id
int32
0
25.3k
idx
stringlengths
5
9
nl_tokens
sequence
pl_tokens
sequence
300
all-301
[ "SetStart", "sets", "the", "current", "scroll", "position", ".", "Values", "out", "of", "bounds", "will", "be", "clamped", "." ]
[ "func", "(", "l", "*", "List", ")", "SetStart", "(", "i", "int", ")", "{", "if", "i", "<", "0", "{", "i", "=", "0", "\n", "}", "\n", "if", "i", ">", "l", ".", "cursor", "{", "l", ".", "start", "=", "l", ".", "cursor", "\n", "}", "else", "{", "l", ".", "<mask>", "=", "i", "\n", "}", "\n", "}" ]
301
all-302
[ "Unescape", "returns", "the", "unescaped", "string", "." ]
[ "func", "Unescape", "(", "s", "string", ")", "string", "{", "if", "len", "(", "s", ")", "==", "0", "{", "return", "\"", "\"", "\n", "}", "\n\n", "var", "ret", "string", "\n", "<mask>", "rw", "int", "\n", "for", "i", ":=", "0", ";", "i", "<", "len", "(", "s", ")", ";", "i", "+=", "rw", "{", "v", ",", "width", ":=", "utf8", ".", "DecodeRuneInString", "(", "s", "[", "i", ":", "]", ")", "\n", "if", "v", "==", "'\\x1b'", "{", "_", ",", "skip", ",", "err", ":=", "DecodeColor", "(", "s", "[", "i", ":", "]", ")", "\n", "if", "err", "==", "nil", "{", "rw", "=", "skip", "\n", "continue", "\n\n", "}", "\n", "}", "\n", "ret", "+=", "string", "(", "v", ")", "\n", "rw", "=", "width", "\n", "}", "\n\n", "return", "ret", "\n", "}" ]
302
all-303
[ "Range", "extracts", "a", "selection", "of", "elements", "from", "the", "array", "provided", "inclusive" ]
[ "func", "Range", "(", "from", ",", "to", "int", ")", "OpFunc", "{", "return", "func", "(", "in", "[", "]", "byte", ")", "(", "[", "]", "<mask>", ",", "error", ")", "{", "return", "scanner", ".", "FindRange", "(", "in", ",", "0", ",", "from", ",", "to", ")", "\n", "}", "\n", "}" ]
303
all-304
[ "RemoteAddr", "returns", "more", "real", "IP", "address", "." ]
[ "func", "(", "ctx", "*", "<mask>", ")", "RemoteAddr", "(", ")", "string", "{", "addr", ":=", "ctx", ".", "Req", ".", "Header", ".", "Get", "(", "\"", "\"", ")", "\n", "if", "len", "(", "addr", ")", "==", "0", "{", "addr", "=", "ctx", ".", "Req", ".", "Header", ".", "Get", "(", "\"", "\"", ")", "\n", "if", "addr", "==", "\"", "\"", "{", "addr", "=", "ctx", ".", "Req", ".", "RemoteAddr", "\n", "if", "i", ":=", "strings", ".", "LastIndex", "(", "addr", ",", "\"", "\"", ")", ";", "i", ">", "-", "1", "{", "addr", "=", "addr", "[", ":", "i", "]", "\n", "}", "\n", "}", "\n", "}", "\n", "return", "addr", "\n", "}" ]
304
all-305
[ "SetMaxTime", "constrains", "the", "query", "to", "stop", "after", "running", "for", "the", "specified", "time", ".", "When", "the", "time", "limit", "is", "reached", "MongoDB", "automatically", "cancels", "the", "query", ".", "This", "can", "be", "used", "to", "efficiently", "prevent", "and", "identify", "unexpectedly", "slow", "queries", ".", "A", "few", "important", "notes", "about", "the", "mechanism", "enforcing", "this", "limit", ":", "-", "Requests", "can", "block", "behind", "locking", "operations", "on", "the", "server", "and", "that", "blocking", "time", "is", "not", "accounted", "for", ".", "In", "other", "words", "the", "timer", "starts", "ticking", "only", "after", "the", "actual", "start", "of", "the", "query", "when", "it", "initially", "acquires", "the", "appropriate", "lock", ";", "-", "Operations", "are", "interrupted", "only", "at", "interrupt", "points", "where", "an", "operation", "can", "be", "safely", "aborted", "–", "the", "total", "execution", "time", "may", "exceed", "the", "specified", "value", ";", "-", "The", "limit", "can", "be", "applied", "to", "both", "CRUD", "operations", "and", "commands", "but", "not", "all", "commands", "are", "interruptible", ";", "-", "While", "iterating", "over", "results", "computing", "follow", "up", "batches", "is", "included", "in", "the", "total", "time", "and", "the", "iteration", "continues", "until", "the", "alloted", "time", "is", "over", "but", "network", "roundtrips", "are", "not", "taken", "into", "account", "for", "the", "limit", ".", "-", "This", "limit", "does", "not", "override", "the", "inactive", "cursor", "timeout", "for", "idle", "cursors", "(", "default", "is", "10", "min", ")", ".", "This", "mechanism", "was", "introduced", "in", "MongoDB", "2", ".", "6", ".", "Relevant", "documentation", ":", "http", ":", "//", "blog", ".", "mongodb", ".", "org", "/", "post", "/", "83621787773", "/", "maxtimems", "-", "and", "-", "query", "-", "optimizer", "-", "introspection", "-", "in" ]
[ "func", "(", "q", "*", "Query", ")", "SetMaxTime", "(", "d", "time", ".", "Duration", ")", "*", "Query", "{", "q", ".", "m", ".", "Lock", "(", ")", "\n", "q", ".", "op", ".", "<mask>", ".", "MaxTimeMS", "=", "int", "(", "d", "/", "time", ".", "Millisecond", ")", "\n", "q", ".", "op", ".", "hasOptions", "=", "true", "\n", "q", ".", "m", ".", "Unlock", "(", ")", "\n", "return", "q", "\n", "}" ]
305
all-306
[ "UnmarshalJSON", "supports", "json", ".", "Unmarshaler", "interface" ]
[ "func", "(", "v", "*", "SearchInContentParams", ")", "UnmarshalJSON", "(", "data", "[", "]", "byte", ")", "error", "{", "r", ":=", "jlexer", ".", "Lexer", "{", "Data", ":", "data", "}", "\n", "easyjsonC5a4559bDecodeGithubComChromedpCdprotoDebugger21", "(", "&", "r", ",", "v", ")", "\n", "return", "r", ".", "<mask>", "(", ")", "\n", "}" ]
306
all-307
[ "GetState", "returns", "the", "State", "field", "if", "non", "-", "nil", "zero", "value", "otherwise", "." ]
[ "func", "(", "a", "*", "Alert", ")", "GetState", "(", ")", "string", "{", "if", "a", "==", "nil", "||", "a", ".", "State", "==", "nil", "{", "<mask>", "\"", "\"", "\n", "}", "\n", "return", "*", "a", ".", "State", "\n", "}" ]
307
all-308
[ "makeRequest", "creates", "and", "executes", "a", "http", ".", "Request", "with", "the", "specified", "parameters", "adding", "authentication", "and", "TLS", "options", "for", "the", "Docker", "client", ".", "The", "host", "name", "and", "schema", "is", "taken", "from", "the", "client", "or", "autodetected", "and", "the", "path", "is", "relative", "to", "it", "i", ".", "e", ".", "the", "path", "usually", "starts", "with", "/", "v2", "/", "." ]
[ "func", "(", "c", "*", "dockerClient", ")", "makeRequest", "(", "ctx", "context", ".", "Context", ",", "method", ",", "path", "string", ",", "headers", "map", "[", "string", "]", "[", "]", "string", ",", "stream", "io", ".", "Reader", ",", "auth", "sendAuth", ",", "extraScope", "*", "authScope", ")", "(", "*", "http", ".", "Response", ",", "error", ")", "{", "if", "err", ":=", "c", ".", "detectProperties", "(", "ctx", ")", ";", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "url", ":=", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "c", ".", "scheme", ",", "c", ".", "registry", ",", "path", ")", "\n", "return", "c", ".", "makeRequestToResolvedURL", "(", "ctx", ",", "method", ",", "url", ",", "<mask>", ",", "stream", ",", "-", "1", ",", "auth", ",", "extraScope", ")", "\n", "}" ]
308
all-309
[ "WithBody", "adds", "the", "body", "to", "the", "update", "Vm", "params" ]
[ "func", "(", "o", "*", "UpdateVMParams", ")", "WithBody", "(", "body", "*", "<mask>", ".", "VM", ")", "*", "UpdateVMParams", "{", "o", ".", "SetBody", "(", "body", ")", "\n", "return", "o", "\n", "}" ]
309
all-310
[ "Locator", "returns", "a", "locator", "for", "the", "given", "resource" ]
[ "func", "(", "r", "*", "ServerTemplate", ")", "Locator", "(", "api", "*", "API", ")", "*", "ServerTemplateLocator", "{", "<mask>", "api", ".", "ServerTemplateLocator", "(", "r", ".", "Href", ")", "\n", "}" ]
310
all-311
[ "String", "returns", "the", "name", "of", "e" ]
[ "func", "(", "e", "AllowTrustResultCode", ")", "String", "(", ")", "string", "{", "name", ",", "_", ":=", "allowTrustResultCodeMap", "[", "int32", "(", "e", ")", "]", "\n", "return", "<mask>", "\n", "}" ]
311
all-312
[ "Delete", "mocks", "base", "method" ]
[ "func", "(", "m", "*", "MockCache", ")", "Delete", "(", "arg0", "<mask>", ")", "{", "m", ".", "ctrl", ".", "Call", "(", "m", ",", "\"", "\"", ",", "arg0", ")", "\n", "}" ]
312
all-313
[ "GetCreatedOk", "returns", "a", "tuple", "with", "the", "Created", "field", "if", "it", "s", "non", "-", "nil", "zero", "value", "otherwise", "and", "a", "boolean", "to", "check", "if", "the", "value", "has", "been", "set", "." ]
[ "func", "(", "a", "*", "APIKey", ")", "GetCreatedOk", "(", ")", "(", "time", ".", "Time", ",", "bool", ")", "{", "if", "a", "==", "nil", "||", "a", ".", "Created", "==", "nil", "{", "return", "time", ".", "Time", "{", "}", ",", "<mask>", "\n", "}", "\n", "return", "*", "a", ".", "Created", ",", "true", "\n", "}" ]
313
all-314
[ "Finish", "belongs", "to", "the", "Span", "interface" ]
[ "func", "(", "s", "*", "MockSpan", ")", "Finish", "(", ")", "{", "s", ".", "Lock", "(", ")", "\n", "s", ".", "FinishTime", "=", "<mask>", ".", "Now", "(", ")", "\n", "s", ".", "Unlock", "(", ")", "\n", "s", ".", "tracer", ".", "recordSpan", "(", "s", ")", "\n", "}" ]
314
all-315
[ "title", ":", "deploy", "info", "path", ":", "/", "deploys", "/", "{", "deploy", "}", "method", ":", "GET", "produce", ":", "application", "/", "json", "responses", ":", "200", ":", "OK", "401", ":", "Unauthorized", "404", ":", "Not", "found" ]
[ "func", "deployInfo", "(", "w", "http", ".", "ResponseWriter", ",", "r", "*", "http", ".", "Request", ",", "t", "auth", ".", "Token", ")", "error", "{", "depID", ":=", "r", ".", "URL", ".", "Query", "(", ")", ".", "Get", "(", "\"", "\"", ")", "\n", "deploy", ",", "err", ":=", "app", ".", "GetDeploy", "(", "depID", ")", "\n", "if", "err", "!=", "nil", "{", "if", "err", "==", "event", ".", "ErrEventNotFound", "{", "return", "&", "tsuruErrors", ".", "HTTP", "{", "Code", ":", "<mask>", ".", "StatusNotFound", ",", "Message", ":", "\"", "\"", "}", "\n", "}", "\n", "return", "err", "\n", "}", "\n", "dbApp", ",", "err", ":=", "app", ".", "GetByName", "(", "deploy", ".", "App", ")", "\n", "if", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n", "canGet", ":=", "permission", ".", "Check", "(", "t", ",", "permission", ".", "PermAppReadDeploy", ",", "contextsForApp", "(", "dbApp", ")", "...", ")", "\n", "if", "!", "canGet", "{", "return", "&", "tsuruErrors", ".", "HTTP", "{", "Code", ":", "http", ".", "StatusNotFound", ",", "Message", ":", "\"", "\"", "}", "\n", "}", "\n", "w", ".", "Header", "(", ")", ".", "Add", "(", "\"", "\"", ",", "\"", "\"", ")", "\n", "return", "json", ".", "NewEncoder", "(", "w", ")", ".", "Encode", "(", "deploy", ")", "\n", "}" ]
315
all-316
[ "UnmarshalJSON", "supports", "json", ".", "Unmarshaler", "interface" ]
[ "func", "(", "v", "*", "DiscardSearchResultsParams", ")", "UnmarshalJSON", "(", "data", "[", "]", "byte", ")", "error", "{", "r", ":=", "jlexer", ".", "Lexer", "{", "Data", ":", "data", "}", "\n", "easyjsonC5a4559bDecodeGithubComChromedpCdprotoDom70", "(", "&", "r", ",", "v", ")", "\n", "return", "r", ".", "<mask>", "(", ")", "\n", "}" ]
316
all-317
[ "NewDecoder", "returns", "a", "new", "decoder", "that", "takes", "input", "from", "r", "." ]
[ "func", "(", "c", "Codec", ")", "NewDecoder", "(", "r", "<mask>", ".", "Reader", ")", "*", "Decoder", "{", "return", "NewDecoder", "(", "c", ".", "NewParser", "(", "r", ")", ")", "\n", "}" ]
317
all-318
[ "HasNodeType", "returns", "a", "boolean", "if", "a", "field", "has", "been", "set", "." ]
[ "func", "(", "h", "*", "HostmapDefinition", ")", "HasNodeType", "(", ")", "bool", "{", "if", "h", "!=", "nil", "&&", "h", ".", "NodeType", "!=", "nil", "{", "return", "<mask>", "\n", "}", "\n\n", "return", "false", "\n", "}" ]
318
all-319
[ "printLicense", "prints", "the", "Agent", "s", "license", "text" ]
[ "func", "printLicense", "(", ")", "int", "{", "license", ":=", "utils", ".", "NewLicenseProvider", "(", ")", "\n", "<mask>", ",", "err", ":=", "license", ".", "GetText", "(", ")", "\n", "if", "err", "!=", "nil", "{", "fmt", ".", "Fprintln", "(", "os", ".", "Stderr", ",", "err", ")", "\n", "return", "exitcodes", ".", "ExitError", "\n", "}", "\n", "fmt", ".", "Println", "(", "text", ")", "\n", "return", "exitcodes", ".", "ExitSuccess", "\n", "}" ]
319
all-320
[ "defaultArguments", "will", "append", "each", "arg", "to", "the", "template", "except", "where", "the", "argument", "name", "is", "already", "defined", "." ]
[ "func", "defaultArguments", "(", "t", "*", "buildv1alpha1", ".", "TemplateInstantiationSpec", ",", "rawEnv", "map", "[", "string", "]", "string", ")", "{", "keys", ":=", "sets", ".", "String", "{", "}", "\n", "for", "_", ",", "arg", ":=", "range", "t", ".", "Arguments", "{", "keys", ".", "Insert", "(", "arg", ".", "Name", ")", "\n", "}", "\n", "for", "_", ",", "k", ":=", "range", "sets", ".", "StringKeySet", "(", "rawEnv", ")", ".", "List", "(", ")", "{", "// deterministic ordering", "if", "<mask>", ".", "Has", "(", "k", ")", "{", "continue", "\n", "}", "\n", "t", ".", "Arguments", "=", "append", "(", "t", ".", "Arguments", ",", "buildv1alpha1", ".", "ArgumentSpec", "{", "Name", ":", "k", ",", "Value", ":", "rawEnv", "[", "k", "]", "}", ")", "\n", "}", "\n", "}" ]
320
all-321
[ "HasAccount", "returns", "a", "boolean", "if", "a", "field", "has", "been", "set", "." ]
[ "func", "(", "c", "*", "ChannelSlackRequest", ")", "HasAccount", "(", ")", "bool", "{", "if", "c", "!=", "nil", "&&", "c", ".", "Account", "!=", "nil", "{", "return", "<mask>", "\n", "}", "\n\n", "return", "false", "\n", "}" ]
321
all-322
[ "ParseCommandAndFlags", "parses", "a", "command", "flag", "and", "infers", "the", "resource", "action", "href", "and", "params", "." ]
[ "func", "(", "a", "*", "API", ")", "ParseCommandAndFlags", "(", "cmd", ",", "hrefPrefix", "string", ",", "values", "ActionCommands", ")", "(", "*", "CommandTarget", ",", "[", "]", "string", ",", "error", ")", "{", "resource", ",", "vars", ",", "err", ":=", "a", ".", "parseResource", "(", "cmd", ",", "hrefPrefix", ",", "values", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "nil", ",", "err", "\n", "}", "\n", "var", "action", "*", "<mask>", ".", "Action", "\n", "elems", ":=", "strings", ".", "Split", "(", "cmd", ",", "\"", "\"", ")", "\n", "actionName", ":=", "elems", "[", "len", "(", "elems", ")", "-", "1", "]", "\n", "for", "_", ",", "a", ":=", "range", "resource", ".", "Actions", "{", "if", "a", ".", "Name", "==", "actionName", "{", "action", "=", "a", "\n", "break", "\n", "}", "\n", "}", "\n", "if", "action", "==", "nil", "{", "supported", ":=", "make", "(", "[", "]", "string", ",", "len", "(", "resource", ".", "Actions", ")", ")", "\n", "for", "i", ",", "a", ":=", "range", "resource", ".", "Actions", "{", "supported", "[", "i", "]", "=", "a", ".", "Name", "\n", "}", "\n", "return", "nil", ",", "nil", ",", "fmt", ".", "Errorf", "(", "\"", "\"", ",", "resource", ".", "Name", ",", "actionName", ",", "strings", ".", "Join", "(", "supported", ",", "\"", "\"", ")", ")", "\n", "}", "\n\n", "path", ",", "err", ":=", "action", ".", "URL", "(", "vars", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "nil", ",", "err", "\n", "}", "\n", "flags", ":=", "values", "[", "cmd", "]", "\n\n", "return", "&", "CommandTarget", "{", "resource", ",", "action", ",", "path", ",", "flags", ".", "Href", "}", ",", "flags", ".", "Params", ",", "nil", "\n", "}" ]
322
all-323
[ "GetText", "is", "a", "wrapper", "around", "gtk_text_iter_get_text", "()", "." ]
[ "func", "(", "v", "*", "TextIter", ")", "GetText", "(", "end", "*", "TextIter", ")", "string", "{", "c", ":=", "C", ".", "gtk_text_iter_get_text", "(", "v", ".", "native", "(", ")", ",", "end", ".", "native", "(", ")", ")", "\n", "return", "C", ".", "GoString", "(", "(", "*", "C", ".", "<mask>", ")", "(", "c", ")", ")", "\n", "}" ]
323
all-324
[ "String", "is", "the", "string", "representation", "of", "this", "authentication", ".", "If", "authentication", "is", "not", "enabled", "this", "returns", "the", "empty", "string", ".", "The", "username", "and", "password", "will", "be", "separated", "by", "a", "colon", "." ]
[ "func", "(", "c", "*", "AuthConfig", ")", "<mask>", "(", ")", "string", "{", "if", "!", "BoolVal", "(", "c", ".", "Enabled", ")", "{", "return", "\"", "\"", "\n", "}", "\n\n", "if", "c", ".", "Password", "!=", "nil", "{", "return", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "StringVal", "(", "c", ".", "Username", ")", ",", "StringVal", "(", "c", ".", "Password", ")", ")", "\n", "}", "\n\n", "return", "StringVal", "(", "c", ".", "Username", ")", "\n", "}" ]
324
all-325
[ "DefaultConfig", "returns", "the", "default", "configuration", "for", "Windows" ]
[ "func", "DefaultConfig", "(", ")", "Config", "{", "programData", ":=", "utils", ".", "DefaultIfBlank", "(", "os", ".", "Getenv", "(", "\"", "\"", ")", ",", "`C:\\ProgramData`", ")", "\n", "ecsRoot", ":=", "filepath", ".", "Join", "(", "programData", ",", "\"", "\"", ",", "\"", "\"", ")", "\n", "dataDir", ":=", "filepath", ".", "Join", "(", "ecsRoot", ",", "\"", "\"", ")", "\n", "platformVariables", ":=", "PlatformVariables", "{", "CPUUnbounded", ":", "false", ",", "}", "\n", "return", "Config", "{", "DockerEndpoint", ":", "\"", "\"", ",", "ReservedPorts", ":", "[", "]", "uint16", "{", "DockerReservedPort", ",", "DockerReservedSSLPort", ",", "AgentIntrospectionPort", ",", "AgentCredentialsPort", ",", "rdpPort", ",", "rpcPort", ",", "smbPort", ",", "winRMPortHTTP", ",", "winRMPortHTTPS", ",", "dnsPort", ",", "netBIOSPort", ",", "}", ",", "ReservedPortsUDP", ":", "[", "]", "uint16", "{", "}", ",", "DataDir", ":", "dataDir", ",", "// DataDirOnHost is identical to DataDir for Windows because we do not", "// run as a container", "DataDirOnHost", ":", "dataDir", ",", "ReservedMemory", ":", "0", ",", "AvailableLoggingDrivers", ":", "[", "]", "dockerclient", ".", "LoggingDriver", "{", "dockerclient", ".", "JSONFileDriver", ",", "dockerclient", ".", "NoneDriver", ",", "dockerclient", ".", "AWSLogsDriver", "}", ",", "TaskCleanupWaitDuration", ":", "DefaultTaskCleanupWaitDuration", ",", "DockerStopTimeout", ":", "defaultDockerStopTimeout", ",", "ContainerStartTimeout", ":", "defaultContainerStartTimeout", ",", "ImagePullInactivityTimeout", ":", "defaultImagePullInactivityTimeout", ",", "CredentialsAuditLogFile", ":", "filepath", ".", "Join", "(", "ecsRoot", ",", "defaultCredentialsAuditLogFile", ")", ",", "CredentialsAuditLogDisabled", ":", "<mask>", ",", "ImageCleanupDisabled", ":", "false", ",", "MinimumImageDeletionAge", ":", "DefaultImageDeletionAge", ",", "ImageCleanupInterval", ":", "DefaultImageCleanupTimeInterval", ",", "NumImagesToDeletePerCycle", ":", "DefaultNumImagesToDeletePerCycle", ",", "NumNonECSContainersToDeletePerCycle", ":", "DefaultNumNonECSContainersToDeletePerCycle", ",", "ContainerMetadataEnabled", ":", "false", ",", "TaskCPUMemLimit", ":", "ExplicitlyDisabled", ",", "PlatformVariables", ":", "platformVariables", ",", "TaskMetadataSteadyStateRate", ":", "DefaultTaskMetadataSteadyStateRate", ",", "TaskMetadataBurstRate", ":", "DefaultTaskMetadataBurstRate", ",", "SharedVolumeMatchFullConfig", ":", "false", ",", "//only requiring shared volumes to match on name, which is default docker behavior", "PollMetrics", ":", "false", ",", "PollingMetricsWaitDuration", ":", "DefaultPollingMetricsWaitDuration", ",", "}", "\n", "}" ]
325
all-326
[ "parseGShadow", "parses", "the", "row", "of", "a", "group", "shadow", "." ]
[ "func", "parseGShadow", "(", "row", "string", ")", "(", "*", "GShadow", ",", "error", ")", "{", "fields", ":=", "strings", ".", "Split", "(", "row", ",", "\"", "\"", ")", "\n", "if", "len", "(", "<mask>", ")", "!=", "4", "{", "return", "nil", ",", "rowError", "{", "_GSHADOW_FILE", ",", "row", "}", "\n", "}", "\n\n", "return", "&", "GShadow", "{", "fields", "[", "0", "]", ",", "fields", "[", "1", "]", ",", "strings", ".", "Split", "(", "fields", "[", "2", "]", ",", "\"", "\"", ")", ",", "strings", ".", "Split", "(", "fields", "[", "3", "]", ",", "\"", "\"", ")", ",", "}", ",", "nil", "\n", "}" ]
326
all-327
[ "MarshalJSON", "implements", "json", ".", "Marshaler", "and", "adds", "the", "jsonrpc", ":", "2", ".", "0", "property", "." ]
[ "func", "(", "r", "Request", ")", "MarshalJSON", "(", ")", "(", "[", "]", "byte", ",", "error", ")", "{", "r2", ":=", "struct", "{", "Method", "string", "`json:\"method\"`", "\n", "Params", "*", "json", ".", "RawMessage", "`json:\"params,omitempty\"`", "\n", "ID", "*", "<mask>", "`json:\"id,omitempty\"`", "\n", "Meta", "*", "json", ".", "RawMessage", "`json:\"meta,omitempty\"`", "\n", "JSONRPC", "string", "`json:\"jsonrpc\"`", "\n", "}", "{", "Method", ":", "r", ".", "Method", ",", "Params", ":", "r", ".", "Params", ",", "Meta", ":", "r", ".", "Meta", ",", "JSONRPC", ":", "\"", "\"", ",", "}", "\n", "if", "!", "r", ".", "Notif", "{", "r2", ".", "ID", "=", "&", "r", ".", "ID", "\n", "}", "\n", "return", "json", ".", "Marshal", "(", "r2", ")", "\n", "}" ]
327
all-328
[ "String", "returns", "the", "name", "of", "e" ]
[ "func", "(", "e", "ManageOfferEffect", ")", "String", "(", ")", "string", "{", "name", ",", "_", ":=", "manageOfferEffectMap", "[", "int32", "(", "e", ")", "]", "\n", "return", "<mask>", "\n", "}" ]
328
all-329
[ "Vec2Sub", "performs", "a", "vector", "subtraction", ".", "dest", "=", "v1", "-", "v2", ".", "dest", "[", "out", "]", "The", "result", "vector", ".", "v1", "[", "in", "]", "The", "base", "vector", ".", "v2", "[", "in", "]", "The", "vector", "to", "subtract", "from", "v1", "." ]
[ "func", "Vec2Sub", "(", "dest", ",", "v1", ",", "v2", "Vec2", ")", "{", "dest", "[", "0", "]", "=", "v1", "[", "0", "]", "-", "v2", "[", "0", "]", "\n", "<mask>", "[", "1", "]", "=", "v1", "[", "1", "]", "-", "v2", "[", "1", "]", "\n", "}" ]
329
all-330
[ "UnmarshalJSON", "supports", "json", ".", "Unmarshaler", "interface" ]
[ "func", "(", "v", "*", "EventWebSocketClosed", ")", "UnmarshalJSON", "(", "data", "[", "]", "byte", ")", "error", "{", "r", ":=", "jlexer", ".", "Lexer", "{", "Data", ":", "data", "}", "\n", "easyjsonC5a4559bDecodeGithubComChromedpCdprotoNetwork46", "(", "&", "r", ",", "v", ")", "\n", "return", "r", ".", "<mask>", "(", ")", "\n", "}" ]
330
all-331
[ "execute", "a", "list", "of", "display", "lists" ]
[ "func", "CallLists", "(", "n", "int32", ",", "xtype", "uint32", ",", "<mask>", "unsafe", ".", "Pointer", ")", "{", "syscall", ".", "Syscall", "(", "gpCallLists", ",", "3", ",", "uintptr", "(", "n", ")", ",", "uintptr", "(", "xtype", ")", ",", "uintptr", "(", "lists", ")", ")", "\n", "}" ]
331
all-332
[ "readPropertyFile", "opens", "the", "configuration", "file", "and", "creates", "configuration", "struct", "with", "all", "the", "key", "/", "value", "pair", "info", ".", "It", "ignores", "any", "line", "that", "begins", "with", "#", "and", "silently", "ignores", "line", "without", "correct", "key", "/", "value", "pair", "format", "." ]
[ "func", "readPropertyFile", "(", "fi", "<mask>", ".", "FileInfo", ",", "cfpath", "string", ")", "(", "configFile", ",", "error", ")", "{", "cf", ":=", "configFile", "{", "fileInfo", ":", "fi", ",", "configs", ":", "make", "(", "map", "[", "string", "]", "interface", "{", "}", ")", "}", "\n\n", "f", ",", "err", ":=", "os", ".", "Open", "(", "cfpath", ")", "\n", "if", "err", "!=", "nil", "{", "return", "configFile", "{", "}", ",", "err", "\n", "}", "\n", "defer", "f", ".", "Close", "(", ")", "\n\n", "sc", ":=", "bufio", ".", "NewScanner", "(", "f", ")", "\n", "sc", ".", "Split", "(", "bufio", ".", "ScanLines", ")", "\n", "for", "sc", ".", "Scan", "(", ")", "{", "l", ":=", "sc", ".", "Text", "(", ")", "\n", "kv", ":=", "s", ".", "Split", "(", "l", ",", "\"", "\"", ")", "\n", "if", "len", "(", "kv", ")", "<", "2", "{", "continue", "\n", "}", "else", "if", "len", "(", "kv", ")", "==", "2", "{", "cf", ".", "addProperty", "(", "kv", "[", "0", "]", ",", "kv", "[", "1", "]", ")", "\n", "}", "else", "{", "//= after first is all part of the value", "pv", ":=", "s", ".", "Replace", "(", "l", ",", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "kv", "[", "0", "]", ")", ",", "\"", "\"", ",", "-", "1", ")", "\n", "cf", ".", "addProperty", "(", "kv", "[", "0", "]", ",", "pv", ")", "\n", "}", "\n", "}", "\n\n", "return", "cf", ",", "nil", "\n", "}" ]
332
all-333
[ "NewService", "creates", "a", "new", "MessageService", "with", "default", "settings", ".", "Named", "Arguments", "allowed", ":", "--", "consumer", "--", "provider", "--", "pact", "-", "dir" ]
[ "func", "(", "v", "*", "MessageService", ")", "NewService", "(", "args", "[", "]", "string", ")", "Service", "{", "v", ".", "Args", "=", "args", "\n\n", "<mask>", ".", "Printf", "(", "\"", "\\n", "\"", ",", "v", ".", "Args", ")", "\n", "v", ".", "Cmd", "=", "\"", "\"", "\n\n", "return", "v", "\n", "}" ]
333
all-334
[ "CreateFirewallRule", "creates", "a", "firewall", "rule" ]
[ "func", "(", "c", "*", "<mask>", ")", "CreateFirewallRule", "(", "dcID", "string", ",", "serverID", "string", ",", "nicID", "string", ",", "fw", "FirewallRule", ")", "(", "*", "FirewallRule", ",", "error", ")", "{", "url", ":=", "fwruleColPath", "(", "dcID", ",", "serverID", ",", "nicID", ")", "+", "`?depth=`", "+", "c", ".", "client", ".", "depth", "+", "`&pretty=`", "+", "strconv", ".", "FormatBool", "(", "c", ".", "client", ".", "pretty", ")", "\n", "ret", ":=", "&", "FirewallRule", "{", "}", "\n", "err", ":=", "c", ".", "client", ".", "Post", "(", "url", ",", "fw", ",", "ret", ",", "http", ".", "StatusAccepted", ")", "\n", "return", "ret", ",", "err", "\n", "}" ]
334
all-335
[ "Equal", "-", "define", "task", "equality" ]
[ "func", "(", "s", "Task", ")", "Equal", "(", "b", "<mask>", ")", "bool", "{", "return", "(", "s", ".", "ID", "==", "b", ".", "ID", "&&", "s", ".", "Timestamp", "==", "b", ".", "Timestamp", "&&", "s", ".", "Expires", "==", "b", ".", "Expires", "&&", "s", ".", "Status", "==", "b", ".", "Status", "&&", "s", ".", "Profile", "==", "b", ".", "Profile", "&&", "s", ".", "CallerName", "==", "b", ".", "CallerName", ")", "\n", "}" ]
335
all-336
[ "Add", "adds", "a", "new", "job", "to", "the", "job", "queue", "(", "optionally", "within", "a", "given", "transaction", ")", "." ]
[ "func", "(", "q", "*", "queue", ")", "Add", "(", "tx", "*", "reform", ".", "TX", ",", "j", "*", "data", ".", "Job", ")", "error", "{", "logger", ":=", "q", ".", "logger", ".", "Add", "(", "\"", "\"", ",", "\"", "\"", ",", "\"", "\"", ",", "j", ")", "\n", "tconf", ":=", "q", ".", "typeConfig", "(", "j", ")", "\n", "if", "!", "tconf", ".", "Duplicated", "{", "if", "err", ":=", "q", ".", "checkDuplicated", "(", "j", ",", "logger", ")", ";", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n", "}", "\n", "if", "tconf", ".", "FirstStartDelay", ">", "0", "{", "j", ".", "NotBefore", "=", "time", ".", "Now", "(", ")", ".", "Add", "(", "time", ".", "Duration", "(", "tconf", ".", "FirstStartDelay", ")", "*", "<mask>", ".", "Millisecond", ")", "\n", "}", "\n\n", "j", ".", "ID", "=", "util", ".", "NewUUID", "(", ")", "\n", "j", ".", "Status", "=", "data", ".", "JobActive", "\n", "j", ".", "CreatedAt", "=", "time", ".", "Now", "(", ")", "\n\n", "db", ":=", "q", ".", "db", ".", "Querier", "\n", "if", "tx", "!=", "nil", "{", "db", "=", "tx", ".", "Querier", "\n", "}", "\n\n", "if", "err", ":=", "db", ".", "Insert", "(", "j", ")", ";", "err", "!=", "nil", "{", "logger", ".", "Error", "(", "err", ".", "Error", "(", ")", ")", "\n", "return", "ErrInternal", "\n", "}", "\n\n", "return", "nil", "\n", "}" ]
336
all-337
[ "NewSnapshot", "creates", "a", "new", "Nitro", "snapshot", ".", "This", "is", "a", "thread", "-", "unsafe", "API", ".", "While", "this", "API", "is", "invoked", "no", "other", "Nitro", "writer", "should", "concurrently", "call", "any", "public", "APIs", "such", "as", "Put", "*", "()", "and", "Delete", "*", "()", "." ]
[ "func", "(", "m", "*", "Nitro", ")", "NewSnapshot", "(", ")", "(", "*", "Snapshot", ",", "error", ")", "{", "buf", ":=", "m", ".", "snapshots", ".", "MakeBuf", "(", ")", "\n", "defer", "m", ".", "snapshots", ".", "FreeBuf", "(", "buf", ")", "\n\n", "// Stitch all local gclists from all writers to create snapshot gclist", "var", "head", ",", "tail", "*", "skiplist", ".", "Node", "\n\n", "for", "w", ":=", "m", ".", "wlist", ";", "w", "!=", "nil", ";", "w", "=", "w", ".", "next", "{", "if", "tail", "==", "nil", "{", "head", "=", "w", ".", "gchead", "\n", "tail", "=", "w", ".", "gctail", "\n", "}", "else", "if", "w", ".", "gchead", "!=", "nil", "{", "tail", ".", "GClink", "=", "w", ".", "gchead", "\n", "tail", "=", "w", ".", "gctail", "\n", "}", "\n\n", "w", ".", "gchead", "=", "nil", "\n", "w", ".", "gctail", "=", "nil", "\n\n", "// Update global stats", "m", ".", "<mask>", ".", "Stats", ".", "Merge", "(", "&", "w", ".", "slSts1", ")", "\n", "atomic", ".", "AddInt64", "(", "&", "m", ".", "itemsCount", ",", "w", ".", "count", ")", "\n", "w", ".", "count", "=", "0", "\n", "}", "\n\n", "snap", ":=", "&", "Snapshot", "{", "db", ":", "m", ",", "sn", ":", "m", ".", "getCurrSn", "(", ")", ",", "refCount", ":", "1", ",", "count", ":", "m", ".", "ItemsCount", "(", ")", "}", "\n", "m", ".", "snapshots", ".", "Insert", "(", "unsafe", ".", "Pointer", "(", "snap", ")", ",", "CompareSnapshot", ",", "buf", ",", "&", "m", ".", "snapshots", ".", "Stats", ")", "\n", "snap", ".", "gclist", "=", "head", "\n", "newSn", ":=", "atomic", ".", "AddUint32", "(", "&", "m", ".", "currSn", ",", "1", ")", "\n", "if", "newSn", "==", "math", ".", "MaxUint32", "{", "return", "nil", ",", "ErrMaxSnapshotsLimitReached", "\n", "}", "\n\n", "return", "snap", ",", "nil", "\n", "}" ]
337
all-338
[ "ServeFileUncompressed", "returns", "HTTP", "response", "containing", "file", "contents", "from", "the", "given", "path", ".", "Directory", "contents", "is", "returned", "if", "path", "points", "to", "directory", ".", "ServeFile", "may", "be", "used", "for", "saving", "network", "traffic", "when", "serving", "files", "with", "good", "compression", "ratio", ".", "See", "also", "RequestCtx", ".", "SendFile", "." ]
[ "func", "ServeFileUncompressed", "(", "ctx", "*", "RequestCtx", ",", "path", "string", ")", "{", "ctx", ".", "Request", ".", "Header", ".", "DelBytes", "(", "strAcceptEncoding", ")", "\n", "ServeFile", "(", "ctx", ",", "<mask>", ")", "\n", "}" ]
338
all-339
[ "newPubSub", "returns", "a", "PubSub", "receiver", ".", "Optionally", "accepts", "a", "client", "to", "allow", "for", "injecting", "the", "fake", "for", "tests", ".", "If", "client", "is", "nil", "a", "real", "client", "connection", "to", "the", "google", "pubsub", "service", "will", "be", "attempted", "." ]
[ "func", "newPubSub", "(", "client", "*", "pubsub", ".", "Client", ",", "name", "string", ",", "options", "*", "Options", ",", "store", "func", "(", "*", "points", ".", "Points", ")", ")", "(", "*", "PubSub", ",", "error", ")", "{", "logger", ":=", "zapwriter", ".", "Logger", "(", "name", ")", "\n", "logger", ".", "Info", "(", "\"", "\"", ",", "zap", ".", "<mask>", "(", "\"", "\"", ",", "options", ".", "Project", ")", ",", "zap", ".", "String", "(", "\"", "\"", ",", "options", ".", "Subscription", ")", ",", ")", "\n\n", "if", "options", ".", "Project", "==", "\"", "\"", "{", "return", "nil", ",", "fmt", ".", "Errorf", "(", "\"", "\"", ")", "\n", "}", "\n\n", "ctx", ":=", "context", ".", "Background", "(", ")", "\n", "if", "client", "==", "nil", "{", "c", ",", "err", ":=", "pubsub", ".", "NewClient", "(", "ctx", ",", "options", ".", "Project", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n", "client", "=", "c", "\n", "}", "\n\n", "sub", ":=", "client", ".", "Subscription", "(", "options", ".", "Subscription", ")", "\n", "exists", ",", "err", ":=", "sub", ".", "Exists", "(", "ctx", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n", "if", "!", "exists", "{", "// TODO: try to create subscription", "return", "nil", ",", "fmt", ".", "Errorf", "(", "\"", "\"", ",", "options", ".", "Subscription", ",", "options", ".", "Project", ")", "\n", "}", "\n\n", "if", "options", ".", "ReceiverGoRoutines", "!=", "0", "{", "sub", ".", "ReceiveSettings", ".", "NumGoroutines", "=", "options", ".", "ReceiverGoRoutines", "\n", "}", "\n", "if", "options", ".", "ReceiverMaxBytes", "!=", "0", "{", "sub", ".", "ReceiveSettings", ".", "MaxOutstandingBytes", "=", "options", ".", "ReceiverMaxBytes", "\n", "}", "\n", "if", "options", ".", "ReceiverMaxMessages", "!=", "0", "{", "sub", ".", "ReceiveSettings", ".", "MaxOutstandingMessages", "=", "options", ".", "ReceiverMaxMessages", "\n", "}", "\n\n", "// cancel() will be called to signal the subscription Receive() goroutines to finish and shutdown", "cctx", ",", "cancel", ":=", "context", ".", "WithCancel", "(", "ctx", ")", "\n\n", "rcv", ":=", "&", "PubSub", "{", "out", ":", "store", ",", "name", ":", "name", ",", "client", ":", "client", ",", "cancel", ":", "cancel", ",", "subscription", ":", "sub", ",", "logger", ":", "logger", ",", "closed", ":", "make", "(", "chan", "struct", "{", "}", ")", ",", "}", "\n\n", "// Receive() will create goroutines as necessary to handle incoming messages. Reconnect", "// on error. Stop processing messages only if Stop() is called", "go", "func", "(", ")", "{", "for", "{", "err", ":=", "rcv", ".", "subscription", ".", "Receive", "(", "cctx", ",", "func", "(", "ctx", "context", ".", "Context", ",", "m", "*", "pubsub", ".", "Message", ")", "{", "rcv", ".", "handleMessage", "(", "m", ")", "\n", "m", ".", "Ack", "(", ")", "\n", "}", ")", "\n", "if", "err", "==", "context", ".", "Canceled", "{", "close", "(", "rcv", ".", "closed", ")", "\n", "rcv", ".", "Stop", "(", ")", "\n", "break", "\n", "}", "\n", "if", "err", "!=", "nil", "{", "rcv", ".", "logger", ".", "Error", "(", "err", ".", "Error", "(", ")", ")", "\n", "}", "\n", "time", ".", "Sleep", "(", "1", "*", "time", ".", "Second", ")", "\n", "}", "\n", "}", "(", ")", "\n\n", "return", "rcv", ",", "nil", "\n", "}" ]
339
all-340
[ "flattenStorageDrsSpaceLoadBalanceConfig", "saves", "a", "StorageDrsSpaceLoadBalanceConfig", "into", "the", "supplied", "ResourceData", "." ]
[ "func", "flattenStorageDrsSpaceLoadBalanceConfig", "(", "d", "*", "schema", ".", "ResourceData", ",", "obj", "*", "<mask>", ".", "StorageDrsSpaceLoadBalanceConfig", ",", "version", "viapi", ".", "VSphereVersion", ",", ")", "error", "{", "attrs", ":=", "map", "[", "string", "]", "interface", "{", "}", "{", "\"", "\"", ":", "obj", ".", "MinSpaceUtilizationDifference", ",", "\"", "\"", ":", "obj", ".", "SpaceThresholdMode", ",", "}", "\n\n", "freeSpaceSupported", ":=", "version", ".", "Newer", "(", "viapi", ".", "VSphereVersion", "{", "Product", ":", "version", ".", "Product", ",", "Major", ":", "6", "}", ")", "\n", "if", "freeSpaceSupported", "&&", "obj", ".", "SpaceThresholdMode", "==", "string", "(", "types", ".", "StorageDrsSpaceLoadBalanceConfigSpaceThresholdModeFreeSpace", ")", "{", "attrs", "[", "\"", "\"", "]", "=", "obj", ".", "FreeSpaceThresholdGB", "\n", "}", "else", "{", "attrs", "[", "\"", "\"", "]", "=", "obj", ".", "SpaceUtilizationThreshold", "\n", "}", "\n\n", "for", "k", ",", "v", ":=", "range", "attrs", "{", "if", "err", ":=", "d", ".", "Set", "(", "k", ",", "v", ")", ";", "err", "!=", "nil", "{", "return", "fmt", ".", "Errorf", "(", "\"", "\"", ",", "k", ",", "err", ")", "\n", "}", "\n", "}", "\n\n", "return", "nil", "\n", "}" ]
340
all-341
[ "DisplayOpen", "()", "is", "a", "wrapper", "around", "gdk_display_open", "()", "." ]
[ "func", "DisplayOpen", "(", "displayName", "string", ")", "(", "*", "Display", ",", "error", ")", "{", "cstr", ":=", "C", ".", "CString", "(", "displayName", ")", "\n", "defer", "C", ".", "<mask>", "(", "unsafe", ".", "Pointer", "(", "cstr", ")", ")", "\n", "c", ":=", "C", ".", "gdk_display_open", "(", "(", "*", "C", ".", "gchar", ")", "(", "cstr", ")", ")", "\n", "if", "c", "==", "nil", "{", "return", "nil", ",", "nilPtrErr", "\n", "}", "\n\n", "return", "&", "Display", "{", "glib", ".", "Take", "(", "unsafe", ".", "Pointer", "(", "c", ")", ")", "}", ",", "nil", "\n", "}" ]
341
all-342
[ "IsSuccess", "means", "the", "job", "passed" ]
[ "func", "(", "jb", "*", "Build", ")", "IsSuccess", "(", ")", "bool", "{", "return", "jb", ".", "Result", "!=", "nil", "&&", "*", "jb", ".", "Result", "==", "<mask>", "\n", "}" ]
342
all-343
[ "setTemplate", "sets", "the", "Template", "field", "of", "any", "TemplateParam", "s", "in", "a", ".", "This", "handles", "the", "forward", "referencing", "template", "parameters", "found", "in", "cast", "operators", "." ]
[ "func", "(", "st", "*", "state", ")", "setTemplate", "(", "a", "AST", ",", "tmpl", "*", "Template", ")", "{", "var", "seen", "[", "]", "AST", "\n", "a", ".", "Traverse", "(", "func", "(", "a", "AST", ")", "bool", "{", "<mask>", "a", ":=", "a", ".", "(", "type", ")", "{", "case", "*", "TemplateParam", ":", "if", "a", ".", "Template", "!=", "nil", "{", "if", "tmpl", "!=", "nil", "{", "st", ".", "fail", "(", "\"", "\"", ")", "\n", "}", "\n", "return", "false", "\n", "}", "\n", "if", "tmpl", "==", "nil", "{", "st", ".", "fail", "(", "\"", "\"", ")", "\n", "}", "\n", "if", "a", ".", "Index", ">=", "len", "(", "tmpl", ".", "Args", ")", "{", "st", ".", "fail", "(", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "a", ".", "Index", ",", "len", "(", "tmpl", ".", "Args", ")", ")", ")", "\n", "}", "\n", "a", ".", "Template", "=", "tmpl", "\n", "return", "false", "\n", "default", ":", "for", "_", ",", "v", ":=", "range", "seen", "{", "if", "v", "==", "a", "{", "return", "false", "\n", "}", "\n", "}", "\n", "seen", "=", "append", "(", "seen", ",", "a", ")", "\n", "return", "true", "\n", "}", "\n", "}", ")", "\n", "}" ]
343
all-344
[ "Do", "executes", "Network", ".", "continueInterceptedRequest", "against", "the", "provided", "context", "." ]
[ "func", "(", "p", "*", "ContinueInterceptedRequestParams", ")", "Do", "(", "ctx", "context", ".", "<mask>", ")", "(", "err", "error", ")", "{", "return", "cdp", ".", "Execute", "(", "ctx", ",", "CommandContinueInterceptedRequest", ",", "p", ",", "nil", ")", "\n", "}" ]
344
all-345
[ "SetMenuLabelText", "()", "is", "a", "wrapper", "around", "gtk_notebook_set_menu_label_text", "()", "." ]
[ "func", "(", "v", "*", "Notebook", ")", "SetMenuLabelText", "(", "<mask>", "IWidget", ",", "menuText", "string", ")", "{", "cstr", ":=", "C", ".", "CString", "(", "menuText", ")", "\n", "defer", "C", ".", "free", "(", "unsafe", ".", "Pointer", "(", "cstr", ")", ")", "\n", "C", ".", "gtk_notebook_set_menu_label_text", "(", "v", ".", "native", "(", ")", ",", "child", ".", "toWidget", "(", ")", ",", "(", "*", "C", ".", "gchar", ")", "(", "cstr", ")", ")", "\n", "}" ]
345
all-346
[ "Get", "the", "global", "non", "window", "specific", "settings" ]
[ "func", "SettingsGetDefault", "(", ")", "(", "*", "Settings", ",", "error", ")", "{", "c", ":=", "C", ".", "gtk_settings_get_default", "(", ")", "\n", "if", "c", "==", "nil", "{", "<mask>", "nil", ",", "nilPtrErr", "\n", "}", "\n\n", "return", "wrapSettings", "(", "glib", ".", "Take", "(", "unsafe", ".", "Pointer", "(", "c", ")", ")", ")", ",", "nil", "\n", "}" ]
346
all-347
[ "SetUseFullPage", "()", "is", "a", "wrapper", "around", "gtk_print_operation_set_use_full_page", "()", "." ]
[ "func", "(", "po", "*", "PrintOperation", ")", "SetUseFullPage", "(", "full", "bool", ")", "{", "C", ".", "gtk_print_operation_set_use_full_page", "(", "<mask>", ".", "native", "(", ")", ",", "gbool", "(", "full", ")", ")", "\n", "}" ]
347
all-348
[ "StorageVolumeConfigAdd", "adds", "a", "new", "storage", "volume", "config", "into", "database", "." ]
[ "func", "StorageVolumeConfigAdd", "(", "tx", "*", "sql", ".", "Tx", ",", "volumeID", "int64", ",", "volumeConfig", "map", "[", "string", "]", "string", ")", "error", "{", "str", ":=", "\"", "\"", "\n", "stmt", ",", "err", ":=", "tx", ".", "Prepare", "(", "str", ")", "\n", "defer", "stmt", ".", "Close", "(", ")", "\n", "if", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n\n", "for", "k", ",", "v", ":=", "range", "volumeConfig", "{", "if", "v", "==", "\"", "\"", "{", "<mask>", "\n", "}", "\n\n", "_", ",", "err", "=", "stmt", ".", "Exec", "(", "volumeID", ",", "k", ",", "v", ")", "\n", "if", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n", "}", "\n\n", "return", "nil", "\n", "}" ]
348
all-349
[ "export", "FileSequence_SetExt" ]
[ "func", "FileSequence_SetExt", "(", "id", "FileSeqId", ",", "ext", "*", "C", ".", "<mask>", ")", "{", "if", "fs", ",", "ok", ":=", "sFileSeqs", ".", "Get", "(", "id", ")", ";", "ok", "{", "str", ":=", "C", ".", "GoString", "(", "ext", ")", "\n", "fs", ".", "SetExt", "(", "str", ")", "\n", "}", "\n", "}" ]
349
all-350
[ "NewPlayerFromBytes", "creates", "a", "new", "player", "with", "the", "given", "bytes", ".", "As", "opposed", "to", "NewPlayer", "you", "don", "t", "have", "to", "care", "if", "src", "is", "already", "used", "by", "another", "player", "or", "not", ".", "src", "can", "be", "shared", "by", "multiple", "players", ".", "The", "format", "of", "src", "should", "be", "same", "as", "noted", "at", "NewPlayer", ".", "NewPlayerFromBytes", "s", "error", "is", "always", "nil", "as", "of", "1", ".", "5", ".", "0", "-", "alpha", "." ]
[ "func", "NewPlayerFromBytes", "(", "<mask>", "*", "Context", ",", "src", "[", "]", "byte", ")", "(", "*", "Player", ",", "error", ")", "{", "b", ":=", "BytesReadSeekCloser", "(", "src", ")", "\n", "p", ",", "err", ":=", "NewPlayer", "(", "context", ",", "b", ")", "\n", "if", "err", "!=", "nil", "{", "// Errors should never happen.", "panic", "(", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "err", ")", ")", "\n", "}", "\n", "return", "p", ",", "nil", "\n", "}" ]
350
all-351
[ "UnmarshalText", "hydrates", "this", "instance", "from", "text" ]
[ "func", "(", "u", "*", "ISBN10", ")", "UnmarshalText", "(", "data", "[", "]", "byte", ")", "error", "{", "// validation is performed later on", "*", "u", "=", "ISBN10", "(", "string", "(", "<mask>", ")", ")", "\n", "return", "nil", "\n", "}" ]
351
all-352
[ "NumChildren", "returns", "the", "number", "of", "child", "snapshots", "of", "a", "specified", "snapshot", ".", "Remarks", ":", "*", "This", "function", "is", "not", "supported", "when", "using", "the", "VMWARE_PLAYER", "provider", ".", "Since", "VMware", "Workstation", "6", ".", "0", "." ]
[ "func", "(", "s", "*", "Snapshot", ")", "NumChildren", "(", ")", "(", "int", ",", "error", ")", "{", "var", "err", "C", ".", "VixError", "=", "C", ".", "VIX_OK", "\n", "<mask>", "numChildren", "*", "C", ".", "int", "\n\n", "err", "=", "C", ".", "VixSnapshot_GetNumChildren", "(", "s", ".", "handle", ",", "numChildren", ")", "\n\n", "if", "C", ".", "VIX_OK", "!=", "err", "{", "return", "0", ",", "&", "Error", "{", "Operation", ":", "\"", "\"", ",", "Code", ":", "int", "(", "err", "&", "0xFFFF", ")", ",", "Text", ":", "C", ".", "GoString", "(", "C", ".", "Vix_GetErrorText", "(", "err", ",", "nil", ")", ")", ",", "}", "\n", "}", "\n\n", "return", "int", "(", "*", "numChildren", ")", ",", "nil", "\n", "}" ]
352
all-353
[ "constructor", ".", "NewFloat64RingBuf", "will", "allocate", "internally", "a", "slice", "of", "maxViewItems", "float64", "." ]
[ "func", "NewFloat64RingBuf", "(", "maxViewItems", "int", ")", "*", "Float64RingBuf", "{", "n", ":=", "maxViewItems", "\n", "r", ":=", "&", "Float64RingBuf", "{", "N", ":", "n", ",", "Beg", ":", "0", ",", "Readable", ":", "0", ",", "}", "\n", "r", ".", "A", "=", "<mask>", "(", "[", "]", "float64", ",", "n", ",", "n", ")", "\n\n", "return", "r", "\n", "}" ]
353
all-354
[ "NodeID", "returns", "the", "6", "byte", "node", "id", "encoded", "in", "uuid", ".", "It", "returns", "nil", "if", "uuid", "is", "not", "valid", ".", "The", "NodeID", "is", "only", "well", "defined", "for", "version", "1", "and", "2", "UUIDs", "." ]
[ "func", "(", "uuid", "UUID", ")", "NodeID", "(", ")", "[", "]", "byte", "{", "var", "node", "[", "6", "]", "byte", "\n", "copy", "(", "node", "[", ":", "]", ",", "uuid", "[", "10", ":", "]", ")", "\n", "return", "<mask>", "[", ":", "]", "\n", "}" ]
354
all-355
[ "Add", "adds", "the", "task", "to", "a", "named", "queue", ".", "An", "empty", "queue", "name", "means", "that", "the", "default", "queue", "will", "be", "used", ".", "Add", "returns", "an", "equivalent", "Task", "with", "defaults", "filled", "in", "including", "setting", "the", "task", "s", "Name", "field", "to", "the", "chosen", "name", "if", "the", "original", "was", "empty", "." ]
[ "func", "Add", "(", "c", "context", ".", "Context", ",", "task", "*", "Task", ",", "queueName", "string", ")", "(", "*", "Task", ",", "error", ")", "{", "req", ",", "err", ":=", "newAddReq", "(", "c", ",", "task", ",", "queueName", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n", "res", ":=", "&", "pb", ".", "TaskQueueAddResponse", "{", "}", "\n", "if", "err", ":=", "internal", ".", "Call", "(", "c", ",", "\"", "\"", ",", "\"", "\"", ",", "req", ",", "res", ")", ";", "err", "!=", "nil", "{", "apiErr", ",", "ok", ":=", "err", ".", "(", "*", "internal", ".", "APIError", ")", "\n", "if", "ok", "&&", "alreadyAddedErrors", "[", "pb", ".", "TaskQueueServiceError_ErrorCode", "(", "apiErr", ".", "Code", ")", "]", "{", "return", "nil", ",", "ErrTaskAlreadyAdded", "\n", "}", "\n", "return", "nil", ",", "err", "\n", "}", "\n", "resultTask", ":=", "*", "task", "\n", "resultTask", ".", "Method", "=", "task", ".", "method", "(", ")", "\n", "if", "task", ".", "Name", "==", "\"", "\"", "{", "resultTask", ".", "<mask>", "=", "string", "(", "res", ".", "ChosenTaskName", ")", "\n", "}", "\n", "return", "&", "resultTask", ",", "nil", "\n", "}" ]
355
all-356
[ "newSTMReadCommitted", "initiates", "a", "new", "read", "committed", "transaction", "." ]
[ "func", "newSTMReadCommitted", "(", "ctx", "<mask>", ".", "Context", ",", "c", "*", "v3", ".", "Client", ",", "apply", "func", "(", "STM", ")", "error", ")", "(", "*", "v3", ".", "TxnResponse", ",", "error", ")", "{", "s", ":=", "&", "stmReadCommitted", "{", "stm", "{", "client", ":", "c", ",", "ctx", ":", "ctx", ",", "getOpts", ":", "[", "]", "v3", ".", "OpOption", "{", "v3", ".", "WithSerializable", "(", ")", "}", "}", "}", "\n", "return", "runSTM", "(", "s", ",", "apply", ",", "true", ")", "\n", "}" ]
356
all-357
[ "AddInteraction", "adds", "a", "new", "Pact", "Mock", "Service", "interaction", "." ]
[ "func", "(", "m", "*", "MockService", ")", "AddInteraction", "(", "interaction", "*", "Interaction", ")", "error", "{", "log", ".", "Println", "(", "\"", "\"", ")", "\n", "<mask>", ":=", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "m", ".", "BaseURL", ")", "\n", "return", "m", ".", "call", "(", "\"", "\"", ",", "url", ",", "interaction", ")", "\n", "}" ]
357
all-358
[ "Format", "renders", "the", "input", "with", "the", "Cursor", "appropriately", "positioned", "." ]
[ "func", "(", "c", "*", "Cursor", ")", "Format", "(", ")", "string", "{", "r", ":=", "c", ".", "input", "\n", "// insert the cursor", "return", "<mask>", "(", "r", ",", "c", ")", "\n", "}" ]
358
all-359
[ "emit", "passes", "an", "item", "pack", "to", "the", "client" ]
[ "func", "(", "l", "*", "Lexer", ")", "emit", "(", "t", "TokenType", ")", "{", "// if the position is the same as the start, do not emit a token", "if", "l", ".", "Pos", "==", "l", ".", "Start", "{", "return", "\n", "}", "\n\n", "tok", ":=", "<mask>", "{", "t", ",", "l", ".", "input", "[", "l", ".", "Start", ":", "l", ".", "Pos", "]", "}", "\n", "l", ".", "handler", "(", "tok", ")", "\n", "l", ".", "Start", "=", "l", ".", "Pos", "\n", "}" ]
359
all-360
[ "FontButtonNew", "is", "a", "wrapper", "around", "gtk_font_button_new", "()", "." ]
[ "func", "FontButtonNew", "(", ")", "(", "*", "FontButton", ",", "<mask>", ")", "{", "c", ":=", "C", ".", "gtk_font_button_new", "(", ")", "\n", "if", "c", "==", "nil", "{", "return", "nil", ",", "nilPtrErr", "\n", "}", "\n", "obj", ":=", "glib", ".", "Take", "(", "unsafe", ".", "Pointer", "(", "c", ")", ")", "\n", "return", "wrapFontButton", "(", "obj", ")", ",", "nil", "\n", "}" ]
360
all-361
[ "GetLabelWidget", "is", "a", "wrapper", "around", "gtk_frame_get_label_widget", "()", "." ]
[ "func", "(", "v", "*", "Frame", ")", "GetLabelWidget", "(", ")", "(", "*", "Widget", ",", "<mask>", ")", "{", "c", ":=", "C", ".", "gtk_frame_get_label_widget", "(", "v", ".", "native", "(", ")", ")", "\n", "if", "c", "==", "nil", "{", "return", "nil", ",", "nilPtrErr", "\n", "}", "\n", "obj", ":=", "glib", ".", "Take", "(", "unsafe", ".", "Pointer", "(", "c", ")", ")", "\n", "return", "wrapWidget", "(", "obj", ")", ",", "nil", "\n", "}" ]
361
all-362
[ "GetDashboard", "returns", "a", "single", "dashboard", "created", "on", "this", "account", "." ]
[ "func", "(", "client", "*", "Client", ")", "GetDashboard", "(", "<mask>", "interface", "{", "}", ")", "(", "*", "Dashboard", ",", "error", ")", "{", "stringId", ",", "err", ":=", "GetStringId", "(", "id", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "var", "out", "reqGetDashboard", "\n", "if", "err", ":=", "client", ".", "doJsonRequest", "(", "\"", "\"", ",", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "stringId", ")", ",", "nil", ",", "&", "out", ")", ";", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n", "return", "out", ".", "Dashboard", ",", "nil", "\n", "}" ]
362
all-363
[ "FillStroke", "first", "fills", "and", "afterwards", "strokes", "a", "path", "." ]
[ "func", "FillStroke", "(", "gc", "draw2d", ".", "GraphicContext", ",", "x", ",", "y", ",", "width", ",", "height", "float64", ")", "{", "sx", ",", "sy", ":=", "width", "/", "210", ",", "height", "/", "215", "\n", "gc", ".", "MoveTo", "(", "x", "+", "sx", "*", "113.0", ",", "y", ")", "\n", "gc", ".", "LineTo", "(", "x", "+", "sx", "*", "215.0", ",", "y", "+", "sy", "*", "215", ")", "\n", "rLineTo", "(", "gc", ",", "sx", "*", "-", "100", ",", "0", ")", "\n", "gc", ".", "CubicCurveTo", "(", "x", "+", "sx", "*", "35", ",", "y", "+", "sy", "*", "215", ",", "x", "+", "sx", "*", "35", ",", "y", "+", "sy", "*", "113", ",", "x", "+", "sx", "*", "113.0", ",", "y", "+", "sy", "*", "113", ")", "\n", "gc", ".", "Close", "(", ")", "\n\n", "gc", ".", "MoveTo", "(", "x", "+", "sx", "*", "50.0", ",", "y", ")", "\n", "rLineTo", "(", "gc", ",", "sx", "*", "51.2", ",", "sy", "*", "51.2", ")", "\n", "rLineTo", "(", "gc", ",", "sx", "*", "-", "51.2", ",", "sy", "*", "51.2", ")", "\n", "rLineTo", "(", "gc", ",", "sx", "*", "-", "51.2", ",", "sy", "*", "-", "51.2", ")", "\n", "gc", ".", "Close", "(", ")", "\n\n", "gc", ".", "SetLineWidth", "(", "width", "/", "20.0", ")", "\n", "gc", ".", "SetFillColor", "(", "color", ".", "NRGBA", "{", "0", ",", "0", ",", "0xFF", ",", "0xFF", "}", ")", "\n", "gc", ".", "SetStrokeColor", "(", "<mask>", ".", "Black", ")", "\n", "gc", ".", "FillStroke", "(", ")", "\n", "}" ]
363
all-364
[ "Authorize", "user" ]
[ "func", "(", "c", "*", "OAuth2Controller", ")", "Authorize", "(", "w", "http", ".", "ResponseWriter", ",", "r", "*", "http", ".", "Request", ")", "{", "clientID", ":=", "r", ".", "URL", ".", "Query", "(", ")", ".", "Get", "(", "\"", "\"", ")", "\n", "responsetype", ":=", "r", ".", "URL", ".", "Query", "(", ")", ".", "Get", "(", "\"", "\"", ")", "\n", "redirectURI", ":=", "r", ".", "URL", ".", "Query", "(", ")", ".", "Get", "(", "\"", "\"", ")", "\n", "userID", ":=", "r", ".", "<mask>", ".", "Query", "(", ")", ".", "Get", "(", "\"", "\"", ")", "\n", "if", "len", "(", "redirectURI", ")", "==", "0", "{", "app", ",", "_", ":=", "c", ".", "ApplicationManager", ".", "GetByClientID", "(", "clientID", ")", "\n", "redirectURI", "=", "app", ".", "Callback", "\n", "}", "\n", "if", "len", "(", "redirectURI", ")", "==", "0", "{", "log", ".", "Print", "(", "\"", ")", "", "\n", "// return an error code ?", "}", "else", "{", "if", "strings", ".", "Compare", "(", "responsetype", ",", "\"", "\"", ")", "==", "0", "{", "code", ",", "err", ":=", "EncodeOAuth2Code", "(", "clientID", ",", "redirectURI", ",", "userID", ",", "c", ".", "cnf", ".", "Jwt", ".", "Key", ")", "\n", "if", "err", "!=", "nil", "{", "log", ".", "Printf", "(", "\"", "\"", ",", "err", ")", "\n", "}", "\n", "data", ":=", "map", "[", "string", "]", "string", "{", "\"", "\"", ":", "redirectURI", ",", "\"", "\"", ":", "code", ",", "}", "\n", "js", ",", "_", ":=", "json", ".", "Marshal", "(", "data", ")", "\n", "w", ".", "Write", "(", "js", ")", "\n", "}", "else", "{", "log", ".", "Print", "(", "\"", ")", "", "\n", "//return a Token", "}", "\n", "}", "\n", "}" ]
364
all-365
[ "NewOpenAPISchemaFor", "returns", "the", "OpenAPISchema", "object", "ready", "to", "validate", "objects", "of", "given", "GroupVersion" ]
[ "func", "NewOpenAPISchemaFor", "(", "delegate", "discovery", ".", "OpenAPISchemaInterface", ",", "gvk", "schema", ".", "GroupVersionKind", ")", "(", "*", "OpenAPISchema", ",", "error", ")", "{", "log", ".", "Debugf", "(", "\"", "\"", ",", "gvk", ")", "\n", "doc", ",", "err", ":=", "delegate", ".", "OpenAPISchema", "(", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n", "res", ",", "err", ":=", "openapi", ".", "NewOpenAPIData", "(", "doc", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "sc", ":=", "res", ".", "LookupResource", "(", "gvk", ")", "\n", "if", "sc", "==", "nil", "{", "gvr", ":=", "schema", ".", "GroupResource", "{", "// TODO(mkm): figure out a meaningful group+resource for schemas.", "<mask>", ":", "\"", "\"", ",", "Resource", ":", "\"", "\"", ",", "}", "\n", "return", "nil", ",", "errors", ".", "NewNotFound", "(", "gvr", ",", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "gvk", ")", ")", "\n", "}", "\n", "return", "&", "OpenAPISchema", "{", "schema", ":", "sc", "}", ",", "nil", "\n", "}" ]
365
all-366
[ "fileKey", "finds", "a", "stable", "representation", "of", "the", "caller", "s", "file", "path", ".", "For", "calls", "from", "package", "main", ":", "strip", "all", "leading", "path", "entries", "leaving", "just", "the", "filename", ".", "For", "calls", "from", "anywhere", "else", "strip", "$GOPATH", "/", "src", "leaving", "just", "the", "package", "path", "and", "file", "path", "." ]
[ "func", "fileKey", "(", "file", "string", ")", "(", "string", ",", "error", ")", "{", "if", "!", "internal", ".", "IsSecondGen", "(", ")", "||", "internal", ".", "MainPath", "==", "\"", "\"", "{", "return", "file", ",", "nil", "\n", "}", "\n", "// If the caller is in the same Dir as mainPath, then strip everything but the file name.", "if", "filepath", ".", "Dir", "(", "file", ")", "==", "internal", ".", "MainPath", "{", "return", "filepath", ".", "Base", "(", "file", ")", ",", "nil", "\n", "}", "\n", "// If the path contains \"_gopath/src/\", which is what the builder uses for", "// apps which don't use go modules, strip everything up to and including src.", "// Or, if the path starts with /tmp/staging, then we're importing a package", "// from the app's module (and we must be using go modules), and we have a", "// path like /tmp/staging1234/srv/... so strip everything up to and", "// including the first /srv/.", "// And be sure to look at the GOPATH, for local development.", "s", ":=", "string", "(", "filepath", ".", "Separator", ")", "\n", "for", "_", ",", "s", ":=", "range", "[", "]", "string", "{", "filepath", ".", "Join", "(", "\"", "\"", ",", "\"", "\"", ")", "+", "s", ",", "s", "+", "\"", "\"", "+", "s", ",", "filepath", ".", "Join", "(", "build", ".", "Default", ".", "GOPATH", ",", "\"", "\"", ")", "+", "s", "}", "{", "if", "idx", ":=", "strings", ".", "Index", "(", "file", ",", "s", ")", ";", "idx", ">", "0", "{", "return", "file", "[", "idx", "+", "len", "(", "s", ")", ":", "]", ",", "nil", "\n", "}", "\n", "}", "\n\n", "// Finally, if that all fails then we must be using go modules, and the file is a module,", "// so the path looks like /go/pkg/mod/github.com/foo/bar@v0.0.0-20181026220418-f595d03440dc/baz.go", "// So... remove everything up to and including mod, plus the @.... version string.", "m", ":=", "\"", "\"", "\n", "if", "idx", ":=", "strings", ".", "Index", "(", "file", ",", "m", ")", ";", "idx", ">", "0", "{", "file", "=", "<mask>", "[", "idx", "+", "len", "(", "m", ")", ":", "]", "\n", "}", "else", "{", "return", "file", ",", "fmt", ".", "Errorf", "(", "\"", "\"", ",", "file", ")", "\n", "}", "\n", "return", "modVersionPat", ".", "ReplaceAllString", "(", "file", ",", "\"", "\"", ")", ",", "nil", "\n", "}" ]
366
all-367
[ "CandidateLocations", "returns", "a", "prioritized", "limited", "number", "of", "blobs", "and", "their", "locations", "that", "could", "possibly", "be", "reused", "within", "the", "specified", "(", "transport", "scope", ")", "(", "if", "they", "still", "exist", "which", "is", "not", "guaranteed", ")", ".", "If", "!canSubstitute", "the", "returned", "cadidates", "will", "match", "the", "submitted", "digest", "exactly", ";", "if", "canSubstitute", "data", "from", "previous", "RecordDigestUncompressedPair", "calls", "is", "used", "to", "also", "look", "up", "variants", "of", "the", "blob", "which", "have", "the", "same", "uncompressed", "digest", "." ]
[ "func", "(", "mem", "*", "cache", ")", "CandidateLocations", "(", "transport", "types", ".", "ImageTransport", ",", "scope", "types", ".", "BICTransportScope", ",", "primaryDigest", "digest", ".", "Digest", ",", "canSubstitute", "bool", ")", "[", "]", "types", ".", "BICReplacementCandidate", "{", "mem", ".", "mutex", ".", "Lock", "(", ")", "\n", "defer", "mem", ".", "mutex", ".", "Unlock", "(", ")", "\n", "<mask>", ":=", "[", "]", "prioritize", ".", "CandidateWithTime", "{", "}", "\n", "res", "=", "mem", ".", "appendReplacementCandidates", "(", "res", ",", "transport", ",", "scope", ",", "primaryDigest", ")", "\n", "var", "uncompressedDigest", "digest", ".", "Digest", "// = \"\"", "\n", "if", "canSubstitute", "{", "if", "uncompressedDigest", "=", "mem", ".", "uncompressedDigestLocked", "(", "primaryDigest", ")", ";", "uncompressedDigest", "!=", "\"", "\"", "{", "otherDigests", ":=", "mem", ".", "digestsByUncompressed", "[", "uncompressedDigest", "]", "// nil if not present in the map", "\n", "for", "d", ":=", "range", "otherDigests", "{", "if", "d", "!=", "primaryDigest", "&&", "d", "!=", "uncompressedDigest", "{", "res", "=", "mem", ".", "appendReplacementCandidates", "(", "res", ",", "transport", ",", "scope", ",", "d", ")", "\n", "}", "\n", "}", "\n", "if", "uncompressedDigest", "!=", "primaryDigest", "{", "res", "=", "mem", ".", "appendReplacementCandidates", "(", "res", ",", "transport", ",", "scope", ",", "uncompressedDigest", ")", "\n", "}", "\n", "}", "\n", "}", "\n", "return", "prioritize", ".", "DestructivelyPrioritizeReplacementCandidates", "(", "res", ",", "primaryDigest", ",", "uncompressedDigest", ")", "\n", "}" ]
367
all-368
[ "Users", "returns", "the", "users", "collection", "from", "MongoDB", "." ]
[ "func", "(", "s", "*", "Storage", ")", "Users", "(", ")", "*", "storage", ".", "Collection", "{", "emailIndex", ":=", "mgo", ".", "Index", "{", "Key", ":", "[", "]", "string", "{", "\"", "\"", "}", ",", "Unique", ":", "true", "}", "\n", "c", ":=", "s", ".", "<mask>", "(", "\"", "\"", ")", "\n", "c", ".", "EnsureIndex", "(", "emailIndex", ")", "\n", "return", "c", "\n", "}" ]
368
all-369
[ "Logf", "formats", "its", "arguments", "according", "to", "the", "format", "analogous", "to", "Printf", "." ]
[ "func", "(", "t", "*", "T", ")", "Logf", "(", "<mask>", "string", ",", "args", "...", "interface", "{", "}", ")", "{", "fmt", ".", "Printf", "(", "format", ",", "args", "...", ")", "\n", "}" ]
369
all-370
[ "NOTE", ":", "this", "function", "specifically", "does", "not", "work", "as", "desired", "because", "text", "styles", "must", "be", "wrapped", "around", "the", "text", "they", "are", "meant", "to", "style", ".", "As", "such", "use", "TextStyle", "()", "or", "Style", ".", "Style", "()", "instead", "." ]
[ "func", "(", "t", "TextStyle", ")", "<mask>", "(", ")", "string", "{", "return", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "t", ".", "start", ",", "t", ".", "stop", ")", "\n", "}" ]
370
all-371
[ "GetId", "returns", "the", "Id", "field", "if", "non", "-", "nil", "zero", "value", "otherwise", "." ]
[ "func", "(", "c", "*", "Creator", ")", "GetId", "(", ")", "int", "{", "if", "c", "==", "nil", "||", "c", ".", "Id", "==", "nil", "{", "return", "0", "\n", "}", "\n", "return", "*", "c", ".", "<mask>", "\n", "}" ]
371
all-372
[ "Register", "Handler", "with", "the", "worker" ]
[ "func", "(", "w", "*", "Simple", ")", "Register", "(", "name", "string", ",", "h", "Handler", ")", "error", "{", "w", ".", "moot", ".", "Lock", "(", ")", "\n", "defer", "w", ".", "moot", ".", "Unlock", "(", ")", "\n", "if", "_", ",", "<mask>", ":=", "w", ".", "handlers", "[", "name", "]", ";", "ok", "{", "return", "fmt", ".", "Errorf", "(", "\"", "\"", ",", "name", ")", "\n", "}", "\n", "w", ".", "handlers", "[", "name", "]", "=", "h", "\n", "return", "nil", "\n", "}" ]
372
all-373
[ "removeServiceMonitor", "watches", "a", "channel", "to", "remove", "services", "from", "operation", "." ]
[ "func", "(", "s", "*", "ServiceManager", ")", "removeServiceMonitor", "(", ")", "{", "log", ".", "Println", "(", "\"", "\"", ")", "\n", "var", "p", "*", "exec", ".", "Cmd", "\n", "for", "{", "select", "{", "case", "p", "=", "<-", "s", ".", "commandCompleteChan", ":", "if", "p", "!=", "nil", "&&", "p", ".", "Process", "!=", "nil", "{", "p", ".", "Process", ".", "Signal", "(", "<mask>", ".", "Interrupt", ")", "\n", "s", ".", "processMap", ".", "Delete", "(", "p", ".", "Process", ".", "Pid", ")", "\n", "}", "\n", "}", "\n", "}", "\n", "}" ]
373
all-374
[ "Do", "executes", "Debugger", ".", "resume", "against", "the", "provided", "context", "." ]
[ "func", "(", "p", "*", "ResumeParams", ")", "Do", "(", "ctx", "context", ".", "<mask>", ")", "(", "err", "error", ")", "{", "return", "cdp", ".", "Execute", "(", "ctx", ",", "CommandResume", ",", "nil", ",", "nil", ")", "\n", "}" ]
374
all-375
[ "GetTimeAggregator", "returns", "the", "TimeAggregator", "field", "if", "non", "-", "nil", "zero", "value", "otherwise", "." ]
[ "func", "(", "t", "*", "ThresholdCount", ")", "GetTimeAggregator", "(", ")", "string", "{", "if", "t", "==", "nil", "||", "t", ".", "TimeAggregator", "==", "nil", "{", "return", "\"", "\"", "\n", "}", "\n", "<mask>", "*", "t", ".", "TimeAggregator", "\n", "}" ]
375
all-376
[ "title", ":", "service", "delete", "path", ":", "/", "services", "/", "{", "name", "}", "method", ":", "DELETE", "responses", ":", "200", ":", "Service", "removed", "401", ":", "Unauthorized", "403", ":", "Forbidden", "(", "team", "is", "not", "the", "owner", "or", "service", "with", "instances", ")", "404", ":", "Service", "not", "found" ]
[ "func", "serviceDelete", "(", "w", "http", ".", "ResponseWriter", ",", "r", "*", "http", ".", "Request", ",", "t", "auth", ".", "Token", ")", "(", "err", "error", ")", "{", "s", ",", "err", ":=", "getService", "(", "r", ".", "URL", ".", "<mask>", "(", ")", ".", "Get", "(", "\"", "\"", ")", ")", "\n", "if", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n", "allowed", ":=", "permission", ".", "Check", "(", "t", ",", "permission", ".", "PermServiceDelete", ",", "contextsForServiceProvision", "(", "&", "s", ")", "...", ",", ")", "\n", "if", "!", "allowed", "{", "return", "permission", ".", "ErrUnauthorized", "\n", "}", "\n", "evt", ",", "err", ":=", "event", ".", "New", "(", "&", "event", ".", "Opts", "{", "Target", ":", "serviceTarget", "(", "s", ".", "Name", ")", ",", "Kind", ":", "permission", ".", "PermServiceDelete", ",", "Owner", ":", "t", ",", "CustomData", ":", "event", ".", "FormToCustomData", "(", "InputFields", "(", "r", ")", ")", ",", "Allowed", ":", "event", ".", "Allowed", "(", "permission", ".", "PermServiceReadEvents", ",", "contextsForServiceProvision", "(", "&", "s", ")", "...", ")", ",", "}", ")", "\n", "if", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n", "defer", "func", "(", ")", "{", "evt", ".", "Done", "(", "err", ")", "}", "(", ")", "\n", "instances", ",", "err", ":=", "service", ".", "GetServiceInstancesByServices", "(", "[", "]", "service", ".", "Service", "{", "s", "}", ")", "\n", "if", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n", "if", "len", "(", "instances", ")", ">", "0", "{", "msg", ":=", "\"", "\\n", "\"", "\n", "msg", "+=", "\"", "\"", "\n", "return", "&", "errors", ".", "HTTP", "{", "Code", ":", "http", ".", "StatusForbidden", ",", "Message", ":", "msg", "}", "\n", "}", "\n", "return", "service", ".", "Delete", "(", "s", ")", "\n", "}" ]
376
all-377
[ "changeContextState", "changes", "pc", ".", "state", "or", "fails", "if", "the", "state", "is", "unexpected" ]
[ "func", "(", "pc", "*", "PolicyContext", ")", "changeState", "(", "expected", ",", "new", "policyContextState", ")", "error", "{", "if", "pc", ".", "state", "!=", "expected", "{", "return", "errors", ".", "Errorf", "(", "`\"Invalid PolicyContext state, expected \"%s\", found \"%s\"`", ",", "expected", ",", "pc", ".", "state", ")", "\n", "}", "\n", "<mask>", ".", "state", "=", "new", "\n", "return", "nil", "\n", "}" ]
377
all-378
[ "Add", "adds", "a", "value", "to", "the", "set", "." ]
[ "func", "(", "s", "*", "<mask>", ")", "Add", "(", "value", "interface", "{", "}", ")", "{", "s", ".", "Lock", "(", ")", "\n", "defer", "s", ".", "Unlock", "(", ")", "\n", "s", ".", "m", "[", "value", "]", "=", "struct", "{", "}", "{", "}", "\n", "}" ]
378
all-379
[ "LookupIP", "returns", "the", "given", "host", "s", "IP", "addresses", "." ]
[ "func", "LookupIP", "(", "ctx", "<mask>", ".", "Context", ",", "host", "string", ")", "(", "addrs", "[", "]", "net", ".", "IP", ",", "err", "error", ")", "{", "return", "net", ".", "LookupIP", "(", "host", ")", "\n", "}" ]
379
all-380
[ "IsTimeoutError", "reports", "whether", "err", "is", "a", "timeout", "error", "." ]
[ "func", "IsTimeoutError", "(", "err", "error", ")", "bool", "{", "if", "err", "==", "context", ".", "DeadlineExceeded", "{", "return", "true", "\n", "}", "\n", "if", "t", ",", "ok", ":=", "err", ".", "(", "interface", "{", "IsTimeout", "(", ")", "bool", "\n", "}", ")", ";", "ok", "{", "return", "t", ".", "IsTimeout", "(", ")", "\n", "}", "\n", "return", "<mask>", "\n", "}" ]
380
all-381
[ "WalkStatement", "is", "the", "top", "level", "walk", "function", ".", "If", "it", "encounters", "a", "Select", "it", "switches", "to", "a", "mode", "where", "variables", "are", "deduped", "." ]
[ "func", "(", "nz", "*", "normalizer", ")", "WalkStatement", "(", "node", "SQLNode", ")", "(", "bool", ",", "error", ")", "{", "<mask>", "node", ":=", "node", ".", "(", "type", ")", "{", "case", "*", "Select", ":", "_", "=", "Walk", "(", "nz", ".", "WalkSelect", ",", "node", ")", "\n", "// Don't continue", "return", "false", ",", "nil", "\n", "case", "*", "SQLVal", ":", "nz", ".", "convertSQLVal", "(", "node", ")", "\n", "case", "*", "ComparisonExpr", ":", "nz", ".", "convertComparison", "(", "node", ")", "\n", "}", "\n", "return", "true", ",", "nil", "\n", "}" ]
381
all-382
[ "AddFromFile", "is", "a", "wrapper", "around", "gtk_builder_add_from_file", "()", "." ]
[ "func", "(", "b", "*", "Builder", ")", "AddFromFile", "(", "filename", "string", ")", "error", "{", "cstr", ":=", "C", ".", "CString", "(", "filename", ")", "\n", "defer", "C", ".", "free", "(", "unsafe", ".", "Pointer", "(", "cstr", ")", ")", "\n", "var", "err", "*", "C", ".", "GError", "=", "nil", "\n", "res", ":=", "C", ".", "gtk_builder_add_from_file", "(", "b", ".", "native", "(", ")", ",", "(", "*", "C", ".", "gchar", ")", "(", "cstr", ")", ",", "&", "err", ")", "\n", "if", "res", "==", "0", "{", "defer", "C", ".", "g_error_free", "(", "err", ")", "\n", "return", "errors", ".", "New", "(", "goString", "(", "err", ".", "<mask>", ")", ")", "\n", "}", "\n", "return", "nil", "\n", "}" ]
382
all-383
[ "map", "all", "or", "part", "of", "a", "buffer", "object", "s", "data", "store", "into", "the", "client", "s", "address", "space" ]
[ "func", "MapBufferRange", "(", "target", "uint32", ",", "offset", "int", ",", "length", "int", ",", "access", "uint32", ")", "unsafe", ".", "Pointer", "{", "ret", ",", "_", ",", "_", ":=", "syscall", ".", "Syscall6", "(", "gpMapBufferRange", ",", "4", ",", "uintptr", "(", "<mask>", ")", ",", "uintptr", "(", "offset", ")", ",", "uintptr", "(", "length", ")", ",", "uintptr", "(", "access", ")", ",", "0", ",", "0", ")", "\n", "return", "(", "unsafe", ".", "Pointer", ")", "(", "ret", ")", "\n", "}" ]
383
all-384
[ "GetText", "mocks", "base", "method" ]
[ "func", "(", "m", "*", "MockLicenseProvider", ")", "GetText", "(", ")", "(", "string", ",", "error", ")", "{", "<mask>", ":=", "m", ".", "ctrl", ".", "Call", "(", "m", ",", "\"", "\"", ")", "\n", "ret0", ",", "_", ":=", "ret", "[", "0", "]", ".", "(", "string", ")", "\n", "ret1", ",", "_", ":=", "ret", "[", "1", "]", ".", "(", "error", ")", "\n", "return", "ret0", ",", "ret1", "\n", "}" ]
384
all-385
[ "Hash", "updates", "all", "of", "the", "hashes", "and", "node", "size", "metadata", "it", "also", "checks", "for", "conflicts", "." ]
[ "func", "(", "h", "*", "dbHashTree", ")", "Hash", "(", ")", "error", "{", "return", "h", ".", "Batch", "(", "func", "(", "tx", "*", "bolt", ".", "Tx", ")", "error", "{", "return", "canonicalize", "(", "<mask>", ",", "\"", "\"", ")", "\n", "}", ")", "\n", "}" ]
385
all-386
[ "SelectItem", "is", "a", "wrapper", "around", "gtk_menu_shell_select_item", "()", "." ]
[ "func", "(", "v", "*", "MenuShell", ")", "SelectItem", "(", "<mask>", "IMenuItem", ")", "{", "C", ".", "gtk_menu_shell_select_item", "(", "v", ".", "native", "(", ")", ",", "child", ".", "toWidget", "(", ")", ")", "\n", "}" ]
386
all-387
[ "TODO", "(", "ideahitme", ")", ":", "consider", "moving", "this", "to", "Plan" ]
[ "func", "filterOwnedRecords", "(", "ownerID", "string", ",", "eps", "[", "]", "*", "endpoint", ".", "Endpoint", ")", "[", "]", "*", "endpoint", ".", "Endpoint", "{", "filtered", ":=", "[", "]", "*", "endpoint", ".", "Endpoint", "{", "}", "\n", "for", "_", ",", "ep", ":=", "range", "eps", "{", "if", "endpointOwner", ",", "ok", ":=", "ep", ".", "Labels", "[", "endpoint", ".", "OwnerLabelKey", "]", ";", "!", "ok", "||", "endpointOwner", "!=", "ownerID", "{", "log", ".", "Debugf", "(", "`Skipping endpoint %v because owner id does not match, found: \"%s\", required: \"%s\"`", ",", "ep", ",", "endpointOwner", ",", "ownerID", ")", "\n", "continue", "\n", "}", "\n", "filtered", "=", "<mask>", "(", "filtered", ",", "ep", ")", "\n", "}", "\n", "return", "filtered", "\n", "}" ]
387
all-388
[ "GetOnce", "gets", "a", "value", "from", "the", "current", "session", "and", "then", "deletes", "it", "." ]
[ "func", "(", "s", "*", "Session", ")", "GetOnce", "(", "<mask>", "interface", "{", "}", ")", "interface", "{", "}", "{", "if", "x", ",", "ok", ":=", "s", ".", "Session", ".", "Values", "[", "name", "]", ";", "ok", "{", "s", ".", "Delete", "(", "name", ")", "\n", "return", "x", "\n", "}", "\n", "return", "nil", "\n", "}" ]
388
all-389
[ "hostNetworkSystemFromHostSystem", "locates", "a", "HostNetworkSystem", "from", "a", "specified", "HostSystem", "." ]
[ "func", "hostNetworkSystemFromHostSystem", "(", "hs", "*", "object", ".", "HostSystem", ")", "(", "*", "object", ".", "HostNetworkSystem", ",", "error", ")", "{", "ctx", ",", "cancel", ":=", "<mask>", ".", "WithTimeout", "(", "context", ".", "Background", "(", ")", ",", "defaultAPITimeout", ")", "\n", "defer", "cancel", "(", ")", "\n", "return", "hs", ".", "ConfigManager", "(", ")", ".", "NetworkSystem", "(", "ctx", ")", "\n", "}" ]
389
all-390
[ "Returns", "an", "time", ".", "time", "at", "the", "key", "and", "whether", "or", "not", "the", "key", "existed", "and", "the", "value", "was", "a", "time", ".", "Time" ]
[ "func", "(", "t", "Typed", ")", "TimeIf", "(", "key", "string", ")", "(", "time", ".", "Time", ",", "bool", ")", "{", "value", ",", "exists", ":=", "t", "[", "key", "]", "\n", "if", "exists", "==", "false", "{", "return", "time", ".", "Time", "{", "}", ",", "false", "\n", "}", "\n", "if", "n", ",", "ok", ":=", "value", ".", "(", "time", ".", "Time", ")", ";", "ok", "{", "return", "n", ",", "true", "\n", "}", "\n", "return", "time", ".", "Time", "{", "}", ",", "<mask>", "\n", "}" ]
390
all-391
[ "Protect", "--", "add", "mutex", "and", "taskmanager", "protection", "to", "task" ]
[ "func", "(", "s", "*", "<mask>", ")", "Protect", "(", "taskmanager", "TaskManagerInterface", ",", "mutex", "sync", ".", "RWMutex", ")", "{", "s", ".", "taskManager", "=", "taskmanager", "\n", "s", ".", "mutex", "=", "mutex", "\n", "}" ]
391
all-392
[ "HasStyle", "returns", "a", "boolean", "if", "a", "field", "has", "been", "set", "." ]
[ "func", "(", "d", "*", "DistributionRequest", ")", "HasStyle", "(", ")", "bool", "{", "if", "d", "!=", "nil", "&&", "d", ".", "Style", "!=", "nil", "{", "return", "true", "\n", "}", "\n\n", "return", "<mask>", "\n", "}" ]
392
all-393
[ "Union", "merges", "a", "given", "interval", "tree", "into", "the", "receiver", "." ]
[ "func", "(", "ivt", "*", "IntervalTree", ")", "Union", "(", "inIvt", "IntervalTree", ",", "ivl", "Interval", ")", "{", "f", ":=", "func", "(", "n", "*", "IntervalValue", ")", "bool", "{", "ivt", ".", "Insert", "(", "n", ".", "Ivl", ",", "n", ".", "Val", ")", "\n", "return", "<mask>", "\n", "}", "\n", "inIvt", ".", "Visit", "(", "ivl", ",", "f", ")", "\n", "}" ]
393
all-394
[ "SetPointer", "is", "a", "wrapper", "around", "g_value_set_pointer", "()", "." ]
[ "func", "(", "v", "*", "<mask>", ")", "SetPointer", "(", "p", "uintptr", ")", "{", "C", ".", "g_value_set_pointer", "(", "v", ".", "native", "(", ")", ",", "C", ".", "gpointer", "(", "p", ")", ")", "\n", "}" ]
394
all-395
[ "MarshalJSON", "supports", "json", ".", "Marshaler", "interface" ]
[ "func", "(", "v", "EventWebSocketFrameSent", ")", "MarshalJSON", "(", ")", "(", "[", "]", "byte", ",", "error", ")", "{", "w", ":=", "jwriter", ".", "Writer", "{", "}", "\n", "easyjsonC5a4559bEncodeGithubComChromedpCdprotoNetwork42", "(", "&", "w", ",", "v", ")", "\n", "return", "w", ".", "<mask>", ".", "BuildBytes", "(", ")", ",", "w", ".", "Error", "\n", "}" ]
395
all-396
[ "Test", "helper" ]
[ "func", "valueBytesToEntry", "(", "buf", "[", "]", "byte", ")", "(", "e", "Entry", ")", "{", "var", "h", "header", "\n", "h", ".", "Decode", "(", "buf", ")", "\n", "n", ":=", "uint32", "(", "headerBufSize", ")", "\n\n", "e", ".", "<mask>", "=", "buf", "[", "n", ":", "n", "+", "h", ".", "klen", "]", "\n", "n", "+=", "h", ".", "klen", "\n", "e", ".", "meta", "=", "h", ".", "meta", "\n", "e", ".", "UserMeta", "=", "h", ".", "userMeta", "\n", "e", ".", "Value", "=", "buf", "[", "n", ":", "n", "+", "h", ".", "vlen", "]", "\n", "return", "\n", "}" ]
396
all-397
[ "Returns", "true", "if", "messages", "from", "channels", "were", "exhausted", "." ]
[ "func", "(", "c", "*", "MConnection", ")", "sendMsgPacket", "(", ")", "bool", "{", "// Choose a channel to create a msgPacket from.", "// The chosen channel will be the one whose recentlySent/priority is the least.", "var", "leastRatio", "float32", "=", "math", ".", "MaxFloat32", "\n", "<mask>", "leastChannel", "*", "Channel", "\n", "for", "_", ",", "channel", ":=", "range", "c", ".", "channels", "{", "// If nothing to send, skip this channel", "if", "!", "channel", ".", "isSendPending", "(", ")", "{", "continue", "\n", "}", "\n", "// Get ratio, and keep track of lowest ratio.", "ratio", ":=", "float32", "(", "channel", ".", "recentlySent", ")", "/", "float32", "(", "channel", ".", "priority", ")", "\n", "if", "ratio", "<", "leastRatio", "{", "leastRatio", "=", "ratio", "\n", "leastChannel", "=", "channel", "\n", "}", "\n", "}", "\n\n", "// Nothing to send?", "if", "leastChannel", "==", "nil", "{", "return", "true", "\n", "}", "else", "{", "// log.Info(\"Found a msgPacket to send\")", "}", "\n\n", "// Make & send a msgPacket from this channel", "n", ",", "err", ":=", "leastChannel", ".", "writeMsgPacketTo", "(", "c", ".", "bufWriter", ")", "\n", "if", "err", "!=", "nil", "{", "log", ".", "Warn", "(", "\"", "\"", ",", "\"", "\"", ",", "err", ")", "\n", "c", ".", "stopForError", "(", "err", ")", "\n", "return", "true", "\n", "}", "\n", "c", ".", "sendMonitor", ".", "Update", "(", "int", "(", "n", ")", ")", "\n", "c", ".", "flushTimer", ".", "Set", "(", ")", "\n", "return", "false", "\n", "}" ]
397
all-398
[ "virtualMachineNames", "is", "a", "helper", "method", "that", "returns", "all", "the", "names", "for", "a", "list", "of", "virtual", "machines", "comma", "separated", "." ]
[ "func", "virtualMachineNames", "(", "vms", "[", "]", "*", "object", ".", "VirtualMachine", ")", "string", "{", "<mask>", "s", "[", "]", "string", "\n", "for", "_", ",", "vm", ":=", "range", "vms", "{", "s", "=", "append", "(", "s", ",", "vm", ".", "Name", "(", ")", ")", "\n", "}", "\n", "return", "strings", ".", "Join", "(", "s", ",", "\"", "\"", ")", "\n", "}" ]
398
all-399
[ "/", "*", "NewFrame", "creates", "a", "new", "frame", ".", "view", "-", "is", "a", "View", "that", "manages", "the", "control", "parent", "-", "is", "container", "that", "keeps", "the", "control", ".", "The", "same", "View", "can", "be", "a", "view", "and", "a", "parent", "at", "the", "same", "time", ".", "width", "and", "heigth", "-", "are", "minimal", "size", "of", "the", "control", ".", "bs", "-", "type", "of", "border", ":", "no", "border", "single", "or", "double", ".", "scale", "-", "the", "way", "of", "scaling", "the", "control", "when", "the", "parent", "is", "resized", ".", "Use", "DoNotScale", "constant", "if", "the", "control", "should", "keep", "its", "original", "size", "." ]
[ "func", "CreateFrame", "(", "parent", "Control", ",", "<mask>", ",", "height", "int", ",", "bs", "BorderStyle", ",", "scale", "int", ")", "*", "Frame", "{", "f", ":=", "new", "(", "Frame", ")", "\n", "f", ".", "BaseControl", "=", "NewBaseControl", "(", ")", "\n\n", "if", "width", "==", "AutoSize", "{", "width", "=", "5", "\n", "}", "\n", "if", "height", "==", "AutoSize", "{", "height", "=", "3", "\n", "}", "\n\n", "if", "bs", "==", "BorderAuto", "{", "bs", "=", "BorderNone", "\n", "}", "\n\n", "f", ".", "SetSize", "(", "width", ",", "height", ")", "\n", "f", ".", "SetConstraints", "(", "width", ",", "height", ")", "\n", "f", ".", "border", "=", "bs", "\n", "f", ".", "parent", "=", "parent", "\n", "f", ".", "SetTabStop", "(", "false", ")", "\n", "f", ".", "scale", "=", "scale", "\n\n", "f", ".", "gapX", ",", "f", ".", "gapY", "=", "0", ",", "0", "\n", "if", "bs", "==", "BorderNone", "{", "f", ".", "padX", ",", "f", ".", "padY", "=", "0", ",", "0", "\n", "}", "else", "{", "f", ".", "padX", ",", "f", ".", "padY", "=", "1", ",", "1", "\n", "}", "\n\n", "if", "parent", "!=", "nil", "{", "parent", ".", "AddChild", "(", "f", ")", "\n", "}", "\n\n", "return", "f", "\n", "}" ]
399
all-400
[ "Delete", "an", "article" ]
[ "func", "Delete", "(", "c", "*", "gin", ".", "Context", ")", "{", "db", ":=", "c", ".", "MustGet", "(", "\"", "\"", ")", ".", "(", "*", "mgo", ".", "Database", ")", "\n", "<mask>", ":=", "bson", ".", "M", "{", "\"", "\"", ":", "bson", ".", "ObjectIdHex", "(", "c", ".", "Param", "(", "\"", "\"", ")", ")", "}", "\n", "err", ":=", "db", ".", "C", "(", "models", ".", "CollectionArticle", ")", ".", "Remove", "(", "query", ")", "\n", "if", "err", "!=", "nil", "{", "c", ".", "Error", "(", "err", ")", "\n", "}", "\n", "c", ".", "Redirect", "(", "http", ".", "StatusMovedPermanently", ",", "\"", "\"", ")", "\n", "}" ]