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
8f57960b7d0ad74c052e5ee05e91920ce0d6adf8
sunlongbo/chromium
tools/code_coverage/coverage.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
_CreateCoverageProfileDataFromTargetProfDataFiles
<not_specific>
def _CreateCoverageProfileDataFromTargetProfDataFiles(profdata_file_paths): """Returns a relative path to coverage profdata file by merging target profdata files. Args: profdata_file_paths: A list of relative paths to the profdata data files that are to be merged. Returns: A r...
Returns a relative path to coverage profdata file by merging target profdata files. Args: profdata_file_paths: A list of relative paths to the profdata data files that are to be merged. Returns: A relative path to the merged coverage profdata file. Raises: CalledProcessEr...
Returns a relative path to coverage profdata file by merging target profdata files.
[ "Returns", "a", "relative", "path", "to", "coverage", "profdata", "file", "by", "merging", "target", "profdata", "files", "." ]
def _CreateCoverageProfileDataFromTargetProfDataFiles(profdata_file_paths): logging.info('Creating the coverage profile data file.') logging.debug('Merging target profraw files to create target profdata file.') profdata_file_path = _GetProfdataFilePath() try: subprocess_cmd = [ LLVM_PROFDATA_PATH, '...
[ "def", "_CreateCoverageProfileDataFromTargetProfDataFiles", "(", "profdata_file_paths", ")", ":", "logging", ".", "info", "(", "'Creating the coverage profile data file.'", ")", "logging", ".", "debug", "(", "'Merging target profraw files to create target profdata file.'", ")", "...
Returns a relative path to coverage profdata file by merging target profdata files.
[ "Returns", "a", "relative", "path", "to", "coverage", "profdata", "file", "by", "merging", "target", "profdata", "files", "." ]
[ "\"\"\"Returns a relative path to coverage profdata file by merging target\n profdata files.\n\n Args:\n profdata_file_paths: A list of relative paths to the profdata data files\n that are to be merged.\n\n Returns:\n A relative path to the merged coverage profdata file.\n\n Raises...
[ { "param": "profdata_file_paths", "type": null } ]
{ "returns": [ { "docstring": "A relative path to the merged coverage profdata file.", "docstring_tokens": [ "A", "relative", "path", "to", "the", "merged", "coverage", "profdata", "file", "." ], "type": null ...
8f57960b7d0ad74c052e5ee05e91920ce0d6adf8
sunlongbo/chromium
tools/code_coverage/coverage.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
_CreateTargetProfDataFileFromProfRawFiles
<not_specific>
def _CreateTargetProfDataFileFromProfRawFiles(target, profraw_file_paths): """Returns a relative path to target profdata file by merging target profraw files. Args: profraw_file_paths: A list of relative paths to the profdata data files that are to be merged. Returns: A relati...
Returns a relative path to target profdata file by merging target profraw files. Args: profraw_file_paths: A list of relative paths to the profdata data files that are to be merged. Returns: A relative path to the merged coverage profdata file. Raises: CalledProcessError:...
Returns a relative path to target profdata file by merging target profraw files.
[ "Returns", "a", "relative", "path", "to", "target", "profdata", "file", "by", "merging", "target", "profraw", "files", "." ]
def _CreateTargetProfDataFileFromProfRawFiles(target, profraw_file_paths): logging.info('Creating target profile data file.') logging.debug('Merging target profraw files to create target profdata file.') profdata_file_path = os.path.join(OUTPUT_DIR, '%s.profdata' % target) try: subprocess_cmd = [ LL...
[ "def", "_CreateTargetProfDataFileFromProfRawFiles", "(", "target", ",", "profraw_file_paths", ")", ":", "logging", ".", "info", "(", "'Creating target profile data file.'", ")", "logging", ".", "debug", "(", "'Merging target profraw files to create target profdata file.'", ")",...
Returns a relative path to target profdata file by merging target profraw files.
[ "Returns", "a", "relative", "path", "to", "target", "profdata", "file", "by", "merging", "target", "profraw", "files", "." ]
[ "\"\"\"Returns a relative path to target profdata file by merging target\n profraw files.\n\n Args:\n profraw_file_paths: A list of relative paths to the profdata data files\n that are to be merged.\n\n Returns:\n A relative path to the merged coverage profdata file.\n\n Raises:\n ...
[ { "param": "target", "type": null }, { "param": "profraw_file_paths", "type": null } ]
{ "returns": [ { "docstring": "A relative path to the merged coverage profdata file.", "docstring_tokens": [ "A", "relative", "path", "to", "the", "merged", "coverage", "profdata", "file", "." ], "type": null ...
8f57960b7d0ad74c052e5ee05e91920ce0d6adf8
sunlongbo/chromium
tools/code_coverage/coverage.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
_GeneratePerFileCoverageSummary
<not_specific>
def _GeneratePerFileCoverageSummary(binary_paths, profdata_file_path, filters, ignore_filename_regex): """Generates per file coverage summary using "llvm-cov export" command.""" # llvm-cov export [options] -instr-profile PROFILE BIN [-object BIN,...] # [[-object BIN]] [SOURCES]...
Generates per file coverage summary using "llvm-cov export" command.
Generates per file coverage summary using "llvm-cov export" command.
[ "Generates", "per", "file", "coverage", "summary", "using", "\"", "llvm", "-", "cov", "export", "\"", "command", "." ]
def _GeneratePerFileCoverageSummary(binary_paths, profdata_file_path, filters, ignore_filename_regex): logging.debug('Generating per-file code coverage summary using "llvm-cov ' 'export -summary-only" command.') for path in binary_paths: if not os.path.exists(...
[ "def", "_GeneratePerFileCoverageSummary", "(", "binary_paths", ",", "profdata_file_path", ",", "filters", ",", "ignore_filename_regex", ")", ":", "logging", ".", "debug", "(", "'Generating per-file code coverage summary using \"llvm-cov '", "'export -summary-only\" command.'", ")...
Generates per file coverage summary using "llvm-cov export" command.
[ "Generates", "per", "file", "coverage", "summary", "using", "\"", "llvm", "-", "cov", "export", "\"", "command", "." ]
[ "\"\"\"Generates per file coverage summary using \"llvm-cov export\" command.\"\"\"", "# llvm-cov export [options] -instr-profile PROFILE BIN [-object BIN,...]", "# [[-object BIN]] [SOURCES].", "# NOTE: For object files, the first one is specified as a positional argument,", "# and the rest are specified as...
[ { "param": "binary_paths", "type": null }, { "param": "profdata_file_path", "type": null }, { "param": "filters", "type": null }, { "param": "ignore_filename_regex", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "binary_paths", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "profdata_file_path", "type": null, "docstring": null, ...
8f57960b7d0ad74c052e5ee05e91920ce0d6adf8
sunlongbo/chromium
tools/code_coverage/coverage.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
_AddArchArgumentForIOSIfNeeded
null
def _AddArchArgumentForIOSIfNeeded(cmd_list, num_archs): """Appends -arch arguments to the command list if it's ios platform. iOS binaries are universal binaries, and require specifying the architecture to use, and one architecture needs to be specified for each binary. """ if _IsIOS(): cmd_list.extend([...
Appends -arch arguments to the command list if it's ios platform. iOS binaries are universal binaries, and require specifying the architecture to use, and one architecture needs to be specified for each binary.
arch arguments to the command list if it's ios platform. iOS binaries are universal binaries, and require specifying the architecture to use, and one architecture needs to be specified for each binary.
[ "arch", "arguments", "to", "the", "command", "list", "if", "it", "'", "s", "ios", "platform", ".", "iOS", "binaries", "are", "universal", "binaries", "and", "require", "specifying", "the", "architecture", "to", "use", "and", "one", "architecture", "needs", "...
def _AddArchArgumentForIOSIfNeeded(cmd_list, num_archs): if _IsIOS(): cmd_list.extend(['-arch=x86_64'] * num_archs)
[ "def", "_AddArchArgumentForIOSIfNeeded", "(", "cmd_list", ",", "num_archs", ")", ":", "if", "_IsIOS", "(", ")", ":", "cmd_list", ".", "extend", "(", "[", "'-arch=x86_64'", "]", "*", "num_archs", ")" ]
Appends -arch arguments to the command list if it's ios platform.
[ "Appends", "-", "arch", "arguments", "to", "the", "command", "list", "if", "it", "'", "s", "ios", "platform", "." ]
[ "\"\"\"Appends -arch arguments to the command list if it's ios platform.\n\n iOS binaries are universal binaries, and require specifying the architecture\n to use, and one architecture needs to be specified for each binary.\n \"\"\"" ]
[ { "param": "cmd_list", "type": null }, { "param": "num_archs", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "cmd_list", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "num_archs", "type": null, "docstring": null, "docstring_t...
8f57960b7d0ad74c052e5ee05e91920ce0d6adf8
sunlongbo/chromium
tools/code_coverage/coverage.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
_GetBinaryPath
<not_specific>
def _GetBinaryPath(command): """Returns a relative path to the binary to be run by the command. Currently, following types of commands are supported (e.g. url_unittests): 1. Run test binary direcly: "out/coverage/url_unittests <arguments>" 2. Use xvfb. 2.1. "python testing/xvfb.py out/coverage/url_unittest...
Returns a relative path to the binary to be run by the command. Currently, following types of commands are supported (e.g. url_unittests): 1. Run test binary direcly: "out/coverage/url_unittests <arguments>" 2. Use xvfb. 2.1. "python testing/xvfb.py out/coverage/url_unittests <arguments>" 2.2. "testing/x...
Returns a relative path to the binary to be run by the command. Currently, following types of commands are supported : 1. Run test binary direcly: "out/coverage/url_unittests " 2. Use xvfb.
[ "Returns", "a", "relative", "path", "to", "the", "binary", "to", "be", "run", "by", "the", "command", ".", "Currently", "following", "types", "of", "commands", "are", "supported", ":", "1", ".", "Run", "test", "binary", "direcly", ":", "\"", "out", "/", ...
def _GetBinaryPath(command): xvfb_script_name = os.extsep.join(['xvfb', 'py']) command_parts = _SplitCommand(command) if os.path.basename(command_parts[0]) == 'python': assert os.path.basename(command_parts[1]) == xvfb_script_name, ( 'This tool doesn\'t understand the command: "%s".' % command) re...
[ "def", "_GetBinaryPath", "(", "command", ")", ":", "xvfb_script_name", "=", "os", ".", "extsep", ".", "join", "(", "[", "'xvfb'", ",", "'py'", "]", ")", "command_parts", "=", "_SplitCommand", "(", "command", ")", "if", "os", ".", "path", ".", "basename",...
Returns a relative path to the binary to be run by the command.
[ "Returns", "a", "relative", "path", "to", "the", "binary", "to", "be", "run", "by", "the", "command", "." ]
[ "\"\"\"Returns a relative path to the binary to be run by the command.\n\n Currently, following types of commands are supported (e.g. url_unittests):\n 1. Run test binary direcly: \"out/coverage/url_unittests <arguments>\"\n 2. Use xvfb.\n 2.1. \"python testing/xvfb.py out/coverage/url_unittests <arguments>\"...
[ { "param": "command", "type": null } ]
{ "returns": [ { "docstring": "A relative path to the binary.", "docstring_tokens": [ "A", "relative", "path", "to", "the", "binary", "." ], "type": null } ], "raises": [], "params": [ { "identifier": "command", ...
8f57960b7d0ad74c052e5ee05e91920ce0d6adf8
sunlongbo/chromium
tools/code_coverage/coverage.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
_VerifyTargetExecutablesAreInBuildDirectory
null
def _VerifyTargetExecutablesAreInBuildDirectory(commands): """Verifies that the target executables specified in the commands are inside the given build directory.""" for command in commands: binary_path = _GetBinaryPath(command) binary_absolute_path = coverage_utils.GetFullPath(binary_path) assert bin...
Verifies that the target executables specified in the commands are inside the given build directory.
Verifies that the target executables specified in the commands are inside the given build directory.
[ "Verifies", "that", "the", "target", "executables", "specified", "in", "the", "commands", "are", "inside", "the", "given", "build", "directory", "." ]
def _VerifyTargetExecutablesAreInBuildDirectory(commands): for command in commands: binary_path = _GetBinaryPath(command) binary_absolute_path = coverage_utils.GetFullPath(binary_path) assert binary_absolute_path.startswith(BUILD_DIR + os.sep), ( 'Target executable "%s" in command: "%s" is outside...
[ "def", "_VerifyTargetExecutablesAreInBuildDirectory", "(", "commands", ")", ":", "for", "command", "in", "commands", ":", "binary_path", "=", "_GetBinaryPath", "(", "command", ")", "binary_absolute_path", "=", "coverage_utils", ".", "GetFullPath", "(", "binary_path", ...
Verifies that the target executables specified in the commands are inside the given build directory.
[ "Verifies", "that", "the", "target", "executables", "specified", "in", "the", "commands", "are", "inside", "the", "given", "build", "directory", "." ]
[ "\"\"\"Verifies that the target executables specified in the commands are inside\n the given build directory.\"\"\"" ]
[ { "param": "commands", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "commands", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
8f57960b7d0ad74c052e5ee05e91920ce0d6adf8
sunlongbo/chromium
tools/code_coverage/coverage.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
_ValidateBuildingWithClangCoverage
null
def _ValidateBuildingWithClangCoverage(): """Asserts that targets are built with Clang coverage enabled.""" build_args = _GetBuildArgs() if (CLANG_COVERAGE_BUILD_ARG not in build_args or build_args[CLANG_COVERAGE_BUILD_ARG] != 'true'): assert False, ('\'{} = true\' is required in args.gn.' ...
Asserts that targets are built with Clang coverage enabled.
Asserts that targets are built with Clang coverage enabled.
[ "Asserts", "that", "targets", "are", "built", "with", "Clang", "coverage", "enabled", "." ]
def _ValidateBuildingWithClangCoverage(): build_args = _GetBuildArgs() if (CLANG_COVERAGE_BUILD_ARG not in build_args or build_args[CLANG_COVERAGE_BUILD_ARG] != 'true'): assert False, ('\'{} = true\' is required in args.gn.' ).format(CLANG_COVERAGE_BUILD_ARG)
[ "def", "_ValidateBuildingWithClangCoverage", "(", ")", ":", "build_args", "=", "_GetBuildArgs", "(", ")", "if", "(", "CLANG_COVERAGE_BUILD_ARG", "not", "in", "build_args", "or", "build_args", "[", "CLANG_COVERAGE_BUILD_ARG", "]", "!=", "'true'", ")", ":", "assert", ...
Asserts that targets are built with Clang coverage enabled.
[ "Asserts", "that", "targets", "are", "built", "with", "Clang", "coverage", "enabled", "." ]
[ "\"\"\"Asserts that targets are built with Clang coverage enabled.\"\"\"" ]
[]
{ "returns": [], "raises": [], "params": [], "outlier_params": [], "others": [] }
8f57960b7d0ad74c052e5ee05e91920ce0d6adf8
sunlongbo/chromium
tools/code_coverage/coverage.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
_ValidateCurrentPlatformIsSupported
null
def _ValidateCurrentPlatformIsSupported(): """Asserts that this script suports running on the current platform""" target_os = _GetTargetOS() if target_os: current_platform = target_os else: current_platform = coverage_utils.GetHostPlatform() supported_platforms = ['android', 'chromeos', 'ios', 'linux...
Asserts that this script suports running on the current platform
Asserts that this script suports running on the current platform
[ "Asserts", "that", "this", "script", "suports", "running", "on", "the", "current", "platform" ]
def _ValidateCurrentPlatformIsSupported(): target_os = _GetTargetOS() if target_os: current_platform = target_os else: current_platform = coverage_utils.GetHostPlatform() supported_platforms = ['android', 'chromeos', 'ios', 'linux', 'mac', 'win'] assert current_platform in supported_platforms, ('Cover...
[ "def", "_ValidateCurrentPlatformIsSupported", "(", ")", ":", "target_os", "=", "_GetTargetOS", "(", ")", "if", "target_os", ":", "current_platform", "=", "target_os", "else", ":", "current_platform", "=", "coverage_utils", ".", "GetHostPlatform", "(", ")", "supporte...
Asserts that this script suports running on the current platform
[ "Asserts", "that", "this", "script", "suports", "running", "on", "the", "current", "platform" ]
[ "\"\"\"Asserts that this script suports running on the current platform\"\"\"" ]
[]
{ "returns": [], "raises": [], "params": [], "outlier_params": [], "others": [] }
8f57960b7d0ad74c052e5ee05e91920ce0d6adf8
sunlongbo/chromium
tools/code_coverage/coverage.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
_GetBuildArgs
<not_specific>
def _GetBuildArgs(): """Parses args.gn file and returns results as a dictionary. Returns: A dictionary representing the build args. """ global _BUILD_ARGS if _BUILD_ARGS is not None: return _BUILD_ARGS _BUILD_ARGS = {} build_args_path = os.path.join(BUILD_DIR, 'args.gn') assert os.path.exists(...
Parses args.gn file and returns results as a dictionary. Returns: A dictionary representing the build args.
Parses args.gn file and returns results as a dictionary.
[ "Parses", "args", ".", "gn", "file", "and", "returns", "results", "as", "a", "dictionary", "." ]
def _GetBuildArgs(): global _BUILD_ARGS if _BUILD_ARGS is not None: return _BUILD_ARGS _BUILD_ARGS = {} build_args_path = os.path.join(BUILD_DIR, 'args.gn') assert os.path.exists(build_args_path), ('"%s" is not a build directory, ' 'missing args.gn file.' % BUILD...
[ "def", "_GetBuildArgs", "(", ")", ":", "global", "_BUILD_ARGS", "if", "_BUILD_ARGS", "is", "not", "None", ":", "return", "_BUILD_ARGS", "_BUILD_ARGS", "=", "{", "}", "build_args_path", "=", "os", ".", "path", ".", "join", "(", "BUILD_DIR", ",", "'args.gn'", ...
Parses args.gn file and returns results as a dictionary.
[ "Parses", "args", ".", "gn", "file", "and", "returns", "results", "as", "a", "dictionary", "." ]
[ "\"\"\"Parses args.gn file and returns results as a dictionary.\n\n Returns:\n A dictionary representing the build args.\n \"\"\"", "# Values are wrapped within a pair of double-quotes, so remove the leading", "# and trailing double-quotes." ]
[]
{ "returns": [ { "docstring": "A dictionary representing the build args.", "docstring_tokens": [ "A", "dictionary", "representing", "the", "build", "args", "." ], "type": null } ], "raises": [], "params": [], "outlier_para...
8f57960b7d0ad74c052e5ee05e91920ce0d6adf8
sunlongbo/chromium
tools/code_coverage/coverage.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
_VerifyPathsAndReturnAbsolutes
<not_specific>
def _VerifyPathsAndReturnAbsolutes(paths): """Verifies that the paths specified in |paths| exist and returns absolute versions. Args: paths: A list of files or directories. """ absolute_paths = [] for path in paths: absolute_path = os.path.join(SRC_ROOT_PATH, path) assert os.path.exists(absolut...
Verifies that the paths specified in |paths| exist and returns absolute versions. Args: paths: A list of files or directories.
Verifies that the paths specified in |paths| exist and returns absolute versions.
[ "Verifies", "that", "the", "paths", "specified", "in", "|paths|", "exist", "and", "returns", "absolute", "versions", "." ]
def _VerifyPathsAndReturnAbsolutes(paths): absolute_paths = [] for path in paths: absolute_path = os.path.join(SRC_ROOT_PATH, path) assert os.path.exists(absolute_path), ('Path: "%s" doesn\'t exist.' % path) absolute_paths.append(absolute_path) return absolute_paths
[ "def", "_VerifyPathsAndReturnAbsolutes", "(", "paths", ")", ":", "absolute_paths", "=", "[", "]", "for", "path", "in", "paths", ":", "absolute_path", "=", "os", ".", "path", ".", "join", "(", "SRC_ROOT_PATH", ",", "path", ")", "assert", "os", ".", "path", ...
Verifies that the paths specified in |paths| exist and returns absolute versions.
[ "Verifies", "that", "the", "paths", "specified", "in", "|paths|", "exist", "and", "returns", "absolute", "versions", "." ]
[ "\"\"\"Verifies that the paths specified in |paths| exist and returns absolute\n versions.\n\n Args:\n paths: A list of files or directories.\n \"\"\"" ]
[ { "param": "paths", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "paths", "type": null, "docstring": "A list of files or directories.", "docstring_tokens": [ "A", "list", "of", "files", "or", "directories", "." ], "default":...
8f57960b7d0ad74c052e5ee05e91920ce0d6adf8
sunlongbo/chromium
tools/code_coverage/coverage.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
_GetBinaryPathsFromTargets
<not_specific>
def _GetBinaryPathsFromTargets(targets, build_dir): """Return binary paths from target names.""" # TODO(crbug.com/899974): Derive output binary from target build definitions # rather than assuming that it is always the same name. binary_paths = [] for target in targets: binary_path = os.path.join(build_di...
Return binary paths from target names.
Return binary paths from target names.
[ "Return", "binary", "paths", "from", "target", "names", "." ]
def _GetBinaryPathsFromTargets(targets, build_dir): binary_paths = [] for target in targets: binary_path = os.path.join(build_dir, target) if coverage_utils.GetHostPlatform() == 'win': binary_path += '.exe' if os.path.exists(binary_path): binary_paths.append(binary_path) else: logg...
[ "def", "_GetBinaryPathsFromTargets", "(", "targets", ",", "build_dir", ")", ":", "binary_paths", "=", "[", "]", "for", "target", "in", "targets", ":", "binary_path", "=", "os", ".", "path", ".", "join", "(", "build_dir", ",", "target", ")", "if", "coverage...
Return binary paths from target names.
[ "Return", "binary", "paths", "from", "target", "names", "." ]
[ "\"\"\"Return binary paths from target names.\"\"\"", "# TODO(crbug.com/899974): Derive output binary from target build definitions", "# rather than assuming that it is always the same name." ]
[ { "param": "targets", "type": null }, { "param": "build_dir", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "targets", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "build_dir", "type": null, "docstring": null, "docstring_to...
8f57960b7d0ad74c052e5ee05e91920ce0d6adf8
sunlongbo/chromium
tools/code_coverage/coverage.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
_GetCommandForWebTests
<not_specific>
def _GetCommandForWebTests(arguments): """Return command to run for blink web tests.""" cpu_count = multiprocessing.cpu_count() if sys.platform == 'win32': # TODO(crbug.com/1190269) - we can't use more than 56 # cores on Windows or Python3 may hang. cpu_count = min(cpu_count, 56) cpu_count = max(1, ...
Return command to run for blink web tests.
Return command to run for blink web tests.
[ "Return", "command", "to", "run", "for", "blink", "web", "tests", "." ]
def _GetCommandForWebTests(arguments): cpu_count = multiprocessing.cpu_count() if sys.platform == 'win32': cpu_count = min(cpu_count, 56) cpu_count = max(1, cpu_count // 2) command_list = [ 'python', 'testing/xvfb.py', 'python', 'third_party/blink/tools/run_web_tests.py', '--additional-dri...
[ "def", "_GetCommandForWebTests", "(", "arguments", ")", ":", "cpu_count", "=", "multiprocessing", ".", "cpu_count", "(", ")", "if", "sys", ".", "platform", "==", "'win32'", ":", "cpu_count", "=", "min", "(", "cpu_count", ",", "56", ")", "cpu_count", "=", "...
Return command to run for blink web tests.
[ "Return", "command", "to", "run", "for", "blink", "web", "tests", "." ]
[ "\"\"\"Return command to run for blink web tests.\"\"\"", "# TODO(crbug.com/1190269) - we can't use more than 56", "# cores on Windows or Python3 may hang." ]
[ { "param": "arguments", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "arguments", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
8f57960b7d0ad74c052e5ee05e91920ce0d6adf8
sunlongbo/chromium
tools/code_coverage/coverage.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
_GetBinaryPathsForAndroid
<not_specific>
def _GetBinaryPathsForAndroid(targets): """Return binary paths used when running android tests.""" # TODO(crbug.com/899974): Implement approach that doesn't assume .so file is # based on the target's name. android_binaries = set() for target in targets: so_library_path = os.path.join(BUILD_DIR, 'lib.unstr...
Return binary paths used when running android tests.
Return binary paths used when running android tests.
[ "Return", "binary", "paths", "used", "when", "running", "android", "tests", "." ]
def _GetBinaryPathsForAndroid(targets): android_binaries = set() for target in targets: so_library_path = os.path.join(BUILD_DIR, 'lib.unstripped', 'lib%s__library.so' % target) if os.path.exists(so_library_path): android_binaries.add(so_library_path) return list(a...
[ "def", "_GetBinaryPathsForAndroid", "(", "targets", ")", ":", "android_binaries", "=", "set", "(", ")", "for", "target", "in", "targets", ":", "so_library_path", "=", "os", ".", "path", ".", "join", "(", "BUILD_DIR", ",", "'lib.unstripped'", ",", "'lib%s__libr...
Return binary paths used when running android tests.
[ "Return", "binary", "paths", "used", "when", "running", "android", "tests", "." ]
[ "\"\"\"Return binary paths used when running android tests.\"\"\"", "# TODO(crbug.com/899974): Implement approach that doesn't assume .so file is", "# based on the target's name." ]
[ { "param": "targets", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "targets", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
8f57960b7d0ad74c052e5ee05e91920ce0d6adf8
sunlongbo/chromium
tools/code_coverage/coverage.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
_GetBinaryPathForWebTests
<not_specific>
def _GetBinaryPathForWebTests(): """Return binary path used to run blink web tests.""" host_platform = coverage_utils.GetHostPlatform() if host_platform == 'win': return os.path.join(BUILD_DIR, 'content_shell.exe') elif host_platform == 'linux': return os.path.join(BUILD_DIR, 'content_shell') elif hos...
Return binary path used to run blink web tests.
Return binary path used to run blink web tests.
[ "Return", "binary", "path", "used", "to", "run", "blink", "web", "tests", "." ]
def _GetBinaryPathForWebTests(): host_platform = coverage_utils.GetHostPlatform() if host_platform == 'win': return os.path.join(BUILD_DIR, 'content_shell.exe') elif host_platform == 'linux': return os.path.join(BUILD_DIR, 'content_shell') elif host_platform == 'mac': return os.path.join(BUILD_DIR, ...
[ "def", "_GetBinaryPathForWebTests", "(", ")", ":", "host_platform", "=", "coverage_utils", ".", "GetHostPlatform", "(", ")", "if", "host_platform", "==", "'win'", ":", "return", "os", ".", "path", ".", "join", "(", "BUILD_DIR", ",", "'content_shell.exe'", ")", ...
Return binary path used to run blink web tests.
[ "Return", "binary", "path", "used", "to", "run", "blink", "web", "tests", "." ]
[ "\"\"\"Return binary path used to run blink web tests.\"\"\"" ]
[]
{ "returns": [], "raises": [], "params": [], "outlier_params": [], "others": [] }
8f57960b7d0ad74c052e5ee05e91920ce0d6adf8
sunlongbo/chromium
tools/code_coverage/coverage.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
_SetMacXcodePath
<not_specific>
def _SetMacXcodePath(): """Set DEVELOPER_DIR to the path to hermetic Xcode.app on Mac OS X.""" if sys.platform != 'darwin': return xcode_path = os.path.join(SRC_ROOT_PATH, 'build', 'mac_files', 'Xcode.app') if os.path.exists(xcode_path): os.environ['DEVELOPER_DIR'] = xcode_path
Set DEVELOPER_DIR to the path to hermetic Xcode.app on Mac OS X.
Set DEVELOPER_DIR to the path to hermetic Xcode.app on Mac OS X.
[ "Set", "DEVELOPER_DIR", "to", "the", "path", "to", "hermetic", "Xcode", ".", "app", "on", "Mac", "OS", "X", "." ]
def _SetMacXcodePath(): if sys.platform != 'darwin': return xcode_path = os.path.join(SRC_ROOT_PATH, 'build', 'mac_files', 'Xcode.app') if os.path.exists(xcode_path): os.environ['DEVELOPER_DIR'] = xcode_path
[ "def", "_SetMacXcodePath", "(", ")", ":", "if", "sys", ".", "platform", "!=", "'darwin'", ":", "return", "xcode_path", "=", "os", ".", "path", ".", "join", "(", "SRC_ROOT_PATH", ",", "'build'", ",", "'mac_files'", ",", "'Xcode.app'", ")", "if", "os", "."...
Set DEVELOPER_DIR to the path to hermetic Xcode.app on Mac OS X.
[ "Set", "DEVELOPER_DIR", "to", "the", "path", "to", "hermetic", "Xcode", ".", "app", "on", "Mac", "OS", "X", "." ]
[ "\"\"\"Set DEVELOPER_DIR to the path to hermetic Xcode.app on Mac OS X.\"\"\"" ]
[]
{ "returns": [], "raises": [], "params": [], "outlier_params": [], "others": [] }
8f57960b7d0ad74c052e5ee05e91920ce0d6adf8
sunlongbo/chromium
tools/code_coverage/coverage.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
_ParseCommandArguments
<not_specific>
def _ParseCommandArguments(): """Adds and parses relevant arguments for tool comands. Returns: A dictionary representing the arguments. """ arg_parser = argparse.ArgumentParser() arg_parser.usage = __doc__ arg_parser.add_argument( '-b', '--build-dir', type=str, required=True, ...
Adds and parses relevant arguments for tool comands. Returns: A dictionary representing the arguments.
Adds and parses relevant arguments for tool comands.
[ "Adds", "and", "parses", "relevant", "arguments", "for", "tool", "comands", "." ]
def _ParseCommandArguments(): arg_parser = argparse.ArgumentParser() arg_parser.usage = __doc__ arg_parser.add_argument( '-b', '--build-dir', type=str, required=True, help='The build directory, the path needs to be relative to the root of ' 'the checkout.') arg_parser.add_arg...
[ "def", "_ParseCommandArguments", "(", ")", ":", "arg_parser", "=", "argparse", ".", "ArgumentParser", "(", ")", "arg_parser", ".", "usage", "=", "__doc__", "arg_parser", ".", "add_argument", "(", "'-b'", ",", "'--build-dir'", ",", "type", "=", "str", ",", "r...
Adds and parses relevant arguments for tool comands.
[ "Adds", "and", "parses", "relevant", "arguments", "for", "tool", "comands", "." ]
[ "\"\"\"Adds and parses relevant arguments for tool comands.\n\n Returns:\n A dictionary representing the arguments.\n \"\"\"" ]
[]
{ "returns": [ { "docstring": "A dictionary representing the arguments.", "docstring_tokens": [ "A", "dictionary", "representing", "the", "arguments", "." ], "type": null } ], "raises": [], "params": [], "outlier_params": [], "o...
655151c748d106d4e7601da19426bb165a23ffbd
sunlongbo/chromium
chrome/tools/build/mac/verify_dynamic_libraries.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
verify_image_libraries
<not_specific>
def verify_image_libraries(image_path, allowed_libraries, binary_path): """Verifies that the Mach-O image residing at |image_path| is only linked against dynamic libraries listed in |allowed_libraries|. The image does not have to link against everything that is allowed, but it cannot link against anythi...
Verifies that the Mach-O image residing at |image_path| is only linked against dynamic libraries listed in |allowed_libraries|. The image does not have to link against everything that is allowed, but it cannot link against anything that is not allowed. Returns True if the image only links against allowe...
Verifies that the Mach-O image residing at |image_path| is only linked against dynamic libraries listed in |allowed_libraries|. The image does not have to link against everything that is allowed, but it cannot link against anything that is not allowed. Returns True if the image only links against allowed libraries, and...
[ "Verifies", "that", "the", "Mach", "-", "O", "image", "residing", "at", "|image_path|", "is", "only", "linked", "against", "dynamic", "libraries", "listed", "in", "|allowed_libraries|", ".", "The", "image", "does", "not", "have", "to", "link", "against", "ever...
def verify_image_libraries(image_path, allowed_libraries, binary_path): output = subprocess.check_output( [binary_path + 'llvm-objdump', '--macho', '--dylibs-used', image_path]) output = output.decode('utf8').strip() disallowed_libraries = [] linked_libraries = output.split('\n')[1:] for lin...
[ "def", "verify_image_libraries", "(", "image_path", ",", "allowed_libraries", ",", "binary_path", ")", ":", "output", "=", "subprocess", ".", "check_output", "(", "[", "binary_path", "+", "'llvm-objdump'", ",", "'--macho'", ",", "'--dylibs-used'", ",", "image_path",...
Verifies that the Mach-O image residing at |image_path| is only linked against dynamic libraries listed in |allowed_libraries|.
[ "Verifies", "that", "the", "Mach", "-", "O", "image", "residing", "at", "|image_path|", "is", "only", "linked", "against", "dynamic", "libraries", "listed", "in", "|allowed_libraries|", "." ]
[ "\"\"\"Verifies that the Mach-O image residing at |image_path| is only linked\n against dynamic libraries listed in |allowed_libraries|. The image does\n not have to link against everything that is allowed, but it cannot link\n against anything that is not allowed. Returns True if the image only\n links...
[ { "param": "image_path", "type": null }, { "param": "allowed_libraries", "type": null }, { "param": "binary_path", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "image_path", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "allowed_libraries", "type": null, "docstring": null, "d...
32eb655414f0dc466d2dbdb71b73fe033871781a
sunlongbo/chromium
chrome/updater/test/service/win/proc_util.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
GetActiveSessionID
<not_specific>
def GetActiveSessionID(): """Get the active session ID.""" local_server = win32ts.WTS_CURRENT_SERVER_HANDLE for session in win32ts.WTSEnumerateSessions(local_server): if session['State'] == win32ts.WTSActive: return session['SessionId'] logging.warning('Unexpected: no active session.') return None
Get the active session ID.
Get the active session ID.
[ "Get", "the", "active", "session", "ID", "." ]
def GetActiveSessionID(): local_server = win32ts.WTS_CURRENT_SERVER_HANDLE for session in win32ts.WTSEnumerateSessions(local_server): if session['State'] == win32ts.WTSActive: return session['SessionId'] logging.warning('Unexpected: no active session.') return None
[ "def", "GetActiveSessionID", "(", ")", ":", "local_server", "=", "win32ts", ".", "WTS_CURRENT_SERVER_HANDLE", "for", "session", "in", "win32ts", ".", "WTSEnumerateSessions", "(", "local_server", ")", ":", "if", "session", "[", "'State'", "]", "==", "win32ts", "....
Get the active session ID.
[ "Get", "the", "active", "session", "ID", "." ]
[ "\"\"\"Get the active session ID.\"\"\"" ]
[]
{ "returns": [], "raises": [], "params": [], "outlier_params": [], "others": [] }
32eb655414f0dc466d2dbdb71b73fe033871781a
sunlongbo/chromium
chrome/updater/test/service/win/proc_util.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
GetPIDsWithName
<not_specific>
def GetPIDsWithName(image_name, session=None): """Gets all process PIDs, with the given image name. Args: image_name: Case-insensitive process image name. session: Session filter. Only search processes within given session. None means no filter. Returns: A list of process ID. """ cmd = [...
Gets all process PIDs, with the given image name. Args: image_name: Case-insensitive process image name. session: Session filter. Only search processes within given session. None means no filter. Returns: A list of process ID.
Gets all process PIDs, with the given image name.
[ "Gets", "all", "process", "PIDs", "with", "the", "given", "image", "name", "." ]
def GetPIDsWithName(image_name, session=None): cmd = ['tasklist', '/FO:csv', '/NH', '/FI', 'IMAGENAME eq %s' % image_name] if session is not None: cmd.extend(['/FI', 'SESSION eq %s' % session]) proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE) stdout, stderr = proc.communicate() ...
[ "def", "GetPIDsWithName", "(", "image_name", ",", "session", "=", "None", ")", ":", "cmd", "=", "[", "'tasklist'", ",", "'/FO:csv'", ",", "'/NH'", ",", "'/FI'", ",", "'IMAGENAME eq %s'", "%", "image_name", "]", "if", "session", "is", "not", "None", ":", ...
Gets all process PIDs, with the given image name.
[ "Gets", "all", "process", "PIDs", "with", "the", "given", "image", "name", "." ]
[ "\"\"\"Gets all process PIDs, with the given image name.\n\n Args:\n image_name: Case-insensitive process image name.\n session: Session filter. Only search processes within given session.\n None means no filter.\n\n Returns:\n A list of process ID.\n \"\"\"" ]
[ { "param": "image_name", "type": null }, { "param": "session", "type": null } ]
{ "returns": [ { "docstring": "A list of process ID.", "docstring_tokens": [ "A", "list", "of", "process", "ID", "." ], "type": null } ], "raises": [], "params": [ { "identifier": "image_name", "type": null, "d...
17e013826fa75a1a2d296bc3aa079a614f19eabe
sunlongbo/chromium
tools/perf/contrib/vr_benchmarks/desktop_runtimes/base_runtime.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
SetupSandboxAcls
null
def SetupSandboxAcls(self, directory): """Sets up ACLs on a directory for sandbox support. No-op of the ACLs are already set. Args: directory: A path pointing to the directory to set the ACLs on. """ # Import here instead of at the top of the file to prevent issues with # Telemetry unitt...
Sets up ACLs on a directory for sandbox support. No-op of the ACLs are already set. Args: directory: A path pointing to the directory to set the ACLs on.
Sets up ACLs on a directory for sandbox support. No-op of the ACLs are already set.
[ "Sets", "up", "ACLs", "on", "a", "directory", "for", "sandbox", "support", ".", "No", "-", "op", "of", "the", "ACLs", "are", "already", "set", "." ]
def SetupSandboxAcls(self, directory): import_dir = os.path.join( os.path.dirname(__file__), '..', '..', '..', '..', '..', 'chrome', 'browser', 'vr', 'test') if import_dir not in sys.path: sys.path.append(import_dir) import run_xr_browser_tests run_xr_browser_tests.SetupWindowsACLs...
[ "def", "SetupSandboxAcls", "(", "self", ",", "directory", ")", ":", "import_dir", "=", "os", ".", "path", ".", "join", "(", "os", ".", "path", ".", "dirname", "(", "__file__", ")", ",", "'..'", ",", "'..'", ",", "'..'", ",", "'..'", ",", "'..'", ",...
Sets up ACLs on a directory for sandbox support.
[ "Sets", "up", "ACLs", "on", "a", "directory", "for", "sandbox", "support", "." ]
[ "\"\"\"Sets up ACLs on a directory for sandbox support.\n\n No-op of the ACLs are already set.\n\n Args:\n directory: A path pointing to the directory to set the ACLs on.\n \"\"\"", "# Import here instead of at the top of the file to prevent issues with", "# Telemetry unittests not properly includ...
[ { "param": "self", "type": null }, { "param": "directory", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "directory", "type": null, "docstring": "A path pointing to the dire...
13d26af099b89ac26efe3e91522ad0ef2277e3fd
sunlongbo/chromium
remoting/tools/build/remoting_localize.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
ReadValuesFromFile
null
def ReadValuesFromFile(values_dict, file_name): """ Reads NAME=VALUE settings from the specified file. Everything to the left of the first '=' is the keyword, everything to the right is the value. No stripping of white space, so beware. The file must exist, otherwise you get the Python exception from ope...
Reads NAME=VALUE settings from the specified file. Everything to the left of the first '=' is the keyword, everything to the right is the value. No stripping of white space, so beware. The file must exist, otherwise you get the Python exception from open().
Reads NAME=VALUE settings from the specified file. Everything to the left of the first '=' is the keyword, everything to the right is the value. No stripping of white space, so beware. The file must exist, otherwise you get the Python exception from open().
[ "Reads", "NAME", "=", "VALUE", "settings", "from", "the", "specified", "file", ".", "Everything", "to", "the", "left", "of", "the", "first", "'", "=", "'", "is", "the", "keyword", "everything", "to", "the", "right", "is", "the", "value", ".", "No", "st...
def ReadValuesFromFile(values_dict, file_name): for line in open(file_name, 'r').readlines(): key, val = line.rstrip('\r\n').split('=', 1) values_dict[key] = val
[ "def", "ReadValuesFromFile", "(", "values_dict", ",", "file_name", ")", ":", "for", "line", "in", "open", "(", "file_name", ",", "'r'", ")", ".", "readlines", "(", ")", ":", "key", ",", "val", "=", "line", ".", "rstrip", "(", "'\\r\\n'", ")", ".", "s...
Reads NAME=VALUE settings from the specified file.
[ "Reads", "NAME", "=", "VALUE", "settings", "from", "the", "specified", "file", "." ]
[ "\"\"\"\n Reads NAME=VALUE settings from the specified file.\n\n Everything to the left of the first '=' is the keyword,\n everything to the right is the value. No stripping of\n white space, so beware.\n\n The file must exist, otherwise you get the Python exception from open().\n \"\"\"" ]
[ { "param": "values_dict", "type": null }, { "param": "file_name", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "values_dict", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "file_name", "type": null, "docstring": null, "docstrin...
13d26af099b89ac26efe3e91522ad0ef2277e3fd
sunlongbo/chromium
remoting/tools/build/remoting_localize.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
ReadMessagesFromFile
<not_specific>
def ReadMessagesFromFile(file_name): """ Reads messages from a 'chrome_messages_json' file. The file must exist, otherwise you get the Python exception from open(). """ messages_file = io.open(file_name, encoding='utf-8-sig') messages = json.load(messages_file) messages_file.close() values = {} for ...
Reads messages from a 'chrome_messages_json' file. The file must exist, otherwise you get the Python exception from open().
Reads messages from a 'chrome_messages_json' file. The file must exist, otherwise you get the Python exception from open().
[ "Reads", "messages", "from", "a", "'", "chrome_messages_json", "'", "file", ".", "The", "file", "must", "exist", "otherwise", "you", "get", "the", "Python", "exception", "from", "open", "()", "." ]
def ReadMessagesFromFile(file_name): messages_file = io.open(file_name, encoding='utf-8-sig') messages = json.load(messages_file) messages_file.close() values = {} for key in messages.keys(): values[key] = messages[key]['message']; return values
[ "def", "ReadMessagesFromFile", "(", "file_name", ")", ":", "messages_file", "=", "io", ".", "open", "(", "file_name", ",", "encoding", "=", "'utf-8-sig'", ")", "messages", "=", "json", ".", "load", "(", "messages_file", ")", "messages_file", ".", "close", "(...
Reads messages from a 'chrome_messages_json' file.
[ "Reads", "messages", "from", "a", "'", "chrome_messages_json", "'", "file", "." ]
[ "\"\"\"\n Reads messages from a 'chrome_messages_json' file.\n\n The file must exist, otherwise you get the Python exception from open().\n \"\"\"" ]
[ { "param": "file_name", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "file_name", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
13d26af099b89ac26efe3e91522ad0ef2277e3fd
sunlongbo/chromium
remoting/tools/build/remoting_localize.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
WriteIfChanged
<not_specific>
def WriteIfChanged(file_name, contents, encoding): """ Writes the specified contents to the specified file_name iff the contents are different than the current contents. """ try: target = io.open(file_name, 'r') old_contents = target.read() except EnvironmentError: pass except UnicodeDecodeErr...
Writes the specified contents to the specified file_name iff the contents are different than the current contents.
Writes the specified contents to the specified file_name iff the contents are different than the current contents.
[ "Writes", "the", "specified", "contents", "to", "the", "specified", "file_name", "iff", "the", "contents", "are", "different", "than", "the", "current", "contents", "." ]
def WriteIfChanged(file_name, contents, encoding): try: target = io.open(file_name, 'r') old_contents = target.read() except EnvironmentError: pass except UnicodeDecodeError: target.close() os.unlink(file_name) else: if contents == old_contents: return target.close() os.unl...
[ "def", "WriteIfChanged", "(", "file_name", ",", "contents", ",", "encoding", ")", ":", "try", ":", "target", "=", "io", ".", "open", "(", "file_name", ",", "'r'", ")", "old_contents", "=", "target", ".", "read", "(", ")", "except", "EnvironmentError", ":...
Writes the specified contents to the specified file_name iff the contents are different than the current contents.
[ "Writes", "the", "specified", "contents", "to", "the", "specified", "file_name", "iff", "the", "contents", "are", "different", "than", "the", "current", "contents", "." ]
[ "\"\"\"\n Writes the specified contents to the specified file_name\n iff the contents are different than the current contents.\n \"\"\"" ]
[ { "param": "file_name", "type": null }, { "param": "contents", "type": null }, { "param": "encoding", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "file_name", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "contents", "type": null, "docstring": null, "docstring_t...
13d26af099b89ac26efe3e91522ad0ef2277e3fd
sunlongbo/chromium
remoting/tools/build/remoting_localize.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
GetText
<not_specific>
def GetText(self, message): """ Returns a localized message for the current language. """ try: return self.message_map[self.language][message] except: return self.message_map['en'][message]
Returns a localized message for the current language.
Returns a localized message for the current language.
[ "Returns", "a", "localized", "message", "for", "the", "current", "language", "." ]
def GetText(self, message): try: return self.message_map[self.language][message] except: return self.message_map['en'][message]
[ "def", "GetText", "(", "self", ",", "message", ")", ":", "try", ":", "return", "self", ".", "message_map", "[", "self", ".", "language", "]", "[", "message", "]", "except", ":", "return", "self", ".", "message_map", "[", "'en'", "]", "[", "message", ...
Returns a localized message for the current language.
[ "Returns", "a", "localized", "message", "for", "the", "current", "language", "." ]
[ "\"\"\" Returns a localized message for the current language. \"\"\"" ]
[ { "param": "self", "type": null }, { "param": "message", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "message", "type": null, "docstring": null, "docstring_tokens"...
ebcdc66db18454b789983dd0cb191326cda40dcc
sunlongbo/chromium
tools/json_schema_compiler/js_util.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
AppendObjectDefinition
<not_specific>
def AppendObjectDefinition(self, c, namespace_name, properties, new_line=True): """Given an OrderedDict of properties, returns a Code containing the description of an object. """ if not properties: return c.Sblock('{', new_line=new_line) first = True ...
Given an OrderedDict of properties, returns a Code containing the description of an object.
Given an OrderedDict of properties, returns a Code containing the description of an object.
[ "Given", "an", "OrderedDict", "of", "properties", "returns", "a", "Code", "containing", "the", "description", "of", "an", "object", "." ]
def AppendObjectDefinition(self, c, namespace_name, properties, new_line=True): if not properties: return c.Sblock('{', new_line=new_line) first = True for field, prop in properties.items(): if not first: c.Append(',', new_line=False) first = Fals...
[ "def", "AppendObjectDefinition", "(", "self", ",", "c", ",", "namespace_name", ",", "properties", ",", "new_line", "=", "True", ")", ":", "if", "not", "properties", ":", "return", "c", ".", "Sblock", "(", "'{'", ",", "new_line", "=", "new_line", ")", "fi...
Given an OrderedDict of properties, returns a Code containing the description of an object.
[ "Given", "an", "OrderedDict", "of", "properties", "returns", "a", "Code", "containing", "the", "description", "of", "an", "object", "." ]
[ "\"\"\"Given an OrderedDict of properties, returns a Code containing the\n description of an object.\n \"\"\"", "# Avoid trailing comma.", "# TODO(devlin): This will be unneeded, if/when", "# https://github.com/google/closure-compiler/issues/796 is fixed." ]
[ { "param": "self", "type": null }, { "param": "c", "type": null }, { "param": "namespace_name", "type": null }, { "param": "properties", "type": null }, { "param": "new_line", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "c", "type": null, "docstring": null, "docstring_tokens": [], ...
ebcdc66db18454b789983dd0cb191326cda40dcc
sunlongbo/chromium
tools/json_schema_compiler/js_util.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
AppendFunctionJsDoc
null
def AppendFunctionJsDoc(self, c, namespace_name, function): """Appends the documentation for a function as a Code. Returns an empty code object if the object has no documentation. """ c.Sblock(line='/**', line_prefix=' * ') if function.description: c.Comment(function.description, comment_pre...
Appends the documentation for a function as a Code. Returns an empty code object if the object has no documentation.
Appends the documentation for a function as a Code. Returns an empty code object if the object has no documentation.
[ "Appends", "the", "documentation", "for", "a", "function", "as", "a", "Code", ".", "Returns", "an", "empty", "code", "object", "if", "the", "object", "has", "no", "documentation", "." ]
def AppendFunctionJsDoc(self, c, namespace_name, function): c.Sblock(line='/**', line_prefix=' * ') if function.description: c.Comment(function.description, comment_prefix='') def append_field(c, tag, js_type, name, optional, description): c.Append('@%s {' % tag) c.Concat(js_type, new_line...
[ "def", "AppendFunctionJsDoc", "(", "self", ",", "c", ",", "namespace_name", ",", "function", ")", ":", "c", ".", "Sblock", "(", "line", "=", "'/**'", ",", "line_prefix", "=", "' * '", ")", "if", "function", ".", "description", ":", "c", ".", "Comment", ...
Appends the documentation for a function as a Code.
[ "Appends", "the", "documentation", "for", "a", "function", "as", "a", "Code", "." ]
[ "\"\"\"Appends the documentation for a function as a Code.\n\n Returns an empty code object if the object has no documentation.\n \"\"\"", "# Mark the parameter as optional, *only if* all following parameters are", "# also optional, to avoid JSC_OPTIONAL_ARG_AT_END errors thrown by Closure", "# Compiler...
[ { "param": "self", "type": null }, { "param": "c", "type": null }, { "param": "namespace_name", "type": null }, { "param": "function", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "c", "type": null, "docstring": null, "docstring_tokens": [], ...
ebcdc66db18454b789983dd0cb191326cda40dcc
sunlongbo/chromium
tools/json_schema_compiler/js_util.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
AppendTypeJsDoc
null
def AppendTypeJsDoc(self, c, namespace_name, js_type, optional): """Appends the documentation for a type as a Code. """ c.Append('@type {') if optional: c.Append('(', new_line=False) c.Concat(self._TypeToJsType(namespace_name, js_type), new_line=False) c.Append('|undefined)', new_line=...
Appends the documentation for a type as a Code.
Appends the documentation for a type as a Code.
[ "Appends", "the", "documentation", "for", "a", "type", "as", "a", "Code", "." ]
def AppendTypeJsDoc(self, c, namespace_name, js_type, optional): c.Append('@type {') if optional: c.Append('(', new_line=False) c.Concat(self._TypeToJsType(namespace_name, js_type), new_line=False) c.Append('|undefined)', new_line=False) else: c.Concat(self._TypeToJsType(namespace_na...
[ "def", "AppendTypeJsDoc", "(", "self", ",", "c", ",", "namespace_name", ",", "js_type", ",", "optional", ")", ":", "c", ".", "Append", "(", "'@type {'", ")", "if", "optional", ":", "c", ".", "Append", "(", "'('", ",", "new_line", "=", "False", ")", "...
Appends the documentation for a type as a Code.
[ "Appends", "the", "documentation", "for", "a", "type", "as", "a", "Code", "." ]
[ "\"\"\"Appends the documentation for a type as a Code.\n \"\"\"" ]
[ { "param": "self", "type": null }, { "param": "c", "type": null }, { "param": "namespace_name", "type": null }, { "param": "js_type", "type": null }, { "param": "optional", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "c", "type": null, "docstring": null, "docstring_tokens": [], ...
ebcdc66db18454b789983dd0cb191326cda40dcc
sunlongbo/chromium
tools/json_schema_compiler/js_util.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
_ReturnsAsyncToJsFunction
<not_specific>
def _ReturnsAsyncToJsFunction(self, namespace_name, returns_async): """Converts a model.ReturnsAsync to a JS function equivalent""" # TODO(https://crbug.com/1142991) update this to generate promise-based # types and show that as a return from the API function itself, rather than # appended to the params...
Converts a model.ReturnsAsync to a JS function equivalent
Converts a model.ReturnsAsync to a JS function equivalent
[ "Converts", "a", "model", ".", "ReturnsAsync", "to", "a", "JS", "function", "equivalent" ]
def _ReturnsAsyncToJsFunction(self, namespace_name, returns_async): c = Code() c.Append('function(') c.Concat( self._FunctionParamsToJsParams(namespace_name, returns_async.params), new_line=False) c.Append('): ', new_line=False, strip_right=False) c.Append('void', new_line=False) ...
[ "def", "_ReturnsAsyncToJsFunction", "(", "self", ",", "namespace_name", ",", "returns_async", ")", ":", "c", "=", "Code", "(", ")", "c", ".", "Append", "(", "'function('", ")", "c", ".", "Concat", "(", "self", ".", "_FunctionParamsToJsParams", "(", "namespac...
Converts a model.ReturnsAsync to a JS function equivalent
[ "Converts", "a", "model", ".", "ReturnsAsync", "to", "a", "JS", "function", "equivalent" ]
[ "\"\"\"Converts a model.ReturnsAsync to a JS function equivalent\"\"\"", "# TODO(https://crbug.com/1142991) update this to generate promise-based", "# types and show that as a return from the API function itself, rather than", "# appended to the params as a callback." ]
[ { "param": "self", "type": null }, { "param": "namespace_name", "type": null }, { "param": "returns_async", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "namespace_name", "type": null, "docstring": null, "docstring_...
ebd4dbb4092f5d2a748d64c0538f1e046cd35be7
sunlongbo/chromium
tools/perf/cli_tools/flakiness_cli/api.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
_Request
<not_specific>
def _Request(path, params=None): """Request json data from the test results server.""" url = TEST_RESULTS_SERVER + path if params: url += '?' + six.moves.urllib.parse.urlencode(params) request = six.moves.urllib.request.Request( url, headers={'User-Agent': TOOL_USER_AGENT}) response = six.moves.urll...
Request json data from the test results server.
Request json data from the test results server.
[ "Request", "json", "data", "from", "the", "test", "results", "server", "." ]
def _Request(path, params=None): url = TEST_RESULTS_SERVER + path if params: url += '?' + six.moves.urllib.parse.urlencode(params) request = six.moves.urllib.request.Request( url, headers={'User-Agent': TOOL_USER_AGENT}) response = six.moves.urllib.request.urlopen(request) return json.load(response)
[ "def", "_Request", "(", "path", ",", "params", "=", "None", ")", ":", "url", "=", "TEST_RESULTS_SERVER", "+", "path", "if", "params", ":", "url", "+=", "'?'", "+", "six", ".", "moves", ".", "urllib", ".", "parse", ".", "urlencode", "(", "params", ")"...
Request json data from the test results server.
[ "Request", "json", "data", "from", "the", "test", "results", "server", "." ]
[ "\"\"\"Request json data from the test results server.\"\"\"" ]
[ { "param": "path", "type": null }, { "param": "params", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "path", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "params", "type": null, "docstring": null, "docstring_tokens":...
ebd4dbb4092f5d2a748d64c0538f1e046cd35be7
sunlongbo/chromium
tools/perf/cli_tools/flakiness_cli/api.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
GetTestResults
<not_specific>
def GetTestResults(master, builder, test_type): """Retrieve test results json for a given master, builder, and test_type.""" return _Request('/testfile', { 'name': 'results.json', 'master': master, 'builder': builder, 'testtype': test_type})
Retrieve test results json for a given master, builder, and test_type.
Retrieve test results json for a given master, builder, and test_type.
[ "Retrieve", "test", "results", "json", "for", "a", "given", "master", "builder", "and", "test_type", "." ]
def GetTestResults(master, builder, test_type): return _Request('/testfile', { 'name': 'results.json', 'master': master, 'builder': builder, 'testtype': test_type})
[ "def", "GetTestResults", "(", "master", ",", "builder", ",", "test_type", ")", ":", "return", "_Request", "(", "'/testfile'", ",", "{", "'name'", ":", "'results.json'", ",", "'master'", ":", "master", ",", "'builder'", ":", "builder", ",", "'testtype'", ":",...
Retrieve test results json for a given master, builder, and test_type.
[ "Retrieve", "test", "results", "json", "for", "a", "given", "master", "builder", "and", "test_type", "." ]
[ "\"\"\"Retrieve test results json for a given master, builder, and test_type.\"\"\"" ]
[ { "param": "master", "type": null }, { "param": "builder", "type": null }, { "param": "test_type", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "master", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "builder", "type": null, "docstring": null, "docstring_token...
ef23d4c3a7b4bb90724c336c7df403bd2cc2e783
sunlongbo/chromium
third_party/libxml/chromium/roll.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
remove_tracked_files
null
def remove_tracked_files(files_to_remove): """Removes tracked files from git. Arguments: files_to_remove: The files to remove. """ files_to_remove = [f for f in files_to_remove if os.path.exists(f)] if files_to_remove: git('rm', '-rf', *files_to_remove)
Removes tracked files from git. Arguments: files_to_remove: The files to remove.
Removes tracked files from git.
[ "Removes", "tracked", "files", "from", "git", "." ]
def remove_tracked_files(files_to_remove): files_to_remove = [f for f in files_to_remove if os.path.exists(f)] if files_to_remove: git('rm', '-rf', *files_to_remove)
[ "def", "remove_tracked_files", "(", "files_to_remove", ")", ":", "files_to_remove", "=", "[", "f", "for", "f", "in", "files_to_remove", "if", "os", ".", "path", ".", "exists", "(", "f", ")", "]", "if", "files_to_remove", ":", "git", "(", "'rm'", ",", "'-...
Removes tracked files from git.
[ "Removes", "tracked", "files", "from", "git", "." ]
[ "\"\"\"Removes tracked files from git.\n\n Arguments:\n files_to_remove: The files to remove.\n \"\"\"" ]
[ { "param": "files_to_remove", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "files_to_remove", "type": null, "docstring": "The files to remove.", "docstring_tokens": [ "The", "files", "to", "remove", "." ], "default": null, "is_optional": null ...
40c2ff52bb583bf5ce27be51ee69c2dd99f3c4fb
sunlongbo/chromium
components/policy/tools/template_writers/writers/xml_writer_base_unittest.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
GetXMLOfChildren
<not_specific>
def GetXMLOfChildren(self, parent): '''Returns the XML of all child nodes of the given parent node. Args: parent: The XML of the children of this node will be returned. Return: XML of the chrildren of the parent node. ''' raw_pretty_xml = ''.join( child.toprettyxml(indent=' ') for c...
Returns the XML of all child nodes of the given parent node. Args: parent: The XML of the children of this node will be returned. Return: XML of the chrildren of the parent node.
Returns the XML of all child nodes of the given parent node.
[ "Returns", "the", "XML", "of", "all", "child", "nodes", "of", "the", "given", "parent", "node", "." ]
def GetXMLOfChildren(self, parent): raw_pretty_xml = ''.join( child.toprettyxml(indent=' ') for child in parent.childNodes) text_re = re.compile('>\n\s+([^<>\s].*?)\n\s*</', re.DOTALL) return text_re.sub('>\g<1></', raw_pretty_xml)
[ "def", "GetXMLOfChildren", "(", "self", ",", "parent", ")", ":", "raw_pretty_xml", "=", "''", ".", "join", "(", "child", ".", "toprettyxml", "(", "indent", "=", "' '", ")", "for", "child", "in", "parent", ".", "childNodes", ")", "text_re", "=", "re", ...
Returns the XML of all child nodes of the given parent node.
[ "Returns", "the", "XML", "of", "all", "child", "nodes", "of", "the", "given", "parent", "node", "." ]
[ "'''Returns the XML of all child nodes of the given parent node.\n Args:\n parent: The XML of the children of this node will be returned.\n\n Return: XML of the chrildren of the parent node.\n '''", "# Python 2.6.5 which is present in Lucid has bug in its pretty print", "# function which produces...
[ { "param": "self", "type": null }, { "param": "parent", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "parent", "type": null, "docstring": "The XML of the children of thi...
40c2ff52bb583bf5ce27be51ee69c2dd99f3c4fb
sunlongbo/chromium
components/policy/tools/template_writers/writers/xml_writer_base_unittest.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
AssertXMLEquals
null
def AssertXMLEquals(self, output, expected_output): '''Asserts if the passed XML arguements are equal. Args: output: Actual XML text. expected_output: Expected XML text. ''' self.assertEquals(output.strip(), expected_output.strip())
Asserts if the passed XML arguements are equal. Args: output: Actual XML text. expected_output: Expected XML text.
Asserts if the passed XML arguements are equal.
[ "Asserts", "if", "the", "passed", "XML", "arguements", "are", "equal", "." ]
def AssertXMLEquals(self, output, expected_output): self.assertEquals(output.strip(), expected_output.strip())
[ "def", "AssertXMLEquals", "(", "self", ",", "output", ",", "expected_output", ")", ":", "self", ".", "assertEquals", "(", "output", ".", "strip", "(", ")", ",", "expected_output", ".", "strip", "(", ")", ")" ]
Asserts if the passed XML arguements are equal.
[ "Asserts", "if", "the", "passed", "XML", "arguements", "are", "equal", "." ]
[ "'''Asserts if the passed XML arguements are equal.\n Args:\n output: Actual XML text.\n expected_output: Expected XML text.\n '''" ]
[ { "param": "self", "type": null }, { "param": "output", "type": null }, { "param": "expected_output", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "output", "type": null, "docstring": "Actual XML text.", "docs...
c5f01c8bdabc4825b3f8e13ebb4123ac90535886
sunlongbo/chromium
tools/site_compare/scrapers/chrome/__init__.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
GetScraper
<not_specific>
def GetScraper(version): """Returns the scraper module for the given version. Args: version: version string of Chrome, or None for most recent Returns: scrape module for given version """ if version is None: version = "0.1.101.0" parsed_version = [int(x) for x in version.split(".")] if (pa...
Returns the scraper module for the given version. Args: version: version string of Chrome, or None for most recent Returns: scrape module for given version
Returns the scraper module for the given version.
[ "Returns", "the", "scraper", "module", "for", "the", "given", "version", "." ]
def GetScraper(version): if version is None: version = "0.1.101.0" parsed_version = [int(x) for x in version.split(".")] if (parsed_version[0] > 0 or parsed_version[1] > 1 or parsed_version[2] > 97 or parsed_version[3] > 0): scraper_version = "chrome011010" else: scraper_version = ...
[ "def", "GetScraper", "(", "version", ")", ":", "if", "version", "is", "None", ":", "version", "=", "\"0.1.101.0\"", "parsed_version", "=", "[", "int", "(", "x", ")", "for", "x", "in", "version", ".", "split", "(", "\".\"", ")", "]", "if", "(", "parse...
Returns the scraper module for the given version.
[ "Returns", "the", "scraper", "module", "for", "the", "given", "version", "." ]
[ "\"\"\"Returns the scraper module for the given version.\n\n Args:\n version: version string of Chrome, or None for most recent\n\n Returns:\n scrape module for given version\n \"\"\"" ]
[ { "param": "version", "type": null } ]
{ "returns": [ { "docstring": "scrape module for given version", "docstring_tokens": [ "scrape", "module", "for", "given", "version" ], "type": null } ], "raises": [], "params": [ { "identifier": "version", "type": null, ...
0aa3750b418a165162ebfad3a81886a377e6e1e0
sunlongbo/chromium
tools/perf/page_sets/login_helpers/pinterest_login.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
LoginDesktopAccount
null
def LoginDesktopAccount(action_runner, credential, credentials_path=login_utils.DEFAULT_CREDENTIAL_PATH): """Logs in into a Pinterest account on desktop. This function navigates the tab into Pinterest's login page and logs in a user using credentials in |credential| part of the |credentia...
Logs in into a Pinterest account on desktop. This function navigates the tab into Pinterest's login page and logs in a user using credentials in |credential| part of the |credentials_path| file. Args: action_runner: Action runner responsible for running actions on the page. credential: The credential to...
Logs in into a Pinterest account on desktop. This function navigates the tab into Pinterest's login page and logs in a user using credentials in |credential| part of the |credentials_path| file. Action runner responsible for running actions on the page. credential: The credential to retrieve from the credentials file ...
[ "Logs", "in", "into", "a", "Pinterest", "account", "on", "desktop", ".", "This", "function", "navigates", "the", "tab", "into", "Pinterest", "'", "s", "login", "page", "and", "logs", "in", "a", "user", "using", "credentials", "in", "|credential|", "part", ...
def LoginDesktopAccount(action_runner, credential, credentials_path=login_utils.DEFAULT_CREDENTIAL_PATH): _LoginAccount(action_runner, credential, credentials_path) action_runner.WaitForElement(selector='input[name=searchBoxInput]')
[ "def", "LoginDesktopAccount", "(", "action_runner", ",", "credential", ",", "credentials_path", "=", "login_utils", ".", "DEFAULT_CREDENTIAL_PATH", ")", ":", "_LoginAccount", "(", "action_runner", ",", "credential", ",", "credentials_path", ")", "action_runner", ".", ...
Logs in into a Pinterest account on desktop.
[ "Logs", "in", "into", "a", "Pinterest", "account", "on", "desktop", "." ]
[ "\"\"\"Logs in into a Pinterest account on desktop.\n\n This function navigates the tab into Pinterest's login page and logs in a user\n using credentials in |credential| part of the |credentials_path| file.\n\n Args:\n action_runner: Action runner responsible for running actions on the page.\n credential:...
[ { "param": "action_runner", "type": null }, { "param": "credential", "type": null }, { "param": "credentials_path", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "action_runner", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "credential", "type": null, "docstring": null, "docst...
0aa3750b418a165162ebfad3a81886a377e6e1e0
sunlongbo/chromium
tools/perf/page_sets/login_helpers/pinterest_login.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
LoginMobileAccount
null
def LoginMobileAccount(action_runner, credential, credentials_path=login_utils.DEFAULT_CREDENTIAL_PATH): """Logs in into a Pinterest account on mobile. This function navigates the tab into Pinterest's login page and logs in a user using credentials in |credential| part of the |credentials...
Logs in into a Pinterest account on mobile. This function navigates the tab into Pinterest's login page and logs in a user using credentials in |credential| part of the |credentials_path| file. Args: action_runner: Action runner responsible for running actions on the page. credential: The credential to ...
Logs in into a Pinterest account on mobile. This function navigates the tab into Pinterest's login page and logs in a user using credentials in |credential| part of the |credentials_path| file. Action runner responsible for running actions on the page. credential: The credential to retrieve from the credentials file (...
[ "Logs", "in", "into", "a", "Pinterest", "account", "on", "mobile", ".", "This", "function", "navigates", "the", "tab", "into", "Pinterest", "'", "s", "login", "page", "and", "logs", "in", "a", "user", "using", "credentials", "in", "|credential|", "part", "...
def LoginMobileAccount(action_runner, credential, credentials_path=login_utils.DEFAULT_CREDENTIAL_PATH): wait_for_local_storage = """ (function() { try { const state = JSON.parse(window.localStorage.REDUX_STATE); return state.users[state.session.userId].login_state; } cat...
[ "def", "LoginMobileAccount", "(", "action_runner", ",", "credential", ",", "credentials_path", "=", "login_utils", ".", "DEFAULT_CREDENTIAL_PATH", ")", ":", "wait_for_local_storage", "=", "\"\"\"\n (function() {\n try {\n const state = JSON.parse(window.localStorage.REDUX_ST...
Logs in into a Pinterest account on mobile.
[ "Logs", "in", "into", "a", "Pinterest", "account", "on", "mobile", "." ]
[ "\"\"\"Logs in into a Pinterest account on mobile.\n\n This function navigates the tab into Pinterest's login page and logs in a user\n using credentials in |credential| part of the |credentials_path| file.\n\n Args:\n action_runner: Action runner responsible for running actions on the page.\n credential: ...
[ { "param": "action_runner", "type": null }, { "param": "credential", "type": null }, { "param": "credentials_path", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "action_runner", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "credential", "type": null, "docstring": null, "docst...
c98c88c1fa37ce808831074d8dc6aa590b6f0287
sunlongbo/chromium
tools/perf/core/results_processor/processor_test.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
CreateHtmlTraceArtifact
<not_specific>
def CreateHtmlTraceArtifact(self): """Create an empty file as a fake html trace.""" with tempfile.NamedTemporaryFile( dir=self.intermediate_dir, delete=False) as artifact_file: pass return (compute_metrics.HTML_TRACE_NAME, testing.Artifact(artifact_file.name))
Create an empty file as a fake html trace.
Create an empty file as a fake html trace.
[ "Create", "an", "empty", "file", "as", "a", "fake", "html", "trace", "." ]
def CreateHtmlTraceArtifact(self): with tempfile.NamedTemporaryFile( dir=self.intermediate_dir, delete=False) as artifact_file: pass return (compute_metrics.HTML_TRACE_NAME, testing.Artifact(artifact_file.name))
[ "def", "CreateHtmlTraceArtifact", "(", "self", ")", ":", "with", "tempfile", ".", "NamedTemporaryFile", "(", "dir", "=", "self", ".", "intermediate_dir", ",", "delete", "=", "False", ")", "as", "artifact_file", ":", "pass", "return", "(", "compute_metrics", "....
Create an empty file as a fake html trace.
[ "Create", "an", "empty", "file", "as", "a", "fake", "html", "trace", "." ]
[ "\"\"\"Create an empty file as a fake html trace.\"\"\"" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
c98c88c1fa37ce808831074d8dc6aa590b6f0287
sunlongbo/chromium
tools/perf/core/results_processor/processor_test.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
CreateProtoTraceArtifact
<not_specific>
def CreateProtoTraceArtifact(self): """Create an empty file as a fake proto trace.""" with tempfile.NamedTemporaryFile( dir=self.intermediate_dir, delete=False) as artifact_file: pass return (compute_metrics.CONCATENATED_PROTO_NAME, testing.Artifact(artifact_file.name))
Create an empty file as a fake proto trace.
Create an empty file as a fake proto trace.
[ "Create", "an", "empty", "file", "as", "a", "fake", "proto", "trace", "." ]
def CreateProtoTraceArtifact(self): with tempfile.NamedTemporaryFile( dir=self.intermediate_dir, delete=False) as artifact_file: pass return (compute_metrics.CONCATENATED_PROTO_NAME, testing.Artifact(artifact_file.name))
[ "def", "CreateProtoTraceArtifact", "(", "self", ")", ":", "with", "tempfile", ".", "NamedTemporaryFile", "(", "dir", "=", "self", ".", "intermediate_dir", ",", "delete", "=", "False", ")", "as", "artifact_file", ":", "pass", "return", "(", "compute_metrics", "...
Create an empty file as a fake proto trace.
[ "Create", "an", "empty", "file", "as", "a", "fake", "proto", "trace", "." ]
[ "\"\"\"Create an empty file as a fake proto trace.\"\"\"" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
c98c88c1fa37ce808831074d8dc6aa590b6f0287
sunlongbo/chromium
tools/perf/core/results_processor/processor_test.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
CreateDiagnosticsArtifact
<not_specific>
def CreateDiagnosticsArtifact(self, **diagnostics): """Create an artifact with diagnostics.""" with tempfile.NamedTemporaryFile(dir=self.intermediate_dir, delete=False, mode='w') as artifact_file: json.dump({'diagnostics': diagnosti...
Create an artifact with diagnostics.
Create an artifact with diagnostics.
[ "Create", "an", "artifact", "with", "diagnostics", "." ]
def CreateDiagnosticsArtifact(self, **diagnostics): with tempfile.NamedTemporaryFile(dir=self.intermediate_dir, delete=False, mode='w') as artifact_file: json.dump({'diagnostics': diagnostics}, artifact_file) return processor.DIAGNO...
[ "def", "CreateDiagnosticsArtifact", "(", "self", ",", "**", "diagnostics", ")", ":", "with", "tempfile", ".", "NamedTemporaryFile", "(", "dir", "=", "self", ".", "intermediate_dir", ",", "delete", "=", "False", ",", "mode", "=", "'w'", ")", "as", "artifact_f...
Create an artifact with diagnostics.
[ "Create", "an", "artifact", "with", "diagnostics", "." ]
[ "\"\"\"Create an artifact with diagnostics.\"\"\"" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
3c05dfef7bd03bee0e969558d3bd7bde75ee74a5
sunlongbo/chromium
testing/merge_scripts/results_merger.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
merge_tries
<not_specific>
def merge_tries(source, dest): """ Merges test tries. This is intended for use as a merge_func parameter to merge_value. Args: source: A result json test trie. dest: A json test trie merge destination. """ # merge_tries merges source into dest by performing a lock-step depth-first # traversal ...
Merges test tries. This is intended for use as a merge_func parameter to merge_value. Args: source: A result json test trie. dest: A json test trie merge destination.
Merges test tries. This is intended for use as a merge_func parameter to merge_value.
[ "Merges", "test", "tries", ".", "This", "is", "intended", "for", "use", "as", "a", "merge_func", "parameter", "to", "merge_value", "." ]
def merge_tries(source, dest): pending_nodes = [('', dest, source)] while pending_nodes: prefix, dest_node, curr_node = pending_nodes.pop() for k, v in curr_node.items(): if k in dest_node: if not isinstance(v, dict): raise MergeException( "%s:%s: %r not mergable, curr_...
[ "def", "merge_tries", "(", "source", ",", "dest", ")", ":", "pending_nodes", "=", "[", "(", "''", ",", "dest", ",", "source", ")", "]", "while", "pending_nodes", ":", "prefix", ",", "dest_node", ",", "curr_node", "=", "pending_nodes", ".", "pop", "(", ...
Merges test tries.
[ "Merges", "test", "tries", "." ]
[ "\"\"\" Merges test tries.\n\n This is intended for use as a merge_func parameter to merge_value.\n\n Args:\n source: A result json test trie.\n dest: A json test trie merge destination.\n \"\"\"", "# merge_tries merges source into dest by performing a lock-step depth-first", "# traversal of dest a...
[ { "param": "source", "type": null }, { "param": "dest", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "source", "type": null, "docstring": "A result json test trie.", "docstring_tokens": [ "A", "result", "json", "test", "trie", "." ], "default": null, "is_optiona...
3c05dfef7bd03bee0e969558d3bd7bde75ee74a5
sunlongbo/chromium
testing/merge_scripts/results_merger.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
ensure_match
<not_specific>
def ensure_match(source, dest): """ Returns source if it matches dest. This is intended for use as a merge_func parameter to merge_value. Raises: MergeException if source != dest """ if source != dest: raise MergeException( # pragma: no cover (covered by # results_merge...
Returns source if it matches dest. This is intended for use as a merge_func parameter to merge_value. Raises: MergeException if source != dest
Returns source if it matches dest. This is intended for use as a merge_func parameter to merge_value. MergeException if source != dest
[ "Returns", "source", "if", "it", "matches", "dest", ".", "This", "is", "intended", "for", "use", "as", "a", "merge_func", "parameter", "to", "merge_value", ".", "MergeException", "if", "source", "!", "=", "dest" ]
def ensure_match(source, dest): if source != dest: raise MergeException( "Values don't match: %s, %s" % (source, dest)) return source
[ "def", "ensure_match", "(", "source", ",", "dest", ")", ":", "if", "source", "!=", "dest", ":", "raise", "MergeException", "(", "\"Values don't match: %s, %s\"", "%", "(", "source", ",", "dest", ")", ")", "return", "source" ]
Returns source if it matches dest.
[ "Returns", "source", "if", "it", "matches", "dest", "." ]
[ "\"\"\" Returns source if it matches dest.\n\n This is intended for use as a merge_func parameter to merge_value.\n\n Raises:\n MergeException if source != dest\n \"\"\"", "# pragma: no cover (covered by", "# results_merger_unittest)." ]
[ { "param": "source", "type": null }, { "param": "dest", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "source", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "dest", "type": null, "docstring": null, "docstring_tokens":...
3c05dfef7bd03bee0e969558d3bd7bde75ee74a5
sunlongbo/chromium
testing/merge_scripts/results_merger.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
sum_dicts
<not_specific>
def sum_dicts(source, dest): """ Adds values from source to corresponding values in dest. This is intended for use as a merge_func parameter to merge_value. """ for k, v in source.items(): dest.setdefault(k, 0) dest[k] += v return dest
Adds values from source to corresponding values in dest. This is intended for use as a merge_func parameter to merge_value.
Adds values from source to corresponding values in dest. This is intended for use as a merge_func parameter to merge_value.
[ "Adds", "values", "from", "source", "to", "corresponding", "values", "in", "dest", ".", "This", "is", "intended", "for", "use", "as", "a", "merge_func", "parameter", "to", "merge_value", "." ]
def sum_dicts(source, dest): for k, v in source.items(): dest.setdefault(k, 0) dest[k] += v return dest
[ "def", "sum_dicts", "(", "source", ",", "dest", ")", ":", "for", "k", ",", "v", "in", "source", ".", "items", "(", ")", ":", "dest", ".", "setdefault", "(", "k", ",", "0", ")", "dest", "[", "k", "]", "+=", "v", "return", "dest" ]
Adds values from source to corresponding values in dest.
[ "Adds", "values", "from", "source", "to", "corresponding", "values", "in", "dest", "." ]
[ "\"\"\" Adds values from source to corresponding values in dest.\n\n This is intended for use as a merge_func parameter to merge_value.\n \"\"\"" ]
[ { "param": "source", "type": null }, { "param": "dest", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "source", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "dest", "type": null, "docstring": null, "docstring_tokens":...
3c05dfef7bd03bee0e969558d3bd7bde75ee74a5
sunlongbo/chromium
testing/merge_scripts/results_merger.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
merge_value
null
def merge_value(source, dest, key, merge_func): """ Merges a value from source to dest. The value is deleted from source. Args: source: A dictionary from which to pull a value, identified by key. dest: The dictionary into to which the value is to be merged. key: The key which identifies the value to...
Merges a value from source to dest. The value is deleted from source. Args: source: A dictionary from which to pull a value, identified by key. dest: The dictionary into to which the value is to be merged. key: The key which identifies the value to be merged. merge_func(src, dst): A function whic...
Merges a value from source to dest. The value is deleted from source. A dictionary from which to pull a value, identified by key. dest: The dictionary into to which the value is to be merged. key: The key which identifies the value to be merged. merge_func(src, dst): A function which merges its src into dst, and retur...
[ "Merges", "a", "value", "from", "source", "to", "dest", ".", "The", "value", "is", "deleted", "from", "source", ".", "A", "dictionary", "from", "which", "to", "pull", "a", "value", "identified", "by", "key", ".", "dest", ":", "The", "dictionary", "into",...
def merge_value(source, dest, key, merge_func): try: dest[key] = merge_func(source[key], dest[key]) except MergeException as e: e.message = "MergeFailure for %s\n%s" % (key, e.message) e.args = tuple([e.message] + list(e.args[1:])) raise del source[key]
[ "def", "merge_value", "(", "source", ",", "dest", ",", "key", ",", "merge_func", ")", ":", "try", ":", "dest", "[", "key", "]", "=", "merge_func", "(", "source", "[", "key", "]", ",", "dest", "[", "key", "]", ")", "except", "MergeException", "as", ...
Merges a value from source to dest.
[ "Merges", "a", "value", "from", "source", "to", "dest", "." ]
[ "\"\"\" Merges a value from source to dest.\n\n The value is deleted from source.\n\n Args:\n source: A dictionary from which to pull a value, identified by key.\n dest: The dictionary into to which the value is to be merged.\n key: The key which identifies the value to be merged.\n merge_func(src, ds...
[ { "param": "source", "type": null }, { "param": "dest", "type": null }, { "param": "key", "type": null }, { "param": "merge_func", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "source", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "dest", "type": null, "docstring": null, "docstring_tokens":...
3f43d8182b104e9376ff88973d36482e1ecfaeb1
sunlongbo/chromium
content/browser/attribution_reporting/PRESUBMIT.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
CheckAttributionStorageSchemaModification
<not_specific>
def CheckAttributionStorageSchemaModification(input_api, output_api): """ Checks the kCurrentVersionNumber is modified when necessary. Whenever any of the following files is changed: - attribution_storage_sql.cc - attribution_storage_sql_migrations.cc - rate_limit_table.cc and kCurrentVersionNumber s...
Checks the kCurrentVersionNumber is modified when necessary. Whenever any of the following files is changed: - attribution_storage_sql.cc - attribution_storage_sql_migrations.cc - rate_limit_table.cc and kCurrentVersionNumber stays intact, this check returns a presubmit warning to make sure the valu...
Checks the kCurrentVersionNumber is modified when necessary. Whenever any of the following files is changed: attribution_storage_sql.cc attribution_storage_sql_migrations.cc rate_limit_table.cc and kCurrentVersionNumber stays intact, this check returns a presubmit warning to make sure the value is updated if necessary.
[ "Checks", "the", "kCurrentVersionNumber", "is", "modified", "when", "necessary", ".", "Whenever", "any", "of", "the", "following", "files", "is", "changed", ":", "attribution_storage_sql", ".", "cc", "attribution_storage_sql_migrations", ".", "cc", "rate_limit_table", ...
def CheckAttributionStorageSchemaModification(input_api, output_api): database_files_changed = False database_version_changed = False for affected_file in input_api.AffectedFiles(): basename = input_api.basename(affected_file.LocalPath()) if (basename == 'attribution_storage_sql_migrations.cc' or ...
[ "def", "CheckAttributionStorageSchemaModification", "(", "input_api", ",", "output_api", ")", ":", "database_files_changed", "=", "False", "database_version_changed", "=", "False", "for", "affected_file", "in", "input_api", ".", "AffectedFiles", "(", ")", ":", "basename...
Checks the kCurrentVersionNumber is modified when necessary.
[ "Checks", "the", "kCurrentVersionNumber", "is", "modified", "when", "necessary", "." ]
[ "\"\"\" Checks the kCurrentVersionNumber is modified when necessary.\n\n Whenever any of the following files is changed:\n - attribution_storage_sql.cc\n - attribution_storage_sql_migrations.cc\n - rate_limit_table.cc\n and kCurrentVersionNumber stays intact, this check returns a\n presubmit warning to ...
[ { "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...
3f4d40903259dfc3eebb7873c4b211d274419946
sunlongbo/chromium
chrome/PRESUBMIT.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
_CheckChangeLintsClean
<not_specific>
def _CheckChangeLintsClean(input_api, output_api): """Makes sure that the chrome/ code is cpplint clean.""" files_to_skip = input_api.DEFAULT_FILES_TO_SKIP + EXCLUDE sources = lambda x: input_api.FilterSourceFile( x, files_to_check=INCLUDE_CPP_FILES_ONLY, files_to_skip=files_to_skip) return input_api.canned...
Makes sure that the chrome/ code is cpplint clean.
Makes sure that the chrome/ code is cpplint clean.
[ "Makes", "sure", "that", "the", "chrome", "/", "code", "is", "cpplint", "clean", "." ]
def _CheckChangeLintsClean(input_api, output_api): files_to_skip = input_api.DEFAULT_FILES_TO_SKIP + EXCLUDE sources = lambda x: input_api.FilterSourceFile( x, files_to_check=INCLUDE_CPP_FILES_ONLY, files_to_skip=files_to_skip) return input_api.canned_checks.CheckChangeLintsClean( input_api, output_api,...
[ "def", "_CheckChangeLintsClean", "(", "input_api", ",", "output_api", ")", ":", "files_to_skip", "=", "input_api", ".", "DEFAULT_FILES_TO_SKIP", "+", "EXCLUDE", "sources", "=", "lambda", "x", ":", "input_api", ".", "FilterSourceFile", "(", "x", ",", "files_to_chec...
Makes sure that the chrome/ code is cpplint clean.
[ "Makes", "sure", "that", "the", "chrome", "/", "code", "is", "cpplint", "clean", "." ]
[ "\"\"\"Makes sure that the chrome/ code is cpplint clean.\"\"\"" ]
[ { "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...
3f4d40903259dfc3eebb7873c4b211d274419946
sunlongbo/chromium
chrome/PRESUBMIT.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
_CheckNoContentUnitTestsInChrome
<not_specific>
def _CheckNoContentUnitTestsInChrome(input_api, output_api): """Makes sure that no unit tests from content/ are included in unit_tests.""" problems = [] for f in input_api.AffectedFiles(): if not f.LocalPath().endswith('BUILD.gn'): continue for line_num, line in f.ChangedContents(): m = re.se...
Makes sure that no unit tests from content/ are included in unit_tests.
Makes sure that no unit tests from content/ are included in unit_tests.
[ "Makes", "sure", "that", "no", "unit", "tests", "from", "content", "/", "are", "included", "in", "unit_tests", "." ]
def _CheckNoContentUnitTestsInChrome(input_api, output_api): problems = [] for f in input_api.AffectedFiles(): if not f.LocalPath().endswith('BUILD.gn'): continue for line_num, line in f.ChangedContents(): m = re.search(r"'(.*\/content\/.*unittest.*)'", line) if m: problems.append(...
[ "def", "_CheckNoContentUnitTestsInChrome", "(", "input_api", ",", "output_api", ")", ":", "problems", "=", "[", "]", "for", "f", "in", "input_api", ".", "AffectedFiles", "(", ")", ":", "if", "not", "f", ".", "LocalPath", "(", ")", ".", "endswith", "(", "...
Makes sure that no unit tests from content/ are included in unit_tests.
[ "Makes", "sure", "that", "no", "unit", "tests", "from", "content", "/", "are", "included", "in", "unit_tests", "." ]
[ "\"\"\"Makes sure that no unit tests from content/ are included in unit_tests.\"\"\"" ]
[ { "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...
3f4d40903259dfc3eebb7873c4b211d274419946
sunlongbo/chromium
chrome/PRESUBMIT.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
_CheckNoOSAPPLEMacrosInChromeFile
<not_specific>
def _CheckNoOSAPPLEMacrosInChromeFile(input_api, f): """Check for OS_APPLE in a given file in chrome/.""" preprocessor_statement = input_api.re.compile(r'^\s*#') apple_macro = input_api.re.compile(r'defined\(OS_APPLE\)') results = [] for lnum, line in f.ChangedContents(): if preprocessor_statement.search(...
Check for OS_APPLE in a given file in chrome/.
Check for OS_APPLE in a given file in chrome/.
[ "Check", "for", "OS_APPLE", "in", "a", "given", "file", "in", "chrome", "/", "." ]
def _CheckNoOSAPPLEMacrosInChromeFile(input_api, f): preprocessor_statement = input_api.re.compile(r'^\s*#') apple_macro = input_api.re.compile(r'defined\(OS_APPLE\)') results = [] for lnum, line in f.ChangedContents(): if preprocessor_statement.search(line) and apple_macro.search(line): results.appen...
[ "def", "_CheckNoOSAPPLEMacrosInChromeFile", "(", "input_api", ",", "f", ")", ":", "preprocessor_statement", "=", "input_api", ".", "re", ".", "compile", "(", "r'^\\s*#'", ")", "apple_macro", "=", "input_api", ".", "re", ".", "compile", "(", "r'defined\\(OS_APPLE\\...
Check for OS_APPLE in a given file in chrome/.
[ "Check", "for", "OS_APPLE", "in", "a", "given", "file", "in", "chrome", "/", "." ]
[ "\"\"\"Check for OS_APPLE in a given file in chrome/.\"\"\"" ]
[ { "param": "input_api", "type": null }, { "param": "f", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "input_api", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "f", "type": null, "docstring": null, "docstring_tokens":...
3f4d40903259dfc3eebb7873c4b211d274419946
sunlongbo/chromium
chrome/PRESUBMIT.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
_CheckNoOSIOSMacrosInChromeFile
<not_specific>
def _CheckNoOSIOSMacrosInChromeFile(input_api, f): """Check for OS_IOS in a given file in chrome/.""" preprocessor_statement = input_api.re.compile(r'^\s*#') ios_macro = input_api.re.compile(r'defined\(OS_IOS\)') results = [] for lnum, line in f.ChangedContents(): if preprocessor_statement.search(line) an...
Check for OS_IOS in a given file in chrome/.
Check for OS_IOS in a given file in chrome/.
[ "Check", "for", "OS_IOS", "in", "a", "given", "file", "in", "chrome", "/", "." ]
def _CheckNoOSIOSMacrosInChromeFile(input_api, f): preprocessor_statement = input_api.re.compile(r'^\s*#') ios_macro = input_api.re.compile(r'defined\(OS_IOS\)') results = [] for lnum, line in f.ChangedContents(): if preprocessor_statement.search(line) and ios_macro.search(line): results.append(' %...
[ "def", "_CheckNoOSIOSMacrosInChromeFile", "(", "input_api", ",", "f", ")", ":", "preprocessor_statement", "=", "input_api", ".", "re", ".", "compile", "(", "r'^\\s*#'", ")", "ios_macro", "=", "input_api", ".", "re", ".", "compile", "(", "r'defined\\(OS_IOS\\)'", ...
Check for OS_IOS in a given file in chrome/.
[ "Check", "for", "OS_IOS", "in", "a", "given", "file", "in", "chrome", "/", "." ]
[ "\"\"\"Check for OS_IOS in a given file in chrome/.\"\"\"" ]
[ { "param": "input_api", "type": null }, { "param": "f", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "input_api", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "f", "type": null, "docstring": null, "docstring_tokens":...
3f4d40903259dfc3eebb7873c4b211d274419946
sunlongbo/chromium
chrome/PRESUBMIT.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
_CommonChecks
<not_specific>
def _CommonChecks(input_api, output_api): """Checks common to both upload and commit.""" results = [] results.extend(_CheckNoContentUnitTestsInChrome(input_api, output_api)) results.extend(_CheckNoOSAPPLEMacrosInChrome(input_api, output_api)) results.extend(_CheckNoOSIOSMacrosInChrome(input_api, output_api)) ...
Checks common to both upload and commit.
Checks common to both upload and commit.
[ "Checks", "common", "to", "both", "upload", "and", "commit", "." ]
def _CommonChecks(input_api, output_api): results = [] results.extend(_CheckNoContentUnitTestsInChrome(input_api, output_api)) results.extend(_CheckNoOSAPPLEMacrosInChrome(input_api, output_api)) results.extend(_CheckNoOSIOSMacrosInChrome(input_api, output_api)) return results
[ "def", "_CommonChecks", "(", "input_api", ",", "output_api", ")", ":", "results", "=", "[", "]", "results", ".", "extend", "(", "_CheckNoContentUnitTestsInChrome", "(", "input_api", ",", "output_api", ")", ")", "results", ".", "extend", "(", "_CheckNoOSAPPLEMacr...
Checks common to both upload and commit.
[ "Checks", "common", "to", "both", "upload", "and", "commit", "." ]
[ "\"\"\"Checks common to both upload and commit.\"\"\"" ]
[ { "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...
aaefc27d43aa3187797ce34edaee6429287bb260
sunlongbo/chromium
chrome/installer/mac/signing/notarize.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
submit
<not_specific>
def submit(path, config): """Submits an artifact to Apple for notarization. Args: path: The path to the artifact that will be uploaded for notarization. config: The |config.CodeSignConfig| for the artifact. Returns: A UUID from the notary service that represents the request. ""...
Submits an artifact to Apple for notarization. Args: path: The path to the artifact that will be uploaded for notarization. config: The |config.CodeSignConfig| for the artifact. Returns: A UUID from the notary service that represents the request.
Submits an artifact to Apple for notarization.
[ "Submits", "an", "artifact", "to", "Apple", "for", "notarization", "." ]
def submit(path, config): command = [ 'xcrun', 'altool', '--notarize-app', '--file', path, '--primary-bundle-id', config.base_bundle_id, '--username', config.notary_user, '--password', config.notary_password, '--output-format', 'xml' ] if config.notary_asc_provider is not Non...
[ "def", "submit", "(", "path", ",", "config", ")", ":", "command", "=", "[", "'xcrun'", ",", "'altool'", ",", "'--notarize-app'", ",", "'--file'", ",", "path", ",", "'--primary-bundle-id'", ",", "config", ".", "base_bundle_id", ",", "'--username'", ",", "conf...
Submits an artifact to Apple for notarization.
[ "Submits", "an", "artifact", "to", "Apple", "for", "notarization", "." ]
[ "\"\"\"Submits an artifact to Apple for notarization.\n\n Args:\n path: The path to the artifact that will be uploaded for notarization.\n config: The |config.CodeSignConfig| for the artifact.\n\n Returns:\n A UUID from the notary service that represents the request.\n \"\"\"", "# Kn...
[ { "param": "path", "type": null }, { "param": "config", "type": null } ]
{ "returns": [ { "docstring": "A UUID from the notary service that represents the request.", "docstring_tokens": [ "A", "UUID", "from", "the", "notary", "service", "that", "represents", "the", "request", "." ...
aaefc27d43aa3187797ce34edaee6429287bb260
sunlongbo/chromium
chrome/installer/mac/signing/notarize.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
wait_for_results
null
def wait_for_results(uuids, config): """Waits for results from the notarization service. This iterates the list of UUIDs and checks the status of each one. For each successful result, the function yields to the caller. If a request failed, this raises a NotarizationError. If no requests are ready, this ...
Waits for results from the notarization service. This iterates the list of UUIDs and checks the status of each one. For each successful result, the function yields to the caller. If a request failed, this raises a NotarizationError. If no requests are ready, this operation blocks and retries until a res...
Waits for results from the notarization service. This iterates the list of UUIDs and checks the status of each one. For each successful result, the function yields to the caller. If a request failed, this raises a NotarizationError. If no requests are ready, this operation blocks and retries until a result is ready. Af...
[ "Waits", "for", "results", "from", "the", "notarization", "service", ".", "This", "iterates", "the", "list", "of", "UUIDs", "and", "checks", "the", "status", "of", "each", "one", ".", "For", "each", "successful", "result", "the", "function", "yields", "to", ...
def wait_for_results(uuids, config): assert len(uuids) wait_set = set(uuids) sleep_time_seconds = 5 total_sleep_time_seconds = 0 while len(wait_set) > 0: for uuid in list(wait_set): try: command = [ 'xcrun', 'altool', '--notarization-info', uui...
[ "def", "wait_for_results", "(", "uuids", ",", "config", ")", ":", "assert", "len", "(", "uuids", ")", "wait_set", "=", "set", "(", "uuids", ")", "sleep_time_seconds", "=", "5", "total_sleep_time_seconds", "=", "0", "while", "len", "(", "wait_set", ")", ">"...
Waits for results from the notarization service.
[ "Waits", "for", "results", "from", "the", "notarization", "service", "." ]
[ "\"\"\"Waits for results from the notarization service. This iterates the list\n of UUIDs and checks the status of each one. For each successful result, the\n function yields to the caller. If a request failed, this raises a\n NotarizationError. If no requests are ready, this operation blocks and\n retr...
[ { "param": "uuids", "type": null }, { "param": "config", "type": null } ]
{ "returns": [ { "docstring": "The UUID of a successful notarization request.", "docstring_tokens": [ "The", "UUID", "of", "a", "successful", "notarization", "request", "." ], "type": null } ], "raises": [], "params"...
aaefc27d43aa3187797ce34edaee6429287bb260
sunlongbo/chromium
chrome/installer/mac/signing/notarize.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
staple
null
def staple(path): """Staples a notarization ticket to the artifact at |path|. The notarization must have been performed with submit() and then completed by Apple's notary service, which can be checked with wait_for_one_result(). Args: path: The path to the artifact that had previously been subm...
Staples a notarization ticket to the artifact at |path|. The notarization must have been performed with submit() and then completed by Apple's notary service, which can be checked with wait_for_one_result(). Args: path: The path to the artifact that had previously been submitted for not...
Staples a notarization ticket to the artifact at |path|. The notarization must have been performed with submit() and then completed by Apple's notary service, which can be checked with wait_for_one_result().
[ "Staples", "a", "notarization", "ticket", "to", "the", "artifact", "at", "|path|", ".", "The", "notarization", "must", "have", "been", "performed", "with", "submit", "()", "and", "then", "completed", "by", "Apple", "'", "s", "notary", "service", "which", "ca...
def staple(path): def staple_command(): commands.run_command(['xcrun', 'stapler', 'staple', '--verbose', path]) _notary_service_retry(staple_command, (65, 68), 'staple')
[ "def", "staple", "(", "path", ")", ":", "def", "staple_command", "(", ")", ":", "commands", ".", "run_command", "(", "[", "'xcrun'", ",", "'stapler'", ",", "'staple'", ",", "'--verbose'", ",", "path", "]", ")", "_notary_service_retry", "(", "staple_command",...
Staples a notarization ticket to the artifact at |path|.
[ "Staples", "a", "notarization", "ticket", "to", "the", "artifact", "at", "|path|", "." ]
[ "\"\"\"Staples a notarization ticket to the artifact at |path|. The\n notarization must have been performed with submit() and then completed by\n Apple's notary service, which can be checked with wait_for_one_result().\n\n Args:\n path: The path to the artifact that had previously been submitted for...
[ { "param": "path", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "path", "type": null, "docstring": "The path to the artifact that had previously been submitted for\nnotarization and is now ready for stapling.", "docstring_tokens": [ "The", "path", "to", "the"...
aaefc27d43aa3187797ce34edaee6429287bb260
sunlongbo/chromium
chrome/installer/mac/signing/notarize.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
_notary_service_retry
<not_specific>
def _notary_service_retry(func, known_bad_returncodes, short_command_name): """Calls the function |func| that runs a subprocess command, retrying it if the command exits uncleanly and the returncode is known to be bad (e.g. flaky). Args: func: The function to call within try block that wil catc...
Calls the function |func| that runs a subprocess command, retrying it if the command exits uncleanly and the returncode is known to be bad (e.g. flaky). Args: func: The function to call within try block that wil catch CalledProcessError. known_bad_returncodes: An iterable of the...
Calls the function |func| that runs a subprocess command, retrying it if the command exits uncleanly and the returncode is known to be bad .
[ "Calls", "the", "function", "|func|", "that", "runs", "a", "subprocess", "command", "retrying", "it", "if", "the", "command", "exits", "uncleanly", "and", "the", "returncode", "is", "known", "to", "be", "bad", "." ]
def _notary_service_retry(func, known_bad_returncodes, short_command_name): attempt = 0 while True: try: return func() except subprocess.CalledProcessError as e: attempt += 1 if (attempt < _NOTARY_SERVICE_MAX_RETRIES and e.returncode in kno...
[ "def", "_notary_service_retry", "(", "func", ",", "known_bad_returncodes", ",", "short_command_name", ")", ":", "attempt", "=", "0", "while", "True", ":", "try", ":", "return", "func", "(", ")", "except", "subprocess", ".", "CalledProcessError", "as", "e", ":"...
Calls the function |func| that runs a subprocess command, retrying it if the command exits uncleanly and the returncode is known to be bad (e.g.
[ "Calls", "the", "function", "|func|", "that", "runs", "a", "subprocess", "command", "retrying", "it", "if", "the", "command", "exits", "uncleanly", "and", "the", "returncode", "is", "known", "to", "be", "bad", "(", "e", ".", "g", "." ]
[ "\"\"\"Calls the function |func| that runs a subprocess command, retrying it if\n the command exits uncleanly and the returncode is known to be bad (e.g.\n flaky).\n\n Args:\n func: The function to call within try block that wil catch\n CalledProcessError.\n known_bad_returncodes: ...
[ { "param": "func", "type": null }, { "param": "known_bad_returncodes", "type": null }, { "param": "short_command_name", "type": null } ]
{ "returns": [ { "docstring": "The result of |func|.", "docstring_tokens": [ "The", "result", "of", "|func|", "." ], "type": null } ], "raises": [], "params": [ { "identifier": "func", "type": null, "docstring": "The f...
fe32e8f675259e5ae1213c764e4b87ff63682326
sunlongbo/chromium
tools/android/eclipse/generate_cdt_clang_settings.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
GetClangIncludeDirectories
<not_specific>
def GetClangIncludeDirectories(compiler_path): """Gets the system include directories as determined by the clang compiler. Returns: The list of include directories. """ includes_set = set() command = [compiler_path, '-E', '-xc++', '-v', '-'] proc = subprocess.Popen(args=command, stdin=subprocess.PIPE...
Gets the system include directories as determined by the clang compiler. Returns: The list of include directories.
Gets the system include directories as determined by the clang compiler.
[ "Gets", "the", "system", "include", "directories", "as", "determined", "by", "the", "clang", "compiler", "." ]
def GetClangIncludeDirectories(compiler_path): includes_set = set() command = [compiler_path, '-E', '-xc++', '-v', '-'] proc = subprocess.Popen(args=command, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE) output = proc.communicate()[1] in_includes_list = False...
[ "def", "GetClangIncludeDirectories", "(", "compiler_path", ")", ":", "includes_set", "=", "set", "(", ")", "command", "=", "[", "compiler_path", ",", "'-E'", ",", "'-xc++'", ",", "'-v'", ",", "'-'", "]", "proc", "=", "subprocess", ".", "Popen", "(", "args"...
Gets the system include directories as determined by the clang compiler.
[ "Gets", "the", "system", "include", "directories", "as", "determined", "by", "the", "clang", "compiler", "." ]
[ "\"\"\"Gets the system include directories as determined by the clang compiler.\n\n Returns:\n The list of include directories.\n \"\"\"", "# Extract the list of include dirs from the output, which has this format:", "# ...", "# #include \"...\" search starts here:", "# #include <...> search star...
[ { "param": "compiler_path", "type": null } ]
{ "returns": [ { "docstring": "The list of include directories.", "docstring_tokens": [ "The", "list", "of", "include", "directories", "." ], "type": null } ], "raises": [], "params": [ { "identifier": "compiler_path", ...
fe32e8f675259e5ae1213c764e4b87ff63682326
sunlongbo/chromium
tools/android/eclipse/generate_cdt_clang_settings.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
GetClangDefines
<not_specific>
def GetClangDefines(compiler_path): """Gets the system defines as determined by the clang compiler. Returns: The dict of defines. """ all_defines = {} command = [compiler_path, '-E', '-dM', '-'] proc = subprocess.Popen(args=command, stdin=subprocess.PIPE, stdout=subprocess.PI...
Gets the system defines as determined by the clang compiler. Returns: The dict of defines.
Gets the system defines as determined by the clang compiler.
[ "Gets", "the", "system", "defines", "as", "determined", "by", "the", "clang", "compiler", "." ]
def GetClangDefines(compiler_path): all_defines = {} command = [compiler_path, '-E', '-dM', '-'] proc = subprocess.Popen(args=command, stdin=subprocess.PIPE, stdout=subprocess.PIPE) output = proc.communicate()[0] for line in output.splitlines(): if not line.strip(): continu...
[ "def", "GetClangDefines", "(", "compiler_path", ")", ":", "all_defines", "=", "{", "}", "command", "=", "[", "compiler_path", ",", "'-E'", ",", "'-dM'", ",", "'-'", "]", "proc", "=", "subprocess", ".", "Popen", "(", "args", "=", "command", ",", "stdin", ...
Gets the system defines as determined by the clang compiler.
[ "Gets", "the", "system", "defines", "as", "determined", "by", "the", "clang", "compiler", "." ]
[ "\"\"\"Gets the system defines as determined by the clang compiler.\n\n Returns:\n The dict of defines.\n \"\"\"", "# Extract the list of defines from the output, which has this format:", "# #define __SIZEOF_INT__ 4", "# ...", "# #define unix 1" ]
[ { "param": "compiler_path", "type": null } ]
{ "returns": [ { "docstring": "The dict of defines.", "docstring_tokens": [ "The", "dict", "of", "defines", "." ], "type": null } ], "raises": [], "params": [ { "identifier": "compiler_path", "type": null, "docstring":...
fe32e8f675259e5ae1213c764e4b87ff63682326
sunlongbo/chromium
tools/android/eclipse/generate_cdt_clang_settings.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
WriteIncludePaths
null
def WriteIncludePaths(out, eclipse_langs, include_dirs): """Write the includes section of a CDT settings export file.""" out.write(' <section name="org.eclipse.cdt.internal.ui.wizards.' \ 'settingswizards.IncludePaths">\n') out.write(' <language name="holder for library settings"></language>\n') ...
Write the includes section of a CDT settings export file.
Write the includes section of a CDT settings export file.
[ "Write", "the", "includes", "section", "of", "a", "CDT", "settings", "export", "file", "." ]
def WriteIncludePaths(out, eclipse_langs, include_dirs): out.write(' <section name="org.eclipse.cdt.internal.ui.wizards.' \ 'settingswizards.IncludePaths">\n') out.write(' <language name="holder for library settings"></language>\n') for lang in eclipse_langs: out.write(' <language name="%s"...
[ "def", "WriteIncludePaths", "(", "out", ",", "eclipse_langs", ",", "include_dirs", ")", ":", "out", ".", "write", "(", "' <section name=\"org.eclipse.cdt.internal.ui.wizards.'", "'settingswizards.IncludePaths\">\\n'", ")", "out", ".", "write", "(", "' <language name=\"h...
Write the includes section of a CDT settings export file.
[ "Write", "the", "includes", "section", "of", "a", "CDT", "settings", "export", "file", "." ]
[ "\"\"\"Write the includes section of a CDT settings export file.\"\"\"" ]
[ { "param": "out", "type": null }, { "param": "eclipse_langs", "type": null }, { "param": "include_dirs", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "out", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "eclipse_langs", "type": null, "docstring": null, "docstring_to...
fe32e8f675259e5ae1213c764e4b87ff63682326
sunlongbo/chromium
tools/android/eclipse/generate_cdt_clang_settings.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
WriteMacros
null
def WriteMacros(out, eclipse_langs, defines): """Write the macros section of a CDT settings export file.""" out.write(' <section name="org.eclipse.cdt.internal.ui.wizards.' \ 'settingswizards.Macros">\n') out.write(' <language name="holder for library settings"></language>\n') for lang in eclip...
Write the macros section of a CDT settings export file.
Write the macros section of a CDT settings export file.
[ "Write", "the", "macros", "section", "of", "a", "CDT", "settings", "export", "file", "." ]
def WriteMacros(out, eclipse_langs, defines): out.write(' <section name="org.eclipse.cdt.internal.ui.wizards.' \ 'settingswizards.Macros">\n') out.write(' <language name="holder for library settings"></language>\n') for lang in eclipse_langs: out.write(' <language name="%s">\n' % lang) ...
[ "def", "WriteMacros", "(", "out", ",", "eclipse_langs", ",", "defines", ")", ":", "out", ".", "write", "(", "' <section name=\"org.eclipse.cdt.internal.ui.wizards.'", "'settingswizards.Macros\">\\n'", ")", "out", ".", "write", "(", "' <language name=\"holder for library...
Write the macros section of a CDT settings export file.
[ "Write", "the", "macros", "section", "of", "a", "CDT", "settings", "export", "file", "." ]
[ "\"\"\"Write the macros section of a CDT settings export file.\"\"\"" ]
[ { "param": "out", "type": null }, { "param": "eclipse_langs", "type": null }, { "param": "defines", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "out", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "eclipse_langs", "type": null, "docstring": null, "docstring_to...
fe4117227bdf888791e1a58248c92dc149d858e6
sunlongbo/chromium
remoting/tools/zip2msi.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
QuoteArgument
<not_specific>
def QuoteArgument(arg): """Escapes a Windows command-line argument. So that the Win32 CommandLineToArgv function will turn the escaped result back into the original string. See http://msdn.microsoft.com/en-us/library/17w5ykft.aspx ("Parsing C++ Command-Line Arguments") to understand why we have to do this....
Escapes a Windows command-line argument. So that the Win32 CommandLineToArgv function will turn the escaped result back into the original string. See http://msdn.microsoft.com/en-us/library/17w5ykft.aspx ("Parsing C++ Command-Line Arguments") to understand why we have to do this. Args: arg: the stri...
Escapes a Windows command-line argument. So that the Win32 CommandLineToArgv function will turn the escaped result back into the original string.
[ "Escapes", "a", "Windows", "command", "-", "line", "argument", ".", "So", "that", "the", "Win32", "CommandLineToArgv", "function", "will", "turn", "the", "escaped", "result", "back", "into", "the", "original", "string", "." ]
def QuoteArgument(arg): def _Replace(match): return 2 * match.group(1) + '\\"' if re.search(quote_matcher_regex, arg): arg = quote_replacer_regex.sub(_Replace, arg) return '"' + arg + '"' else: return arg
[ "def", "QuoteArgument", "(", "arg", ")", ":", "def", "_Replace", "(", "match", ")", ":", "return", "2", "*", "match", ".", "group", "(", "1", ")", "+", "'\\\\\"'", "if", "re", ".", "search", "(", "quote_matcher_regex", ",", "arg", ")", ":", "arg", ...
Escapes a Windows command-line argument.
[ "Escapes", "a", "Windows", "command", "-", "line", "argument", "." ]
[ "\"\"\"Escapes a Windows command-line argument.\n\n So that the Win32 CommandLineToArgv function will turn the escaped result back\n into the original string.\n See http://msdn.microsoft.com/en-us/library/17w5ykft.aspx\n (\"Parsing C++ Command-Line Arguments\") to understand why we have to do\n this.\n\n Args...
[ { "param": "arg", "type": null } ]
{ "returns": [ { "docstring": "the escaped string.", "docstring_tokens": [ "the", "escaped", "string", "." ], "type": null } ], "raises": [], "params": [ { "identifier": "arg", "type": null, "docstring": "the string to be esca...
fe4117227bdf888791e1a58248c92dc149d858e6
sunlongbo/chromium
remoting/tools/zip2msi.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
GenerateCommandLine
<not_specific>
def GenerateCommandLine(tool, source, dest, parameters): """Generates the command line for |tool|.""" # Merge/apply tool-specific parameters params = copy.copy(parameters) if tool in parameters: params = Merge(params, params[tool]) wix_path = os.path.normpath(params.get('wix_path', '')) switches = [os....
Generates the command line for |tool|.
Generates the command line for |tool|.
[ "Generates", "the", "command", "line", "for", "|tool|", "." ]
def GenerateCommandLine(tool, source, dest, parameters): params = copy.copy(parameters) if tool in parameters: params = Merge(params, params[tool]) wix_path = os.path.normpath(params.get('wix_path', '')) switches = [os.path.join(wix_path, tool), '-nologo'] for name, value in params.get('defines', {}).item...
[ "def", "GenerateCommandLine", "(", "tool", ",", "source", ",", "dest", ",", "parameters", ")", ":", "params", "=", "copy", ".", "copy", "(", "parameters", ")", "if", "tool", "in", "parameters", ":", "params", "=", "Merge", "(", "params", ",", "params", ...
Generates the command line for |tool|.
[ "Generates", "the", "command", "line", "for", "|tool|", "." ]
[ "\"\"\"Generates the command line for |tool|.\"\"\"", "# Merge/apply tool-specific parameters", "# Append the list of defines and extensions to the command line switches.", "# Append raw switches", "# Append the input and output files", "# Generate the actual command line", "#return ' '.join(map(QuoteAr...
[ { "param": "tool", "type": null }, { "param": "source", "type": null }, { "param": "dest", "type": null }, { "param": "parameters", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "tool", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "source", "type": null, "docstring": null, "docstring_tokens":...
fe4117227bdf888791e1a58248c92dc149d858e6
sunlongbo/chromium
remoting/tools/zip2msi.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
Run
<not_specific>
def Run(args): """Runs a command interpreting the passed |args| as a command line.""" command = ' '.join(map(QuoteArgument, args)) popen = subprocess.Popen( command, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) out, _ = popen.communicate() if popen.returncode: print(command) for line in out...
Runs a command interpreting the passed |args| as a command line.
Runs a command interpreting the passed |args| as a command line.
[ "Runs", "a", "command", "interpreting", "the", "passed", "|args|", "as", "a", "command", "line", "." ]
def Run(args): command = ' '.join(map(QuoteArgument, args)) popen = subprocess.Popen( command, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) out, _ = popen.communicate() if popen.returncode: print(command) for line in out.splitlines(): print(line) print('%s returned %d' % (args[0], p...
[ "def", "Run", "(", "args", ")", ":", "command", "=", "' '", ".", "join", "(", "map", "(", "QuoteArgument", ",", "args", ")", ")", "popen", "=", "subprocess", ".", "Popen", "(", "command", ",", "stdout", "=", "subprocess", ".", "PIPE", ",", "stderr", ...
Runs a command interpreting the passed |args| as a command line.
[ "Runs", "a", "command", "interpreting", "the", "passed", "|args|", "as", "a", "command", "line", "." ]
[ "\"\"\"Runs a command interpreting the passed |args| as a command line.\"\"\"" ]
[ { "param": "args", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "args", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
fe4117227bdf888791e1a58248c92dc149d858e6
sunlongbo/chromium
remoting/tools/zip2msi.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
GenerateMsi
<not_specific>
def GenerateMsi(target, source, parameters): """Generates .msi from the installation files prepared by Chromium build.""" parameters['basename'] = os.path.splitext(os.path.basename(source))[0] # The script can handle both forms of input a directory with unpacked files or # a ZIP archive with the same files. In...
Generates .msi from the installation files prepared by Chromium build.
Generates .msi from the installation files prepared by Chromium build.
[ "Generates", ".", "msi", "from", "the", "installation", "files", "prepared", "by", "Chromium", "build", "." ]
def GenerateMsi(target, source, parameters): parameters['basename'] = os.path.splitext(os.path.basename(source))[0] source_dir = None if os.path.isdir(source): source_dir = source else: rc = UnpackZip(parameters['intermediate_dir'], source) if rc != 0: return rc source_dir = '%(intermediat...
[ "def", "GenerateMsi", "(", "target", ",", "source", ",", "parameters", ")", ":", "parameters", "[", "'basename'", "]", "=", "os", ".", "path", ".", "splitext", "(", "os", ".", "path", ".", "basename", "(", "source", ")", ")", "[", "0", "]", "source_d...
Generates .msi from the installation files prepared by Chromium build.
[ "Generates", ".", "msi", "from", "the", "installation", "files", "prepared", "by", "Chromium", "build", "." ]
[ "\"\"\"Generates .msi from the installation files prepared by Chromium build.\"\"\"", "# The script can handle both forms of input a directory with unpacked files or", "# a ZIP archive with the same files. In the latter case the archive should be", "# unpacked to the intermediate directory.", "# Just use un...
[ { "param": "target", "type": null }, { "param": "source", "type": null }, { "param": "parameters", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "target", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "source", "type": null, "docstring": null, "docstring_tokens...
fe51ed58aefa8fcb368f1ad70102accc20267097
sunlongbo/chromium
gpu/config/PRESUBMIT.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
_CheckGPUWorkaroundListSorted
<not_specific>
def _CheckGPUWorkaroundListSorted(input_api, output_api): """Check: gpu_workaround_list.txt feature list sorted alphabetically. """ filename = os.path.join(input_api.PresubmitLocalPath(), 'gpu_workaround_list.txt') with io.open(filename, encoding='utf-8') as f: workaro...
Check: gpu_workaround_list.txt feature list sorted alphabetically.
gpu_workaround_list.txt feature list sorted alphabetically.
[ "gpu_workaround_list", ".", "txt", "feature", "list", "sorted", "alphabetically", "." ]
def _CheckGPUWorkaroundListSorted(input_api, output_api): filename = os.path.join(input_api.PresubmitLocalPath(), 'gpu_workaround_list.txt') with io.open(filename, encoding='utf-8') as f: workaround_list = [line.rstrip('\n') for line in f] workaround_list_sorted = sorted(wo...
[ "def", "_CheckGPUWorkaroundListSorted", "(", "input_api", ",", "output_api", ")", ":", "filename", "=", "os", ".", "path", ".", "join", "(", "input_api", ".", "PresubmitLocalPath", "(", ")", ",", "'gpu_workaround_list.txt'", ")", "with", "io", ".", "open", "("...
Check: gpu_workaround_list.txt feature list sorted alphabetically.
[ "Check", ":", "gpu_workaround_list", ".", "txt", "feature", "list", "sorted", "alphabetically", "." ]
[ "\"\"\"Check: gpu_workaround_list.txt feature list sorted alphabetically.\n \"\"\"", "# Diff the sorted/unsorted versions." ]
[ { "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...
cba249b0f365fc54623e5419a903a23acafe1778
sunlongbo/chromium
mojo/public/tools/mojom/mojom/parse/conditional_features_unittest.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
testFilterConst
null
def testFilterConst(self): """Test that Consts are correctly filtered.""" const_source = """ [EnableIf=blue] const int kMyConst1 = 1; [EnableIf=orange] const double kMyConst2 = 2; const int kMyConst3 = 3; """ expected_source = """ [EnableIf=blue] const int kMyCo...
Test that Consts are correctly filtered.
Test that Consts are correctly filtered.
[ "Test", "that", "Consts", "are", "correctly", "filtered", "." ]
def testFilterConst(self): const_source = """ [EnableIf=blue] const int kMyConst1 = 1; [EnableIf=orange] const double kMyConst2 = 2; const int kMyConst3 = 3; """ expected_source = """ [EnableIf=blue] const int kMyConst1 = 1; const int kMyConst3 = 3; """ ...
[ "def", "testFilterConst", "(", "self", ")", ":", "const_source", "=", "\"\"\"\n [EnableIf=blue]\n const int kMyConst1 = 1;\n [EnableIf=orange]\n const double kMyConst2 = 2;\n const int kMyConst3 = 3;\n \"\"\"", "expected_source", "=", "\"\"\"\n [EnableIf=blue]\...
Test that Consts are correctly filtered.
[ "Test", "that", "Consts", "are", "correctly", "filtered", "." ]
[ "\"\"\"Test that Consts are correctly filtered.\"\"\"" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
cba249b0f365fc54623e5419a903a23acafe1778
sunlongbo/chromium
mojo/public/tools/mojom/mojom/parse/conditional_features_unittest.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
testFilterIfNotConst
null
def testFilterIfNotConst(self): """Test that Consts are correctly filtered.""" const_source = """ [EnableIfNot=blue] const int kMyConst1 = 1; [EnableIfNot=orange] const double kMyConst2 = 2; [EnableIf=blue] const int kMyConst3 = 3; [EnableIfNot=blue] const int kMy...
Test that Consts are correctly filtered.
Test that Consts are correctly filtered.
[ "Test", "that", "Consts", "are", "correctly", "filtered", "." ]
def testFilterIfNotConst(self): const_source = """ [EnableIfNot=blue] const int kMyConst1 = 1; [EnableIfNot=orange] const double kMyConst2 = 2; [EnableIf=blue] const int kMyConst3 = 3; [EnableIfNot=blue] const int kMyConst4 = 4; [EnableIfNot=purple] const ...
[ "def", "testFilterIfNotConst", "(", "self", ")", ":", "const_source", "=", "\"\"\"\n [EnableIfNot=blue]\n const int kMyConst1 = 1;\n [EnableIfNot=orange]\n const double kMyConst2 = 2;\n [EnableIf=blue]\n const int kMyConst3 = 3;\n [EnableIfNot=blue]\n const in...
Test that Consts are correctly filtered.
[ "Test", "that", "Consts", "are", "correctly", "filtered", "." ]
[ "\"\"\"Test that Consts are correctly filtered.\"\"\"" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
cba249b0f365fc54623e5419a903a23acafe1778
sunlongbo/chromium
mojo/public/tools/mojom/mojom/parse/conditional_features_unittest.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
testFilterIfNotMultipleConst
null
def testFilterIfNotMultipleConst(self): """Test that Consts are correctly filtered.""" const_source = """ [EnableIfNot=blue] const int kMyConst1 = 1; [EnableIfNot=orange] const double kMyConst2 = 2; [EnableIfNot=orange] const int kMyConst3 = 3; """ expected_source = "...
Test that Consts are correctly filtered.
Test that Consts are correctly filtered.
[ "Test", "that", "Consts", "are", "correctly", "filtered", "." ]
def testFilterIfNotMultipleConst(self): const_source = """ [EnableIfNot=blue] const int kMyConst1 = 1; [EnableIfNot=orange] const double kMyConst2 = 2; [EnableIfNot=orange] const int kMyConst3 = 3; """ expected_source = """ [EnableIfNot=orange] const double kM...
[ "def", "testFilterIfNotMultipleConst", "(", "self", ")", ":", "const_source", "=", "\"\"\"\n [EnableIfNot=blue]\n const int kMyConst1 = 1;\n [EnableIfNot=orange]\n const double kMyConst2 = 2;\n [EnableIfNot=orange]\n const int kMyConst3 = 3;\n \"\"\"", "expected_so...
Test that Consts are correctly filtered.
[ "Test", "that", "Consts", "are", "correctly", "filtered", "." ]
[ "\"\"\"Test that Consts are correctly filtered.\"\"\"" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
cba249b0f365fc54623e5419a903a23acafe1778
sunlongbo/chromium
mojo/public/tools/mojom/mojom/parse/conditional_features_unittest.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
testFilterEnum
null
def testFilterEnum(self): """Test that EnumValues are correctly filtered from an Enum.""" enum_source = """ enum MyEnum { [EnableIf=purple] VALUE1, [EnableIf=blue] VALUE2, VALUE3, }; """ expected_source = """ enum MyEnum { [EnableIf=blue]...
Test that EnumValues are correctly filtered from an Enum.
Test that EnumValues are correctly filtered from an Enum.
[ "Test", "that", "EnumValues", "are", "correctly", "filtered", "from", "an", "Enum", "." ]
def testFilterEnum(self): enum_source = """ enum MyEnum { [EnableIf=purple] VALUE1, [EnableIf=blue] VALUE2, VALUE3, }; """ expected_source = """ enum MyEnum { [EnableIf=blue] VALUE2, VALUE3 }; """ self.parseAndAs...
[ "def", "testFilterEnum", "(", "self", ")", ":", "enum_source", "=", "\"\"\"\n enum MyEnum {\n [EnableIf=purple]\n VALUE1,\n [EnableIf=blue]\n VALUE2,\n VALUE3,\n };\n \"\"\"", "expected_source", "=", "\"\"\"\n enum MyEnum {\n [EnableI...
Test that EnumValues are correctly filtered from an Enum.
[ "Test", "that", "EnumValues", "are", "correctly", "filtered", "from", "an", "Enum", "." ]
[ "\"\"\"Test that EnumValues are correctly filtered from an Enum.\"\"\"" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
cba249b0f365fc54623e5419a903a23acafe1778
sunlongbo/chromium
mojo/public/tools/mojom/mojom/parse/conditional_features_unittest.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
testFilterImport
null
def testFilterImport(self): """Test that imports are correctly filtered from a Mojom.""" import_source = """ [EnableIf=blue] import "foo.mojom"; import "bar.mojom"; [EnableIf=purple] import "baz.mojom"; """ expected_source = """ [EnableIf=blue] import "foo.mojom...
Test that imports are correctly filtered from a Mojom.
Test that imports are correctly filtered from a Mojom.
[ "Test", "that", "imports", "are", "correctly", "filtered", "from", "a", "Mojom", "." ]
def testFilterImport(self): import_source = """ [EnableIf=blue] import "foo.mojom"; import "bar.mojom"; [EnableIf=purple] import "baz.mojom"; """ expected_source = """ [EnableIf=blue] import "foo.mojom"; import "bar.mojom"; """ self.parseAndAssertEqual...
[ "def", "testFilterImport", "(", "self", ")", ":", "import_source", "=", "\"\"\"\n [EnableIf=blue]\n import \"foo.mojom\";\n import \"bar.mojom\";\n [EnableIf=purple]\n import \"baz.mojom\";\n \"\"\"", "expected_source", "=", "\"\"\"\n [EnableIf=blue]\n imp...
Test that imports are correctly filtered from a Mojom.
[ "Test", "that", "imports", "are", "correctly", "filtered", "from", "a", "Mojom", "." ]
[ "\"\"\"Test that imports are correctly filtered from a Mojom.\"\"\"" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
cba249b0f365fc54623e5419a903a23acafe1778
sunlongbo/chromium
mojo/public/tools/mojom/mojom/parse/conditional_features_unittest.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
testFilterIfNotImport
null
def testFilterIfNotImport(self): """Test that imports are correctly filtered from a Mojom.""" import_source = """ [EnableIf=blue] import "foo.mojom"; [EnableIfNot=purple] import "bar.mojom"; [EnableIfNot=green] import "baz.mojom"; """ expected_source = """ [Enab...
Test that imports are correctly filtered from a Mojom.
Test that imports are correctly filtered from a Mojom.
[ "Test", "that", "imports", "are", "correctly", "filtered", "from", "a", "Mojom", "." ]
def testFilterIfNotImport(self): import_source = """ [EnableIf=blue] import "foo.mojom"; [EnableIfNot=purple] import "bar.mojom"; [EnableIfNot=green] import "baz.mojom"; """ expected_source = """ [EnableIf=blue] import "foo.mojom"; [EnableIfNot=purple] ...
[ "def", "testFilterIfNotImport", "(", "self", ")", ":", "import_source", "=", "\"\"\"\n [EnableIf=blue]\n import \"foo.mojom\";\n [EnableIfNot=purple]\n import \"bar.mojom\";\n [EnableIfNot=green]\n import \"baz.mojom\";\n \"\"\"", "expected_source", "=", "\"\"\...
Test that imports are correctly filtered from a Mojom.
[ "Test", "that", "imports", "are", "correctly", "filtered", "from", "a", "Mojom", "." ]
[ "\"\"\"Test that imports are correctly filtered from a Mojom.\"\"\"" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
cba249b0f365fc54623e5419a903a23acafe1778
sunlongbo/chromium
mojo/public/tools/mojom/mojom/parse/conditional_features_unittest.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
testFilterInterface
null
def testFilterInterface(self): """Test that definitions are correctly filtered from an Interface.""" interface_source = """ interface MyInterface { [EnableIf=blue] enum MyEnum { [EnableIf=purple] VALUE1, VALUE2, }; [EnableIf=blue] const...
Test that definitions are correctly filtered from an Interface.
Test that definitions are correctly filtered from an Interface.
[ "Test", "that", "definitions", "are", "correctly", "filtered", "from", "an", "Interface", "." ]
def testFilterInterface(self): interface_source = """ interface MyInterface { [EnableIf=blue] enum MyEnum { [EnableIf=purple] VALUE1, VALUE2, }; [EnableIf=blue] const int32 kMyConst = 123; [EnableIf=purple] MyMethod(); ...
[ "def", "testFilterInterface", "(", "self", ")", ":", "interface_source", "=", "\"\"\"\n interface MyInterface {\n [EnableIf=blue]\n enum MyEnum {\n [EnableIf=purple]\n VALUE1,\n VALUE2,\n };\n [EnableIf=blue]\n const int32 kMyConst =...
Test that definitions are correctly filtered from an Interface.
[ "Test", "that", "definitions", "are", "correctly", "filtered", "from", "an", "Interface", "." ]
[ "\"\"\"Test that definitions are correctly filtered from an Interface.\"\"\"" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
cba249b0f365fc54623e5419a903a23acafe1778
sunlongbo/chromium
mojo/public/tools/mojom/mojom/parse/conditional_features_unittest.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
testFilterMethod
null
def testFilterMethod(self): """Test that Parameters are correctly filtered from a Method.""" method_source = """ interface MyInterface { [EnableIf=blue] MyMethod([EnableIf=purple] int32 a) => ([EnableIf=red] int32 b); }; """ expected_source = """ interface MyInterface {...
Test that Parameters are correctly filtered from a Method.
Test that Parameters are correctly filtered from a Method.
[ "Test", "that", "Parameters", "are", "correctly", "filtered", "from", "a", "Method", "." ]
def testFilterMethod(self): method_source = """ interface MyInterface { [EnableIf=blue] MyMethod([EnableIf=purple] int32 a) => ([EnableIf=red] int32 b); }; """ expected_source = """ interface MyInterface { [EnableIf=blue] MyMethod() => ([EnableIf=red] int32 ...
[ "def", "testFilterMethod", "(", "self", ")", ":", "method_source", "=", "\"\"\"\n interface MyInterface {\n [EnableIf=blue]\n MyMethod([EnableIf=purple] int32 a) => ([EnableIf=red] int32 b);\n };\n \"\"\"", "expected_source", "=", "\"\"\"\n interface MyInterface...
Test that Parameters are correctly filtered from a Method.
[ "Test", "that", "Parameters", "are", "correctly", "filtered", "from", "a", "Method", "." ]
[ "\"\"\"Test that Parameters are correctly filtered from a Method.\"\"\"" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
cba249b0f365fc54623e5419a903a23acafe1778
sunlongbo/chromium
mojo/public/tools/mojom/mojom/parse/conditional_features_unittest.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
testFilterStruct
null
def testFilterStruct(self): """Test that definitions are correctly filtered from a Struct.""" struct_source = """ struct MyStruct { [EnableIf=blue] enum MyEnum { VALUE1, [EnableIf=purple] VALUE2, }; [EnableIf=yellow] const double kMyCon...
Test that definitions are correctly filtered from a Struct.
Test that definitions are correctly filtered from a Struct.
[ "Test", "that", "definitions", "are", "correctly", "filtered", "from", "a", "Struct", "." ]
def testFilterStruct(self): struct_source = """ struct MyStruct { [EnableIf=blue] enum MyEnum { VALUE1, [EnableIf=purple] VALUE2, }; [EnableIf=yellow] const double kMyConst = 1.23; [EnableIf=green] int32 a; double b;...
[ "def", "testFilterStruct", "(", "self", ")", ":", "struct_source", "=", "\"\"\"\n struct MyStruct {\n [EnableIf=blue]\n enum MyEnum {\n VALUE1,\n [EnableIf=purple]\n VALUE2,\n };\n [EnableIf=yellow]\n const double kMyConst = 1.23;\n ...
Test that definitions are correctly filtered from a Struct.
[ "Test", "that", "definitions", "are", "correctly", "filtered", "from", "a", "Struct", "." ]
[ "\"\"\"Test that definitions are correctly filtered from a Struct.\"\"\"" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
cba249b0f365fc54623e5419a903a23acafe1778
sunlongbo/chromium
mojo/public/tools/mojom/mojom/parse/conditional_features_unittest.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
testFilterIfNotStruct
null
def testFilterIfNotStruct(self): """Test that definitions are correctly filtered from a Struct.""" struct_source = """ struct MyStruct { [EnableIf=blue] enum MyEnum { VALUE1, [EnableIfNot=red] VALUE2, }; [EnableIfNot=yellow] const doubl...
Test that definitions are correctly filtered from a Struct.
Test that definitions are correctly filtered from a Struct.
[ "Test", "that", "definitions", "are", "correctly", "filtered", "from", "a", "Struct", "." ]
def testFilterIfNotStruct(self): struct_source = """ struct MyStruct { [EnableIf=blue] enum MyEnum { VALUE1, [EnableIfNot=red] VALUE2, }; [EnableIfNot=yellow] const double kMyConst = 1.23; [EnableIf=green] int32 a; d...
[ "def", "testFilterIfNotStruct", "(", "self", ")", ":", "struct_source", "=", "\"\"\"\n struct MyStruct {\n [EnableIf=blue]\n enum MyEnum {\n VALUE1,\n [EnableIfNot=red]\n VALUE2,\n };\n [EnableIfNot=yellow]\n const double kMyConst = ...
Test that definitions are correctly filtered from a Struct.
[ "Test", "that", "definitions", "are", "correctly", "filtered", "from", "a", "Struct", "." ]
[ "\"\"\"Test that definitions are correctly filtered from a Struct.\"\"\"" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
cba249b0f365fc54623e5419a903a23acafe1778
sunlongbo/chromium
mojo/public/tools/mojom/mojom/parse/conditional_features_unittest.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
testFilterUnion
null
def testFilterUnion(self): """Test that UnionFields are correctly filtered from a Union.""" union_source = """ union MyUnion { [EnableIf=yellow] int32 a; [EnableIf=red] bool b; }; """ expected_source = """ union MyUnion { [EnableIf=red] b...
Test that UnionFields are correctly filtered from a Union.
Test that UnionFields are correctly filtered from a Union.
[ "Test", "that", "UnionFields", "are", "correctly", "filtered", "from", "a", "Union", "." ]
def testFilterUnion(self): union_source = """ union MyUnion { [EnableIf=yellow] int32 a; [EnableIf=red] bool b; }; """ expected_source = """ union MyUnion { [EnableIf=red] bool b; }; """ self.parseAndAssertEqual(union_source, ex...
[ "def", "testFilterUnion", "(", "self", ")", ":", "union_source", "=", "\"\"\"\n union MyUnion {\n [EnableIf=yellow]\n int32 a;\n [EnableIf=red]\n bool b;\n };\n \"\"\"", "expected_source", "=", "\"\"\"\n union MyUnion {\n [EnableIf=red]\n ...
Test that UnionFields are correctly filtered from a Union.
[ "Test", "that", "UnionFields", "are", "correctly", "filtered", "from", "a", "Union", "." ]
[ "\"\"\"Test that UnionFields are correctly filtered from a Union.\"\"\"" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
20b14d8d670a9805bbe5ca92a9561fe054bfa1ba
sunlongbo/chromium
testing/trigger_scripts/perf_device_trigger.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
_query_swarming_for_eligible_bot_configs
<not_specific>
def _query_swarming_for_eligible_bot_configs(self, dimensions): """Query Swarming to figure out which bots are available. Returns: a dictionary in which the keys are the bot id and the values are Bot object that indicate the health status of the bots. """ query_result =...
Query Swarming to figure out which bots are available. Returns: a dictionary in which the keys are the bot id and the values are Bot object that indicate the health status of the bots.
Query Swarming to figure out which bots are available. Returns: a dictionary in which the keys are the bot id and the values are Bot object that indicate the health status of the bots.
[ "Query", "Swarming", "to", "figure", "out", "which", "bots", "are", "available", ".", "Returns", ":", "a", "dictionary", "in", "which", "the", "keys", "are", "the", "bot", "id", "and", "the", "values", "are", "Bot", "object", "that", "indicate", "the", "...
def _query_swarming_for_eligible_bot_configs(self, dimensions): query_result = self.list_bots(dimensions, server=self._swarming_server) perf_bots = {} for bot in query_result: alive = (not bot.get('is_dead') and not bot.get('quarantined') ...
[ "def", "_query_swarming_for_eligible_bot_configs", "(", "self", ",", "dimensions", ")", ":", "query_result", "=", "self", ".", "list_bots", "(", "dimensions", ",", "server", "=", "self", ".", "_swarming_server", ")", "perf_bots", "=", "{", "}", "for", "bot", "...
Query Swarming to figure out which bots are available.
[ "Query", "Swarming", "to", "figure", "out", "which", "bots", "are", "available", "." ]
[ "\"\"\"Query Swarming to figure out which bots are available.\n\n Returns: a dictionary in which the keys are the bot id and\n the values are Bot object that indicate the health status\n of the bots.\n \"\"\"", "# Device maintenance is usually quick, and we can wait for it to", "# fi...
[ { "param": "self", "type": null }, { "param": "dimensions", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "dimensions", "type": null, "docstring": null, "docstring_toke...
20b14d8d670a9805bbe5ca92a9561fe054bfa1ba
sunlongbo/chromium
testing/trigger_scripts/perf_device_trigger.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
_query_swarming_for_last_shard_id
<not_specific>
def _query_swarming_for_last_shard_id(self, shard_index): """Per shard, query swarming for the last bot that ran the task. Example: swarming.py query -S server-url.com --limit 1 \\ 'tasks/list?tags=os:Windows&tags=pool:chrome.tests.perf&tags=shard:12' """ values = ['%s:%s' % (...
Per shard, query swarming for the last bot that ran the task. Example: swarming.py query -S server-url.com --limit 1 \\ 'tasks/list?tags=os:Windows&tags=pool:chrome.tests.perf&tags=shard:12'
Per shard, query swarming for the last bot that ran the task.
[ "Per", "shard", "query", "swarming", "for", "the", "last", "bot", "that", "ran", "the", "task", "." ]
def _query_swarming_for_last_shard_id(self, shard_index): values = ['%s:%s' % (k, v) for k, v in self._dimensions.items()] values.sort() values_with_shard = list(values) values_with_shard.append('%s:%s' % ('shard', str(shard_index))) values_with_shard.sort() try: ...
[ "def", "_query_swarming_for_last_shard_id", "(", "self", ",", "shard_index", ")", ":", "values", "=", "[", "'%s:%s'", "%", "(", "k", ",", "v", ")", "for", "k", ",", "v", "in", "self", ".", "_dimensions", ".", "items", "(", ")", "]", "values", ".", "s...
Per shard, query swarming for the last bot that ran the task.
[ "Per", "shard", "query", "swarming", "for", "the", "last", "bot", "that", "ran", "the", "task", "." ]
[ "\"\"\"Per shard, query swarming for the last bot that ran the task.\n\n Example: swarming.py query -S server-url.com --limit 1 \\\\\n 'tasks/list?tags=os:Windows&tags=pool:chrome.tests.perf&tags=shard:12'\n \"\"\"", "# Append the shard as a tag", "# TODO(eyaich): For now we are ignoring ...
[ { "param": "self", "type": null }, { "param": "shard_index", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "shard_index", "type": null, "docstring": null, "docstring_tok...
41c5c66e30b4c632332a0500486c6b8636141d20
sunlongbo/chromium
tools/perf/core/tbmv3/run_tbmv3_metric_unittest.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
testRunInternalTBMv3Metric
null
def testRunInternalTBMv3Metric(self): """Run metric that is compiled into Trace Processor.""" # This won't produce any histograms because trace_metadata proto is not # annotated. Check only that it doesn't throw errors. 'trace_metadata' # metric is relatively unlikely to be removed from Perfetto, but if...
Run metric that is compiled into Trace Processor.
Run metric that is compiled into Trace Processor.
[ "Run", "metric", "that", "is", "compiled", "into", "Trace", "Processor", "." ]
def testRunInternalTBMv3Metric(self): run_tbmv3_metric.Main([ '--trace', self.trace_path, '--metric', 'trace_metadata', '--outfile', self.outfile_path, ])
[ "def", "testRunInternalTBMv3Metric", "(", "self", ")", ":", "run_tbmv3_metric", ".", "Main", "(", "[", "'--trace'", ",", "self", ".", "trace_path", ",", "'--metric'", ",", "'trace_metadata'", ",", "'--outfile'", ",", "self", ".", "outfile_path", ",", "]", ")" ...
Run metric that is compiled into Trace Processor.
[ "Run", "metric", "that", "is", "compiled", "into", "Trace", "Processor", "." ]
[ "\"\"\"Run metric that is compiled into Trace Processor.\"\"\"", "# This won't produce any histograms because trace_metadata proto is not", "# annotated. Check only that it doesn't throw errors. 'trace_metadata'", "# metric is relatively unlikely to be removed from Perfetto, but if it", "# is, we will have ...
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
41c92623bf2ef223341778fec0aa8ae531816675
sunlongbo/chromium
docs/enterprise/extension_query.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
ComputeExtensionsList
null
def ComputeExtensionsList(extensions_list, data): """Computes list of machines that have an extension. This sample function processes the |data| retrieved from the Takeout API and calculates the list of machines that have installed each extension listed in the data. Args: extensions_list: the extension ...
Computes list of machines that have an extension. This sample function processes the |data| retrieved from the Takeout API and calculates the list of machines that have installed each extension listed in the data. Args: extensions_list: the extension list dictionary to fill. data: the data fetched fro...
Computes list of machines that have an extension. This sample function processes the |data| retrieved from the Takeout API and calculates the list of machines that have installed each extension listed in the data.
[ "Computes", "list", "of", "machines", "that", "have", "an", "extension", ".", "This", "sample", "function", "processes", "the", "|data|", "retrieved", "from", "the", "Takeout", "API", "and", "calculates", "the", "list", "of", "machines", "that", "have", "insta...
def ComputeExtensionsList(extensions_list, data): for device in data['browsers']: if 'browsers' not in device: continue for browser in device['browsers']: if 'profiles' not in browser: continue for profile in browser['profiles']: if 'extensions' not in profile: cont...
[ "def", "ComputeExtensionsList", "(", "extensions_list", ",", "data", ")", ":", "for", "device", "in", "data", "[", "'browsers'", "]", ":", "if", "'browsers'", "not", "in", "device", ":", "continue", "for", "browser", "in", "device", "[", "'browsers'", "]", ...
Computes list of machines that have an extension.
[ "Computes", "list", "of", "machines", "that", "have", "an", "extension", "." ]
[ "\"\"\"Computes list of machines that have an extension.\n\n This sample function processes the |data| retrieved from the Takeout API and\n calculates the list of machines that have installed each extension listed in\n the data.\n\n Args:\n extensions_list: the extension list dictionary to fill.\n data: t...
[ { "param": "extensions_list", "type": null }, { "param": "data", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "extensions_list", "type": null, "docstring": "the extension list dictionary to fill.", "docstring_tokens": [ "the", "extension", "list", "dictionary", "to", "fill", "." ...
41c92623bf2ef223341778fec0aa8ae531816675
sunlongbo/chromium
docs/enterprise/extension_query.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
Flatten
null
def Flatten(data, all_columns): """Flattens lists inside |data|, one level deep. This function will flatten each dictionary key in |data| into a single row so that it can be written to a CSV file. Args: data: the data to be flattened. all_columns: set of all columns that are found in the result (this ...
Flattens lists inside |data|, one level deep. This function will flatten each dictionary key in |data| into a single row so that it can be written to a CSV file. Args: data: the data to be flattened. all_columns: set of all columns that are found in the result (this will be filled by the function)...
Flattens lists inside |data|, one level deep. This function will flatten each dictionary key in |data| into a single row so that it can be written to a CSV file.
[ "Flattens", "lists", "inside", "|data|", "one", "level", "deep", ".", "This", "function", "will", "flatten", "each", "dictionary", "key", "in", "|data|", "into", "a", "single", "row", "so", "that", "it", "can", "be", "written", "to", "a", "CSV", "file", ...
def Flatten(data, all_columns): SEPARATOR = ', ' MAX_CELL_LENGTH = 32700 for item in data: added_item = {} for prop, value in item.items(): if not isinstance(value, (list, set)): added_item[prop] = value continue num_prop = 'num_' + prop added_item[num_prop] = len(value) ...
[ "def", "Flatten", "(", "data", ",", "all_columns", ")", ":", "SEPARATOR", "=", "', '", "MAX_CELL_LENGTH", "=", "32700", "for", "item", "in", "data", ":", "added_item", "=", "{", "}", "for", "prop", ",", "value", "in", "item", ".", "items", "(", ")", ...
Flattens lists inside |data|, one level deep.
[ "Flattens", "lists", "inside", "|data|", "one", "level", "deep", "." ]
[ "\"\"\"Flattens lists inside |data|, one level deep.\n\n This function will flatten each dictionary key in |data| into a single row\n so that it can be written to a CSV file.\n\n Args:\n data: the data to be flattened.\n all_columns: set of all columns that are found in the result (this will be\n fill...
[ { "param": "data", "type": null }, { "param": "all_columns", "type": null } ]
{ "returns": [ { "docstring": "A list of dict objects whose lists or sets have been flattened.", "docstring_tokens": [ "A", "list", "of", "dict", "objects", "whose", "lists", "or", "sets", "have", "been", "...
41c92623bf2ef223341778fec0aa8ae531816675
sunlongbo/chromium
docs/enterprise/extension_query.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
ExtensionListAsCsv
null
def ExtensionListAsCsv(extensions_list, csv_filename, sort_column='name'): """Saves an extensions list to a CSV file. Args: extensions_list: an extensions list as returned by ComputeExtensionsList csv_filename: the name of the CSV file to save sort_column: the name of the column by which to sort the da...
Saves an extensions list to a CSV file. Args: extensions_list: an extensions list as returned by ComputeExtensionsList csv_filename: the name of the CSV file to save sort_column: the name of the column by which to sort the data
Saves an extensions list to a CSV file.
[ "Saves", "an", "extensions", "list", "to", "a", "CSV", "file", "." ]
def ExtensionListAsCsv(extensions_list, csv_filename, sort_column='name'): all_columns = set() flattened_list = list(Flatten(DictToList(extensions_list), all_columns)) desired_column_order = [ 'id', 'name', 'num_permissions', 'num_installed', 'num_disabled', 'num_forced', 'permissions', 'installed', '...
[ "def", "ExtensionListAsCsv", "(", "extensions_list", ",", "csv_filename", ",", "sort_column", "=", "'name'", ")", ":", "all_columns", "=", "set", "(", ")", "flattened_list", "=", "list", "(", "Flatten", "(", "DictToList", "(", "extensions_list", ")", ",", "all...
Saves an extensions list to a CSV file.
[ "Saves", "an", "extensions", "list", "to", "a", "CSV", "file", "." ]
[ "\"\"\"Saves an extensions list to a CSV file.\n\n Args:\n extensions_list: an extensions list as returned by ComputeExtensionsList\n csv_filename: the name of the CSV file to save\n sort_column: the name of the column by which to sort the data\n \"\"\"", "# Order the columns as desired. Columns other ...
[ { "param": "extensions_list", "type": null }, { "param": "csv_filename", "type": null }, { "param": "sort_column", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "extensions_list", "type": null, "docstring": "an extensions list as returned by ComputeExtensionsList", "docstring_tokens": [ "an", "extensions", "list", "as", "returned", "by", ...
8908183381c3b12020916f04f5a6c484844beb1a
sunlongbo/chromium
tools/perf/cli_tools/soundwave/tables/timeseries.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
AsApiParams
<not_specific>
def AsApiParams(self): """Return a dict with params for a /timeseries2 API request.""" params = self.AsDict() if not params['test_case']: del params['test_case'] # test_case is optional. params['columns'] = ','.join(_TIMESERIES2_COLS) return params
Return a dict with params for a /timeseries2 API request.
Return a dict with params for a /timeseries2 API request.
[ "Return", "a", "dict", "with", "params", "for", "a", "/", "timeseries2", "API", "request", "." ]
def AsApiParams(self): params = self.AsDict() if not params['test_case']: del params['test_case'] params['columns'] = ','.join(_TIMESERIES2_COLS) return params
[ "def", "AsApiParams", "(", "self", ")", ":", "params", "=", "self", ".", "AsDict", "(", ")", "if", "not", "params", "[", "'test_case'", "]", ":", "del", "params", "[", "'test_case'", "]", "params", "[", "'columns'", "]", "=", "','", ".", "join", "(",...
Return a dict with params for a /timeseries2 API request.
[ "Return", "a", "dict", "with", "params", "for", "a", "/", "timeseries2", "API", "request", "." ]
[ "\"\"\"Return a dict with params for a /timeseries2 API request.\"\"\"", "# test_case is optional." ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
8506772f25c624df601637d4fa0a97b1dc9748f3
sunlongbo/chromium
tools/json_comment_eater/json_comment_eater.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
_Rcount
<not_specific>
def _Rcount(string, chars): '''Returns the number of consecutive characters from |chars| that occur at the end of |string|. ''' return len(string) - len(string.rstrip(chars))
Returns the number of consecutive characters from |chars| that occur at the end of |string|.
Returns the number of consecutive characters from |chars| that occur at the end of |string|.
[ "Returns", "the", "number", "of", "consecutive", "characters", "from", "|chars|", "that", "occur", "at", "the", "end", "of", "|string|", "." ]
def _Rcount(string, chars): return len(string) - len(string.rstrip(chars))
[ "def", "_Rcount", "(", "string", ",", "chars", ")", ":", "return", "len", "(", "string", ")", "-", "len", "(", "string", ".", "rstrip", "(", "chars", ")", ")" ]
Returns the number of consecutive characters from |chars| that occur at the end of |string|.
[ "Returns", "the", "number", "of", "consecutive", "characters", "from", "|chars|", "that", "occur", "at", "the", "end", "of", "|string|", "." ]
[ "'''Returns the number of consecutive characters from |chars| that occur at the\n end of |string|.\n '''" ]
[ { "param": "string", "type": null }, { "param": "chars", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "string", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "chars", "type": null, "docstring": null, "docstring_tokens"...
e02be70cffb4ab98b7ae8e9e4ae4b5db3a434cb6
sunlongbo/chromium
tools/android/customtabs_benchmark/scripts/customtabs_benchmark.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
RunOnce
<not_specific>
def RunOnce(device, url, speculated_url, parallel_url, warmup, skip_launcher_activity, speculation_mode, delay_to_may_launch_url, delay_to_launch_url, cold, pinning_benchmark, pin_filename, pin_offset, pin_length, extra_brief_memory_mb, chrome_args, reset_chrome_state): ...
Runs a test on a device once. Args: device: (DeviceUtils) device to run the tests on. url: (str) URL to load. End of the redirect chain when using a parallel request. speculated_url: (str) Speculated URL. parallel_url: ([str]) URL to load in parallel, typically the start of the redire...
Runs a test on a device once.
[ "Runs", "a", "test", "on", "a", "device", "once", "." ]
def RunOnce(device, url, speculated_url, parallel_url, warmup, skip_launcher_activity, speculation_mode, delay_to_may_launch_url, delay_to_launch_url, cold, pinning_benchmark, pin_filename, pin_offset, pin_length, extra_brief_memory_mb, chrome_args, reset_chrome_state): ...
[ "def", "RunOnce", "(", "device", ",", "url", ",", "speculated_url", ",", "parallel_url", ",", "warmup", ",", "skip_launcher_activity", ",", "speculation_mode", ",", "delay_to_may_launch_url", ",", "delay_to_launch_url", ",", "cold", ",", "pinning_benchmark", ",", "p...
Runs a test on a device once.
[ "Runs", "a", "test", "on", "a", "device", "once", "." ]
[ "\"\"\"Runs a test on a device once.\n\n Args:\n device: (DeviceUtils) device to run the tests on.\n url: (str) URL to load. End of the redirect chain when using a\n parallel request.\n speculated_url: (str) Speculated URL.\n parallel_url: ([str]) URL to load in parallel, typically\n the ...
[ { "param": "device", "type": null }, { "param": "url", "type": null }, { "param": "speculated_url", "type": null }, { "param": "parallel_url", "type": null }, { "param": "warmup", "type": null }, { "param": "skip_launcher_activity", "type": null ...
{ "returns": [ { "docstring": "The output line (str), like this (one line only):\n,,,,\n,,,\n\nor None on error.", "docstring_tokens": [ "The", "output", "line", "(", "str", ")", "like", "this", "(", "one", "line",...
e02be70cffb4ab98b7ae8e9e4ae4b5db3a434cb6
sunlongbo/chromium
tools/android/customtabs_benchmark/scripts/customtabs_benchmark.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
LoopOnDevice
<not_specific>
def LoopOnDevice(device, configs, output_filename, once=False, should_stop=None): """Loops the tests on a device. Args: device: (DeviceUtils) device to run the tests on. configs: ([dict]) output_filename: (str) Output filename. '-' for stdout. once: (bool) Run only once. should...
Loops the tests on a device. Args: device: (DeviceUtils) device to run the tests on. configs: ([dict]) output_filename: (str) Output filename. '-' for stdout. once: (bool) Run only once. should_stop: (threading.Event or None) When the event is set, stop looping.
Loops the tests on a device.
[ "Loops", "the", "tests", "on", "a", "device", "." ]
def LoopOnDevice(device, configs, output_filename, once=False, should_stop=None): to_stdout = output_filename == '-' out = sys.stdout if to_stdout else open(output_filename, 'a') try: while should_stop is None or not should_stop.is_set(): config = configs[random.randint(0, len(configs) ...
[ "def", "LoopOnDevice", "(", "device", ",", "configs", ",", "output_filename", ",", "once", "=", "False", ",", "should_stop", "=", "None", ")", ":", "to_stdout", "=", "output_filename", "==", "'-'", "out", "=", "sys", ".", "stdout", "if", "to_stdout", "else...
Loops the tests on a device.
[ "Loops", "the", "tests", "on", "a", "device", "." ]
[ "\"\"\"Loops the tests on a device.\n\n Args:\n device: (DeviceUtils) device to run the tests on.\n configs: ([dict])\n output_filename: (str) Output filename. '-' for stdout.\n once: (bool) Run only once.\n should_stop: (threading.Event or None) When the event is set, stop looping.\n \"\"\"", "#...
[ { "param": "device", "type": null }, { "param": "configs", "type": null }, { "param": "output_filename", "type": null }, { "param": "once", "type": null }, { "param": "should_stop", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "device", "type": null, "docstring": "(DeviceUtils) device to run the tests on.", "docstring_tokens": [ "(", "DeviceUtils", ")", "device", "to", "run", "the", "tes...
45f70cb0ff8a67c716b2b5dace4a5684d6c33724
sunlongbo/chromium
tools/dromaeo_benchmark_runner/dromaeo_benchmark_runner.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
PrepareSpreadsheet
null
def PrepareSpreadsheet(self, run_count): """Update cells in worksheet topmost row with service information. Calculate column count corresponding to run_count and create worksheet column titles [c0, c1, ...] in the topmost row to speed up spreadsheet updates (it allows to insert a whole row with a singl...
Update cells in worksheet topmost row with service information. Calculate column count corresponding to run_count and create worksheet column titles [c0, c1, ...] in the topmost row to speed up spreadsheet updates (it allows to insert a whole row with a single request)
Update cells in worksheet topmost row with service information. Calculate column count corresponding to run_count and create worksheet column titles [c0, c1, ...] in the topmost row to speed up spreadsheet updates (it allows to insert a whole row with a single request)
[ "Update", "cells", "in", "worksheet", "topmost", "row", "with", "service", "information", ".", "Calculate", "column", "count", "corresponding", "to", "run_count", "and", "create", "worksheet", "column", "titles", "[", "c0", "c1", "...", "]", "in", "the", "topm...
def PrepareSpreadsheet(self, run_count): self.columns_count = (run_count + 2) * len(test_props) if self.columns_count > max_spreadsheet_columns: max_run_count = max_spreadsheet_columns / len(test_props) - 2 raise Exception('maximum run count is %i' % max_run_count) for i in xrange(self.columns_c...
[ "def", "PrepareSpreadsheet", "(", "self", ",", "run_count", ")", ":", "self", ".", "columns_count", "=", "(", "run_count", "+", "2", ")", "*", "len", "(", "test_props", ")", "if", "self", ".", "columns_count", ">", "max_spreadsheet_columns", ":", "max_run_co...
Update cells in worksheet topmost row with service information.
[ "Update", "cells", "in", "worksheet", "topmost", "row", "with", "service", "information", "." ]
[ "\"\"\"Update cells in worksheet topmost row with service information.\n\n Calculate column count corresponding to run_count and create worksheet\n column titles [c0, c1, ...] in the topmost row to speed up spreadsheet\n updates (it allows to insert a whole row with a single request)\n \"\"\"", "# Cal...
[ { "param": "self", "type": null }, { "param": "run_count", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "run_count", "type": null, "docstring": null, "docstring_token...
45f70cb0ff8a67c716b2b5dace4a5684d6c33724
sunlongbo/chromium
tools/dromaeo_benchmark_runner/dromaeo_benchmark_runner.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
WriteBrowserBenchmarkResults
null
def WriteBrowserBenchmarkResults(self, test_name, test_data): "Insert a row with single test results" row = [] for prop in test_props: if not row: row.append(test_name) else: row.append('') row.extend([str(x) for x in test_data[prop]]) row.append(str(sum(test_data[pro...
Insert a row with single test results
Insert a row with single test results
[ "Insert", "a", "row", "with", "single", "test", "results" ]
def WriteBrowserBenchmarkResults(self, test_name, test_data): row = [] for prop in test_props: if not row: row.append(test_name) else: row.append('') row.extend([str(x) for x in test_data[prop]]) row.append(str(sum(test_data[prop]) / len(test_data[prop]))) self._Inser...
[ "def", "WriteBrowserBenchmarkResults", "(", "self", ",", "test_name", ",", "test_data", ")", ":", "row", "=", "[", "]", "for", "prop", "in", "test_props", ":", "if", "not", "row", ":", "row", ".", "append", "(", "test_name", ")", "else", ":", "row", "....
Insert a row with single test results
[ "Insert", "a", "row", "with", "single", "test", "results" ]
[ "\"Insert a row with single test results\"" ]
[ { "param": "self", "type": null }, { "param": "test_name", "type": null }, { "param": "test_data", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "test_name", "type": null, "docstring": null, "docstring_token...
45f70cb0ff8a67c716b2b5dace4a5684d6c33724
sunlongbo/chromium
tools/dromaeo_benchmark_runner/dromaeo_benchmark_runner.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
ProcessBrowserPostData
null
def ProcessBrowserPostData(self, data): "Convert dromaeo test results in internal format" tests = json.loads(data[0]) for test in tests: test_name = test['name'] if test_name not in self.data: # Test is encountered for the first time. self.data[test_name] = dict([(prop, []) for p...
Convert dromaeo test results in internal format
Convert dromaeo test results in internal format
[ "Convert", "dromaeo", "test", "results", "in", "internal", "format" ]
def ProcessBrowserPostData(self, data): tests = json.loads(data[0]) for test in tests: test_name = test['name'] if test_name not in self.data: self.data[test_name] = dict([(prop, []) for prop in test_props]) for prop in test_props: value = -1 if prop in test: value = te...
[ "def", "ProcessBrowserPostData", "(", "self", ",", "data", ")", ":", "tests", "=", "json", ".", "loads", "(", "data", "[", "0", "]", ")", "for", "test", "in", "tests", ":", "test_name", "=", "test", "[", "'name'", "]", "if", "test_name", "not", "in",...
Convert dromaeo test results in internal format
[ "Convert", "dromaeo", "test", "results", "in", "internal", "format" ]
[ "\"Convert dromaeo test results in internal format\"", "# Test is encountered for the first time.", "# Append current run results.", "# workaround for Opera 10.5" ]
[ { "param": "self", "type": null }, { "param": "data", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "data", "type": null, "docstring": null, "docstring_tokens": [...
322c2b75ccd8bdd2dd56a56615b5f3fae7eb80ea
sunlongbo/chromium
tools/site_compare/site_compare.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
Scrape
null
def Scrape(browsers, urls, window_size=(1024, 768), window_pos=(0, 0), timeout=20, save_path=None, **kwargs): """Invoke one or more browsers over one or more URLs, scraping renders. Args: browsers: browsers to invoke with optional version strings urls: URLs to visit window_size: size of the ...
Invoke one or more browsers over one or more URLs, scraping renders. Args: browsers: browsers to invoke with optional version strings urls: URLs to visit window_size: size of the browser window to display window_pos: location of browser window timeout: time (in seconds) to wait for page to load ...
Invoke one or more browsers over one or more URLs, scraping renders.
[ "Invoke", "one", "or", "more", "browsers", "over", "one", "or", "more", "URLs", "scraping", "renders", "." ]
def Scrape(browsers, urls, window_size=(1024, 768), window_pos=(0, 0), timeout=20, save_path=None, **kwargs): if type(browsers) in types.StringTypes: browsers = [browsers] if save_path is None: save_path = os.path.join(os.path.split(__file__)[0], "Scrapes") for browser in browsers: if type(brow...
[ "def", "Scrape", "(", "browsers", ",", "urls", ",", "window_size", "=", "(", "1024", ",", "768", ")", ",", "window_pos", "=", "(", "0", ",", "0", ")", ",", "timeout", "=", "20", ",", "save_path", "=", "None", ",", "**", "kwargs", ")", ":", "if", ...
Invoke one or more browsers over one or more URLs, scraping renders.
[ "Invoke", "one", "or", "more", "browsers", "over", "one", "or", "more", "URLs", "scraping", "renders", "." ]
[ "\"\"\"Invoke one or more browsers over one or more URLs, scraping renders.\n\n Args:\n browsers: browsers to invoke with optional version strings\n urls: URLs to visit\n window_size: size of the browser window to display\n window_pos: location of browser window\n timeout: time (in seconds) to wait ...
[ { "param": "browsers", "type": null }, { "param": "urls", "type": null }, { "param": "window_size", "type": null }, { "param": "window_pos", "type": null }, { "param": "timeout", "type": null }, { "param": "save_path", "type": null } ]
{ "returns": [ { "docstring": null, "docstring_tokens": [ "None" ], "type": null } ], "raises": [], "params": [ { "identifier": "browsers", "type": null, "docstring": "browsers to invoke with optional version strings", "docstring_tokens": [ ...
322c2b75ccd8bdd2dd56a56615b5f3fae7eb80ea
sunlongbo/chromium
tools/site_compare/site_compare.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
Compare
null
def Compare(base, compare, ops, root_path=None, out_path=None): """Compares a series of scrapes using a series of operators. Args: base: (browser, version) tuple of version to consider the baseline compare: (browser, version) tuple of version to compare to ops: list of operators plus operator arguments...
Compares a series of scrapes using a series of operators. Args: base: (browser, version) tuple of version to consider the baseline compare: (browser, version) tuple of version to compare to ops: list of operators plus operator arguments root_path: root of the scrapes out_path: place to put any ou...
Compares a series of scrapes using a series of operators.
[ "Compares", "a", "series", "of", "scrapes", "using", "a", "series", "of", "operators", "." ]
def Compare(base, compare, ops, root_path=None, out_path=None): if root_path is None: root_path = os.path.join(os.path.split(__file__)[0], "Scrapes") if out_path is None: out_path = os.path.join(os.path.split(__file__)[0], "Compares") if type(base) in types.StringTypes: base = (base, None) if type(compa...
[ "def", "Compare", "(", "base", ",", "compare", ",", "ops", ",", "root_path", "=", "None", ",", "out_path", "=", "None", ")", ":", "if", "root_path", "is", "None", ":", "root_path", "=", "os", ".", "path", ".", "join", "(", "os", ".", "path", ".", ...
Compares a series of scrapes using a series of operators.
[ "Compares", "a", "series", "of", "scrapes", "using", "a", "series", "of", "operators", "." ]
[ "\"\"\"Compares a series of scrapes using a series of operators.\n\n Args:\n base: (browser, version) tuple of version to consider the baseline\n compare: (browser, version) tuple of version to compare to\n ops: list of operators plus operator arguments\n root_path: root of the scrapes\n out_path: p...
[ { "param": "base", "type": null }, { "param": "compare", "type": null }, { "param": "ops", "type": null }, { "param": "root_path", "type": null }, { "param": "out_path", "type": null } ]
{ "returns": [ { "docstring": null, "docstring_tokens": [ "None" ], "type": null } ], "raises": [], "params": [ { "identifier": "base", "type": null, "docstring": "(browser, version) tuple of version to consider the baseline", "docstring_tokens...
322c2b75ccd8bdd2dd56a56615b5f3fae7eb80ea
sunlongbo/chromium
tools/site_compare/site_compare.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
main
<not_specific>
def main(): """Main executable. Parse the command line and invoke the command.""" cmdline = command_line.CommandLine() # The below two commands are currently unstable so have been disabled # commands.compare2.CreateCommand(cmdline) # commands.maskmaker.CreateCommand(cmdline) commands.measure.CreateCommand(...
Main executable. Parse the command line and invoke the command.
Main executable. Parse the command line and invoke the command.
[ "Main", "executable", ".", "Parse", "the", "command", "line", "and", "invoke", "the", "command", "." ]
def main(): cmdline = command_line.CommandLine() commands.measure.CreateCommand(cmdline) commands.scrape.CreateCommand(cmdline) cmdline.ParseCommandLine() return 0
[ "def", "main", "(", ")", ":", "cmdline", "=", "command_line", ".", "CommandLine", "(", ")", "commands", ".", "measure", ".", "CreateCommand", "(", "cmdline", ")", "commands", ".", "scrape", ".", "CreateCommand", "(", "cmdline", ")", "cmdline", ".", "ParseC...
Main executable.
[ "Main", "executable", "." ]
[ "\"\"\"Main executable. Parse the command line and invoke the command.\"\"\"", "# The below two commands are currently unstable so have been disabled", "# commands.compare2.CreateCommand(cmdline)", "# commands.maskmaker.CreateCommand(cmdline)" ]
[]
{ "returns": [], "raises": [], "params": [], "outlier_params": [], "others": [] }
a3ff627b9fcf299f2f5d1749caf91858fa6de3b9
sunlongbo/chromium
third_party/blink/renderer/bindings/scripts/web_idl/dictionary.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
own_members
<not_specific>
def own_members(self): """ Returns own dictionary members. Inherited members are not included. Members are sorted by their identifiers alphabetically. """ return self._own_members
Returns own dictionary members. Inherited members are not included. Members are sorted by their identifiers alphabetically.
Returns own dictionary members. Inherited members are not included. Members are sorted by their identifiers alphabetically.
[ "Returns", "own", "dictionary", "members", ".", "Inherited", "members", "are", "not", "included", ".", "Members", "are", "sorted", "by", "their", "identifiers", "alphabetically", "." ]
def own_members(self): return self._own_members
[ "def", "own_members", "(", "self", ")", ":", "return", "self", ".", "_own_members" ]
Returns own dictionary members.
[ "Returns", "own", "dictionary", "members", "." ]
[ "\"\"\"\n Returns own dictionary members. Inherited members are not included.\n\n Members are sorted by their identifiers alphabetically.\n \"\"\"" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
a3ff627b9fcf299f2f5d1749caf91858fa6de3b9
sunlongbo/chromium
third_party/blink/renderer/bindings/scripts/web_idl/dictionary.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
members
<not_specific>
def members(self): """ Returns all dictionary members including inherited members, sorted in order from least to most derived dictionaries and lexicographical order within each dictionary. """ def collect_inherited_members(dictionary): if dictionary is None: ...
Returns all dictionary members including inherited members, sorted in order from least to most derived dictionaries and lexicographical order within each dictionary.
Returns all dictionary members including inherited members, sorted in order from least to most derived dictionaries and lexicographical order within each dictionary.
[ "Returns", "all", "dictionary", "members", "including", "inherited", "members", "sorted", "in", "order", "from", "least", "to", "most", "derived", "dictionaries", "and", "lexicographical", "order", "within", "each", "dictionary", "." ]
def members(self): def collect_inherited_members(dictionary): if dictionary is None: return () return (collect_inherited_members(dictionary.inherited) + dictionary.own_members) return tuple(collect_inherited_members(self))
[ "def", "members", "(", "self", ")", ":", "def", "collect_inherited_members", "(", "dictionary", ")", ":", "if", "dictionary", "is", "None", ":", "return", "(", ")", "return", "(", "collect_inherited_members", "(", "dictionary", ".", "inherited", ")", "+", "d...
Returns all dictionary members including inherited members, sorted in order from least to most derived dictionaries and lexicographical order within each dictionary.
[ "Returns", "all", "dictionary", "members", "including", "inherited", "members", "sorted", "in", "order", "from", "least", "to", "most", "derived", "dictionaries", "and", "lexicographical", "order", "within", "each", "dictionary", "." ]
[ "\"\"\"\n Returns all dictionary members including inherited members, sorted in\n order from least to most derived dictionaries and lexicographical order\n within each dictionary.\n \"\"\"" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
a3ff627b9fcf299f2f5d1749caf91858fa6de3b9
sunlongbo/chromium
third_party/blink/renderer/bindings/scripts/web_idl/dictionary.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
has_required_member
<not_specific>
def has_required_member(self): """ Returns True if the dictionary has any required dictionary members. """ return bool(any(member.is_required for member in self.members))
Returns True if the dictionary has any required dictionary members.
Returns True if the dictionary has any required dictionary members.
[ "Returns", "True", "if", "the", "dictionary", "has", "any", "required", "dictionary", "members", "." ]
def has_required_member(self): return bool(any(member.is_required for member in self.members))
[ "def", "has_required_member", "(", "self", ")", ":", "return", "bool", "(", "any", "(", "member", ".", "is_required", "for", "member", "in", "self", ".", "members", ")", ")" ]
Returns True if the dictionary has any required dictionary members.
[ "Returns", "True", "if", "the", "dictionary", "has", "any", "required", "dictionary", "members", "." ]
[ "\"\"\"\n Returns True if the dictionary has any required dictionary members.\n \"\"\"" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
5fdb507f4ea2cb237a62a50ebf83c12e5e51f48d
sunlongbo/chromium
tools/perf/core/results_processor/testing.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
TestResult
<not_specific>
def TestResult(test_path, status='PASS', expected=None, start_time='2015-10-21T07:28:00.000Z', run_duration='1.00s', output_artifacts=None, tags=None, result_id=None): """Build a TestResult dict. This follows the TestResultEntry spec of LUCI Test Results format. See: go/luci-test-re...
Build a TestResult dict. This follows the TestResultEntry spec of LUCI Test Results format. See: go/luci-test-results-design Args: test_path: A string with the path that identifies this test. Usually of the form '{benchmark_name}/{story_name}'. status: An optional string indicating the status of t...
Build a TestResult dict. This follows the TestResultEntry spec of LUCI Test Results format. See: go/luci-test-results-design
[ "Build", "a", "TestResult", "dict", ".", "This", "follows", "the", "TestResultEntry", "spec", "of", "LUCI", "Test", "Results", "format", ".", "See", ":", "go", "/", "luci", "-", "test", "-", "results", "-", "design" ]
def TestResult(test_path, status='PASS', expected=None, start_time='2015-10-21T07:28:00.000Z', run_duration='1.00s', output_artifacts=None, tags=None, result_id=None): if expected is None: expected = status in ('PASS', 'SKIP') test_result = { 'testPath': test_path, 'sta...
[ "def", "TestResult", "(", "test_path", ",", "status", "=", "'PASS'", ",", "expected", "=", "None", ",", "start_time", "=", "'2015-10-21T07:28:00.000Z'", ",", "run_duration", "=", "'1.00s'", ",", "output_artifacts", "=", "None", ",", "tags", "=", "None", ",", ...
Build a TestResult dict.
[ "Build", "a", "TestResult", "dict", "." ]
[ "\"\"\"Build a TestResult dict.\n\n This follows the TestResultEntry spec of LUCI Test Results format.\n See: go/luci-test-results-design\n\n Args:\n test_path: A string with the path that identifies this test. Usually of\n the form '{benchmark_name}/{story_name}'.\n status: An optional string indicat...
[ { "param": "test_path", "type": null }, { "param": "status", "type": null }, { "param": "expected", "type": null }, { "param": "start_time", "type": null }, { "param": "run_duration", "type": null }, { "param": "output_artifacts", "type": null },...
{ "returns": [ { "docstring": "A TestResult dict.", "docstring_tokens": [ "A", "TestResult", "dict", "." ], "type": null } ], "raises": [], "params": [ { "identifier": "test_path", "type": null, "docstring": "A string with the...
5fdb507f4ea2cb237a62a50ebf83c12e5e51f48d
sunlongbo/chromium
tools/perf/core/results_processor/testing.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
SerializeIntermediateResults
null
def SerializeIntermediateResults(in_results, filepath): """Serialize intermediate results to a filepath. Args: in_results: A list of test results. filepath: A file path where to serialize the intermediate results. """ with open(filepath, 'w') as fp: for test_result in in_results: json.dump({'...
Serialize intermediate results to a filepath. Args: in_results: A list of test results. filepath: A file path where to serialize the intermediate results.
Serialize intermediate results to a filepath.
[ "Serialize", "intermediate", "results", "to", "a", "filepath", "." ]
def SerializeIntermediateResults(in_results, filepath): with open(filepath, 'w') as fp: for test_result in in_results: json.dump({'testResult': test_result}, fp, sort_keys=True, separators=(',', ':')) fp.write('\n')
[ "def", "SerializeIntermediateResults", "(", "in_results", ",", "filepath", ")", ":", "with", "open", "(", "filepath", ",", "'w'", ")", "as", "fp", ":", "for", "test_result", "in", "in_results", ":", "json", ".", "dump", "(", "{", "'testResult'", ":", "test...
Serialize intermediate results to a filepath.
[ "Serialize", "intermediate", "results", "to", "a", "filepath", "." ]
[ "\"\"\"Serialize intermediate results to a filepath.\n\n Args:\n in_results: A list of test results.\n filepath: A file path where to serialize the intermediate results.\n \"\"\"" ]
[ { "param": "in_results", "type": null }, { "param": "filepath", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "in_results", "type": null, "docstring": "A list of test results.", "docstring_tokens": [ "A", "list", "of", "test", "results", "." ], "default": null, "is_optio...
ac0b9f54292fd8791c100ed8280a1c8f0fa99852
sunlongbo/chromium
tools/variations/fieldtrial_util.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
_FindFeaturesOverriddenByArgs
<not_specific>
def _FindFeaturesOverriddenByArgs(args): """Returns a list of the features enabled or disabled by the flags in args.""" overridden_features = [] for arg in args: if (arg.startswith('--enable-features=') or arg.startswith('--disable-features=')): _, _, arg_val = arg.partition('=') overridde...
Returns a list of the features enabled or disabled by the flags in args.
Returns a list of the features enabled or disabled by the flags in args.
[ "Returns", "a", "list", "of", "the", "features", "enabled", "or", "disabled", "by", "the", "flags", "in", "args", "." ]
def _FindFeaturesOverriddenByArgs(args): overridden_features = [] for arg in args: if (arg.startswith('--enable-features=') or arg.startswith('--disable-features=')): _, _, arg_val = arg.partition('=') overridden_features.extend(arg_val.split(',')) return [f.split('<')[0] for f in overridd...
[ "def", "_FindFeaturesOverriddenByArgs", "(", "args", ")", ":", "overridden_features", "=", "[", "]", "for", "arg", "in", "args", ":", "if", "(", "arg", ".", "startswith", "(", "'--enable-features='", ")", "or", "arg", ".", "startswith", "(", "'--disable-featur...
Returns a list of the features enabled or disabled by the flags in args.
[ "Returns", "a", "list", "of", "the", "features", "enabled", "or", "disabled", "by", "the", "flags", "in", "args", "." ]
[ "\"\"\"Returns a list of the features enabled or disabled by the flags in args.\"\"\"" ]
[ { "param": "args", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "args", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
ac0b9f54292fd8791c100ed8280a1c8f0fa99852
sunlongbo/chromium
tools/variations/fieldtrial_util.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
MergeFeaturesAndFieldTrialsArgs
<not_specific>
def MergeFeaturesAndFieldTrialsArgs(args): """Merges duplicate features and field trials arguments. Merges multiple instances of --enable-features, --disable-features, --force-fieldtrials and --force-fieldtrial-params. Any such merged flags are moved to the end of the returned list. The original argument order...
Merges duplicate features and field trials arguments. Merges multiple instances of --enable-features, --disable-features, --force-fieldtrials and --force-fieldtrial-params. Any such merged flags are moved to the end of the returned list. The original argument ordering is otherwise maintained. TODO(crbug.com/...
Merges duplicate features and field trials arguments.
[ "Merges", "duplicate", "features", "and", "field", "trials", "arguments", "." ]
def MergeFeaturesAndFieldTrialsArgs(args): merged_args = [] disable_features = set() enable_features = set() force_fieldtrials = set() force_fieldtrial_params = set() for arg in args: if arg.startswith('--disable-features='): disable_features.update(arg.split('=', 1)[1].split(',')) elif arg.st...
[ "def", "MergeFeaturesAndFieldTrialsArgs", "(", "args", ")", ":", "merged_args", "=", "[", "]", "disable_features", "=", "set", "(", ")", "enable_features", "=", "set", "(", ")", "force_fieldtrials", "=", "set", "(", ")", "force_fieldtrial_params", "=", "set", ...
Merges duplicate features and field trials arguments.
[ "Merges", "duplicate", "features", "and", "field", "trials", "arguments", "." ]
[ "\"\"\"Merges duplicate features and field trials arguments.\n\n Merges multiple instances of --enable-features, --disable-features,\n --force-fieldtrials and --force-fieldtrial-params. Any such merged flags are\n moved to the end of the returned list. The original argument ordering is\n otherwise maintained.\n...
[ { "param": "args", "type": null } ]
{ "returns": [ { "docstring": "A new list of strings representing the merged command line arguments.", "docstring_tokens": [ "A", "new", "list", "of", "strings", "representing", "the", "merged", "command", "line", ...
ac0b9f54292fd8791c100ed8280a1c8f0fa99852
sunlongbo/chromium
tools/variations/fieldtrial_util.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
GenerateArgs
<not_specific>
def GenerateArgs(config_path, platform, override_args=None): """Generates command-line flags for enabling field trials. Generates a list of command-line switches to enable field trials for the provided config_path and platform. If override_args is set, all field trials that conflict with any listed --enable-fe...
Generates command-line flags for enabling field trials. Generates a list of command-line switches to enable field trials for the provided config_path and platform. If override_args is set, all field trials that conflict with any listed --enable-features or --disable-features argument are skipped. Args: ...
Generates command-line flags for enabling field trials. Generates a list of command-line switches to enable field trials for the provided config_path and platform.
[ "Generates", "command", "-", "line", "flags", "for", "enabling", "field", "trials", ".", "Generates", "a", "list", "of", "command", "-", "line", "switches", "to", "enable", "field", "trials", "for", "the", "provided", "config_path", "and", "platform", "." ]
def GenerateArgs(config_path, platform, override_args=None): try: with open(config_path, 'r') as config_file: config = json.load(config_file) except (IOError, ValueError): return [] platform_studies = fieldtrial_to_struct.ConfigToStudies( config, [platform], False) if override_ar...
[ "def", "GenerateArgs", "(", "config_path", ",", "platform", ",", "override_args", "=", "None", ")", ":", "try", ":", "with", "open", "(", "config_path", ",", "'r'", ")", "as", "config_file", ":", "config", "=", "json", ".", "load", "(", "config_file", ")...
Generates command-line flags for enabling field trials.
[ "Generates", "command", "-", "line", "flags", "for", "enabling", "field", "trials", "." ]
[ "\"\"\"Generates command-line flags for enabling field trials.\n\n Generates a list of command-line switches to enable field trials for the\n provided config_path and platform. If override_args is set, all field trials\n that conflict with any listed --enable-features or --disable-features argument\n are skippe...
[ { "param": "config_path", "type": null }, { "param": "platform", "type": null }, { "param": "override_args", "type": null } ]
{ "returns": [ { "docstring": "A list of string command-line arguments.", "docstring_tokens": [ "A", "list", "of", "string", "command", "-", "line", "arguments", "." ], "type": null } ], "raises": [], "params...
ac210784ee9cfc7c3615e1a401160b9b413d17d8
sunlongbo/chromium
tools/python/llvm_symbolizer.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
_CheckValidAddr
<not_specific>
def _CheckValidAddr(addr): """ Check whether the addr is valid input to llvm symbolizer. Valid addr has to be octal, binary, or hex number. Args: addr: addr to be entered to llvm symbolizer. Returns: whether the addr is valid input to llvm symbolizer. """ return _HEX.match(addr) or _OCTAL.match(...
Check whether the addr is valid input to llvm symbolizer. Valid addr has to be octal, binary, or hex number. Args: addr: addr to be entered to llvm symbolizer. Returns: whether the addr is valid input to llvm symbolizer.
Check whether the addr is valid input to llvm symbolizer. Valid addr has to be octal, binary, or hex number.
[ "Check", "whether", "the", "addr", "is", "valid", "input", "to", "llvm", "symbolizer", ".", "Valid", "addr", "has", "to", "be", "octal", "binary", "or", "hex", "number", "." ]
def _CheckValidAddr(addr): return _HEX.match(addr) or _OCTAL.match(addr) or _BINARY.match(addr)
[ "def", "_CheckValidAddr", "(", "addr", ")", ":", "return", "_HEX", ".", "match", "(", "addr", ")", "or", "_OCTAL", ".", "match", "(", "addr", ")", "or", "_BINARY", ".", "match", "(", "addr", ")" ]
Check whether the addr is valid input to llvm symbolizer.
[ "Check", "whether", "the", "addr", "is", "valid", "input", "to", "llvm", "symbolizer", "." ]
[ "\"\"\"\n Check whether the addr is valid input to llvm symbolizer.\n Valid addr has to be octal, binary, or hex number.\n\n Args:\n addr: addr to be entered to llvm symbolizer.\n\n Returns:\n whether the addr is valid input to llvm symbolizer.\n \"\"\"" ]
[ { "param": "addr", "type": null } ]
{ "returns": [ { "docstring": "whether the addr is valid input to llvm symbolizer.", "docstring_tokens": [ "whether", "the", "addr", "is", "valid", "input", "to", "llvm", "symbolizer", "." ], "type": null }...
ac210784ee9cfc7c3615e1a401160b9b413d17d8
sunlongbo/chromium
tools/python/llvm_symbolizer.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
Start
null
def Start(self): """Start the llvm symbolizer subprocess. Create a subprocess of the llvm symbolizer executable, which will be used to retrieve function names etc. """ if os.path.isfile(_LLVM_SYMBOLIZER_PATH): self._llvm_symbolizer_subprocess = subprocess.Popen( [_LLVM_SYMBOLIZER_PA...
Start the llvm symbolizer subprocess. Create a subprocess of the llvm symbolizer executable, which will be used to retrieve function names etc.
Start the llvm symbolizer subprocess. Create a subprocess of the llvm symbolizer executable, which will be used to retrieve function names etc.
[ "Start", "the", "llvm", "symbolizer", "subprocess", ".", "Create", "a", "subprocess", "of", "the", "llvm", "symbolizer", "executable", "which", "will", "be", "used", "to", "retrieve", "function", "names", "etc", "." ]
def Start(self): if os.path.isfile(_LLVM_SYMBOLIZER_PATH): self._llvm_symbolizer_subprocess = subprocess.Popen( [_LLVM_SYMBOLIZER_PATH], stdout=subprocess.PIPE, stdin=subprocess.PIPE, universal_newlines=True) else: logging.error('Cannot find llvm_symbolizer he...
[ "def", "Start", "(", "self", ")", ":", "if", "os", ".", "path", ".", "isfile", "(", "_LLVM_SYMBOLIZER_PATH", ")", ":", "self", ".", "_llvm_symbolizer_subprocess", "=", "subprocess", ".", "Popen", "(", "[", "_LLVM_SYMBOLIZER_PATH", "]", ",", "stdout", "=", ...
Start the llvm symbolizer subprocess.
[ "Start", "the", "llvm", "symbolizer", "subprocess", "." ]
[ "\"\"\"Start the llvm symbolizer subprocess.\n\n Create a subprocess of the llvm symbolizer executable, which will be used\n to retrieve function names etc.\n \"\"\"" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
ac210784ee9cfc7c3615e1a401160b9b413d17d8
sunlongbo/chromium
tools/python/llvm_symbolizer.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
Close
null
def Close(self): """Close the llvm symbolizer subprocess. Close the subprocess by closing stdin, stdout and killing the subprocess. """ with self._lock: if self._llvm_symbolizer_subprocess: self._llvm_symbolizer_subprocess.kill() self._llvm_symbolizer_subprocess = None
Close the llvm symbolizer subprocess. Close the subprocess by closing stdin, stdout and killing the subprocess.
Close the llvm symbolizer subprocess. Close the subprocess by closing stdin, stdout and killing the subprocess.
[ "Close", "the", "llvm", "symbolizer", "subprocess", ".", "Close", "the", "subprocess", "by", "closing", "stdin", "stdout", "and", "killing", "the", "subprocess", "." ]
def Close(self): with self._lock: if self._llvm_symbolizer_subprocess: self._llvm_symbolizer_subprocess.kill() self._llvm_symbolizer_subprocess = None
[ "def", "Close", "(", "self", ")", ":", "with", "self", ".", "_lock", ":", "if", "self", ".", "_llvm_symbolizer_subprocess", ":", "self", ".", "_llvm_symbolizer_subprocess", ".", "kill", "(", ")", "self", ".", "_llvm_symbolizer_subprocess", "=", "None" ]
Close the llvm symbolizer subprocess.
[ "Close", "the", "llvm", "symbolizer", "subprocess", "." ]
[ "\"\"\"Close the llvm symbolizer subprocess.\n\n Close the subprocess by closing stdin, stdout and killing the subprocess.\n \"\"\"" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }