hexsha stringlengths 40 40 | repo stringlengths 7 114 | path stringlengths 4 124 | license listlengths 1 9 | language stringclasses 1
value | identifier stringlengths 1 71 | return_type stringlengths 1 749 ⌀ | original_string stringlengths 76 22.7k | original_docstring stringlengths 16 7.61k | docstring stringlengths 16 2.47k | docstring_tokens listlengths 6 477 | code stringlengths 14 10.2k | code_tokens listlengths 6 996 | short_docstring stringlengths 2 644 | short_docstring_tokens listlengths 1 116 | comment listlengths 1 89 | parameters listlengths 0 64 | docstring_params dict |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
e866648645772216a84298da342ea739107c81c4 | sunlongbo/chromium | components/policy/tools/template_writers/writers/plist_writer.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | _AddRealKeyValuePair | null | def _AddRealKeyValuePair(self, parent, key_string, value_string):
'''Adds a plist key-value pair to a parent XML element, where the
value element contains a real number. The name of the value element will be
<real>.
Args:
key_string: The content of the key tag.
value_string: The content of ... | Adds a plist key-value pair to a parent XML element, where the
value element contains a real number. The name of the value element will be
<real>.
Args:
key_string: The content of the key tag.
value_string: The content of the value tag.
| Adds a plist key-value pair to a parent XML element, where the
value element contains a real number. The name of the value element will be
. | [
"Adds",
"a",
"plist",
"key",
"-",
"value",
"pair",
"to",
"a",
"parent",
"XML",
"element",
"where",
"the",
"value",
"element",
"contains",
"a",
"real",
"number",
".",
"The",
"name",
"of",
"the",
"value",
"element",
"will",
"be",
"."
] | def _AddRealKeyValuePair(self, parent, key_string, value_string):
self.AddElement(parent, 'key', {}, key_string)
self.AddElement(parent, 'real', {}, value_string) | [
"def",
"_AddRealKeyValuePair",
"(",
"self",
",",
"parent",
",",
"key_string",
",",
"value_string",
")",
":",
"self",
".",
"AddElement",
"(",
"parent",
",",
"'key'",
",",
"{",
"}",
",",
"key_string",
")",
"self",
".",
"AddElement",
"(",
"parent",
",",
"'r... | Adds a plist key-value pair to a parent XML element, where the
value element contains a real number. | [
"Adds",
"a",
"plist",
"key",
"-",
"value",
"pair",
"to",
"a",
"parent",
"XML",
"element",
"where",
"the",
"value",
"element",
"contains",
"a",
"real",
"number",
"."
] | [
"'''Adds a plist key-value pair to a parent XML element, where the\n value element contains a real number. The name of the value element will be\n <real>.\n\n Args:\n key_string: The content of the key tag.\n value_string: The content of the value tag.\n '''"
] | [
{
"param": "self",
"type": null
},
{
"param": "parent",
"type": null
},
{
"param": "key_string",
"type": null
},
{
"param": "value_string",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "parent",
"type": null,
"docstring": null,
"docstring_tokens":... |
957498072ac27ccb0ca95319f57a507f5989b852 | sunlongbo/chromium | net/data/ocsp_unittest/annotate_test_data.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | Transform | <not_specific> | def Transform(file_data):
"""Returns a transformed (formatted) version of file_data"""
result = ''
for block in GetPemBlocks(file_data):
if len(result) != 0:
result += '\n'
# If there was a user comment (non-script-generated comment) associated
# with the block, output it immediately before t... | Returns a transformed (formatted) version of file_data | Returns a transformed (formatted) version of file_data | [
"Returns",
"a",
"transformed",
"(",
"formatted",
")",
"version",
"of",
"file_data"
] | def Transform(file_data):
result = ''
for block in GetPemBlocks(file_data):
if len(result) != 0:
result += '\n'
user_comment = GetUserComment(block.comment)
if user_comment:
result += user_comment
generated_comment = GenerateCommentForBlock(block.name, block.data)
result += generated... | [
"def",
"Transform",
"(",
"file_data",
")",
":",
"result",
"=",
"''",
"for",
"block",
"in",
"GetPemBlocks",
"(",
"file_data",
")",
":",
"if",
"len",
"(",
"result",
")",
"!=",
"0",
":",
"result",
"+=",
"'\\n'",
"user_comment",
"=",
"GetUserComment",
"(",
... | Returns a transformed (formatted) version of file_data | [
"Returns",
"a",
"transformed",
"(",
"formatted",
")",
"version",
"of",
"file_data"
] | [
"\"\"\"Returns a transformed (formatted) version of file_data\"\"\"",
"# If there was a user comment (non-script-generated comment) associated",
"# with the block, output it immediately before the block."
] | [
{
"param": "file_data",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "file_data",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
957498072ac27ccb0ca95319f57a507f5989b852 | sunlongbo/chromium | net/data/ocsp_unittest/annotate_test_data.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | GenerateCommentForBlock | <not_specific> | def GenerateCommentForBlock(block_name, block_data):
"""Returns a string describing |block_data|. The format of |block_data| is
inferred from |block_name|, and is pretty-printed accordingly. For
instance CERTIFICATE is understood to be an X.509 certificate and pretty
printed using OpenSSL's x509 command. If the... | Returns a string describing |block_data|. The format of |block_data| is
inferred from |block_name|, and is pretty-printed accordingly. For
instance CERTIFICATE is understood to be an X.509 certificate and pretty
printed using OpenSSL's x509 command. If there is no specific pretty-printer
for the data type, it i... | Returns a string describing |block_data|. The format of |block_data| is
inferred from |block_name|, and is pretty-printed accordingly. For
instance CERTIFICATE is understood to be an X.509 certificate and pretty
printed using OpenSSL's x509 command. If there is no specific pretty-printer
for the data type, it is annota... | [
"Returns",
"a",
"string",
"describing",
"|block_data|",
".",
"The",
"format",
"of",
"|block_data|",
"is",
"inferred",
"from",
"|block_name|",
"and",
"is",
"pretty",
"-",
"printed",
"accordingly",
".",
"For",
"instance",
"CERTIFICATE",
"is",
"understood",
"to",
"... | def GenerateCommentForBlock(block_name, block_data):
if "CERTIFICATE" in block_name:
p = subprocess.Popen(["openssl", "x509", "-text", "-noout",
"-inform", "DER"],
stdin=subprocess.PIPE,
stdout=subprocess.PIPE,
... | [
"def",
"GenerateCommentForBlock",
"(",
"block_name",
",",
"block_data",
")",
":",
"if",
"\"CERTIFICATE\"",
"in",
"block_name",
":",
"p",
"=",
"subprocess",
".",
"Popen",
"(",
"[",
"\"openssl\"",
",",
"\"x509\"",
",",
"\"-text\"",
",",
"\"-noout\"",
",",
"\"-in... | Returns a string describing |block_data|. | [
"Returns",
"a",
"string",
"describing",
"|block_data|",
"."
] | [
"\"\"\"Returns a string describing |block_data|. The format of |block_data| is\n inferred from |block_name|, and is pretty-printed accordingly. For\n instance CERTIFICATE is understood to be an X.509 certificate and pretty\n printed using OpenSSL's x509 command. If there is no specific pretty-printer\n for the ... | [
{
"param": "block_name",
"type": null
},
{
"param": "block_data",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "block_name",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "block_data",
"type": null,
"docstring": null,
"docstrin... |
957498072ac27ccb0ca95319f57a507f5989b852 | sunlongbo/chromium | net/data/ocsp_unittest/annotate_test_data.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | GetUserComment | <not_specific> | def GetUserComment(comment):
"""Removes any script-generated lines (everything after the $ openssl line)"""
# Consider everything after "$ openssl" to be a generated comment.
comment = comment.split('$ openssl', 1)[0]
if IsEntirelyWhiteSpace(comment):
comment = ''
elif not comment.endswith("\n\n"):
c... | Removes any script-generated lines (everything after the $ openssl line) | Removes any script-generated lines (everything after the $ openssl line) | [
"Removes",
"any",
"script",
"-",
"generated",
"lines",
"(",
"everything",
"after",
"the",
"$",
"openssl",
"line",
")"
] | def GetUserComment(comment):
comment = comment.split('$ openssl', 1)[0]
if IsEntirelyWhiteSpace(comment):
comment = ''
elif not comment.endswith("\n\n"):
comment += "\n\n"
return comment | [
"def",
"GetUserComment",
"(",
"comment",
")",
":",
"comment",
"=",
"comment",
".",
"split",
"(",
"'$ openssl'",
",",
"1",
")",
"[",
"0",
"]",
"if",
"IsEntirelyWhiteSpace",
"(",
"comment",
")",
":",
"comment",
"=",
"''",
"elif",
"not",
"comment",
".",
"... | Removes any script-generated lines (everything after the $ openssl line) | [
"Removes",
"any",
"script",
"-",
"generated",
"lines",
"(",
"everything",
"after",
"the",
"$",
"openssl",
"line",
")"
] | [
"\"\"\"Removes any script-generated lines (everything after the $ openssl line)\"\"\"",
"# Consider everything after \"$ openssl\" to be a generated comment."
] | [
{
"param": "comment",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "comment",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
95a7af330319abec8dc35be14e981698b39d91d7 | sunlongbo/chromium | tools/git/git-diff-ide.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | PrintGitDiff | null | def PrintGitDiff(extra_args):
"""Outputs git diff extra_args with file:line inserted into relevant lines."""
current_file = '';
line_num = 0;
lines = GitShell('git diff %s' % ' '.join(extra_args))
for line in lines:
# Pass-through lines:
# diff --git a/file.c b/file.c
# index 0e38c2d..8cd69ae 10... | Outputs git diff extra_args with file:line inserted into relevant lines. | Outputs git diff extra_args with file:line inserted into relevant lines. | [
"Outputs",
"git",
"diff",
"extra_args",
"with",
"file",
":",
"line",
"inserted",
"into",
"relevant",
"lines",
"."
] | def PrintGitDiff(extra_args):
current_file = '';
line_num = 0;
lines = GitShell('git diff %s' % ' '.join(extra_args))
for line in lines:
if (line.startswith('diff ') or
line.startswith('index ') or
line.startswith('--- ')):
print(line)
continue
if line.startswith('+++ '):
... | [
"def",
"PrintGitDiff",
"(",
"extra_args",
")",
":",
"current_file",
"=",
"''",
";",
"line_num",
"=",
"0",
";",
"lines",
"=",
"GitShell",
"(",
"'git diff %s'",
"%",
"' '",
".",
"join",
"(",
"extra_args",
")",
")",
"for",
"line",
"in",
"lines",
":",
"if"... | Outputs git diff extra_args with file:line inserted into relevant lines. | [
"Outputs",
"git",
"diff",
"extra_args",
"with",
"file",
":",
"line",
"inserted",
"into",
"relevant",
"lines",
"."
] | [
"\"\"\"Outputs git diff extra_args with file:line inserted into relevant lines.\"\"\"",
"# Pass-through lines:",
"# diff --git a/file.c b/file.c",
"# index 0e38c2d..8cd69ae 100644",
"# --- a/file.c",
"# Get the filename from the +++ line:",
"# +++ b/file.c",
"# Filename might be /dev/null or a/fil... | [
{
"param": "extra_args",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "extra_args",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
55ff78fa10893af6941f6027b16a6a85c7b6c852 | sunlongbo/chromium | extensions/common/api/externs_checker.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | ParseApiFileList | <not_specific> | def ParseApiFileList(input_api, api_root=None):
"""Extract the API pairs from the registered list."""
if api_root is None:
api_root = input_api.PresubmitLocalPath()
externs_root = input_api.os_path.join(
input_api.change.RepositoryRoot(), 'third_party', 'closure_compiler',
'externs')
... | Extract the API pairs from the registered list. | Extract the API pairs from the registered list. | [
"Extract",
"the",
"API",
"pairs",
"from",
"the",
"registered",
"list",
"."
] | def ParseApiFileList(input_api, api_root=None):
if api_root is None:
api_root = input_api.PresubmitLocalPath()
externs_root = input_api.os_path.join(
input_api.change.RepositoryRoot(), 'third_party', 'closure_compiler',
'externs')
ret = {}
listing = input_api.os_path.join(api_root,... | [
"def",
"ParseApiFileList",
"(",
"input_api",
",",
"api_root",
"=",
"None",
")",
":",
"if",
"api_root",
"is",
"None",
":",
"api_root",
"=",
"input_api",
".",
"PresubmitLocalPath",
"(",
")",
"externs_root",
"=",
"input_api",
".",
"os_path",
".",
"join",
"(",
... | Extract the API pairs from the registered list. | [
"Extract",
"the",
"API",
"pairs",
"from",
"the",
"registered",
"list",
"."
] | [
"\"\"\"Extract the API pairs from the registered list.\"\"\"",
"# Skip blank & comment lines."
] | [
{
"param": "input_api",
"type": null
},
{
"param": "api_root",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "input_api",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "api_root",
"type": null,
"docstring": null,
"docstring_t... |
3ad572bb5d81ac906422079123af576dd773325a | sunlongbo/chromium | components/exo/wayland/fuzzer/wayland_sequencer.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | GetDependencyGraph | <not_specific> | def GetDependencyGraph(protocols):
"""Determine the dependencies between interfaces and their messages.
Args:
protocols: the list of wayland xml protocols you want the dependencies of.
Returns:
A bipartite graph where messages (i, m) depend on interfaces (i) and
vice-versa. An edge from (i,m) to (i'... | Determine the dependencies between interfaces and their messages.
Args:
protocols: the list of wayland xml protocols you want the dependencies of.
Returns:
A bipartite graph where messages (i, m) depend on interfaces (i) and
vice-versa. An edge from (i,m) to (i') indicates an i' instance is needed to
... | Determine the dependencies between interfaces and their messages. | [
"Determine",
"the",
"dependencies",
"between",
"interfaces",
"and",
"their",
"messages",
"."
] | def GetDependencyGraph(protocols):
dep_graph = {}
constructed_interfaces = set()
for _, i, m in wlu.AllMessages(protocols):
dep_graph[ToNode(i, m)] = [('receiver', i.attrib['name'])] + [
(a.attrib['name'], a.get('interface', '?'))
for a in m.findall('arg')
if a.attrib['type'] == 'objec... | [
"def",
"GetDependencyGraph",
"(",
"protocols",
")",
":",
"dep_graph",
"=",
"{",
"}",
"constructed_interfaces",
"=",
"set",
"(",
")",
"for",
"_",
",",
"i",
",",
"m",
"in",
"wlu",
".",
"AllMessages",
"(",
"protocols",
")",
":",
"dep_graph",
"[",
"ToNode",
... | Determine the dependencies between interfaces and their messages. | [
"Determine",
"the",
"dependencies",
"between",
"interfaces",
"and",
"their",
"messages",
"."
] | [
"\"\"\"Determine the dependencies between interfaces and their messages.\n\n Args:\n protocols: the list of wayland xml protocols you want the dependencies of.\n\n Returns:\n A bipartite graph where messages (i, m) depend on interfaces (i) and\n vice-versa. An edge from (i,m) to (i') indicates an i' inst... | [
{
"param": "protocols",
"type": null
}
] | {
"returns": [
{
"docstring": "A bipartite graph where messages (i, m) depend on interfaces (i) and\nvice-versa. An edge from (i,m) to (i') indicates an i' instance is needed to\ninvoke m, whereas (i) to (i',m') indicates m' is a constructor for i\ninstances.",
"docstring_tokens": [
"A",
... |
3ad572bb5d81ac906422079123af576dd773325a | sunlongbo/chromium | components/exo/wayland/fuzzer/wayland_sequencer.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | GetLastInterfaceCreated | <not_specific> | def GetLastInterfaceCreated(self, interface):
"""Return the small_value index for the currently available interface.
Args:
interface: the name of the interface you want an index of.
Returns:
A small_value index for the topmost-version of the interface.
"""
return small_value[self.count... | Return the small_value index for the currently available interface.
Args:
interface: the name of the interface you want an index of.
Returns:
A small_value index for the topmost-version of the interface.
| Return the small_value index for the currently available interface. | [
"Return",
"the",
"small_value",
"index",
"for",
"the",
"currently",
"available",
"interface",
"."
] | def GetLastInterfaceCreated(self, interface):
return small_value[self.counts[interface]] | [
"def",
"GetLastInterfaceCreated",
"(",
"self",
",",
"interface",
")",
":",
"return",
"small_value",
"[",
"self",
".",
"counts",
"[",
"interface",
"]",
"]"
] | Return the small_value index for the currently available interface. | [
"Return",
"the",
"small_value",
"index",
"for",
"the",
"currently",
"available",
"interface",
"."
] | [
"\"\"\"Return the small_value index for the currently available interface.\n\n Args:\n interface: the name of the interface you want an index of.\n\n Returns:\n A small_value index for the topmost-version of the interface.\n \"\"\""
] | [
{
"param": "self",
"type": null
},
{
"param": "interface",
"type": null
}
] | {
"returns": [
{
"docstring": "A small_value index for the topmost-version of the interface.",
"docstring_tokens": [
"A",
"small_value",
"index",
"for",
"the",
"topmost",
"-",
"version",
"of",
"the",
"interface",
... |
3ad572bb5d81ac906422079123af576dd773325a | sunlongbo/chromium | components/exo/wayland/fuzzer/wayland_sequencer.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | BuildMessage | null | def BuildMessage(self, interface, message, target_i):
"""Build the message sequence up to and including the supplied message.
Args:
interface: the name of the interface that defines the message you want to
send.
message: the name of the message you want to send.
target_i: the interfac... | Build the message sequence up to and including the supplied message.
Args:
interface: the name of the interface that defines the message you want to
send.
message: the name of the message you want to send.
target_i: the interface you expect to be created by this message (if there
... | Build the message sequence up to and including the supplied message. | [
"Build",
"the",
"message",
"sequence",
"up",
"to",
"and",
"including",
"the",
"supplied",
"message",
"."
] | def BuildMessage(self, interface, message, target_i):
args = [(arg_name, self.BuildInterface(arg_type))
for arg_name, arg_type in self.dep_graph[(interface, message)]]
if interface == 'wl_registry' and message == 'bind' and target_i:
args.append(('global', target_i))
self.AppendCall(interf... | [
"def",
"BuildMessage",
"(",
"self",
",",
"interface",
",",
"message",
",",
"target_i",
")",
":",
"args",
"=",
"[",
"(",
"arg_name",
",",
"self",
".",
"BuildInterface",
"(",
"arg_type",
")",
")",
"for",
"arg_name",
",",
"arg_type",
"in",
"self",
".",
"d... | Build the message sequence up to and including the supplied message. | [
"Build",
"the",
"message",
"sequence",
"up",
"to",
"and",
"including",
"the",
"supplied",
"message",
"."
] | [
"\"\"\"Build the message sequence up to and including the supplied message.\n\n Args:\n interface: the name of the interface that defines the message you want to\n send.\n message: the name of the message you want to send.\n target_i: the interface you expect to be created by this message (... | [
{
"param": "self",
"type": null
},
{
"param": "interface",
"type": null
},
{
"param": "message",
"type": null
},
{
"param": "target_i",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "interface",
"type": null,
"docstring": "the name of the interface t... |
3ad572bb5d81ac906422079123af576dd773325a | sunlongbo/chromium | components/exo/wayland/fuzzer/wayland_sequencer.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | GetManualSequences | <not_specific> | def GetManualSequences(dep_graph):
"""Get the sequences which can't be automated.
Some sequences of messages are interesting, and involve more than what can be
automatically generated by looking at the dependency graph. In such cases we
define the sequence here so that it will still be automatically generated ... | Get the sequences which can't be automated.
Some sequences of messages are interesting, and involve more than what can be
automatically generated by looking at the dependency graph. In such cases we
define the sequence here so that it will still be automatically generated as
part of the corpus.
Args:
de... | Get the sequences which can't be automated.
Some sequences of messages are interesting, and involve more than what can be
automatically generated by looking at the dependency graph. In such cases we
define the sequence here so that it will still be automatically generated as
part of the corpus. | [
"Get",
"the",
"sequences",
"which",
"can",
"'",
"t",
"be",
"automated",
".",
"Some",
"sequences",
"of",
"messages",
"are",
"interesting",
"and",
"involve",
"more",
"than",
"what",
"can",
"be",
"automatically",
"generated",
"by",
"looking",
"at",
"the",
"depe... | def GetManualSequences(dep_graph):
c = SequenceBuilder('copy_paste', dep_graph)
c_device = c.BuildInterface('wl_data_device')
c_source = c.BuildInterface('wl_data_source')
c.AppendCall('wl_data_source', 'offer', [('receiver', c_source),
('mime_type', '"text/plain"')])
... | [
"def",
"GetManualSequences",
"(",
"dep_graph",
")",
":",
"c",
"=",
"SequenceBuilder",
"(",
"'copy_paste'",
",",
"dep_graph",
")",
"c_device",
"=",
"c",
".",
"BuildInterface",
"(",
"'wl_data_device'",
")",
"c_source",
"=",
"c",
".",
"BuildInterface",
"(",
"'wl_... | Get the sequences which can't be automated. | [
"Get",
"the",
"sequences",
"which",
"can",
"'",
"t",
"be",
"automated",
"."
] | [
"\"\"\"Get the sequences which can't be automated.\n\n Some sequences of messages are interesting, and involve more than what can be\n automatically generated by looking at the dependency graph. In such cases we\n define the sequence here so that it will still be automatically generated as\n part of the corpus.... | [
{
"param": "dep_graph",
"type": null
}
] | {
"returns": [
{
"docstring": "A list of SequenceBuilder objects, each one containing a manually-created\nsequence.",
"docstring_tokens": [
"A",
"list",
"of",
"SequenceBuilder",
"objects",
"each",
"one",
"containing",
"a",
... |
3ad572bb5d81ac906422079123af576dd773325a | sunlongbo/chromium | components/exo/wayland/fuzzer/wayland_sequencer.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | Main | null | def Main(argv):
"""Instantiate the group of message-sequences used to seed the fuzzer.
Args:
argv: command-line arguments used to run the sequencer.
"""
parsed = wlu.ParseOpts(argv)
protocols = wlu.ReadProtocols(parsed.spec)
dep_graph = GetDependencyGraph(protocols)
for _, interface in wlu.AllInterf... | Instantiate the group of message-sequences used to seed the fuzzer.
Args:
argv: command-line arguments used to run the sequencer.
| Instantiate the group of message-sequences used to seed the fuzzer. | [
"Instantiate",
"the",
"group",
"of",
"message",
"-",
"sequences",
"used",
"to",
"seed",
"the",
"fuzzer",
"."
] | def Main(argv):
parsed = wlu.ParseOpts(argv)
protocols = wlu.ReadProtocols(parsed.spec)
dep_graph = GetDependencyGraph(protocols)
for _, interface in wlu.AllInterfaces(protocols):
for req in interface.findall('request'):
interface_name = interface.attrib['name']
message_name = req.attrib['name']... | [
"def",
"Main",
"(",
"argv",
")",
":",
"parsed",
"=",
"wlu",
".",
"ParseOpts",
"(",
"argv",
")",
"protocols",
"=",
"wlu",
".",
"ReadProtocols",
"(",
"parsed",
".",
"spec",
")",
"dep_graph",
"=",
"GetDependencyGraph",
"(",
"protocols",
")",
"for",
"_",
"... | Instantiate the group of message-sequences used to seed the fuzzer. | [
"Instantiate",
"the",
"group",
"of",
"message",
"-",
"sequences",
"used",
"to",
"seed",
"the",
"fuzzer",
"."
] | [
"\"\"\"Instantiate the group of message-sequences used to seed the fuzzer.\n\n Args:\n argv: command-line arguments used to run the sequencer.\n \"\"\"",
"# Add a round-trip to the sequence in case the server wants to do",
"# something funky.",
"# For sequences which are more complicated than a dependenc... | [
{
"param": "argv",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "argv",
"type": null,
"docstring": "command-line arguments used to run the sequencer.",
"docstring_tokens": [
"command",
"-",
"line",
"arguments",
"used",
"to",
"run",
... |
3ad89f15e3c64bb8c2b0c1c3110cb945f621c68d | sunlongbo/chromium | third_party/blink/tools/blinkpy/common/system/stack_utils.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | log_thread_state | null | def log_thread_state(logger, name, thread_id, msg=''):
"""Log information about the given thread state."""
stack = _find_thread_stack(thread_id)
assert stack is not None
logger('')
logger('%s (tid %d) %s' % (name, thread_id, msg))
_log_stack(logger, stack)
logger('') | Log information about the given thread state. | Log information about the given thread state. | [
"Log",
"information",
"about",
"the",
"given",
"thread",
"state",
"."
] | def log_thread_state(logger, name, thread_id, msg=''):
stack = _find_thread_stack(thread_id)
assert stack is not None
logger('')
logger('%s (tid %d) %s' % (name, thread_id, msg))
_log_stack(logger, stack)
logger('') | [
"def",
"log_thread_state",
"(",
"logger",
",",
"name",
",",
"thread_id",
",",
"msg",
"=",
"''",
")",
":",
"stack",
"=",
"_find_thread_stack",
"(",
"thread_id",
")",
"assert",
"stack",
"is",
"not",
"None",
"logger",
"(",
"''",
")",
"logger",
"(",
"'%s (ti... | Log information about the given thread state. | [
"Log",
"information",
"about",
"the",
"given",
"thread",
"state",
"."
] | [
"\"\"\"Log information about the given thread state.\"\"\""
] | [
{
"param": "logger",
"type": null
},
{
"param": "name",
"type": null
},
{
"param": "thread_id",
"type": null
},
{
"param": "msg",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "logger",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "name",
"type": null,
"docstring": null,
"docstring_tokens":... |
3ad89f15e3c64bb8c2b0c1c3110cb945f621c68d | sunlongbo/chromium | third_party/blink/tools/blinkpy/common/system/stack_utils.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | _find_thread_stack | <not_specific> | def _find_thread_stack(thread_id):
"""Returns a stack object that can be used to dump a stack trace for
the given thread id (or None if the id is not found).
"""
for tid, stack in sys._current_frames().items():
if tid == thread_id:
return stack
return None | Returns a stack object that can be used to dump a stack trace for
the given thread id (or None if the id is not found).
| Returns a stack object that can be used to dump a stack trace for
the given thread id (or None if the id is not found). | [
"Returns",
"a",
"stack",
"object",
"that",
"can",
"be",
"used",
"to",
"dump",
"a",
"stack",
"trace",
"for",
"the",
"given",
"thread",
"id",
"(",
"or",
"None",
"if",
"the",
"id",
"is",
"not",
"found",
")",
"."
] | def _find_thread_stack(thread_id):
for tid, stack in sys._current_frames().items():
if tid == thread_id:
return stack
return None | [
"def",
"_find_thread_stack",
"(",
"thread_id",
")",
":",
"for",
"tid",
",",
"stack",
"in",
"sys",
".",
"_current_frames",
"(",
")",
".",
"items",
"(",
")",
":",
"if",
"tid",
"==",
"thread_id",
":",
"return",
"stack",
"return",
"None"
] | Returns a stack object that can be used to dump a stack trace for
the given thread id (or None if the id is not found). | [
"Returns",
"a",
"stack",
"object",
"that",
"can",
"be",
"used",
"to",
"dump",
"a",
"stack",
"trace",
"for",
"the",
"given",
"thread",
"id",
"(",
"or",
"None",
"if",
"the",
"id",
"is",
"not",
"found",
")",
"."
] | [
"\"\"\"Returns a stack object that can be used to dump a stack trace for\n the given thread id (or None if the id is not found).\n \"\"\""
] | [
{
"param": "thread_id",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "thread_id",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
3ad89f15e3c64bb8c2b0c1c3110cb945f621c68d | sunlongbo/chromium | third_party/blink/tools/blinkpy/common/system/stack_utils.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | _log_stack | null | def _log_stack(logger, stack):
"""Log a stack trace to the logger callback."""
for filename, lineno, name, line in traceback.extract_stack(stack):
logger('File: "%s", line %d, in %s' % (filename, lineno, name))
if line:
logger(' %s' % line.strip()) | Log a stack trace to the logger callback. | Log a stack trace to the logger callback. | [
"Log",
"a",
"stack",
"trace",
"to",
"the",
"logger",
"callback",
"."
] | def _log_stack(logger, stack):
for filename, lineno, name, line in traceback.extract_stack(stack):
logger('File: "%s", line %d, in %s' % (filename, lineno, name))
if line:
logger(' %s' % line.strip()) | [
"def",
"_log_stack",
"(",
"logger",
",",
"stack",
")",
":",
"for",
"filename",
",",
"lineno",
",",
"name",
",",
"line",
"in",
"traceback",
".",
"extract_stack",
"(",
"stack",
")",
":",
"logger",
"(",
"'File: \"%s\", line %d, in %s'",
"%",
"(",
"filename",
... | Log a stack trace to the logger callback. | [
"Log",
"a",
"stack",
"trace",
"to",
"the",
"logger",
"callback",
"."
] | [
"\"\"\"Log a stack trace to the logger callback.\"\"\""
] | [
{
"param": "logger",
"type": null
},
{
"param": "stack",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "logger",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "stack",
"type": null,
"docstring": null,
"docstring_tokens"... |
7bb50630ffb821de5b89880e04008b9b86198655 | sunlongbo/chromium | content/test/gpu/gpu_tests/skia_gold_matching_algorithms.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | GetCmdline | <not_specific> | def GetCmdline(self):
"""Gets command line parameters for the algorithm.
Returns:
A list of strings representing the algorithm's parameters. The returned
list is suitable for extending an existing goldctl imgtest add
commandline, which will cause goldctl to use the specified algorithm
i... | Gets command line parameters for the algorithm.
Returns:
A list of strings representing the algorithm's parameters. The returned
list is suitable for extending an existing goldctl imgtest add
commandline, which will cause goldctl to use the specified algorithm
instead of the default.
| Gets command line parameters for the algorithm. | [
"Gets",
"command",
"line",
"parameters",
"for",
"the",
"algorithm",
"."
] | def GetCmdline(self):
return _GenerateOptionalKey(SkiaGoldMatchingAlgorithm.ALGORITHM_KEY,
self.Name()) | [
"def",
"GetCmdline",
"(",
"self",
")",
":",
"return",
"_GenerateOptionalKey",
"(",
"SkiaGoldMatchingAlgorithm",
".",
"ALGORITHM_KEY",
",",
"self",
".",
"Name",
"(",
")",
")"
] | Gets command line parameters for the algorithm. | [
"Gets",
"command",
"line",
"parameters",
"for",
"the",
"algorithm",
"."
] | [
"\"\"\"Gets command line parameters for the algorithm.\n\n Returns:\n A list of strings representing the algorithm's parameters. The returned\n list is suitable for extending an existing goldctl imgtest add\n commandline, which will cause goldctl to use the specified algorithm\n instead of th... | [
{
"param": "self",
"type": null
}
] | {
"returns": [
{
"docstring": "A list of strings representing the algorithm's parameters. The returned\nlist is suitable for extending an existing goldctl imgtest add\ncommandline, which will cause goldctl to use the specified algorithm\ninstead of the default.",
"docstring_tokens": [
"A",
... |
7bb6a127db4ba76ec9ed4bfbe619823ad943a3da | sunlongbo/chromium | testing/run_with_dummy_home.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | _set_up_dummy_home | null | def _set_up_dummy_home(original_home, dummy_home):
"""Sets up a dummy $HOME that Chromium tests can run in.
Files are copied, while directories are symlinked.
"""
for filename in ['.Xauthority']:
original_path = os.path.join(original_home, filename)
if not os.path.exists(original_path):
continue
... | Sets up a dummy $HOME that Chromium tests can run in.
Files are copied, while directories are symlinked.
| Sets up a dummy $HOME that Chromium tests can run in.
Files are copied, while directories are symlinked. | [
"Sets",
"up",
"a",
"dummy",
"$HOME",
"that",
"Chromium",
"tests",
"can",
"run",
"in",
".",
"Files",
"are",
"copied",
"while",
"directories",
"are",
"symlinked",
"."
] | def _set_up_dummy_home(original_home, dummy_home):
for filename in ['.Xauthority']:
original_path = os.path.join(original_home, filename)
if not os.path.exists(original_path):
continue
shutil.copyfile(original_path, os.path.join(dummy_home, filename))
for dirpath in [['.cache'], ['.local', 'share'... | [
"def",
"_set_up_dummy_home",
"(",
"original_home",
",",
"dummy_home",
")",
":",
"for",
"filename",
"in",
"[",
"'.Xauthority'",
"]",
":",
"original_path",
"=",
"os",
".",
"path",
".",
"join",
"(",
"original_home",
",",
"filename",
")",
"if",
"not",
"os",
".... | Sets up a dummy $HOME that Chromium tests can run in. | [
"Sets",
"up",
"a",
"dummy",
"$HOME",
"that",
"Chromium",
"tests",
"can",
"run",
"in",
"."
] | [
"\"\"\"Sets up a dummy $HOME that Chromium tests can run in.\n\n Files are copied, while directories are symlinked.\n \"\"\"",
"# Prevent fontconfig etc. from reconstructing the cache and symlink rr",
"# trace directory."
] | [
{
"param": "original_home",
"type": null
},
{
"param": "dummy_home",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "original_home",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "dummy_home",
"type": null,
"docstring": null,
"docst... |
2f856449f468132be9914cf3595fba407456929f | sunlongbo/chromium | third_party/blink/tools/blinkpy/web_tests/port/factory.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | _read_configuration_from_gn | <not_specific> | def _read_configuration_from_gn(fs, options):
"""Returns the configuration to used based on args.gn, if possible."""
build_directory = getattr(options, 'build_directory', 'out')
target = options.target
finder = PathFinder(fs)
path = fs.join(finder.chromium_base(), build_directory, target, 'args.gn')... | Returns the configuration to used based on args.gn, if possible. | Returns the configuration to used based on args.gn, if possible. | [
"Returns",
"the",
"configuration",
"to",
"used",
"based",
"on",
"args",
".",
"gn",
"if",
"possible",
"."
] | def _read_configuration_from_gn(fs, options):
build_directory = getattr(options, 'build_directory', 'out')
target = options.target
finder = PathFinder(fs)
path = fs.join(finder.chromium_base(), build_directory, target, 'args.gn')
if not fs.exists(path):
path = fs.join(finder.chromium_base(),... | [
"def",
"_read_configuration_from_gn",
"(",
"fs",
",",
"options",
")",
":",
"build_directory",
"=",
"getattr",
"(",
"options",
",",
"'build_directory'",
",",
"'out'",
")",
"target",
"=",
"options",
".",
"target",
"finder",
"=",
"PathFinder",
"(",
"fs",
")",
"... | Returns the configuration to used based on args.gn, if possible. | [
"Returns",
"the",
"configuration",
"to",
"used",
"based",
"on",
"args",
".",
"gn",
"if",
"possible",
"."
] | [
"\"\"\"Returns the configuration to used based on args.gn, if possible.\"\"\"",
"# This does not appear to be a GN-based build directory, so we don't know",
"# how to interpret it.",
"# toolchain.ninja exists, but args.gn does not; this can happen when",
"# `gn gen` is run with no --args.",
"# If is_debug... | [
{
"param": "fs",
"type": null
},
{
"param": "options",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "fs",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "options",
"type": null,
"docstring": null,
"docstring_tokens": ... |
b6b1013edef29560c8e58e26f6c89a9ccd8fae2d | sunlongbo/chromium | tools/perf/page_sets/login_helpers/google_login.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | BaseLoginGoogle | null | def BaseLoginGoogle(action_runner,
credential='googletest', # Recommended credential.
credentials_path=login_utils.DEFAULT_CREDENTIAL_PATH):
"""Logs in into Google account.
This function navigates the tab into Google's login page and logs in a user
using credentials in |c... | Logs in into Google account.
This function navigates the tab into Google's login page and logs in a user
using credentials in |credential| part of the |credentials_path| file.
Args:
action_runner: Action runner responsible for running actions on the page.
credential: The credential to retrieve from the ... | Logs in into Google account.
This function navigates the tab into Google's login page and logs in a user
using credentials in |credential| part of the |credentials_path| file.
Action runner responsible for running actions on the page.
credential: The credential to retrieve from the credentials file
(type string).
cred... | [
"Logs",
"in",
"into",
"Google",
"account",
".",
"This",
"function",
"navigates",
"the",
"tab",
"into",
"Google",
"'",
"s",
"login",
"page",
"and",
"logs",
"in",
"a",
"user",
"using",
"credentials",
"in",
"|credential|",
"part",
"of",
"the",
"|credentials_pat... | def BaseLoginGoogle(action_runner,
credential='googletest',
credentials_path=login_utils.DEFAULT_CREDENTIAL_PATH):
account_name, password = login_utils.GetAccountNameAndPassword(
credential, credentials_path=credentials_path)
action_runner.Navigate(
'https://acc... | [
"def",
"BaseLoginGoogle",
"(",
"action_runner",
",",
"credential",
"=",
"'googletest'",
",",
"credentials_path",
"=",
"login_utils",
".",
"DEFAULT_CREDENTIAL_PATH",
")",
":",
"account_name",
",",
"password",
"=",
"login_utils",
".",
"GetAccountNameAndPassword",
"(",
"... | Logs in into Google account. | [
"Logs",
"in",
"into",
"Google",
"account",
"."
] | [
"# Recommended credential.",
"\"\"\"Logs in into Google account.\n\n This function navigates the tab into Google's login page and logs in a user\n using credentials in |credential| part of the |credentials_path| file.\n\n Args:\n action_runner: Action runner responsible for running actions on the page.\n ... | [
{
"param": "action_runner",
"type": null
},
{
"param": "credential",
"type": null
},
{
"param": "credentials_path",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "action_runner",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "credential",
"type": null,
"docstring": null,
"docst... |
3a389ca9fdd3bb61867f7591fd0d13fa7b491994 | sunlongbo/chromium | tools/mac/dump-static-initializers.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | ParseDsymutil | null | def ParseDsymutil(binary):
"""Given a binary, prints source and object filenames for files with
static initializers.
"""
child = subprocess.Popen(['tools/clang/dsymutil/bin/dsymutil', '-s', binary],
stdout=subprocess.PIPE)
for line in child.stdout:
file_match = dsymutil_file_re.search(line)
if f... | Given a binary, prints source and object filenames for files with
static initializers.
| Given a binary, prints source and object filenames for files with
static initializers. | [
"Given",
"a",
"binary",
"prints",
"source",
"and",
"object",
"filenames",
"for",
"files",
"with",
"static",
"initializers",
"."
] | def ParseDsymutil(binary):
child = subprocess.Popen(['tools/clang/dsymutil/bin/dsymutil', '-s', binary],
stdout=subprocess.PIPE)
for line in child.stdout:
file_match = dsymutil_file_re.search(line)
if file_match:
current_filename = file_match.group(1)
else:
o_file_match = dsymutil_o_fil... | [
"def",
"ParseDsymutil",
"(",
"binary",
")",
":",
"child",
"=",
"subprocess",
".",
"Popen",
"(",
"[",
"'tools/clang/dsymutil/bin/dsymutil'",
",",
"'-s'",
",",
"binary",
"]",
",",
"stdout",
"=",
"subprocess",
".",
"PIPE",
")",
"for",
"line",
"in",
"child",
"... | Given a binary, prints source and object filenames for files with
static initializers. | [
"Given",
"a",
"binary",
"prints",
"source",
"and",
"object",
"filenames",
"for",
"files",
"with",
"static",
"initializers",
"."
] | [
"\"\"\"Given a binary, prints source and object filenames for files with\n static initializers.\n \"\"\""
] | [
{
"param": "binary",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "binary",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
565876a5db6bc6bf71e8037955482c674288a269 | sunlongbo/chromium | chrome/test/chromedriver/util.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | _DeleteDir | null | def _DeleteDir(path):
"""Deletes a directory recursively, which must exist.
Note that this function can fail and raise OSError if another process is
making changes to the directory at the same time.
"""
# Don't use shutil.rmtree because it can't delete read-only files on Win.
for root, dirs, files in os.wa... | Deletes a directory recursively, which must exist.
Note that this function can fail and raise OSError if another process is
making changes to the directory at the same time.
| Deletes a directory recursively, which must exist.
Note that this function can fail and raise OSError if another process is
making changes to the directory at the same time. | [
"Deletes",
"a",
"directory",
"recursively",
"which",
"must",
"exist",
".",
"Note",
"that",
"this",
"function",
"can",
"fail",
"and",
"raise",
"OSError",
"if",
"another",
"process",
"is",
"making",
"changes",
"to",
"the",
"directory",
"at",
"the",
"same",
"ti... | def _DeleteDir(path):
for root, dirs, files in os.walk(path, topdown=False):
for name in files:
filename = os.path.join(root, name)
try:
os.chmod(filename, stat.S_IWRITE)
except OSError:
pass
os.remove(filename)
for name in dirs:
os.rmdir(os.path.join(root, name))... | [
"def",
"_DeleteDir",
"(",
"path",
")",
":",
"for",
"root",
",",
"dirs",
",",
"files",
"in",
"os",
".",
"walk",
"(",
"path",
",",
"topdown",
"=",
"False",
")",
":",
"for",
"name",
"in",
"files",
":",
"filename",
"=",
"os",
".",
"path",
".",
"join"... | Deletes a directory recursively, which must exist. | [
"Deletes",
"a",
"directory",
"recursively",
"which",
"must",
"exist",
"."
] | [
"\"\"\"Deletes a directory recursively, which must exist.\n\n Note that this function can fail and raise OSError if another process is\n making changes to the directory at the same time.\n \"\"\"",
"# Don't use shutil.rmtree because it can't delete read-only files on Win."
] | [
{
"param": "path",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "path",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
565876a5db6bc6bf71e8037955482c674288a269 | sunlongbo/chromium | chrome/test/chromedriver/util.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | RunCommand | <not_specific> | def RunCommand(cmd, cwd=None, fileName=None):
"""Runs the given command and returns the exit code.
Args:
fileName: file name to redirect output
cmd: list of command arguments.
cwd: working directory to execute the command, or None if the current
working directory should be used.
Returns:
... | Runs the given command and returns the exit code.
Args:
fileName: file name to redirect output
cmd: list of command arguments.
cwd: working directory to execute the command, or None if the current
working directory should be used.
Returns:
The exit code of the command.
| Runs the given command and returns the exit code. | [
"Runs",
"the",
"given",
"command",
"and",
"returns",
"the",
"exit",
"code",
"."
] | def RunCommand(cmd, cwd=None, fileName=None):
sys.stdout.flush()
if fileName is not None:
with open(fileName,"wb") as out:
process = subprocess.Popen(cmd, cwd=cwd,stdout=out,stderr=out)
else:
process = subprocess.Popen(cmd, cwd=cwd)
process.wait()
sys.stdout.flush()
return process.returncode | [
"def",
"RunCommand",
"(",
"cmd",
",",
"cwd",
"=",
"None",
",",
"fileName",
"=",
"None",
")",
":",
"sys",
".",
"stdout",
".",
"flush",
"(",
")",
"if",
"fileName",
"is",
"not",
"None",
":",
"with",
"open",
"(",
"fileName",
",",
"\"wb\"",
")",
"as",
... | Runs the given command and returns the exit code. | [
"Runs",
"the",
"given",
"command",
"and",
"returns",
"the",
"exit",
"code",
"."
] | [
"\"\"\"Runs the given command and returns the exit code.\n\n Args:\n fileName: file name to redirect output\n cmd: list of command arguments.\n cwd: working directory to execute the command, or None if the current\n working directory should be used.\n\n Returns:\n The exit code of the command.... | [
{
"param": "cmd",
"type": null
},
{
"param": "cwd",
"type": null
},
{
"param": "fileName",
"type": null
}
] | {
"returns": [
{
"docstring": "The exit code of the command.",
"docstring_tokens": [
"The",
"exit",
"code",
"of",
"the",
"command",
"."
],
"type": null
}
],
"raises": [],
"params": [
{
"identifier": "cmd",
"t... |
565876a5db6bc6bf71e8037955482c674288a269 | sunlongbo/chromium | chrome/test/chromedriver/util.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | DoesUrlExist | <not_specific> | def DoesUrlExist(url):
"""Determines whether a resource exists at the given URL.
Args:
url: URL to be verified.
Returns:
True if url exists, otherwise False.
"""
parsed = urllib.parse.urlparse(url)
try:
conn = http_client.HTTPConnection(parsed.netloc)
conn.request('HEAD', parsed.path)
... | Determines whether a resource exists at the given URL.
Args:
url: URL to be verified.
Returns:
True if url exists, otherwise False.
| Determines whether a resource exists at the given URL. | [
"Determines",
"whether",
"a",
"resource",
"exists",
"at",
"the",
"given",
"URL",
"."
] | def DoesUrlExist(url):
parsed = urllib.parse.urlparse(url)
try:
conn = http_client.HTTPConnection(parsed.netloc)
conn.request('HEAD', parsed.path)
response = conn.getresponse()
except http_client.HTTPException:
return False
finally:
conn.close()
if response.status == 302 or response.status... | [
"def",
"DoesUrlExist",
"(",
"url",
")",
":",
"parsed",
"=",
"urllib",
".",
"parse",
".",
"urlparse",
"(",
"url",
")",
"try",
":",
"conn",
"=",
"http_client",
".",
"HTTPConnection",
"(",
"parsed",
".",
"netloc",
")",
"conn",
".",
"request",
"(",
"'HEAD'... | Determines whether a resource exists at the given URL. | [
"Determines",
"whether",
"a",
"resource",
"exists",
"at",
"the",
"given",
"URL",
"."
] | [
"\"\"\"Determines whether a resource exists at the given URL.\n\n Args:\n url: URL to be verified.\n\n Returns:\n True if url exists, otherwise False.\n \"\"\"",
"# Follow both permanent (301) and temporary (302) redirects."
] | [
{
"param": "url",
"type": null
}
] | {
"returns": [
{
"docstring": "True if url exists, otherwise False.",
"docstring_tokens": [
"True",
"if",
"url",
"exists",
"otherwise",
"False",
"."
],
"type": null
}
],
"raises": [],
"params": [
{
"identifier": "u... |
565876a5db6bc6bf71e8037955482c674288a269 | sunlongbo/chromium | chrome/test/chromedriver/util.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | AddLink | null | def AddLink(label, url):
"""Adds a link with name |label| linking to |url| to current buildbot step.
Args:
label: A string with the name of the label.
url: A string of the URL.
"""
print('@@@STEP_LINK@%s@%s@@@' % (label, url)) | Adds a link with name |label| linking to |url| to current buildbot step.
Args:
label: A string with the name of the label.
url: A string of the URL.
| Adds a link with name |label| linking to |url| to current buildbot step. | [
"Adds",
"a",
"link",
"with",
"name",
"|label|",
"linking",
"to",
"|url|",
"to",
"current",
"buildbot",
"step",
"."
] | def AddLink(label, url):
print('@@@STEP_LINK@%s@%s@@@' % (label, url)) | [
"def",
"AddLink",
"(",
"label",
",",
"url",
")",
":",
"print",
"(",
"'@@@STEP_LINK@%s@%s@@@'",
"%",
"(",
"label",
",",
"url",
")",
")"
] | Adds a link with name |label| linking to |url| to current buildbot step. | [
"Adds",
"a",
"link",
"with",
"name",
"|label|",
"linking",
"to",
"|url|",
"to",
"current",
"buildbot",
"step",
"."
] | [
"\"\"\"Adds a link with name |label| linking to |url| to current buildbot step.\n\n Args:\n label: A string with the name of the label.\n url: A string of the URL.\n \"\"\""
] | [
{
"param": "label",
"type": null
},
{
"param": "url",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "label",
"type": null,
"docstring": "A string with the name of the label.",
"docstring_tokens": [
"A",
"string",
"with",
"the",
"name",
"of",
"the",
"label",
... |
565876a5db6bc6bf71e8037955482c674288a269 | sunlongbo/chromium | chrome/test/chromedriver/util.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | FindProbableFreePorts | null | def FindProbableFreePorts():
"""Get an generator returning random free ports on the system.
Note that this function has an inherent race condition: some other process
may bind to the port after we return it, so it may no longer be free by then.
The workaround is to do this inside a retry loop. Do not use this ... | Get an generator returning random free ports on the system.
Note that this function has an inherent race condition: some other process
may bind to the port after we return it, so it may no longer be free by then.
The workaround is to do this inside a retry loop. Do not use this function
if there is any alterna... | Get an generator returning random free ports on the system.
Note that this function has an inherent race condition: some other process
may bind to the port after we return it, so it may no longer be free by then.
The workaround is to do this inside a retry loop. Do not use this function
if there is any alternative. | [
"Get",
"an",
"generator",
"returning",
"random",
"free",
"ports",
"on",
"the",
"system",
".",
"Note",
"that",
"this",
"function",
"has",
"an",
"inherent",
"race",
"condition",
":",
"some",
"other",
"process",
"may",
"bind",
"to",
"the",
"port",
"after",
"w... | def FindProbableFreePorts():
dynamic_ports = range(49152, 65535)
random.shuffle(dynamic_ports)
for port in dynamic_ports:
try:
socket.create_connection(('127.0.0.1', port), 0.2).close()
except socket.error:
yield port
raise RuntimeError('Cannot find open port') | [
"def",
"FindProbableFreePorts",
"(",
")",
":",
"dynamic_ports",
"=",
"range",
"(",
"49152",
",",
"65535",
")",
"random",
".",
"shuffle",
"(",
"dynamic_ports",
")",
"for",
"port",
"in",
"dynamic_ports",
":",
"try",
":",
"socket",
".",
"create_connection",
"("... | Get an generator returning random free ports on the system. | [
"Get",
"an",
"generator",
"returning",
"random",
"free",
"ports",
"on",
"the",
"system",
"."
] | [
"\"\"\"Get an generator returning random free ports on the system.\n\n Note that this function has an inherent race condition: some other process\n may bind to the port after we return it, so it may no longer be free by then.\n The workaround is to do this inside a retry loop. Do not use this function\n if ther... | [] | {
"returns": [],
"raises": [],
"params": [],
"outlier_params": [],
"others": []
} |
565876a5db6bc6bf71e8037955482c674288a269 | sunlongbo/chromium | chrome/test/chromedriver/util.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | WriteResultToJSONFile | <not_specific> | def WriteResultToJSONFile(test_suites, results, json_path):
"""Aggregate a list of unittest result object and write to a file as a JSON.
This takes a list of result object from one or more runs (for retry purpose)
of Python unittest tests; aggregates the list by appending each test result
from each run and wri... | Aggregate a list of unittest result object and write to a file as a JSON.
This takes a list of result object from one or more runs (for retry purpose)
of Python unittest tests; aggregates the list by appending each test result
from each run and writes to a file in the correct format
for the --isolated-script-t... | Aggregate a list of unittest result object and write to a file as a JSON. | [
"Aggregate",
"a",
"list",
"of",
"unittest",
"result",
"object",
"and",
"write",
"to",
"a",
"file",
"as",
"a",
"JSON",
"."
] | def WriteResultToJSONFile(test_suites, results, json_path):
output = {
'interrupted': False,
'num_failures_by_type': {},
'path_delimiter': '.',
'seconds_since_epoch': time.time(),
'tests': {},
'version': 3,
}
def initialize(test_suite):
for test in test_suite:
if test... | [
"def",
"WriteResultToJSONFile",
"(",
"test_suites",
",",
"results",
",",
"json_path",
")",
":",
"output",
"=",
"{",
"'interrupted'",
":",
"False",
",",
"'num_failures_by_type'",
":",
"{",
"}",
",",
"'path_delimiter'",
":",
"'.'",
",",
"'seconds_since_epoch'",
":... | Aggregate a list of unittest result object and write to a file as a JSON. | [
"Aggregate",
"a",
"list",
"of",
"unittest",
"result",
"object",
"and",
"write",
"to",
"a",
"file",
"as",
"a",
"JSON",
"."
] | [
"\"\"\"Aggregate a list of unittest result object and write to a file as a JSON.\n\n This takes a list of result object from one or more runs (for retry purpose)\n of Python unittest tests; aggregates the list by appending each test result\n from each run and writes to a file in the correct format\n for the --i... | [
{
"param": "test_suites",
"type": null
},
{
"param": "results",
"type": null
},
{
"param": "json_path",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "test_suites",
"type": null,
"docstring": "a list of unittest.TestSuite that were run to get\nthe list of result object; each test_suite contains\nthe tests run and is iterated to get all test cases ran.",
"docstring_tokens": [... |
566545de6da3c5a55e458b2a44d39dd1cfc10c02 | sunlongbo/chromium | content/test/gpu/gold_inexact_matching/parameter_set.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | AsList | <not_specific> | def AsList(self):
"""Returns the object's data in list format.
The returned object is suitable for appending to a "goldctl match" command
in order to compare using the parameters stored within the object.
Returns:
A list of strings.
"""
return [
'--parameter',
'fuzzy_max_... | Returns the object's data in list format.
The returned object is suitable for appending to a "goldctl match" command
in order to compare using the parameters stored within the object.
Returns:
A list of strings.
| Returns the object's data in list format.
The returned object is suitable for appending to a "goldctl match" command
in order to compare using the parameters stored within the object. | [
"Returns",
"the",
"object",
"'",
"s",
"data",
"in",
"list",
"format",
".",
"The",
"returned",
"object",
"is",
"suitable",
"for",
"appending",
"to",
"a",
"\"",
"goldctl",
"match",
"\"",
"command",
"in",
"order",
"to",
"compare",
"using",
"the",
"parameters"... | def AsList(self):
return [
'--parameter',
'fuzzy_max_different_pixels:%d' % self.max_diff,
'--parameter',
'fuzzy_pixel_delta_threshold:%d' % self.delta_threshold,
'--parameter',
'fuzzy_ignored_border_thickness:%d' % self.ignored_border_thickness,
'--parameter'... | [
"def",
"AsList",
"(",
"self",
")",
":",
"return",
"[",
"'--parameter'",
",",
"'fuzzy_max_different_pixels:%d'",
"%",
"self",
".",
"max_diff",
",",
"'--parameter'",
",",
"'fuzzy_pixel_delta_threshold:%d'",
"%",
"self",
".",
"delta_threshold",
",",
"'--parameter'",
",... | Returns the object's data in list format. | [
"Returns",
"the",
"object",
"'",
"s",
"data",
"in",
"list",
"format",
"."
] | [
"\"\"\"Returns the object's data in list format.\n\n The returned object is suitable for appending to a \"goldctl match\" command\n in order to compare using the parameters stored within the object.\n\n Returns:\n A list of strings.\n \"\"\""
] | [
{
"param": "self",
"type": null
}
] | {
"returns": [
{
"docstring": "A list of strings.",
"docstring_tokens": [
"A",
"list",
"of",
"strings",
"."
],
"type": null
}
],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
... |
e768eefb893ed63d8615d658d99bded8c74ce894 | sunlongbo/chromium | tools/cr/cr/actions/runner.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | Invoke | null | def Invoke(self, targets, arguments):
"""Invoke a target.
This dispatches to either Test or Run depending on the target type.
"""
for target in targets:
if target.is_test:
self.Test(target, arguments)
else:
self.Run(target, arguments) | Invoke a target.
This dispatches to either Test or Run depending on the target type.
| Invoke a target.
This dispatches to either Test or Run depending on the target type. | [
"Invoke",
"a",
"target",
".",
"This",
"dispatches",
"to",
"either",
"Test",
"or",
"Run",
"depending",
"on",
"the",
"target",
"type",
"."
] | def Invoke(self, targets, arguments):
for target in targets:
if target.is_test:
self.Test(target, arguments)
else:
self.Run(target, arguments) | [
"def",
"Invoke",
"(",
"self",
",",
"targets",
",",
"arguments",
")",
":",
"for",
"target",
"in",
"targets",
":",
"if",
"target",
".",
"is_test",
":",
"self",
".",
"Test",
"(",
"target",
",",
"arguments",
")",
"else",
":",
"self",
".",
"Run",
"(",
"... | Invoke a target. | [
"Invoke",
"a",
"target",
"."
] | [
"\"\"\"Invoke a target.\n\n This dispatches to either Test or Run depending on the target type.\n \"\"\""
] | [
{
"param": "self",
"type": null
},
{
"param": "targets",
"type": null
},
{
"param": "arguments",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "targets",
"type": null,
"docstring": null,
"docstring_tokens"... |
9c210061002262d19c0ab44cfaf3716d36966eb0 | sunlongbo/chromium | third_party/blink/tools/blinkpy/w3c/import_notifier.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | main | null | def main(self,
wpt_revision_start,
wpt_revision_end,
rebaselined_tests,
test_expectations,
new_override_expectations,
issue,
patchset,
dry_run=True,
service_account_key_json=None):
"""Files bug r... | Files bug reports for new failures.
Args:
wpt_revision_start: The start of the imported WPT revision range
(exclusive), i.e. the last imported revision.
wpt_revision_end: The end of the imported WPT revision range
(inclusive), i.e. the current imported re... | Files bug reports for new failures. | [
"Files",
"bug",
"reports",
"for",
"new",
"failures",
"."
] | def main(self,
wpt_revision_start,
wpt_revision_end,
rebaselined_tests,
test_expectations,
new_override_expectations,
issue,
patchset,
dry_run=True,
service_account_key_json=None):
gerrit_url = S... | [
"def",
"main",
"(",
"self",
",",
"wpt_revision_start",
",",
"wpt_revision_end",
",",
"rebaselined_tests",
",",
"test_expectations",
",",
"new_override_expectations",
",",
"issue",
",",
"patchset",
",",
"dry_run",
"=",
"True",
",",
"service_account_key_json",
"=",
"N... | Files bug reports for new failures. | [
"Files",
"bug",
"reports",
"for",
"new",
"failures",
"."
] | [
"\"\"\"Files bug reports for new failures.\n\n Args:\n wpt_revision_start: The start of the imported WPT revision range\n (exclusive), i.e. the last imported revision.\n wpt_revision_end: The end of the imported WPT revision range\n (inclusive), i.e. the cu... | [
{
"param": "self",
"type": null
},
{
"param": "wpt_revision_start",
"type": null
},
{
"param": "wpt_revision_end",
"type": null
},
{
"param": "rebaselined_tests",
"type": null
},
{
"param": "test_expectations",
"type": null
},
{
"param": "new_override_... | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "wpt_revision_start",
"type": null,
"docstring": "The start of the i... |
9c210061002262d19c0ab44cfaf3716d36966eb0 | sunlongbo/chromium | third_party/blink/tools/blinkpy/w3c/import_notifier.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | examine_baseline_changes | null | def examine_baseline_changes(self, changed_test_baselines,
gerrit_url_with_ps):
"""Examines all changed baselines to find new failures.
Args:
changed_test_baselines: A dictionary mapping test names to paths of
changed baselines.
g... | Examines all changed baselines to find new failures.
Args:
changed_test_baselines: A dictionary mapping test names to paths of
changed baselines.
gerrit_url_with_ps: Gerrit URL of this CL with the patchset number.
| Examines all changed baselines to find new failures. | [
"Examines",
"all",
"changed",
"baselines",
"to",
"find",
"new",
"failures",
"."
] | def examine_baseline_changes(self, changed_test_baselines,
gerrit_url_with_ps):
for test_name, changed_baselines in changed_test_baselines.items():
directory = self.find_owned_directory(test_name)
if not directory:
_log.warning('Cannot fin... | [
"def",
"examine_baseline_changes",
"(",
"self",
",",
"changed_test_baselines",
",",
"gerrit_url_with_ps",
")",
":",
"for",
"test_name",
",",
"changed_baselines",
"in",
"changed_test_baselines",
".",
"items",
"(",
")",
":",
"directory",
"=",
"self",
".",
"find_owned_... | Examines all changed baselines to find new failures. | [
"Examines",
"all",
"changed",
"baselines",
"to",
"find",
"new",
"failures",
"."
] | [
"\"\"\"Examines all changed baselines to find new failures.\n\n Args:\n changed_test_baselines: A dictionary mapping test names to paths of\n changed baselines.\n gerrit_url_with_ps: Gerrit URL of this CL with the patchset number.\n \"\"\""
] | [
{
"param": "self",
"type": null
},
{
"param": "changed_test_baselines",
"type": null
},
{
"param": "gerrit_url_with_ps",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "changed_test_baselines",
"type": null,
"docstring": "A dictionary m... |
9c210061002262d19c0ab44cfaf3716d36966eb0 | sunlongbo/chromium | third_party/blink/tools/blinkpy/w3c/import_notifier.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | more_failures_in_baseline | <not_specific> | def more_failures_in_baseline(self, baseline):
"""Determines if a testharness.js baseline file has new failures.
The file is assumed to have been modified in the current git checkout,
and so has a diff we can parse.
We recognize two types of failures: FAIL lines, which are output for a... | Determines if a testharness.js baseline file has new failures.
The file is assumed to have been modified in the current git checkout,
and so has a diff we can parse.
We recognize two types of failures: FAIL lines, which are output for a
specific subtest failing, and harness errors, whi... | Determines if a testharness.js baseline file has new failures.
The file is assumed to have been modified in the current git checkout,
and so has a diff we can parse.
We recognize two types of failures: FAIL lines, which are output for a
specific subtest failing, and harness errors, which indicate an uncaught
error in ... | [
"Determines",
"if",
"a",
"testharness",
".",
"js",
"baseline",
"file",
"has",
"new",
"failures",
".",
"The",
"file",
"is",
"assumed",
"to",
"have",
"been",
"modified",
"in",
"the",
"current",
"git",
"checkout",
"and",
"so",
"has",
"a",
"diff",
"we",
"can... | def more_failures_in_baseline(self, baseline):
diff = self.git.run(['diff', '-U0', 'origin/main', '--', baseline])
delta_failures = 0
delta_harness_errors = 0
for line in diff.splitlines():
if line.startswith('+FAIL'):
delta_failures += 1
if line.s... | [
"def",
"more_failures_in_baseline",
"(",
"self",
",",
"baseline",
")",
":",
"diff",
"=",
"self",
".",
"git",
".",
"run",
"(",
"[",
"'diff'",
",",
"'-U0'",
",",
"'origin/main'",
",",
"'--'",
",",
"baseline",
"]",
")",
"delta_failures",
"=",
"0",
"delta_ha... | Determines if a testharness.js baseline file has new failures. | [
"Determines",
"if",
"a",
"testharness",
".",
"js",
"baseline",
"file",
"has",
"new",
"failures",
"."
] | [
"\"\"\"Determines if a testharness.js baseline file has new failures.\n\n The file is assumed to have been modified in the current git checkout,\n and so has a diff we can parse.\n\n We recognize two types of failures: FAIL lines, which are output for a\n specific subtest failing, and ha... | [
{
"param": "self",
"type": null
},
{
"param": "baseline",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "baseline",
"type": null,
"docstring": null,
"docstring_tokens... |
9c210061002262d19c0ab44cfaf3716d36966eb0 | sunlongbo/chromium | third_party/blink/tools/blinkpy/w3c/import_notifier.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | create_bugs_for_product | <not_specific> | def create_bugs_for_product(self, wpt_revision_start, wpt_revision_end,
gerrit_url, product, expectation_lines):
"""Files bug reports for new failures per product
Args:
wpt_revision_start: The start of the imported WPT revision range
(exclusiv... | Files bug reports for new failures per product
Args:
wpt_revision_start: The start of the imported WPT revision range
(exclusive), i.e. the last imported revision.
wpt_revision_end: The end of the imported WPT revision range
(inclusive), i.e. the current ... | Files bug reports for new failures per product | [
"Files",
"bug",
"reports",
"for",
"new",
"failures",
"per",
"product"
] | def create_bugs_for_product(self, wpt_revision_start, wpt_revision_end,
gerrit_url, product, expectation_lines):
bugs = []
summary = '[WPT] New failures introduced by import {}'.format(gerrit_url)
prologue = ('WPT import {} introduced new failures:\n\n'
... | [
"def",
"create_bugs_for_product",
"(",
"self",
",",
"wpt_revision_start",
",",
"wpt_revision_end",
",",
"gerrit_url",
",",
"product",
",",
"expectation_lines",
")",
":",
"bugs",
"=",
"[",
"]",
"summary",
"=",
"'[WPT] New failures introduced by import {}'",
".",
"forma... | Files bug reports for new failures per product | [
"Files",
"bug",
"reports",
"for",
"new",
"failures",
"per",
"product"
] | [
"\"\"\"Files bug reports for new failures per product\n\n Args:\n wpt_revision_start: The start of the imported WPT revision range\n (exclusive), i.e. the last imported revision.\n wpt_revision_end: The end of the imported WPT revision range\n (inclusive), ... | [
{
"param": "self",
"type": null
},
{
"param": "wpt_revision_start",
"type": null
},
{
"param": "wpt_revision_end",
"type": null
},
{
"param": "gerrit_url",
"type": null
},
{
"param": "product",
"type": null
},
{
"param": "expectation_lines",
"type"... | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "wpt_revision_start",
"type": null,
"docstring": "The start of the i... |
9c210061002262d19c0ab44cfaf3716d36966eb0 | sunlongbo/chromium | third_party/blink/tools/blinkpy/w3c/import_notifier.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | create_bugs_from_new_failures | <not_specific> | def create_bugs_from_new_failures(self, wpt_revision_start,
wpt_revision_end, gerrit_url):
"""Files bug reports for new failures.
Args:
wpt_revision_start: The start of the imported WPT revision range
(exclusive), i.e. the last imported ... | Files bug reports for new failures.
Args:
wpt_revision_start: The start of the imported WPT revision range
(exclusive), i.e. the last imported revision.
wpt_revision_end: The end of the imported WPT revision range
(inclusive), i.e. the current imported re... | Files bug reports for new failures. | [
"Files",
"bug",
"reports",
"for",
"new",
"failures",
"."
] | def create_bugs_from_new_failures(self, wpt_revision_start,
wpt_revision_end, gerrit_url):
imported_commits = self.local_wpt.commits_in_range(
wpt_revision_start, wpt_revision_end)
bugs = []
for directory, failures in self.new_failures_by_directo... | [
"def",
"create_bugs_from_new_failures",
"(",
"self",
",",
"wpt_revision_start",
",",
"wpt_revision_end",
",",
"gerrit_url",
")",
":",
"imported_commits",
"=",
"self",
".",
"local_wpt",
".",
"commits_in_range",
"(",
"wpt_revision_start",
",",
"wpt_revision_end",
")",
"... | Files bug reports for new failures. | [
"Files",
"bug",
"reports",
"for",
"new",
"failures",
"."
] | [
"\"\"\"Files bug reports for new failures.\n\n Args:\n wpt_revision_start: The start of the imported WPT revision range\n (exclusive), i.e. the last imported revision.\n wpt_revision_end: The end of the imported WPT revision range\n (inclusive), i.e. the cu... | [
{
"param": "self",
"type": null
},
{
"param": "wpt_revision_start",
"type": null
},
{
"param": "wpt_revision_end",
"type": null
},
{
"param": "gerrit_url",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "wpt_revision_start",
"type": null,
"docstring": "The start of the i... |
9c210061002262d19c0ab44cfaf3716d36966eb0 | sunlongbo/chromium | third_party/blink/tools/blinkpy/w3c/import_notifier.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | format_commit_list | <not_specific> | def format_commit_list(self, imported_commits, directory):
"""Formats the list of imported WPT commits.
Imports affecting the given directory will be highlighted.
Args:
imported_commits: A list of (SHA, commit subject) pairs.
directory: An absolute path of a directory i... | Formats the list of imported WPT commits.
Imports affecting the given directory will be highlighted.
Args:
imported_commits: A list of (SHA, commit subject) pairs.
directory: An absolute path of a directory in the Chromium repo, for
which the list is formatted.
... | Formats the list of imported WPT commits.
Imports affecting the given directory will be highlighted. | [
"Formats",
"the",
"list",
"of",
"imported",
"WPT",
"commits",
".",
"Imports",
"affecting",
"the",
"given",
"directory",
"will",
"be",
"highlighted",
"."
] | def format_commit_list(self, imported_commits, directory):
path_from_wpt = self.host.filesystem.relpath(
directory, self.finder.path_from_web_tests('external', 'wpt'))
commit_list = ''
for sha, subject in imported_commits:
line = u'{}: {}'.format(subject, GITHUB_COMMIT_PR... | [
"def",
"format_commit_list",
"(",
"self",
",",
"imported_commits",
",",
"directory",
")",
":",
"path_from_wpt",
"=",
"self",
".",
"host",
".",
"filesystem",
".",
"relpath",
"(",
"directory",
",",
"self",
".",
"finder",
".",
"path_from_web_tests",
"(",
"'extern... | Formats the list of imported WPT commits. | [
"Formats",
"the",
"list",
"of",
"imported",
"WPT",
"commits",
"."
] | [
"\"\"\"Formats the list of imported WPT commits.\n\n Imports affecting the given directory will be highlighted.\n\n Args:\n imported_commits: A list of (SHA, commit subject) pairs.\n directory: An absolute path of a directory in the Chromium repo, for\n which the l... | [
{
"param": "self",
"type": null
},
{
"param": "imported_commits",
"type": null
},
{
"param": "directory",
"type": null
}
] | {
"returns": [
{
"docstring": "A multi-line string.",
"docstring_tokens": [
"A",
"multi",
"-",
"line",
"string",
"."
],
"type": null
}
],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstri... |
9c210061002262d19c0ab44cfaf3716d36966eb0 | sunlongbo/chromium | third_party/blink/tools/blinkpy/w3c/import_notifier.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | find_owned_directory | <not_specific> | def find_owned_directory(self, test_name):
"""Finds the lowest directory that contains the test and has OWNERS.
Args:
The name of the test (a path relative to web_tests).
Returns:
The path of the found directory relative to web_tests.
"""
# Always use no... | Finds the lowest directory that contains the test and has OWNERS.
Args:
The name of the test (a path relative to web_tests).
Returns:
The path of the found directory relative to web_tests.
| Finds the lowest directory that contains the test and has OWNERS.
Args:
The name of the test (a path relative to web_tests).
The path of the found directory relative to web_tests. | [
"Finds",
"the",
"lowest",
"directory",
"that",
"contains",
"the",
"test",
"and",
"has",
"OWNERS",
".",
"Args",
":",
"The",
"name",
"of",
"the",
"test",
"(",
"a",
"path",
"relative",
"to",
"web_tests",
")",
".",
"The",
"path",
"of",
"the",
"found",
"dir... | def find_owned_directory(self, test_name):
if self.default_port.lookup_virtual_test_base(test_name):
test_name = self.default_port.lookup_virtual_test_base(test_name)
abs_test_path = self.finder.path_from_web_tests(test_name)
owners_file = self.owners_extractor.find_owners_file(
... | [
"def",
"find_owned_directory",
"(",
"self",
",",
"test_name",
")",
":",
"if",
"self",
".",
"default_port",
".",
"lookup_virtual_test_base",
"(",
"test_name",
")",
":",
"test_name",
"=",
"self",
".",
"default_port",
".",
"lookup_virtual_test_base",
"(",
"test_name"... | Finds the lowest directory that contains the test and has OWNERS. | [
"Finds",
"the",
"lowest",
"directory",
"that",
"contains",
"the",
"test",
"and",
"has",
"OWNERS",
"."
] | [
"\"\"\"Finds the lowest directory that contains the test and has OWNERS.\n\n Args:\n The name of the test (a path relative to web_tests).\n\n Returns:\n The path of the found directory relative to web_tests.\n \"\"\"",
"# Always use non-virtual test names when looking up... | [
{
"param": "self",
"type": null
},
{
"param": "test_name",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "test_name",
"type": null,
"docstring": null,
"docstring_token... |
9c210061002262d19c0ab44cfaf3716d36966eb0 | sunlongbo/chromium | third_party/blink/tools/blinkpy/w3c/import_notifier.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | file_bugs | <not_specific> | def file_bugs(self, bugs, dry_run, service_account_key_json=None):
"""Files a list of bugs to Monorail.
Args:
bugs: A list of MonorailIssue objects.
dry_run: A boolean, whether we are in dry run mode.
service_account_key_json: Optional, see docs for main().
"... | Files a list of bugs to Monorail.
Args:
bugs: A list of MonorailIssue objects.
dry_run: A boolean, whether we are in dry run mode.
service_account_key_json: Optional, see docs for main().
| Files a list of bugs to Monorail. | [
"Files",
"a",
"list",
"of",
"bugs",
"to",
"Monorail",
"."
] | def file_bugs(self, bugs, dry_run, service_account_key_json=None):
if dry_run:
_log.info(
'[dry_run] Would have filed the %d bugs in the pending list.',
len(bugs))
return
_log.info('Filing %d bugs in the pending list to Monorail', len(bugs))
... | [
"def",
"file_bugs",
"(",
"self",
",",
"bugs",
",",
"dry_run",
",",
"service_account_key_json",
"=",
"None",
")",
":",
"if",
"dry_run",
":",
"_log",
".",
"info",
"(",
"'[dry_run] Would have filed the %d bugs in the pending list.'",
",",
"len",
"(",
"bugs",
")",
"... | Files a list of bugs to Monorail. | [
"Files",
"a",
"list",
"of",
"bugs",
"to",
"Monorail",
"."
] | [
"\"\"\"Files a list of bugs to Monorail.\n\n Args:\n bugs: A list of MonorailIssue objects.\n dry_run: A boolean, whether we are in dry run mode.\n service_account_key_json: Optional, see docs for main().\n \"\"\"",
"# TODO(robertma): Better error handling in this me... | [
{
"param": "self",
"type": null
},
{
"param": "bugs",
"type": null
},
{
"param": "dry_run",
"type": null
},
{
"param": "service_account_key_json",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "bugs",
"type": null,
"docstring": "A list of MonorailIssue objects.... |
7da10088897ee6e2ac58412e967223906d33f7cb | sunlongbo/chromium | tools/android/dependency_analysis/class_dependency.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | split_nested_class_from_key | Tuple[str, str] | def split_nested_class_from_key(key: str) -> Tuple[str, str]:
"""Splits a jdeps class name into its key and nested class, if any."""
re_match = JAVA_CLASS_FULL_NAME_REGEX.match(key)
package = re_match.group('package')
class_name = re_match.group('class_name')
nested = re_match.group('nested')
re... | Splits a jdeps class name into its key and nested class, if any. | Splits a jdeps class name into its key and nested class, if any. | [
"Splits",
"a",
"jdeps",
"class",
"name",
"into",
"its",
"key",
"and",
"nested",
"class",
"if",
"any",
"."
] | def split_nested_class_from_key(key: str) -> Tuple[str, str]:
re_match = JAVA_CLASS_FULL_NAME_REGEX.match(key)
package = re_match.group('package')
class_name = re_match.group('class_name')
nested = re_match.group('nested')
return java_class_params_to_key(package, class_name), nested | [
"def",
"split_nested_class_from_key",
"(",
"key",
":",
"str",
")",
"->",
"Tuple",
"[",
"str",
",",
"str",
"]",
":",
"re_match",
"=",
"JAVA_CLASS_FULL_NAME_REGEX",
".",
"match",
"(",
"key",
")",
"package",
"=",
"re_match",
".",
"group",
"(",
"'package'",
")... | Splits a jdeps class name into its key and nested class, if any. | [
"Splits",
"a",
"jdeps",
"class",
"name",
"into",
"its",
"key",
"and",
"nested",
"class",
"if",
"any",
"."
] | [
"\"\"\"Splits a jdeps class name into its key and nested class, if any.\"\"\""
] | [
{
"param": "key",
"type": "str"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "key",
"type": "str",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
7da10088897ee6e2ac58412e967223906d33f7cb | sunlongbo/chromium | tools/android/dependency_analysis/class_dependency.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | create_node_from_key | <not_specific> | def create_node_from_key(self, key: str):
"""See comment above the regex definition."""
re_match = JAVA_CLASS_FULL_NAME_REGEX.match(key)
package = re_match.group('package')
class_name = re_match.group('class_name')
return JavaClass(package, class_name) | See comment above the regex definition. | See comment above the regex definition. | [
"See",
"comment",
"above",
"the",
"regex",
"definition",
"."
] | def create_node_from_key(self, key: str):
re_match = JAVA_CLASS_FULL_NAME_REGEX.match(key)
package = re_match.group('package')
class_name = re_match.group('class_name')
return JavaClass(package, class_name) | [
"def",
"create_node_from_key",
"(",
"self",
",",
"key",
":",
"str",
")",
":",
"re_match",
"=",
"JAVA_CLASS_FULL_NAME_REGEX",
".",
"match",
"(",
"key",
")",
"package",
"=",
"re_match",
".",
"group",
"(",
"'package'",
")",
"class_name",
"=",
"re_match",
".",
... | See comment above the regex definition. | [
"See",
"comment",
"above",
"the",
"regex",
"definition",
"."
] | [
"\"\"\"See comment above the regex definition.\"\"\""
] | [
{
"param": "self",
"type": null
},
{
"param": "key",
"type": "str"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "key",
"type": "str",
"docstring": null,
"docstring_tokens": [... |
ddf8fc4385f735c018bb80fac2d096fcba946209 | sunlongbo/chromium | testing/chromoting/chromoting_test_utilities.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | RunCommandInSubProcess | <not_specific> | def RunCommandInSubProcess(command):
"""Creates a subprocess with command-line that is passed in.
Args:
command: The text of command to be executed.
Returns:
results: stdout contents of executing the command.
"""
cmd_line = [command]
try:
print('Going to run:\n%s' % command)
results = subp... | Creates a subprocess with command-line that is passed in.
Args:
command: The text of command to be executed.
Returns:
results: stdout contents of executing the command.
| Creates a subprocess with command-line that is passed in. | [
"Creates",
"a",
"subprocess",
"with",
"command",
"-",
"line",
"that",
"is",
"passed",
"in",
"."
] | def RunCommandInSubProcess(command):
cmd_line = [command]
try:
print('Going to run:\n%s' % command)
results = subprocess.check_output(cmd_line, stderr=subprocess.STDOUT,
shell=True)
except subprocess.CalledProcessError as e:
results = e.output
finally:
print... | [
"def",
"RunCommandInSubProcess",
"(",
"command",
")",
":",
"cmd_line",
"=",
"[",
"command",
"]",
"try",
":",
"print",
"(",
"'Going to run:\\n%s'",
"%",
"command",
")",
"results",
"=",
"subprocess",
".",
"check_output",
"(",
"cmd_line",
",",
"stderr",
"=",
"s... | Creates a subprocess with command-line that is passed in. | [
"Creates",
"a",
"subprocess",
"with",
"command",
"-",
"line",
"that",
"is",
"passed",
"in",
"."
] | [
"\"\"\"Creates a subprocess with command-line that is passed in.\n\n Args:\n command: The text of command to be executed.\n Returns:\n results: stdout contents of executing the command.\n \"\"\""
] | [
{
"param": "command",
"type": null
}
] | {
"returns": [
{
"docstring": "stdout contents of executing the command.",
"docstring_tokens": [
"stdout",
"contents",
"of",
"executing",
"the",
"command",
"."
],
"type": "results"
}
],
"raises": [],
"params": [
{
... |
ddf8fc4385f735c018bb80fac2d096fcba946209 | sunlongbo/chromium | testing/chromoting/chromoting_test_utilities.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | TestMachineCleanup | null | def TestMachineCleanup(user_profile_dir, host_logs=None):
"""Cleans up test machine so as not to impact other tests.
Args:
user_profile_dir: the user-profile folder used by Chromoting tests.
host_logs: List of me2me host logs; these will be deleted.
"""
# Stop the host service.
RunCommandInSubProces... | Cleans up test machine so as not to impact other tests.
Args:
user_profile_dir: the user-profile folder used by Chromoting tests.
host_logs: List of me2me host logs; these will be deleted.
| Cleans up test machine so as not to impact other tests. | [
"Cleans",
"up",
"test",
"machine",
"so",
"as",
"not",
"to",
"impact",
"other",
"tests",
"."
] | def TestMachineCleanup(user_profile_dir, host_logs=None):
RunCommandInSubProcess(CHROMOTING_HOST_PATH + ' --stop')
if host_logs:
for host_log in host_logs:
RunCommandInSubProcess('rm %s' % host_log)
if os.path.exists(user_profile_dir):
shutil.rmtree(user_profile_dir) | [
"def",
"TestMachineCleanup",
"(",
"user_profile_dir",
",",
"host_logs",
"=",
"None",
")",
":",
"RunCommandInSubProcess",
"(",
"CHROMOTING_HOST_PATH",
"+",
"' --stop'",
")",
"if",
"host_logs",
":",
"for",
"host_log",
"in",
"host_logs",
":",
"RunCommandInSubProcess",
... | Cleans up test machine so as not to impact other tests. | [
"Cleans",
"up",
"test",
"machine",
"so",
"as",
"not",
"to",
"impact",
"other",
"tests",
"."
] | [
"\"\"\"Cleans up test machine so as not to impact other tests.\n\n Args:\n user_profile_dir: the user-profile folder used by Chromoting tests.\n host_logs: List of me2me host logs; these will be deleted.\n \"\"\"",
"# Stop the host service.",
"# Cleanup any host logs.",
"# Remove the user-profile dir"... | [
{
"param": "user_profile_dir",
"type": null
},
{
"param": "host_logs",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "user_profile_dir",
"type": null,
"docstring": "the user-profile folder used by Chromoting tests.",
"docstring_tokens": [
"the",
"user",
"-",
"profile",
"folder",
"used",
... |
ddf8fc4385f735c018bb80fac2d096fcba946209 | sunlongbo/chromium | testing/chromoting/chromoting_test_utilities.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | InitialiseTestMachineForLinux | null | def InitialiseTestMachineForLinux(cfg_file):
"""Sets up a Linux machine for connect-to-host chromoting tests.
Copy over me2me host-config to expected locations.
By default, the Linux me2me host expects the host-config file to be under
$HOME/.config/chrome-remote-desktop
Its name is expected to have a hash th... | Sets up a Linux machine for connect-to-host chromoting tests.
Copy over me2me host-config to expected locations.
By default, the Linux me2me host expects the host-config file to be under
$HOME/.config/chrome-remote-desktop
Its name is expected to have a hash that is specific to a machine.
Args:
cfg_file... | Sets up a Linux machine for connect-to-host chromoting tests.
Copy over me2me host-config to expected locations.
By default, the Linux me2me host expects the host-config file to be under
$HOME/.config/chrome-remote-desktop
Its name is expected to have a hash that is specific to a machine. | [
"Sets",
"up",
"a",
"Linux",
"machine",
"for",
"connect",
"-",
"to",
"-",
"host",
"chromoting",
"tests",
".",
"Copy",
"over",
"me2me",
"host",
"-",
"config",
"to",
"expected",
"locations",
".",
"By",
"default",
"the",
"Linux",
"me2me",
"host",
"expects",
... | def InitialiseTestMachineForLinux(cfg_file):
home_dir = expanduser('~')
default_config_file_location = os.path.join(home_dir, '.config', CRD_ID)
if os.path.exists(default_config_file_location):
shutil.rmtree(default_config_file_location)
os.makedirs(default_config_file_location)
default_config_file_name =... | [
"def",
"InitialiseTestMachineForLinux",
"(",
"cfg_file",
")",
":",
"home_dir",
"=",
"expanduser",
"(",
"'~'",
")",
"default_config_file_location",
"=",
"os",
".",
"path",
".",
"join",
"(",
"home_dir",
",",
"'.config'",
",",
"CRD_ID",
")",
"if",
"os",
".",
"p... | Sets up a Linux machine for connect-to-host chromoting tests. | [
"Sets",
"up",
"a",
"Linux",
"machine",
"for",
"connect",
"-",
"to",
"-",
"host",
"chromoting",
"tests",
"."
] | [
"\"\"\"Sets up a Linux machine for connect-to-host chromoting tests.\n\n Copy over me2me host-config to expected locations.\n By default, the Linux me2me host expects the host-config file to be under\n $HOME/.config/chrome-remote-desktop\n Its name is expected to have a hash that is specific to a machine.\n\n ... | [
{
"param": "cfg_file",
"type": null
}
] | {
"returns": [],
"raises": [
{
"docstring": "if host did not start properly.",
"docstring_tokens": [
"if",
"host",
"did",
"not",
"start",
"properly",
"."
],
"type": "Exception"
}
],
"params": [
{
"identifier": "cfg... |
ddf8fc4385f735c018bb80fac2d096fcba946209 | sunlongbo/chromium | testing/chromoting/chromoting_test_utilities.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | RestartMe2MeHost | <not_specific> | def RestartMe2MeHost():
"""Stops and starts the Me2Me host on the test machine.
Launches the me2me start-host command, and parses the stdout of the execution
to obtain the host log-file name.
Returns:
log_file: Host log file.
Raises:
Exception: If host-log does not contain string indicating host is... | Stops and starts the Me2Me host on the test machine.
Launches the me2me start-host command, and parses the stdout of the execution
to obtain the host log-file name.
Returns:
log_file: Host log file.
Raises:
Exception: If host-log does not contain string indicating host is ready.
| Stops and starts the Me2Me host on the test machine.
Launches the me2me start-host command, and parses the stdout of the execution
to obtain the host log-file name. | [
"Stops",
"and",
"starts",
"the",
"Me2Me",
"host",
"on",
"the",
"test",
"machine",
".",
"Launches",
"the",
"me2me",
"start",
"-",
"host",
"command",
"and",
"parses",
"the",
"stdout",
"of",
"the",
"execution",
"to",
"obtain",
"the",
"host",
"log",
"-",
"fi... | def RestartMe2MeHost():
previous_directory = os.getcwd()
os.chdir(ISOLATE_TEMP_FOLDER)
RunCommandInSubProcess(CHROMOTING_HOST_PATH + ' --stop')
print('Starting chromoting host from %s' % CHROMOTING_HOST_PATH)
results = RunCommandInSubProcess(CHROMOTING_HOST_PATH + ' --start')
os.chdir(previous_directory)
... | [
"def",
"RestartMe2MeHost",
"(",
")",
":",
"previous_directory",
"=",
"os",
".",
"getcwd",
"(",
")",
"os",
".",
"chdir",
"(",
"ISOLATE_TEMP_FOLDER",
")",
"RunCommandInSubProcess",
"(",
"CHROMOTING_HOST_PATH",
"+",
"' --stop'",
")",
"print",
"(",
"'Starting chromoti... | Stops and starts the Me2Me host on the test machine. | [
"Stops",
"and",
"starts",
"the",
"Me2Me",
"host",
"on",
"the",
"test",
"machine",
"."
] | [
"\"\"\"Stops and starts the Me2Me host on the test machine.\n\n Launches the me2me start-host command, and parses the stdout of the execution\n to obtain the host log-file name.\n\n Returns:\n log_file: Host log file.\n\n Raises:\n Exception: If host-log does not contain string indicating host is ready.\n... | [] | {
"returns": [
{
"docstring": "Host log file.",
"docstring_tokens": [
"Host",
"log",
"file",
"."
],
"type": "log_file"
}
],
"raises": [
{
"docstring": "If host-log does not contain string indicating host is ready.",
"docstring_tokens"... |
ddf8fc4385f735c018bb80fac2d096fcba946209 | sunlongbo/chromium | testing/chromoting/chromoting_test_utilities.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | GetJidListFromTestResults | <not_specific> | def GetJidListFromTestResults(results):
"""Parse the output of a test execution to obtain the JID used by the test.
Args:
results: stdio contents of test execution.
Returns:
jids_used: List of JIDs used by test; empty list if not found.
"""
# Reg-ex defining the JID information in the string being ... | Parse the output of a test execution to obtain the JID used by the test.
Args:
results: stdio contents of test execution.
Returns:
jids_used: List of JIDs used by test; empty list if not found.
| Parse the output of a test execution to obtain the JID used by the test. | [
"Parse",
"the",
"output",
"of",
"a",
"test",
"execution",
"to",
"obtain",
"the",
"JID",
"used",
"by",
"the",
"test",
"."
] | def GetJidListFromTestResults(results):
jid_re = '(Connecting to )(.*.gserviceaccount.com/chromoting.*)(. Local.*)'
jids_used = []
for line in results.split('\n'):
match = re.search(jid_re, line)
if match:
jid_used = match.group(2)
if jid_used not in jids_used:
jids_used.append(jid_use... | [
"def",
"GetJidListFromTestResults",
"(",
"results",
")",
":",
"jid_re",
"=",
"'(Connecting to )(.*.gserviceaccount.com/chromoting.*)(. Local.*)'",
"jids_used",
"=",
"[",
"]",
"for",
"line",
"in",
"results",
".",
"split",
"(",
"'\\n'",
")",
":",
"match",
"=",
"re",
... | Parse the output of a test execution to obtain the JID used by the test. | [
"Parse",
"the",
"output",
"of",
"a",
"test",
"execution",
"to",
"obtain",
"the",
"JID",
"used",
"by",
"the",
"test",
"."
] | [
"\"\"\"Parse the output of a test execution to obtain the JID used by the test.\n\n Args:\n results: stdio contents of test execution.\n\n Returns:\n jids_used: List of JIDs used by test; empty list if not found.\n \"\"\"",
"# Reg-ex defining the JID information in the string being parsed."
] | [
{
"param": "results",
"type": null
}
] | {
"returns": [
{
"docstring": "List of JIDs used by test; empty list if not found.",
"docstring_tokens": [
"List",
"of",
"JIDs",
"used",
"by",
"test",
";",
"empty",
"list",
"if",
"not",
"found",
"."... |
ddf8fc4385f735c018bb80fac2d096fcba946209 | sunlongbo/chromium | testing/chromoting/chromoting_test_utilities.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | GetJidFromHostLog | <not_specific> | def GetJidFromHostLog(host_log_file):
"""Parse the me2me host log to obtain the JID that the host registered.
Args:
host_log_file: path to host-log file that should be parsed for a JID.
Returns:
host_jid: host-JID if found in host-log, else None
"""
host_jid = None
with open(host_log_file, 'r') as... | Parse the me2me host log to obtain the JID that the host registered.
Args:
host_log_file: path to host-log file that should be parsed for a JID.
Returns:
host_jid: host-JID if found in host-log, else None
| Parse the me2me host log to obtain the JID that the host registered. | [
"Parse",
"the",
"me2me",
"host",
"log",
"to",
"obtain",
"the",
"JID",
"that",
"the",
"host",
"registered",
"."
] | def GetJidFromHostLog(host_log_file):
host_jid = None
with open(host_log_file, 'r') as log_file:
for line in log_file:
if 'Signaling connected. ' in line:
components = line.split(':')
host_jid = components[-1].lstrip()
break
return host_jid | [
"def",
"GetJidFromHostLog",
"(",
"host_log_file",
")",
":",
"host_jid",
"=",
"None",
"with",
"open",
"(",
"host_log_file",
",",
"'r'",
")",
"as",
"log_file",
":",
"for",
"line",
"in",
"log_file",
":",
"if",
"'Signaling connected. '",
"in",
"line",
":",
"comp... | Parse the me2me host log to obtain the JID that the host registered. | [
"Parse",
"the",
"me2me",
"host",
"log",
"to",
"obtain",
"the",
"JID",
"that",
"the",
"host",
"registered",
"."
] | [
"\"\"\"Parse the me2me host log to obtain the JID that the host registered.\n\n Args:\n host_log_file: path to host-log file that should be parsed for a JID.\n\n Returns:\n host_jid: host-JID if found in host-log, else None\n \"\"\"",
"# The host JID will be recorded in a line saying 'Signaling",
"# co... | [
{
"param": "host_log_file",
"type": null
}
] | {
"returns": [
{
"docstring": "host-JID if found in host-log, else None",
"docstring_tokens": [
"host",
"-",
"JID",
"if",
"found",
"in",
"host",
"-",
"log",
"else",
"None"
],
"type": "host_jid"
}
... |
4db630e686524fecd6e0a07c86d715783d850213 | sunlongbo/chromium | tools/fuchsia/comparative_tester/test_results.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | UnitStringIsValid | bool | def UnitStringIsValid(unit: str) -> bool:
"""Checks to make sure that a given string is in fact a recognized unit used
by the chromium perftests to report results.
Args:
unit (str): The unit string to be checked.
Returns:
bool: Whether or not it is a unit.
"""
accepted_units = [
"us/hop"... | Checks to make sure that a given string is in fact a recognized unit used
by the chromium perftests to report results.
Args:
unit (str): The unit string to be checked.
Returns:
bool: Whether or not it is a unit.
| Checks to make sure that a given string is in fact a recognized unit used
by the chromium perftests to report results. | [
"Checks",
"to",
"make",
"sure",
"that",
"a",
"given",
"string",
"is",
"in",
"fact",
"a",
"recognized",
"unit",
"used",
"by",
"the",
"chromium",
"perftests",
"to",
"report",
"results",
"."
] | def UnitStringIsValid(unit: str) -> bool:
accepted_units = [
"us/hop", "us/task", "ns/sample", "ms", "s", "count", "KB", "MB/s", "us"
]
return unit in accepted_units | [
"def",
"UnitStringIsValid",
"(",
"unit",
":",
"str",
")",
"->",
"bool",
":",
"accepted_units",
"=",
"[",
"\"us/hop\"",
",",
"\"us/task\"",
",",
"\"ns/sample\"",
",",
"\"ms\"",
",",
"\"s\"",
",",
"\"count\"",
",",
"\"KB\"",
",",
"\"MB/s\"",
",",
"\"us\"",
"... | Checks to make sure that a given string is in fact a recognized unit used
by the chromium perftests to report results. | [
"Checks",
"to",
"make",
"sure",
"that",
"a",
"given",
"string",
"is",
"in",
"fact",
"a",
"recognized",
"unit",
"used",
"by",
"the",
"chromium",
"perftests",
"to",
"report",
"results",
"."
] | [
"\"\"\"Checks to make sure that a given string is in fact a recognized unit used\n by the chromium perftests to report results.\n\n Args:\n unit (str): The unit string to be checked.\n\n Returns:\n bool: Whether or not it is a unit.\n \"\"\""
] | [
{
"param": "unit",
"type": "str"
}
] | {
"returns": [
{
"docstring": "Whether or not it is a unit.",
"docstring_tokens": [
"Whether",
"or",
"not",
"it",
"is",
"a",
"unit",
"."
],
"type": "bool"
}
],
"raises": [],
"params": [
{
"identifier": "uni... |
4db630e686524fecd6e0a07c86d715783d850213 | sunlongbo/chromium | tools/fuchsia/comparative_tester/test_results.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | ToJsonDict | Dict[str, Any] | def ToJsonDict(self) -> Dict[str, Any]:
"""Converts a ResultLine into a JSON-serializable dictionary object.
Returns:
Dict[str, Any]: A mapping of strings that will appear in the output JSON
object to their respective values.
"""
return {
"description": self.desc,
"meas... | Converts a ResultLine into a JSON-serializable dictionary object.
Returns:
Dict[str, Any]: A mapping of strings that will appear in the output JSON
object to their respective values.
| Converts a ResultLine into a JSON-serializable dictionary object. | [
"Converts",
"a",
"ResultLine",
"into",
"a",
"JSON",
"-",
"serializable",
"dictionary",
"object",
"."
] | def ToJsonDict(self) -> Dict[str, Any]:
return {
"description": self.desc,
"measurement": self.meas,
"unit": self.unit,
} | [
"def",
"ToJsonDict",
"(",
"self",
")",
"->",
"Dict",
"[",
"str",
",",
"Any",
"]",
":",
"return",
"{",
"\"description\"",
":",
"self",
".",
"desc",
",",
"\"measurement\"",
":",
"self",
".",
"meas",
",",
"\"unit\"",
":",
"self",
".",
"unit",
",",
"}"
] | Converts a ResultLine into a JSON-serializable dictionary object. | [
"Converts",
"a",
"ResultLine",
"into",
"a",
"JSON",
"-",
"serializable",
"dictionary",
"object",
"."
] | [
"\"\"\"Converts a ResultLine into a JSON-serializable dictionary object.\n\n Returns:\n Dict[str, Any]: A mapping of strings that will appear in the output JSON\n object to their respective values.\n \"\"\""
] | [
{
"param": "self",
"type": null
}
] | {
"returns": [
{
"docstring": "A mapping of strings that will appear in the output JSON\nobject to their respective values.",
"docstring_tokens": [
"A",
"mapping",
"of",
"strings",
"that",
"will",
"appear",
"in",
"the",
"o... |
4db630e686524fecd6e0a07c86d715783d850213 | sunlongbo/chromium | tools/fuchsia/comparative_tester/test_results.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | ReadResultLineFromJson | ResultLine | def ReadResultLineFromJson(dct: Dict[str, Any]) -> ResultLine:
"""Converts a JSON dictionary object into a ResultLine.
Args:
dct (Dict[str, Any]): The JSON object to be parsed as a ResultLine. MUST
contain the strings 'description', 'measurement', and 'unit'.
Raises:
KeyError: If the passed in d... | Converts a JSON dictionary object into a ResultLine.
Args:
dct (Dict[str, Any]): The JSON object to be parsed as a ResultLine. MUST
contain the strings 'description', 'measurement', and 'unit'.
Raises:
KeyError: If the passed in dictionary does not contain the three required
strings that a... | Converts a JSON dictionary object into a ResultLine. | [
"Converts",
"a",
"JSON",
"dictionary",
"object",
"into",
"a",
"ResultLine",
"."
] | def ReadResultLineFromJson(dct: Dict[str, Any]) -> ResultLine:
return ResultLine(dct["description"], float(dct["measurement"]), dct["unit"]) | [
"def",
"ReadResultLineFromJson",
"(",
"dct",
":",
"Dict",
"[",
"str",
",",
"Any",
"]",
")",
"->",
"ResultLine",
":",
"return",
"ResultLine",
"(",
"dct",
"[",
"\"description\"",
"]",
",",
"float",
"(",
"dct",
"[",
"\"measurement\"",
"]",
")",
",",
"dct",
... | Converts a JSON dictionary object into a ResultLine. | [
"Converts",
"a",
"JSON",
"dictionary",
"object",
"into",
"a",
"ResultLine",
"."
] | [
"\"\"\"Converts a JSON dictionary object into a ResultLine.\n\n Args:\n dct (Dict[str, Any]): The JSON object to be parsed as a ResultLine. MUST\n contain the strings 'description', 'measurement', and 'unit'.\n\n Raises:\n KeyError: If the passed in dictionary does not contain the three required\n ... | [
{
"param": "dct",
"type": "Dict[str, Any]"
}
] | {
"returns": [
{
"docstring": "A ResultLine object reconstituted from the JSON dictionary.",
"docstring_tokens": [
"A",
"ResultLine",
"object",
"reconstituted",
"from",
"the",
"JSON",
"dictionary",
"."
],
"type": "Resu... |
4db630e686524fecd6e0a07c86d715783d850213 | sunlongbo/chromium | tools/fuchsia/comparative_tester/test_results.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | ResultLineFromStdout | Optional[ResultLine] | def ResultLineFromStdout(line: str) -> Optional[ResultLine]:
"""Takes a line of stdout data and attempts to parse it into a ResultLine.
Args:
line (str): The stdout line to be converted
Returns:
Optional[ResultLine]: The output is Optional, because the line may be noise,
or in some way incorrect... | Takes a line of stdout data and attempts to parse it into a ResultLine.
Args:
line (str): The stdout line to be converted
Returns:
Optional[ResultLine]: The output is Optional, because the line may be noise,
or in some way incorrectly formatted and unparseable.
| Takes a line of stdout data and attempts to parse it into a ResultLine. | [
"Takes",
"a",
"line",
"of",
"stdout",
"data",
"and",
"attempts",
"to",
"parse",
"it",
"into",
"a",
"ResultLine",
"."
] | def ResultLineFromStdout(line: str) -> Optional[ResultLine]:
if "pkgsvr" in line:
return None
chunks = line.split()
if len(chunks) < 3:
logging.warning("The line {} contains too few space-separated pieces to be "
"parsed as a ResultLine".format(line))
return None
unit = chunks[-... | [
"def",
"ResultLineFromStdout",
"(",
"line",
":",
"str",
")",
"->",
"Optional",
"[",
"ResultLine",
"]",
":",
"if",
"\"pkgsvr\"",
"in",
"line",
":",
"return",
"None",
"chunks",
"=",
"line",
".",
"split",
"(",
")",
"if",
"len",
"(",
"chunks",
")",
"<",
... | Takes a line of stdout data and attempts to parse it into a ResultLine. | [
"Takes",
"a",
"line",
"of",
"stdout",
"data",
"and",
"attempts",
"to",
"parse",
"it",
"into",
"a",
"ResultLine",
"."
] | [
"\"\"\"Takes a line of stdout data and attempts to parse it into a ResultLine.\n\n Args:\n line (str): The stdout line to be converted\n\n Returns:\n Optional[ResultLine]: The output is Optional, because the line may be noise,\n or in some way incorrectly formatted and unparseable.\n \"\"\"",
"# F... | [
{
"param": "line",
"type": "str"
}
] | {
"returns": [
{
"docstring": "The output is Optional, because the line may be noise,\nor in some way incorrectly formatted and unparseable.",
"docstring_tokens": [
"The",
"output",
"is",
"Optional",
"because",
"the",
"line",
"may",
... |
4db630e686524fecd6e0a07c86d715783d850213 | sunlongbo/chromium | tools/fuchsia/comparative_tester/test_results.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | ToJsonDict | Dict[str, Any] | def ToJsonDict(self) -> Dict[str, Any]:
"""Converts a TestResult object to a JSON-serializable dictionary.
Returns:
Dict[str, Any]: The output dictionary object that can be directly
serialized to JSON.
"""
return {
"name": self.name,
"time_in_ms": self.time,
"lin... | Converts a TestResult object to a JSON-serializable dictionary.
Returns:
Dict[str, Any]: The output dictionary object that can be directly
serialized to JSON.
| Converts a TestResult object to a JSON-serializable dictionary. | [
"Converts",
"a",
"TestResult",
"object",
"to",
"a",
"JSON",
"-",
"serializable",
"dictionary",
"."
] | def ToJsonDict(self) -> Dict[str, Any]:
return {
"name": self.name,
"time_in_ms": self.time,
"lines": [line.ToJsonDict() for line in self.lines]
} | [
"def",
"ToJsonDict",
"(",
"self",
")",
"->",
"Dict",
"[",
"str",
",",
"Any",
"]",
":",
"return",
"{",
"\"name\"",
":",
"self",
".",
"name",
",",
"\"time_in_ms\"",
":",
"self",
".",
"time",
",",
"\"lines\"",
":",
"[",
"line",
".",
"ToJsonDict",
"(",
... | Converts a TestResult object to a JSON-serializable dictionary. | [
"Converts",
"a",
"TestResult",
"object",
"to",
"a",
"JSON",
"-",
"serializable",
"dictionary",
"."
] | [
"\"\"\"Converts a TestResult object to a JSON-serializable dictionary.\n\n Returns:\n Dict[str, Any]: The output dictionary object that can be directly\n serialized to JSON.\n \"\"\""
] | [
{
"param": "self",
"type": null
}
] | {
"returns": [
{
"docstring": "The output dictionary object that can be directly\nserialized to JSON.",
"docstring_tokens": [
"The",
"output",
"dictionary",
"object",
"that",
"can",
"be",
"directly",
"serialized",
"to",
... |
4db630e686524fecd6e0a07c86d715783d850213 | sunlongbo/chromium | tools/fuchsia/comparative_tester/test_results.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | ReadTestFromJson | TestResult | def ReadTestFromJson(obj_dict: Dict[str, Any]) -> TestResult:
"""Reconstitutes a TestResult read from a JSON file back into a TestResult
object.
Args:
obj_dict (Dict[str, Any]): The JSON object as read from an output JSON file.
Returns:
TestResult: The reconstituted TestResult object.
"""
name = o... | Reconstitutes a TestResult read from a JSON file back into a TestResult
object.
Args:
obj_dict (Dict[str, Any]): The JSON object as read from an output JSON file.
Returns:
TestResult: The reconstituted TestResult object.
| Reconstitutes a TestResult read from a JSON file back into a TestResult
object. | [
"Reconstitutes",
"a",
"TestResult",
"read",
"from",
"a",
"JSON",
"file",
"back",
"into",
"a",
"TestResult",
"object",
"."
] | def ReadTestFromJson(obj_dict: Dict[str, Any]) -> TestResult:
name = obj_dict["name"]
time = obj_dict["time_in_ms"]
lines = [ReadResultLineFromJson(line) for line in obj_dict["lines"]]
return TestResult(name, time, lines) | [
"def",
"ReadTestFromJson",
"(",
"obj_dict",
":",
"Dict",
"[",
"str",
",",
"Any",
"]",
")",
"->",
"TestResult",
":",
"name",
"=",
"obj_dict",
"[",
"\"name\"",
"]",
"time",
"=",
"obj_dict",
"[",
"\"time_in_ms\"",
"]",
"lines",
"=",
"[",
"ReadResultLineFromJs... | Reconstitutes a TestResult read from a JSON file back into a TestResult
object. | [
"Reconstitutes",
"a",
"TestResult",
"read",
"from",
"a",
"JSON",
"file",
"back",
"into",
"a",
"TestResult",
"object",
"."
] | [
"\"\"\"Reconstitutes a TestResult read from a JSON file back into a TestResult\n object.\n\n Args:\n obj_dict (Dict[str, Any]): The JSON object as read from an output JSON file.\n\n Returns:\n TestResult: The reconstituted TestResult object.\n \"\"\""
] | [
{
"param": "obj_dict",
"type": "Dict[str, Any]"
}
] | {
"returns": [
{
"docstring": "The reconstituted TestResult object.",
"docstring_tokens": [
"The",
"reconstituted",
"TestResult",
"object",
"."
],
"type": "TestResult"
}
],
"raises": [],
"params": [
{
"identifier": "obj_dict",
... |
4db630e686524fecd6e0a07c86d715783d850213 | sunlongbo/chromium | tools/fuchsia/comparative_tester/test_results.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | ExtractTestInfo | Tuple[str, float] | def ExtractTestInfo(line: str) -> Tuple[str, float]:
"""Deconstructs a line starting with OK, stating that the test finished
successfully, and isolates the timing measurement as well as a descriptive
string for the test
Args:
line (str): The line of output to attempt to destructure into name and time.
R... | Deconstructs a line starting with OK, stating that the test finished
successfully, and isolates the timing measurement as well as a descriptive
string for the test
Args:
line (str): The line of output to attempt to destructure into name and time.
Raises:
Exception: In the event that it couldn't split ... | Deconstructs a line starting with OK, stating that the test finished
successfully, and isolates the timing measurement as well as a descriptive
string for the test | [
"Deconstructs",
"a",
"line",
"starting",
"with",
"OK",
"stating",
"that",
"the",
"test",
"finished",
"successfully",
"and",
"isolates",
"the",
"timing",
"measurement",
"as",
"well",
"as",
"a",
"descriptive",
"string",
"for",
"the",
"test"
] | def ExtractTestInfo(line: str) -> Tuple[str, float]:
trimmed = line.lstrip("[ OK ]").strip()
try:
test_name, rest = trimmed.split("(")
except Exception as e:
err_text = "Could not extract the case name from {} because of error {}"\
.format(trimmed, str(e))
raise Exception(err_te... | [
"def",
"ExtractTestInfo",
"(",
"line",
":",
"str",
")",
"->",
"Tuple",
"[",
"str",
",",
"float",
"]",
":",
"trimmed",
"=",
"line",
".",
"lstrip",
"(",
"\"[ OK ]\"",
")",
".",
"strip",
"(",
")",
"try",
":",
"test_name",
",",
"rest",
"=",
"trimme... | Deconstructs a line starting with OK, stating that the test finished
successfully, and isolates the timing measurement as well as a descriptive
string for the test | [
"Deconstructs",
"a",
"line",
"starting",
"with",
"OK",
"stating",
"that",
"the",
"test",
"finished",
"successfully",
"and",
"isolates",
"the",
"timing",
"measurement",
"as",
"well",
"as",
"a",
"descriptive",
"string",
"for",
"the",
"test"
] | [
"\"\"\"Deconstructs a line starting with OK, stating that the test finished\n successfully, and isolates the timing measurement as well as a descriptive\n string for the test\n\n Args:\n line (str): The line of output to attempt to destructure into name and time.\n\n Raises:\n Exception: In the event that... | [
{
"param": "line",
"type": "str"
}
] | {
"returns": [
{
"docstring": "A tuple of the test name, and the amount of time it took\nto run.",
"docstring_tokens": [
"A",
"tuple",
"of",
"the",
"test",
"name",
"and",
"the",
"amount",
"of",
"time",
"it"... |
4db630e686524fecd6e0a07c86d715783d850213 | sunlongbo/chromium | tools/fuchsia/comparative_tester/test_results.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | TaggedTestFromLines | TestResult | def TaggedTestFromLines(lines: List[str]) -> TestResult:
"""Takes a chunk of lines gathered together from the stdout of a test process
and collects it all into a single test result, including the set of
ResultLines inside of the TestResult.
Args:
lines (List[str]): The stdout lines to be parsed into a sing... | Takes a chunk of lines gathered together from the stdout of a test process
and collects it all into a single test result, including the set of
ResultLines inside of the TestResult.
Args:
lines (List[str]): The stdout lines to be parsed into a single test result
Returns:
TestResult: The final parsed Te... | Takes a chunk of lines gathered together from the stdout of a test process
and collects it all into a single test result, including the set of
ResultLines inside of the TestResult. | [
"Takes",
"a",
"chunk",
"of",
"lines",
"gathered",
"together",
"from",
"the",
"stdout",
"of",
"a",
"test",
"process",
"and",
"collects",
"it",
"all",
"into",
"a",
"single",
"test",
"result",
"including",
"the",
"set",
"of",
"ResultLines",
"inside",
"of",
"t... | def TaggedTestFromLines(lines: List[str]) -> TestResult:
test_name, time = ExtractTestInfo(lines[-1])
res_lines = []
for line in lines[:-1]:
res_line = ResultLineFromStdout(line)
if res_line:
res_lines.append(res_line)
else:
logging.warning("Couldn't parse line {} into a ResultLine".format... | [
"def",
"TaggedTestFromLines",
"(",
"lines",
":",
"List",
"[",
"str",
"]",
")",
"->",
"TestResult",
":",
"test_name",
",",
"time",
"=",
"ExtractTestInfo",
"(",
"lines",
"[",
"-",
"1",
"]",
")",
"res_lines",
"=",
"[",
"]",
"for",
"line",
"in",
"lines",
... | Takes a chunk of lines gathered together from the stdout of a test process
and collects it all into a single test result, including the set of
ResultLines inside of the TestResult. | [
"Takes",
"a",
"chunk",
"of",
"lines",
"gathered",
"together",
"from",
"the",
"stdout",
"of",
"a",
"test",
"process",
"and",
"collects",
"it",
"all",
"into",
"a",
"single",
"test",
"result",
"including",
"the",
"set",
"of",
"ResultLines",
"inside",
"of",
"t... | [
"\"\"\"Takes a chunk of lines gathered together from the stdout of a test process\n and collects it all into a single test result, including the set of\n ResultLines inside of the TestResult.\n\n Args:\n lines (List[str]): The stdout lines to be parsed into a single test result\n\n Returns:\n TestResult: ... | [
{
"param": "lines",
"type": "List[str]"
}
] | {
"returns": [
{
"docstring": "The final parsed TestResult from the input",
"docstring_tokens": [
"The",
"final",
"parsed",
"TestResult",
"from",
"the",
"input"
],
"type": "TestResult"
}
],
"raises": [],
"params": [
{
... |
4db630e686524fecd6e0a07c86d715783d850213 | sunlongbo/chromium | tools/fuchsia/comparative_tester/test_results.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | ToJsonDict | Dict[str, Any] | def ToJsonDict(self) -> Dict[str, Any]:
"""Converts a TargetResult to a JSON-serializable dict.
Returns:
Dict[str, Any]: The TargetResult in JSON-serializable form.
"""
return {
"name": self.name,
"tests": [test.ToJsonDict() for test in self.tests]
} | Converts a TargetResult to a JSON-serializable dict.
Returns:
Dict[str, Any]: The TargetResult in JSON-serializable form.
| Converts a TargetResult to a JSON-serializable dict. | [
"Converts",
"a",
"TargetResult",
"to",
"a",
"JSON",
"-",
"serializable",
"dict",
"."
] | def ToJsonDict(self) -> Dict[str, Any]:
return {
"name": self.name,
"tests": [test.ToJsonDict() for test in self.tests]
} | [
"def",
"ToJsonDict",
"(",
"self",
")",
"->",
"Dict",
"[",
"str",
",",
"Any",
"]",
":",
"return",
"{",
"\"name\"",
":",
"self",
".",
"name",
",",
"\"tests\"",
":",
"[",
"test",
".",
"ToJsonDict",
"(",
")",
"for",
"test",
"in",
"self",
".",
"tests",
... | Converts a TargetResult to a JSON-serializable dict. | [
"Converts",
"a",
"TargetResult",
"to",
"a",
"JSON",
"-",
"serializable",
"dict",
"."
] | [
"\"\"\"Converts a TargetResult to a JSON-serializable dict.\n\n Returns:\n Dict[str, Any]: The TargetResult in JSON-serializable form.\n \"\"\""
] | [
{
"param": "self",
"type": null
}
] | {
"returns": [
{
"docstring": "The TargetResult in JSON-serializable form.",
"docstring_tokens": [
"The",
"TargetResult",
"in",
"JSON",
"-",
"serializable",
"form",
"."
],
"type": "Dict[str, Any]"
}
],
"raises": [],
... |
4db630e686524fecd6e0a07c86d715783d850213 | sunlongbo/chromium | tools/fuchsia/comparative_tester/test_results.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | WriteToJson | None | def WriteToJson(self, path: str) -> None:
"""Writes this TargetResult object as a JSON file at the given file path.
Args:
path (str): The location to place the serialized version of this object.
Returns:
None: It'd return IO (), but this Python.
"""
with open(path, "w") as outfile:
... | Writes this TargetResult object as a JSON file at the given file path.
Args:
path (str): The location to place the serialized version of this object.
Returns:
None: It'd return IO (), but this Python.
| Writes this TargetResult object as a JSON file at the given file path. | [
"Writes",
"this",
"TargetResult",
"object",
"as",
"a",
"JSON",
"file",
"at",
"the",
"given",
"file",
"path",
"."
] | def WriteToJson(self, path: str) -> None:
with open(path, "w") as outfile:
json.dump(self.ToJsonDict(), outfile, indent=2) | [
"def",
"WriteToJson",
"(",
"self",
",",
"path",
":",
"str",
")",
"->",
"None",
":",
"with",
"open",
"(",
"path",
",",
"\"w\"",
")",
"as",
"outfile",
":",
"json",
".",
"dump",
"(",
"self",
".",
"ToJsonDict",
"(",
")",
",",
"outfile",
",",
"indent",
... | Writes this TargetResult object as a JSON file at the given file path. | [
"Writes",
"this",
"TargetResult",
"object",
"as",
"a",
"JSON",
"file",
"at",
"the",
"given",
"file",
"path",
"."
] | [
"\"\"\"Writes this TargetResult object as a JSON file at the given file path.\n\n Args:\n path (str): The location to place the serialized version of this object.\n\n Returns:\n None: It'd return IO (), but this Python.\n \"\"\""
] | [
{
"param": "self",
"type": null
},
{
"param": "path",
"type": "str"
}
] | {
"returns": [
{
"docstring": "It'd return IO (), but this Python.",
"docstring_tokens": [
"It",
"'",
"d",
"return",
"IO",
"()",
"but",
"this",
"Python",
"."
],
"type": "None"
}
],
"raises": [],
"para... |
4db630e686524fecd6e0a07c86d715783d850213 | sunlongbo/chromium | tools/fuchsia/comparative_tester/test_results.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | ReadTargetFromJson | Optional[TargetResult] | def ReadTargetFromJson(path: str) -> Optional[TargetResult]:
"""Takes a file path and attempts to parse a TargetResult from it.
Args:
path (str): The location of the JSON-serialized TargetResult to read.
Returns:
Optional[TargetResult]: Again, technically should be wrapped in an IO,
but Python.
... | Takes a file path and attempts to parse a TargetResult from it.
Args:
path (str): The location of the JSON-serialized TargetResult to read.
Returns:
Optional[TargetResult]: Again, technically should be wrapped in an IO,
but Python.
| Takes a file path and attempts to parse a TargetResult from it. | [
"Takes",
"a",
"file",
"path",
"and",
"attempts",
"to",
"parse",
"a",
"TargetResult",
"from",
"it",
"."
] | def ReadTargetFromJson(path: str) -> Optional[TargetResult]:
with open(path, "r") as json_file:
dct = json.load(json_file)
return TargetResult(
dct["name"], [ReadTestFromJson(test_dct) for test_dct in dct["tests"]]) | [
"def",
"ReadTargetFromJson",
"(",
"path",
":",
"str",
")",
"->",
"Optional",
"[",
"TargetResult",
"]",
":",
"with",
"open",
"(",
"path",
",",
"\"r\"",
")",
"as",
"json_file",
":",
"dct",
"=",
"json",
".",
"load",
"(",
"json_file",
")",
"return",
"Targe... | Takes a file path and attempts to parse a TargetResult from it. | [
"Takes",
"a",
"file",
"path",
"and",
"attempts",
"to",
"parse",
"a",
"TargetResult",
"from",
"it",
"."
] | [
"\"\"\"Takes a file path and attempts to parse a TargetResult from it.\n\n Args:\n path (str): The location of the JSON-serialized TargetResult to read.\n\n Returns:\n Optional[TargetResult]: Again, technically should be wrapped in an IO,\n but Python.\n \"\"\""
] | [
{
"param": "path",
"type": "str"
}
] | {
"returns": [
{
"docstring": "Again, technically should be wrapped in an IO,\nbut Python.",
"docstring_tokens": [
"Again",
"technically",
"should",
"be",
"wrapped",
"in",
"an",
"IO",
"but",
"Python",
"."
],
... |
4db630e686524fecd6e0a07c86d715783d850213 | sunlongbo/chromium | tools/fuchsia/comparative_tester/test_results.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | TargetResultFromStdout | TargetResult | def TargetResultFromStdout(lines: List[str], name: str) -> TargetResult:
"""TargetResultFromStdout attempts to associate GTest names to the lines of
output that they produce. Example input looks something like the following:
[ RUN ] TestNameFoo
INFO measurement units
...
[ OK ] TestNameFoo (meas... | TargetResultFromStdout attempts to associate GTest names to the lines of
output that they produce. Example input looks something like the following:
[ RUN ] TestNameFoo
INFO measurement units
...
[ OK ] TestNameFoo (measurement units)
...
Unfortunately, Because the results of output from perf... | TargetResultFromStdout attempts to associate GTest names to the lines of
output that they produce. Example input looks something like the following.
[ RUN ] TestNameFoo
INFO measurement units
[ OK ] TestNameFoo (measurement units)
Unfortunately, Because the results of output from perftest targets is not
n... | [
"TargetResultFromStdout",
"attempts",
"to",
"associate",
"GTest",
"names",
"to",
"the",
"lines",
"of",
"output",
"that",
"they",
"produce",
".",
"Example",
"input",
"looks",
"something",
"like",
"the",
"following",
".",
"[",
"RUN",
"]",
"TestNameFoo",
"INFO",
... | def TargetResultFromStdout(lines: List[str], name: str) -> TargetResult:
test_line_lists = []
test_line_accum = []
read_lines = False
for line in lines:
if line.startswith("[ RUN ]"):
read_lines = True
if len(test_line_accum) > 0:
test_line_lists.append(test_line_accum)
... | [
"def",
"TargetResultFromStdout",
"(",
"lines",
":",
"List",
"[",
"str",
"]",
",",
"name",
":",
"str",
")",
"->",
"TargetResult",
":",
"test_line_lists",
"=",
"[",
"]",
"test_line_accum",
"=",
"[",
"]",
"read_lines",
"=",
"False",
"for",
"line",
"in",
"li... | TargetResultFromStdout attempts to associate GTest names to the lines of
output that they produce. | [
"TargetResultFromStdout",
"attempts",
"to",
"associate",
"GTest",
"names",
"to",
"the",
"lines",
"of",
"output",
"that",
"they",
"produce",
"."
] | [
"\"\"\"TargetResultFromStdout attempts to associate GTest names to the lines of\n output that they produce. Example input looks something like the following:\n\n [ RUN ] TestNameFoo\n INFO measurement units\n ...\n [ OK ] TestNameFoo (measurement units)\n ...\n\n Unfortunately, Because the results... | [
{
"param": "lines",
"type": "List[str]"
},
{
"param": "name",
"type": "str"
}
] | {
"returns": [
{
"docstring": "The TargetResult object parsed from the input lines.",
"docstring_tokens": [
"The",
"TargetResult",
"object",
"parsed",
"from",
"the",
"input",
"lines",
"."
],
"type": "TargetResult"
... |
4dc09a8d7bdc6f7e8d90644388563fc6ca027940 | sunlongbo/chromium | chrome/installer/tools/shortcut_properties.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | BuildPKeyToNameMapping | <not_specific> | def BuildPKeyToNameMapping():
"""Returns a dict mapping PKey values (a tuple of an IID and an int) to their
names."""
# The pscon module contains a number of well-known PKey values. Scan through
# the module picking out anything that looks plausibly like a PROPERTYKEY (a
# tuple of a PyIID and an int), and ma... | Returns a dict mapping PKey values (a tuple of an IID and an int) to their
names. | Returns a dict mapping PKey values (a tuple of an IID and an int) to their
names. | [
"Returns",
"a",
"dict",
"mapping",
"PKey",
"values",
"(",
"a",
"tuple",
"of",
"an",
"IID",
"and",
"an",
"int",
")",
"to",
"their",
"names",
"."
] | def BuildPKeyToNameMapping():
return {item: name for (name, item) in pscon.__dict__.iteritems() if (
isinstance(item, tuple) and
len(item) == 2 and
isinstance(item[1], int))} | [
"def",
"BuildPKeyToNameMapping",
"(",
")",
":",
"return",
"{",
"item",
":",
"name",
"for",
"(",
"name",
",",
"item",
")",
"in",
"pscon",
".",
"__dict__",
".",
"iteritems",
"(",
")",
"if",
"(",
"isinstance",
"(",
"item",
",",
"tuple",
")",
"and",
"len... | Returns a dict mapping PKey values (a tuple of an IID and an int) to their
names. | [
"Returns",
"a",
"dict",
"mapping",
"PKey",
"values",
"(",
"a",
"tuple",
"of",
"an",
"IID",
"and",
"an",
"int",
")",
"to",
"their",
"names",
"."
] | [
"\"\"\"Returns a dict mapping PKey values (a tuple of an IID and an int) to their\n names.\"\"\"",
"# The pscon module contains a number of well-known PKey values. Scan through",
"# the module picking out anything that looks plausibly like a PROPERTYKEY (a",
"# tuple of a PyIID and an int), and map it to its... | [] | {
"returns": [],
"raises": [],
"params": [],
"outlier_params": [],
"others": []
} |
e629a3633993cdf9e0c2dce583125ee1a483002f | sunlongbo/chromium | native_client_sdk/src/doc/PRESUBMIT.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | _CheckSphinxBuild | <not_specific> | def _CheckSphinxBuild(input_api, output_api):
"""Check that the docs are buildable without any warnings.
This check runs sphinx-build with -W so that warning are errors.
However, since the trybots don't have sphinx installed, we'll treat a sphinx
failure as a warning. (Let's trust that the docs editors are te... | Check that the docs are buildable without any warnings.
This check runs sphinx-build with -W so that warning are errors.
However, since the trybots don't have sphinx installed, we'll treat a sphinx
failure as a warning. (Let's trust that the docs editors are testing locally.)
| Check that the docs are buildable without any warnings.
This check runs sphinx-build with -W so that warning are errors.
However, since the trybots don't have sphinx installed, we'll treat a sphinx
failure as a warning. (Let's trust that the docs editors are testing locally.) | [
"Check",
"that",
"the",
"docs",
"are",
"buildable",
"without",
"any",
"warnings",
".",
"This",
"check",
"runs",
"sphinx",
"-",
"build",
"with",
"-",
"W",
"so",
"that",
"warning",
"are",
"errors",
".",
"However",
"since",
"the",
"trybots",
"don",
"'",
"t"... | def _CheckSphinxBuild(input_api, output_api):
try:
subprocess.check_output(['make', 'presubmit', 'SPHINXOPTS=-Wa'],
stderr=subprocess.STDOUT)
except subprocess.CalledProcessError as e:
return [output_api.PresubmitNotifyResult('sphinx_build failed:\n' +
... | [
"def",
"_CheckSphinxBuild",
"(",
"input_api",
",",
"output_api",
")",
":",
"try",
":",
"subprocess",
".",
"check_output",
"(",
"[",
"'make'",
",",
"'presubmit'",
",",
"'SPHINXOPTS=-Wa'",
"]",
",",
"stderr",
"=",
"subprocess",
".",
"STDOUT",
")",
"except",
"s... | Check that the docs are buildable without any warnings. | [
"Check",
"that",
"the",
"docs",
"are",
"buildable",
"without",
"any",
"warnings",
"."
] | [
"\"\"\"Check that the docs are buildable without any warnings.\n\n This check runs sphinx-build with -W so that warning are errors.\n\n However, since the trybots don't have sphinx installed, we'll treat a sphinx\n failure as a warning. (Let's trust that the docs editors are testing locally.)\n \"\"\""
] | [
{
"param": "input_api",
"type": null
},
{
"param": "output_api",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "input_api",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "output_api",
"type": null,
"docstring": null,
"docstring... |
a30e91c3c7be3d585ede5b2dbf54385ba368d5e5 | sunlongbo/chromium | chrome/installer/mac/signing/pipeline.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | _include_branding_code_in_app | <not_specific> | def _include_branding_code_in_app(dist):
"""Returns whether to omit the branding code from the Chrome .app bundle.
If a distribution is packaged in a PKG (but is not also packaged in a DMG),
then the brand code is carried in the PKG script, and should not be added to
the .app bundle's Info.plist.
... | Returns whether to omit the branding code from the Chrome .app bundle.
If a distribution is packaged in a PKG (but is not also packaged in a DMG),
then the brand code is carried in the PKG script, and should not be added to
the .app bundle's Info.plist.
Args:
dist: The |model.Distribution|.
... | Returns whether to omit the branding code from the Chrome .app bundle.
If a distribution is packaged in a PKG (but is not also packaged in a DMG),
then the brand code is carried in the PKG script, and should not be added to
the .app bundle's Info.plist. | [
"Returns",
"whether",
"to",
"omit",
"the",
"branding",
"code",
"from",
"the",
"Chrome",
".",
"app",
"bundle",
".",
"If",
"a",
"distribution",
"is",
"packaged",
"in",
"a",
"PKG",
"(",
"but",
"is",
"not",
"also",
"packaged",
"in",
"a",
"DMG",
")",
"then"... | def _include_branding_code_in_app(dist):
return dist.package_as_dmg or not dist.package_as_pkg | [
"def",
"_include_branding_code_in_app",
"(",
"dist",
")",
":",
"return",
"dist",
".",
"package_as_dmg",
"or",
"not",
"dist",
".",
"package_as_pkg"
] | Returns whether to omit the branding code from the Chrome .app bundle. | [
"Returns",
"whether",
"to",
"omit",
"the",
"branding",
"code",
"from",
"the",
"Chrome",
".",
"app",
"bundle",
"."
] | [
"\"\"\"Returns whether to omit the branding code from the Chrome .app bundle.\n\n If a distribution is packaged in a PKG (but is not also packaged in a DMG),\n then the brand code is carried in the PKG script, and should not be added to\n the .app bundle's Info.plist.\n\n Args:\n dist: The |model... | [
{
"param": "dist",
"type": null
}
] | {
"returns": [
{
"docstring": "Whether to include the branding code in the app bundle.",
"docstring_tokens": [
"Whether",
"to",
"include",
"the",
"branding",
"code",
"in",
"the",
"app",
"bundle",
"."
],
... |
a30e91c3c7be3d585ede5b2dbf54385ba368d5e5 | sunlongbo/chromium | chrome/installer/mac/signing/pipeline.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | _binary_architectures | <not_specific> | def _binary_architectures(binary_path):
"""Returns a comma-separated list of architectures of a binary.
Args:
binary_path: The path to the binary on disk.
Returns:
A comma-separated string of architectures.
"""
command = ['lipo', '-archs', binary_path]
output = commands.run_co... | Returns a comma-separated list of architectures of a binary.
Args:
binary_path: The path to the binary on disk.
Returns:
A comma-separated string of architectures.
| Returns a comma-separated list of architectures of a binary. | [
"Returns",
"a",
"comma",
"-",
"separated",
"list",
"of",
"architectures",
"of",
"a",
"binary",
"."
] | def _binary_architectures(binary_path):
command = ['lipo', '-archs', binary_path]
output = commands.run_command_output(command)
output = output.decode('utf-8').strip()
output = output.replace(' ', ',')
return output | [
"def",
"_binary_architectures",
"(",
"binary_path",
")",
":",
"command",
"=",
"[",
"'lipo'",
",",
"'-archs'",
",",
"binary_path",
"]",
"output",
"=",
"commands",
".",
"run_command_output",
"(",
"command",
")",
"output",
"=",
"output",
".",
"decode",
"(",
"'u... | Returns a comma-separated list of architectures of a binary. | [
"Returns",
"a",
"comma",
"-",
"separated",
"list",
"of",
"architectures",
"of",
"a",
"binary",
"."
] | [
"\"\"\"Returns a comma-separated list of architectures of a binary.\n\n Args:\n binary_path: The path to the binary on disk.\n\n Returns:\n A comma-separated string of architectures.\n \"\"\""
] | [
{
"param": "binary_path",
"type": null
}
] | {
"returns": [
{
"docstring": "A comma-separated string of architectures.",
"docstring_tokens": [
"A",
"comma",
"-",
"separated",
"string",
"of",
"architectures",
"."
],
"type": null
}
],
"raises": [],
"params": [
... |
a30e91c3c7be3d585ede5b2dbf54385ba368d5e5 | sunlongbo/chromium | chrome/installer/mac/signing/pipeline.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | _customize_and_sign_chrome | null | def _customize_and_sign_chrome(paths, dist_config, dest_dir, signed_frameworks):
"""Does channel customization and signing of a Chrome distribution. The
resulting app bundle is moved into |dest_dir|.
Args:
paths: A |model.Paths| object.
dist_config: A |config.CodeSignConfig| for the |model.... | Does channel customization and signing of a Chrome distribution. The
resulting app bundle is moved into |dest_dir|.
Args:
paths: A |model.Paths| object.
dist_config: A |config.CodeSignConfig| for the |model.Distribution|.
dest_dir: The directory into which the product will be placed whe... | Does channel customization and signing of a Chrome distribution. The
resulting app bundle is moved into |dest_dir|. | [
"Does",
"channel",
"customization",
"and",
"signing",
"of",
"a",
"Chrome",
"distribution",
".",
"The",
"resulting",
"app",
"bundle",
"is",
"moved",
"into",
"|dest_dir|",
"."
] | def _customize_and_sign_chrome(paths, dist_config, dest_dir, signed_frameworks):
commands.copy_files(
os.path.join(paths.input, dist_config.base_config.app_dir), paths.work)
customization_dist = dist_config.distribution
customization_dist_config = dist_config
if not _include_branding_code_in_app... | [
"def",
"_customize_and_sign_chrome",
"(",
"paths",
",",
"dist_config",
",",
"dest_dir",
",",
"signed_frameworks",
")",
":",
"commands",
".",
"copy_files",
"(",
"os",
".",
"path",
".",
"join",
"(",
"paths",
".",
"input",
",",
"dist_config",
".",
"base_config",
... | Does channel customization and signing of a Chrome distribution. | [
"Does",
"channel",
"customization",
"and",
"signing",
"of",
"a",
"Chrome",
"distribution",
"."
] | [
"\"\"\"Does channel customization and signing of a Chrome distribution. The\n resulting app bundle is moved into |dest_dir|.\n\n Args:\n paths: A |model.Paths| object.\n dist_config: A |config.CodeSignConfig| for the |model.Distribution|.\n dest_dir: The directory into which the product w... | [
{
"param": "paths",
"type": null
},
{
"param": "dist_config",
"type": null
},
{
"param": "dest_dir",
"type": null
},
{
"param": "signed_frameworks",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "paths",
"type": null,
"docstring": "A |model.Paths| object.",
"docstring_tokens": [
"A",
"|model",
".",
"Paths|",
"object",
"."
],
"default": null,
"is_optional... |
a30e91c3c7be3d585ede5b2dbf54385ba368d5e5 | sunlongbo/chromium | chrome/installer/mac/signing/pipeline.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | _staple_chrome | null | def _staple_chrome(paths, dist_config):
"""Staples all the executable components of the Chrome app bundle.
Args:
paths: A |model.Paths| object.
dist_config: A |config.CodeSignConfig| for the customized product.
"""
notarize.staple_bundled_parts(parts.get_parts(dist_config).values(), pat... | Staples all the executable components of the Chrome app bundle.
Args:
paths: A |model.Paths| object.
dist_config: A |config.CodeSignConfig| for the customized product.
| Staples all the executable components of the Chrome app bundle. | [
"Staples",
"all",
"the",
"executable",
"components",
"of",
"the",
"Chrome",
"app",
"bundle",
"."
] | def _staple_chrome(paths, dist_config):
notarize.staple_bundled_parts(parts.get_parts(dist_config).values(), paths) | [
"def",
"_staple_chrome",
"(",
"paths",
",",
"dist_config",
")",
":",
"notarize",
".",
"staple_bundled_parts",
"(",
"parts",
".",
"get_parts",
"(",
"dist_config",
")",
".",
"values",
"(",
")",
",",
"paths",
")"
] | Staples all the executable components of the Chrome app bundle. | [
"Staples",
"all",
"the",
"executable",
"components",
"of",
"the",
"Chrome",
"app",
"bundle",
"."
] | [
"\"\"\"Staples all the executable components of the Chrome app bundle.\n\n Args:\n paths: A |model.Paths| object.\n dist_config: A |config.CodeSignConfig| for the customized product.\n \"\"\""
] | [
{
"param": "paths",
"type": null
},
{
"param": "dist_config",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "paths",
"type": null,
"docstring": "A |model.Paths| object.",
"docstring_tokens": [
"A",
"|model",
".",
"Paths|",
"object",
"."
],
"default": null,
"is_optional... |
a30e91c3c7be3d585ede5b2dbf54385ba368d5e5 | sunlongbo/chromium | chrome/installer/mac/signing/pipeline.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | _create_pkgbuild_scripts | <not_specific> | def _create_pkgbuild_scripts(paths, dist_config):
"""Creates a directory filled with scripts for use by `pkgbuild`, and copies
the postinstall script into this directory, customizing it along the way.
Args:
paths: A |model.Paths| object.
dist_config: The |config.CodeSignConfig| object.
... | Creates a directory filled with scripts for use by `pkgbuild`, and copies
the postinstall script into this directory, customizing it along the way.
Args:
paths: A |model.Paths| object.
dist_config: The |config.CodeSignConfig| object.
Returns:
The path to the scripts directory.
| Creates a directory filled with scripts for use by `pkgbuild`, and copies
the postinstall script into this directory, customizing it along the way. | [
"Creates",
"a",
"directory",
"filled",
"with",
"scripts",
"for",
"use",
"by",
"`",
"pkgbuild",
"`",
"and",
"copies",
"the",
"postinstall",
"script",
"into",
"this",
"directory",
"customizing",
"it",
"along",
"the",
"way",
"."
] | def _create_pkgbuild_scripts(paths, dist_config):
scripts_path = os.path.join(paths.work, 'scripts')
commands.make_dir(scripts_path)
packaging_dir = paths.packaging_dir(dist_config)
def do_substitutions(script):
substitutions = {
'@APP_DIR@': dist_config.app_dir,
'@APP_PR... | [
"def",
"_create_pkgbuild_scripts",
"(",
"paths",
",",
"dist_config",
")",
":",
"scripts_path",
"=",
"os",
".",
"path",
".",
"join",
"(",
"paths",
".",
"work",
",",
"'scripts'",
")",
"commands",
".",
"make_dir",
"(",
"scripts_path",
")",
"packaging_dir",
"=",... | Creates a directory filled with scripts for use by `pkgbuild`, and copies
the postinstall script into this directory, customizing it along the way. | [
"Creates",
"a",
"directory",
"filled",
"with",
"scripts",
"for",
"use",
"by",
"`",
"pkgbuild",
"`",
"and",
"copies",
"the",
"postinstall",
"script",
"into",
"this",
"directory",
"customizing",
"it",
"along",
"the",
"way",
"."
] | [
"\"\"\"Creates a directory filled with scripts for use by `pkgbuild`, and copies\n the postinstall script into this directory, customizing it along the way.\n\n Args:\n paths: A |model.Paths| object.\n dist_config: The |config.CodeSignConfig| object.\n\n Returns:\n The path to the scri... | [
{
"param": "paths",
"type": null
},
{
"param": "dist_config",
"type": null
}
] | {
"returns": [
{
"docstring": "The path to the scripts directory.",
"docstring_tokens": [
"The",
"path",
"to",
"the",
"scripts",
"directory",
"."
],
"type": null
}
],
"raises": [],
"params": [
{
"identifier": "path... |
a30e91c3c7be3d585ede5b2dbf54385ba368d5e5 | sunlongbo/chromium | chrome/installer/mac/signing/pipeline.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | _component_property_path | <not_specific> | def _component_property_path(paths, dist_config):
"""Creates a component plist file for use by `pkgbuild`. The reason this
file is used is to ensure that the component package is not relocatable. See
https://scriptingosx.com/2017/05/relocatable-package-installers-and-quickpkg-update/
for information on ... | Creates a component plist file for use by `pkgbuild`. The reason this
file is used is to ensure that the component package is not relocatable. See
https://scriptingosx.com/2017/05/relocatable-package-installers-and-quickpkg-update/
for information on why that's important.
Args:
paths: A |model.... | Creates a component plist file for use by `pkgbuild`. The reason this
file is used is to ensure that the component package is not relocatable. | [
"Creates",
"a",
"component",
"plist",
"file",
"for",
"use",
"by",
"`",
"pkgbuild",
"`",
".",
"The",
"reason",
"this",
"file",
"is",
"used",
"is",
"to",
"ensure",
"that",
"the",
"component",
"package",
"is",
"not",
"relocatable",
"."
] | def _component_property_path(paths, dist_config):
component_property_path = os.path.join(
paths.work, '{}.plist'.format(dist_config.app_product))
commands.write_plist([{
'BundleHasStrictIdentifier': True,
'BundleIsRelocatable': False,
'BundleIsVersionChecked': True,
'Bund... | [
"def",
"_component_property_path",
"(",
"paths",
",",
"dist_config",
")",
":",
"component_property_path",
"=",
"os",
".",
"path",
".",
"join",
"(",
"paths",
".",
"work",
",",
"'{}.plist'",
".",
"format",
"(",
"dist_config",
".",
"app_product",
")",
")",
"com... | Creates a component plist file for use by `pkgbuild`. | [
"Creates",
"a",
"component",
"plist",
"file",
"for",
"use",
"by",
"`",
"pkgbuild",
"`",
"."
] | [
"\"\"\"Creates a component plist file for use by `pkgbuild`. The reason this\n file is used is to ensure that the component package is not relocatable. See\n https://scriptingosx.com/2017/05/relocatable-package-installers-and-quickpkg-update/\n for information on why that's important.\n\n Args:\n ... | [
{
"param": "paths",
"type": null
},
{
"param": "dist_config",
"type": null
}
] | {
"returns": [
{
"docstring": "The path to the component plist file.",
"docstring_tokens": [
"The",
"path",
"to",
"the",
"component",
"plist",
"file",
"."
],
"type": null
}
],
"raises": [],
"params": [
{
"i... |
a30e91c3c7be3d585ede5b2dbf54385ba368d5e5 | sunlongbo/chromium | chrome/installer/mac/signing/pipeline.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | _minimum_os_version | <not_specific> | def _minimum_os_version(app_paths, dist_config):
"""Returns the minimum OS requirement for the copy of Chrome being packaged.
Args:
app_paths: A |model.Paths| object for the app.
dist_config: The |config.CodeSignConfig| object.
Returns:
The minimum OS requirement.
"""
app_pl... | Returns the minimum OS requirement for the copy of Chrome being packaged.
Args:
app_paths: A |model.Paths| object for the app.
dist_config: The |config.CodeSignConfig| object.
Returns:
The minimum OS requirement.
| Returns the minimum OS requirement for the copy of Chrome being packaged. | [
"Returns",
"the",
"minimum",
"OS",
"requirement",
"for",
"the",
"copy",
"of",
"Chrome",
"being",
"packaged",
"."
] | def _minimum_os_version(app_paths, dist_config):
app_plist_path = os.path.join(app_paths.work, dist_config.app_dir,
'Contents', 'Info.plist')
with commands.PlistContext(app_plist_path) as app_plist:
return app_plist['LSMinimumSystemVersion'] | [
"def",
"_minimum_os_version",
"(",
"app_paths",
",",
"dist_config",
")",
":",
"app_plist_path",
"=",
"os",
".",
"path",
".",
"join",
"(",
"app_paths",
".",
"work",
",",
"dist_config",
".",
"app_dir",
",",
"'Contents'",
",",
"'Info.plist'",
")",
"with",
"comm... | Returns the minimum OS requirement for the copy of Chrome being packaged. | [
"Returns",
"the",
"minimum",
"OS",
"requirement",
"for",
"the",
"copy",
"of",
"Chrome",
"being",
"packaged",
"."
] | [
"\"\"\"Returns the minimum OS requirement for the copy of Chrome being packaged.\n\n Args:\n app_paths: A |model.Paths| object for the app.\n dist_config: The |config.CodeSignConfig| object.\n Returns:\n The minimum OS requirement.\n \"\"\""
] | [
{
"param": "app_paths",
"type": null
},
{
"param": "dist_config",
"type": null
}
] | {
"returns": [
{
"docstring": "The minimum OS requirement.",
"docstring_tokens": [
"The",
"minimum",
"OS",
"requirement",
"."
],
"type": null
}
],
"raises": [],
"params": [
{
"identifier": "app_paths",
"type": null,
"d... |
a30e91c3c7be3d585ede5b2dbf54385ba368d5e5 | sunlongbo/chromium | chrome/installer/mac/signing/pipeline.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | _productbuild_distribution_path | <not_specific> | def _productbuild_distribution_path(app_paths, pkg_paths, dist_config,
component_pkg_path):
"""Creates a distribution XML file for use by `productbuild`. This copies
the OS and architecture requirements from the copy of Chrome being packaged.
Args:
app_paths: A |... | Creates a distribution XML file for use by `productbuild`. This copies
the OS and architecture requirements from the copy of Chrome being packaged.
Args:
app_paths: A |model.Paths| object for the app.
pkg_paths: A |model.Paths| object for the pkg files.
dist_config: The |config.CodeSign... | Creates a distribution XML file for use by `productbuild`. This copies
the OS and architecture requirements from the copy of Chrome being packaged. | [
"Creates",
"a",
"distribution",
"XML",
"file",
"for",
"use",
"by",
"`",
"productbuild",
"`",
".",
"This",
"copies",
"the",
"OS",
"and",
"architecture",
"requirements",
"from",
"the",
"copy",
"of",
"Chrome",
"being",
"packaged",
"."
] | def _productbuild_distribution_path(app_paths, pkg_paths, dist_config,
component_pkg_path):
distribution_path = os.path.join(pkg_paths.work,
'{}.dist'.format(dist_config.app_product))
app_binary_path = os.path.join(app_paths.work, dist_con... | [
"def",
"_productbuild_distribution_path",
"(",
"app_paths",
",",
"pkg_paths",
",",
"dist_config",
",",
"component_pkg_path",
")",
":",
"distribution_path",
"=",
"os",
".",
"path",
".",
"join",
"(",
"pkg_paths",
".",
"work",
",",
"'{}.dist'",
".",
"format",
"(",
... | Creates a distribution XML file for use by `productbuild`. | [
"Creates",
"a",
"distribution",
"XML",
"file",
"for",
"use",
"by",
"`",
"productbuild",
"`",
"."
] | [
"\"\"\"Creates a distribution XML file for use by `productbuild`. This copies\n the OS and architecture requirements from the copy of Chrome being packaged.\n\n Args:\n app_paths: A |model.Paths| object for the app.\n pkg_paths: A |model.Paths| object for the pkg files.\n dist_config: The... | [
{
"param": "app_paths",
"type": null
},
{
"param": "pkg_paths",
"type": null
},
{
"param": "dist_config",
"type": null
},
{
"param": "component_pkg_path",
"type": null
}
] | {
"returns": [
{
"docstring": "The path to the distribution file.",
"docstring_tokens": [
"The",
"path",
"to",
"the",
"distribution",
"file",
"."
],
"type": null
}
],
"raises": [],
"params": [
{
"identifier": "app_... |
a30e91c3c7be3d585ede5b2dbf54385ba368d5e5 | sunlongbo/chromium | chrome/installer/mac/signing/pipeline.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | _package_and_sign_pkg | <not_specific> | def _package_and_sign_pkg(paths, dist_config):
"""Packages, signs, and verifies a PKG for a signed build product.
Args:
paths: A |model.Paths| object.
dist_config: The |config.CodeSignConfig| object.
Returns:
The path to the signed PKG file.
"""
assert dist_config.installer... | Packages, signs, and verifies a PKG for a signed build product.
Args:
paths: A |model.Paths| object.
dist_config: The |config.CodeSignConfig| object.
Returns:
The path to the signed PKG file.
| Packages, signs, and verifies a PKG for a signed build product. | [
"Packages",
"signs",
"and",
"verifies",
"a",
"PKG",
"for",
"a",
"signed",
"build",
"product",
"."
] | def _package_and_sign_pkg(paths, dist_config):
assert dist_config.installer_identity
with commands.WorkDirectory(paths) as pkg_paths:
root_directory = os.path.join(pkg_paths.work, 'payload')
commands.make_dir(root_directory)
app_path = os.path.join(paths.work, dist_config.app_dir)
... | [
"def",
"_package_and_sign_pkg",
"(",
"paths",
",",
"dist_config",
")",
":",
"assert",
"dist_config",
".",
"installer_identity",
"with",
"commands",
".",
"WorkDirectory",
"(",
"paths",
")",
"as",
"pkg_paths",
":",
"root_directory",
"=",
"os",
".",
"path",
".",
... | Packages, signs, and verifies a PKG for a signed build product. | [
"Packages",
"signs",
"and",
"verifies",
"a",
"PKG",
"for",
"a",
"signed",
"build",
"product",
"."
] | [
"\"\"\"Packages, signs, and verifies a PKG for a signed build product.\n\n Args:\n paths: A |model.Paths| object.\n dist_config: The |config.CodeSignConfig| object.\n\n Returns:\n The path to the signed PKG file.\n \"\"\"",
"# Because several .pkg distributions might be built from th... | [
{
"param": "paths",
"type": null
},
{
"param": "dist_config",
"type": null
}
] | {
"returns": [
{
"docstring": "The path to the signed PKG file.",
"docstring_tokens": [
"The",
"path",
"to",
"the",
"signed",
"PKG",
"file",
"."
],
"type": null
}
],
"raises": [],
"params": [
{
"identifier"... |
a30e91c3c7be3d585ede5b2dbf54385ba368d5e5 | sunlongbo/chromium | chrome/installer/mac/signing/pipeline.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | _package_and_sign_dmg | <not_specific> | def _package_and_sign_dmg(paths, dist_config):
"""Packages, signs, and verifies a DMG for a signed build product.
Args:
paths: A |model.Paths| object.
dist_config: The |config.CodeSignConfig| object.
Returns:
The path to the signed DMG file.
"""
dist = dist_config.distribut... | Packages, signs, and verifies a DMG for a signed build product.
Args:
paths: A |model.Paths| object.
dist_config: The |config.CodeSignConfig| object.
Returns:
The path to the signed DMG file.
| Packages, signs, and verifies a DMG for a signed build product. | [
"Packages",
"signs",
"and",
"verifies",
"a",
"DMG",
"for",
"a",
"signed",
"build",
"product",
"."
] | def _package_and_sign_dmg(paths, dist_config):
dist = dist_config.distribution
dmg_path = _package_dmg(paths, dist, dist_config)
dmg_identifier = dist_config.packaging_basename
if dist.branding_code:
dmg_identifier = dist_config.packaging_basename.replace(
dist.packaging_name_fragmen... | [
"def",
"_package_and_sign_dmg",
"(",
"paths",
",",
"dist_config",
")",
":",
"dist",
"=",
"dist_config",
".",
"distribution",
"dmg_path",
"=",
"_package_dmg",
"(",
"paths",
",",
"dist",
",",
"dist_config",
")",
"dmg_identifier",
"=",
"dist_config",
".",
"packagin... | Packages, signs, and verifies a DMG for a signed build product. | [
"Packages",
"signs",
"and",
"verifies",
"a",
"DMG",
"for",
"a",
"signed",
"build",
"product",
"."
] | [
"\"\"\"Packages, signs, and verifies a DMG for a signed build product.\n\n Args:\n paths: A |model.Paths| object.\n dist_config: The |config.CodeSignConfig| object.\n\n Returns:\n The path to the signed DMG file.\n \"\"\"",
"# dmg_identifier is like dmg_name but without the file exte... | [
{
"param": "paths",
"type": null
},
{
"param": "dist_config",
"type": null
}
] | {
"returns": [
{
"docstring": "The path to the signed DMG file.",
"docstring_tokens": [
"The",
"path",
"to",
"the",
"signed",
"DMG",
"file",
"."
],
"type": null
}
],
"raises": [],
"params": [
{
"identifier"... |
a30e91c3c7be3d585ede5b2dbf54385ba368d5e5 | sunlongbo/chromium | chrome/installer/mac/signing/pipeline.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | _package_dmg | <not_specific> | def _package_dmg(paths, dist, config):
"""Packages a Chrome application bundle into a DMG.
Args:
paths: A |model.Paths| object.
dist: The |model.Distribution| for which the product was customized.
config: The |config.CodeSignConfig| object.
Returns:
A path to the produced D... | Packages a Chrome application bundle into a DMG.
Args:
paths: A |model.Paths| object.
dist: The |model.Distribution| for which the product was customized.
config: The |config.CodeSignConfig| object.
Returns:
A path to the produced DMG file.
| Packages a Chrome application bundle into a DMG. | [
"Packages",
"a",
"Chrome",
"application",
"bundle",
"into",
"a",
"DMG",
"."
] | def _package_dmg(paths, dist, config):
packaging_dir = paths.packaging_dir(config)
if dist.channel_customize:
dsstore_file = 'chrome_{}_dmg_dsstore'.format(dist.channel)
icon_file = 'chrome_{}_dmg_icon.icns'.format(dist.channel)
else:
dsstore_file = 'chrome_dmg_dsstore'
icon_... | [
"def",
"_package_dmg",
"(",
"paths",
",",
"dist",
",",
"config",
")",
":",
"packaging_dir",
"=",
"paths",
".",
"packaging_dir",
"(",
"config",
")",
"if",
"dist",
".",
"channel_customize",
":",
"dsstore_file",
"=",
"'chrome_{}_dmg_dsstore'",
".",
"format",
"(",... | Packages a Chrome application bundle into a DMG. | [
"Packages",
"a",
"Chrome",
"application",
"bundle",
"into",
"a",
"DMG",
"."
] | [
"\"\"\"Packages a Chrome application bundle into a DMG.\n\n Args:\n paths: A |model.Paths| object.\n dist: The |model.Distribution| for which the product was customized.\n config: The |config.CodeSignConfig| object.\n\n Returns:\n A path to the produced DMG file.\n \"\"\"",
"#... | [
{
"param": "paths",
"type": null
},
{
"param": "dist",
"type": null
},
{
"param": "config",
"type": null
}
] | {
"returns": [
{
"docstring": "A path to the produced DMG file.",
"docstring_tokens": [
"A",
"path",
"to",
"the",
"produced",
"DMG",
"file",
"."
],
"type": null
}
],
"raises": [],
"params": [
{
"identifier"... |
a30e91c3c7be3d585ede5b2dbf54385ba368d5e5 | sunlongbo/chromium | chrome/installer/mac/signing/pipeline.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | _package_installer_tools | null | def _package_installer_tools(paths, config):
"""Signs and packages all the installer tools, which are not shipped to end-
users.
Args:
paths: A |model.Paths| object.
config: The |config.CodeSignConfig| object.
"""
DIFF_TOOLS = 'diff_tools'
tools_to_sign = parts.get_installer_to... | Signs and packages all the installer tools, which are not shipped to end-
users.
Args:
paths: A |model.Paths| object.
config: The |config.CodeSignConfig| object.
| Signs and packages all the installer tools, which are not shipped to end
users. | [
"Signs",
"and",
"packages",
"all",
"the",
"installer",
"tools",
"which",
"are",
"not",
"shipped",
"to",
"end",
"users",
"."
] | def _package_installer_tools(paths, config):
DIFF_TOOLS = 'diff_tools'
tools_to_sign = parts.get_installer_tools(config)
chrome_tools = (
'keystone_install.sh',) if config.is_chrome_branded() else ()
other_tools = (
'dirdiffer.sh',
'dirpatcher.sh',
'dmgdiffer.sh',
... | [
"def",
"_package_installer_tools",
"(",
"paths",
",",
"config",
")",
":",
"DIFF_TOOLS",
"=",
"'diff_tools'",
"tools_to_sign",
"=",
"parts",
".",
"get_installer_tools",
"(",
"config",
")",
"chrome_tools",
"=",
"(",
"'keystone_install.sh'",
",",
")",
"if",
"config",... | Signs and packages all the installer tools, which are not shipped to end
users. | [
"Signs",
"and",
"packages",
"all",
"the",
"installer",
"tools",
"which",
"are",
"not",
"shipped",
"to",
"end",
"users",
"."
] | [
"\"\"\"Signs and packages all the installer tools, which are not shipped to end-\n users.\n\n Args:\n paths: A |model.Paths| object.\n config: The |config.CodeSignConfig| object.\n \"\"\""
] | [
{
"param": "paths",
"type": null
},
{
"param": "config",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "paths",
"type": null,
"docstring": "A |model.Paths| object.",
"docstring_tokens": [
"A",
"|model",
".",
"Paths|",
"object",
"."
],
"default": null,
"is_optional... |
a30e91c3c7be3d585ede5b2dbf54385ba368d5e5 | sunlongbo/chromium | chrome/installer/mac/signing/pipeline.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | _intermediate_work_dir_name | <not_specific> | def _intermediate_work_dir_name(dist):
"""Returns the name of an intermediate work directory for a distribution.
All distributions that can share the same app bundle share the intermediate
work directory.
Just about any customization in the distribution will require it to have its
own app bundle. H... | Returns the name of an intermediate work directory for a distribution.
All distributions that can share the same app bundle share the intermediate
work directory.
Just about any customization in the distribution will require it to have its
own app bundle. However, if a distribution is packaged in a PKG... | Returns the name of an intermediate work directory for a distribution.
All distributions that can share the same app bundle share the intermediate
work directory.
Just about any customization in the distribution will require it to have its
own app bundle. However, if a distribution is packaged in a PKG (but is not
als... | [
"Returns",
"the",
"name",
"of",
"an",
"intermediate",
"work",
"directory",
"for",
"a",
"distribution",
".",
"All",
"distributions",
"that",
"can",
"share",
"the",
"same",
"app",
"bundle",
"share",
"the",
"intermediate",
"work",
"directory",
".",
"Just",
"about... | def _intermediate_work_dir_name(dist):
customizations = []
if dist.channel_customize:
customizations.append('sxs')
if dist.channel:
customizations.append(dist.channel)
else:
customizations.append('stable')
if dist.app_name_fragment:
customizations.append(dist.app_name... | [
"def",
"_intermediate_work_dir_name",
"(",
"dist",
")",
":",
"customizations",
"=",
"[",
"]",
"if",
"dist",
".",
"channel_customize",
":",
"customizations",
".",
"append",
"(",
"'sxs'",
")",
"if",
"dist",
".",
"channel",
":",
"customizations",
".",
"append",
... | Returns the name of an intermediate work directory for a distribution. | [
"Returns",
"the",
"name",
"of",
"an",
"intermediate",
"work",
"directory",
"for",
"a",
"distribution",
"."
] | [
"\"\"\"Returns the name of an intermediate work directory for a distribution.\n All distributions that can share the same app bundle share the intermediate\n work directory.\n\n Just about any customization in the distribution will require it to have its\n own app bundle. However, if a distribution is p... | [
{
"param": "dist",
"type": null
}
] | {
"returns": [
{
"docstring": "The work directory name to use.",
"docstring_tokens": [
"The",
"work",
"directory",
"name",
"to",
"use",
"."
],
"type": null
}
],
"raises": [],
"params": [
{
"identifier": "dist",
... |
a30e91c3c7be3d585ede5b2dbf54385ba368d5e5 | sunlongbo/chromium | chrome/installer/mac/signing/pipeline.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | sign_all | null | def sign_all(orig_paths,
config,
disable_packaging=False,
do_notarization=True,
skip_brands=[]):
"""For each distribution in |config|, performs customization, signing, and
DMG packaging and places the resulting signed DMG in |orig_paths.output|.
The |paths... | For each distribution in |config|, performs customization, signing, and
DMG packaging and places the resulting signed DMG in |orig_paths.output|.
The |paths.input| must contain the products to customize and sign.
Args:
orig_paths: A |model.Paths| object.
config: The |config.CodeSignConfig| ... | For each distribution in |config|, performs customization, signing, and
DMG packaging and places the resulting signed DMG in |orig_paths.output|.
The |paths.input| must contain the products to customize and sign. | [
"For",
"each",
"distribution",
"in",
"|config|",
"performs",
"customization",
"signing",
"and",
"DMG",
"packaging",
"and",
"places",
"the",
"resulting",
"signed",
"DMG",
"in",
"|orig_paths",
".",
"output|",
".",
"The",
"|paths",
".",
"input|",
"must",
"contain",... | def sign_all(orig_paths,
config,
disable_packaging=False,
do_notarization=True,
skip_brands=[]):
with commands.WorkDirectory(orig_paths) as notary_paths:
uuids_to_config = {}
signed_frameworks = {}
created_app_bundles = set()
for di... | [
"def",
"sign_all",
"(",
"orig_paths",
",",
"config",
",",
"disable_packaging",
"=",
"False",
",",
"do_notarization",
"=",
"True",
",",
"skip_brands",
"=",
"[",
"]",
")",
":",
"with",
"commands",
".",
"WorkDirectory",
"(",
"orig_paths",
")",
"as",
"notary_pat... | For each distribution in |config|, performs customization, signing, and
DMG packaging and places the resulting signed DMG in |orig_paths.output|. | [
"For",
"each",
"distribution",
"in",
"|config|",
"performs",
"customization",
"signing",
"and",
"DMG",
"packaging",
"and",
"places",
"the",
"resulting",
"signed",
"DMG",
"in",
"|orig_paths",
".",
"output|",
"."
] | [
"\"\"\"For each distribution in |config|, performs customization, signing, and\n DMG packaging and places the resulting signed DMG in |orig_paths.output|.\n The |paths.input| must contain the products to customize and sign.\n\n Args:\n orig_paths: A |model.Paths| object.\n config: The |config... | [
{
"param": "orig_paths",
"type": null
},
{
"param": "config",
"type": null
},
{
"param": "disable_packaging",
"type": null
},
{
"param": "do_notarization",
"type": null
},
{
"param": "skip_brands",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "orig_paths",
"type": null,
"docstring": "A |model.Paths| object.",
"docstring_tokens": [
"A",
"|model",
".",
"Paths|",
"object",
"."
],
"default": null,
"is_opt... |
a31222c1292baf2e3a86e98f0deb9c52d97ceb2d | sunlongbo/chromium | third_party/blink/tools/blinkpy/style/error_handlers_unittest.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | _style_checker_configuration | <not_specific> | def _style_checker_configuration(self):
"""Return a StyleProcessorConfiguration instance for testing."""
base_rules = ['-whitespace', '+whitespace/tab']
filter_configuration = FilterConfiguration(base_rules=base_rules)
return StyleProcessorConfiguration(
filter_configuration... | Return a StyleProcessorConfiguration instance for testing. | Return a StyleProcessorConfiguration instance for testing. | [
"Return",
"a",
"StyleProcessorConfiguration",
"instance",
"for",
"testing",
"."
] | def _style_checker_configuration(self):
base_rules = ['-whitespace', '+whitespace/tab']
filter_configuration = FilterConfiguration(base_rules=base_rules)
return StyleProcessorConfiguration(
filter_configuration=filter_configuration,
max_reports_per_category={'whitespace/t... | [
"def",
"_style_checker_configuration",
"(",
"self",
")",
":",
"base_rules",
"=",
"[",
"'-whitespace'",
",",
"'+whitespace/tab'",
"]",
"filter_configuration",
"=",
"FilterConfiguration",
"(",
"base_rules",
"=",
"base_rules",
")",
"return",
"StyleProcessorConfiguration",
... | Return a StyleProcessorConfiguration instance for testing. | [
"Return",
"a",
"StyleProcessorConfiguration",
"instance",
"for",
"testing",
"."
] | [
"\"\"\"Return a StyleProcessorConfiguration instance for testing.\"\"\""
] | [
{
"param": "self",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
a31222c1292baf2e3a86e98f0deb9c52d97ceb2d | sunlongbo/chromium | third_party/blink/tools/blinkpy/style/error_handlers_unittest.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | _call_error_handler | null | def _call_error_handler(self, handle_error, confidence, line_number=100):
"""Call the given error handler with a test error."""
handle_error(
line_number=line_number,
category=self._category,
confidence=confidence,
message='message') | Call the given error handler with a test error. | Call the given error handler with a test error. | [
"Call",
"the",
"given",
"error",
"handler",
"with",
"a",
"test",
"error",
"."
] | def _call_error_handler(self, handle_error, confidence, line_number=100):
handle_error(
line_number=line_number,
category=self._category,
confidence=confidence,
message='message') | [
"def",
"_call_error_handler",
"(",
"self",
",",
"handle_error",
",",
"confidence",
",",
"line_number",
"=",
"100",
")",
":",
"handle_error",
"(",
"line_number",
"=",
"line_number",
",",
"category",
"=",
"self",
".",
"_category",
",",
"confidence",
"=",
"confid... | Call the given error handler with a test error. | [
"Call",
"the",
"given",
"error",
"handler",
"with",
"a",
"test",
"error",
"."
] | [
"\"\"\"Call the given error handler with a test error.\"\"\""
] | [
{
"param": "self",
"type": null
},
{
"param": "handle_error",
"type": null
},
{
"param": "confidence",
"type": null
},
{
"param": "line_number",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "handle_error",
"type": null,
"docstring": null,
"docstring_to... |
a34302e729035e5c97d8e9606288e357df98b2a0 | sunlongbo/chromium | third_party/blink/tools/blinkpy/web_tests/stale_expectation_removal/data_types_unittest.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | testCompareWildcard | null | def testCompareWildcard(self):
"""Tests that wildcard comparisons work as expected."""
e = data_types.WebTestExpectation('test*', ['tag1'], 'Failure')
self.assertTrue(e._CompareWildcard('testing123'))
self.assertTrue(
e._CompareWildcard('virtual/some-identifier/testing123'))
... | Tests that wildcard comparisons work as expected. | Tests that wildcard comparisons work as expected. | [
"Tests",
"that",
"wildcard",
"comparisons",
"work",
"as",
"expected",
"."
] | def testCompareWildcard(self):
e = data_types.WebTestExpectation('test*', ['tag1'], 'Failure')
self.assertTrue(e._CompareWildcard('testing123'))
self.assertTrue(
e._CompareWildcard('virtual/some-identifier/testing123'))
self.assertTrue(e._CompareWildcard('test'))
self... | [
"def",
"testCompareWildcard",
"(",
"self",
")",
":",
"e",
"=",
"data_types",
".",
"WebTestExpectation",
"(",
"'test*'",
",",
"[",
"'tag1'",
"]",
",",
"'Failure'",
")",
"self",
".",
"assertTrue",
"(",
"e",
".",
"_CompareWildcard",
"(",
"'testing123'",
")",
... | Tests that wildcard comparisons work as expected. | [
"Tests",
"that",
"wildcard",
"comparisons",
"work",
"as",
"expected",
"."
] | [
"\"\"\"Tests that wildcard comparisons work as expected.\"\"\""
] | [
{
"param": "self",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
a34302e729035e5c97d8e9606288e357df98b2a0 | sunlongbo/chromium | third_party/blink/tools/blinkpy/web_tests/stale_expectation_removal/data_types_unittest.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | testCompareNonWildcard | null | def testCompareNonWildcard(self):
"""Tests that non-wildcard comparisons work as expected."""
e = data_types.WebTestExpectation('test', ['tag1'], 'Failure')
self.assertTrue(e._CompareNonWildcard('test'))
self.assertTrue(e._CompareNonWildcard('virtual/some-identifier/test'))
self.... | Tests that non-wildcard comparisons work as expected. | Tests that non-wildcard comparisons work as expected. | [
"Tests",
"that",
"non",
"-",
"wildcard",
"comparisons",
"work",
"as",
"expected",
"."
] | def testCompareNonWildcard(self):
e = data_types.WebTestExpectation('test', ['tag1'], 'Failure')
self.assertTrue(e._CompareNonWildcard('test'))
self.assertTrue(e._CompareNonWildcard('virtual/some-identifier/test'))
self.assertFalse(e._CompareNonWildcard('tes'))
self.assertFalse(
... | [
"def",
"testCompareNonWildcard",
"(",
"self",
")",
":",
"e",
"=",
"data_types",
".",
"WebTestExpectation",
"(",
"'test'",
",",
"[",
"'tag1'",
"]",
",",
"'Failure'",
")",
"self",
".",
"assertTrue",
"(",
"e",
".",
"_CompareNonWildcard",
"(",
"'test'",
")",
"... | Tests that non-wildcard comparisons work as expected. | [
"Tests",
"that",
"non",
"-",
"wildcard",
"comparisons",
"work",
"as",
"expected",
"."
] | [
"\"\"\"Tests that non-wildcard comparisons work as expected.\"\"\""
] | [
{
"param": "self",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
a34302e729035e5c97d8e9606288e357df98b2a0 | sunlongbo/chromium | third_party/blink/tools/blinkpy/web_tests/stale_expectation_removal/data_types_unittest.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | testSetDurationString | null | def testSetDurationString(self):
"""Tests that strings are properly converted when setting durations."""
result = data_types.WebTestResult('foo', ['debug'], 'Pass', 'step',
'build_id')
result.SetDuration(str(1), str(2000))
self.assertTrue(result.... | Tests that strings are properly converted when setting durations. | Tests that strings are properly converted when setting durations. | [
"Tests",
"that",
"strings",
"are",
"properly",
"converted",
"when",
"setting",
"durations",
"."
] | def testSetDurationString(self):
result = data_types.WebTestResult('foo', ['debug'], 'Pass', 'step',
'build_id')
result.SetDuration(str(1), str(2000))
self.assertTrue(result.is_slow_result) | [
"def",
"testSetDurationString",
"(",
"self",
")",
":",
"result",
"=",
"data_types",
".",
"WebTestResult",
"(",
"'foo'",
",",
"[",
"'debug'",
"]",
",",
"'Pass'",
",",
"'step'",
",",
"'build_id'",
")",
"result",
".",
"SetDuration",
"(",
"str",
"(",
"1",
")... | Tests that strings are properly converted when setting durations. | [
"Tests",
"that",
"strings",
"are",
"properly",
"converted",
"when",
"setting",
"durations",
"."
] | [
"\"\"\"Tests that strings are properly converted when setting durations.\"\"\""
] | [
{
"param": "self",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
a34302e729035e5c97d8e9606288e357df98b2a0 | sunlongbo/chromium | third_party/blink/tools/blinkpy/web_tests/stale_expectation_removal/data_types_unittest.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | testSetDurationNotSlow | null | def testSetDurationNotSlow(self):
"""Tests that setting a duration for a non-slow result works."""
result = data_types.WebTestResult('foo', ['debug'], 'Pass', 'step',
'build_id')
# The cutoff should be 30% of the timeout.
result.SetDuration(30, 1... | Tests that setting a duration for a non-slow result works. | Tests that setting a duration for a non-slow result works. | [
"Tests",
"that",
"setting",
"a",
"duration",
"for",
"a",
"non",
"-",
"slow",
"result",
"works",
"."
] | def testSetDurationNotSlow(self):
result = data_types.WebTestResult('foo', ['debug'], 'Pass', 'step',
'build_id')
result.SetDuration(30, 100000)
self.assertFalse(result.is_slow_result) | [
"def",
"testSetDurationNotSlow",
"(",
"self",
")",
":",
"result",
"=",
"data_types",
".",
"WebTestResult",
"(",
"'foo'",
",",
"[",
"'debug'",
"]",
",",
"'Pass'",
",",
"'step'",
",",
"'build_id'",
")",
"result",
".",
"SetDuration",
"(",
"30",
",",
"100000",... | Tests that setting a duration for a non-slow result works. | [
"Tests",
"that",
"setting",
"a",
"duration",
"for",
"a",
"non",
"-",
"slow",
"result",
"works",
"."
] | [
"\"\"\"Tests that setting a duration for a non-slow result works.\"\"\"",
"# The cutoff should be 30% of the timeout."
] | [
{
"param": "self",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
a34302e729035e5c97d8e9606288e357df98b2a0 | sunlongbo/chromium | third_party/blink/tools/blinkpy/web_tests/stale_expectation_removal/data_types_unittest.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | testSetDurationSlow | null | def testSetDurationSlow(self):
"""Tests that setting a duration for a slow result works."""
result = data_types.WebTestResult('foo', ['debug'], 'Pass', 'step',
'build_id')
# The cutoff should be 30% of the timeout.
result.SetDuration(30.01, 10000... | Tests that setting a duration for a slow result works. | Tests that setting a duration for a slow result works. | [
"Tests",
"that",
"setting",
"a",
"duration",
"for",
"a",
"slow",
"result",
"works",
"."
] | def testSetDurationSlow(self):
result = data_types.WebTestResult('foo', ['debug'], 'Pass', 'step',
'build_id')
result.SetDuration(30.01, 100000)
self.assertTrue(result.is_slow_result) | [
"def",
"testSetDurationSlow",
"(",
"self",
")",
":",
"result",
"=",
"data_types",
".",
"WebTestResult",
"(",
"'foo'",
",",
"[",
"'debug'",
"]",
",",
"'Pass'",
",",
"'step'",
",",
"'build_id'",
")",
"result",
".",
"SetDuration",
"(",
"30.01",
",",
"100000",... | Tests that setting a duration for a slow result works. | [
"Tests",
"that",
"setting",
"a",
"duration",
"for",
"a",
"slow",
"result",
"works",
"."
] | [
"\"\"\"Tests that setting a duration for a slow result works.\"\"\"",
"# The cutoff should be 30% of the timeout."
] | [
{
"param": "self",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
a34302e729035e5c97d8e9606288e357df98b2a0 | sunlongbo/chromium | third_party/blink/tools/blinkpy/web_tests/stale_expectation_removal/data_types_unittest.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | testSetDurationNotSlowSeconds | null | def testSetDurationNotSlowSeconds(self):
"""Tests that setting a duration for non-slow in seconds works."""
result = data_types.WebTestResult('foo', ['debug'], 'Pass', 'step',
'build_id')
result.SetDuration(30, 100)
self.assertFalse(result.is_slo... | Tests that setting a duration for non-slow in seconds works. | Tests that setting a duration for non-slow in seconds works. | [
"Tests",
"that",
"setting",
"a",
"duration",
"for",
"non",
"-",
"slow",
"in",
"seconds",
"works",
"."
] | def testSetDurationNotSlowSeconds(self):
result = data_types.WebTestResult('foo', ['debug'], 'Pass', 'step',
'build_id')
result.SetDuration(30, 100)
self.assertFalse(result.is_slow_result) | [
"def",
"testSetDurationNotSlowSeconds",
"(",
"self",
")",
":",
"result",
"=",
"data_types",
".",
"WebTestResult",
"(",
"'foo'",
",",
"[",
"'debug'",
"]",
",",
"'Pass'",
",",
"'step'",
",",
"'build_id'",
")",
"result",
".",
"SetDuration",
"(",
"30",
",",
"1... | Tests that setting a duration for non-slow in seconds works. | [
"Tests",
"that",
"setting",
"a",
"duration",
"for",
"non",
"-",
"slow",
"in",
"seconds",
"works",
"."
] | [
"\"\"\"Tests that setting a duration for non-slow in seconds works.\"\"\""
] | [
{
"param": "self",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
a34302e729035e5c97d8e9606288e357df98b2a0 | sunlongbo/chromium | third_party/blink/tools/blinkpy/web_tests/stale_expectation_removal/data_types_unittest.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | testSetDurationSlowSeconds | null | def testSetDurationSlowSeconds(self):
"""Tests that setting a duration for a slow result in seconds works."""
result = data_types.WebTestResult('foo', ['debug'], 'Pass', 'step',
'build_id')
result.SetDuration(30.01, 100)
self.assertTrue(result.is... | Tests that setting a duration for a slow result in seconds works. | Tests that setting a duration for a slow result in seconds works. | [
"Tests",
"that",
"setting",
"a",
"duration",
"for",
"a",
"slow",
"result",
"in",
"seconds",
"works",
"."
] | def testSetDurationSlowSeconds(self):
result = data_types.WebTestResult('foo', ['debug'], 'Pass', 'step',
'build_id')
result.SetDuration(30.01, 100)
self.assertTrue(result.is_slow_result) | [
"def",
"testSetDurationSlowSeconds",
"(",
"self",
")",
":",
"result",
"=",
"data_types",
".",
"WebTestResult",
"(",
"'foo'",
",",
"[",
"'debug'",
"]",
",",
"'Pass'",
",",
"'step'",
",",
"'build_id'",
")",
"result",
".",
"SetDuration",
"(",
"30.01",
",",
"1... | Tests that setting a duration for a slow result in seconds works. | [
"Tests",
"that",
"setting",
"a",
"duration",
"for",
"a",
"slow",
"result",
"in",
"seconds",
"works",
"."
] | [
"\"\"\"Tests that setting a duration for a slow result in seconds works.\"\"\""
] | [
{
"param": "self",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
a34302e729035e5c97d8e9606288e357df98b2a0 | sunlongbo/chromium | third_party/blink/tools/blinkpy/web_tests/stale_expectation_removal/data_types_unittest.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | testNeverNeededExpectationSlowExpectation | null | def testNeverNeededExpectationSlowExpectation(self):
"""Tests that special logic is used for Slow-only expectations."""
expectation = data_types.WebTestExpectation('foo', ['debug'], 'Slow')
stats = data_types.WebTestBuildStats()
# The fact that this failed should be ignored.
stat... | Tests that special logic is used for Slow-only expectations. | Tests that special logic is used for Slow-only expectations. | [
"Tests",
"that",
"special",
"logic",
"is",
"used",
"for",
"Slow",
"-",
"only",
"expectations",
"."
] | def testNeverNeededExpectationSlowExpectation(self):
expectation = data_types.WebTestExpectation('foo', ['debug'], 'Slow')
stats = data_types.WebTestBuildStats()
stats.AddFailedBuild('build_id')
self.assertTrue(stats.NeverNeededExpectation(expectation))
stats.AddSlowBuild('build_... | [
"def",
"testNeverNeededExpectationSlowExpectation",
"(",
"self",
")",
":",
"expectation",
"=",
"data_types",
".",
"WebTestExpectation",
"(",
"'foo'",
",",
"[",
"'debug'",
"]",
",",
"'Slow'",
")",
"stats",
"=",
"data_types",
".",
"WebTestBuildStats",
"(",
")",
"s... | Tests that special logic is used for Slow-only expectations. | [
"Tests",
"that",
"special",
"logic",
"is",
"used",
"for",
"Slow",
"-",
"only",
"expectations",
"."
] | [
"\"\"\"Tests that special logic is used for Slow-only expectations.\"\"\"",
"# The fact that this failed should be ignored."
] | [
{
"param": "self",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
a34302e729035e5c97d8e9606288e357df98b2a0 | sunlongbo/chromium | third_party/blink/tools/blinkpy/web_tests/stale_expectation_removal/data_types_unittest.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | testNeverNeededExpectationMixedSlowExpectation | null | def testNeverNeededExpectationMixedSlowExpectation(self):
"""Tests that special logic is used for mixed Slow expectations."""
expectation = data_types.WebTestExpectation('foo', ['debug'],
['Slow', 'Failure'])
stats = data_types.WebTestBuildStat... | Tests that special logic is used for mixed Slow expectations. | Tests that special logic is used for mixed Slow expectations. | [
"Tests",
"that",
"special",
"logic",
"is",
"used",
"for",
"mixed",
"Slow",
"expectations",
"."
] | def testNeverNeededExpectationMixedSlowExpectation(self):
expectation = data_types.WebTestExpectation('foo', ['debug'],
['Slow', 'Failure'])
stats = data_types.WebTestBuildStats()
stats.AddPassedBuild()
self.assertTrue(stats.NeverNeeded... | [
"def",
"testNeverNeededExpectationMixedSlowExpectation",
"(",
"self",
")",
":",
"expectation",
"=",
"data_types",
".",
"WebTestExpectation",
"(",
"'foo'",
",",
"[",
"'debug'",
"]",
",",
"[",
"'Slow'",
",",
"'Failure'",
"]",
")",
"stats",
"=",
"data_types",
".",
... | Tests that special logic is used for mixed Slow expectations. | [
"Tests",
"that",
"special",
"logic",
"is",
"used",
"for",
"mixed",
"Slow",
"expectations",
"."
] | [
"\"\"\"Tests that special logic is used for mixed Slow expectations.\"\"\"",
"# This should only return true if there are no slow builds AND there",
"# are no failed builds.",
"# Passed build, not slow.",
"# Passed build, slow.",
"# Failed build, not slow.",
"# Failed build, slow."
] | [
{
"param": "self",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
a34302e729035e5c97d8e9606288e357df98b2a0 | sunlongbo/chromium | third_party/blink/tools/blinkpy/web_tests/stale_expectation_removal/data_types_unittest.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | testNeverNeededExpectationNoSlowExpectation | null | def testNeverNeededExpectationNoSlowExpectation(self):
"""Tests that no special logic is used for non-Slow expectations."""
expectation = data_types.WebTestExpectation('foo', ['debug'],
'Failure')
stats = data_types.WebTestBuildStats()
... | Tests that no special logic is used for non-Slow expectations. | Tests that no special logic is used for non-Slow expectations. | [
"Tests",
"that",
"no",
"special",
"logic",
"is",
"used",
"for",
"non",
"-",
"Slow",
"expectations",
"."
] | def testNeverNeededExpectationNoSlowExpectation(self):
expectation = data_types.WebTestExpectation('foo', ['debug'],
'Failure')
stats = data_types.WebTestBuildStats()
stats.AddPassedBuild()
self.assertTrue(stats.NeverNeededExpectation(e... | [
"def",
"testNeverNeededExpectationNoSlowExpectation",
"(",
"self",
")",
":",
"expectation",
"=",
"data_types",
".",
"WebTestExpectation",
"(",
"'foo'",
",",
"[",
"'debug'",
"]",
",",
"'Failure'",
")",
"stats",
"=",
"data_types",
".",
"WebTestBuildStats",
"(",
")",... | Tests that no special logic is used for non-Slow expectations. | [
"Tests",
"that",
"no",
"special",
"logic",
"is",
"used",
"for",
"non",
"-",
"Slow",
"expectations",
"."
] | [
"\"\"\"Tests that no special logic is used for non-Slow expectations.\"\"\"",
"# Slowness should not be considered in this case."
] | [
{
"param": "self",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
a34302e729035e5c97d8e9606288e357df98b2a0 | sunlongbo/chromium | third_party/blink/tools/blinkpy/web_tests/stale_expectation_removal/data_types_unittest.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | testAlwaysNeededExpectationSlowExpectation | null | def testAlwaysNeededExpectationSlowExpectation(self):
"""Tests that special logic is used for Slow-only expectations."""
expectation = data_types.WebTestExpectation('foo', ['debug'], 'Slow')
stats = data_types.WebTestBuildStats()
# The fact that this failed should be ignored.
sta... | Tests that special logic is used for Slow-only expectations. | Tests that special logic is used for Slow-only expectations. | [
"Tests",
"that",
"special",
"logic",
"is",
"used",
"for",
"Slow",
"-",
"only",
"expectations",
"."
] | def testAlwaysNeededExpectationSlowExpectation(self):
expectation = data_types.WebTestExpectation('foo', ['debug'], 'Slow')
stats = data_types.WebTestBuildStats()
stats.AddFailedBuild('build_id')
self.assertFalse(stats.AlwaysNeededExpectation(expectation))
stats.AddSlowBuild('bui... | [
"def",
"testAlwaysNeededExpectationSlowExpectation",
"(",
"self",
")",
":",
"expectation",
"=",
"data_types",
".",
"WebTestExpectation",
"(",
"'foo'",
",",
"[",
"'debug'",
"]",
",",
"'Slow'",
")",
"stats",
"=",
"data_types",
".",
"WebTestBuildStats",
"(",
")",
"... | Tests that special logic is used for Slow-only expectations. | [
"Tests",
"that",
"special",
"logic",
"is",
"used",
"for",
"Slow",
"-",
"only",
"expectations",
"."
] | [
"\"\"\"Tests that special logic is used for Slow-only expectations.\"\"\"",
"# The fact that this failed should be ignored."
] | [
{
"param": "self",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
a34302e729035e5c97d8e9606288e357df98b2a0 | sunlongbo/chromium | third_party/blink/tools/blinkpy/web_tests/stale_expectation_removal/data_types_unittest.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | testAlwaysNeededExpectationMixedSlowExpectations | null | def testAlwaysNeededExpectationMixedSlowExpectations(self):
"""Tests that special logic is used for mixed Slow expectations."""
expectation = data_types.WebTestExpectation('foo', ['debug'],
['Slow', 'Failure'])
stats = data_types.WebTestBuildSt... | Tests that special logic is used for mixed Slow expectations. | Tests that special logic is used for mixed Slow expectations. | [
"Tests",
"that",
"special",
"logic",
"is",
"used",
"for",
"mixed",
"Slow",
"expectations",
"."
] | def testAlwaysNeededExpectationMixedSlowExpectations(self):
expectation = data_types.WebTestExpectation('foo', ['debug'],
['Slow', 'Failure'])
stats = data_types.WebTestBuildStats()
stats.AddPassedBuild()
self.assertFalse(stats.AlwaysNe... | [
"def",
"testAlwaysNeededExpectationMixedSlowExpectations",
"(",
"self",
")",
":",
"expectation",
"=",
"data_types",
".",
"WebTestExpectation",
"(",
"'foo'",
",",
"[",
"'debug'",
"]",
",",
"[",
"'Slow'",
",",
"'Failure'",
"]",
")",
"stats",
"=",
"data_types",
"."... | Tests that special logic is used for mixed Slow expectations. | [
"Tests",
"that",
"special",
"logic",
"is",
"used",
"for",
"mixed",
"Slow",
"expectations",
"."
] | [
"\"\"\"Tests that special logic is used for mixed Slow expectations.\"\"\"",
"# This should return true if either all builds failed OR all builds were",
"# slow.",
"# Passed build, not slow.",
"# Passed build, slow.",
"# Failed build, not slow.",
"# Failed build, slow."
] | [
{
"param": "self",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
a34302e729035e5c97d8e9606288e357df98b2a0 | sunlongbo/chromium | third_party/blink/tools/blinkpy/web_tests/stale_expectation_removal/data_types_unittest.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | testAlwaysNeededExpectationNoSlowExpectation | null | def testAlwaysNeededExpectationNoSlowExpectation(self):
"""Tests that no special logic is used for non-Slow expectations."""
expectation = data_types.WebTestExpectation('foo', ['debug'],
'Failure')
stats = data_types.WebTestBuildStats()
... | Tests that no special logic is used for non-Slow expectations. | Tests that no special logic is used for non-Slow expectations. | [
"Tests",
"that",
"no",
"special",
"logic",
"is",
"used",
"for",
"non",
"-",
"Slow",
"expectations",
"."
] | def testAlwaysNeededExpectationNoSlowExpectation(self):
expectation = data_types.WebTestExpectation('foo', ['debug'],
'Failure')
stats = data_types.WebTestBuildStats()
stats.AddFailedBuild('build_id')
self.assertTrue(stats.AlwaysNeededE... | [
"def",
"testAlwaysNeededExpectationNoSlowExpectation",
"(",
"self",
")",
":",
"expectation",
"=",
"data_types",
".",
"WebTestExpectation",
"(",
"'foo'",
",",
"[",
"'debug'",
"]",
",",
"'Failure'",
")",
"stats",
"=",
"data_types",
".",
"WebTestBuildStats",
"(",
")"... | Tests that no special logic is used for non-Slow expectations. | [
"Tests",
"that",
"no",
"special",
"logic",
"is",
"used",
"for",
"non",
"-",
"Slow",
"expectations",
"."
] | [
"\"\"\"Tests that no special logic is used for non-Slow expectations.\"\"\"",
"# Slowness should not be considered in this case even if all builds are",
"# slow."
] | [
{
"param": "self",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
8f57960b7d0ad74c052e5ee05e91920ce0d6adf8 | sunlongbo/chromium | tools/code_coverage/coverage.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | _GetPathWithLLVMSymbolizerDir | <not_specific> | def _GetPathWithLLVMSymbolizerDir():
"""Add llvm-symbolizer directory to path for symbolized stacks."""
path = os.getenv('PATH')
dirs = path.split(os.pathsep)
if LLVM_BIN_DIR in dirs:
return path
return path + os.pathsep + LLVM_BIN_DIR | Add llvm-symbolizer directory to path for symbolized stacks. | Add llvm-symbolizer directory to path for symbolized stacks. | [
"Add",
"llvm",
"-",
"symbolizer",
"directory",
"to",
"path",
"for",
"symbolized",
"stacks",
"."
] | def _GetPathWithLLVMSymbolizerDir():
path = os.getenv('PATH')
dirs = path.split(os.pathsep)
if LLVM_BIN_DIR in dirs:
return path
return path + os.pathsep + LLVM_BIN_DIR | [
"def",
"_GetPathWithLLVMSymbolizerDir",
"(",
")",
":",
"path",
"=",
"os",
".",
"getenv",
"(",
"'PATH'",
")",
"dirs",
"=",
"path",
".",
"split",
"(",
"os",
".",
"pathsep",
")",
"if",
"LLVM_BIN_DIR",
"in",
"dirs",
":",
"return",
"path",
"return",
"path",
... | Add llvm-symbolizer directory to path for symbolized stacks. | [
"Add",
"llvm",
"-",
"symbolizer",
"directory",
"to",
"path",
"for",
"symbolized",
"stacks",
"."
] | [
"\"\"\"Add llvm-symbolizer directory to path for symbolized stacks.\"\"\""
] | [] | {
"returns": [],
"raises": [],
"params": [],
"outlier_params": [],
"others": []
} |
8f57960b7d0ad74c052e5ee05e91920ce0d6adf8 | sunlongbo/chromium | tools/code_coverage/coverage.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | _GetTargetOS | <not_specific> | def _GetTargetOS():
"""Returns the target os specified in args.gn file.
Returns an empty string is target_os is not specified.
"""
build_args = _GetBuildArgs()
return build_args['target_os'] if 'target_os' in build_args else '' | Returns the target os specified in args.gn file.
Returns an empty string is target_os is not specified.
| Returns the target os specified in args.gn file.
Returns an empty string is target_os is not specified. | [
"Returns",
"the",
"target",
"os",
"specified",
"in",
"args",
".",
"gn",
"file",
".",
"Returns",
"an",
"empty",
"string",
"is",
"target_os",
"is",
"not",
"specified",
"."
] | def _GetTargetOS():
build_args = _GetBuildArgs()
return build_args['target_os'] if 'target_os' in build_args else '' | [
"def",
"_GetTargetOS",
"(",
")",
":",
"build_args",
"=",
"_GetBuildArgs",
"(",
")",
"return",
"build_args",
"[",
"'target_os'",
"]",
"if",
"'target_os'",
"in",
"build_args",
"else",
"''"
] | Returns the target os specified in args.gn file. | [
"Returns",
"the",
"target",
"os",
"specified",
"in",
"args",
".",
"gn",
"file",
"."
] | [
"\"\"\"Returns the target os specified in args.gn file.\n\n Returns an empty string is target_os is not specified.\n \"\"\""
] | [] | {
"returns": [],
"raises": [],
"params": [],
"outlier_params": [],
"others": []
} |
8f57960b7d0ad74c052e5ee05e91920ce0d6adf8 | sunlongbo/chromium | tools/code_coverage/coverage.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | _GetProfdataFilePath | <not_specific> | def _GetProfdataFilePath():
"""Path to the resulting .profdata file."""
return os.path.join(
coverage_utils.GetCoverageReportRootDirPath(OUTPUT_DIR),
PROFDATA_FILE_NAME) | Path to the resulting .profdata file. | Path to the resulting .profdata file. | [
"Path",
"to",
"the",
"resulting",
".",
"profdata",
"file",
"."
] | def _GetProfdataFilePath():
return os.path.join(
coverage_utils.GetCoverageReportRootDirPath(OUTPUT_DIR),
PROFDATA_FILE_NAME) | [
"def",
"_GetProfdataFilePath",
"(",
")",
":",
"return",
"os",
".",
"path",
".",
"join",
"(",
"coverage_utils",
".",
"GetCoverageReportRootDirPath",
"(",
"OUTPUT_DIR",
")",
",",
"PROFDATA_FILE_NAME",
")"
] | Path to the resulting .profdata file. | [
"Path",
"to",
"the",
"resulting",
".",
"profdata",
"file",
"."
] | [
"\"\"\"Path to the resulting .profdata file.\"\"\""
] | [] | {
"returns": [],
"raises": [],
"params": [],
"outlier_params": [],
"others": []
} |
8f57960b7d0ad74c052e5ee05e91920ce0d6adf8 | sunlongbo/chromium | tools/code_coverage/coverage.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | _GetSummaryFilePath | <not_specific> | def _GetSummaryFilePath():
"""The JSON file that contains coverage summary written by llvm-cov export."""
return os.path.join(
coverage_utils.GetCoverageReportRootDirPath(OUTPUT_DIR),
SUMMARY_FILE_NAME) | The JSON file that contains coverage summary written by llvm-cov export. | The JSON file that contains coverage summary written by llvm-cov export. | [
"The",
"JSON",
"file",
"that",
"contains",
"coverage",
"summary",
"written",
"by",
"llvm",
"-",
"cov",
"export",
"."
] | def _GetSummaryFilePath():
return os.path.join(
coverage_utils.GetCoverageReportRootDirPath(OUTPUT_DIR),
SUMMARY_FILE_NAME) | [
"def",
"_GetSummaryFilePath",
"(",
")",
":",
"return",
"os",
".",
"path",
".",
"join",
"(",
"coverage_utils",
".",
"GetCoverageReportRootDirPath",
"(",
"OUTPUT_DIR",
")",
",",
"SUMMARY_FILE_NAME",
")"
] | The JSON file that contains coverage summary written by llvm-cov export. | [
"The",
"JSON",
"file",
"that",
"contains",
"coverage",
"summary",
"written",
"by",
"llvm",
"-",
"cov",
"export",
"."
] | [
"\"\"\"The JSON file that contains coverage summary written by llvm-cov export.\"\"\""
] | [] | {
"returns": [],
"raises": [],
"params": [],
"outlier_params": [],
"others": []
} |
8f57960b7d0ad74c052e5ee05e91920ce0d6adf8 | sunlongbo/chromium | tools/code_coverage/coverage.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | _GetLcovFilePath | <not_specific> | def _GetLcovFilePath():
"""The LCOV file that contains coverage data written by llvm-cov export."""
return os.path.join(
coverage_utils.GetCoverageReportRootDirPath(OUTPUT_DIR),
LCOV_FILE_NAME) | The LCOV file that contains coverage data written by llvm-cov export. | The LCOV file that contains coverage data written by llvm-cov export. | [
"The",
"LCOV",
"file",
"that",
"contains",
"coverage",
"data",
"written",
"by",
"llvm",
"-",
"cov",
"export",
"."
] | def _GetLcovFilePath():
return os.path.join(
coverage_utils.GetCoverageReportRootDirPath(OUTPUT_DIR),
LCOV_FILE_NAME) | [
"def",
"_GetLcovFilePath",
"(",
")",
":",
"return",
"os",
".",
"path",
".",
"join",
"(",
"coverage_utils",
".",
"GetCoverageReportRootDirPath",
"(",
"OUTPUT_DIR",
")",
",",
"LCOV_FILE_NAME",
")"
] | The LCOV file that contains coverage data written by llvm-cov export. | [
"The",
"LCOV",
"file",
"that",
"contains",
"coverage",
"data",
"written",
"by",
"llvm",
"-",
"cov",
"export",
"."
] | [
"\"\"\"The LCOV file that contains coverage data written by llvm-cov export.\"\"\""
] | [] | {
"returns": [],
"raises": [],
"params": [],
"outlier_params": [],
"others": []
} |
8f57960b7d0ad74c052e5ee05e91920ce0d6adf8 | sunlongbo/chromium | tools/code_coverage/coverage.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | _CreateCoverageProfileDataForTargets | <not_specific> | def _CreateCoverageProfileDataForTargets(targets, commands, jobs_count=None):
"""Builds and runs target to generate the coverage profile data.
Args:
targets: A list of targets to build with coverage instrumentation.
commands: A list of commands used to run the targets.
jobs_count: Number of jobs to run... | Builds and runs target to generate the coverage profile data.
Args:
targets: A list of targets to build with coverage instrumentation.
commands: A list of commands used to run the targets.
jobs_count: Number of jobs to run in parallel for building. If None, a
default value is derived base... | Builds and runs target to generate the coverage profile data. | [
"Builds",
"and",
"runs",
"target",
"to",
"generate",
"the",
"coverage",
"profile",
"data",
"."
] | def _CreateCoverageProfileDataForTargets(targets, commands, jobs_count=None):
_BuildTargets(targets, jobs_count)
target_profdata_file_paths = _GetTargetProfDataPathsByExecutingCommands(
targets, commands)
coverage_profdata_file_path = (
_CreateCoverageProfileDataFromTargetProfDataFiles(
targ... | [
"def",
"_CreateCoverageProfileDataForTargets",
"(",
"targets",
",",
"commands",
",",
"jobs_count",
"=",
"None",
")",
":",
"_BuildTargets",
"(",
"targets",
",",
"jobs_count",
")",
"target_profdata_file_paths",
"=",
"_GetTargetProfDataPathsByExecutingCommands",
"(",
"target... | Builds and runs target to generate the coverage profile data. | [
"Builds",
"and",
"runs",
"target",
"to",
"generate",
"the",
"coverage",
"profile",
"data",
"."
] | [
"\"\"\"Builds and runs target to generate the coverage profile data.\n\n Args:\n targets: A list of targets to build with coverage instrumentation.\n commands: A list of commands used to run the targets.\n jobs_count: Number of jobs to run in parallel for building. If None, a\n default valu... | [
{
"param": "targets",
"type": null
},
{
"param": "commands",
"type": null
},
{
"param": "jobs_count",
"type": null
}
] | {
"returns": [
{
"docstring": "A relative path to the generated profdata file.",
"docstring_tokens": [
"A",
"relative",
"path",
"to",
"the",
"generated",
"profdata",
"file",
"."
],
"type": null
}
],
"raises": [... |
8f57960b7d0ad74c052e5ee05e91920ce0d6adf8 | sunlongbo/chromium | tools/code_coverage/coverage.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | _BuildTargets | null | def _BuildTargets(targets, jobs_count):
"""Builds target with Clang coverage instrumentation.
This function requires current working directory to be the root of checkout.
Args:
targets: A list of targets to build with coverage instrumentation.
jobs_count: Number of jobs to run in parallel for compilatio... | Builds target with Clang coverage instrumentation.
This function requires current working directory to be the root of checkout.
Args:
targets: A list of targets to build with coverage instrumentation.
jobs_count: Number of jobs to run in parallel for compilation. If None, a
default value i... | Builds target with Clang coverage instrumentation.
This function requires current working directory to be the root of checkout. | [
"Builds",
"target",
"with",
"Clang",
"coverage",
"instrumentation",
".",
"This",
"function",
"requires",
"current",
"working",
"directory",
"to",
"be",
"the",
"root",
"of",
"checkout",
"."
] | def _BuildTargets(targets, jobs_count):
logging.info('Building %s.', str(targets))
autoninja = 'autoninja'
if coverage_utils.GetHostPlatform() == 'win':
autoninja += '.bat'
subprocess_cmd = [autoninja, '-C', BUILD_DIR]
if jobs_count is not None:
subprocess_cmd.append('-j' + str(jobs_count))
subproce... | [
"def",
"_BuildTargets",
"(",
"targets",
",",
"jobs_count",
")",
":",
"logging",
".",
"info",
"(",
"'Building %s.'",
",",
"str",
"(",
"targets",
")",
")",
"autoninja",
"=",
"'autoninja'",
"if",
"coverage_utils",
".",
"GetHostPlatform",
"(",
")",
"==",
"'win'"... | Builds target with Clang coverage instrumentation. | [
"Builds",
"target",
"with",
"Clang",
"coverage",
"instrumentation",
"."
] | [
"\"\"\"Builds target with Clang coverage instrumentation.\n\n This function requires current working directory to be the root of checkout.\n\n Args:\n targets: A list of targets to build with coverage instrumentation.\n jobs_count: Number of jobs to run in parallel for compilation. If None, a\n ... | [
{
"param": "targets",
"type": null
},
{
"param": "jobs_count",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "targets",
"type": null,
"docstring": "A list of targets to build with coverage instrumentation.",
"docstring_tokens": [
"A",
"list",
"of",
"targets",
"to",
"build",
"with... |
8f57960b7d0ad74c052e5ee05e91920ce0d6adf8 | sunlongbo/chromium | tools/code_coverage/coverage.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | _GetTargetProfDataPathsByExecutingCommands | <not_specific> | def _GetTargetProfDataPathsByExecutingCommands(targets, commands):
"""Runs commands and returns the relative paths to the profraw data files.
Args:
targets: A list of targets built with coverage instrumentation.
commands: A list of commands used to run the targets.
Returns:
A list of relative paths ... | Runs commands and returns the relative paths to the profraw data files.
Args:
targets: A list of targets built with coverage instrumentation.
commands: A list of commands used to run the targets.
Returns:
A list of relative paths to the generated profraw data files.
| Runs commands and returns the relative paths to the profraw data files. | [
"Runs",
"commands",
"and",
"returns",
"the",
"relative",
"paths",
"to",
"the",
"profraw",
"data",
"files",
"."
] | def _GetTargetProfDataPathsByExecutingCommands(targets, commands):
logging.debug('Executing the test commands.')
report_root_dir = coverage_utils.GetCoverageReportRootDirPath(OUTPUT_DIR)
for file_or_dir in os.listdir(report_root_dir):
if file_or_dir.endswith(PROFRAW_FILE_EXTENSION):
os.remove(os.path.jo... | [
"def",
"_GetTargetProfDataPathsByExecutingCommands",
"(",
"targets",
",",
"commands",
")",
":",
"logging",
".",
"debug",
"(",
"'Executing the test commands.'",
")",
"report_root_dir",
"=",
"coverage_utils",
".",
"GetCoverageReportRootDirPath",
"(",
"OUTPUT_DIR",
")",
"for... | Runs commands and returns the relative paths to the profraw data files. | [
"Runs",
"commands",
"and",
"returns",
"the",
"relative",
"paths",
"to",
"the",
"profraw",
"data",
"files",
"."
] | [
"\"\"\"Runs commands and returns the relative paths to the profraw data files.\n\n Args:\n targets: A list of targets built with coverage instrumentation.\n commands: A list of commands used to run the targets.\n\n Returns:\n A list of relative paths to the generated profraw data files.\n \"\"\"",
"# ... | [
{
"param": "targets",
"type": null
},
{
"param": "commands",
"type": null
}
] | {
"returns": [
{
"docstring": "A list of relative paths to the generated profraw data files.",
"docstring_tokens": [
"A",
"list",
"of",
"relative",
"paths",
"to",
"the",
"generated",
"profraw",
"data",
"files",
... |
8f57960b7d0ad74c052e5ee05e91920ce0d6adf8 | sunlongbo/chromium | tools/code_coverage/coverage.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | _GetEnvironmentVars | <not_specific> | def _GetEnvironmentVars(profraw_file_path):
"""Return environment vars for subprocess, given a profraw file path."""
env = os.environ.copy()
env.update({
'LLVM_PROFILE_FILE': profraw_file_path,
'PATH': _GetPathWithLLVMSymbolizerDir()
})
return env | Return environment vars for subprocess, given a profraw file path. | Return environment vars for subprocess, given a profraw file path. | [
"Return",
"environment",
"vars",
"for",
"subprocess",
"given",
"a",
"profraw",
"file",
"path",
"."
] | def _GetEnvironmentVars(profraw_file_path):
env = os.environ.copy()
env.update({
'LLVM_PROFILE_FILE': profraw_file_path,
'PATH': _GetPathWithLLVMSymbolizerDir()
})
return env | [
"def",
"_GetEnvironmentVars",
"(",
"profraw_file_path",
")",
":",
"env",
"=",
"os",
".",
"environ",
".",
"copy",
"(",
")",
"env",
".",
"update",
"(",
"{",
"'LLVM_PROFILE_FILE'",
":",
"profraw_file_path",
",",
"'PATH'",
":",
"_GetPathWithLLVMSymbolizerDir",
"(",
... | Return environment vars for subprocess, given a profraw file path. | [
"Return",
"environment",
"vars",
"for",
"subprocess",
"given",
"a",
"profraw",
"file",
"path",
"."
] | [
"\"\"\"Return environment vars for subprocess, given a profraw file path.\"\"\""
] | [
{
"param": "profraw_file_path",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "profraw_file_path",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
8f57960b7d0ad74c052e5ee05e91920ce0d6adf8 | sunlongbo/chromium | tools/code_coverage/coverage.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | _SplitCommand | <not_specific> | def _SplitCommand(command):
"""Split a command string into parts in a platform-specific way."""
if coverage_utils.GetHostPlatform() == 'win':
return command.split()
return shlex.split(command) | Split a command string into parts in a platform-specific way. | Split a command string into parts in a platform-specific way. | [
"Split",
"a",
"command",
"string",
"into",
"parts",
"in",
"a",
"platform",
"-",
"specific",
"way",
"."
] | def _SplitCommand(command):
if coverage_utils.GetHostPlatform() == 'win':
return command.split()
return shlex.split(command) | [
"def",
"_SplitCommand",
"(",
"command",
")",
":",
"if",
"coverage_utils",
".",
"GetHostPlatform",
"(",
")",
"==",
"'win'",
":",
"return",
"command",
".",
"split",
"(",
")",
"return",
"shlex",
".",
"split",
"(",
"command",
")"
] | Split a command string into parts in a platform-specific way. | [
"Split",
"a",
"command",
"string",
"into",
"parts",
"in",
"a",
"platform",
"-",
"specific",
"way",
"."
] | [
"\"\"\"Split a command string into parts in a platform-specific way.\"\"\""
] | [
{
"param": "command",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "command",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
8f57960b7d0ad74c052e5ee05e91920ce0d6adf8 | sunlongbo/chromium | tools/code_coverage/coverage.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | _ExecuteCommand | <not_specific> | def _ExecuteCommand(target, command, output_file_path):
"""Runs a single command and generates a profraw data file."""
# Per Clang "Source-based Code Coverage" doc:
#
# "%p" expands out to the process ID. It's not used by this scripts due to:
# 1) If a target program spawns too many processess, it may exhaust... | Runs a single command and generates a profraw data file. | Runs a single command and generates a profraw data file. | [
"Runs",
"a",
"single",
"command",
"and",
"generates",
"a",
"profraw",
"data",
"file",
"."
] | def _ExecuteCommand(target, command, output_file_path):
"%p" expands out to the process ID. It's not used by this scripts due to:
1) If a target program spawns too many processess, it may exhaust all disk
space available. For example, unit_tests writes thousands of .profraw
files each of size 1GB+.
... | [
"def",
"_ExecuteCommand",
"(",
"target",
",",
"command",
",",
"output_file_path",
")",
":",
"profile_pattern_string",
"=",
"'%1m'",
"if",
"_IsFuzzerTarget",
"(",
"target",
")",
"else",
"'%4m'",
"expected_profraw_file_name",
"=",
"os",
".",
"extsep",
".",
"join",
... | Runs a single command and generates a profraw data file. | [
"Runs",
"a",
"single",
"command",
"and",
"generates",
"a",
"profraw",
"data",
"file",
"."
] | [
"\"\"\"Runs a single command and generates a profraw data file.\"\"\"",
"# Per Clang \"Source-based Code Coverage\" doc:",
"#",
"# \"%p\" expands out to the process ID. It's not used by this scripts due to:",
"# 1) If a target program spawns too many processess, it may exhaust all disk",
"# space avail... | [
{
"param": "target",
"type": null
},
{
"param": "command",
"type": null
},
{
"param": "output_file_path",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "target",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "command",
"type": null,
"docstring": null,
"docstring_token... |
8f57960b7d0ad74c052e5ee05e91920ce0d6adf8 | sunlongbo/chromium | tools/code_coverage/coverage.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | _IsFuzzerTarget | <not_specific> | def _IsFuzzerTarget(target):
"""Returns true if the target is a fuzzer target."""
build_args = _GetBuildArgs()
use_libfuzzer = ('use_libfuzzer' in build_args and
build_args['use_libfuzzer'] == 'true')
return use_libfuzzer and target.endswith('_fuzzer') | Returns true if the target is a fuzzer target. | Returns true if the target is a fuzzer target. | [
"Returns",
"true",
"if",
"the",
"target",
"is",
"a",
"fuzzer",
"target",
"."
] | def _IsFuzzerTarget(target):
build_args = _GetBuildArgs()
use_libfuzzer = ('use_libfuzzer' in build_args and
build_args['use_libfuzzer'] == 'true')
return use_libfuzzer and target.endswith('_fuzzer') | [
"def",
"_IsFuzzerTarget",
"(",
"target",
")",
":",
"build_args",
"=",
"_GetBuildArgs",
"(",
")",
"use_libfuzzer",
"=",
"(",
"'use_libfuzzer'",
"in",
"build_args",
"and",
"build_args",
"[",
"'use_libfuzzer'",
"]",
"==",
"'true'",
")",
"return",
"use_libfuzzer",
"... | Returns true if the target is a fuzzer target. | [
"Returns",
"true",
"if",
"the",
"target",
"is",
"a",
"fuzzer",
"target",
"."
] | [
"\"\"\"Returns true if the target is a fuzzer target.\"\"\""
] | [
{
"param": "target",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "target",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
8f57960b7d0ad74c052e5ee05e91920ce0d6adf8 | sunlongbo/chromium | tools/code_coverage/coverage.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | _ExecuteIOSCommand | <not_specific> | def _ExecuteIOSCommand(command, output_file_path):
"""Runs a single iOS command and generates a profraw data file.
iOS application doesn't have write access to folders outside of the app, so
it's impossible to instruct the app to flush the profraw data file to the
desired location. The profraw data file will b... | Runs a single iOS command and generates a profraw data file.
iOS application doesn't have write access to folders outside of the app, so
it's impossible to instruct the app to flush the profraw data file to the
desired location. The profraw data file will be generated somewhere within the
application's Documen... | Runs a single iOS command and generates a profraw data file.
iOS application doesn't have write access to folders outside of the app, so
it's impossible to instruct the app to flush the profraw data file to the
desired location. The profraw data file will be generated somewhere within the
application's Documents folder... | [
"Runs",
"a",
"single",
"iOS",
"command",
"and",
"generates",
"a",
"profraw",
"data",
"file",
".",
"iOS",
"application",
"doesn",
"'",
"t",
"have",
"write",
"access",
"to",
"folders",
"outside",
"of",
"the",
"app",
"so",
"it",
"'",
"s",
"impossible",
"to"... | def _ExecuteIOSCommand(command, output_file_path):
assert _IsIOSCommand(command)
iossim_profraw_file_path = os.path.join(
OUTPUT_DIR, os.extsep.join(['iossim', PROFRAW_FILE_EXTENSION]))
command = command.replace(LLVM_PROFILE_FILE_PATH_SUBSTITUTION,
iossim_profraw_file_path)
try... | [
"def",
"_ExecuteIOSCommand",
"(",
"command",
",",
"output_file_path",
")",
":",
"assert",
"_IsIOSCommand",
"(",
"command",
")",
"iossim_profraw_file_path",
"=",
"os",
".",
"path",
".",
"join",
"(",
"OUTPUT_DIR",
",",
"os",
".",
"extsep",
".",
"join",
"(",
"[... | Runs a single iOS command and generates a profraw data file. | [
"Runs",
"a",
"single",
"iOS",
"command",
"and",
"generates",
"a",
"profraw",
"data",
"file",
"."
] | [
"\"\"\"Runs a single iOS command and generates a profraw data file.\n\n iOS application doesn't have write access to folders outside of the app, so\n it's impossible to instruct the app to flush the profraw data file to the\n desired location. The profraw data file will be generated somewhere within the\n appli... | [
{
"param": "command",
"type": null
},
{
"param": "output_file_path",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "command",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "output_file_path",
"type": null,
"docstring": null,
"docst... |
8f57960b7d0ad74c052e5ee05e91920ce0d6adf8 | sunlongbo/chromium | tools/code_coverage/coverage.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | _GetProfrawDataFileByParsingOutput | <not_specific> | def _GetProfrawDataFileByParsingOutput(output):
"""Returns the path to the profraw data file obtained by parsing the output.
The output of running the test target has no format, but it is guaranteed to
have a single line containing the path to the generated profraw data file.
NOTE: This should only be called w... | Returns the path to the profraw data file obtained by parsing the output.
The output of running the test target has no format, but it is guaranteed to
have a single line containing the path to the generated profraw data file.
NOTE: This should only be called when target os is iOS.
| Returns the path to the profraw data file obtained by parsing the output.
The output of running the test target has no format, but it is guaranteed to
have a single line containing the path to the generated profraw data file.
NOTE: This should only be called when target os is iOS. | [
"Returns",
"the",
"path",
"to",
"the",
"profraw",
"data",
"file",
"obtained",
"by",
"parsing",
"the",
"output",
".",
"The",
"output",
"of",
"running",
"the",
"test",
"target",
"has",
"no",
"format",
"but",
"it",
"is",
"guaranteed",
"to",
"have",
"a",
"si... | def _GetProfrawDataFileByParsingOutput(output):
assert _IsIOS()
output_by_lines = ''.join(output).splitlines()
profraw_file_pattern = re.compile('.*Coverage data at (.*coverage\.profraw).')
for line in output_by_lines:
result = profraw_file_pattern.match(line)
if result:
return result.group(1)
a... | [
"def",
"_GetProfrawDataFileByParsingOutput",
"(",
"output",
")",
":",
"assert",
"_IsIOS",
"(",
")",
"output_by_lines",
"=",
"''",
".",
"join",
"(",
"output",
")",
".",
"splitlines",
"(",
")",
"profraw_file_pattern",
"=",
"re",
".",
"compile",
"(",
"'.*Coverage... | Returns the path to the profraw data file obtained by parsing the output. | [
"Returns",
"the",
"path",
"to",
"the",
"profraw",
"data",
"file",
"obtained",
"by",
"parsing",
"the",
"output",
"."
] | [
"\"\"\"Returns the path to the profraw data file obtained by parsing the output.\n\n The output of running the test target has no format, but it is guaranteed to\n have a single line containing the path to the generated profraw data file.\n NOTE: This should only be called when target os is iOS.\n \"\"\""
] | [
{
"param": "output",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "output",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.