id
int32 0
25.3k
| idx
stringlengths 5
9
| nl_tokens
sequencelengths 1
418
| pl_tokens
sequencelengths 22
4.98k
|
---|---|---|---|
5,100 | all-5101 | [
"setDefaultValue",
"is",
"used",
"to",
"install",
"a",
"default",
"value",
"from",
"a",
"tag",
"string",
"into",
"a",
"Value",
".",
"It",
"is",
"successful",
"if",
"the",
"field",
"was",
"optional",
"even",
"if",
"a",
"default",
"value",
"wasn",
"t",
"provided",
"or",
"it",
"failed",
"to",
"install",
"it",
"into",
"the",
"Value",
"."
] | [
"func",
"setDefaultValue",
"(",
"v",
"reflect",
".",
"Value",
",",
"params",
"fieldParameters",
")",
"(",
"ok",
"bool",
")",
"{",
"if",
"!",
"params",
".",
"optional",
"{",
"return",
"\n",
"}",
"\n",
"<mask>",
"=",
"true",
"\n",
"if",
"params",
".",
"defaultValue",
"==",
"nil",
"{",
"return",
"\n",
"}",
"\n",
"if",
"canHaveDefaultValue",
"(",
"v",
".",
"Kind",
"(",
")",
")",
"{",
"v",
".",
"SetInt",
"(",
"*",
"params",
".",
"defaultValue",
")",
"\n",
"}",
"\n",
"return",
"\n",
"}"
] |
5,101 | all-5102 | [
"mergeExprs",
"combines",
"information",
"from",
"src",
"and",
"dst",
"and",
"returns",
"a",
"merged",
"expression",
".",
"dst",
"may",
"be",
"modified",
"during",
"this",
"process",
".",
"The",
"returned",
"expression",
"may",
"be",
"different",
"from",
"dst",
"when",
"a",
"structural",
"change",
"is",
"needed",
".",
"The",
"following",
"kinds",
"of",
"expressions",
"are",
"recognized",
".",
"*",
"nil",
"*",
"strings",
"(",
"can",
"only",
"be",
"merged",
"with",
"strings",
")",
"*",
"lists",
"of",
"strings",
"*",
"a",
"call",
"to",
"select",
"with",
"a",
"dict",
"argument",
".",
"The",
"dict",
"keys",
"must",
"be",
"strings",
"and",
"the",
"values",
"must",
"be",
"lists",
"of",
"strings",
".",
"*",
"a",
"list",
"of",
"strings",
"combined",
"with",
"a",
"select",
"call",
"using",
"+",
".",
"The",
"list",
"must",
"be",
"the",
"left",
"operand",
".",
"An",
"error",
"is",
"returned",
"if",
"the",
"expressions",
"can",
"t",
"be",
"merged",
"for",
"example",
"because",
"they",
"are",
"not",
"in",
"one",
"of",
"the",
"above",
"formats",
"."
] | [
"func",
"mergeExprs",
"(",
"src",
",",
"dst",
"bzl",
".",
"Expr",
")",
"(",
"bzl",
".",
"Expr",
",",
"error",
")",
"{",
"if",
"ShouldKeep",
"(",
"dst",
")",
"{",
"return",
"nil",
",",
"nil",
"\n",
"}",
"\n",
"if",
"src",
"==",
"nil",
"&&",
"(",
"dst",
"==",
"nil",
"||",
"isScalar",
"(",
"dst",
")",
")",
"{",
"return",
"nil",
",",
"nil",
"\n",
"}",
"\n",
"if",
"isScalar",
"(",
"src",
")",
"{",
"return",
"src",
",",
"nil",
"\n",
"}",
"\n\n",
"srcExprs",
",",
"err",
":=",
"extractPlatformStringsExprs",
"(",
"src",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n",
"dstExprs",
",",
"err",
":=",
"extractPlatformStringsExprs",
"(",
"dst",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n",
"mergedExprs",
",",
"err",
":=",
"mergePlatformStringsExprs",
"(",
"srcExprs",
",",
"dstExprs",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n",
"<mask>",
"makePlatformStringsExpr",
"(",
"mergedExprs",
")",
",",
"nil",
"\n",
"}"
] |
5,102 | all-5103 | [
"Resolver",
"returns",
"a",
"resolver",
"for",
"the",
"given",
"rule",
"and",
"package",
"and",
"a",
"bool",
"indicating",
"whether",
"one",
"was",
"found",
".",
"Empty",
"string",
"may",
"be",
"passed",
"for",
"pkgRel",
"which",
"results",
"in",
"consulting",
"the",
"builtin",
"kinds",
"only",
"."
] | [
"func",
"(",
"mr",
"metaResolver",
")",
"Resolver",
"(",
"r",
"*",
"rule",
".",
"Rule",
",",
"pkgRel",
"string",
")",
"resolve",
".",
"Resolver",
"{",
"for",
"_",
",",
"mappedKind",
":=",
"<mask>",
"mr",
".",
"mappedKinds",
"[",
"pkgRel",
"]",
"{",
"if",
"mappedKind",
".",
"KindName",
"==",
"r",
".",
"Kind",
"(",
")",
"{",
"return",
"mr",
".",
"builtins",
"[",
"mappedKind",
".",
"FromKind",
"]",
"\n",
"}",
"\n",
"}",
"\n",
"return",
"mr",
".",
"builtins",
"[",
"r",
".",
"Kind",
"(",
")",
"]",
"\n",
"}"
] |
5,103 | all-5104 | [
"SetLineCap",
"sets",
"the",
"line",
"cap",
"(",
"round",
"but",
"or",
"square",
")"
] | [
"func",
"(",
"gc",
"*",
"GraphicContext",
")",
"SetLineCap",
"(",
"Cap",
"draw2d",
".",
"LineCap",
")",
"{",
"gc",
".",
"StackGraphicContext",
".",
"SetLineCap",
"(",
"Cap",
")",
"\n",
"gc",
".",
"pdf",
".",
"SetLineCapStyle",
"(",
"<mask>",
"[",
"Cap",
"]",
")",
"\n",
"}"
] |
5,104 | all-5105 | [
"dependingImages",
"returns",
"all",
"images",
"that",
"is",
"depended",
"by",
"the",
"image",
"."
] | [
"func",
"(",
"i",
"*",
"Image",
")",
"dependingImages",
"(",
")",
"map",
"[",
"*",
"Image",
"]",
"struct",
"{",
"}",
"{",
"r",
":=",
"map",
"[",
"*",
"Image",
"]",
"struct",
"{",
"}",
"{",
"}",
"\n",
"for",
"_",
",",
"c",
":=",
"range",
"i",
".",
"drawTrianglesHistory",
"{",
"r",
"[",
"c",
".",
"<mask>",
"]",
"=",
"struct",
"{",
"}",
"{",
"}",
"\n",
"}",
"\n",
"return",
"r",
"\n",
"}"
] |
5,105 | all-5106 | [
"UnbindUnit",
"is",
"a",
"no",
"-",
"op",
"for",
"OSB",
"API",
"implementations"
] | [
"func",
"(",
"b",
"*",
"brokerClient",
")",
"UnbindUnit",
"(",
"instance",
"*",
"ServiceInstance",
",",
"app",
"<mask>",
".",
"App",
",",
"unit",
"bind",
".",
"Unit",
")",
"error",
"{",
"return",
"nil",
"\n",
"}"
] |
5,106 | all-5107 | [
"GetReliefStyle",
"is",
"a",
"wrapper",
"around",
"gtk_toolbar_get_relief_style",
"()",
"."
] | [
"func",
"(",
"v",
"*",
"Toolbar",
")",
"GetReliefStyle",
"(",
")",
"ReliefStyle",
"{",
"c",
":=",
"C",
".",
"gtk_toolbar_get_relief_style",
"(",
"v",
".",
"native",
"(",
")",
")",
"\n",
"<mask>",
"ReliefStyle",
"(",
"c",
")",
"\n",
"}"
] |
5,107 | all-5108 | [
"NewMultiplex",
"creates",
"a",
"new",
"multiplexer",
"session",
"."
] | [
"func",
"NewMultiplex",
"(",
"con",
"net",
".",
"Conn",
",",
"initiator",
"bool",
")",
"*",
"Multiplex",
"{",
"mp",
":=",
"&",
"Multiplex",
"{",
"con",
":",
"con",
",",
"initiator",
":",
"initiator",
",",
"buf",
":",
"bufio",
".",
"NewReader",
"(",
"con",
")",
",",
"channels",
":",
"<mask>",
"(",
"map",
"[",
"streamID",
"]",
"*",
"Stream",
")",
",",
"closed",
":",
"make",
"(",
"chan",
"struct",
"{",
"}",
")",
",",
"shutdown",
":",
"make",
"(",
"chan",
"struct",
"{",
"}",
")",
",",
"wrTkn",
":",
"make",
"(",
"chan",
"struct",
"{",
"}",
",",
"1",
")",
",",
"nstreams",
":",
"make",
"(",
"chan",
"*",
"Stream",
",",
"16",
")",
",",
"}",
"\n\n",
"go",
"mp",
".",
"handleIncoming",
"(",
")",
"\n\n",
"mp",
".",
"wrTkn",
"<-",
"struct",
"{",
"}",
"{",
"}",
"\n\n",
"return",
"mp",
"\n",
"}"
] |
5,108 | all-5109 | [
"ShowAPIActions",
"displays",
"the",
"command",
"hrefs",
"."
] | [
"func",
"(",
"a",
"*",
"API",
")",
"ShowAPIActions",
"(",
"cmd",
"string",
")",
"<mask>",
"{",
"return",
"a",
".",
"ShowActions",
"(",
"cmd",
",",
"\"",
"\"",
",",
"commandValues",
")",
"\n",
"}"
] |
5,109 | all-5110 | [
"SetRules",
"overwrites",
"the",
"existing",
"security",
"rules",
"with",
"the",
"new",
"rules",
"given",
"."
] | [
"func",
"(",
"c",
"*",
"<mask>",
")",
"SetRules",
"(",
"rules",
"*",
"Rules",
",",
"params",
"map",
"[",
"string",
"]",
"string",
")",
"error",
"{",
"body",
",",
"err",
":=",
"json",
".",
"Marshal",
"(",
"rules",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"log",
".",
"Printf",
"(",
"\"",
"\\n",
"\"",
",",
"err",
")",
"\n",
"return",
"err",
"\n",
"}",
"\n\n",
"_",
",",
"err",
"=",
"c",
".",
"api",
".",
"Call",
"(",
"\"",
"\"",
",",
"c",
".",
"Url",
"+",
"\"",
"\"",
",",
"c",
".",
"Auth",
",",
"body",
",",
"params",
")",
"\n\n",
"return",
"err",
"\n",
"}"
] |
5,110 | all-5111 | [
"Port",
"returns",
"the",
"actual",
"port",
"the",
"server",
"listens",
"to"
] | [
"func",
"(",
"s",
"*",
"Server",
")",
"Port",
"(",
")",
"string",
"{",
"hostPortSplit",
":=",
"strings",
".",
"Split",
"(",
"s",
".",
"HostPort",
",",
"\"",
"\"",
")",
"\n",
"<mask>",
":=",
"hostPortSplit",
"[",
"len",
"(",
"hostPortSplit",
")",
"-",
"1",
"]",
"\n",
"return",
"port",
"\n",
"}"
] |
5,111 | all-5112 | [
"SetInstance",
"is",
"a",
"wrapper",
"around",
"g_value_set_instance",
"()",
"."
] | [
"func",
"(",
"v",
"*",
"Value",
")",
"SetInstance",
"(",
"<mask>",
"uintptr",
")",
"{",
"C",
".",
"g_value_set_instance",
"(",
"v",
".",
"native",
"(",
")",
",",
"C",
".",
"gpointer",
"(",
"instance",
")",
")",
"\n",
"}"
] |
5,112 | all-5113 | [
"MkdirAll",
"mocks",
"base",
"method"
] | [
"func",
"(",
"m",
"*",
"MockFileSystem",
")",
"MkdirAll",
"(",
"arg0",
"string",
",",
"arg1",
"os",
".",
"FileMode",
")",
"error",
"{",
"ret",
":=",
"m",
".",
"ctrl",
".",
"Call",
"(",
"m",
",",
"\"",
"\"",
",",
"arg0",
",",
"arg1",
")",
"\n",
"ret0",
",",
"_",
":=",
"<mask>",
"[",
"0",
"]",
".",
"(",
"error",
")",
"\n",
"return",
"ret0",
"\n",
"}"
] |
5,113 | all-5114 | [
"newChange",
"returns",
"a",
"Change",
"of",
"the",
"given",
"record",
"by",
"the",
"given",
"action",
"e",
".",
"g",
".",
"action",
"=",
"ChangeActionCreate",
"returns",
"a",
"change",
"for",
"creation",
"of",
"the",
"record",
"and",
"action",
"=",
"ChangeActionDelete",
"returns",
"a",
"change",
"for",
"deletion",
"of",
"the",
"record",
"."
] | [
"func",
"(",
"p",
"*",
"AWSProvider",
")",
"newChange",
"(",
"action",
"string",
",",
"endpoint",
"*",
"endpoint",
".",
"Endpoint",
",",
"recordsCache",
"[",
"]",
"*",
"endpoint",
".",
"Endpoint",
",",
"zones",
"map",
"[",
"string",
"]",
"*",
"route53",
".",
"HostedZone",
")",
"*",
"route53",
".",
"Change",
"{",
"change",
":=",
"&",
"route53",
".",
"Change",
"{",
"Action",
":",
"aws",
".",
"String",
"(",
"action",
")",
",",
"ResourceRecordSet",
":",
"&",
"route53",
".",
"ResourceRecordSet",
"{",
"Name",
":",
"aws",
".",
"String",
"(",
"endpoint",
".",
"DNSName",
")",
",",
"}",
",",
"}",
"\n\n",
"if",
"isAWSLoadBalancer",
"(",
"endpoint",
")",
"{",
"evalTargetHealth",
":=",
"p",
".",
"evaluateTargetHealth",
"\n",
"if",
"prop",
",",
"ok",
":=",
"endpoint",
".",
"GetProviderSpecificProperty",
"(",
"providerSpecificEvaluateTargetHealth",
")",
";",
"ok",
"{",
"evalTargetHealth",
"=",
"prop",
".",
"Value",
"==",
"\"",
"\"",
"\n",
"}",
"\n\n",
"<mask>",
".",
"ResourceRecordSet",
".",
"Type",
"=",
"aws",
".",
"String",
"(",
"route53",
".",
"RRTypeA",
")",
"\n",
"change",
".",
"ResourceRecordSet",
".",
"AliasTarget",
"=",
"&",
"route53",
".",
"AliasTarget",
"{",
"DNSName",
":",
"aws",
".",
"String",
"(",
"endpoint",
".",
"Targets",
"[",
"0",
"]",
")",
",",
"HostedZoneId",
":",
"aws",
".",
"String",
"(",
"canonicalHostedZone",
"(",
"endpoint",
".",
"Targets",
"[",
"0",
"]",
")",
")",
",",
"EvaluateTargetHealth",
":",
"aws",
".",
"Bool",
"(",
"evalTargetHealth",
")",
",",
"}",
"\n",
"}",
"else",
"if",
"hostedZone",
":=",
"isAWSAlias",
"(",
"endpoint",
",",
"recordsCache",
")",
";",
"hostedZone",
"!=",
"\"",
"\"",
"{",
"for",
"_",
",",
"zone",
":=",
"range",
"zones",
"{",
"change",
".",
"ResourceRecordSet",
".",
"Type",
"=",
"aws",
".",
"String",
"(",
"route53",
".",
"RRTypeA",
")",
"\n",
"change",
".",
"ResourceRecordSet",
".",
"AliasTarget",
"=",
"&",
"route53",
".",
"AliasTarget",
"{",
"DNSName",
":",
"aws",
".",
"String",
"(",
"endpoint",
".",
"Targets",
"[",
"0",
"]",
")",
",",
"HostedZoneId",
":",
"aws",
".",
"String",
"(",
"cleanZoneID",
"(",
"*",
"zone",
".",
"Id",
")",
")",
",",
"EvaluateTargetHealth",
":",
"aws",
".",
"Bool",
"(",
"p",
".",
"evaluateTargetHealth",
")",
",",
"}",
"\n",
"}",
"\n",
"}",
"else",
"{",
"change",
".",
"ResourceRecordSet",
".",
"Type",
"=",
"aws",
".",
"String",
"(",
"endpoint",
".",
"RecordType",
")",
"\n",
"if",
"!",
"endpoint",
".",
"RecordTTL",
".",
"IsConfigured",
"(",
")",
"{",
"change",
".",
"ResourceRecordSet",
".",
"TTL",
"=",
"aws",
".",
"Int64",
"(",
"recordTTL",
")",
"\n",
"}",
"else",
"{",
"change",
".",
"ResourceRecordSet",
".",
"TTL",
"=",
"aws",
".",
"Int64",
"(",
"int64",
"(",
"endpoint",
".",
"RecordTTL",
")",
")",
"\n",
"}",
"\n",
"change",
".",
"ResourceRecordSet",
".",
"ResourceRecords",
"=",
"make",
"(",
"[",
"]",
"*",
"route53",
".",
"ResourceRecord",
",",
"len",
"(",
"endpoint",
".",
"Targets",
")",
")",
"\n",
"for",
"idx",
",",
"val",
":=",
"range",
"endpoint",
".",
"Targets",
"{",
"change",
".",
"ResourceRecordSet",
".",
"ResourceRecords",
"[",
"idx",
"]",
"=",
"&",
"route53",
".",
"ResourceRecord",
"{",
"Value",
":",
"aws",
".",
"String",
"(",
"val",
")",
",",
"}",
"\n",
"}",
"\n",
"}",
"\n\n",
"return",
"change",
"\n",
"}"
] |
5,114 | all-5115 | [
"GetId",
"returns",
"the",
"Id",
"field",
"if",
"non",
"-",
"nil",
"zero",
"value",
"otherwise",
"."
] | [
"func",
"(",
"m",
"*",
"Monitor",
")",
"GetId",
"(",
")",
"int",
"{",
"if",
"m",
"==",
"nil",
"||",
"m",
".",
"Id",
"==",
"nil",
"{",
"return",
"0",
"\n",
"}",
"\n",
"return",
"*",
"m",
".",
"<mask>",
"\n",
"}"
] |
5,115 | all-5116 | [
"CompileResult",
"compiles",
"the",
"parsed",
"result",
"to",
"the",
"template",
".",
"Template",
"."
] | [
"func",
"CompileResult",
"(",
"name",
"string",
",",
"rslt",
"*",
"result",
",",
"opts",
"*",
"Options",
")",
"(",
"*",
"template",
".",
"Template",
",",
"error",
")",
"{",
"// Initialize the options.",
"opts",
"=",
"InitializeOptions",
"(",
"opts",
")",
"\n\n",
"// Create a template.",
"t",
":=",
"template",
".",
"New",
"(",
"<mask>",
")",
"\n\n",
"return",
"CompileResultWithTemplate",
"(",
"t",
",",
"rslt",
",",
"opts",
")",
"\n",
"}"
] |
5,116 | all-5117 | [
"ExtendsServicePrefix",
"returns",
"a",
"package",
"selector",
"(",
"if",
"any",
")",
"for",
"the",
"extended",
"service",
"."
] | [
"func",
"(",
"s",
"*",
"Service",
")",
"ExtendsServicePrefix",
"(",
")",
"string",
"{",
"if",
"dotIndex",
":=",
"strings",
".",
"<mask>",
"(",
"s",
".",
"Extends",
",",
"\"",
"\"",
")",
";",
"dotIndex",
">",
"0",
"{",
"return",
"s",
".",
"ExtendsPrefix",
"\n",
"}",
"\n",
"return",
"\"",
"\"",
"\n",
"}"
] |
5,117 | all-5118 | [
"NewDriver",
"creates",
"a",
"new",
"VirtualBox",
"driver",
"with",
"default",
"settings",
"."
] | [
"func",
"NewDriver",
"(",
"hostName",
",",
"storePath",
"<mask>",
")",
"*",
"Driver",
"{",
"return",
"&",
"Driver",
"{",
"VBoxManager",
":",
"NewVBoxManager",
"(",
")",
",",
"b2dUpdater",
":",
"NewB2DUpdater",
"(",
")",
",",
"sshKeyGenerator",
":",
"NewSSHKeyGenerator",
"(",
")",
",",
"diskCreator",
":",
"NewDiskCreator",
"(",
")",
",",
"logsReader",
":",
"NewLogsReader",
"(",
")",
",",
"ipWaiter",
":",
"NewIPWaiter",
"(",
")",
",",
"randomInter",
":",
"NewRandomInter",
"(",
")",
",",
"sleeper",
":",
"NewSleeper",
"(",
")",
",",
"HostInterfaces",
":",
"NewHostInterfaces",
"(",
")",
",",
"Memory",
":",
"defaultMemory",
",",
"CPU",
":",
"defaultCPU",
",",
"DiskSize",
":",
"defaultDiskSize",
",",
"NatNicType",
":",
"defaultHostOnlyNictype",
",",
"HostOnlyCIDR",
":",
"defaultHostOnlyCIDR",
",",
"HostOnlyNicType",
":",
"defaultHostOnlyNictype",
",",
"HostOnlyPromiscMode",
":",
"defaultHostOnlyPromiscMode",
",",
"UIType",
":",
"defaultUIType",
",",
"HostOnlyNoDHCP",
":",
"defaultHostOnlyNoDHCP",
",",
"DNSProxy",
":",
"defaultDNSProxy",
",",
"HostDNSResolver",
":",
"defaultDNSResolver",
",",
"BaseDriver",
":",
"&",
"drivers",
".",
"BaseDriver",
"{",
"MachineName",
":",
"hostName",
",",
"StorePath",
":",
"storePath",
",",
"}",
",",
"}",
"\n",
"}"
] |
5,118 | all-5119 | [
"DeactivateControls",
"makes",
"all",
"children",
"of",
"parent",
"inactive"
] | [
"func",
"DeactivateControls",
"(",
"parent",
"Control",
")",
"{",
"for",
"_",
",",
"ctrl",
":=",
"<mask>",
"parent",
".",
"Children",
"(",
")",
"{",
"if",
"ctrl",
".",
"Active",
"(",
")",
"{",
"ctrl",
".",
"SetActive",
"(",
"false",
")",
"\n",
"ctrl",
".",
"ProcessEvent",
"(",
"Event",
"{",
"Type",
":",
"EventActivate",
",",
"X",
":",
"0",
"}",
")",
"\n",
"}",
"\n\n",
"DeactivateControls",
"(",
"ctrl",
")",
"\n",
"}",
"\n",
"}"
] |
5,119 | all-5120 | [
"Find",
"a",
"router",
"with",
"the",
"specific",
"path",
"and",
"return",
"it",
"."
] | [
"func",
"(",
"rs",
"*",
"Routers",
")",
"Find",
"(",
"path",
"string",
")",
"(",
"url",
".",
"Values",
",",
"HandlerFunc",
",",
"view",
".",
"View",
")",
"{",
"defer",
"<mask>",
".",
"RUnlock",
"(",
")",
"\n",
"rs",
".",
"RLock",
"(",
")",
"\n",
"if",
"s",
",",
"ok",
":=",
"rs",
".",
"s",
"[",
"path",
"]",
";",
"ok",
"{",
"return",
"nil",
",",
"s",
".",
"h",
",",
"s",
".",
"v",
"\n",
"}",
"\n",
"for",
"e",
":=",
"rs",
".",
"l",
".",
"Front",
"(",
")",
";",
"e",
"!=",
"nil",
";",
"e",
"=",
"e",
".",
"Next",
"(",
")",
"{",
"s",
":=",
"e",
".",
"Value",
".",
"(",
"struct",
"{",
"r",
"router",
".",
"Router",
"\n",
"v",
"view",
".",
"View",
"\n",
"h",
"HandlerFunc",
"\n",
"}",
")",
"\n",
"if",
"params",
",",
"ok",
":=",
"s",
".",
"r",
".",
"Match",
"(",
"path",
")",
";",
"ok",
"{",
"return",
"params",
",",
"s",
".",
"h",
",",
"s",
".",
"v",
"\n",
"}",
"\n",
"}",
"\n",
"return",
"nil",
",",
"nil",
",",
"nil",
"\n",
"}"
] |
5,120 | all-5121 | [
"UnmarshalEasyJSON",
"satisfies",
"easyjson",
".",
"Unmarshaler",
"."
] | [
"func",
"(",
"t",
"*",
"TimeSinceEpoch",
")",
"UnmarshalEasyJSON",
"(",
"in",
"*",
"jlexer",
".",
"Lexer",
")",
"{",
"*",
"t",
"=",
"TimeSinceEpoch",
"(",
"time",
".",
"Unix",
"(",
"0",
",",
"int64",
"(",
"in",
".",
"Float64",
"(",
")",
"*",
"float64",
"(",
"<mask>",
".",
"Second",
")",
")",
")",
")",
"\n",
"}"
] |
5,121 | all-5122 | [
"resourceVSphereDRSVMOverrideObjects",
"handles",
"the",
"fetching",
"of",
"the",
"cluster",
"and",
"virtual",
"machine",
"depending",
"on",
"what",
"attributes",
"are",
"available",
":",
"*",
"If",
"the",
"resource",
"ID",
"is",
"available",
"the",
"data",
"is",
"derived",
"from",
"the",
"ID",
".",
"*",
"If",
"not",
"it",
"s",
"derived",
"from",
"the",
"compute_cluster_id",
"and",
"virtual_machine_id",
"attributes",
"."
] | [
"func",
"resourceVSphereDRSVMOverrideObjects",
"(",
"d",
"*",
"schema",
".",
"ResourceData",
",",
"meta",
"interface",
"{",
"}",
",",
")",
"(",
"*",
"<mask>",
".",
"ClusterComputeResource",
",",
"*",
"object",
".",
"VirtualMachine",
",",
"error",
")",
"{",
"if",
"d",
".",
"Id",
"(",
")",
"!=",
"\"",
"\"",
"{",
"return",
"resourceVSphereDRSVMOverrideObjectsFromID",
"(",
"d",
",",
"meta",
")",
"\n",
"}",
"\n",
"return",
"resourceVSphereDRSVMOverrideObjectsFromAttributes",
"(",
"d",
",",
"meta",
")",
"\n",
"}"
] |
5,122 | all-5123 | [
"SetDriverVersion",
"is",
"a",
"setter",
"for",
"nvidia",
"driver",
"version"
] | [
"func",
"(",
"n",
"*",
"NvidiaGPUManager",
")",
"SetDriverVersion",
"(",
"version",
"string",
")",
"{",
"n",
".",
"lock",
".",
"Lock",
"(",
")",
"\n",
"defer",
"n",
".",
"<mask>",
".",
"Unlock",
"(",
")",
"\n",
"n",
".",
"DriverVersion",
"=",
"version",
"\n",
"}"
] |
5,123 | all-5124 | [
"UnmarshalJSON",
"supports",
"json",
".",
"Unmarshaler",
"interface"
] | [
"func",
"(",
"v",
"*",
"EventDetachedFromTarget",
")",
"UnmarshalJSON",
"(",
"<mask>",
"[",
"]",
"byte",
")",
"error",
"{",
"r",
":=",
"jlexer",
".",
"Lexer",
"{",
"Data",
":",
"data",
"}",
"\n",
"easyjsonC5a4559bDecodeGithubComChromedpCdprotoTarget18",
"(",
"&",
"r",
",",
"v",
")",
"\n",
"return",
"r",
".",
"Error",
"(",
")",
"\n",
"}"
] |
5,124 | all-5125 | [
"SetMetaDataLabel",
"sets",
"an",
"annotation",
"value"
] | [
"func",
"SetMetaDataLabel",
"(",
"obj",
"metav1",
".",
"Object",
",",
"key",
",",
"value",
"string",
")",
"{",
"l",
":=",
"obj",
".",
"GetLabels",
"(",
")",
"\n",
"if",
"l",
"==",
"nil",
"{",
"l",
"=",
"make",
"(",
"map",
"[",
"string",
"]",
"string",
")",
"\n",
"}",
"\n",
"l",
"[",
"key",
"]",
"=",
"<mask>",
"\n",
"obj",
".",
"SetLabels",
"(",
"l",
")",
"\n",
"}"
] |
5,125 | all-5126 | [
"SetSizeRequest",
"is",
"a",
"wrapper",
"around",
"gtk_widget_set_size_request",
"()",
"."
] | [
"func",
"(",
"v",
"*",
"Widget",
")",
"SetSizeRequest",
"(",
"width",
",",
"height",
"int",
")",
"{",
"C",
".",
"gtk_widget_set_size_request",
"(",
"v",
".",
"native",
"(",
")",
",",
"C",
".",
"gint",
"(",
"<mask>",
")",
",",
"C",
".",
"gint",
"(",
"height",
")",
")",
"\n",
"}"
] |
5,126 | all-5127 | [
"start",
"but",
"do",
"not",
"wait",
"for",
"it",
"to",
"complete"
] | [
"func",
"(",
"srv",
"*",
"Server",
")",
"runEtcd",
"(",
")",
"error",
"{",
"errc",
":=",
"make",
"(",
"chan",
"error",
")",
"\n",
"go",
"func",
"(",
")",
"{",
"time",
".",
"Sleep",
"(",
"5",
"*",
"time",
".",
"Second",
")",
"\n",
"// server advertise client/peer listener had to start first",
"// before setting up proxy listener",
"errc",
"<-",
"srv",
".",
"startProxy",
"(",
")",
"\n",
"}",
"(",
")",
"\n\n",
"if",
"srv",
".",
"etcdCmd",
"!=",
"nil",
"{",
"srv",
".",
"lg",
".",
"Info",
"(",
"\"",
"\"",
",",
"zap",
".",
"String",
"(",
"\"",
"\"",
",",
"srv",
".",
"etcdCmd",
".",
"<mask>",
")",
",",
")",
"\n",
"err",
":=",
"srv",
".",
"etcdCmd",
".",
"Start",
"(",
")",
"\n",
"perr",
":=",
"<-",
"errc",
"\n",
"srv",
".",
"lg",
".",
"Info",
"(",
"\"",
"\"",
",",
"zap",
".",
"String",
"(",
"\"",
"\"",
",",
"srv",
".",
"etcdCmd",
".",
"Path",
")",
",",
"zap",
".",
"Errors",
"(",
"\"",
"\"",
",",
"[",
"]",
"error",
"{",
"err",
",",
"perr",
"}",
")",
",",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n",
"return",
"perr",
"\n",
"}",
"\n\n",
"select",
"{",
"case",
"<-",
"srv",
".",
"etcdServer",
".",
"Server",
".",
"ReadyNotify",
"(",
")",
":",
"srv",
".",
"lg",
".",
"Info",
"(",
"\"",
"\"",
")",
"\n",
"case",
"<-",
"time",
".",
"After",
"(",
"time",
".",
"Minute",
")",
":",
"srv",
".",
"etcdServer",
".",
"Close",
"(",
")",
"\n",
"return",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
",",
"<-",
"srv",
".",
"etcdServer",
".",
"Err",
"(",
")",
")",
"\n",
"}",
"\n",
"return",
"<-",
"errc",
"\n",
"}"
] |
5,127 | all-5128 | [
"===",
"hour",
"(",
"v",
"Vector",
")",
"Scalar",
"==="
] | [
"func",
"funcHour",
"(",
"vals",
"[",
"]",
"Value",
",",
"args",
"Expressions",
",",
"enh",
"*",
"EvalNodeHelper",
")",
"Vector",
"{",
"return",
"dateWrapper",
"(",
"vals",
",",
"enh",
",",
"func",
"(",
"t",
"<mask>",
".",
"Time",
")",
"float64",
"{",
"return",
"float64",
"(",
"t",
".",
"Hour",
"(",
")",
")",
"\n",
"}",
")",
"\n",
"}"
] |
5,128 | all-5129 | [
"MarshalJSON",
"supports",
"json",
".",
"Marshaler",
"interface"
] | [
"func",
"(",
"v",
"SetReturnValueParams",
")",
"MarshalJSON",
"(",
")",
"(",
"[",
"]",
"byte",
",",
"error",
")",
"{",
"w",
":=",
"jwriter",
".",
"Writer",
"{",
"}",
"\n",
"easyjsonC5a4559bEncodeGithubComChromedpCdprotoDebugger7",
"(",
"&",
"w",
",",
"v",
")",
"\n",
"return",
"w",
".",
"Buffer",
".",
"BuildBytes",
"(",
")",
",",
"w",
".",
"<mask>",
"\n",
"}"
] |
5,129 | all-5130 | [
"Start",
"worker"
] | [
"func",
"(",
"p",
"*",
"Whisper",
")",
"Start",
"(",
")",
"error",
"{",
"return",
"p",
".",
"StartFunc",
"(",
"func",
"(",
")",
"error",
"{",
"p",
".",
"throttleTicker",
"=",
"NewThrottleTicker",
"(",
"p",
".",
"maxUpdatesPerSecond",
")",
"\n",
"if",
"p",
".",
"hardMaxCreatesPerSecond",
"{",
"p",
".",
"maxCreatesTicker",
"=",
"NewHardThrottleTicker",
"(",
"p",
".",
"maxCreatesPerSecond",
")",
"\n",
"}",
"else",
"{",
"p",
".",
"maxCreatesTicker",
"=",
"NewThrottleTicker",
"(",
"p",
".",
"maxCreatesPerSecond",
")",
"\n",
"}",
"\n\n",
"for",
"i",
":=",
"0",
";",
"i",
"<",
"p",
".",
"workersCount",
";",
"i",
"++",
"{",
"p",
".",
"Go",
"(",
"p",
".",
"<mask>",
")",
"\n",
"}",
"\n\n",
"return",
"nil",
"\n",
"}",
")",
"\n",
"}"
] |
5,130 | all-5131 | [
"TODO",
":",
"cairo_set_font_matrix",
"TODO",
":",
"cairo_get_font_matrix",
"TODO",
":",
"cairo_set_font_options",
"TODO",
":",
"cairo_get_font_options",
"TODO",
":",
"cairo_set_font_face",
"TODO",
":",
"cairo_get_font_face",
"TODO",
":",
"cairo_set_scaled_font",
"TODO",
":",
"cairo_get_scaled_font"
] | [
"func",
"(",
"v",
"*",
"<mask>",
")",
"ShowText",
"(",
"utf8",
"string",
")",
"{",
"cstr",
":=",
"C",
".",
"CString",
"(",
"utf8",
")",
"\n",
"defer",
"C",
".",
"free",
"(",
"unsafe",
".",
"Pointer",
"(",
"cstr",
")",
")",
"\n",
"C",
".",
"cairo_show_text",
"(",
"v",
".",
"native",
"(",
")",
",",
"(",
"*",
"C",
".",
"char",
")",
"(",
"cstr",
")",
")",
"\n",
"}"
] |
5,131 | all-5132 | [
"SIGQUIT",
"to",
"exit",
"with",
"stackstrace"
] | [
"func",
"(",
"srv",
"*",
"Server",
")",
"stopEtcd",
"(",
"sig",
"os",
".",
"Signal",
")",
"error",
"{",
"srv",
".",
"stopProxy",
"(",
")",
"\n\n",
"if",
"srv",
".",
"etcdCmd",
"!=",
"nil",
"{",
"srv",
".",
"lg",
".",
"Info",
"(",
"\"",
"\"",
",",
"zap",
".",
"String",
"(",
"\"",
"\"",
",",
"srv",
".",
"etcdCmd",
".",
"Path",
")",
",",
"zap",
".",
"String",
"(",
"\"",
"\"",
",",
"sig",
".",
"String",
"(",
")",
")",
",",
")",
"\n\n",
"err",
":=",
"srv",
".",
"etcdCmd",
".",
"Process",
".",
"Signal",
"(",
"sig",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n\n",
"errc",
":=",
"make",
"(",
"chan",
"error",
")",
"\n",
"go",
"func",
"(",
")",
"{",
"_",
",",
"ew",
":=",
"srv",
".",
"etcdCmd",
".",
"Process",
".",
"Wait",
"(",
")",
"\n",
"errc",
"<-",
"ew",
"\n",
"close",
"(",
"errc",
")",
"\n",
"}",
"(",
")",
"\n\n",
"select",
"{",
"case",
"<-",
"time",
".",
"After",
"(",
"5",
"*",
"time",
".",
"Second",
")",
":",
"srv",
".",
"etcdCmd",
".",
"Process",
".",
"Kill",
"(",
")",
"\n",
"<mask>",
"e",
":=",
"<-",
"errc",
":",
"return",
"e",
"\n",
"}",
"\n\n",
"err",
"=",
"<-",
"errc",
"\n\n",
"srv",
".",
"lg",
".",
"Info",
"(",
"\"",
"\"",
",",
"zap",
".",
"String",
"(",
"\"",
"\"",
",",
"srv",
".",
"etcdCmd",
".",
"Path",
")",
",",
"zap",
".",
"String",
"(",
"\"",
"\"",
",",
"sig",
".",
"String",
"(",
")",
")",
",",
"zap",
".",
"Error",
"(",
"err",
")",
",",
")",
"\n",
"return",
"err",
"\n",
"}",
"\n\n",
"srv",
".",
"lg",
".",
"Info",
"(",
"\"",
"\"",
")",
"\n",
"srv",
".",
"etcdServer",
".",
"Server",
".",
"HardStop",
"(",
")",
"\n",
"srv",
".",
"etcdServer",
".",
"Close",
"(",
")",
"\n",
"srv",
".",
"lg",
".",
"Info",
"(",
"\"",
"\"",
")",
"\n",
"return",
"nil",
"\n",
"}"
] |
5,132 | all-5133 | [
"makeBroadcastRouteStatusSlice",
"takes",
"a",
"snapshot",
"of",
"the",
"broadcast",
"routes",
"in",
"routes",
"."
] | [
"func",
"makeBroadcastRouteStatusSlice",
"(",
"r",
"*",
"routes",
")",
"[",
"]",
"broadcastRouteStatus",
"{",
"r",
".",
"RLock",
"(",
")",
"\n",
"defer",
"r",
".",
"RUnlock",
"(",
")",
"\n\n",
"var",
"slice",
"[",
"]",
"broadcastRouteStatus",
"\n",
"for",
"source",
",",
"via",
":=",
"range",
"r",
".",
"broadcast",
"{",
"var",
"hops",
"[",
"]",
"string",
"\n",
"for",
"_",
",",
"hop",
":=",
"range",
"via",
"{",
"hops",
"=",
"append",
"(",
"hops",
",",
"hop",
".",
"String",
"(",
")",
")",
"\n",
"}",
"\n",
"slice",
"=",
"append",
"(",
"slice",
",",
"broadcastRouteStatus",
"{",
"source",
".",
"<mask>",
"(",
")",
",",
"hops",
"}",
")",
"\n",
"}",
"\n",
"return",
"slice",
"\n",
"}"
] |
5,133 | all-5134 | [
"String",
"returns",
"the",
"name",
"of",
"e"
] | [
"func",
"(",
"e",
"BucketEntryType",
")",
"String",
"(",
")",
"string",
"{",
"<mask>",
",",
"_",
":=",
"bucketEntryTypeMap",
"[",
"int32",
"(",
"e",
")",
"]",
"\n",
"return",
"name",
"\n",
"}"
] |
5,134 | all-5135 | [
"AddFlags",
"adds",
"comments",
"<comments",
">",
"to",
"the",
"command",
"help"
] | [
"func",
"(",
"c",
"*",
"CommentCounterPlugin",
")",
"AddFlags",
"(",
"cmd",
"*",
"cobra",
".",
"Command",
")",
"{",
"cmd",
".",
"Flags",
"(",
")",
".",
"StringSliceVar",
"(",
"&",
"c",
".",
"<mask>",
",",
"\"",
"\"",
",",
"[",
"]",
"string",
"{",
"}",
",",
"\"",
"\"",
")",
"\n",
"}"
] |
5,135 | all-5136 | [
"VisitAll",
"calls",
"f",
"for",
"each",
"existing",
"arg",
".",
"f",
"must",
"not",
"retain",
"references",
"to",
"key",
"and",
"value",
"after",
"returning",
".",
"Make",
"key",
"and",
"/",
"or",
"value",
"copies",
"if",
"you",
"need",
"storing",
"them",
"after",
"returning",
"."
] | [
"func",
"(",
"a",
"*",
"Args",
")",
"VisitAll",
"(",
"f",
"func",
"(",
"<mask>",
",",
"value",
"[",
"]",
"byte",
")",
")",
"{",
"visitArgs",
"(",
"a",
".",
"args",
",",
"f",
")",
"\n",
"}"
] |
5,136 | all-5137 | [
"SQLType",
"returns",
"the",
"SQL",
"type",
"of",
"the",
"v",
"for",
"PostgreSQL",
"."
] | [
"func",
"(",
"d",
"*",
"PostgresDialect",
")",
"SQLType",
"(",
"v",
"interface",
"{",
"}",
",",
"autoIncrement",
"bool",
",",
"size",
"uint64",
")",
"(",
"name",
"string",
",",
"allowNull",
"bool",
")",
"{",
"switch",
"v",
".",
"(",
"type",
")",
"{",
"case",
"bool",
":",
"return",
"\"",
"\"",
",",
"false",
"\n",
"case",
"*",
"bool",
",",
"sql",
".",
"NullBool",
":",
"return",
"\"",
"\"",
",",
"true",
"\n",
"case",
"int8",
",",
"int16",
",",
"uint8",
",",
"uint16",
":",
"return",
"d",
".",
"smallint",
"(",
"autoIncrement",
")",
",",
"false",
"\n",
"case",
"*",
"int8",
",",
"*",
"int16",
",",
"*",
"uint8",
",",
"*",
"uint16",
":",
"return",
"d",
".",
"smallint",
"(",
"autoIncrement",
")",
",",
"<mask>",
"\n",
"case",
"int",
",",
"int32",
",",
"uint",
",",
"uint32",
":",
"return",
"d",
".",
"integer",
"(",
"autoIncrement",
")",
",",
"false",
"\n",
"case",
"*",
"int",
",",
"*",
"int32",
",",
"*",
"uint",
",",
"*",
"uint32",
":",
"return",
"d",
".",
"integer",
"(",
"autoIncrement",
")",
",",
"true",
"\n",
"case",
"int64",
",",
"uint64",
":",
"return",
"d",
".",
"bigint",
"(",
"autoIncrement",
")",
",",
"false",
"\n",
"case",
"*",
"int64",
",",
"*",
"uint64",
",",
"sql",
".",
"NullInt64",
":",
"return",
"d",
".",
"bigint",
"(",
"autoIncrement",
")",
",",
"true",
"\n",
"case",
"string",
":",
"return",
"d",
".",
"varchar",
"(",
"size",
")",
",",
"false",
"\n",
"case",
"*",
"string",
",",
"sql",
".",
"NullString",
":",
"return",
"d",
".",
"varchar",
"(",
"size",
")",
",",
"true",
"\n",
"case",
"[",
"]",
"byte",
":",
"return",
"\"",
"\"",
",",
"true",
"\n",
"case",
"time",
".",
"Time",
":",
"return",
"\"",
"\"",
",",
"false",
"\n",
"case",
"*",
"time",
".",
"Time",
":",
"return",
"\"",
"\"",
",",
"true",
"\n",
"case",
"Rat",
":",
"return",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\"",
",",
"decimalPrecision",
",",
"decimalScale",
")",
",",
"false",
"\n",
"case",
"*",
"Rat",
":",
"return",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\"",
",",
"decimalPrecision",
",",
"decimalScale",
")",
",",
"true",
"\n",
"case",
"Float32",
",",
"Float64",
":",
"return",
"\"",
"\"",
",",
"false",
"\n",
"case",
"*",
"Float32",
",",
"*",
"Float64",
":",
"return",
"\"",
"\"",
",",
"true",
"\n",
"case",
"float32",
",",
"*",
"float32",
",",
"float64",
",",
"*",
"float64",
",",
"sql",
".",
"NullFloat64",
":",
"panic",
"(",
"ErrUsingFloatType",
")",
"\n",
"}",
"\n",
"panic",
"(",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
",",
"v",
")",
")",
"\n",
"}"
] |
5,137 | all-5138 | [
"A",
"client",
"implementation",
"of",
"the",
"PLAIN",
"authentication",
"mechanism",
"as",
"described",
"in",
"RFC",
"4616",
".",
"Authorization",
"identity",
"may",
"be",
"left",
"blank",
"to",
"indicate",
"that",
"it",
"is",
"the",
"same",
"as",
"the",
"username",
"."
] | [
"func",
"NewPlainClient",
"(",
"identity",
",",
"username",
",",
"password",
"string",
")",
"Client",
"{",
"return",
"&",
"plainClient",
"{",
"identity",
",",
"username",
",",
"<mask>",
"}",
"\n",
"}"
] |
5,138 | all-5139 | [
"Warn",
"calls",
"UI",
".",
"Warn",
"to",
"write",
".",
"Useful",
"when",
"you",
"want",
"separate",
"colors",
"or",
"prefixes",
".",
"WarnFGColor",
"and",
"WarnBGColor",
"are",
"used",
"for",
"color",
"."
] | [
"func",
"(",
"ui",
"*",
"ColorUI",
")",
"Warn",
"(",
"<mask>",
"string",
")",
"{",
"ct",
".",
"ChangeColor",
"(",
"ui",
".",
"WarnFGColor",
".",
"Code",
",",
"ui",
".",
"WarnFGColor",
".",
"Bright",
",",
"ui",
".",
"WarnBGColor",
".",
"Code",
",",
"ui",
".",
"WarnBGColor",
".",
"Bright",
")",
"\n",
"ui",
".",
"UI",
".",
"Warn",
"(",
"message",
")",
"\n",
"ct",
".",
"ResetColor",
"(",
")",
"\n",
"}"
] |
5,139 | all-5140 | [
"List",
"provides",
"a",
"mock",
"function",
"with",
"given",
"fields",
":",
"_a0",
"_a1",
"_a2",
"_a3",
"_a4"
] | [
"func",
"(",
"_m",
"*",
"InstrumentedStorage",
")",
"List",
"(",
"_a0",
"<mask>",
".",
"Context",
",",
"_a1",
"int64",
",",
"_a2",
"int64",
",",
"_a3",
"*",
"time",
".",
"Time",
",",
"_a4",
"*",
"time",
".",
"Time",
")",
"(",
"[",
"]",
"*",
"mnemosynerpc",
".",
"Session",
",",
"error",
")",
"{",
"ret",
":=",
"_m",
".",
"Called",
"(",
"_a0",
",",
"_a1",
",",
"_a2",
",",
"_a3",
",",
"_a4",
")",
"\n\n",
"var",
"r0",
"[",
"]",
"*",
"mnemosynerpc",
".",
"Session",
"\n",
"if",
"rf",
",",
"ok",
":=",
"ret",
".",
"Get",
"(",
"0",
")",
".",
"(",
"func",
"(",
"context",
".",
"Context",
",",
"int64",
",",
"int64",
",",
"*",
"time",
".",
"Time",
",",
"*",
"time",
".",
"Time",
")",
"[",
"]",
"*",
"mnemosynerpc",
".",
"Session",
")",
";",
"ok",
"{",
"r0",
"=",
"rf",
"(",
"_a0",
",",
"_a1",
",",
"_a2",
",",
"_a3",
",",
"_a4",
")",
"\n",
"}",
"else",
"{",
"if",
"ret",
".",
"Get",
"(",
"0",
")",
"!=",
"nil",
"{",
"r0",
"=",
"ret",
".",
"Get",
"(",
"0",
")",
".",
"(",
"[",
"]",
"*",
"mnemosynerpc",
".",
"Session",
")",
"\n",
"}",
"\n",
"}",
"\n\n",
"var",
"r1",
"error",
"\n",
"if",
"rf",
",",
"ok",
":=",
"ret",
".",
"Get",
"(",
"1",
")",
".",
"(",
"func",
"(",
"context",
".",
"Context",
",",
"int64",
",",
"int64",
",",
"*",
"time",
".",
"Time",
",",
"*",
"time",
".",
"Time",
")",
"error",
")",
";",
"ok",
"{",
"r1",
"=",
"rf",
"(",
"_a0",
",",
"_a1",
",",
"_a2",
",",
"_a3",
",",
"_a4",
")",
"\n",
"}",
"else",
"{",
"r1",
"=",
"ret",
".",
"Error",
"(",
"1",
")",
"\n",
"}",
"\n\n",
"return",
"r0",
",",
"r1",
"\n",
"}"
] |
5,140 | all-5141 | [
"NewReadWriteCloser",
"-",
"a",
"fake",
"readwritecloser",
"constructor"
] | [
"func",
"NewReadWriteCloser",
"(",
"readErr",
",",
"writeErr",
",",
"closeErr",
"<mask>",
")",
"*",
"MockReadWriteCloser",
"{",
"return",
"&",
"MockReadWriteCloser",
"{",
"ReadErr",
":",
"readErr",
",",
"WriteErr",
":",
"writeErr",
",",
"CloseErr",
":",
"closeErr",
",",
"}",
"\n",
"}"
] |
5,141 | all-5142 | [
"AcquireRequest",
"returns",
"an",
"empty",
"Request",
"instance",
"from",
"request",
"pool",
".",
"The",
"returned",
"Request",
"instance",
"may",
"be",
"passed",
"to",
"ReleaseRequest",
"when",
"it",
"is",
"no",
"longer",
"needed",
".",
"This",
"allows",
"Request",
"recycling",
"reduces",
"GC",
"pressure",
"and",
"usually",
"improves",
"performance",
"."
] | [
"func",
"AcquireRequest",
"(",
")",
"*",
"<mask>",
"{",
"v",
":=",
"requestPool",
".",
"Get",
"(",
")",
"\n",
"if",
"v",
"==",
"nil",
"{",
"return",
"&",
"Request",
"{",
"}",
"\n",
"}",
"\n",
"return",
"v",
".",
"(",
"*",
"Request",
")",
"\n",
"}"
] |
5,142 | all-5143 | [
"Infof",
"logs",
"a",
"formatted",
"line",
"with",
"an",
"INFO",
"prefix",
"."
] | [
"func",
"(",
"l",
"*",
"logger",
")",
"Infof",
"(",
"format",
"string",
",",
"vals",
"...",
"<mask>",
"{",
"}",
")",
"{",
"l",
".",
"mut",
".",
"Lock",
"(",
")",
"\n",
"defer",
"l",
".",
"mut",
".",
"Unlock",
"(",
")",
"\n",
"s",
":=",
"fmt",
".",
"Sprintf",
"(",
"format",
",",
"vals",
"...",
")",
"\n",
"l",
".",
"logger",
".",
"Output",
"(",
"2",
",",
"\"",
"\"",
"+",
"s",
")",
"\n",
"l",
".",
"callHandlers",
"(",
"LevelInfo",
",",
"s",
")",
"\n",
"}"
] |
5,143 | all-5144 | [
"RemoveTask",
"mocks",
"base",
"method"
] | [
"func",
"(",
"m",
"*",
"MockTaskEngineState",
")",
"RemoveTask",
"(",
"arg0",
"*",
"task",
".",
"<mask>",
")",
"{",
"m",
".",
"ctrl",
".",
"Call",
"(",
"m",
",",
"\"",
"\"",
",",
"arg0",
")",
"\n",
"}"
] |
5,144 | all-5145 | [
"AddTrigger",
"adds",
"a",
"trigger",
"to",
"the",
"bot",
"s",
"handlers"
] | [
"func",
"(",
"bot",
"*",
"Bot",
")",
"AddTrigger",
"(",
"h",
"Handler",
")",
"{",
"<mask>",
".",
"handlers",
"=",
"append",
"(",
"bot",
".",
"handlers",
",",
"h",
")",
"\n",
"}"
] |
5,145 | all-5146 | [
"OAuthConsumerKey",
"returns",
"the",
"OAuth",
"consumer",
"key",
"provided",
"with",
"the",
"current",
"request",
".",
"This",
"method",
"will",
"return",
"an",
"error",
"if",
"the",
"OAuth",
"request",
"was",
"invalid",
"."
] | [
"func",
"OAuthConsumerKey",
"(",
"c",
"context",
".",
"Context",
")",
"(",
"string",
",",
"error",
")",
"{",
"req",
":=",
"&",
"pb",
".",
"CheckOAuthSignatureRequest",
"{",
"}",
"\n",
"res",
":=",
"&",
"pb",
".",
"CheckOAuthSignatureResponse",
"{",
"}",
"\n\n",
"err",
":=",
"internal",
".",
"Call",
"(",
"c",
",",
"\"",
"\"",
",",
"\"",
"\"",
",",
"req",
",",
"<mask>",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"\"",
"\"",
",",
"err",
"\n",
"}",
"\n",
"return",
"*",
"res",
".",
"OauthConsumerKey",
",",
"err",
"\n",
"}"
] |
5,146 | all-5147 | [
"cafiles",
"returns",
"a",
"list",
"of",
"CA",
"file",
"paths",
"."
] | [
"func",
"(",
"info",
"TLSInfo",
")",
"cafiles",
"(",
")",
"[",
"]",
"string",
"{",
"<mask>",
":=",
"make",
"(",
"[",
"]",
"string",
",",
"0",
")",
"\n",
"if",
"info",
".",
"TrustedCAFile",
"!=",
"\"",
"\"",
"{",
"cs",
"=",
"append",
"(",
"cs",
",",
"info",
".",
"TrustedCAFile",
")",
"\n",
"}",
"\n",
"return",
"cs",
"\n",
"}"
] |
5,147 | all-5148 | [
"SetSourceRGB",
"is",
"a",
"wrapper",
"around",
"cairo_set_source_rgb",
"()",
"."
] | [
"func",
"(",
"v",
"*",
"Context",
")",
"SetSourceRGB",
"(",
"red",
",",
"green",
",",
"blue",
"float64",
")",
"{",
"C",
".",
"cairo_set_source_rgb",
"(",
"v",
".",
"native",
"(",
")",
",",
"C",
".",
"double",
"(",
"<mask>",
")",
",",
"C",
".",
"double",
"(",
"green",
")",
",",
"C",
".",
"double",
"(",
"blue",
")",
")",
"\n",
"}"
] |
5,148 | all-5149 | [
"Do",
"executes",
"Target",
".",
"detachFromTarget",
"against",
"the",
"provided",
"context",
"."
] | [
"func",
"(",
"p",
"*",
"DetachFromTargetParams",
")",
"Do",
"(",
"ctx",
"context",
".",
"<mask>",
")",
"(",
"err",
"error",
")",
"{",
"return",
"cdp",
".",
"Execute",
"(",
"ctx",
",",
"CommandDetachFromTarget",
",",
"p",
",",
"nil",
")",
"\n",
"}"
] |
5,149 | all-5150 | [
"native",
"returns",
"a",
"pointer",
"to",
"the",
"underlying",
"GtkRevealer",
"."
] | [
"func",
"(",
"v",
"*",
"Revealer",
")",
"native",
"(",
")",
"*",
"C",
".",
"GtkRevealer",
"{",
"if",
"v",
"==",
"nil",
"||",
"v",
".",
"GObject",
"==",
"nil",
"{",
"<mask>",
"nil",
"\n",
"}",
"\n",
"p",
":=",
"unsafe",
".",
"Pointer",
"(",
"v",
".",
"GObject",
")",
"\n",
"return",
"C",
".",
"toGtkRevealer",
"(",
"p",
")",
"\n",
"}"
] |
5,150 | all-5151 | [
"MarshalJSON",
"supports",
"json",
".",
"Marshaler",
"interface"
] | [
"func",
"(",
"v",
"SetCacheDisabledParams",
")",
"MarshalJSON",
"(",
")",
"(",
"[",
"]",
"byte",
",",
"error",
")",
"{",
"w",
":=",
"jwriter",
".",
"Writer",
"{",
"}",
"\n",
"easyjsonC5a4559bEncodeGithubComChromedpCdprotoNetwork16",
"(",
"&",
"w",
",",
"v",
")",
"\n",
"return",
"w",
".",
"Buffer",
".",
"BuildBytes",
"(",
")",
",",
"w",
".",
"<mask>",
"\n",
"}"
] |
5,151 | all-5152 | [
"ToSlice",
"places",
"all",
"iterated",
"over",
"values",
"in",
"a",
"Slice",
"for",
"easy",
"consumption",
"."
] | [
"func",
"(",
"iter",
"Enumerator",
")",
"ToSlice",
"(",
")",
"[",
"]",
"interface",
"{",
"}",
"{",
"retval",
":=",
"make",
"(",
"[",
"]",
"interface",
"{",
"}",
",",
"0",
")",
"\n",
"for",
"entry",
":=",
"range",
"iter",
"{",
"retval",
"=",
"append",
"(",
"retval",
",",
"<mask>",
")",
"\n",
"}",
"\n",
"return",
"retval",
"\n",
"}"
] |
5,152 | all-5153 | [
"inject",
"an",
"application",
"-",
"supplied",
"message",
"into",
"the",
"debug",
"message",
"queue"
] | [
"func",
"DebugMessageInsert",
"(",
"source",
"uint32",
",",
"xtype",
"uint32",
",",
"<mask>",
"uint32",
",",
"severity",
"uint32",
",",
"length",
"int32",
",",
"buf",
"*",
"uint8",
")",
"{",
"syscall",
".",
"Syscall6",
"(",
"gpDebugMessageInsert",
",",
"6",
",",
"uintptr",
"(",
"source",
")",
",",
"uintptr",
"(",
"xtype",
")",
",",
"uintptr",
"(",
"id",
")",
",",
"uintptr",
"(",
"severity",
")",
",",
"uintptr",
"(",
"length",
")",
",",
"uintptr",
"(",
"unsafe",
".",
"Pointer",
"(",
"buf",
")",
")",
")",
"\n",
"}"
] |
5,153 | all-5154 | [
"NoCache",
"called",
"when",
"a",
"particular",
"handler",
"is",
"not",
"valid",
"for",
"cache",
".",
"If",
"this",
"function",
"called",
"inside",
"a",
"handler",
"then",
"the",
"handler",
"is",
"not",
"cached",
"."
] | [
"func",
"NoCache",
"(",
"reqCtx",
"*",
"fasthttp",
".",
"RequestCtx",
")",
"{",
"reqCtx",
".",
"Response",
".",
"Header",
".",
"<mask>",
"(",
"cfg",
".",
"NoCacheHeader",
",",
"\"",
"\"",
")",
"\n",
"}"
] |
5,154 | all-5155 | [
"Replace",
"the",
"parent",
"EncodeJson",
"to",
"provide",
"indentation",
"."
] | [
"func",
"(",
"w",
"*",
"jsonIndentResponseWriter",
")",
"EncodeJson",
"(",
"v",
"interface",
"{",
"}",
")",
"(",
"[",
"]",
"byte",
",",
"error",
")",
"{",
"b",
",",
"err",
":=",
"json",
".",
"MarshalIndent",
"(",
"v",
",",
"w",
".",
"<mask>",
",",
"w",
".",
"indent",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n",
"return",
"b",
",",
"nil",
"\n",
"}"
] |
5,155 | all-5156 | [
"SetNumInstances",
"sets",
"the",
"number",
"of",
"instances",
"of",
"the",
"given",
"module",
".",
"version",
"to",
"the",
"specified",
"value",
".",
"If",
"either",
"module",
"or",
"version",
"are",
"the",
"empty",
"string",
"it",
"means",
"the",
"default",
"."
] | [
"func",
"SetNumInstances",
"(",
"c",
"context",
".",
"Context",
",",
"module",
",",
"version",
"string",
",",
"instances",
"int",
")",
"error",
"{",
"req",
":=",
"&",
"<mask>",
".",
"SetNumInstancesRequest",
"{",
"}",
"\n",
"if",
"module",
"!=",
"\"",
"\"",
"{",
"req",
".",
"Module",
"=",
"&",
"module",
"\n",
"}",
"\n",
"if",
"version",
"!=",
"\"",
"\"",
"{",
"req",
".",
"Version",
"=",
"&",
"version",
"\n",
"}",
"\n",
"req",
".",
"Instances",
"=",
"proto",
".",
"Int64",
"(",
"int64",
"(",
"instances",
")",
")",
"\n",
"res",
":=",
"&",
"pb",
".",
"SetNumInstancesResponse",
"{",
"}",
"\n",
"return",
"internal",
".",
"Call",
"(",
"c",
",",
"\"",
"\"",
",",
"\"",
"\"",
",",
"req",
",",
"res",
")",
"\n",
"}"
] |
5,156 | all-5157 | [
"FromBytes",
"creates",
"a",
"new",
"UUID",
"from",
"a",
"byte",
"slice",
".",
"Returns",
"an",
"error",
"if",
"the",
"slice",
"does",
"not",
"have",
"a",
"length",
"of",
"16",
".",
"The",
"bytes",
"are",
"copied",
"from",
"the",
"slice",
"."
] | [
"func",
"FromBytes",
"(",
"b",
"[",
"]",
"<mask>",
")",
"(",
"uuid",
"UUID",
",",
"err",
"error",
")",
"{",
"err",
"=",
"uuid",
".",
"UnmarshalBinary",
"(",
"b",
")",
"\n",
"return",
"uuid",
",",
"err",
"\n",
"}"
] |
5,157 | all-5158 | [
"select",
"a",
"polygon",
"rasterization",
"mode"
] | [
"func",
"PolygonMode",
"(",
"face",
"uint32",
",",
"<mask>",
"uint32",
")",
"{",
"C",
".",
"glowPolygonMode",
"(",
"gpPolygonMode",
",",
"(",
"C",
".",
"GLenum",
")",
"(",
"face",
")",
",",
"(",
"C",
".",
"GLenum",
")",
"(",
"mode",
")",
")",
"\n",
"}"
] |
5,158 | all-5159 | [
"/",
"*",
"Infof",
"uses",
"msg",
"as",
"a",
"format",
"string",
"with",
"subsequent",
"parameters",
"as",
"values",
"and",
"logs",
"the",
"resulting",
"message",
"to",
"all",
"added",
"loggers",
"at",
"LogLevel",
".",
"LevelInfo"
] | [
"func",
"(",
"la",
"*",
"LogAdapter",
")",
"Infof",
"(",
"msg",
"string",
",",
"a",
"...",
"interface",
"{",
"}",
")",
"error",
"{",
"return",
"la",
".",
"<mask>",
"(",
"LevelInfo",
",",
"nil",
",",
"msg",
",",
"a",
"...",
")",
"\n",
"}"
] |
5,159 | all-5160 | [
"ListCollaborators",
"gets",
"a",
"list",
"of",
"all",
"users",
"who",
"have",
"access",
"to",
"a",
"repo",
"(",
"and",
"can",
"become",
"assignees",
"or",
"requested",
"reviewers",
")",
".",
"See",
"IsCollaborator",
"for",
"more",
"details",
".",
"See",
"https",
":",
"//",
"developer",
".",
"github",
".",
"com",
"/",
"v3",
"/",
"repos",
"/",
"collaborators",
"/"
] | [
"func",
"(",
"c",
"*",
"Client",
")",
"ListCollaborators",
"(",
"org",
",",
"repo",
"string",
")",
"(",
"[",
"]",
"User",
",",
"error",
")",
"{",
"c",
".",
"log",
"(",
"\"",
"\"",
",",
"org",
",",
"repo",
")",
"\n",
"if",
"c",
".",
"fake",
"{",
"return",
"nil",
",",
"nil",
"\n",
"}",
"\n",
"path",
":=",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\"",
",",
"org",
",",
"repo",
")",
"\n",
"var",
"users",
"[",
"]",
"User",
"\n",
"err",
":=",
"c",
".",
"readPaginatedResults",
"(",
"path",
",",
"// This accept header enables the nested teams preview.",
"// https://developer.github.com/changes/2017-08-30-preview-nested-teams/",
"\"",
"\"",
",",
"func",
"(",
")",
"interface",
"{",
"}",
"{",
"return",
"&",
"[",
"]",
"User",
"{",
"}",
"\n",
"}",
",",
"func",
"(",
"obj",
"interface",
"{",
"}",
")",
"{",
"users",
"=",
"append",
"(",
"users",
",",
"*",
"(",
"obj",
".",
"(",
"*",
"[",
"]",
"User",
")",
")",
"...",
")",
"\n",
"}",
",",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n",
"return",
"<mask>",
",",
"nil",
"\n",
"}"
] |
5,160 | all-5161 | [
"GetText",
"indicates",
"an",
"expected",
"call",
"of",
"GetText"
] | [
"func",
"(",
"mr",
"*",
"MockLicenseProviderMockRecorder",
")",
"GetText",
"(",
")",
"*",
"gomock",
".",
"Call",
"{",
"<mask>",
"mr",
".",
"mock",
".",
"ctrl",
".",
"RecordCallWithMethodType",
"(",
"mr",
".",
"mock",
",",
"\"",
"\"",
",",
"reflect",
".",
"TypeOf",
"(",
"(",
"*",
"MockLicenseProvider",
")",
"(",
"nil",
")",
".",
"GetText",
")",
")",
"\n",
"}"
] |
5,161 | all-5162 | [
"Lex",
"returns",
"the",
"next",
"token",
"form",
"the",
"Tokenizer",
".",
"This",
"function",
"is",
"used",
"by",
"go",
"yacc",
"."
] | [
"func",
"(",
"tkn",
"*",
"Tokenizer",
")",
"Lex",
"(",
"lval",
"*",
"yySymType",
")",
"int",
"{",
"typ",
",",
"val",
":=",
"tkn",
".",
"Scan",
"(",
")",
"\n",
"for",
"typ",
"==",
"COMMENT",
"{",
"if",
"tkn",
".",
"AllowComments",
"{",
"break",
"\n",
"}",
"\n",
"typ",
",",
"val",
"=",
"tkn",
".",
"Scan",
"(",
")",
"\n",
"}",
"\n",
"lval",
".",
"<mask>",
"=",
"val",
"\n",
"tkn",
".",
"lastToken",
"=",
"val",
"\n",
"return",
"typ",
"\n",
"}"
] |
5,162 | all-5163 | [
"gboolean",
"pango_color_parse",
"(",
"PangoColor",
"*",
"color",
"const",
"char",
"*",
"spec",
")",
";"
] | [
"func",
"(",
"v",
"*",
"Color",
")",
"Parse",
"(",
"spec",
"string",
")",
"bool",
"{",
"cstr",
":=",
"C",
".",
"CString",
"(",
"spec",
")",
"\n",
"defer",
"C",
".",
"free",
"(",
"unsafe",
".",
"Pointer",
"(",
"cstr",
")",
")",
"\n",
"c",
":=",
"C",
".",
"pango_color_parse",
"(",
"v",
".",
"native",
"(",
")",
",",
"(",
"*",
"C",
".",
"<mask>",
")",
"(",
"cstr",
")",
")",
"\n",
"return",
"gobool",
"(",
"c",
")",
"\n",
"}"
] |
5,163 | all-5164 | [
"RegisterMachine",
"registers",
"an",
"iaas",
".",
"Machine",
"as",
"an",
"Machine",
"and",
"a",
"host",
"on",
"the",
"current",
"running",
"DockerMachine",
".",
"It",
"expects",
"all",
"data",
"needed",
"to",
"Marshal",
"the",
"host",
"/",
"driver",
"to",
"be",
"available",
"on",
"CustomData",
"."
] | [
"func",
"(",
"d",
"*",
"DockerMachine",
")",
"RegisterMachine",
"(",
"opts",
"RegisterMachineOpts",
")",
"(",
"*",
"Machine",
",",
"error",
")",
"{",
"if",
"!",
"d",
".",
"temp",
"{",
"return",
"nil",
",",
"errors",
".",
"New",
"(",
"\"",
"\"",
")",
"\n",
"}",
"\n",
"if",
"opts",
".",
"Base",
".",
"CustomData",
"==",
"nil",
"{",
"return",
"nil",
",",
"errors",
".",
"New",
"(",
"\"",
"\"",
")",
"\n",
"}",
"\n",
"opts",
".",
"Base",
".",
"CustomData",
"[",
"\"",
"\"",
"]",
"=",
"filepath",
".",
"Join",
"(",
"d",
".",
"client",
".",
"GetMachinesDir",
"(",
")",
",",
"opts",
".",
"Base",
".",
"Id",
",",
"\"",
"\"",
")",
"\n",
"rawDriver",
",",
"err",
":=",
"json",
".",
"Marshal",
"(",
"opts",
".",
"<mask>",
".",
"CustomData",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"errors",
".",
"WithMessage",
"(",
"err",
",",
"\"",
"\"",
")",
"\n",
"}",
"\n",
"h",
",",
"err",
":=",
"d",
".",
"client",
".",
"NewHost",
"(",
"opts",
".",
"DriverName",
",",
"rawDriver",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"errors",
".",
"WithStack",
"(",
"err",
")",
"\n",
"}",
"\n",
"err",
"=",
"ioutil",
".",
"WriteFile",
"(",
"h",
".",
"Driver",
".",
"GetSSHKeyPath",
"(",
")",
",",
"opts",
".",
"SSHPrivateKey",
",",
"0700",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"errors",
".",
"WithStack",
"(",
"err",
")",
"\n",
"}",
"\n",
"err",
"=",
"ioutil",
".",
"WriteFile",
"(",
"h",
".",
"AuthOptions",
"(",
")",
".",
"CaCertPath",
",",
"opts",
".",
"Base",
".",
"CaCert",
",",
"0700",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"errors",
".",
"WithStack",
"(",
"err",
")",
"\n",
"}",
"\n",
"err",
"=",
"ioutil",
".",
"WriteFile",
"(",
"h",
".",
"AuthOptions",
"(",
")",
".",
"ClientCertPath",
",",
"opts",
".",
"Base",
".",
"ClientCert",
",",
"0700",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"errors",
".",
"WithStack",
"(",
"err",
")",
"\n",
"}",
"\n",
"err",
"=",
"ioutil",
".",
"WriteFile",
"(",
"h",
".",
"AuthOptions",
"(",
")",
".",
"ClientKeyPath",
",",
"opts",
".",
"Base",
".",
"ClientKey",
",",
"0700",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"errors",
".",
"WithStack",
"(",
"err",
")",
"\n",
"}",
"\n",
"err",
"=",
"d",
".",
"client",
".",
"Save",
"(",
"h",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"errors",
".",
"WithStack",
"(",
"err",
")",
"\n",
"}",
"\n",
"savedHost",
",",
"err",
":=",
"d",
".",
"client",
".",
"Load",
"(",
"h",
".",
"Name",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"errors",
".",
"WithStack",
"(",
"err",
")",
"\n",
"}",
"\n",
"return",
"&",
"Machine",
"{",
"Base",
":",
"opts",
".",
"Base",
",",
"Host",
":",
"savedHost",
",",
"}",
",",
"nil",
"\n",
"}"
] |
5,164 | all-5165 | [
"DestructivelyPrioritizeReplacementCandidates",
"consumes",
"AND",
"DESTROYS",
"an",
"array",
"of",
"possible",
"replacement",
"candidates",
"with",
"their",
"last",
"known",
"existence",
"times",
"the",
"primary",
"digest",
"the",
"user",
"actually",
"asked",
"for",
"and",
"the",
"corresponding",
"uncompressed",
"digest",
"(",
"if",
"known",
"possibly",
"equal",
"to",
"the",
"primary",
"digest",
")",
"and",
"returns",
"an",
"appropriately",
"prioritized",
"and",
"/",
"or",
"trimmed",
"result",
"suitable",
"for",
"a",
"return",
"value",
"from",
"types",
".",
"BlobInfoCache",
".",
"CandidateLocations",
".",
"WARNING",
":",
"The",
"array",
"of",
"candidates",
"is",
"destructively",
"modified",
".",
"(",
"The",
"implementation",
"of",
"this",
"function",
"could",
"of",
"course",
"make",
"a",
"copy",
"but",
"all",
"CandidateLocations",
"implementations",
"build",
"the",
"slice",
"of",
"candidates",
"only",
"for",
"the",
"single",
"purpose",
"of",
"calling",
"this",
"function",
"anyway",
".",
")"
] | [
"func",
"DestructivelyPrioritizeReplacementCandidates",
"(",
"cs",
"[",
"]",
"CandidateWithTime",
",",
"primaryDigest",
",",
"uncompressedDigest",
"digest",
".",
"Digest",
")",
"[",
"]",
"<mask>",
".",
"BICReplacementCandidate",
"{",
"return",
"destructivelyPrioritizeReplacementCandidatesWithMax",
"(",
"cs",
",",
"primaryDigest",
",",
"uncompressedDigest",
",",
"replacementAttempts",
")",
"\n",
"}"
] |
5,165 | all-5166 | [
"HasCheck",
"returns",
"a",
"boolean",
"if",
"a",
"field",
"has",
"been",
"set",
"."
] | [
"func",
"(",
"c",
"*",
"CheckStatusDefinition",
")",
"HasCheck",
"(",
")",
"bool",
"{",
"if",
"c",
"!=",
"nil",
"&&",
"c",
".",
"Check",
"!=",
"nil",
"{",
"return",
"true",
"\n",
"}",
"\n\n",
"return",
"<mask>",
"\n",
"}"
] |
5,166 | all-5167 | [
"Warningf",
"logs",
"a",
"WARNING",
"message",
"to",
"the",
"logger",
"specified",
"in",
"opts",
"."
] | [
"func",
"(",
"<mask>",
"*",
"Options",
")",
"Debugf",
"(",
"format",
"string",
",",
"v",
"...",
"interface",
"{",
"}",
")",
"{",
"if",
"opt",
".",
"Logger",
"==",
"nil",
"{",
"return",
"\n",
"}",
"\n",
"opt",
".",
"Logger",
".",
"Debugf",
"(",
"format",
",",
"v",
"...",
")",
"\n",
"}"
] |
5,167 | all-5168 | [
"Sample",
"implements",
"instruments",
".",
"Reporter"
] | [
"func",
"(",
"r",
"*",
"Reporter",
")",
"Sample",
"(",
"name",
"string",
",",
"<mask>",
"[",
"]",
"string",
",",
"dist",
"instruments",
".",
"Distribution",
")",
"error",
"{",
"r",
".",
"Metric",
"(",
"name",
"+",
"\"",
"\"",
",",
"tags",
",",
"float32",
"(",
"dist",
".",
"Quantile",
"(",
"0.95",
")",
")",
")",
"\n",
"r",
".",
"Metric",
"(",
"name",
"+",
"\"",
"\"",
",",
"tags",
",",
"float32",
"(",
"dist",
".",
"Quantile",
"(",
"0.99",
")",
")",
")",
"\n",
"return",
"nil",
"\n",
"}"
] |
5,168 | all-5169 | [
"GetEntries",
"walks",
"the",
"cache",
"dir",
"and",
"returns",
"all",
"paths",
"that",
"exist",
"In",
"the",
"future",
"this",
"*",
"may",
"*",
"be",
"made",
"smarter"
] | [
"func",
"(",
"c",
"*",
"Cache",
")",
"GetEntries",
"(",
")",
"[",
"]",
"EntryInfo",
"{",
"entries",
":=",
"[",
"]",
"EntryInfo",
"{",
"}",
"\n",
"// note we swallow errors because we just need to know what keys exist",
"// some keys missing is OK since this is used for eviction, but not returning",
"// any of the keys due to some error is NOT",
"_",
"=",
"filepath",
".",
"Walk",
"(",
"c",
".",
"diskRoot",
",",
"func",
"(",
"path",
"string",
",",
"f",
"os",
".",
"FileInfo",
",",
"err",
"error",
")",
"error",
"{",
"if",
"err",
"!=",
"nil",
"{",
"logrus",
".",
"WithError",
"(",
"err",
")",
".",
"Error",
"(",
"\"",
"\"",
")",
"\n",
"return",
"nil",
"\n",
"}",
"\n",
"if",
"!",
"f",
".",
"IsDir",
"(",
")",
"{",
"atime",
":=",
"diskutil",
".",
"GetATime",
"(",
"path",
",",
"time",
".",
"Now",
"(",
")",
")",
"\n",
"entries",
"=",
"append",
"(",
"entries",
",",
"EntryInfo",
"{",
"Path",
":",
"<mask>",
",",
"LastAccess",
":",
"atime",
",",
"}",
")",
"\n",
"}",
"\n",
"return",
"nil",
"\n",
"}",
")",
"\n",
"return",
"entries",
"\n",
"}"
] |
5,169 | all-5170 | [
"CanonicalLink",
"gets",
"a",
"link",
"to",
"the",
"location",
"of",
"job",
"-",
"specific",
"artifacts",
"in",
"GCS"
] | [
"func",
"(",
"src",
"*",
"gcsJobSource",
")",
"canonicalLink",
"(",
")",
"string",
"{",
"return",
"<mask>",
".",
"Join",
"(",
"src",
".",
"linkPrefix",
",",
"src",
".",
"bucket",
",",
"src",
".",
"jobPrefix",
")",
"\n",
"}"
] |
5,170 | all-5171 | [
"SetAppMenu",
"is",
"a",
"wrapper",
"around",
"gtk_application_set_app_menu",
"()",
"."
] | [
"func",
"(",
"v",
"*",
"<mask>",
")",
"SetAppMenu",
"(",
"m",
"*",
"glib",
".",
"MenuModel",
")",
"{",
"mptr",
":=",
"(",
"*",
"C",
".",
"GMenuModel",
")",
"(",
"unsafe",
".",
"Pointer",
"(",
"m",
".",
"Native",
"(",
")",
")",
")",
"\n",
"C",
".",
"gtk_application_set_app_menu",
"(",
"v",
".",
"native",
"(",
")",
",",
"mptr",
")",
"\n",
"}"
] |
5,171 | all-5172 | [
"Configure",
"logging"
] | [
"func",
"(",
"p",
"*",
"Pact",
")",
"setupLogging",
"(",
")",
"{",
"if",
"p",
".",
"logFilter",
"==",
"nil",
"{",
"if",
"p",
".",
"LogLevel",
"==",
"\"",
"\"",
"{",
"p",
".",
"LogLevel",
"=",
"\"",
"\"",
"\n",
"}",
"\n",
"p",
".",
"logFilter",
"=",
"&",
"logutils",
".",
"LevelFilter",
"{",
"Levels",
":",
"[",
"]",
"logutils",
".",
"LogLevel",
"{",
"\"",
"\"",
",",
"\"",
"\"",
",",
"\"",
"\"",
",",
"\"",
"\"",
"}",
",",
"MinLevel",
":",
"logutils",
".",
"LogLevel",
"(",
"p",
".",
"LogLevel",
")",
",",
"Writer",
":",
"os",
".",
"Stderr",
",",
"}",
"\n",
"<mask>",
".",
"SetOutput",
"(",
"p",
".",
"logFilter",
")",
"\n",
"}",
"\n",
"log",
".",
"Println",
"(",
"\"",
"\"",
")",
"\n",
"}"
] |
5,172 | all-5173 | [
"mergePassInto",
"merges",
"a",
"single",
"pass",
"into",
"a",
"full",
"sized",
"image",
"."
] | [
"func",
"(",
"d",
"*",
"decoder",
")",
"mergePassInto",
"(",
"dst",
"image",
".",
"Image",
",",
"src",
"image",
".",
"Image",
",",
"pass",
"int",
")",
"{",
"p",
":=",
"interlacing",
"[",
"pass",
"]",
"\n",
"var",
"(",
"srcPix",
"[",
"]",
"uint8",
"\n",
"dstPix",
"[",
"]",
"uint8",
"\n",
"stride",
"int",
"\n",
"rect",
"image",
".",
"Rectangle",
"\n",
"bytesPerPixel",
"int",
"\n",
")",
"\n",
"switch",
"target",
":=",
"dst",
".",
"(",
"type",
")",
"{",
"case",
"*",
"image",
".",
"Alpha",
":",
"srcPix",
"=",
"src",
".",
"(",
"*",
"image",
".",
"Alpha",
")",
".",
"Pix",
"\n",
"dstPix",
",",
"stride",
",",
"rect",
"=",
"target",
".",
"Pix",
",",
"target",
".",
"Stride",
",",
"target",
".",
"Rect",
"\n",
"bytesPerPixel",
"=",
"1",
"\n",
"case",
"*",
"image",
".",
"Alpha16",
":",
"srcPix",
"=",
"src",
".",
"(",
"*",
"image",
".",
"Alpha16",
")",
".",
"Pix",
"\n",
"dstPix",
",",
"stride",
",",
"rect",
"=",
"target",
".",
"Pix",
",",
"target",
".",
"Stride",
",",
"target",
".",
"Rect",
"\n",
"bytesPerPixel",
"=",
"2",
"\n",
"case",
"*",
"image",
".",
"Gray",
":",
"srcPix",
"=",
"src",
".",
"(",
"*",
"image",
".",
"Gray",
")",
".",
"Pix",
"\n",
"dstPix",
",",
"stride",
",",
"rect",
"=",
"target",
".",
"Pix",
",",
"target",
".",
"Stride",
",",
"target",
".",
"Rect",
"\n",
"bytesPerPixel",
"=",
"1",
"\n",
"case",
"*",
"image",
".",
"Gray16",
":",
"srcPix",
"=",
"src",
".",
"(",
"*",
"image",
".",
"Gray16",
")",
".",
"Pix",
"\n",
"dstPix",
",",
"stride",
",",
"rect",
"=",
"target",
".",
"Pix",
",",
"target",
".",
"Stride",
",",
"target",
".",
"Rect",
"\n",
"bytesPerPixel",
"=",
"2",
"\n",
"case",
"*",
"image",
".",
"NRGBA",
":",
"srcPix",
"=",
"src",
".",
"(",
"*",
"image",
".",
"NRGBA",
")",
".",
"Pix",
"\n",
"dstPix",
",",
"stride",
",",
"rect",
"=",
"target",
".",
"Pix",
",",
"target",
".",
"Stride",
",",
"target",
".",
"Rect",
"\n",
"bytesPerPixel",
"=",
"4",
"\n",
"case",
"*",
"image",
".",
"NRGBA64",
":",
"srcPix",
"=",
"src",
".",
"(",
"*",
"<mask>",
".",
"NRGBA64",
")",
".",
"Pix",
"\n",
"dstPix",
",",
"stride",
",",
"rect",
"=",
"target",
".",
"Pix",
",",
"target",
".",
"Stride",
",",
"target",
".",
"Rect",
"\n",
"bytesPerPixel",
"=",
"8",
"\n",
"case",
"*",
"image",
".",
"Paletted",
":",
"srcPix",
"=",
"src",
".",
"(",
"*",
"image",
".",
"Paletted",
")",
".",
"Pix",
"\n",
"dstPix",
",",
"stride",
",",
"rect",
"=",
"target",
".",
"Pix",
",",
"target",
".",
"Stride",
",",
"target",
".",
"Rect",
"\n",
"bytesPerPixel",
"=",
"1",
"\n",
"case",
"*",
"image",
".",
"RGBA",
":",
"srcPix",
"=",
"src",
".",
"(",
"*",
"image",
".",
"RGBA",
")",
".",
"Pix",
"\n",
"dstPix",
",",
"stride",
",",
"rect",
"=",
"target",
".",
"Pix",
",",
"target",
".",
"Stride",
",",
"target",
".",
"Rect",
"\n",
"bytesPerPixel",
"=",
"4",
"\n",
"case",
"*",
"image",
".",
"RGBA64",
":",
"srcPix",
"=",
"src",
".",
"(",
"*",
"image",
".",
"RGBA64",
")",
".",
"Pix",
"\n",
"dstPix",
",",
"stride",
",",
"rect",
"=",
"target",
".",
"Pix",
",",
"target",
".",
"Stride",
",",
"target",
".",
"Rect",
"\n",
"bytesPerPixel",
"=",
"8",
"\n",
"}",
"\n",
"s",
",",
"bounds",
":=",
"0",
",",
"src",
".",
"Bounds",
"(",
")",
"\n",
"for",
"y",
":=",
"bounds",
".",
"Min",
".",
"Y",
";",
"y",
"<",
"bounds",
".",
"Max",
".",
"Y",
";",
"y",
"++",
"{",
"dBase",
":=",
"(",
"y",
"*",
"p",
".",
"yFactor",
"+",
"p",
".",
"yOffset",
"-",
"rect",
".",
"Min",
".",
"Y",
")",
"*",
"stride",
"+",
"(",
"p",
".",
"xOffset",
"-",
"rect",
".",
"Min",
".",
"X",
")",
"*",
"bytesPerPixel",
"\n",
"for",
"x",
":=",
"bounds",
".",
"Min",
".",
"X",
";",
"x",
"<",
"bounds",
".",
"Max",
".",
"X",
";",
"x",
"++",
"{",
"d",
":=",
"dBase",
"+",
"x",
"*",
"p",
".",
"xFactor",
"*",
"bytesPerPixel",
"\n",
"copy",
"(",
"dstPix",
"[",
"d",
":",
"]",
",",
"srcPix",
"[",
"s",
":",
"s",
"+",
"bytesPerPixel",
"]",
")",
"\n",
"s",
"+=",
"bytesPerPixel",
"\n",
"}",
"\n",
"}",
"\n",
"}"
] |
5,173 | all-5174 | [
"NewIterator",
"creates",
"a",
"CSVIterator",
"from",
"a",
"Reader",
"."
] | [
"func",
"NewIterator",
"(",
"reader",
"io",
".",
"Reader",
",",
"unmarshaller",
"RecordUnmarshaller",
")",
"*",
"Iterator",
"{",
"return",
"&",
"Iterator",
"{",
"reader",
":",
"reader",
",",
"line",
":",
"0",
",",
"scanner",
":",
"bufio",
".",
"NewScanner",
"(",
"<mask>",
")",
",",
"unmarshaller",
":",
"unmarshaller",
",",
"}",
"\n",
"}"
] |
5,174 | all-5175 | [
"ToSlice",
"converts",
"a",
"Queue",
"into",
"a",
"slice",
"."
] | [
"func",
"(",
"q",
"*",
"Queue",
")",
"ToSlice",
"(",
")",
"[",
"]",
"interface",
"{",
"}",
"{",
"q",
".",
"<mask>",
".",
"RLock",
"(",
")",
"\n",
"defer",
"q",
".",
"key",
".",
"RUnlock",
"(",
")",
"\n\n",
"if",
"q",
".",
"underlyer",
"==",
"nil",
"{",
"return",
"[",
"]",
"interface",
"{",
"}",
"{",
"}",
"\n",
"}",
"\n",
"return",
"q",
".",
"underlyer",
".",
"ToSlice",
"(",
")",
"\n",
"}"
] |
5,175 | all-5176 | [
"GetInputPurpose",
"()",
"is",
"a",
"wrapper",
"around",
"gtk_entry_get_input_purpose",
"()",
"."
] | [
"func",
"(",
"v",
"*",
"<mask>",
")",
"GetInputPurpose",
"(",
")",
"InputPurpose",
"{",
"c",
":=",
"C",
".",
"gtk_entry_get_input_purpose",
"(",
"v",
".",
"native",
"(",
")",
")",
"\n",
"return",
"InputPurpose",
"(",
"c",
")",
"\n",
"}"
] |
5,176 | all-5177 | [
"VarPath",
"returns",
"the",
"provided",
"path",
"elements",
"joined",
"by",
"a",
"slash",
"and",
"appended",
"to",
"the",
"end",
"of",
"$LXD_DIR",
"which",
"defaults",
"to",
"/",
"var",
"/",
"lib",
"/",
"lxd",
"."
] | [
"func",
"VarPath",
"(",
"path",
"...",
"string",
")",
"string",
"{",
"varDir",
":=",
"<mask>",
".",
"Getenv",
"(",
"\"",
"\"",
")",
"\n",
"if",
"varDir",
"==",
"\"",
"\"",
"{",
"varDir",
"=",
"\"",
"\"",
"\n",
"}",
"\n\n",
"items",
":=",
"[",
"]",
"string",
"{",
"varDir",
"}",
"\n",
"items",
"=",
"append",
"(",
"items",
",",
"path",
"...",
")",
"\n",
"return",
"filepath",
".",
"Join",
"(",
"items",
"...",
")",
"\n",
"}"
] |
5,177 | all-5178 | [
"NextDrawable",
"returns",
"a",
"Metal",
"drawable",
".",
"Reference",
":",
"https",
":",
"//",
"developer",
".",
"apple",
".",
"com",
"/",
"documentation",
"/",
"quartzcore",
"/",
"cametallayer",
"/",
"1478172",
"-",
"nextdrawable",
"."
] | [
"func",
"(",
"ml",
"MetalLayer",
")",
"NextDrawable",
"(",
")",
"(",
"MetalDrawable",
",",
"error",
")",
"{",
"<mask>",
":=",
"C",
".",
"MetalLayer_NextDrawable",
"(",
"ml",
".",
"metalLayer",
")",
"\n",
"if",
"md",
"==",
"nil",
"{",
"return",
"MetalDrawable",
"{",
"}",
",",
"errors",
".",
"New",
"(",
"\"",
"\"",
")",
"\n",
"}",
"\n\n",
"return",
"MetalDrawable",
"{",
"md",
"}",
",",
"nil",
"\n",
"}"
] |
5,178 | all-5179 | [
"UnmarshalJSON",
"supports",
"json",
".",
"Unmarshaler",
"interface"
] | [
"func",
"(",
"v",
"*",
"EventWebSocketHandshakeResponseReceived",
")",
"UnmarshalJSON",
"(",
"data",
"[",
"]",
"byte",
")",
"error",
"{",
"r",
":=",
"jlexer",
".",
"Lexer",
"{",
"Data",
":",
"data",
"}",
"\n",
"easyjsonC5a4559bDecodeGithubComChromedpCdprotoNetwork41",
"(",
"&",
"r",
",",
"v",
")",
"\n",
"return",
"r",
".",
"<mask>",
"(",
")",
"\n",
"}"
] |
5,179 | all-5180 | [
"DisableServiceFlapDetection",
"creates",
"a",
"new",
"DISABLE_SERVICE_FLAP_DETECTION",
"Nagios",
"command",
".",
"Disables",
"flap",
"detection",
"for",
"the",
"specified",
"service",
"."
] | [
"func",
"DisableServiceFlapDetection",
"(",
"host_name",
"string",
",",
"service_description",
"<mask>",
",",
")",
"*",
"livestatus",
".",
"Command",
"{",
"return",
"livestatus",
".",
"NewCommand",
"(",
"\"",
"\"",
",",
"stringifyArg",
"(",
"\"",
"\"",
",",
"\"",
"\"",
",",
"host_name",
")",
",",
"stringifyArg",
"(",
"\"",
"\"",
",",
"\"",
"\"",
",",
"service_description",
")",
",",
")",
"\n",
"}"
] |
5,180 | all-5181 | [
"Configures",
"the",
"uploading",
"of",
"a",
"generated",
"snapshot",
"file",
"to",
"a",
"remote",
"Backtrace",
"coronerd",
"object",
"store",
".",
"Uploads",
"use",
"simple",
"one",
"-",
"shot",
"semantics",
"and",
"won",
"t",
"retry",
"on",
"failures",
".",
"For",
"more",
"robust",
"snapshot",
"uploading",
"and",
"directory",
"monitoring",
"consider",
"using",
"coroner",
"daemon",
"as",
"described",
"at",
"https",
":",
"//",
"documentation",
".",
"backtrace",
".",
"io",
"/",
"snapshot",
"/",
"#daemon",
".",
"endpoint",
":",
"The",
"URL",
"of",
"the",
"server",
".",
"It",
"must",
"be",
"a",
"valid",
"HTTP",
"endpoint",
"as",
"according",
"to",
"url",
".",
"Parse",
"()",
"(",
"which",
"is",
"based",
"on",
"RFC",
"3986",
")",
".",
"The",
"default",
"scheme",
"and",
"port",
"are",
"https",
"and",
"6098",
"respectively",
"and",
"are",
"used",
"if",
"left",
"unspecified",
".",
"token",
":",
"The",
"hash",
"associated",
"with",
"the",
"coronerd",
"project",
"to",
"which",
"this",
"application",
"belongs",
";",
"see",
"https",
":",
"//",
"documentation",
".",
"backtrace",
".",
"io",
"/",
"coronerd_setup",
"/",
"#authentication",
"-",
"tokens",
"for",
"more",
"details",
".",
"options",
":",
"Modifies",
"behavior",
"of",
"the",
"Put",
"action",
";",
"see",
"PutOptions",
"documentation",
"for",
"more",
"details",
"."
] | [
"func",
"(",
"t",
"*",
"BTTracer",
")",
"ConfigurePut",
"(",
"endpoint",
",",
"token",
"string",
",",
"options",
"PutOptions",
")",
"error",
"{",
"if",
"endpoint",
"==",
"\"",
"\"",
"||",
"token",
"==",
"\"",
"\"",
"{",
"return",
"errors",
".",
"New",
"(",
"\"",
"\"",
")",
"\n",
"}",
"\n\n",
"url",
",",
"err",
":=",
"url",
".",
"Parse",
"(",
"endpoint",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n\n",
"// Endpoints without the scheme prefix (or at the very least a '//`",
"// prefix) are interpreted as remote server paths. Handle the",
"// (unlikely) case of an unspecified scheme. We won't allow other",
"// cases, like a port specified without a scheme, though, as per",
"// RFC 3986.",
"if",
"url",
".",
"Host",
"==",
"\"",
"\"",
"{",
"if",
"<mask>",
".",
"Path",
"==",
"\"",
"\"",
"{",
"return",
"errors",
".",
"New",
"(",
"\"",
"\"",
"+",
"\"",
"\"",
")",
"\n",
"}",
"\n\n",
"url",
".",
"Host",
"=",
"url",
".",
"Path",
"\n",
"}",
"\n\n",
"if",
"url",
".",
"Scheme",
"==",
"\"",
"\"",
"{",
"url",
".",
"Scheme",
"=",
"defaultCoronerScheme",
"\n",
"}",
"\n\n",
"if",
"strings",
".",
"IndexAny",
"(",
"url",
".",
"Host",
",",
"\"",
"\"",
")",
"==",
"-",
"1",
"{",
"url",
".",
"Host",
"+=",
"\"",
"\"",
"+",
"defaultCoronerPort",
"\n",
"}",
"\n\n",
"url",
".",
"Path",
"=",
"\"",
"\"",
"\n",
"url",
".",
"RawQuery",
"=",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\"",
",",
"token",
")",
"\n\n",
"t",
".",
"put",
".",
"endpoint",
"=",
"url",
".",
"String",
"(",
")",
"\n",
"t",
".",
"put",
".",
"options",
"=",
"options",
"\n\n",
"t",
".",
"Logf",
"(",
"LogDebug",
",",
"\"",
"\\n",
"\"",
",",
"t",
".",
"put",
".",
"endpoint",
",",
"t",
".",
"put",
".",
"options",
".",
"Unlink",
")",
"\n\n",
"return",
"nil",
"\n",
"}"
] |
5,181 | all-5182 | [
"add",
"punctuation",
"characters",
"to",
"start",
"and",
"end",
"of",
"string"
] | [
"func",
"(",
"g",
"Garbler",
")",
"punctuate",
"(",
"p",
"string",
",",
"numPunc",
"int",
")",
"string",
"{",
"if",
"numPunc",
"<=",
"0",
"{",
"return",
"p",
"\n",
"}",
"\n",
"ret",
":=",
"p",
"\n",
"for",
"i",
":=",
"0",
";",
"i",
"<",
"numPunc",
";",
"i",
"++",
"{",
"if",
"i",
"%",
"2",
"==",
"0",
"{",
"ret",
"+=",
"string",
"(",
"Punctuation",
"[",
"randInt",
"(",
"len",
"(",
"Punctuation",
")",
")",
"]",
")",
"\n",
"}",
"else",
"{",
"<mask>",
"=",
"string",
"(",
"Punctuation",
"[",
"randInt",
"(",
"len",
"(",
"Punctuation",
")",
")",
"]",
")",
"+",
"ret",
"\n",
"}",
"\n",
"}",
"\n",
"return",
"ret",
"\n",
"}"
] |
5,182 | all-5183 | [
"RequestReview",
"tries",
"to",
"add",
"the",
"users",
"listed",
"in",
"logins",
"as",
"requested",
"reviewers",
"of",
"the",
"specified",
"PR",
".",
"If",
"any",
"user",
"in",
"the",
"logins",
"slice",
"is",
"not",
"a",
"contributor",
"of",
"the",
"repo",
"the",
"entire",
"POST",
"will",
"fail",
"without",
"adding",
"any",
"reviewers",
".",
"The",
"GitHub",
"API",
"response",
"does",
"not",
"specify",
"which",
"user",
"(",
"s",
")",
"were",
"invalid",
"so",
"if",
"we",
"fail",
"to",
"request",
"reviews",
"from",
"the",
"members",
"of",
"logins",
"we",
"try",
"to",
"request",
"reviews",
"from",
"each",
"member",
"individually",
".",
"We",
"try",
"first",
"with",
"all",
"users",
"in",
"logins",
"for",
"efficiency",
"in",
"the",
"common",
"case",
".",
"See",
"https",
":",
"//",
"developer",
".",
"github",
".",
"com",
"/",
"v3",
"/",
"pulls",
"/",
"review_requests",
"/",
"#create",
"-",
"a",
"-",
"review",
"-",
"request"
] | [
"func",
"(",
"c",
"*",
"Client",
")",
"RequestReview",
"(",
"org",
",",
"repo",
"string",
",",
"number",
"int",
",",
"logins",
"[",
"]",
"string",
")",
"error",
"{",
"statusCode",
",",
"err",
":=",
"c",
".",
"tryRequestReview",
"(",
"org",
",",
"repo",
",",
"number",
",",
"logins",
")",
"\n",
"if",
"err",
"!=",
"nil",
"&&",
"statusCode",
"==",
"http",
".",
"StatusUnprocessableEntity",
"/*422*/",
"{",
"// Failed to set all members of 'logins' as reviewers, try individually.",
"missing",
":=",
"MissingUsers",
"{",
"action",
":",
"\"",
"\"",
"}",
"\n",
"for",
"_",
",",
"user",
":=",
"range",
"logins",
"{",
"statusCode",
",",
"err",
"=",
"c",
".",
"tryRequestReview",
"(",
"org",
",",
"repo",
",",
"number",
",",
"[",
"]",
"string",
"{",
"<mask>",
"}",
")",
"\n",
"if",
"err",
"!=",
"nil",
"&&",
"statusCode",
"==",
"http",
".",
"StatusUnprocessableEntity",
"/*422*/",
"{",
"// User is not a contributor, or team not in org.",
"missing",
".",
"Users",
"=",
"append",
"(",
"missing",
".",
"Users",
",",
"user",
")",
"\n",
"}",
"else",
"if",
"err",
"!=",
"nil",
"{",
"return",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
",",
"statusCode",
",",
"err",
")",
"\n",
"}",
"\n",
"}",
"\n",
"if",
"len",
"(",
"missing",
".",
"Users",
")",
">",
"0",
"{",
"return",
"missing",
"\n",
"}",
"\n",
"return",
"nil",
"\n",
"}",
"\n",
"return",
"err",
"\n",
"}"
] |
5,183 | all-5184 | [
"stop",
"terminates",
"all",
"scrape",
"loops",
"and",
"returns",
"after",
"they",
"all",
"terminated",
"."
] | [
"func",
"(",
"sp",
"*",
"scrapePool",
")",
"stop",
"(",
")",
"{",
"sp",
".",
"cancel",
"(",
")",
"\n",
"var",
"wg",
"<mask>",
".",
"WaitGroup",
"\n\n",
"sp",
".",
"mtx",
".",
"Lock",
"(",
")",
"\n",
"defer",
"sp",
".",
"mtx",
".",
"Unlock",
"(",
")",
"\n\n",
"for",
"fp",
",",
"l",
":=",
"range",
"sp",
".",
"loops",
"{",
"wg",
".",
"Add",
"(",
"1",
")",
"\n\n",
"go",
"func",
"(",
"l",
"loop",
")",
"{",
"l",
".",
"stop",
"(",
")",
"\n",
"wg",
".",
"Done",
"(",
")",
"\n",
"}",
"(",
"l",
")",
"\n\n",
"delete",
"(",
"sp",
".",
"loops",
",",
"fp",
")",
"\n",
"delete",
"(",
"sp",
".",
"activeTargets",
",",
"fp",
")",
"\n",
"}",
"\n",
"wg",
".",
"Wait",
"(",
")",
"\n",
"sp",
".",
"client",
".",
"CloseIdleConnections",
"(",
")",
"\n",
"}"
] |
5,184 | all-5185 | [
"VerifyJSONRepresenting",
"is",
"similar",
"to",
"VerifyJSON",
".",
"Instead",
"of",
"taking",
"a",
"JSON",
"string",
"however",
"it",
"takes",
"an",
"arbitrary",
"JSON",
"-",
"encodable",
"object",
"and",
"verifies",
"that",
"the",
"requests",
"s",
"body",
"is",
"a",
"JSON",
"representation",
"that",
"matches",
"the",
"object"
] | [
"func",
"VerifyJSONRepresenting",
"(",
"<mask>",
"interface",
"{",
"}",
")",
"http",
".",
"HandlerFunc",
"{",
"data",
",",
"err",
":=",
"json",
".",
"Marshal",
"(",
"object",
")",
"\n",
"Expect",
"(",
"err",
")",
".",
"ShouldNot",
"(",
"HaveOccurred",
"(",
")",
")",
"\n",
"return",
"CombineHandlers",
"(",
"VerifyContentType",
"(",
"\"",
"\"",
")",
",",
"VerifyJSON",
"(",
"string",
"(",
"data",
")",
")",
",",
")",
"\n",
"}"
] |
5,185 | all-5186 | [
"Timing",
"adds",
"a",
"value",
"to",
"a",
"histogram"
] | [
"func",
"(",
"m",
"*",
"CirconusMetrics",
")",
"Timing",
"(",
"metric",
"<mask>",
",",
"val",
"float64",
")",
"{",
"m",
".",
"SetHistogramValue",
"(",
"metric",
",",
"val",
")",
"\n",
"}"
] |
5,186 | all-5187 | [
"LogRequest",
"logs",
"a",
"goanna",
"request"
] | [
"func",
"LogRequest",
"(",
"r",
"*",
"Request",
",",
"v",
"...",
"string",
")",
"{",
"serializedHeaders",
":=",
"bytes",
".",
"Buffer",
"{",
"}",
"\n",
"r",
".",
"Header",
".",
"Write",
"(",
"&",
"serializedHeaders",
")",
"\n\n",
"printf",
":=",
"log",
".",
"Printf",
"\n",
"if",
"Logger",
"!=",
"nil",
"{",
"printf",
"=",
"Logger",
".",
"Printf",
"\n",
"}",
"\n\n",
"printf",
"(",
"LogRequestTemplate",
",",
"strings",
".",
"Join",
"(",
"v",
",",
"\"",
"\"",
")",
",",
"r",
".",
"URL",
".",
"<mask>",
"(",
")",
",",
"r",
".",
"Method",
",",
"time",
".",
"Now",
"(",
")",
",",
"serializedHeaders",
".",
"String",
"(",
")",
",",
"string",
"(",
"r",
".",
"BodyData",
"(",
")",
")",
",",
"debug",
".",
"Stack",
"(",
")",
",",
")",
"\n",
"}"
] |
5,187 | all-5188 | [
"LiveServers",
"returns",
"a",
"list",
"of",
"server",
"addresses",
"which",
"are",
"currently",
"known",
"to",
"be",
"alive",
"."
] | [
"func",
"(",
"s",
"*",
"<mask>",
")",
"LiveServers",
"(",
")",
"(",
"addrs",
"[",
"]",
"string",
")",
"{",
"s",
".",
"m",
".",
"RLock",
"(",
")",
"\n",
"addrs",
"=",
"s",
".",
"cluster",
"(",
")",
".",
"LiveServers",
"(",
")",
"\n",
"s",
".",
"m",
".",
"RUnlock",
"(",
")",
"\n",
"return",
"addrs",
"\n",
"}"
] |
5,188 | all-5189 | [
"Extract",
"the",
"project",
"query",
"parameter",
"from",
"the",
"given",
"request",
"."
] | [
"func",
"projectParam",
"(",
"<mask>",
"*",
"http",
".",
"Request",
")",
"string",
"{",
"project",
":=",
"queryParam",
"(",
"request",
",",
"\"",
"\"",
")",
"\n",
"if",
"project",
"==",
"\"",
"\"",
"{",
"project",
"=",
"\"",
"\"",
"\n",
"}",
"\n",
"return",
"project",
"\n",
"}"
] |
5,189 | all-5190 | [
"MarshalJSON",
"supports",
"json",
".",
"Marshaler",
"interface"
] | [
"func",
"(",
"v",
"SetScriptSourceParams",
")",
"MarshalJSON",
"(",
")",
"(",
"[",
"]",
"byte",
",",
"error",
")",
"{",
"w",
":=",
"jwriter",
".",
"Writer",
"{",
"}",
"\n",
"easyjsonC5a4559bEncodeGithubComChromedpCdprotoDebugger6",
"(",
"&",
"w",
",",
"v",
")",
"\n",
"return",
"w",
".",
"Buffer",
".",
"BuildBytes",
"(",
")",
",",
"w",
".",
"<mask>",
"\n",
"}"
] |
5,190 | all-5191 | [
"WithLatitude",
"mock",
"latitude",
"."
] | [
"func",
"(",
"p",
"SetGeolocationOverrideParams",
")",
"WithLatitude",
"(",
"latitude",
"float64",
")",
"*",
"SetGeolocationOverrideParams",
"{",
"p",
".",
"Latitude",
"=",
"latitude",
"\n",
"<mask>",
"&",
"p",
"\n",
"}"
] |
5,191 | all-5192 | [
"------------------------------------------------------------------",
"Switches",
"connected",
"via",
"arbitrary",
"net",
".",
"Conn",
";",
"useful",
"for",
"testing",
"Returns",
"n",
"switches",
"connected",
"according",
"to",
"the",
"connect",
"func",
".",
"If",
"connect",
"==",
"Connect2Switches",
"the",
"switches",
"will",
"be",
"fully",
"connected",
".",
"initSwitch",
"defines",
"how",
"the",
"ith",
"switch",
"should",
"be",
"initialized",
"(",
"ie",
".",
"with",
"what",
"reactors",
")",
".",
"NOTE",
":",
"panics",
"if",
"any",
"switch",
"fails",
"to",
"start",
"."
] | [
"func",
"MakeConnectedSwitches",
"(",
"n",
"int",
",",
"initSwitch",
"func",
"(",
"int",
",",
"*",
"Switch",
")",
"*",
"Switch",
",",
"connect",
"func",
"(",
"[",
"]",
"*",
"Switch",
",",
"int",
",",
"int",
")",
")",
"[",
"]",
"*",
"Switch",
"{",
"switches",
":=",
"make",
"(",
"[",
"]",
"*",
"Switch",
",",
"n",
")",
"\n",
"for",
"i",
":=",
"0",
";",
"i",
"<",
"n",
";",
"i",
"++",
"{",
"switches",
"[",
"i",
"]",
"=",
"makeSwitch",
"(",
"i",
",",
"\"",
"\"",
",",
"\"",
"\"",
",",
"initSwitch",
")",
"\n",
"}",
"\n\n",
"if",
"err",
":=",
"StartSwitches",
"(",
"switches",
")",
";",
"err",
"!=",
"nil",
"{",
"panic",
"(",
"err",
")",
"\n",
"}",
"\n\n",
"for",
"i",
":=",
"0",
";",
"i",
"<",
"n",
";",
"i",
"++",
"{",
"for",
"j",
":=",
"i",
";",
"j",
"<",
"n",
";",
"j",
"++",
"{",
"<mask>",
"(",
"switches",
",",
"i",
",",
"j",
")",
"\n",
"}",
"\n",
"}",
"\n\n",
"return",
"switches",
"\n",
"}"
] |
5,192 | all-5193 | [
"NewOutgoingCallbackQueryResponse",
"creates",
"a",
"response",
"to",
"a",
"callback",
"query",
"."
] | [
"func",
"(",
"api",
"*",
"TelegramBotAPI",
")",
"NewOutgoingCallbackQueryResponse",
"(",
"queryID",
"string",
")",
"*",
"OutgoingCallbackQueryResponse",
"{",
"<mask>",
"&",
"OutgoingCallbackQueryResponse",
"{",
"api",
":",
"api",
",",
"CallbackQueryID",
":",
"queryID",
",",
"}",
"\n",
"}"
] |
5,193 | all-5194 | [
"parseTimestamp",
"parses",
"s",
"as",
"a",
"timestamp",
"string",
"and",
"returns",
"the",
"timestamp",
"and",
"reports",
"whether",
"it",
"succeeded",
".",
"Timestamp",
"formats",
"are",
"defined",
"at",
"http",
":",
"//",
"yaml",
".",
"org",
"/",
"type",
"/",
"timestamp",
".",
"html"
] | [
"func",
"parseTimestamp",
"(",
"s",
"string",
")",
"(",
"time",
".",
"Time",
",",
"bool",
")",
"{",
"// TODO write code to check all the formats supported by",
"// http://yaml.org/type/timestamp.html instead of using time.Parse.",
"// Quick check: all date formats start with YYYY-.",
"i",
":=",
"0",
"\n",
"for",
";",
"i",
"<",
"len",
"(",
"s",
")",
";",
"i",
"++",
"{",
"if",
"c",
":=",
"s",
"[",
"i",
"]",
";",
"c",
"<",
"'0'",
"||",
"c",
">",
"'9'",
"{",
"<mask>",
"\n",
"}",
"\n",
"}",
"\n",
"if",
"i",
"!=",
"4",
"||",
"i",
"==",
"len",
"(",
"s",
")",
"||",
"s",
"[",
"i",
"]",
"!=",
"'-'",
"{",
"return",
"time",
".",
"Time",
"{",
"}",
",",
"false",
"\n",
"}",
"\n",
"for",
"_",
",",
"format",
":=",
"range",
"allowedTimestampFormats",
"{",
"if",
"t",
",",
"err",
":=",
"time",
".",
"Parse",
"(",
"format",
",",
"s",
")",
";",
"err",
"==",
"nil",
"{",
"return",
"t",
",",
"true",
"\n",
"}",
"\n",
"}",
"\n",
"return",
"time",
".",
"Time",
"{",
"}",
",",
"false",
"\n",
"}"
] |
5,194 | all-5195 | [
"add",
"adds",
"an",
"inflight",
"into",
"inflights"
] | [
"func",
"(",
"in",
"*",
"inflights",
")",
"add",
"(",
"inflight",
"uint64",
")",
"{",
"if",
"in",
".",
"full",
"(",
")",
"{",
"panic",
"(",
"\"",
"\"",
")",
"\n",
"}",
"\n",
"next",
":=",
"in",
".",
"start",
"+",
"in",
".",
"count",
"\n",
"size",
":=",
"in",
".",
"size",
"\n",
"if",
"next",
">=",
"size",
"{",
"next",
"-=",
"size",
"\n",
"}",
"\n",
"if",
"next",
">=",
"len",
"(",
"in",
".",
"buffer",
")",
"{",
"in",
".",
"growBuf",
"(",
")",
"\n",
"}",
"\n",
"in",
".",
"buffer",
"[",
"next",
"]",
"=",
"inflight",
"\n",
"in",
".",
"<mask>",
"++",
"\n",
"}"
] |
5,195 | all-5196 | [
"NewExactReadCloser",
"returns",
"a",
"ReadCloser",
"that",
"returns",
"errors",
"if",
"the",
"underlying",
"reader",
"does",
"not",
"read",
"back",
"exactly",
"the",
"requested",
"number",
"of",
"bytes",
"."
] | [
"func",
"NewExactReadCloser",
"(",
"rc",
"io",
".",
"ReadCloser",
",",
"totalBytes",
"int64",
")",
"<mask>",
".",
"ReadCloser",
"{",
"return",
"&",
"exactReadCloser",
"{",
"rc",
":",
"rc",
",",
"totalBytes",
":",
"totalBytes",
"}",
"\n",
"}"
] |
5,196 | all-5197 | [
"title",
":",
"machine",
"template",
"list",
"path",
":",
"/",
"iaas",
"/",
"templates",
"method",
":",
"GET",
"produce",
":",
"application",
"/",
"json",
"responses",
":",
"200",
":",
"OK",
"401",
":",
"Unauthorized"
] | [
"func",
"templatesList",
"(",
"w",
"http",
".",
"ResponseWriter",
",",
"r",
"*",
"http",
".",
"Request",
",",
"token",
"auth",
".",
"Token",
")",
"error",
"{",
"templates",
",",
"err",
":=",
"iaas",
".",
"ListTemplates",
"(",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n",
"contexts",
":=",
"permission",
".",
"ContextsForPermission",
"(",
"token",
",",
"permission",
".",
"PermMachineTemplateRead",
")",
"\n",
"allowedIaaS",
":=",
"map",
"[",
"string",
"]",
"struct",
"{",
"}",
"{",
"}",
"\n",
"for",
"_",
",",
"c",
":=",
"range",
"contexts",
"{",
"if",
"c",
".",
"CtxType",
"==",
"permTypes",
".",
"CtxGlobal",
"{",
"allowedIaaS",
"=",
"nil",
"\n",
"break",
"\n",
"}",
"\n",
"if",
"c",
".",
"CtxType",
"==",
"permTypes",
".",
"CtxIaaS",
"{",
"allowedIaaS",
"[",
"c",
".",
"Value",
"]",
"=",
"struct",
"{",
"}",
"{",
"}",
"\n",
"}",
"\n",
"}",
"\n",
"for",
"i",
":=",
"0",
";",
"allowedIaaS",
"!=",
"nil",
"&&",
"i",
"<",
"len",
"(",
"templates",
")",
";",
"i",
"++",
"{",
"if",
"_",
",",
"ok",
":=",
"allowedIaaS",
"[",
"templates",
"[",
"i",
"]",
".",
"IaaSName",
"]",
";",
"!",
"ok",
"{",
"templates",
"=",
"append",
"(",
"templates",
"[",
":",
"i",
"]",
",",
"templates",
"[",
"i",
"+",
"1",
":",
"]",
"...",
")",
"\n",
"i",
"--",
"\n",
"}",
"\n",
"}",
"\n",
"w",
".",
"<mask>",
"(",
")",
".",
"Add",
"(",
"\"",
"\"",
",",
"\"",
"\"",
")",
"\n",
"return",
"json",
".",
"NewEncoder",
"(",
"w",
")",
".",
"Encode",
"(",
"templates",
")",
"\n",
"}"
] |
5,197 | all-5198 | [
"ForgetConnections",
"removes",
"direct",
"connections",
"to",
"the",
"provided",
"peers",
"specified",
"in",
"host",
":",
"port",
"format",
".",
"TODO",
"(",
"pb",
")",
":",
"Weave",
"Net",
"invokes",
"router",
".",
"ConnectionMaker",
".",
"ForgetConnections",
";",
"it",
"may",
"be",
"better",
"to",
"provide",
"that",
"on",
"Router",
"directly",
"."
] | [
"func",
"(",
"cm",
"*",
"connectionMaker",
")",
"ForgetConnections",
"(",
"peers",
"[",
"]",
"string",
")",
"{",
"cm",
".",
"actionChan",
"<-",
"func",
"(",
")",
"bool",
"{",
"for",
"_",
",",
"peer",
":=",
"range",
"peers",
"{",
"delete",
"(",
"cm",
".",
"directPeers",
",",
"peer",
")",
"\n",
"}",
"\n",
"return",
"<mask>",
"\n",
"}",
"\n",
"}"
] |
5,198 | all-5199 | [
"ReplaceN",
"replaces",
"regular",
"expressions",
"mathed",
"in",
"r",
".",
"The",
"count",
"determines",
"the",
"number",
"to",
"match",
":",
"n",
">",
"0",
":",
"at",
"most",
"n",
"matches",
"n",
"==",
"0",
":",
"the",
"result",
"is",
"none",
"n",
"<",
"0",
":",
"all",
"matches"
] | [
"func",
"(",
"e",
"*",
"edit",
")",
"ReplaceN",
"(",
"r",
"[",
"]",
"Replacer",
",",
"n",
"int",
")",
"<mask>",
"{",
"return",
"e",
".",
"genReplace",
"(",
"r",
",",
"n",
")",
"\n",
"}"
] |
5,199 | all-5200 | [
"VirtualMachineCloneSchema",
"represents",
"the",
"schema",
"for",
"the",
"VM",
"clone",
"sub",
"-",
"resource",
".",
"This",
"is",
"a",
"workflow",
"for",
"vsphere_virtual_machine",
"that",
"facilitates",
"the",
"creation",
"of",
"a",
"virtual",
"machine",
"through",
"cloning",
"from",
"an",
"existing",
"template",
".",
"Customization",
"is",
"nested",
"here",
"even",
"though",
"it",
"exists",
"in",
"its",
"own",
"workflow",
"."
] | [
"func",
"VirtualMachineCloneSchema",
"(",
")",
"map",
"[",
"string",
"]",
"*",
"schema",
".",
"Schema",
"{",
"return",
"map",
"[",
"string",
"]",
"*",
"schema",
".",
"Schema",
"{",
"\"",
"\"",
":",
"{",
"Type",
":",
"schema",
".",
"TypeString",
",",
"Required",
":",
"true",
",",
"Description",
":",
"\"",
"\"",
",",
"}",
",",
"\"",
"\"",
":",
"{",
"<mask>",
":",
"schema",
".",
"TypeBool",
",",
"Optional",
":",
"true",
",",
"Description",
":",
"\"",
"\"",
",",
"}",
",",
"\"",
"\"",
":",
"{",
"Type",
":",
"schema",
".",
"TypeInt",
",",
"Optional",
":",
"true",
",",
"Default",
":",
"30",
",",
"Description",
":",
"\"",
"\"",
",",
"ValidateFunc",
":",
"validation",
".",
"IntAtLeast",
"(",
"10",
")",
",",
"}",
",",
"\"",
"\"",
":",
"{",
"Type",
":",
"schema",
".",
"TypeList",
",",
"Optional",
":",
"true",
",",
"MaxItems",
":",
"1",
",",
"Description",
":",
"\"",
"\"",
",",
"Elem",
":",
"&",
"schema",
".",
"Resource",
"{",
"Schema",
":",
"VirtualMachineCustomizeSchema",
"(",
")",
"}",
",",
"}",
",",
"}",
"\n",
"}"
] |
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.