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
aa5cd8751490199401ea3755b6ac600cde56d4f0
sunlongbo/chromium
chrome/browser/resources/chromeos/accessibility/chromevox/tools/webstore_extension_util.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
GetUploadStatus
<not_specific>
def GetUploadStatus(client_secret): '''Gets the status of a previous upload. Args: client_secret ChromeVox's client secret creds. ''' return SendGetCommand(GetUploadStatusCommand(), client_secret)
Gets the status of a previous upload. Args: client_secret ChromeVox's client secret creds.
Gets the status of a previous upload.
[ "Gets", "the", "status", "of", "a", "previous", "upload", "." ]
def GetUploadStatus(client_secret): return SendGetCommand(GetUploadStatusCommand(), client_secret)
[ "def", "GetUploadStatus", "(", "client_secret", ")", ":", "return", "SendGetCommand", "(", "GetUploadStatusCommand", "(", ")", ",", "client_secret", ")" ]
Gets the status of a previous upload.
[ "Gets", "the", "status", "of", "a", "previous", "upload", "." ]
[ "'''Gets the status of a previous upload.\n Args:\n client_secret ChromeVox's client secret creds.\n '''" ]
[ { "param": "client_secret", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "client_secret", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
aa5cd8751490199401ea3755b6ac600cde56d4f0
sunlongbo/chromium
chrome/browser/resources/chromeos/accessibility/chromevox/tools/webstore_extension_util.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
PostUpload
null
def PostUpload(file, client_secret): '''Posts an uploaded version of ChromeVox. Args: file A string path to the ChromeVox extension zip. client_secret ChromeVox's client secret creds. ''' header = GetPopulatedHeader(client_secret) curl_command = ' '.join([ 'curl', '-H "Authorization: %(Aut...
Posts an uploaded version of ChromeVox. Args: file A string path to the ChromeVox extension zip. client_secret ChromeVox's client secret creds.
Posts an uploaded version of ChromeVox. Args: file A string path to the ChromeVox extension zip.
[ "Posts", "an", "uploaded", "version", "of", "ChromeVox", ".", "Args", ":", "file", "A", "string", "path", "to", "the", "ChromeVox", "extension", "zip", "." ]
def PostUpload(file, client_secret): header = GetPopulatedHeader(client_secret) curl_command = ' '.join([ 'curl', '-H "Authorization: %(Authorization)s"' % header, '-H "x-goog-api-version: 2"', '-X PUT', '-T %s' % file, '-v', 'https://%s%s' % (API_ENDPOINT_DOMAIN, GetUploadCommand()) ...
[ "def", "PostUpload", "(", "file", ",", "client_secret", ")", ":", "header", "=", "GetPopulatedHeader", "(", "client_secret", ")", "curl_command", "=", "' '", ".", "join", "(", "[", "'curl'", ",", "'-H \"Authorization: %(Authorization)s\"'", "%", "header", ",", "...
Posts an uploaded version of ChromeVox.
[ "Posts", "an", "uploaded", "version", "of", "ChromeVox", "." ]
[ "'''Posts an uploaded version of ChromeVox.\n Args:\n file A string path to the ChromeVox extension zip.\n client_secret ChromeVox's client secret creds.\n '''" ]
[ { "param": "file", "type": null }, { "param": "client_secret", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "file", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "client_secret", "type": null, "docstring": null, "docstring_t...
aa5cd8751490199401ea3755b6ac600cde56d4f0
sunlongbo/chromium
chrome/browser/resources/chromeos/accessibility/chromevox/tools/webstore_extension_util.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
PostPublishTrustedTesters
<not_specific>
def PostPublishTrustedTesters(client_secret): '''Publishes a previously uploaded ChromeVox extension to trusted testers. Args: client_secret ChromeVox's client secret creds. ''' return SendPostCommand(GetPublishCommand(), client_secret, {'publishTarget': 'trustedTesters'})
Publishes a previously uploaded ChromeVox extension to trusted testers. Args: client_secret ChromeVox's client secret creds.
Publishes a previously uploaded ChromeVox extension to trusted testers.
[ "Publishes", "a", "previously", "uploaded", "ChromeVox", "extension", "to", "trusted", "testers", "." ]
def PostPublishTrustedTesters(client_secret): return SendPostCommand(GetPublishCommand(), client_secret, {'publishTarget': 'trustedTesters'})
[ "def", "PostPublishTrustedTesters", "(", "client_secret", ")", ":", "return", "SendPostCommand", "(", "GetPublishCommand", "(", ")", ",", "client_secret", ",", "{", "'publishTarget'", ":", "'trustedTesters'", "}", ")" ]
Publishes a previously uploaded ChromeVox extension to trusted testers.
[ "Publishes", "a", "previously", "uploaded", "ChromeVox", "extension", "to", "trusted", "testers", "." ]
[ "'''Publishes a previously uploaded ChromeVox extension to trusted testers.\n Args:\n client_secret ChromeVox's client secret creds.\n '''" ]
[ { "param": "client_secret", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "client_secret", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
aa5cd8751490199401ea3755b6ac600cde56d4f0
sunlongbo/chromium
chrome/browser/resources/chromeos/accessibility/chromevox/tools/webstore_extension_util.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
PostPublish
<not_specific>
def PostPublish(client_secret): '''Publishes a previously uploaded ChromeVox extension publically. Args: client_secret ChromeVox's client secret creds. ''' return SendPostCommand(GetPublishCommand(), client_secret)
Publishes a previously uploaded ChromeVox extension publically. Args: client_secret ChromeVox's client secret creds.
Publishes a previously uploaded ChromeVox extension publically.
[ "Publishes", "a", "previously", "uploaded", "ChromeVox", "extension", "publically", "." ]
def PostPublish(client_secret): return SendPostCommand(GetPublishCommand(), client_secret)
[ "def", "PostPublish", "(", "client_secret", ")", ":", "return", "SendPostCommand", "(", "GetPublishCommand", "(", ")", ",", "client_secret", ")" ]
Publishes a previously uploaded ChromeVox extension publically.
[ "Publishes", "a", "previously", "uploaded", "ChromeVox", "extension", "publically", "." ]
[ "'''Publishes a previously uploaded ChromeVox extension publically.\n Args:\n client_secret ChromeVox's client secret creds.\n '''" ]
[ { "param": "client_secret", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "client_secret", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
faa7ed7862db474a9fc414ccb20d8ed858425900
sunlongbo/chromium
third_party/blink/tools/blinkpy/style/checkers/common.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
check
<not_specific>
def check(self, lines): """Check for and strip trailing carriage returns from lines.""" for line_number in range(len(lines)): if not lines[line_number].endswith('\r'): continue self._handle_style_error( line_number + 1, # Correct for offset. ...
Check for and strip trailing carriage returns from lines.
Check for and strip trailing carriage returns from lines.
[ "Check", "for", "and", "strip", "trailing", "carriage", "returns", "from", "lines", "." ]
def check(self, lines): for line_number in range(len(lines)): if not lines[line_number].endswith('\r'): continue self._handle_style_error( line_number + 1, 'whitespace/carriage_return', 1, 'One or more unex...
[ "def", "check", "(", "self", ",", "lines", ")", ":", "for", "line_number", "in", "range", "(", "len", "(", "lines", ")", ")", ":", "if", "not", "lines", "[", "line_number", "]", ".", "endswith", "(", "'\\r'", ")", ":", "continue", "self", ".", "_ha...
Check for and strip trailing carriage returns from lines.
[ "Check", "for", "and", "strip", "trailing", "carriage", "returns", "from", "lines", "." ]
[ "\"\"\"Check for and strip trailing carriage returns from lines.\"\"\"", "# Correct for offset." ]
[ { "param": "self", "type": null }, { "param": "lines", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "lines", "type": null, "docstring": null, "docstring_tokens": ...
fac48aa7c50918d57d044bafc384933bfaf09443
sunlongbo/chromium
tools/perf/core/cli_helpers.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
Colored
<not_specific>
def Colored(message, color): """Wraps the message into ASCII color escape codes. Args: message: Message to be wrapped. color: See COLOR_ANSI_CODE_MAP.keys() for available choices. """ # This only works on Linux and OS X. Windows users must install ANSICON or # use VT100 emulation on Windows 10. ass...
Wraps the message into ASCII color escape codes. Args: message: Message to be wrapped. color: See COLOR_ANSI_CODE_MAP.keys() for available choices.
Wraps the message into ASCII color escape codes.
[ "Wraps", "the", "message", "into", "ASCII", "color", "escape", "codes", "." ]
def Colored(message, color): assert color in COLOR_ANSI_CODE_MAP, 'Unsupported color' return '\033[%dm%s\033[0m' % (COLOR_ANSI_CODE_MAP[color], message)
[ "def", "Colored", "(", "message", ",", "color", ")", ":", "assert", "color", "in", "COLOR_ANSI_CODE_MAP", ",", "'Unsupported color'", "return", "'\\033[%dm%s\\033[0m'", "%", "(", "COLOR_ANSI_CODE_MAP", "[", "color", "]", ",", "message", ")" ]
Wraps the message into ASCII color escape codes.
[ "Wraps", "the", "message", "into", "ASCII", "color", "escape", "codes", "." ]
[ "\"\"\"Wraps the message into ASCII color escape codes.\n\n Args:\n message: Message to be wrapped.\n color: See COLOR_ANSI_CODE_MAP.keys() for available choices.\n \"\"\"", "# This only works on Linux and OS X. Windows users must install ANSICON or", "# use VT100 emulation on Windows 10." ]
[ { "param": "message", "type": null }, { "param": "color", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "message", "type": null, "docstring": "Message to be wrapped.", "docstring_tokens": [ "Message", "to", "be", "wrapped", "." ], "default": null, "is_optional": null }...
fac48aa7c50918d57d044bafc384933bfaf09443
sunlongbo/chromium
tools/perf/core/cli_helpers.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
Step
null
def Step(name): """Display a decorated message to the user. This is useful to separate major stages of the script. For simple messages, please use comment function above. """ boundary = max(80, len(name)) print(Colored('=' * boundary, 'green')) print(Colored(name, 'green')) print(Colored('=' * boundary...
Display a decorated message to the user. This is useful to separate major stages of the script. For simple messages, please use comment function above.
Display a decorated message to the user. This is useful to separate major stages of the script. For simple messages, please use comment function above.
[ "Display", "a", "decorated", "message", "to", "the", "user", ".", "This", "is", "useful", "to", "separate", "major", "stages", "of", "the", "script", ".", "For", "simple", "messages", "please", "use", "comment", "function", "above", "." ]
def Step(name): boundary = max(80, len(name)) print(Colored('=' * boundary, 'green')) print(Colored(name, 'green')) print(Colored('=' * boundary, 'green'))
[ "def", "Step", "(", "name", ")", ":", "boundary", "=", "max", "(", "80", ",", "len", "(", "name", ")", ")", "print", "(", "Colored", "(", "'='", "*", "boundary", ",", "'green'", ")", ")", "print", "(", "Colored", "(", "name", ",", "'green'", ")",...
Display a decorated message to the user.
[ "Display", "a", "decorated", "message", "to", "the", "user", "." ]
[ "\"\"\"Display a decorated message to the user.\n\n This is useful to separate major stages of the script. For simple messages,\n please use comment function above.\n \"\"\"" ]
[ { "param": "name", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "name", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
fac48aa7c50918d57d044bafc384933bfaf09443
sunlongbo/chromium
tools/perf/core/cli_helpers.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
Ask
<not_specific>
def Ask(question, answers=None, default=None): """Asks the user to answer a question with multiple choices. Users are able to press Return to access the default answer (if specified) and to type part of the full answer, e.g. "y", "ye" or "yes" are all valid answers for "yes". The func will ask user again in ca...
Asks the user to answer a question with multiple choices. Users are able to press Return to access the default answer (if specified) and to type part of the full answer, e.g. "y", "ye" or "yes" are all valid answers for "yes". The func will ask user again in case an invalid answer is provided. Raises ValueErr...
Asks the user to answer a question with multiple choices. Users are able to press Return to access the default answer (if specified) and to type part of the full answer, e.g. Raises ValueError if default is specified, but not listed an a valid answer.
[ "Asks", "the", "user", "to", "answer", "a", "question", "with", "multiple", "choices", ".", "Users", "are", "able", "to", "press", "Return", "to", "access", "the", "default", "answer", "(", "if", "specified", ")", "and", "to", "type", "part", "of", "the"...
def Ask(question, answers=None, default=None): if answers is None: answers = {'yes': True, 'no': False} default = 'yes' if isinstance(answers, list): ordered_answers = answers answers = {v: v for v in answers} else: ordered_answers = sorted(answers) inputs = {} common_prefixes = set() fo...
[ "def", "Ask", "(", "question", ",", "answers", "=", "None", ",", "default", "=", "None", ")", ":", "if", "answers", "is", "None", ":", "answers", "=", "{", "'yes'", ":", "True", ",", "'no'", ":", "False", "}", "default", "=", "'yes'", "if", "isinst...
Asks the user to answer a question with multiple choices.
[ "Asks", "the", "user", "to", "answer", "a", "question", "with", "multiple", "choices", "." ]
[ "\"\"\"Asks the user to answer a question with multiple choices.\n\n Users are able to press Return to access the default answer (if specified) and\n to type part of the full answer, e.g. \"y\", \"ye\" or \"yes\" are all valid answers\n for \"yes\". The func will ask user again in case an invalid answer is provi...
[ { "param": "question", "type": null }, { "param": "answers", "type": null }, { "param": "default", "type": null } ]
{ "returns": [ { "docstring": "Chosen option from answers. Full option name is returned even if user only\nenters part of it or chooses the default.", "docstring_tokens": [ "Chosen", "option", "from", "answers", ".", "Full", "option", "na...
fac48aa7c50918d57d044bafc384933bfaf09443
sunlongbo/chromium
tools/perf/core/cli_helpers.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
CheckLog
null
def CheckLog(command, log_path, env=None): """Executes a command and writes its stdout to a specified log file. On non-zero return value, also prints the content of the file to the screen and raises subprocess.CalledProcessError. Args: command: Command to be run as a list of arguments. log_path: Path ...
Executes a command and writes its stdout to a specified log file. On non-zero return value, also prints the content of the file to the screen and raises subprocess.CalledProcessError. Args: command: Command to be run as a list of arguments. log_path: Path to a file to which the output will be written. ...
Executes a command and writes its stdout to a specified log file. On non-zero return value, also prints the content of the file to the screen and raises subprocess.CalledProcessError.
[ "Executes", "a", "command", "and", "writes", "its", "stdout", "to", "a", "specified", "log", "file", ".", "On", "non", "-", "zero", "return", "value", "also", "prints", "the", "content", "of", "the", "file", "to", "the", "screen", "and", "raises", "subpr...
def CheckLog(command, log_path, env=None): with open(log_path, 'w') as f: try: cmd_str = (' '.join(pipes.quote(c) for c in command) if isinstance(command, list) else command) print(Colored(cmd_str, 'blue')) print(Colored('Logging stdout & stderr to %s' % log_path, 'blue')) ...
[ "def", "CheckLog", "(", "command", ",", "log_path", ",", "env", "=", "None", ")", ":", "with", "open", "(", "log_path", ",", "'w'", ")", "as", "f", ":", "try", ":", "cmd_str", "=", "(", "' '", ".", "join", "(", "pipes", ".", "quote", "(", "c", ...
Executes a command and writes its stdout to a specified log file.
[ "Executes", "a", "command", "and", "writes", "its", "stdout", "to", "a", "specified", "log", "file", "." ]
[ "\"\"\"Executes a command and writes its stdout to a specified log file.\n\n On non-zero return value, also prints the content of the file to the screen\n and raises subprocess.CalledProcessError.\n\n Args:\n command: Command to be run as a list of arguments.\n log_path: Path to a file to which the output ...
[ { "param": "command", "type": null }, { "param": "log_path", "type": null }, { "param": "env", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "command", "type": null, "docstring": "Command to be run as a list of arguments.", "docstring_tokens": [ "Command", "to", "be", "run", "as", "a", "list", "of", ...
fac48aa7c50918d57d044bafc384933bfaf09443
sunlongbo/chromium
tools/perf/core/cli_helpers.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
Run
<not_specific>
def Run(command, ok_fail=False, **kwargs): """Prints and runs the command. Allows to ignore non-zero exit code.""" if not isinstance(command, list): raise ValueError('command must be a list') print(Colored(' '.join(pipes.quote(c) for c in command), 'blue')) try: return subprocess.check_call(command, **k...
Prints and runs the command. Allows to ignore non-zero exit code.
Prints and runs the command. Allows to ignore non-zero exit code.
[ "Prints", "and", "runs", "the", "command", ".", "Allows", "to", "ignore", "non", "-", "zero", "exit", "code", "." ]
def Run(command, ok_fail=False, **kwargs): if not isinstance(command, list): raise ValueError('command must be a list') print(Colored(' '.join(pipes.quote(c) for c in command), 'blue')) try: return subprocess.check_call(command, **kwargs) except subprocess.CalledProcessError as cpe: if not ok_fail: ...
[ "def", "Run", "(", "command", ",", "ok_fail", "=", "False", ",", "**", "kwargs", ")", ":", "if", "not", "isinstance", "(", "command", ",", "list", ")", ":", "raise", "ValueError", "(", "'command must be a list'", ")", "print", "(", "Colored", "(", "' '",...
Prints and runs the command.
[ "Prints", "and", "runs", "the", "command", "." ]
[ "\"\"\"Prints and runs the command. Allows to ignore non-zero exit code.\"\"\"" ]
[ { "param": "command", "type": null }, { "param": "ok_fail", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "command", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "ok_fail", "type": null, "docstring": null, "docstring_toke...
facbba1e1fe3ca85b91e6f89e4b216a7374db994
sunlongbo/chromium
chrome/test/chromedriver/test/run_java_tests.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
_Run
null
def _Run(java_tests_src_dir, test_filter, ready_to_run_tests, chromedriver_path, chrome_path, log_path, android_package_key, debug, tests_report_file): """Run the WebDriver Java tests and return the test results. Args: java_tests_src_dir: the java test source code directory. test_filter: ...
Run the WebDriver Java tests and return the test results. Args: java_tests_src_dir: the java test source code directory. test_filter: the filter to use when choosing tests to run. Format is same as Google C++ Test format. readyToRunTests: tests that need to run regardless of @NotYetImplem...
Run the WebDriver Java tests and return the test results.
[ "Run", "the", "WebDriver", "Java", "tests", "and", "return", "the", "test", "results", "." ]
def _Run(java_tests_src_dir, test_filter, ready_to_run_tests, chromedriver_path, chrome_path, log_path, android_package_key, debug, tests_report_file): sys_props = ['selenium.browser=chrome', 'webdriver.chrome.driver=' + os.path.abspath(chromedriver_path)] if chrome_path: if uti...
[ "def", "_Run", "(", "java_tests_src_dir", ",", "test_filter", ",", "ready_to_run_tests", ",", "chromedriver_path", ",", "chrome_path", ",", "log_path", ",", "android_package_key", ",", "debug", ",", "tests_report_file", ")", ":", "sys_props", "=", "[", "'selenium.br...
Run the WebDriver Java tests and return the test results.
[ "Run", "the", "WebDriver", "Java", "tests", "and", "return", "the", "test", "results", "." ]
[ "\"\"\"Run the WebDriver Java tests and return the test results.\n\n Args:\n java_tests_src_dir: the java test source code directory.\n test_filter: the filter to use when choosing tests to run. Format is same\n as Google C++ Test format.\n readyToRunTests: tests that need to run regardless of\n ...
[ { "param": "java_tests_src_dir", "type": null }, { "param": "test_filter", "type": null }, { "param": "ready_to_run_tests", "type": null }, { "param": "chromedriver_path", "type": null }, { "param": "chrome_path", "type": null }, { "param": "log_path",...
{ "returns": [], "raises": [], "params": [ { "identifier": "java_tests_src_dir", "type": null, "docstring": "the java test source code directory.", "docstring_tokens": [ "the", "java", "test", "source", "code", "directory", "." ...
facbba1e1fe3ca85b91e6f89e4b216a7374db994
sunlongbo/chromium
chrome/test/chromedriver/test/run_java_tests.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
_RunTest
null
def _RunTest(java_tests_src_dir, jvm_args, sys_props, tests_report_file): """Runs a single JUnit test suite. Args: java_tests_src_dir: the directory to run the tests in. sys_props: Java system properties to set when running the tests. jvm_args: Java VM command line args to use. """ classpath = [] ...
Runs a single JUnit test suite. Args: java_tests_src_dir: the directory to run the tests in. sys_props: Java system properties to set when running the tests. jvm_args: Java VM command line args to use.
Runs a single JUnit test suite.
[ "Runs", "a", "single", "JUnit", "test", "suite", "." ]
def _RunTest(java_tests_src_dir, jvm_args, sys_props, tests_report_file): classpath = [] for name in glob.glob(java_tests_src_dir + "/jar/*.jar"): classpath.append(name) if util.IsWindows(): separator = ';' else: separator = ':' code = util.RunCommand( ['java'] + ...
[ "def", "_RunTest", "(", "java_tests_src_dir", ",", "jvm_args", ",", "sys_props", ",", "tests_report_file", ")", ":", "classpath", "=", "[", "]", "for", "name", "in", "glob", ".", "glob", "(", "java_tests_src_dir", "+", "\"/jar/*.jar\"", ")", ":", "classpath", ...
Runs a single JUnit test suite.
[ "Runs", "a", "single", "JUnit", "test", "suite", "." ]
[ "\"\"\"Runs a single JUnit test suite.\n\n Args:\n java_tests_src_dir: the directory to run the tests in.\n sys_props: Java system properties to set when running the tests.\n jvm_args: Java VM command line args to use.\n \"\"\"" ]
[ { "param": "java_tests_src_dir", "type": null }, { "param": "jvm_args", "type": null }, { "param": "sys_props", "type": null }, { "param": "tests_report_file", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "java_tests_src_dir", "type": null, "docstring": "the directory to run the tests in.", "docstring_tokens": [ "the", "directory", "to", "run", "the", "tests", "in", ...
facbba1e1fe3ca85b91e6f89e4b216a7374db994
sunlongbo/chromium
chrome/test/chromedriver/test/run_java_tests.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
_PrintTestResults
<not_specific>
def _PrintTestResults(results_path): """Prints the given results in a format recognized by the buildbot.""" with open(results_path, "r") as myfile: contents = myfile.read() successJunitTestsCount = re.search(r'OK \((\d* tests)', contents) if successJunitTestsCount: testsCount = re.findall(r'INFO: <<< ...
Prints the given results in a format recognized by the buildbot.
Prints the given results in a format recognized by the buildbot.
[ "Prints", "the", "given", "results", "in", "a", "format", "recognized", "by", "the", "buildbot", "." ]
def _PrintTestResults(results_path): with open(results_path, "r") as myfile: contents = myfile.read() successJunitTestsCount = re.search(r'OK \((\d* tests)', contents) if successJunitTestsCount: testsCount = re.findall(r'INFO: <<< Finished (.*)\)', contents) print("Ran %s tests " % len(testsCount)) ...
[ "def", "_PrintTestResults", "(", "results_path", ")", ":", "with", "open", "(", "results_path", ",", "\"r\"", ")", "as", "myfile", ":", "contents", "=", "myfile", ".", "read", "(", ")", "successJunitTestsCount", "=", "re", ".", "search", "(", "r'OK \\((\\d* ...
Prints the given results in a format recognized by the buildbot.
[ "Prints", "the", "given", "results", "in", "a", "format", "recognized", "by", "the", "buildbot", "." ]
[ "\"\"\"Prints the given results in a format recognized by the buildbot.\"\"\"" ]
[ { "param": "results_path", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "results_path", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
d76876b514371bd1659ea7877802d6d409714acf
sunlongbo/chromium
tools/site_compare/commands/maskmaker.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
CreateCommand
null
def CreateCommand(cmdline): """Inserts the command and arguments into a command line for parsing.""" cmd = cmdline.AddCommand( ["maskmaker"], "Automatically generates a mask from a list of URLs", ValidateMaskmaker, ExecuteMaskmaker) cmd.AddArgument( ["-bp", "--browserpath"], "Full path to bro...
Inserts the command and arguments into a command line for parsing.
Inserts the command and arguments into a command line for parsing.
[ "Inserts", "the", "command", "and", "arguments", "into", "a", "command", "line", "for", "parsing", "." ]
def CreateCommand(cmdline): cmd = cmdline.AddCommand( ["maskmaker"], "Automatically generates a mask from a list of URLs", ValidateMaskmaker, ExecuteMaskmaker) cmd.AddArgument( ["-bp", "--browserpath"], "Full path to browser's executable", type="readfile", metaname="PATH") cmd.AddArgument(...
[ "def", "CreateCommand", "(", "cmdline", ")", ":", "cmd", "=", "cmdline", ".", "AddCommand", "(", "[", "\"maskmaker\"", "]", ",", "\"Automatically generates a mask from a list of URLs\"", ",", "ValidateMaskmaker", ",", "ExecuteMaskmaker", ")", "cmd", ".", "AddArgument"...
Inserts the command and arguments into a command line for parsing.
[ "Inserts", "the", "command", "and", "arguments", "into", "a", "command", "line", "for", "parsing", "." ]
[ "\"\"\"Inserts the command and arguments into a command line for parsing.\"\"\"" ]
[ { "param": "cmdline", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "cmdline", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
d76876b514371bd1659ea7877802d6d409714acf
sunlongbo/chromium
tools/site_compare/commands/maskmaker.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
ValidateMaskmaker
null
def ValidateMaskmaker(command): """Validate the arguments to maskmaker. Raises ParseError if failed.""" executables = [".exe", ".com", ".bat"] if command["--browserpath"]: if os.path.splitext(command["--browserpath"])[1].lower() not in executables: raise command_line.ParseError("Browser filename must be...
Validate the arguments to maskmaker. Raises ParseError if failed.
Validate the arguments to maskmaker. Raises ParseError if failed.
[ "Validate", "the", "arguments", "to", "maskmaker", ".", "Raises", "ParseError", "if", "failed", "." ]
def ValidateMaskmaker(command): executables = [".exe", ".com", ".bat"] if command["--browserpath"]: if os.path.splitext(command["--browserpath"])[1].lower() not in executables: raise command_line.ParseError("Browser filename must be an executable")
[ "def", "ValidateMaskmaker", "(", "command", ")", ":", "executables", "=", "[", "\".exe\"", ",", "\".com\"", ",", "\".bat\"", "]", "if", "command", "[", "\"--browserpath\"", "]", ":", "if", "os", ".", "path", ".", "splitext", "(", "command", "[", "\"--brows...
Validate the arguments to maskmaker.
[ "Validate", "the", "arguments", "to", "maskmaker", "." ]
[ "\"\"\"Validate the arguments to maskmaker. Raises ParseError if failed.\"\"\"" ]
[ { "param": "command", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "command", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
4e68488d7f4bed31176a11b1f4b5232e7e3434f8
sunlongbo/chromium
tools/cr/cr/base/host.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
_Execute
<not_specific>
def _Execute(self, command, shell=False, capture=False, silent=False, ignore_dry_run=False, return_status=False, ignore_interrupt_signal=False): """This is the only method that launches external programs. It is a thin wrapper around subprocess.Popen that handles cr ...
This is the only method that launches external programs. It is a thin wrapper around subprocess.Popen that handles cr specific issues. The command is expanded in the active context so that variables are substituted. Args: command: the command to run. shell: whether to run the command using ...
This is the only method that launches external programs. It is a thin wrapper around subprocess.Popen that handles cr specific issues. The command is expanded in the active context so that variables are substituted.
[ "This", "is", "the", "only", "method", "that", "launches", "external", "programs", ".", "It", "is", "a", "thin", "wrapper", "around", "subprocess", ".", "Popen", "that", "handles", "cr", "specific", "issues", ".", "The", "command", "is", "expanded", "in", ...
def _Execute(self, command, shell=False, capture=False, silent=False, ignore_dry_run=False, return_status=False, ignore_interrupt_signal=False): with cr.context.Trace(): command = [cr.context.Substitute(arg) for arg in command if arg] command = filter(bool, c...
[ "def", "_Execute", "(", "self", ",", "command", ",", "shell", "=", "False", ",", "capture", "=", "False", ",", "silent", "=", "False", ",", "ignore_dry_run", "=", "False", ",", "return_status", "=", "False", ",", "ignore_interrupt_signal", "=", "False", ")...
This is the only method that launches external programs.
[ "This", "is", "the", "only", "method", "that", "launches", "external", "programs", "." ]
[ "\"\"\"This is the only method that launches external programs.\n\n It is a thin wrapper around subprocess.Popen that handles cr specific\n issues. The command is expanded in the active context so that variables\n are substituted.\n Args:\n command: the command to run.\n shell: whether to run ...
[ { "param": "self", "type": null }, { "param": "command", "type": null }, { "param": "shell", "type": null }, { "param": "capture", "type": null }, { "param": "silent", "type": null }, { "param": "ignore_dry_run", "type": null }, { "param": ...
{ "returns": [ { "docstring": "the status if return_status is true, or the output if capture is true,\notherwise nothing.", "docstring_tokens": [ "the", "status", "if", "return_status", "is", "true", "or", "the", "output", ...
4e68488d7f4bed31176a11b1f4b5232e7e3434f8
sunlongbo/chromium
tools/cr/cr/base/host.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
SearchPath
<not_specific>
def SearchPath(cls, name, paths=[]): """Searches the PATH for an executable. Args: name: the name of the binary to search for. Returns: the set of executables found, or an empty list if none. """ result = [] extensions = [''] extensions.extend(os.environ.get('PATHEXT', '').split...
Searches the PATH for an executable. Args: name: the name of the binary to search for. Returns: the set of executables found, or an empty list if none.
Searches the PATH for an executable.
[ "Searches", "the", "PATH", "for", "an", "executable", "." ]
def SearchPath(cls, name, paths=[]): result = [] extensions = [''] extensions.extend(os.environ.get('PATHEXT', '').split(os.pathsep)) paths = [cr.context.Substitute(path) for path in paths if path] paths = paths + os.environ.get('PATH', '').split(os.pathsep) for path in paths: partial = os...
[ "def", "SearchPath", "(", "cls", ",", "name", ",", "paths", "=", "[", "]", ")", ":", "result", "=", "[", "]", "extensions", "=", "[", "''", "]", "extensions", ".", "extend", "(", "os", ".", "environ", ".", "get", "(", "'PATHEXT'", ",", "''", ")",...
Searches the PATH for an executable.
[ "Searches", "the", "PATH", "for", "an", "executable", "." ]
[ "\"\"\"Searches the PATH for an executable.\n\n Args:\n name: the name of the binary to search for.\n Returns:\n the set of executables found, or an empty list if none.\n \"\"\"" ]
[ { "param": "cls", "type": null }, { "param": "name", "type": null }, { "param": "paths", "type": null } ]
{ "returns": [ { "docstring": "the set of executables found, or an empty list if none.", "docstring_tokens": [ "the", "set", "of", "executables", "found", "or", "an", "empty", "list", "if", "none", "." ...
4e6eeadc0ad39c45b3a63c9ee55f23289ca89604
sunlongbo/chromium
tools/android/find_annotated_tests.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
_GetBugId
<not_specific>
def _GetBugId(test_annotations): """Find and return the test bug id from its annoation message elements""" # TODO(yolandyan): currently the script only supports on bug id per method, # add support for multiple bug id for content in test_annotations.items(): if content and content.get('message'): searc...
Find and return the test bug id from its annoation message elements
Find and return the test bug id from its annoation message elements
[ "Find", "and", "return", "the", "test", "bug", "id", "from", "its", "annoation", "message", "elements" ]
def _GetBugId(test_annotations): for content in test_annotations.items(): if content and content.get('message'): search_result = re.search(_CRBUG_ID_PATTERN, content.get('message')) if search_result is not None: return int(search_result.group(1)) return None
[ "def", "_GetBugId", "(", "test_annotations", ")", ":", "for", "content", "in", "test_annotations", ".", "items", "(", ")", ":", "if", "content", "and", "content", ".", "get", "(", "'message'", ")", ":", "search_result", "=", "re", ".", "search", "(", "_C...
Find and return the test bug id from its annoation message elements
[ "Find", "and", "return", "the", "test", "bug", "id", "from", "its", "annoation", "message", "elements" ]
[ "\"\"\"Find and return the test bug id from its annoation message elements\"\"\"", "# TODO(yolandyan): currently the script only supports on bug id per method,", "# add support for multiple bug id" ]
[ { "param": "test_annotations", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "test_annotations", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
4e6eeadc0ad39c45b3a63c9ee55f23289ca89604
sunlongbo/chromium
tools/android/find_annotated_tests.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
_GetTests
<not_specific>
def _GetTests(test_apks, apk_output_dir): """Return a list of all annotated tests and total test count""" result = [] total_test_count = 0 for test_apk in test_apks: logging.info('Current test apk: %s', test_apk) test_jar = os.path.join( apk_output_dir, constants.SDK_BUILD_TEST_JAVALIB_DIR, ...
Return a list of all annotated tests and total test count
Return a list of all annotated tests and total test count
[ "Return", "a", "list", "of", "all", "annotated", "tests", "and", "total", "test", "count" ]
def _GetTests(test_apks, apk_output_dir): result = [] total_test_count = 0 for test_apk in test_apks: logging.info('Current test apk: %s', test_apk) test_jar = os.path.join( apk_output_dir, constants.SDK_BUILD_TEST_JAVALIB_DIR, '%s.jar' % test_apk) all_tests = instrumentation_test_inst...
[ "def", "_GetTests", "(", "test_apks", ",", "apk_output_dir", ")", ":", "result", "=", "[", "]", "total_test_count", "=", "0", "for", "test_apk", "in", "test_apks", ":", "logging", ".", "info", "(", "'Current test apk: %s'", ",", "test_apk", ")", "test_jar", ...
Return a list of all annotated tests and total test count
[ "Return", "a", "list", "of", "all", "annotated", "tests", "and", "total", "test", "count" ]
[ "\"\"\"Return a list of all annotated tests and total test count\"\"\"", "# getting annotation of each test case", "# getting test method name of each test" ]
[ { "param": "test_apks", "type": null }, { "param": "apk_output_dir", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "test_apks", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "apk_output_dir", "type": null, "docstring": null, "docst...
4e6eeadc0ad39c45b3a63c9ee55f23289ca89604
sunlongbo/chromium
tools/android/find_annotated_tests.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
_GetReportMeta
<not_specific>
def _GetReportMeta(utc_script_runtime_string, total_test_count): """Returns a dictionary of the report's metadata""" revision = cmd_helper.GetCmdOutput(['git', 'rev-parse', 'HEAD']).strip() raw_string = cmd_helper.GetCmdOutput( ['git', 'log', '--pretty=format:%at', '--max-count=1', 'HEAD']) time_string_se...
Returns a dictionary of the report's metadata
Returns a dictionary of the report's metadata
[ "Returns", "a", "dictionary", "of", "the", "report", "'", "s", "metadata" ]
def _GetReportMeta(utc_script_runtime_string, total_test_count): revision = cmd_helper.GetCmdOutput(['git', 'rev-parse', 'HEAD']).strip() raw_string = cmd_helper.GetCmdOutput( ['git', 'log', '--pretty=format:%at', '--max-count=1', 'HEAD']) time_string_search = re.search(_GIT_LOG_TIME_PATTERN, raw_string) ...
[ "def", "_GetReportMeta", "(", "utc_script_runtime_string", ",", "total_test_count", ")", ":", "revision", "=", "cmd_helper", ".", "GetCmdOutput", "(", "[", "'git'", ",", "'rev-parse'", ",", "'HEAD'", "]", ")", ".", "strip", "(", ")", "raw_string", "=", "cmd_he...
Returns a dictionary of the report's metadata
[ "Returns", "a", "dictionary", "of", "the", "report", "'", "s", "metadata" ]
[ "\"\"\"Returns a dictionary of the report's metadata\"\"\"" ]
[ { "param": "utc_script_runtime_string", "type": null }, { "param": "total_test_count", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "utc_script_runtime_string", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "total_test_count", "type": null, "docstring": ...
4e6eeadc0ad39c45b3a63c9ee55f23289ca89604
sunlongbo/chromium
tools/android/find_annotated_tests.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
_GetReport
<not_specific>
def _GetReport(test_apks, script_runtime_string, apk_output_dir): """Generate the dictionary of report data Args: test_apks: a list of apks for search for tests script_runtime_string: the time when the script is run at format: '%Y%m%dT%H%M%S' """ test_data, total_test_count ...
Generate the dictionary of report data Args: test_apks: a list of apks for search for tests script_runtime_string: the time when the script is run at format: '%Y%m%dT%H%M%S'
Generate the dictionary of report data
[ "Generate", "the", "dictionary", "of", "report", "data" ]
def _GetReport(test_apks, script_runtime_string, apk_output_dir): test_data, total_test_count = _GetTests(test_apks, apk_output_dir) report_meta = _GetReportMeta(script_runtime_string, total_test_count) report_data = { 'metadata': report_meta, 'tests': test_data } return report_data
[ "def", "_GetReport", "(", "test_apks", ",", "script_runtime_string", ",", "apk_output_dir", ")", ":", "test_data", ",", "total_test_count", "=", "_GetTests", "(", "test_apks", ",", "apk_output_dir", ")", "report_meta", "=", "_GetReportMeta", "(", "script_runtime_strin...
Generate the dictionary of report data
[ "Generate", "the", "dictionary", "of", "report", "data" ]
[ "\"\"\"Generate the dictionary of report data\n\n Args:\n test_apks: a list of apks for search for tests\n script_runtime_string: the time when the script is run at\n format: '%Y%m%dT%H%M%S'\n \"\"\"" ]
[ { "param": "test_apks", "type": null }, { "param": "script_runtime_string", "type": null }, { "param": "apk_output_dir", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "test_apks", "type": null, "docstring": "a list of apks for search for tests", "docstring_tokens": [ "a", "list", "of", "apks", "for", "search", "for", "tests" ...
4e711c42b5ef1a1b1e3a5ca25948d08007e47853
sunlongbo/chromium
third_party/blink/tools/blinkpy/style/optparser_unittest.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
_create_parser
<not_specific>
def _create_parser(self): """Return an ArgumentParser instance for testing.""" default_options = self._create_defaults() all_categories = ['build', 'whitespace'] mock_stderr = self._MockStdErr() return ArgumentParser( all_categories=all_categories, base...
Return an ArgumentParser instance for testing.
Return an ArgumentParser instance for testing.
[ "Return", "an", "ArgumentParser", "instance", "for", "testing", "." ]
def _create_parser(self): default_options = self._create_defaults() all_categories = ['build', 'whitespace'] mock_stderr = self._MockStdErr() return ArgumentParser( all_categories=all_categories, base_filter_rules=[], default_options=default_options, ...
[ "def", "_create_parser", "(", "self", ")", ":", "default_options", "=", "self", ".", "_create_defaults", "(", ")", "all_categories", "=", "[", "'build'", ",", "'whitespace'", "]", "mock_stderr", "=", "self", ".", "_MockStdErr", "(", ")", "return", "ArgumentPar...
Return an ArgumentParser instance for testing.
[ "Return", "an", "ArgumentParser", "instance", "for", "testing", "." ]
[ "\"\"\"Return an ArgumentParser instance for testing.\"\"\"" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
4e717d62986692a05f0a16e495343940ed022883
sunlongbo/chromium
chrome/test/mini_installer/run_mini_installer_tests.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
_prepare_env_for_subprocesses
null
def _prepare_env_for_subprocesses(parser, args): """Populates environment variables with values given to this process on its command line. typ runs tests in child processes. It does not pass args defined by this test suite, so here we stuff the args the suite cares about into the environment so...
Populates environment variables with values given to this process on its command line. typ runs tests in child processes. It does not pass args defined by this test suite, so here we stuff the args the suite cares about into the environment so they can be pulled out by test modules that need them. ...
Populates environment variables with values given to this process on its command line. typ runs tests in child processes. It does not pass args defined by this test suite, so here we stuff the args the suite cares about into the environment so they can be pulled out by test modules that need them.
[ "Populates", "environment", "variables", "with", "values", "given", "to", "this", "process", "on", "its", "command", "line", ".", "typ", "runs", "tests", "in", "child", "processes", ".", "It", "does", "not", "pass", "args", "defined", "by", "this", "test", ...
def _prepare_env_for_subprocesses(parser, args): if args.force_clean: os.environ['CMI_FORCE_CLEAN'] = '1' if args.output_dir != parser.get_default('output_dir'): os.environ['CMI_OUTPUT_DIR'] = args.output_dir if args.installer_path != parser.get_default('installer_path'): os.environ[...
[ "def", "_prepare_env_for_subprocesses", "(", "parser", ",", "args", ")", ":", "if", "args", ".", "force_clean", ":", "os", ".", "environ", "[", "'CMI_FORCE_CLEAN'", "]", "=", "'1'", "if", "args", ".", "output_dir", "!=", "parser", ".", "get_default", "(", ...
Populates environment variables with values given to this process on its command line.
[ "Populates", "environment", "variables", "with", "values", "given", "to", "this", "process", "on", "its", "command", "line", "." ]
[ "\"\"\"Populates environment variables with values given to this process on its\n command line.\n\n typ runs tests in child processes. It does not pass args defined by this\n test suite, so here we stuff the args the suite cares about into the\n environment so they can be pulled out by test modules ...
[ { "param": "parser", "type": null }, { "param": "args", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "parser", "type": null, "docstring": "The ArgumentParser used for this process.", "docstring_tokens": [ "The", "ArgumentParser", "used", "for", "this", "process", "." ...
dd1e6a886ff05edfe373a645dac1b70113cc2dae
sunlongbo/chromium
content/test/gpu/gpu_tests/ipg_utils.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
_ScrapeDataFromIPGLogFiles
<not_specific>
def _ScrapeDataFromIPGLogFiles(): """Scrapes data from IPG log files. Returns: A tuple (per_core_results, metrics). |output| is a dictionary containing per-core results extracted from the IPG log files. |metrics| is a dictionary mapping metrics found in the logs to all found data points. ...
Scrapes data from IPG log files. Returns: A tuple (per_core_results, metrics). |output| is a dictionary containing per-core results extracted from the IPG log files. |metrics| is a dictionary mapping metrics found in the logs to all found data points.
Scrapes data from IPG log files.
[ "Scrapes", "data", "from", "IPG", "log", "files", "." ]
def _ScrapeDataFromIPGLogFiles(): per_core_results = {} metrics = {} for logfile in logfiles: results = AnalyzeIPGLogFile(logfile, skip_in_seconds) results['log'] = logfile (_, filename) = os.path.split(logfile) (core, _) = os.path.splitext(filename) prefix = 'PowerLog_' ...
[ "def", "_ScrapeDataFromIPGLogFiles", "(", ")", ":", "per_core_results", "=", "{", "}", "metrics", "=", "{", "}", "for", "logfile", "in", "logfiles", ":", "results", "=", "AnalyzeIPGLogFile", "(", "logfile", ",", "skip_in_seconds", ")", "results", "[", "'log'",...
Scrapes data from IPG log files.
[ "Scrapes", "data", "from", "IPG", "log", "files", "." ]
[ "\"\"\"Scrapes data from IPG log files.\n\n Returns:\n A tuple (per_core_results, metrics). |output| is a dictionary containing\n per-core results extracted from the IPG log files. |metrics| is a\n dictionary mapping metrics found in the logs to all found data points.\n \"\"\"" ]
[]
{ "returns": [ { "docstring": "A tuple (per_core_results, metrics). |output| is a dictionary containing\nper-core results extracted from the IPG log files. |metrics| is a\ndictionary mapping metrics found in the logs to all found data points.", "docstring_tokens": [ "A", "tuple", ...
dd1e6a886ff05edfe373a645dac1b70113cc2dae
sunlongbo/chromium
content/test/gpu/gpu_tests/ipg_utils.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
_CalculateSummaryStatistics
<not_specific>
def _CalculateSummaryStatistics(metrics): """Calculates summary statistics for the given metrics. Args: metrics: A dictionary mapping metrics to lists of data points. Returns: A dictionary mapping the same metrics in |metrics| to dicts containing the 'mean' and 'stdev' for the metric. ...
Calculates summary statistics for the given metrics. Args: metrics: A dictionary mapping metrics to lists of data points. Returns: A dictionary mapping the same metrics in |metrics| to dicts containing the 'mean' and 'stdev' for the metric.
Calculates summary statistics for the given metrics.
[ "Calculates", "summary", "statistics", "for", "the", "given", "metrics", "." ]
def _CalculateSummaryStatistics(metrics): summary = {} for key, data in metrics.items(): assert data and len(data) > 1 n = len(data) if outliers > 0: assert outliers * 2 < n data.sort() data = data[outliers:(n - outliers)] n = len(data) logging.debug('%s: ...
[ "def", "_CalculateSummaryStatistics", "(", "metrics", ")", ":", "summary", "=", "{", "}", "for", "key", ",", "data", "in", "metrics", ".", "items", "(", ")", ":", "assert", "data", "and", "len", "(", "data", ")", ">", "1", "n", "=", "len", "(", "da...
Calculates summary statistics for the given metrics.
[ "Calculates", "summary", "statistics", "for", "the", "given", "metrics", "." ]
[ "\"\"\"Calculates summary statistics for the given metrics.\n\n Args:\n metrics: A dictionary mapping metrics to lists of data points.\n\n Returns:\n A dictionary mapping the same metrics in |metrics| to dicts containing\n the 'mean' and 'stdev' for the metric.\n \"\"\"" ]
[ { "param": "metrics", "type": null } ]
{ "returns": [ { "docstring": "A dictionary mapping the same metrics in |metrics| to dicts containing\nthe 'mean' and 'stdev' for the metric.", "docstring_tokens": [ "A", "dictionary", "mapping", "the", "same", "metrics", "in", "|metrics|...
6258f268eae42146416a35768dd73a40e735fd98
sunlongbo/chromium
chrome/test/mini_installer/argument_parser.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
ArgumentParser
<not_specific>
def ArgumentParser(host=None): """Returns an argparse.ArgumentParser for the mini_installer test suite. Args: host: A typ.Host to pass to typ's argument parser. Returns: A filled out ArgumentParser instance. """ parser = typ.ArgumentParser(host) group = parser.add_argument_grou...
Returns an argparse.ArgumentParser for the mini_installer test suite. Args: host: A typ.Host to pass to typ's argument parser. Returns: A filled out ArgumentParser instance.
Returns an argparse.ArgumentParser for the mini_installer test suite.
[ "Returns", "an", "argparse", ".", "ArgumentParser", "for", "the", "mini_installer", "test", "suite", "." ]
def ArgumentParser(host=None): parser = typ.ArgumentParser(host) group = parser.add_argument_group(title='run_mini_installer_tests') group.add_argument('--force-clean', action='store_true', default=False, help='Force cleaning existing inst...
[ "def", "ArgumentParser", "(", "host", "=", "None", ")", ":", "parser", "=", "typ", ".", "ArgumentParser", "(", "host", ")", "group", "=", "parser", ".", "add_argument_group", "(", "title", "=", "'run_mini_installer_tests'", ")", "group", ".", "add_argument", ...
Returns an argparse.ArgumentParser for the mini_installer test suite.
[ "Returns", "an", "argparse", ".", "ArgumentParser", "for", "the", "mini_installer", "test", "suite", "." ]
[ "\"\"\"Returns an argparse.ArgumentParser for the mini_installer test suite.\n\n Args:\n host: A typ.Host to pass to typ's argument parser.\n\n Returns:\n A filled out ArgumentParser instance.\n \"\"\"" ]
[ { "param": "host", "type": null } ]
{ "returns": [ { "docstring": "A filled out ArgumentParser instance.", "docstring_tokens": [ "A", "filled", "out", "ArgumentParser", "instance", "." ], "type": null } ], "raises": [], "params": [ { "identifier": "host", ...
8069707420460cfbd16a6569e83dd846bc21ba58
sunlongbo/chromium
build/android/list_class_verification_failures_test.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
_CreateOdexLine
<not_specific>
def _CreateOdexLine(java_class_name, type_idx, verification_status): """Create a rough approximation of a line of oatdump output.""" return ('{type_idx}: L{java_class}; (offset=0xac) (type_idx={type_idx}) ' '({verification}) ' '(OatClassNoneCompiled)'.format(type_idx=type_idx, ...
Create a rough approximation of a line of oatdump output.
Create a rough approximation of a line of oatdump output.
[ "Create", "a", "rough", "approximation", "of", "a", "line", "of", "oatdump", "output", "." ]
def _CreateOdexLine(java_class_name, type_idx, verification_status): return ('{type_idx}: L{java_class}; (offset=0xac) (type_idx={type_idx}) ' '({verification}) ' '(OatClassNoneCompiled)'.format(type_idx=type_idx, java_class=java_class_name, ...
[ "def", "_CreateOdexLine", "(", "java_class_name", ",", "type_idx", ",", "verification_status", ")", ":", "return", "(", "'{type_idx}: L{java_class}; (offset=0xac) (type_idx={type_idx}) '", "'({verification}) '", "'(OatClassNoneCompiled)'", ".", "format", "(", "type_idx", "=", ...
Create a rough approximation of a line of oatdump output.
[ "Create", "a", "rough", "approximation", "of", "a", "line", "of", "oatdump", "output", "." ]
[ "\"\"\"Create a rough approximation of a line of oatdump output.\"\"\"" ]
[ { "param": "java_class_name", "type": null }, { "param": "type_idx", "type": null }, { "param": "verification_status", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "java_class_name", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "type_idx", "type": null, "docstring": null, "docst...
fdfc52745a9c0cc4ee25d426f8643a2c0aaa3925
sunlongbo/chromium
tools/android/remove_strings.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
RemoveStrings
null
def RemoveStrings(grd_path, string_names): """Removes strings with the given names from a GRD file. Overwrites the file. Args: grd_path: path to the GRD file. string_names: a list of string names to be removed. """ with open(grd_path, 'r') as f: grd = f.read() names_pattern = '|'.join(map(re.esca...
Removes strings with the given names from a GRD file. Overwrites the file. Args: grd_path: path to the GRD file. string_names: a list of string names to be removed.
Removes strings with the given names from a GRD file. Overwrites the file.
[ "Removes", "strings", "with", "the", "given", "names", "from", "a", "GRD", "file", ".", "Overwrites", "the", "file", "." ]
def RemoveStrings(grd_path, string_names): with open(grd_path, 'r') as f: grd = f.read() names_pattern = '|'.join(map(re.escape, string_names)) pattern = r'<message [^>]*name="(%s)".*?</message>\s*' % names_pattern grd = re.sub(pattern, '', grd, flags=re.DOTALL) with open(grd_path, 'w') as f: f.write(...
[ "def", "RemoveStrings", "(", "grd_path", ",", "string_names", ")", ":", "with", "open", "(", "grd_path", ",", "'r'", ")", "as", "f", ":", "grd", "=", "f", ".", "read", "(", ")", "names_pattern", "=", "'|'", ".", "join", "(", "map", "(", "re", ".", ...
Removes strings with the given names from a GRD file.
[ "Removes", "strings", "with", "the", "given", "names", "from", "a", "GRD", "file", "." ]
[ "\"\"\"Removes strings with the given names from a GRD file. Overwrites the file.\n\n Args:\n grd_path: path to the GRD file.\n string_names: a list of string names to be removed.\n \"\"\"" ]
[ { "param": "grd_path", "type": null }, { "param": "string_names", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "grd_path", "type": null, "docstring": "path to the GRD file.", "docstring_tokens": [ "path", "to", "the", "GRD", "file", "." ], "default": null, "is_optional": ...
ca11515d3429a44123ce37f28d944bb4cf00a33c
sunlongbo/chromium
third_party/blink/tools/blinkpy/web_tests/port/android.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
requires_http_server
<not_specific>
def requires_http_server(self): """Chromium Android runs tests on devices, and uses the HTTP server to serve the actual web tests to the test driver. """ return True
Chromium Android runs tests on devices, and uses the HTTP server to serve the actual web tests to the test driver.
Chromium Android runs tests on devices, and uses the HTTP server to serve the actual web tests to the test driver.
[ "Chromium", "Android", "runs", "tests", "on", "devices", "and", "uses", "the", "HTTP", "server", "to", "serve", "the", "actual", "web", "tests", "to", "the", "test", "driver", "." ]
def requires_http_server(self): return True
[ "def", "requires_http_server", "(", "self", ")", ":", "return", "True" ]
Chromium Android runs tests on devices, and uses the HTTP server to serve the actual web tests to the test driver.
[ "Chromium", "Android", "runs", "tests", "on", "devices", "and", "uses", "the", "HTTP", "server", "to", "serve", "the", "actual", "web", "tests", "to", "the", "test", "driver", "." ]
[ "\"\"\"Chromium Android runs tests on devices, and uses the HTTP server to\n serve the actual web tests to the test driver.\n \"\"\"" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
a77ca7734f85ba1c9a61d7f32650bda4200cb031
sunlongbo/chromium
tools/cygprofile/cyglog_to_orderfile.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
GetObjectFilenames
<not_specific>
def GetObjectFilenames(obj_dir): """Returns all a list of .o files in a given directory tree.""" obj_files = [] # Scan _obj_dir recursively for .o files. for (dirpath, _, filenames) in os.walk(obj_dir): for file_name in filenames: if file_name.endswith('.o'): obj_files.append(os.path.join(dirp...
Returns all a list of .o files in a given directory tree.
Returns all a list of .o files in a given directory tree.
[ "Returns", "all", "a", "list", "of", ".", "o", "files", "in", "a", "given", "directory", "tree", "." ]
def GetObjectFilenames(obj_dir): obj_files = [] for (dirpath, _, filenames) in os.walk(obj_dir): for file_name in filenames: if file_name.endswith('.o'): obj_files.append(os.path.join(dirpath, file_name)) return obj_files
[ "def", "GetObjectFilenames", "(", "obj_dir", ")", ":", "obj_files", "=", "[", "]", "for", "(", "dirpath", ",", "_", ",", "filenames", ")", "in", "os", ".", "walk", "(", "obj_dir", ")", ":", "for", "file_name", "in", "filenames", ":", "if", "file_name",...
Returns all a list of .o files in a given directory tree.
[ "Returns", "all", "a", "list", "of", ".", "o", "files", "in", "a", "given", "directory", "tree", "." ]
[ "\"\"\"Returns all a list of .o files in a given directory tree.\"\"\"", "# Scan _obj_dir recursively for .o files." ]
[ { "param": "obj_dir", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "obj_dir", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
a77ca7734f85ba1c9a61d7f32650bda4200cb031
sunlongbo/chromium
tools/cygprofile/cyglog_to_orderfile.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
GetSymbolToSectionsMap
<not_specific>
def GetSymbolToSectionsMap(self): """Scans object files to find symbol section names. Returns: {symbol: linker section(s)} """ if self._symbol_to_sections_map is not None: return self._symbol_to_sections_map symbol_infos = self._GetAllSymbolInfos() self._symbol_to_sections_map = {}...
Scans object files to find symbol section names. Returns: {symbol: linker section(s)}
Scans object files to find symbol section names.
[ "Scans", "object", "files", "to", "find", "symbol", "section", "names", "." ]
def GetSymbolToSectionsMap(self): if self._symbol_to_sections_map is not None: return self._symbol_to_sections_map symbol_infos = self._GetAllSymbolInfos() self._symbol_to_sections_map = {} symbol_warnings = cygprofile_utils.WarningCollector(300) for symbol_info in symbol_infos: symbol =...
[ "def", "GetSymbolToSectionsMap", "(", "self", ")", ":", "if", "self", ".", "_symbol_to_sections_map", "is", "not", "None", ":", "return", "self", ".", "_symbol_to_sections_map", "symbol_infos", "=", "self", ".", "_GetAllSymbolInfos", "(", ")", "self", ".", "_sym...
Scans object files to find symbol section names.
[ "Scans", "object", "files", "to", "find", "symbol", "section", "names", "." ]
[ "\"\"\"Scans object files to find symbol section names.\n\n Returns:\n {symbol: linker section(s)}\n \"\"\"", "# Assembly functions have section \".text\". These are all grouped", "# together near the end of the orderfile via an explicit \".text\" entry.", "# In most cases we expect just one item i...
[ { "param": "self", "type": null } ]
{ "returns": [ { "docstring": null, "docstring_tokens": [ "None" ], "type": "{symbol" } ], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": nu...
a77ca7734f85ba1c9a61d7f32650bda4200cb031
sunlongbo/chromium
tools/cygprofile/cyglog_to_orderfile.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
_SameCtorOrDtorNames
<not_specific>
def _SameCtorOrDtorNames(cls, symbol1, symbol2): """Returns True if two symbols refer to the same constructor or destructor. The Itanium C++ ABI specifies dual constructor and destructor emmission (section 5.1.4.3): https://itanium-cxx-abi.github.io/cxx-abi/abi.html#mangling-special-ctor-dtor To av...
Returns True if two symbols refer to the same constructor or destructor. The Itanium C++ ABI specifies dual constructor and destructor emmission (section 5.1.4.3): https://itanium-cxx-abi.github.io/cxx-abi/abi.html#mangling-special-ctor-dtor To avoid fully parsing all mangled symbols, a heuristic is us...
Returns True if two symbols refer to the same constructor or destructor. some compilers may name generated copies differently. If this becomes an issue this heuristic will need to be updated.
[ "Returns", "True", "if", "two", "symbols", "refer", "to", "the", "same", "constructor", "or", "destructor", ".", "some", "compilers", "may", "name", "generated", "copies", "differently", ".", "If", "this", "becomes", "an", "issue", "this", "heuristic", "will",...
def _SameCtorOrDtorNames(cls, symbol1, symbol2): return (re.search('(C[123]|D[012])E', symbol1) and symbol_extractor.DemangleSymbol(symbol1) == symbol_extractor.DemangleSymbol(symbol2))
[ "def", "_SameCtorOrDtorNames", "(", "cls", ",", "symbol1", ",", "symbol2", ")", ":", "return", "(", "re", ".", "search", "(", "'(C[123]|D[012])E'", ",", "symbol1", ")", "and", "symbol_extractor", ".", "DemangleSymbol", "(", "symbol1", ")", "==", "symbol_extrac...
Returns True if two symbols refer to the same constructor or destructor.
[ "Returns", "True", "if", "two", "symbols", "refer", "to", "the", "same", "constructor", "or", "destructor", "." ]
[ "\"\"\"Returns True if two symbols refer to the same constructor or destructor.\n\n The Itanium C++ ABI specifies dual constructor and destructor emmission\n (section 5.1.4.3):\n https://itanium-cxx-abi.github.io/cxx-abi/abi.html#mangling-special-ctor-dtor\n To avoid fully parsing all mangled symbols, a...
[ { "param": "cls", "type": null }, { "param": "symbol1", "type": null }, { "param": "symbol2", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "cls", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "symbol1", "type": null, "docstring": null, "docstring_tokens":...
a77ca7734f85ba1c9a61d7f32650bda4200cb031
sunlongbo/chromium
tools/cygprofile/cyglog_to_orderfile.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
_ReadReachedOffsets
<not_specific>
def _ReadReachedOffsets(filename): """Reads and returns a list of reached offsets.""" with open(filename, 'r') as f: offsets = [int(x.rstrip('\n')) for x in f.xreadlines()] return offsets
Reads and returns a list of reached offsets.
Reads and returns a list of reached offsets.
[ "Reads", "and", "returns", "a", "list", "of", "reached", "offsets", "." ]
def _ReadReachedOffsets(filename): with open(filename, 'r') as f: offsets = [int(x.rstrip('\n')) for x in f.xreadlines()] return offsets
[ "def", "_ReadReachedOffsets", "(", "filename", ")", ":", "with", "open", "(", "filename", ",", "'r'", ")", "as", "f", ":", "offsets", "=", "[", "int", "(", "x", ".", "rstrip", "(", "'\\n'", ")", ")", "for", "x", "in", "f", ".", "xreadlines", "(", ...
Reads and returns a list of reached offsets.
[ "Reads", "and", "returns", "a", "list", "of", "reached", "offsets", "." ]
[ "\"\"\"Reads and returns a list of reached offsets.\"\"\"" ]
[ { "param": "filename", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "filename", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
e3b32eadf258989ead2660ed345b0b322eb13ff1
sunlongbo/chromium
third_party/androidx/fetch_all_androidx.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
_download_and_parse_build_info
<not_specific>
def _download_and_parse_build_info(): """Downloads and parses BUILD_INFO file.""" with _build_dir() as build_dir: androidx_build_info_response = request.urlopen( _ANDROIDX_LATEST_SNAPSHOT_BUILD_INFO_URL) androidx_build_info_path = os.path.join(build_dir, 'BUILD_INFO') with op...
Downloads and parses BUILD_INFO file.
Downloads and parses BUILD_INFO file.
[ "Downloads", "and", "parses", "BUILD_INFO", "file", "." ]
def _download_and_parse_build_info(): with _build_dir() as build_dir: androidx_build_info_response = request.urlopen( _ANDROIDX_LATEST_SNAPSHOT_BUILD_INFO_URL) androidx_build_info_path = os.path.join(build_dir, 'BUILD_INFO') with open(androidx_build_info_path, 'w') as f: ...
[ "def", "_download_and_parse_build_info", "(", ")", ":", "with", "_build_dir", "(", ")", "as", "build_dir", ":", "androidx_build_info_response", "=", "request", ".", "urlopen", "(", "_ANDROIDX_LATEST_SNAPSHOT_BUILD_INFO_URL", ")", "androidx_build_info_path", "=", "os", "...
Downloads and parses BUILD_INFO file.
[ "Downloads", "and", "parses", "BUILD_INFO", "file", "." ]
[ "\"\"\"Downloads and parses BUILD_INFO file.\"\"\"", "# Strip '/repository' from pattern." ]
[]
{ "returns": [], "raises": [], "params": [], "outlier_params": [], "others": [] }
e3b32eadf258989ead2660ed345b0b322eb13ff1
sunlongbo/chromium
third_party/androidx/fetch_all_androidx.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
_write_cipd_yaml
null
def _write_cipd_yaml(libs_dir, version, cipd_yaml_path): """Writes cipd.yaml file at the passed-in path.""" lib_dirs = os.listdir(libs_dir) if not lib_dirs: raise Exception('No generated libraries in {}'.format(libs_dir)) data_files = [ 'BUILD.gn', 'VERSION.txt', 'additional_readme_pat...
Writes cipd.yaml file at the passed-in path.
Writes cipd.yaml file at the passed-in path.
[ "Writes", "cipd", ".", "yaml", "file", "at", "the", "passed", "-", "in", "path", "." ]
def _write_cipd_yaml(libs_dir, version, cipd_yaml_path): lib_dirs = os.listdir(libs_dir) if not lib_dirs: raise Exception('No generated libraries in {}'.format(libs_dir)) data_files = [ 'BUILD.gn', 'VERSION.txt', 'additional_readme_paths.json', 'build.gradle' ] for lib_dir in...
[ "def", "_write_cipd_yaml", "(", "libs_dir", ",", "version", ",", "cipd_yaml_path", ")", ":", "lib_dirs", "=", "os", ".", "listdir", "(", "libs_dir", ")", "if", "not", "lib_dirs", ":", "raise", "Exception", "(", "'No generated libraries in {}'", ".", "format", ...
Writes cipd.yaml file at the passed-in path.
[ "Writes", "cipd", ".", "yaml", "file", "at", "the", "passed", "-", "in", "path", "." ]
[ "\"\"\"Writes cipd.yaml file at the passed-in path.\"\"\"" ]
[ { "param": "libs_dir", "type": null }, { "param": "version", "type": null }, { "param": "cipd_yaml_path", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "libs_dir", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "version", "type": null, "docstring": null, "docstring_tok...
103ce29c1d2efd48c3fe1f76c069a6ccd6423b96
sunlongbo/chromium
chrome/test/data/android/upload_download_utils.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
download
null
def download(directory, filter, scenario, gcs_bucket): """Downloads the files from cloud as according to the given directory. Args: directory: A local disk directory. filter: A method to filter target files inside this directory. scenario: A scenario names that utilize this download method. gcs_buc...
Downloads the files from cloud as according to the given directory. Args: directory: A local disk directory. filter: A method to filter target files inside this directory. scenario: A scenario names that utilize this download method. gcs_bucket: A GCS bucket name to be used in the download.
Downloads the files from cloud as according to the given directory.
[ "Downloads", "the", "files", "from", "cloud", "as", "according", "to", "the", "given", "directory", "." ]
def download(directory, filter, scenario, gcs_bucket): files_to_delete = _get_files_to_delete(directory, filter) for file_path in files_to_delete: os.remove(file_path) try: subprocess.check_output([ 'download_from_google_storage', '--bucket', gcs_bucket, '-d', directory, '-...
[ "def", "download", "(", "directory", ",", "filter", ",", "scenario", ",", "gcs_bucket", ")", ":", "files_to_delete", "=", "_get_files_to_delete", "(", "directory", ",", "filter", ")", "for", "file_path", "in", "files_to_delete", ":", "os", ".", "remove", "(", ...
Downloads the files from cloud as according to the given directory.
[ "Downloads", "the", "files", "from", "cloud", "as", "according", "to", "the", "given", "directory", "." ]
[ "\"\"\"Downloads the files from cloud as according to the given directory.\n\n Args:\n directory: A local disk directory.\n filter: A method to filter target files inside this directory.\n scenario: A scenario names that utilize this download method.\n gcs_bucket: A GCS bucket name to be used in the do...
[ { "param": "directory", "type": null }, { "param": "filter", "type": null }, { "param": "scenario", "type": null }, { "param": "gcs_bucket", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "directory", "type": null, "docstring": "A local disk directory.", "docstring_tokens": [ "A", "local", "disk", "directory", "." ], "default": null, "is_optional": null ...
103ce29c1d2efd48c3fe1f76c069a6ccd6423b96
sunlongbo/chromium
chrome/test/data/android/upload_download_utils.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
verify_file_exists
<not_specific>
def verify_file_exists(directory, filter): """Verifies that some file exists in the directory.""" for _, _, file_list in os.walk(directory): for f in file_list: if filter(f): return True return False
Verifies that some file exists in the directory.
Verifies that some file exists in the directory.
[ "Verifies", "that", "some", "file", "exists", "in", "the", "directory", "." ]
def verify_file_exists(directory, filter): for _, _, file_list in os.walk(directory): for f in file_list: if filter(f): return True return False
[ "def", "verify_file_exists", "(", "directory", ",", "filter", ")", ":", "for", "_", ",", "_", ",", "file_list", "in", "os", ".", "walk", "(", "directory", ")", ":", "for", "f", "in", "file_list", ":", "if", "filter", "(", "f", ")", ":", "return", "...
Verifies that some file exists in the directory.
[ "Verifies", "that", "some", "file", "exists", "in", "the", "directory", "." ]
[ "\"\"\"Verifies that some file exists in the directory.\"\"\"" ]
[ { "param": "directory", "type": null }, { "param": "filter", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "directory", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "filter", "type": null, "docstring": null, "docstring_tok...
103ce29c1d2efd48c3fe1f76c069a6ccd6423b96
sunlongbo/chromium
chrome/test/data/android/upload_download_utils.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
_get_files_to_delete
<not_specific>
def _get_files_to_delete(directory, filter): """Returns a list of local files to delete. Args: directory: A local disk directory. filter: A method to filter target files inside the directory. """ files_to_delete = [] for f in os.listdir(directory): if not filter(f): continue sha1_path =...
Returns a list of local files to delete. Args: directory: A local disk directory. filter: A method to filter target files inside the directory.
Returns a list of local files to delete.
[ "Returns", "a", "list", "of", "local", "files", "to", "delete", "." ]
def _get_files_to_delete(directory, filter): files_to_delete = [] for f in os.listdir(directory): if not filter(f): continue sha1_path = os.path.join(directory, f + '.sha1') if not os.path.exists(sha1_path): files_to_delete.append(os.path.join(directory, f)) return files_to_delete
[ "def", "_get_files_to_delete", "(", "directory", ",", "filter", ")", ":", "files_to_delete", "=", "[", "]", "for", "f", "in", "os", ".", "listdir", "(", "directory", ")", ":", "if", "not", "filter", "(", "f", ")", ":", "continue", "sha1_path", "=", "os...
Returns a list of local files to delete.
[ "Returns", "a", "list", "of", "local", "files", "to", "delete", "." ]
[ "\"\"\"Returns a list of local files to delete.\n\n Args:\n directory: A local disk directory.\n filter: A method to filter target files inside the directory.\n \"\"\"" ]
[ { "param": "directory", "type": null }, { "param": "filter", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "directory", "type": null, "docstring": "A local disk directory.", "docstring_tokens": [ "A", "local", "disk", "directory", "." ], "default": null, "is_optional": null ...
103ce29c1d2efd48c3fe1f76c069a6ccd6423b96
sunlongbo/chromium
chrome/test/data/android/upload_download_utils.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
upload
<not_specific>
def upload(directory, filter, scenario, gcs_bucket, dry_run=False): """Uploads the files to cloud storage. Args: directory: A local disk directory. filter: A method to filter target files inside the directory. scenarios: A scenario that calls this upload. gcs_bucket: A GCS bucket name to be used in...
Uploads the files to cloud storage. Args: directory: A local disk directory. filter: A method to filter target files inside the directory. scenarios: A scenario that calls this upload. gcs_bucket: A GCS bucket name to be used in upload. dry_run: A flag to indicate whether it is just a dry_run or ...
Uploads the files to cloud storage.
[ "Uploads", "the", "files", "to", "cloud", "storage", "." ]
def upload(directory, filter, scenario, gcs_bucket, dry_run=False): files_to_upload = _get_files_to_upload(directory, filter) if len(files_to_upload): if dry_run: logging.info('Will upload the following %s: %s', scenario, ', '.join(files_to_upload)) logging.info('Destination gcs b...
[ "def", "upload", "(", "directory", ",", "filter", ",", "scenario", ",", "gcs_bucket", ",", "dry_run", "=", "False", ")", ":", "files_to_upload", "=", "_get_files_to_upload", "(", "directory", ",", "filter", ")", "if", "len", "(", "files_to_upload", ")", ":",...
Uploads the files to cloud storage.
[ "Uploads", "the", "files", "to", "cloud", "storage", "." ]
[ "\"\"\"Uploads the files to cloud storage.\n\n Args:\n directory: A local disk directory.\n filter: A method to filter target files inside the directory.\n scenarios: A scenario that calls this upload.\n gcs_bucket: A GCS bucket name to be used in upload.\n dry_run: A flag to indicate whether it is ...
[ { "param": "directory", "type": null }, { "param": "filter", "type": null }, { "param": "scenario", "type": null }, { "param": "gcs_bucket", "type": null }, { "param": "dry_run", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "directory", "type": null, "docstring": "A local disk directory.", "docstring_tokens": [ "A", "local", "disk", "directory", "." ], "default": null, "is_optional": null ...
103ce29c1d2efd48c3fe1f76c069a6ccd6423b96
sunlongbo/chromium
chrome/test/data/android/upload_download_utils.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
_get_files_to_upload
<not_specific>
def _get_files_to_upload(directory, filter): """Returns a list of files to upload to cloud storage. Args: directory: A local disk directory. filter: A method to filter target files inside the directory. """ files_to_upload = [] for f in os.listdir(directory): # Skip any files that we don't care a...
Returns a list of files to upload to cloud storage. Args: directory: A local disk directory. filter: A method to filter target files inside the directory.
Returns a list of files to upload to cloud storage.
[ "Returns", "a", "list", "of", "files", "to", "upload", "to", "cloud", "storage", "." ]
def _get_files_to_upload(directory, filter): files_to_upload = [] for f in os.listdir(directory): if not filter(f): continue file_path = os.path.join(directory, f) sha_path = file_path + '.sha1' if os.path.isfile(sha_path): with open(sha_path) as sha_file: with open(file_path, 'r...
[ "def", "_get_files_to_upload", "(", "directory", ",", "filter", ")", ":", "files_to_upload", "=", "[", "]", "for", "f", "in", "os", ".", "listdir", "(", "directory", ")", ":", "if", "not", "filter", "(", "f", ")", ":", "continue", "file_path", "=", "os...
Returns a list of files to upload to cloud storage.
[ "Returns", "a", "list", "of", "files", "to", "upload", "to", "cloud", "storage", "." ]
[ "\"\"\"Returns a list of files to upload to cloud storage.\n\n Args:\n directory: A local disk directory.\n filter: A method to filter target files inside the directory.\n \"\"\"", "# Skip any files that we don't care about.", "# upload_to_google_storage will upload a file even if it already exists", ...
[ { "param": "directory", "type": null }, { "param": "filter", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "directory", "type": null, "docstring": "A local disk directory.", "docstring_tokens": [ "A", "local", "disk", "directory", "." ], "default": null, "is_optional": null ...
904514f1a1334967f5d5f669c35eb66c30f50fe2
sunlongbo/chromium
tools/metrics/common/presubmit_util.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
DoPresubmit
<not_specific>
def DoPresubmit(argv, original_filename, backup_filename, prettyFn, script_name='git cl format'): """Execute presubmit/pretty printing for the target file. Args: argv: command line arguments original_filename: The path to the file to read from...
Execute presubmit/pretty printing for the target file. Args: argv: command line arguments original_filename: The path to the file to read from. backup_filename: When pretty printing, move the old file contents here. prettyFn: A function which takes the original xml content and produces pretty...
Execute presubmit/pretty printing for the target file.
[ "Execute", "presubmit", "/", "pretty", "printing", "for", "the", "target", "file", "." ]
def DoPresubmit(argv, original_filename, backup_filename, prettyFn, script_name='git cl format'): interactive = ('--non-interactive' not in argv) presubmit = ('--presubmit' in argv) diff = ('--diff' in argv) if interactive: logging.basicConfig(...
[ "def", "DoPresubmit", "(", "argv", ",", "original_filename", ",", "backup_filename", ",", "prettyFn", ",", "script_name", "=", "'git cl format'", ")", ":", "interactive", "=", "(", "'--non-interactive'", "not", "in", "argv", ")", "presubmit", "=", "(", "'--presu...
Execute presubmit/pretty printing for the target file.
[ "Execute", "presubmit", "/", "pretty", "printing", "for", "the", "target", "file", "." ]
[ "\"\"\"Execute presubmit/pretty printing for the target file.\n\n Args:\n argv: command line arguments\n original_filename: The path to the file to read from.\n backup_filename: When pretty printing, move the old file contents here.\n prettyFn: A function which takes the original xml content and produc...
[ { "param": "argv", "type": null }, { "param": "original_filename", "type": null }, { "param": "backup_filename", "type": null }, { "param": "prettyFn", "type": null }, { "param": "script_name", "type": null } ]
{ "returns": [ { "docstring": "An exit status. Non-zero indicates errors.", "docstring_tokens": [ "An", "exit", "status", ".", "Non", "-", "zero", "indicates", "errors", "." ], "type": null } ], "raise...
02d03d0d476884e48e3a0f16b2ae69baec82e884
sunlongbo/chromium
tools/perf/cli_tools/tbmv3/trace_downloader.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
_GetSubpathInBucket
<not_specific>
def _GetSubpathInBucket(html_url): """Returns the path minus the HTML_URL_PREFIX. Given https://console.../chrome-telemetry-output/o/foo/bar/trace.html, it returns foo/bar/trace.html.""" if not html_url.startswith(HTML_URL_PREFIX): raise Exception('Html trace url must start with %s' % HTML_URL_PREFIX) re...
Returns the path minus the HTML_URL_PREFIX. Given https://console.../chrome-telemetry-output/o/foo/bar/trace.html, it returns foo/bar/trace.html.
Returns the path minus the HTML_URL_PREFIX.
[ "Returns", "the", "path", "minus", "the", "HTML_URL_PREFIX", "." ]
def _GetSubpathInBucket(html_url): if not html_url.startswith(HTML_URL_PREFIX): raise Exception('Html trace url must start with %s' % HTML_URL_PREFIX) return html_url.replace(HTML_URL_PREFIX, "")
[ "def", "_GetSubpathInBucket", "(", "html_url", ")", ":", "if", "not", "html_url", ".", "startswith", "(", "HTML_URL_PREFIX", ")", ":", "raise", "Exception", "(", "'Html trace url must start with %s'", "%", "HTML_URL_PREFIX", ")", "return", "html_url", ".", "replace"...
Returns the path minus the HTML_URL_PREFIX.
[ "Returns", "the", "path", "minus", "the", "HTML_URL_PREFIX", "." ]
[ "\"\"\"Returns the path minus the HTML_URL_PREFIX.\n\n Given https://console.../chrome-telemetry-output/o/foo/bar/trace.html,\n it returns foo/bar/trace.html.\"\"\"" ]
[ { "param": "html_url", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "html_url", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
02d03d0d476884e48e3a0f16b2ae69baec82e884
sunlongbo/chromium
tools/perf/cli_tools/tbmv3/trace_downloader.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
_GetProtoTraceLinkFromTraceEventsDir
<not_specific>
def _GetProtoTraceLinkFromTraceEventsDir(link_prefix): """Returns the first proto trace in |link_prefix|/trace/traceEvents/""" proto_link_prefix = '/'.join([link_prefix, 'trace/traceEvents/**']) try: for link in cloud_storage.List(cloud_storage.TELEMETRY_OUTPUT, proto_link_p...
Returns the first proto trace in |link_prefix|/trace/traceEvents/
Returns the first proto trace in |link_prefix|/trace/traceEvents
[ "Returns", "the", "first", "proto", "trace", "in", "|link_prefix|", "/", "trace", "/", "traceEvents" ]
def _GetProtoTraceLinkFromTraceEventsDir(link_prefix): proto_link_prefix = '/'.join([link_prefix, 'trace/traceEvents/**']) try: for link in cloud_storage.List(cloud_storage.TELEMETRY_OUTPUT, proto_link_prefix): if link.endswith('.pb.gz') or link.endswith('.pb'): ...
[ "def", "_GetProtoTraceLinkFromTraceEventsDir", "(", "link_prefix", ")", ":", "proto_link_prefix", "=", "'/'", ".", "join", "(", "[", "link_prefix", ",", "'trace/traceEvents/**'", "]", ")", "try", ":", "for", "link", "in", "cloud_storage", ".", "List", "(", "clou...
Returns the first proto trace in |link_prefix|/trace/traceEvents
[ "Returns", "the", "first", "proto", "trace", "in", "|link_prefix|", "/", "trace", "/", "traceEvents" ]
[ "\"\"\"Returns the first proto trace in |link_prefix|/trace/traceEvents/\"\"\"", "# Strip the initial '/'.", "# This directory doesn't exist at all.", "# The directory exists, but no proto trace found." ]
[ { "param": "link_prefix", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "link_prefix", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
02d03d0d476884e48e3a0f16b2ae69baec82e884
sunlongbo/chromium
tools/perf/cli_tools/tbmv3/trace_downloader.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
GetLocalTraceFileName
<not_specific>
def GetLocalTraceFileName(html_url): """Returns a local filename derived from the html trace url. Given https://console.../chrome-telemetry-output/o/foo/bar/trace.html, it returns foo_bar_trace as the local filename. The filename does not contain extensions. It's up to the caller to add .html or .pb etc.""" ...
Returns a local filename derived from the html trace url. Given https://console.../chrome-telemetry-output/o/foo/bar/trace.html, it returns foo_bar_trace as the local filename. The filename does not contain extensions. It's up to the caller to add .html or .pb etc.
Returns a local filename derived from the html trace url.
[ "Returns", "a", "local", "filename", "derived", "from", "the", "html", "trace", "url", "." ]
def GetLocalTraceFileName(html_url): subpath = _GetSubpathInBucket(html_url) extension = GetFileExtension(subpath) no_extension_subpath = subpath[:-len(extension)] return '_'.join(no_extension_subpath.split('/'))
[ "def", "GetLocalTraceFileName", "(", "html_url", ")", ":", "subpath", "=", "_GetSubpathInBucket", "(", "html_url", ")", "extension", "=", "GetFileExtension", "(", "subpath", ")", "no_extension_subpath", "=", "subpath", "[", ":", "-", "len", "(", "extension", ")"...
Returns a local filename derived from the html trace url.
[ "Returns", "a", "local", "filename", "derived", "from", "the", "html", "trace", "url", "." ]
[ "\"\"\"Returns a local filename derived from the html trace url.\n\n Given https://console.../chrome-telemetry-output/o/foo/bar/trace.html, it\n returns foo_bar_trace as the local filename. The filename does not contain\n extensions. It's up to the caller to add .html or .pb etc.\"\"\"" ]
[ { "param": "html_url", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "html_url", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
02d03d0d476884e48e3a0f16b2ae69baec82e884
sunlongbo/chromium
tools/perf/cli_tools/tbmv3/trace_downloader.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
FindProtoTracePath
<not_specific>
def FindProtoTracePath(html_url): """ Finds the proto trace path given a html trace url. In the simple case foo/bar/trace.pb is the proto trace for foo/bar/trace.html. But sometimes that's not available so we have to look for a .pb.gz file in a special directory.""" subpath = _GetSubpathInBucket(html_url) ...
Finds the proto trace path given a html trace url. In the simple case foo/bar/trace.pb is the proto trace for foo/bar/trace.html. But sometimes that's not available so we have to look for a .pb.gz file in a special directory.
Finds the proto trace path given a html trace url. In the simple case foo/bar/trace.pb is the proto trace for foo/bar/trace.html. But sometimes that's not available so we have to look for a .pb.gz file in a special directory.
[ "Finds", "the", "proto", "trace", "path", "given", "a", "html", "trace", "url", ".", "In", "the", "simple", "case", "foo", "/", "bar", "/", "trace", ".", "pb", "is", "the", "proto", "trace", "for", "foo", "/", "bar", "/", "trace", ".", "html", ".",...
def FindProtoTracePath(html_url): subpath = _GetSubpathInBucket(html_url) if subpath.endswith('trace.html'): proto_path = subpath.replace('trace.html', 'trace.pb') if cloud_storage.Exists(cloud_storage.TELEMETRY_OUTPUT, proto_path): return proto_path proto_path += '.gz' if cloud_storage.Exists...
[ "def", "FindProtoTracePath", "(", "html_url", ")", ":", "subpath", "=", "_GetSubpathInBucket", "(", "html_url", ")", "if", "subpath", ".", "endswith", "(", "'trace.html'", ")", ":", "proto_path", "=", "subpath", ".", "replace", "(", "'trace.html'", ",", "'trac...
Finds the proto trace path given a html trace url.
[ "Finds", "the", "proto", "trace", "path", "given", "a", "html", "trace", "url", "." ]
[ "\"\"\"\n Finds the proto trace path given a html trace url.\n\n In the simple case foo/bar/trace.pb is the proto trace for foo/bar/trace.html.\n But sometimes that's not available so we have to look for a .pb.gz file in a\n special directory.\"\"\"" ]
[ { "param": "html_url", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "html_url", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
02d03d0d476884e48e3a0f16b2ae69baec82e884
sunlongbo/chromium
tools/perf/cli_tools/tbmv3/trace_downloader.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
DownloadHtmlTrace
<not_specific>
def DownloadHtmlTrace(html_url, download_dir=DEFAULT_TRACE_DIR): """Downloads html trace given the url. Returns local path. Skips downloading if file was already downloaded once.""" local_filename = os.path.join(download_dir, GetLocalTraceFileName(html_url)) local_path = local_filename + '.html' if os.path.e...
Downloads html trace given the url. Returns local path. Skips downloading if file was already downloaded once.
Downloads html trace given the url. Returns local path. Skips downloading if file was already downloaded once.
[ "Downloads", "html", "trace", "given", "the", "url", ".", "Returns", "local", "path", ".", "Skips", "downloading", "if", "file", "was", "already", "downloaded", "once", "." ]
def DownloadHtmlTrace(html_url, download_dir=DEFAULT_TRACE_DIR): local_filename = os.path.join(download_dir, GetLocalTraceFileName(html_url)) local_path = local_filename + '.html' if os.path.exists(local_path): logging.info('%s already downloaded. Skipping.' % local_path) return local_path remote_path =...
[ "def", "DownloadHtmlTrace", "(", "html_url", ",", "download_dir", "=", "DEFAULT_TRACE_DIR", ")", ":", "local_filename", "=", "os", ".", "path", ".", "join", "(", "download_dir", ",", "GetLocalTraceFileName", "(", "html_url", ")", ")", "local_path", "=", "local_f...
Downloads html trace given the url.
[ "Downloads", "html", "trace", "given", "the", "url", "." ]
[ "\"\"\"Downloads html trace given the url. Returns local path.\n\n Skips downloading if file was already downloaded once.\"\"\"" ]
[ { "param": "html_url", "type": null }, { "param": "download_dir", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "html_url", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "download_dir", "type": null, "docstring": null, "docstrin...
02d03d0d476884e48e3a0f16b2ae69baec82e884
sunlongbo/chromium
tools/perf/cli_tools/tbmv3/trace_downloader.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
DownloadProtoTrace
<not_specific>
def DownloadProtoTrace(html_url, download_dir=DEFAULT_TRACE_DIR): """Downloads the associated proto trace for html trace url. Returns path. Skips downloading if file was already downloaded once.""" local_filename = os.path.join(download_dir, GetLocalTraceFileName(html_url)) for local_path in [local_filename + ...
Downloads the associated proto trace for html trace url. Returns path. Skips downloading if file was already downloaded once.
Downloads the associated proto trace for html trace url. Returns path. Skips downloading if file was already downloaded once.
[ "Downloads", "the", "associated", "proto", "trace", "for", "html", "trace", "url", ".", "Returns", "path", ".", "Skips", "downloading", "if", "file", "was", "already", "downloaded", "once", "." ]
def DownloadProtoTrace(html_url, download_dir=DEFAULT_TRACE_DIR): local_filename = os.path.join(download_dir, GetLocalTraceFileName(html_url)) for local_path in [local_filename + '.pb', local_filename + '.pb.gz']: if os.path.exists(local_path): logging.info('%s already downloaded. Skipping.' % local_path)...
[ "def", "DownloadProtoTrace", "(", "html_url", ",", "download_dir", "=", "DEFAULT_TRACE_DIR", ")", ":", "local_filename", "=", "os", ".", "path", ".", "join", "(", "download_dir", ",", "GetLocalTraceFileName", "(", "html_url", ")", ")", "for", "local_path", "in",...
Downloads the associated proto trace for html trace url.
[ "Downloads", "the", "associated", "proto", "trace", "for", "html", "trace", "url", "." ]
[ "\"\"\"Downloads the associated proto trace for html trace url. Returns path.\n\n Skips downloading if file was already downloaded once.\"\"\"" ]
[ { "param": "html_url", "type": null }, { "param": "download_dir", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "html_url", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "download_dir", "type": null, "docstring": null, "docstrin...
e4cd9e6075cfa8dafd3f39ac72fedfddb0d409f5
sunlongbo/chromium
mojo/public/tools/mojom/mojom/generate/translate_unittest.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
testTranslateSimpleUnions
null
def testTranslateSimpleUnions(self): """Makes sure that a simple union is translated correctly.""" tree = ast.Mojom(None, ast.ImportList(), [ ast.Union( "SomeUnion", None, ast.UnionBody([ ast.UnionField("a", None, None, "int32"), ast.UnionField("b"...
Makes sure that a simple union is translated correctly.
Makes sure that a simple union is translated correctly.
[ "Makes", "sure", "that", "a", "simple", "union", "is", "translated", "correctly", "." ]
def testTranslateSimpleUnions(self): tree = ast.Mojom(None, ast.ImportList(), [ ast.Union( "SomeUnion", None, ast.UnionBody([ ast.UnionField("a", None, None, "int32"), ast.UnionField("b", None, None, "string") ])) ]) translation = t...
[ "def", "testTranslateSimpleUnions", "(", "self", ")", ":", "tree", "=", "ast", ".", "Mojom", "(", "None", ",", "ast", ".", "ImportList", "(", ")", ",", "[", "ast", ".", "Union", "(", "\"SomeUnion\"", ",", "None", ",", "ast", ".", "UnionBody", "(", "[...
Makes sure that a simple union is translated correctly.
[ "Makes", "sure", "that", "a", "simple", "union", "is", "translated", "correctly", "." ]
[ "\"\"\"Makes sure that a simple union is translated correctly.\"\"\"" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
e4cd9e6075cfa8dafd3f39ac72fedfddb0d409f5
sunlongbo/chromium
mojo/public/tools/mojom/mojom/generate/translate_unittest.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
testMapKindRaisesWithDuplicate
null
def testMapKindRaisesWithDuplicate(self): """Verifies _MapTreeForType() raises when passed two values with the same name.""" methods = [ ast.Method('dup', None, None, ast.ParameterList(), None), ast.Method('dup', None, None, ast.ParameterList(), None) ] with self.assertRaises(Exce...
Verifies _MapTreeForType() raises when passed two values with the same name.
Verifies _MapTreeForType() raises when passed two values with the same name.
[ "Verifies", "_MapTreeForType", "()", "raises", "when", "passed", "two", "values", "with", "the", "same", "name", "." ]
def testMapKindRaisesWithDuplicate(self): methods = [ ast.Method('dup', None, None, ast.ParameterList(), None), ast.Method('dup', None, None, ast.ParameterList(), None) ] with self.assertRaises(Exception): translate._ElemsOfType(methods, ast.Method, 'scope')
[ "def", "testMapKindRaisesWithDuplicate", "(", "self", ")", ":", "methods", "=", "[", "ast", ".", "Method", "(", "'dup'", ",", "None", ",", "None", ",", "ast", ".", "ParameterList", "(", ")", ",", "None", ")", ",", "ast", ".", "Method", "(", "'dup'", ...
Verifies _MapTreeForType() raises when passed two values with the same name.
[ "Verifies", "_MapTreeForType", "()", "raises", "when", "passed", "two", "values", "with", "the", "same", "name", "." ]
[ "\"\"\"Verifies _MapTreeForType() raises when passed two values with the same\n name.\"\"\"" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
e4cd9e6075cfa8dafd3f39ac72fedfddb0d409f5
sunlongbo/chromium
mojo/public/tools/mojom/mojom/generate/translate_unittest.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
testAssociatedKinds
null
def testAssociatedKinds(self): """Tests type spec translation of associated interfaces and requests.""" # pylint: disable=W0212 self.assertEquals( translate._MapKind("asso<SomeInterface>?"), "?asso:x:SomeInterface") self.assertEquals( translate._MapKind("asso<SomeInterface&>?"), "?asso:r...
Tests type spec translation of associated interfaces and requests.
Tests type spec translation of associated interfaces and requests.
[ "Tests", "type", "spec", "translation", "of", "associated", "interfaces", "and", "requests", "." ]
def testAssociatedKinds(self): self.assertEquals( translate._MapKind("asso<SomeInterface>?"), "?asso:x:SomeInterface") self.assertEquals( translate._MapKind("asso<SomeInterface&>?"), "?asso:r:x:SomeInterface")
[ "def", "testAssociatedKinds", "(", "self", ")", ":", "self", ".", "assertEquals", "(", "translate", ".", "_MapKind", "(", "\"asso<SomeInterface>?\"", ")", ",", "\"?asso:x:SomeInterface\"", ")", "self", ".", "assertEquals", "(", "translate", ".", "_MapKind", "(", ...
Tests type spec translation of associated interfaces and requests.
[ "Tests", "type", "spec", "translation", "of", "associated", "interfaces", "and", "requests", "." ]
[ "\"\"\"Tests type spec translation of associated interfaces and requests.\"\"\"", "# pylint: disable=W0212" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
e4cd9e6075cfa8dafd3f39ac72fedfddb0d409f5
sunlongbo/chromium
mojo/public/tools/mojom/mojom/generate/translate_unittest.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
testSelfRecursiveUnions
null
def testSelfRecursiveUnions(self): """Verifies _UnionField() raises when a union is self-recursive.""" tree = ast.Mojom(None, ast.ImportList(), [ ast.Union("SomeUnion", None, ast.UnionBody([ast.UnionField("a", None, None, "SomeUnion")])) ]) with self.assertRaises(Exception): ...
Verifies _UnionField() raises when a union is self-recursive.
Verifies _UnionField() raises when a union is self-recursive.
[ "Verifies", "_UnionField", "()", "raises", "when", "a", "union", "is", "self", "-", "recursive", "." ]
def testSelfRecursiveUnions(self): tree = ast.Mojom(None, ast.ImportList(), [ ast.Union("SomeUnion", None, ast.UnionBody([ast.UnionField("a", None, None, "SomeUnion")])) ]) with self.assertRaises(Exception): translate.OrderedModule(tree, "mojom_tree", []) tree = ast.Mojom...
[ "def", "testSelfRecursiveUnions", "(", "self", ")", ":", "tree", "=", "ast", ".", "Mojom", "(", "None", ",", "ast", ".", "ImportList", "(", ")", ",", "[", "ast", ".", "Union", "(", "\"SomeUnion\"", ",", "None", ",", "ast", ".", "UnionBody", "(", "[",...
Verifies _UnionField() raises when a union is self-recursive.
[ "Verifies", "_UnionField", "()", "raises", "when", "a", "union", "is", "self", "-", "recursive", "." ]
[ "\"\"\"Verifies _UnionField() raises when a union is self-recursive.\"\"\"" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
e4e8e63bf7bf768b670407a7af9a9f4aab55a085
sunlongbo/chromium
mojo/public/tools/bindings/generators/mojom_mojolpm_generator.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
_GetAllTypemaps
<not_specific>
def _GetAllTypemaps(self): """Returns the typemaps for types needed in this module. """ all_typemaps = [] seen_types = set() def AddKind(kind): if (mojom.IsIntegralKind(kind) or mojom.IsStringKind(kind) or mojom.IsDoubleKind(kind) or mojom.IsFloatKind(kind) or mojom.IsAnyH...
Returns the typemaps for types needed in this module.
Returns the typemaps for types needed in this module.
[ "Returns", "the", "typemaps", "for", "types", "needed", "in", "this", "module", "." ]
def _GetAllTypemaps(self): all_typemaps = [] seen_types = set() def AddKind(kind): if (mojom.IsIntegralKind(kind) or mojom.IsStringKind(kind) or mojom.IsDoubleKind(kind) or mojom.IsFloatKind(kind) or mojom.IsAnyHandleKind(kind) or mojom.IsInterfaceKind(kind) or mojom.IsIn...
[ "def", "_GetAllTypemaps", "(", "self", ")", ":", "all_typemaps", "=", "[", "]", "seen_types", "=", "set", "(", ")", "def", "AddKind", "(", "kind", ")", ":", "if", "(", "mojom", ".", "IsIntegralKind", "(", "kind", ")", "or", "mojom", ".", "IsStringKind"...
Returns the typemaps for types needed in this module.
[ "Returns", "the", "typemaps", "for", "types", "needed", "in", "this", "module", "." ]
[ "\"\"\"Returns the typemaps for types needed in this module.\n \"\"\"" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
e4e8e63bf7bf768b670407a7af9a9f4aab55a085
sunlongbo/chromium
mojo/public/tools/bindings/generators/mojom_mojolpm_generator.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
_ProtoImports
<not_specific>
def _ProtoImports(self): """Scans all of the types used in this module to check which of the imports are needed for the generated proto files. This is somewhat different to the general case, since the generated proto files don't reference response parameters. """ all_imports = self.module.import...
Scans all of the types used in this module to check which of the imports are needed for the generated proto files. This is somewhat different to the general case, since the generated proto files don't reference response parameters.
Scans all of the types used in this module to check which of the imports are needed for the generated proto files. This is somewhat different to the general case, since the generated proto files don't reference response parameters.
[ "Scans", "all", "of", "the", "types", "used", "in", "this", "module", "to", "check", "which", "of", "the", "imports", "are", "needed", "for", "the", "generated", "proto", "files", ".", "This", "is", "somewhat", "different", "to", "the", "general", "case", ...
def _ProtoImports(self): all_imports = self.module.imports seen_imports = set() seen_types = set() def AddKind(kind): if (mojom.IsIntegralKind(kind) or mojom.IsStringKind(kind) or mojom.IsDoubleKind(kind) or mojom.IsFloatKind(kind)): pass elif (mojom.IsAnyHandleKind(kind)):...
[ "def", "_ProtoImports", "(", "self", ")", ":", "all_imports", "=", "self", ".", "module", ".", "imports", "seen_imports", "=", "set", "(", ")", "seen_types", "=", "set", "(", ")", "def", "AddKind", "(", "kind", ")", ":", "if", "(", "mojom", ".", "IsI...
Scans all of the types used in this module to check which of the imports are needed for the generated proto files.
[ "Scans", "all", "of", "the", "types", "used", "in", "this", "module", "to", "check", "which", "of", "the", "imports", "are", "needed", "for", "the", "generated", "proto", "files", "." ]
[ "\"\"\"Scans all of the types used in this module to check which of the imports\n are needed for the generated proto files. This is somewhat different to the\n general case, since the generated proto files don't reference response\n parameters.\n \"\"\"" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
e4ed02a57d98a1d0e7741d0506458fd6e55af782
sunlongbo/chromium
third_party/blink/renderer/modules/bluetooth/testing/clusterfuzz/constraints.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
_GetFuzzedJsString
<not_specific>
def _GetFuzzedJsString(s): """Returns a fuzzed string based on |s|. Args: s: The base string to fuzz. Returns: A single line string surrounded by quotes. """ while True: fuzzed_string = fuzzy_types.FuzzyString(s) try: fuzzed_string = fuzzed_string.decode('utf...
Returns a fuzzed string based on |s|. Args: s: The base string to fuzz. Returns: A single line string surrounded by quotes.
Returns a fuzzed string based on |s|.
[ "Returns", "a", "fuzzed", "string", "based", "on", "|s|", "." ]
def _GetFuzzedJsString(s): while True: fuzzed_string = fuzzy_types.FuzzyString(s) try: fuzzed_string = fuzzed_string.decode('utf8') except UnicodeDecodeError: print 'Can\'t decode fuzzed string. Trying again.' else: fuzzed_string = fuzzed_string.re...
[ "def", "_GetFuzzedJsString", "(", "s", ")", ":", "while", "True", ":", "fuzzed_string", "=", "fuzzy_types", ".", "FuzzyString", "(", "s", ")", "try", ":", "fuzzed_string", "=", "fuzzed_string", ".", "decode", "(", "'utf8'", ")", "except", "UnicodeDecodeError",...
Returns a fuzzed string based on |s|.
[ "Returns", "a", "fuzzed", "string", "based", "on", "|s|", "." ]
[ "\"\"\"Returns a fuzzed string based on |s|.\n\n Args:\n s: The base string to fuzz.\n Returns:\n A single line string surrounded by quotes.\n \"\"\"", "# Escape 'escape' characters.", "# Escape quote characters.", "# Put everything in a single line." ]
[ { "param": "s", "type": null } ]
{ "returns": [ { "docstring": "A single line string surrounded by quotes.", "docstring_tokens": [ "A", "single", "line", "string", "surrounded", "by", "quotes", "." ], "type": null } ], "raises": [], "params": [ ...
e4ed02a57d98a1d0e7741d0506458fd6e55af782
sunlongbo/chromium
third_party/blink/renderer/modules/bluetooth/testing/clusterfuzz/constraints.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
_get_array_of_random_ints
<not_specific>
def _get_array_of_random_ints(max_length, max_value): """Returns an string with an array of random integer.""" length = utils.UniformExpoInteger(0, math.log(max_length, 2)) exp_max_value = math.log(max_value, 2) return '[{}]'.format(', '.join( str(utils.UniformExpoInteger(0, exp_max_value)) ...
Returns an string with an array of random integer.
Returns an string with an array of random integer.
[ "Returns", "an", "string", "with", "an", "array", "of", "random", "integer", "." ]
def _get_array_of_random_ints(max_length, max_value): length = utils.UniformExpoInteger(0, math.log(max_length, 2)) exp_max_value = math.log(max_value, 2) return '[{}]'.format(', '.join( str(utils.UniformExpoInteger(0, exp_max_value)) for _ in xrange(length)))
[ "def", "_get_array_of_random_ints", "(", "max_length", ",", "max_value", ")", ":", "length", "=", "utils", ".", "UniformExpoInteger", "(", "0", ",", "math", ".", "log", "(", "max_length", ",", "2", ")", ")", "exp_max_value", "=", "math", ".", "log", "(", ...
Returns an string with an array of random integer.
[ "Returns", "an", "string", "with", "an", "array", "of", "random", "integer", "." ]
[ "\"\"\"Returns an string with an array of random integer.\"\"\"" ]
[ { "param": "max_length", "type": null }, { "param": "max_value", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "max_length", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "max_value", "type": null, "docstring": null, "docstring...
e4ed02a57d98a1d0e7741d0506458fd6e55af782
sunlongbo/chromium
third_party/blink/renderer/modules/bluetooth/testing/clusterfuzz/constraints.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
_get_typed_array
<not_specific>
def _get_typed_array(): """Generates a TypedArray constructor. There are nine types of TypedArrays and TypedArray has four constructors. Types: * Int8Array * Int16Array * Int32Array * Uint8Array * Uint16Array * Uint32Array * Uint8ClampedArray * Float32Array ...
Generates a TypedArray constructor. There are nine types of TypedArrays and TypedArray has four constructors. Types: * Int8Array * Int16Array * Int32Array * Uint8Array * Uint16Array * Uint32Array * Uint8ClampedArray * Float32Array * Float64Array Const...
Generates a TypedArray constructor. There are nine types of TypedArrays and TypedArray has four constructors.
[ "Generates", "a", "TypedArray", "constructor", ".", "There", "are", "nine", "types", "of", "TypedArrays", "and", "TypedArray", "has", "four", "constructors", "." ]
def _get_typed_array(): array_type = random.choice([ 'Int8Array', 'Int16Array', 'Int32Array', 'Uint8Array', 'Uint16Array', 'Uint32Array', 'Uint8ClampedArray', 'Float32Array', 'Float64Array' ]) arguments = random.choice([ lambda: utils.UniformExpoInteger(0, 10), _get_typed_arr...
[ "def", "_get_typed_array", "(", ")", ":", "array_type", "=", "random", ".", "choice", "(", "[", "'Int8Array'", ",", "'Int16Array'", ",", "'Int32Array'", ",", "'Uint8Array'", ",", "'Uint16Array'", ",", "'Uint32Array'", ",", "'Uint8ClampedArray'", ",", "'Float32Arra...
Generates a TypedArray constructor.
[ "Generates", "a", "TypedArray", "constructor", "." ]
[ "\"\"\"Generates a TypedArray constructor.\n\n There are nine types of TypedArrays and TypedArray has four constructors.\n\n Types:\n * Int8Array\n * Int16Array\n * Int32Array\n * Uint8Array\n * Uint16Array\n * Uint32Array\n * Uint8ClampedArray\n * Float32Array\n *...
[]
{ "returns": [ { "docstring": "A string made up of a randomly chosen type and argument type from the\nlists above.", "docstring_tokens": [ "A", "string", "made", "up", "of", "a", "randomly", "chosen", "type", "and", ...
e4ed02a57d98a1d0e7741d0506458fd6e55af782
sunlongbo/chromium
third_party/blink/renderer/modules/bluetooth/testing/clusterfuzz/constraints.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
GetRandomUUID
<not_specific>
def GetRandomUUID(): """Returns a random UUID, a random number or a fuzzed uuid or alias.""" choice = random.choice(['uuid', 'number', 'fuzzed string']) if choice == 'uuid': return _ToJsStr(uuid.uuid4()) elif choice == 'number': return _get_random_number() elif choice == 'fuzzed stri...
Returns a random UUID, a random number or a fuzzed uuid or alias.
Returns a random UUID, a random number or a fuzzed uuid or alias.
[ "Returns", "a", "random", "UUID", "a", "random", "number", "or", "a", "fuzzed", "uuid", "or", "alias", "." ]
def GetRandomUUID(): choice = random.choice(['uuid', 'number', 'fuzzed string']) if choice == 'uuid': return _ToJsStr(uuid.uuid4()) elif choice == 'number': return _get_random_number() elif choice == 'fuzzed string': choice2 = random.choice(['uuid', 'alias']) if choice2 =...
[ "def", "GetRandomUUID", "(", ")", ":", "choice", "=", "random", ".", "choice", "(", "[", "'uuid'", ",", "'number'", ",", "'fuzzed string'", "]", ")", "if", "choice", "==", "'uuid'", ":", "return", "_ToJsStr", "(", "uuid", ".", "uuid4", "(", ")", ")", ...
Returns a random UUID, a random number or a fuzzed uuid or alias.
[ "Returns", "a", "random", "UUID", "a", "random", "number", "or", "a", "fuzzed", "uuid", "or", "alias", "." ]
[ "\"\"\"Returns a random UUID, a random number or a fuzzed uuid or alias.\"\"\"" ]
[]
{ "returns": [], "raises": [], "params": [], "outlier_params": [], "others": [] }
e4ed02a57d98a1d0e7741d0506458fd6e55af782
sunlongbo/chromium
third_party/blink/renderer/modules/bluetooth/testing/clusterfuzz/constraints.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
GetAdvertisedServiceUUID
<not_specific>
def GetAdvertisedServiceUUID(): """Generates a random Service UUID from a set of functions. See get_service_uuid_from_fakes(), GetValidServiceAlias() and GetRandomUUID() for the different values this function can return. This function weights get_service_uuid_from_fakes() more heavily to increase the ...
Generates a random Service UUID from a set of functions. See get_service_uuid_from_fakes(), GetValidServiceAlias() and GetRandomUUID() for the different values this function can return. This function weights get_service_uuid_from_fakes() more heavily to increase the probability of generating test page...
Generates a random Service UUID from a set of functions. See get_service_uuid_from_fakes(), GetValidServiceAlias() and GetRandomUUID() for the different values this function can return. This function weights get_service_uuid_from_fakes() more heavily to increase the probability of generating test pages that can intera...
[ "Generates", "a", "random", "Service", "UUID", "from", "a", "set", "of", "functions", ".", "See", "get_service_uuid_from_fakes", "()", "GetValidServiceAlias", "()", "and", "GetRandomUUID", "()", "for", "the", "different", "values", "this", "function", "can", "retu...
def GetAdvertisedServiceUUID(): roll = random.random() if roll < 0.8: return GetAdvertisedServiceUUIDFromFakes() elif roll < 0.9: return GetValidServiceAlias() else: return GetRandomUUID()
[ "def", "GetAdvertisedServiceUUID", "(", ")", ":", "roll", "=", "random", ".", "random", "(", ")", "if", "roll", "<", "0.8", ":", "return", "GetAdvertisedServiceUUIDFromFakes", "(", ")", "elif", "roll", "<", "0.9", ":", "return", "GetValidServiceAlias", "(", ...
Generates a random Service UUID from a set of functions.
[ "Generates", "a", "random", "Service", "UUID", "from", "a", "set", "of", "functions", "." ]
[ "\"\"\"Generates a random Service UUID from a set of functions.\n\n See get_service_uuid_from_fakes(), GetValidServiceAlias() and GetRandomUUID()\n for the different values this function can return.\n\n This function weights get_service_uuid_from_fakes() more heavily to increase the\n probability of gen...
[]
{ "returns": [ { "docstring": "A string or a number that can be used as a Service UUID by the Web\nBluetooth API.", "docstring_tokens": [ "A", "string", "or", "a", "number", "that", "can", "be", "used", "as", "a", ...
e4ed02a57d98a1d0e7741d0506458fd6e55af782
sunlongbo/chromium
third_party/blink/renderer/modules/bluetooth/testing/clusterfuzz/constraints.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
GetDeviceDiscoveryBase
<not_specific>
def GetDeviceDiscoveryBase(): """Generates a string that contains all steps to find a device.""" adapter, services = random.choice(wbt_fakes.ADAPTERS_WITH_DEVICES) return DEVICE_DISCOVERY_BASE.format( fake_adapter_name=_ToJsStr(adapter), service_uuid=_ToJsStr(random.choice(services)))
Generates a string that contains all steps to find a device.
Generates a string that contains all steps to find a device.
[ "Generates", "a", "string", "that", "contains", "all", "steps", "to", "find", "a", "device", "." ]
def GetDeviceDiscoveryBase(): adapter, services = random.choice(wbt_fakes.ADAPTERS_WITH_DEVICES) return DEVICE_DISCOVERY_BASE.format( fake_adapter_name=_ToJsStr(adapter), service_uuid=_ToJsStr(random.choice(services)))
[ "def", "GetDeviceDiscoveryBase", "(", ")", ":", "adapter", ",", "services", "=", "random", ".", "choice", "(", "wbt_fakes", ".", "ADAPTERS_WITH_DEVICES", ")", "return", "DEVICE_DISCOVERY_BASE", ".", "format", "(", "fake_adapter_name", "=", "_ToJsStr", "(", "adapte...
Generates a string that contains all steps to find a device.
[ "Generates", "a", "string", "that", "contains", "all", "steps", "to", "find", "a", "device", "." ]
[ "\"\"\"Generates a string that contains all steps to find a device.\"\"\"" ]
[]
{ "returns": [], "raises": [], "params": [], "outlier_params": [], "others": [] }
e4ed02a57d98a1d0e7741d0506458fd6e55af782
sunlongbo/chromium
third_party/blink/renderer/modules/bluetooth/testing/clusterfuzz/constraints.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
GetConnectableBase
<not_specific>
def GetConnectableBase(): """Generates a string that contains all steps to connect to a device. Returns: A string that: 1. Sets an adapter to a fake adapter with a connectable device. 2. Looks for the connectable device. 3. Connects to it. """ adapter, services = random.choice(wbt_fak...
Generates a string that contains all steps to connect to a device. Returns: A string that: 1. Sets an adapter to a fake adapter with a connectable device. 2. Looks for the connectable device. 3. Connects to it.
Generates a string that contains all steps to connect to a device. Returns: A string that: 1. Sets an adapter to a fake adapter with a connectable device. 2. Looks for the connectable device. 3. Connects to it.
[ "Generates", "a", "string", "that", "contains", "all", "steps", "to", "connect", "to", "a", "device", ".", "Returns", ":", "A", "string", "that", ":", "1", ".", "Sets", "an", "adapter", "to", "a", "fake", "adapter", "with", "a", "connectable", "device", ...
def GetConnectableBase(): adapter, services = random.choice(wbt_fakes.ADAPTERS_WITH_DEVICES) return DEVICE_DISCOVERY_BASE.format( fake_adapter_name=_ToJsStr(adapter), service_uuid=_ToJsStr(random.choice(services)))
[ "def", "GetConnectableBase", "(", ")", ":", "adapter", ",", "services", "=", "random", ".", "choice", "(", "wbt_fakes", ".", "ADAPTERS_WITH_DEVICES", ")", "return", "DEVICE_DISCOVERY_BASE", ".", "format", "(", "fake_adapter_name", "=", "_ToJsStr", "(", "adapter", ...
Generates a string that contains all steps to connect to a device.
[ "Generates", "a", "string", "that", "contains", "all", "steps", "to", "connect", "to", "a", "device", "." ]
[ "\"\"\"Generates a string that contains all steps to connect to a device.\n\n Returns: A string that:\n 1. Sets an adapter to a fake adapter with a connectable device.\n 2. Looks for the connectable device.\n 3. Connects to it.\n \"\"\"" ]
[]
{ "returns": [], "raises": [], "params": [], "outlier_params": [], "others": [] }
a0ba8ee57f7e069e15a96f3e5d44fa888add4975
sunlongbo/chromium
tools/android/instant_start/stats/analyze.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
print_report
null
def print_report(runs, model, control='control', experiment='experiment'): """Print stats of A/B testing""" all_df = pandas.DataFrame(runs, dtype=float) report = pandas.DataFrame( columns=['Median', 'Diff with control', 'p-value']) for metric in sorted(set(all_df['metric_name'])): mdf = ...
Print stats of A/B testing
Print stats of A/B testing
[ "Print", "stats", "of", "A", "/", "B", "testing" ]
def print_report(runs, model, control='control', experiment='experiment'): all_df = pandas.DataFrame(runs, dtype=float) report = pandas.DataFrame( columns=['Median', 'Diff with control', 'p-value']) for metric in sorted(set(all_df['metric_name'])): mdf = all_df[all_df['metric_name'] == metri...
[ "def", "print_report", "(", "runs", ",", "model", ",", "control", "=", "'control'", ",", "experiment", "=", "'experiment'", ")", ":", "all_df", "=", "pandas", ".", "DataFrame", "(", "runs", ",", "dtype", "=", "float", ")", "report", "=", "pandas", ".", ...
Print stats of A/B testing
[ "Print", "stats", "of", "A", "/", "B", "testing" ]
[ "\"\"\"Print stats of A/B testing\"\"\"" ]
[ { "param": "runs", "type": null }, { "param": "model", "type": null }, { "param": "control", "type": null }, { "param": "experiment", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "runs", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "model", "type": null, "docstring": null, "docstring_tokens": ...
65d65515107fd7b043b8560f0a95b14081f5a29d
sunlongbo/chromium
third_party/blink/tools/blinkpy/common/unified_diff.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
unified_diff
<not_specific>
def unified_diff(expected_text, actual_text, expected_filename, actual_filename): """Returns a string containing the diff of the two text strings in 'unified diff' format. """ # The filenames show up in the diff output, make sure they're # raw bytes and not unicode, so that they don...
Returns a string containing the diff of the two text strings in 'unified diff' format.
Returns a string containing the diff of the two text strings in 'unified diff' format.
[ "Returns", "a", "string", "containing", "the", "diff", "of", "the", "two", "text", "strings", "in", "'", "unified", "diff", "'", "format", "." ]
def unified_diff(expected_text, actual_text, expected_filename, actual_filename): if six.PY2: expected_filename = six.ensure_binary(expected_filename) actual_filename = six.ensure_binary(actual_filename) diff = difflib.unified_diff(expected_text.splitlines(True), ...
[ "def", "unified_diff", "(", "expected_text", ",", "actual_text", ",", "expected_filename", ",", "actual_filename", ")", ":", "if", "six", ".", "PY2", ":", "expected_filename", "=", "six", ".", "ensure_binary", "(", "expected_filename", ")", "actual_filename", "=",...
Returns a string containing the diff of the two text strings in 'unified diff' format.
[ "Returns", "a", "string", "containing", "the", "diff", "of", "the", "two", "text", "strings", "in", "'", "unified", "diff", "'", "format", "." ]
[ "\"\"\"Returns a string containing the diff of the two text strings\n in 'unified diff' format.\n \"\"\"", "# The filenames show up in the diff output, make sure they're", "# raw bytes and not unicode, so that they don't trigger join()", "# trying to decode the input." ]
[ { "param": "expected_text", "type": null }, { "param": "actual_text", "type": null }, { "param": "expected_filename", "type": null }, { "param": "actual_filename", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "expected_text", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "actual_text", "type": null, "docstring": null, "docs...
65db4dc9cf59be1d80bd4075af42af59add036d9
sunlongbo/chromium
mojo/public/tools/mojom/version_compatibility_unittest.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
_GetTypeCompatibilityMap
<not_specific>
def _GetTypeCompatibilityMap(self, old_mojom, new_mojom): """Helper to support the implementation of assertBackwardCompatible and assertNotBackwardCompatible.""" old = self.ExtractTypes(old_mojom) new = self.ExtractTypes(new_mojom) self.assertEqual(set(old.keys()), set(new.keys()), ...
Helper to support the implementation of assertBackwardCompatible and assertNotBackwardCompatible.
Helper to support the implementation of assertBackwardCompatible and assertNotBackwardCompatible.
[ "Helper", "to", "support", "the", "implementation", "of", "assertBackwardCompatible", "and", "assertNotBackwardCompatible", "." ]
def _GetTypeCompatibilityMap(self, old_mojom, new_mojom): old = self.ExtractTypes(old_mojom) new = self.ExtractTypes(new_mojom) self.assertEqual(set(old.keys()), set(new.keys()), 'Old and new test mojoms should use the same type names.') checker = module.BackwardCompatibilityChecker...
[ "def", "_GetTypeCompatibilityMap", "(", "self", ",", "old_mojom", ",", "new_mojom", ")", ":", "old", "=", "self", ".", "ExtractTypes", "(", "old_mojom", ")", "new", "=", "self", ".", "ExtractTypes", "(", "new_mojom", ")", "self", ".", "assertEqual", "(", "...
Helper to support the implementation of assertBackwardCompatible and assertNotBackwardCompatible.
[ "Helper", "to", "support", "the", "implementation", "of", "assertBackwardCompatible", "and", "assertNotBackwardCompatible", "." ]
[ "\"\"\"Helper to support the implementation of assertBackwardCompatible and\n assertNotBackwardCompatible.\"\"\"" ]
[ { "param": "self", "type": null }, { "param": "old_mojom", "type": null }, { "param": "new_mojom", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "old_mojom", "type": null, "docstring": null, "docstring_token...
65db4dc9cf59be1d80bd4075af42af59add036d9
sunlongbo/chromium
mojo/public/tools/mojom/version_compatibility_unittest.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
testNewNonExtensibleEnumValueWithMinVersion
null
def testNewNonExtensibleEnumValueWithMinVersion(self): """Adding a value to a non-extensible enum breaks backward-compatibility, even with a new [MinVersion] specified for the value.""" self.assertNotBackwardCompatible( 'enum E { kFoo, kBar };', 'enum E { kFoo, kBar, [MinVersion=1] kBaz };')
Adding a value to a non-extensible enum breaks backward-compatibility, even with a new [MinVersion] specified for the value.
Adding a value to a non-extensible enum breaks backward-compatibility, even with a new [MinVersion] specified for the value.
[ "Adding", "a", "value", "to", "a", "non", "-", "extensible", "enum", "breaks", "backward", "-", "compatibility", "even", "with", "a", "new", "[", "MinVersion", "]", "specified", "for", "the", "value", "." ]
def testNewNonExtensibleEnumValueWithMinVersion(self): self.assertNotBackwardCompatible( 'enum E { kFoo, kBar };', 'enum E { kFoo, kBar, [MinVersion=1] kBaz };')
[ "def", "testNewNonExtensibleEnumValueWithMinVersion", "(", "self", ")", ":", "self", ".", "assertNotBackwardCompatible", "(", "'enum E { kFoo, kBar };'", ",", "'enum E { kFoo, kBar, [MinVersion=1] kBaz };'", ")" ]
Adding a value to a non-extensible enum breaks backward-compatibility, even with a new [MinVersion] specified for the value.
[ "Adding", "a", "value", "to", "a", "non", "-", "extensible", "enum", "breaks", "backward", "-", "compatibility", "even", "with", "a", "new", "[", "MinVersion", "]", "specified", "for", "the", "value", "." ]
[ "\"\"\"Adding a value to a non-extensible enum breaks backward-compatibility,\n even with a new [MinVersion] specified for the value.\"\"\"" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
65db4dc9cf59be1d80bd4075af42af59add036d9
sunlongbo/chromium
mojo/public/tools/mojom/version_compatibility_unittest.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
testNewValueInExistingVersion
null
def testNewValueInExistingVersion(self): """Adding a value to an existing version is not allowed, even if the old enum was marked [Extensible]. Note that it is irrelevant whether or not the new enum is marked [Extensible].""" self.assertNotBackwardCompatible('[Extensible] enum E { kFoo, kBar };', ...
Adding a value to an existing version is not allowed, even if the old enum was marked [Extensible]. Note that it is irrelevant whether or not the new enum is marked [Extensible].
Adding a value to an existing version is not allowed, even if the old enum was marked [Extensible]. Note that it is irrelevant whether or not the new enum is marked [Extensible].
[ "Adding", "a", "value", "to", "an", "existing", "version", "is", "not", "allowed", "even", "if", "the", "old", "enum", "was", "marked", "[", "Extensible", "]", ".", "Note", "that", "it", "is", "irrelevant", "whether", "or", "not", "the", "new", "enum", ...
def testNewValueInExistingVersion(self): self.assertNotBackwardCompatible('[Extensible] enum E { kFoo, kBar };', 'enum E { kFoo, kBar, kBaz };') self.assertNotBackwardCompatible( '[Extensible] enum E { kFoo, kBar };', '[Extensible] enum E { kFoo, kBar, kBaz }...
[ "def", "testNewValueInExistingVersion", "(", "self", ")", ":", "self", ".", "assertNotBackwardCompatible", "(", "'[Extensible] enum E { kFoo, kBar };'", ",", "'enum E { kFoo, kBar, kBaz };'", ")", "self", ".", "assertNotBackwardCompatible", "(", "'[Extensible] enum E { kFoo, kBar...
Adding a value to an existing version is not allowed, even if the old enum was marked [Extensible].
[ "Adding", "a", "value", "to", "an", "existing", "version", "is", "not", "allowed", "even", "if", "the", "old", "enum", "was", "marked", "[", "Extensible", "]", "." ]
[ "\"\"\"Adding a value to an existing version is not allowed, even if the old\n enum was marked [Extensible]. Note that it is irrelevant whether or not the\n new enum is marked [Extensible].\"\"\"" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
65db4dc9cf59be1d80bd4075af42af59add036d9
sunlongbo/chromium
mojo/public/tools/mojom/version_compatibility_unittest.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
testEnumValueRemoval
null
def testEnumValueRemoval(self): """Removal of an enum value is never valid even for [Extensible] enums.""" self.assertNotBackwardCompatible('enum E { kFoo, kBar };', 'enum E { kFoo };') self.assertNotBackwardCompatible('[Extensible] enum E { kFoo, kBar };', ...
Removal of an enum value is never valid even for [Extensible] enums.
Removal of an enum value is never valid even for [Extensible] enums.
[ "Removal", "of", "an", "enum", "value", "is", "never", "valid", "even", "for", "[", "Extensible", "]", "enums", "." ]
def testEnumValueRemoval(self): self.assertNotBackwardCompatible('enum E { kFoo, kBar };', 'enum E { kFoo };') self.assertNotBackwardCompatible('[Extensible] enum E { kFoo, kBar };', '[Extensible] enum E { kFoo };') self.assertNotBack...
[ "def", "testEnumValueRemoval", "(", "self", ")", ":", "self", ".", "assertNotBackwardCompatible", "(", "'enum E { kFoo, kBar };'", ",", "'enum E { kFoo };'", ")", "self", ".", "assertNotBackwardCompatible", "(", "'[Extensible] enum E { kFoo, kBar };'", ",", "'[Extensible] enu...
Removal of an enum value is never valid even for [Extensible] enums.
[ "Removal", "of", "an", "enum", "value", "is", "never", "valid", "even", "for", "[", "Extensible", "]", "enums", "." ]
[ "\"\"\"Removal of an enum value is never valid even for [Extensible] enums.\"\"\"" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
65db4dc9cf59be1d80bd4075af42af59add036d9
sunlongbo/chromium
mojo/public/tools/mojom/version_compatibility_unittest.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
testNewExtensibleEnumValueWithMinVersion
null
def testNewExtensibleEnumValueWithMinVersion(self): """Adding a new and properly [MinVersion]'d value to an [Extensible] enum is a backward-compatible change. Note that it is irrelevant whether or not the new enum is marked [Extensible].""" self.assertBackwardCompatible('[Extensible] enum E { kA, kB };'...
Adding a new and properly [MinVersion]'d value to an [Extensible] enum is a backward-compatible change. Note that it is irrelevant whether or not the new enum is marked [Extensible].
Adding a new and properly [MinVersion]'d value to an [Extensible] enum is a backward-compatible change. Note that it is irrelevant whether or not the new enum is marked [Extensible].
[ "Adding", "a", "new", "and", "properly", "[", "MinVersion", "]", "'", "d", "value", "to", "an", "[", "Extensible", "]", "enum", "is", "a", "backward", "-", "compatible", "change", ".", "Note", "that", "it", "is", "irrelevant", "whether", "or", "not", "...
def testNewExtensibleEnumValueWithMinVersion(self): self.assertBackwardCompatible('[Extensible] enum E { kA, kB };', 'enum E { kA, kB, [MinVersion=1] kC };') self.assertBackwardCompatible( '[Extensible] enum E { kA, kB };', '[Extensible] enum E { kA, kB, [MinVer...
[ "def", "testNewExtensibleEnumValueWithMinVersion", "(", "self", ")", ":", "self", ".", "assertBackwardCompatible", "(", "'[Extensible] enum E { kA, kB };'", ",", "'enum E { kA, kB, [MinVersion=1] kC };'", ")", "self", ".", "assertBackwardCompatible", "(", "'[Extensible] enum E { ...
Adding a new and properly [MinVersion]'d value to an [Extensible] enum is a backward-compatible change.
[ "Adding", "a", "new", "and", "properly", "[", "MinVersion", "]", "'", "d", "value", "to", "an", "[", "Extensible", "]", "enum", "is", "a", "backward", "-", "compatible", "change", "." ]
[ "\"\"\"Adding a new and properly [MinVersion]'d value to an [Extensible] enum\n is a backward-compatible change. Note that it is irrelevant whether or not\n the new enum is marked [Extensible].\"\"\"" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
65db4dc9cf59be1d80bd4075af42af59add036d9
sunlongbo/chromium
mojo/public/tools/mojom/version_compatibility_unittest.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
testAddEnumValueAlias
null
def testAddEnumValueAlias(self): """Adding new enum fields does not affect backward-compatibility if it does not introduce any new numeric values.""" self.assertBackwardCompatible( 'enum E { kA, kB };', 'enum E { kA, kB, kC = kA, kD = 1, kE = kD };')
Adding new enum fields does not affect backward-compatibility if it does not introduce any new numeric values.
Adding new enum fields does not affect backward-compatibility if it does not introduce any new numeric values.
[ "Adding", "new", "enum", "fields", "does", "not", "affect", "backward", "-", "compatibility", "if", "it", "does", "not", "introduce", "any", "new", "numeric", "values", "." ]
def testAddEnumValueAlias(self): self.assertBackwardCompatible( 'enum E { kA, kB };', 'enum E { kA, kB, kC = kA, kD = 1, kE = kD };')
[ "def", "testAddEnumValueAlias", "(", "self", ")", ":", "self", ".", "assertBackwardCompatible", "(", "'enum E { kA, kB };'", ",", "'enum E { kA, kB, kC = kA, kD = 1, kE = kD };'", ")" ]
Adding new enum fields does not affect backward-compatibility if it does not introduce any new numeric values.
[ "Adding", "new", "enum", "fields", "does", "not", "affect", "backward", "-", "compatibility", "if", "it", "does", "not", "introduce", "any", "new", "numeric", "values", "." ]
[ "\"\"\"Adding new enum fields does not affect backward-compatibility if it does\n not introduce any new numeric values.\"\"\"" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
65db4dc9cf59be1d80bd4075af42af59add036d9
sunlongbo/chromium
mojo/public/tools/mojom/version_compatibility_unittest.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
testNewStructFieldUnversioned
null
def testNewStructFieldUnversioned(self): """Adding a new field to a struct without a new (i.e. higher than any existing version) [MinVersion] tag breaks backward-compatibility.""" self.assertNotBackwardCompatible('struct S { string a; };', 'struct S { string a; string b;...
Adding a new field to a struct without a new (i.e. higher than any existing version) [MinVersion] tag breaks backward-compatibility.
Adding a new field to a struct without a new [MinVersion] tag breaks backward-compatibility.
[ "Adding", "a", "new", "field", "to", "a", "struct", "without", "a", "new", "[", "MinVersion", "]", "tag", "breaks", "backward", "-", "compatibility", "." ]
def testNewStructFieldUnversioned(self): self.assertNotBackwardCompatible('struct S { string a; };', 'struct S { string a; string b; };')
[ "def", "testNewStructFieldUnversioned", "(", "self", ")", ":", "self", ".", "assertNotBackwardCompatible", "(", "'struct S { string a; };'", ",", "'struct S { string a; string b; };'", ")" ]
Adding a new field to a struct without a new (i.e.
[ "Adding", "a", "new", "field", "to", "a", "struct", "without", "a", "new", "(", "i", ".", "e", "." ]
[ "\"\"\"Adding a new field to a struct without a new (i.e. higher than any\n existing version) [MinVersion] tag breaks backward-compatibility.\"\"\"" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
65db4dc9cf59be1d80bd4075af42af59add036d9
sunlongbo/chromium
mojo/public/tools/mojom/version_compatibility_unittest.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
testStructFieldTypeChange
null
def testStructFieldTypeChange(self): """Changing the type of an existing field always breaks backward-compatibility.""" self.assertNotBackwardCompatible('struct S { string a; };', 'struct S { array<int32> a; };')
Changing the type of an existing field always breaks backward-compatibility.
Changing the type of an existing field always breaks backward-compatibility.
[ "Changing", "the", "type", "of", "an", "existing", "field", "always", "breaks", "backward", "-", "compatibility", "." ]
def testStructFieldTypeChange(self): self.assertNotBackwardCompatible('struct S { string a; };', 'struct S { array<int32> a; };')
[ "def", "testStructFieldTypeChange", "(", "self", ")", ":", "self", ".", "assertNotBackwardCompatible", "(", "'struct S { string a; };'", ",", "'struct S { array<int32> a; };'", ")" ]
Changing the type of an existing field always breaks backward-compatibility.
[ "Changing", "the", "type", "of", "an", "existing", "field", "always", "breaks", "backward", "-", "compatibility", "." ]
[ "\"\"\"Changing the type of an existing field always breaks\n backward-compatibility.\"\"\"" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
65db4dc9cf59be1d80bd4075af42af59add036d9
sunlongbo/chromium
mojo/public/tools/mojom/version_compatibility_unittest.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
testStructFieldBecomingOptional
null
def testStructFieldBecomingOptional(self): """Changing a field from non-optional to optional breaks backward-compatibility.""" self.assertNotBackwardCompatible('struct S { string a; };', 'struct S { string? a; };')
Changing a field from non-optional to optional breaks backward-compatibility.
Changing a field from non-optional to optional breaks backward-compatibility.
[ "Changing", "a", "field", "from", "non", "-", "optional", "to", "optional", "breaks", "backward", "-", "compatibility", "." ]
def testStructFieldBecomingOptional(self): self.assertNotBackwardCompatible('struct S { string a; };', 'struct S { string? a; };')
[ "def", "testStructFieldBecomingOptional", "(", "self", ")", ":", "self", ".", "assertNotBackwardCompatible", "(", "'struct S { string a; };'", ",", "'struct S { string? a; };'", ")" ]
Changing a field from non-optional to optional breaks backward-compatibility.
[ "Changing", "a", "field", "from", "non", "-", "optional", "to", "optional", "breaks", "backward", "-", "compatibility", "." ]
[ "\"\"\"Changing a field from non-optional to optional breaks\n backward-compatibility.\"\"\"" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
65db4dc9cf59be1d80bd4075af42af59add036d9
sunlongbo/chromium
mojo/public/tools/mojom/version_compatibility_unittest.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
testStructFieldBecomingNonOptional
null
def testStructFieldBecomingNonOptional(self): """Changing a field from optional to non-optional breaks backward-compatibility.""" self.assertNotBackwardCompatible('struct S { string? a; };', 'struct S { string a; };')
Changing a field from optional to non-optional breaks backward-compatibility.
Changing a field from optional to non-optional breaks backward-compatibility.
[ "Changing", "a", "field", "from", "optional", "to", "non", "-", "optional", "breaks", "backward", "-", "compatibility", "." ]
def testStructFieldBecomingNonOptional(self): self.assertNotBackwardCompatible('struct S { string? a; };', 'struct S { string a; };')
[ "def", "testStructFieldBecomingNonOptional", "(", "self", ")", ":", "self", ".", "assertNotBackwardCompatible", "(", "'struct S { string? a; };'", ",", "'struct S { string a; };'", ")" ]
Changing a field from optional to non-optional breaks backward-compatibility.
[ "Changing", "a", "field", "from", "optional", "to", "non", "-", "optional", "breaks", "backward", "-", "compatibility", "." ]
[ "\"\"\"Changing a field from optional to non-optional breaks\n backward-compatibility.\"\"\"" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
65db4dc9cf59be1d80bd4075af42af59add036d9
sunlongbo/chromium
mojo/public/tools/mojom/version_compatibility_unittest.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
testStructFieldOrderChange
null
def testStructFieldOrderChange(self): """Changing the order of fields breaks backward-compatibility.""" self.assertNotBackwardCompatible('struct S { string a; bool b; };', 'struct S { bool b; string a; };') self.assertNotBackwardCompatible('struct S { string a@0; bool b@...
Changing the order of fields breaks backward-compatibility.
Changing the order of fields breaks backward-compatibility.
[ "Changing", "the", "order", "of", "fields", "breaks", "backward", "-", "compatibility", "." ]
def testStructFieldOrderChange(self): self.assertNotBackwardCompatible('struct S { string a; bool b; };', 'struct S { bool b; string a; };') self.assertNotBackwardCompatible('struct S { string a@0; bool b@1; };', 'struct S { string a@1; b...
[ "def", "testStructFieldOrderChange", "(", "self", ")", ":", "self", ".", "assertNotBackwardCompatible", "(", "'struct S { string a; bool b; };'", ",", "'struct S { bool b; string a; };'", ")", "self", ".", "assertNotBackwardCompatible", "(", "'struct S { string a@0; bool b@1; };'...
Changing the order of fields breaks backward-compatibility.
[ "Changing", "the", "order", "of", "fields", "breaks", "backward", "-", "compatibility", "." ]
[ "\"\"\"Changing the order of fields breaks backward-compatibility.\"\"\"" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
65db4dc9cf59be1d80bd4075af42af59add036d9
sunlongbo/chromium
mojo/public/tools/mojom/version_compatibility_unittest.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
testStructFieldMinVersionChange
null
def testStructFieldMinVersionChange(self): """Changing the MinVersion of a field breaks backward-compatibility.""" self.assertNotBackwardCompatible( 'struct S { string a; [MinVersion=1] string? b; };', 'struct S { string a; [MinVersion=2] string? b; };')
Changing the MinVersion of a field breaks backward-compatibility.
Changing the MinVersion of a field breaks backward-compatibility.
[ "Changing", "the", "MinVersion", "of", "a", "field", "breaks", "backward", "-", "compatibility", "." ]
def testStructFieldMinVersionChange(self): self.assertNotBackwardCompatible( 'struct S { string a; [MinVersion=1] string? b; };', 'struct S { string a; [MinVersion=2] string? b; };')
[ "def", "testStructFieldMinVersionChange", "(", "self", ")", ":", "self", ".", "assertNotBackwardCompatible", "(", "'struct S { string a; [MinVersion=1] string? b; };'", ",", "'struct S { string a; [MinVersion=2] string? b; };'", ")" ]
Changing the MinVersion of a field breaks backward-compatibility.
[ "Changing", "the", "MinVersion", "of", "a", "field", "breaks", "backward", "-", "compatibility", "." ]
[ "\"\"\"Changing the MinVersion of a field breaks backward-compatibility.\"\"\"" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
65db4dc9cf59be1d80bd4075af42af59add036d9
sunlongbo/chromium
mojo/public/tools/mojom/version_compatibility_unittest.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
testStructFieldTypeChange
null
def testStructFieldTypeChange(self): """If a struct field's own type definition changes, the containing struct is backward-compatible if and only if the field type's change is backward-compatible.""" self.assertBackwardCompatible( 'struct S {}; struct T { S s; };', 'struct S { [MinVersio...
If a struct field's own type definition changes, the containing struct is backward-compatible if and only if the field type's change is backward-compatible.
If a struct field's own type definition changes, the containing struct is backward-compatible if and only if the field type's change is backward-compatible.
[ "If", "a", "struct", "field", "'", "s", "own", "type", "definition", "changes", "the", "containing", "struct", "is", "backward", "-", "compatible", "if", "and", "only", "if", "the", "field", "type", "'", "s", "change", "is", "backward", "-", "compatible", ...
def testStructFieldTypeChange(self): self.assertBackwardCompatible( 'struct S {}; struct T { S s; };', 'struct S { [MinVersion=1] int32 x; }; struct T { S s; };') self.assertBackwardCompatible( '[Extensible] enum E { kA }; struct S { E e; };', '[Extensible] enum E { kA, [MinVersi...
[ "def", "testStructFieldTypeChange", "(", "self", ")", ":", "self", ".", "assertBackwardCompatible", "(", "'struct S {}; struct T { S s; };'", ",", "'struct S { [MinVersion=1] int32 x; }; struct T { S s; };'", ")", "self", ".", "assertBackwardCompatible", "(", "'[Extensible] enum ...
If a struct field's own type definition changes, the containing struct is backward-compatible if and only if the field type's change is backward-compatible.
[ "If", "a", "struct", "field", "'", "s", "own", "type", "definition", "changes", "the", "containing", "struct", "is", "backward", "-", "compatible", "if", "and", "only", "if", "the", "field", "type", "'", "s", "change", "is", "backward", "-", "compatible", ...
[ "\"\"\"If a struct field's own type definition changes, the containing struct\n is backward-compatible if and only if the field type's change is\n backward-compatible.\"\"\"" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
65db4dc9cf59be1d80bd4075af42af59add036d9
sunlongbo/chromium
mojo/public/tools/mojom/version_compatibility_unittest.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
testNewStructFieldWithInvalidMinVersion
null
def testNewStructFieldWithInvalidMinVersion(self): """Adding a new field using an existing MinVersion breaks backward- compatibility.""" self.assertNotBackwardCompatible( """\ struct S { string a; [MinVersion=1] string? b; }; """, """\ struct S { ...
Adding a new field using an existing MinVersion breaks backward- compatibility.
Adding a new field using an existing MinVersion breaks backward compatibility.
[ "Adding", "a", "new", "field", "using", "an", "existing", "MinVersion", "breaks", "backward", "compatibility", "." ]
def testNewStructFieldWithInvalidMinVersion(self): self.assertNotBackwardCompatible( """\ struct S { string a; [MinVersion=1] string? b; }; """, """\ struct S { string a; [MinVersion=1] string? b; [MinVersion=1] string? c; ...
[ "def", "testNewStructFieldWithInvalidMinVersion", "(", "self", ")", ":", "self", ".", "assertNotBackwardCompatible", "(", "\"\"\"\\\n struct S {\n string a;\n [MinVersion=1] string? b;\n };\n \"\"\"", ",", "\"\"\"\\\n struct S {\n string...
Adding a new field using an existing MinVersion breaks backward compatibility.
[ "Adding", "a", "new", "field", "using", "an", "existing", "MinVersion", "breaks", "backward", "compatibility", "." ]
[ "\"\"\"Adding a new field using an existing MinVersion breaks backward-\n compatibility.\"\"\"" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
65db4dc9cf59be1d80bd4075af42af59add036d9
sunlongbo/chromium
mojo/public/tools/mojom/version_compatibility_unittest.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
testNewStructFieldWithValidMinVersion
null
def testNewStructFieldWithValidMinVersion(self): """Adding a new field is safe if tagged with a MinVersion greater than any previously used MinVersion in the struct.""" self.assertBackwardCompatible( 'struct S { int32 a; };', 'struct S { int32 a; [MinVersion=1] int32 b; };') self.assertB...
Adding a new field is safe if tagged with a MinVersion greater than any previously used MinVersion in the struct.
Adding a new field is safe if tagged with a MinVersion greater than any previously used MinVersion in the struct.
[ "Adding", "a", "new", "field", "is", "safe", "if", "tagged", "with", "a", "MinVersion", "greater", "than", "any", "previously", "used", "MinVersion", "in", "the", "struct", "." ]
def testNewStructFieldWithValidMinVersion(self): self.assertBackwardCompatible( 'struct S { int32 a; };', 'struct S { int32 a; [MinVersion=1] int32 b; };') self.assertBackwardCompatible( 'struct S { int32 a; [MinVersion=1] int32 b; };', 'struct S { int32 a; [MinVersion=1] int32 b...
[ "def", "testNewStructFieldWithValidMinVersion", "(", "self", ")", ":", "self", ".", "assertBackwardCompatible", "(", "'struct S { int32 a; };'", ",", "'struct S { int32 a; [MinVersion=1] int32 b; };'", ")", "self", ".", "assertBackwardCompatible", "(", "'struct S { int32 a; [MinV...
Adding a new field is safe if tagged with a MinVersion greater than any previously used MinVersion in the struct.
[ "Adding", "a", "new", "field", "is", "safe", "if", "tagged", "with", "a", "MinVersion", "greater", "than", "any", "previously", "used", "MinVersion", "in", "the", "struct", "." ]
[ "\"\"\"Adding a new field is safe if tagged with a MinVersion greater than any\n previously used MinVersion in the struct.\"\"\"" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
65db4dc9cf59be1d80bd4075af42af59add036d9
sunlongbo/chromium
mojo/public/tools/mojom/version_compatibility_unittest.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
testNewStructFieldNullableReference
null
def testNewStructFieldNullableReference(self): """Adding a new nullable reference-typed field is fine if versioned properly.""" self.assertBackwardCompatible( 'struct S { int32 a; };', 'struct S { int32 a; [MinVersion=1] string? b; };')
Adding a new nullable reference-typed field is fine if versioned properly.
Adding a new nullable reference-typed field is fine if versioned properly.
[ "Adding", "a", "new", "nullable", "reference", "-", "typed", "field", "is", "fine", "if", "versioned", "properly", "." ]
def testNewStructFieldNullableReference(self): self.assertBackwardCompatible( 'struct S { int32 a; };', 'struct S { int32 a; [MinVersion=1] string? b; };')
[ "def", "testNewStructFieldNullableReference", "(", "self", ")", ":", "self", ".", "assertBackwardCompatible", "(", "'struct S { int32 a; };'", ",", "'struct S { int32 a; [MinVersion=1] string? b; };'", ")" ]
Adding a new nullable reference-typed field is fine if versioned properly.
[ "Adding", "a", "new", "nullable", "reference", "-", "typed", "field", "is", "fine", "if", "versioned", "properly", "." ]
[ "\"\"\"Adding a new nullable reference-typed field is fine if versioned\n properly.\"\"\"" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
65db4dc9cf59be1d80bd4075af42af59add036d9
sunlongbo/chromium
mojo/public/tools/mojom/version_compatibility_unittest.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
testStructFieldReorderWithExplicitOrdinals
null
def testStructFieldReorderWithExplicitOrdinals(self): """Reordering fields has no effect on backward-compatibility when field ordinals are explicitly labeled and remain unchanged.""" self.assertBackwardCompatible('struct S { bool b@1; int32 a@0; };', 'struct S { int32 a@0; ...
Reordering fields has no effect on backward-compatibility when field ordinals are explicitly labeled and remain unchanged.
Reordering fields has no effect on backward-compatibility when field ordinals are explicitly labeled and remain unchanged.
[ "Reordering", "fields", "has", "no", "effect", "on", "backward", "-", "compatibility", "when", "field", "ordinals", "are", "explicitly", "labeled", "and", "remain", "unchanged", "." ]
def testStructFieldReorderWithExplicitOrdinals(self): self.assertBackwardCompatible('struct S { bool b@1; int32 a@0; };', 'struct S { int32 a@0; bool b@1; };')
[ "def", "testStructFieldReorderWithExplicitOrdinals", "(", "self", ")", ":", "self", ".", "assertBackwardCompatible", "(", "'struct S { bool b@1; int32 a@0; };'", ",", "'struct S { int32 a@0; bool b@1; };'", ")" ]
Reordering fields has no effect on backward-compatibility when field ordinals are explicitly labeled and remain unchanged.
[ "Reordering", "fields", "has", "no", "effect", "on", "backward", "-", "compatibility", "when", "field", "ordinals", "are", "explicitly", "labeled", "and", "remain", "unchanged", "." ]
[ "\"\"\"Reordering fields has no effect on backward-compatibility when field\n ordinals are explicitly labeled and remain unchanged.\"\"\"" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
65db4dc9cf59be1d80bd4075af42af59add036d9
sunlongbo/chromium
mojo/public/tools/mojom/version_compatibility_unittest.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
testNewUnionFieldUnversioned
null
def testNewUnionFieldUnversioned(self): """Adding a new field to a union without a new (i.e. higher than any existing version) [MinVersion] tag breaks backward-compatibility.""" self.assertNotBackwardCompatible('union U { string a; };', 'union U { string a; string b; };'...
Adding a new field to a union without a new (i.e. higher than any existing version) [MinVersion] tag breaks backward-compatibility.
Adding a new field to a union without a new [MinVersion] tag breaks backward-compatibility.
[ "Adding", "a", "new", "field", "to", "a", "union", "without", "a", "new", "[", "MinVersion", "]", "tag", "breaks", "backward", "-", "compatibility", "." ]
def testNewUnionFieldUnversioned(self): self.assertNotBackwardCompatible('union U { string a; };', 'union U { string a; string b; };')
[ "def", "testNewUnionFieldUnversioned", "(", "self", ")", ":", "self", ".", "assertNotBackwardCompatible", "(", "'union U { string a; };'", ",", "'union U { string a; string b; };'", ")" ]
Adding a new field to a union without a new (i.e.
[ "Adding", "a", "new", "field", "to", "a", "union", "without", "a", "new", "(", "i", ".", "e", "." ]
[ "\"\"\"Adding a new field to a union without a new (i.e. higher than any\n existing version) [MinVersion] tag breaks backward-compatibility.\"\"\"" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
65db4dc9cf59be1d80bd4075af42af59add036d9
sunlongbo/chromium
mojo/public/tools/mojom/version_compatibility_unittest.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
testUnionFieldTypeChange
null
def testUnionFieldTypeChange(self): """Changing the type of an existing field always breaks backward-compatibility.""" self.assertNotBackwardCompatible('union U { string a; };', 'union U { array<int32> a; };')
Changing the type of an existing field always breaks backward-compatibility.
Changing the type of an existing field always breaks backward-compatibility.
[ "Changing", "the", "type", "of", "an", "existing", "field", "always", "breaks", "backward", "-", "compatibility", "." ]
def testUnionFieldTypeChange(self): self.assertNotBackwardCompatible('union U { string a; };', 'union U { array<int32> a; };')
[ "def", "testUnionFieldTypeChange", "(", "self", ")", ":", "self", ".", "assertNotBackwardCompatible", "(", "'union U { string a; };'", ",", "'union U { array<int32> a; };'", ")" ]
Changing the type of an existing field always breaks backward-compatibility.
[ "Changing", "the", "type", "of", "an", "existing", "field", "always", "breaks", "backward", "-", "compatibility", "." ]
[ "\"\"\"Changing the type of an existing field always breaks\n backward-compatibility.\"\"\"" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
65db4dc9cf59be1d80bd4075af42af59add036d9
sunlongbo/chromium
mojo/public/tools/mojom/version_compatibility_unittest.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
testUnionFieldBecomingOptional
null
def testUnionFieldBecomingOptional(self): """Changing a field from non-optional to optional breaks backward-compatibility.""" self.assertNotBackwardCompatible('union U { string a; };', 'union U { string? a; };')
Changing a field from non-optional to optional breaks backward-compatibility.
Changing a field from non-optional to optional breaks backward-compatibility.
[ "Changing", "a", "field", "from", "non", "-", "optional", "to", "optional", "breaks", "backward", "-", "compatibility", "." ]
def testUnionFieldBecomingOptional(self): self.assertNotBackwardCompatible('union U { string a; };', 'union U { string? a; };')
[ "def", "testUnionFieldBecomingOptional", "(", "self", ")", ":", "self", ".", "assertNotBackwardCompatible", "(", "'union U { string a; };'", ",", "'union U { string? a; };'", ")" ]
Changing a field from non-optional to optional breaks backward-compatibility.
[ "Changing", "a", "field", "from", "non", "-", "optional", "to", "optional", "breaks", "backward", "-", "compatibility", "." ]
[ "\"\"\"Changing a field from non-optional to optional breaks\n backward-compatibility.\"\"\"" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
65db4dc9cf59be1d80bd4075af42af59add036d9
sunlongbo/chromium
mojo/public/tools/mojom/version_compatibility_unittest.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
testFieldNestedTypeChanged
null
def testFieldNestedTypeChanged(self): """Changing the definition of a nested type within a field (such as an array element or interface endpoint type) should only break backward-compatibility if the changes to that type are not backward-compatible.""" self.assertBackwardCompatible( """\ ...
Changing the definition of a nested type within a field (such as an array element or interface endpoint type) should only break backward-compatibility if the changes to that type are not backward-compatible.
Changing the definition of a nested type within a field (such as an array element or interface endpoint type) should only break backward-compatibility if the changes to that type are not backward-compatible.
[ "Changing", "the", "definition", "of", "a", "nested", "type", "within", "a", "field", "(", "such", "as", "an", "array", "element", "or", "interface", "endpoint", "type", ")", "should", "only", "break", "backward", "-", "compatibility", "if", "the", "changes"...
def testFieldNestedTypeChanged(self): self.assertBackwardCompatible( """\ struct S { string a; }; struct T { array<S> ss; }; """, """\ struct S { string a; [MinVersion=1] string? b; }; struct T { array<S> ss; }; """) self.assert...
[ "def", "testFieldNestedTypeChanged", "(", "self", ")", ":", "self", ".", "assertBackwardCompatible", "(", "\"\"\"\\\n struct S { string a; };\n struct T { array<S> ss; };\n \"\"\"", ",", "\"\"\"\\\n struct S {\n string a;\n [MinVersion=1] string?...
Changing the definition of a nested type within a field (such as an array element or interface endpoint type) should only break backward-compatibility if the changes to that type are not backward-compatible.
[ "Changing", "the", "definition", "of", "a", "nested", "type", "within", "a", "field", "(", "such", "as", "an", "array", "element", "or", "interface", "endpoint", "type", ")", "should", "only", "break", "backward", "-", "compatibility", "if", "the", "changes"...
[ "\"\"\"Changing the definition of a nested type within a field (such as an array\n element or interface endpoint type) should only break backward-compatibility\n if the changes to that type are not backward-compatible.\"\"\"" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
65db4dc9cf59be1d80bd4075af42af59add036d9
sunlongbo/chromium
mojo/public/tools/mojom/version_compatibility_unittest.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
testRecursiveTypeChange
null
def testRecursiveTypeChange(self): """Recursive types do not break the compatibility checker.""" self.assertBackwardCompatible( """\ struct S { string a; array<S> others; };""", """\ struct S { string a; array<S> others; [MinVersi...
Recursive types do not break the compatibility checker.
Recursive types do not break the compatibility checker.
[ "Recursive", "types", "do", "not", "break", "the", "compatibility", "checker", "." ]
def testRecursiveTypeChange(self): self.assertBackwardCompatible( """\ struct S { string a; array<S> others; };""", """\ struct S { string a; array<S> others; [MinVersion=1] string? b; };""")
[ "def", "testRecursiveTypeChange", "(", "self", ")", ":", "self", ".", "assertBackwardCompatible", "(", "\"\"\"\\\n struct S {\n string a;\n array<S> others;\n };\"\"\"", ",", "\"\"\"\\\n struct S {\n string a;\n array<S> others;\n ...
Recursive types do not break the compatibility checker.
[ "Recursive", "types", "do", "not", "break", "the", "compatibility", "checker", "." ]
[ "\"\"\"Recursive types do not break the compatibility checker.\"\"\"" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
65db4dc9cf59be1d80bd4075af42af59add036d9
sunlongbo/chromium
mojo/public/tools/mojom/version_compatibility_unittest.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
testUnionFieldBecomingNonOptional
null
def testUnionFieldBecomingNonOptional(self): """Changing a field from optional to non-optional breaks backward-compatibility.""" self.assertNotBackwardCompatible('union U { string? a; };', 'union U { string a; };')
Changing a field from optional to non-optional breaks backward-compatibility.
Changing a field from optional to non-optional breaks backward-compatibility.
[ "Changing", "a", "field", "from", "optional", "to", "non", "-", "optional", "breaks", "backward", "-", "compatibility", "." ]
def testUnionFieldBecomingNonOptional(self): self.assertNotBackwardCompatible('union U { string? a; };', 'union U { string a; };')
[ "def", "testUnionFieldBecomingNonOptional", "(", "self", ")", ":", "self", ".", "assertNotBackwardCompatible", "(", "'union U { string? a; };'", ",", "'union U { string a; };'", ")" ]
Changing a field from optional to non-optional breaks backward-compatibility.
[ "Changing", "a", "field", "from", "optional", "to", "non", "-", "optional", "breaks", "backward", "-", "compatibility", "." ]
[ "\"\"\"Changing a field from optional to non-optional breaks\n backward-compatibility.\"\"\"" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
65db4dc9cf59be1d80bd4075af42af59add036d9
sunlongbo/chromium
mojo/public/tools/mojom/version_compatibility_unittest.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
testUnionFieldOrderChange
null
def testUnionFieldOrderChange(self): """Changing the order of fields breaks backward-compatibility.""" self.assertNotBackwardCompatible('union U { string a; bool b; };', 'union U { bool b; string a; };') self.assertNotBackwardCompatible('union U { string a@0; bool b@1; }...
Changing the order of fields breaks backward-compatibility.
Changing the order of fields breaks backward-compatibility.
[ "Changing", "the", "order", "of", "fields", "breaks", "backward", "-", "compatibility", "." ]
def testUnionFieldOrderChange(self): self.assertNotBackwardCompatible('union U { string a; bool b; };', 'union U { bool b; string a; };') self.assertNotBackwardCompatible('union U { string a@0; bool b@1; };', 'union U { string a@1; bool b...
[ "def", "testUnionFieldOrderChange", "(", "self", ")", ":", "self", ".", "assertNotBackwardCompatible", "(", "'union U { string a; bool b; };'", ",", "'union U { bool b; string a; };'", ")", "self", ".", "assertNotBackwardCompatible", "(", "'union U { string a@0; bool b@1; };'", ...
Changing the order of fields breaks backward-compatibility.
[ "Changing", "the", "order", "of", "fields", "breaks", "backward", "-", "compatibility", "." ]
[ "\"\"\"Changing the order of fields breaks backward-compatibility.\"\"\"" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
65db4dc9cf59be1d80bd4075af42af59add036d9
sunlongbo/chromium
mojo/public/tools/mojom/version_compatibility_unittest.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
testUnionFieldMinVersionChange
null
def testUnionFieldMinVersionChange(self): """Changing the MinVersion of a field breaks backward-compatibility.""" self.assertNotBackwardCompatible( 'union U { string a; [MinVersion=1] string b; };', 'union U { string a; [MinVersion=2] string b; };')
Changing the MinVersion of a field breaks backward-compatibility.
Changing the MinVersion of a field breaks backward-compatibility.
[ "Changing", "the", "MinVersion", "of", "a", "field", "breaks", "backward", "-", "compatibility", "." ]
def testUnionFieldMinVersionChange(self): self.assertNotBackwardCompatible( 'union U { string a; [MinVersion=1] string b; };', 'union U { string a; [MinVersion=2] string b; };')
[ "def", "testUnionFieldMinVersionChange", "(", "self", ")", ":", "self", ".", "assertNotBackwardCompatible", "(", "'union U { string a; [MinVersion=1] string b; };'", ",", "'union U { string a; [MinVersion=2] string b; };'", ")" ]
Changing the MinVersion of a field breaks backward-compatibility.
[ "Changing", "the", "MinVersion", "of", "a", "field", "breaks", "backward", "-", "compatibility", "." ]
[ "\"\"\"Changing the MinVersion of a field breaks backward-compatibility.\"\"\"" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
65db4dc9cf59be1d80bd4075af42af59add036d9
sunlongbo/chromium
mojo/public/tools/mojom/version_compatibility_unittest.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
testUnionFieldTypeChange
null
def testUnionFieldTypeChange(self): """If a union field's own type definition changes, the containing union is backward-compatible if and only if the field type's change is backward-compatible.""" self.assertBackwardCompatible( 'struct S {}; union U { S s; };', 'struct S { [MinVersion=1]...
If a union field's own type definition changes, the containing union is backward-compatible if and only if the field type's change is backward-compatible.
If a union field's own type definition changes, the containing union is backward-compatible if and only if the field type's change is backward-compatible.
[ "If", "a", "union", "field", "'", "s", "own", "type", "definition", "changes", "the", "containing", "union", "is", "backward", "-", "compatible", "if", "and", "only", "if", "the", "field", "type", "'", "s", "change", "is", "backward", "-", "compatible", ...
def testUnionFieldTypeChange(self): self.assertBackwardCompatible( 'struct S {}; union U { S s; };', 'struct S { [MinVersion=1] int32 x; }; union U { S s; };') self.assertBackwardCompatible( '[Extensible] enum E { kA }; union U { E e; };', '[Extensible] enum E { kA, [MinVersion=1...
[ "def", "testUnionFieldTypeChange", "(", "self", ")", ":", "self", ".", "assertBackwardCompatible", "(", "'struct S {}; union U { S s; };'", ",", "'struct S { [MinVersion=1] int32 x; }; union U { S s; };'", ")", "self", ".", "assertBackwardCompatible", "(", "'[Extensible] enum E {...
If a union field's own type definition changes, the containing union is backward-compatible if and only if the field type's change is backward-compatible.
[ "If", "a", "union", "field", "'", "s", "own", "type", "definition", "changes", "the", "containing", "union", "is", "backward", "-", "compatible", "if", "and", "only", "if", "the", "field", "type", "'", "s", "change", "is", "backward", "-", "compatible", ...
[ "\"\"\"If a union field's own type definition changes, the containing union\n is backward-compatible if and only if the field type's change is\n backward-compatible.\"\"\"" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
65db4dc9cf59be1d80bd4075af42af59add036d9
sunlongbo/chromium
mojo/public/tools/mojom/version_compatibility_unittest.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
testNewUnionFieldWithInvalidMinVersion
null
def testNewUnionFieldWithInvalidMinVersion(self): """Adding a new field using an existing MinVersion breaks backward- compatibility.""" self.assertNotBackwardCompatible( """\ union U { string a; [MinVersion=1] string b; }; """, """\ union U { ...
Adding a new field using an existing MinVersion breaks backward- compatibility.
Adding a new field using an existing MinVersion breaks backward compatibility.
[ "Adding", "a", "new", "field", "using", "an", "existing", "MinVersion", "breaks", "backward", "compatibility", "." ]
def testNewUnionFieldWithInvalidMinVersion(self): self.assertNotBackwardCompatible( """\ union U { string a; [MinVersion=1] string b; }; """, """\ union U { string a; [MinVersion=1] string b; [MinVersion=1] string c; }...
[ "def", "testNewUnionFieldWithInvalidMinVersion", "(", "self", ")", ":", "self", ".", "assertNotBackwardCompatible", "(", "\"\"\"\\\n union U {\n string a;\n [MinVersion=1] string b;\n };\n \"\"\"", ",", "\"\"\"\\\n union U {\n string a;\...
Adding a new field using an existing MinVersion breaks backward compatibility.
[ "Adding", "a", "new", "field", "using", "an", "existing", "MinVersion", "breaks", "backward", "compatibility", "." ]
[ "\"\"\"Adding a new field using an existing MinVersion breaks backward-\n compatibility.\"\"\"" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
65db4dc9cf59be1d80bd4075af42af59add036d9
sunlongbo/chromium
mojo/public/tools/mojom/version_compatibility_unittest.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
testNewUnionFieldWithValidMinVersion
null
def testNewUnionFieldWithValidMinVersion(self): """Adding a new field is safe if tagged with a MinVersion greater than any previously used MinVersion in the union.""" self.assertBackwardCompatible( 'union U { int32 a; };', 'union U { int32 a; [MinVersion=1] int32 b; };') self.assertBackw...
Adding a new field is safe if tagged with a MinVersion greater than any previously used MinVersion in the union.
Adding a new field is safe if tagged with a MinVersion greater than any previously used MinVersion in the union.
[ "Adding", "a", "new", "field", "is", "safe", "if", "tagged", "with", "a", "MinVersion", "greater", "than", "any", "previously", "used", "MinVersion", "in", "the", "union", "." ]
def testNewUnionFieldWithValidMinVersion(self): self.assertBackwardCompatible( 'union U { int32 a; };', 'union U { int32 a; [MinVersion=1] int32 b; };') self.assertBackwardCompatible( 'union U { int32 a; [MinVersion=1] int32 b; };', 'union U { int32 a; [MinVersion=1] int32 b; [Mi...
[ "def", "testNewUnionFieldWithValidMinVersion", "(", "self", ")", ":", "self", ".", "assertBackwardCompatible", "(", "'union U { int32 a; };'", ",", "'union U { int32 a; [MinVersion=1] int32 b; };'", ")", "self", ".", "assertBackwardCompatible", "(", "'union U { int32 a; [MinVersi...
Adding a new field is safe if tagged with a MinVersion greater than any previously used MinVersion in the union.
[ "Adding", "a", "new", "field", "is", "safe", "if", "tagged", "with", "a", "MinVersion", "greater", "than", "any", "previously", "used", "MinVersion", "in", "the", "union", "." ]
[ "\"\"\"Adding a new field is safe if tagged with a MinVersion greater than any\n previously used MinVersion in the union.\"\"\"" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
65db4dc9cf59be1d80bd4075af42af59add036d9
sunlongbo/chromium
mojo/public/tools/mojom/version_compatibility_unittest.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
testUnionFieldReorderWithExplicitOrdinals
null
def testUnionFieldReorderWithExplicitOrdinals(self): """Reordering fields has no effect on backward-compatibility when field ordinals are explicitly labeled and remain unchanged.""" self.assertBackwardCompatible('union U { bool b@1; int32 a@0; };', 'union U { int32 a@0; boo...
Reordering fields has no effect on backward-compatibility when field ordinals are explicitly labeled and remain unchanged.
Reordering fields has no effect on backward-compatibility when field ordinals are explicitly labeled and remain unchanged.
[ "Reordering", "fields", "has", "no", "effect", "on", "backward", "-", "compatibility", "when", "field", "ordinals", "are", "explicitly", "labeled", "and", "remain", "unchanged", "." ]
def testUnionFieldReorderWithExplicitOrdinals(self): self.assertBackwardCompatible('union U { bool b@1; int32 a@0; };', 'union U { int32 a@0; bool b@1; };')
[ "def", "testUnionFieldReorderWithExplicitOrdinals", "(", "self", ")", ":", "self", ".", "assertBackwardCompatible", "(", "'union U { bool b@1; int32 a@0; };'", ",", "'union U { int32 a@0; bool b@1; };'", ")" ]
Reordering fields has no effect on backward-compatibility when field ordinals are explicitly labeled and remain unchanged.
[ "Reordering", "fields", "has", "no", "effect", "on", "backward", "-", "compatibility", "when", "field", "ordinals", "are", "explicitly", "labeled", "and", "remain", "unchanged", "." ]
[ "\"\"\"Reordering fields has no effect on backward-compatibility when field\n ordinals are explicitly labeled and remain unchanged.\"\"\"" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
65db4dc9cf59be1d80bd4075af42af59add036d9
sunlongbo/chromium
mojo/public/tools/mojom/version_compatibility_unittest.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
testNewInterfaceMethodUnversioned
null
def testNewInterfaceMethodUnversioned(self): """Adding a new method to an interface without a new (i.e. higher than any existing version) [MinVersion] tag breaks backward-compatibility.""" self.assertNotBackwardCompatible('interface F { A(); };', 'interface F { A(); B();...
Adding a new method to an interface without a new (i.e. higher than any existing version) [MinVersion] tag breaks backward-compatibility.
Adding a new method to an interface without a new [MinVersion] tag breaks backward-compatibility.
[ "Adding", "a", "new", "method", "to", "an", "interface", "without", "a", "new", "[", "MinVersion", "]", "tag", "breaks", "backward", "-", "compatibility", "." ]
def testNewInterfaceMethodUnversioned(self): self.assertNotBackwardCompatible('interface F { A(); };', 'interface F { A(); B(); };')
[ "def", "testNewInterfaceMethodUnversioned", "(", "self", ")", ":", "self", ".", "assertNotBackwardCompatible", "(", "'interface F { A(); };'", ",", "'interface F { A(); B(); };'", ")" ]
Adding a new method to an interface without a new (i.e.
[ "Adding", "a", "new", "method", "to", "an", "interface", "without", "a", "new", "(", "i", ".", "e", "." ]
[ "\"\"\"Adding a new method to an interface without a new (i.e. higher than any\n existing version) [MinVersion] tag breaks backward-compatibility.\"\"\"" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
65db4dc9cf59be1d80bd4075af42af59add036d9
sunlongbo/chromium
mojo/public/tools/mojom/version_compatibility_unittest.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
testInterfaceMethodParamsChanged
null
def testInterfaceMethodParamsChanged(self): """Changes to the parameter list are only backward-compatible if they meet backward-compatibility requirements of an equivalent struct definition.""" self.assertNotBackwardCompatible('interface F { A(); };', 'interface F { A(in...
Changes to the parameter list are only backward-compatible if they meet backward-compatibility requirements of an equivalent struct definition.
Changes to the parameter list are only backward-compatible if they meet backward-compatibility requirements of an equivalent struct definition.
[ "Changes", "to", "the", "parameter", "list", "are", "only", "backward", "-", "compatible", "if", "they", "meet", "backward", "-", "compatibility", "requirements", "of", "an", "equivalent", "struct", "definition", "." ]
def testInterfaceMethodParamsChanged(self): self.assertNotBackwardCompatible('interface F { A(); };', 'interface F { A(int32 x); };') self.assertNotBackwardCompatible('interface F { A(int32 x); };', 'interface F { A(bool x); };') self...
[ "def", "testInterfaceMethodParamsChanged", "(", "self", ")", ":", "self", ".", "assertNotBackwardCompatible", "(", "'interface F { A(); };'", ",", "'interface F { A(int32 x); };'", ")", "self", ".", "assertNotBackwardCompatible", "(", "'interface F { A(int32 x); };'", ",", "'...
Changes to the parameter list are only backward-compatible if they meet backward-compatibility requirements of an equivalent struct definition.
[ "Changes", "to", "the", "parameter", "list", "are", "only", "backward", "-", "compatible", "if", "they", "meet", "backward", "-", "compatibility", "requirements", "of", "an", "equivalent", "struct", "definition", "." ]
[ "\"\"\"Changes to the parameter list are only backward-compatible if they meet\n backward-compatibility requirements of an equivalent struct definition.\"\"\"" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
65db4dc9cf59be1d80bd4075af42af59add036d9
sunlongbo/chromium
mojo/public/tools/mojom/version_compatibility_unittest.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
testInterfaceMethodReplyParamsChanged
null
def testInterfaceMethodReplyParamsChanged(self): """Similar to request parameters, a change to reply parameters is considered backward-compatible if it meets the same backward-compatibility requirements imposed on equivalent struct changes.""" self.assertNotBackwardCompatible('interface F { A() => (); }...
Similar to request parameters, a change to reply parameters is considered backward-compatible if it meets the same backward-compatibility requirements imposed on equivalent struct changes.
Similar to request parameters, a change to reply parameters is considered backward-compatible if it meets the same backward-compatibility requirements imposed on equivalent struct changes.
[ "Similar", "to", "request", "parameters", "a", "change", "to", "reply", "parameters", "is", "considered", "backward", "-", "compatible", "if", "it", "meets", "the", "same", "backward", "-", "compatibility", "requirements", "imposed", "on", "equivalent", "struct", ...
def testInterfaceMethodReplyParamsChanged(self): self.assertNotBackwardCompatible('interface F { A() => (); };', 'interface F { A() => (int32 x); };') self.assertNotBackwardCompatible('interface F { A() => (int32 x); };', 'interface F { A...
[ "def", "testInterfaceMethodReplyParamsChanged", "(", "self", ")", ":", "self", ".", "assertNotBackwardCompatible", "(", "'interface F { A() => (); };'", ",", "'interface F { A() => (int32 x); };'", ")", "self", ".", "assertNotBackwardCompatible", "(", "'interface F { A() => (int3...
Similar to request parameters, a change to reply parameters is considered backward-compatible if it meets the same backward-compatibility requirements imposed on equivalent struct changes.
[ "Similar", "to", "request", "parameters", "a", "change", "to", "reply", "parameters", "is", "considered", "backward", "-", "compatible", "if", "it", "meets", "the", "same", "backward", "-", "compatibility", "requirements", "imposed", "on", "equivalent", "struct", ...
[ "\"\"\"Similar to request parameters, a change to reply parameters is considered\n backward-compatible if it meets the same backward-compatibility\n requirements imposed on equivalent struct changes.\"\"\"" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
65db4dc9cf59be1d80bd4075af42af59add036d9
sunlongbo/chromium
mojo/public/tools/mojom/version_compatibility_unittest.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
testNewInterfaceMethodWithInvalidMinVersion
null
def testNewInterfaceMethodWithInvalidMinVersion(self): """Adding a new method to an existing version is not backward-compatible.""" self.assertNotBackwardCompatible( """\ interface F { A(); [MinVersion=1] B(); }; """, """\ interface F { A(); ...
Adding a new method to an existing version is not backward-compatible.
Adding a new method to an existing version is not backward-compatible.
[ "Adding", "a", "new", "method", "to", "an", "existing", "version", "is", "not", "backward", "-", "compatible", "." ]
def testNewInterfaceMethodWithInvalidMinVersion(self): self.assertNotBackwardCompatible( """\ interface F { A(); [MinVersion=1] B(); }; """, """\ interface F { A(); [MinVersion=1] B(); [MinVersion=1] C(); }; ""...
[ "def", "testNewInterfaceMethodWithInvalidMinVersion", "(", "self", ")", ":", "self", ".", "assertNotBackwardCompatible", "(", "\"\"\"\\\n interface F {\n A();\n [MinVersion=1] B();\n };\n \"\"\"", ",", "\"\"\"\\\n interface F {\n A();\n ...
Adding a new method to an existing version is not backward-compatible.
[ "Adding", "a", "new", "method", "to", "an", "existing", "version", "is", "not", "backward", "-", "compatible", "." ]
[ "\"\"\"Adding a new method to an existing version is not backward-compatible.\"\"\"" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
65db4dc9cf59be1d80bd4075af42af59add036d9
sunlongbo/chromium
mojo/public/tools/mojom/version_compatibility_unittest.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
testNewInterfaceMethodWithValidMinVersion
null
def testNewInterfaceMethodWithValidMinVersion(self): """Adding a new method is fine as long as its MinVersion exceeds that of any method on the old interface definition.""" self.assertBackwardCompatible('interface F { A(); };', 'interface F { A(); [MinVersion=1] B(); };')
Adding a new method is fine as long as its MinVersion exceeds that of any method on the old interface definition.
Adding a new method is fine as long as its MinVersion exceeds that of any method on the old interface definition.
[ "Adding", "a", "new", "method", "is", "fine", "as", "long", "as", "its", "MinVersion", "exceeds", "that", "of", "any", "method", "on", "the", "old", "interface", "definition", "." ]
def testNewInterfaceMethodWithValidMinVersion(self): self.assertBackwardCompatible('interface F { A(); };', 'interface F { A(); [MinVersion=1] B(); };')
[ "def", "testNewInterfaceMethodWithValidMinVersion", "(", "self", ")", ":", "self", ".", "assertBackwardCompatible", "(", "'interface F { A(); };'", ",", "'interface F { A(); [MinVersion=1] B(); };'", ")" ]
Adding a new method is fine as long as its MinVersion exceeds that of any method on the old interface definition.
[ "Adding", "a", "new", "method", "is", "fine", "as", "long", "as", "its", "MinVersion", "exceeds", "that", "of", "any", "method", "on", "the", "old", "interface", "definition", "." ]
[ "\"\"\"Adding a new method is fine as long as its MinVersion exceeds that of any\n method on the old interface definition.\"\"\"" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
65e6f0fec812edbf1faf6f503f85b66aac394821
sunlongbo/chromium
tools/perf/cli_tools/tbmv3/validate_tbmv3_metric.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
CursorErase
null
def CursorErase(length): """Erase |length| chars starting from cursor.""" for _ in range(length): sys.stdout.write('\b') # Add 80 spaces, because \b only moves back the cursor. for _ in range(80): sys.stdout.write(' ') for _ in range(80): sys.stdout.write('\b') sys.stdout.flush()
Erase |length| chars starting from cursor.
Erase |length| chars starting from cursor.
[ "Erase", "|length|", "chars", "starting", "from", "cursor", "." ]
def CursorErase(length): for _ in range(length): sys.stdout.write('\b') for _ in range(80): sys.stdout.write(' ') for _ in range(80): sys.stdout.write('\b') sys.stdout.flush()
[ "def", "CursorErase", "(", "length", ")", ":", "for", "_", "in", "range", "(", "length", ")", ":", "sys", ".", "stdout", ".", "write", "(", "'\\b'", ")", "for", "_", "in", "range", "(", "80", ")", ":", "sys", ".", "stdout", ".", "write", "(", "...
Erase |length| chars starting from cursor.
[ "Erase", "|length|", "chars", "starting", "from", "cursor", "." ]
[ "\"\"\"Erase |length| chars starting from cursor.\"\"\"", "# Add 80 spaces, because \\b only moves back the cursor." ]
[ { "param": "length", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "length", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
a57cf89aa74f04b5dacf93d34dd9cdb8bf37c4c4
sunlongbo/chromium
tools/sublime/compile_current_file.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
draw_panel_text
null
def draw_panel_text(self): """Draw in the output.exec panel the text accumulated in self.text_to_draw. This must be called from the main UI thread (e.g., using set_timeout). """ assert self.thread_id == threading.current_thread().ident logging.debug("draw_panel_text called.") self.lock.acquire(...
Draw in the output.exec panel the text accumulated in self.text_to_draw. This must be called from the main UI thread (e.g., using set_timeout).
Draw in the output.exec panel the text accumulated in self.text_to_draw. This must be called from the main UI thread .
[ "Draw", "in", "the", "output", ".", "exec", "panel", "the", "text", "accumulated", "in", "self", ".", "text_to_draw", ".", "This", "must", "be", "called", "from", "the", "main", "UI", "thread", "." ]
def draw_panel_text(self): assert self.thread_id == threading.current_thread().ident logging.debug("draw_panel_text called.") self.lock.acquire() text_to_draw = self.text_to_draw self.text_to_draw = "" self.lock.release() if len(text_to_draw): self.output_panel.run_command('print_outpu...
[ "def", "draw_panel_text", "(", "self", ")", ":", "assert", "self", ".", "thread_id", "==", "threading", ".", "current_thread", "(", ")", ".", "ident", "logging", ".", "debug", "(", "\"draw_panel_text called.\"", ")", "self", ".", "lock", ".", "acquire", "(",...
Draw in the output.exec panel the text accumulated in self.text_to_draw.
[ "Draw", "in", "the", "output", ".", "exec", "panel", "the", "text", "accumulated", "in", "self", ".", "text_to_draw", "." ]
[ "\"\"\"Draw in the output.exec panel the text accumulated in self.text_to_draw.\n\n This must be called from the main UI thread (e.g., using set_timeout).\n \"\"\"" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
a57cf89aa74f04b5dacf93d34dd9cdb8bf37c4c4
sunlongbo/chromium
tools/sublime/compile_current_file.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
execute_command
<not_specific>
def execute_command(self, command, cwd): """Execute the provided command and send ouput to panel. Because the implementation of subprocess can deadlock on windows, we use a Queue that we write to from another thread to avoid blocking on IO. Args: command: A list containing the command to execute...
Execute the provided command and send ouput to panel. Because the implementation of subprocess can deadlock on windows, we use a Queue that we write to from another thread to avoid blocking on IO. Args: command: A list containing the command to execute and it's arguments. Returns: The exit...
Execute the provided command and send ouput to panel. Because the implementation of subprocess can deadlock on windows, we use a Queue that we write to from another thread to avoid blocking on IO.
[ "Execute", "the", "provided", "command", "and", "send", "ouput", "to", "panel", ".", "Because", "the", "implementation", "of", "subprocess", "can", "deadlock", "on", "windows", "we", "use", "a", "Queue", "that", "we", "write", "to", "from", "another", "threa...
def execute_command(self, command, cwd): logging.debug("Running command: %s", command) def EnqueueOutput(out, queue): while True: data = out.readline() if not data: break queue.put(data, block=True) out.close() try: os.chdir(cwd) proc = subprocess.Po...
[ "def", "execute_command", "(", "self", ",", "command", ",", "cwd", ")", ":", "logging", ".", "debug", "(", "\"Running command: %s\"", ",", "command", ")", "def", "EnqueueOutput", "(", "out", ",", "queue", ")", ":", "\"\"\"Read all the output from the given handle ...
Execute the provided command and send ouput to panel.
[ "Execute", "the", "provided", "command", "and", "send", "ouput", "to", "panel", "." ]
[ "\"\"\"Execute the provided command and send ouput to panel.\n\n Because the implementation of subprocess can deadlock on windows, we use\n a Queue that we write to from another thread to avoid blocking on IO.\n\n Args:\n command: A list containing the command to execute and it's arguments.\n Retur...
[ { "param": "self", "type": null }, { "param": "command", "type": null }, { "param": "cwd", "type": null } ]
{ "returns": [ { "docstring": "The exit code of the process running the command or,\n1 if we got interrupted.\n1 if we couldn't start the process\n2 if we couldn't poll the running process", "docstring_tokens": [ "The", "exit", "code", "of", "the", "proc...
a57cf89aa74f04b5dacf93d34dd9cdb8bf37c4c4
sunlongbo/chromium
tools/sublime/compile_current_file.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
EnqueueOutput
null
def EnqueueOutput(out, queue): """Read all the output from the given handle and insert it into the queue. Args: queue: The Queue object to write to. """ while True: # This readline will block until there is either new input or the handle # is closed. Readline will only r...
Read all the output from the given handle and insert it into the queue. Args: queue: The Queue object to write to.
Read all the output from the given handle and insert it into the queue.
[ "Read", "all", "the", "output", "from", "the", "given", "handle", "and", "insert", "it", "into", "the", "queue", "." ]
def EnqueueOutput(out, queue): while True: data = out.readline() if not data: break queue.put(data, block=True) out.close()
[ "def", "EnqueueOutput", "(", "out", ",", "queue", ")", ":", "while", "True", ":", "data", "=", "out", ".", "readline", "(", ")", "if", "not", "data", ":", "break", "queue", ".", "put", "(", "data", ",", "block", "=", "True", ")", "out", ".", "clo...
Read all the output from the given handle and insert it into the queue.
[ "Read", "all", "the", "output", "from", "the", "given", "handle", "and", "insert", "it", "into", "the", "queue", "." ]
[ "\"\"\"Read all the output from the given handle and insert it into the queue.\n\n Args:\n queue: The Queue object to write to.\n \"\"\"", "# This readline will block until there is either new input or the handle", "# is closed. Readline will only return None once the handle is close, so", "#...
[ { "param": "out", "type": null }, { "param": "queue", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "out", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "queue", "type": null, "docstring": "The Queue object to write to.", ...