id
int32
0
25.3k
idx
stringlengths
5
9
nl_tokens
sequencelengths
1
418
pl_tokens
sequencelengths
22
4.98k
13,600
all-13601
[ "RadioMenuItemNewWithLabelFromWidget", "is", "a", "wrapper", "around", "gtk_radio_menu_item_new_with_label_from_widget", "()", "." ]
[ "func", "RadioMenuItemNewWithLabelFromWidget", "(", "group", "*", "RadioMenuItem", ",", "label", "string", ")", "(", "*", "RadioMenuItem", ",", "error", ")", "{", "cstr", ":=", "C", ".", "CString", "(", "label", ")", "\n", "defer", "C", ".", "<mask>", "(", "unsafe", ".", "Pointer", "(", "cstr", ")", ")", "\n", "c", ":=", "C", ".", "gtk_radio_menu_item_new_with_label_from_widget", "(", "group", ".", "native", "(", ")", ",", "(", "*", "C", ".", "gchar", ")", "(", "cstr", ")", ")", "\n", "if", "c", "==", "nil", "{", "return", "nil", ",", "nilPtrErr", "\n", "}", "\n", "return", "wrapRadioMenuItem", "(", "glib", ".", "Take", "(", "unsafe", ".", "Pointer", "(", "c", ")", ")", ")", ",", "nil", "\n", "}" ]
13,601
all-13602
[ "linePosition", "reports", "at", "which", "character", "in", "the", "current", "line", "we", "are", "on", "." ]
[ "func", "(", "l", "*", "lexer", ")", "linePosition", "(", ")", "int", "{", "lb", ":=", "strings", ".", "LastIndex", "(", "l", ".", "<mask>", "[", ":", "l", ".", "lastPos", "]", ",", "\"", "\\n", "\"", ")", "\n", "if", "lb", "==", "-", "1", "{", "return", "1", "+", "int", "(", "l", ".", "lastPos", ")", "\n", "}", "\n", "return", "1", "+", "int", "(", "l", ".", "lastPos", ")", "-", "lb", "\n", "}" ]
13,602
all-13603
[ "Do", "executes", "DOM", ".", "describeNode", "against", "the", "provided", "context", ".", "returns", ":", "node", "-", "Node", "description", "." ]
[ "func", "(", "p", "*", "DescribeNodeParams", ")", "Do", "(", "ctx", "context", ".", "Context", ")", "(", "node", "*", "cdp", ".", "Node", ",", "err", "error", ")", "{", "// execute", "var", "res", "DescribeNodeReturns", "\n", "err", "=", "cdp", ".", "Execute", "(", "ctx", ",", "CommandDescribeNode", ",", "p", ",", "&", "<mask>", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "return", "res", ".", "Node", ",", "nil", "\n", "}" ]
13,603
all-13604
[ "paranoidUnmarshalJSONObject", "unmarshals", "data", "as", "a", "JSON", "object", "but", "failing", "on", "the", "slightest", "unexpected", "aspect", "(", "including", "duplicated", "keys", "unrecognized", "keys", "and", "non", "-", "matching", "types", ")", ".", "Uses", "fieldResolver", "to", "determine", "the", "destination", "for", "a", "field", "value", "which", "should", "return", "a", "pointer", "to", "the", "destination", "if", "valid", "or", "nil", "if", "the", "key", "is", "rejected", ".", "The", "fieldResolver", "approach", "is", "useful", "for", "decoding", "the", "Policy", ".", "Transports", "map", ";", "using", "it", "for", "structs", "is", "a", "bit", "lazy", "we", "could", "use", "reflection", "to", "automate", "this", ".", "Later?" ]
[ "func", "paranoidUnmarshalJSONObject", "(", "data", "[", "]", "byte", ",", "fieldResolver", "func", "(", "string", ")", "interface", "{", "}", ")", "error", "{", "seenKeys", ":=", "map", "[", "string", "]", "struct", "{", "}", "{", "}", "\n\n", "dec", ":=", "json", ".", "NewDecoder", "(", "bytes", ".", "NewReader", "(", "data", ")", ")", "\n", "t", ",", "err", ":=", "dec", ".", "Token", "(", ")", "\n", "if", "err", "!=", "nil", "{", "return", "jsonFormatError", "(", "err", ".", "Error", "(", ")", ")", "\n", "}", "\n", "if", "t", "!=", "json", ".", "Delim", "(", "'{'", ")", "{", "return", "jsonFormatError", "(", "fmt", ".", "Sprintf", "(", "\"", "\\\"", "\\\"", "\"", ",", "t", ")", ")", "\n", "}", "\n", "for", "{", "t", ",", "err", ":=", "dec", ".", "Token", "(", ")", "\n", "if", "err", "!=", "nil", "{", "return", "jsonFormatError", "(", "err", ".", "Error", "(", ")", ")", "\n", "}", "\n", "if", "t", "==", "json", ".", "Delim", "(", "'}'", ")", "{", "break", "\n", "}", "\n\n", "key", ",", "ok", ":=", "t", ".", "(", "string", ")", "\n", "if", "!", "ok", "{", "// Coverage: This should never happen, dec.Token() rejects non-string-literals in this state.", "return", "jsonFormatError", "(", "fmt", ".", "Sprintf", "(", "\"", "\\\"", "\\\"", "\"", ",", "t", ")", ")", "\n", "}", "\n", "if", "_", ",", "ok", ":=", "seenKeys", "[", "key", "]", ";", "ok", "{", "return", "jsonFormatError", "(", "fmt", ".", "Sprintf", "(", "\"", "\\\"", "\\\"", "\"", ",", "key", ")", ")", "\n", "}", "\n", "seenKeys", "[", "key", "]", "=", "struct", "{", "}", "{", "}", "\n\n", "valuePtr", ":=", "fieldResolver", "(", "key", ")", "\n", "if", "valuePtr", "==", "nil", "{", "return", "jsonFormatError", "(", "fmt", ".", "Sprintf", "(", "\"", "\\\"", "\\\"", "\"", ",", "key", ")", ")", "\n", "}", "\n", "// This works like json.Unmarshal, in particular it allows us to implement UnmarshalJSON to implement strict parsing of the field value.", "if", "err", ":=", "dec", ".", "Decode", "(", "valuePtr", ")", ";", "err", "!=", "nil", "{", "return", "jsonFormatError", "(", "err", ".", "<mask>", "(", ")", ")", "\n", "}", "\n", "}", "\n", "if", "_", ",", "err", ":=", "dec", ".", "Token", "(", ")", ";", "err", "!=", "io", ".", "EOF", "{", "return", "jsonFormatError", "(", "\"", "\"", ")", "\n", "}", "\n", "return", "nil", "\n", "}" ]
13,604
all-13605
[ "Do", "executes", "CSS", ".", "getStyleSheetText", "against", "the", "provided", "context", ".", "returns", ":", "text", "-", "The", "stylesheet", "text", "." ]
[ "func", "(", "p", "*", "GetStyleSheetTextParams", ")", "Do", "(", "ctx", "<mask>", ".", "Context", ")", "(", "text", "string", ",", "err", "error", ")", "{", "// execute", "var", "res", "GetStyleSheetTextReturns", "\n", "err", "=", "cdp", ".", "Execute", "(", "ctx", ",", "CommandGetStyleSheetText", ",", "p", ",", "&", "res", ")", "\n", "if", "err", "!=", "nil", "{", "return", "\"", "\"", ",", "err", "\n", "}", "\n\n", "return", "res", ".", "Text", ",", "nil", "\n", "}" ]
13,605
all-13606
[ "export", "FrameSet_FrameRangePadded" ]
[ "func", "FrameSet_FrameRangePadded", "(", "id", "FrameSetId", ",", "pad", "int", ")", "(", "ret", "*", "C", ".", "char", ")", "{", "fs", ",", "ok", ":=", "sFrameSets", ".", "Get", "(", "id", ")", "\n", "if", "!", "ok", "{", "ret", "=", "C", ".", "CString", "(", "\"", "\"", ")", "\n", "}", "else", "{", "<mask>", "=", "C", ".", "CString", "(", "fs", ".", "FrameRangePadded", "(", "pad", ")", ")", "\n", "}", "\n", "// caller must free the string", "return", "ret", "\n", "}" ]
13,606
all-13607
[ "Reset", "resets", "the", "whole", "State", "object" ]
[ "func", "(", "st", "*", "State", ")", "Reset", "(", ")", "{", "st", ".", "opidx", "=", "0", "\n", "st", ".", "sa", "=", "nil", "\n", "st", ".", "sb", "=", "nil", "\n", "st", ".", "<mask>", ".", "Reset", "(", ")", "\n", "st", ".", "markstack", ".", "Reset", "(", ")", "\n", "st", ".", "frames", ".", "Reset", "(", ")", "\n", "st", ".", "framestack", ".", "Reset", "(", ")", "\n\n", "st", ".", "Pushmark", "(", ")", "\n", "st", ".", "PushFrame", "(", ")", "\n", "}" ]
13,607
all-13608
[ "MakeRequest", "mocks", "base", "method" ]
[ "func", "(", "m", "*", "MockClientServer", ")", "MakeRequest", "(", "arg0", "<mask>", "{", "}", ")", "error", "{", "ret", ":=", "m", ".", "ctrl", ".", "Call", "(", "m", ",", "\"", "\"", ",", "arg0", ")", "\n", "ret0", ",", "_", ":=", "ret", "[", "0", "]", ".", "(", "error", ")", "\n", "return", "ret0", "\n", "}" ]
13,608
all-13609
[ "SetVariableValue", "changes", "value", "of", "variable", "in", "a", "callframe", ".", "Object", "-", "based", "scopes", "are", "not", "supported", "and", "must", "be", "mutated", "manually", ".", "See", ":", "https", ":", "//", "chromedevtools", ".", "github", ".", "io", "/", "devtools", "-", "protocol", "/", "tot", "/", "Debugger#method", "-", "setVariableValue", "parameters", ":", "scopeNumber", "-", "0", "-", "based", "number", "of", "scope", "as", "was", "listed", "in", "scope", "chain", ".", "Only", "local", "closure", "and", "catch", "scope", "types", "are", "allowed", ".", "Other", "scopes", "could", "be", "manipulated", "manually", ".", "variableName", "-", "Variable", "name", ".", "newValue", "-", "New", "variable", "value", ".", "callFrameID", "-", "Id", "of", "callframe", "that", "holds", "variable", "." ]
[ "func", "SetVariableValue", "(", "scopeNumber", "int64", ",", "variableName", "<mask>", ",", "newValue", "*", "runtime", ".", "CallArgument", ",", "callFrameID", "CallFrameID", ")", "*", "SetVariableValueParams", "{", "return", "&", "SetVariableValueParams", "{", "ScopeNumber", ":", "scopeNumber", ",", "VariableName", ":", "variableName", ",", "NewValue", ":", "newValue", ",", "CallFrameID", ":", "callFrameID", ",", "}", "\n", "}" ]
13,609
all-13610
[ "CheckEffective", "returns", "true", "if", "c", "was", "issued", "on", "or", "after", "the", "EffectiveDate", ".", "If", "EffectiveDate", "is", "zero", "CheckEffective", "always", "returns", "true", "." ]
[ "func", "(", "l", "*", "Lint", ")", "CheckEffective", "(", "c", "*", "x509", ".", "Certificate", ")", "bool", "{", "if", "l", ".", "EffectiveDate", ".", "IsZero", "(", ")", "||", "!", "l", ".", "EffectiveDate", ".", "After", "(", "c", ".", "NotBefore", ")", "{", "return", "true", "\n", "}", "\n", "return", "<mask>", "\n", "}" ]
13,610
all-13611
[ "SetBytesV", "sets", "the", "given", "key", ":", "value", "header", ".", "Use", "AddBytesV", "for", "setting", "multiple", "header", "values", "under", "the", "same", "key", "." ]
[ "func", "(", "h", "*", "RequestHeader", ")", "SetBytesV", "(", "key", "string", ",", "value", "[", "]", "<mask>", ")", "{", "k", ":=", "getHeaderKeyBytes", "(", "&", "h", ".", "bufKV", ",", "key", ",", "h", ".", "disableNormalizing", ")", "\n", "h", ".", "SetCanonical", "(", "k", ",", "value", ")", "\n", "}" ]
13,611
all-13612
[ "Layout", ".", "SetSize", "is", "a", "wrapper", "around", "gtk_layout_set_size" ]
[ "func", "(", "v", "*", "Layout", ")", "SetSize", "(", "<mask>", ",", "height", "uint", ")", "{", "C", ".", "gtk_layout_set_size", "(", "v", ".", "native", "(", ")", ",", "C", ".", "guint", "(", "width", ")", ",", "C", ".", "guint", "(", "height", ")", ")", "\n", "}" ]
13,612
all-13613
[ "ActiveColors", "return", "the", "attrubutes", "for", "the", "controls", "when", "it", "is", "active", ":", "text", "and", "background", "colors" ]
[ "func", "(", "c", "*", "BaseControl", ")", "ActiveColors", "(", ")", "(", "<mask>", ".", "Attribute", ",", "term", ".", "Attribute", ")", "{", "return", "c", ".", "fgActive", ",", "c", ".", "bgActive", "\n", "}" ]
13,613
all-13614
[ "Inspect", "returns", "container", "configuration", "." ]
[ "func", "(", "s", "*", "<mask>", ")", "Inspect", "(", ")", "(", "[", "]", "Inspect", ",", "error", ")", "{", "out", ",", "err", ":=", "s", ".", "docker", ".", "Run", "(", "\"", "\"", ",", "s", ".", "id", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "var", "list", "[", "]", "Inspect", "\n", "err", "=", "json", ".", "NewDecoder", "(", "strings", ".", "NewReader", "(", "out", ")", ")", ".", "Decode", "(", "&", "list", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "UnexpectedOutputError", "(", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "err", ")", ")", "\n", "}", "\n", "if", "len", "(", "list", ")", "==", "0", "{", "return", "nil", ",", "UnexpectedOutputError", "(", "\"", "\"", ")", "\n", "}", "\n\n", "return", "list", ",", "nil", "\n", "}" ]
13,614
all-13615
[ "GetParentIdOk", "returns", "a", "tuple", "with", "the", "ParentId", "field", "if", "it", "s", "non", "-", "nil", "zero", "value", "otherwise", "and", "a", "boolean", "to", "check", "if", "the", "value", "has", "been", "set", "." ]
[ "func", "(", "d", "*", "Downtime", ")", "GetParentIdOk", "(", ")", "(", "int", ",", "bool", ")", "{", "if", "d", "==", "nil", "||", "d", ".", "ParentId", "==", "nil", "{", "return", "0", ",", "<mask>", "\n", "}", "\n", "return", "*", "d", ".", "ParentId", ",", "true", "\n", "}" ]
13,615
all-13616
[ "start", "the", "shards", ";", "must", "be", "called", "before", "any", "call", "to", "enqueue", "." ]
[ "func", "(", "s", "*", "shards", ")", "start", "(", "n", "int", ")", "{", "s", ".", "mtx", ".", "Lock", "(", ")", "\n", "defer", "s", ".", "mtx", ".", "Unlock", "(", ")", "\n\n", "newQueues", ":=", "make", "(", "[", "]", "chan", "prompb", ".", "TimeSeries", ",", "n", ")", "\n", "for", "i", ":=", "0", ";", "i", "<", "n", ";", "i", "++", "{", "newQueues", "[", "i", "]", "=", "make", "(", "chan", "prompb", ".", "TimeSeries", ",", "s", ".", "qm", ".", "cfg", ".", "Capacity", ")", "\n", "}", "\n\n", "s", ".", "queues", "=", "newQueues", "\n\n", "var", "hardShutdownCtx", "context", ".", "Context", "\n", "hardShutdownCtx", ",", "s", ".", "hardShutdown", "=", "<mask>", ".", "WithCancel", "(", "context", ".", "Background", "(", ")", ")", "\n", "s", ".", "softShutdown", "=", "make", "(", "chan", "struct", "{", "}", ")", "\n", "s", ".", "running", "=", "int32", "(", "n", ")", "\n", "s", ".", "done", "=", "make", "(", "chan", "struct", "{", "}", ")", "\n", "for", "i", ":=", "0", ";", "i", "<", "n", ";", "i", "++", "{", "go", "s", ".", "runShard", "(", "hardShutdownCtx", ",", "i", ",", "newQueues", "[", "i", "]", ")", "\n", "}", "\n", "s", ".", "qm", ".", "numShardsMetric", ".", "Set", "(", "float64", "(", "n", ")", ")", "\n", "}" ]
13,616
all-13617
[ "UnmarshalJSON", "supports", "json", ".", "Unmarshaler", "interface" ]
[ "func", "(", "v", "*", "Property", ")", "UnmarshalJSON", "(", "<mask>", "[", "]", "byte", ")", "error", "{", "r", ":=", "jlexer", ".", "Lexer", "{", "Data", ":", "data", "}", "\n", "easyjsonC5a4559bDecodeGithubComChromedpCdprotoCss27", "(", "&", "r", ",", "v", ")", "\n", "return", "r", ".", "Error", "(", ")", "\n", "}" ]
13,617
all-13618
[ "Returns", "the", "Docker", "SDK", "Client" ]
[ "func", "(", "dg", "*", "dockerGoClient", ")", "sdkDockerClient", "(", ")", "(", "sdkclient", ".", "Client", ",", "error", ")", "{", "if", "dg", ".", "version", "==", "\"", "\"", "{", "return", "dg", ".", "sdkClientFactory", ".", "GetDefaultClient", "(", ")", "\n", "}", "\n", "return", "dg", ".", "sdkClientFactory", ".", "GetClient", "(", "dg", ".", "<mask>", ")", "\n", "}" ]
13,618
all-13619
[ "FlattenToV1", "expands", "any", "List", "-", "type", "objects", "into", "their", "members", "and", "cooerces", "everything", "to", "v1", ".", "Unstructured", ".", "Panics", "if", "coercion", "encounters", "an", "unexpected", "object", "type", "." ]
[ "func", "FlattenToV1", "(", "objs", "[", "]", "runtime", ".", "Object", ")", "[", "]", "*", "unstructured", ".", "Unstructured", "{", "ret", ":=", "make", "(", "[", "]", "*", "unstructured", ".", "Unstructured", ",", "0", ",", "len", "(", "objs", ")", ")", "\n", "for", "_", ",", "obj", ":=", "range", "objs", "{", "switch", "o", ":=", "obj", ".", "(", "type", ")", "{", "case", "*", "unstructured", ".", "UnstructuredList", ":", "for", "i", ":=", "range", "o", ".", "Items", "{", "ret", "=", "append", "(", "ret", ",", "&", "o", ".", "Items", "[", "i", "]", ")", "\n", "}", "\n", "case", "*", "unstructured", ".", "Unstructured", ":", "ret", "=", "<mask>", "(", "ret", ",", "o", ")", "\n", "default", ":", "panic", "(", "\"", "\"", ")", "\n", "}", "\n", "}", "\n", "return", "ret", "\n", "}" ]
13,619
all-13620
[ "NewService", "creates", "a", "new", "configured", "random", "service", "." ]
[ "func", "NewService", "(", "config", "ServiceConfig", ")", "(", "Service", ",", "error", ")", "{", "// Dependencies.", "if", "config", ".", "BackoffFactory", "==", "nil", "{", "return", "nil", ",", "maskAnyf", "(", "invalidConfigError", ",", "\"", "\"", ")", "\n", "}", "\n", "if", "config", ".", "RandFactory", "==", "nil", "{", "return", "nil", ",", "maskAnyf", "(", "invalidConfigError", ",", "\"", "\"", ")", "\n", "}", "\n\n", "// Settings.", "if", "config", ".", "RandReader", "==", "nil", "{", "return", "nil", ",", "maskAnyf", "(", "invalidConfigError", ",", "\"", "\"", ")", "\n", "}", "\n\n", "newService", ":=", "&", "<mask>", "{", "// Dependencies.", "backoffFactory", ":", "config", ".", "BackoffFactory", ",", "randFactory", ":", "config", ".", "RandFactory", ",", "// Settings.", "randReader", ":", "config", ".", "RandReader", ",", "timeout", ":", "config", ".", "Timeout", ",", "}", "\n\n", "return", "newService", ",", "nil", "\n", "}" ]
13,620
all-13621
[ "Release", "decreases", "the", "reference", "count", "for", "the", "cluster", ".", "Once", "it", "reaches", "zero", "all", "servers", "will", "be", "closed", "." ]
[ "func", "(", "cluster", "*", "mongoCluster", ")", "Release", "(", ")", "{", "cluster", ".", "Lock", "(", ")", "\n", "if", "cluster", ".", "references", "==", "0", "{", "panic", "(", "\"", "\"", ")", "\n", "}", "\n", "cluster", ".", "references", "--", "\n", "debugf", "(", "\"", "\"", ",", "cluster", ",", "cluster", ".", "references", ")", "\n", "if", "cluster", ".", "references", "==", "0", "{", "for", "_", ",", "server", ":=", "range", "cluster", ".", "servers", ".", "Slice", "(", ")", "{", "<mask>", ".", "Close", "(", ")", "\n", "}", "\n", "// Wake up the sync loop so it can die.", "cluster", ".", "syncServers", "(", ")", "\n", "stats", ".", "cluster", "(", "-", "1", ")", "\n", "}", "\n", "cluster", ".", "Unlock", "(", ")", "\n", "}" ]
13,621
all-13622
[ "GetBackgroundColorOk", "returns", "a", "tuple", "with", "the", "BackgroundColor", "field", "if", "it", "s", "non", "-", "nil", "zero", "value", "otherwise", "and", "a", "boolean", "to", "check", "if", "the", "value", "has", "been", "set", "." ]
[ "func", "(", "n", "*", "NoteDefinition", ")", "GetBackgroundColorOk", "(", ")", "(", "string", ",", "bool", ")", "{", "if", "n", "==", "nil", "||", "n", ".", "BackgroundColor", "==", "nil", "{", "return", "\"", "\"", ",", "false", "\n", "}", "\n", "return", "*", "n", ".", "BackgroundColor", ",", "<mask>", "\n", "}" ]
13,622
all-13623
[ "Peek", "returns", "the", "element", "at", "the", "front", "of", "the", "queue", "." ]
[ "func", "(", "<mask>", "*", "queue", ")", "Peek", "(", ")", "interface", "{", "}", "{", "if", "queue", ".", "size", "==", "0", "{", "return", "nil", "\n", "}", "\n", "return", "queue", ".", "elements", "[", "queue", ".", "start", "%", "int64", "(", "queue", ".", "cap", ")", "]", "\n", "}" ]
13,623
all-13624
[ "RealName", "return", "the", "real", "name", "of", "the", "account", "as", "registered" ]
[ "func", "(", "a", "Account", ")", "RealName", "(", ")", "(", "string", ",", "error", ")", "{", "var", "d", "dictionary", "\n", "err", ":=", "a", ".", "Domain", ".", "cgp", ".", "<mask>", "(", "getAccountSettings", "{", "Account", ":", "a", ".", "Email", "(", ")", "}", ",", "&", "d", ")", "\n", "if", "err", "!=", "nil", "{", "return", "\"", "\"", ",", "err", "\n", "}", "\n", "return", "d", ".", "toMap", "(", ")", "[", "\"", "\"", "]", ",", "nil", "\n", "}" ]
13,624
all-13625
[ "IsGamepadJustDisconnected", "returns", "a", "boolean", "value", "indicating", "whether", "the", "gamepad", "of", "the", "given", "id", "is", "released", "just", "in", "the", "current", "frame", ".", "IsGamepadJustDisconnected", "is", "concurrent", "safe", "." ]
[ "func", "IsGamepadJustDisconnected", "(", "id", "int", ")", "bool", "{", "theInputState", ".", "m", ".", "RLock", "(", ")", "\n", "_", ",", "prev", ":=", "theInputState", ".", "prevGamepadIDs", "[", "id", "]", "\n", "_", ",", "current", ":=", "theInputState", ".", "gamepadIDs", "[", "id", "]", "\n", "theInputState", ".", "m", ".", "RUnlock", "(", ")", "\n", "return", "prev", "&&", "!", "<mask>", "\n", "}" ]
13,625
all-13626
[ "WithInsecure", "returns", "a", "copy", "of", "the", "TokenCredentials", "allowing", "insecure", "transport" ]
[ "func", "(", "c", "*", "TokenCredentials", ")", "WithInsecure", "(", ")", "*", "TokenCredentials", "{", "return", "&", "TokenCredentials", "{", "token", ":", "c", ".", "token", ",", "tokenFunc", ":", "c", ".", "tokenFunc", ",", "allowInsecure", ":", "<mask>", "}", "\n", "}" ]
13,626
all-13627
[ "DiskCloneRelocateOperation", "assembles", "the", "VirtualMachineRelocateSpecDiskLocator", "slice", "for", "a", "virtual", "machine", "clone", "operation", ".", "This", "differs", "from", "a", "regular", "storage", "vMotion", "in", "that", "we", "have", "no", "existing", "devices", "in", "the", "resource", "to", "work", "off", "of", "-", "the", "disks", "in", "the", "source", "virtual", "machine", "is", "our", "source", "of", "truth", ".", "These", "disks", "are", "assigned", "to", "our", "disk", "sub", "-", "resources", "in", "config", "and", "the", "relocate", "specs", "are", "generated", "off", "of", "the", "backing", "data", "defined", "in", "config", "taking", "on", "these", "filenames", "when", "cloned", ".", "After", "the", "clone", "is", "complete", "natural", "re", "-", "configuration", "happens", "to", "bring", "the", "disk", "configurations", "fully", "in", "sync", "with", "what", "is", "defined", "." ]
[ "func", "DiskCloneRelocateOperation", "(", "d", "*", "schema", ".", "ResourceData", ",", "c", "*", "govmomi", ".", "Client", ",", "l", "object", ".", "VirtualDeviceList", ")", "(", "[", "]", "types", ".", "VirtualMachineRelocateSpecDiskLocator", ",", "error", ")", "{", "log", ".", "Printf", "(", "\"", "\"", ")", "\n", "devices", ":=", "SelectDisks", "(", "l", ",", "d", ".", "Get", "(", "\"", "\"", ")", ".", "(", "int", ")", ")", "\n", "log", ".", "Printf", "(", "\"", "\"", ",", "DeviceListString", "(", "devices", ")", ")", "\n", "// Sort the device list, in case it's not sorted already.", "devSort", ":=", "virtualDeviceListSorter", "{", "Sort", ":", "devices", ",", "DeviceList", ":", "l", ",", "}", "\n", "sort", ".", "Sort", "(", "devSort", ")", "\n", "devices", "=", "devSort", ".", "Sort", "\n", "log", ".", "Printf", "(", "\"", "\"", ",", "DeviceListString", "(", "devices", ")", ")", "\n", "// Do the same for our listed disks.", "curSet", ":=", "d", ".", "Get", "(", "subresourceTypeDisk", ")", ".", "(", "[", "]", "interface", "{", "}", ")", "\n", "log", ".", "Printf", "(", "\"", "\"", ",", "subresourceListString", "(", "curSet", ")", ")", "\n", "sort", ".", "Sort", "(", "virtualDiskSubresourceSorter", "(", "curSet", ")", ")", "\n", "log", ".", "Printf", "(", "\"", "\"", ",", "subresourceListString", "(", "curSet", ")", ")", "\n\n", "<mask>", ".", "Printf", "(", "\"", "\"", ")", "\n", "var", "relocators", "[", "]", "types", ".", "VirtualMachineRelocateSpecDiskLocator", "\n", "for", "i", ",", "device", ":=", "range", "devices", "{", "m", ":=", "curSet", "[", "i", "]", ".", "(", "map", "[", "string", "]", "interface", "{", "}", ")", "\n", "vd", ":=", "device", ".", "GetVirtualDevice", "(", ")", "\n", "ctlr", ":=", "l", ".", "FindByKey", "(", "vd", ".", "ControllerKey", ")", "\n", "if", "ctlr", "==", "nil", "{", "return", "nil", ",", "fmt", ".", "Errorf", "(", "\"", "\"", ",", "vd", ".", "Key", ")", "\n", "}", "\n", "m", "[", "\"", "\"", "]", "=", "int", "(", "vd", ".", "Key", ")", "\n", "var", "err", "error", "\n", "m", "[", "\"", "\"", "]", ",", "err", "=", "computeDevAddr", "(", "vd", ",", "ctlr", ".", "(", "types", ".", "BaseVirtualController", ")", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "fmt", ".", "Errorf", "(", "\"", "\"", ",", "err", ")", "\n", "}", "\n", "r", ":=", "NewDiskSubresource", "(", "c", ",", "d", ",", "m", ",", "nil", ",", "i", ")", "\n", "// A disk locator is only useful if a target datastore is available. If we", "// don't have a datastore specified (ie: when Storage DRS is in use), then", "// we just need to skip this disk. The disk will be migrated properly", "// through the SDRS API.", "if", "dsID", ":=", "r", ".", "Get", "(", "\"", "\"", ")", ";", "dsID", "==", "\"", "\"", "||", "dsID", "==", "diskDatastoreComputedName", "{", "continue", "\n", "}", "\n", "// Otherwise, proceed with generating and appending the locator.", "relocator", ",", "err", ":=", "r", ".", "Relocate", "(", "l", ",", "true", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "fmt", ".", "Errorf", "(", "\"", "\"", ",", "r", ".", "Addr", "(", ")", ",", "err", ")", "\n", "}", "\n", "relocators", "=", "append", "(", "relocators", ",", "relocator", ")", "\n", "}", "\n\n", "log", ".", "Printf", "(", "\"", "\"", ",", "diskRelocateListString", "(", "relocators", ")", ")", "\n", "log", ".", "Printf", "(", "\"", "\"", ")", "\n", "return", "relocators", ",", "nil", "\n", "}" ]
13,627
all-13628
[ "Insert", "is", "used", "to", "add", "a", "newentry", "or", "update", "an", "existing", "entry", ".", "Returns", "if", "updated", "." ]
[ "func", "(", "t", "*", "Tree", ")", "Insert", "(", "s", "string", ",", "v", "interface", "{", "}", ")", "(", "interface", "{", "}", ",", "bool", ")", "{", "var", "parent", "*", "node", "\n", "n", ":=", "t", ".", "root", "\n", "search", ":=", "s", "\n", "for", "{", "// Handle key exhaution", "if", "len", "(", "search", ")", "==", "0", "{", "if", "n", ".", "isLeaf", "(", ")", "{", "old", ":=", "n", ".", "leaf", ".", "val", "\n", "n", ".", "leaf", ".", "val", "=", "v", "\n", "return", "old", ",", "true", "\n", "}", "\n\n", "n", ".", "leaf", "=", "&", "leafNode", "{", "key", ":", "s", ",", "val", ":", "v", ",", "}", "\n", "t", ".", "size", "++", "\n", "return", "nil", ",", "false", "\n", "}", "\n\n", "// Look for the edge", "parent", "=", "n", "\n", "n", "=", "n", ".", "getEdge", "(", "search", "[", "0", "]", ")", "\n\n", "// No edge, create one", "if", "n", "==", "nil", "{", "e", ":=", "edge", "{", "label", ":", "search", "[", "0", "]", ",", "node", ":", "&", "node", "{", "leaf", ":", "&", "leafNode", "{", "key", ":", "s", ",", "val", ":", "v", ",", "}", ",", "prefix", ":", "search", ",", "}", ",", "}", "\n", "parent", ".", "addEdge", "(", "e", ")", "\n", "t", ".", "size", "++", "\n", "return", "nil", ",", "false", "\n", "}", "\n\n", "// Determine longest prefix of the search key on match", "commonPrefix", ":=", "longestPrefix", "(", "search", ",", "n", ".", "prefix", ")", "\n", "if", "commonPrefix", "==", "len", "(", "n", ".", "prefix", ")", "{", "search", "=", "search", "[", "commonPrefix", ":", "]", "\n", "continue", "\n", "}", "\n\n", "// Split the node", "t", ".", "size", "++", "\n", "child", ":=", "&", "node", "{", "prefix", ":", "search", "[", ":", "commonPrefix", "]", ",", "}", "\n", "parent", ".", "updateEdge", "(", "search", "[", "0", "]", ",", "child", ")", "\n\n", "// Restore the existing node", "child", ".", "addEdge", "(", "edge", "{", "label", ":", "n", ".", "<mask>", "[", "commonPrefix", "]", ",", "node", ":", "n", ",", "}", ")", "\n", "n", ".", "prefix", "=", "n", ".", "prefix", "[", "commonPrefix", ":", "]", "\n\n", "// Create a new leaf node", "leaf", ":=", "&", "leafNode", "{", "key", ":", "s", ",", "val", ":", "v", ",", "}", "\n\n", "// If the new key is a subset, add to to this node", "search", "=", "search", "[", "commonPrefix", ":", "]", "\n", "if", "len", "(", "search", ")", "==", "0", "{", "child", ".", "leaf", "=", "leaf", "\n", "return", "nil", ",", "false", "\n", "}", "\n\n", "// Create a new edge for the node", "child", ".", "addEdge", "(", "edge", "{", "label", ":", "search", "[", "0", "]", ",", "node", ":", "&", "node", "{", "leaf", ":", "leaf", ",", "prefix", ":", "search", ",", "}", ",", "}", ")", "\n", "return", "nil", ",", "false", "\n", "}", "\n", "}" ]
13,628
all-13629
[ "anyMessageHandler", "handles", "any", "server", "message", ".", "Any", "server", "message", "means", "the", "connection", "is", "active", "and", "thus", "the", "heartbeat", "disconnect", "should", "not", "occur" ]
[ "func", "anyMessageHandler", "(", "timer", "ttime", ".", "Timer", ",", "client", "wsclient", ".", "ClientServer", ")", "func", "(", "<mask>", "{", "}", ")", "{", "return", "func", "(", "interface", "{", "}", ")", "{", "seelog", ".", "Debug", "(", "\"", "\"", ")", "\n", "// Reset read deadline as there's activity on the channel", "if", "err", ":=", "client", ".", "SetReadDeadline", "(", "time", ".", "Now", "(", ")", ".", "Add", "(", "wsRWTimeout", ")", ")", ";", "err", "!=", "nil", "{", "seelog", ".", "Warnf", "(", "\"", "\"", ",", "err", ")", "\n", "}", "\n\n", "// Reset heartbeat timer", "timer", ".", "Reset", "(", "retry", ".", "AddJitter", "(", "heartbeatTimeout", ",", "heartbeatJitter", ")", ")", "\n", "}", "\n", "}" ]
13,629
all-13630
[ "SetDecorated", "is", "a", "wrapper", "around", "gtk_window_set_decorated", "()", "." ]
[ "func", "(", "v", "*", "Window", ")", "SetDecorated", "(", "setting", "bool", ")", "{", "C", ".", "gtk_window_set_decorated", "(", "v", ".", "native", "(", ")", ",", "gbool", "(", "<mask>", ")", ")", "\n", "}" ]
13,630
all-13631
[ "GetOffer", "retrieves", "the", "Offer", "value", "from", "the", "union", "returning", "ok", "if", "the", "union", "s", "switch", "indicated", "the", "value", "is", "valid", "." ]
[ "func", "(", "u", "ManageOfferSuccessResultOffer", ")", "GetOffer", "(", ")", "(", "result", "OfferEntry", ",", "ok", "bool", ")", "{", "armName", ",", "_", ":=", "u", ".", "ArmForSwitch", "(", "int32", "(", "u", ".", "Effect", ")", ")", "\n\n", "if", "armName", "==", "\"", "\"", "{", "<mask>", "=", "*", "u", ".", "Offer", "\n", "ok", "=", "true", "\n", "}", "\n\n", "return", "\n", "}" ]
13,631
all-13632
[ "Initialize", "storage", "interface", "for", "this", "container" ]
[ "func", "(", "c", "*", "containerLXC", ")", "initStorage", "(", ")", "error", "{", "if", "c", ".", "storage", "!=", "nil", "{", "return", "nil", "\n", "}", "\n\n", "s", ",", "err", ":=", "storagePoolVolumeContainerLoadInit", "(", "c", ".", "state", ",", "c", ".", "Project", "(", ")", ",", "c", ".", "<mask>", "(", ")", ")", "\n", "if", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n\n", "c", ".", "storage", "=", "s", "\n\n", "return", "nil", "\n", "}" ]
13,632
all-13633
[ "CONTRACT", ":", "info", ".", "Type", ".", "Elem", "()", ".", "Kind", "()", "==", "reflect", ".", "Uint8" ]
[ "func", "(", "cdc", "*", "Codec", ")", "encodeReflectBinaryByteSlice", "(", "w", "io", ".", "<mask>", ",", "info", "*", "TypeInfo", ",", "rv", "reflect", ".", "Value", ",", "fopts", "FieldOptions", ")", "(", "err", "error", ")", "{", "if", "printLog", "{", "fmt", ".", "Println", "(", "\"", "\"", ")", "\n", "defer", "func", "(", ")", "{", "fmt", ".", "Printf", "(", "\"", "\\n", "\"", ",", "err", ")", "\n", "}", "(", ")", "\n", "}", "\n", "ert", ":=", "info", ".", "Type", ".", "Elem", "(", ")", "\n", "if", "ert", ".", "Kind", "(", ")", "!=", "reflect", ".", "Uint8", "{", "panic", "(", "\"", "\"", ")", "\n", "}", "\n\n", "// Write byte-length prefixed byte-slice.", "var", "byteslice", "=", "rv", ".", "Bytes", "(", ")", "\n", "err", "=", "EncodeByteSlice", "(", "w", ",", "byteslice", ")", "\n", "return", "\n", "}" ]
13,633
all-13634
[ "Strftime", "formats", "time", ".", "Date", "according", "to", "the", "directives", "in", "the", "given", "format", "string", ".", "The", "directives", "begins", "with", "a", "percent", "(", "%", ")", "character", "." ]
[ "func", "Strftime", "(", "t", "time", ".", "Time", ",", "f", "string", ")", "(", "string", ",", "error", ")", "{", "var", "result", "[", "]", "string", "\n", "format", ":=", "[", "]", "rune", "(", "f", ")", "\n\n", "add", ":=", "func", "(", "str", "string", ")", "{", "result", "=", "append", "(", "result", ",", "str", ")", "\n", "}", "\n\n", "for", "i", ":=", "0", ";", "i", "<", "len", "(", "format", ")", ";", "i", "++", "{", "switch", "format", "[", "i", "]", "{", "case", "'%'", ":", "if", "i", "<", "len", "(", "format", ")", "-", "1", "{", "switch", "format", "[", "i", "+", "1", "]", "{", "case", "'a'", ":", "add", "(", "shortDayNames", "[", "t", ".", "Weekday", "(", ")", "]", ")", "\n", "case", "'A'", ":", "<mask>", "(", "longDayNames", "[", "t", ".", "Weekday", "(", ")", "]", ")", "\n", "case", "'b'", ",", "'h'", ":", "add", "(", "shortMonthNames", "[", "t", ".", "Month", "(", ")", "]", ")", "\n", "case", "'B'", ":", "add", "(", "longMonthNames", "[", "t", ".", "Month", "(", ")", "]", ")", "\n", "case", "'c'", ":", "add", "(", "t", ".", "Format", "(", "\"", "\"", ")", ")", "\n", "case", "'C'", ":", "add", "(", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "t", ".", "Year", "(", ")", "/", "100", ")", ")", "\n", "case", "'d'", ":", "add", "(", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "t", ".", "Day", "(", ")", ")", ")", "\n", "case", "'D'", ",", "'x'", ":", "add", "(", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "t", ".", "Month", "(", ")", ",", "t", ".", "Day", "(", ")", ",", "t", ".", "Year", "(", ")", "%", "100", ")", ")", "\n", "case", "'e'", ":", "add", "(", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "t", ".", "Day", "(", ")", ")", ")", "\n", "case", "'f'", ":", "add", "(", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "t", ".", "Nanosecond", "(", ")", ")", ")", "\n", "case", "'F'", ":", "add", "(", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "t", ".", "Year", "(", ")", ",", "t", ".", "Month", "(", ")", ",", "t", ".", "Day", "(", ")", ")", ")", "\n", "case", "'H'", ":", "add", "(", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "t", ".", "Hour", "(", ")", ")", ")", "\n", "case", "'I'", ":", "if", "t", ".", "Hour", "(", ")", "==", "0", "{", "add", "(", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "12", ")", ")", "\n", "}", "else", "if", "t", ".", "Hour", "(", ")", ">", "12", "{", "add", "(", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "t", ".", "Hour", "(", ")", "-", "12", ")", ")", "\n", "}", "else", "{", "add", "(", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "t", ".", "Hour", "(", ")", ")", ")", "\n", "}", "\n", "case", "'j'", ":", "add", "(", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "t", ".", "YearDay", "(", ")", ")", ")", "\n", "case", "'k'", ":", "add", "(", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "t", ".", "Hour", "(", ")", ")", ")", "\n", "case", "'l'", ":", "if", "t", ".", "Hour", "(", ")", "==", "0", "{", "add", "(", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "12", ")", ")", "\n", "}", "else", "if", "t", ".", "Hour", "(", ")", ">", "12", "{", "add", "(", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "t", ".", "Hour", "(", ")", "-", "12", ")", ")", "\n", "}", "else", "{", "add", "(", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "t", ".", "Hour", "(", ")", ")", ")", "\n", "}", "\n", "case", "'m'", ":", "add", "(", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "t", ".", "Month", "(", ")", ")", ")", "\n", "case", "'M'", ":", "add", "(", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "t", ".", "Minute", "(", ")", ")", ")", "\n", "case", "'n'", ":", "add", "(", "\"", "\\n", "\"", ")", "\n", "case", "'p'", ":", "if", "t", ".", "Hour", "(", ")", "<", "12", "{", "add", "(", "\"", "\"", ")", "\n", "}", "else", "{", "add", "(", "\"", "\"", ")", "\n", "}", "\n", "case", "'r'", ":", "s", ",", "_", ":=", "Strftime", "(", "t", ",", "\"", "\"", ")", "\n", "add", "(", "s", ")", "\n", "case", "'R'", ":", "add", "(", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "t", ".", "Hour", "(", ")", ",", "t", ".", "Minute", "(", ")", ")", ")", "\n", "case", "'s'", ":", "add", "(", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "t", ".", "Unix", "(", ")", ")", ")", "\n", "case", "'S'", ":", "add", "(", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "t", ".", "Second", "(", ")", ")", ")", "\n", "case", "'t'", ":", "add", "(", "\"", "\\t", "\"", ")", "\n", "case", "'T'", ",", "'X'", ":", "add", "(", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "t", ".", "Hour", "(", ")", ",", "t", ".", "Minute", "(", ")", ",", "t", ".", "Second", "(", ")", ")", ")", "\n", "case", "'u'", ":", "w", ":=", "t", ".", "Weekday", "(", ")", "\n", "if", "w", "==", "0", "{", "w", "=", "7", "\n", "}", "\n", "add", "(", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "w", ")", ")", "\n", "case", "'U'", ":", "add", "(", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "weekNumber", "(", "t", ",", "'U'", ")", ")", ")", "\n", "case", "'w'", ":", "add", "(", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "t", ".", "Weekday", "(", ")", ")", ")", "\n", "case", "'W'", ":", "add", "(", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "weekNumber", "(", "t", ",", "'W'", ")", ")", ")", "\n", "case", "'y'", ":", "add", "(", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "t", ".", "Year", "(", ")", "%", "100", ")", ")", "\n", "case", "'Y'", ":", "add", "(", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "t", ".", "Year", "(", ")", ")", ")", "\n", "case", "'z'", ":", "add", "(", "t", ".", "Format", "(", "\"", "\"", ")", ")", "\n", "case", "'Z'", ":", "add", "(", "t", ".", "Format", "(", "\"", "\"", ")", ")", "\n", "case", "'%'", ":", "add", "(", "\"", "\"", ")", "\n", "default", ":", "return", "\"", "\"", ",", "fmt", ".", "Errorf", "(", "\"", "\"", ",", "format", "[", "i", "+", "1", "]", ")", "\n", "}", "\n", "i", "+=", "1", "\n", "}", "\n", "default", ":", "add", "(", "string", "(", "format", "[", "i", "]", ")", ")", "\n", "}", "\n", "}", "\n\n", "return", "strings", ".", "Join", "(", "result", ",", "\"", "\"", ")", ",", "nil", "\n", "}" ]
13,634
all-13635
[ "ReadIndex", "requests", "a", "read", "state", ".", "The", "read", "state", "will", "be", "set", "in", "ready", ".", "Read", "State", "has", "a", "read", "index", ".", "Once", "the", "application", "advances", "further", "than", "the", "read", "index", "any", "linearizable", "read", "requests", "issued", "before", "the", "read", "request", "can", "be", "processed", "safely", ".", "The", "read", "state", "will", "have", "the", "same", "rctx", "attached", "." ]
[ "func", "(", "rn", "*", "RawNode", ")", "ReadIndex", "(", "rctx", "[", "]", "byte", ")", "{", "_", "=", "rn", ".", "raft", ".", "Step", "(", "pb", ".", "Message", "{", "Type", ":", "pb", ".", "MsgReadIndex", ",", "Entries", ":", "[", "]", "<mask>", ".", "Entry", "{", "{", "Data", ":", "rctx", "}", "}", "}", ")", "\n", "}" ]
13,635
all-13636
[ "safeClose", "closes", "c", "being", "careful", "not", "to", "race", "with", "any", "calls", "to", "c", ".", "Write", ".", "See", "golang", ".", "org", "/", "issue", "/", "9307", "and", "TestEchoFileRace", "in", "exec_test", ".", "go", ".", "In", "theory", "other", "calls", "could", "also", "be", "excluded", "(", "by", "writing", "appropriate", "wrappers", "like", "c", ".", "Write", "s", "implementation", "below", ")", "but", "since", "c", "is", "most", "commonly", "used", "as", "a", "WriteCloser", "Write", "is", "the", "main", "one", "to", "worry", "about", ".", "See", "also", "#7970", "for", "which", "this", "is", "a", "partial", "fix", "for", "this", "specific", "instance", ".", "The", "idea", "is", "that", "we", "return", "a", "WriteCloser", "and", "so", "the", "caller", "can", "be", "relied", "upon", "not", "to", "call", "Write", "and", "Close", "simultaneously", "but", "it", "s", "less", "obvious", "that", "cmd", ".", "Wait", "calls", "Close", "and", "that", "the", "caller", "must", "not", "call", "Write", "and", "cmd", ".", "Wait", "simultaneously", ".", "In", "fact", "that", "seems", "too", "onerous", ".", "So", "we", "change", "the", "use", "of", "Close", "in", "cmd", ".", "Wait", "to", "use", "safeClose", "which", "will", "synchronize", "with", "any", "Write", ".", "It", "s", "important", "that", "we", "know", "this", "won", "t", "block", "forever", "waiting", "for", "the", "operations", "being", "excluded", ".", "At", "the", "point", "where", "this", "is", "called", "the", "invoked", "command", "has", "exited", "and", "the", "parent", "copy", "of", "the", "read", "side", "of", "the", "pipe", "has", "also", "been", "closed", "so", "there", "should", "really", "be", "no", "read", "side", "of", "the", "pipe", "left", ".", "Any", "active", "writes", "should", "return", "very", "shortly", "with", "an", "EPIPE", "making", "it", "reasonable", "to", "wait", "for", "them", ".", "Technically", "it", "is", "possible", "that", "the", "child", "forked", "a", "sub", "-", "process", "or", "otherwise", "handed", "off", "the", "read", "side", "of", "the", "pipe", "before", "exiting", "and", "the", "current", "holder", "is", "not", "reading", "from", "the", "pipe", "and", "the", "pipe", "is", "full", "in", "which", "case", "the", "close", "here", "might", "block", "waiting", "for", "the", "write", "to", "complete", ".", "That", "s", "probably", "OK", ".", "It", "s", "a", "small", "enough", "problem", "to", "be", "outweighed", "by", "eliminating", "the", "race", "here", "." ]
[ "func", "(", "c", "*", "closeOnce", ")", "safeClose", "(", ")", "error", "{", "c", ".", "writers", ".", "Lock", "(", ")", "\n", "<mask>", ":=", "c", ".", "Close", "(", ")", "\n", "c", ".", "writers", ".", "Unlock", "(", ")", "\n", "return", "err", "\n", "}" ]
13,636
all-13637
[ "sbytes", "should", "begin", "where", "decodeVersion", "left", "off", "." ]
[ "func", "(", "p", "*", "hashed", ")", "decodeCost", "(", "sbytes", "[", "]", "byte", ")", "(", "int", ",", "error", ")", "{", "cost", ",", "err", ":=", "strconv", ".", "Atoi", "(", "string", "(", "sbytes", "[", "0", ":", "2", "]", ")", ")", "\n", "if", "err", "!=", "nil", "{", "return", "-", "1", ",", "err", "\n", "}", "\n", "err", "=", "checkCost", "(", "cost", ")", "\n", "if", "err", "!=", "nil", "{", "return", "-", "1", ",", "err", "\n", "}", "\n", "p", ".", "<mask>", "=", "cost", "\n", "return", "3", ",", "nil", "\n", "}" ]
13,637
all-13638
[ "GetMessage", "returns", "the", "Message", "field", "if", "non", "-", "nil", "zero", "value", "otherwise", "." ]
[ "func", "(", "a", "*", "Alert", ")", "GetMessage", "(", ")", "string", "{", "if", "a", "==", "nil", "||", "a", ".", "Message", "==", "nil", "{", "return", "\"", "\"", "\n", "}", "\n", "return", "*", "a", ".", "<mask>", "\n", "}" ]
13,638
all-13639
[ "execThen", "executes", "r", ".", "Then", ".", "It", "is", "trigged", "after", "successful", "git", "pull" ]
[ "func", "(", "r", "*", "Repo", ")", "execThen", "(", ")", "error", "{", "var", "errs", "error", "\n", "for", "_", ",", "<mask>", ":=", "range", "r", ".", "Then", "{", "err", ":=", "command", ".", "Exec", "(", "r", ".", "Path", ")", "\n", "if", "err", "==", "nil", "{", "Logger", "(", ")", ".", "Printf", "(", "\"", "\\n", "\"", ",", "command", ".", "Command", "(", ")", ")", "\n", "}", "\n", "errs", "=", "mergeErrors", "(", "errs", ",", "err", ")", "\n", "}", "\n", "return", "errs", "\n", "}" ]
13,639
all-13640
[ "UnmarshalJSON", "supports", "json", ".", "Unmarshaler", "interface" ]
[ "func", "(", "v", "*", "GetScriptSourceParams", ")", "UnmarshalJSON", "(", "<mask>", "[", "]", "byte", ")", "error", "{", "r", ":=", "jlexer", ".", "Lexer", "{", "Data", ":", "data", "}", "\n", "easyjsonC5a4559bDecodeGithubComChromedpCdprotoDebugger34", "(", "&", "r", ",", "v", ")", "\n", "return", "r", ".", "Error", "(", ")", "\n", "}" ]
13,640
all-13641
[ "processCloneLog", "checks", "if", "clone", "operation", "successed", "or", "failed", "for", "a", "ref", "and", "upload", "clone", "logs", "as", "build", "log", "upon", "failures", ".", "returns", ":", "bool", "-", "clone", "status", "string", "-", "final", "main", "ref", "SHA", "on", "a", "successful", "clone", "error", "-", "when", "unexpected", "file", "operation", "happens" ]
[ "func", "processCloneLog", "(", "logfile", "string", ",", "uploadTargets", "map", "[", "string", "]", "gcs", ".", "UploadFunc", ")", "(", "bool", ",", "string", ",", "error", ")", "{", "var", "cloneRecords", "[", "]", "clone", ".", "Record", "\n", "<mask>", ",", "err", ":=", "ioutil", ".", "ReadFile", "(", "logfile", ")", "\n", "if", "err", "!=", "nil", "{", "return", "true", ",", "\"", "\"", ",", "fmt", ".", "Errorf", "(", "\"", "\"", ",", "err", ")", "\n", "}", "\n", "if", "err", "=", "json", ".", "Unmarshal", "(", "data", ",", "&", "cloneRecords", ")", ";", "err", "!=", "nil", "{", "return", "true", ",", "\"", "\"", ",", "fmt", ".", "Errorf", "(", "\"", "\"", ",", "err", ")", "\n", "}", "\n", "// Do not read from cloneLog directly. Instead create multiple readers from cloneLog so it can", "// be uploaded to both clone-log.txt and build-log.txt on failure.", "cloneLog", ":=", "bytes", ".", "Buffer", "{", "}", "\n", "var", "failed", "bool", "\n", "var", "mainRefSHA", "string", "\n", "for", "idx", ",", "record", ":=", "range", "cloneRecords", "{", "cloneLog", ".", "WriteString", "(", "clone", ".", "FormatRecord", "(", "record", ")", ")", "\n", "failed", "=", "failed", "||", "record", ".", "Failed", "\n", "// fill in mainRefSHA with FinalSHA from the first record", "if", "idx", "==", "0", "{", "mainRefSHA", "=", "record", ".", "FinalSHA", "\n", "}", "\n\n", "}", "\n", "uploadTargets", "[", "\"", "\"", "]", "=", "gcs", ".", "DataUpload", "(", "bytes", ".", "NewReader", "(", "cloneLog", ".", "Bytes", "(", ")", ")", ")", "\n", "uploadTargets", "[", "\"", "\"", "]", "=", "gcs", ".", "FileUpload", "(", "logfile", ")", "\n\n", "if", "failed", "{", "uploadTargets", "[", "\"", "\"", "]", "=", "gcs", ".", "DataUpload", "(", "bytes", ".", "NewReader", "(", "cloneLog", ".", "Bytes", "(", ")", ")", ")", "\n\n", "passed", ":=", "!", "failed", "\n", "now", ":=", "time", ".", "Now", "(", ")", ".", "Unix", "(", ")", "\n", "finished", ":=", "gcs", ".", "Finished", "{", "Timestamp", ":", "&", "now", ",", "Passed", ":", "&", "passed", ",", "Result", ":", "\"", "\"", ",", "}", "\n", "finishedData", ",", "err", ":=", "json", ".", "Marshal", "(", "&", "finished", ")", "\n", "if", "err", "!=", "nil", "{", "return", "true", ",", "mainRefSHA", ",", "fmt", ".", "Errorf", "(", "\"", "\"", ",", "err", ")", "\n", "}", "\n", "uploadTargets", "[", "\"", "\"", "]", "=", "gcs", ".", "DataUpload", "(", "bytes", ".", "NewReader", "(", "finishedData", ")", ")", "\n", "}", "\n", "return", "failed", ",", "mainRefSHA", ",", "nil", "\n", "}" ]
13,641
all-13642
[ "render", "primitives", "from", "array", "data" ]
[ "func", "DrawRangeElements", "(", "mode", "uint32", ",", "start", "uint32", ",", "end", "uint32", ",", "<mask>", "int32", ",", "xtype", "uint32", ",", "indices", "unsafe", ".", "Pointer", ")", "{", "syscall", ".", "Syscall6", "(", "gpDrawRangeElements", ",", "6", ",", "uintptr", "(", "mode", ")", ",", "uintptr", "(", "start", ")", ",", "uintptr", "(", "end", ")", ",", "uintptr", "(", "count", ")", ",", "uintptr", "(", "xtype", ")", ",", "uintptr", "(", "indices", ")", ")", "\n", "}" ]
13,642
all-13643
[ "TryReusingBlob", "checks", "whether", "the", "transport", "already", "contains", "or", "can", "efficiently", "reuse", "a", "blob", "and", "if", "so", "applies", "it", "to", "the", "current", "destination", "(", "e", ".", "g", ".", "if", "the", "blob", "is", "a", "filesystem", "layer", "this", "signifies", "that", "the", "changes", "it", "describes", "need", "to", "be", "applied", "again", "when", "composing", "a", "filesystem", "tree", ")", ".", "info", ".", "Digest", "must", "not", "be", "empty", ".", "If", "canSubstitute", "TryReusingBlob", "can", "use", "an", "equivalent", "equivalent", "of", "the", "desired", "blob", ";", "in", "that", "case", "the", "returned", "info", "may", "not", "match", "the", "input", ".", "If", "the", "blob", "has", "been", "succesfully", "reused", "returns", "(", "true", "info", "nil", ")", ";", "info", "must", "contain", "at", "least", "a", "digest", "and", "size", ".", "If", "the", "transport", "can", "not", "reuse", "the", "requested", "blob", "TryReusingBlob", "returns", "(", "false", "{}", "nil", ")", ";", "it", "returns", "a", "non", "-", "nil", "error", "only", "on", "an", "unexpected", "failure", ".", "May", "use", "and", "/", "or", "update", "cache", "." ]
[ "func", "(", "d", "*", "ostreeImageDestination", ")", "TryReusingBlob", "(", "ctx", "context", ".", "Context", ",", "info", "types", ".", "BlobInfo", ",", "cache", "types", ".", "BlobInfoCache", ",", "canSubstitute", "bool", ")", "(", "bool", ",", "types", ".", "BlobInfo", ",", "error", ")", "{", "if", "d", ".", "repo", "==", "nil", "{", "repo", ",", "err", ":=", "openRepo", "(", "d", ".", "ref", ".", "repo", ")", "\n", "if", "err", "!=", "nil", "{", "return", "false", ",", "types", ".", "BlobInfo", "{", "}", ",", "err", "\n", "}", "\n", "d", ".", "repo", "=", "repo", "\n", "}", "\n", "branch", ":=", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "info", ".", "Digest", ".", "Hex", "(", ")", ")", "\n\n", "found", ",", "data", ",", "err", ":=", "readMetadata", "(", "d", ".", "repo", ",", "branch", ",", "\"", "\"", ")", "\n", "if", "err", "!=", "nil", "||", "!", "found", "{", "return", "found", ",", "types", ".", "BlobInfo", "{", "}", ",", "err", "\n", "}", "\n\n", "found", ",", "data", ",", "err", "=", "readMetadata", "(", "d", ".", "repo", ",", "branch", ",", "\"", "\"", ")", "\n", "if", "err", "!=", "nil", "||", "!", "found", "{", "return", "found", ",", "types", ".", "BlobInfo", "{", "}", ",", "err", "\n", "}", "\n\n", "found", ",", "<mask>", ",", "err", "=", "readMetadata", "(", "d", ".", "repo", ",", "branch", ",", "\"", "\"", ")", "\n", "if", "err", "!=", "nil", "||", "!", "found", "{", "return", "found", ",", "types", ".", "BlobInfo", "{", "}", ",", "err", "\n", "}", "\n\n", "size", ",", "err", ":=", "strconv", ".", "ParseInt", "(", "data", ",", "10", ",", "64", ")", "\n", "if", "err", "!=", "nil", "{", "return", "false", ",", "types", ".", "BlobInfo", "{", "}", ",", "err", "\n", "}", "\n\n", "return", "true", ",", "types", ".", "BlobInfo", "{", "Digest", ":", "info", ".", "Digest", ",", "Size", ":", "size", "}", ",", "nil", "\n", "}" ]
13,643
all-13644
[ "/", "*", "Debugm", "uses", "msg", "as", "a", "format", "string", "with", "subsequent", "parameters", "as", "values", "and", "logs", "the", "resulting", "message", "to", "all", "added", "loggers", "at", "LogLevel", ".", "LevelDebug", ".", "It", "will", "also", "merge", "all", "attributes", "passed", "in", "m", "with", "any", "attributes", "added", "to", "Base", "and", "include", "them", "with", "the", "message", "if", "the", "Logger", "supports", "it", "." ]
[ "func", "(", "b", "*", "<mask>", ")", "Debugm", "(", "m", "*", "Attrs", ",", "msg", "string", ",", "a", "...", "interface", "{", "}", ")", "error", "{", "return", "b", ".", "Log", "(", "LevelDebug", ",", "m", ",", "msg", ",", "a", "...", ")", "\n", "}" ]
13,644
all-13645
[ "String", "returns", "a", "string", "representation", "of", "this", "Raft", "node", "." ]
[ "func", "(", "r", "*", "Raft", ")", "<mask>", "(", ")", "string", "{", "return", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "r", ".", "localAddr", ",", "r", ".", "getState", "(", ")", ")", "\n", "}" ]
13,645
all-13646
[ "expandVMwareDVSPortgroupPolicy", "reads", "certain", "ResourceData", "keys", "and", "returns", "a", "VMwareDVSPortgroupPolicy", "." ]
[ "func", "expandVMwareDVSPortgroupPolicy", "(", "d", "*", "schema", ".", "ResourceData", ")", "*", "types", ".", "VMwareDVSPortgroupPolicy", "{", "obj", ":=", "&", "<mask>", ".", "VMwareDVSPortgroupPolicy", "{", "DVPortgroupPolicy", ":", "types", ".", "DVPortgroupPolicy", "{", "BlockOverrideAllowed", ":", "d", ".", "Get", "(", "\"", "\"", ")", ".", "(", "bool", ")", ",", "ShapingOverrideAllowed", ":", "d", ".", "Get", "(", "\"", "\"", ")", ".", "(", "bool", ")", ",", "LivePortMovingAllowed", ":", "d", ".", "Get", "(", "\"", "\"", ")", ".", "(", "bool", ")", ",", "PortConfigResetAtDisconnect", ":", "d", ".", "Get", "(", "\"", "\"", ")", ".", "(", "bool", ")", ",", "NetworkResourcePoolOverrideAllowed", ":", "structure", ".", "GetBoolPtr", "(", "d", ",", "\"", "\"", ")", ",", "TrafficFilterOverrideAllowed", ":", "structure", ".", "GetBoolPtr", "(", "d", ",", "\"", "\"", ")", ",", "}", ",", "VlanOverrideAllowed", ":", "d", ".", "Get", "(", "\"", "\"", ")", ".", "(", "bool", ")", ",", "UplinkTeamingOverrideAllowed", ":", "d", ".", "Get", "(", "\"", "\"", ")", ".", "(", "bool", ")", ",", "SecurityPolicyOverrideAllowed", ":", "d", ".", "Get", "(", "\"", "\"", ")", ".", "(", "bool", ")", ",", "IpfixOverrideAllowed", ":", "structure", ".", "GetBoolPtr", "(", "d", ",", "\"", "\"", ")", ",", "}", "\n", "return", "obj", "\n", "}" ]
13,646
all-13647
[ "BeNumerically", "performs", "numerical", "assertions", "in", "a", "type", "-", "agnostic", "way", ".", "Actual", "and", "expected", "should", "be", "numbers", "though", "the", "specific", "type", "of", "number", "is", "irrelevant", "(", "float32", "float64", "uint8", "etc", "...", ")", ".", "There", "are", "six", "self", "-", "explanatory", "supported", "comparators", ":", "Expect", "(", "1", ".", "0", ")", ".", "Should", "(", "BeNumerically", "(", "==", "1", "))", "Expect", "(", "1", ".", "0", ")", ".", "Should", "(", "BeNumerically", "(", "~", "0", ".", "999", "0", ".", "01", "))", "Expect", "(", "1", ".", "0", ")", ".", "Should", "(", "BeNumerically", "(", ">", "0", ".", "9", "))", "Expect", "(", "1", ".", "0", ")", ".", "Should", "(", "BeNumerically", "(", ">", "=", "1", ".", "0", "))", "Expect", "(", "1", ".", "0", ")", ".", "Should", "(", "BeNumerically", "(", "<", "3", "))", "Expect", "(", "1", ".", "0", ")", ".", "Should", "(", "BeNumerically", "(", "<", "=", "1", ".", "0", "))" ]
[ "func", "BeNumerically", "(", "comparator", "string", ",", "compareTo", "...", "<mask>", "{", "}", ")", "types", ".", "GomegaMatcher", "{", "return", "&", "matchers", ".", "BeNumericallyMatcher", "{", "Comparator", ":", "comparator", ",", "CompareTo", ":", "compareTo", ",", "}", "\n", "}" ]
13,647
all-13648
[ "This", "uses", "the", "OS", "and", "the", "Seed", "(", "s", ")", "." ]
[ "func", "CRandBytes", "(", "numBytes", "int", ")", "[", "]", "byte", "{", "b", ":=", "make", "(", "[", "]", "<mask>", ",", "numBytes", ")", "\n", "_", ",", "err", ":=", "gRandInfo", ".", "Read", "(", "b", ")", "\n", "if", "err", "!=", "nil", "{", "PanicCrisis", "(", "err", ")", "\n", "}", "\n", "return", "b", "\n", "}" ]
13,648
all-13649
[ "Do", "executes", "CSS", ".", "setRuleSelector", "against", "the", "provided", "context", ".", "returns", ":", "selectorList", "-", "The", "resulting", "selector", "list", "after", "modification", "." ]
[ "func", "(", "p", "*", "SetRuleSelectorParams", ")", "Do", "(", "ctx", "context", ".", "<mask>", ")", "(", "selectorList", "*", "SelectorList", ",", "err", "error", ")", "{", "// execute", "var", "res", "SetRuleSelectorReturns", "\n", "err", "=", "cdp", ".", "Execute", "(", "ctx", ",", "CommandSetRuleSelector", ",", "p", ",", "&", "res", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "return", "res", ".", "SelectorList", ",", "nil", "\n", "}" ]
13,649
all-13650
[ "Map", "calls", "fn", "(", "x", ")", "for", "every", "item", "x", "and", "yields", "the", "outputs", "of", "the", "fn", "calls", "." ]
[ "func", "<mask>", "(", "fn", "func", "(", "string", ")", "string", ")", "Filter", "{", "return", "FilterFunc", "(", "func", "(", "arg", "Arg", ")", "error", "{", "for", "s", ":=", "range", "arg", ".", "In", "{", "arg", ".", "Out", "<-", "fn", "(", "s", ")", "\n", "}", "\n", "return", "nil", "\n", "}", ")", "\n", "}" ]
13,650
all-13651
[ "Int64Var", "defines", "an", "int64", "flag", "with", "specified", "name", "default", "value", "and", "usage", "string", ".", "The", "argument", "p", "points", "to", "an", "int64", "variable", "in", "which", "to", "store", "the", "value", "of", "the", "flag", "." ]
[ "func", "Int64Var", "(", "p", "*", "int64", ",", "name", "string", ",", "value", "int64", ",", "usage", "string", ")", "{", "EnvironmentFlags", ".", "Int64Var", "(", "p", ",", "name", ",", "<mask>", ",", "usage", ")", "\n", "}" ]
13,651
all-13652
[ "Indexes", "return", "a", "copy", "of", "the", "indexes", "in", "this", "schema" ]
[ "func", "(", "s", "*", "Schema", ")", "Indexes", "(", ")", "<mask>", "[", "string", "]", "*", "Index", "{", "result", ":=", "make", "(", "map", "[", "string", "]", "*", "Index", ")", "\n", "for", "k", ",", "v", ":=", "range", "s", ".", "indexes", "{", "result", "[", "k", "]", "=", "v", ".", "copy", "(", ")", "\n", "}", "\n", "return", "result", "\n", "}" ]
13,652
all-13653
[ "Write", "writes", "the", "contents", "of", "p", "." ]
[ "func", "(", "w", "*", "Writer", ")", "Write", "(", "p", "[", "]", "<mask>", ")", "{", "if", "w", ".", "err", "!=", "nil", "{", "return", "\n", "}", "\n", "w", ".", "wr", ".", "Write", "(", "p", ")", "\n", "}" ]
13,653
all-13654
[ "WithText", "text", "as", "generated", "by", "processing", "a", "virtual", "key", "code", "with", "a", "keyboard", "layout", ".", "Not", "needed", "for", "for", "keyUp", "and", "rawKeyDown", "events", "(", "default", ":", ")", "." ]
[ "func", "(", "p", "DispatchKeyEventParams", ")", "WithText", "(", "text", "string", ")", "*", "DispatchKeyEventParams", "{", "p", ".", "Text", "=", "<mask>", "\n", "return", "&", "p", "\n", "}" ]
13,654
all-13655
[ "RemoveAll", "mocks", "base", "method" ]
[ "func", "(", "m", "*", "MockOS", ")", "RemoveAll", "(", "arg0", "string", ")", "error", "{", "<mask>", ":=", "m", ".", "ctrl", ".", "Call", "(", "m", ",", "\"", "\"", ",", "arg0", ")", "\n", "ret0", ",", "_", ":=", "ret", "[", "0", "]", ".", "(", "error", ")", "\n", "return", "ret0", "\n", "}" ]
13,655
all-13656
[ "determine", "if", "a", "name", "corresponds", "to", "a", "texture" ]
[ "func", "IsTexture", "(", "texture", "uint32", ")", "bool", "{", "ret", ",", "_", ",", "_", ":=", "syscall", ".", "Syscall", "(", "gpIsTexture", ",", "1", ",", "uintptr", "(", "texture", ")", ",", "0", ",", "0", ")", "\n", "return", "<mask>", "!=", "0", "\n", "}" ]
13,656
all-13657
[ "FindItem", "looks", "for", "an", "item", "in", "list", "which", "text", "equals", "to", "text", "by", "default", "the", "search", "is", "casesensitive", ".", "Returns", "item", "number", "in", "item", "list", "or", "-", "1", "if", "nothing", "is", "found", "." ]
[ "func", "(", "l", "*", "ListBox", ")", "FindItem", "(", "text", "string", ",", "caseSensitive", "bool", ")", "int", "{", "for", "idx", ",", "itm", ":=", "range", "l", ".", "items", "{", "if", "itm", "==", "text", "||", "(", "caseSensitive", "&&", "strings", ".", "EqualFold", "(", "itm", ",", "<mask>", ")", ")", "{", "return", "idx", "\n", "}", "\n", "}", "\n\n", "return", "-", "1", "\n", "}" ]
13,657
all-13658
[ "MoveToFolder", "moves", "a", "virtual", "machine", "to", "the", "specified", "folder", "." ]
[ "func", "MoveToFolder", "(", "client", "*", "govmomi", ".", "Client", ",", "vm", "*", "object", ".", "VirtualMachine", ",", "relative", "string", ")", "error", "{", "log", ".", "Printf", "(", "\"", "\"", ",", "vm", ".", "InventoryPath", ",", "relative", ")", "\n", "f", ",", "err", ":=", "folder", ".", "VirtualMachineFolderFromObject", "(", "client", ",", "vm", ",", "<mask>", ")", "\n", "if", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n", "return", "folder", ".", "MoveObjectTo", "(", "vm", ".", "Reference", "(", ")", ",", "f", ")", "\n", "}" ]
13,658
all-13659
[ "DefaultTicket", "returns", "a", "ticket", "used", "for", "background", "context", "or", "dev_appserver", "." ]
[ "func", "DefaultTicket", "(", ")", "string", "{", "defaultTicketOnce", ".", "Do", "(", "func", "(", ")", "{", "if", "IsDevAppServer", "(", ")", "{", "defaultTicket", "=", "\"", "\"", "+", "defaultTicketSuffix", "\n", "return", "\n", "}", "\n", "appID", ":=", "partitionlessAppID", "(", ")", "\n", "escAppID", ":=", "strings", ".", "Replace", "(", "strings", ".", "Replace", "(", "appID", ",", "\"", "\"", ",", "\"", "\"", ",", "-", "1", ")", ",", "\"", "\"", ",", "\"", "\"", ",", "-", "1", ")", "\n", "majVersion", ":=", "VersionID", "(", "nil", ")", "\n", "if", "i", ":=", "strings", ".", "<mask>", "(", "majVersion", ",", "\"", "\"", ")", ";", "i", ">", "0", "{", "majVersion", "=", "majVersion", "[", ":", "i", "]", "\n", "}", "\n", "defaultTicket", "=", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "escAppID", ",", "ModuleName", "(", "nil", ")", ",", "majVersion", ",", "InstanceID", "(", ")", ")", "\n", "}", ")", "\n", "return", "defaultTicket", "\n", "}" ]
13,659
all-13660
[ "Locator", "returns", "a", "locator", "for", "the", "given", "resource" ]
[ "func", "(", "r", "*", "ResourceGroup", ")", "Locator", "(", "api", "*", "API", ")", "*", "ResourceGroupLocator", "{", "for", "_", ",", "l", ":=", "<mask>", "r", ".", "Links", "{", "if", "l", "[", "\"", "\"", "]", "==", "\"", "\"", "{", "return", "api", ".", "ResourceGroupLocator", "(", "l", "[", "\"", "\"", "]", ")", "\n", "}", "\n", "}", "\n", "return", "nil", "\n", "}" ]
13,660
all-13661
[ "Insert", "is", "a", "wrapper", "around", "gtk_flow_box_insert", "()" ]
[ "func", "(", "fb", "*", "FlowBox", ")", "Insert", "(", "widget", "IWidget", ",", "position", "int", ")", "{", "C", ".", "gtk_flow_box_insert", "(", "fb", ".", "native", "(", ")", ",", "widget", ".", "toWidget", "(", ")", ",", "C", ".", "gint", "(", "<mask>", ")", ")", "\n", "}" ]
13,661
all-13662
[ "private", "methods" ]
[ "func", "(", "c", "*", "Client", ")", "updateLocalResource", "(", "i", "common", ".", "Item", ",", "state", "string", ",", "data", "*", "common", ".", "UserData", ")", "error", "{", "res", ",", "err", ":=", "common", ".", "ItemToResource", "(", "i", ")", "\n", "if", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n", "res", ".", "State", "=", "state", "\n", "if", "res", ".", "UserData", "==", "nil", "{", "res", ".", "UserData", "=", "<mask>", "\n", "}", "else", "{", "res", ".", "UserData", ".", "Update", "(", "data", ")", "\n", "}", "\n\n", "return", "c", ".", "storage", ".", "Update", "(", "res", ")", "\n", "}" ]
13,662
all-13663
[ "shouldIgnore", "returns", "whether", "a", "write", "to", "the", "given", "file", "should", "be", "ignored", "because", "they", "were", "caused", "by", "gazelle", "or", "autogazelle", "or", "something", "unrelated", "to", "the", "build", "." ]
[ "func", "shouldIgnore", "(", "p", "string", ")", "bool", "{", "p", "=", "strings", ".", "TrimPrefix", "(", "filepath", ".", "ToSlash", "(", "p", ")", ",", "\"", "\"", ")", "\n", "base", ":=", "path", ".", "Base", "(", "p", ")", "\n", "return", "strings", ".", "HasPrefix", "(", "p", ",", "\"", "\"", ")", "||", "base", "==", "\"", "\"", "||", "base", "==", "\"", "\"", "||", "<mask>", "==", "\"", "\"", "\n", "}" ]
13,663
all-13664
[ "GetBranchProtection", "returns", "the", "policy", "for", "a", "given", "branch", ".", "Handles", "merging", "any", "policies", "defined", "at", "repo", "/", "org", "/", "global", "levels", "into", "the", "branch", "policy", "." ]
[ "func", "(", "c", "*", "Config", ")", "GetBranchProtection", "(", "org", ",", "repo", ",", "branch", "string", ")", "(", "*", "<mask>", ",", "error", ")", "{", "if", "_", ",", "present", ":=", "c", ".", "BranchProtection", ".", "Orgs", "[", "org", "]", ";", "!", "present", "{", "return", "nil", ",", "nil", "// only consider branches in configured orgs", "\n", "}", "\n", "b", ",", "err", ":=", "c", ".", "BranchProtection", ".", "GetOrg", "(", "org", ")", ".", "GetRepo", "(", "repo", ")", ".", "GetBranch", "(", "branch", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "return", "c", ".", "GetPolicy", "(", "org", ",", "repo", ",", "branch", ",", "*", "b", ")", "\n", "}" ]
13,664
all-13665
[ "SetOrientation", "()", "is", "a", "wrapper", "around", "gtk_print_settings_set_orientation", "()", "." ]
[ "func", "(", "<mask>", "*", "PrintSettings", ")", "SetOrientation", "(", "orientation", "PageOrientation", ")", "{", "C", ".", "gtk_print_settings_set_orientation", "(", "ps", ".", "native", "(", ")", ",", "C", ".", "GtkPageOrientation", "(", "orientation", ")", ")", "\n", "}" ]
13,665
all-13666
[ "///////////////////////////////////////////////", "TODO", ":", "возможно", "в", "эту", "задачу", "хорошо", "подойдет", "fasthttp", ".", "Нужно", "будет", "посмотреть", "TODO", ":", "на", "сколько", "все", "станет", "сложнее", "." ]
[ "func", "main", "(", ")", "{", "//go RunTestServer(\":8088\")", "//go RunTestServer(\":8089\")", "//go RunTestServer(\":8090\")", "config", ":=", "ParseArgs", "(", ")", "\n\n", "logger", ",", "err", ":=", "CreateLogger", "(", "config", ".", "LogLevel", ",", "\"", "\"", ")", "\n", "utils", ".", "HandleErrorWithoutLogger", "(", "\"", "\"", ",", "err", ")", "\n", "logger", ".", "Debugf", "(", "\"", "\"", ",", "config", ")", "\n\n", "// TODO: прокинуть Repeate-настроки куда нужно", "forwarder", ",", "err", ":=", "CreateForwarder", "(", "logger", ",", "config", ".", "Upstreams", ")", "\n", "utils", ".", "HandleError", "(", "logger", ",", "\"", "\"", ",", "err", ")", "\n\n", "storer", ",", "err", ":=", "storage", ".", "StartStorer", "(", "logger", ",", "config", ".", "Storage", ",", "config", ".", "RepeatNumber", ",", "5", "*", "time", ".", "Second", ",", "100000", ")", "\n", "utils", ".", "HandleError", "(", "logger", ",", "\"", "\"", ",", "err", ")", "\n", "defer", "storer", ".", "Stop", "(", ")", "\n\n", "repeater", ",", "err", ":=", "StartRepeater", "(", "logger", ",", "forwarder", ",", "storer", ",", "config", ".", "RepeatTimeout", ",", "config", ".", "RepeatNumber", ")", "\n", "utils", ".", "HandleError", "(", "logger", ",", "\"", "\"", ",", "err", ")", "\n", "defer", "repeater", ".", "Stop", "(", ")", "\n\n", "err", "=", "httpdown", ".", "ListenAndServe", "(", "&", "http", ".", "Server", "{", "Addr", ":", "config", ".", "Address", ",", "Handler", ":", "NewStreamer", "(", "logger", ",", "storer", ",", "forwarder", ")", ",", "}", ",", "&", "httpdown", ".", "HTTP", "{", "StopTimeout", ":", "10", "*", "time", ".", "Second", ",", "KillTimeout", ":", "1", "*", "<mask>", ".", "Second", ",", "}", ")", "\n", "utils", ".", "HandleError", "(", "logger", ",", "\"", "\"", ",", "err", ")", "\n", "}" ]
13,666
all-13667
[ "setCell", "sets", "the", "content", "of", "the", "window", "cell", "at", "the", "x", "and", "y", "coordinate", ".", "setCell", "shall", "be", "called", "from", "queue", "context", "." ]
[ "func", "(", "w", "*", "Window", ")", "setCell", "(", "x", ",", "y", "int", ",", "c", "Cell", ")", "{", "c", ".", "dirty", "=", "<mask>", "\n", "pos", ":=", "x", "+", "(", "y", "*", "w", ".", "x", ")", "\n", "if", "pos", "<", "len", "(", "w", ".", "backingStore", ")", "{", "w", ".", "backingStore", "[", "pos", "]", "=", "c", "\n", "}", "\n", "}" ]
13,667
all-13668
[ "MarshalJSON", "supports", "json", ".", "Marshaler", "interface" ]
[ "func", "(", "v", "EventExecutionContextCreated", ")", "MarshalJSON", "(", ")", "(", "[", "]", "byte", ",", "error", ")", "{", "w", ":=", "jwriter", ".", "Writer", "{", "}", "\n", "easyjsonC5a4559bEncodeGithubComChromedpCdprotoRuntime32", "(", "&", "w", ",", "v", ")", "\n", "return", "w", ".", "<mask>", ".", "BuildBytes", "(", ")", ",", "w", ".", "Error", "\n", "}" ]
13,668
all-13669
[ "Update", "the", "schema", "and", "api_extensions", "columns", "of", "the", "row", "in", "the", "nodes", "table", "that", "matches", "the", "given", "id", ".", "If", "not", "such", "row", "is", "found", "an", "error", "is", "returned", "." ]
[ "func", "updateNodeVersion", "(", "tx", "*", "sql", ".", "Tx", ",", "address", "string", ",", "apiExtensions", "int", ")", "error", "{", "stmt", ":=", "\"", "\"", "\n", "result", ",", "err", ":=", "tx", ".", "Exec", "(", "stmt", ",", "len", "(", "updates", ")", ",", "apiExtensions", ",", "<mask>", ")", "\n", "if", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n", "n", ",", "err", ":=", "result", ".", "RowsAffected", "(", ")", "\n", "if", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n", "if", "n", "!=", "1", "{", "return", "fmt", ".", "Errorf", "(", "\"", "\"", ",", "n", ")", "\n", "}", "\n", "return", "nil", "\n", "}" ]
13,669
all-13670
[ "GetStyle", "returns", "the", "Style", "field", "if", "non", "-", "nil", "zero", "value", "otherwise", "." ]
[ "func", "(", "t", "*", "ToplistRequest", ")", "GetStyle", "(", ")", "WidgetRequestStyle", "{", "if", "t", "==", "nil", "||", "t", ".", "Style", "==", "nil", "{", "<mask>", "WidgetRequestStyle", "{", "}", "\n", "}", "\n", "return", "*", "t", ".", "Style", "\n", "}" ]
13,670
all-13671
[ "SetSChar", "is", "a", "wrapper", "around", "g_value_set_schar", "()", "." ]
[ "func", "(", "v", "*", "<mask>", ")", "SetSChar", "(", "val", "int8", ")", "{", "C", ".", "g_value_set_schar", "(", "v", ".", "native", "(", ")", ",", "C", ".", "gint8", "(", "val", ")", ")", "\n", "}" ]
13,671
all-13672
[ "tagTypeForObject", "takes", "an", "object", ".", "Reference", "and", "returns", "the", "tag", "type", "based", "on", "its", "underlying", "type", ".", "If", "it", "s", "not", "in", "this", "list", "we", "don", "t", "support", "it", "for", "tagging", "and", "we", "return", "an", "error", "." ]
[ "func", "tagTypeForObject", "(", "obj", "object", ".", "Reference", ")", "(", "string", ",", "error", ")", "{", "switch", "obj", ".", "(", "type", ")", "{", "case", "*", "<mask>", ".", "VirtualMachine", ":", "return", "vSphereTagTypeVirtualMachine", ",", "nil", "\n", "case", "*", "object", ".", "Datastore", ":", "return", "vSphereTagTypeDatastore", ",", "nil", "\n", "case", "*", "object", ".", "Network", ":", "return", "vSphereTagTypeNetwork", ",", "nil", "\n", "case", "*", "object", ".", "Folder", ":", "return", "vSphereTagTypeFolder", ",", "nil", "\n", "case", "*", "object", ".", "VmwareDistributedVirtualSwitch", ":", "return", "vSphereTagTypeVmwareDistributedVirtualSwitch", ",", "nil", "\n", "case", "*", "object", ".", "DistributedVirtualSwitch", ":", "return", "vSphereTagTypeDistributedVirtualSwitch", ",", "nil", "\n", "case", "*", "object", ".", "DistributedVirtualPortgroup", ":", "return", "vSphereTagTypeDistributedVirtualPortgroup", ",", "nil", "\n", "case", "*", "object", ".", "Datacenter", ":", "return", "vSphereTagTypeDatacenter", ",", "nil", "\n", "case", "*", "object", ".", "ClusterComputeResource", ":", "return", "vSphereTagTypeClusterComputeResource", ",", "nil", "\n", "case", "*", "object", ".", "HostSystem", ":", "return", "vSphereTagTypeHostSystem", ",", "nil", "\n", "case", "*", "object", ".", "StoragePod", ":", "return", "vSphereTagTypeStoragePod", ",", "nil", "\n", "case", "*", "object", ".", "ResourcePool", ":", "return", "vSphereTagTypeResourcePool", ",", "nil", "\n", "case", "*", "object", ".", "VirtualApp", ":", "return", "vSphereTagTypeVirtualApp", ",", "nil", "\n", "}", "\n", "return", "\"", "\"", ",", "fmt", ".", "Errorf", "(", "\"", "\"", ",", "obj", ")", "\n", "}" ]
13,672
all-13673
[ "leaseRevokeCommandFunc", "executes", "the", "lease", "grant", "command", "." ]
[ "func", "leaseRevokeCommandFunc", "(", "cmd", "*", "cobra", ".", "Command", ",", "args", "[", "]", "string", ")", "{", "if", "len", "(", "args", ")", "!=", "1", "{", "ExitWithError", "(", "ExitBadArgs", ",", "fmt", ".", "Errorf", "(", "\"", "\"", ")", ")", "\n", "}", "\n\n", "id", ":=", "leaseFromArgs", "(", "args", "[", "0", "]", ")", "\n", "ctx", ",", "cancel", ":=", "commandCtx", "(", "cmd", ")", "\n", "resp", ",", "err", ":=", "mustClientFromCmd", "(", "cmd", ")", ".", "Revoke", "(", "ctx", ",", "id", ")", "\n", "cancel", "(", ")", "\n", "if", "err", "!=", "nil", "{", "ExitWithError", "(", "ExitError", ",", "fmt", ".", "Errorf", "(", "\"", "\"", ",", "err", ")", ")", "\n", "}", "\n", "display", ".", "Revoke", "(", "<mask>", ",", "*", "resp", ")", "\n", "}" ]
13,673
all-13674
[ "NewWaitGroup", "instantiates", "a", "new", "WaitGroup", "with", "the", "given", "throttle", "." ]
[ "func", "NewWaitGroup", "(", "throttle", "int", ")", "*", "WaitGroup", "{", "return", "&", "WaitGroup", "{", "outstanding", ":", "0", ",", "throttle", ":", "throttle", ",", "completed", ":", "<mask>", "(", "chan", "bool", ",", "throttle", ")", ",", "}", "\n", "}" ]
13,674
all-13675
[ "NewQueue", "creates", "a", "new", "job", "queue", "." ]
[ "func", "NewQueue", "(", "conf", "*", "Config", ",", "logger", "log", ".", "Logger", ",", "<mask>", "*", "reform", ".", "DB", ",", "handlers", "HandlerMap", ")", "Queue", "{", "l", ":=", "logger", ".", "Add", "(", "\"", "\"", ",", "\"", "\"", ")", "\n", "return", "&", "queue", "{", "conf", ":", "conf", ",", "logger", ":", "l", ",", "db", ":", "db", ",", "handlers", ":", "handlers", ",", "subs", ":", "map", "[", "string", "]", "[", "]", "subEntry", "{", "}", ",", "}", "\n", "}" ]
13,675
all-13676
[ "Profile", "update", "of", "a", "single", "container", "." ]
[ "func", "doProfileUpdateContainer", "(", "d", "*", "Daemon", ",", "name", "string", ",", "old", "api", ".", "ProfilePut", ",", "nodeName", "string", ",", "args", "db", ".", "ContainerArgs", ")", "error", "{", "if", "args", ".", "Node", "!=", "\"", "\"", "&&", "args", ".", "Node", "!=", "nodeName", "{", "// No-op, this container does not belong to this node.", "return", "nil", "\n", "}", "\n\n", "profiles", ",", "err", ":=", "d", ".", "cluster", ".", "ProfilesGet", "(", "args", ".", "<mask>", ",", "args", ".", "Profiles", ")", "\n", "if", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n", "for", "i", ",", "profileName", ":=", "range", "args", ".", "Profiles", "{", "if", "profileName", "==", "name", "{", "// Use the old config and devices.", "profiles", "[", "i", "]", ".", "Config", "=", "old", ".", "Config", "\n", "profiles", "[", "i", "]", ".", "Devices", "=", "old", ".", "Devices", "\n", "break", "\n", "}", "\n", "}", "\n\n", "c", ":=", "containerLXCInstantiate", "(", "d", ".", "State", "(", ")", ",", "args", ")", "\n\n", "c", ".", "expandConfig", "(", "profiles", ")", "\n", "c", ".", "expandDevices", "(", "profiles", ")", "\n\n", "return", "c", ".", "Update", "(", "db", ".", "ContainerArgs", "{", "Architecture", ":", "c", ".", "Architecture", "(", ")", ",", "Config", ":", "c", ".", "LocalConfig", "(", ")", ",", "Description", ":", "c", ".", "Description", "(", ")", ",", "Devices", ":", "c", ".", "LocalDevices", "(", ")", ",", "Ephemeral", ":", "c", ".", "IsEphemeral", "(", ")", ",", "Profiles", ":", "c", ".", "Profiles", "(", ")", ",", "Project", ":", "c", ".", "Project", "(", ")", ",", "}", ",", "true", ")", "\n", "}" ]
13,676
all-13677
[ "GetComputeOk", "returns", "a", "tuple", "with", "the", "Compute", "field", "if", "it", "s", "non", "-", "nil", "zero", "value", "otherwise", "and", "a", "boolean", "to", "check", "if", "the", "value", "has", "been", "set", "." ]
[ "func", "(", "w", "*", "WidgetApmOrLogQuery", ")", "GetComputeOk", "(", ")", "(", "ApmOrLogQueryCompute", ",", "bool", ")", "{", "if", "w", "==", "nil", "||", "w", ".", "Compute", "==", "nil", "{", "return", "ApmOrLogQueryCompute", "{", "}", ",", "false", "\n", "}", "\n", "return", "*", "w", ".", "Compute", ",", "<mask>", "\n", "}" ]
13,677
all-13678
[ "Debugln", "logs", "a", "line", "with", "a", "DEBUG", "prefix", "." ]
[ "func", "(", "l", "*", "logger", ")", "Debugln", "(", "vals", "...", "<mask>", "{", "}", ")", "{", "l", ".", "mut", ".", "Lock", "(", ")", "\n", "defer", "l", ".", "mut", ".", "Unlock", "(", ")", "\n", "s", ":=", "fmt", ".", "Sprintln", "(", "vals", "...", ")", "\n", "l", ".", "logger", ".", "Output", "(", "2", ",", "\"", "\"", "+", "s", ")", "\n", "l", ".", "callHandlers", "(", "LevelDebug", ",", "s", ")", "\n", "}" ]
13,678
all-13679
[ "MustUpdated", "retrieves", "the", "Updated", "value", "from", "the", "union", "panicing", "if", "the", "value", "is", "not", "set", "." ]
[ "func", "(", "u", "LedgerEntryChange", ")", "MustUpdated", "(", ")", "LedgerEntry", "{", "val", ",", "<mask>", ":=", "u", ".", "GetUpdated", "(", ")", "\n\n", "if", "!", "ok", "{", "panic", "(", "\"", "\"", ")", "\n", "}", "\n\n", "return", "val", "\n", "}" ]
13,679
all-13680
[ "NewIssueComment", "creates", "a", "Comment", "from", "a", "github", ".", "IssueComment" ]
[ "func", "NewIssueComment", "(", "issueID", "int", ",", "gComment", "*", "github", ".", "IssueComment", ",", "repository", "string", ")", "(", "*", "sql", ".", "Comment", ",", "error", ")", "{", "if", "gComment", ".", "ID", "==", "nil", "||", "gComment", ".", "Body", "==", "nil", "||", "gComment", ".", "CreatedAt", "==", "nil", "||", "gComment", ".", "UpdatedAt", "==", "nil", "{", "return", "nil", ",", "fmt", ".", "Errorf", "(", "\"", "\"", ",", "gComment", ")", "\n", "}", "\n\n", "var", "login", "string", "\n", "if", "gComment", ".", "User", "!=", "nil", "&&", "gComment", ".", "User", ".", "Login", "!=", "nil", "{", "login", "=", "*", "gComment", ".", "User", ".", "Login", "\n", "}", "\n\n", "return", "&", "sql", ".", "Comment", "{", "ID", ":", "itoa", "(", "*", "gComment", ".", "ID", ")", ",", "IssueID", ":", "strconv", ".", "Itoa", "(", "issueID", ")", ",", "Body", ":", "*", "gComment", ".", "Body", ",", "<mask>", ":", "login", ",", "CommentCreatedAt", ":", "*", "gComment", ".", "CreatedAt", ",", "CommentUpdatedAt", ":", "*", "gComment", ".", "UpdatedAt", ",", "PullRequest", ":", "false", ",", "Repository", ":", "strings", ".", "ToLower", "(", "repository", ")", ",", "}", ",", "nil", "\n", "}" ]
13,680
all-13681
[ "MarshalJSON", "supports", "json", ".", "Marshaler", "interface" ]
[ "func", "(", "v", "AwaitPromiseReturns", ")", "MarshalJSON", "(", ")", "(", "[", "]", "byte", ",", "error", ")", "{", "w", ":=", "jwriter", ".", "<mask>", "{", "}", "\n", "easyjsonC5a4559bEncodeGithubComChromedpCdprotoRuntime50", "(", "&", "w", ",", "v", ")", "\n", "return", "w", ".", "Buffer", ".", "BuildBytes", "(", ")", ",", "w", ".", "Error", "\n", "}" ]
13,681
all-13682
[ "GetDefaultPageSetup", "()", "is", "a", "wrapper", "around", "gtk_print_operation_get_default_page_setup", "()", "." ]
[ "func", "(", "<mask>", "*", "PrintOperation", ")", "GetDefaultPageSetup", "(", ")", "(", "*", "PageSetup", ",", "error", ")", "{", "c", ":=", "C", ".", "gtk_print_operation_get_default_page_setup", "(", "po", ".", "native", "(", ")", ")", "\n", "if", "c", "==", "nil", "{", "return", "nil", ",", "nilPtrErr", "\n", "}", "\n", "obj", ":=", "glib", ".", "Take", "(", "unsafe", ".", "Pointer", "(", "c", ")", ")", "\n", "return", "wrapPageSetup", "(", "obj", ")", ",", "nil", "\n", "}" ]
13,682
all-13683
[ "GetAuthorizationToken", "mocks", "base", "method" ]
[ "func", "(", "m", "*", "MockECRSDK", ")", "GetAuthorizationToken", "(", "arg0", "*", "ecr0", ".", "GetAuthorizationTokenInput", ")", "(", "*", "ecr0", ".", "GetAuthorizationTokenOutput", ",", "error", ")", "{", "ret", ":=", "m", ".", "ctrl", ".", "Call", "(", "m", ",", "\"", "\"", ",", "arg0", ")", "\n", "ret0", ",", "_", ":=", "<mask>", "[", "0", "]", ".", "(", "*", "ecr0", ".", "GetAuthorizationTokenOutput", ")", "\n", "ret1", ",", "_", ":=", "ret", "[", "1", "]", ".", "(", "error", ")", "\n", "return", "ret0", ",", "ret1", "\n", "}" ]
13,683
all-13684
[ "newBICLocationReference", "returns", "a", "BICLocationReference", "appropriate", "for", "ref", "." ]
[ "func", "newBICLocationReference", "(", "<mask>", "dockerReference", ")", "types", ".", "BICLocationReference", "{", "// Blobs are scoped to repositories (the tag/digest are not necessary to reuse a blob).", "return", "types", ".", "BICLocationReference", "{", "Opaque", ":", "ref", ".", "ref", ".", "Name", "(", ")", "}", "\n", "}" ]
13,684
all-13685
[ "InfoFunc", "outputs", "Info", "level", "log", "returned", "from", "the", "function" ]
[ "func", "(", "g", "*", "Glg", ")", "InfoFunc", "(", "f", "func", "(", ")", "string", ")", "error", "{", "if", "g", ".", "isModeEnable", "(", "<mask>", ")", "{", "return", "g", ".", "out", "(", "INFO", ",", "\"", "\"", ",", "f", "(", ")", ")", "\n", "}", "\n", "return", "nil", "\n", "}" ]
13,685
all-13686
[ "querystring", "implements", "querystringer", "to", "represent", "the", "outgoing", "voice", "note", "." ]
[ "func", "(", "ov", "*", "OutgoingVoice", ")", "querystring", "(", ")", "querystring", "{", "toReturn", ":=", "<mask>", "[", "string", "]", "string", "(", "ov", ".", "getBaseQueryString", "(", ")", ")", "\n\n", "if", "ov", ".", "Duration", "!=", "0", "{", "toReturn", "[", "\"", "\"", "]", "=", "fmt", ".", "Sprint", "(", "ov", ".", "Duration", ")", "\n", "}", "\n\n", "return", "querystring", "(", "toReturn", ")", "\n", "}" ]
13,686
all-13687
[ "recvPeerFrame", "waits", "for", "a", "new", "frame", "from", "the", "peer", "or", "until", "the", "context", "expires", "or", "is", "cancelled" ]
[ "func", "(", "mex", "*", "messageExchange", ")", "recvPeerFrame", "(", ")", "(", "*", "Frame", ",", "error", ")", "{", "// We have to check frames/errors in a very specific order here:", "// 1. Timeouts/cancellation (mex.ctx errors)", "// 2. Any pending frames (non-blocking select over mex.recvCh)", "// 3. Other mex errors (mex.errCh)", "// Which is why we check the context error only (instead of mex.checkError)e", "// In the mex.errCh case, we do a non-blocking read from recvCh to prioritize it.", "if", "err", ":=", "mex", ".", "ctx", ".", "Err", "(", ")", ";", "err", "!=", "nil", "{", "return", "nil", ",", "GetContextError", "(", "err", ")", "\n", "}", "\n\n", "select", "{", "case", "frame", ":=", "<-", "mex", ".", "recvCh", ":", "if", "err", ":=", "mex", ".", "checkFrame", "(", "frame", ")", ";", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n", "return", "frame", ",", "nil", "\n", "case", "<-", "mex", ".", "ctx", ".", "Done", "(", ")", ":", "return", "nil", ",", "GetContextError", "(", "mex", ".", "ctx", ".", "Err", "(", ")", ")", "\n", "case", "<-", "mex", ".", "errCh", ".", "c", ":", "// Select will randomly choose a case, but we want to prioritize", "// receiving a frame over errCh. Try a non-blocking read.", "select", "{", "<mask>", "frame", ":=", "<-", "mex", ".", "recvCh", ":", "if", "err", ":=", "mex", ".", "checkFrame", "(", "frame", ")", ";", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n", "return", "frame", ",", "nil", "\n", "default", ":", "}", "\n", "return", "nil", ",", "mex", ".", "errCh", ".", "err", "\n", "}", "\n", "}" ]
13,687
all-13688
[ "SelectChild", "is", "a", "wrapper", "around", "gtk_flow_box_select_child", "()" ]
[ "func", "(", "fb", "*", "FlowBox", ")", "SelectChild", "(", "<mask>", "*", "FlowBoxChild", ")", "{", "C", ".", "gtk_flow_box_select_child", "(", "fb", ".", "native", "(", ")", ",", "child", ".", "native", "(", ")", ")", "\n", "}" ]
13,688
all-13689
[ "Do", "executes", "CSS", ".", "getPlatformFontsForNode", "against", "the", "provided", "context", ".", "returns", ":", "fonts", "-", "Usage", "statistics", "for", "every", "employed", "platform", "font", "." ]
[ "func", "(", "p", "*", "GetPlatformFontsForNodeParams", ")", "Do", "(", "ctx", "context", ".", "<mask>", ")", "(", "fonts", "[", "]", "*", "PlatformFontUsage", ",", "err", "error", ")", "{", "// execute", "var", "res", "GetPlatformFontsForNodeReturns", "\n", "err", "=", "cdp", ".", "Execute", "(", "ctx", ",", "CommandGetPlatformFontsForNode", ",", "p", ",", "&", "res", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "return", "res", ".", "Fonts", ",", "nil", "\n", "}" ]
13,689
all-13690
[ "checkRPCHeader", "houses", "logic", "about", "whether", "this", "instance", "of", "Raft", "can", "process", "the", "given", "RPC", "message", "." ]
[ "func", "(", "r", "*", "Raft", ")", "checkRPCHeader", "(", "rpc", "RPC", ")", "error", "{", "// Get the header off the RPC message.", "wh", ",", "ok", ":=", "rpc", ".", "Command", ".", "(", "WithRPCHeader", ")", "\n", "if", "!", "ok", "{", "return", "fmt", ".", "Errorf", "(", "\"", "\"", ")", "\n", "}", "\n", "header", ":=", "wh", ".", "GetRPCHeader", "(", ")", "\n\n", "// First check is to just make sure the code can understand the", "// protocol at all.", "if", "header", ".", "ProtocolVersion", "<", "ProtocolVersionMin", "||", "header", ".", "ProtocolVersion", ">", "ProtocolVersionMax", "{", "return", "ErrUnsupportedProtocol", "\n", "}", "\n\n", "// Second check is whether we should support this message, given the", "// current protocol we are configured to run. This will drop support", "// for protocol version 0 starting at protocol version 2, which is", "// currently what we want, and in general support one version back. We", "// may need to revisit this policy depending on how future protocol", "// changes evolve.", "if", "<mask>", ".", "ProtocolVersion", "<", "r", ".", "conf", ".", "ProtocolVersion", "-", "1", "{", "return", "ErrUnsupportedProtocol", "\n", "}", "\n\n", "return", "nil", "\n", "}" ]
13,690
all-13691
[ "WriteTo", "writes", "data", "to", "w", "." ]
[ "func", "(", "e", "*", "helperMethodContent", ")", "WriteTo", "(", "w", "io", ".", "Writer", ")", "(", "int64", ",", "error", ")", "{", "var", "bf", "bytes", ".", "<mask>", "\n\n", "inner", ":=", "e", ".", "src", ".", "inner", "\n", "if", "inner", "==", "nil", "{", "return", "0", ",", "fmt", ".", "Errorf", "(", "\"", "\"", ",", "e", ".", "ln", ".", "fileName", "(", ")", ",", "e", ".", "ln", ".", "no", ")", "\n", "}", "\n\n", "// Write a define action.", "bf", ".", "WriteString", "(", "fmt", ".", "Sprintf", "(", "actionDefine", ",", "e", ".", "opts", ".", "DelimLeft", ",", "inner", ".", "path", "+", "doubleColon", "+", "e", ".", "name", ",", "e", ".", "opts", ".", "DelimRight", ")", ")", "\n\n", "// Write the children's HTML.", "if", "i", ",", "err", ":=", "e", ".", "writeChildren", "(", "&", "bf", ")", ";", "err", "!=", "nil", "{", "return", "i", ",", "err", "\n", "}", "\n\n", "// Write an end action.", "bf", ".", "WriteString", "(", "fmt", ".", "Sprintf", "(", "actionEnd", ",", "e", ".", "opts", ".", "DelimLeft", ",", "e", ".", "opts", ".", "DelimRight", ")", ")", "\n\n", "// Write the buffer.", "i", ",", "err", ":=", "w", ".", "Write", "(", "bf", ".", "Bytes", "(", ")", ")", "\n\n", "return", "int64", "(", "i", ")", ",", "err", "\n", "}" ]
13,691
all-13692
[ "Run", "implements", "the", "Worker", "interface", "." ]
[ "func", "(", "sd", "*", "StaticProvider", ")", "Run", "(", "ctx", "context", ".", "Context", ",", "ch", "chan", "<-", "[", "]", "*", "targetgroup", ".", "Group", ")", "{", "// We still have to consider that the consumer exits right away in which case", "// the context will be canceled.", "select", "{", "case", "ch", "<-", "sd", ".", "TargetGroups", ":", "case", "<-", "ctx", ".", "Done", "(", ")", ":", "}", "\n", "<mask>", "(", "ch", ")", "\n", "}" ]
13,692
all-13693
[ "HexToBytes", "reutrns", "the", "bytes", "represented", "by", "the", "hex", "of", "string", "s", "." ]
[ "func", "HexToBytes", "(", "s", "HexString", ")", "(", "[", "]", "byte", ",", "error", ")", "{", "s2", ":=", "string", "(", "s", ")", "\n", "if", "strings", ".", "HasPrefix", "(", "s2", ",", "\"", "\"", ")", "||", "strings", ".", "HasPrefix", "(", "s2", ",", "\"", "\"", ")", "{", "s2", "=", "s2", "[", "2", ":", "]", "\n", "}", "\n", "return", "<mask>", ".", "DecodeString", "(", "s2", ")", "\n", "}" ]
13,693
all-13694
[ "Prevent", "users", "from", "relabing", "system", "files" ]
[ "func", "badPrefix", "(", "fpath", "string", ")", "error", "{", "var", "badprefixes", "=", "[", "]", "string", "{", "\"", "\"", "}", "\n\n", "for", "_", ",", "prefix", ":=", "range", "badprefixes", "{", "if", "fpath", "==", "prefix", "||", "strings", ".", "HasPrefix", "(", "fpath", ",", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "prefix", ")", ")", "{", "return", "fmt", ".", "Errorf", "(", "\"", "\"", ",", "<mask>", ")", "\n", "}", "\n", "}", "\n", "return", "nil", "\n", "}" ]
13,694
all-13695
[ "CacheFunc", "accepts", "two", "parameters", "first", "is", "the", "http", ".", "HandlerFunc", "which", "you", "want", "to", "cache", "its", "result", "the", "second", "is", "optional", "the", "cache", "Entry", "s", "expiration", "duration", "if", "the", "expiration", "<", "=", "2", "seconds", "then", "expiration", "is", "taken", "by", "the", "cache", "-", "control", "s", "maxage", "header", "returns", "an", "http", ".", "HandlerFunc", "which", "you", "can", "use", "as", "your", "default", "router", "or", "per", "-", "route", "handler", "All", "type", "of", "responses", "are", "cached", "templates", "json", "text", "anything", ".", "You", "CAN", "NOT", "add", "validators", "with", "this", "function" ]
[ "func", "CacheFunc", "(", "bodyHandler", "func", "(", "http", ".", "ResponseWriter", ",", "*", "http", ".", "<mask>", ")", ",", "expiration", "time", ".", "Duration", ")", "http", ".", "HandlerFunc", "{", "return", "Cache", "(", "http", ".", "HandlerFunc", "(", "bodyHandler", ")", ",", "expiration", ")", ".", "ServeHTTP", "\n", "}" ]
13,695
all-13696
[ "Execute", "execute", "tmpl" ]
[ "func", "(", "tmpl", "*", "Template", ")", "Execute", "(", "templateName", "string", ",", "obj", "interface", "{", "}", ",", "req", "*", "http", ".", "Request", ",", "w", "http", ".", "ResponseWriter", ")", "error", "{", "<mask>", ",", "err", ":=", "tmpl", ".", "Render", "(", "templateName", ",", "obj", ",", "req", ",", "w", ")", "\n", "if", "err", "==", "nil", "{", "if", "w", ".", "Header", "(", ")", ".", "Get", "(", "\"", "\"", ")", "==", "\"", "\"", "{", "w", ".", "Header", "(", ")", ".", "Set", "(", "\"", "\"", ",", "\"", "\"", ")", "\n", "}", "\n\n", "_", ",", "err", "=", "w", ".", "Write", "(", "[", "]", "byte", "(", "result", ")", ")", "\n", "}", "\n", "return", "err", "\n", "}" ]
13,696
all-13697
[ "FormatDiffSlice", "prints", "a", "diff", "for", "the", "slices", "(", "or", "strings", ")", "represented", "by", "v", ".", "This", "provides", "custom", "-", "tailored", "logic", "to", "make", "printing", "of", "differences", "in", "textual", "strings", "and", "slices", "of", "primitive", "kinds", "more", "readable", "." ]
[ "func", "(", "opts", "formatOptions", ")", "FormatDiffSlice", "(", "v", "*", "valueNode", ")", "textNode", "{", "assert", "(", "opts", ".", "DiffMode", "==", "diffUnknown", ")", "\n", "t", ",", "vx", ",", "vy", ":=", "v", ".", "Type", ",", "v", ".", "ValueX", ",", "v", ".", "ValueY", "\n\n", "// Auto-detect the type of the data.", "var", "isLinedText", ",", "isText", ",", "isBinary", "bool", "\n", "<mask>", "sx", ",", "sy", "string", "\n", "switch", "{", "case", "t", ".", "Kind", "(", ")", "==", "reflect", ".", "String", ":", "sx", ",", "sy", "=", "vx", ".", "String", "(", ")", ",", "vy", ".", "String", "(", ")", "\n", "isText", "=", "true", "// Initial estimate, verify later", "\n", "case", "t", ".", "Kind", "(", ")", "==", "reflect", ".", "Slice", "&&", "t", ".", "Elem", "(", ")", "==", "reflect", ".", "TypeOf", "(", "byte", "(", "0", ")", ")", ":", "sx", ",", "sy", "=", "string", "(", "vx", ".", "Bytes", "(", ")", ")", ",", "string", "(", "vy", ".", "Bytes", "(", ")", ")", "\n", "isBinary", "=", "true", "// Initial estimate, verify later", "\n", "case", "t", ".", "Kind", "(", ")", "==", "reflect", ".", "Array", ":", "// Arrays need to be addressable for slice operations to work.", "vx2", ",", "vy2", ":=", "reflect", ".", "New", "(", "t", ")", ".", "Elem", "(", ")", ",", "reflect", ".", "New", "(", "t", ")", ".", "Elem", "(", ")", "\n", "vx2", ".", "Set", "(", "vx", ")", "\n", "vy2", ".", "Set", "(", "vy", ")", "\n", "vx", ",", "vy", "=", "vx2", ",", "vy2", "\n", "}", "\n", "if", "isText", "||", "isBinary", "{", "var", "numLines", ",", "lastLineIdx", ",", "maxLineLen", "int", "\n", "isBinary", "=", "false", "\n", "for", "i", ",", "r", ":=", "range", "sx", "+", "sy", "{", "if", "!", "(", "unicode", ".", "IsPrint", "(", "r", ")", "||", "unicode", ".", "IsSpace", "(", "r", ")", ")", "||", "r", "==", "utf8", ".", "RuneError", "{", "isBinary", "=", "true", "\n", "break", "\n", "}", "\n", "if", "r", "==", "'\\n'", "{", "if", "maxLineLen", "<", "i", "-", "lastLineIdx", "{", "lastLineIdx", "=", "i", "-", "lastLineIdx", "\n", "}", "\n", "lastLineIdx", "=", "i", "+", "1", "\n", "numLines", "++", "\n", "}", "\n", "}", "\n", "isText", "=", "!", "isBinary", "\n", "isLinedText", "=", "isText", "&&", "numLines", ">=", "4", "&&", "maxLineLen", "<=", "256", "\n", "}", "\n\n", "// Format the string into printable records.", "var", "list", "textList", "\n", "var", "delim", "string", "\n", "switch", "{", "// If the text appears to be multi-lined text,", "// then perform differencing across individual lines.", "case", "isLinedText", ":", "ssx", ":=", "strings", ".", "Split", "(", "sx", ",", "\"", "\\n", "\"", ")", "\n", "ssy", ":=", "strings", ".", "Split", "(", "sy", ",", "\"", "\\n", "\"", ")", "\n", "list", "=", "opts", ".", "formatDiffSlice", "(", "reflect", ".", "ValueOf", "(", "ssx", ")", ",", "reflect", ".", "ValueOf", "(", "ssy", ")", ",", "1", ",", "\"", "\"", ",", "func", "(", "v", "reflect", ".", "Value", ",", "d", "diffMode", ")", "textRecord", "{", "s", ":=", "formatString", "(", "v", ".", "Index", "(", "0", ")", ".", "String", "(", ")", ")", "\n", "return", "textRecord", "{", "Diff", ":", "d", ",", "Value", ":", "textLine", "(", "s", ")", "}", "\n", "}", ",", ")", "\n", "delim", "=", "\"", "\\n", "\"", "\n", "// If the text appears to be single-lined text,", "// then perform differencing in approximately fixed-sized chunks.", "// The output is printed as quoted strings.", "case", "isText", ":", "list", "=", "opts", ".", "formatDiffSlice", "(", "reflect", ".", "ValueOf", "(", "sx", ")", ",", "reflect", ".", "ValueOf", "(", "sy", ")", ",", "64", ",", "\"", "\"", ",", "func", "(", "v", "reflect", ".", "Value", ",", "d", "diffMode", ")", "textRecord", "{", "s", ":=", "formatString", "(", "v", ".", "String", "(", ")", ")", "\n", "return", "textRecord", "{", "Diff", ":", "d", ",", "Value", ":", "textLine", "(", "s", ")", "}", "\n", "}", ",", ")", "\n", "delim", "=", "\"", "\"", "\n", "// If the text appears to be binary data,", "// then perform differencing in approximately fixed-sized chunks.", "// The output is inspired by hexdump.", "case", "isBinary", ":", "list", "=", "opts", ".", "formatDiffSlice", "(", "reflect", ".", "ValueOf", "(", "sx", ")", ",", "reflect", ".", "ValueOf", "(", "sy", ")", ",", "16", ",", "\"", "\"", ",", "func", "(", "v", "reflect", ".", "Value", ",", "d", "diffMode", ")", "textRecord", "{", "var", "ss", "[", "]", "string", "\n", "for", "i", ":=", "0", ";", "i", "<", "v", ".", "Len", "(", ")", ";", "i", "++", "{", "ss", "=", "append", "(", "ss", ",", "formatHex", "(", "v", ".", "Index", "(", "i", ")", ".", "Uint", "(", ")", ")", ")", "\n", "}", "\n", "s", ":=", "strings", ".", "Join", "(", "ss", ",", "\"", "\"", ")", "\n", "comment", ":=", "commentString", "(", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "d", ",", "formatASCII", "(", "v", ".", "String", "(", ")", ")", ")", ")", "\n", "return", "textRecord", "{", "Diff", ":", "d", ",", "Value", ":", "textLine", "(", "s", ")", ",", "Comment", ":", "comment", "}", "\n", "}", ",", ")", "\n", "// For all other slices of primitive types,", "// then perform differencing in approximately fixed-sized chunks.", "// The size of each chunk depends on the width of the element kind.", "default", ":", "var", "chunkSize", "int", "\n", "if", "t", ".", "Elem", "(", ")", ".", "Kind", "(", ")", "==", "reflect", ".", "Bool", "{", "chunkSize", "=", "16", "\n", "}", "else", "{", "switch", "t", ".", "Elem", "(", ")", ".", "Bits", "(", ")", "{", "case", "8", ":", "chunkSize", "=", "16", "\n", "case", "16", ":", "chunkSize", "=", "12", "\n", "case", "32", ":", "chunkSize", "=", "8", "\n", "default", ":", "chunkSize", "=", "8", "\n", "}", "\n", "}", "\n", "list", "=", "opts", ".", "formatDiffSlice", "(", "vx", ",", "vy", ",", "chunkSize", ",", "t", ".", "Elem", "(", ")", ".", "Kind", "(", ")", ".", "String", "(", ")", ",", "func", "(", "v", "reflect", ".", "Value", ",", "d", "diffMode", ")", "textRecord", "{", "var", "ss", "[", "]", "string", "\n", "for", "i", ":=", "0", ";", "i", "<", "v", ".", "Len", "(", ")", ";", "i", "++", "{", "switch", "t", ".", "Elem", "(", ")", ".", "Kind", "(", ")", "{", "case", "reflect", ".", "Int", ",", "reflect", ".", "Int8", ",", "reflect", ".", "Int16", ",", "reflect", ".", "Int32", ",", "reflect", ".", "Int64", ":", "ss", "=", "append", "(", "ss", ",", "fmt", ".", "Sprint", "(", "v", ".", "Index", "(", "i", ")", ".", "Int", "(", ")", ")", ")", "\n", "case", "reflect", ".", "Uint", ",", "reflect", ".", "Uint8", ",", "reflect", ".", "Uint16", ",", "reflect", ".", "Uint32", ",", "reflect", ".", "Uint64", ",", "reflect", ".", "Uintptr", ":", "ss", "=", "append", "(", "ss", ",", "formatHex", "(", "v", ".", "Index", "(", "i", ")", ".", "Uint", "(", ")", ")", ")", "\n", "case", "reflect", ".", "Bool", ",", "reflect", ".", "Float32", ",", "reflect", ".", "Float64", ",", "reflect", ".", "Complex64", ",", "reflect", ".", "Complex128", ":", "ss", "=", "append", "(", "ss", ",", "fmt", ".", "Sprint", "(", "v", ".", "Index", "(", "i", ")", ".", "Interface", "(", ")", ")", ")", "\n", "}", "\n", "}", "\n", "s", ":=", "strings", ".", "Join", "(", "ss", ",", "\"", "\"", ")", "\n", "return", "textRecord", "{", "Diff", ":", "d", ",", "Value", ":", "textLine", "(", "s", ")", "}", "\n", "}", ",", ")", "\n", "}", "\n\n", "// Wrap the output with appropriate type information.", "var", "out", "textNode", "=", "textWrap", "{", "\"", "\"", ",", "list", ",", "\"", "\"", "}", "\n", "if", "!", "isText", "{", "// The \"{...}\" byte-sequence literal is not valid Go syntax for strings.", "// Emit the type for extra clarity (e.g. \"string{...}\").", "if", "t", ".", "Kind", "(", ")", "==", "reflect", ".", "String", "{", "opts", "=", "opts", ".", "WithTypeMode", "(", "emitType", ")", "\n", "}", "\n", "return", "opts", ".", "FormatType", "(", "t", ",", "out", ")", "\n", "}", "\n", "switch", "t", ".", "Kind", "(", ")", "{", "case", "reflect", ".", "String", ":", "out", "=", "textWrap", "{", "\"", "\"", ",", "out", ",", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "delim", ")", "}", "\n", "if", "t", "!=", "reflect", ".", "TypeOf", "(", "string", "(", "\"", "\"", ")", ")", "{", "out", "=", "opts", ".", "FormatType", "(", "t", ",", "out", ")", "\n", "}", "\n", "case", "reflect", ".", "Slice", ":", "out", "=", "textWrap", "{", "\"", "\"", ",", "out", ",", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "delim", ")", "}", "\n", "if", "t", "!=", "reflect", ".", "TypeOf", "(", "[", "]", "byte", "(", "nil", ")", ")", "{", "out", "=", "opts", ".", "FormatType", "(", "t", ",", "out", ")", "\n", "}", "\n", "}", "\n", "return", "out", "\n", "}" ]
13,697
all-13698
[ "CanAuthenticate", "makes", "a", "test", "request", "to", "SS", "and", "returns", "true", "if", "it", "is", "successful", "." ]
[ "func", "(", "a", "*", "ssAuthenticator", ")", "CanAuthenticate", "(", "host", "string", ")", "error", "{", "url", ":=", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "a", ".", "accountID", ")", "\n", "req", ",", "err", ":=", "http", ".", "NewRequest", "(", "\"", "\"", ",", "buildURL", "(", "host", ",", "<mask>", ")", ",", "nil", ")", "\n", "if", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n", "req", ".", "Header", ".", "Set", "(", "\"", "\"", ",", "\"", "\"", ")", "\n", "if", "err", ":=", "a", ".", "Sign", "(", "req", ")", ";", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n", "resp", ",", "err", ":=", "a", ".", "client", ".", "DoHidden", "(", "req", ")", "\n", "if", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n", "if", "resp", ".", "StatusCode", "!=", "200", "{", "var", "body", "string", "\n", "if", "b", ",", "err", ":=", "ioutil", ".", "ReadAll", "(", "resp", ".", "Body", ")", ";", "err", "!=", "nil", "{", "body", "=", "\"", "\"", "+", "string", "(", "b", ")", "\n", "}", "\n", "return", "fmt", ".", "Errorf", "(", "\"", "\"", ",", "resp", ".", "Status", ",", "body", ")", "\n", "}", "\n", "return", "nil", "\n", "}" ]
13,698
all-13699
[ "UnmarshalEasyJSON", "satisfies", "easyjson", ".", "Unmarshaler", "." ]
[ "func", "(", "t", "*", "NodeType", ")", "UnmarshalEasyJSON", "(", "in", "*", "jlexer", ".", "Lexer", ")", "{", "switch", "NodeType", "(", "in", ".", "Int64", "(", ")", ")", "{", "case", "NodeTypeElement", ":", "*", "t", "=", "NodeTypeElement", "\n", "case", "NodeTypeAttribute", ":", "*", "t", "=", "NodeTypeAttribute", "\n", "case", "NodeTypeText", ":", "*", "t", "=", "NodeTypeText", "\n", "case", "NodeTypeCDATA", ":", "*", "t", "=", "NodeTypeCDATA", "\n", "case", "NodeTypeEntityReference", ":", "*", "t", "=", "NodeTypeEntityReference", "\n", "case", "NodeTypeEntity", ":", "*", "t", "=", "NodeTypeEntity", "\n", "case", "NodeTypeProcessingInstruction", ":", "*", "t", "=", "NodeTypeProcessingInstruction", "\n", "case", "NodeTypeComment", ":", "*", "t", "=", "NodeTypeComment", "\n", "<mask>", "NodeTypeDocument", ":", "*", "t", "=", "NodeTypeDocument", "\n", "case", "NodeTypeDocumentType", ":", "*", "t", "=", "NodeTypeDocumentType", "\n", "case", "NodeTypeDocumentFragment", ":", "*", "t", "=", "NodeTypeDocumentFragment", "\n", "case", "NodeTypeNotation", ":", "*", "t", "=", "NodeTypeNotation", "\n\n", "default", ":", "in", ".", "AddError", "(", "errors", ".", "New", "(", "\"", "\"", ")", ")", "\n", "}", "\n", "}" ]
13,699
all-13700
[ "Respond", "without", "doing", "anything", ".", "This", "endpoint", "is", "used", "to", "check", "that", "the", "service", "is", "up", ".", "See", "#ping" ]
[ "func", "(", "queue", "*", "Queue", ")", "Ping", "(", ")", "error", "{", "<mask>", ":=", "tcclient", ".", "Client", "(", "*", "queue", ")", "\n", "_", ",", "_", ",", "err", ":=", "(", "&", "cd", ")", ".", "APICall", "(", "nil", ",", "\"", "\"", ",", "\"", "\"", ",", "nil", ",", "nil", ")", "\n", "return", "err", "\n", "}" ]