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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
478d3c72993436247f9ad6c1ab104fd30b06d396 | sunlongbo/chromium | tools/android/dependency_analysis/count_cycles.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | find_cycles | List[List[Cycle]] | def find_cycles(base_graph: graph.Graph,
max_cycle_length: int) -> List[List[Cycle]]:
"""Finds all cycles in the graph within a certain length.
The algorithm is as such: Number the nodes arbitrarily. For i from 0 to
the number of nodes, find all cycles starting and ending at node i using
... | Finds all cycles in the graph within a certain length.
The algorithm is as such: Number the nodes arbitrarily. For i from 0 to
the number of nodes, find all cycles starting and ending at node i using
only nodes with numbers >= i (see find_cycles_from_node). Taking the union
of the results will give all... | Finds all cycles in the graph within a certain length.
The algorithm is as such: Number the nodes arbitrarily. For i from 0 to
the number of nodes, find all cycles starting and ending at node i using
only nodes with numbers >= i . Taking the union
of the results will give all relevant cycles in the graph. | [
"Finds",
"all",
"cycles",
"in",
"the",
"graph",
"within",
"a",
"certain",
"length",
".",
"The",
"algorithm",
"is",
"as",
"such",
":",
"Number",
"the",
"nodes",
"arbitrarily",
".",
"For",
"i",
"from",
"0",
"to",
"the",
"number",
"of",
"nodes",
"find",
"... | def find_cycles(base_graph: graph.Graph,
max_cycle_length: int) -> List[List[Cycle]]:
sorted_base_graph_nodes = sorted(base_graph.nodes)
node_to_id = {}
for generated_node_id, node in enumerate(sorted_base_graph_nodes):
node_to_id[node] = generated_node_id
num_nodes = base_graph.... | [
"def",
"find_cycles",
"(",
"base_graph",
":",
"graph",
".",
"Graph",
",",
"max_cycle_length",
":",
"int",
")",
"->",
"List",
"[",
"List",
"[",
"Cycle",
"]",
"]",
":",
"sorted_base_graph_nodes",
"=",
"sorted",
"(",
"base_graph",
".",
"nodes",
")",
"node_to_... | Finds all cycles in the graph within a certain length. | [
"Finds",
"all",
"cycles",
"in",
"the",
"graph",
"within",
"a",
"certain",
"length",
"."
] | [
"\"\"\"Finds all cycles in the graph within a certain length.\n\n The algorithm is as such: Number the nodes arbitrarily. For i from 0 to\n the number of nodes, find all cycles starting and ending at node i using\n only nodes with numbers >= i (see find_cycles_from_node). Taking the union\n of the resul... | [
{
"param": "base_graph",
"type": "graph.Graph"
},
{
"param": "max_cycle_length",
"type": "int"
}
] | {
"returns": [
{
"docstring": "A list |cycles| of length |max_cycle_length| + 1, where cycles[i]\ncontains all cycles of length i.",
"docstring_tokens": [
"A",
"list",
"|cycles|",
"of",
"length",
"|max_cycle_length|",
"+",
"1",
"w... |
478d3c72993436247f9ad6c1ab104fd30b06d396 | sunlongbo/chromium | tools/android/dependency_analysis/count_cycles.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | main | null | def main():
"""Enumerates the cycles within a certain length in a graph."""
arg_parser = argparse.ArgumentParser(
description='Given a JSON dependency graph, count the number of cycles '
'in the package graph.')
required_arg_group = arg_parser.add_argument_group('required arguments')
re... | Enumerates the cycles within a certain length in a graph. | Enumerates the cycles within a certain length in a graph. | [
"Enumerates",
"the",
"cycles",
"within",
"a",
"certain",
"length",
"in",
"a",
"graph",
"."
] | def main():
arg_parser = argparse.ArgumentParser(
description='Given a JSON dependency graph, count the number of cycles '
'in the package graph.')
required_arg_group = arg_parser.add_argument_group('required arguments')
required_arg_group.add_argument(
'-f',
'--file',
... | [
"def",
"main",
"(",
")",
":",
"arg_parser",
"=",
"argparse",
".",
"ArgumentParser",
"(",
"description",
"=",
"'Given a JSON dependency graph, count the number of cycles '",
"'in the package graph.'",
")",
"required_arg_group",
"=",
"arg_parser",
".",
"add_argument_group",
"... | Enumerates the cycles within a certain length in a graph. | [
"Enumerates",
"the",
"cycles",
"within",
"a",
"certain",
"length",
"in",
"a",
"graph",
"."
] | [
"\"\"\"Enumerates the cycles within a certain length in a graph.\"\"\"",
"# There are no cycles of length 0 or 1 (since self-loops are disallowed)."
] | [] | {
"returns": [],
"raises": [],
"params": [],
"outlier_params": [],
"others": []
} |
e3c385392638108500c0254ec0ce71d8afa4f9ab | sunlongbo/chromium | ios/build/bots/scripts/run.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | install_xcode | <not_specific> | def install_xcode(self):
"""Installs the requested Xcode build version.
Returns:
(bool, bool)
First bool: True if installation was successful. False otherwise.
Second bool: True if Xcode is legacy package. False if it's new.
"""
try:
if not self.args.mac_toolchain_cmd:
... | Installs the requested Xcode build version.
Returns:
(bool, bool)
First bool: True if installation was successful. False otherwise.
Second bool: True if Xcode is legacy package. False if it's new.
| Installs the requested Xcode build version. | [
"Installs",
"the",
"requested",
"Xcode",
"build",
"version",
"."
] | def install_xcode(self):
try:
if not self.args.mac_toolchain_cmd:
raise test_runner.MacToolchainNotFoundError(self.args.mac_toolchain_cmd)
if not os.path.exists(self.args.xcode_path):
raise test_runner.XcodePathNotFoundError(self.args.xcode_path)
runtime_cache_folder = None
i... | [
"def",
"install_xcode",
"(",
"self",
")",
":",
"try",
":",
"if",
"not",
"self",
".",
"args",
".",
"mac_toolchain_cmd",
":",
"raise",
"test_runner",
".",
"MacToolchainNotFoundError",
"(",
"self",
".",
"args",
".",
"mac_toolchain_cmd",
")",
"if",
"not",
"os",
... | Installs the requested Xcode build version. | [
"Installs",
"the",
"requested",
"Xcode",
"build",
"version",
"."
] | [
"\"\"\"Installs the requested Xcode build version.\n\n Returns:\n (bool, bool)\n First bool: True if installation was successful. False otherwise.\n Second bool: True if Xcode is legacy package. False if it's new.\n \"\"\"",
"# Guard against incorrect install paths. On swarming, this path... | [
{
"param": "self",
"type": null
}
] | {
"returns": [
{
"docstring": null,
"docstring_tokens": [
"None"
],
"type": null
}
],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
... |
e3c385392638108500c0254ec0ce71d8afa4f9ab | sunlongbo/chromium | ios/build/bots/scripts/run.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | parse_args | null | def parse_args(self, args):
"""Parse the args into args and test_args.
Note: test_cases related arguments are handled in |resolve_test_cases|
instead of this function.
"""
parser = argparse.ArgumentParser()
parser.add_argument(
'-x',
'--xcode-parallelization',
help='Run... | Parse the args into args and test_args.
Note: test_cases related arguments are handled in |resolve_test_cases|
instead of this function.
| Parse the args into args and test_args.
Note: test_cases related arguments are handled in |resolve_test_cases|
instead of this function. | [
"Parse",
"the",
"args",
"into",
"args",
"and",
"test_args",
".",
"Note",
":",
"test_cases",
"related",
"arguments",
"are",
"handled",
"in",
"|resolve_test_cases|",
"instead",
"of",
"this",
"function",
"."
] | def parse_args(self, args):
parser = argparse.ArgumentParser()
parser.add_argument(
'-x',
'--xcode-parallelization',
help='Run tests using xcodebuild\'s parallelization.',
action='store_true',
)
parser.add_argument(
'-a',
'--app',
help='Compiled .a... | [
"def",
"parse_args",
"(",
"self",
",",
"args",
")",
":",
"parser",
"=",
"argparse",
".",
"ArgumentParser",
"(",
")",
"parser",
".",
"add_argument",
"(",
"'-x'",
",",
"'--xcode-parallelization'",
",",
"help",
"=",
"'Run tests using xcodebuild\\'s parallelization.'",
... | Parse the args into args and test_args. | [
"Parse",
"the",
"args",
"into",
"args",
"and",
"test_args",
"."
] | [
"\"\"\"Parse the args into args and test_args.\n\n Note: test_cases related arguments are handled in |resolve_test_cases|\n instead of this function.\n \"\"\"",
"#TODO(crbug.com/1056887): Implement this arg in infra.",
"\"\"\"Loads and sets arguments from args_json.\n\n Note: |test_cases| in --arg... | [
{
"param": "self",
"type": null
},
{
"param": "args",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "args",
"type": null,
"docstring": null,
"docstring_tokens": [... |
8ccac4aed6389c6a8ec5dd5215a1cfd99bc8ea20 | sunlongbo/chromium | build/rust/run_build_script.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | host_triple | <not_specific> | def host_triple(rustc_path):
""" Works out the host rustc target. """
args = [rustc_path, "-vV"]
known_vars = dict()
proc = subprocess.Popen(args, stdout=subprocess.PIPE)
for line in io.TextIOWrapper(proc.stdout, encoding="utf-8"):
m = RUSTC_VERSION_LINE.match(line.rstrip())
if m:
known_vars[m.g... | Works out the host rustc target. | Works out the host rustc target. | [
"Works",
"out",
"the",
"host",
"rustc",
"target",
"."
] | def host_triple(rustc_path):
args = [rustc_path, "-vV"]
known_vars = dict()
proc = subprocess.Popen(args, stdout=subprocess.PIPE)
for line in io.TextIOWrapper(proc.stdout, encoding="utf-8"):
m = RUSTC_VERSION_LINE.match(line.rstrip())
if m:
known_vars[m.group(1)] = m.group(2)
return known_vars["... | [
"def",
"host_triple",
"(",
"rustc_path",
")",
":",
"args",
"=",
"[",
"rustc_path",
",",
"\"-vV\"",
"]",
"known_vars",
"=",
"dict",
"(",
")",
"proc",
"=",
"subprocess",
".",
"Popen",
"(",
"args",
",",
"stdout",
"=",
"subprocess",
".",
"PIPE",
")",
"for"... | Works out the host rustc target. | [
"Works",
"out",
"the",
"host",
"rustc",
"target",
"."
] | [
"\"\"\" Works out the host rustc target. \"\"\""
] | [
{
"param": "rustc_path",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "rustc_path",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
d453d8046b96904dcd0a345609da98c520911055 | sunlongbo/chromium | chrome/updater/test/service/win/impersonate.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | _MakeInheritable | <not_specific> | def _MakeInheritable(self, handle):
"""Returns an inheritable duplicated handle."""
inheritable_handle = win32api.DuplicateHandle(
win32api.GetCurrentProcess(), handle, win32api.GetCurrentProcess(), 0,
1, win32con.DUPLICATE_SAME_ACCESS)
win32file.CloseHandle(handle)
return inheritable_ha... | Returns an inheritable duplicated handle. | Returns an inheritable duplicated handle. | [
"Returns",
"an",
"inheritable",
"duplicated",
"handle",
"."
] | def _MakeInheritable(self, handle):
inheritable_handle = win32api.DuplicateHandle(
win32api.GetCurrentProcess(), handle, win32api.GetCurrentProcess(), 0,
1, win32con.DUPLICATE_SAME_ACCESS)
win32file.CloseHandle(handle)
return inheritable_handle | [
"def",
"_MakeInheritable",
"(",
"self",
",",
"handle",
")",
":",
"inheritable_handle",
"=",
"win32api",
".",
"DuplicateHandle",
"(",
"win32api",
".",
"GetCurrentProcess",
"(",
")",
",",
"handle",
",",
"win32api",
".",
"GetCurrentProcess",
"(",
")",
",",
"0",
... | Returns an inheritable duplicated handle. | [
"Returns",
"an",
"inheritable",
"duplicated",
"handle",
"."
] | [
"\"\"\"Returns an inheritable duplicated handle.\"\"\""
] | [
{
"param": "self",
"type": null
},
{
"param": "handle",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "handle",
"type": null,
"docstring": null,
"docstring_tokens":... |
d453d8046b96904dcd0a345609da98c520911055 | sunlongbo/chromium | chrome/updater/test/service/win/impersonate.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | _ReadStdout | null | def _ReadStdout(self):
"""Read content from the stdout pipe."""
try:
logging.info('Into read thread for STDOUT...')
stdout_buf = os.fdopen(msvcrt.open_osfhandle(self.stdout_r, 0), 'rt')
self.stdout = stdout_buf.read()
except Exception as err:
logging.exception(err) | Read content from the stdout pipe. | Read content from the stdout pipe. | [
"Read",
"content",
"from",
"the",
"stdout",
"pipe",
"."
] | def _ReadStdout(self):
try:
logging.info('Into read thread for STDOUT...')
stdout_buf = os.fdopen(msvcrt.open_osfhandle(self.stdout_r, 0), 'rt')
self.stdout = stdout_buf.read()
except Exception as err:
logging.exception(err) | [
"def",
"_ReadStdout",
"(",
"self",
")",
":",
"try",
":",
"logging",
".",
"info",
"(",
"'Into read thread for STDOUT...'",
")",
"stdout_buf",
"=",
"os",
".",
"fdopen",
"(",
"msvcrt",
".",
"open_osfhandle",
"(",
"self",
".",
"stdout_r",
",",
"0",
")",
",",
... | Read content from the stdout pipe. | [
"Read",
"content",
"from",
"the",
"stdout",
"pipe",
"."
] | [
"\"\"\"Read content from the stdout pipe.\"\"\""
] | [
{
"param": "self",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
d453d8046b96904dcd0a345609da98c520911055 | sunlongbo/chromium | chrome/updater/test/service/win/impersonate.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | _ReadStderr | null | def _ReadStderr(self):
"""Read content from the stderr pipe."""
try:
logging.info('Into read thread for STDERR...')
stderr_buf = os.fdopen(msvcrt.open_osfhandle(self.stderr_r, 0), 'rt')
self.stderr = stderr_buf.read()
except Exception as err:
logging.exception(err) | Read content from the stderr pipe. | Read content from the stderr pipe. | [
"Read",
"content",
"from",
"the",
"stderr",
"pipe",
"."
] | def _ReadStderr(self):
try:
logging.info('Into read thread for STDERR...')
stderr_buf = os.fdopen(msvcrt.open_osfhandle(self.stderr_r, 0), 'rt')
self.stderr = stderr_buf.read()
except Exception as err:
logging.exception(err) | [
"def",
"_ReadStderr",
"(",
"self",
")",
":",
"try",
":",
"logging",
".",
"info",
"(",
"'Into read thread for STDERR...'",
")",
"stderr_buf",
"=",
"os",
".",
"fdopen",
"(",
"msvcrt",
".",
"open_osfhandle",
"(",
"self",
".",
"stderr_r",
",",
"0",
")",
",",
... | Read content from the stderr pipe. | [
"Read",
"content",
"from",
"the",
"stderr",
"pipe",
"."
] | [
"\"\"\"Read content from the stderr pipe.\"\"\""
] | [
{
"param": "self",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
d453d8046b96904dcd0a345609da98c520911055 | sunlongbo/chromium | chrome/updater/test/service/win/impersonate.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | ReadAll | null | def ReadAll(self):
"""Fork threads to read stdout/stderr."""
self.stdout_thread = threading.Thread(target=self._ReadStdout)
self.stdout_thread.setDaemon(True)
self.stdout_thread.start()
self.stderr_thread = threading.Thread(target=self._ReadStderr)
self.stderr_thread.setDaemon(True)
self.st... | Fork threads to read stdout/stderr. | Fork threads to read stdout/stderr. | [
"Fork",
"threads",
"to",
"read",
"stdout",
"/",
"stderr",
"."
] | def ReadAll(self):
self.stdout_thread = threading.Thread(target=self._ReadStdout)
self.stdout_thread.setDaemon(True)
self.stdout_thread.start()
self.stderr_thread = threading.Thread(target=self._ReadStderr)
self.stderr_thread.setDaemon(True)
self.stderr_thread.start() | [
"def",
"ReadAll",
"(",
"self",
")",
":",
"self",
".",
"stdout_thread",
"=",
"threading",
".",
"Thread",
"(",
"target",
"=",
"self",
".",
"_ReadStdout",
")",
"self",
".",
"stdout_thread",
".",
"setDaemon",
"(",
"True",
")",
"self",
".",
"stdout_thread",
"... | Fork threads to read stdout/stderr. | [
"Fork",
"threads",
"to",
"read",
"stdout",
"/",
"stderr",
"."
] | [
"\"\"\"Fork threads to read stdout/stderr.\"\"\""
] | [
{
"param": "self",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
d453d8046b96904dcd0a345609da98c520911055 | sunlongbo/chromium | chrome/updater/test/service/win/impersonate.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | CloseWriteHandles | null | def CloseWriteHandles(self):
"""Closes write handles.
This is important to unblock readers: read threads will wait until all
write handles are closed.
"""
win32file.CloseHandle(self.stdout_w)
win32file.CloseHandle(self.stderr_w) | Closes write handles.
This is important to unblock readers: read threads will wait until all
write handles are closed.
| Closes write handles.
This is important to unblock readers: read threads will wait until all
write handles are closed. | [
"Closes",
"write",
"handles",
".",
"This",
"is",
"important",
"to",
"unblock",
"readers",
":",
"read",
"threads",
"will",
"wait",
"until",
"all",
"write",
"handles",
"are",
"closed",
"."
] | def CloseWriteHandles(self):
win32file.CloseHandle(self.stdout_w)
win32file.CloseHandle(self.stderr_w) | [
"def",
"CloseWriteHandles",
"(",
"self",
")",
":",
"win32file",
".",
"CloseHandle",
"(",
"self",
".",
"stdout_w",
")",
"win32file",
".",
"CloseHandle",
"(",
"self",
".",
"stderr_w",
")"
] | Closes write handles. | [
"Closes",
"write",
"handles",
"."
] | [
"\"\"\"Closes write handles.\n\n This is important to unblock readers: read threads will wait until all\n write handles are closed.\n \"\"\""
] | [
{
"param": "self",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
d453d8046b96904dcd0a345609da98c520911055 | sunlongbo/chromium | chrome/updater/test/service/win/impersonate.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | _RunAsOnWindowStationDesktop | <not_specific> | def _RunAsOnWindowStationDesktop(command_line,
security_token,
window_station,
desktop,
env=None,
cwd=None,
timeout=win32e... | Runs a command as the security token user on given desktop.
Args:
command_line: Full command line string to run.
security_token: Security token that the command run as.
window_station: Window station for the new process to run, tpically is
"WinSta0", aka the interactive window station.
desktop... | Runs a command as the security token user on given desktop. | [
"Runs",
"a",
"command",
"as",
"the",
"security",
"token",
"user",
"on",
"given",
"desktop",
"."
] | def _RunAsOnWindowStationDesktop(command_line,
security_token,
window_station,
desktop,
env=None,
cwd=None,
timeout=win32e... | [
"def",
"_RunAsOnWindowStationDesktop",
"(",
"command_line",
",",
"security_token",
",",
"window_station",
",",
"desktop",
",",
"env",
"=",
"None",
",",
"cwd",
"=",
"None",
",",
"timeout",
"=",
"win32event",
".",
"INFINITE",
")",
":",
"pipes",
"=",
"_StdoutStde... | Runs a command as the security token user on given desktop. | [
"Runs",
"a",
"command",
"as",
"the",
"security",
"token",
"user",
"on",
"given",
"desktop",
"."
] | [
"\"\"\"Runs a command as the security token user on given desktop.\n\n Args:\n command_line: Full command line string to run.\n security_token: Security token that the command run as.\n window_station: Window station for the new process to run, tpically is\n \"WinSta0\", aka the interactive window s... | [
{
"param": "command_line",
"type": null
},
{
"param": "security_token",
"type": null
},
{
"param": "window_station",
"type": null
},
{
"param": "desktop",
"type": null
},
{
"param": "env",
"type": null
},
{
"param": "cwd",
"type": null
},
{
... | {
"returns": [
{
"docstring": "(pid, exit_code, stdout, stderr) tuple.",
"docstring_tokens": [
"(",
"pid",
"exit_code",
"stdout",
"stderr",
")",
"tuple",
"."
],
"type": null
}
],
"raises": [
{
"docstring": "w... |
d453d8046b96904dcd0a345609da98c520911055 | sunlongbo/chromium | chrome/updater/test/service/win/impersonate.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | RunAsStandardUser | <not_specific> | def RunAsStandardUser(command_line, env, cwd, timeout):
"""Runs a command as non-elevated logged-on user.
Args:
command_line: The command line string, including arguments, to run.
env: Environment variables for child process, None to inherit.
cwd: Working directory for child process, None to inherit fr... | Runs a command as non-elevated logged-on user.
Args:
command_line: The command line string, including arguments, to run.
env: Environment variables for child process, None to inherit.
cwd: Working directory for child process, None to inherit from parent.
timeout: How long in seconds should wait for c... | Runs a command as non-elevated logged-on user. | [
"Runs",
"a",
"command",
"as",
"non",
"-",
"elevated",
"logged",
"-",
"on",
"user",
"."
] | def RunAsStandardUser(command_line, env, cwd, timeout):
logging.info('Running "%s" as the logon user.', command_line)
current_process_token = win32security.OpenProcessToken(
win32api.GetCurrentProcess(), win32security.TOKEN_ALL_ACCESS)
tcb_privilege_flag = win32security.LookupPrivilegeValue(
None, win... | [
"def",
"RunAsStandardUser",
"(",
"command_line",
",",
"env",
",",
"cwd",
",",
"timeout",
")",
":",
"logging",
".",
"info",
"(",
"'Running \"%s\" as the logon user.'",
",",
"command_line",
")",
"current_process_token",
"=",
"win32security",
".",
"OpenProcessToken",
"... | Runs a command as non-elevated logged-on user. | [
"Runs",
"a",
"command",
"as",
"non",
"-",
"elevated",
"logged",
"-",
"on",
"user",
"."
] | [
"\"\"\"Runs a command as non-elevated logged-on user.\n\n Args:\n command_line: The command line string, including arguments, to run.\n env: Environment variables for child process, None to inherit.\n cwd: Working directory for child process, None to inherit from parent.\n timeout: How long in seconds ... | [
{
"param": "command_line",
"type": null
},
{
"param": "env",
"type": null
},
{
"param": "cwd",
"type": null
},
{
"param": "timeout",
"type": null
}
] | {
"returns": [
{
"docstring": "(pid, exit_code, sdtout, stderr) tuple.",
"docstring_tokens": [
"(",
"pid",
"exit_code",
"sdtout",
"stderr",
")",
"tuple",
"."
],
"type": null
}
],
"raises": [
{
"docstring": "w... |
d453d8046b96904dcd0a345609da98c520911055 | sunlongbo/chromium | chrome/updater/test/service/win/impersonate.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | RunAsPidOnDeskstop | <not_specific> | def RunAsPidOnDeskstop(command_line,
pid,
window_station='WinSta0',
desktop='default',
env=None,
cwd=None,
timeout=win32event.INFINITE):
"""Runs a command with pid's security token... | Runs a command with pid's security token and on the given desktop.
Args:
command_line: The command line string, including arguments, to run.
pid: ID of the process to get the security token from.
window_station: Window station for the new process to run, tpically is
"WinSta0", aka the interactive ... | Runs a command with pid's security token and on the given desktop. | [
"Runs",
"a",
"command",
"with",
"pid",
"'",
"s",
"security",
"token",
"and",
"on",
"the",
"given",
"desktop",
"."
] | def RunAsPidOnDeskstop(command_line,
pid,
window_station='WinSta0',
desktop='default',
env=None,
cwd=None,
timeout=win32event.INFINITE):
logging.info('RunAsPidOnDeskstop: [%s][%s]'... | [
"def",
"RunAsPidOnDeskstop",
"(",
"command_line",
",",
"pid",
",",
"window_station",
"=",
"'WinSta0'",
",",
"desktop",
"=",
"'default'",
",",
"env",
"=",
"None",
",",
"cwd",
"=",
"None",
",",
"timeout",
"=",
"win32event",
".",
"INFINITE",
")",
":",
"loggin... | Runs a command with pid's security token and on the given desktop. | [
"Runs",
"a",
"command",
"with",
"pid",
"'",
"s",
"security",
"token",
"and",
"on",
"the",
"given",
"desktop",
"."
] | [
"\"\"\"Runs a command with pid's security token and on the given desktop.\n\n Args:\n command_line: The command line string, including arguments, to run.\n pid: ID of the process to get the security token from.\n window_station: Window station for the new process to run, tpically is\n \"WinSta0\", a... | [
{
"param": "command_line",
"type": null
},
{
"param": "pid",
"type": null
},
{
"param": "window_station",
"type": null
},
{
"param": "desktop",
"type": null
},
{
"param": "env",
"type": null
},
{
"param": "cwd",
"type": null
},
{
"param": "... | {
"returns": [
{
"docstring": "(pid, exit_code, stdout, stderr) tuple.",
"docstring_tokens": [
"(",
"pid",
"exit_code",
"stdout",
"stderr",
")",
"tuple",
"."
],
"type": null
}
],
"raises": [],
"params": [
{
... |
d45ced9e921be06400fb52ae137da2b184f5c199 | sunlongbo/chromium | third_party/blink/tools/blinkpy/w3c/wpt_manifest.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | all_url_items | <not_specific> | def all_url_items(self):
"""Returns a dict mapping every URL in the manifest to its item."""
url_items = {}
if 'items' not in self.raw_dict:
return url_items
items = self.raw_dict['items']
for test_type in self.test_types:
if test_type not in items:
... | Returns a dict mapping every URL in the manifest to its item. | Returns a dict mapping every URL in the manifest to its item. | [
"Returns",
"a",
"dict",
"mapping",
"every",
"URL",
"in",
"the",
"manifest",
"to",
"its",
"item",
"."
] | def all_url_items(self):
url_items = {}
if 'items' not in self.raw_dict:
return url_items
items = self.raw_dict['items']
for test_type in self.test_types:
if test_type not in items:
continue
for filename, records in items[test_type].ite... | [
"def",
"all_url_items",
"(",
"self",
")",
":",
"url_items",
"=",
"{",
"}",
"if",
"'items'",
"not",
"in",
"self",
".",
"raw_dict",
":",
"return",
"url_items",
"items",
"=",
"self",
".",
"raw_dict",
"[",
"'items'",
"]",
"for",
"test_type",
"in",
"self",
... | Returns a dict mapping every URL in the manifest to its item. | [
"Returns",
"a",
"dict",
"mapping",
"every",
"URL",
"in",
"the",
"manifest",
"to",
"its",
"item",
"."
] | [
"\"\"\"Returns a dict mapping every URL in the manifest to its item.\"\"\""
] | [
{
"param": "self",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
d45ced9e921be06400fb52ae137da2b184f5c199 | sunlongbo/chromium | third_party/blink/tools/blinkpy/w3c/wpt_manifest.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | extract_fuzzy_metadata | <not_specific> | def extract_fuzzy_metadata(self, url):
"""Extracts the fuzzy reftest metadata for the specified reference test.
Although WPT supports multiple fuzzy references for a given test (one
for each reference file), blinkpy only supports a single reference per
test. As such, we just return the ... | Extracts the fuzzy reftest metadata for the specified reference test.
Although WPT supports multiple fuzzy references for a given test (one
for each reference file), blinkpy only supports a single reference per
test. As such, we just return the first fuzzy reference that we find.
FIXME... | Extracts the fuzzy reftest metadata for the specified reference test.
Although WPT supports multiple fuzzy references for a given test (one
for each reference file), blinkpy only supports a single reference per
test. As such, we just return the first fuzzy reference that we find.
It is possible for the references and ... | [
"Extracts",
"the",
"fuzzy",
"reftest",
"metadata",
"for",
"the",
"specified",
"reference",
"test",
".",
"Although",
"WPT",
"supports",
"multiple",
"fuzzy",
"references",
"for",
"a",
"given",
"test",
"(",
"one",
"for",
"each",
"reference",
"file",
")",
"blinkpy... | def extract_fuzzy_metadata(self, url):
items = self.raw_dict.get('items', {})
if url not in items.get('reftest', {}):
return None, None
for item in items['reftest'][url]:
if 'fuzzy' not in item[2]:
return None, None
fuzzy_metadata_list = item[2... | [
"def",
"extract_fuzzy_metadata",
"(",
"self",
",",
"url",
")",
":",
"items",
"=",
"self",
".",
"raw_dict",
".",
"get",
"(",
"'items'",
",",
"{",
"}",
")",
"if",
"url",
"not",
"in",
"items",
".",
"get",
"(",
"'reftest'",
",",
"{",
"}",
")",
":",
"... | Extracts the fuzzy reftest metadata for the specified reference test. | [
"Extracts",
"the",
"fuzzy",
"reftest",
"metadata",
"for",
"the",
"specified",
"reference",
"test",
"."
] | [
"\"\"\"Extracts the fuzzy reftest metadata for the specified reference test.\n\n Although WPT supports multiple fuzzy references for a given test (one\n for each reference file), blinkpy only supports a single reference per\n test. As such, we just return the first fuzzy reference that we find.... | [
{
"param": "self",
"type": null
},
{
"param": "url",
"type": null
}
] | {
"returns": [
{
"docstring": "A pair of lists representing the maxDifference and totalPixel ranges\nfor the test. If the test isn't a reference test or doesn't have\nfuzzy information, a pair of Nones are returned.",
"docstring_tokens": [
"A",
"pair",
"of",
"lists",
... |
d45ced9e921be06400fb52ae137da2b184f5c199 | sunlongbo/chromium | third_party/blink/tools/blinkpy/w3c/wpt_manifest.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | ensure_manifest | null | def ensure_manifest(port, path=None):
"""Regenerates the WPT MANIFEST.json file.
Args:
port: A blinkpy.web_tests.port.Port object.
path: The path to a WPT root (relative to web_tests, optional).
"""
fs = port.host.filesystem
if path is None:
p... | Regenerates the WPT MANIFEST.json file.
Args:
port: A blinkpy.web_tests.port.Port object.
path: The path to a WPT root (relative to web_tests, optional).
| Regenerates the WPT MANIFEST.json file. | [
"Regenerates",
"the",
"WPT",
"MANIFEST",
".",
"json",
"file",
"."
] | def ensure_manifest(port, path=None):
fs = port.host.filesystem
if path is None:
path = fs.join('external', 'wpt')
wpt_path = fs.join(port.web_tests_dir(), path)
manifest_path = fs.join(wpt_path, MANIFEST_NAME)
if fs.exists(manifest_path):
_log.debug('Remo... | [
"def",
"ensure_manifest",
"(",
"port",
",",
"path",
"=",
"None",
")",
":",
"fs",
"=",
"port",
".",
"host",
".",
"filesystem",
"if",
"path",
"is",
"None",
":",
"path",
"=",
"fs",
".",
"join",
"(",
"'external'",
",",
"'wpt'",
")",
"wpt_path",
"=",
"f... | Regenerates the WPT MANIFEST.json file. | [
"Regenerates",
"the",
"WPT",
"MANIFEST",
".",
"json",
"file",
"."
] | [
"\"\"\"Regenerates the WPT MANIFEST.json file.\n\n Args:\n port: A blinkpy.web_tests.port.Port object.\n path: The path to a WPT root (relative to web_tests, optional).\n \"\"\"",
"# Unconditionally delete local MANIFEST.json to avoid regenerating the",
"# manifest from scrat... | [
{
"param": "port",
"type": null
},
{
"param": "path",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "port",
"type": null,
"docstring": "A blinkpy.web_tests.port.Port object.",
"docstring_tokens": [
"A",
"blinkpy",
".",
"web_tests",
".",
"port",
".",
"Port",
... |
d45ced9e921be06400fb52ae137da2b184f5c199 | sunlongbo/chromium | third_party/blink/tools/blinkpy/w3c/wpt_manifest.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | generate_manifest | null | def generate_manifest(port, dest_path):
"""Generates MANIFEST.json on the specified directory."""
wpt_exec_path = PathFinder(
port.host.filesystem).path_from_chromium_base(
'third_party', 'wpt_tools', 'wpt', 'wpt')
cmd = [
port.python3_command(), wpt_exec_... | Generates MANIFEST.json on the specified directory. | Generates MANIFEST.json on the specified directory. | [
"Generates",
"MANIFEST",
".",
"json",
"on",
"the",
"specified",
"directory",
"."
] | def generate_manifest(port, dest_path):
wpt_exec_path = PathFinder(
port.host.filesystem).path_from_chromium_base(
'third_party', 'wpt_tools', 'wpt', 'wpt')
cmd = [
port.python3_command(), wpt_exec_path, 'manifest', '-v',
'--no-download', '--tests-root... | [
"def",
"generate_manifest",
"(",
"port",
",",
"dest_path",
")",
":",
"wpt_exec_path",
"=",
"PathFinder",
"(",
"port",
".",
"host",
".",
"filesystem",
")",
".",
"path_from_chromium_base",
"(",
"'third_party'",
",",
"'wpt_tools'",
",",
"'wpt'",
",",
"'wpt'",
")"... | Generates MANIFEST.json on the specified directory. | [
"Generates",
"MANIFEST",
".",
"json",
"on",
"the",
"specified",
"directory",
"."
] | [
"\"\"\"Generates MANIFEST.json on the specified directory.\"\"\"",
"# ScriptError will be raised if the command fails.",
"# This will also include stderr in the exception message."
] | [
{
"param": "port",
"type": null
},
{
"param": "dest_path",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "port",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "dest_path",
"type": null,
"docstring": null,
"docstring_token... |
d45cffd5e4cbdd460c1db98910bd10148c7a7a15 | sunlongbo/chromium | chrome/test/chromedriver/test/test_environment.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | GetDisabledJavaTestMatchers | <not_specific> | def GetDisabledJavaTestMatchers(self):
"""Get the list of disabled java test matchers.
Returns:
List of disabled test matchers, which may contain '*' wildcards.
"""
return _EXPECTATIONS['GetDisabledTestMatchers'](self.GetOS()) | Get the list of disabled java test matchers.
Returns:
List of disabled test matchers, which may contain '*' wildcards.
| Get the list of disabled java test matchers. | [
"Get",
"the",
"list",
"of",
"disabled",
"java",
"test",
"matchers",
"."
] | def GetDisabledJavaTestMatchers(self):
return _EXPECTATIONS['GetDisabledTestMatchers'](self.GetOS()) | [
"def",
"GetDisabledJavaTestMatchers",
"(",
"self",
")",
":",
"return",
"_EXPECTATIONS",
"[",
"'GetDisabledTestMatchers'",
"]",
"(",
"self",
".",
"GetOS",
"(",
")",
")"
] | Get the list of disabled java test matchers. | [
"Get",
"the",
"list",
"of",
"disabled",
"java",
"test",
"matchers",
"."
] | [
"\"\"\"Get the list of disabled java test matchers.\n\n Returns:\n List of disabled test matchers, which may contain '*' wildcards.\n \"\"\""
] | [
{
"param": "self",
"type": null
}
] | {
"returns": [
{
"docstring": "List of disabled test matchers, which may contain '*' wildcards.",
"docstring_tokens": [
"List",
"of",
"disabled",
"test",
"matchers",
"which",
"may",
"contain",
"'",
"*",
"'",
... |
d45cffd5e4cbdd460c1db98910bd10148c7a7a15 | sunlongbo/chromium | chrome/test/chromedriver/test/test_environment.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | GetReadyToRunJavaTestMatchers | <not_specific> | def GetReadyToRunJavaTestMatchers(self):
"""Get the list of disabled for Chrome java test matchers
but which already works.
Returns:
List of disabled for Chrome java test matchers
but which already works.
"""
return _EXPECTATIONS['GetReadyToRunTestMatchers']() | Get the list of disabled for Chrome java test matchers
but which already works.
Returns:
List of disabled for Chrome java test matchers
but which already works.
| Get the list of disabled for Chrome java test matchers
but which already works. | [
"Get",
"the",
"list",
"of",
"disabled",
"for",
"Chrome",
"java",
"test",
"matchers",
"but",
"which",
"already",
"works",
"."
] | def GetReadyToRunJavaTestMatchers(self):
return _EXPECTATIONS['GetReadyToRunTestMatchers']() | [
"def",
"GetReadyToRunJavaTestMatchers",
"(",
"self",
")",
":",
"return",
"_EXPECTATIONS",
"[",
"'GetReadyToRunTestMatchers'",
"]",
"(",
")"
] | Get the list of disabled for Chrome java test matchers
but which already works. | [
"Get",
"the",
"list",
"of",
"disabled",
"for",
"Chrome",
"java",
"test",
"matchers",
"but",
"which",
"already",
"works",
"."
] | [
"\"\"\"Get the list of disabled for Chrome java test matchers\n but which already works.\n\n Returns:\n List of disabled for Chrome java test matchers\n but which already works.\n \"\"\""
] | [
{
"param": "self",
"type": null
}
] | {
"returns": [
{
"docstring": "List of disabled for Chrome java test matchers\nbut which already works.",
"docstring_tokens": [
"List",
"of",
"disabled",
"for",
"Chrome",
"java",
"test",
"matchers",
"but",
"which",
... |
d45cffd5e4cbdd460c1db98910bd10148c7a7a15 | sunlongbo/chromium | chrome/test/chromedriver/test/test_environment.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | GetPassedJavaTests | <not_specific> | def GetPassedJavaTests(self):
"""Get the list of passed java tests.
Returns:
List of passed test names.
"""
with open(os.path.join(_THIS_DIR, 'java_tests.txt'), 'r') as f:
return _EXPECTATIONS['ApplyJavaTestFilter'](
self.GetOS(), [t.strip('\n') for t in f.readlines()]) | Get the list of passed java tests.
Returns:
List of passed test names.
| Get the list of passed java tests. | [
"Get",
"the",
"list",
"of",
"passed",
"java",
"tests",
"."
] | def GetPassedJavaTests(self):
with open(os.path.join(_THIS_DIR, 'java_tests.txt'), 'r') as f:
return _EXPECTATIONS['ApplyJavaTestFilter'](
self.GetOS(), [t.strip('\n') for t in f.readlines()]) | [
"def",
"GetPassedJavaTests",
"(",
"self",
")",
":",
"with",
"open",
"(",
"os",
".",
"path",
".",
"join",
"(",
"_THIS_DIR",
",",
"'java_tests.txt'",
")",
",",
"'r'",
")",
"as",
"f",
":",
"return",
"_EXPECTATIONS",
"[",
"'ApplyJavaTestFilter'",
"]",
"(",
"... | Get the list of passed java tests. | [
"Get",
"the",
"list",
"of",
"passed",
"java",
"tests",
"."
] | [
"\"\"\"Get the list of passed java tests.\n\n Returns:\n List of passed test names.\n \"\"\""
] | [
{
"param": "self",
"type": null
}
] | {
"returns": [
{
"docstring": "List of passed test names.",
"docstring_tokens": [
"List",
"of",
"passed",
"test",
"names",
"."
],
"type": null
}
],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
... |
d45ec5862999d5ddb463ac3e06abd050cdd18e9e | sunlongbo/chromium | mojo/public/tools/mojom/stable_attribute_unittest.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | testStableAttributeTagging | null | def testStableAttributeTagging(self):
"""Verify that we recognize the [Stable] attribute on relevant definitions
and the resulting parser outputs are tagged accordingly."""
mojom = 'test.mojom'
self.WriteFile(
mojom, """\
[Stable] enum TestEnum { kFoo };
enum UnstableEnum { kBar ... | Verify that we recognize the [Stable] attribute on relevant definitions
and the resulting parser outputs are tagged accordingly. | Verify that we recognize the [Stable] attribute on relevant definitions
and the resulting parser outputs are tagged accordingly. | [
"Verify",
"that",
"we",
"recognize",
"the",
"[",
"Stable",
"]",
"attribute",
"on",
"relevant",
"definitions",
"and",
"the",
"resulting",
"parser",
"outputs",
"are",
"tagged",
"accordingly",
"."
] | def testStableAttributeTagging(self):
mojom = 'test.mojom'
self.WriteFile(
mojom, """\
[Stable] enum TestEnum { kFoo };
enum UnstableEnum { kBar };
[Stable] struct TestStruct { TestEnum a; };
struct UnstableStruct { UnstableEnum a; };
[Stable] union TestUnion { Te... | [
"def",
"testStableAttributeTagging",
"(",
"self",
")",
":",
"mojom",
"=",
"'test.mojom'",
"self",
".",
"WriteFile",
"(",
"mojom",
",",
"\"\"\"\\\n [Stable] enum TestEnum { kFoo };\n enum UnstableEnum { kBar };\n [Stable] struct TestStruct { TestEnum a; };\n ... | Verify that we recognize the [Stable] attribute on relevant definitions
and the resulting parser outputs are tagged accordingly. | [
"Verify",
"that",
"we",
"recognize",
"the",
"[",
"Stable",
"]",
"attribute",
"on",
"relevant",
"definitions",
"and",
"the",
"resulting",
"parser",
"outputs",
"are",
"tagged",
"accordingly",
"."
] | [
"\"\"\"Verify that we recognize the [Stable] attribute on relevant definitions\n and the resulting parser outputs are tagged accordingly.\"\"\""
] | [
{
"param": "self",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
d45ec5862999d5ddb463ac3e06abd050cdd18e9e | sunlongbo/chromium | mojo/public/tools/mojom/stable_attribute_unittest.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | testStableStruct | null | def testStableStruct(self):
"""A [Stable] struct is valid if all its fields are also stable."""
self.ExtractTypes('[Stable] struct S {};')
self.ExtractTypes('[Stable] struct S { int32 x; bool b; };')
self.ExtractTypes('[Stable] enum E { A }; [Stable] struct S { E e; };')
self.ExtractTypes('[Stable] ... | A [Stable] struct is valid if all its fields are also stable. | A [Stable] struct is valid if all its fields are also stable. | [
"A",
"[",
"Stable",
"]",
"struct",
"is",
"valid",
"if",
"all",
"its",
"fields",
"are",
"also",
"stable",
"."
] | def testStableStruct(self):
self.ExtractTypes('[Stable] struct S {};')
self.ExtractTypes('[Stable] struct S { int32 x; bool b; };')
self.ExtractTypes('[Stable] enum E { A }; [Stable] struct S { E e; };')
self.ExtractTypes('[Stable] struct S {}; [Stable] struct T { S s; };')
self.ExtractTypes(
... | [
"def",
"testStableStruct",
"(",
"self",
")",
":",
"self",
".",
"ExtractTypes",
"(",
"'[Stable] struct S {};'",
")",
"self",
".",
"ExtractTypes",
"(",
"'[Stable] struct S { int32 x; bool b; };'",
")",
"self",
".",
"ExtractTypes",
"(",
"'[Stable] enum E { A }; [Stable] stru... | A [Stable] struct is valid if all its fields are also stable. | [
"A",
"[",
"Stable",
"]",
"struct",
"is",
"valid",
"if",
"all",
"its",
"fields",
"are",
"also",
"stable",
"."
] | [
"\"\"\"A [Stable] struct is valid if all its fields are also stable.\"\"\""
] | [
{
"param": "self",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
d45ec5862999d5ddb463ac3e06abd050cdd18e9e | sunlongbo/chromium | mojo/public/tools/mojom/stable_attribute_unittest.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | testStableUnion | null | def testStableUnion(self):
"""A [Stable] union is valid if all its fields' types are also stable."""
self.ExtractTypes('[Stable] union U {};')
self.ExtractTypes('[Stable] union U { int32 x; bool b; };')
self.ExtractTypes('[Stable] enum E { A }; [Stable] union U { E e; };')
self.ExtractTypes('[Stable... | A [Stable] union is valid if all its fields' types are also stable. | A [Stable] union is valid if all its fields' types are also stable. | [
"A",
"[",
"Stable",
"]",
"union",
"is",
"valid",
"if",
"all",
"its",
"fields",
"'",
"types",
"are",
"also",
"stable",
"."
] | def testStableUnion(self):
self.ExtractTypes('[Stable] union U {};')
self.ExtractTypes('[Stable] union U { int32 x; bool b; };')
self.ExtractTypes('[Stable] enum E { A }; [Stable] union U { E e; };')
self.ExtractTypes('[Stable] struct S {}; [Stable] union U { S s; };')
self.ExtractTypes(
'[S... | [
"def",
"testStableUnion",
"(",
"self",
")",
":",
"self",
".",
"ExtractTypes",
"(",
"'[Stable] union U {};'",
")",
"self",
".",
"ExtractTypes",
"(",
"'[Stable] union U { int32 x; bool b; };'",
")",
"self",
".",
"ExtractTypes",
"(",
"'[Stable] enum E { A }; [Stable] union U... | A [Stable] union is valid if all its fields' types are also stable. | [
"A",
"[",
"Stable",
"]",
"union",
"is",
"valid",
"if",
"all",
"its",
"fields",
"'",
"types",
"are",
"also",
"stable",
"."
] | [
"\"\"\"A [Stable] union is valid if all its fields' types are also stable.\"\"\""
] | [
{
"param": "self",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
d45ec5862999d5ddb463ac3e06abd050cdd18e9e | sunlongbo/chromium | mojo/public/tools/mojom/stable_attribute_unittest.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | testStableInterface | null | def testStableInterface(self):
"""A [Stable] interface is valid if all its methods' parameter types are
stable, including response parameters where applicable."""
self.ExtractTypes('[Stable] interface F {};')
self.ExtractTypes('[Stable] interface F { A@0(int32 x); };')
self.ExtractTypes('[Stable] in... | A [Stable] interface is valid if all its methods' parameter types are
stable, including response parameters where applicable. | A [Stable] interface is valid if all its methods' parameter types are
stable, including response parameters where applicable. | [
"A",
"[",
"Stable",
"]",
"interface",
"is",
"valid",
"if",
"all",
"its",
"methods",
"'",
"parameter",
"types",
"are",
"stable",
"including",
"response",
"parameters",
"where",
"applicable",
"."
] | def testStableInterface(self):
self.ExtractTypes('[Stable] interface F {};')
self.ExtractTypes('[Stable] interface F { A@0(int32 x); };')
self.ExtractTypes('[Stable] interface F { A@0(int32 x) => (bool b); };')
self.ExtractTypes("""\
[Stable] enum E { A, B, C };
[Stable] struct S {};
... | [
"def",
"testStableInterface",
"(",
"self",
")",
":",
"self",
".",
"ExtractTypes",
"(",
"'[Stable] interface F {};'",
")",
"self",
".",
"ExtractTypes",
"(",
"'[Stable] interface F { A@0(int32 x); };'",
")",
"self",
".",
"ExtractTypes",
"(",
"'[Stable] interface F { A@0(int... | A [Stable] interface is valid if all its methods' parameter types are
stable, including response parameters where applicable. | [
"A",
"[",
"Stable",
"]",
"interface",
"is",
"valid",
"if",
"all",
"its",
"methods",
"'",
"parameter",
"types",
"are",
"stable",
"including",
"response",
"parameters",
"where",
"applicable",
"."
] | [
"\"\"\"A [Stable] interface is valid if all its methods' parameter types are\n stable, including response parameters where applicable.\"\"\""
] | [
{
"param": "self",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
4f8d7263ce44a8563b84827020b76de4bac94ba1 | sunlongbo/chromium | chrome/test/enterprise/e2e/policy/allow_deleting_browser_history/allow_deleting_browser_history.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | allowDeletingBrowserHistoryEnabled | <not_specific> | def allowDeletingBrowserHistoryEnabled(self, instance_name):
"""Returns true if AllowDeletingBrowserHistory is enabled."""
directory = os.path.dirname(os.path.abspath(__file__))
output = self.RunWebDriverTest(
self.win_config['client'],
os.path.join(directory,
'allow_del... | Returns true if AllowDeletingBrowserHistory is enabled. | Returns true if AllowDeletingBrowserHistory is enabled. | [
"Returns",
"true",
"if",
"AllowDeletingBrowserHistory",
"is",
"enabled",
"."
] | def allowDeletingBrowserHistoryEnabled(self, instance_name):
directory = os.path.dirname(os.path.abspath(__file__))
output = self.RunWebDriverTest(
self.win_config['client'],
os.path.join(directory,
'allow_deleting_browser_history_webdriver_test.py'))
return 'ENABLED' in... | [
"def",
"allowDeletingBrowserHistoryEnabled",
"(",
"self",
",",
"instance_name",
")",
":",
"directory",
"=",
"os",
".",
"path",
".",
"dirname",
"(",
"os",
".",
"path",
".",
"abspath",
"(",
"__file__",
")",
")",
"output",
"=",
"self",
".",
"RunWebDriverTest",
... | Returns true if AllowDeletingBrowserHistory is enabled. | [
"Returns",
"true",
"if",
"AllowDeletingBrowserHistory",
"is",
"enabled",
"."
] | [
"\"\"\"Returns true if AllowDeletingBrowserHistory is enabled.\"\"\""
] | [
{
"param": "self",
"type": null
},
{
"param": "instance_name",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "instance_name",
"type": null,
"docstring": null,
"docstring_t... |
4f901284bc080138b3c69e3bca09c04c5c98b1cb | sunlongbo/chromium | tools/cygprofile/patch_orderfile.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | _GroupSymbolsByOffset | <not_specific> | def _GroupSymbolsByOffset(binary_filename):
"""Produce a map symbol name -> all symbol names at same offset.
Suffixes are stripped.
"""
symbol_infos = [
s._replace(name=RemoveSuffixes(s.name))
for s in symbol_extractor.SymbolInfosFromBinary(binary_filename)]
offset_map = symbol_extractor.GroupSym... | Produce a map symbol name -> all symbol names at same offset.
Suffixes are stripped.
| Produce a map symbol name -> all symbol names at same offset.
Suffixes are stripped. | [
"Produce",
"a",
"map",
"symbol",
"name",
"-",
">",
"all",
"symbol",
"names",
"at",
"same",
"offset",
".",
"Suffixes",
"are",
"stripped",
"."
] | def _GroupSymbolsByOffset(binary_filename):
symbol_infos = [
s._replace(name=RemoveSuffixes(s.name))
for s in symbol_extractor.SymbolInfosFromBinary(binary_filename)]
offset_map = symbol_extractor.GroupSymbolInfosByOffset(symbol_infos)
missing_offsets = 0
sym_to_matching = {}
for sym in symbol_inf... | [
"def",
"_GroupSymbolsByOffset",
"(",
"binary_filename",
")",
":",
"symbol_infos",
"=",
"[",
"s",
".",
"_replace",
"(",
"name",
"=",
"RemoveSuffixes",
"(",
"s",
".",
"name",
")",
")",
"for",
"s",
"in",
"symbol_extractor",
".",
"SymbolInfosFromBinary",
"(",
"b... | Produce a map symbol name -> all symbol names at same offset. | [
"Produce",
"a",
"map",
"symbol",
"name",
"-",
">",
"all",
"symbol",
"names",
"at",
"same",
"offset",
"."
] | [
"\"\"\"Produce a map symbol name -> all symbol names at same offset.\n\n Suffixes are stripped.\n \"\"\""
] | [
{
"param": "binary_filename",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "binary_filename",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
4f901284bc080138b3c69e3bca09c04c5c98b1cb | sunlongbo/chromium | tools/cygprofile/patch_orderfile.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | _GetMaxOutlinedIndex | <not_specific> | def _GetMaxOutlinedIndex(sym_dict):
"""Find the largest index of an outlined functions.
See _OUTLINED_FUNCTION_RE for the definition of the index. In practice the
maximum index equals the total number of outlined functions. This function
asserts that the index is near the total number of outlined functions.
... | Find the largest index of an outlined functions.
See _OUTLINED_FUNCTION_RE for the definition of the index. In practice the
maximum index equals the total number of outlined functions. This function
asserts that the index is near the total number of outlined functions.
Args:
sym_dict: Dict with symbol nam... | Find the largest index of an outlined functions.
See _OUTLINED_FUNCTION_RE for the definition of the index. In practice the
maximum index equals the total number of outlined functions. This function
asserts that the index is near the total number of outlined functions. | [
"Find",
"the",
"largest",
"index",
"of",
"an",
"outlined",
"functions",
".",
"See",
"_OUTLINED_FUNCTION_RE",
"for",
"the",
"definition",
"of",
"the",
"index",
".",
"In",
"practice",
"the",
"maximum",
"index",
"equals",
"the",
"total",
"number",
"of",
"outlined... | def _GetMaxOutlinedIndex(sym_dict):
seen = set()
for sym in sym_dict:
m = _OUTLINED_FUNCTION_RE.match(sym)
if m:
seen.add(int(m.group('index')))
if not seen:
return None
max_index = max(seen)
assert max_index < 2 * len(seen)
return max_index | [
"def",
"_GetMaxOutlinedIndex",
"(",
"sym_dict",
")",
":",
"seen",
"=",
"set",
"(",
")",
"for",
"sym",
"in",
"sym_dict",
":",
"m",
"=",
"_OUTLINED_FUNCTION_RE",
".",
"match",
"(",
"sym",
")",
"if",
"m",
":",
"seen",
".",
"add",
"(",
"int",
"(",
"m",
... | Find the largest index of an outlined functions. | [
"Find",
"the",
"largest",
"index",
"of",
"an",
"outlined",
"functions",
"."
] | [
"\"\"\"Find the largest index of an outlined functions.\n\n See _OUTLINED_FUNCTION_RE for the definition of the index. In practice the\n maximum index equals the total number of outlined functions. This function\n asserts that the index is near the total number of outlined functions.\n\n Args:\n sym_dict: Di... | [
{
"param": "sym_dict",
"type": null
}
] | {
"returns": [
{
"docstring": "The largest index of an outlined function seen in the keys of |sym_dict|.",
"docstring_tokens": [
"The",
"largest",
"index",
"of",
"an",
"outlined",
"function",
"seen",
"in",
"the",
"... |
4f901284bc080138b3c69e3bca09c04c5c98b1cb | sunlongbo/chromium | tools/cygprofile/patch_orderfile.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | ReadOrderfile | null | def ReadOrderfile(orderfile):
"""Reads an orderfile and cleans up symbols.
Args:
orderfile: The name of the orderfile.
Yields:
Symbol names, cleaned and unique.
"""
with open(orderfile) as f:
for line in f:
line = line.strip()
if line:
yield line | Reads an orderfile and cleans up symbols.
Args:
orderfile: The name of the orderfile.
Yields:
Symbol names, cleaned and unique.
| Reads an orderfile and cleans up symbols. | [
"Reads",
"an",
"orderfile",
"and",
"cleans",
"up",
"symbols",
"."
] | def ReadOrderfile(orderfile):
with open(orderfile) as f:
for line in f:
line = line.strip()
if line:
yield line | [
"def",
"ReadOrderfile",
"(",
"orderfile",
")",
":",
"with",
"open",
"(",
"orderfile",
")",
"as",
"f",
":",
"for",
"line",
"in",
"f",
":",
"line",
"=",
"line",
".",
"strip",
"(",
")",
"if",
"line",
":",
"yield",
"line"
] | Reads an orderfile and cleans up symbols. | [
"Reads",
"an",
"orderfile",
"and",
"cleans",
"up",
"symbols",
"."
] | [
"\"\"\"Reads an orderfile and cleans up symbols.\n\n Args:\n orderfile: The name of the orderfile.\n\n Yields:\n Symbol names, cleaned and unique.\n \"\"\""
] | [
{
"param": "orderfile",
"type": null
}
] | {
"returns": [
{
"docstring": "Symbol names, cleaned and unique.",
"docstring_tokens": [
"Symbol",
"names",
"cleaned",
"and",
"unique",
"."
],
"type": null
}
],
"raises": [],
"params": [
{
"identifier": "orderfile",
... |
4f901284bc080138b3c69e3bca09c04c5c98b1cb | sunlongbo/chromium | tools/cygprofile/patch_orderfile.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | _CreateArgumentParser | <not_specific> | def _CreateArgumentParser():
"""Creates and returns the argument parser."""
parser = argparse.ArgumentParser()
parser.add_argument('--target-arch', help='Unused')
parser.add_argument('--unpatched-orderfile', required=True,
help='Path to the unpatched orderfile')
parser.add_argument('--na... | Creates and returns the argument parser. | Creates and returns the argument parser. | [
"Creates",
"and",
"returns",
"the",
"argument",
"parser",
"."
] | def _CreateArgumentParser():
parser = argparse.ArgumentParser()
parser.add_argument('--target-arch', help='Unused')
parser.add_argument('--unpatched-orderfile', required=True,
help='Path to the unpatched orderfile')
parser.add_argument('--native-library', required=True,
... | [
"def",
"_CreateArgumentParser",
"(",
")",
":",
"parser",
"=",
"argparse",
".",
"ArgumentParser",
"(",
")",
"parser",
".",
"add_argument",
"(",
"'--target-arch'",
",",
"help",
"=",
"'Unused'",
")",
"parser",
".",
"add_argument",
"(",
"'--unpatched-orderfile'",
",... | Creates and returns the argument parser. | [
"Creates",
"and",
"returns",
"the",
"argument",
"parser",
"."
] | [
"\"\"\"Creates and returns the argument parser.\"\"\""
] | [] | {
"returns": [],
"raises": [],
"params": [],
"outlier_params": [],
"others": []
} |
4fa4d5a4d8abff063f5f3daeb91c22fe8c4aa21a | sunlongbo/chromium | chrome/test/mini_installer/variable_expander.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | _GetFileBitness | <not_specific> | def _GetFileBitness(file_path):
"""Returns the bitness of the given file."""
if win32file.GetBinaryType(file_path) == win32file.SCS_32BIT_BINARY:
return '32'
return '64' | Returns the bitness of the given file. | Returns the bitness of the given file. | [
"Returns",
"the",
"bitness",
"of",
"the",
"given",
"file",
"."
] | def _GetFileBitness(file_path):
if win32file.GetBinaryType(file_path) == win32file.SCS_32BIT_BINARY:
return '32'
return '64' | [
"def",
"_GetFileBitness",
"(",
"file_path",
")",
":",
"if",
"win32file",
".",
"GetBinaryType",
"(",
"file_path",
")",
"==",
"win32file",
".",
"SCS_32BIT_BINARY",
":",
"return",
"'32'",
"return",
"'64'"
] | Returns the bitness of the given file. | [
"Returns",
"the",
"bitness",
"of",
"the",
"given",
"file",
"."
] | [
"\"\"\"Returns the bitness of the given file.\"\"\""
] | [
{
"param": "file_path",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "file_path",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
4fa4d5a4d8abff063f5f3daeb91c22fe8c4aa21a | sunlongbo/chromium | chrome/test/mini_installer/variable_expander.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | _GetProductName | <not_specific> | def _GetProductName(file_path):
"""Returns the product name of the given file.
Args:
file_path: The absolute or relative path to the file.
Returns:
A string representing the product name of the file, or None if the
product name was not found.
"""
language_and_codepage_pairs... | Returns the product name of the given file.
Args:
file_path: The absolute or relative path to the file.
Returns:
A string representing the product name of the file, or None if the
product name was not found.
| Returns the product name of the given file. | [
"Returns",
"the",
"product",
"name",
"of",
"the",
"given",
"file",
"."
] | def _GetProductName(file_path):
language_and_codepage_pairs = win32api.GetFileVersionInfo(
file_path, '\\VarFileInfo\\Translation')
if not language_and_codepage_pairs:
return None
product_name_entry = ('\\StringFileInfo\\%04x%04x\\ProductName' %
language_and_codepag... | [
"def",
"_GetProductName",
"(",
"file_path",
")",
":",
"language_and_codepage_pairs",
"=",
"win32api",
".",
"GetFileVersionInfo",
"(",
"file_path",
",",
"'\\\\VarFileInfo\\\\Translation'",
")",
"if",
"not",
"language_and_codepage_pairs",
":",
"return",
"None",
"product_nam... | Returns the product name of the given file. | [
"Returns",
"the",
"product",
"name",
"of",
"the",
"given",
"file",
"."
] | [
"\"\"\"Returns the product name of the given file.\n\n Args:\n file_path: The absolute or relative path to the file.\n\n Returns:\n A string representing the product name of the file, or None if the\n product name was not found.\n \"\"\""
] | [
{
"param": "file_path",
"type": null
}
] | {
"returns": [
{
"docstring": "A string representing the product name of the file, or None if the\nproduct name was not found.",
"docstring_tokens": [
"A",
"string",
"representing",
"the",
"product",
"name",
"of",
"the",
"file",
... |
4fa4d5a4d8abff063f5f3daeb91c22fe8c4aa21a | sunlongbo/chromium | chrome/test/mini_installer/variable_expander.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | _GetUserSpecificRegistrySuffix | <not_specific> | def _GetUserSpecificRegistrySuffix():
"""Returns '.' + the unpadded Base32 encoding of the MD5 of the user's SID.
The result must match the output from the method
UserSpecificRegistrySuffix::GetSuffix() in
chrome/installer/util/shell_util.cc. It will always be 27 characters long.
"""
token_hand... | Returns '.' + the unpadded Base32 encoding of the MD5 of the user's SID.
The result must match the output from the method
UserSpecificRegistrySuffix::GetSuffix() in
chrome/installer/util/shell_util.cc. It will always be 27 characters long.
| Returns '.' + the unpadded Base32 encoding of the MD5 of the user's SID.
The result must match the output from the method
UserSpecificRegistrySuffix::GetSuffix() in
chrome/installer/util/shell_util.cc. It will always be 27 characters long. | [
"Returns",
"'",
".",
"'",
"+",
"the",
"unpadded",
"Base32",
"encoding",
"of",
"the",
"MD5",
"of",
"the",
"user",
"'",
"s",
"SID",
".",
"The",
"result",
"must",
"match",
"the",
"output",
"from",
"the",
"method",
"UserSpecificRegistrySuffix",
"::",
"GetSuffi... | def _GetUserSpecificRegistrySuffix():
token_handle = win32security.OpenProcessToken(win32api.GetCurrentProcess(),
win32security.TOKEN_QUERY)
user_sid, _ = win32security.GetTokenInformation(token_handle,
win32se... | [
"def",
"_GetUserSpecificRegistrySuffix",
"(",
")",
":",
"token_handle",
"=",
"win32security",
".",
"OpenProcessToken",
"(",
"win32api",
".",
"GetCurrentProcess",
"(",
")",
",",
"win32security",
".",
"TOKEN_QUERY",
")",
"user_sid",
",",
"_",
"=",
"win32security",
"... | Returns '.' | [
"Returns",
"'",
".",
"'"
] | [
"\"\"\"Returns '.' + the unpadded Base32 encoding of the MD5 of the user's SID.\n\n The result must match the output from the method\n UserSpecificRegistrySuffix::GetSuffix() in\n chrome/installer/util/shell_util.cc. It will always be 27 characters long.\n \"\"\""
] | [] | {
"returns": [],
"raises": [],
"params": [],
"outlier_params": [],
"others": []
} |
4fa4d5a4d8abff063f5f3daeb91c22fe8c4aa21a | sunlongbo/chromium | chrome/test/mini_installer/variable_expander.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | Expand | <not_specific> | def Expand(self, a_string):
"""Expands variables in the given string.
This method resolves only variables defined in the constructor. It does
not resolve environment variables. Any dollar signs that are not part of
variables must be escaped with $$, otherwise a KeyError or a ValueError
... | Expands variables in the given string.
This method resolves only variables defined in the constructor. It does
not resolve environment variables. Any dollar signs that are not part of
variables must be escaped with $$, otherwise a KeyError or a ValueError
will be raised.
Args:
... | Expands variables in the given string.
This method resolves only variables defined in the constructor. It does
not resolve environment variables. Any dollar signs that are not part of
variables must be escaped with $$, otherwise a KeyError or a ValueError
will be raised. | [
"Expands",
"variables",
"in",
"the",
"given",
"string",
".",
"This",
"method",
"resolves",
"only",
"variables",
"defined",
"in",
"the",
"constructor",
".",
"It",
"does",
"not",
"resolve",
"environment",
"variables",
".",
"Any",
"dollar",
"signs",
"that",
"are"... | def Expand(self, a_string):
return string.Template(a_string).substitute(self._variable_mapping) | [
"def",
"Expand",
"(",
"self",
",",
"a_string",
")",
":",
"return",
"string",
".",
"Template",
"(",
"a_string",
")",
".",
"substitute",
"(",
"self",
".",
"_variable_mapping",
")"
] | Expands variables in the given string. | [
"Expands",
"variables",
"in",
"the",
"given",
"string",
"."
] | [
"\"\"\"Expands variables in the given string.\n\n This method resolves only variables defined in the constructor. It does\n not resolve environment variables. Any dollar signs that are not part of\n variables must be escaped with $$, otherwise a KeyError or a ValueError\n will be raised.... | [
{
"param": "self",
"type": null
},
{
"param": "a_string",
"type": null
}
] | {
"returns": [
{
"docstring": "A new string created by replacing variables with their values.",
"docstring_tokens": [
"A",
"new",
"string",
"created",
"by",
"replacing",
"variables",
"with",
"their",
"values",
"."
... |
0ecaa3d136eca7f9f847038508738f60cebe5261 | sunlongbo/chromium | tools/perf/experimental/story_clustering/cluster_stories.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | GetDistanceFrom | <not_specific> | def GetDistanceFrom(self, other_cluster, distance_matrix):
"""Calculates the distance of two clusters.
The maximum distance between any story of first cluster to any story of
the second cluster is used as the distance between clusters._members
Args:
other_cluster: Cluster object to calculate dis... | Calculates the distance of two clusters.
The maximum distance between any story of first cluster to any story of
the second cluster is used as the distance between clusters._members
Args:
other_cluster: Cluster object to calculate distance from.
distance_matrix: A dataframe containing the dist... | Calculates the distance of two clusters.
The maximum distance between any story of first cluster to any story of
the second cluster is used as the distance between clusters._members
Cluster object to calculate distance from.
distance_matrix: A dataframe containing the distances between any
two stories.
A float number... | [
"Calculates",
"the",
"distance",
"of",
"two",
"clusters",
".",
"The",
"maximum",
"distance",
"between",
"any",
"story",
"of",
"first",
"cluster",
"to",
"any",
"story",
"of",
"the",
"second",
"cluster",
"is",
"used",
"as",
"the",
"distance",
"between",
"clust... | def GetDistanceFrom(self, other_cluster, distance_matrix):
matrix_slice = distance_matrix.loc[self.members, other_cluster.members]
return matrix_slice.max().max() | [
"def",
"GetDistanceFrom",
"(",
"self",
",",
"other_cluster",
",",
"distance_matrix",
")",
":",
"matrix_slice",
"=",
"distance_matrix",
".",
"loc",
"[",
"self",
".",
"members",
",",
"other_cluster",
".",
"members",
"]",
"return",
"matrix_slice",
".",
"max",
"("... | Calculates the distance of two clusters. | [
"Calculates",
"the",
"distance",
"of",
"two",
"clusters",
"."
] | [
"\"\"\"Calculates the distance of two clusters.\n\n The maximum distance between any story of first cluster to any story of\n the second cluster is used as the distance between clusters._members\n\n Args:\n other_cluster: Cluster object to calculate distance from.\n distance_matrix: A dataframe c... | [
{
"param": "self",
"type": null
},
{
"param": "other_cluster",
"type": null
},
{
"param": "distance_matrix",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "other_cluster",
"type": null,
"docstring": null,
"docstring_t... |
0ecaa3d136eca7f9f847038508738f60cebe5261 | sunlongbo/chromium | tools/perf/experimental/story_clustering/cluster_stories.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | GetRepresentative | <not_specific> | def GetRepresentative(self, distance_matrix=None):
"""Finds and sets the representative of cluster.
The story which its max distance to all other members is minimum is
used as the representative.
Args:
distance_matrix: A dataframe containing the distances between any
two stories.
Retu... | Finds and sets the representative of cluster.
The story which its max distance to all other members is minimum is
used as the representative.
Args:
distance_matrix: A dataframe containing the distances between any
two stories.
Returns:
A story which is the representative of cluster
... | Finds and sets the representative of cluster.
The story which its max distance to all other members is minimum is
used as the representative.
A dataframe containing the distances between any
two stories.
A story which is the representative of cluster | [
"Finds",
"and",
"sets",
"the",
"representative",
"of",
"cluster",
".",
"The",
"story",
"which",
"its",
"max",
"distance",
"to",
"all",
"other",
"members",
"is",
"minimum",
"is",
"used",
"as",
"the",
"representative",
".",
"A",
"dataframe",
"containing",
"the... | def GetRepresentative(self, distance_matrix=None):
if self._representative:
return self._representative
if distance_matrix is None:
raise Exception('Distance matrix is not set.')
self._representative = distance_matrix.loc[
self._members, self._members].sum().idxmin()
return self._repre... | [
"def",
"GetRepresentative",
"(",
"self",
",",
"distance_matrix",
"=",
"None",
")",
":",
"if",
"self",
".",
"_representative",
":",
"return",
"self",
".",
"_representative",
"if",
"distance_matrix",
"is",
"None",
":",
"raise",
"Exception",
"(",
"'Distance matrix ... | Finds and sets the representative of cluster. | [
"Finds",
"and",
"sets",
"the",
"representative",
"of",
"cluster",
"."
] | [
"\"\"\"Finds and sets the representative of cluster.\n\n The story which its max distance to all other members is minimum is\n used as the representative.\n\n Args:\n distance_matrix: A dataframe containing the distances between any\n two stories.\n\n Returns:\n A story which is the repre... | [
{
"param": "self",
"type": null
},
{
"param": "distance_matrix",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "distance_matrix",
"type": null,
"docstring": null,
"docstring... |
0ecaa3d136eca7f9f847038508738f60cebe5261 | sunlongbo/chromium | tools/perf/experimental/story_clustering/cluster_stories.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | AsDict | <not_specific> | def AsDict(self):
"""Creates a dictionary which describes cluster object.
Returns:
A dictionary containing the members of the cluster and its
representative. The representative will not be listed in members
list.
"""
representative = self.GetRepresentative()
members_list = list(se... | Creates a dictionary which describes cluster object.
Returns:
A dictionary containing the members of the cluster and its
representative. The representative will not be listed in members
list.
| Creates a dictionary which describes cluster object. | [
"Creates",
"a",
"dictionary",
"which",
"describes",
"cluster",
"object",
"."
] | def AsDict(self):
representative = self.GetRepresentative()
members_list = list(self.members.difference([representative]))
return {
'members': members_list,
'representative': self.GetRepresentative()
} | [
"def",
"AsDict",
"(",
"self",
")",
":",
"representative",
"=",
"self",
".",
"GetRepresentative",
"(",
")",
"members_list",
"=",
"list",
"(",
"self",
".",
"members",
".",
"difference",
"(",
"[",
"representative",
"]",
")",
")",
"return",
"{",
"'members'",
... | Creates a dictionary which describes cluster object. | [
"Creates",
"a",
"dictionary",
"which",
"describes",
"cluster",
"object",
"."
] | [
"\"\"\"Creates a dictionary which describes cluster object.\n\n Returns:\n A dictionary containing the members of the cluster and its\n representative. The representative will not be listed in members\n list.\n \"\"\""
] | [
{
"param": "self",
"type": null
}
] | {
"returns": [
{
"docstring": "A dictionary containing the members of the cluster and its\nrepresentative. The representative will not be listed in members\nlist.",
"docstring_tokens": [
"A",
"dictionary",
"containing",
"the",
"members",
"of",
"t... |
0ecaa3d136eca7f9f847038508738f60cebe5261 | sunlongbo/chromium | tools/perf/experimental/story_clustering/cluster_stories.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | RunHierarchicalClustering | <not_specific> | def RunHierarchicalClustering(
distance_matrix,
max_cluster_count,
min_cluster_size):
"""Clusters stories.
Runs a hierarchical clustering algorithm based on the similarity measures.
Args:
distance_matrix: A dataframe containing distance matrix of stories.
max_cluster_count: number representing the... | Clusters stories.
Runs a hierarchical clustering algorithm based on the similarity measures.
Args:
distance_matrix: A dataframe containing distance matrix of stories.
max_cluster_count: number representing the maximum number of clusters
needed per metric.
min_cluster_size: number representing th... | Clusters stories.
Runs a hierarchical clustering algorithm based on the similarity measures. | [
"Clusters",
"stories",
".",
"Runs",
"a",
"hierarchical",
"clustering",
"algorithm",
"based",
"on",
"the",
"similarity",
"measures",
"."
] | def RunHierarchicalClustering(
distance_matrix,
max_cluster_count,
min_cluster_size):
stories = distance_matrix.index.values
remaining_clusters = set([])
for story in stories:
remaining_clusters.add(Cluster([story]))
heap = []
for cluster1 in remaining_clusters:
for cluster2 in remaining_cluster... | [
"def",
"RunHierarchicalClustering",
"(",
"distance_matrix",
",",
"max_cluster_count",
",",
"min_cluster_size",
")",
":",
"stories",
"=",
"distance_matrix",
".",
"index",
".",
"values",
"remaining_clusters",
"=",
"set",
"(",
"[",
"]",
")",
"for",
"story",
"in",
"... | Clusters stories. | [
"Clusters",
"stories",
"."
] | [
"\"\"\"Clusters stories.\n\n Runs a hierarchical clustering algorithm based on the similarity measures.\n\n Args:\n distance_matrix: A dataframe containing distance matrix of stories.\n max_cluster_count: number representing the maximum number of clusters\n needed per metric.\n min_cluster_size: num... | [
{
"param": "distance_matrix",
"type": null
},
{
"param": "max_cluster_count",
"type": null
},
{
"param": "min_cluster_size",
"type": null
}
] | {
"returns": [
{
"docstring": "A tuple containing:\nclusters: A list of cluster objects\ncoverage: Ratio(float) of stories covered using this clustering",
"docstring_tokens": [
"A",
"tuple",
"containing",
":",
"clusters",
":",
"A",
"list"... |
96c97c2a339d5ea3c2eea8d45d266ebfbb0d8239 | sunlongbo/chromium | chrome/test/mini_installer/property_walker.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | Verify | null | def Verify(property_dict, variable_expander):
"""Verifies the expectations in a property dict.
Args:
property_dict: A property dictionary mapping type names to expectations.
variable_expander: A VariableExpander.
Raises:
AssertionError: If an expectation is not satisfied.
"""
... | Verifies the expectations in a property dict.
Args:
property_dict: A property dictionary mapping type names to expectations.
variable_expander: A VariableExpander.
Raises:
AssertionError: If an expectation is not satisfied.
| Verifies the expectations in a property dict. | [
"Verifies",
"the",
"expectations",
"in",
"a",
"property",
"dict",
"."
] | def Verify(property_dict, variable_expander):
_Walk(
{
'Files': file_operations.VerifyFileExpectation,
'Processes': process_operations.VerifyProcessExpectation,
'RegistryEntries':
registry_operations.VerifyRegistryEntryExpectation,
}, False, property_d... | [
"def",
"Verify",
"(",
"property_dict",
",",
"variable_expander",
")",
":",
"_Walk",
"(",
"{",
"'Files'",
":",
"file_operations",
".",
"VerifyFileExpectation",
",",
"'Processes'",
":",
"process_operations",
".",
"VerifyProcessExpectation",
",",
"'RegistryEntries'",
":"... | Verifies the expectations in a property dict. | [
"Verifies",
"the",
"expectations",
"in",
"a",
"property",
"dict",
"."
] | [
"\"\"\"Verifies the expectations in a property dict.\n\n Args:\n property_dict: A property dictionary mapping type names to expectations.\n variable_expander: A VariableExpander.\n\n Raises:\n AssertionError: If an expectation is not satisfied.\n \"\"\""
] | [
{
"param": "property_dict",
"type": null
},
{
"param": "variable_expander",
"type": null
}
] | {
"returns": [],
"raises": [
{
"docstring": "If an expectation is not satisfied.",
"docstring_tokens": [
"If",
"an",
"expectation",
"is",
"not",
"satisfied",
"."
],
"type": "AssertionError"
}
],
"params": [
{
"iden... |
96c97c2a339d5ea3c2eea8d45d266ebfbb0d8239 | sunlongbo/chromium | chrome/test/mini_installer/property_walker.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | Clean | null | def Clean(property_dict, variable_expander):
"""Cleans machine state so that expectations will be satisfied.
Args:
property_dict: A property dictionary mapping type names to expectations.
variable_expander: A VariableExpander.
"""
_Walk(
{
'Files': file_operations.Cl... | Cleans machine state so that expectations will be satisfied.
Args:
property_dict: A property dictionary mapping type names to expectations.
variable_expander: A VariableExpander.
| Cleans machine state so that expectations will be satisfied. | [
"Cleans",
"machine",
"state",
"so",
"that",
"expectations",
"will",
"be",
"satisfied",
"."
] | def Clean(property_dict, variable_expander):
_Walk(
{
'Files': file_operations.CleanFile,
'Processes': process_operations.CleanProcess,
'RegistryEntries': registry_operations.CleanRegistryEntry,
}, True, property_dict, variable_expander) | [
"def",
"Clean",
"(",
"property_dict",
",",
"variable_expander",
")",
":",
"_Walk",
"(",
"{",
"'Files'",
":",
"file_operations",
".",
"CleanFile",
",",
"'Processes'",
":",
"process_operations",
".",
"CleanProcess",
",",
"'RegistryEntries'",
":",
"registry_operations"... | Cleans machine state so that expectations will be satisfied. | [
"Cleans",
"machine",
"state",
"so",
"that",
"expectations",
"will",
"be",
"satisfied",
"."
] | [
"\"\"\"Cleans machine state so that expectations will be satisfied.\n\n Args:\n property_dict: A property dictionary mapping type names to expectations.\n variable_expander: A VariableExpander.\n \"\"\""
] | [
{
"param": "property_dict",
"type": null
},
{
"param": "variable_expander",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "property_dict",
"type": null,
"docstring": "A property dictionary mapping type names to expectations.",
"docstring_tokens": [
"A",
"property",
"dictionary",
"mapping",
"type",
"n... |
9caf80cee07be7b42c3fdf504aff1b2ace14112a | sunlongbo/chromium | content/test/gpu/flake_suppressor/queries.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | GetFlakyOrFailingTests | <not_specific> | def GetFlakyOrFailingTests(sample_period, billing_project):
"""Gets all flaky or failing GPU tests in the given |sample_period|.
Args:
sample_period: An int containing the number of days in the past from the
current time to pull results from.
billing_project: A string containing the billing project... | Gets all flaky or failing GPU tests in the given |sample_period|.
Args:
sample_period: An int containing the number of days in the past from the
current time to pull results from.
billing_project: A string containing the billing project to use for
BigQuery queries.
Returns:
A JSON repr... | Gets all flaky or failing GPU tests in the given |sample_period|. | [
"Gets",
"all",
"flaky",
"or",
"failing",
"GPU",
"tests",
"in",
"the",
"given",
"|sample_period|",
"."
] | def GetFlakyOrFailingTests(sample_period, billing_project):
cmd = [
'bq',
'query',
'--max_rows=%d' % MAX_ROWS,
'--format=json',
'--project_id=%s' % billing_project,
'--use_legacy_sql=false',
'--parameter=sample_period:INT64:%d' % sample_period,
QUERY,
]
with open(os... | [
"def",
"GetFlakyOrFailingTests",
"(",
"sample_period",
",",
"billing_project",
")",
":",
"cmd",
"=",
"[",
"'bq'",
",",
"'query'",
",",
"'--max_rows=%d'",
"%",
"MAX_ROWS",
",",
"'--format=json'",
",",
"'--project_id=%s'",
"%",
"billing_project",
",",
"'--use_legacy_s... | Gets all flaky or failing GPU tests in the given |sample_period|. | [
"Gets",
"all",
"flaky",
"or",
"failing",
"GPU",
"tests",
"in",
"the",
"given",
"|sample_period|",
"."
] | [
"\"\"\"Gets all flaky or failing GPU tests in the given |sample_period|.\n\n Args:\n sample_period: An int containing the number of days in the past from the\n current time to pull results from.\n billing_project: A string containing the billing project to use for\n BigQuery queries.\n\n Retur... | [
{
"param": "sample_period",
"type": null
},
{
"param": "billing_project",
"type": null
}
] | {
"returns": [
{
"docstring": "A JSON representation of the BigQuery results containing all found flaky or\nfailing test results.",
"docstring_tokens": [
"A",
"JSON",
"representation",
"of",
"the",
"BigQuery",
"results",
"containing",
... |
9ce12ce137f84b1babe6cc53ab33a607be2f1729 | sunlongbo/chromium | third_party/blink/tools/blinkpy/w3c/monorail.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | new_chromium_issue | <not_specific> | def new_chromium_issue(summary,
description='',
cc=None,
components=None,
priority='3',
type='Bug',
labels=None):
"""Creates a minimal new Chromium is... | Creates a minimal new Chromium issue.
Chromium requires at least summary, priority and type: you must provide
the summary, whereas priority defaults to 3 and type defaults to Bug.
Args:
summary: The summary line.
description: The issue description.
cc: A lis... | Creates a minimal new Chromium issue.
Chromium requires at least summary, priority and type: you must provide
the summary, whereas priority defaults to 3 and type defaults to Bug. | [
"Creates",
"a",
"minimal",
"new",
"Chromium",
"issue",
".",
"Chromium",
"requires",
"at",
"least",
"summary",
"priority",
"and",
"type",
":",
"you",
"must",
"provide",
"the",
"summary",
"whereas",
"priority",
"defaults",
"to",
"3",
"and",
"type",
"defaults",
... | def new_chromium_issue(summary,
description='',
cc=None,
components=None,
priority='3',
type='Bug',
labels=None):
return MonorailIssue('chromium',
... | [
"def",
"new_chromium_issue",
"(",
"summary",
",",
"description",
"=",
"''",
",",
"cc",
"=",
"None",
",",
"components",
"=",
"None",
",",
"priority",
"=",
"'3'",
",",
"type",
"=",
"'Bug'",
",",
"labels",
"=",
"None",
")",
":",
"return",
"MonorailIssue",
... | Creates a minimal new Chromium issue. | [
"Creates",
"a",
"minimal",
"new",
"Chromium",
"issue",
"."
] | [
"\"\"\"Creates a minimal new Chromium issue.\n\n Chromium requires at least summary, priority and type: you must provide\n the summary, whereas priority defaults to 3 and type defaults to Bug.\n\n Args:\n summary: The summary line.\n description: The issue description.\n ... | [
{
"param": "summary",
"type": null
},
{
"param": "description",
"type": null
},
{
"param": "cc",
"type": null
},
{
"param": "components",
"type": null
},
{
"param": "priority",
"type": null
},
{
"param": "type",
"type": null
},
{
"param": "... | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "summary",
"type": null,
"docstring": "The summary line.",
"docstring_tokens": [
"The",
"summary",
"line",
"."
],
"default": null,
"is_optional": null
},
{
"identi... |
9cea148ee9a06df045f2237bf5745032d00d2ab2 | sunlongbo/chromium | tools/clang/pylib/clang/compile_db.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | _ProcessEntry | <not_specific> | def _ProcessEntry(entry, filtered_args, target_os):
"""Transforms one entry in a compile db to be more clang-tool friendly.
Expands the contents of the response file, if any, and performs any
transformations needed to make the compile DB easier to use for third-party
tooling.
"""
# Expand the contents of t... | Transforms one entry in a compile db to be more clang-tool friendly.
Expands the contents of the response file, if any, and performs any
transformations needed to make the compile DB easier to use for third-party
tooling.
| Transforms one entry in a compile db to be more clang-tool friendly.
Expands the contents of the response file, if any, and performs any
transformations needed to make the compile DB easier to use for third-party
tooling. | [
"Transforms",
"one",
"entry",
"in",
"a",
"compile",
"db",
"to",
"be",
"more",
"clang",
"-",
"tool",
"friendly",
".",
"Expands",
"the",
"contents",
"of",
"the",
"response",
"file",
"if",
"any",
"and",
"performs",
"any",
"transformations",
"needed",
"to",
"m... | def _ProcessEntry(entry, filtered_args, target_os):
try:
match = _RSP_RE.search(entry['command'])
if match:
rsp_path = os.path.join(entry['directory'], match.group(2))
rsp_contents = open(rsp_path).read()
entry['command'] = ''.join([
entry['command'][:match.start(1)], rsp_contents,... | [
"def",
"_ProcessEntry",
"(",
"entry",
",",
"filtered_args",
",",
"target_os",
")",
":",
"try",
":",
"match",
"=",
"_RSP_RE",
".",
"search",
"(",
"entry",
"[",
"'command'",
"]",
")",
"if",
"match",
":",
"rsp_path",
"=",
"os",
".",
"path",
".",
"join",
... | Transforms one entry in a compile db to be more clang-tool friendly. | [
"Transforms",
"one",
"entry",
"in",
"a",
"compile",
"db",
"to",
"be",
"more",
"clang",
"-",
"tool",
"friendly",
"."
] | [
"\"\"\"Transforms one entry in a compile db to be more clang-tool friendly.\n\n Expands the contents of the response file, if any, and performs any\n transformations needed to make the compile DB easier to use for third-party\n tooling.\n \"\"\"",
"# Expand the contents of the response file, if any.",
"# ht... | [
{
"param": "entry",
"type": null
},
{
"param": "filtered_args",
"type": null
},
{
"param": "target_os",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "entry",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "filtered_args",
"type": null,
"docstring": null,
"docstring_... |
9cea148ee9a06df045f2237bf5745032d00d2ab2 | sunlongbo/chromium | tools/clang/pylib/clang/compile_db.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | ProcessCompileDatabase | <not_specific> | def ProcessCompileDatabase(compile_db, filtered_args, target_os=None):
"""Make the compile db generated by ninja more clang-tool friendly.
Args:
compile_db: The compile database parsed as a Python dictionary.
Returns:
A postprocessed compile db that clang tooling can use.
"""
compile_db = [_ProcessE... | Make the compile db generated by ninja more clang-tool friendly.
Args:
compile_db: The compile database parsed as a Python dictionary.
Returns:
A postprocessed compile db that clang tooling can use.
| Make the compile db generated by ninja more clang-tool friendly. | [
"Make",
"the",
"compile",
"db",
"generated",
"by",
"ninja",
"more",
"clang",
"-",
"tool",
"friendly",
"."
] | def ProcessCompileDatabase(compile_db, filtered_args, target_os=None):
compile_db = [_ProcessEntry(e, filtered_args, target_os) for e in compile_db]
if not _IsTargettingWindows(target_os):
return compile_db
if _debugging:
print('Read in %d entries from the compile db' % len(compile_db))
original_length ... | [
"def",
"ProcessCompileDatabase",
"(",
"compile_db",
",",
"filtered_args",
",",
"target_os",
"=",
"None",
")",
":",
"compile_db",
"=",
"[",
"_ProcessEntry",
"(",
"e",
",",
"filtered_args",
",",
"target_os",
")",
"for",
"e",
"in",
"compile_db",
"]",
"if",
"not... | Make the compile db generated by ninja more clang-tool friendly. | [
"Make",
"the",
"compile",
"db",
"generated",
"by",
"ninja",
"more",
"clang",
"-",
"tool",
"friendly",
"."
] | [
"\"\"\"Make the compile db generated by ninja more clang-tool friendly.\n\n Args:\n compile_db: The compile database parsed as a Python dictionary.\n\n Returns:\n A postprocessed compile db that clang tooling can use.\n \"\"\"",
"# Filter out NaCl stuff. The clang tooling chokes on them.",
"# TODO(dche... | [
{
"param": "compile_db",
"type": null
},
{
"param": "filtered_args",
"type": null
},
{
"param": "target_os",
"type": null
}
] | {
"returns": [
{
"docstring": "A postprocessed compile db that clang tooling can use.",
"docstring_tokens": [
"A",
"postprocessed",
"compile",
"db",
"that",
"clang",
"tooling",
"can",
"use",
"."
],
"type": null... |
9cea148ee9a06df045f2237bf5745032d00d2ab2 | sunlongbo/chromium | tools/clang/pylib/clang/compile_db.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | GenerateWithNinja | <not_specific> | def GenerateWithNinja(path, targets=None):
"""Generates a compile database using ninja.
Args:
path: The build directory to generate a compile database for.
targets: Additional targets to pass to ninja.
Returns:
List of the contents of the compile database.
"""
# TODO(dcheng): Ensure that clang i... | Generates a compile database using ninja.
Args:
path: The build directory to generate a compile database for.
targets: Additional targets to pass to ninja.
Returns:
List of the contents of the compile database.
| Generates a compile database using ninja. | [
"Generates",
"a",
"compile",
"database",
"using",
"ninja",
"."
] | def GenerateWithNinja(path, targets=None):
ninja_path = GetNinjaPath()
if not os.path.exists(ninja_path):
ninja_path = shutil.which('ninja')
if targets is None:
targets = []
json_compile_db = subprocess.check_output(
[ninja_path, '-C', path] + targets +
['-t', 'compdb', 'cc', 'cxx', 'objc', ... | [
"def",
"GenerateWithNinja",
"(",
"path",
",",
"targets",
"=",
"None",
")",
":",
"ninja_path",
"=",
"GetNinjaPath",
"(",
")",
"if",
"not",
"os",
".",
"path",
".",
"exists",
"(",
"ninja_path",
")",
":",
"ninja_path",
"=",
"shutil",
".",
"which",
"(",
"'n... | Generates a compile database using ninja. | [
"Generates",
"a",
"compile",
"database",
"using",
"ninja",
"."
] | [
"\"\"\"Generates a compile database using ninja.\n\n Args:\n path: The build directory to generate a compile database for.\n targets: Additional targets to pass to ninja.\n\n Returns:\n List of the contents of the compile database.\n \"\"\"",
"# TODO(dcheng): Ensure that clang is enabled somehow.",
... | [
{
"param": "path",
"type": null
},
{
"param": "targets",
"type": null
}
] | {
"returns": [
{
"docstring": "List of the contents of the compile database.",
"docstring_tokens": [
"List",
"of",
"the",
"contents",
"of",
"the",
"compile",
"database",
"."
],
"type": null
}
],
"raises": [],
... |
9cebfe05f1643932ff6656b86b236b88e2fbe4d6 | sunlongbo/chromium | ios/build/bots/scripts/xctest_utils.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | ProcessLine | null | def ProcessLine(self, line):
"""This is called once with each line of the test log."""
# Track line number for error messages.
self._line_number += 1
# Some tests (net_unittests in particular) run subprocesses which can write
# stuff to shared stdout buffer. Sometimes such output appears between n... | This is called once with each line of the test log. | This is called once with each line of the test log. | [
"This",
"is",
"called",
"once",
"with",
"each",
"line",
"of",
"the",
"test",
"log",
"."
] | def ProcessLine(self, line):
self._line_number += 1
gtest_regexps = [
self._test_start,
self._test_ok,
self._test_fail,
self._test_execute_failed,
self._test_execute_succeeded,
]
for regexp in gtest_regexps:
match = regexp.search(line)
if match:
... | [
"def",
"ProcessLine",
"(",
"self",
",",
"line",
")",
":",
"self",
".",
"_line_number",
"+=",
"1",
"gtest_regexps",
"=",
"[",
"self",
".",
"_test_start",
",",
"self",
".",
"_test_ok",
",",
"self",
".",
"_test_fail",
",",
"self",
".",
"_test_execute_failed",... | This is called once with each line of the test log. | [
"This",
"is",
"called",
"once",
"with",
"each",
"line",
"of",
"the",
"test",
"log",
"."
] | [
"\"\"\"This is called once with each line of the test log.\"\"\"",
"# Track line number for error messages.",
"# Some tests (net_unittests in particular) run subprocesses which can write",
"# stuff to shared stdout buffer. Sometimes such output appears between new",
"# line and gtest directives ('[ RUN ]'... | [
{
"param": "self",
"type": null
},
{
"param": "line",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "line",
"type": null,
"docstring": null,
"docstring_tokens": [... |
9cebfe05f1643932ff6656b86b236b88e2fbe4d6 | sunlongbo/chromium | ios/build/bots/scripts/xctest_utils.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | _ProcessLine | <not_specific> | def _ProcessLine(self, line):
"""Parses the line and changes the state of parsed tests accordingly.
Will recognize newly started tests, OK or FAILED statuses, timeouts, etc.
"""
# Is it a line declaring end of all tests?
succeeded = self._test_execute_succeeded.match(line)
failed = self._test_... | Parses the line and changes the state of parsed tests accordingly.
Will recognize newly started tests, OK or FAILED statuses, timeouts, etc.
| Parses the line and changes the state of parsed tests accordingly.
Will recognize newly started tests, OK or FAILED statuses, timeouts, etc. | [
"Parses",
"the",
"line",
"and",
"changes",
"the",
"state",
"of",
"parsed",
"tests",
"accordingly",
".",
"Will",
"recognize",
"newly",
"started",
"tests",
"OK",
"or",
"FAILED",
"statuses",
"timeouts",
"etc",
"."
] | def _ProcessLine(self, line):
succeeded = self._test_execute_succeeded.match(line)
failed = self._test_execute_failed.match(line)
if succeeded or failed:
self.completed = True
self._current_test = ''
return
results = self._system_alert_present_message.search(line)
if results:
... | [
"def",
"_ProcessLine",
"(",
"self",
",",
"line",
")",
":",
"succeeded",
"=",
"self",
".",
"_test_execute_succeeded",
".",
"match",
"(",
"line",
")",
"failed",
"=",
"self",
".",
"_test_execute_failed",
".",
"match",
"(",
"line",
")",
"if",
"succeeded",
"or"... | Parses the line and changes the state of parsed tests accordingly. | [
"Parses",
"the",
"line",
"and",
"changes",
"the",
"state",
"of",
"parsed",
"tests",
"accordingly",
"."
] | [
"\"\"\"Parses the line and changes the state of parsed tests accordingly.\n\n Will recognize newly started tests, OK or FAILED statuses, timeouts, etc.\n \"\"\"",
"# Is it a line declaring end of all tests?",
"# Is it a line declaring a system alert is shown on the device?",
"# Is it the start of a test... | [
{
"param": "self",
"type": null
},
{
"param": "line",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "line",
"type": null,
"docstring": null,
"docstring_tokens": [... |
038fc5ed2d51d4bb45677ed3e85478a7e7e1ff00 | sunlongbo/chromium | tools/code_coverage/coverage_utils.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | AddLinkToAnotherReport | null | def AddLinkToAnotherReport(self, html_report_path, name, summary):
"""Adds a link to another html report in this report.
The link to be added is assumed to be an entry in this directory.
"""
# Use relative paths instead of absolute paths to make the generated reports
# portable.
html_report_rel... | Adds a link to another html report in this report.
The link to be added is assumed to be an entry in this directory.
| Adds a link to another html report in this report.
The link to be added is assumed to be an entry in this directory. | [
"Adds",
"a",
"link",
"to",
"another",
"html",
"report",
"in",
"this",
"report",
".",
"The",
"link",
"to",
"be",
"added",
"is",
"assumed",
"to",
"be",
"an",
"entry",
"in",
"this",
"directory",
"."
] | def AddLinkToAnotherReport(self, html_report_path, name, summary):
html_report_relative_path = GetRelativePathToDirectoryOfFile(
html_report_path, self._output_path)
table_entry = self._CreateTableEntryFromCoverageSummary(
summary, html_report_relative_path, name,
os.path.basename(html_r... | [
"def",
"AddLinkToAnotherReport",
"(",
"self",
",",
"html_report_path",
",",
"name",
",",
"summary",
")",
":",
"html_report_relative_path",
"=",
"GetRelativePathToDirectoryOfFile",
"(",
"html_report_path",
",",
"self",
".",
"_output_path",
")",
"table_entry",
"=",
"sel... | Adds a link to another html report in this report. | [
"Adds",
"a",
"link",
"to",
"another",
"html",
"report",
"in",
"this",
"report",
"."
] | [
"\"\"\"Adds a link to another html report in this report.\n\n The link to be added is assumed to be an entry in this directory.\n \"\"\"",
"# Use relative paths instead of absolute paths to make the generated reports",
"# portable."
] | [
{
"param": "self",
"type": null
},
{
"param": "html_report_path",
"type": null
},
{
"param": "name",
"type": null
},
{
"param": "summary",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "html_report_path",
"type": null,
"docstring": null,
"docstrin... |
038fc5ed2d51d4bb45677ed3e85478a7e7e1ff00 | sunlongbo/chromium | tools/code_coverage/coverage_utils.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | WriteHtmlCoverageReport | <not_specific> | def WriteHtmlCoverageReport(self, no_component_view, no_file_view):
"""Writes html coverage report.
In the report, sub-directories are displayed before files and within each
category, entries are sorted alphabetically.
"""
def EntryCmp(left, right):
"""Compare function for table entries."""
... | Writes html coverage report.
In the report, sub-directories are displayed before files and within each
category, entries are sorted alphabetically.
| Writes html coverage report.
In the report, sub-directories are displayed before files and within each
category, entries are sorted alphabetically. | [
"Writes",
"html",
"coverage",
"report",
".",
"In",
"the",
"report",
"sub",
"-",
"directories",
"are",
"displayed",
"before",
"files",
"and",
"within",
"each",
"category",
"entries",
"are",
"sorted",
"alphabetically",
"."
] | def WriteHtmlCoverageReport(self, no_component_view, no_file_view):
def EntryCmp(left, right):
if left['is_dir'] != right['is_dir']:
return -1 if left['is_dir'] == True else 1
return -1 if left['name'] < right['name'] else 1
self._table_entries = sorted(
self._table_entries, key=func... | [
"def",
"WriteHtmlCoverageReport",
"(",
"self",
",",
"no_component_view",
",",
"no_file_view",
")",
":",
"def",
"EntryCmp",
"(",
"left",
",",
"right",
")",
":",
"\"\"\"Compare function for table entries.\"\"\"",
"if",
"left",
"[",
"'is_dir'",
"]",
"!=",
"right",
"[... | Writes html coverage report. | [
"Writes",
"html",
"coverage",
"report",
"."
] | [
"\"\"\"Writes html coverage report.\n\n In the report, sub-directories are displayed before files and within each\n category, entries are sorted alphabetically.\n \"\"\"",
"\"\"\"Compare function for table entries.\"\"\"",
"# File view is optional in the report."
] | [
{
"param": "self",
"type": null
},
{
"param": "no_component_view",
"type": null
},
{
"param": "no_file_view",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "no_component_view",
"type": null,
"docstring": null,
"docstri... |
038fc5ed2d51d4bb45677ed3e85478a7e7e1ff00 | sunlongbo/chromium | tools/code_coverage/coverage_utils.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | _ExtractComponentToDirectoriesMapping | null | def _ExtractComponentToDirectoriesMapping(self, component_mappings):
"""Initializes a mapping from components to directories."""
directory_to_component = component_mappings['dir-to-component']
self.component_to_directories = defaultdict(list)
for directory in sorted(directory_to_component):
compo... | Initializes a mapping from components to directories. | Initializes a mapping from components to directories. | [
"Initializes",
"a",
"mapping",
"from",
"components",
"to",
"directories",
"."
] | def _ExtractComponentToDirectoriesMapping(self, component_mappings):
directory_to_component = component_mappings['dir-to-component']
self.component_to_directories = defaultdict(list)
for directory in sorted(directory_to_component):
component = directory_to_component[directory]
found_parent_direc... | [
"def",
"_ExtractComponentToDirectoriesMapping",
"(",
"self",
",",
"component_mappings",
")",
":",
"directory_to_component",
"=",
"component_mappings",
"[",
"'dir-to-component'",
"]",
"self",
".",
"component_to_directories",
"=",
"defaultdict",
"(",
"list",
")",
"for",
"... | Initializes a mapping from components to directories. | [
"Initializes",
"a",
"mapping",
"from",
"components",
"to",
"directories",
"."
] | [
"\"\"\"Initializes a mapping from components to directories.\"\"\"",
"# Check if we already added the parent directory of this directory. If",
"# yes,skip this sub-directory to avoid double-counting."
] | [
{
"param": "self",
"type": null
},
{
"param": "component_mappings",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "component_mappings",
"type": null,
"docstring": null,
"docstr... |
038fc5ed2d51d4bb45677ed3e85478a7e7e1ff00 | sunlongbo/chromium | tools/code_coverage/coverage_utils.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | _MapToLocal | <not_specific> | def _MapToLocal(self, path):
"""Maps a path from the coverage data to a local path."""
if not self.path_map:
return path
return path.replace(self.path_map[0], self.path_map[1], 1) | Maps a path from the coverage data to a local path. | Maps a path from the coverage data to a local path. | [
"Maps",
"a",
"path",
"from",
"the",
"coverage",
"data",
"to",
"a",
"local",
"path",
"."
] | def _MapToLocal(self, path):
if not self.path_map:
return path
return path.replace(self.path_map[0], self.path_map[1], 1) | [
"def",
"_MapToLocal",
"(",
"self",
",",
"path",
")",
":",
"if",
"not",
"self",
".",
"path_map",
":",
"return",
"path",
"return",
"path",
".",
"replace",
"(",
"self",
".",
"path_map",
"[",
"0",
"]",
",",
"self",
".",
"path_map",
"[",
"1",
"]",
",",
... | Maps a path from the coverage data to a local path. | [
"Maps",
"a",
"path",
"from",
"the",
"coverage",
"data",
"to",
"a",
"local",
"path",
"."
] | [
"\"\"\"Maps a path from the coverage data to a local path.\"\"\""
] | [
{
"param": "self",
"type": null
},
{
"param": "path",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "path",
"type": null,
"docstring": null,
"docstring_tokens": [... |
038fc5ed2d51d4bb45677ed3e85478a7e7e1ff00 | sunlongbo/chromium | tools/code_coverage/coverage_utils.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | CalculatePerDirectoryCoverageSummary | <not_specific> | def CalculatePerDirectoryCoverageSummary(self, per_file_coverage_summary):
"""Calculates per directory coverage summary."""
logging.debug('Calculating per-directory coverage summary.')
per_directory_coverage_summary = defaultdict(lambda: CoverageSummary())
for file_path in per_file_coverage_summary:
... | Calculates per directory coverage summary. | Calculates per directory coverage summary. | [
"Calculates",
"per",
"directory",
"coverage",
"summary",
"."
] | def CalculatePerDirectoryCoverageSummary(self, per_file_coverage_summary):
logging.debug('Calculating per-directory coverage summary.')
per_directory_coverage_summary = defaultdict(lambda: CoverageSummary())
for file_path in per_file_coverage_summary:
summary = per_file_coverage_summary[file_path]
... | [
"def",
"CalculatePerDirectoryCoverageSummary",
"(",
"self",
",",
"per_file_coverage_summary",
")",
":",
"logging",
".",
"debug",
"(",
"'Calculating per-directory coverage summary.'",
")",
"per_directory_coverage_summary",
"=",
"defaultdict",
"(",
"lambda",
":",
"CoverageSumma... | Calculates per directory coverage summary. | [
"Calculates",
"per",
"directory",
"coverage",
"summary",
"."
] | [
"\"\"\"Calculates per directory coverage summary.\"\"\""
] | [
{
"param": "self",
"type": null
},
{
"param": "per_file_coverage_summary",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "per_file_coverage_summary",
"type": null,
"docstring": null,
... |
038fc5ed2d51d4bb45677ed3e85478a7e7e1ff00 | sunlongbo/chromium | tools/code_coverage/coverage_utils.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | CalculatePerComponentCoverageSummary | <not_specific> | def CalculatePerComponentCoverageSummary(self,
per_directory_coverage_summary):
"""Calculates per component coverage summary."""
logging.debug('Calculating per-component coverage summary.')
per_component_coverage_summary = defaultdict(lambda: CoverageSummary())
... | Calculates per component coverage summary. | Calculates per component coverage summary. | [
"Calculates",
"per",
"component",
"coverage",
"summary",
"."
] | def CalculatePerComponentCoverageSummary(self,
per_directory_coverage_summary):
logging.debug('Calculating per-component coverage summary.')
per_component_coverage_summary = defaultdict(lambda: CoverageSummary())
for component in self.component_to_directories:
... | [
"def",
"CalculatePerComponentCoverageSummary",
"(",
"self",
",",
"per_directory_coverage_summary",
")",
":",
"logging",
".",
"debug",
"(",
"'Calculating per-component coverage summary.'",
")",
"per_component_coverage_summary",
"=",
"defaultdict",
"(",
"lambda",
":",
"Coverage... | Calculates per component coverage summary. | [
"Calculates",
"per",
"component",
"coverage",
"summary",
"."
] | [
"\"\"\"Calculates per component coverage summary.\"\"\""
] | [
{
"param": "self",
"type": null
},
{
"param": "per_directory_coverage_summary",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "per_directory_coverage_summary",
"type": null,
"docstring": null,
... |
038fc5ed2d51d4bb45677ed3e85478a7e7e1ff00 | sunlongbo/chromium | tools/code_coverage/coverage_utils.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | GeneratePerComponentCoverageInHtml | null | def GeneratePerComponentCoverageInHtml(self, per_component_coverage_summary,
per_directory_coverage_summary):
"""Generates per-component coverage reports in html."""
logging.debug('Writing per-component coverage html reports.')
for component in per_component_coverage... | Generates per-component coverage reports in html. | Generates per-component coverage reports in html. | [
"Generates",
"per",
"-",
"component",
"coverage",
"reports",
"in",
"html",
"."
] | def GeneratePerComponentCoverageInHtml(self, per_component_coverage_summary,
per_directory_coverage_summary):
logging.debug('Writing per-component coverage html reports.')
for component in per_component_coverage_summary:
self.GenerateCoverageInHtmlForComponent(comp... | [
"def",
"GeneratePerComponentCoverageInHtml",
"(",
"self",
",",
"per_component_coverage_summary",
",",
"per_directory_coverage_summary",
")",
":",
"logging",
".",
"debug",
"(",
"'Writing per-component coverage html reports.'",
")",
"for",
"component",
"in",
"per_component_covera... | Generates per-component coverage reports in html. | [
"Generates",
"per",
"-",
"component",
"coverage",
"reports",
"in",
"html",
"."
] | [
"\"\"\"Generates per-component coverage reports in html.\"\"\""
] | [
{
"param": "self",
"type": null
},
{
"param": "per_component_coverage_summary",
"type": null
},
{
"param": "per_directory_coverage_summary",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "per_component_coverage_summary",
"type": null,
"docstring": null,
... |
038fc5ed2d51d4bb45677ed3e85478a7e7e1ff00 | sunlongbo/chromium | tools/code_coverage/coverage_utils.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | GenerateComponentViewHtmlIndexFile | null | def GenerateComponentViewHtmlIndexFile(self, per_component_coverage_summary):
"""Generates the html index file for component view."""
component_view_index_file_path = self.component_view_path
logging.debug('Generating component view html index file as: "%s".',
component_view_index_file_pat... | Generates the html index file for component view. | Generates the html index file for component view. | [
"Generates",
"the",
"html",
"index",
"file",
"for",
"component",
"view",
"."
] | def GenerateComponentViewHtmlIndexFile(self, per_component_coverage_summary):
component_view_index_file_path = self.component_view_path
logging.debug('Generating component view html index file as: "%s".',
component_view_index_file_path)
html_generator = CoverageReportHtmlGenerator(
... | [
"def",
"GenerateComponentViewHtmlIndexFile",
"(",
"self",
",",
"per_component_coverage_summary",
")",
":",
"component_view_index_file_path",
"=",
"self",
".",
"component_view_path",
"logging",
".",
"debug",
"(",
"'Generating component view html index file as: \"%s\".'",
",",
"c... | Generates the html index file for component view. | [
"Generates",
"the",
"html",
"index",
"file",
"for",
"component",
"view",
"."
] | [
"\"\"\"Generates the html index file for component view.\"\"\"",
"# Do not create a totals row for the component view as the value is",
"# incorrect due to failure to account for UNKNOWN component and some paths",
"# belonging to multiple components."
] | [
{
"param": "self",
"type": null
},
{
"param": "per_component_coverage_summary",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "per_component_coverage_summary",
"type": null,
"docstring": null,
... |
038fc5ed2d51d4bb45677ed3e85478a7e7e1ff00 | sunlongbo/chromium | tools/code_coverage/coverage_utils.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | GenerateCoverageInHtmlForComponent | null | def GenerateCoverageInHtmlForComponent(self, component_name,
per_component_coverage_summary,
per_directory_coverage_summary):
"""Generates coverage html report for a component."""
component_html_report_path = self.GetCoverageHtmlR... | Generates coverage html report for a component. | Generates coverage html report for a component. | [
"Generates",
"coverage",
"html",
"report",
"for",
"a",
"component",
"."
] | def GenerateCoverageInHtmlForComponent(self, component_name,
per_component_coverage_summary,
per_directory_coverage_summary):
component_html_report_path = self.GetCoverageHtmlReportPathForComponent(
component_name)
compone... | [
"def",
"GenerateCoverageInHtmlForComponent",
"(",
"self",
",",
"component_name",
",",
"per_component_coverage_summary",
",",
"per_directory_coverage_summary",
")",
":",
"component_html_report_path",
"=",
"self",
".",
"GetCoverageHtmlReportPathForComponent",
"(",
"component_name",... | Generates coverage html report for a component. | [
"Generates",
"coverage",
"html",
"report",
"for",
"a",
"component",
"."
] | [
"\"\"\"Generates coverage html report for a component.\"\"\"",
"# Any directory without an exercised file shouldn't be included into",
"# the report."
] | [
{
"param": "self",
"type": null
},
{
"param": "component_name",
"type": null
},
{
"param": "per_component_coverage_summary",
"type": null
},
{
"param": "per_directory_coverage_summary",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "component_name",
"type": null,
"docstring": null,
"docstring_... |
038fc5ed2d51d4bb45677ed3e85478a7e7e1ff00 | sunlongbo/chromium | tools/code_coverage/coverage_utils.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | GetCoverageHtmlReportPathForComponent | <not_specific> | def GetCoverageHtmlReportPathForComponent(self, component_name):
"""Given a component, returns the corresponding html report path."""
component_file_name = component_name.lower().replace('>', '-')
html_report_name = os.extsep.join([component_file_name, 'html'])
return os.path.join(self.report_root_dir, ... | Given a component, returns the corresponding html report path. | Given a component, returns the corresponding html report path. | [
"Given",
"a",
"component",
"returns",
"the",
"corresponding",
"html",
"report",
"path",
"."
] | def GetCoverageHtmlReportPathForComponent(self, component_name):
component_file_name = component_name.lower().replace('>', '-')
html_report_name = os.extsep.join([component_file_name, 'html'])
return os.path.join(self.report_root_dir, 'components', html_report_name) | [
"def",
"GetCoverageHtmlReportPathForComponent",
"(",
"self",
",",
"component_name",
")",
":",
"component_file_name",
"=",
"component_name",
".",
"lower",
"(",
")",
".",
"replace",
"(",
"'>'",
",",
"'-'",
")",
"html_report_name",
"=",
"os",
".",
"extsep",
".",
... | Given a component, returns the corresponding html report path. | [
"Given",
"a",
"component",
"returns",
"the",
"corresponding",
"html",
"report",
"path",
"."
] | [
"\"\"\"Given a component, returns the corresponding html report path.\"\"\""
] | [
{
"param": "self",
"type": null
},
{
"param": "component_name",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "component_name",
"type": null,
"docstring": null,
"docstring_... |
038fc5ed2d51d4bb45677ed3e85478a7e7e1ff00 | sunlongbo/chromium | tools/code_coverage/coverage_utils.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | GetCoverageHtmlReportPathForDirectory | <not_specific> | def GetCoverageHtmlReportPathForDirectory(self, dir_path):
"""Given a directory path, returns the corresponding html report path."""
assert os.path.isdir(
self._MapToLocal(dir_path)), '"%s" is not a directory.' % dir_path
html_report_path = os.path.join(
GetFullPath(dir_path), DIRECTORY_COVE... | Given a directory path, returns the corresponding html report path. | Given a directory path, returns the corresponding html report path. | [
"Given",
"a",
"directory",
"path",
"returns",
"the",
"corresponding",
"html",
"report",
"path",
"."
] | def GetCoverageHtmlReportPathForDirectory(self, dir_path):
assert os.path.isdir(
self._MapToLocal(dir_path)), '"%s" is not a directory.' % dir_path
html_report_path = os.path.join(
GetFullPath(dir_path), DIRECTORY_COVERAGE_HTML_REPORT_NAME)
return self.CombineAbsolutePaths(self.report_root_d... | [
"def",
"GetCoverageHtmlReportPathForDirectory",
"(",
"self",
",",
"dir_path",
")",
":",
"assert",
"os",
".",
"path",
".",
"isdir",
"(",
"self",
".",
"_MapToLocal",
"(",
"dir_path",
")",
")",
",",
"'\"%s\" is not a directory.'",
"%",
"dir_path",
"html_report_path",... | Given a directory path, returns the corresponding html report path. | [
"Given",
"a",
"directory",
"path",
"returns",
"the",
"corresponding",
"html",
"report",
"path",
"."
] | [
"\"\"\"Given a directory path, returns the corresponding html report path.\"\"\""
] | [
{
"param": "self",
"type": null
},
{
"param": "dir_path",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "dir_path",
"type": null,
"docstring": null,
"docstring_tokens... |
038fc5ed2d51d4bb45677ed3e85478a7e7e1ff00 | sunlongbo/chromium | tools/code_coverage/coverage_utils.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | GetCoverageHtmlReportPathForFile | <not_specific> | def GetCoverageHtmlReportPathForFile(self, file_path):
"""Given a file path, returns the corresponding html report path."""
assert os.path.isfile(
self._MapToLocal(file_path)), '"%s" is not a file.' % file_path
html_report_path = os.extsep.join([GetFullPath(file_path), 'html'])
return self.Comb... | Given a file path, returns the corresponding html report path. | Given a file path, returns the corresponding html report path. | [
"Given",
"a",
"file",
"path",
"returns",
"the",
"corresponding",
"html",
"report",
"path",
"."
] | def GetCoverageHtmlReportPathForFile(self, file_path):
assert os.path.isfile(
self._MapToLocal(file_path)), '"%s" is not a file.' % file_path
html_report_path = os.extsep.join([GetFullPath(file_path), 'html'])
return self.CombineAbsolutePaths(self.report_root_dir, html_report_path) | [
"def",
"GetCoverageHtmlReportPathForFile",
"(",
"self",
",",
"file_path",
")",
":",
"assert",
"os",
".",
"path",
".",
"isfile",
"(",
"self",
".",
"_MapToLocal",
"(",
"file_path",
")",
")",
",",
"'\"%s\" is not a file.'",
"%",
"file_path",
"html_report_path",
"="... | Given a file path, returns the corresponding html report path. | [
"Given",
"a",
"file",
"path",
"returns",
"the",
"corresponding",
"html",
"report",
"path",
"."
] | [
"\"\"\"Given a file path, returns the corresponding html report path.\"\"\""
] | [
{
"param": "self",
"type": null
},
{
"param": "file_path",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "file_path",
"type": null,
"docstring": null,
"docstring_token... |
038fc5ed2d51d4bb45677ed3e85478a7e7e1ff00 | sunlongbo/chromium | tools/code_coverage/coverage_utils.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | GenerateFileViewHtmlIndexFile | null | def GenerateFileViewHtmlIndexFile(self, per_file_coverage_summary,
file_view_index_file_path):
"""Generates html index file for file view."""
logging.debug('Generating file view html index file as: "%s".',
file_view_index_file_path)
html_generator = Cove... | Generates html index file for file view. | Generates html index file for file view. | [
"Generates",
"html",
"index",
"file",
"for",
"file",
"view",
"."
] | def GenerateFileViewHtmlIndexFile(self, per_file_coverage_summary,
file_view_index_file_path):
logging.debug('Generating file view html index file as: "%s".',
file_view_index_file_path)
html_generator = CoverageReportHtmlGenerator(
self.output_dir, f... | [
"def",
"GenerateFileViewHtmlIndexFile",
"(",
"self",
",",
"per_file_coverage_summary",
",",
"file_view_index_file_path",
")",
":",
"logging",
".",
"debug",
"(",
"'Generating file view html index file as: \"%s\".'",
",",
"file_view_index_file_path",
")",
"html_generator",
"=",
... | Generates html index file for file view. | [
"Generates",
"html",
"index",
"file",
"for",
"file",
"view",
"."
] | [
"\"\"\"Generates html index file for file view.\"\"\""
] | [
{
"param": "self",
"type": null
},
{
"param": "per_file_coverage_summary",
"type": null
},
{
"param": "file_view_index_file_path",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "per_file_coverage_summary",
"type": null,
"docstring": null,
... |
038fc5ed2d51d4bb45677ed3e85478a7e7e1ff00 | sunlongbo/chromium | tools/code_coverage/coverage_utils.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | GeneratePerFileCoverageSummary | <not_specific> | def GeneratePerFileCoverageSummary(self):
"""Generate per file coverage summary using coverage data in JSON format."""
files_coverage_data = self.summary_data['data'][0]['files']
per_file_coverage_summary = {}
for file_coverage_data in files_coverage_data:
file_path = os.path.normpath(file_covera... | Generate per file coverage summary using coverage data in JSON format. | Generate per file coverage summary using coverage data in JSON format. | [
"Generate",
"per",
"file",
"coverage",
"summary",
"using",
"coverage",
"data",
"in",
"JSON",
"format",
"."
] | def GeneratePerFileCoverageSummary(self):
files_coverage_data = self.summary_data['data'][0]['files']
per_file_coverage_summary = {}
for file_coverage_data in files_coverage_data:
file_path = os.path.normpath(file_coverage_data['filename'])
assert file_path.startswith(self.src_root_dir), (
... | [
"def",
"GeneratePerFileCoverageSummary",
"(",
"self",
")",
":",
"files_coverage_data",
"=",
"self",
".",
"summary_data",
"[",
"'data'",
"]",
"[",
"0",
"]",
"[",
"'files'",
"]",
"per_file_coverage_summary",
"=",
"{",
"}",
"for",
"file_coverage_data",
"in",
"files... | Generate per file coverage summary using coverage data in JSON format. | [
"Generate",
"per",
"file",
"coverage",
"summary",
"using",
"coverage",
"data",
"in",
"JSON",
"format",
"."
] | [
"\"\"\"Generate per file coverage summary using coverage data in JSON format.\"\"\""
] | [
{
"param": "self",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
038fc5ed2d51d4bb45677ed3e85478a7e7e1ff00 | sunlongbo/chromium | tools/code_coverage/coverage_utils.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | GeneratePerDirectoryCoverageInHtml | null | def GeneratePerDirectoryCoverageInHtml(self, per_directory_coverage_summary,
per_file_coverage_summary):
"""Generates per directory coverage breakdown in html."""
logging.debug('Writing per-directory coverage html reports.')
for dir_path in per_directory_coverage_sum... | Generates per directory coverage breakdown in html. | Generates per directory coverage breakdown in html. | [
"Generates",
"per",
"directory",
"coverage",
"breakdown",
"in",
"html",
"."
] | def GeneratePerDirectoryCoverageInHtml(self, per_directory_coverage_summary,
per_file_coverage_summary):
logging.debug('Writing per-directory coverage html reports.')
for dir_path in per_directory_coverage_summary:
self.GenerateCoverageInHtmlForDirectory(
... | [
"def",
"GeneratePerDirectoryCoverageInHtml",
"(",
"self",
",",
"per_directory_coverage_summary",
",",
"per_file_coverage_summary",
")",
":",
"logging",
".",
"debug",
"(",
"'Writing per-directory coverage html reports.'",
")",
"for",
"dir_path",
"in",
"per_directory_coverage_sum... | Generates per directory coverage breakdown in html. | [
"Generates",
"per",
"directory",
"coverage",
"breakdown",
"in",
"html",
"."
] | [
"\"\"\"Generates per directory coverage breakdown in html.\"\"\""
] | [
{
"param": "self",
"type": null
},
{
"param": "per_directory_coverage_summary",
"type": null
},
{
"param": "per_file_coverage_summary",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "per_directory_coverage_summary",
"type": null,
"docstring": null,
... |
038fc5ed2d51d4bb45677ed3e85478a7e7e1ff00 | sunlongbo/chromium | tools/code_coverage/coverage_utils.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | GenerateCoverageInHtmlForDirectory | null | def GenerateCoverageInHtmlForDirectory(self, dir_path,
per_directory_coverage_summary,
per_file_coverage_summary):
"""Generates coverage html report for a single directory."""
html_generator = CoverageReportHtmlGenerator(
... | Generates coverage html report for a single directory. | Generates coverage html report for a single directory. | [
"Generates",
"coverage",
"html",
"report",
"for",
"a",
"single",
"directory",
"."
] | def GenerateCoverageInHtmlForDirectory(self, dir_path,
per_directory_coverage_summary,
per_file_coverage_summary):
html_generator = CoverageReportHtmlGenerator(
self.output_dir, self.GetCoverageHtmlReportPathForDirectory(dir_p... | [
"def",
"GenerateCoverageInHtmlForDirectory",
"(",
"self",
",",
"dir_path",
",",
"per_directory_coverage_summary",
",",
"per_file_coverage_summary",
")",
":",
"html_generator",
"=",
"CoverageReportHtmlGenerator",
"(",
"self",
".",
"output_dir",
",",
"self",
".",
"GetCovera... | Generates coverage html report for a single directory. | [
"Generates",
"coverage",
"html",
"report",
"for",
"a",
"single",
"directory",
"."
] | [
"\"\"\"Generates coverage html report for a single directory.\"\"\"",
"# Any file without executable lines shouldn't be included into the",
"# report. For example, OWNER and README.md files."
] | [
{
"param": "self",
"type": null
},
{
"param": "dir_path",
"type": null
},
{
"param": "per_directory_coverage_summary",
"type": null
},
{
"param": "per_file_coverage_summary",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "dir_path",
"type": null,
"docstring": null,
"docstring_tokens... |
038fc5ed2d51d4bb45677ed3e85478a7e7e1ff00 | sunlongbo/chromium | tools/code_coverage/coverage_utils.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | GenerateDirectoryViewHtmlIndexFile | null | def GenerateDirectoryViewHtmlIndexFile(self):
"""Generates the html index file for directory view.
Note that the index file is already generated under src_root_dir, so this
file simply redirects to it, and the reason of this extra layer is for
structural consistency with other views.
"""
direct... | Generates the html index file for directory view.
Note that the index file is already generated under src_root_dir, so this
file simply redirects to it, and the reason of this extra layer is for
structural consistency with other views.
| Generates the html index file for directory view.
Note that the index file is already generated under src_root_dir, so this
file simply redirects to it, and the reason of this extra layer is for
structural consistency with other views. | [
"Generates",
"the",
"html",
"index",
"file",
"for",
"directory",
"view",
".",
"Note",
"that",
"the",
"index",
"file",
"is",
"already",
"generated",
"under",
"src_root_dir",
"so",
"this",
"file",
"simply",
"redirects",
"to",
"it",
"and",
"the",
"reason",
"of"... | def GenerateDirectoryViewHtmlIndexFile(self):
directory_view_index_file_path = self.directory_view_path
logging.debug('Generating directory view html index file as: "%s".',
directory_view_index_file_path)
src_root_html_report_path = self.GetCoverageHtmlReportPathForDirectory(
self.... | [
"def",
"GenerateDirectoryViewHtmlIndexFile",
"(",
"self",
")",
":",
"directory_view_index_file_path",
"=",
"self",
".",
"directory_view_path",
"logging",
".",
"debug",
"(",
"'Generating directory view html index file as: \"%s\".'",
",",
"directory_view_index_file_path",
")",
"s... | Generates the html index file for directory view. | [
"Generates",
"the",
"html",
"index",
"file",
"for",
"directory",
"view",
"."
] | [
"\"\"\"Generates the html index file for directory view.\n\n Note that the index file is already generated under src_root_dir, so this\n file simply redirects to it, and the reason of this extra layer is for\n structural consistency with other views.\n \"\"\""
] | [
{
"param": "self",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
038fc5ed2d51d4bb45677ed3e85478a7e7e1ff00 | sunlongbo/chromium | tools/code_coverage/coverage_utils.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | OverwriteHtmlReportsIndexFile | null | def OverwriteHtmlReportsIndexFile(self):
"""Overwrites the root index file to redirect to the default view."""
html_index_file_path = self.html_index_path
directory_view_index_file_path = self.directory_view_path
WriteRedirectHtmlFile(html_index_file_path, directory_view_index_file_path) | Overwrites the root index file to redirect to the default view. | Overwrites the root index file to redirect to the default view. | [
"Overwrites",
"the",
"root",
"index",
"file",
"to",
"redirect",
"to",
"the",
"default",
"view",
"."
] | def OverwriteHtmlReportsIndexFile(self):
html_index_file_path = self.html_index_path
directory_view_index_file_path = self.directory_view_path
WriteRedirectHtmlFile(html_index_file_path, directory_view_index_file_path) | [
"def",
"OverwriteHtmlReportsIndexFile",
"(",
"self",
")",
":",
"html_index_file_path",
"=",
"self",
".",
"html_index_path",
"directory_view_index_file_path",
"=",
"self",
".",
"directory_view_path",
"WriteRedirectHtmlFile",
"(",
"html_index_file_path",
",",
"directory_view_in... | Overwrites the root index file to redirect to the default view. | [
"Overwrites",
"the",
"root",
"index",
"file",
"to",
"redirect",
"to",
"the",
"default",
"view",
"."
] | [
"\"\"\"Overwrites the root index file to redirect to the default view.\"\"\""
] | [
{
"param": "self",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
038fc5ed2d51d4bb45677ed3e85478a7e7e1ff00 | sunlongbo/chromium | tools/code_coverage/coverage_utils.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | CleanUpOutputDir | null | def CleanUpOutputDir(self):
"""Perform a cleanup of the output dir."""
# Remove the default index.html file produced by llvm-cov.
index_path = os.path.join(self.output_dir, INDEX_HTML_FILE)
if os.path.exists(index_path):
os.remove(index_path) | Perform a cleanup of the output dir. | Perform a cleanup of the output dir. | [
"Perform",
"a",
"cleanup",
"of",
"the",
"output",
"dir",
"."
] | def CleanUpOutputDir(self):
index_path = os.path.join(self.output_dir, INDEX_HTML_FILE)
if os.path.exists(index_path):
os.remove(index_path) | [
"def",
"CleanUpOutputDir",
"(",
"self",
")",
":",
"index_path",
"=",
"os",
".",
"path",
".",
"join",
"(",
"self",
".",
"output_dir",
",",
"INDEX_HTML_FILE",
")",
"if",
"os",
".",
"path",
".",
"exists",
"(",
"index_path",
")",
":",
"os",
".",
"remove",
... | Perform a cleanup of the output dir. | [
"Perform",
"a",
"cleanup",
"of",
"the",
"output",
"dir",
"."
] | [
"\"\"\"Perform a cleanup of the output dir.\"\"\"",
"# Remove the default index.html file produced by llvm-cov."
] | [
{
"param": "self",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
038fc5ed2d51d4bb45677ed3e85478a7e7e1ff00 | sunlongbo/chromium | tools/code_coverage/coverage_utils.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | ConfigureLogging | null | def ConfigureLogging(verbose=False, log_file=None):
"""Configures logging settings for later use."""
log_level = logging.DEBUG if verbose else logging.INFO
log_format = '[%(asctime)s %(levelname)s] %(message)s'
logging.basicConfig(filename=log_file, level=log_level, format=log_format) | Configures logging settings for later use. | Configures logging settings for later use. | [
"Configures",
"logging",
"settings",
"for",
"later",
"use",
"."
] | def ConfigureLogging(verbose=False, log_file=None):
log_level = logging.DEBUG if verbose else logging.INFO
log_format = '[%(asctime)s %(levelname)s] %(message)s'
logging.basicConfig(filename=log_file, level=log_level, format=log_format) | [
"def",
"ConfigureLogging",
"(",
"verbose",
"=",
"False",
",",
"log_file",
"=",
"None",
")",
":",
"log_level",
"=",
"logging",
".",
"DEBUG",
"if",
"verbose",
"else",
"logging",
".",
"INFO",
"log_format",
"=",
"'[%(asctime)s %(levelname)s] %(message)s'",
"logging",
... | Configures logging settings for later use. | [
"Configures",
"logging",
"settings",
"for",
"later",
"use",
"."
] | [
"\"\"\"Configures logging settings for later use.\"\"\""
] | [
{
"param": "verbose",
"type": null
},
{
"param": "log_file",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "verbose",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "log_file",
"type": null,
"docstring": null,
"docstring_tok... |
038fc5ed2d51d4bb45677ed3e85478a7e7e1ff00 | sunlongbo/chromium | tools/code_coverage/coverage_utils.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | GetHostPlatform | <not_specific> | def GetHostPlatform():
"""Returns the host platform.
This is separate from the target platform/os that coverage is running for.
"""
if sys.platform == 'win32' or sys.platform == 'cygwin':
return 'win'
if sys.platform.startswith('linux'):
return 'linux'
else:
assert sys.platform == 'darwin'
... | Returns the host platform.
This is separate from the target platform/os that coverage is running for.
| Returns the host platform.
This is separate from the target platform/os that coverage is running for. | [
"Returns",
"the",
"host",
"platform",
".",
"This",
"is",
"separate",
"from",
"the",
"target",
"platform",
"/",
"os",
"that",
"coverage",
"is",
"running",
"for",
"."
] | def GetHostPlatform():
if sys.platform == 'win32' or sys.platform == 'cygwin':
return 'win'
if sys.platform.startswith('linux'):
return 'linux'
else:
assert sys.platform == 'darwin'
return 'mac' | [
"def",
"GetHostPlatform",
"(",
")",
":",
"if",
"sys",
".",
"platform",
"==",
"'win32'",
"or",
"sys",
".",
"platform",
"==",
"'cygwin'",
":",
"return",
"'win'",
"if",
"sys",
".",
"platform",
".",
"startswith",
"(",
"'linux'",
")",
":",
"return",
"'linux'"... | Returns the host platform. | [
"Returns",
"the",
"host",
"platform",
"."
] | [
"\"\"\"Returns the host platform.\n\n This is separate from the target platform/os that coverage is running for.\n \"\"\""
] | [] | {
"returns": [],
"raises": [],
"params": [],
"outlier_params": [],
"others": []
} |
038fc5ed2d51d4bb45677ed3e85478a7e7e1ff00 | sunlongbo/chromium | tools/code_coverage/coverage_utils.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | GetRelativePathToDirectoryOfFile | <not_specific> | def GetRelativePathToDirectoryOfFile(target_path, base_path):
"""Returns a target path relative to the directory of base_path.
This method requires base_path to be a file, otherwise, one should call
os.path.relpath directly.
"""
assert os.path.dirname(base_path) != base_path, (
'Base path: "%s" is a di... | Returns a target path relative to the directory of base_path.
This method requires base_path to be a file, otherwise, one should call
os.path.relpath directly.
| Returns a target path relative to the directory of base_path.
This method requires base_path to be a file, otherwise, one should call
os.path.relpath directly. | [
"Returns",
"a",
"target",
"path",
"relative",
"to",
"the",
"directory",
"of",
"base_path",
".",
"This",
"method",
"requires",
"base_path",
"to",
"be",
"a",
"file",
"otherwise",
"one",
"should",
"call",
"os",
".",
"path",
".",
"relpath",
"directly",
"."
] | def GetRelativePathToDirectoryOfFile(target_path, base_path):
assert os.path.dirname(base_path) != base_path, (
'Base path: "%s" is a directory, please call os.path.relpath directly.' %
base_path)
base_dir = os.path.dirname(base_path)
return os.path.relpath(target_path, base_dir) | [
"def",
"GetRelativePathToDirectoryOfFile",
"(",
"target_path",
",",
"base_path",
")",
":",
"assert",
"os",
".",
"path",
".",
"dirname",
"(",
"base_path",
")",
"!=",
"base_path",
",",
"(",
"'Base path: \"%s\" is a directory, please call os.path.relpath directly.'",
"%",
... | Returns a target path relative to the directory of base_path. | [
"Returns",
"a",
"target",
"path",
"relative",
"to",
"the",
"directory",
"of",
"base_path",
"."
] | [
"\"\"\"Returns a target path relative to the directory of base_path.\n\n This method requires base_path to be a file, otherwise, one should call\n os.path.relpath directly.\n \"\"\""
] | [
{
"param": "target_path",
"type": null
},
{
"param": "base_path",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "target_path",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "base_path",
"type": null,
"docstring": null,
"docstrin... |
038fc5ed2d51d4bb45677ed3e85478a7e7e1ff00 | sunlongbo/chromium | tools/code_coverage/coverage_utils.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | GetSharedLibraries | <not_specific> | def GetSharedLibraries(binary_paths, build_dir, otool_path):
"""Returns list of shared libraries used by specified binaries."""
logging.info('Finding shared libraries for targets (if any).')
shared_libraries = []
cmd = []
shared_library_re = None
if sys.platform.startswith('linux'):
cmd.extend(['ldd'])... | Returns list of shared libraries used by specified binaries. | Returns list of shared libraries used by specified binaries. | [
"Returns",
"list",
"of",
"shared",
"libraries",
"used",
"by",
"specified",
"binaries",
"."
] | def GetSharedLibraries(binary_paths, build_dir, otool_path):
logging.info('Finding shared libraries for targets (if any).')
shared_libraries = []
cmd = []
shared_library_re = None
if sys.platform.startswith('linux'):
cmd.extend(['ldd'])
shared_library_re = re.compile(r'.*\.so[.0-9]*\s=>\s(.*' + build_... | [
"def",
"GetSharedLibraries",
"(",
"binary_paths",
",",
"build_dir",
",",
"otool_path",
")",
":",
"logging",
".",
"info",
"(",
"'Finding shared libraries for targets (if any).'",
")",
"shared_libraries",
"=",
"[",
"]",
"cmd",
"=",
"[",
"]",
"shared_library_re",
"=",
... | Returns list of shared libraries used by specified binaries. | [
"Returns",
"list",
"of",
"shared",
"libraries",
"used",
"by",
"specified",
"binaries",
"."
] | [
"\"\"\"Returns list of shared libraries used by specified binaries.\"\"\"",
"# otool outputs \"@rpath\" macro instead of the dirname of the given binary.",
"# Do not add non-instrumented libraries. Otherwise, llvm-cov errors outs."
] | [
{
"param": "binary_paths",
"type": null
},
{
"param": "build_dir",
"type": null
},
{
"param": "otool_path",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "binary_paths",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "build_dir",
"type": null,
"docstring": null,
"docstri... |
038fc5ed2d51d4bb45677ed3e85478a7e7e1ff00 | sunlongbo/chromium | tools/code_coverage/coverage_utils.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | WriteRedirectHtmlFile | null | def WriteRedirectHtmlFile(from_html_path, to_html_path):
"""Writes a html file that redirects to another html file."""
to_html_relative_path = GetRelativePathToDirectoryOfFile(
to_html_path, from_html_path)
content = ("""
<!DOCTYPE html>
<html>
<head>
<!-- HTML meta refresh URL redirec... | Writes a html file that redirects to another html file. | Writes a html file that redirects to another html file. | [
"Writes",
"a",
"html",
"file",
"that",
"redirects",
"to",
"another",
"html",
"file",
"."
] | def WriteRedirectHtmlFile(from_html_path, to_html_path):
to_html_relative_path = GetRelativePathToDirectoryOfFile(
to_html_path, from_html_path)
content = ("""
<!DOCTYPE html>
<html>
<head>
<!-- HTML meta refresh URL redirection -->
<meta http-equiv="refresh" content="0; url=%s">... | [
"def",
"WriteRedirectHtmlFile",
"(",
"from_html_path",
",",
"to_html_path",
")",
":",
"to_html_relative_path",
"=",
"GetRelativePathToDirectoryOfFile",
"(",
"to_html_path",
",",
"from_html_path",
")",
"content",
"=",
"(",
"\"\"\"\n <!DOCTYPE html>\n <html>\n <head>\n... | Writes a html file that redirects to another html file. | [
"Writes",
"a",
"html",
"file",
"that",
"redirects",
"to",
"another",
"html",
"file",
"."
] | [
"\"\"\"Writes a html file that redirects to another html file.\"\"\""
] | [
{
"param": "from_html_path",
"type": null
},
{
"param": "to_html_path",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "from_html_path",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "to_html_path",
"type": null,
"docstring": null,
"do... |
a5a61f9d404e76504f80e491b9768bfd5df31393 | sunlongbo/chromium | components/policy/tools/template_writers/writers/ios_app_config_writer.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | _ParseSchemaTypeValueToString | <not_specific> | def _ParseSchemaTypeValueToString(value, type):
'''Parses the value of a given JSON schema type to a string.
'''
if type not in _JSON_SCHEMA_TYPES:
raise Error('schema type "{}" not supported'.format(type))
if type == 'integer':
return '{0:d}'.format(value)
# Use the default string parser.
return ... | Parses the value of a given JSON schema type to a string.
| Parses the value of a given JSON schema type to a string. | [
"Parses",
"the",
"value",
"of",
"a",
"given",
"JSON",
"schema",
"type",
"to",
"a",
"string",
"."
] | def _ParseSchemaTypeValueToString(value, type):
if type not in _JSON_SCHEMA_TYPES:
raise Error('schema type "{}" not supported'.format(type))
if type == 'integer':
return '{0:d}'.format(value)
return str(value) | [
"def",
"_ParseSchemaTypeValueToString",
"(",
"value",
",",
"type",
")",
":",
"if",
"type",
"not",
"in",
"_JSON_SCHEMA_TYPES",
":",
"raise",
"Error",
"(",
"'schema type \"{}\" not supported'",
".",
"format",
"(",
"type",
")",
")",
"if",
"type",
"==",
"'integer'",... | Parses the value of a given JSON schema type to a string. | [
"Parses",
"the",
"value",
"of",
"a",
"given",
"JSON",
"schema",
"type",
"to",
"a",
"string",
"."
] | [
"'''Parses the value of a given JSON schema type to a string.\n '''",
"# Use the default string parser."
] | [
{
"param": "value",
"type": null
},
{
"param": "type",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "value",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "type",
"type": null,
"docstring": null,
"docstring_tokens": ... |
a5b948728080fdc5fa2b0a7340876221bfccb1ca | sunlongbo/chromium | third_party/blink/renderer/bindings/scripts/web_idl/make_copy.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | make_copy | <not_specific> | def make_copy(obj, memo=None):
"""
Creates a copy of the given object, which should be an IR or part of IR.
The copy is created basically as a deep copy of the object, but |make_copy|
method is used to create a (part of) copy if the object (or part of it) has
the method. |memo| argument behaves as... |
Creates a copy of the given object, which should be an IR or part of IR.
The copy is created basically as a deep copy of the object, but |make_copy|
method is used to create a (part of) copy if the object (or part of it) has
the method. |memo| argument behaves as the same as |deepcopy|.
| Creates a copy of the given object, which should be an IR or part of IR.
The copy is created basically as a deep copy of the object, but |make_copy|
method is used to create a (part of) copy if the object (or part of it) has
the method. |memo| argument behaves as the same as |deepcopy|. | [
"Creates",
"a",
"copy",
"of",
"the",
"given",
"object",
"which",
"should",
"be",
"an",
"IR",
"or",
"part",
"of",
"IR",
".",
"The",
"copy",
"is",
"created",
"basically",
"as",
"a",
"deep",
"copy",
"of",
"the",
"object",
"but",
"|make_copy|",
"method",
"... | def make_copy(obj, memo=None):
if memo is None:
memo = dict()
if (obj is None
or isinstance(obj, (bool, int, long, float, complex, basestring))):
Memoization is tricky in case that both of Identifier('x') and
Component('x') exist. We could memoize them as
|memo[(t... | [
"def",
"make_copy",
"(",
"obj",
",",
"memo",
"=",
"None",
")",
":",
"if",
"memo",
"is",
"None",
":",
"memo",
"=",
"dict",
"(",
")",
"if",
"(",
"obj",
"is",
"None",
"or",
"isinstance",
"(",
"obj",
",",
"(",
"bool",
",",
"int",
",",
"long",
",",
... | Creates a copy of the given object, which should be an IR or part of IR. | [
"Creates",
"a",
"copy",
"of",
"the",
"given",
"object",
"which",
"should",
"be",
"an",
"IR",
"or",
"part",
"of",
"IR",
"."
] | [
"\"\"\"\n Creates a copy of the given object, which should be an IR or part of IR.\n\n The copy is created basically as a deep copy of the object, but |make_copy|\n method is used to create a (part of) copy if the object (or part of it) has\n the method. |memo| argument behaves as the same as |deepcopy... | [
{
"param": "obj",
"type": null
},
{
"param": "memo",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "obj",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "memo",
"type": null,
"docstring": null,
"docstring_tokens": []... |
a5d3c40ca91d0d779e38baf278d51b9b38df09e0 | sunlongbo/chromium | chrome/installer/mac/signing/model.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | requirements_string | <not_specific> | def requirements_string(self, config):
"""Produces a full requirements string for the product.
Args:
config: A |config.CodeSignConfig| object.
Returns:
A string for designated requirements of the product, which can be
passed to `codesign --requirements`.
... | Produces a full requirements string for the product.
Args:
config: A |config.CodeSignConfig| object.
Returns:
A string for designated requirements of the product, which can be
passed to `codesign --requirements`.
| Produces a full requirements string for the product. | [
"Produces",
"a",
"full",
"requirements",
"string",
"for",
"the",
"product",
"."
] | def requirements_string(self, config):
if config.identity == '-':
return ''
reqs = []
if self.identifier_requirement:
reqs.append('designated => identifier "{identifier}"'.format(
identifier=self.identifier))
if self.requirements:
reqs.... | [
"def",
"requirements_string",
"(",
"self",
",",
"config",
")",
":",
"if",
"config",
".",
"identity",
"==",
"'-'",
":",
"return",
"''",
"reqs",
"=",
"[",
"]",
"if",
"self",
".",
"identifier_requirement",
":",
"reqs",
".",
"append",
"(",
"'designated => iden... | Produces a full requirements string for the product. | [
"Produces",
"a",
"full",
"requirements",
"string",
"for",
"the",
"product",
"."
] | [
"\"\"\"Produces a full requirements string for the product.\n\n Args:\n config: A |config.CodeSignConfig| object.\n\n Returns:\n A string for designated requirements of the product, which can be\n passed to `codesign --requirements`.\n \"\"\"",
"# If the signi... | [
{
"param": "self",
"type": null
},
{
"param": "config",
"type": null
}
] | {
"returns": [
{
"docstring": "A string for designated requirements of the product, which can be\npassed to `codesign --requirements`.",
"docstring_tokens": [
"A",
"string",
"for",
"designated",
"requirements",
"of",
"the",
"product",
... |
a5d3c40ca91d0d779e38baf278d51b9b38df09e0 | sunlongbo/chromium | chrome/installer/mac/signing/model.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | make_enum | <not_specific> | def make_enum(class_name, options):
"""Makes a new class type for an enum.
Args:
class_name: Name of the new type to make.
options: A dictionary of enum options to use. The keys will become
attributes on the class, and the values will be wrapped in a tuple
so that the op... | Makes a new class type for an enum.
Args:
class_name: Name of the new type to make.
options: A dictionary of enum options to use. The keys will become
attributes on the class, and the values will be wrapped in a tuple
so that the options can be joined together.
Returns:... | Makes a new class type for an enum. | [
"Makes",
"a",
"new",
"class",
"type",
"for",
"an",
"enum",
"."
] | def make_enum(class_name, options):
attrs = {}
@classmethod
def valid(cls, opts_to_check):
if opts_to_check is None:
return True
valid_values = options.values()
return all([option in valid_values for option in opts_to_check])
attrs['valid'] = valid
for name, value... | [
"def",
"make_enum",
"(",
"class_name",
",",
"options",
")",
":",
"attrs",
"=",
"{",
"}",
"@",
"classmethod",
"def",
"valid",
"(",
"cls",
",",
"opts_to_check",
")",
":",
"\"\"\"Tests if the specified |opts_to_check| are valid.\n\n Args:\n options: Iterabl... | Makes a new class type for an enum. | [
"Makes",
"a",
"new",
"class",
"type",
"for",
"an",
"enum",
"."
] | [
"\"\"\"Makes a new class type for an enum.\n\n Args:\n class_name: Name of the new type to make.\n options: A dictionary of enum options to use. The keys will become\n attributes on the class, and the values will be wrapped in a tuple\n so that the options can be joined togeth... | [
{
"param": "class_name",
"type": null
},
{
"param": "options",
"type": null
}
] | {
"returns": [
{
"docstring": "A new class for the enum.",
"docstring_tokens": [
"A",
"new",
"class",
"for",
"the",
"enum",
"."
],
"type": null
}
],
"raises": [],
"params": [
{
"identifier": "class_name",
"ty... |
a5d3c40ca91d0d779e38baf278d51b9b38df09e0 | sunlongbo/chromium | chrome/installer/mac/signing/model.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | brandless_copy | <not_specific> | def brandless_copy(self):
"""Derives and returns a copy of this Distribution object, identical
except for not having a branding code.
This is useful in the case where a non-branded app bundle needs to be
created with otherwise the same configuration.
"""
return Distribut... | Derives and returns a copy of this Distribution object, identical
except for not having a branding code.
This is useful in the case where a non-branded app bundle needs to be
created with otherwise the same configuration.
| Derives and returns a copy of this Distribution object, identical
except for not having a branding code.
This is useful in the case where a non-branded app bundle needs to be
created with otherwise the same configuration. | [
"Derives",
"and",
"returns",
"a",
"copy",
"of",
"this",
"Distribution",
"object",
"identical",
"except",
"for",
"not",
"having",
"a",
"branding",
"code",
".",
"This",
"is",
"useful",
"in",
"the",
"case",
"where",
"a",
"non",
"-",
"branded",
"app",
"bundle"... | def brandless_copy(self):
return Distribution(self.channel, None, self.app_name_fragment,
self.packaging_name_fragment, self.product_dirname,
self.creator_code, self.channel_customize,
self.package_as_dmg, self.package_as_pkg) | [
"def",
"brandless_copy",
"(",
"self",
")",
":",
"return",
"Distribution",
"(",
"self",
".",
"channel",
",",
"None",
",",
"self",
".",
"app_name_fragment",
",",
"self",
".",
"packaging_name_fragment",
",",
"self",
".",
"product_dirname",
",",
"self",
".",
"cr... | Derives and returns a copy of this Distribution object, identical
except for not having a branding code. | [
"Derives",
"and",
"returns",
"a",
"copy",
"of",
"this",
"Distribution",
"object",
"identical",
"except",
"for",
"not",
"having",
"a",
"branding",
"code",
"."
] | [
"\"\"\"Derives and returns a copy of this Distribution object, identical\n except for not having a branding code.\n\n This is useful in the case where a non-branded app bundle needs to be\n created with otherwise the same configuration.\n \"\"\""
] | [
{
"param": "self",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
a5d3c40ca91d0d779e38baf278d51b9b38df09e0 | sunlongbo/chromium | chrome/installer/mac/signing/model.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | to_config | <not_specific> | def to_config(self, base_config):
"""Produces a derived |config.CodeSignConfig| for the Distribution.
Args:
base_config: The base CodeSignConfig to derive.
Returns:
A new CodeSignConfig instance that uses information in the
Distribution to alter various prop... | Produces a derived |config.CodeSignConfig| for the Distribution.
Args:
base_config: The base CodeSignConfig to derive.
Returns:
A new CodeSignConfig instance that uses information in the
Distribution to alter various properties of the |base_config|.
| Produces a derived |config.CodeSignConfig| for the Distribution. | [
"Produces",
"a",
"derived",
"|config",
".",
"CodeSignConfig|",
"for",
"the",
"Distribution",
"."
] | def to_config(self, base_config):
this = self
class DistributionCodeSignConfig(base_config.__class__):
@property
def base_config(self):
return base_config
@property
def distribution(self):
return this
@property
... | [
"def",
"to_config",
"(",
"self",
",",
"base_config",
")",
":",
"this",
"=",
"self",
"class",
"DistributionCodeSignConfig",
"(",
"base_config",
".",
"__class__",
")",
":",
"@",
"property",
"def",
"base_config",
"(",
"self",
")",
":",
"return",
"base_config",
... | Produces a derived |config.CodeSignConfig| for the Distribution. | [
"Produces",
"a",
"derived",
"|config",
".",
"CodeSignConfig|",
"for",
"the",
"Distribution",
"."
] | [
"\"\"\"Produces a derived |config.CodeSignConfig| for the Distribution.\n\n Args:\n base_config: The base CodeSignConfig to derive.\n\n Returns:\n A new CodeSignConfig instance that uses information in the\n Distribution to alter various properties of the |base_config|... | [
{
"param": "self",
"type": null
},
{
"param": "base_config",
"type": null
}
] | {
"returns": [
{
"docstring": "A new CodeSignConfig instance that uses information in the\nDistribution to alter various properties of the |base_config|.",
"docstring_tokens": [
"A",
"new",
"CodeSignConfig",
"instance",
"that",
"uses",
"informati... |
a5d3c40ca91d0d779e38baf278d51b9b38df09e0 | sunlongbo/chromium | chrome/installer/mac/signing/model.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | packaging_dir | <not_specific> | def packaging_dir(self, config):
"""Returns the path to the product packaging directory, which contains
scripts and assets used in signing.
Args:
config: The |config.CodeSignConfig| object.
Returns:
Path to the packaging directory.
"""
return os.... | Returns the path to the product packaging directory, which contains
scripts and assets used in signing.
Args:
config: The |config.CodeSignConfig| object.
Returns:
Path to the packaging directory.
| Returns the path to the product packaging directory, which contains
scripts and assets used in signing. | [
"Returns",
"the",
"path",
"to",
"the",
"product",
"packaging",
"directory",
"which",
"contains",
"scripts",
"and",
"assets",
"used",
"in",
"signing",
"."
] | def packaging_dir(self, config):
return os.path.join(self.input, '{} Packaging'.format(config.product)) | [
"def",
"packaging_dir",
"(",
"self",
",",
"config",
")",
":",
"return",
"os",
".",
"path",
".",
"join",
"(",
"self",
".",
"input",
",",
"'{} Packaging'",
".",
"format",
"(",
"config",
".",
"product",
")",
")"
] | Returns the path to the product packaging directory, which contains
scripts and assets used in signing. | [
"Returns",
"the",
"path",
"to",
"the",
"product",
"packaging",
"directory",
"which",
"contains",
"scripts",
"and",
"assets",
"used",
"in",
"signing",
"."
] | [
"\"\"\"Returns the path to the product packaging directory, which contains\n scripts and assets used in signing.\n\n Args:\n config: The |config.CodeSignConfig| object.\n\n Returns:\n Path to the packaging directory.\n \"\"\""
] | [
{
"param": "self",
"type": null
},
{
"param": "config",
"type": null
}
] | {
"returns": [
{
"docstring": "Path to the packaging directory.",
"docstring_tokens": [
"Path",
"to",
"the",
"packaging",
"directory",
"."
],
"type": null
}
],
"raises": [],
"params": [
{
"identifier": "self",
"type"... |
ecb33e12e384a5fffe46e49ea08c999047c32559 | sunlongbo/chromium | third_party/blink/tools/blinkpy/style/checkers/common_unittest.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | _mock_style_error_handler | null | def _mock_style_error_handler(self, line_number, category, confidence,
message):
"""Append the error information to the list of style errors."""
error = (line_number, category, confidence, message)
self._style_errors.append(error) | Append the error information to the list of style errors. | Append the error information to the list of style errors. | [
"Append",
"the",
"error",
"information",
"to",
"the",
"list",
"of",
"style",
"errors",
"."
] | def _mock_style_error_handler(self, line_number, category, confidence,
message):
error = (line_number, category, confidence, message)
self._style_errors.append(error) | [
"def",
"_mock_style_error_handler",
"(",
"self",
",",
"line_number",
",",
"category",
",",
"confidence",
",",
"message",
")",
":",
"error",
"=",
"(",
"line_number",
",",
"category",
",",
"confidence",
",",
"message",
")",
"self",
".",
"_style_errors",
".",
"... | Append the error information to the list of style errors. | [
"Append",
"the",
"error",
"information",
"to",
"the",
"list",
"of",
"style",
"errors",
"."
] | [
"\"\"\"Append the error information to the list of style errors.\"\"\""
] | [
{
"param": "self",
"type": null
},
{
"param": "line_number",
"type": null
},
{
"param": "category",
"type": null
},
{
"param": "confidence",
"type": null
},
{
"param": "message",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "line_number",
"type": null,
"docstring": null,
"docstring_tok... |
ecb33e12e384a5fffe46e49ea08c999047c32559 | sunlongbo/chromium | third_party/blink/tools/blinkpy/style/checkers/common_unittest.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | assert_carriage_return | null | def assert_carriage_return(self, input_lines, expected_lines, error_lines):
"""Process the given line and assert that the result is correct."""
handle_style_error = self._mock_style_error_handler
checker = CarriageReturnChecker(handle_style_error)
output_lines = checker.check(input_line... | Process the given line and assert that the result is correct. | Process the given line and assert that the result is correct. | [
"Process",
"the",
"given",
"line",
"and",
"assert",
"that",
"the",
"result",
"is",
"correct",
"."
] | def assert_carriage_return(self, input_lines, expected_lines, error_lines):
handle_style_error = self._mock_style_error_handler
checker = CarriageReturnChecker(handle_style_error)
output_lines = checker.check(input_lines)
self.assertEqual(output_lines, expected_lines)
expected_er... | [
"def",
"assert_carriage_return",
"(",
"self",
",",
"input_lines",
",",
"expected_lines",
",",
"error_lines",
")",
":",
"handle_style_error",
"=",
"self",
".",
"_mock_style_error_handler",
"checker",
"=",
"CarriageReturnChecker",
"(",
"handle_style_error",
")",
"output_l... | Process the given line and assert that the result is correct. | [
"Process",
"the",
"given",
"line",
"and",
"assert",
"that",
"the",
"result",
"is",
"correct",
"."
] | [
"\"\"\"Process the given line and assert that the result is correct.\"\"\"",
"# Check both the return value and error messages."
] | [
{
"param": "self",
"type": null
},
{
"param": "input_lines",
"type": null
},
{
"param": "expected_lines",
"type": null
},
{
"param": "error_lines",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "input_lines",
"type": null,
"docstring": null,
"docstring_tok... |
ecb33e12e384a5fffe46e49ea08c999047c32559 | sunlongbo/chromium | third_party/blink/tools/blinkpy/style/checkers/common_unittest.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | assert_tab | null | def assert_tab(self, input_lines, error_lines):
"""Assert when the given lines contain tabs."""
self._error_lines = []
def style_error_handler(line_number, category, confidence, message):
self.assertEqual(category, 'whitespace/tab')
self.assertEqual(confidence, 5)
... | Assert when the given lines contain tabs. | Assert when the given lines contain tabs. | [
"Assert",
"when",
"the",
"given",
"lines",
"contain",
"tabs",
"."
] | def assert_tab(self, input_lines, error_lines):
self._error_lines = []
def style_error_handler(line_number, category, confidence, message):
self.assertEqual(category, 'whitespace/tab')
self.assertEqual(confidence, 5)
self.assertEqual(message, 'Line contains tab charac... | [
"def",
"assert_tab",
"(",
"self",
",",
"input_lines",
",",
"error_lines",
")",
":",
"self",
".",
"_error_lines",
"=",
"[",
"]",
"def",
"style_error_handler",
"(",
"line_number",
",",
"category",
",",
"confidence",
",",
"message",
")",
":",
"self",
".",
"as... | Assert when the given lines contain tabs. | [
"Assert",
"when",
"the",
"given",
"lines",
"contain",
"tabs",
"."
] | [
"\"\"\"Assert when the given lines contain tabs.\"\"\""
] | [
{
"param": "self",
"type": null
},
{
"param": "input_lines",
"type": null
},
{
"param": "error_lines",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "input_lines",
"type": null,
"docstring": null,
"docstring_tok... |
4988c24f10cc81347d9e06bb2b152e970cdfc455 | sunlongbo/chromium | ppapi/c/documentation/doxy_cleanup.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | FixTableHeadings | null | def FixTableHeadings(self):
'''Fixes the doxygen table headings.
This includes:
- Using bare <h2> title row instead of row embedded in <tr><td> in table
- Putting the "name" attribute into the "id" attribute of the <tr> tag.
- Splitting up tables into multiple separate tables if a table
... | Fixes the doxygen table headings.
This includes:
- Using bare <h2> title row instead of row embedded in <tr><td> in table
- Putting the "name" attribute into the "id" attribute of the <tr> tag.
- Splitting up tables into multiple separate tables if a table
heading appears in the middle of... | Fixes the doxygen table headings.
This includes:
Using bare title row instead of row embedded in in table
Putting the "name" attribute into the "id" attribute of the tag.
Splitting up tables into multiple separate tables if a table
heading appears in the middle of a table.
For example, this html:
Data Fields List... | [
"Fixes",
"the",
"doxygen",
"table",
"headings",
".",
"This",
"includes",
":",
"Using",
"bare",
"title",
"row",
"instead",
"of",
"row",
"embedded",
"in",
"in",
"table",
"Putting",
"the",
"\"",
"name",
"\"",
"attribute",
"into",
"the",
"\"",
"id",
"\"",
"a... | def FixTableHeadings(self):
table_headers = []
for tag in self.soup.findAll('tr'):
if tag.td and tag.td.h2 and tag.td.h2.a and tag.td.h2.a['name']:
tag.string = tag.td.h2.a.next
tag.name = 'h2'
table_headers.append(tag)
table_headers.reverse()
for tag in table_headers:
... | [
"def",
"FixTableHeadings",
"(",
"self",
")",
":",
"table_headers",
"=",
"[",
"]",
"for",
"tag",
"in",
"self",
".",
"soup",
".",
"findAll",
"(",
"'tr'",
")",
":",
"if",
"tag",
".",
"td",
"and",
"tag",
".",
"td",
".",
"h2",
"and",
"tag",
".",
"td",... | Fixes the doxygen table headings. | [
"Fixes",
"the",
"doxygen",
"table",
"headings",
"."
] | [
"'''Fixes the doxygen table headings.\n\n This includes:\n - Using bare <h2> title row instead of row embedded in <tr><td> in table\n - Putting the \"name\" attribute into the \"id\" attribute of the <tr> tag.\n - Splitting up tables into multiple separate tables if a table\n heading appear... | [
{
"param": "self",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
4988c24f10cc81347d9e06bb2b152e970cdfc455 | sunlongbo/chromium | ppapi/c/documentation/doxy_cleanup.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | main | <not_specific> | def main():
'''Main entry for the doxy_cleanup utility
doxy_cleanup takes a list of html files and modifies them in place.'''
parser = optparse.OptionParser(usage='Usage: %prog [options] files...')
parser.add_option('-m', '--move', dest='move', action='store_true',
default=False, help='mo... | Main entry for the doxy_cleanup utility
doxy_cleanup takes a list of html files and modifies them in place. | Main entry for the doxy_cleanup utility
doxy_cleanup takes a list of html files and modifies them in place. | [
"Main",
"entry",
"for",
"the",
"doxy_cleanup",
"utility",
"doxy_cleanup",
"takes",
"a",
"list",
"of",
"html",
"files",
"and",
"modifies",
"them",
"in",
"place",
"."
] | def main():
parser = optparse.OptionParser(usage='Usage: %prog [options] files...')
parser.add_option('-m', '--move', dest='move', action='store_true',
default=False, help='move html files to "original_html"')
options, files = parser.parse_args()
if not files:
parser.print_usage()
re... | [
"def",
"main",
"(",
")",
":",
"parser",
"=",
"optparse",
".",
"OptionParser",
"(",
"usage",
"=",
"'Usage: %prog [options] files...'",
")",
"parser",
".",
"add_option",
"(",
"'-m'",
",",
"'--move'",
",",
"dest",
"=",
"'move'",
",",
"action",
"=",
"'store_true... | Main entry for the doxy_cleanup utility
doxy_cleanup takes a list of html files and modifies them in place. | [
"Main",
"entry",
"for",
"the",
"doxy_cleanup",
"utility",
"doxy_cleanup",
"takes",
"a",
"list",
"of",
"html",
"files",
"and",
"modifies",
"them",
"in",
"place",
"."
] | [
"'''Main entry for the doxy_cleanup utility\n\n doxy_cleanup takes a list of html files and modifies them in place.'''"
] | [] | {
"returns": [],
"raises": [],
"params": [],
"outlier_params": [],
"others": []
} |
26cc978c120b9fa1aaf14f3c2335f5db74cea605 | sunlongbo/chromium | build/fuchsia/net_test_server.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | SetupTestServer | <not_specific> | def SetupTestServer(target, test_concurrency, for_package, for_realms=[]):
"""Provisions a forwarding test server and configures |target| to use it.
Returns a Popen object for the test server process."""
logging.debug('Starting test server.')
# The TestLauncher can launch more jobs than the limit specified wi... | Provisions a forwarding test server and configures |target| to use it.
Returns a Popen object for the test server process. | Provisions a forwarding test server and configures |target| to use it.
Returns a Popen object for the test server process. | [
"Provisions",
"a",
"forwarding",
"test",
"server",
"and",
"configures",
"|target|",
"to",
"use",
"it",
".",
"Returns",
"a",
"Popen",
"object",
"for",
"the",
"test",
"server",
"process",
"."
] | def SetupTestServer(target, test_concurrency, for_package, for_realms=[]):
logging.debug('Starting test server.')
spawning_server = chrome_test_server_spawner.SpawningServer(
0, SSHPortForwarder(target), test_concurrency * 2)
forwarded_port = common.ConnectPortForwardingTask(
target, spawning_server.s... | [
"def",
"SetupTestServer",
"(",
"target",
",",
"test_concurrency",
",",
"for_package",
",",
"for_realms",
"=",
"[",
"]",
")",
":",
"logging",
".",
"debug",
"(",
"'Starting test server.'",
")",
"spawning_server",
"=",
"chrome_test_server_spawner",
".",
"SpawningServer... | Provisions a forwarding test server and configures |target| to use it. | [
"Provisions",
"a",
"forwarding",
"test",
"server",
"and",
"configures",
"|target|",
"to",
"use",
"it",
"."
] | [
"\"\"\"Provisions a forwarding test server and configures |target| to use it.\n\n Returns a Popen object for the test server process.\"\"\"",
"# The TestLauncher can launch more jobs than the limit specified with",
"# --test-launcher-jobs so the max number of spawned test servers is set to",
"# twice that li... | [
{
"param": "target",
"type": null
},
{
"param": "test_concurrency",
"type": null
},
{
"param": "for_package",
"type": null
},
{
"param": "for_realms",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "target",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "test_concurrency",
"type": null,
"docstring": null,
"docstr... |
55aa0c9734df47923032943eb11eff75aaa893a2 | sunlongbo/chromium | third_party/tflite_support/src/tensorflow_lite_support/custom_ops/python/sentencepiece_tokenizer.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | detokenize | <not_specific> | def detokenize(self, input): # pylint: disable=redefined-builtin
"""Detokenizes tokens into preprocessed text.
Args:
input: A `RaggedTensor` or `Tensor` with int32 encoded text with rank >=
1.
Returns:
A N-1 dimensional string Tensor or RaggedTensor of the detokenized text.
"""
... | Detokenizes tokens into preprocessed text.
Args:
input: A `RaggedTensor` or `Tensor` with int32 encoded text with rank >=
1.
Returns:
A N-1 dimensional string Tensor or RaggedTensor of the detokenized text.
| Detokenizes tokens into preprocessed text. | [
"Detokenizes",
"tokens",
"into",
"preprocessed",
"text",
"."
] | def detokenize(self, input):
input_tensor = ragged_tensor.convert_to_tensor_or_ragged_tensor(input)
if input_tensor.shape.ndims is None:
raise ValueError("Rank of input_tensor must be statically known.")
if input_tensor.shape.ndims == 0:
raise ValueError("Rank of input_tensor must be at least ... | [
"def",
"detokenize",
"(",
"self",
",",
"input",
")",
":",
"input_tensor",
"=",
"ragged_tensor",
".",
"convert_to_tensor_or_ragged_tensor",
"(",
"input",
")",
"if",
"input_tensor",
".",
"shape",
".",
"ndims",
"is",
"None",
":",
"raise",
"ValueError",
"(",
"\"Ra... | Detokenizes tokens into preprocessed text. | [
"Detokenizes",
"tokens",
"into",
"preprocessed",
"text",
"."
] | [
"# pylint: disable=redefined-builtin",
"\"\"\"Detokenizes tokens into preprocessed text.\n\n Args:\n input: A `RaggedTensor` or `Tensor` with int32 encoded text with rank >=\n 1.\n\n Returns:\n A N-1 dimensional string Tensor or RaggedTensor of the detokenized text.\n \"\"\"",
"# If th... | [
{
"param": "self",
"type": null
},
{
"param": "input",
"type": null
}
] | {
"returns": [
{
"docstring": "A N-1 dimensional string Tensor or RaggedTensor of the detokenized text.",
"docstring_tokens": [
"A",
"N",
"-",
"1",
"dimensional",
"string",
"Tensor",
"or",
"RaggedTensor",
"of",
"th... |
d5a91c40b02a3b602a569257486fafb1db3e9836 | sunlongbo/chromium | chrome/updater/test/service/win/service_client.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | ParseCommandLine | <not_specific> | def ParseCommandLine():
"""Parse the command line arguments."""
cmd_parser = argparse.ArgumentParser(
description='Updater test service client')
cmd_parser.add_argument(
'--function',
dest='function',
type=str,
help='Name of the function to call, defined in rpc_client.py')
cmd_par... | Parse the command line arguments. | Parse the command line arguments. | [
"Parse",
"the",
"command",
"line",
"arguments",
"."
] | def ParseCommandLine():
cmd_parser = argparse.ArgumentParser(
description='Updater test service client')
cmd_parser.add_argument(
'--function',
dest='function',
type=str,
help='Name of the function to call, defined in rpc_client.py')
cmd_parser.add_argument(
'--args',
des... | [
"def",
"ParseCommandLine",
"(",
")",
":",
"cmd_parser",
"=",
"argparse",
".",
"ArgumentParser",
"(",
"description",
"=",
"'Updater test service client'",
")",
"cmd_parser",
".",
"add_argument",
"(",
"'--function'",
",",
"dest",
"=",
"'function'",
",",
"type",
"=",... | Parse the command line arguments. | [
"Parse",
"the",
"command",
"line",
"arguments",
"."
] | [
"\"\"\"Parse the command line arguments.\"\"\""
] | [] | {
"returns": [],
"raises": [],
"params": [],
"outlier_params": [],
"others": []
} |
d5d3ff643c4c9c4baad11d8897acaa4a0a954f08 | sunlongbo/chromium | tools/binary_size/libsupersize/function_signature.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | _FindParameterListParen | <not_specific> | def _FindParameterListParen(name):
"""Finds index of the "(" that denotes the start of a parameter list."""
# This loops from left-to-right, but the only reason (I think) that this
# is necessary (rather than reusing _FindLastCharOutsideOfBrackets), is
# to capture the outer-most function in the case where clas... | Finds index of the "(" that denotes the start of a parameter list. | Finds index of the "(" that denotes the start of a parameter list. | [
"Finds",
"index",
"of",
"the",
"\"",
"(",
"\"",
"that",
"denotes",
"the",
"start",
"of",
"a",
"parameter",
"list",
"."
] | def _FindParameterListParen(name):
start_idx = 0
template_balance_count = 0
paren_balance_count = 0
while True:
idx = name.find('(', start_idx)
if idx == -1:
return -1
template_balance_count += (
name.count('<', start_idx, idx) - name.count('>', start_idx, idx))
operator_idx = name... | [
"def",
"_FindParameterListParen",
"(",
"name",
")",
":",
"start_idx",
"=",
"0",
"template_balance_count",
"=",
"0",
"paren_balance_count",
"=",
"0",
"while",
"True",
":",
"idx",
"=",
"name",
".",
"find",
"(",
"'('",
",",
"start_idx",
")",
"if",
"idx",
"=="... | Finds index of the "(" that denotes the start of a parameter list. | [
"Finds",
"index",
"of",
"the",
"\"",
"(",
"\"",
"that",
"denotes",
"the",
"start",
"of",
"a",
"parameter",
"list",
"."
] | [
"\"\"\"Finds index of the \"(\" that denotes the start of a parameter list.\"\"\"",
"# This loops from left-to-right, but the only reason (I think) that this",
"# is necessary (rather than reusing _FindLastCharOutsideOfBrackets), is",
"# to capture the outer-most function in the case where classes are nested.... | [
{
"param": "name",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "name",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
d5d3ff643c4c9c4baad11d8897acaa4a0a954f08 | sunlongbo/chromium | tools/binary_size/libsupersize/function_signature.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | _FindReturnValueSpace | <not_specific> | def _FindReturnValueSpace(name, paren_idx):
"""Returns the index of the space that comes after the return type."""
space_idx = paren_idx
# Special case: const cast operators (see tests).
if -1 != name.find(' const', paren_idx - 6, paren_idx):
space_idx = paren_idx - 6
while True:
space_idx = _FindLast... | Returns the index of the space that comes after the return type. | Returns the index of the space that comes after the return type. | [
"Returns",
"the",
"index",
"of",
"the",
"space",
"that",
"comes",
"after",
"the",
"return",
"type",
"."
] | def _FindReturnValueSpace(name, paren_idx):
space_idx = paren_idx
if -1 != name.find(' const', paren_idx - 6, paren_idx):
space_idx = paren_idx - 6
while True:
space_idx = _FindLastCharOutsideOfBrackets(name, ' ', space_idx)
if -1 == space_idx:
break
if -1 != name.find('operator', space_idx ... | [
"def",
"_FindReturnValueSpace",
"(",
"name",
",",
"paren_idx",
")",
":",
"space_idx",
"=",
"paren_idx",
"if",
"-",
"1",
"!=",
"name",
".",
"find",
"(",
"' const'",
",",
"paren_idx",
"-",
"6",
",",
"paren_idx",
")",
":",
"space_idx",
"=",
"paren_idx",
"-"... | Returns the index of the space that comes after the return type. | [
"Returns",
"the",
"index",
"of",
"the",
"space",
"that",
"comes",
"after",
"the",
"return",
"type",
"."
] | [
"\"\"\"Returns the index of the space that comes after the return type.\"\"\"",
"# Special case: const cast operators (see tests).",
"# Special cases: \"operator new\", \"operator< <templ>\", \"operator<< <tmpl>\".",
"# No space is added for operator>><tmpl>."
] | [
{
"param": "name",
"type": null
},
{
"param": "paren_idx",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "name",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "paren_idx",
"type": null,
"docstring": null,
"docstring_token... |
d5d3ff643c4c9c4baad11d8897acaa4a0a954f08 | sunlongbo/chromium | tools/binary_size/libsupersize/function_signature.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | ParseJava | <not_specific> | def ParseJava(full_name):
"""Breaks java full_name into parts.
See unit tests for example signatures.
Returns:
A tuple of (full_name, template_name, name), where:
* full_name = "class_with_package#member(args): type"
* template_name = "class_with_package#member"
* name = "class_without_pac... | Breaks java full_name into parts.
See unit tests for example signatures.
Returns:
A tuple of (full_name, template_name, name), where:
* full_name = "class_with_package#member(args): type"
* template_name = "class_with_package#member"
* name = "class_without_package#member
When a symbols... | Breaks java full_name into parts.
See unit tests for example signatures. | [
"Breaks",
"java",
"full_name",
"into",
"parts",
".",
"See",
"unit",
"tests",
"for",
"example",
"signatures",
"."
] | def ParseJava(full_name):
hash_idx = full_name.find('#')
if hash_idx != -1:
full_new_class_name = full_name[:hash_idx]
colon_idx = full_name.find(':')
if colon_idx == -1:
member = full_name[hash_idx + 1:]
member_type = ''
else:
member = full_name[hash_idx + 1:colon_idx]
membe... | [
"def",
"ParseJava",
"(",
"full_name",
")",
":",
"hash_idx",
"=",
"full_name",
".",
"find",
"(",
"'#'",
")",
"if",
"hash_idx",
"!=",
"-",
"1",
":",
"full_new_class_name",
"=",
"full_name",
"[",
":",
"hash_idx",
"]",
"colon_idx",
"=",
"full_name",
".",
"fi... | Breaks java full_name into parts. | [
"Breaks",
"java",
"full_name",
"into",
"parts",
"."
] | [
"\"\"\"Breaks java full_name into parts.\n\n See unit tests for example signatures.\n\n Returns:\n A tuple of (full_name, template_name, name), where:\n * full_name = \"class_with_package#member(args): type\"\n * template_name = \"class_with_package#member\"\n * name = \"class_without_package#me... | [
{
"param": "full_name",
"type": null
}
] | {
"returns": [
{
"docstring": "A tuple of (full_name, template_name, name), where:\nfull_name = \"class_with_package#member(args): type\"\ntemplate_name = \"class_with_package#member\"\nname = \"class_without_package#member\n\nWhen a symbols has been merged into a different class:\nfull_name = \"new_class#o... |
d5d3ff643c4c9c4baad11d8897acaa4a0a954f08 | sunlongbo/chromium | tools/binary_size/libsupersize/function_signature.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | Parse | <not_specific> | def Parse(name):
"""Strips return type and breaks function signature into parts.
See unit tests for example signatures.
Returns:
A tuple of:
* name without return type (symbol.full_name),
* full_name without params (symbol.template_name),
* full_name without params and template args (symbol.name... | Strips return type and breaks function signature into parts.
See unit tests for example signatures.
Returns:
A tuple of:
* name without return type (symbol.full_name),
* full_name without params (symbol.template_name),
* full_name without params and template args (symbol.name)
| Strips return type and breaks function signature into parts.
See unit tests for example signatures. | [
"Strips",
"return",
"type",
"and",
"breaks",
"function",
"signature",
"into",
"parts",
".",
"See",
"unit",
"tests",
"for",
"example",
"signatures",
"."
] | def Parse(name):
left_paren_idx = _FindParameterListParen(name)
full_name = name
if left_paren_idx > 0:
right_paren_idx = name.rindex(')')
assert right_paren_idx > left_paren_idx
space_idx = _FindReturnValueSpace(name, left_paren_idx)
name_no_params = name[space_idx + 1:left_paren_idx]
if name... | [
"def",
"Parse",
"(",
"name",
")",
":",
"left_paren_idx",
"=",
"_FindParameterListParen",
"(",
"name",
")",
"full_name",
"=",
"name",
"if",
"left_paren_idx",
">",
"0",
":",
"right_paren_idx",
"=",
"name",
".",
"rindex",
"(",
"')'",
")",
"assert",
"right_paren... | Strips return type and breaks function signature into parts. | [
"Strips",
"return",
"type",
"and",
"breaks",
"function",
"signature",
"into",
"parts",
"."
] | [
"\"\"\"Strips return type and breaks function signature into parts.\n\n See unit tests for example signatures.\n\n Returns:\n A tuple of:\n * name without return type (symbol.full_name),\n * full_name without params (symbol.template_name),\n * full_name without params and template args (symbol.name)\n... | [
{
"param": "name",
"type": null
}
] | {
"returns": [
{
"docstring": "A tuple of:\nname without return type (symbol.full_name),\nfull_name without params (symbol.template_name),\nfull_name without params and template args (symbol.name)",
"docstring_tokens": [
"A",
"tuple",
"of",
":",
"name",
... |
d5d820cd6a3e2232eb7817a362098bba9731fa02 | sunlongbo/chromium | tools/android/dependency_analysis/generate_json_dependency_graph.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | class_is_interesting | <not_specific> | def class_is_interesting(name: str):
"""Checks if a jdeps class is a class we are actually interested in."""
if name.startswith('org.chromium.'):
return True
return False | Checks if a jdeps class is a class we are actually interested in. | Checks if a jdeps class is a class we are actually interested in. | [
"Checks",
"if",
"a",
"jdeps",
"class",
"is",
"a",
"class",
"we",
"are",
"actually",
"interested",
"in",
"."
] | def class_is_interesting(name: str):
if name.startswith('org.chromium.'):
return True
return False | [
"def",
"class_is_interesting",
"(",
"name",
":",
"str",
")",
":",
"if",
"name",
".",
"startswith",
"(",
"'org.chromium.'",
")",
":",
"return",
"True",
"return",
"False"
] | Checks if a jdeps class is a class we are actually interested in. | [
"Checks",
"if",
"a",
"jdeps",
"class",
"is",
"a",
"class",
"we",
"are",
"actually",
"interested",
"in",
"."
] | [
"\"\"\"Checks if a jdeps class is a class we are actually interested in.\"\"\""
] | [
{
"param": "name",
"type": "str"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "name",
"type": "str",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
d5d820cd6a3e2232eb7817a362098bba9731fa02 | sunlongbo/chromium | tools/android/dependency_analysis/generate_json_dependency_graph.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | _run_jdeps | str | def _run_jdeps(jdeps_path: str, filepath: pathlib.Path) -> str:
"""Runs jdeps on the given filepath and returns the output."""
print(f'Running jdeps and parsing output for {filepath}')
return subprocess_utils.run_command(
[jdeps_path, '-R', '-verbose:class', filepath]) | Runs jdeps on the given filepath and returns the output. | Runs jdeps on the given filepath and returns the output. | [
"Runs",
"jdeps",
"on",
"the",
"given",
"filepath",
"and",
"returns",
"the",
"output",
"."
] | def _run_jdeps(jdeps_path: str, filepath: pathlib.Path) -> str:
print(f'Running jdeps and parsing output for {filepath}')
return subprocess_utils.run_command(
[jdeps_path, '-R', '-verbose:class', filepath]) | [
"def",
"_run_jdeps",
"(",
"jdeps_path",
":",
"str",
",",
"filepath",
":",
"pathlib",
".",
"Path",
")",
"->",
"str",
":",
"print",
"(",
"f'Running jdeps and parsing output for {filepath}'",
")",
"return",
"subprocess_utils",
".",
"run_command",
"(",
"[",
"jdeps_pat... | Runs jdeps on the given filepath and returns the output. | [
"Runs",
"jdeps",
"on",
"the",
"given",
"filepath",
"and",
"returns",
"the",
"output",
"."
] | [
"\"\"\"Runs jdeps on the given filepath and returns the output.\"\"\""
] | [
{
"param": "jdeps_path",
"type": "str"
},
{
"param": "filepath",
"type": "pathlib.Path"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "jdeps_path",
"type": "str",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "filepath",
"type": "pathlib.Path",
"docstring": null,
... |
d5d820cd6a3e2232eb7817a362098bba9731fa02 | sunlongbo/chromium | tools/android/dependency_analysis/generate_json_dependency_graph.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | _run_gn_desc_list_dependencies | str | def _run_gn_desc_list_dependencies(build_output_dir: str, target: str,
gn_path: str) -> str:
"""Runs gn desc to list all jars that a target depends on.
This includes direct and indirect dependencies."""
return subprocess_utils.run_command(
[gn_path, 'desc', '--all... | Runs gn desc to list all jars that a target depends on.
This includes direct and indirect dependencies. | Runs gn desc to list all jars that a target depends on.
This includes direct and indirect dependencies. | [
"Runs",
"gn",
"desc",
"to",
"list",
"all",
"jars",
"that",
"a",
"target",
"depends",
"on",
".",
"This",
"includes",
"direct",
"and",
"indirect",
"dependencies",
"."
] | def _run_gn_desc_list_dependencies(build_output_dir: str, target: str,
gn_path: str) -> str:
return subprocess_utils.run_command(
[gn_path, 'desc', '--all', build_output_dir, target, 'deps']) | [
"def",
"_run_gn_desc_list_dependencies",
"(",
"build_output_dir",
":",
"str",
",",
"target",
":",
"str",
",",
"gn_path",
":",
"str",
")",
"->",
"str",
":",
"return",
"subprocess_utils",
".",
"run_command",
"(",
"[",
"gn_path",
",",
"'desc'",
",",
"'--all'",
... | Runs gn desc to list all jars that a target depends on. | [
"Runs",
"gn",
"desc",
"to",
"list",
"all",
"jars",
"that",
"a",
"target",
"depends",
"on",
"."
] | [
"\"\"\"Runs gn desc to list all jars that a target depends on.\n\n This includes direct and indirect dependencies.\"\"\""
] | [
{
"param": "build_output_dir",
"type": "str"
},
{
"param": "target",
"type": "str"
},
{
"param": "gn_path",
"type": "str"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "build_output_dir",
"type": "str",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "target",
"type": "str",
"docstring": null,
"docs... |
d5d820cd6a3e2232eb7817a362098bba9731fa02 | sunlongbo/chromium | tools/android/dependency_analysis/generate_json_dependency_graph.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | list_original_targets_and_jars | JarTargetList | def list_original_targets_and_jars(gn_desc_output: str, build_output_dir: str,
cr_position: int) -> JarTargetList:
"""Parses gn desc output to list original java targets and output jar paths.
Returns a list of tuples (build_target: str, jar_path: str), where:
- build_targ... | Parses gn desc output to list original java targets and output jar paths.
Returns a list of tuples (build_target: str, jar_path: str), where:
- build_target is the original java dependency target in the form
"//path/to:target"
- jar_path is the path to the built jar in the build_output_dir,
inc... | Parses gn desc output to list original java targets and output jar paths.
Returns a list of tuples (build_target: str, jar_path: str), where:
build_target is the original java dependency target in the form
"//path/to:target"
jar_path is the path to the built jar in the build_output_dir,
including the path to the output... | [
"Parses",
"gn",
"desc",
"output",
"to",
"list",
"original",
"java",
"targets",
"and",
"output",
"jar",
"paths",
".",
"Returns",
"a",
"list",
"of",
"tuples",
"(",
"build_target",
":",
"str",
"jar_path",
":",
"str",
")",
"where",
":",
"build_target",
"is",
... | def list_original_targets_and_jars(gn_desc_output: str, build_output_dir: str,
cr_position: int) -> JarTargetList:
jar_tuples: JarTargetList = []
for build_target_line in gn_desc_output.split('\n'):
if not build_target_line.endswith('__compile_java'):
conti... | [
"def",
"list_original_targets_and_jars",
"(",
"gn_desc_output",
":",
"str",
",",
"build_output_dir",
":",
"str",
",",
"cr_position",
":",
"int",
")",
"->",
"JarTargetList",
":",
"jar_tuples",
":",
"JarTargetList",
"=",
"[",
"]",
"for",
"build_target_line",
"in",
... | Parses gn desc output to list original java targets and output jar paths. | [
"Parses",
"gn",
"desc",
"output",
"to",
"list",
"original",
"java",
"targets",
"and",
"output",
"jar",
"paths",
"."
] | [
"\"\"\"Parses gn desc output to list original java targets and output jar paths.\n\n Returns a list of tuples (build_target: str, jar_path: str), where:\n - build_target is the original java dependency target in the form\n \"//path/to:target\"\n - jar_path is the path to the built jar in the build_out... | [
{
"param": "gn_desc_output",
"type": "str"
},
{
"param": "build_output_dir",
"type": "str"
},
{
"param": "cr_position",
"type": "int"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "gn_desc_output",
"type": "str",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "build_output_dir",
"type": "str",
"docstring": null,
... |
d5d820cd6a3e2232eb7817a362098bba9731fa02 | sunlongbo/chromium | tools/android/dependency_analysis/generate_json_dependency_graph.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | _get_jar_path_for_target | str | def _get_jar_path_for_target(build_output_dir: str, build_target: str,
cr_position: int) -> str:
if cr_position == 0: # Not running on main branch, use current convention.
subdirectory = 'obj'
elif cr_position < 761560: # crrev.com/c/2161205
subdirectory = 'gen'
... | Calculates the output location of a jar for a java build target. | Calculates the output location of a jar for a java build target. | [
"Calculates",
"the",
"output",
"location",
"of",
"a",
"jar",
"for",
"a",
"java",
"build",
"target",
"."
] | def _get_jar_path_for_target(build_output_dir: str, build_target: str,
cr_position: int) -> str:
if cr_position == 0:
subdirectory = 'obj'
elif cr_position < 761560:
subdirectory = 'gen'
else:
subdirectory = 'obj'
target_path, target_name = build_... | [
"def",
"_get_jar_path_for_target",
"(",
"build_output_dir",
":",
"str",
",",
"build_target",
":",
"str",
",",
"cr_position",
":",
"int",
")",
"->",
"str",
":",
"if",
"cr_position",
"==",
"0",
":",
"subdirectory",
"=",
"'obj'",
"elif",
"cr_position",
"<",
"76... | Calculates the output location of a jar for a java build target. | [
"Calculates",
"the",
"output",
"location",
"of",
"a",
"jar",
"for",
"a",
"java",
"build",
"target",
"."
] | [
"# Not running on main branch, use current convention.",
"# crrev.com/c/2161205",
"\"\"\"Calculates the output location of a jar for a java build target.\"\"\""
] | [
{
"param": "build_output_dir",
"type": "str"
},
{
"param": "build_target",
"type": "str"
},
{
"param": "cr_position",
"type": "int"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "build_output_dir",
"type": "str",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "build_target",
"type": "str",
"docstring": null,
... |
d5d820cd6a3e2232eb7817a362098bba9731fa02 | sunlongbo/chromium | tools/android/dependency_analysis/generate_json_dependency_graph.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | main | null | def main():
"""Runs jdeps on all JARs a build target depends on.
Creates a JSON file from the jdeps output."""
arg_parser = argparse.ArgumentParser(
description='Runs jdeps (dependency analysis tool) on all JARs a root '
'build target depends on and writes the resulting dependency graph '
... | Runs jdeps on all JARs a build target depends on.
Creates a JSON file from the jdeps output. | Runs jdeps on all JARs a build target depends on.
Creates a JSON file from the jdeps output. | [
"Runs",
"jdeps",
"on",
"all",
"JARs",
"a",
"build",
"target",
"depends",
"on",
".",
"Creates",
"a",
"JSON",
"file",
"from",
"the",
"jdeps",
"output",
"."
] | def main():
arg_parser = argparse.ArgumentParser(
description='Runs jdeps (dependency analysis tool) on all JARs a root '
'build target depends on and writes the resulting dependency graph '
'into a JSON file. The default root build target is '
'chrome/android:monochrome_public_bundl... | [
"def",
"main",
"(",
")",
":",
"arg_parser",
"=",
"argparse",
".",
"ArgumentParser",
"(",
"description",
"=",
"'Runs jdeps (dependency analysis tool) on all JARs a root '",
"'build target depends on and writes the resulting dependency graph '",
"'into a JSON file. The default root build... | Runs jdeps on all JARs a build target depends on. | [
"Runs",
"jdeps",
"on",
"all",
"JARs",
"a",
"build",
"target",
"depends",
"on",
"."
] | [
"\"\"\"Runs jdeps on all JARs a build target depends on.\n\n Creates a JSON file from the jdeps output.\"\"\"",
"# gn and git must be run from inside the git checkout.",
"# jdeps already has some parallelism"
] | [] | {
"returns": [],
"raises": [],
"params": [],
"outlier_params": [],
"others": []
} |
d5d925c8f1bfee61f37378e4d28b79fa3351430a | sunlongbo/chromium | tools/perf/cli_tools/tbmv3/validators/utils.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | AssertHistogramStatsAlmostEqual | null | def AssertHistogramStatsAlmostEqual(test_ctx, v2_hist, v3_hist, precision=1e-3):
"""Asserts major histogram statistics are close enough.
sum, mean, max, min are asserted to be within 3 decimal places.
count is asserted to be exactly equal."""
v2_running = v2_hist.running
v3_running = v3_hist.running
test_c... | Asserts major histogram statistics are close enough.
sum, mean, max, min are asserted to be within 3 decimal places.
count is asserted to be exactly equal. | Asserts major histogram statistics are close enough.
sum, mean, max, min are asserted to be within 3 decimal places.
count is asserted to be exactly equal. | [
"Asserts",
"major",
"histogram",
"statistics",
"are",
"close",
"enough",
".",
"sum",
"mean",
"max",
"min",
"are",
"asserted",
"to",
"be",
"within",
"3",
"decimal",
"places",
".",
"count",
"is",
"asserted",
"to",
"be",
"exactly",
"equal",
"."
] | def AssertHistogramStatsAlmostEqual(test_ctx, v2_hist, v3_hist, precision=1e-3):
v2_running = v2_hist.running
v3_running = v3_hist.running
test_ctx.assertAlmostEqual(v2_running.mean, v3_running.mean, delta=precision)
test_ctx.assertAlmostEqual(v2_running.sum, v3_running.sum, delta=precision)
test_ctx.assertAl... | [
"def",
"AssertHistogramStatsAlmostEqual",
"(",
"test_ctx",
",",
"v2_hist",
",",
"v3_hist",
",",
"precision",
"=",
"1e-3",
")",
":",
"v2_running",
"=",
"v2_hist",
".",
"running",
"v3_running",
"=",
"v3_hist",
".",
"running",
"test_ctx",
".",
"assertAlmostEqual",
... | Asserts major histogram statistics are close enough. | [
"Asserts",
"major",
"histogram",
"statistics",
"are",
"close",
"enough",
"."
] | [
"\"\"\"Asserts major histogram statistics are close enough.\n\n sum, mean, max, min are asserted to be within 3 decimal places.\n count is asserted to be exactly equal.\"\"\""
] | [
{
"param": "test_ctx",
"type": null
},
{
"param": "v2_hist",
"type": null
},
{
"param": "v3_hist",
"type": null
},
{
"param": "precision",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "test_ctx",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "v2_hist",
"type": null,
"docstring": null,
"docstring_tok... |
fe8f789a8bbf284e756dec4e6b84a57005d4db61 | sunlongbo/chromium | third_party/blink/web_tests/wpt_internal/prerender/PRESUBMIT.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | _CheckFileTimeoutMetaTags | <not_specific> | def _CheckFileTimeoutMetaTags(f):
"""Checks if the given file has timeout meta tags."""
new_contents = f.NewContents()
for line in new_contents:
if 'name="timeout" content="long"' in line:
return True
return False | Checks if the given file has timeout meta tags. | Checks if the given file has timeout meta tags. | [
"Checks",
"if",
"the",
"given",
"file",
"has",
"timeout",
"meta",
"tags",
"."
] | def _CheckFileTimeoutMetaTags(f):
new_contents = f.NewContents()
for line in new_contents:
if 'name="timeout" content="long"' in line:
return True
return False | [
"def",
"_CheckFileTimeoutMetaTags",
"(",
"f",
")",
":",
"new_contents",
"=",
"f",
".",
"NewContents",
"(",
")",
"for",
"line",
"in",
"new_contents",
":",
"if",
"'name=\"timeout\" content=\"long\"'",
"in",
"line",
":",
"return",
"True",
"return",
"False"
] | Checks if the given file has timeout meta tags. | [
"Checks",
"if",
"the",
"given",
"file",
"has",
"timeout",
"meta",
"tags",
"."
] | [
"\"\"\"Checks if the given file has timeout meta tags.\"\"\""
] | [
{
"param": "f",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "f",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
fe8f789a8bbf284e756dec4e6b84a57005d4db61 | sunlongbo/chromium | third_party/blink/web_tests/wpt_internal/prerender/PRESUBMIT.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | _CheckTimeoutMetaTags | <not_specific> | def _CheckTimeoutMetaTags(input_api, output_api):
""" This function ensures that all WPTs for prerendering have meta tags
to lengthen test timeout as some tests can possibly run out of time
on windows platform.
"""
results = []
def file_filter(f):
return (f.LocalPath().endswith(... | This function ensures that all WPTs for prerendering have meta tags
to lengthen test timeout as some tests can possibly run out of time
on windows platform.
| This function ensures that all WPTs for prerendering have meta tags
to lengthen test timeout as some tests can possibly run out of time
on windows platform. | [
"This",
"function",
"ensures",
"that",
"all",
"WPTs",
"for",
"prerendering",
"have",
"meta",
"tags",
"to",
"lengthen",
"test",
"timeout",
"as",
"some",
"tests",
"can",
"possibly",
"run",
"out",
"of",
"time",
"on",
"windows",
"platform",
"."
] | def _CheckTimeoutMetaTags(input_api, output_api):
results = []
def file_filter(f):
return (f.LocalPath().endswith(('html'))
and (os.path.join('resources', '') not in f.LocalPath()))
for f in input_api.AffectedFiles(include_deletes=False,
file_filt... | [
"def",
"_CheckTimeoutMetaTags",
"(",
"input_api",
",",
"output_api",
")",
":",
"results",
"=",
"[",
"]",
"def",
"file_filter",
"(",
"f",
")",
":",
"return",
"(",
"f",
".",
"LocalPath",
"(",
")",
".",
"endswith",
"(",
"(",
"'html'",
")",
")",
"and",
"... | This function ensures that all WPTs for prerendering have meta tags
to lengthen test timeout as some tests can possibly run out of time
on windows platform. | [
"This",
"function",
"ensures",
"that",
"all",
"WPTs",
"for",
"prerendering",
"have",
"meta",
"tags",
"to",
"lengthen",
"test",
"timeout",
"as",
"some",
"tests",
"can",
"possibly",
"run",
"out",
"of",
"time",
"on",
"windows",
"platform",
"."
] | [
"\"\"\" This function ensures that all WPTs for prerendering have meta tags\n to lengthen test timeout as some tests can possibly run out of time\n on windows platform.\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... |
892130f637c39936630889e617696da695ecdecf | sunlongbo/chromium | chrome/installer/mac/universalizer.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | _file_type_for_stat | <not_specific> | def _file_type_for_stat(st):
"""Returns a string indicating the type of directory entry in st.
Args:
st: The return value of os.stat or os.lstat.
Returns:
'symbolic link', 'file', or 'directory'.
"""
if stat.S_ISLNK(st.st_mode):
return 'symbolic_link'
if stat.S_ISREG(st... | Returns a string indicating the type of directory entry in st.
Args:
st: The return value of os.stat or os.lstat.
Returns:
'symbolic link', 'file', or 'directory'.
| Returns a string indicating the type of directory entry in st. | [
"Returns",
"a",
"string",
"indicating",
"the",
"type",
"of",
"directory",
"entry",
"in",
"st",
"."
] | def _file_type_for_stat(st):
if stat.S_ISLNK(st.st_mode):
return 'symbolic_link'
if stat.S_ISREG(st.st_mode):
return 'file'
if stat.S_ISDIR(st.st_mode):
return 'directory'
raise Exception('unknown file type for mode 0o%o' % mode) | [
"def",
"_file_type_for_stat",
"(",
"st",
")",
":",
"if",
"stat",
".",
"S_ISLNK",
"(",
"st",
".",
"st_mode",
")",
":",
"return",
"'symbolic_link'",
"if",
"stat",
".",
"S_ISREG",
"(",
"st",
".",
"st_mode",
")",
":",
"return",
"'file'",
"if",
"stat",
".",... | Returns a string indicating the type of directory entry in st. | [
"Returns",
"a",
"string",
"indicating",
"the",
"type",
"of",
"directory",
"entry",
"in",
"st",
"."
] | [
"\"\"\"Returns a string indicating the type of directory entry in st.\n\n Args:\n st: The return value of os.stat or os.lstat.\n\n Returns:\n 'symbolic link', 'file', or 'directory'.\n \"\"\""
] | [
{
"param": "st",
"type": null
}
] | {
"returns": [
{
"docstring": "'symbolic link', 'file', or 'directory'.",
"docstring_tokens": [
"'",
"symbolic",
"link",
"'",
"'",
"file",
"'",
"or",
"'",
"directory",
"'",
"."
],
"type": null
... |
892130f637c39936630889e617696da695ecdecf | sunlongbo/chromium | chrome/installer/mac/universalizer.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | _sole_list_element | <not_specific> | def _sole_list_element(l, exception_message):
"""Assures that every element in a list is identical.
Args:
l: The list to consider.
exception_message: A message used to convey failure if every element in
l is not identical.
Returns:
The value of each identical element in... | Assures that every element in a list is identical.
Args:
l: The list to consider.
exception_message: A message used to convey failure if every element in
l is not identical.
Returns:
The value of each identical element in the list.
| Assures that every element in a list is identical. | [
"Assures",
"that",
"every",
"element",
"in",
"a",
"list",
"is",
"identical",
"."
] | def _sole_list_element(l, exception_message):
s = set(l)
if len(s) != 1:
raise Exception(exception_message)
return l[0] | [
"def",
"_sole_list_element",
"(",
"l",
",",
"exception_message",
")",
":",
"s",
"=",
"set",
"(",
"l",
")",
"if",
"len",
"(",
"s",
")",
"!=",
"1",
":",
"raise",
"Exception",
"(",
"exception_message",
")",
"return",
"l",
"[",
"0",
"]"
] | Assures that every element in a list is identical. | [
"Assures",
"that",
"every",
"element",
"in",
"a",
"list",
"is",
"identical",
"."
] | [
"\"\"\"Assures that every element in a list is identical.\n\n Args:\n l: The list to consider.\n exception_message: A message used to convey failure if every element in\n l is not identical.\n\n Returns:\n The value of each identical element in the list.\n \"\"\""
] | [
{
"param": "l",
"type": null
},
{
"param": "exception_message",
"type": null
}
] | {
"returns": [
{
"docstring": "The value of each identical element in the list.",
"docstring_tokens": [
"The",
"value",
"of",
"each",
"identical",
"element",
"in",
"the",
"list",
"."
],
"type": null
}
],
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.