id
int32
0
25.3k
idx
stringlengths
5
9
nl_tokens
sequencelengths
1
418
pl_tokens
sequencelengths
22
4.98k
23,800
all-23801
[ "GetIsolationSegmentConfig", "reads", "isolation", "segment", "config" ]
[ "func", "(", "m", "*", "yamlManager", ")", "GetGlobalConfig", "(", ")", "(", "*", "GlobalConfig", ",", "error", ")", "{", "globalConfig", ":=", "&", "GlobalConfig", "{", "}", "\n", "LoadFile", "(", "<mask>", ".", "Join", "(", "m", ".", "ConfigDir", ",", "\"", "\"", ")", ",", "globalConfig", ")", "\n", "if", "len", "(", "globalConfig", ".", "MetadataPrefix", ")", "==", "0", "{", "globalConfig", ".", "MetadataPrefix", "=", "\"", "\"", "\n", "}", "\n", "return", "globalConfig", ",", "nil", "\n", "}" ]
23,801
all-23802
[ "UnmarshalJSON", "supports", "json", ".", "Unmarshaler", "interface" ]
[ "func", "(", "v", "*", "DeleteObjectStoreEntriesParams", ")", "UnmarshalJSON", "(", "data", "[", "]", "byte", ")", "error", "{", "r", ":=", "jlexer", ".", "Lexer", "{", "Data", ":", "<mask>", "}", "\n", "easyjsonC5a4559bDecodeGithubComChromedpCdprotoIndexeddb15", "(", "&", "r", ",", "v", ")", "\n", "return", "r", ".", "Error", "(", ")", "\n", "}" ]
23,802
all-23803
[ "Visit", "inserts", "pointer", "v", "into", "the", "visited", "map", "and", "reports", "whether", "it", "had", "already", "been", "visited", "before", "." ]
[ "func", "(", "m", "visitedPointers", ")", "Visit", "(", "v", "reflect", ".", "<mask>", ")", "bool", "{", "p", ":=", "value", ".", "PointerOf", "(", "v", ")", "\n", "_", ",", "visited", ":=", "m", "[", "p", "]", "\n", "m", "[", "p", "]", "=", "struct", "{", "}", "{", "}", "\n", "return", "visited", "\n", "}" ]
23,803
all-23804
[ "PutResourcePolicyWithContext", "mocks", "base", "method" ]
[ "func", "(", "m", "*", "MockSecretsManagerAPI", ")", "PutResourcePolicyWithContext", "(", "arg0", "aws", ".", "<mask>", ",", "arg1", "*", "secretsmanager", ".", "PutResourcePolicyInput", ",", "arg2", "...", "request", ".", "Option", ")", "(", "*", "secretsmanager", ".", "PutResourcePolicyOutput", ",", "error", ")", "{", "varargs", ":=", "[", "]", "interface", "{", "}", "{", "arg0", ",", "arg1", "}", "\n", "for", "_", ",", "a", ":=", "range", "arg2", "{", "varargs", "=", "append", "(", "varargs", ",", "a", ")", "\n", "}", "\n", "ret", ":=", "m", ".", "ctrl", ".", "Call", "(", "m", ",", "\"", "\"", ",", "varargs", "...", ")", "\n", "ret0", ",", "_", ":=", "ret", "[", "0", "]", ".", "(", "*", "secretsmanager", ".", "PutResourcePolicyOutput", ")", "\n", "ret1", ",", "_", ":=", "ret", "[", "1", "]", ".", "(", "error", ")", "\n", "return", "ret0", ",", "ret1", "\n", "}" ]
23,804
all-23805
[ "GetGetScpLedgerSeq", "retrieves", "the", "GetScpLedgerSeq", "value", "from", "the", "union", "returning", "ok", "if", "the", "union", "s", "switch", "indicated", "the", "value", "is", "valid", "." ]
[ "func", "(", "u", "StellarMessage", ")", "GetGetScpLedgerSeq", "(", ")", "(", "<mask>", "Uint32", ",", "ok", "bool", ")", "{", "armName", ",", "_", ":=", "u", ".", "ArmForSwitch", "(", "int32", "(", "u", ".", "Type", ")", ")", "\n\n", "if", "armName", "==", "\"", "\"", "{", "result", "=", "*", "u", ".", "GetScpLedgerSeq", "\n", "ok", "=", "true", "\n", "}", "\n\n", "return", "\n", "}" ]
23,805
all-23806
[ "HasText", "returns", "a", "boolean", "if", "a", "field", "has", "been", "set", "." ]
[ "func", "(", "w", "*", "Widget", ")", "HasText", "(", ")", "bool", "{", "if", "w", "!=", "nil", "&&", "w", ".", "<mask>", "!=", "nil", "{", "return", "true", "\n", "}", "\n\n", "return", "false", "\n", "}" ]
23,806
all-23807
[ "SpinButtonNewWithRange", "()", "is", "a", "wrapper", "around", "gtk_spin_button_new_with_range", "()", "." ]
[ "func", "SpinButtonNewWithRange", "(", "min", ",", "max", ",", "step", "float64", ")", "(", "*", "SpinButton", ",", "error", ")", "{", "c", ":=", "C", ".", "gtk_spin_button_new_with_range", "(", "C", ".", "gdouble", "(", "min", ")", ",", "C", ".", "gdouble", "(", "max", ")", ",", "C", ".", "gdouble", "(", "<mask>", ")", ")", "\n", "if", "c", "==", "nil", "{", "return", "nil", ",", "nilPtrErr", "\n", "}", "\n", "return", "wrapSpinButton", "(", "glib", ".", "Take", "(", "unsafe", ".", "Pointer", "(", "c", ")", ")", ")", ",", "nil", "\n", "}" ]
23,807
all-23808
[ "MarshalJSON", "supports", "json", ".", "Marshaler", "interface" ]
[ "func", "(", "v", "GetAppManifestParams", ")", "MarshalJSON", "(", ")", "(", "[", "]", "byte", ",", "error", ")", "{", "w", ":=", "jwriter", ".", "Writer", "{", "}", "\n", "easyjsonC5a4559bEncodeGithubComChromedpCdprotoPage43", "(", "&", "w", ",", "v", ")", "\n", "return", "w", ".", "<mask>", ".", "BuildBytes", "(", ")", ",", "w", ".", "Error", "\n", "}" ]
23,808
all-23809
[ "Select", "returns", "a", "NoopSeriesSet", "if", "the", "given", "matchers", "don", "t", "match", "the", "label", "set", "of", "the", "requiredMatchersQuerier", ".", "Otherwise", "it", "ll", "call", "the", "wrapped", "querier", "." ]
[ "func", "(", "q", "requiredMatchersQuerier", ")", "Select", "(", "p", "*", "storage", ".", "SelectParams", ",", "matchers", "...", "*", "labels", ".", "Matcher", ")", "(", "storage", ".", "SeriesSet", ",", "storage", ".", "Warnings", ",", "error", ")", "{", "ms", ":=", "q", ".", "requiredMatchers", "\n", "for", "_", ",", "m", ":=", "<mask>", "matchers", "{", "for", "i", ",", "r", ":=", "range", "ms", "{", "if", "m", ".", "Type", "==", "labels", ".", "MatchEqual", "&&", "m", ".", "Name", "==", "r", ".", "Name", "&&", "m", ".", "Value", "==", "r", ".", "Value", "{", "ms", "=", "append", "(", "ms", "[", ":", "i", "]", ",", "ms", "[", "i", "+", "1", ":", "]", "...", ")", "\n", "break", "\n", "}", "\n", "}", "\n", "if", "len", "(", "ms", ")", "==", "0", "{", "break", "\n", "}", "\n", "}", "\n", "if", "len", "(", "ms", ")", ">", "0", "{", "return", "storage", ".", "NoopSeriesSet", "(", ")", ",", "nil", ",", "nil", "\n", "}", "\n", "return", "q", ".", "Querier", ".", "Select", "(", "p", ",", "matchers", "...", ")", "\n", "}" ]
23,809
all-23810
[ "Symbols", "returns", "a", "list", "of", "symbols", "this", "statement", "loads", "." ]
[ "func", "(", "l", "*", "Load", ")", "Symbols", "(", ")", "[", "]", "string", "{", "syms", ":=", "make", "(", "[", "]", "string", ",", "0", ",", "len", "(", "l", ".", "symbols", ")", ")", "\n", "for", "sym", ":=", "<mask>", "l", ".", "symbols", "{", "syms", "=", "append", "(", "syms", ",", "sym", ")", "\n", "}", "\n", "sort", ".", "Strings", "(", "syms", ")", "\n", "return", "syms", "\n", "}" ]
23,810
all-23811
[ "StderrWriter", "sets", "the", "StderrWriter" ]
[ "func", "(", "e", "*", "execStreamerBuilder", ")", "StderrWriter", "(", "writer", "<mask>", ".", "Writer", ")", "ExecStreamerBuilder", "{", "e", ".", "d", ".", "StderrWriter", "=", "writer", "\n", "return", "e", "\n", "}" ]
23,811
all-23812
[ "Resume", "resumes", "a", "paused", "peer", "." ]
[ "func", "(", "p", "*", "<mask>", ")", "Resume", "(", ")", "{", "p", ".", "mu", ".", "Lock", "(", ")", "\n", "defer", "p", ".", "mu", ".", "Unlock", "(", ")", "\n", "p", ".", "paused", "=", "false", "\n", "p", ".", "msgAppReader", ".", "resume", "(", ")", "\n", "p", ".", "msgAppV2Reader", ".", "resume", "(", ")", "\n", "}" ]
23,812
all-23813
[ "waitForOp", "waits", "for", "the", "operation", "to", "finish", "." ]
[ "func", "(", "c", "*", "ComputeUtil", ")", "waitForOp", "(", "opGetter", "func", "(", ")", "(", "*", "raw", ".", "<mask>", ",", "error", ")", ")", "error", "{", "for", "{", "op", ",", "err", ":=", "opGetter", "(", ")", "\n", "if", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n\n", "log", ".", "Debugf", "(", "\"", "\"", ",", "op", ".", "Name", ",", "op", ".", "Status", ")", "\n", "if", "op", ".", "Status", "==", "\"", "\"", "{", "if", "op", ".", "Error", "!=", "nil", "{", "return", "fmt", ".", "Errorf", "(", "\"", "\"", ",", "*", "op", ".", "Error", ".", "Errors", "[", "0", "]", ")", "\n", "}", "\n", "break", "\n", "}", "\n", "time", ".", "Sleep", "(", "1", "*", "time", ".", "Second", ")", "\n", "}", "\n", "return", "nil", "\n", "}" ]
23,813
all-23814
[ "ArmForSwitch", "returns", "which", "field", "name", "should", "be", "used", "for", "storing", "the", "value", "for", "an", "instance", "of", "StellarMessage" ]
[ "func", "(", "u", "StellarMessage", ")", "ArmForSwitch", "(", "sw", "int32", ")", "(", "string", ",", "bool", ")", "{", "switch", "MessageType", "(", "sw", ")", "{", "case", "MessageTypeErrorMsg", ":", "return", "\"", "\"", ",", "true", "\n", "case", "MessageTypeHello", ":", "return", "\"", "\"", ",", "true", "\n", "case", "MessageTypeAuth", ":", "return", "\"", "\"", ",", "true", "\n", "case", "MessageTypeDontHave", ":", "return", "\"", "\"", ",", "true", "\n", "case", "MessageTypeGetPeers", ":", "return", "\"", "\"", ",", "true", "\n", "case", "MessageTypePeers", ":", "return", "\"", "\"", ",", "true", "\n", "case", "MessageTypeGetTxSet", ":", "return", "\"", "\"", ",", "true", "\n", "case", "MessageTypeTxSet", ":", "return", "\"", "\"", ",", "true", "\n", "case", "MessageTypeTransaction", ":", "return", "\"", "\"", ",", "true", "\n", "case", "MessageTypeGetScpQuorumset", ":", "return", "\"", "\"", ",", "true", "\n", "case", "MessageTypeScpQuorumset", ":", "return", "\"", "\"", ",", "true", "\n", "case", "MessageTypeScpMessage", ":", "return", "\"", "\"", ",", "<mask>", "\n", "case", "MessageTypeGetScpState", ":", "return", "\"", "\"", ",", "true", "\n", "}", "\n", "return", "\"", "\"", ",", "false", "\n", "}" ]
23,814
all-23815
[ "Rules", "returns", "the", "list", "of", "the", "manager", "s", "rules", "." ]
[ "func", "(", "m", "*", "Manager", ")", "Rules", "(", ")", "[", "]", "Rule", "{", "m", ".", "mtx", ".", "RLock", "(", ")", "\n", "defer", "m", ".", "mtx", ".", "RUnlock", "(", ")", "\n\n", "var", "<mask>", "[", "]", "Rule", "\n", "for", "_", ",", "g", ":=", "range", "m", ".", "groups", "{", "rules", "=", "append", "(", "rules", ",", "g", ".", "rules", "...", ")", "\n", "}", "\n\n", "return", "rules", "\n", "}" ]
23,815
all-23816
[ "StoragePoolVolumeGetType", "returns", "a", "single", "storage", "volume", "attached", "to", "a", "given", "storage", "pool", "of", "a", "given", "type", "on", "the", "node", "with", "the", "given", "ID", "." ]
[ "func", "(", "c", "*", "Cluster", ")", "StoragePoolVolumeGetType", "(", "project", "string", ",", "volumeName", "string", ",", "volumeType", "int", ",", "poolID", ",", "nodeID", "int64", ")", "(", "int64", ",", "*", "api", ".", "StorageVolume", ",", "error", ")", "{", "// Custom volumes are \"global\", i.e. they are associated with the", "// default project.", "if", "volumeType", "==", "StoragePoolVolumeTypeCustom", "{", "project", "=", "\"", "\"", "\n", "}", "\n\n", "volumeID", ",", "err", ":=", "c", ".", "StoragePoolVolumeGetTypeID", "(", "<mask>", ",", "volumeName", ",", "volumeType", ",", "poolID", ",", "nodeID", ")", "\n", "if", "err", "!=", "nil", "{", "return", "-", "1", ",", "nil", ",", "err", "\n", "}", "\n\n", "volumeNode", ",", "err", ":=", "c", ".", "StorageVolumeNodeGet", "(", "volumeID", ")", "\n", "if", "err", "!=", "nil", "{", "return", "-", "1", ",", "nil", ",", "err", "\n", "}", "\n\n", "volumeConfig", ",", "err", ":=", "c", ".", "StorageVolumeConfigGet", "(", "volumeID", ")", "\n", "if", "err", "!=", "nil", "{", "return", "-", "1", ",", "nil", ",", "err", "\n", "}", "\n\n", "volumeDescription", ",", "err", ":=", "c", ".", "StorageVolumeDescriptionGet", "(", "volumeID", ")", "\n", "if", "err", "!=", "nil", "{", "return", "-", "1", ",", "nil", ",", "err", "\n", "}", "\n\n", "volumeTypeName", ",", "err", ":=", "StoragePoolVolumeTypeToName", "(", "volumeType", ")", "\n", "if", "err", "!=", "nil", "{", "return", "-", "1", ",", "nil", ",", "err", "\n", "}", "\n\n", "storageVolume", ":=", "api", ".", "StorageVolume", "{", "Type", ":", "volumeTypeName", ",", "}", "\n", "storageVolume", ".", "Name", "=", "volumeName", "\n", "storageVolume", ".", "Description", "=", "volumeDescription", "\n", "storageVolume", ".", "Config", "=", "volumeConfig", "\n", "storageVolume", ".", "Location", "=", "volumeNode", "\n\n", "return", "volumeID", ",", "&", "storageVolume", ",", "nil", "\n", "}" ]
23,816
all-23817
[ "UnmarshalJSON", "supports", "json", ".", "Unmarshaler", "interface" ]
[ "func", "(", "v", "*", "SetBreakpointsActiveParams", ")", "UnmarshalJSON", "(", "data", "[", "]", "<mask>", ")", "error", "{", "r", ":=", "jlexer", ".", "Lexer", "{", "Data", ":", "data", "}", "\n", "easyjsonC5a4559bDecodeGithubComChromedpCdprotoDebugger9", "(", "&", "r", ",", "v", ")", "\n", "return", "r", ".", "Error", "(", ")", "\n", "}" ]
23,817
all-23818
[ "SetWorkers", "count" ]
[ "func", "(", "p", "*", "Whisper", ")", "SetWorkers", "(", "count", "int", ")", "{", "if", "count", ">=", "1", "{", "p", ".", "workersCount", "=", "<mask>", "\n", "}", "else", "{", "p", ".", "workersCount", "=", "1", "\n", "}", "\n", "}" ]
23,818
all-23819
[ "Get", "a", "throttled", "reader", "that", "wraps", "r", "." ]
[ "func", "(", "pool", "*", "ReaderPool", ")", "Get", "(", "r", "<mask>", ".", "Reader", ")", "(", "reader", "io", ".", "Reader", ",", "release", "func", "(", ")", ")", "{", "// don't export a ThrottlerReader to prevent users changing the rate", "// and expecting their change to be respected, since we might modify", "// the rate under their feet", "// make the initial rate be 0, the actual rate is", "// set in the call to `setSharedRates`.", "rd", ":=", "ThrottledReader", "(", "r", ",", "0", ",", "pool", ".", "maxBurst", ")", "\n\n", "pool", ".", "mu", ".", "Lock", "(", ")", "\n", "pool", ".", "givenOut", "[", "rd", "]", "=", "struct", "{", "}", "{", "}", "\n", "pool", ".", "setSharedRates", "(", ")", "\n", "pool", ".", "mu", ".", "Unlock", "(", ")", "\n\n", "return", "rd", ",", "func", "(", ")", "{", "pool", ".", "mu", ".", "Lock", "(", ")", "\n", "delete", "(", "pool", ".", "givenOut", ",", "rd", ")", "\n", "pool", ".", "setSharedRates", "(", ")", "\n", "pool", ".", "mu", ".", "Unlock", "(", ")", "\n", "}", "\n", "}" ]
23,819
all-23820
[ "String", "returns", "the", "name", "of", "e" ]
[ "func", "(", "e", "InflationResultCode", ")", "<mask>", "(", ")", "string", "{", "name", ",", "_", ":=", "inflationResultCodeMap", "[", "int32", "(", "e", ")", "]", "\n", "return", "name", "\n", "}" ]
23,820
all-23821
[ "Return", "a", "new", "instance", "of", "HostsLine", "." ]
[ "func", "NewHostsLine", "(", "raw", "string", ")", "HostsLine", "{", "<mask>", ":=", "strings", ".", "Fields", "(", "raw", ")", "\n", "if", "len", "(", "fields", ")", "==", "0", "{", "return", "HostsLine", "{", "Raw", ":", "raw", "}", "\n", "}", "\n\n", "output", ":=", "HostsLine", "{", "Raw", ":", "raw", "}", "\n", "if", "!", "output", ".", "IsComment", "(", ")", "{", "rawIP", ":=", "fields", "[", "0", "]", "\n", "if", "net", ".", "ParseIP", "(", "rawIP", ")", "==", "nil", "{", "output", ".", "Err", "=", "errors", ".", "New", "(", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "raw", ")", ")", "\n", "}", "\n\n", "output", ".", "IP", "=", "rawIP", "\n", "output", ".", "Hosts", "=", "fields", "[", "1", ":", "]", "\n", "}", "\n\n", "return", "output", "\n", "}" ]
23,821
all-23822
[ "GetCurrentPoint", "is", "a", "wrapper", "around", "cairo_get_current_point", "()", "." ]
[ "func", "(", "v", "*", "<mask>", ")", "GetCurrentPoint", "(", ")", "(", "x", ",", "y", "float64", ")", "{", "C", ".", "cairo_get_current_point", "(", "v", ".", "native", "(", ")", ",", "(", "*", "C", ".", "double", ")", "(", "&", "x", ")", ",", "(", "*", "C", ".", "double", ")", "(", "&", "y", ")", ")", "\n", "return", "\n", "}" ]
23,822
all-23823
[ "Text", "returns", "v", "s", "string", "value", "interpreted", "as", "a", "text", "string", "(", "defined", "in", "the", "PDF", "spec", ")", "and", "converted", "to", "UTF", "-", "8", ".", "If", "v", ".", "Kind", "()", "!", "=", "String", "Text", "returns", "the", "empty", "string", "." ]
[ "func", "(", "v", "Value", ")", "<mask>", "(", ")", "string", "{", "x", ",", "ok", ":=", "v", ".", "data", ".", "(", "string", ")", "\n", "if", "!", "ok", "{", "return", "\"", "\"", "\n", "}", "\n", "if", "isPDFDocEncoded", "(", "x", ")", "{", "return", "pdfDocDecode", "(", "x", ")", "\n", "}", "\n", "if", "isUTF16", "(", "x", ")", "{", "return", "utf16Decode", "(", "x", "[", "2", ":", "]", ")", "\n", "}", "\n", "return", "x", "\n", "}" ]
23,823
all-23824
[ "HasTime", "returns", "a", "boolean", "if", "a", "field", "has", "been", "set", "." ]
[ "func", "(", "d", "*", "DistributionDefinition", ")", "HasTime", "(", ")", "bool", "{", "if", "d", "!=", "nil", "&&", "d", ".", "Time", "!=", "nil", "{", "return", "<mask>", "\n", "}", "\n\n", "return", "false", "\n", "}" ]
23,824
all-23825
[ "Specify", "the", "value", "of", "a", "uniform", "variable", "for", "a", "specified", "program", "object" ]
[ "func", "ProgramUniform3fv", "(", "program", "uint32", ",", "location", "int32", ",", "count", "int32", ",", "value", "*", "float32", ")", "{", "C", ".", "glowProgramUniform3fv", "(", "gpProgramUniform3fv", ",", "(", "C", ".", "GLuint", ")", "(", "program", ")", ",", "(", "C", ".", "GLint", ")", "(", "location", ")", ",", "(", "C", ".", "GLsizei", ")", "(", "count", ")", ",", "(", "*", "C", ".", "GLfloat", ")", "(", "unsafe", ".", "Pointer", "(", "<mask>", ")", ")", ")", "\n", "}" ]
23,825
all-23826
[ "RemoveKey", "removes", "an", "existing", "key", "from", "keyring" ]
[ "func", "(", "k", "*", "Keyring", ")", "RemoveKey", "(", "<mask>", "ssh", ".", "PublicKey", ")", "error", "{", "return", "k", ".", "Agent", ".", "Remove", "(", "key", ")", "\n", "}" ]
23,826
all-23827
[ "AllocateIDRange", "allocates", "a", "range", "of", "IDs", "with", "specific", "endpoints", ".", "The", "range", "is", "inclusive", "at", "both", "the", "low", "and", "high", "end", ".", "Once", "these", "IDs", "have", "been", "allocated", "you", "can", "manually", "assign", "them", "to", "newly", "created", "entities", ".", "The", "Datastore", "s", "automatic", "ID", "allocator", "never", "assigns", "a", "key", "that", "has", "already", "been", "allocated", "(", "either", "through", "automatic", "ID", "allocation", "or", "through", "an", "explicit", "AllocateIDs", "call", ")", ".", "As", "a", "result", "entities", "written", "to", "the", "given", "key", "range", "will", "never", "be", "overwritten", ".", "However", "writing", "entities", "with", "manually", "assigned", "keys", "in", "this", "range", "may", "overwrite", "existing", "entities", "(", "or", "new", "entities", "written", "by", "a", "separate", "request", ")", "depending", "on", "the", "error", "returned", ".", "Use", "this", "only", "if", "you", "have", "an", "existing", "numeric", "ID", "range", "that", "you", "want", "to", "reserve", "(", "for", "example", "bulk", "loading", "entities", "that", "already", "have", "IDs", ")", ".", "If", "you", "don", "t", "care", "about", "which", "IDs", "you", "receive", "use", "AllocateIDs", "instead", ".", "AllocateIDRange", "returns", "nil", "if", "the", "range", "is", "successfully", "allocated", ".", "If", "one", "or", "more", "entities", "with", "an", "ID", "in", "the", "given", "range", "already", "exist", "it", "returns", "a", "KeyRangeCollisionError", ".", "If", "the", "Datastore", "has", "already", "cached", "IDs", "in", "this", "range", "(", "e", ".", "g", ".", "from", "a", "previous", "call", "to", "AllocateIDRange", ")", "it", "returns", "a", "KeyRangeContentionError", ".", "Errors", "of", "other", "types", "indicate", "problems", "with", "arguments", "or", "an", "error", "returned", "directly", "from", "the", "Datastore", "." ]
[ "func", "AllocateIDRange", "(", "c", "context", ".", "Context", ",", "kind", "string", ",", "parent", "*", "Key", ",", "start", ",", "end", "int64", ")", "(", "err", "error", ")", "{", "if", "kind", "==", "\"", "\"", "{", "return", "errors", ".", "New", "(", "\"", "\"", ")", "\n", "}", "\n\n", "if", "start", "<", "1", "||", "end", "<", "1", "{", "return", "errors", ".", "New", "(", "\"", "\"", ")", "\n", "}", "\n\n", "if", "start", ">", "end", "{", "return", "errors", ".", "New", "(", "\"", "\"", ")", "\n", "}", "\n\n", "req", ":=", "&", "pb", ".", "AllocateIdsRequest", "{", "ModelKey", ":", "keyToProto", "(", "\"", "\"", ",", "NewIncompleteKey", "(", "c", ",", "kind", ",", "<mask>", ")", ")", ",", "Max", ":", "proto", ".", "Int64", "(", "end", ")", ",", "}", "\n", "res", ":=", "&", "pb", ".", "AllocateIdsResponse", "{", "}", "\n", "if", "err", ":=", "internal", ".", "Call", "(", "c", ",", "\"", "\"", ",", "\"", "\"", ",", "req", ",", "res", ")", ";", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n\n", "// Check for collisions, i.e. existing entities with IDs in this range.", "// We could do this before the allocation, but we'd still have to do it", "// afterward as well to catch the race condition where an entity is inserted", "// after that initial check but before the allocation. Skip the up-front check", "// and just do it once.", "q", ":=", "NewQuery", "(", "kind", ")", ".", "Filter", "(", "\"", "\"", ",", "NewKey", "(", "c", ",", "kind", ",", "\"", "\"", ",", "start", ",", "parent", ")", ")", ".", "Filter", "(", "\"", "\"", ",", "NewKey", "(", "c", ",", "kind", ",", "\"", "\"", ",", "end", ",", "parent", ")", ")", ".", "KeysOnly", "(", ")", ".", "Limit", "(", "1", ")", "\n\n", "keys", ",", "err", ":=", "q", ".", "GetAll", "(", "c", ",", "nil", ")", "\n", "if", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n", "if", "len", "(", "keys", ")", "!=", "0", "{", "return", "&", "KeyRangeCollisionError", "{", "start", ":", "start", ",", "end", ":", "end", "}", "\n", "}", "\n\n", "// Check for a race condition, i.e. cases where the datastore may have", "// cached ID batches that contain IDs in this range.", "if", "start", "<", "res", ".", "GetStart", "(", ")", "{", "return", "&", "KeyRangeContentionError", "{", "start", ":", "start", ",", "end", ":", "end", "}", "\n", "}", "\n\n", "return", "nil", "\n", "}" ]
23,827
all-23828
[ "NewKVKeysQuery", "parses", "a", "string", "into", "a", "dependency", "." ]
[ "func", "NewKVKeysQuery", "(", "s", "string", ")", "(", "*", "KVKeysQuery", ",", "error", ")", "{", "if", "s", "!=", "\"", "\"", "&&", "!", "KVKeysQueryRe", ".", "MatchString", "(", "s", ")", "{", "return", "nil", ",", "fmt", ".", "Errorf", "(", "\"", "\"", ",", "s", ")", "\n", "}", "\n\n", "m", ":=", "regexpMatch", "(", "KVKeysQueryRe", ",", "s", ")", "\n", "return", "&", "KVKeysQuery", "{", "stopCh", ":", "<mask>", "(", "chan", "struct", "{", "}", ",", "1", ")", ",", "dc", ":", "m", "[", "\"", "\"", "]", ",", "prefix", ":", "m", "[", "\"", "\"", "]", ",", "}", ",", "nil", "\n", "}" ]
23,828
all-23829
[ "DeleteMulti", "deletes", "multiple", "documents", "from", "the", "index", ".", "The", "returned", "error", "may", "be", "an", "instance", "of", "appengine", ".", "MultiError", "in", "which", "case", "it", "will", "be", "the", "same", "size", "as", "srcs", "and", "the", "individual", "errors", "inside", "will", "correspond", "with", "the", "items", "in", "srcs", "." ]
[ "func", "(", "x", "*", "Index", ")", "DeleteMulti", "(", "c", "context", ".", "Context", ",", "ids", "[", "]", "string", ")", "error", "{", "if", "len", "(", "ids", ")", ">", "maxDocumentsPerPutDelete", "{", "return", "ErrTooManyDocuments", "\n", "}", "\n\n", "req", ":=", "&", "pb", ".", "DeleteDocumentRequest", "{", "Params", ":", "&", "pb", ".", "DeleteDocumentParams", "{", "DocId", ":", "ids", ",", "IndexSpec", ":", "&", "x", ".", "spec", ",", "}", ",", "}", "\n", "res", ":=", "&", "pb", ".", "DeleteDocumentResponse", "{", "}", "\n", "if", "err", ":=", "internal", ".", "Call", "(", "c", ",", "\"", "\"", ",", "\"", "\"", ",", "req", ",", "res", ")", ";", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n", "if", "len", "(", "res", ".", "Status", ")", "!=", "len", "(", "ids", ")", "{", "return", "fmt", ".", "Errorf", "(", "\"", "\"", ",", "len", "(", "res", ".", "Status", ")", ",", "len", "(", "ids", ")", ")", "\n", "}", "\n", "multiErr", ",", "hasErr", ":=", "make", "(", "appengine", ".", "MultiError", ",", "len", "(", "<mask>", ")", ")", ",", "false", "\n", "for", "i", ",", "s", ":=", "range", "res", ".", "Status", "{", "if", "s", ".", "GetCode", "(", ")", "!=", "pb", ".", "SearchServiceError_OK", "{", "multiErr", "[", "i", "]", "=", "fmt", ".", "Errorf", "(", "\"", "\"", ",", "s", ".", "GetCode", "(", ")", ",", "s", ".", "GetErrorDetail", "(", ")", ")", "\n", "hasErr", "=", "true", "\n", "}", "\n", "}", "\n", "if", "hasErr", "{", "return", "multiErr", "\n", "}", "\n", "return", "nil", "\n", "}" ]
23,829
all-23830
[ "GetFollowRedirects", "returns", "the", "FollowRedirects", "field", "if", "non", "-", "nil", "zero", "value", "otherwise", "." ]
[ "func", "(", "s", "*", "SyntheticsOptions", ")", "GetFollowRedirects", "(", ")", "bool", "{", "if", "s", "==", "nil", "||", "s", ".", "FollowRedirects", "==", "nil", "{", "return", "<mask>", "\n", "}", "\n", "return", "*", "s", ".", "FollowRedirects", "\n", "}" ]
23,830
all-23831
[ "SetText", "is", "a", "wrapper", "around", "gtk_tooltip_set_text", "()", "." ]
[ "func", "(", "t", "*", "Tooltip", ")", "SetText", "(", "str", "string", ")", "{", "cstr", ":=", "C", ".", "CString", "(", "str", ")", "\n", "defer", "C", ".", "<mask>", "(", "unsafe", ".", "Pointer", "(", "cstr", ")", ")", "\n", "C", ".", "gtk_tooltip_set_text", "(", "t", ".", "native", "(", ")", ",", "(", "*", "C", ".", "gchar", ")", "(", "cstr", ")", ")", "\n", "}" ]
23,831
all-23832
[ "Getter", "allows", "the", "user", "to", "set", "the", "method", "by", "which", "a", "nonce", "is", "retrieved", "from", "the", "incoming", "request", "." ]
[ "func", "Getter", "(", "g", "NonceGetter", ")", "Option", "{", "return", "Option", "{", "func", "(", "o", "*", "<mask>", ")", "{", "o", ".", "getter", "=", "g", "\n", "}", "}", "\n", "}" ]
23,832
all-23833
[ "Commit", "commits", "the", "transaction", ".", "If", "Begin", "still", "not", "called", "or", "Commit", "or", "Rollback", "already", "called", "Commit", "returns", "ErrTxDone", "." ]
[ "func", "(", "db", "*", "DB", ")", "Commit", "(", ")", "error", "{", "db", ".", "m", ".", "Lock", "(", ")", "\n", "defer", "db", ".", "m", ".", "Unlock", "(", ")", "\n", "if", "<mask>", ".", "tx", "==", "nil", "{", "return", "ErrTxDone", "\n", "}", "\n", "err", ":=", "db", ".", "tx", ".", "Commit", "(", ")", "\n", "db", ".", "tx", "=", "nil", "\n", "return", "err", "\n", "}" ]
23,833
all-23834
[ "DecodeHTMLEntities", "decodes", "HTML", "entities", "into", "their", "proper", "string", "representation", ".", "DecodeHTMLEntities", "is", "an", "alias", "for", "html", ".", "UnescapeString" ]
[ "func", "DecodeHTMLEntities", "(", "s", "string", ")", "string", "{", "if", "Verbose", "{", "fmt", ".", "Println", "(", "\"", "\"", ")", "\n", "}", "\n", "return", "<mask>", ".", "UnescapeString", "(", "s", ")", "\n", "}" ]
23,834
all-23835
[ "GetDisplayFormat", "returns", "the", "DisplayFormat", "field", "if", "non", "-", "nil", "zero", "value", "otherwise", "." ]
[ "func", "(", "w", "*", "Widget", ")", "GetDisplayFormat", "(", ")", "<mask>", "{", "if", "w", "==", "nil", "||", "w", ".", "DisplayFormat", "==", "nil", "{", "return", "\"", "\"", "\n", "}", "\n", "return", "*", "w", ".", "DisplayFormat", "\n", "}" ]
23,835
all-23836
[ "Warningf", "logs", "a", "message", "using", "WARNING", "as", "log", "level", "." ]
[ "func", "(", "l", "*", "Logger", ")", "Warningf", "(", "format", "string", ",", "args", "...", "<mask>", "{", "}", ")", "{", "l", ".", "log", "(", "WARNING", ",", "&", "format", ",", "args", "...", ")", "\n", "}" ]
23,836
all-23837
[ "SetDebugEnabled", "is", "a", "wrapper", "around", "gdk_gl_context_set_debug_enabled", "()", "." ]
[ "func", "(", "v", "*", "GLContext", ")", "SetDebugEnabled", "(", "enabled", "bool", ")", "{", "C", ".", "gdk_gl_context_set_debug_enabled", "(", "v", ".", "native", "(", ")", ",", "gbool", "(", "<mask>", ")", ")", "\n", "}" ]
23,837
all-23838
[ "Returns", "a", "int", "slice", "+", "true", "if", "valid", "Returns", "nil", "+", "false", "otherwise", "(", "returns", "nil", "+", "false", "if", "one", "of", "the", "values", "is", "not", "a", "valid", "int", ")" ]
[ "func", "(", "t", "Typed", ")", "IntsIf", "(", "key", "string", ")", "(", "[", "]", "int", ",", "bool", ")", "{", "value", ",", "exists", ":=", "t", "[", "key", "]", "\n", "if", "exists", "==", "false", "{", "return", "nil", ",", "false", "\n", "}", "\n", "if", "n", ",", "<mask>", ":=", "value", ".", "(", "[", "]", "int", ")", ";", "ok", "{", "return", "n", ",", "true", "\n", "}", "\n", "if", "a", ",", "ok", ":=", "value", ".", "(", "[", "]", "interface", "{", "}", ")", ";", "ok", "{", "l", ":=", "len", "(", "a", ")", "\n", "if", "l", "==", "0", "{", "return", "nil", ",", "false", "\n", "}", "\n\n", "n", ":=", "make", "(", "[", "]", "int", ",", "l", ")", "\n", "for", "i", ":=", "0", ";", "i", "<", "l", ";", "i", "++", "{", "switch", "t", ":=", "a", "[", "i", "]", ".", "(", "type", ")", "{", "case", "int", ":", "n", "[", "i", "]", "=", "t", "\n", "case", "float64", ":", "n", "[", "i", "]", "=", "int", "(", "t", ")", "\n", "case", "string", ":", "_i", ",", "err", ":=", "strconv", ".", "Atoi", "(", "t", ")", "\n", "if", "err", "!=", "nil", "{", "return", "n", ",", "false", "\n", "}", "\n", "n", "[", "i", "]", "=", "_i", "\n", "default", ":", "return", "n", ",", "false", "\n", "}", "\n", "}", "\n", "return", "n", ",", "true", "\n", "}", "\n", "return", "nil", ",", "false", "\n", "}" ]
23,838
all-23839
[ "NewHandler", "creates", "a", "new", "RPC", "handler", "." ]
[ "func", "NewHandler", "(", "db", "*", "reform", ".", "DB", ",", "logger", "<mask>", ".", "Logger", ")", "*", "Handler", "{", "return", "&", "Handler", "{", "db", ":", "db", ",", "logger", ":", "logger", ".", "Add", "(", "\"", "\"", ",", "\"", "\"", ")", "}", "\n", "}" ]
23,839
all-23840
[ "manifestOCI1FromComponents", "builds", "a", "new", "manifestOCI1", "from", "the", "supplied", "data", ":" ]
[ "func", "manifestOCI1FromComponents", "(", "config", "imgspecv1", ".", "Descriptor", ",", "src", "<mask>", ".", "ImageSource", ",", "configBlob", "[", "]", "byte", ",", "layers", "[", "]", "imgspecv1", ".", "Descriptor", ")", "genericManifest", "{", "return", "&", "manifestOCI1", "{", "src", ":", "src", ",", "configBlob", ":", "configBlob", ",", "m", ":", "manifest", ".", "OCI1FromComponents", "(", "config", ",", "layers", ")", ",", "}", "\n", "}" ]
23,840
all-23841
[ "TransactionByHash", "returns", "the", "transaction", "with", "the", "given", "hash", "." ]
[ "func", "(", "b", "*", "backendInstance", ")", "GetTransactionByHash", "(", "ctx", "context", ".", "<mask>", ",", "hash", "common", ".", "Hash", ")", "(", "*", "types", ".", "Transaction", ",", "bool", ",", "error", ")", "{", "ctx2", ",", "cancel", ":=", "b", ".", "addTimeout", "(", "ctx", ")", "\n", "defer", "cancel", "(", ")", "\n\n", "tx", ",", "pending", ",", "err", ":=", "b", ".", "conn", ".", "ethClient", "(", ")", ".", "TransactionByHash", "(", "ctx2", ",", "hash", ")", "\n", "if", "err", "!=", "nil", "{", "err", "=", "fmt", ".", "Errorf", "(", "\"", "\"", ",", "err", ")", "\n", "}", "\n", "return", "tx", ",", "pending", ",", "err", "\n", "}" ]
23,841
all-23842
[ "HandleFunc", "adds", "the", "route", "pattern", "that", "matches", "any", "http", "method", "to", "execute", "the", "handlerFn", "http", ".", "HandlerFunc", "." ]
[ "func", "(", "mx", "*", "Mux", ")", "HandleFunc", "(", "pattern", "string", ",", "handlerFn", "http", ".", "HandlerFunc", ")", "{", "mx", ".", "handle", "(", "mALL", ",", "<mask>", ",", "handlerFn", ")", "\n", "}" ]
23,842
all-23843
[ "HaveSuffix", "succeeds", "if", "actual", "is", "a", "string", "or", "stringer", "that", "contains", "the", "passed", "-", "in", "string", "as", "a", "suffix", ".", "Optional", "arguments", "can", "be", "provided", "to", "construct", "via", "fmt", ".", "Sprintf", "()", "." ]
[ "func", "HaveSuffix", "(", "suffix", "string", ",", "args", "...", "<mask>", "{", "}", ")", "types", ".", "GomegaMatcher", "{", "return", "&", "matchers", ".", "HaveSuffixMatcher", "{", "Suffix", ":", "suffix", ",", "Args", ":", "args", ",", "}", "\n", "}" ]
23,843
all-23844
[ "allBoshReleaseNames", "returns", "a", "union", "of", "unique", "BOSH", "release", "names", "across", "all", "contained", "BOSH", "releases", "." ]
[ "func", "(", "d", "pivnetReleaseDiffer", ")", "allBoshReleaseNames", "(", ")", "[", "]", "string", "{", "boshReleaseNamesMap", ":=", "<mask>", "(", "map", "[", "string", "]", "string", ")", "\n", "var", "addReleaseNames", "=", "func", "(", "br", "map", "[", "string", "]", "*", "release", ".", "BoshRelease", ")", "{", "for", "brname", ":=", "range", "br", "{", "boshReleaseNamesMap", "[", "brname", "]", "=", "brname", "\n", "}", "\n", "}", "\n", "addReleaseNames", "(", "d", ".", "release1", ".", "BoshRelease", ")", "\n", "addReleaseNames", "(", "d", ".", "release2", ".", "BoshRelease", ")", "\n", "var", "releaseNames", "[", "]", "string", "\n", "for", "brname", ":=", "range", "boshReleaseNamesMap", "{", "releaseNames", "=", "append", "(", "releaseNames", ",", "brname", ")", "\n", "}", "\n", "return", "releaseNames", "\n", "}" ]
23,844
all-23845
[ "Post", "delivers", "a", "metrics", "snapshot", "to", "datadog" ]
[ "func", "(", "c", "*", "Client", ")", "Post", "(", "metrics", "[", "]", "Metric", ")", "error", "{", "series", ":=", "struct", "{", "Series", "[", "]", "Metric", "`json:\"series,omitempty\"`", "\n", "}", "{", "Series", ":", "metrics", "}", "\n\n", "buf", ":=", "fetchBuffer", "(", ")", "\n", "defer", "bufferPool", ".", "Put", "(", "buf", ")", "\n\n", "<mask>", "dst", "io", ".", "Writer", "=", "buf", "\n", "if", "!", "c", ".", "DisableCompression", "{", "zlw", ":=", "fetcZlibWriter", "(", "buf", ")", "\n", "defer", "zlibWriterPool", ".", "Put", "(", "zlw", ")", "\n", "defer", "zlw", ".", "Close", "(", ")", "\n\n", "dst", "=", "zlw", "\n", "}", "\n\n", "if", "err", ":=", "json", ".", "NewEncoder", "(", "dst", ")", ".", "Encode", "(", "&", "series", ")", ";", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n", "if", "c", ",", "ok", ":=", "dst", ".", "(", "io", ".", "Closer", ")", ";", "ok", "{", "if", "err", ":=", "c", ".", "Close", "(", ")", ";", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n", "}", "\n", "return", "c", ".", "post", "(", "buf", ".", "Bytes", "(", ")", ",", "0", ")", "\n", "}" ]
23,845
all-23846
[ "AddAgentUpdateHandlers", "adds", "the", "needed", "update", "handlers", "to", "perform", "agent", "updates" ]
[ "func", "AddAgentUpdateHandlers", "(", "cs", "wsclient", ".", "ClientServer", ",", "cfg", "*", "config", ".", "Config", ",", "saver", "statemanager", ".", "Saver", ",", "taskEngine", "<mask>", ".", "TaskEngine", ")", "{", "singleUpdater", ":=", "&", "updater", "{", "acs", ":", "cs", ",", "config", ":", "cfg", ",", "fs", ":", "os", ".", "Default", ",", "httpclient", ":", "httpclient", ".", "New", "(", "updateDownloadTimeout", ",", "false", ")", ",", "}", "\n", "cs", ".", "AddRequestHandler", "(", "singleUpdater", ".", "stageUpdateHandler", "(", ")", ")", "\n", "cs", ".", "AddRequestHandler", "(", "singleUpdater", ".", "performUpdateHandler", "(", "saver", ",", "taskEngine", ")", ")", "\n", "}" ]
23,846
all-23847
[ "Read", "reads", "val", "from", "r", "." ]
[ "func", "(", "r", "*", "readWriter", ")", "Read", "(", "val", "proto", ".", "<mask>", ")", "error", "{", "buf", ",", "err", ":=", "r", ".", "ReadBytes", "(", ")", "\n", "if", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n", "return", "proto", ".", "Unmarshal", "(", "buf", ",", "val", ")", "\n", "}" ]
23,847
all-23848
[ "Log", "implements", "the", "Log", "method", "required", "by", "Backend", "." ]
[ "func", "(", "b", "*", "ChannelMemoryBackend", ")", "<mask>", "(", "level", "Level", ",", "calldepth", "int", ",", "rec", "*", "Record", ")", "error", "{", "b", ".", "incoming", "<-", "rec", "\n", "return", "nil", "\n", "}" ]
23,848
all-23849
[ "GetTime", "returns", "a", "time", "struct", "value", "for", "a", "specific", "column", "." ]
[ "func", "(", "r", "Record", ")", "GetTime", "(", "column", "string", ")", "(", "time", ".", "Time", ",", "error", ")", "{", "v", ",", "err", ":=", "r", ".", "getKey", "(", "reflect", ".", "Float64", ",", "column", ")", "\n", "if", "err", "!=", "nil", "{", "return", "time", ".", "Time", "{", "}", ",", "err", "\n", "}", "\n\n", "return", "<mask>", ".", "Unix", "(", "int64", "(", "v", ".", "(", "float64", ")", ")", ",", "0", ")", ",", "nil", "\n", "}" ]
23,849
all-23850
[ "ReceiveSnapshot", "receives", "a", "ZFS", "stream", "from", "the", "input", "io", ".", "Reader", "creates", "a", "new", "snapshot", "with", "the", "specified", "name", "and", "streams", "the", "input", "data", "into", "the", "newly", "-", "created", "snapshot", "." ]
[ "func", "ReceiveSnapshot", "(", "input", "<mask>", ".", "Reader", ",", "name", "string", ")", "(", "*", "Dataset", ",", "error", ")", "{", "c", ":=", "command", "{", "Command", ":", "\"", "\"", ",", "Stdin", ":", "input", "}", "\n", "_", ",", "err", ":=", "c", ".", "Run", "(", "\"", "\"", ",", "name", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n", "return", "GetDataset", "(", "name", ")", "\n", "}" ]
23,850
all-23851
[ "New", "creates", "a", "new", "session", "with", "the", "same", "parameters", "as", "the", "original", "session", "including", "consistency", "batch", "size", "prefetching", "safety", "mode", "etc", ".", "The", "returned", "session", "will", "use", "sockets", "from", "the", "pool", "so", "there", "s", "a", "chance", "that", "writes", "just", "performed", "in", "another", "session", "may", "not", "yet", "be", "visible", ".", "Login", "information", "from", "the", "original", "session", "will", "not", "be", "copied", "over", "into", "the", "new", "session", "unless", "it", "was", "provided", "through", "the", "initial", "URL", "for", "the", "Dial", "function", ".", "See", "the", "Copy", "and", "Clone", "methods", "." ]
[ "func", "(", "s", "*", "Session", ")", "New", "(", ")", "*", "<mask>", "{", "s", ".", "m", ".", "Lock", "(", ")", "\n", "scopy", ":=", "copySession", "(", "s", ",", "false", ")", "\n", "s", ".", "m", ".", "Unlock", "(", ")", "\n", "scopy", ".", "Refresh", "(", ")", "\n", "return", "scopy", "\n", "}" ]
23,851
all-23852
[ "/", "*", "Routine", "which", "helps", "to", "deserialize", ".", "used", "in", "AttrList", "Deserialize", "()" ]
[ "func", "DeserializeSerDes", "(", "serdesType", "string", ",", "list", "[", "]", "byte", ")", "(", "SerDes", ",", "error", ")", "{", "switch", "serdesType", "{", "case", "\"", "\"", ":", "attr", ":=", "new", "(", "U8Type", ")", "\n", "err", ":=", "attr", ".", "Deserialize", "(", "list", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n", "return", "attr", ",", "nil", "\n", "case", "\"", "\"", ":", "attr", ":=", "new", "(", "U16Type", ")", "\n", "err", ":=", "attr", ".", "Deserialize", "(", "list", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n", "return", "attr", ",", "nil", "\n", "case", "\"", "\"", ":", "attr", ":=", "new", "(", "U32Type", ")", "\n", "err", ":=", "attr", ".", "Deserialize", "(", "list", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n", "return", "attr", ",", "nil", "\n", "<mask>", "\"", "\"", ":", "attr", ":=", "new", "(", "U64Type", ")", "\n", "err", ":=", "attr", ".", "Deserialize", "(", "list", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n", "return", "attr", ",", "nil", "\n", "case", "\"", "\"", ":", "attr", ":=", "new", "(", "I32Type", ")", "\n", "err", ":=", "attr", ".", "Deserialize", "(", "list", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n", "return", "attr", ",", "nil", "\n", "case", "\"", "\"", ":", "attr", ":=", "new", "(", "Net16Type", ")", "\n", "err", ":=", "attr", ".", "Deserialize", "(", "list", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n", "return", "attr", ",", "nil", "\n", "case", "\"", "\"", ":", "attr", ":=", "new", "(", "Net32Type", ")", "\n", "err", ":=", "attr", ".", "Deserialize", "(", "list", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n", "return", "attr", ",", "nil", "\n", "case", "\"", "\"", ":", "attr", ":=", "new", "(", "NulStringType", ")", "\n", "err", ":=", "attr", ".", "Deserialize", "(", "list", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n", "return", "attr", ",", "nil", "\n", "case", "\"", "\"", ":", "attr", ":=", "new", "(", "IgnoreType", ")", "\n", "return", "attr", ",", "nil", "\n", "case", "\"", "\"", ":", "attr", ":=", "new", "(", "BinaryType", ")", "\n", "//binary always return nil, no point to check err != nil", "attr", ".", "Deserialize", "(", "list", ")", "\n", "return", "attr", ",", "nil", "\n", "/*\n\t\tXXX(tehnerd): dangerous assumption that we either have basic types (above) or it's\n\t\ta nested attribute's list. havent tested in prod yet\n\t*/", "default", ":", "atl", ",", "exists", ":=", "ATLName2ATL", "[", "serdesType", "]", "\n", "if", "!", "exists", "{", "return", "nil", ",", "fmt", ".", "Errorf", "(", "\"", "\\n", "\"", ",", "serdesType", ")", "\n", "}", "\n", "attr", ":=", "CreateAttrListType", "(", "atl", ")", "\n", "err", ":=", "attr", ".", "Deserialize", "(", "list", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n", "return", "&", "attr", ",", "nil", "\n", "}", "\n", "return", "nil", ",", "nil", "\n", "}" ]
23,852
all-23853
[ "All", "tests", "whether", "or", "not", "all", "items", "present", "in", "an", "Enumerable", "meet", "a", "criteria", "." ]
[ "func", "All", "(", "subject", "Enumerable", ",", "p", "Predicate", ")", "bool", "{", "done", ":=", "make", "(", "chan", "struct", "{", "}", ")", "\n", "defer", "close", "(", "<mask>", ")", "\n\n", "return", "subject", ".", "Enumerate", "(", "done", ")", ".", "All", "(", "p", ")", "\n", "}" ]
23,853
all-23854
[ "FramesToFrameRange", "takes", "a", "slice", "of", "frame", "numbers", "and", "compresses", "them", "into", "a", "frame", "range", "string", ".", "If", "sorted", "==", "true", "pre", "-", "sort", "the", "frames", "instead", "of", "respecting", "their", "current", "order", "in", "the", "range", ".", "If", "zfill", ">", "1", "then", "pad", "out", "each", "number", "with", "0", "to", "the", "given", "total", "width", "." ]
[ "func", "FramesToFrameRange", "(", "frames", "[", "]", "int", ",", "sorted", "bool", ",", "zfill", "int", ")", "string", "{", "count", ":=", "len", "(", "frames", ")", "\n", "if", "count", "==", "0", "{", "return", "\"", "\"", "\n", "}", "\n\n", "if", "count", "==", "1", "{", "return", "zfillInt", "(", "frames", "[", "0", "]", ",", "zfill", ")", "\n", "}", "\n\n", "if", "sorted", "{", "sort", ".", "Ints", "(", "frames", ")", "\n", "}", "\n\n", "var", "i", ",", "frame", ",", "step", "int", "\n", "<mask>", "start", ",", "end", "string", "\n", "var", "buf", "strings", ".", "Builder", "\n\n", "// Keep looping until all frames are consumed", "for", "len", "(", "frames", ")", ">", "0", "{", "count", "=", "len", "(", "frames", ")", "\n", "// If we get to the last element, just write it", "// and end", "if", "count", "<=", "2", "{", "for", "_", ",", "frame", "=", "range", "frames", "{", "if", "buf", ".", "Len", "(", ")", ">", "0", "{", "buf", ".", "WriteString", "(", "\"", "\"", ")", "\n", "}", "\n", "buf", ".", "WriteString", "(", "zfillInt", "(", "frame", ",", "zfill", ")", ")", "\n", "}", "\n", "break", "\n", "}", "\n", "// At this point, we have 3 or more frames to check.", "// Scan the current window of the slice to see how", "// many frames we can consume into a group", "step", "=", "frames", "[", "1", "]", "-", "frames", "[", "0", "]", "\n", "for", "i", "=", "0", ";", "i", "<", "len", "(", "frames", ")", "-", "1", ";", "i", "++", "{", "// We have scanned as many frames as we can", "// for this group. Now write them and stop", "// looping on this window", "if", "(", "frames", "[", "i", "+", "1", "]", "-", "frames", "[", "i", "]", ")", "!=", "step", "{", "break", "\n", "}", "\n", "}", "\n\n", "// Subsequent groups are comma-separated", "if", "buf", ".", "Len", "(", ")", ">", "0", "{", "buf", ".", "WriteString", "(", "\"", "\"", ")", "\n", "}", "\n\n", "// We only have a single frame to write for this group", "if", "i", "==", "0", "{", "buf", ".", "WriteString", "(", "zfillInt", "(", "frames", "[", "0", "]", ",", "zfill", ")", ")", "\n", "frames", "=", "frames", "[", "1", ":", "]", "\n", "continue", "\n", "}", "\n\n", "// First do a check to see if we could have gotten a larger range", "// out of subsequent values with a different step size", "if", "i", "==", "1", "&&", "count", ">", "3", "{", "// Check if the next two pairwise frames have the same step.", "// If so, then it is better than our current grouping.", "if", "(", "frames", "[", "2", "]", "-", "frames", "[", "1", "]", ")", "==", "(", "frames", "[", "3", "]", "-", "frames", "[", "2", "]", ")", "{", "// Just consume the first frame, and allow the next", "// loop to scan the new stepping", "buf", ".", "WriteString", "(", "zfillInt", "(", "frames", "[", "0", "]", ",", "zfill", ")", ")", "\n", "frames", "=", "frames", "[", "1", ":", "]", "\n", "continue", "\n", "}", "\n", "}", "\n\n", "// Otherwise write out this step range", "start", "=", "zfillInt", "(", "frames", "[", "0", "]", ",", "zfill", ")", "\n", "end", "=", "zfillInt", "(", "frames", "[", "i", "]", ",", "zfill", ")", "\n", "buf", ".", "WriteString", "(", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "start", ",", "end", ")", ")", "\n", "if", "step", ">", "1", "{", "buf", ".", "WriteString", "(", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "step", ")", ")", "\n", "}", "\n", "frames", "=", "frames", "[", "i", "+", "1", ":", "]", "\n", "}", "\n\n", "return", "buf", ".", "String", "(", ")", "\n", "}" ]
23,854
all-23855
[ "void", "gtk_application_add_accelerator", "()", "//", "deprecated", "and", "uses", "a", "gvariant", "paramater", "void", "gtk_application_remove_accelerator", "()", "//", "deprecated", "and", "uses", "a", "gvariant", "paramater", "GetWindows", "is", "a", "wrapper", "around", "gtk_application_get_windows", "()", ".", "Returned", "list", "is", "wrapped", "to", "return", "*", "gtk", ".", "Window", "elements", "." ]
[ "func", "(", "v", "*", "<mask>", ")", "GetWindows", "(", ")", "*", "glib", ".", "List", "{", "glist", ":=", "C", ".", "gtk_application_get_windows", "(", "v", ".", "native", "(", ")", ")", "\n", "list", ":=", "glib", ".", "WrapList", "(", "uintptr", "(", "unsafe", ".", "Pointer", "(", "glist", ")", ")", ")", "\n", "list", ".", "DataWrapper", "(", "func", "(", "ptr", "unsafe", ".", "Pointer", ")", "interface", "{", "}", "{", "return", "wrapWindow", "(", "glib", ".", "Take", "(", "ptr", ")", ")", "\n", "}", ")", "\n", "runtime", ".", "SetFinalizer", "(", "list", ",", "func", "(", "l", "*", "glib", ".", "List", ")", "{", "l", ".", "Free", "(", ")", "\n", "}", ")", "\n", "return", "list", "\n", "}" ]
23,855
all-23856
[ "caller", "returns", "the", "name", "of", "the", "function", "that", "called", "the", "function", "this", "function", "was", "called", "from", "." ]
[ "func", "caller", "(", ")", "string", "{", "name", ":=", "\"", "\"", "\n", "if", "pc", ",", "_", ",", "_", ",", "ok", ":=", "runtime", ".", "Caller", "(", "1", ")", ";", "ok", "{", "name", "=", "filepath", ".", "Base", "(", "runtime", ".", "FuncForPC", "(", "pc", ")", ".", "<mask>", "(", ")", ")", "\n", "}", "\n", "return", "name", "\n", "}" ]
23,856
all-23857
[ "async", "janitor", "goroutine" ]
[ "func", "janitor", "(", "c", "boskosClient", ",", "buffer", "<-", "chan", "*", "common", ".", "Resource", ",", "fn", "clean", ",", "flags", "[", "]", "string", ")", "{", "for", "{", "resource", ":=", "<-", "buffer", "\n\n", "dest", ":=", "common", ".", "Free", "\n", "if", "err", ":=", "fn", "(", "resource", ",", "flags", ")", ";", "err", "!=", "nil", "{", "logrus", ".", "WithError", "(", "err", ")", ".", "Errorf", "(", "\"", "\"", ",", "*", "janitorPath", ")", "\n", "dest", "=", "<mask>", ".", "Dirty", "\n", "}", "\n\n", "if", "err", ":=", "c", ".", "ReleaseOne", "(", "resource", ".", "Name", ",", "dest", ")", ";", "err", "!=", "nil", "{", "logrus", ".", "WithError", "(", "err", ")", ".", "Error", "(", "\"", "\"", ")", "\n", "}", "\n", "}", "\n", "}" ]
23,857
all-23858
[ "ClearObjectStore", "clears", "all", "entries", "from", "an", "object", "store", ".", "See", ":", "https", ":", "//", "chromedevtools", ".", "github", ".", "io", "/", "devtools", "-", "protocol", "/", "tot", "/", "IndexedDB#method", "-", "clearObjectStore", "parameters", ":", "securityOrigin", "-", "Security", "origin", ".", "databaseName", "-", "Database", "name", ".", "objectStoreName", "-", "Object", "store", "name", "." ]
[ "func", "ClearObjectStore", "(", "securityOrigin", "string", ",", "databaseName", "<mask>", ",", "objectStoreName", "string", ")", "*", "ClearObjectStoreParams", "{", "return", "&", "ClearObjectStoreParams", "{", "SecurityOrigin", ":", "securityOrigin", ",", "DatabaseName", ":", "databaseName", ",", "ObjectStoreName", ":", "objectStoreName", ",", "}", "\n", "}" ]
23,858
all-23859
[ "FormatSimpleResponse", "formats", "a", "response", "that", "does", "not", "warrant", "additional", "explanation", "in", "the", "details", "section", "." ]
[ "func", "FormatSimpleResponse", "(", "to", ",", "message", "string", ")", "string", "{", "format", ":=", "`@%s: %s\n\n<details>\n\n%s\n</details>`", "\n\n", "return", "fmt", ".", "Sprintf", "(", "<mask>", ",", "to", ",", "message", ",", "AboutThisBotWithoutCommands", ")", "\n", "}" ]
23,859
all-23860
[ "CreateGroup", "creates", "a", "group" ]
[ "func", "(", "c", "*", "Client", ")", "CreateGroup", "(", "grp", "Group", ")", "(", "*", "Group", ",", "error", ")", "{", "url", ":=", "umGroups", "(", ")", "+", "`?depth=`", "+", "c", ".", "client", ".", "depth", "+", "`&pretty=`", "+", "strconv", ".", "FormatBool", "(", "c", ".", "client", ".", "pretty", ")", "\n", "ret", ":=", "&", "Group", "{", "}", "\n", "err", ":=", "c", ".", "client", ".", "Post", "(", "url", ",", "grp", ",", "ret", ",", "<mask>", ".", "StatusAccepted", ")", "\n", "return", "ret", ",", "err", "\n", "}" ]
23,860
all-23861
[ "GetRequest", "gets", "a", "specific", "request" ]
[ "func", "(", "c", "*", "Client", ")", "GetRequest", "(", "reqID", "string", ")", "(", "*", "Request", ",", "error", ")", "{", "url", ":=", "\"", "\"", "+", "reqID", "+", "`?depth=`", "+", "c", ".", "client", ".", "depth", "+", "`&pretty=`", "+", "strconv", ".", "FormatBool", "(", "c", ".", "client", ".", "<mask>", ")", "\n", "ret", ":=", "&", "Request", "{", "}", "\n", "err", ":=", "c", ".", "client", ".", "Get", "(", "url", ",", "ret", ",", "http", ".", "StatusOK", ")", "\n", "return", "ret", ",", "err", "\n", "}" ]
23,861
all-23862
[ "TwoContig", "returns", "all", "readable", "pointers", "but", "in", "two", "separate", "slices", "to", "avoid", "copying", ".", "The", "two", "slices", "are", "from", "the", "same", "buffer", "but", "are", "not", "contiguous", ".", "Either", "or", "both", "may", "be", "empty", "slices", "." ]
[ "func", "(", "b", "*", "PointerRingBuf", ")", "TwoContig", "(", ")", "(", "first", "[", "]", "<mask>", "{", "}", ",", "second", "[", "]", "interface", "{", "}", ")", "{", "extent", ":=", "b", ".", "Beg", "+", "b", ".", "Readable", "\n", "if", "extent", "<=", "b", ".", "N", "{", "// we fit contiguously in this buffer without wrapping to the other.", "// Let second stay an empty slice.", "return", "b", ".", "A", "[", "b", ".", "Beg", ":", "(", "b", ".", "Beg", "+", "b", ".", "Readable", ")", "]", ",", "second", "\n", "}", "\n\n", "return", "b", ".", "A", "[", "b", ".", "Beg", ":", "b", ".", "N", "]", ",", "b", ".", "A", "[", "0", ":", "(", "extent", "%", "b", ".", "N", ")", "]", "\n", "}" ]
23,862
all-23863
[ "MarshalJSON", "supports", "json", ".", "Marshaler", "interface" ]
[ "func", "(", "v", "BeginFrameReturns", ")", "MarshalJSON", "(", ")", "(", "[", "]", "byte", ",", "error", ")", "{", "w", ":=", "jwriter", ".", "Writer", "{", "}", "\n", "easyjsonC5a4559bEncodeGithubComChromedpCdprotoHeadlessexperimental4", "(", "&", "w", ",", "v", ")", "\n", "return", "w", ".", "<mask>", ".", "BuildBytes", "(", ")", ",", "w", ".", "Error", "\n", "}" ]
23,863
all-23864
[ "MethodNotAllowed", "sets", "a", "custom", "http", ".", "HandlerFunc", "for", "routing", "paths", "where", "the", "method", "is", "unresolved", ".", "The", "default", "handler", "returns", "a", "405", "with", "an", "empty", "body", "." ]
[ "func", "(", "mx", "*", "Mux", ")", "MethodNotAllowed", "(", "handlerFn", "http", ".", "HandlerFunc", ")", "{", "// Build MethodNotAllowed handler chain", "m", ":=", "mx", "\n", "hFn", ":=", "handlerFn", "\n", "if", "mx", ".", "inline", "&&", "mx", ".", "parent", "!=", "nil", "{", "m", "=", "mx", ".", "<mask>", "\n", "hFn", "=", "Chain", "(", "mx", ".", "middlewares", "...", ")", ".", "HandlerFunc", "(", "hFn", ")", ".", "ServeHTTP", "\n", "}", "\n\n", "// Update the methodNotAllowedHandler from this point forward", "m", ".", "methodNotAllowedHandler", "=", "hFn", "\n", "m", ".", "updateSubRoutes", "(", "func", "(", "subMux", "*", "Mux", ")", "{", "if", "subMux", ".", "methodNotAllowedHandler", "==", "nil", "{", "subMux", ".", "MethodNotAllowed", "(", "hFn", ")", "\n", "}", "\n", "}", ")", "\n", "}" ]
23,864
all-23865
[ "HasYaxis", "returns", "a", "boolean", "if", "a", "field", "has", "been", "set", "." ]
[ "func", "(", "h", "*", "HeatmapDefinition", ")", "HasYaxis", "(", ")", "bool", "{", "if", "h", "!=", "nil", "&&", "h", ".", "Yaxis", "!=", "nil", "{", "return", "true", "\n", "}", "\n\n", "return", "<mask>", "\n", "}" ]
23,865
all-23866
[ "Request", "makes", "a", "HTTP", "request", "based", "on", "Client", "configuration", "and", "arguments", "provided", "." ]
[ "func", "(", "c", "Client", ")", "Request", "(", "method", ",", "path", "string", ",", "query", "url", ".", "Values", ",", "body", "io", ".", "Reader", ",", "accept", "[", "]", "string", ")", "(", "resp", "*", "http", ".", "Response", ",", "err", "error", ")", "{", "return", "c", ".", "RequestContext", "(", "nil", ",", "<mask>", ",", "path", ",", "query", ",", "body", ",", "accept", ")", "\n", "}" ]
23,866
all-23867
[ "demuxExternal", "dispatches", "the", "provided", "payload", "to", "the", "external", "plugins", "." ]
[ "func", "(", "s", "*", "Server", ")", "demuxExternal", "(", "l", "*", "logrus", ".", "Entry", ",", "externalPlugins", "[", "]", "plugins", ".", "ExternalPlugin", ",", "payload", "[", "]", "byte", ",", "h", "http", ".", "Header", ")", "{", "h", ".", "Set", "(", "\"", "\"", ",", "\"", "\"", ")", "\n", "for", "_", ",", "p", ":=", "<mask>", "externalPlugins", "{", "s", ".", "wg", ".", "Add", "(", "1", ")", "\n", "go", "func", "(", "p", "plugins", ".", "ExternalPlugin", ")", "{", "defer", "s", ".", "wg", ".", "Done", "(", ")", "\n", "if", "err", ":=", "s", ".", "dispatch", "(", "p", ".", "Endpoint", ",", "payload", ",", "h", ")", ";", "err", "!=", "nil", "{", "l", ".", "WithError", "(", "err", ")", ".", "WithField", "(", "\"", "\"", ",", "p", ".", "Name", ")", ".", "Error", "(", "\"", "\"", ")", "\n", "}", "else", "{", "l", ".", "WithField", "(", "\"", "\"", ",", "p", ".", "Name", ")", ".", "Info", "(", "\"", "\"", ")", "\n", "}", "\n", "}", "(", "p", ")", "\n", "}", "\n", "}" ]
23,867
all-23868
[ "MarshalJSON", "supports", "json", ".", "Marshaler", "interface" ]
[ "func", "(", "v", "StartObservingParams", ")", "MarshalJSON", "(", ")", "(", "[", "]", "<mask>", ",", "error", ")", "{", "w", ":=", "jwriter", ".", "Writer", "{", "}", "\n", "easyjsonC5a4559bEncodeGithubComChromedpCdprotoBackgroundservice1", "(", "&", "w", ",", "v", ")", "\n", "return", "w", ".", "Buffer", ".", "BuildBytes", "(", ")", ",", "w", ".", "Error", "\n", "}" ]
23,868
all-23869
[ "GetTrackVisitedLinks", "is", "a", "wrapper", "around", "gtk_label_get_track_visited_links", "()", "." ]
[ "func", "(", "v", "*", "<mask>", ")", "GetTrackVisitedLinks", "(", ")", "bool", "{", "c", ":=", "C", ".", "gtk_label_get_track_visited_links", "(", "v", ".", "native", "(", ")", ")", "\n", "return", "gobool", "(", "c", ")", "\n", "}" ]
23,869
all-23870
[ "PCMScaleF32", "converts", "a", "buffer", "with", "audio", "content", "from", "-", "1", "to", "1", "(", "float32", ")", "into", "the", "PCM", "scale", "based", "on", "the", "passed", "bitdepth", ".", "Note", "that", "while", "the", "PCM", "data", "is", "scaled", "the", "PCM", "format", "is", "not", "changed", "." ]
[ "func", "PCMScaleF32", "(", "buf", "*", "<mask>", ".", "Float32Buffer", ",", "bitDepth", "int", ")", "error", "{", "if", "buf", "==", "nil", "||", "buf", ".", "Format", "==", "nil", "{", "return", "audio", ".", "ErrInvalidBuffer", "\n", "}", "\n", "buf", ".", "SourceBitDepth", "=", "bitDepth", "\n", "factor", ":=", "float32", "(", "math", ".", "Pow", "(", "2", ",", "float64", "(", "bitDepth", ")", "-", "1", ")", ")", "-", "1.0", "\n", "for", "i", ":=", "0", ";", "i", "<", "len", "(", "buf", ".", "Data", ")", ";", "i", "++", "{", "buf", ".", "Data", "[", "i", "]", "*=", "factor", "\n", "}", "\n\n", "return", "nil", "\n", "}" ]
23,870
all-23871
[ "MarshalJSON", "supports", "json", ".", "Marshaler", "interface" ]
[ "func", "(", "v", "GetOuterHTMLReturns", ")", "MarshalJSON", "(", ")", "(", "[", "]", "byte", ",", "error", ")", "{", "w", ":=", "jwriter", ".", "Writer", "{", "}", "\n", "easyjsonC5a4559bEncodeGithubComChromedpCdprotoDom36", "(", "&", "w", ",", "v", ")", "\n", "return", "w", ".", "Buffer", ".", "BuildBytes", "(", ")", ",", "w", ".", "<mask>", "\n", "}" ]
23,871
all-23872
[ "Identify", "action", "resource", "if", "any", "Return", "error", "if", "no", "resource", "could", "be", "identified", "This", "is", "a", "subtle", "algorithm", "...", "We", "want", "to", "be", "able", "to", ":", "*", "Match", "a", "resource", "action", "on", "partial", "href", "e", ".", "g", ".", "/", "clouds", "/", "1", "/", "instances", "/", "2", "should", "be", "ok", "to", "invoke", "terminate", "(", "whose", "path", "has", "/", "terminate", "at", "the", "end", ")", "*", "If", "two", "resources", "have", "actions", "with", "different", "names", "but", "same", "path", "pattern", "then", "return", "the", "right", "one", "e", ".", "g", ".", "both", "Deployment", "and", "Server", "have", "an", "action", "with", "path", "/", "deployments", "/", "1", "/", "servers", "/", "2", "but", "it", "s", "called", "servers", "in", "the", "case", "of", "Deployment", "and", "index", "in", "the", "case", "of", "servers", ".", "*", "If", "more", "than", "one", "actions", "on", "different", "resources", "have", "the", "same", "name", "and", "match", "the", "href", "then", "we", "want", "to", "fail", "so", "we", "don", "t", "risk", "running", "the", "action", "on", "the", "wrong", "resource", "." ]
[ "func", "(", "a", "*", "API", ")", "parseResource", "(", "cmd", ",", "hrefPrefix", "string", ",", "commandValues", "ActionCommands", ")", "(", "*", "metadata", ".", "Resource", ",", "[", "]", "*", "metadata", ".", "PathVariable", ",", "error", ")", "{", "elems", ":=", "strings", ".", "Split", "(", "cmd", ",", "\"", "\"", ")", "\n", "actionName", ":=", "elems", "[", "len", "(", "elems", ")", "-", "1", "]", "\n", "flags", ":=", "commandValues", "[", "cmd", "]", "\n", "if", "flags", "==", "nil", "{", "return", "nil", ",", "nil", ",", "fmt", ".", "Errorf", "(", "\"", "\"", ")", "\n", "}", "\n", "href", ":=", "flags", ".", "Href", "\n", "if", "hrefPrefix", "!=", "\"", "\"", "&&", "!", "strings", ".", "HasPrefix", "(", "href", ",", "hrefPrefix", ")", "{", "href", "=", "path", ".", "Join", "(", "hrefPrefix", ",", "href", ")", "\n", "}", "\n\n", "var", "vars", "[", "]", "*", "metadata", ".", "PathVariable", "\n", "var", "candidates", "[", "]", "*", "metadata", ".", "Resource", "\n", "Metadata", ":", "for", "_", ",", "res", ":=", "range", "a", ".", "Metadata", "{", "if", "v", ",", "err", ":=", "res", ".", "ExtractVariables", "(", "href", ")", ";", "err", "==", "nil", "{", "vars", "=", "v", "\n", "for", "_", ",", "a", ":=", "range", "res", ".", "Actions", "{", "if", "a", ".", "Name", "==", "actionName", "&&", "a", ".", "MatchHref", "(", "href", ")", "{", "// We found an exact match!", "candidates", "=", "[", "]", "*", "metadata", ".", "Resource", "{", "res", "}", "\n", "break", "Metadata", "\n", "}", "\n", "}", "\n", "candidates", "=", "<mask>", "(", "candidates", ",", "res", ")", "\n", "}", "\n", "}", "\n", "if", "len", "(", "candidates", ")", "==", "0", "{", "return", "nil", ",", "nil", ",", "fmt", ".", "Errorf", "(", "\"", "\"", ",", "href", ",", "os", ".", "Args", "[", "0", "]", ",", "strings", ".", "Split", "(", "cmd", ",", "\"", "\"", ")", "[", "0", "]", ")", "\n", "}", "\n", "if", "len", "(", "candidates", ")", ">", "1", "{", "return", "nil", ",", "nil", ",", "fmt", ".", "Errorf", "(", "\"", "\"", ",", "href", ",", "actionName", ",", "os", ".", "Args", "[", "0", "]", ",", "strings", ".", "Split", "(", "cmd", ",", "\"", "\"", ")", "[", "0", "]", ")", "\n", "}", "\n", "return", "candidates", "[", "0", "]", ",", "vars", ",", "nil", "\n", "}" ]
23,872
all-23873
[ "GetValue", "()", "is", "a", "wrapper", "around", "gtk_tree_model_get_value", "()", "." ]
[ "func", "(", "v", "*", "TreeModel", ")", "GetValue", "(", "iter", "*", "TreeIter", ",", "column", "int", ")", "(", "*", "glib", ".", "<mask>", ",", "error", ")", "{", "val", ",", "err", ":=", "glib", ".", "ValueAlloc", "(", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n", "C", ".", "gtk_tree_model_get_value", "(", "(", "*", "C", ".", "GtkTreeModel", ")", "(", "unsafe", ".", "Pointer", "(", "v", ".", "native", "(", ")", ")", ")", ",", "iter", ".", "native", "(", ")", ",", "C", ".", "gint", "(", "column", ")", ",", "(", "*", "C", ".", "GValue", ")", "(", "unsafe", ".", "Pointer", "(", "val", ".", "Native", "(", ")", ")", ")", ")", "\n", "return", "val", ",", "nil", "\n", "}" ]
23,873
all-23874
[ "SetOrientation", "()", "is", "a", "wrapper", "around", "gtk_page_setup_set_orientation", "()", "." ]
[ "func", "(", "ps", "*", "PageSetup", ")", "SetOrientation", "(", "orientation", "PageOrientation", ")", "{", "C", ".", "gtk_page_setup_set_orientation", "(", "<mask>", ".", "native", "(", ")", ",", "C", ".", "GtkPageOrientation", "(", "orientation", ")", ")", "\n", "}" ]
23,874
all-23875
[ "Run", "starts", "the", "specified", "command", "and", "waits", "for", "it", "to", "complete", ".", "The", "returned", "error", "is", "nil", "if", "the", "command", "runs", "has", "no", "problems", "copying", "stdin", "stdout", "and", "stderr", "and", "exits", "with", "a", "zero", "exit", "status", ".", "If", "the", "command", "starts", "but", "does", "not", "complete", "successfully", "the", "error", "is", "of", "type", "*", "ExitError", ".", "Other", "error", "types", "may", "be", "returned", "for", "other", "situations", "." ]
[ "func", "(", "c", "*", "Cmd", ")", "Run", "(", ")", "error", "{", "if", "err", ":=", "c", ".", "Start", "(", ")", ";", "err", "!=", "nil", "{", "return", "<mask>", "\n", "}", "\n", "return", "c", ".", "Wait", "(", ")", "\n", "}" ]
23,875
all-23876
[ "GossipBroadcast", "implements", "Gossip", "relaying", "update", "to", "all", "members", "of", "the", "channel", "." ]
[ "func", "(", "c", "*", "gossipChannel", ")", "GossipBroadcast", "(", "update", "GossipData", ")", "{", "c", ".", "relayBroadcast", "(", "c", ".", "ourself", ".", "<mask>", ",", "update", ")", "\n", "}" ]
23,876
all-23877
[ "Returns", "a", "map", "[", "string", "]", "interface", "{}", "at", "the", "key", "or", "a", "nil", "map", "if", "the", "key", "doesn", "t", "exist", "or", "if", "the", "key", "isn", "t", "a", "map", "[", "string", "]", "interface" ]
[ "func", "(", "t", "Typed", ")", "<mask>", "(", "key", "string", ")", "map", "[", "string", "]", "interface", "{", "}", "{", "return", "t", ".", "MapOr", "(", "key", ",", "nil", ")", "\n", "}" ]
23,877
all-23878
[ "ParseFile", "creates", "a", "new", "Config", "and", "parses", "the", "file", "configuration", "from", "the", "named", "file", "." ]
[ "func", "ParseFile", "(", "name", "string", ")", "(", "*", "Config", ",", "error", ")", "{", "file", ",", "err", ":=", "os", ".", "Open", "(", "name", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "cfg", ":=", "&", "Config", "{", "sync", ".", "RWMutex", "{", "}", ",", "make", "(", "map", "[", "string", "]", "string", ")", ",", "make", "(", "[", "]", "byte", ",", "0", ")", ",", "file", ".", "Name", "(", ")", ",", "}", "\n", "cfg", ".", "Lock", "(", ")", "\n", "defer", "cfg", ".", "Unlock", "(", ")", "\n", "defer", "file", ".", "Close", "(", ")", "\n\n", "gotSeparator", ":=", "false", "\n", "s", ":=", "NewScanner", "(", "file", ")", "\n\n", "for", "found", ":=", "s", ".", "Scan", "(", ")", ";", "found", ";", "found", "=", "s", ".", "Scan", "(", ")", "{", "if", "found", "{", "k", ",", "v", ":=", "s", ".", "Text", "(", ")", "\n", "cfg", ".", "data", "[", "k", "]", "=", "v", "\n\n", "if", "!", "gotSeparator", "{", "cfg", ".", "separator", "=", "s", ".", "Separator", "(", ")", "\n", "gotSeparator", "=", "<mask>", "\n", "}", "\n", "continue", "\n", "}", "else", "if", "s", ".", "Err", "(", ")", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n", "}", "\n\n", "return", "cfg", ",", "nil", "\n", "}" ]
23,878
all-23879
[ "getContext", "is", "a", "modified", "copy", "of", "k8s", ".", "io", "/", "kubernetes", "/", "pkg", "/", "client", "/", "unversioned", "/", "clientcmd", ".", "DirectClientConfig", ".", "getContext", "." ]
[ "func", "(", "config", "*", "directClientConfig", ")", "getContext", "(", ")", "clientcmdContext", "{", "contexts", ":=", "config", ".", "config", ".", "Contexts", "\n", "contextName", ":=", "config", ".", "getContextName", "(", ")", "\n\n", "<mask>", "mergedContext", "clientcmdContext", "\n", "if", "configContext", ",", "exists", ":=", "contexts", "[", "contextName", "]", ";", "exists", "{", "mergo", ".", "Merge", "(", "&", "mergedContext", ",", "configContext", ")", "\n", "}", "\n", "// REMOVED: overrides support", "return", "mergedContext", "\n", "}" ]
23,879
all-23880
[ "SetReplyToMessageID", "sets", "the", "ID", "for", "the", "message", "to", "reply", "to", "(", "optional", ")", "." ]
[ "func", "(", "op", "*", "outgoingMessageBase", ")", "SetReplyToMessageID", "(", "to", "int", ")", "{", "op", ".", "ReplyToMessageID", "=", "to", "\n", "op", ".", "replyToMessageIDSet", "=", "<mask>", "\n", "}" ]
23,880
all-23881
[ "GetTitleAlign", "returns", "the", "TitleAlign", "field", "if", "non", "-", "nil", "zero", "value", "otherwise", "." ]
[ "func", "(", "c", "*", "ChangeDefinition", ")", "GetTitleAlign", "(", ")", "<mask>", "{", "if", "c", "==", "nil", "||", "c", ".", "TitleAlign", "==", "nil", "{", "return", "\"", "\"", "\n", "}", "\n", "return", "*", "c", ".", "TitleAlign", "\n", "}" ]
23,881
all-23882
[ "RotatePieceLeft", "tries", "to", "rotate", "the", "piece", "to", "the", "left", "and", "returns", "the", "piece", "s", "next", "angle", "." ]
[ "func", "(", "f", "*", "<mask>", ")", "RotatePieceLeft", "(", "piece", "*", "Piece", ",", "x", ",", "y", "int", ",", "angle", "Angle", ")", "Angle", "{", "if", "piece", ".", "collides", "(", "f", ",", "x", ",", "y", ",", "angle", ".", "RotateLeft", "(", ")", ")", "{", "return", "angle", "\n", "}", "\n", "return", "angle", ".", "RotateLeft", "(", ")", "\n", "}" ]
23,882
all-23883
[ "determine", "if", "a", "name", "corresponds", "to", "a", "program", "pipeline", "object" ]
[ "func", "IsProgramPipeline", "(", "pipeline", "uint32", ")", "bool", "{", "<mask>", ",", "_", ",", "_", ":=", "syscall", ".", "Syscall", "(", "gpIsProgramPipeline", ",", "1", ",", "uintptr", "(", "pipeline", ")", ",", "0", ",", "0", ")", "\n", "return", "ret", "!=", "0", "\n", "}" ]
23,883
all-23884
[ "Post", "registers", "handlers", "with", "the", "given", "pattern", "for", "POST", "method" ]
[ "func", "(", "r", "*", "<mask>", ")", "Post", "(", "pat", "string", ",", "f", "...", "HandlerFunc", ")", "{", "r", ".", "HandleMethod", "(", "pat", ",", "\"", "\"", ",", "f", "...", ")", "\n", "}" ]
23,884
all-23885
[ "nodeToMap", "translates", "the", "contents", "of", "a", "node", "into", "a", "map", "nodeToMap", "can", "be", "called", "on", "the", "same", "map", "with", "successive", "results", "from", "watch", "to", "accumulate", "a", "value", "nodeToMap", "returns", "true", "if", "out", "was", "modified" ]
[ "func", "nodeToMap", "(", "node", "*", "etcd", ".", "Node", ",", "out", "map", "[", "string", "]", "string", ")", "bool", "{", "key", ":=", "strings", ".", "TrimPrefix", "(", "node", ".", "Key", ",", "\"", "\"", ")", "\n", "if", "!", "node", ".", "Dir", "{", "if", "node", ".", "Value", "==", "\"", "\"", "{", "if", "_", ",", "ok", ":=", "out", "[", "key", "]", ";", "ok", "{", "delete", "(", "out", ",", "key", ")", "\n", "return", "true", "\n", "}", "\n", "return", "false", "\n", "}", "\n", "if", "value", ",", "ok", ":=", "out", "[", "key", "]", ";", "!", "ok", "||", "value", "!=", "node", ".", "Value", "{", "<mask>", "[", "key", "]", "=", "node", ".", "Value", "\n", "return", "true", "\n", "}", "\n", "return", "false", "\n", "}", "\n", "changed", ":=", "false", "\n", "for", "_", ",", "node", ":=", "range", "node", ".", "Nodes", "{", "changed", "=", "nodeToMap", "(", "node", ",", "out", ")", "||", "changed", "\n", "}", "\n", "return", "changed", "\n", "}" ]
23,885
all-23886
[ "Used", "to", "get", "a", "name", "of", "interface", "." ]
[ "func", "getIfaceLink", "(", "idx", "uint32", ")", "(", "*", "syscall", ".", "NetlinkMessage", ",", "error", ")", "{", "dat", ",", "err", ":=", "syscall", ".", "NetlinkRIB", "(", "syscall", ".", "RTM_GETLINK", ",", "syscall", ".", "AF_UNSPEC", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n\n", "msgs", ",", "msgErr", ":=", "syscall", ".", "ParseNetlinkMessage", "(", "dat", ")", "\n", "if", "msgErr", "!=", "nil", "{", "return", "nil", ",", "msgErr", "\n", "}", "\n\n", "ifinfomsg", ":=", "syscall", ".", "IfInfomsg", "{", "}", "\n", "for", "_", ",", "m", ":=", "range", "msgs", "{", "if", "m", ".", "Header", ".", "Type", "!=", "syscall", ".", "RTM_NEWLINK", "{", "continue", "\n", "}", "\n", "buf", ":=", "bytes", ".", "NewBuffer", "(", "m", ".", "Data", "[", ":", "syscall", ".", "SizeofIfInfomsg", "]", ")", "\n", "if", "rerr", ":=", "binary", ".", "Read", "(", "buf", ",", "cpuutil", ".", "ByteOrder", "(", ")", ",", "&", "ifinfomsg", ")", ";", "rerr", "!=", "nil", "{", "continue", "\n", "}", "\n", "if", "ifinfomsg", ".", "<mask>", "==", "int32", "(", "idx", ")", "{", "return", "&", "m", ",", "nil", "\n", "}", "\n", "}", "\n\n", "return", "nil", ",", "fmt", ".", "Errorf", "(", "\"", "\"", ",", "idx", ")", "\n", "}" ]
23,886
all-23887
[ "parseData", "is", "used", "to", "update", "brain", "from", "a", "KV", "data", "pair" ]
[ "func", "(", "d", "*", "DedupManager", ")", "parseData", "(", "path", "string", ",", "raw", "[", "]", "byte", ")", "{", "// Setup the decompression and decoders", "r", ":=", "bytes", ".", "NewReader", "(", "raw", ")", "\n", "decompress", ":=", "lzw", ".", "NewReader", "(", "r", ",", "lzw", ".", "LSB", ",", "8", ")", "\n", "defer", "decompress", ".", "Close", "(", ")", "\n", "dec", ":=", "gob", ".", "NewDecoder", "(", "decompress", ")", "\n\n", "// Decode the data", "var", "td", "templateData", "\n", "if", "err", ":=", "dec", ".", "Decode", "(", "&", "td", ")", ";", "err", "!=", "nil", "{", "log", ".", "Printf", "(", "\"", "\"", ",", "path", ",", "err", ")", "\n", "return", "\n", "}", "\n", "if", "td", ".", "<mask>", "!=", "version", ".", "Version", "{", "log", ".", "Printf", "(", "\"", "\"", ",", "td", ".", "Version", ",", "version", ".", "Version", ")", "\n", "return", "\n", "}", "\n", "log", ".", "Printf", "(", "\"", "\"", ",", "len", "(", "td", ".", "Data", ")", ",", "path", ")", "\n\n", "// Update the data in the brain", "for", "hashCode", ",", "value", ":=", "range", "td", ".", "Data", "{", "d", ".", "brain", ".", "ForceSet", "(", "hashCode", ",", "value", ")", "\n", "}", "\n\n", "// Trigger the updateCh", "select", "{", "case", "d", ".", "updateCh", "<-", "struct", "{", "}", "{", "}", ":", "default", ":", "}", "\n", "}" ]
23,887
all-23888
[ "Unregister", "remove", "from", "the", "registry", "the", "instrument", "matching", "the", "given", "name", "/", "tags" ]
[ "func", "(", "r", "*", "Registry", ")", "Unregister", "(", "name", "string", ",", "tags", "[", "]", "string", ")", "{", "key", ":=", "MetricID", "(", "name", ",", "tags", ")", "\n", "r", ".", "mutex", ".", "Lock", "(", ")", "\n", "delete", "(", "r", ".", "instruments", ",", "<mask>", ")", "\n", "r", ".", "mutex", ".", "Unlock", "(", ")", "\n", "}" ]
23,888
all-23889
[ "MarshalJSON", "supports", "json", ".", "Marshaler", "interface" ]
[ "func", "(", "v", "GetOuterHTMLParams", ")", "MarshalJSON", "(", ")", "(", "[", "]", "<mask>", ",", "error", ")", "{", "w", ":=", "jwriter", ".", "Writer", "{", "}", "\n", "easyjsonC5a4559bEncodeGithubComChromedpCdprotoDom37", "(", "&", "w", ",", "v", ")", "\n", "return", "w", ".", "Buffer", ".", "BuildBytes", "(", ")", ",", "w", ".", "Error", "\n", "}" ]
23,889
all-23890
[ "Reset", "an", "auto", "-", "generated", "source", "file", "writing", "a", "new", "empty", "file", "header", "." ]
[ "func", "Reset", "(", "path", "string", ",", "imports", "[", "]", "string", ")", "error", "{", "content", ":=", "fmt", ".", "Sprintf", "(", "`package %s\n\n// The code below was generated by %s - DO NOT EDIT!\n\nimport (\n`", ",", "os", ".", "Getenv", "(", "\"", "\"", ")", ",", "os", ".", "Args", "[", "0", "]", ")", "\n\n", "for", "_", ",", "uri", ":=", "range", "imports", "{", "content", "+=", "fmt", ".", "Sprintf", "(", "\"", "\\t", "\\n", "\"", ",", "uri", ")", "\n", "}", "\n\n", "content", "+=", "\"", "\\n", "\\n", "\"", "\n\n", "// FIXME: we should only import what's needed.", "content", "+=", "\"", "\\n", "\"", "\n\n", "bytes", ":=", "[", "]", "byte", "(", "content", ")", "\n\n", "var", "err", "error", "\n\n", "if", "<mask>", "==", "\"", "\"", "{", "_", ",", "err", "=", "os", ".", "Stdout", ".", "Write", "(", "bytes", ")", "\n", "}", "else", "{", "err", "=", "ioutil", ".", "WriteFile", "(", "path", ",", "[", "]", "byte", "(", "content", ")", ",", "0644", ")", "\n", "}", "\n\n", "if", "err", "!=", "nil", "{", "errors", ".", "Wrapf", "(", "err", ",", "\"", "\"", ",", "path", ")", "\n", "}", "\n\n", "return", "nil", "\n", "}" ]
23,890
all-23891
[ "NewRedisCounter", "returns", "a", "new", "redis", "-", "based", "counter" ]
[ "func", "NewRedisCounter", "(", "client", "*", "redis", ".", "<mask>", ",", "key", "string", ",", "bucketSize", ",", "retention", "time", ".", "Duration", ")", "Counter", "{", "return", "&", "redisCounter", "{", "client", ":", "client", ",", "key", ":", "key", ",", "bucketSize", ":", "bucketSize", ",", "retention", ":", "retention", ",", "}", "\n", "}" ]
23,891
all-23892
[ "GetProcessQueryOk", "returns", "a", "tuple", "with", "the", "ProcessQuery", "field", "if", "it", "s", "non", "-", "nil", "zero", "value", "otherwise", "and", "a", "boolean", "to", "check", "if", "the", "value", "has", "been", "set", "." ]
[ "func", "(", "c", "*", "ChangeRequest", ")", "GetProcessQueryOk", "(", ")", "(", "WidgetProcessQuery", ",", "bool", ")", "{", "if", "c", "==", "nil", "||", "c", ".", "ProcessQuery", "==", "nil", "{", "return", "WidgetProcessQuery", "{", "}", ",", "<mask>", "\n", "}", "\n", "return", "*", "c", ".", "ProcessQuery", ",", "true", "\n", "}" ]
23,892
all-23893
[ "parseXML", "extracts", "a", "gcsDir", "object", "from", "XML", ".", "If", "this", "returns", "a", "nil", "gcsDir", "the", "XML", "indicated", "that", "this", "was", "not", "a", "directory", "at", "all", "." ]
[ "func", "parseXML", "(", "body", "[", "]", "byte", ",", "object", "string", ")", "(", "*", "gcsDir", ",", "error", ")", "{", "dir", ":=", "new", "(", "gcsDir", ")", "\n", "if", "err", ":=", "xml", ".", "Unmarshal", "(", "body", ",", "&", "dir", ")", ";", "err", "!=", "nil", "{", "return", "nil", ",", "err", "\n", "}", "\n", "// We think this is a dir if the object is \"/\" (just the bucket) or if we", "// find any Contents or CommonPrefixes.", "isDir", ":=", "object", "==", "\"", "\"", "||", "len", "(", "dir", ".", "Contents", ")", "+", "len", "(", "dir", ".", "CommonPrefixes", ")", ">", "0", "\n", "selfIndex", ":=", "-", "1", "\n", "for", "i", ":=", "<mask>", "dir", ".", "Contents", "{", "rec", ":=", "&", "dir", ".", "Contents", "[", "i", "]", "\n", "name", ":=", "strings", ".", "TrimPrefix", "(", "rec", ".", "Name", ",", "object", ")", "\n", "if", "name", "==", "\"", "\"", "{", "selfIndex", "=", "i", "\n", "continue", "\n", "}", "\n", "rec", ".", "Name", "=", "name", "\n", "if", "strings", ".", "HasSuffix", "(", "name", ",", "\"", "\"", ")", "{", "rec", ".", "isDir", "=", "true", "\n", "}", "\n", "}", "\n\n", "for", "i", ":=", "range", "dir", ".", "CommonPrefixes", "{", "cp", ":=", "&", "dir", ".", "CommonPrefixes", "[", "i", "]", "\n", "cp", ".", "Prefix", "=", "strings", ".", "TrimPrefix", "(", "cp", ".", "Prefix", ",", "object", ")", "\n", "}", "\n\n", "if", "!", "isDir", "{", "return", "nil", ",", "nil", "\n", "}", "\n\n", "if", "selfIndex", ">=", "0", "{", "// Strip out the record that indicates this object.", "dir", ".", "Contents", "=", "append", "(", "dir", ".", "Contents", "[", ":", "selfIndex", "]", ",", "dir", ".", "Contents", "[", "selfIndex", "+", "1", ":", "]", "...", ")", "\n", "}", "\n", "return", "dir", ",", "nil", "\n", "}" ]
23,893
all-23894
[ "Function", "decorator", "to", "monitor", "the", "execution", "of", "an", "anonymous", "function", "returns", "an", "array", "of", "the", "returned", "Values" ]
[ "func", "(", "m", "*", "Monitor", ")", "MonitorFunc", "(", "section", "string", ",", "myfunc", "interface", "{", "}", ")", "[", "]", "reflect", ".", "Value", "{", "return", "m", ".", "MonitorReflectedFunc", "(", "section", ",", "reflect", ".", "ValueOf", "(", "myfunc", ")", ",", "[", "]", "reflect", ".", "<mask>", "{", "}", ")", "\n", "}" ]
23,894
all-23895
[ "Returns", "a", "signed", "URL", "for", "AzureTables", "valid", "for", "the", "specified", "duration", ".", "Required", "scopes", ":", "auth", ":", "azure", "-", "table", ":", "list", "-", "tables", ":", "<account", ">", "See", "AzureTables", "for", "more", "details", "." ]
[ "func", "(", "auth", "*", "Auth", ")", "AzureTables_SignedURL", "(", "account", ",", "continuationToken", "string", ",", "duration", "time", ".", "Duration", ")", "(", "*", "url", ".", "URL", ",", "error", ")", "{", "v", ":=", "<mask>", ".", "Values", "{", "}", "\n", "if", "continuationToken", "!=", "\"", "\"", "{", "v", ".", "Add", "(", "\"", "\"", ",", "continuationToken", ")", "\n", "}", "\n", "cd", ":=", "tcclient", ".", "Client", "(", "*", "auth", ")", "\n", "return", "(", "&", "cd", ")", ".", "SignedURL", "(", "\"", "\"", "+", "url", ".", "QueryEscape", "(", "account", ")", "+", "\"", "\"", ",", "v", ",", "duration", ")", "\n", "}" ]
23,895
all-23896
[ "AsyncClose", "implements", "PartitionConsumer" ]
[ "func", "(", "c", "*", "partitionConsumer", ")", "AsyncClose", "(", ")", "{", "c", ".", "closeOnce", ".", "Do", "(", "func", "(", ")", "{", "c", ".", "closeErr", "=", "c", ".", "PartitionConsumer", ".", "Close", "(", ")", "\n", "<mask>", "(", "c", ".", "dying", ")", "\n", "}", ")", "\n", "}" ]
23,896
all-23897
[ "timeoutFlush", "calls", "Flush", "and", "returns", "when", "it", "completes", "or", "after", "timeout", "elapses", "whichever", "happens", "first", ".", "This", "is", "needed", "because", "the", "hooks", "invoked", "by", "Flush", "may", "deadlock", "when", "glog", ".", "Fatal", "is", "called", "from", "a", "hook", "that", "holds", "a", "lock", "." ]
[ "func", "timeoutFlush", "(", "l", "*", "Log", ",", "timeout", "time", ".", "Duration", ")", "{", "done", ":=", "make", "(", "chan", "bool", ",", "1", ")", "\n", "<mask>", "func", "(", ")", "{", "l", ".", "lockAndFlushAll", "(", ")", "\n", "done", "<-", "true", "\n", "}", "(", ")", "\n", "select", "{", "case", "<-", "done", ":", "case", "<-", "time", ".", "After", "(", "timeout", ")", ":", "fmt", ".", "Fprintln", "(", "os", ".", "Stderr", ",", "\"", "\"", ",", "timeout", ")", "\n", "}", "\n", "}" ]
23,897
all-23898
[ "Rl10Locator", "builds", "a", "locator", "from", "the", "given", "href", "." ]
[ "func", "(", "api", "*", "API", ")", "Rl10Locator", "(", "href", "<mask>", ")", "*", "Rl10Locator", "{", "return", "&", "Rl10Locator", "{", "Href", "(", "href", ")", ",", "api", "}", "\n", "}" ]
23,898
all-23899
[ "SetKnownStatus", "sets", "the", "known", "status", "of", "the", "task" ]
[ "func", "(", "task", "*", "Task", ")", "SetKnownStatus", "(", "status", "apitaskstatus", ".", "TaskStatus", ")", "{", "<mask>", ".", "setKnownStatus", "(", "status", ")", "\n", "task", ".", "updateKnownStatusTime", "(", ")", "\n", "}" ]
23,899
all-23900
[ "InitialState", "returns", "the", "initial", "state", "of", "the", "LedgerEntry", "identified", "by", "key", "just", "prior", "to", "the", "application", "of", "the", "transaction", "the", "produced", "b", ".", "Returns", "nil", "if", "the", "ledger", "entry", "did", "not", "exist", "prior", "to", "the", "bundle", "." ]
[ "func", "(", "b", "*", "Bundle", ")", "InitialState", "(", "key", "xdr", ".", "LedgerKey", ")", "(", "*", "xdr", ".", "LedgerEntry", ",", "error", ")", "{", "all", ":=", "b", ".", "Changes", "(", "key", ")", "\n\n", "if", "len", "(", "all", ")", "==", "0", "{", "return", "nil", ",", "ErrMetaNotFound", "\n", "}", "\n\n", "first", ":=", "all", "[", "0", "]", "\n\n", "if", "first", ".", "<mask>", "!=", "xdr", ".", "LedgerEntryChangeTypeLedgerEntryState", "{", "return", "nil", ",", "nil", "\n", "}", "\n\n", "result", ":=", "first", ".", "MustState", "(", ")", "\n\n", "return", "&", "result", ",", "nil", "\n", "}" ]