id
int32
0
25.3k
idx
stringlengths
5
9
nl_tokens
sequencelengths
1
418
pl_tokens
sequencelengths
22
4.98k
9,300
all-9301
[ "GetResources", "returns", "the", "list", "of", "task", "resources", "from", "ResourcesMap" ]
[ "func", "(", "task", "*", "Task", ")", "GetResources", "(", ")", "[", "]", "taskresource", ".", "TaskResource", "{", "<mask>", ".", "lock", ".", "RLock", "(", ")", "\n", "defer", "task", ".", "lock", ".", "RUnlock", "(", ")", "\n", "return", "task", ".", "getResourcesUnsafe", "(", ")", "\n", "}" ]
9,301
all-9302
[ "expect", "consumes", "an", "event", "from", "the", "event", "stream", "and", "checks", "that", "it", "s", "of", "the", "expected", "type", "." ]
[ "func", "(", "p", "*", "<mask>", ")", "expect", "(", "e", "yaml_event_type_t", ")", "{", "if", "p", ".", "event", ".", "typ", "==", "yaml_NO_EVENT", "{", "if", "!", "yaml_parser_parse", "(", "&", "p", ".", "parser", ",", "&", "p", ".", "event", ")", "{", "p", ".", "fail", "(", ")", "\n", "}", "\n", "}", "\n", "if", "p", ".", "event", ".", "typ", "==", "yaml_STREAM_END_EVENT", "{", "failf", "(", "\"", "\"", ")", "\n", "}", "\n", "if", "p", ".", "event", ".", "typ", "!=", "e", "{", "p", ".", "parser", ".", "problem", "=", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "e", ",", "p", ".", "event", ".", "typ", ")", "\n", "p", ".", "fail", "(", ")", "\n", "}", "\n", "yaml_event_delete", "(", "&", "p", ".", "event", ")", "\n", "p", ".", "event", ".", "typ", "=", "yaml_NO_EVENT", "\n", "}" ]
9,302
all-9303
[ "InsertNewTable", "creates", "a", "new", "empty", "table", "for", "the", "given", "project", "and", "dataset", "with", "the", "field", "name", "/", "types", "defined", "in", "the", "fields", "map" ]
[ "func", "(", "c", "*", "<mask>", ")", "InsertNewTable", "(", "projectID", ",", "datasetID", ",", "tableName", "string", ",", "fields", "map", "[", "string", "]", "string", ")", "error", "{", "// If the table already exists, an error will be raised here.", "service", ",", "err", ":=", "c", ".", "connect", "(", ")", "\n", "if", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n\n", "// build the table schema", "schema", ":=", "&", "bigquery", ".", "TableSchema", "{", "}", "\n", "for", "k", ",", "v", ":=", "range", "fields", "{", "schema", ".", "Fields", "=", "append", "(", "schema", ".", "Fields", ",", "&", "bigquery", ".", "TableFieldSchema", "{", "Name", ":", "k", ",", "Type", ":", "v", "}", ")", "\n", "}", "\n\n", "// build the table to insert", "table", ":=", "&", "bigquery", ".", "Table", "{", "}", "\n", "table", ".", "Schema", "=", "schema", "\n\n", "tr", ":=", "&", "bigquery", ".", "TableReference", "{", "}", "\n", "tr", ".", "DatasetId", "=", "datasetID", "\n", "tr", ".", "ProjectId", "=", "projectID", "\n", "tr", ".", "TableId", "=", "tableName", "\n\n", "table", ".", "TableReference", "=", "tr", "\n\n", "_", ",", "err", "=", "service", ".", "Tables", ".", "Insert", "(", "projectID", ",", "datasetID", ",", "table", ")", ".", "Do", "(", ")", "\n", "if", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n\n", "return", "nil", "\n", "}" ]
9,303
all-9304
[ "InsertStrings", "inserts", "a", "new", "row", "for", "each", "of", "the", "given", "strings", "using", "the", "given", "insert", "statement", "template", "which", "must", "define", "exactly", "one", "insertion", "column", "and", "one", "substitution", "placeholder", "for", "the", "values", ".", "For", "example", ":", "InsertStrings", "(", "tx", "INSERT", "INTO", "foo", "(", "name", ")", "VALUES", "%s", "[]", "string", "{", "bar", "}", ")", "." ]
[ "func", "InsertStrings", "(", "tx", "*", "sql", ".", "Tx", ",", "stmt", "string", ",", "values", "[", "]", "string", ")", "error", "{", "n", ":=", "len", "(", "values", ")", "\n\n", "if", "n", "==", "0", "{", "return", "nil", "\n", "}", "\n\n", "params", ":=", "<mask>", "(", "[", "]", "string", ",", "n", ")", "\n", "args", ":=", "make", "(", "[", "]", "interface", "{", "}", ",", "n", ")", "\n", "for", "i", ",", "value", ":=", "range", "values", "{", "params", "[", "i", "]", "=", "\"", "\"", "\n", "args", "[", "i", "]", "=", "value", "\n", "}", "\n\n", "stmt", "=", "fmt", ".", "Sprintf", "(", "stmt", ",", "strings", ".", "Join", "(", "params", ",", "\"", "\"", ")", ")", "\n", "_", ",", "err", ":=", "tx", ".", "Exec", "(", "stmt", ",", "args", "...", ")", "\n", "return", "err", "\n", "}" ]
9,304
all-9305
[ "StrLength", "param", "is", "a", "string", "length", "must", "be", "n" ]
[ "func", "(", "c", "*", "Controller", ")", "StrLength", "(", "fieldName", "string", ",", "p", "<mask>", "{", "}", ",", "n", "int", ")", "string", "{", "if", "p", "==", "nil", "{", "p", "=", "\"", "\"", "\n", "}", "\n", "v", ",", "ok", ":=", "p", ".", "(", "string", ")", "\n", "if", "ok", "==", "false", "{", "panic", "(", "(", "&", "ValidationError", "{", "}", ")", ".", "New", "(", "fieldName", "+", "\"", "v", "I", "oa(n)))", "", "", "", "", "", "", "", "\n", "}", "\n", "b", ":=", "c", ".", "Validate", ".", "Length", "(", "v", ",", "n", ")", "\n", "if", "b", "==", "false", "{", "panic", "(", "(", "&", "ValidationError", "{", "}", ")", ".", "New", "(", "fieldName", "+", "\"", "v", "I", "oa(n)))", "", "", "", "", "", "", "", "\n", "}", "\n", "return", "v", "\n", "}" ]
9,305
all-9306
[ "Remove", "Remove" ]
[ "func", "(", "ms", "*", "MongoStore", ")", "Remove", "(", "words", "...", "string", ")", "error", "{", "if", "len", "(", "words", ")", "==", "0", "{", "return", "nil", "\n", "}", "\n\n", "var", "err", "error", "\n", "<mask>", ".", "c", "(", "func", "(", "c", "*", "mgo", ".", "Collection", ")", "{", "_", ",", "err", "=", "c", ".", "RemoveAll", "(", "bson", ".", "M", "{", "\"", "\"", ":", "bson", ".", "M", "{", "\"", "\"", ":", "words", "}", "}", ")", "\n", "}", ")", "\n", "if", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n\n", "atomic", ".", "AddUint64", "(", "&", "ms", ".", "version", ",", "1", ")", "\n", "return", "nil", "\n", "}" ]
9,306
all-9307
[ "Inject", "implements", "the", "Injector", "interface" ]
[ "func", "(", "t", "*", "TextMapPropagator", ")", "Inject", "(", "spanContext", "MockSpanContext", ",", "carrier", "interface", "{", "}", ")", "error", "{", "writer", ",", "ok", ":=", "carrier", ".", "(", "opentracing", ".", "TextMapWriter", ")", "\n", "if", "!", "ok", "{", "return", "opentracing", ".", "ErrInvalidCarrier", "\n", "}", "\n", "// Ids:", "writer", ".", "Set", "(", "mockTextMapIdsPrefix", "+", "\"", "\"", ",", "strconv", ".", "Itoa", "(", "spanContext", ".", "TraceID", ")", ")", "\n", "writer", ".", "Set", "(", "mockTextMapIdsPrefix", "+", "\"", "\"", ",", "strconv", ".", "Itoa", "(", "spanContext", ".", "SpanID", ")", ")", "\n", "writer", ".", "Set", "(", "mockTextMapIdsPrefix", "+", "\"", "\"", ",", "fmt", ".", "Sprint", "(", "spanContext", ".", "Sampled", ")", ")", "\n", "// Baggage:", "for", "baggageKey", ",", "baggageVal", ":=", "<mask>", "spanContext", ".", "Baggage", "{", "safeVal", ":=", "baggageVal", "\n", "if", "t", ".", "HTTPHeaders", "{", "safeVal", "=", "url", ".", "QueryEscape", "(", "baggageVal", ")", "\n", "}", "\n", "writer", ".", "Set", "(", "mockTextMapBaggagePrefix", "+", "baggageKey", ",", "safeVal", ")", "\n", "}", "\n", "return", "nil", "\n", "}" ]
9,307
all-9308
[ "lintCounter", "detects", "issues", "specific", "to", "counters", "as", "well", "as", "patterns", "that", "should", "only", "be", "used", "with", "counters", "." ]
[ "func", "lintCounter", "(", "mf", "dto", ".", "MetricFamily", ")", "[", "]", "Problem", "{", "var", "problems", "problems", "\n\n", "isCounter", ":=", "mf", ".", "GetType", "(", ")", "==", "dto", ".", "MetricType_COUNTER", "\n", "isUntyped", ":=", "mf", ".", "GetType", "(", ")", "==", "dto", ".", "MetricType_UNTYPED", "\n", "hasTotalSuffix", ":=", "strings", ".", "HasSuffix", "(", "mf", ".", "GetName", "(", ")", ",", "\"", "\"", ")", "\n\n", "<mask>", "{", "case", "isCounter", "&&", "!", "hasTotalSuffix", ":", "problems", ".", "Add", "(", "mf", ",", "`counter metrics should have \"_total\" suffix`", ")", "\n", "case", "!", "isUntyped", "&&", "!", "isCounter", "&&", "hasTotalSuffix", ":", "problems", ".", "Add", "(", "mf", ",", "`non-counter metrics should not have \"_total\" suffix`", ")", "\n", "}", "\n\n", "return", "problems", "\n", "}" ]
9,308
all-9309
[ "SetErrorHandlerFunc", "returns", "Middleware", "that", "can", "be", "used", "to", "set", "the", "error", "handler" ]
[ "func", "SetErrorHandlerFunc", "(", "status", "int", ",", "handler", "func", "(", "ctx", "context", ".", "Context", ",", "w", "http", ".", "ResponseWriter", ",", "r", "*", "http", ".", "Request", ",", "<mask>", "int", ",", "err", "error", ")", ")", "scaffold", ".", "Middleware", "{", "return", "SetErrorHandler", "(", "status", ",", "ErrorHandlerFunc", "(", "handler", ")", ")", "\n", "}" ]
9,309
all-9310
[ "isDialErrorRetriable", "determines", "whether", "or", "not", "a", "dialer", "should", "retry", "a", "failed", "connection", "attempt", "by", "examining", "the", "connection", "error", "to", "see", "if", "it", "is", "one", "of", "the", "following", "error", "types", ":", "*", "Timeout", "*", "Temporary", "*", "ECONNREFUSED", "*", "ECONNRESET" ]
[ "func", "isDialErrorRetriable", "(", "err", "error", ")", "bool", "{", "opErr", ",", "isOpErr", ":=", "err", ".", "(", "*", "net", ".", "OpError", ")", "\n", "if", "!", "isOpErr", "{", "return", "false", "\n", "}", "\n", "if", "opErr", ".", "Timeout", "(", ")", "||", "opErr", ".", "Temporary", "(", ")", "{", "return", "true", "\n", "}", "\n", "sysErr", ",", "isSysErr", ":=", "opErr", ".", "Err", ".", "(", "*", "os", ".", "SyscallError", ")", "\n", "if", "!", "isSysErr", "{", "return", "false", "\n", "}", "\n", "switch", "sysErr", ".", "Err", "{", "case", "syscall", ".", "ECONNREFUSED", ",", "syscall", ".", "ECONNRESET", ":", "return", "<mask>", "\n", "}", "\n", "return", "false", "\n", "}" ]
9,310
all-9311
[ "FillStroke", "first", "fills", "the", "paths", "and", "than", "strokes", "them" ]
[ "func", "(", "gc", "*", "GraphicContext", ")", "FillStroke", "(", "paths", "...", "*", "draw2d", ".", "Path", ")", "{", "gc", ".", "drawPaths", "(", "filled", "|", "stroked", ",", "paths", "...", ")", "\n", "gc", ".", "Current", ".", "<mask>", ".", "Clear", "(", ")", "\n", "}" ]
9,311
all-9312
[ "UnmarshalBinary", "interface", "implementation" ]
[ "func", "(", "m", "*", "RouteWrapper", ")", "UnmarshalBinary", "(", "b", "[", "]", "byte", ")", "error", "{", "<mask>", "res", "RouteWrapper", "\n", "if", "err", ":=", "swag", ".", "ReadJSON", "(", "b", ",", "&", "res", ")", ";", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n", "*", "m", "=", "res", "\n", "return", "nil", "\n", "}" ]
9,312
all-9313
[ "GetProperty", "is", "a", "wrapper", "around", "gtk_style_context_get_property", "()", "." ]
[ "func", "(", "v", "*", "StyleContext", ")", "GetProperty", "(", "property", "string", ",", "<mask>", "StateFlags", ")", "(", "interface", "{", "}", ",", "error", ")", "{", "cstr", ":=", "(", "*", "C", ".", "gchar", ")", "(", "C", ".", "CString", "(", "property", ")", ")", "\n", "defer", "C", ".", "free", "(", "unsafe", ".", "Pointer", "(", "cstr", ")", ")", "\n\n", "var", "gval", "C", ".", "GValue", "\n", "C", ".", "gtk_style_context_get_property", "(", "v", ".", "native", "(", ")", ",", "cstr", ",", "C", ".", "GtkStateFlags", "(", "state", ")", ",", "&", "gval", ")", "\n", "val", ":=", "glib", ".", "ValueFromNative", "(", "unsafe", ".", "Pointer", "(", "&", "gval", ")", ")", "\n", "return", "val", ".", "GoValue", "(", ")", "\n", "}" ]
9,313
all-9314
[ "GetUInt", "is", "a", "wrapper", "around", "g_settings_get_uint", "()", "." ]
[ "func", "(", "v", "*", "Settings", ")", "GetUInt", "(", "name", "string", ")", "uint", "{", "cstr1", ":=", "(", "*", "C", ".", "gchar", ")", "(", "C", ".", "CString", "(", "name", ")", ")", "\n", "defer", "C", ".", "<mask>", "(", "unsafe", ".", "Pointer", "(", "cstr1", ")", ")", "\n\n", "return", "uint", "(", "C", ".", "g_settings_get_uint", "(", "v", ".", "native", "(", ")", ",", "cstr1", ")", ")", "\n", "}" ]
9,314
all-9315
[ "MarshalJSON", "supports", "json", ".", "Marshaler", "interface" ]
[ "func", "(", "v", "GetMediaQueriesParams", ")", "MarshalJSON", "(", ")", "(", "[", "]", "<mask>", ",", "error", ")", "{", "w", ":=", "jwriter", ".", "Writer", "{", "}", "\n", "easyjsonC5a4559bEncodeGithubComChromedpCdprotoCss40", "(", "&", "w", ",", "v", ")", "\n", "return", "w", ".", "Buffer", ".", "BuildBytes", "(", ")", ",", "w", ".", "Error", "\n", "}" ]
9,315
all-9316
[ "MutateAllowTrust", "for", "Authorize", "sets", "the", "AllowTrustOp", "s", "Authorize", "field" ]
[ "func", "(", "m", "Authorize", ")", "MutateAllowTrust", "(", "o", "*", "xdr", ".", "AllowTrustOp", ")", "error", "{", "o", ".", "Authorize", "=", "m", ".", "<mask>", "\n", "return", "nil", "\n", "}" ]
9,316
all-9317
[ "StructName", "-", "gets", "struct", "name", "for", "property" ]
[ "func", "(", "v", "*", "Record", ")", "StructName", "(", "i", "int", ",", "packagename", "string", ",", "properties", "[", "]", "string", ")", "(", "structname", "string", ")", "{", "if", "i", ">", "0", "{", "currentNode", ":=", "v", ".", "Slice", "[", "i", "-", "1", "]", "\n", "structname", "=", "FormatName", "(", "currentNode", ")", "\n", "if", "i", ">", "1", "{", "parentNames", ":=", "v", ".", "FindAllParentsOfSameNamedElement", "(", "currentNode", ",", "<mask>", ")", "\n", "if", "len", "(", "parentNames", ")", ">", "1", "{", "structname", "=", "FormatName", "(", "v", ".", "Slice", "[", "i", "-", "2", "]", "+", "\"", "\"", "+", "currentNode", ")", "\n", "}", "\n", "}", "\n", "}", "else", "{", "structname", "=", "FormatName", "(", "packagename", "+", "\"", "\"", ")", "\n", "}", "\n", "return", "\n", "}" ]
9,317
all-9318
[ "Close", "closes", "the", "current", "WAL", "file", "and", "directory", "." ]
[ "func", "(", "w", "*", "WAL", ")", "Close", "(", ")", "error", "{", "w", ".", "mu", ".", "Lock", "(", ")", "\n", "defer", "w", ".", "mu", ".", "Unlock", "(", ")", "\n\n", "if", "w", ".", "fp", "!=", "nil", "{", "w", ".", "fp", ".", "Close", "(", ")", "\n", "w", ".", "fp", "=", "nil", "\n", "}", "\n\n", "if", "w", ".", "tail", "(", ")", "!=", "nil", "{", "if", "err", ":=", "w", ".", "sync", "(", ")", ";", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n", "}", "\n", "for", "_", ",", "l", ":=", "range", "w", ".", "<mask>", "{", "if", "l", "==", "nil", "{", "continue", "\n", "}", "\n", "if", "err", ":=", "l", ".", "Close", "(", ")", ";", "err", "!=", "nil", "{", "if", "w", ".", "lg", "!=", "nil", "{", "w", ".", "lg", ".", "Warn", "(", "\"", "\"", ",", "zap", ".", "Error", "(", "err", ")", ")", "\n", "}", "else", "{", "plog", ".", "Errorf", "(", "\"", "\"", ",", "err", ")", "\n", "}", "\n", "}", "\n", "}", "\n\n", "return", "w", ".", "dirFile", ".", "Close", "(", ")", "\n", "}" ]
9,318
all-9319
[ "Run", "is", "the", "main", "path", "of", "execution", "for", "the", "controller", "loop", "." ]
[ "func", "(", "c", "*", "Controller", ")", "Run", "(", "stopCh", "<-", "chan", "struct", "{", "}", ")", "{", "// handle a panic with logging and exiting", "defer", "utilruntime", ".", "HandleCrash", "(", ")", "\n", "// ignore new items in the queue but when all goroutines", "// have completed existing items then shutdown", "defer", "c", ".", "queue", ".", "ShutDown", "(", ")", "\n\n", "logrus", ".", "Info", "(", "\"", "\"", ")", "\n", "c", ".", "informer", ".", "Informer", "(", ")", ".", "AddEventHandler", "(", "cache", ".", "ResourceEventHandlerFuncs", "{", "AddFunc", ":", "func", "(", "obj", "interface", "{", "}", ")", "{", "key", ",", "err", ":=", "cache", ".", "MetaNamespaceKeyFunc", "(", "obj", ")", "\n", "logrus", ".", "WithField", "(", "\"", "\"", ",", "key", ")", ".", "Infof", "(", "\"", "\"", ")", "\n", "if", "err", "!=", "nil", "{", "logrus", ".", "WithError", "(", "err", ")", ".", "Error", "(", "\"", "\"", ")", "\n", "return", "\n", "}", "\n", "c", ".", "queue", ".", "AddRateLimited", "(", "key", ")", "\n", "}", ",", "UpdateFunc", ":", "func", "(", "oldObj", ",", "newObj", "interface", "{", "}", ")", "{", "key", ",", "err", ":=", "cache", ".", "MetaNamespaceKeyFunc", "(", "newObj", ")", "\n", "logrus", ".", "WithField", "(", "\"", "\"", ",", "key", ")", ".", "Infof", "(", "\"", "\"", ")", "\n", "if", "err", "!=", "nil", "{", "logrus", ".", "WithError", "(", "err", ")", ".", "<mask>", "(", "\"", "\"", ")", "\n", "return", "\n", "}", "\n", "c", ".", "queue", ".", "AddRateLimited", "(", "key", ")", "\n", "}", ",", "}", ")", "\n\n", "// run the informer to start listing and watching resources", "go", "c", ".", "informer", ".", "Informer", "(", ")", ".", "Run", "(", "stopCh", ")", "\n\n", "// do the initial synchronization (one time) to populate resources", "if", "!", "cache", ".", "WaitForCacheSync", "(", "stopCh", ",", "c", ".", "HasSynced", ")", "{", "utilruntime", ".", "HandleError", "(", "fmt", ".", "Errorf", "(", "\"", "\"", ")", ")", "\n", "return", "\n", "}", "\n", "logrus", ".", "Info", "(", "\"", "\"", ")", "\n\n", "// run the runWorker method every second with a stop channel", "for", "i", ":=", "0", ";", "i", "<", "c", ".", "numWorkers", ";", "i", "++", "{", "go", "wait", ".", "Until", "(", "c", ".", "runWorker", ",", "time", ".", "Second", ",", "stopCh", ")", "\n", "}", "\n\n", "logrus", ".", "Infof", "(", "\"", "\"", ",", "c", ".", "numWorkers", ")", "\n", "<-", "stopCh", "\n", "logrus", ".", "Info", "(", "\"", "\"", ")", "\n", "}" ]
9,319
all-9320
[ "Returns", "the", "location", "of", "an", "attribute", "variable" ]
[ "func", "GetAttribLocation", "(", "program", "uint32", ",", "name", "*", "uint8", ")", "int32", "{", "ret", ":=", "C", ".", "glowGetAttribLocation", "(", "gpGetAttribLocation", ",", "(", "C", ".", "GLuint", ")", "(", "program", ")", ",", "(", "*", "C", ".", "GLchar", ")", "(", "unsafe", ".", "Pointer", "(", "<mask>", ")", ")", ")", "\n", "return", "(", "int32", ")", "(", "ret", ")", "\n", "}" ]
9,320
all-9321
[ "Errorf", "creates", "a", "new", "error", "with", "the", "given", "message", ".", "You", "can", "use", "it", "as", "a", "drop", "-", "in", "replacement", "for", "fmt", ".", "Errorf", "()", "to", "provide", "descriptive", "errors", "in", "return", "values", "." ]
[ "func", "Errorf", "(", "<mask>", "string", ",", "a", "...", "interface", "{", "}", ")", "*", "Error", "{", "return", "Wrap", "(", "fmt", ".", "Errorf", "(", "format", ",", "a", "...", ")", ",", "1", ")", "\n", "}" ]
9,321
all-9322
[ "virtualEthernetCardString", "prints", "a", "string", "representation", "of", "the", "ethernet", "device", "passed", "in", "." ]
[ "func", "virtualEthernetCardString", "(", "d", "types", ".", "BaseVirtualEthernetCard", ")", "string", "{", "switch", "d", ".", "(", "<mask>", ")", "{", "case", "*", "types", ".", "VirtualE1000", ":", "return", "networkInterfaceSubresourceTypeE1000", "\n", "case", "*", "types", ".", "VirtualE1000e", ":", "return", "networkInterfaceSubresourceTypeE1000e", "\n", "case", "*", "types", ".", "VirtualPCNet32", ":", "return", "networkInterfaceSubresourceTypePCNet32", "\n", "case", "*", "types", ".", "VirtualSriovEthernetCard", ":", "return", "networkInterfaceSubresourceTypeSriov", "\n", "case", "*", "types", ".", "VirtualVmxnet2", ":", "return", "networkInterfaceSubresourceTypeVmxnet2", "\n", "case", "*", "types", ".", "VirtualVmxnet3", ":", "return", "networkInterfaceSubresourceTypeVmxnet3", "\n", "}", "\n", "return", "networkInterfaceSubresourceTypeUnknown", "\n", "}" ]
9,322
all-9323
[ "addRemoteFromRequest", "adds", "a", "remote", "peer", "according", "to", "an", "http", "request", "header" ]
[ "func", "addRemoteFromRequest", "(", "tr", "Transporter", ",", "r", "*", "http", ".", "Request", ")", "{", "if", "from", ",", "err", ":=", "types", ".", "IDFromString", "(", "r", ".", "Header", ".", "Get", "(", "\"", "\"", ")", ")", ";", "err", "==", "nil", "{", "if", "urls", ":=", "r", ".", "<mask>", ".", "Get", "(", "\"", "\"", ")", ";", "urls", "!=", "\"", "\"", "{", "tr", ".", "AddRemote", "(", "from", ",", "strings", ".", "Split", "(", "urls", ",", "\"", "\"", ")", ")", "\n", "}", "\n", "}", "\n", "}" ]
9,323
all-9324
[ "RemoveImageName", "removes", "image", "name", "from", "image", "state" ]
[ "func", "(", "imageState", "*", "ImageState", ")", "RemoveImageName", "(", "containerImageName", "string", ")", "{", "imageState", ".", "lock", ".", "Lock", "(", ")", "\n", "defer", "imageState", ".", "lock", ".", "Unlock", "(", ")", "\n", "for", "i", ",", "imageName", ":=", "<mask>", "imageState", ".", "Image", ".", "Names", "{", "if", "imageName", "==", "containerImageName", "{", "imageState", ".", "Image", ".", "Names", "=", "append", "(", "imageState", ".", "Image", ".", "Names", "[", ":", "i", "]", ",", "imageState", ".", "Image", ".", "Names", "[", "i", "+", "1", ":", "]", "...", ")", "\n", "}", "\n", "}", "\n", "}" ]
9,324
all-9325
[ "Command", "line", "used", "to", "run", "tool" ]
[ "func", "commandLine", "(", ")", "string", "{", "return", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "os", ".", "Args", "[", "0", "]", ",", "strings", ".", "Join", "(", "<mask>", ".", "Args", "[", "1", ":", "]", ",", "\"", "\"", ")", ")", "\n", "}" ]
9,325
all-9326
[ "RenameContainer", "renames", "the", "MAAS", "device", "for", "the", "container", "without", "releasing", "any", "allocation" ]
[ "func", "(", "c", "*", "<mask>", ")", "RenameContainer", "(", "name", "string", ",", "newName", "string", ")", "error", "{", "device", ",", "err", ":=", "c", ".", "getDevice", "(", "name", ")", "\n", "if", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n\n", "// FIXME: We should convince the Juju folks to implement an Update() method on Device", "uri", ",", "err", ":=", "url", ".", "Parse", "(", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "c", ".", "url", ",", "device", ".", "SystemID", "(", ")", ")", ")", "\n", "if", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n\n", "values", ":=", "url", ".", "Values", "{", "}", "\n", "values", ".", "Set", "(", "\"", "\"", ",", "newName", ")", "\n\n", "_", ",", "err", "=", "c", ".", "srvRaw", ".", "Put", "(", "uri", ",", "values", ")", "\n", "if", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n\n", "return", "nil", "\n", "}" ]
9,326
all-9327
[ "Assign", "produces", "a", "command", "to", "assign", "a", "value", "to", "a", "variable", "within", "a", "go", "session" ]
[ "func", "Assign", "(", "symbol", "string", ",", "value", "interface", "{", "}", ")", "(", "[", "]", "byte", ",", "error", ")", "{", "switch", "value", ".", "(", "type", ")", "{", "case", "[", "]", "float64", ":", "return", "assignDoubleArray", "(", "symbol", ",", "value", ".", "(", "[", "]", "float64", ")", ")", "\n", "case", "[", "]", "int32", ":", "return", "assignIntArray", "(", "symbol", ",", "value", ".", "(", "[", "]", "int32", ")", ")", "\n", "case", "[", "]", "string", ":", "return", "assignStrArray", "(", "symbol", ",", "value", ".", "(", "[", "]", "string", ")", ")", "\n", "<mask>", "[", "]", "byte", ":", "return", "assignByteArray", "(", "symbol", ",", "value", ".", "(", "[", "]", "byte", ")", ")", "\n", "case", "string", ":", "return", "assignStr", "(", "symbol", ",", "value", ".", "(", "string", ")", ")", "\n", "case", "int32", ":", "return", "assignInt", "(", "symbol", ",", "value", ".", "(", "int32", ")", ")", "\n", "case", "float64", ":", "return", "assignDouble", "(", "symbol", ",", "value", ".", "(", "float64", ")", ")", "\n", "default", ":", "return", "nil", ",", "errors", ".", "New", "(", "\"", "\"", ")", "\n", "}", "\n", "}" ]
9,327
all-9328
[ "Do", "executes", "ApplicationCache", ".", "getManifestForFrame", "against", "the", "provided", "context", ".", "returns", ":", "manifestURL", "-", "Manifest", "URL", "for", "document", "in", "the", "given", "frame", "." ]
[ "func", "(", "p", "*", "GetManifestForFrameParams", ")", "Do", "(", "ctx", "context", ".", "Context", ")", "(", "manifestURL", "string", ",", "err", "error", ")", "{", "// execute", "var", "res", "GetManifestForFrameReturns", "\n", "err", "=", "cdp", ".", "Execute", "(", "ctx", ",", "CommandGetManifestForFrame", ",", "p", ",", "&", "res", ")", "\n", "if", "err", "!=", "nil", "{", "return", "\"", "\"", ",", "err", "\n", "}", "\n\n", "return", "<mask>", ".", "ManifestURL", ",", "nil", "\n", "}" ]
9,328
all-9329
[ "UnmarshalJSON", "supports", "json", ".", "Unmarshaler", "interface" ]
[ "func", "(", "v", "*", "NavigationEntry", ")", "UnmarshalJSON", "(", "<mask>", "[", "]", "byte", ")", "error", "{", "r", ":=", "jlexer", ".", "Lexer", "{", "Data", ":", "data", "}", "\n", "easyjsonC5a4559bDecodeGithubComChromedpCdprotoPage24", "(", "&", "r", ",", "v", ")", "\n", "return", "r", ".", "Error", "(", ")", "\n", "}" ]
9,329
all-9330
[ "Activate", "is", "a", "wrapper", "around", "g_action_activate" ]
[ "func", "(", "v", "*", "<mask>", ")", "Activate", "(", "parameter", "*", "Variant", ")", "{", "C", ".", "g_action_activate", "(", "v", ".", "native", "(", ")", ",", "parameter", ".", "native", "(", ")", ")", "\n", "}" ]
9,330
all-9331
[ "RemoveDOMStorageItem", "[", "no", "description", "]", ".", "See", ":", "https", ":", "//", "chromedevtools", ".", "github", ".", "io", "/", "devtools", "-", "protocol", "/", "tot", "/", "DOMStorage#method", "-", "removeDOMStorageItem", "parameters", ":", "storageID", "key" ]
[ "func", "RemoveDOMStorageItem", "(", "storageID", "*", "StorageID", ",", "key", "string", ")", "*", "RemoveDOMStorageItemParams", "{", "return", "&", "RemoveDOMStorageItemParams", "{", "StorageID", ":", "storageID", ",", "Key", ":", "<mask>", ",", "}", "\n", "}" ]
9,331
all-9332
[ "AttachPersistentDisk", "updates", "the", "agent", "settings", "in", "order", "to", "add", "an", "attached", "persistent", "disk", "." ]
[ "func", "(", "as", "AgentSettings", ")", "AttachPersistentDisk", "(", "diskID", "string", ",", "updateSetting", "[", "]", "byte", ")", "(", "AgentSettings", ",", "error", ")", "{", "persistenDiskSettings", ":=", "make", "(", "map", "[", "string", "]", "PersistentSettings", ")", "\n\n", "var", "persistentSetting", "PersistentSettings", "\n", "err", ":=", "json", ".", "Unmarshal", "(", "updateSetting", ",", "&", "persistentSetting", ")", "\n", "if", "err", "!=", "nil", "{", "return", "as", ",", "err", "\n", "}", "\n\n", "persistenDiskSettings", "[", "diskID", "]", "=", "persistentSetting", "\n", "<mask>", ".", "Disks", ".", "Persistent", "=", "persistenDiskSettings", "\n\n", "return", "as", ",", "nil", "\n", "}" ]
9,332
all-9333
[ "Labels", "returns", "a", "copy", "of", "the", "set", "of", "all", "public", "labels", "of", "the", "target", "." ]
[ "func", "(", "t", "*", "Target", ")", "Labels", "(", ")", "labels", ".", "Labels", "{", "lset", ":=", "make", "(", "labels", ".", "Labels", ",", "0", ",", "len", "(", "t", ".", "labels", ")", ")", "\n", "for", "_", ",", "l", ":=", "range", "t", ".", "labels", "{", "if", "!", "strings", ".", "HasPrefix", "(", "l", ".", "<mask>", ",", "model", ".", "ReservedLabelPrefix", ")", "{", "lset", "=", "append", "(", "lset", ",", "l", ")", "\n", "}", "\n", "}", "\n", "return", "lset", "\n", "}" ]
9,333
all-9334
[ "----------------------------------------", "Unsigned" ]
[ "func", "EncodeByte", "(", "w", "io", ".", "<mask>", ",", "b", "byte", ")", "(", "err", "error", ")", "{", "return", "EncodeUvarint", "(", "w", ",", "uint64", "(", "b", ")", ")", "\n", "}" ]
9,334
all-9335
[ "NewFileCache", "creates", "a", "new", "FileCache", "which", "stores", "caches", "underneath", "the", "directory", "specified", "by", "dir" ]
[ "func", "NewFileCache", "(", "dir", "<mask>", ")", "(", "*", "FileCache", ",", "error", ")", "{", "f", ":=", "&", "FileCache", "{", "dir", "}", "\n", "return", "f", ",", "nil", "\n", "}" ]
9,335
all-9336
[ "Decode", "implements", "binary", "decoder", "for", "snapshot", "metadata" ]
[ "func", "(", "s", "*", "Snapshot", ")", "Decode", "(", "buf", "[", "]", "byte", ",", "r", "io", ".", "Reader", ")", "error", "{", "if", "_", ",", "err", ":=", "<mask>", ".", "ReadFull", "(", "r", ",", "buf", "[", "0", ":", "4", "]", ")", ";", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n", "s", ".", "sn", "=", "binary", ".", "BigEndian", ".", "Uint32", "(", "buf", "[", "0", ":", "4", "]", ")", "\n", "return", "nil", "\n", "}" ]
9,336
all-9337
[ "NewMockImageManager", "creates", "a", "new", "mock", "instance" ]
[ "func", "NewMockImageManager", "(", "ctrl", "*", "gomock", ".", "<mask>", ")", "*", "MockImageManager", "{", "mock", ":=", "&", "MockImageManager", "{", "ctrl", ":", "ctrl", "}", "\n", "mock", ".", "recorder", "=", "&", "MockImageManagerMockRecorder", "{", "mock", "}", "\n", "return", "mock", "\n", "}" ]
9,337
all-9338
[ "ReplacePatternF", "is", "the", "filter", "form", "of", "ReplaceRegexp", "." ]
[ "func", "ReplacePatternF", "(", "pattern", ",", "repl", "string", ")", "func", "(", "string", ")", "string", "{", "return", "func", "(", "s", "string", ")", "string", "{", "return", "ReplacePattern", "(", "s", ",", "<mask>", ",", "repl", ")", "\n", "}", "\n", "}" ]
9,338
all-9339
[ "Validate", "checks", "a", "Config", "instance", ".", "It", "will", "return", "a", "sarama", ".", "ConfigurationError", "if", "the", "specified", "values", "don", "t", "make", "sense", "." ]
[ "func", "(", "c", "*", "Config", ")", "Validate", "(", ")", "error", "{", "if", "c", ".", "Group", ".", "Heartbeat", ".", "Interval", "%", "time", ".", "Millisecond", "!=", "0", "{", "sarama", ".", "Logger", ".", "Println", "(", "\"", "\"", ")", "\n", "}", "\n", "if", "c", ".", "Group", ".", "Session", ".", "Timeout", "%", "time", ".", "Millisecond", "!=", "0", "{", "sarama", ".", "Logger", ".", "Println", "(", "\"", "\"", ")", "\n", "}", "\n", "if", "c", ".", "Group", ".", "PartitionStrategy", "!=", "StrategyRange", "&&", "c", ".", "Group", ".", "PartitionStrategy", "!=", "StrategyRoundRobin", "{", "sarama", ".", "Logger", ".", "Println", "(", "\"", "\"", ")", "\n", "}", "\n", "if", "!", "c", ".", "Version", ".", "IsAtLeast", "(", "minVersion", ")", "{", "sarama", ".", "Logger", ".", "Println", "(", "\"", "\"", ")", "\n", "c", ".", "Version", "=", "minVersion", "\n", "}", "\n", "if", "err", ":=", "c", ".", "Config", ".", "Validate", "(", ")", ";", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n\n", "// validate the Group values", "switch", "{", "case", "c", ".", "Group", ".", "Offsets", ".", "Retry", ".", "Max", "<", "0", ":", "return", "sarama", ".", "ConfigurationError", "(", "\"", "\"", ")", "\n", "case", "c", ".", "Group", ".", "Offsets", ".", "Synchronization", ".", "DwellTime", "<=", "0", ":", "return", "sarama", ".", "ConfigurationError", "(", "\"", "\"", ")", "\n", "case", "c", ".", "Group", ".", "Offsets", ".", "Synchronization", ".", "DwellTime", ">", "10", "*", "time", ".", "Minute", ":", "return", "sarama", ".", "ConfigurationError", "(", "\"", "\"", ")", "\n", "case", "c", ".", "Group", ".", "Heartbeat", ".", "Interval", "<=", "0", ":", "return", "sarama", ".", "ConfigurationError", "(", "\"", "\"", ")", "\n", "case", "c", ".", "Group", ".", "Session", ".", "Timeout", "<=", "0", ":", "return", "sarama", ".", "ConfigurationError", "(", "\"", "\"", ")", "\n", "case", "!", "c", ".", "Metadata", ".", "Full", "&&", "c", ".", "Group", ".", "Topics", ".", "Whitelist", "!=", "nil", ":", "return", "sarama", ".", "ConfigurationError", "(", "\"", "\"", ")", "\n", "case", "!", "c", ".", "Metadata", ".", "Full", "&&", "c", ".", "Group", ".", "Topics", ".", "Blacklist", "!=", "nil", ":", "return", "sarama", ".", "ConfigurationError", "(", "\"", "\"", ")", "\n", "}", "\n\n", "// ensure offset is correct", "switch", "c", ".", "Consumer", ".", "Offsets", ".", "Initial", "{", "<mask>", "sarama", ".", "OffsetOldest", ",", "sarama", ".", "OffsetNewest", ":", "default", ":", "return", "sarama", ".", "ConfigurationError", "(", "\"", "\"", ")", "\n", "}", "\n\n", "return", "nil", "\n", "}" ]
9,339
all-9340
[ "===", "days_in_month", "(", "v", "Vector", ")", "Scalar", "===" ]
[ "func", "funcDaysInMonth", "(", "vals", "[", "]", "Value", ",", "args", "Expressions", ",", "enh", "*", "EvalNodeHelper", ")", "Vector", "{", "return", "dateWrapper", "(", "vals", ",", "enh", ",", "func", "(", "t", "time", ".", "Time", ")", "float64", "{", "return", "float64", "(", "32", "-", "<mask>", ".", "Date", "(", "t", ".", "Year", "(", ")", ",", "t", ".", "Month", "(", ")", ",", "32", ",", "0", ",", "0", ",", "0", ",", "0", ",", "time", ".", "UTC", ")", ".", "Day", "(", ")", ")", "\n", "}", ")", "\n", "}" ]
9,340
all-9341
[ "expandVirtualMachineBootOptions", "reads", "certain", "ResourceData", "keys", "and", "returns", "a", "VirtualMachineBootOptions", "." ]
[ "func", "expandVirtualMachineBootOptions", "(", "d", "*", "schema", ".", "ResourceData", ",", "client", "*", "govmomi", ".", "Client", ")", "*", "types", ".", "VirtualMachineBootOptions", "{", "obj", ":=", "&", "types", ".", "VirtualMachineBootOptions", "{", "BootDelay", ":", "int64", "(", "d", ".", "Get", "(", "\"", "\"", ")", ".", "(", "int", ")", ")", ",", "BootRetryEnabled", ":", "structure", ".", "GetBool", "(", "d", ",", "\"", "\"", ")", ",", "BootRetryDelay", ":", "int64", "(", "d", ".", "Get", "(", "\"", "\"", ")", ".", "(", "int", ")", ")", ",", "}", "\n", "// Only set EFI secure boot if we are on vSphere 6.5 and higher", "version", ":=", "viapi", ".", "ParseVersionFromClient", "(", "client", ")", "\n", "if", "<mask>", ".", "Newer", "(", "viapi", ".", "VSphereVersion", "{", "Product", ":", "version", ".", "Product", ",", "Major", ":", "6", ",", "Minor", ":", "5", "}", ")", "{", "obj", ".", "EfiSecureBootEnabled", "=", "getBoolWithRestart", "(", "d", ",", "\"", "\"", ")", "\n", "}", "\n", "return", "obj", "\n", "}" ]
9,341
all-9342
[ "Name", "identifies", "the", "client", "." ]
[ "func", "(", "c", "Client", ")", "Name", "(", ")", "string", "{", "return", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "c", ".", "<mask>", ",", "c", ".", "url", ")", "\n", "}" ]
9,342
all-9343
[ "GetAPIKey", "returns", "a", "single", "API", "key", "or", "error", "on", "failure" ]
[ "func", "(", "client", "*", "Client", ")", "GetAPIKey", "(", "key", "string", ")", "(", "*", "APIKey", ",", "error", ")", "{", "<mask>", "out", "reqAPIKey", "\n", "if", "err", ":=", "client", ".", "doJsonRequest", "(", "\"", "\"", ",", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "key", ")", ",", "nil", ",", "&", "out", ")", ";", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "return", "out", ".", "APIKey", ",", "nil", "\n", "}" ]
9,343
all-9344
[ "Specify", "the", "value", "of", "a", "uniform", "variable", "for", "a", "specified", "program", "object" ]
[ "func", "ProgramUniform3f", "(", "<mask>", "uint32", ",", "location", "int32", ",", "v0", "float32", ",", "v1", "float32", ",", "v2", "float32", ")", "{", "syscall", ".", "Syscall6", "(", "gpProgramUniform3f", ",", "5", ",", "uintptr", "(", "program", ")", ",", "uintptr", "(", "location", ")", ",", "uintptr", "(", "math", ".", "Float32bits", "(", "v0", ")", ")", ",", "uintptr", "(", "math", ".", "Float32bits", "(", "v1", ")", ")", ",", "uintptr", "(", "math", ".", "Float32bits", "(", "v2", ")", ")", ",", "0", ")", "\n", "}" ]
9,344
all-9345
[ "WriteHeader", "writes", "the", "header", "text", "." ]
[ "func", "(", "c", "*", "ClientWriter", ")", "WriteHeader", "(", "pkg", ",", "version", "string", ",", "needTime", ",", "needJSON", "bool", ",", "w", "io", ".", "Writer", ")", "error", "{", "ctx", ":=", "<mask>", "[", "string", "]", "interface", "{", "}", "{", "\"", "\"", ":", "pkg", ",", "\"", "\"", ":", "version", ",", "\"", "\"", ":", "needTime", ",", "\"", "\"", ":", "needJSON", ",", "}", "\n", "return", "c", ".", "headerTmpl", ".", "Execute", "(", "w", ",", "ctx", ")", "\n", "}" ]
9,345
all-9346
[ "tagIDFromName", "helps", "convert", "the", "tag", "and", "category", "names", "into", "the", "final", "ID", "used", "for", "discovery", "." ]
[ "func", "tagIDFromName", "(", "ctx", "context", ".", "Context", ",", "client", "*", "tags", ".", "RestClient", ",", "name", ",", "category", "string", ")", "(", "string", ",", "error", ")", "{", "logger", ".", "Printf", "(", "\"", "\"", ",", "name", ",", "category", ")", "\n\n", "categoryID", ",", "err", ":=", "tagCategoryByName", "(", "ctx", ",", "client", ",", "<mask>", ")", "\n", "if", "err", "!=", "nil", "{", "return", "\"", "\"", ",", "err", "\n", "}", "\n\n", "return", "tagByName", "(", "ctx", ",", "client", ",", "name", ",", "categoryID", ")", "\n", "}" ]
9,346
all-9347
[ "SliceInterfacesToStrings", "converts", "an", "interface", "slice", "to", "a", "string", "slice", ".", "The", "function", "does", "not", "attempt", "to", "do", "any", "sanity", "checking", "and", "will", "panic", "if", "one", "of", "the", "items", "in", "the", "slice", "is", "not", "a", "string", "." ]
[ "func", "SliceInterfacesToStrings", "(", "s", "[", "]", "interface", "{", "}", ")", "[", "]", "string", "{", "var", "d", "[", "]", "string", "\n", "for", "_", ",", "v", ":=", "range", "s", "{", "if", "o", ",", "ok", ":=", "v", ".", "(", "string", ")", ";", "ok", "{", "d", "=", "<mask>", "(", "d", ",", "o", ")", "\n", "}", "\n", "}", "\n", "return", "d", "\n", "}" ]
9,347
all-9348
[ "UnmarshalJSON", "supports", "json", ".", "Unmarshaler", "interface" ]
[ "func", "(", "v", "*", "HighlightFrameParams", ")", "UnmarshalJSON", "(", "data", "[", "]", "byte", ")", "error", "{", "r", ":=", "jlexer", ".", "Lexer", "{", "Data", ":", "data", "}", "\n", "easyjsonC5a4559bDecodeGithubComChromedpCdprotoOverlay12", "(", "&", "r", ",", "v", ")", "\n", "return", "r", ".", "<mask>", "(", ")", "\n", "}" ]
9,348
all-9349
[ "determine", "if", "a", "name", "corresponds", "to", "a", "query", "object" ]
[ "func", "IsQuery", "(", "id", "uint32", ")", "bool", "{", "ret", ":=", "C", ".", "glowIsQuery", "(", "gpIsQuery", ",", "(", "C", ".", "GLuint", ")", "(", "id", ")", ")", "\n", "return", "<mask>", "==", "TRUE", "\n", "}" ]
9,349
all-9350
[ "Set", "sets", "the", "value", "for", "a", "given", "key", "." ]
[ "func", "(", "h", "*", "kvHandler", ")", "Set", "(", "ctx", "thrift", ".", "Context", ",", "key", ",", "value", "string", ")", "error", "{", "if", "err", ":=", "isValidKey", "(", "key", ")", ";", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n\n", "h", ".", "Lock", "(", ")", "\n", "defer", "h", ".", "Unlock", "(", ")", "\n\n", "h", ".", "vals", "[", "key", "]", "=", "value", "\n", "// Example of how to use response headers. Normally, these values should be passed via result structs.", "ctx", ".", "SetResponseHeaders", "(", "<mask>", "[", "string", "]", "string", "{", "\"", "\"", ":", "fmt", ".", "Sprint", "(", "len", "(", "h", ".", "vals", ")", ")", "}", ")", "\n", "return", "nil", "\n", "}" ]
9,350
all-9351
[ "NewStreamEncoder", "returns", "a", "new", "JSON", "stream", "encoder", "that", "writes", "to", "w", "." ]
[ "func", "NewStreamEncoder", "(", "w", "<mask>", ".", "Writer", ")", "*", "objconv", ".", "StreamEncoder", "{", "return", "objconv", ".", "NewStreamEncoder", "(", "NewEmitter", "(", "w", ")", ")", "\n", "}" ]
9,351
all-9352
[ "MarshalJSON", "supports", "json", ".", "Marshaler", "interface" ]
[ "func", "(", "v", "RequestDataReturns", ")", "MarshalJSON", "(", ")", "(", "[", "]", "byte", ",", "error", ")", "{", "w", ":=", "jwriter", ".", "<mask>", "{", "}", "\n", "easyjsonC5a4559bEncodeGithubComChromedpCdprotoIndexeddb4", "(", "&", "w", ",", "v", ")", "\n", "return", "w", ".", "Buffer", ".", "BuildBytes", "(", ")", ",", "w", ".", "Error", "\n", "}" ]
9,352
all-9353
[ "pushPeer", "pushes", "the", "new", "peer", "into", "the", "heap", "." ]
[ "func", "(", "ph", "*", "peerHeap", ")", "pushPeer", "(", "peerScore", "*", "peerScore", ")", "{", "ph", ".", "<mask>", "++", "\n", "newOrder", ":=", "ph", ".", "order", "\n", "// randRange will affect the deviation of peer's chosenCount", "randRange", ":=", "ph", ".", "Len", "(", ")", "/", "2", "+", "1", "\n", "peerScore", ".", "order", "=", "newOrder", "+", "uint64", "(", "ph", ".", "rng", ".", "Intn", "(", "randRange", ")", ")", "\n", "heap", ".", "Push", "(", "ph", ",", "peerScore", ")", "\n", "}" ]
9,353
all-9354
[ "setCallFunc", "populates", "the", "function", "parts", "of", "a", "CallCommon", "structure", "(", "Func", "Method", "Recv", "Args", "[", "0", "]", ")", "based", "on", "the", "kind", "of", "invocation", "occurring", "in", "e", "." ]
[ "func", "(", "b", "*", "builder", ")", "setCallFunc", "(", "fn", "*", "Function", ",", "e", "*", "ast", ".", "CallExpr", ",", "c", "*", "CallCommon", ")", "{", "c", ".", "pos", "=", "e", ".", "Lparen", "\n\n", "// Is this a method call?", "if", "selector", ",", "ok", ":=", "unparen", "(", "e", ".", "Fun", ")", ".", "(", "*", "ast", ".", "SelectorExpr", ")", ";", "<mask>", "{", "sel", ",", "ok", ":=", "fn", ".", "Pkg", ".", "info", ".", "Selections", "[", "selector", "]", "\n", "if", "ok", "&&", "sel", ".", "Kind", "(", ")", "==", "types", ".", "MethodVal", "{", "obj", ":=", "sel", ".", "Obj", "(", ")", ".", "(", "*", "types", ".", "Func", ")", "\n", "recv", ":=", "recvType", "(", "obj", ")", "\n", "wantAddr", ":=", "isPointer", "(", "recv", ")", "\n", "escaping", ":=", "true", "\n", "v", ":=", "b", ".", "receiver", "(", "fn", ",", "selector", ".", "X", ",", "wantAddr", ",", "escaping", ",", "sel", ")", "\n", "if", "isInterface", "(", "recv", ")", "{", "// Invoke-mode call.", "c", ".", "Value", "=", "v", "\n", "c", ".", "Method", "=", "obj", "\n", "}", "else", "{", "// \"Call\"-mode call.", "c", ".", "Value", "=", "fn", ".", "Prog", ".", "declaredFunc", "(", "obj", ")", "\n", "c", ".", "Args", "=", "append", "(", "c", ".", "Args", ",", "v", ")", "\n", "}", "\n", "return", "\n", "}", "\n\n", "// sel.Kind()==MethodExpr indicates T.f() or (*T).f():", "// a statically dispatched call to the method f in the", "// method-set of T or *T. T may be an interface.", "//", "// e.Fun would evaluate to a concrete method, interface", "// wrapper function, or promotion wrapper.", "//", "// For now, we evaluate it in the usual way.", "//", "// TODO(adonovan): opt: inline expr() here, to make the", "// call static and to avoid generation of wrappers.", "// It's somewhat tricky as it may consume the first", "// actual parameter if the call is \"invoke\" mode.", "//", "// Examples:", "// type T struct{}; func (T) f() {} // \"call\" mode", "// type T interface { f() } // \"invoke\" mode", "//", "// type S struct{ T }", "//", "// var s S", "// S.f(s)", "// (*S).f(&s)", "//", "// Suggested approach:", "// - consume the first actual parameter expression", "// and build it with b.expr().", "// - apply implicit field selections.", "// - use MethodVal logic to populate fields of c.", "}", "\n\n", "// Evaluate the function operand in the usual way.", "c", ".", "Value", "=", "b", ".", "expr", "(", "fn", ",", "e", ".", "Fun", ")", "\n", "}" ]
9,354
all-9355
[ "GetPaperHeight", "()", "is", "a", "wrapper", "around", "gtk_print_settings_get_paper_height", "()", "." ]
[ "func", "(", "<mask>", "*", "PrintSettings", ")", "GetPaperHeight", "(", "unit", "Unit", ")", "float64", "{", "c", ":=", "C", ".", "gtk_print_settings_get_paper_height", "(", "ps", ".", "native", "(", ")", ",", "C", ".", "GtkUnit", "(", "unit", ")", ")", "\n", "return", "float64", "(", "c", ")", "\n", "}" ]
9,355
all-9356
[ "Fatal", "is", "equivalent", "to", "l", ".", "Critical", "(", "fmt", ".", "Sprint", "()", ")", "followed", "by", "a", "call", "to", "os", ".", "Exit", "(", "1", ")", "." ]
[ "func", "(", "l", "*", "Logger", ")", "Fatal", "(", "args", "...", "<mask>", "{", "}", ")", "{", "l", ".", "log", "(", "CRITICAL", ",", "nil", ",", "args", "...", ")", "\n", "os", ".", "Exit", "(", "1", ")", "\n", "}" ]
9,356
all-9357
[ "CloseIssue", "closes", "the", "existing", "open", "issue", "provided", "See", "https", ":", "//", "developer", ".", "github", ".", "com", "/", "v3", "/", "issues", "/", "#edit", "-", "an", "-", "issue" ]
[ "func", "(", "c", "*", "Client", ")", "CloseIssue", "(", "org", ",", "repo", "string", ",", "number", "int", ")", "error", "{", "c", ".", "log", "(", "\"", "\"", ",", "org", ",", "repo", ",", "number", ")", "\n", "_", ",", "err", ":=", "c", ".", "request", "(", "&", "request", "{", "<mask>", ":", "http", ".", "MethodPatch", ",", "path", ":", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "org", ",", "repo", ",", "number", ")", ",", "requestBody", ":", "map", "[", "string", "]", "string", "{", "\"", "\"", ":", "\"", "\"", "}", ",", "exitCodes", ":", "[", "]", "int", "{", "200", "}", ",", "}", ",", "nil", ")", "\n", "return", "err", "\n", "}" ]
9,357
all-9358
[ "NewAsset", "creates", "a", "new", "Asset", "." ]
[ "func", "NewAsset", "(", "aType", "AssetType", ",", "value", "interface", "{", "}", ")", "(", "result", "Asset", ",", "err", "error", ")", "{", "result", ".", "Type", "=", "aType", "\n", "switch", "AssetType", "(", "aType", ")", "{", "case", "AssetTypeAssetTypeNative", ":", "// void", "case", "AssetTypeAssetTypeCreditAlphanum4", ":", "tv", ",", "ok", ":=", "value", ".", "(", "AssetAlphaNum4", ")", "\n", "if", "!", "ok", "{", "err", "=", "fmt", ".", "Errorf", "(", "\"", "\"", ")", "\n", "return", "\n", "}", "\n", "result", ".", "AlphaNum4", "=", "&", "tv", "\n", "case", "AssetTypeAssetTypeCreditAlphanum12", ":", "tv", ",", "ok", ":=", "value", ".", "(", "AssetAlphaNum12", ")", "\n", "if", "!", "<mask>", "{", "err", "=", "fmt", ".", "Errorf", "(", "\"", "\"", ")", "\n", "return", "\n", "}", "\n", "result", ".", "AlphaNum12", "=", "&", "tv", "\n", "}", "\n", "return", "\n", "}" ]
9,358
all-9359
[ "PostEvent", "takes", "as", "input", "an", "event", "and", "then", "posts", "it", "to", "the", "server", "." ]
[ "func", "(", "client", "*", "Client", ")", "PostEvent", "(", "event", "*", "Event", ")", "(", "*", "Event", ",", "error", ")", "{", "var", "<mask>", "reqGetEvent", "\n", "if", "err", ":=", "client", ".", "doJsonRequest", "(", "\"", "\"", ",", "\"", "\"", ",", "event", ",", "&", "out", ")", ";", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n", "return", "out", ".", "Event", ",", "nil", "\n", "}" ]
9,359
all-9360
[ "funcMap", "is", "the", "map", "of", "template", "functions", "to", "their", "respective", "functions", "." ]
[ "func", "funcMap", "(", "i", "*", "funcMapInput", ")", "template", ".", "FuncMap", "{", "var", "scratch", "Scratch", "\n\n", "return", "template", ".", "FuncMap", "{", "// API functions", "\"", "\"", ":", "datacentersFunc", "(", "i", ".", "brain", ",", "i", ".", "used", ",", "i", ".", "<mask>", ")", ",", "\"", "\"", ":", "fileFunc", "(", "i", ".", "brain", ",", "i", ".", "used", ",", "i", ".", "missing", ")", ",", "\"", "\"", ":", "keyFunc", "(", "i", ".", "brain", ",", "i", ".", "used", ",", "i", ".", "missing", ")", ",", "\"", "\"", ":", "keyExistsFunc", "(", "i", ".", "brain", ",", "i", ".", "used", ",", "i", ".", "missing", ")", ",", "\"", "\"", ":", "keyWithDefaultFunc", "(", "i", ".", "brain", ",", "i", ".", "used", ",", "i", ".", "missing", ")", ",", "\"", "\"", ":", "lsFunc", "(", "i", ".", "brain", ",", "i", ".", "used", ",", "i", ".", "missing", ")", ",", "\"", "\"", ":", "nodeFunc", "(", "i", ".", "brain", ",", "i", ".", "used", ",", "i", ".", "missing", ")", ",", "\"", "\"", ":", "nodesFunc", "(", "i", ".", "brain", ",", "i", ".", "used", ",", "i", ".", "missing", ")", ",", "\"", "\"", ":", "secretFunc", "(", "i", ".", "brain", ",", "i", ".", "used", ",", "i", ".", "missing", ")", ",", "\"", "\"", ":", "secretsFunc", "(", "i", ".", "brain", ",", "i", ".", "used", ",", "i", ".", "missing", ")", ",", "\"", "\"", ":", "serviceFunc", "(", "i", ".", "brain", ",", "i", ".", "used", ",", "i", ".", "missing", ")", ",", "\"", "\"", ":", "servicesFunc", "(", "i", ".", "brain", ",", "i", ".", "used", ",", "i", ".", "missing", ")", ",", "\"", "\"", ":", "treeFunc", "(", "i", ".", "brain", ",", "i", ".", "used", ",", "i", ".", "missing", ")", ",", "// Scratch", "\"", "\"", ":", "func", "(", ")", "*", "Scratch", "{", "return", "&", "scratch", "}", ",", "// Helper functions", "\"", "\"", ":", "base64Decode", ",", "\"", "\"", ":", "base64Encode", ",", "\"", "\"", ":", "base64URLDecode", ",", "\"", "\"", ":", "base64URLEncode", ",", "\"", "\"", ":", "byKey", ",", "\"", "\"", ":", "byTag", ",", "\"", "\"", ":", "contains", ",", "\"", "\"", ":", "containsSomeFunc", "(", "true", ",", "true", ")", ",", "\"", "\"", ":", "containsSomeFunc", "(", "false", ",", "false", ")", ",", "\"", "\"", ":", "containsSomeFunc", "(", "true", ",", "false", ")", ",", "\"", "\"", ":", "containsSomeFunc", "(", "false", ",", "true", ")", ",", "\"", "\"", ":", "envFunc", "(", "i", ".", "env", ")", ",", "\"", "\"", ":", "executeTemplateFunc", "(", "i", ".", "t", ")", ",", "\"", "\"", ":", "explode", ",", "\"", "\"", ":", "in", ",", "\"", "\"", ":", "indent", ",", "\"", "\"", ":", "loop", ",", "\"", "\"", ":", "join", ",", "\"", "\"", ":", "trimSpace", ",", "\"", "\"", ":", "parseBool", ",", "\"", "\"", ":", "parseFloat", ",", "\"", "\"", ":", "parseInt", ",", "\"", "\"", ":", "parseJSON", ",", "\"", "\"", ":", "parseUint", ",", "\"", "\"", ":", "plugin", ",", "\"", "\"", ":", "regexReplaceAll", ",", "\"", "\"", ":", "regexMatch", ",", "\"", "\"", ":", "replaceAll", ",", "\"", "\"", ":", "timestamp", ",", "\"", "\"", ":", "toLower", ",", "\"", "\"", ":", "toJSON", ",", "\"", "\"", ":", "toJSONPretty", ",", "\"", "\"", ":", "toTitle", ",", "\"", "\"", ":", "toTOML", ",", "\"", "\"", ":", "toUpper", ",", "\"", "\"", ":", "toYAML", ",", "\"", "\"", ":", "split", ",", "// Math functions", "\"", "\"", ":", "add", ",", "\"", "\"", ":", "subtract", ",", "\"", "\"", ":", "multiply", ",", "\"", "\"", ":", "divide", ",", "\"", "\"", ":", "modulo", ",", "}", "\n", "}" ]
9,360
all-9361
[ "FilterBefore", "returns", "rows", "created", "before", "a", "provided", "key", ".", "It", "accepts", "a", "filter", "and", "result", "shaping", "arguments" ]
[ "func", "(", "s", "RethinkStore", ")", "FilterBefore", "(", "id", "string", ",", "filter", "<mask>", "[", "string", "]", "interface", "{", "}", ",", "count", "int", ",", "skip", "int", ",", "store", "string", ",", "opts", "ObjectStoreOptions", ")", "(", "rows", "ObjectRows", ",", "err", "error", ")", "{", "rootTerm", ":=", "r", ".", "DB", "(", "s", ".", "Database", ")", ".", "Table", "(", "store", ")", ".", "Between", "(", "r", ".", "MinVal", ",", "id", ",", "r", ".", "BetweenOpts", "{", "RightBound", ":", "\"", "\"", "}", ")", ".", "OrderBy", "(", "r", ".", "OrderByOpts", "{", "Index", ":", "r", ".", "Desc", "(", "\"", "\"", ")", "}", ")", ".", "Filter", "(", "s", ".", "transformFilter", "(", "nil", ",", "filter", ")", ")", ".", "Limit", "(", "count", ")", "\n", "result", ",", "err", ":=", "rootTerm", ".", "Run", "(", "s", ".", "Session", ")", "\n", "if", "err", "!=", "nil", "{", "return", "\n", "}", "\n", "if", "result", ".", "Err", "(", ")", "!=", "nil", "{", "return", "nil", ",", "result", ".", "Err", "(", ")", "\n", "}", "\n", "if", "result", ".", "IsNil", "(", ")", "{", "return", "nil", ",", "ErrNotFound", "\n", "}", "\n", "rows", "=", "RethinkRows", "{", "result", "}", "\n", "return", "\n", "}" ]
9,361
all-9362
[ "UnmarshalJSON", "supports", "json", ".", "Unmarshaler", "interface" ]
[ "func", "(", "v", "*", "GetFramesWithManifestsParams", ")", "UnmarshalJSON", "(", "data", "[", "]", "<mask>", ")", "error", "{", "r", ":=", "jlexer", ".", "Lexer", "{", "Data", ":", "data", "}", "\n", "easyjsonC5a4559bDecodeGithubComChromedpCdprotoApplicationcache4", "(", "&", "r", ",", "v", ")", "\n", "return", "r", ".", "Error", "(", ")", "\n", "}" ]
9,362
all-9363
[ "Given", "a", "service", "spec", "looks", "up", "and", "returns", "an", "array", "of", "*", "dns", ".", "SRV", "objects", ".", "These", "must", "be", "massaged", "into", "the", "[]", "dns", ".", "RR", "after", "the", "fact", "." ]
[ "func", "(", "ds", "*", "DNSServer", ")", "GetSRV", "(", "spec", "string", ")", "[", "]", "*", "dns", ".", "SRV", "{", "ds", ".", "srvMutex", ".", "RLock", "(", ")", "\n", "defer", "ds", ".", "srvMutex", ".", "RUnlock", "(", ")", "\n\n", "srv", ",", "ok", ":=", "ds", ".", "srvRecords", "[", "spec", "]", "\n\n", "if", "ok", "{", "records", ":=", "[", "]", "*", "dns", ".", "SRV", "{", "}", "\n", "for", "_", ",", "record", ":=", "<mask>", "srv", "{", "srvRecord", ":=", "&", "dns", ".", "SRV", "{", "Hdr", ":", "dns", ".", "RR_Header", "{", "Name", ":", "spec", ",", "Rrtype", ":", "dns", ".", "TypeSRV", ",", "Class", ":", "dns", ".", "ClassINET", ",", "// 0 TTL results in UB for DNS resolvers and generally causes problems.", "Ttl", ":", "1", ",", "}", ",", "Priority", ":", "0", ",", "Weight", ":", "0", ",", "Port", ":", "record", ".", "Port", ",", "Target", ":", "record", ".", "Host", ",", "}", "\n\n", "records", "=", "append", "(", "records", ",", "srvRecord", ")", "\n", "}", "\n\n", "return", "records", "\n", "}", "\n\n", "return", "nil", "\n", "}" ]
9,363
all-9364
[ "GetPalette", "returns", "the", "Palette", "field", "if", "non", "-", "nil", "zero", "value", "otherwise", "." ]
[ "func", "(", "c", "*", "ConditionalFormat", ")", "GetPalette", "(", ")", "<mask>", "{", "if", "c", "==", "nil", "||", "c", ".", "Palette", "==", "nil", "{", "return", "\"", "\"", "\n", "}", "\n", "return", "*", "c", ".", "Palette", "\n", "}" ]
9,364
all-9365
[ "configure", "sends", "a", "configuration", "change", "through", "consensus", "and", "then", "waits", "for", "it", "to", "be", "applied", "to", "the", "server", ".", "It", "will", "block", "until", "the", "change", "is", "performed", "or", "there", "is", "an", "error", "." ]
[ "func", "(", "s", "*", "EtcdServer", ")", "configure", "(", "ctx", "context", ".", "Context", ",", "cc", "raftpb", ".", "ConfChange", ")", "(", "[", "]", "*", "membership", ".", "Member", ",", "error", ")", "{", "cc", ".", "ID", "=", "s", ".", "reqIDGen", ".", "Next", "(", ")", "\n", "ch", ":=", "s", ".", "w", ".", "Register", "(", "cc", ".", "ID", ")", "\n\n", "start", ":=", "time", ".", "Now", "(", ")", "\n", "if", "err", ":=", "s", ".", "r", ".", "ProposeConfChange", "(", "ctx", ",", "cc", ")", ";", "err", "!=", "nil", "{", "s", ".", "w", ".", "Trigger", "(", "cc", ".", "ID", ",", "nil", ")", "\n", "return", "nil", ",", "err", "\n", "}", "\n\n", "select", "{", "case", "x", ":=", "<-", "ch", ":", "if", "x", "==", "nil", "{", "if", "lg", ":=", "s", ".", "getLogger", "(", ")", ";", "lg", "!=", "nil", "{", "lg", ".", "Panic", "(", "\"", "\"", ")", "\n", "}", "else", "{", "plog", ".", "Panicf", "(", "\"", "\"", ")", "\n", "}", "\n", "}", "\n", "resp", ":=", "x", ".", "(", "*", "confChangeResponse", ")", "\n", "if", "lg", ":=", "s", ".", "getLogger", "(", ")", ";", "lg", "!=", "nil", "{", "lg", ".", "Info", "(", "\"", "\"", ",", "zap", ".", "String", "(", "\"", "\"", ",", "s", ".", "ID", "(", ")", ".", "String", "(", ")", ")", ",", "zap", ".", "String", "(", "\"", "\"", ",", "<mask>", ".", "Type", ".", "String", "(", ")", ")", ",", "zap", ".", "String", "(", "\"", "\"", ",", "types", ".", "ID", "(", "cc", ".", "NodeID", ")", ".", "String", "(", ")", ")", ",", ")", "\n", "}", "\n", "return", "resp", ".", "membs", ",", "resp", ".", "err", "\n\n", "case", "<-", "ctx", ".", "Done", "(", ")", ":", "s", ".", "w", ".", "Trigger", "(", "cc", ".", "ID", ",", "nil", ")", "// GC wait", "\n", "return", "nil", ",", "s", ".", "parseProposeCtxErr", "(", "ctx", ".", "Err", "(", ")", ",", "start", ")", "\n\n", "case", "<-", "s", ".", "stopping", ":", "return", "nil", ",", "ErrStopped", "\n", "}", "\n", "}" ]
9,365
all-9366
[ "GetReconciler", "gets", "the", "correct", "Reconciler", "for", "the", "cloud", "provider", "currenty", "used", "." ]
[ "func", "GetReconciler", "(", "known", "*", "cluster", ".", "Cluster", ",", "runtimeParameters", "*", "RuntimeParameters", ")", "(", "reconciler", "cloud", ".", "Reconciler", ",", "err", "error", ")", "{", "switch", "known", ".", "ProviderConfig", "(", ")", ".", "Cloud", "{", "case", "cluster", ".", "CloudGoogle", ":", "sdk", ",", "err", ":=", "googleSDK", ".", "NewSdk", "(", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n", "gr", ".", "Sdk", "=", "sdk", "\n", "return", "cloud", ".", "NewAtomicReconciler", "(", "known", ",", "compute", ".", "NewGoogleComputeModel", "(", "known", ")", ")", ",", "nil", "\n", "case", "cluster", ".", "CloudDigitalOcean", ":", "sdk", ",", "err", ":=", "godoSdk", ".", "NewSdk", "(", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n", "dr", ".", "Sdk", "=", "sdk", "\n", "return", "cloud", ".", "NewAtomicReconciler", "(", "known", ",", "droplet", ".", "NewDigitalOceanDropletModel", "(", "known", ")", ")", ",", "nil", "\n", "case", "cluster", ".", "CloudAmazon", ":", "awsProfile", ":=", "\"", "\"", "\n", "if", "runtimeParameters", "!=", "nil", "{", "awsProfile", "=", "runtimeParameters", ".", "AwsProfile", "\n", "}", "\n", "sdk", ",", "err", ":=", "awsSdkGo", ".", "NewSdk", "(", "known", ".", "ProviderConfig", "(", ")", ".", "Location", ",", "awsProfile", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n", "<mask>", ".", "Sdk", "=", "sdk", "\n", "return", "cloud", ".", "NewAtomicReconciler", "(", "known", ",", "awspub", ".", "NewAmazonPublicModel", "(", "known", ")", ")", ",", "nil", "\n", "case", "cluster", ".", "CloudAzure", ":", "sdk", ",", "err", ":=", "azureSDK", ".", "NewSdk", "(", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n", "azr", ".", "Sdk", "=", "sdk", "\n", "return", "cloud", ".", "NewAtomicReconciler", "(", "known", ",", "azpub", ".", "NewAzurePublicModel", "(", "known", ")", ")", ",", "nil", "\n", "case", "cluster", ".", "CloudOVH", ":", "sdk", ",", "err", ":=", "openstackSdk", ".", "NewSdk", "(", "known", ".", "ProviderConfig", "(", ")", ".", "Location", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n", "osr", ".", "Sdk", "=", "sdk", "\n", "return", "cloud", ".", "NewAtomicReconciler", "(", "known", ",", "osovh", ".", "NewOvhPublicModel", "(", "known", ")", ")", ",", "nil", "\n", "case", "cluster", ".", "CloudPacket", ":", "sdk", ",", "err", ":=", "packetSDK", ".", "NewSdk", "(", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n", "packetr", ".", "Sdk", "=", "sdk", "\n", "return", "cloud", ".", "NewAtomicReconciler", "(", "known", ",", "packetpub", ".", "NewPacketPublicModel", "(", "known", ")", ")", ",", "nil", "\n", "case", "cluster", ".", "CloudECS", ":", "sdk", ",", "err", ":=", "openstackSdk", ".", "NewSdk", "(", "known", ".", "ProviderConfig", "(", ")", ".", "Location", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n", "osr", ".", "Sdk", "=", "sdk", "\n", "return", "cloud", ".", "NewAtomicReconciler", "(", "known", ",", "osecs", ".", "NewEcsPublicModel", "(", "known", ")", ")", ",", "nil", "\n", "default", ":", "return", "nil", ",", "fmt", ".", "Errorf", "(", "\"", "\"", ",", "known", ".", "ProviderConfig", "(", ")", ".", "Cloud", ")", "\n", "}", "\n", "}" ]
9,366
all-9367
[ "MarshalJSON", "supports", "json", ".", "Marshaler", "interface" ]
[ "func", "(", "v", "GetRequestPostDataParams", ")", "MarshalJSON", "(", ")", "(", "[", "]", "<mask>", ",", "error", ")", "{", "w", ":=", "jwriter", ".", "Writer", "{", "}", "\n", "easyjsonC5a4559bEncodeGithubComChromedpCdprotoNetwork33", "(", "&", "w", ",", "v", ")", "\n", "return", "w", ".", "Buffer", ".", "BuildBytes", "(", ")", ",", "w", ".", "Error", "\n", "}" ]
9,367
all-9368
[ "Callback", "sends", "the", "CallbackRequest", "type", "to", "the", "configured", "StatusCallbackUrl", ".", "If", "it", "fails", "to", "deliver", "in", "n", "attempts", "or", "the", "request", "is", "invalid", "it", "will", "return", "an", "error", "." ]
[ "func", "Callback", "(", "cbReq", "*", "CallbackRequest", ",", "opts", "*", "CallbackOptions", ")", "error", "{", "client", ":=", "opts", ".", "Client", "\n", "if", "client", "==", "nil", "{", "client", "=", "http", ".", "DefaultClient", "\n", "}", "\n", "buf", ":=", "bytes", ".", "NewBuffer", "(", "nil", ")", "\n", "err", ":=", "json", ".", "NewEncoder", "(", "buf", ")", ".", "Encode", "(", "cbReq", ")", "\n", "if", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n", "signature", ",", "err", ":=", "opts", ".", "Signer", ".", "Sign", "(", "buf", ".", "Bytes", "(", ")", ")", "\n", "if", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n", "req", ",", "err", ":=", "http", ".", "NewRequest", "(", "\"", "\"", ",", "cbReq", ".", "StatusCallbackUrl", ",", "buf", ")", "\n", "if", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n", "req", ".", "Header", ".", "Set", "(", "\"", "\"", ",", "opts", ".", "ProcessorDomain", ")", "\n", "req", ".", "Header", ".", "Set", "(", "\"", "\"", ",", "signature", ")", "\n", "// Attempt to make callback", "for", "i", ":=", "0", ";", "i", "<", "opts", ".", "MaxAttempts", ";", "i", "++", "{", "resp", ",", "err", ":=", "client", ".", "Do", "(", "req", ")", "\n", "if", "err", "!=", "nil", "||", "resp", ".", "StatusCode", "!=", "200", "{", "time", ".", "Sleep", "(", "opts", ".", "Backoff", ")", "\n", "<mask>", "\n", "}", "\n", "// Success", "return", "nil", "\n", "}", "\n", "return", "fmt", ".", "Errorf", "(", "\"", "\"", ",", "cbReq", ".", "StatusCallbackUrl", ")", "\n", "}" ]
9,368
all-9369
[ "DeleteClusterMember", "makes", "the", "given", "member", "leave", "the", "cluster", "(", "gracefully", "or", "not", "depending", "on", "the", "force", "flag", ")" ]
[ "func", "(", "r", "*", "ProtocolLXD", ")", "DeleteClusterMember", "(", "<mask>", "string", ",", "force", "bool", ")", "error", "{", "if", "!", "r", ".", "HasExtension", "(", "\"", "\"", ")", "{", "return", "fmt", ".", "Errorf", "(", "\"", "\\\"", "\\\"", "\"", ")", "\n", "}", "\n\n", "params", ":=", "\"", "\"", "\n", "if", "force", "{", "params", "+=", "\"", "\"", "\n", "}", "\n\n", "_", ",", "err", ":=", "r", ".", "queryStruct", "(", "\"", "\"", ",", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "name", ",", "params", ")", ",", "nil", ",", "\"", "\"", ",", "nil", ")", "\n", "if", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n\n", "return", "nil", "\n", "}" ]
9,369
all-9370
[ "emit", "passes", "an", "item", "back", "to", "the", "client", "." ]
[ "func", "(", "l", "*", "lexer", ")", "emit", "(", "t", "ItemType", ")", "{", "l", ".", "items", "<-", "item", "{", "t", ",", "l", ".", "<mask>", ",", "l", ".", "input", "[", "l", ".", "start", ":", "l", ".", "pos", "]", "}", "\n", "l", ".", "start", "=", "l", ".", "pos", "\n", "}" ]
9,370
all-9371
[ "Unmarshal", "decodes", "a", "JSON", "representation", "of", "v", "from", "b", "." ]
[ "func", "Unmarshal", "(", "b", "[", "]", "byte", ",", "v", "interface", "{", "}", ")", "error", "{", "u", ":=", "unmarshalerPool", ".", "Get", "(", ")", ".", "(", "*", "unmarshaler", ")", "\n", "u", ".", "<mask>", "(", "b", ")", "\n\n", "err", ":=", "(", "objconv", ".", "Decoder", "{", "Parser", ":", "u", "}", ")", ".", "Decode", "(", "v", ")", "\n\n", "u", ".", "reset", "(", "nil", ")", "\n", "unmarshalerPool", ".", "Put", "(", "u", ")", "\n", "return", "err", "\n", "}" ]
9,371
all-9372
[ "UnregisterTopicValidator", "removes", "a", "validator", "from", "a", "topic", ".", "Returns", "an", "error", "if", "there", "was", "no", "validator", "registered", "with", "the", "topic", "." ]
[ "func", "(", "p", "*", "PubSub", ")", "UnregisterTopicValidator", "(", "topic", "string", ")", "error", "{", "rmVal", ":=", "&", "rmValReq", "{", "topic", ":", "topic", ",", "resp", ":", "<mask>", "(", "chan", "error", ",", "1", ")", ",", "}", "\n\n", "p", ".", "rmVal", "<-", "rmVal", "\n", "return", "<-", "rmVal", ".", "resp", "\n", "}" ]
9,372
all-9373
[ "handleMessages", "handles", "each", "message", "one", "at", "a", "time" ]
[ "func", "(", "attachENIHandler", "*", "attachENIHandler", ")", "handleMessages", "(", ")", "{", "for", "{", "select", "{", "case", "message", ":=", "<-", "attachENIHandler", ".", "messageBuffer", ":", "if", "err", ":=", "attachENIHandler", ".", "handleSingleMessage", "(", "message", ")", ";", "err", "!=", "nil", "{", "seelog", ".", "Warnf", "(", "\"", "\"", ",", "message", ".", "String", "(", ")", ",", "err", ")", "\n", "}", "\n", "<mask>", "<-", "attachENIHandler", ".", "ctx", ".", "Done", "(", ")", ":", "return", "\n", "}", "\n", "}", "\n", "}" ]
9,373
all-9374
[ "GetProfile", "fetches", "the", "recipient", "s", "profile", "from", "facebook", "platform", "Non", "empty", "UserID", "has", "to", "be", "specified", "in", "order", "to", "receive", "the", "information" ]
[ "func", "(", "m", "*", "Messenger", ")", "GetProfile", "(", "userID", "string", ")", "(", "*", "Profile", ",", "error", ")", "{", "resp", ",", "err", ":=", "m", ".", "doRequest", "(", "\"", "\"", ",", "fmt", ".", "Sprintf", "(", "GraphAPI", "+", "\"", "\"", ",", "userID", ")", ",", "nil", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n", "defer", "resp", ".", "Body", ".", "Close", "(", ")", "\n", "read", ",", "err", ":=", "ioutil", ".", "ReadAll", "(", "resp", ".", "Body", ")", "\n", "if", "resp", ".", "StatusCode", "!=", "http", ".", "StatusOK", "{", "er", ":=", "new", "(", "rawError", ")", "\n", "json", ".", "Unmarshal", "(", "read", ",", "er", ")", "\n", "return", "nil", ",", "errors", ".", "New", "(", "\"", "\"", "+", "er", ".", "Error", ".", "Message", ")", "\n", "}", "\n", "profile", ":=", "<mask>", "(", "Profile", ")", "\n", "return", "profile", ",", "json", ".", "Unmarshal", "(", "read", ",", "profile", ")", "\n", "}" ]
9,374
all-9375
[ "GetLiveSpan", "returns", "the", "LiveSpan", "field", "if", "non", "-", "nil", "zero", "value", "otherwise", "." ]
[ "func", "(", "t", "*", "Time", ")", "GetLiveSpan", "(", ")", "<mask>", "{", "if", "t", "==", "nil", "||", "t", ".", "LiveSpan", "==", "nil", "{", "return", "\"", "\"", "\n", "}", "\n", "return", "*", "t", ".", "LiveSpan", "\n", "}" ]
9,375
all-9376
[ "ContentType", "returns", "Content", "-", "Type", "header", "value", "." ]
[ "func", "(", "h", "*", "ResponseHeader", ")", "ContentType", "(", ")", "[", "]", "<mask>", "{", "contentType", ":=", "h", ".", "contentType", "\n", "if", "!", "h", ".", "noDefaultContentType", "&&", "len", "(", "h", ".", "contentType", ")", "==", "0", "{", "contentType", "=", "defaultContentType", "\n", "}", "\n", "return", "contentType", "\n", "}" ]
9,376
all-9377
[ "Value", "converts", "a", "value", "to", "a", "database", "driver", "value" ]
[ "func", "(", "u", "CreditCard", ")", "Value", "(", ")", "(", "driver", ".", "Value", ",", "error", ")", "{", "return", "<mask>", ".", "Value", "(", "string", "(", "u", ")", ")", ",", "nil", "\n", "}" ]
9,377
all-9378
[ "declImports", "reports", "whether", "gen", "contains", "an", "import", "of", "path", "." ]
[ "func", "declImports", "(", "gen", "*", "ast", ".", "GenDecl", ",", "path", "string", ")", "bool", "{", "if", "gen", ".", "Tok", "!=", "token", ".", "IMPORT", "{", "return", "false", "\n", "}", "\n", "for", "_", ",", "spec", ":=", "<mask>", "gen", ".", "Specs", "{", "impspec", ":=", "spec", ".", "(", "*", "ast", ".", "ImportSpec", ")", "\n", "if", "importPath", "(", "impspec", ")", "==", "path", "{", "return", "true", "\n", "}", "\n", "}", "\n", "return", "false", "\n", "}" ]
9,378
all-9379
[ "Error", "method", "return", "string", "representation", "of", "Error", "It", "is", "an", "implementation", "of", "error", "interface" ]
[ "func", "(", "e", "<mask>", ")", "Error", "(", ")", "string", "{", "logWithNumber", ":=", "make", "(", "[", "]", "string", ",", "lenWithoutNil", "(", "e", ")", ")", "\n", "for", "i", ",", "l", ":=", "range", "e", "{", "if", "l", "!=", "nil", "{", "logWithNumber", "[", "i", "]", "=", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "i", "+", "1", ",", "l", ".", "Error", "(", ")", ")", "\n", "}", "\n", "}", "\n\n", "return", "fmt", ".", "Sprintf", "(", "\"", "\\n", "\"", ",", "strings", ".", "Join", "(", "logWithNumber", ",", "\"", "\\n", "\"", ")", ")", "\n", "}" ]
9,379
all-9380
[ "Encode", "serializes", "the", "JSON", "marshalable", "obj", "data", "as", "a", "JWT", "." ]
[ "func", "(", "hs", "*", "HmacSigner", ")", "Encode", "(", "obj", "<mask>", "{", "}", ")", "(", "[", "]", "byte", ",", "error", ")", "{", "return", "hs", ".", "alg", ".", "Encode", "(", "hs", ",", "obj", ")", "\n", "}" ]
9,380
all-9381
[ "NewExponentialFullJitter", "creates", "a", "new", "backoff", "using", "the", "exponential", "with", "full", "jitter", "backoff", "algorithm", "." ]
[ "func", "NewExponentialFullJitter", "(", "start", "<mask>", ".", "Duration", ",", "limit", "time", ".", "Duration", ")", "*", "Backoff", "{", "return", "NewBackoff", "(", "exponentialFullJitter", "{", "limit", ":", "limit", "}", ",", "start", ",", "limit", ")", "\n", "}" ]
9,381
all-9382
[ "HasPrefix", "returns", "a", "boolean", "if", "a", "field", "has", "been", "set", "." ]
[ "func", "(", "t", "*", "TemplateVariable", ")", "HasPrefix", "(", ")", "bool", "{", "if", "t", "!=", "nil", "&&", "t", ".", "Prefix", "!=", "nil", "{", "return", "true", "\n", "}", "\n\n", "return", "<mask>", "\n", "}" ]
9,382
all-9383
[ "MarshalJSON", "supports", "json", ".", "Marshaler", "interface" ]
[ "func", "(", "v", "DeleteCookiesParams", ")", "MarshalJSON", "(", ")", "(", "[", "]", "byte", ",", "error", ")", "{", "w", ":=", "jwriter", ".", "Writer", "{", "}", "\n", "easyjsonC5a4559bEncodeGithubComChromedpCdprotoNetwork60", "(", "&", "w", ",", "v", ")", "\n", "return", "w", ".", "<mask>", ".", "BuildBytes", "(", ")", ",", "w", ".", "Error", "\n", "}" ]
9,383
all-9384
[ "NewDataEntryExt", "creates", "a", "new", "DataEntryExt", "." ]
[ "func", "NewDataEntryExt", "(", "v", "int32", ",", "value", "interface", "{", "}", ")", "(", "<mask>", "DataEntryExt", ",", "err", "error", ")", "{", "result", ".", "V", "=", "v", "\n", "switch", "int32", "(", "v", ")", "{", "case", "0", ":", "// void", "}", "\n", "return", "\n", "}" ]
9,384
all-9385
[ "HasText", "returns", "a", "boolean", "if", "a", "field", "has", "been", "set", "." ]
[ "func", "(", "p", "*", "Params", ")", "HasText", "(", ")", "bool", "{", "if", "p", "!=", "nil", "&&", "p", ".", "<mask>", "!=", "nil", "{", "return", "true", "\n", "}", "\n\n", "return", "false", "\n", "}" ]
9,385
all-9386
[ "MarshalJSON", "supports", "json", ".", "Marshaler", "interface" ]
[ "func", "(", "v", "GetUsageAndQuotaParams", ")", "MarshalJSON", "(", ")", "(", "[", "]", "byte", ",", "error", ")", "{", "w", ":=", "jwriter", ".", "<mask>", "{", "}", "\n", "easyjsonC5a4559bEncodeGithubComChromedpCdprotoStorage6", "(", "&", "w", ",", "v", ")", "\n", "return", "w", ".", "Buffer", ".", "BuildBytes", "(", ")", ",", "w", ".", "Error", "\n", "}" ]
9,386
all-9387
[ "GetNewHostDelay", "returns", "the", "NewHostDelay", "field", "if", "non", "-", "nil", "zero", "value", "otherwise", "." ]
[ "func", "(", "o", "*", "<mask>", ")", "GetNewHostDelay", "(", ")", "int", "{", "if", "o", "==", "nil", "||", "o", ".", "NewHostDelay", "==", "nil", "{", "return", "0", "\n", "}", "\n", "return", "*", "o", ".", "NewHostDelay", "\n", "}" ]
9,387
all-9388
[ "newAuthTokenRoundTripper", "adds", "the", "provided", "auth", "token", "to", "a", "request", "." ]
[ "func", "newAuthTokenRoundTripper", "(", "token", "config_util", ".", "Secret", ",", "rt", "http", ".", "RoundTripper", ")", "(", "http", ".", "RoundTripper", ",", "error", ")", "{", "return", "&", "authTokenRoundTripper", "{", "<mask>", ",", "rt", "}", ",", "nil", "\n", "}" ]
9,388
all-9389
[ "KnownCreated", "returns", "true", "if", "the", "cgroup", "s", "known", "status", "is", "CREATED" ]
[ "func", "(", "auth", "*", "ASMAuthResource", ")", "KnownCreated", "(", ")", "bool", "{", "auth", ".", "<mask>", ".", "RLock", "(", ")", "\n", "defer", "auth", ".", "lock", ".", "RUnlock", "(", ")", "\n\n", "return", "auth", ".", "knownStatusUnsafe", "==", "resourcestatus", ".", "ResourceStatus", "(", "ASMAuthStatusCreated", ")", "\n", "}" ]
9,389
all-9390
[ "ProgressBarNew", "()", "is", "a", "wrapper", "around", "gtk_progress_bar_new", "()", "." ]
[ "func", "ProgressBarNew", "(", ")", "(", "*", "ProgressBar", ",", "<mask>", ")", "{", "c", ":=", "C", ".", "gtk_progress_bar_new", "(", ")", "\n", "if", "c", "==", "nil", "{", "return", "nil", ",", "nilPtrErr", "\n", "}", "\n", "return", "wrapProgressBar", "(", "glib", ".", "Take", "(", "unsafe", ".", "Pointer", "(", "c", ")", ")", ")", ",", "nil", "\n", "}" ]
9,390
all-9391
[ "==", "Editing", "AddGroup", "adds", "a", "group", "." ]
[ "func", "AddGroup", "(", "name", "string", ",", "members", "...", "string", ")", "(", "gid", "int", ",", "err", "error", ")", "{", "s", ":=", "NewGShadow", "(", "name", ",", "members", "...", ")", "\n", "if", "err", "=", "s", ".", "Add", "(", "nil", ")", ";", "err", "!=", "nil", "{", "return", "\n", "}", "\n\n", "return", "NewGroup", "(", "name", ",", "<mask>", "...", ")", ".", "Add", "(", ")", "\n", "}" ]
9,391
all-9392
[ "fixed", "GetData", "directly", "from", "ptr" ]
[ "func", "GetData", "(", "pointer", "uintptr", ")", "(", "data", "[", "]", "byte", ")", "{", "c", ":=", "(", "*", "C", ".", "GValue", ")", "(", "unsafe", ".", "Pointer", "(", "pointer", ")", ")", "\n", "p", ":=", "(", "*", "C", ".", "GtkSelectionData", ")", "(", "unsafe", ".", "Pointer", "(", "c", ")", ")", "\n", "C", ".", "gtk_selection_data_get_text", "(", "p", ")", "\n\n", "<mask>", "byteData", "[", "]", "byte", "\n", "var", "length", "C", ".", "gint", "\n", "cptr", ":=", "C", ".", "gtk_selection_data_get_data_with_length", "(", "p", ",", "&", "length", ")", "\n", "sliceHeader", ":=", "(", "*", "reflect", ".", "SliceHeader", ")", "(", "unsafe", ".", "Pointer", "(", "&", "byteData", ")", ")", "\n", "sliceHeader", ".", "Data", "=", "uintptr", "(", "unsafe", ".", "Pointer", "(", "cptr", ")", ")", "\n", "sliceHeader", ".", "Len", "=", "int", "(", "length", ")", "\n", "sliceHeader", ".", "Cap", "=", "int", "(", "length", ")", "\n\n", "return", "byteData", "\n", "}" ]
9,392
all-9393
[ "GetStringPtr", "reads", "a", "ResourceData", "and", "returns", "an", "appropriate", "*", "string", "for", "the", "state", "of", "the", "definition", ".", "nil", "is", "returned", "if", "it", "does", "not", "exist", "." ]
[ "func", "GetStringPtr", "(", "d", "*", "schema", ".", "ResourceData", ",", "<mask>", "string", ")", "*", "string", "{", "v", ",", "e", ":=", "d", ".", "GetOkExists", "(", "key", ")", "\n", "if", "e", "{", "return", "StringPtr", "(", "v", ".", "(", "string", ")", ")", "\n", "}", "\n", "return", "nil", "\n", "}" ]
9,393
all-9394
[ "WithTrail", "creates", "a", "new", "context", "with", "trail", "appended", "to" ]
[ "func", "(", "ec", "EvalCtx", ")", "WithTrail", "(", "t", "string", ")", "EvalCtx", "{", "newEC", ":=", "ec", "\n", "trailCopy", ":=", "<mask>", "(", "[", "]", "string", ",", "0", ",", "len", "(", "ec", ".", "Trail", ")", "+", "1", ")", "\n", "for", "_", ",", "val", ":=", "range", "ec", ".", "Trail", "{", "trailCopy", "=", "append", "(", "trailCopy", ",", "val", ")", "\n", "}", "\n", "newEC", ".", "Trail", "=", "append", "(", "trailCopy", ",", "t", ")", "\n", "return", "newEC", "\n", "}" ]
9,394
all-9395
[ "DefaultDevices", "loads", "a", "satisfactory", "default", "device", "list", "for", "the", "optionally", "supplied", "host", "and", "descriptor", "key", ".", "The", "result", "is", "returned", "as", "a", "higher", "-", "level", "VirtualDeviceList", "object", ".", "This", "can", "be", "used", "as", "an", "initial", "VirtualDeviceList", "when", "building", "a", "device", "list", "and", "VirtualDeviceConfigSpec", "list", "for", "new", "virtual", "machines", ".", "Appropriate", "options", "for", "key", "can", "be", "loaded", "by", "running", "QueryConfigOptionDescriptor", "which", "will", "return", "a", "list", "of", "VirtualMachineConfigOptionDescriptor", "which", "will", "contain", "the", "appropriate", "key", "for", "the", "virtual", "machine", "version", "needed", ".", "If", "no", "key", "is", "supplied", "the", "results", "generally", "reflect", "the", "most", "recent", "VM", "hardware", "version", "." ]
[ "func", "(", "b", "*", "EnvironmentBrowser", ")", "DefaultDevices", "(", "ctx", "context", ".", "Context", ",", "key", "string", ",", "host", "*", "object", ".", "HostSystem", ")", "(", "object", ".", "VirtualDeviceList", ",", "error", ")", "{", "var", "eb", "mo", ".", "EnvironmentBrowser", "\n\n", "err", ":=", "b", ".", "Properties", "(", "ctx", ",", "b", ".", "Reference", "(", ")", ",", "nil", ",", "&", "eb", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "req", ":=", "types", ".", "QueryConfigOption", "{", "This", ":", "b", ".", "Reference", "(", ")", ",", "Key", ":", "<mask>", ",", "}", "\n", "if", "host", "!=", "nil", "{", "ref", ":=", "host", ".", "Reference", "(", ")", "\n", "req", ".", "Host", "=", "&", "ref", "\n", "}", "\n", "res", ",", "err", ":=", "methods", ".", "QueryConfigOption", "(", "ctx", ",", "b", ".", "Client", "(", ")", ",", "&", "req", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n", "if", "res", ".", "Returnval", "==", "nil", "{", "return", "nil", ",", "errors", ".", "New", "(", "\"", "\"", ")", "\n", "}", "\n", "return", "object", ".", "VirtualDeviceList", "(", "res", ".", "Returnval", ".", "DefaultDevice", ")", ",", "nil", "\n", "}" ]
9,395
all-9396
[ "WithClientIP", "returns", "a", "context", "which", "carries", "the", "given", "client", "IP", "." ]
[ "func", "WithClientIP", "(", "ctx", "context", ".", "<mask>", ",", "ip", "net", ".", "IP", ")", "context", ".", "Context", "{", "if", "ip", "==", "nil", "{", "return", "ctx", "\n", "}", "\n", "return", "context", ".", "WithValue", "(", "ctx", ",", "clientIPKey", "{", "}", ",", "ip", ")", "\n", "}" ]
9,396
all-9397
[ "clearStaleComments", "deletes", "old", "comments", "that", "are", "no", "longer", "applicable", "." ]
[ "func", "clearStaleComments", "(", "gc", "githubClient", ",", "log", "*", "logrus", ".", "Entry", ",", "pr", "*", "github", ".", "PullRequestEvent", ",", "prLabels", "sets", ".", "String", ",", "comments", "[", "]", "github", ".", "IssueComment", ")", "error", "{", "// If the PR must follow the process and hasn't yet completed the process, don't remove comments.", "if", "prMustFollowRelNoteProcess", "(", "gc", ",", "log", ",", "pr", ",", "prLabels", ",", "false", ")", "&&", "!", "releaseNoteAlreadyAdded", "(", "prLabels", ")", "{", "return", "nil", "\n", "}", "\n", "botName", ",", "err", ":=", "gc", ".", "BotName", "(", ")", "\n", "if", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n", "return", "gc", ".", "DeleteStaleComments", "(", "pr", ".", "Repo", ".", "Owner", ".", "Login", ",", "pr", ".", "Repo", ".", "Name", ",", "pr", ".", "Number", ",", "comments", ",", "func", "(", "c", "github", ".", "IssueComment", ")", "bool", "{", "// isStale function", "return", "c", ".", "User", ".", "Login", "==", "botName", "&&", "(", "strings", ".", "Contains", "(", "c", ".", "<mask>", ",", "releaseNoteBody", ")", "||", "strings", ".", "Contains", "(", "c", ".", "Body", ",", "parentReleaseNoteBody", ")", ")", "\n", "}", ",", ")", "\n", "}" ]
9,397
all-9398
[ "AddTask", "starts", "tracking", "a", "task" ]
[ "func", "(", "engine", "*", "DockerTaskEngine", ")", "AddTask", "(", "task", "*", "apitask", ".", "Task", ")", "{", "defer", "metrics", ".", "MetricsEngineGlobal", ".", "RecordTaskEngineMetric", "(", "\"", "\"", ")", "(", ")", "\n", "err", ":=", "task", ".", "PostUnmarshalTask", "(", "engine", ".", "cfg", ",", "engine", ".", "credentialsManager", ",", "engine", ".", "resourceFields", ",", "engine", ".", "client", ",", "engine", ".", "ctx", ")", "\n", "if", "err", "!=", "nil", "{", "seelog", ".", "Errorf", "(", "\"", "\"", ",", "task", ".", "Arn", ",", "err", ")", "\n", "task", ".", "SetKnownStatus", "(", "apitaskstatus", ".", "TaskStopped", ")", "\n", "task", ".", "SetDesiredStatus", "(", "apitaskstatus", ".", "TaskStopped", ")", "\n", "engine", ".", "emitTaskEvent", "(", "task", ",", "err", ".", "Error", "(", ")", ")", "\n", "return", "\n", "}", "\n\n", "engine", ".", "tasksLock", ".", "Lock", "(", ")", "\n", "defer", "engine", ".", "tasksLock", ".", "Unlock", "(", ")", "\n\n", "existingTask", ",", "exists", ":=", "engine", ".", "state", ".", "TaskByArn", "(", "<mask>", ".", "Arn", ")", "\n", "if", "!", "exists", "{", "// This will update the container desired status", "task", ".", "UpdateDesiredStatus", "(", ")", "\n\n", "engine", ".", "state", ".", "AddTask", "(", "task", ")", "\n", "if", "dependencygraph", ".", "ValidDependencies", "(", "task", ")", "{", "engine", ".", "startTask", "(", "task", ")", "\n", "}", "else", "{", "seelog", ".", "Errorf", "(", "\"", "\"", ",", "task", ".", "Arn", ")", "\n", "task", ".", "SetKnownStatus", "(", "apitaskstatus", ".", "TaskStopped", ")", "\n", "task", ".", "SetDesiredStatus", "(", "apitaskstatus", ".", "TaskStopped", ")", "\n", "err", ":=", "TaskDependencyError", "{", "task", ".", "Arn", "}", "\n", "engine", ".", "emitTaskEvent", "(", "task", ",", "err", ".", "Error", "(", ")", ")", "\n", "}", "\n", "return", "\n", "}", "\n\n", "// Update task", "engine", ".", "updateTaskUnsafe", "(", "existingTask", ",", "task", ")", "\n", "}" ]
9,398
all-9399
[ "New", "returns", "a", "new", "uuid", "." ]
[ "func", "New", "(", ")", "string", "{", "<mask>", "result", "string", "\n", "backoff", ".", "RetryNotify", "(", "func", "(", ")", "error", "{", "uuid", ",", "err", ":=", "uuid", ".", "NewV4", "(", ")", "\n", "if", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n", "result", "=", "uuid", ".", "String", "(", ")", "\n", "return", "nil", "\n", "}", ",", "backoff", ".", "NewInfiniteBackOff", "(", ")", ",", "func", "(", "err", "error", ",", "d", "time", ".", "Duration", ")", "error", "{", "fmt", ".", "Printf", "(", "\"", "\"", ",", "err", ")", "\n", "return", "nil", "\n", "}", ")", "\n", "return", "result", "\n", "}" ]
9,399
all-9400
[ "Update", "increases", "the", "value", "associated", "with", "the", "key", ".", "The", "key", "will", "be", "inserted", "if", "it", "is", "not", "in", "the", "cedar", ".", "It", "will", "return", "ErrInvalidValue", "if", "the", "updated", "value", "<", "0", "or", ">", "=", "ValueLimit", "." ]
[ "func", "(", "da", "*", "Cedar", ")", "Update", "(", "key", "[", "]", "byte", ",", "value", "int", ")", "error", "{", "p", ":=", "da", ".", "get", "(", "key", ",", "0", ",", "0", ")", "\n\n", "// key was not inserted", "if", "*", "p", "==", "ValueLimit", "{", "*", "p", "=", "<mask>", "\n", "return", "nil", "\n", "}", "\n\n", "// key was inserted before", "if", "*", "p", "+", "value", "<", "0", "||", "*", "p", "+", "value", ">=", "ValueLimit", "{", "return", "ErrInvalidValue", "\n", "}", "\n", "*", "p", "+=", "value", "\n", "return", "nil", "\n", "}" ]