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
5e8de89409976528f8d97d4962f9f111c6d158a1
sunlongbo/chromium
third_party/blink/renderer/bindings/scripts/web_idl/composition_parts.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
all_locations
<not_specific>
def all_locations(self): """ Returns a list of locations of all related IDL definitions, including partial definitions and mixins. """ return tuple(self._locations)
Returns a list of locations of all related IDL definitions, including partial definitions and mixins.
Returns a list of locations of all related IDL definitions, including partial definitions and mixins.
[ "Returns", "a", "list", "of", "locations", "of", "all", "related", "IDL", "definitions", "including", "partial", "definitions", "and", "mixins", "." ]
def all_locations(self): return tuple(self._locations)
[ "def", "all_locations", "(", "self", ")", ":", "return", "tuple", "(", "self", ".", "_locations", ")" ]
Returns a list of locations of all related IDL definitions, including partial definitions and mixins.
[ "Returns", "a", "list", "of", "locations", "of", "all", "related", "IDL", "definitions", "including", "partial", "definitions", "and", "mixins", "." ]
[ "\"\"\"\n Returns a list of locations of all related IDL definitions, including\n partial definitions and mixins.\n \"\"\"" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
5e8de89409976528f8d97d4962f9f111c6d158a1
sunlongbo/chromium
third_party/blink/renderer/bindings/scripts/web_idl/composition_parts.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
owner_mixin
<not_specific>
def owner_mixin(self): """ Returns the interface mixin object where this construct was originally defined. """ return self._owner_mixin.target_object if self._owner_mixin else None
Returns the interface mixin object where this construct was originally defined.
Returns the interface mixin object where this construct was originally defined.
[ "Returns", "the", "interface", "mixin", "object", "where", "this", "construct", "was", "originally", "defined", "." ]
def owner_mixin(self): return self._owner_mixin.target_object if self._owner_mixin else None
[ "def", "owner_mixin", "(", "self", ")", ":", "return", "self", ".", "_owner_mixin", ".", "target_object", "if", "self", ".", "_owner_mixin", "else", "None" ]
Returns the interface mixin object where this construct was originally defined.
[ "Returns", "the", "interface", "mixin", "object", "where", "this", "construct", "was", "originally", "defined", "." ]
[ "\"\"\"\n Returns the interface mixin object where this construct was originally\n defined.\n \"\"\"" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
0af9de8b4d16dc67b2e5705807fdee964352e40f
sunlongbo/chromium
third_party/blink/renderer/build/scripts/make_document_policy_features_util.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
parse_default_value
<not_specific>
def parse_default_value(default_value, value_type, recognized_types=('Bool', 'DecDouble')): """ Parses default_value string to actual usable C++ expression. @param default_value_str: default_value field specified in document_policy_features.json5 @param value_...
Parses default_value string to actual usable C++ expression. @param default_value_str: default_value field specified in document_policy_features.json5 @param value_type: value_type field specified in document_policy_features.json5 @param recognized_types: types that are valid for value_type @returns: a...
Parses default_value string to actual usable C++ expression.
[ "Parses", "default_value", "string", "to", "actual", "usable", "C", "++", "expression", "." ]
def parse_default_value(default_value, value_type, recognized_types=('Bool', 'DecDouble')): if (value_type not in recognized_types): raise ValueError("{} is not recognized as valid value_type({})".format( value_type, recognized_types)) policy_v...
[ "def", "parse_default_value", "(", "default_value", ",", "value_type", ",", "recognized_types", "=", "(", "'Bool'", ",", "'DecDouble'", ")", ")", ":", "if", "(", "value_type", "not", "in", "recognized_types", ")", ":", "raise", "ValueError", "(", "\"{} is not re...
Parses default_value string to actual usable C++ expression.
[ "Parses", "default_value", "string", "to", "actual", "usable", "C", "++", "expression", "." ]
[ "\"\"\" Parses default_value string to actual usable C++ expression.\n @param default_value_str: default_value field specified in document_policy_features.json5\n @param value_type: value_type field specified in document_policy_features.json5\n @param recognized_types: types that are valid for value_type\n...
[ { "param": "default_value", "type": null }, { "param": "value_type", "type": null }, { "param": "recognized_types", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "default_value", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "value_type", "type": null, "docstring": "value_type field ...
b71e7feb8fb9d56a8f45a9331d985a2b94eff661
sunlongbo/chromium
tools/metrics/histograms/histogram_ownership.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
main
null
def main(): """Prints the owners of histograms in a specific file or of all histograms. Args: argv[1]: Optional argument that is the relative path to a specific histograms.xml. Example usage to print owners of metadata/Accessibility/histograms.xml: python histogram_ownership.py metadata/Accessib...
Prints the owners of histograms in a specific file or of all histograms. Args: argv[1]: Optional argument that is the relative path to a specific histograms.xml. Example usage to print owners of metadata/Accessibility/histograms.xml: python histogram_ownership.py metadata/Accessibility/histograms....
Prints the owners of histograms in a specific file or of all histograms.
[ "Prints", "the", "owners", "of", "histograms", "in", "a", "specific", "file", "or", "of", "all", "histograms", "." ]
def main(): if len(sys.argv) == 1: merged_xml_string = merge_xml.MergeFiles( histogram_paths.ALL_XMLS, should_expand_owners=True).toxml() root = ET.fromstring(merged_xml_string) else: rel_path = path_util.GetInputFile( os.path.join('tools', 'metrics', 'histograms', sys.argv[1])) if n...
[ "def", "main", "(", ")", ":", "if", "len", "(", "sys", ".", "argv", ")", "==", "1", ":", "merged_xml_string", "=", "merge_xml", ".", "MergeFiles", "(", "histogram_paths", ".", "ALL_XMLS", ",", "should_expand_owners", "=", "True", ")", ".", "toxml", "(", ...
Prints the owners of histograms in a specific file or of all histograms.
[ "Prints", "the", "owners", "of", "histograms", "in", "a", "specific", "file", "or", "of", "all", "histograms", "." ]
[ "\"\"\"Prints the owners of histograms in a specific file or of all histograms.\n\n Args:\n argv[1]: Optional argument that is the relative path to a specific\n histograms.xml.\n\n Example usage to print owners of metadata/Accessibility/histograms.xml:\n python histogram_ownership.py metadata/Accessi...
[]
{ "returns": [], "raises": [], "params": [], "outlier_params": [ { "identifier": "argv[1]", "type": null, "docstring": "Optional argument that is the relative path to a specific\nhistograms.xml.", "docstring_tokens": [ "Optional", "argument", "that", "...
43ec3f6d180efbc21fb7e9b8f0de80cc4f4eb8d0
sunlongbo/chromium
tools/translation/helper/sanity_check.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
list_files_in_repository
<not_specific>
def list_files_in_repository(repo_path, pattern): """Lists all files matching given pattern in the given git repository""" # This works because git does its own glob expansion even though there is no # shell to do it. output = subprocess.check_output([GIT, 'ls-files', '--', pattern], ...
Lists all files matching given pattern in the given git repository
Lists all files matching given pattern in the given git repository
[ "Lists", "all", "files", "matching", "given", "pattern", "in", "the", "given", "git", "repository" ]
def list_files_in_repository(repo_path, pattern): output = subprocess.check_output([GIT, 'ls-files', '--', pattern], cwd=repo_path).decode('utf-8') return output.strip().splitlines()
[ "def", "list_files_in_repository", "(", "repo_path", ",", "pattern", ")", ":", "output", "=", "subprocess", ".", "check_output", "(", "[", "GIT", ",", "'ls-files'", ",", "'--'", ",", "pattern", "]", ",", "cwd", "=", "repo_path", ")", ".", "decode", "(", ...
Lists all files matching given pattern in the given git repository
[ "Lists", "all", "files", "matching", "given", "pattern", "in", "the", "given", "git", "repository" ]
[ "\"\"\"Lists all files matching given pattern in the given git repository\"\"\"", "# This works because git does its own glob expansion even though there is no", "# shell to do it." ]
[ { "param": "repo_path", "type": null }, { "param": "pattern", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "repo_path", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "pattern", "type": null, "docstring": null, "docstring_to...
de05ded0fa8d86bb22a9e8b79cb798a2ed0ac25d
sunlongbo/chromium
chrome/app/theme/PRESUBMIT.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
_CommonChecks
<not_specific>
def _CommonChecks(input_api, output_api): """Checks common to both upload and commit.""" results = [] resources = input_api.os_path.join(input_api.PresubmitLocalPath(), '../../../ui/resources') # List of paths with their associated scale factor. This is used to verify # that the images modified in one ...
Checks common to both upload and commit.
Checks common to both upload and commit.
[ "Checks", "common", "to", "both", "upload", "and", "commit", "." ]
def _CommonChecks(input_api, output_api): results = [] resources = input_api.os_path.join(input_api.PresubmitLocalPath(), '../../../ui/resources') path_scales = [ [(100, 'default_100_percent/'), (200, 'default_200_percent/')], ] import sys old_path = sys.path try: sys.path = [resources] + ol...
[ "def", "_CommonChecks", "(", "input_api", ",", "output_api", ")", ":", "results", "=", "[", "]", "resources", "=", "input_api", ".", "os_path", ".", "join", "(", "input_api", ".", "PresubmitLocalPath", "(", ")", ",", "'../../../ui/resources'", ")", "path_scale...
Checks common to both upload and commit.
[ "Checks", "common", "to", "both", "upload", "and", "commit", "." ]
[ "\"\"\"Checks common to both upload and commit.\"\"\"", "# List of paths with their associated scale factor. This is used to verify", "# that the images modified in one are the correct scale of the other." ]
[ { "param": "input_api", "type": null }, { "param": "output_api", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "input_api", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "output_api", "type": null, "docstring": null, "docstring...
de0e018a0d474165c85317ef3a79fe1ae9b60a62
sunlongbo/chromium
third_party/blink/tools/blinkpy/w3c/export_notifier.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
main
<not_specific>
def main(self): """Surfaces relevant Taskcluster check failures to Gerrit through comments.""" gerrit_dict = {} try: _log.info('Searching for recent failiing chromium exports.') prs = self.wpt_github.recent_failing_chromium_exports() except GitHubError as e: ...
Surfaces relevant Taskcluster check failures to Gerrit through comments.
Surfaces relevant Taskcluster check failures to Gerrit through comments.
[ "Surfaces", "relevant", "Taskcluster", "check", "failures", "to", "Gerrit", "through", "comments", "." ]
def main(self): gerrit_dict = {} try: _log.info('Searching for recent failiing chromium exports.') prs = self.wpt_github.recent_failing_chromium_exports() except GitHubError as e: _log.info( 'Surfacing Taskcluster failures cannot be completed d...
[ "def", "main", "(", "self", ")", ":", "gerrit_dict", "=", "{", "}", "try", ":", "_log", ".", "info", "(", "'Searching for recent failiing chromium exports.'", ")", "prs", "=", "self", ".", "wpt_github", ".", "recent_failing_chromium_exports", "(", ")", "except",...
Surfaces relevant Taskcluster check failures to Gerrit through comments.
[ "Surfaces", "relevant", "Taskcluster", "check", "failures", "to", "Gerrit", "through", "comments", "." ]
[ "\"\"\"Surfaces relevant Taskcluster check failures to Gerrit through comments.\"\"\"" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
de0e018a0d474165c85317ef3a79fe1ae9b60a62
sunlongbo/chromium
third_party/blink/tools/blinkpy/w3c/export_notifier.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
process_failing_prs
null
def process_failing_prs(self, gerrit_dict): """Processes and comments on CLs with failed Tackcluster checks.""" _log.info('Processing %d CLs with failed Taskcluster checks.', len(gerrit_dict)) for change_id, pr_status_info in gerrit_dict.items(): _log.info('Change-I...
Processes and comments on CLs with failed Tackcluster checks.
Processes and comments on CLs with failed Tackcluster checks.
[ "Processes", "and", "comments", "on", "CLs", "with", "failed", "Tackcluster", "checks", "." ]
def process_failing_prs(self, gerrit_dict): _log.info('Processing %d CLs with failed Taskcluster checks.', len(gerrit_dict)) for change_id, pr_status_info in gerrit_dict.items(): _log.info('Change-Id: %s', change_id) try: cl = self.gerrit.query_c...
[ "def", "process_failing_prs", "(", "self", ",", "gerrit_dict", ")", ":", "_log", ".", "info", "(", "'Processing %d CLs with failed Taskcluster checks.'", ",", "len", "(", "gerrit_dict", ")", ")", "for", "change_id", ",", "pr_status_info", "in", "gerrit_dict", ".", ...
Processes and comments on CLs with failed Tackcluster checks.
[ "Processes", "and", "comments", "on", "CLs", "with", "failed", "Tackcluster", "checks", "." ]
[ "\"\"\"Processes and comments on CLs with failed Tackcluster checks.\"\"\"" ]
[ { "param": "self", "type": null }, { "param": "gerrit_dict", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "gerrit_dict", "type": null, "docstring": null, "docstring_tok...
5e163ef12ee17c151ed9770f7710baf36a5a84d1
sunlongbo/chromium
tools/mac/download_symbols.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
download_chrome_symbols
<not_specific>
def download_chrome_symbols(version, channel, arch, dest_dir): """Downloads and extracts the official Google Chrome dSYM files to a subdirectory of `dest_dir`. Args: version: The version to download symbols for. channel: The release channel to download symbols for. If None, attempts ...
Downloads and extracts the official Google Chrome dSYM files to a subdirectory of `dest_dir`. Args: version: The version to download symbols for. channel: The release channel to download symbols for. If None, attempts to guess the channel. arch: The CPU architecture to ...
Downloads and extracts the official Google Chrome dSYM files to a subdirectory of `dest_dir`.
[ "Downloads", "and", "extracts", "the", "official", "Google", "Chrome", "dSYM", "files", "to", "a", "subdirectory", "of", "`", "dest_dir", "`", "." ]
def download_chrome_symbols(version, channel, arch, dest_dir): if channel is None: channel = _identify_channel(version, arch) if channel: print('Using release channel {} for {}'.format(channel, version), file=sys.stderr) else: print('Could not identi...
[ "def", "download_chrome_symbols", "(", "version", ",", "channel", ",", "arch", ",", "dest_dir", ")", ":", "if", "channel", "is", "None", ":", "channel", "=", "_identify_channel", "(", "version", ",", "arch", ")", "if", "channel", ":", "print", "(", "'Using...
Downloads and extracts the official Google Chrome dSYM files to a subdirectory of `dest_dir`.
[ "Downloads", "and", "extracts", "the", "official", "Google", "Chrome", "dSYM", "files", "to", "a", "subdirectory", "of", "`", "dest_dir", "`", "." ]
[ "\"\"\"Downloads and extracts the official Google Chrome dSYM files to a\n subdirectory of `dest_dir`.\n\n Args:\n version: The version to download symbols for.\n channel: The release channel to download symbols for. If None, attempts\n to guess the channel.\n arch: The CP...
[ { "param": "version", "type": null }, { "param": "channel", "type": null }, { "param": "arch", "type": null }, { "param": "dest_dir", "type": null } ]
{ "returns": [ { "docstring": "The path to the directory containing the dSYMs, which will be a\nsubdirectory of `dest_dir`.", "docstring_tokens": [ "The", "path", "to", "the", "directory", "containing", "the", "dSYMs", "which", ...
5e163ef12ee17c151ed9770f7710baf36a5a84d1
sunlongbo/chromium
tools/mac/download_symbols.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
_identify_channel
<not_specific>
def _identify_channel(version, arch): """Attempts to guess the release channel given a Chrome version and CPU architecture.""" # First try querying OmahaProxy for the release. with request.urlopen(_OMAHAPROXY_HISTORY) as release_history: history = csv.DictReader( release_history.read...
Attempts to guess the release channel given a Chrome version and CPU architecture.
Attempts to guess the release channel given a Chrome version and CPU architecture.
[ "Attempts", "to", "guess", "the", "release", "channel", "given", "a", "Chrome", "version", "and", "CPU", "architecture", "." ]
def _identify_channel(version, arch): with request.urlopen(_OMAHAPROXY_HISTORY) as release_history: history = csv.DictReader( release_history.read().decode('utf8').split('\n')) for row in history: if row['version'] == version: return row['channel'] print( ...
[ "def", "_identify_channel", "(", "version", ",", "arch", ")", ":", "with", "request", ".", "urlopen", "(", "_OMAHAPROXY_HISTORY", ")", "as", "release_history", ":", "history", "=", "csv", ".", "DictReader", "(", "release_history", ".", "read", "(", ")", ".",...
Attempts to guess the release channel given a Chrome version and CPU architecture.
[ "Attempts", "to", "guess", "the", "release", "channel", "given", "a", "Chrome", "version", "and", "CPU", "architecture", "." ]
[ "\"\"\"Attempts to guess the release channel given a Chrome version and CPU\n architecture.\"\"\"", "# First try querying OmahaProxy for the release.", "# Fall back to sending HEAD HTTP requests to each of the possible symbol", "# locations." ]
[ { "param": "version", "type": null }, { "param": "arch", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "version", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "arch", "type": null, "docstring": null, "docstring_tokens"...
5e163ef12ee17c151ed9770f7710baf36a5a84d1
sunlongbo/chromium
tools/mac/download_symbols.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
_get_url_and_dest
<not_specific>
def _get_url_and_dest(version, channel, arch, dest_dir): """Returns a the symbol archive URL and local destination directory given the format parameters.""" args = {'channel': channel, 'arch': arch, 'version': version} url = _DSYM_URL_TEMPLATE.format(**args) dest_dir = os.path.join(dest_dir, ...
Returns a the symbol archive URL and local destination directory given the format parameters.
Returns a the symbol archive URL and local destination directory given the format parameters.
[ "Returns", "a", "the", "symbol", "archive", "URL", "and", "local", "destination", "directory", "given", "the", "format", "parameters", "." ]
def _get_url_and_dest(version, channel, arch, dest_dir): args = {'channel': channel, 'arch': arch, 'version': version} url = _DSYM_URL_TEMPLATE.format(**args) dest_dir = os.path.join(dest_dir, 'googlechrome-{version}-{arch}-dsym'.format(**args)) return url, dest_dir
[ "def", "_get_url_and_dest", "(", "version", ",", "channel", ",", "arch", ",", "dest_dir", ")", ":", "args", "=", "{", "'channel'", ":", "channel", ",", "'arch'", ":", "arch", ",", "'version'", ":", "version", "}", "url", "=", "_DSYM_URL_TEMPLATE", ".", "...
Returns a the symbol archive URL and local destination directory given the format parameters.
[ "Returns", "a", "the", "symbol", "archive", "URL", "and", "local", "destination", "directory", "given", "the", "format", "parameters", "." ]
[ "\"\"\"Returns a the symbol archive URL and local destination directory given\n the format parameters.\"\"\"" ]
[ { "param": "version", "type": null }, { "param": "channel", "type": null }, { "param": "arch", "type": null }, { "param": "dest_dir", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "version", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "channel", "type": null, "docstring": null, "docstring_toke...
5e163ef12ee17c151ed9770f7710baf36a5a84d1
sunlongbo/chromium
tools/mac/download_symbols.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
_download_and_extract
<not_specific>
def _download_and_extract(version, channel, arch, dest_dir): """Performs the download and extraction of the symbol files. Returns the path to the extracted symbol files on success, None on error. """ url, dest_dir = _get_url_and_dest(version, channel, arch, dest_dir) remove_on_failure = False if...
Performs the download and extraction of the symbol files. Returns the path to the extracted symbol files on success, None on error.
Performs the download and extraction of the symbol files. Returns the path to the extracted symbol files on success, None on error.
[ "Performs", "the", "download", "and", "extraction", "of", "the", "symbol", "files", ".", "Returns", "the", "path", "to", "the", "extracted", "symbol", "files", "on", "success", "None", "on", "error", "." ]
def _download_and_extract(version, channel, arch, dest_dir): url, dest_dir = _get_url_and_dest(version, channel, arch, dest_dir) remove_on_failure = False if not os.path.isdir(dest_dir): os.mkdir(dest_dir) remove_on_failure = True try: with request.urlopen(url) as symbol_request:...
[ "def", "_download_and_extract", "(", "version", ",", "channel", ",", "arch", ",", "dest_dir", ")", ":", "url", ",", "dest_dir", "=", "_get_url_and_dest", "(", "version", ",", "channel", ",", "arch", ",", "dest_dir", ")", "remove_on_failure", "=", "False", "i...
Performs the download and extraction of the symbol files.
[ "Performs", "the", "download", "and", "extraction", "of", "the", "symbol", "files", "." ]
[ "\"\"\"Performs the download and extraction of the symbol files. Returns the\n path to the extracted symbol files on success, None on error.\n \"\"\"" ]
[ { "param": "version", "type": null }, { "param": "channel", "type": null }, { "param": "arch", "type": null }, { "param": "dest_dir", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "version", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "channel", "type": null, "docstring": null, "docstring_toke...
5e163ef12ee17c151ed9770f7710baf36a5a84d1
sunlongbo/chromium
tools/mac/download_symbols.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
_extract_symbols_to
<not_specific>
def _extract_symbols_to(symbol_request, dest_dir): """Performs a streaming extract of the symbol files. Args: symbol_request: The HTTPResponse object for the symbol URL. dest_dir: The destination directory into which the files will be extracted. Returns: True on successfu...
Performs a streaming extract of the symbol files. Args: symbol_request: The HTTPResponse object for the symbol URL. dest_dir: The destination directory into which the files will be extracted. Returns: True on successful download and extraction, False on error.
Performs a streaming extract of the symbol files.
[ "Performs", "a", "streaming", "extract", "of", "the", "symbol", "files", "." ]
def _extract_symbols_to(symbol_request, dest_dir): proc = subprocess.Popen(['tar', 'xjf', '-'], cwd=dest_dir, stdin=subprocess.PIPE, stdout=sys.stderr, stderr=sys.stderr) while True: data = sy...
[ "def", "_extract_symbols_to", "(", "symbol_request", ",", "dest_dir", ")", ":", "proc", "=", "subprocess", ".", "Popen", "(", "[", "'tar'", ",", "'xjf'", ",", "'-'", "]", ",", "cwd", "=", "dest_dir", ",", "stdin", "=", "subprocess", ".", "PIPE", ",", "...
Performs a streaming extract of the symbol files.
[ "Performs", "a", "streaming", "extract", "of", "the", "symbol", "files", "." ]
[ "\"\"\"Performs a streaming extract of the symbol files.\n\n Args:\n symbol_request: The HTTPResponse object for the symbol URL.\n dest_dir: The destination directory into which the files will be\n extracted.\n\n Returns: True on successful download and extraction, False on erro...
[ { "param": "symbol_request", "type": null }, { "param": "dest_dir", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "symbol_request", "type": null, "docstring": "The HTTPResponse object for the symbol URL.", "docstring_tokens": [ "The", "HTTPResponse", "object", "for", "the", "symbol", ...
3e9201b59605abfb14b5efd323fe4fc0f9e4e727
sunlongbo/chromium
tools/variations/cleanup_stale_fieldtrial_configs.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
is_literal_used
<not_specific>
def is_literal_used(literal): """Check if a given string literal is used in the codebase.""" if literal in _LITERAL_CACHE: return _LITERAL_CACHE[literal] git_grep_cmd = ('git', 'grep', '--threads', '2', '-l', '\"%s\"' % literal) git_grep_proc = subprocess.Popen(git_grep_cmd, stdout=subprocess.PIPE) # Che...
Check if a given string literal is used in the codebase.
Check if a given string literal is used in the codebase.
[ "Check", "if", "a", "given", "string", "literal", "is", "used", "in", "the", "codebase", "." ]
def is_literal_used(literal): if literal in _LITERAL_CACHE: return _LITERAL_CACHE[literal] git_grep_cmd = ('git', 'grep', '--threads', '2', '-l', '\"%s\"' % literal) git_grep_proc = subprocess.Popen(git_grep_cmd, stdout=subprocess.PIPE) if len(git_grep_proc.stdout.read().splitlines()) > 1: _LITERAL_CACH...
[ "def", "is_literal_used", "(", "literal", ")", ":", "if", "literal", "in", "_LITERAL_CACHE", ":", "return", "_LITERAL_CACHE", "[", "literal", "]", "git_grep_cmd", "=", "(", "'git'", ",", "'grep'", ",", "'--threads'", ",", "'2'", ",", "'-l'", ",", "'\\\"%s\\\...
Check if a given string literal is used in the codebase.
[ "Check", "if", "a", "given", "string", "literal", "is", "used", "in", "the", "codebase", "." ]
[ "\"\"\"Check if a given string literal is used in the codebase.\"\"\"", "# Check for >1 since fieldtrial_testing_config.json will always be a result." ]
[ { "param": "literal", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "literal", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
3e9201b59605abfb14b5efd323fe4fc0f9e4e727
sunlongbo/chromium
tools/variations/cleanup_stale_fieldtrial_configs.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
is_study_used
<not_specific>
def is_study_used(study_name, configs): """Checks if a given study is used in the codebase.""" if study_name.startswith('WebRTC-'): return True # Skip webrtc studies which give false positives. if is_literal_used(study_name): return True for config in configs: for experiment in config.get('experim...
Checks if a given study is used in the codebase.
Checks if a given study is used in the codebase.
[ "Checks", "if", "a", "given", "study", "is", "used", "in", "the", "codebase", "." ]
def is_study_used(study_name, configs): if study_name.startswith('WebRTC-'): return True if is_literal_used(study_name): return True for config in configs: for experiment in config.get('experiments', []): for feature in experiment.get('enable_features', []): if is_literal_used(feature)...
[ "def", "is_study_used", "(", "study_name", ",", "configs", ")", ":", "if", "study_name", ".", "startswith", "(", "'WebRTC-'", ")", ":", "return", "True", "if", "is_literal_used", "(", "study_name", ")", ":", "return", "True", "for", "config", "in", "configs"...
Checks if a given study is used in the codebase.
[ "Checks", "if", "a", "given", "study", "is", "used", "in", "the", "codebase", "." ]
[ "\"\"\"Checks if a given study is used in the codebase.\"\"\"", "# Skip webrtc studies which give false positives." ]
[ { "param": "study_name", "type": null }, { "param": "configs", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "study_name", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "configs", "type": null, "docstring": null, "docstring_t...
3e9201b59605abfb14b5efd323fe4fc0f9e4e727
sunlongbo/chromium
tools/variations/cleanup_stale_fieldtrial_configs.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
thread_func
null
def thread_func(thread_limiter, studies_map, study_name, configs): """Runs a limited number of tasks and updates the map with the results. Args: thread_limited: A lock used to limit the number of active threads. studies_map: The map where confirmed studies are added to. study_name: The name of the stud...
Runs a limited number of tasks and updates the map with the results. Args: thread_limited: A lock used to limit the number of active threads. studies_map: The map where confirmed studies are added to. study_name: The name of the study to check. configs: The configs for the given study. Side-effect...
Runs a limited number of tasks and updates the map with the results.
[ "Runs", "a", "limited", "number", "of", "tasks", "and", "updates", "the", "map", "with", "the", "results", "." ]
def thread_func(thread_limiter, studies_map, study_name, configs): thread_limiter.acquire() try: if is_study_used(study_name, configs): studies_map[study_name] = configs finally: thread_limiter.release()
[ "def", "thread_func", "(", "thread_limiter", ",", "studies_map", ",", "study_name", ",", "configs", ")", ":", "thread_limiter", ".", "acquire", "(", ")", "try", ":", "if", "is_study_used", "(", "study_name", ",", "configs", ")", ":", "studies_map", "[", "stu...
Runs a limited number of tasks and updates the map with the results.
[ "Runs", "a", "limited", "number", "of", "tasks", "and", "updates", "the", "map", "with", "the", "results", "." ]
[ "\"\"\"Runs a limited number of tasks and updates the map with the results.\n\n Args:\n thread_limited: A lock used to limit the number of active threads.\n studies_map: The map where confirmed studies are added to.\n study_name: The name of the study to check.\n configs: The configs for the given stud...
[ { "param": "thread_limiter", "type": null }, { "param": "studies_map", "type": null }, { "param": "study_name", "type": null }, { "param": "configs", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "thread_limiter", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "studies_map", "type": null, "docstring": "The map where c...
f579752dcaf475e0773677d45eae5adb622454ff
sunlongbo/chromium
tools/perf/core/upload_results_to_perf_dashboard.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
_CommitPositionNumber
<not_specific>
def _CommitPositionNumber(commit_pos): """Extracts the number part of a commit position. This is used to extract the number from got_revision_cp; This will be used as the value of "rev" in the data passed to results_dashboard.SendResults. """ return int(re.search(r'{#(\d+)}', commit_pos).group(1))
Extracts the number part of a commit position. This is used to extract the number from got_revision_cp; This will be used as the value of "rev" in the data passed to results_dashboard.SendResults.
Extracts the number part of a commit position. This is used to extract the number from got_revision_cp; This will be used as the value of "rev" in the data passed to results_dashboard.SendResults.
[ "Extracts", "the", "number", "part", "of", "a", "commit", "position", ".", "This", "is", "used", "to", "extract", "the", "number", "from", "got_revision_cp", ";", "This", "will", "be", "used", "as", "the", "value", "of", "\"", "rev", "\"", "in", "the", ...
def _CommitPositionNumber(commit_pos): return int(re.search(r'{#(\d+)}', commit_pos).group(1))
[ "def", "_CommitPositionNumber", "(", "commit_pos", ")", ":", "return", "int", "(", "re", ".", "search", "(", "r'{#(\\d+)}'", ",", "commit_pos", ")", ".", "group", "(", "1", ")", ")" ]
Extracts the number part of a commit position.
[ "Extracts", "the", "number", "part", "of", "a", "commit", "position", "." ]
[ "\"\"\"Extracts the number part of a commit position.\n\n This is used to extract the number from got_revision_cp; This will be used\n as the value of \"rev\" in the data passed to results_dashboard.SendResults.\n \"\"\"" ]
[ { "param": "commit_pos", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "commit_pos", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
f579752dcaf475e0773677d45eae5adb622454ff
sunlongbo/chromium
tools/perf/core/upload_results_to_perf_dashboard.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
GetDashboardUrl
<not_specific>
def GetDashboardUrl(name, configuration_name, results_url, got_revision_cp, perf_dashboard_machine_group): """Optionally writes the dashboard URL to a file and returns a link to the dashboard. """ name = name.replace('.reference', '') dashboard_url = results_url + RESULTS_LINK_PATH % ( six.moves.url...
Optionally writes the dashboard URL to a file and returns a link to the dashboard.
Optionally writes the dashboard URL to a file and returns a link to the dashboard.
[ "Optionally", "writes", "the", "dashboard", "URL", "to", "a", "file", "and", "returns", "a", "link", "to", "the", "dashboard", "." ]
def GetDashboardUrl(name, configuration_name, results_url, got_revision_cp, perf_dashboard_machine_group): name = name.replace('.reference', '') dashboard_url = results_url + RESULTS_LINK_PATH % ( six.moves.urllib.parse.quote(perf_dashboard_machine_group), six.moves.urllib.parse.quote(configuration_...
[ "def", "GetDashboardUrl", "(", "name", ",", "configuration_name", ",", "results_url", ",", "got_revision_cp", ",", "perf_dashboard_machine_group", ")", ":", "name", "=", "name", ".", "replace", "(", "'.reference'", ",", "''", ")", "dashboard_url", "=", "results_ur...
Optionally writes the dashboard URL to a file and returns a link to the dashboard.
[ "Optionally", "writes", "the", "dashboard", "URL", "to", "a", "file", "and", "returns", "a", "link", "to", "the", "dashboard", "." ]
[ "\"\"\"Optionally writes the dashboard URL to a file and returns a link to the\n dashboard.\n \"\"\"" ]
[ { "param": "name", "type": null }, { "param": "configuration_name", "type": null }, { "param": "results_url", "type": null }, { "param": "got_revision_cp", "type": null }, { "param": "perf_dashboard_machine_group", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "name", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "configuration_name", "type": null, "docstring": null, "docstr...
f579752dcaf475e0773677d45eae5adb622454ff
sunlongbo/chromium
tools/perf/core/upload_results_to_perf_dashboard.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
_GetPerfDashboardRevisionsWithProperties
<not_specific>
def _GetPerfDashboardRevisionsWithProperties( got_webrtc_revision, got_v8_revision, git_revision, main_revision, point_id=None): """Fills in the same revisions fields that process_log_utils does.""" versions = {} versions['rev'] = main_revision versions['webrtc_git'] = got_webrtc_revision versions['v8...
Fills in the same revisions fields that process_log_utils does.
Fills in the same revisions fields that process_log_utils does.
[ "Fills", "in", "the", "same", "revisions", "fields", "that", "process_log_utils", "does", "." ]
def _GetPerfDashboardRevisionsWithProperties( got_webrtc_revision, got_v8_revision, git_revision, main_revision, point_id=None): versions = {} versions['rev'] = main_revision versions['webrtc_git'] = got_webrtc_revision versions['v8_rev'] = got_v8_revision versions['git_revision'] = git_revision ver...
[ "def", "_GetPerfDashboardRevisionsWithProperties", "(", "got_webrtc_revision", ",", "got_v8_revision", ",", "git_revision", ",", "main_revision", ",", "point_id", "=", "None", ")", ":", "versions", "=", "{", "}", "versions", "[", "'rev'", "]", "=", "main_revision", ...
Fills in the same revisions fields that process_log_utils does.
[ "Fills", "in", "the", "same", "revisions", "fields", "that", "process_log_utils", "does", "." ]
[ "\"\"\"Fills in the same revisions fields that process_log_utils does.\"\"\"", "# There are a lot of \"bad\" revisions to check for, so clean them all up here." ]
[ { "param": "got_webrtc_revision", "type": null }, { "param": "got_v8_revision", "type": null }, { "param": "git_revision", "type": null }, { "param": "main_revision", "type": null }, { "param": "point_id", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "got_webrtc_revision", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "got_v8_revision", "type": null, "docstring": null, ...
4c68826f86562c8470d746f5c8710e64cca797c3
sunlongbo/chromium
tools/perf/run_gtest_benchmark.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
RunGTest
<not_specific>
def RunGTest(options, gtest_args): """Runs gtest with --trace-dir switch pointing at intermediate dir. Args: options: Parsed command line options. gtest_args: List of args to run gtest. Returns gtest run return code. """ trace_dir = _GetTraceDir(options) os.makedirs(trace_dir) gtest_args.append(...
Runs gtest with --trace-dir switch pointing at intermediate dir. Args: options: Parsed command line options. gtest_args: List of args to run gtest. Returns gtest run return code.
Runs gtest with --trace-dir switch pointing at intermediate dir.
[ "Runs", "gtest", "with", "--", "trace", "-", "dir", "switch", "pointing", "at", "intermediate", "dir", "." ]
def RunGTest(options, gtest_args): trace_dir = _GetTraceDir(options) os.makedirs(trace_dir) gtest_args.append('--trace-dir=%s' % trace_dir) gtest_command = [options.executable] gtest_command.extend(gtest_args) return_code = test_env.run_command(gtest_command) return return_code
[ "def", "RunGTest", "(", "options", ",", "gtest_args", ")", ":", "trace_dir", "=", "_GetTraceDir", "(", "options", ")", "os", ".", "makedirs", "(", "trace_dir", ")", "gtest_args", ".", "append", "(", "'--trace-dir=%s'", "%", "trace_dir", ")", "gtest_command", ...
Runs gtest with --trace-dir switch pointing at intermediate dir.
[ "Runs", "gtest", "with", "--", "trace", "-", "dir", "switch", "pointing", "at", "intermediate", "dir", "." ]
[ "\"\"\"Runs gtest with --trace-dir switch pointing at intermediate dir.\n\n Args:\n options: Parsed command line options.\n gtest_args: List of args to run gtest.\n\n Returns gtest run return code.\n \"\"\"" ]
[ { "param": "options", "type": null }, { "param": "gtest_args", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "options", "type": null, "docstring": "Parsed command line options.", "docstring_tokens": [ "Parsed", "command", "line", "options", "." ], "default": null, "is_optional"...
4c68826f86562c8470d746f5c8710e64cca797c3
sunlongbo/chromium
tools/perf/run_gtest_benchmark.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
_MapDeviceTracePath
<not_specific>
def _MapDeviceTracePath(trace_dir, result_json): """Maps trace file paths to |trace_dir|. It is needed when gtest runs on a real device and trace file is the absolute path on the device. If gtest runs on a bot, the returned result should be the same as input. Args: result_json: JSON string of a test result...
Maps trace file paths to |trace_dir|. It is needed when gtest runs on a real device and trace file is the absolute path on the device. If gtest runs on a bot, the returned result should be the same as input. Args: result_json: JSON string of a test result. Returns the JSON string of a LUCI test result wit...
Maps trace file paths to |trace_dir|. It is needed when gtest runs on a real device and trace file is the absolute path on the device. If gtest runs on a bot, the returned result should be the same as input.
[ "Maps", "trace", "file", "paths", "to", "|trace_dir|", ".", "It", "is", "needed", "when", "gtest", "runs", "on", "a", "real", "device", "and", "trace", "file", "is", "the", "absolute", "path", "on", "the", "device", ".", "If", "gtest", "runs", "on", "a...
def _MapDeviceTracePath(trace_dir, result_json): result = json.loads(result_json) test_result = result.get('testResult', {}) artifacts = test_result.get('outputArtifacts', {}) trace_names = [name for name in artifacts if name.startswith('trace/')] for name in trace_names: trace_file = artifacts[name]['fil...
[ "def", "_MapDeviceTracePath", "(", "trace_dir", ",", "result_json", ")", ":", "result", "=", "json", ".", "loads", "(", "result_json", ")", "test_result", "=", "result", ".", "get", "(", "'testResult'", ",", "{", "}", ")", "artifacts", "=", "test_result", ...
Maps trace file paths to |trace_dir|.
[ "Maps", "trace", "file", "paths", "to", "|trace_dir|", "." ]
[ "\"\"\"Maps trace file paths to |trace_dir|. It is needed when gtest runs\n on a real device and trace file is the absolute path on the device. If\n gtest runs on a bot, the returned result should be the same as input.\n\n Args:\n result_json: JSON string of a test result.\n\n Returns the JSON string of a LU...
[ { "param": "trace_dir", "type": null }, { "param": "result_json", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "trace_dir", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "result_json", "type": null, "docstring": "JSON string of a tes...
4c68826f86562c8470d746f5c8710e64cca797c3
sunlongbo/chromium
tools/perf/run_gtest_benchmark.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
_MergeResultsJson
null
def _MergeResultsJson(trace_dir, output_file): """Merge results json files generated in each test case into output_file. Gtest test cases store results in LUCI test results format. See: go/luci-test-results-design This function reads the individual LUCI test results JSON files and concatenates them into a j...
Merge results json files generated in each test case into output_file. Gtest test cases store results in LUCI test results format. See: go/luci-test-results-design This function reads the individual LUCI test results JSON files and concatenates them into a jsonl file to feed result processor scripts later on....
Merge results json files generated in each test case into output_file. Gtest test cases store results in LUCI test results format. See: go/luci-test-results-design This function reads the individual LUCI test results JSON files and concatenates them into a jsonl file to feed result processor scripts later on.
[ "Merge", "results", "json", "files", "generated", "in", "each", "test", "case", "into", "output_file", ".", "Gtest", "test", "cases", "store", "results", "in", "LUCI", "test", "results", "format", ".", "See", ":", "go", "/", "luci", "-", "test", "-", "re...
def _MergeResultsJson(trace_dir, output_file): result_files = [ os.path.join(trace_dir, trace) for trace in os.listdir(trace_dir) if trace.endswith('test_result.json') ] with open(output_file, 'w') as output: for result_file in result_files: with open(result_file) as f: strippe...
[ "def", "_MergeResultsJson", "(", "trace_dir", ",", "output_file", ")", ":", "result_files", "=", "[", "os", ".", "path", ".", "join", "(", "trace_dir", ",", "trace", ")", "for", "trace", "in", "os", ".", "listdir", "(", "trace_dir", ")", "if", "trace", ...
Merge results json files generated in each test case into output_file.
[ "Merge", "results", "json", "files", "generated", "in", "each", "test", "case", "into", "output_file", "." ]
[ "\"\"\"Merge results json files generated in each test case into output_file.\n\n Gtest test cases store results in LUCI test results format.\n See: go/luci-test-results-design\n\n This function reads the individual LUCI test results JSON files and\n concatenates them into a jsonl file to feed result processor ...
[ { "param": "trace_dir", "type": null }, { "param": "output_file", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "trace_dir", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "output_file", "type": null, "docstring": null, "docstrin...
4c68826f86562c8470d746f5c8710e64cca797c3
sunlongbo/chromium
tools/perf/run_gtest_benchmark.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
ProcessResults
<not_specific>
def ProcessResults(options): """Collect generated results and call results_processor to compute results.""" _MergeResultsJson(_GetTraceDir(options), os.path.join(options.intermediate_dir, MERGED_RESULTS)) process_return_code = results_processor.ProcessResults(options) if process_return_code ...
Collect generated results and call results_processor to compute results.
Collect generated results and call results_processor to compute results.
[ "Collect", "generated", "results", "and", "call", "results_processor", "to", "compute", "results", "." ]
def ProcessResults(options): _MergeResultsJson(_GetTraceDir(options), os.path.join(options.intermediate_dir, MERGED_RESULTS)) process_return_code = results_processor.ProcessResults(options) if process_return_code != 0: return process_return_code expected_perf_filename = os.path.join(opti...
[ "def", "ProcessResults", "(", "options", ")", ":", "_MergeResultsJson", "(", "_GetTraceDir", "(", "options", ")", ",", "os", ".", "path", ".", "join", "(", "options", ".", "intermediate_dir", ",", "MERGED_RESULTS", ")", ")", "process_return_code", "=", "result...
Collect generated results and call results_processor to compute results.
[ "Collect", "generated", "results", "and", "call", "results_processor", "to", "compute", "results", "." ]
[ "\"\"\"Collect generated results and call results_processor to compute results.\"\"\"" ]
[ { "param": "options", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "options", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
c61e98f14c9a76d67981dbcf26cd371477e7bf9b
sunlongbo/chromium
tools/perf/cli_tools/flakiness_cli/cached_api.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
GetBuilders
<not_specific>
def GetBuilders(): """Get the builders data frame and keep a cached copy.""" def make_frame(): data = api.GetBuilders() return frames.BuildersDataFrame(data) return frames.GetWithCache( 'builders.pkl', make_frame, expires_after=datetime.timedelta(hours=12))
Get the builders data frame and keep a cached copy.
Get the builders data frame and keep a cached copy.
[ "Get", "the", "builders", "data", "frame", "and", "keep", "a", "cached", "copy", "." ]
def GetBuilders(): def make_frame(): data = api.GetBuilders() return frames.BuildersDataFrame(data) return frames.GetWithCache( 'builders.pkl', make_frame, expires_after=datetime.timedelta(hours=12))
[ "def", "GetBuilders", "(", ")", ":", "def", "make_frame", "(", ")", ":", "data", "=", "api", ".", "GetBuilders", "(", ")", "return", "frames", ".", "BuildersDataFrame", "(", "data", ")", "return", "frames", ".", "GetWithCache", "(", "'builders.pkl'", ",", ...
Get the builders data frame and keep a cached copy.
[ "Get", "the", "builders", "data", "frame", "and", "keep", "a", "cached", "copy", "." ]
[ "\"\"\"Get the builders data frame and keep a cached copy.\"\"\"" ]
[]
{ "returns": [], "raises": [], "params": [], "outlier_params": [], "others": [] }
c61e98f14c9a76d67981dbcf26cd371477e7bf9b
sunlongbo/chromium
tools/perf/cli_tools/flakiness_cli/cached_api.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
GetTestResults
<not_specific>
def GetTestResults(master, builder, test_type): """Get a test results data frame and keep a cached copy.""" def make_frame(): data = api.GetTestResults(master, builder, test_type) return frames.TestResultsDataFrame(data) basename = hashlib.md5('/'.join([master, builder, test_type])).hexdigest() return ...
Get a test results data frame and keep a cached copy.
Get a test results data frame and keep a cached copy.
[ "Get", "a", "test", "results", "data", "frame", "and", "keep", "a", "cached", "copy", "." ]
def GetTestResults(master, builder, test_type): def make_frame(): data = api.GetTestResults(master, builder, test_type) return frames.TestResultsDataFrame(data) basename = hashlib.md5('/'.join([master, builder, test_type])).hexdigest() return frames.GetWithCache( basename + '.pkl', make_frame, expir...
[ "def", "GetTestResults", "(", "master", ",", "builder", ",", "test_type", ")", ":", "def", "make_frame", "(", ")", ":", "data", "=", "api", ".", "GetTestResults", "(", "master", ",", "builder", ",", "test_type", ")", "return", "frames", ".", "TestResultsDa...
Get a test results data frame and keep a cached copy.
[ "Get", "a", "test", "results", "data", "frame", "and", "keep", "a", "cached", "copy", "." ]
[ "\"\"\"Get a test results data frame and keep a cached copy.\"\"\"" ]
[ { "param": "master", "type": null }, { "param": "builder", "type": null }, { "param": "test_type", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "master", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "builder", "type": null, "docstring": null, "docstring_token...
0d8e956f3ee5f81617b12ff9729db86e3ffcd506
sunlongbo/chromium
chrome/updater/test/service/win/updater_test_service.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
run
null
def run(self): """xml-rpc server main loop.""" self.register_introspection_functions() self.register_instance(rpc_handler.UpdaterTestRPCHandler()) self.serve_forever()
xml-rpc server main loop.
xml-rpc server main loop.
[ "xml", "-", "rpc", "server", "main", "loop", "." ]
def run(self): self.register_introspection_functions() self.register_instance(rpc_handler.UpdaterTestRPCHandler()) self.serve_forever()
[ "def", "run", "(", "self", ")", ":", "self", ".", "register_introspection_functions", "(", ")", "self", ".", "register_instance", "(", "rpc_handler", ".", "UpdaterTestRPCHandler", "(", ")", ")", "self", ".", "serve_forever", "(", ")" ]
xml-rpc server main loop.
[ "xml", "-", "rpc", "server", "main", "loop", "." ]
[ "\"\"\"xml-rpc server main loop.\"\"\"" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
0d8e956f3ee5f81617b12ff9729db86e3ffcd506
sunlongbo/chromium
chrome/updater/test/service/win/updater_test_service.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
SvcStop
null
def SvcStop(self): """Called by service framework to stop this service.""" logging.info('Updater test service stopping...') self._xmlrpc_server.shutdown() self.ReportServiceStatus(win32service.SERVICE_STOPPED)
Called by service framework to stop this service.
Called by service framework to stop this service.
[ "Called", "by", "service", "framework", "to", "stop", "this", "service", "." ]
def SvcStop(self): logging.info('Updater test service stopping...') self._xmlrpc_server.shutdown() self.ReportServiceStatus(win32service.SERVICE_STOPPED)
[ "def", "SvcStop", "(", "self", ")", ":", "logging", ".", "info", "(", "'Updater test service stopping...'", ")", "self", ".", "_xmlrpc_server", ".", "shutdown", "(", ")", "self", ".", "ReportServiceStatus", "(", "win32service", ".", "SERVICE_STOPPED", ")" ]
Called by service framework to stop this service.
[ "Called", "by", "service", "framework", "to", "stop", "this", "service", "." ]
[ "\"\"\"Called by service framework to stop this service.\"\"\"" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
0d8e956f3ee5f81617b12ff9729db86e3ffcd506
sunlongbo/chromium
chrome/updater/test/service/win/updater_test_service.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
SvcDoRun
null
def SvcDoRun(self): """Called by service framework to start this service.""" try: logging.info('%s starting...', self._svc_name_) servicemanager.LogMsg(servicemanager.EVENTLOG_INFORMATION_TYPE, servicemanager.PYS_SERVICE_STARTED, (self._svc_na...
Called by service framework to start this service.
Called by service framework to start this service.
[ "Called", "by", "service", "framework", "to", "start", "this", "service", "." ]
def SvcDoRun(self): try: logging.info('%s starting...', self._svc_name_) servicemanager.LogMsg(servicemanager.EVENTLOG_INFORMATION_TYPE, servicemanager.PYS_SERVICE_STARTED, (self._svc_name_, '')) self.ReportServiceStatus(win32service.SERVICE_...
[ "def", "SvcDoRun", "(", "self", ")", ":", "try", ":", "logging", ".", "info", "(", "'%s starting...'", ",", "self", ".", "_svc_name_", ")", "servicemanager", ".", "LogMsg", "(", "servicemanager", ".", "EVENTLOG_INFORMATION_TYPE", ",", "servicemanager", ".", "P...
Called by service framework to start this service.
[ "Called", "by", "service", "framework", "to", "start", "this", "service", "." ]
[ "\"\"\"Called by service framework to start this service.\"\"\"" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
5bdd9ce39c65bcd731904bc582f8ab45d67f4479
sunlongbo/chromium
tools/cr/cr/actions/action.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
Skipping
<not_specific>
def Skipping(self): """A method that is used to detect void or skip implementations. Most actions have a skip version that you can select to indicate that you want to not perform the action at all. It is important that commands can detect this so they can modify the action sequence if there are oth...
A method that is used to detect void or skip implementations. Most actions have a skip version that you can select to indicate that you want to not perform the action at all. It is important that commands can detect this so they can modify the action sequence if there are other changes that depend on i...
A method that is used to detect void or skip implementations. Most actions have a skip version that you can select to indicate that you want to not perform the action at all. It is important that commands can detect this so they can modify the action sequence if there are other changes that depend on it (for instance n...
[ "A", "method", "that", "is", "used", "to", "detect", "void", "or", "skip", "implementations", ".", "Most", "actions", "have", "a", "skip", "version", "that", "you", "can", "select", "to", "indicate", "that", "you", "want", "to", "not", "perform", "the", ...
def Skipping(self): return self.name == 'skip'
[ "def", "Skipping", "(", "self", ")", ":", "return", "self", ".", "name", "==", "'skip'" ]
A method that is used to detect void or skip implementations.
[ "A", "method", "that", "is", "used", "to", "detect", "void", "or", "skip", "implementations", "." ]
[ "\"\"\"A method that is used to detect void or skip implementations.\n\n Most actions have a skip version that you can select to indicate that you\n want to not perform the action at all.\n It is important that commands can detect this so they can modify the action\n sequence if there are other changes ...
[ { "param": "self", "type": null } ]
{ "returns": [ { "docstring": "True if this implementation is a skip action.", "docstring_tokens": [ "True", "if", "this", "implementation", "is", "a", "skip", "action", "." ], "type": null } ], "raises": [], ...
41fa458decee16db1b66d5d4045fb7e308fdb893
sunlongbo/chromium
components/policy/tools/template_writers/writers/jamf_writer.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
GetWriter
<not_specific>
def GetWriter(config): '''Factory method for creating JamfWriter objects. See the constructor of TemplateWriter for description of arguments. ''' return JamfWriter(['mac', 'ios'], config)
Factory method for creating JamfWriter objects. See the constructor of TemplateWriter for description of arguments.
Factory method for creating JamfWriter objects. See the constructor of TemplateWriter for description of arguments.
[ "Factory", "method", "for", "creating", "JamfWriter", "objects", ".", "See", "the", "constructor", "of", "TemplateWriter", "for", "description", "of", "arguments", "." ]
def GetWriter(config): return JamfWriter(['mac', 'ios'], config)
[ "def", "GetWriter", "(", "config", ")", ":", "return", "JamfWriter", "(", "[", "'mac'", ",", "'ios'", "]", ",", "config", ")" ]
Factory method for creating JamfWriter objects.
[ "Factory", "method", "for", "creating", "JamfWriter", "objects", "." ]
[ "'''Factory method for creating JamfWriter objects.\n See the constructor of TemplateWriter for description of\n arguments.\n '''" ]
[ { "param": "config", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "config", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
41fa458decee16db1b66d5d4045fb7e308fdb893
sunlongbo/chromium
components/policy/tools/template_writers/writers/jamf_writer.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
WriteTemplate
<not_specific>
def WriteTemplate(self, template): '''Writes the given template definition. Args: template: Template definition to write. Returns: Generated output for the passed template definition. ''' # Keep track of all items that can be referred to by an id. # This is used for '$ref' fields i...
Writes the given template definition. Args: template: Template definition to write. Returns: Generated output for the passed template definition.
Writes the given template definition.
[ "Writes", "the", "given", "template", "definition", "." ]
def WriteTemplate(self, template): ref_ids_schemas = {} policies = [] for policy_def in template['policy_definitions']: if policy_def['type'] == 'group': policies += policy_def['policies'] else: policies += [policy_def] for policy in policies: if policy['type'] == 'int-...
[ "def", "WriteTemplate", "(", "self", ",", "template", ")", ":", "ref_ids_schemas", "=", "{", "}", "policies", "=", "[", "]", "for", "policy_def", "in", "template", "[", "'policy_definitions'", "]", ":", "if", "policy_def", "[", "'type'", "]", "==", "'group...
Writes the given template definition.
[ "Writes", "the", "given", "template", "definition", "." ]
[ "'''Writes the given template definition.\n\n Args:\n template: Template definition to write.\n\n Returns:\n Generated output for the passed template definition.\n '''", "# Keep track of all items that can be referred to by an id.", "# This is used for '$ref' fields in the policy templates.",...
[ { "param": "self", "type": null }, { "param": "template", "type": null } ]
{ "returns": [ { "docstring": "Generated output for the passed template definition.", "docstring_tokens": [ "Generated", "output", "for", "the", "passed", "template", "definition", "." ], "type": null } ], "raises": []...
41fa458decee16db1b66d5d4045fb7e308fdb893
sunlongbo/chromium
components/policy/tools/template_writers/writers/jamf_writer.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
RecordEnumIds
null
def RecordEnumIds(self, policy, known_ids): '''Writes the a dictionary mapping ids of enums that can be referred to by '$ref' to their schema. Args: policy: The policy to scan for refs. known_ids: The dictionary and output of all the known ids. ''' if 'id' in policy['schema']: ...
Writes the a dictionary mapping ids of enums that can be referred to by '$ref' to their schema. Args: policy: The policy to scan for refs. known_ids: The dictionary and output of all the known ids.
Writes the a dictionary mapping ids of enums that can be referred to by '$ref' to their schema.
[ "Writes", "the", "a", "dictionary", "mapping", "ids", "of", "enums", "that", "can", "be", "referred", "to", "by", "'", "$ref", "'", "to", "their", "schema", "." ]
def RecordEnumIds(self, policy, known_ids): if 'id' in policy['schema']: known_ids[policy['schema']['id']] = { 'type': policy['schema']['type'], 'options': { 'enum_titles': [item['name'] for item in policy['items']] }, 'enum': [item['value'] for item in po...
[ "def", "RecordEnumIds", "(", "self", ",", "policy", ",", "known_ids", ")", ":", "if", "'id'", "in", "policy", "[", "'schema'", "]", ":", "known_ids", "[", "policy", "[", "'schema'", "]", "[", "'id'", "]", "]", "=", "{", "'type'", ":", "policy", "[", ...
Writes the a dictionary mapping ids of enums that can be referred to by '$ref' to their schema.
[ "Writes", "the", "a", "dictionary", "mapping", "ids", "of", "enums", "that", "can", "be", "referred", "to", "by", "'", "$ref", "'", "to", "their", "schema", "." ]
[ "'''Writes the a dictionary mapping ids of enums that can be referred to by\n '$ref' to their schema.\n\n Args:\n policy: The policy to scan for refs.\n known_ids: The dictionary and output of all the known ids.\n '''" ]
[ { "param": "self", "type": null }, { "param": "policy", "type": null }, { "param": "known_ids", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "policy", "type": null, "docstring": "The policy to scan for refs.",...
41fa458decee16db1b66d5d4045fb7e308fdb893
sunlongbo/chromium
components/policy/tools/template_writers/writers/jamf_writer.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
RecordKnownPropertyIds
<not_specific>
def RecordKnownPropertyIds(self, obj, known_ids): '''Writes the a dictionary mapping ids of schemas properties that can be referred to by '$ref' to their schema. Args: obj: The object to scan for refs. known_ids: The dictionary and output of all the known ids. ''' if type(obj) is not...
Writes the a dictionary mapping ids of schemas properties that can be referred to by '$ref' to their schema. Args: obj: The object to scan for refs. known_ids: The dictionary and output of all the known ids.
Writes the a dictionary mapping ids of schemas properties that can be referred to by '$ref' to their schema.
[ "Writes", "the", "a", "dictionary", "mapping", "ids", "of", "schemas", "properties", "that", "can", "be", "referred", "to", "by", "'", "$ref", "'", "to", "their", "schema", "." ]
def RecordKnownPropertyIds(self, obj, known_ids): if type(obj) is not dict: return if 'id' in obj: known_ids[obj['id']] = obj for value in obj.values(): self.RecordKnownPropertyIds(value, known_ids)
[ "def", "RecordKnownPropertyIds", "(", "self", ",", "obj", ",", "known_ids", ")", ":", "if", "type", "(", "obj", ")", "is", "not", "dict", ":", "return", "if", "'id'", "in", "obj", ":", "known_ids", "[", "obj", "[", "'id'", "]", "]", "=", "obj", "fo...
Writes the a dictionary mapping ids of schemas properties that can be referred to by '$ref' to their schema.
[ "Writes", "the", "a", "dictionary", "mapping", "ids", "of", "schemas", "properties", "that", "can", "be", "referred", "to", "by", "'", "$ref", "'", "to", "their", "schema", "." ]
[ "'''Writes the a dictionary mapping ids of schemas properties that can be\n referred to by '$ref' to their schema.\n\n Args:\n obj: The object to scan for refs.\n known_ids: The dictionary and output of all the known ids.\n '''" ]
[ { "param": "self", "type": null }, { "param": "obj", "type": null }, { "param": "known_ids", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "obj", "type": null, "docstring": "The object to scan for refs.", ...
41fa458decee16db1b66d5d4045fb7e308fdb893
sunlongbo/chromium
components/policy/tools/template_writers/writers/jamf_writer.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
WriteRefItems
<not_specific>
def WriteRefItems(self, root, obj, path_to_obj_parent, known_ids, ids_in_ancestry): '''Replaces all the '$ref' items by their actual value. Nested properties are limited to a depth of MAX_RECURSIVE_FIELDS_DEPTH, after which the recursive field is removed. Args: root: The r...
Replaces all the '$ref' items by their actual value. Nested properties are limited to a depth of MAX_RECURSIVE_FIELDS_DEPTH, after which the recursive field is removed. Args: root: The root of the object tree to scan for refs. obj: The current object being checked for ids. path_to_obj...
Replaces all the '$ref' items by their actual value. Nested properties are limited to a depth of MAX_RECURSIVE_FIELDS_DEPTH, after which the recursive field is removed.
[ "Replaces", "all", "the", "'", "$ref", "'", "items", "by", "their", "actual", "value", ".", "Nested", "properties", "are", "limited", "to", "a", "depth", "of", "MAX_RECURSIVE_FIELDS_DEPTH", "after", "which", "the", "recursive", "field", "is", "removed", "." ]
def WriteRefItems(self, root, obj, path_to_obj_parent, known_ids, ids_in_ancestry): if type(obj) is not dict: return if 'id' in obj: ids_in_ancestry.add(obj['id']) for key, value in list(obj.items()): if type(value) is not dict: continue if '$ref' in value...
[ "def", "WriteRefItems", "(", "self", ",", "root", ",", "obj", ",", "path_to_obj_parent", ",", "known_ids", ",", "ids_in_ancestry", ")", ":", "if", "type", "(", "obj", ")", "is", "not", "dict", ":", "return", "if", "'id'", "in", "obj", ":", "ids_in_ancest...
Replaces all the '$ref' items by their actual value.
[ "Replaces", "all", "the", "'", "$ref", "'", "items", "by", "their", "actual", "value", "." ]
[ "'''Replaces all the '$ref' items by their actual value. Nested properties\n are limited to a depth of MAX_RECURSIVE_FIELDS_DEPTH, after which the\n recursive field is removed.\n\n Args:\n root: The root of the object tree to scan for refs.\n obj: The current object being checked for ids.\n ...
[ { "param": "self", "type": null }, { "param": "root", "type": null }, { "param": "obj", "type": null }, { "param": "path_to_obj_parent", "type": null }, { "param": "known_ids", "type": null }, { "param": "ids_in_ancestry", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "root", "type": null, "docstring": "The root of the object tree to s...
b39478d739df676db55ce5498a2aee813edb7c8c
sunlongbo/chromium
third_party/jinja2/compiler.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
generate
<not_specific>
def generate( node, environment, name, filename, stream=None, defer_init=False, optimized=True ): """Generate the python source for a node tree.""" if not isinstance(node, nodes.Template): raise TypeError("Can't compile non template nodes") generator = environment.code_generator_class( e...
Generate the python source for a node tree.
Generate the python source for a node tree.
[ "Generate", "the", "python", "source", "for", "a", "node", "tree", "." ]
def generate( node, environment, name, filename, stream=None, defer_init=False, optimized=True ): if not isinstance(node, nodes.Template): raise TypeError("Can't compile non template nodes") generator = environment.code_generator_class( environment, name, filename, stream, defer_init, optimi...
[ "def", "generate", "(", "node", ",", "environment", ",", "name", ",", "filename", ",", "stream", "=", "None", ",", "defer_init", "=", "False", ",", "optimized", "=", "True", ")", ":", "if", "not", "isinstance", "(", "node", ",", "nodes", ".", "Template...
Generate the python source for a node tree.
[ "Generate", "the", "python", "source", "for", "a", "node", "tree", "." ]
[ "\"\"\"Generate the python source for a node tree.\"\"\"" ]
[ { "param": "node", "type": null }, { "param": "environment", "type": null }, { "param": "name", "type": null }, { "param": "filename", "type": null }, { "param": "stream", "type": null }, { "param": "defer_init", "type": null }, { "param": ...
{ "returns": [], "raises": [], "params": [ { "identifier": "node", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "environment", "type": null, "docstring": null, "docstring_tok...
b39478d739df676db55ce5498a2aee813edb7c8c
sunlongbo/chromium
third_party/jinja2/compiler.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
find_undeclared
<not_specific>
def find_undeclared(nodes, names): """Check if the names passed are accessed undeclared. The return value is a set of all the undeclared names from the sequence of names found. """ visitor = UndeclaredNameVisitor(names) try: for node in nodes: visitor.visit(node) except Visi...
Check if the names passed are accessed undeclared. The return value is a set of all the undeclared names from the sequence of names found.
Check if the names passed are accessed undeclared. The return value is a set of all the undeclared names from the sequence of names found.
[ "Check", "if", "the", "names", "passed", "are", "accessed", "undeclared", ".", "The", "return", "value", "is", "a", "set", "of", "all", "the", "undeclared", "names", "from", "the", "sequence", "of", "names", "found", "." ]
def find_undeclared(nodes, names): visitor = UndeclaredNameVisitor(names) try: for node in nodes: visitor.visit(node) except VisitorExit: pass return visitor.undeclared
[ "def", "find_undeclared", "(", "nodes", ",", "names", ")", ":", "visitor", "=", "UndeclaredNameVisitor", "(", "names", ")", "try", ":", "for", "node", "in", "nodes", ":", "visitor", ".", "visit", "(", "node", ")", "except", "VisitorExit", ":", "pass", "r...
Check if the names passed are accessed undeclared.
[ "Check", "if", "the", "names", "passed", "are", "accessed", "undeclared", "." ]
[ "\"\"\"Check if the names passed are accessed undeclared. The return value\n is a set of all the undeclared names from the sequence of names found.\n \"\"\"" ]
[ { "param": "nodes", "type": null }, { "param": "names", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "nodes", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "names", "type": null, "docstring": null, "docstring_tokens":...
b39478d739df676db55ce5498a2aee813edb7c8c
sunlongbo/chromium
third_party/jinja2/compiler.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
copy
<not_specific>
def copy(self): """Create a copy of the current one.""" rv = object.__new__(self.__class__) rv.__dict__.update(self.__dict__) rv.symbols = self.symbols.copy() return rv
Create a copy of the current one.
Create a copy of the current one.
[ "Create", "a", "copy", "of", "the", "current", "one", "." ]
def copy(self): rv = object.__new__(self.__class__) rv.__dict__.update(self.__dict__) rv.symbols = self.symbols.copy() return rv
[ "def", "copy", "(", "self", ")", ":", "rv", "=", "object", ".", "__new__", "(", "self", ".", "__class__", ")", "rv", ".", "__dict__", ".", "update", "(", "self", ".", "__dict__", ")", "rv", ".", "symbols", "=", "self", ".", "symbols", ".", "copy", ...
Create a copy of the current one.
[ "Create", "a", "copy", "of", "the", "current", "one", "." ]
[ "\"\"\"Create a copy of the current one.\"\"\"" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
b39478d739df676db55ce5498a2aee813edb7c8c
sunlongbo/chromium
third_party/jinja2/compiler.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
soft
<not_specific>
def soft(self): """Return a soft frame. A soft frame may not be modified as standalone thing as it shares the resources with the frame it was created of, but it's not a rootlevel frame any longer. This is only used to implement if-statements. """ rv = self.copy() ...
Return a soft frame. A soft frame may not be modified as standalone thing as it shares the resources with the frame it was created of, but it's not a rootlevel frame any longer. This is only used to implement if-statements.
Return a soft frame. A soft frame may not be modified as standalone thing as it shares the resources with the frame it was created of, but it's not a rootlevel frame any longer. This is only used to implement if-statements.
[ "Return", "a", "soft", "frame", ".", "A", "soft", "frame", "may", "not", "be", "modified", "as", "standalone", "thing", "as", "it", "shares", "the", "resources", "with", "the", "frame", "it", "was", "created", "of", "but", "it", "'", "s", "not", "a", ...
def soft(self): rv = self.copy() rv.rootlevel = False return rv
[ "def", "soft", "(", "self", ")", ":", "rv", "=", "self", ".", "copy", "(", ")", "rv", ".", "rootlevel", "=", "False", "return", "rv" ]
Return a soft frame.
[ "Return", "a", "soft", "frame", "." ]
[ "\"\"\"Return a soft frame. A soft frame may not be modified as\n standalone thing as it shares the resources with the frame it\n was created of, but it's not a rootlevel frame any longer.\n\n This is only used to implement if-statements.\n \"\"\"" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
b39478d739df676db55ce5498a2aee813edb7c8c
sunlongbo/chromium
third_party/jinja2/compiler.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
return_buffer_contents
<not_specific>
def return_buffer_contents(self, frame, force_unescaped=False): """Return the buffer contents of the frame.""" if not force_unescaped: if frame.eval_ctx.volatile: self.writeline("if context.eval_ctx.autoescape:") self.indent() self.writeline("r...
Return the buffer contents of the frame.
Return the buffer contents of the frame.
[ "Return", "the", "buffer", "contents", "of", "the", "frame", "." ]
def return_buffer_contents(self, frame, force_unescaped=False): if not force_unescaped: if frame.eval_ctx.volatile: self.writeline("if context.eval_ctx.autoescape:") self.indent() self.writeline("return Markup(concat(%s))" % frame.buffer) ...
[ "def", "return_buffer_contents", "(", "self", ",", "frame", ",", "force_unescaped", "=", "False", ")", ":", "if", "not", "force_unescaped", ":", "if", "frame", ".", "eval_ctx", ".", "volatile", ":", "self", ".", "writeline", "(", "\"if context.eval_ctx.autoescap...
Return the buffer contents of the frame.
[ "Return", "the", "buffer", "contents", "of", "the", "frame", "." ]
[ "\"\"\"Return the buffer contents of the frame.\"\"\"" ]
[ { "param": "self", "type": null }, { "param": "frame", "type": null }, { "param": "force_unescaped", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "frame", "type": null, "docstring": null, "docstring_tokens": ...
b39478d739df676db55ce5498a2aee813edb7c8c
sunlongbo/chromium
third_party/jinja2/compiler.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
start_write
null
def start_write(self, frame, node=None): """Yield or write into the frame buffer.""" if frame.buffer is None: self.writeline("yield ", node) else: self.writeline("%s.append(" % frame.buffer, node)
Yield or write into the frame buffer.
Yield or write into the frame buffer.
[ "Yield", "or", "write", "into", "the", "frame", "buffer", "." ]
def start_write(self, frame, node=None): if frame.buffer is None: self.writeline("yield ", node) else: self.writeline("%s.append(" % frame.buffer, node)
[ "def", "start_write", "(", "self", ",", "frame", ",", "node", "=", "None", ")", ":", "if", "frame", ".", "buffer", "is", "None", ":", "self", ".", "writeline", "(", "\"yield \"", ",", "node", ")", "else", ":", "self", ".", "writeline", "(", "\"%s.app...
Yield or write into the frame buffer.
[ "Yield", "or", "write", "into", "the", "frame", "buffer", "." ]
[ "\"\"\"Yield or write into the frame buffer.\"\"\"" ]
[ { "param": "self", "type": null }, { "param": "frame", "type": null }, { "param": "node", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "frame", "type": null, "docstring": null, "docstring_tokens": ...
b39478d739df676db55ce5498a2aee813edb7c8c
sunlongbo/chromium
third_party/jinja2/compiler.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
blockvisit
null
def blockvisit(self, nodes, frame): """Visit a list of nodes as block in a frame. If the current frame is no buffer a dummy ``if 0: yield None`` is written automatically. """ try: self.writeline("pass") for node in nodes: self.visit(node, frame) ...
Visit a list of nodes as block in a frame. If the current frame is no buffer a dummy ``if 0: yield None`` is written automatically.
Visit a list of nodes as block in a frame. If the current frame is no buffer a dummy ``if 0: yield None`` is written automatically.
[ "Visit", "a", "list", "of", "nodes", "as", "block", "in", "a", "frame", ".", "If", "the", "current", "frame", "is", "no", "buffer", "a", "dummy", "`", "`", "if", "0", ":", "yield", "None", "`", "`", "is", "written", "automatically", "." ]
def blockvisit(self, nodes, frame): try: self.writeline("pass") for node in nodes: self.visit(node, frame) except CompilerExit: pass
[ "def", "blockvisit", "(", "self", ",", "nodes", ",", "frame", ")", ":", "try", ":", "self", ".", "writeline", "(", "\"pass\"", ")", "for", "node", "in", "nodes", ":", "self", ".", "visit", "(", "node", ",", "frame", ")", "except", "CompilerExit", ":"...
Visit a list of nodes as block in a frame.
[ "Visit", "a", "list", "of", "nodes", "as", "block", "in", "a", "frame", "." ]
[ "\"\"\"Visit a list of nodes as block in a frame. If the current frame\n is no buffer a dummy ``if 0: yield None`` is written automatically.\n \"\"\"" ]
[ { "param": "self", "type": null }, { "param": "nodes", "type": null }, { "param": "frame", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "nodes", "type": null, "docstring": null, "docstring_tokens": ...
b39478d739df676db55ce5498a2aee813edb7c8c
sunlongbo/chromium
third_party/jinja2/compiler.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
write
null
def write(self, x): """Write a string into the output stream.""" if self._new_lines: if not self._first_write: self.stream.write("\n" * self._new_lines) self.code_lineno += self._new_lines if self._write_debug_info is not None: ...
Write a string into the output stream.
Write a string into the output stream.
[ "Write", "a", "string", "into", "the", "output", "stream", "." ]
def write(self, x): if self._new_lines: if not self._first_write: self.stream.write("\n" * self._new_lines) self.code_lineno += self._new_lines if self._write_debug_info is not None: self.debug_info.append((self._write_debug_info, s...
[ "def", "write", "(", "self", ",", "x", ")", ":", "if", "self", ".", "_new_lines", ":", "if", "not", "self", ".", "_first_write", ":", "self", ".", "stream", ".", "write", "(", "\"\\n\"", "*", "self", ".", "_new_lines", ")", "self", ".", "code_lineno"...
Write a string into the output stream.
[ "Write", "a", "string", "into", "the", "output", "stream", "." ]
[ "\"\"\"Write a string into the output stream.\"\"\"" ]
[ { "param": "self", "type": null }, { "param": "x", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "x", "type": null, "docstring": null, "docstring_tokens": [], ...
b39478d739df676db55ce5498a2aee813edb7c8c
sunlongbo/chromium
third_party/jinja2/compiler.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
newline
null
def newline(self, node=None, extra=0): """Add one or more newlines before the next write.""" self._new_lines = max(self._new_lines, 1 + extra) if node is not None and node.lineno != self._last_line: self._write_debug_info = node.lineno self._last_line = node.lineno
Add one or more newlines before the next write.
Add one or more newlines before the next write.
[ "Add", "one", "or", "more", "newlines", "before", "the", "next", "write", "." ]
def newline(self, node=None, extra=0): self._new_lines = max(self._new_lines, 1 + extra) if node is not None and node.lineno != self._last_line: self._write_debug_info = node.lineno self._last_line = node.lineno
[ "def", "newline", "(", "self", ",", "node", "=", "None", ",", "extra", "=", "0", ")", ":", "self", ".", "_new_lines", "=", "max", "(", "self", ".", "_new_lines", ",", "1", "+", "extra", ")", "if", "node", "is", "not", "None", "and", "node", ".", ...
Add one or more newlines before the next write.
[ "Add", "one", "or", "more", "newlines", "before", "the", "next", "write", "." ]
[ "\"\"\"Add one or more newlines before the next write.\"\"\"" ]
[ { "param": "self", "type": null }, { "param": "node", "type": null }, { "param": "extra", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "node", "type": null, "docstring": null, "docstring_tokens": [...
b39478d739df676db55ce5498a2aee813edb7c8c
sunlongbo/chromium
third_party/jinja2/compiler.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
signature
null
def signature(self, node, frame, extra_kwargs=None): """Writes a function call to the stream for the current node. A leading comma is added automatically. The extra keyword arguments may not include python keywords otherwise a syntax error could occur. The extra keyword arguments shoul...
Writes a function call to the stream for the current node. A leading comma is added automatically. The extra keyword arguments may not include python keywords otherwise a syntax error could occur. The extra keyword arguments should be given as python dict.
Writes a function call to the stream for the current node. A leading comma is added automatically. The extra keyword arguments may not include python keywords otherwise a syntax error could occur. The extra keyword arguments should be given as python dict.
[ "Writes", "a", "function", "call", "to", "the", "stream", "for", "the", "current", "node", ".", "A", "leading", "comma", "is", "added", "automatically", ".", "The", "extra", "keyword", "arguments", "may", "not", "include", "python", "keywords", "otherwise", ...
def signature(self, node, frame, extra_kwargs=None): kwarg_workaround = False for kwarg in chain((x.key for x in node.kwargs), extra_kwargs or ()): if is_python_keyword(kwarg): kwarg_workaround = True break for arg in node.args: self.write(...
[ "def", "signature", "(", "self", ",", "node", ",", "frame", ",", "extra_kwargs", "=", "None", ")", ":", "kwarg_workaround", "=", "False", "for", "kwarg", "in", "chain", "(", "(", "x", ".", "key", "for", "x", "in", "node", ".", "kwargs", ")", ",", "...
Writes a function call to the stream for the current node.
[ "Writes", "a", "function", "call", "to", "the", "stream", "for", "the", "current", "node", "." ]
[ "\"\"\"Writes a function call to the stream for the current node.\n A leading comma is added automatically. The extra keyword\n arguments may not include python keywords otherwise a syntax\n error could occur. The extra keyword arguments should be given\n as python dict.\n \"\"\...
[ { "param": "self", "type": null }, { "param": "node", "type": null }, { "param": "frame", "type": null }, { "param": "extra_kwargs", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "node", "type": null, "docstring": null, "docstring_tokens": [...
b39478d739df676db55ce5498a2aee813edb7c8c
sunlongbo/chromium
third_party/jinja2/compiler.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
macro_body
<not_specific>
def macro_body(self, node, frame): """Dump the function def of a macro or call block.""" frame = frame.inner() frame.symbols.analyze_node(node) macro_ref = MacroRef(node) explicit_caller = None skip_special_params = set() args = [] for idx, arg in enumera...
Dump the function def of a macro or call block.
Dump the function def of a macro or call block.
[ "Dump", "the", "function", "def", "of", "a", "macro", "or", "call", "block", "." ]
def macro_body(self, node, frame): frame = frame.inner() frame.symbols.analyze_node(node) macro_ref = MacroRef(node) explicit_caller = None skip_special_params = set() args = [] for idx, arg in enumerate(node.args): if arg.name == "caller": ...
[ "def", "macro_body", "(", "self", ",", "node", ",", "frame", ")", ":", "frame", "=", "frame", ".", "inner", "(", ")", "frame", ".", "symbols", ".", "analyze_node", "(", "node", ")", "macro_ref", "=", "MacroRef", "(", "node", ")", "explicit_caller", "="...
Dump the function def of a macro or call block.
[ "Dump", "the", "function", "def", "of", "a", "macro", "or", "call", "block", "." ]
[ "\"\"\"Dump the function def of a macro or call block.\"\"\"", "# In older Jinja versions there was a bug that allowed caller", "# to retain the special behavior even if it was mentioned in", "# the argument list. However thankfully this was only really", "# working if it was the last argument. So we are ...
[ { "param": "self", "type": null }, { "param": "node", "type": null }, { "param": "frame", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "node", "type": null, "docstring": null, "docstring_tokens": [...
b39478d739df676db55ce5498a2aee813edb7c8c
sunlongbo/chromium
third_party/jinja2/compiler.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
macro_def
null
def macro_def(self, macro_ref, frame): """Dump the macro definition for the def created by macro_body.""" arg_tuple = ", ".join(repr(x.name) for x in macro_ref.node.args) name = getattr(macro_ref.node, "name", None) if len(macro_ref.node.args) == 1: arg_tuple += "," s...
Dump the macro definition for the def created by macro_body.
Dump the macro definition for the def created by macro_body.
[ "Dump", "the", "macro", "definition", "for", "the", "def", "created", "by", "macro_body", "." ]
def macro_def(self, macro_ref, frame): arg_tuple = ", ".join(repr(x.name) for x in macro_ref.node.args) name = getattr(macro_ref.node, "name", None) if len(macro_ref.node.args) == 1: arg_tuple += "," self.write( "Macro(environment, macro, %r, (%s), %r, %r, %r, " ...
[ "def", "macro_def", "(", "self", ",", "macro_ref", ",", "frame", ")", ":", "arg_tuple", "=", "\", \"", ".", "join", "(", "repr", "(", "x", ".", "name", ")", "for", "x", "in", "macro_ref", ".", "node", ".", "args", ")", "name", "=", "getattr", "(", ...
Dump the macro definition for the def created by macro_body.
[ "Dump", "the", "macro", "definition", "for", "the", "def", "created", "by", "macro_body", "." ]
[ "\"\"\"Dump the macro definition for the def created by macro_body.\"\"\"" ]
[ { "param": "self", "type": null }, { "param": "macro_ref", "type": null }, { "param": "frame", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "macro_ref", "type": null, "docstring": null, "docstring_token...
b39478d739df676db55ce5498a2aee813edb7c8c
sunlongbo/chromium
third_party/jinja2/compiler.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
position
<not_specific>
def position(self, node): """Return a human readable position for the node.""" rv = "line %d" % node.lineno if self.name is not None: rv += " in " + repr(self.name) return rv
Return a human readable position for the node.
Return a human readable position for the node.
[ "Return", "a", "human", "readable", "position", "for", "the", "node", "." ]
def position(self, node): rv = "line %d" % node.lineno if self.name is not None: rv += " in " + repr(self.name) return rv
[ "def", "position", "(", "self", ",", "node", ")", ":", "rv", "=", "\"line %d\"", "%", "node", ".", "lineno", "if", "self", ".", "name", "is", "not", "None", ":", "rv", "+=", "\" in \"", "+", "repr", "(", "self", ".", "name", ")", "return", "rv" ]
Return a human readable position for the node.
[ "Return", "a", "human", "readable", "position", "for", "the", "node", "." ]
[ "\"\"\"Return a human readable position for the node.\"\"\"" ]
[ { "param": "self", "type": null }, { "param": "node", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "node", "type": null, "docstring": null, "docstring_tokens": [...
b39478d739df676db55ce5498a2aee813edb7c8c
sunlongbo/chromium
third_party/jinja2/compiler.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
write_commons
null
def write_commons(self): """Writes a common preamble that is used by root and block functions. Primarily this sets up common local helpers and enforces a generator through a dead branch. """ self.writeline("resolve = context.resolve_or_missing") self.writeline("undefined ...
Writes a common preamble that is used by root and block functions. Primarily this sets up common local helpers and enforces a generator through a dead branch.
Writes a common preamble that is used by root and block functions. Primarily this sets up common local helpers and enforces a generator through a dead branch.
[ "Writes", "a", "common", "preamble", "that", "is", "used", "by", "root", "and", "block", "functions", ".", "Primarily", "this", "sets", "up", "common", "local", "helpers", "and", "enforces", "a", "generator", "through", "a", "dead", "branch", "." ]
def write_commons(self): self.writeline("resolve = context.resolve_or_missing") self.writeline("undefined = environment.undefined") self.writeline("cond_expr_undefined = Undefined") self.writeline("if 0: yield None")
[ "def", "write_commons", "(", "self", ")", ":", "self", ".", "writeline", "(", "\"resolve = context.resolve_or_missing\"", ")", "self", ".", "writeline", "(", "\"undefined = environment.undefined\"", ")", "self", ".", "writeline", "(", "\"cond_expr_undefined = Undefined\""...
Writes a common preamble that is used by root and block functions.
[ "Writes", "a", "common", "preamble", "that", "is", "used", "by", "root", "and", "block", "functions", "." ]
[ "\"\"\"Writes a common preamble that is used by root and block functions.\n Primarily this sets up common local helpers and enforces a generator\n through a dead branch.\n \"\"\"", "# always use the standard Undefined class for the implicit else of", "# conditional expressions" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
b39478d739df676db55ce5498a2aee813edb7c8c
sunlongbo/chromium
third_party/jinja2/compiler.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
push_parameter_definitions
null
def push_parameter_definitions(self, frame): """Pushes all parameter targets from the given frame into a local stack that permits tracking of yet to be assigned parameters. In particular this enables the optimization from `visit_Name` to skip undefined expressions for parameters in macr...
Pushes all parameter targets from the given frame into a local stack that permits tracking of yet to be assigned parameters. In particular this enables the optimization from `visit_Name` to skip undefined expressions for parameters in macros as macros can reference otherwise unbound par...
Pushes all parameter targets from the given frame into a local stack that permits tracking of yet to be assigned parameters. In particular this enables the optimization from `visit_Name` to skip undefined expressions for parameters in macros as macros can reference otherwise unbound parameters.
[ "Pushes", "all", "parameter", "targets", "from", "the", "given", "frame", "into", "a", "local", "stack", "that", "permits", "tracking", "of", "yet", "to", "be", "assigned", "parameters", ".", "In", "particular", "this", "enables", "the", "optimization", "from"...
def push_parameter_definitions(self, frame): self._param_def_block.append(frame.symbols.dump_param_targets())
[ "def", "push_parameter_definitions", "(", "self", ",", "frame", ")", ":", "self", ".", "_param_def_block", ".", "append", "(", "frame", ".", "symbols", ".", "dump_param_targets", "(", ")", ")" ]
Pushes all parameter targets from the given frame into a local stack that permits tracking of yet to be assigned parameters.
[ "Pushes", "all", "parameter", "targets", "from", "the", "given", "frame", "into", "a", "local", "stack", "that", "permits", "tracking", "of", "yet", "to", "be", "assigned", "parameters", "." ]
[ "\"\"\"Pushes all parameter targets from the given frame into a local\n stack that permits tracking of yet to be assigned parameters. In\n particular this enables the optimization from `visit_Name` to skip\n undefined expressions for parameters in macros as macros can reference\n otherw...
[ { "param": "self", "type": null }, { "param": "frame", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "frame", "type": null, "docstring": null, "docstring_tokens": ...
b39478d739df676db55ce5498a2aee813edb7c8c
sunlongbo/chromium
third_party/jinja2/compiler.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
mark_parameter_stored
null
def mark_parameter_stored(self, target): """Marks a parameter in the current parameter definitions as stored. This will skip the enforced undefined checks. """ if self._param_def_block: self._param_def_block[-1].discard(target)
Marks a parameter in the current parameter definitions as stored. This will skip the enforced undefined checks.
Marks a parameter in the current parameter definitions as stored. This will skip the enforced undefined checks.
[ "Marks", "a", "parameter", "in", "the", "current", "parameter", "definitions", "as", "stored", ".", "This", "will", "skip", "the", "enforced", "undefined", "checks", "." ]
def mark_parameter_stored(self, target): if self._param_def_block: self._param_def_block[-1].discard(target)
[ "def", "mark_parameter_stored", "(", "self", ",", "target", ")", ":", "if", "self", ".", "_param_def_block", ":", "self", ".", "_param_def_block", "[", "-", "1", "]", ".", "discard", "(", "target", ")" ]
Marks a parameter in the current parameter definitions as stored.
[ "Marks", "a", "parameter", "in", "the", "current", "parameter", "definitions", "as", "stored", "." ]
[ "\"\"\"Marks a parameter in the current parameter definitions as stored.\n This will skip the enforced undefined checks.\n \"\"\"" ]
[ { "param": "self", "type": null }, { "param": "target", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "target", "type": null, "docstring": null, "docstring_tokens":...
b39478d739df676db55ce5498a2aee813edb7c8c
sunlongbo/chromium
third_party/jinja2/compiler.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
parameter_is_undeclared
<not_specific>
def parameter_is_undeclared(self, target): """Checks if a given target is an undeclared parameter.""" if not self._param_def_block: return False return target in self._param_def_block[-1]
Checks if a given target is an undeclared parameter.
Checks if a given target is an undeclared parameter.
[ "Checks", "if", "a", "given", "target", "is", "an", "undeclared", "parameter", "." ]
def parameter_is_undeclared(self, target): if not self._param_def_block: return False return target in self._param_def_block[-1]
[ "def", "parameter_is_undeclared", "(", "self", ",", "target", ")", ":", "if", "not", "self", ".", "_param_def_block", ":", "return", "False", "return", "target", "in", "self", ".", "_param_def_block", "[", "-", "1", "]" ]
Checks if a given target is an undeclared parameter.
[ "Checks", "if", "a", "given", "target", "is", "an", "undeclared", "parameter", "." ]
[ "\"\"\"Checks if a given target is an undeclared parameter.\"\"\"" ]
[ { "param": "self", "type": null }, { "param": "target", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "target", "type": null, "docstring": null, "docstring_tokens":...
b39478d739df676db55ce5498a2aee813edb7c8c
sunlongbo/chromium
third_party/jinja2/compiler.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
pop_assign_tracking
<not_specific>
def pop_assign_tracking(self, frame): """Pops the topmost level for assignment tracking and updates the context variables if necessary. """ vars = self._assign_stack.pop() if not frame.toplevel or not vars: return public_names = [x for x in vars if x[:1] != "_...
Pops the topmost level for assignment tracking and updates the context variables if necessary.
Pops the topmost level for assignment tracking and updates the context variables if necessary.
[ "Pops", "the", "topmost", "level", "for", "assignment", "tracking", "and", "updates", "the", "context", "variables", "if", "necessary", "." ]
def pop_assign_tracking(self, frame): vars = self._assign_stack.pop() if not frame.toplevel or not vars: return public_names = [x for x in vars if x[:1] != "_"] if len(vars) == 1: name = next(iter(vars)) ref = frame.symbols.ref(name) self.w...
[ "def", "pop_assign_tracking", "(", "self", ",", "frame", ")", ":", "vars", "=", "self", ".", "_assign_stack", ".", "pop", "(", ")", "if", "not", "frame", ".", "toplevel", "or", "not", "vars", ":", "return", "public_names", "=", "[", "x", "for", "x", ...
Pops the topmost level for assignment tracking and updates the context variables if necessary.
[ "Pops", "the", "topmost", "level", "for", "assignment", "tracking", "and", "updates", "the", "context", "variables", "if", "necessary", "." ]
[ "\"\"\"Pops the topmost level for assignment tracking and updates the\n context variables if necessary.\n \"\"\"" ]
[ { "param": "self", "type": null }, { "param": "frame", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "frame", "type": null, "docstring": null, "docstring_tokens": ...
b39478d739df676db55ce5498a2aee813edb7c8c
sunlongbo/chromium
third_party/jinja2/compiler.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
visit_Block
<not_specific>
def visit_Block(self, node, frame): """Call a block and register it for the template.""" level = 0 if frame.toplevel: # if we know that we are a child template, there is no need to # check if we are one if self.has_known_extends: return ...
Call a block and register it for the template.
Call a block and register it for the template.
[ "Call", "a", "block", "and", "register", "it", "for", "the", "template", "." ]
def visit_Block(self, node, frame): level = 0 if frame.toplevel: if self.has_known_extends: return if self.extends_so_far > 0: self.writeline("if parent_template is None:") self.indent() level += 1 if node.sc...
[ "def", "visit_Block", "(", "self", ",", "node", ",", "frame", ")", ":", "level", "=", "0", "if", "frame", ".", "toplevel", ":", "if", "self", ".", "has_known_extends", ":", "return", "if", "self", ".", "extends_so_far", ">", "0", ":", "self", ".", "w...
Call a block and register it for the template.
[ "Call", "a", "block", "and", "register", "it", "for", "the", "template", "." ]
[ "\"\"\"Call a block and register it for the template.\"\"\"", "# if we know that we are a child template, there is no need to", "# check if we are one" ]
[ { "param": "self", "type": null }, { "param": "node", "type": null }, { "param": "frame", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "node", "type": null, "docstring": null, "docstring_tokens": [...
b39478d739df676db55ce5498a2aee813edb7c8c
sunlongbo/chromium
third_party/jinja2/compiler.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
_output_const_repr
<not_specific>
def _output_const_repr(self, group): """Given a group of constant values converted from ``Output`` child nodes, produce a string to write to the template module source. """ return repr(concat(group))
Given a group of constant values converted from ``Output`` child nodes, produce a string to write to the template module source.
Given a group of constant values converted from ``Output`` child nodes, produce a string to write to the template module source.
[ "Given", "a", "group", "of", "constant", "values", "converted", "from", "`", "`", "Output", "`", "`", "child", "nodes", "produce", "a", "string", "to", "write", "to", "the", "template", "module", "source", "." ]
def _output_const_repr(self, group): return repr(concat(group))
[ "def", "_output_const_repr", "(", "self", ",", "group", ")", ":", "return", "repr", "(", "concat", "(", "group", ")", ")" ]
Given a group of constant values converted from ``Output`` child nodes, produce a string to write to the template module source.
[ "Given", "a", "group", "of", "constant", "values", "converted", "from", "`", "`", "Output", "`", "`", "child", "nodes", "produce", "a", "string", "to", "write", "to", "the", "template", "module", "source", "." ]
[ "\"\"\"Given a group of constant values converted from ``Output``\n child nodes, produce a string to write to the template module\n source.\n \"\"\"" ]
[ { "param": "self", "type": null }, { "param": "group", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "group", "type": null, "docstring": null, "docstring_tokens": ...
b39478d739df676db55ce5498a2aee813edb7c8c
sunlongbo/chromium
third_party/jinja2/compiler.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
_output_child_to_const
<not_specific>
def _output_child_to_const(self, node, frame, finalize): """Try to optimize a child of an ``Output`` node by trying to convert it to constant, finalized data at compile time. If :exc:`Impossible` is raised, the node is not constant and will be evaluated at runtime. Any other exception w...
Try to optimize a child of an ``Output`` node by trying to convert it to constant, finalized data at compile time. If :exc:`Impossible` is raised, the node is not constant and will be evaluated at runtime. Any other exception will also be evaluated at runtime for easier debugging. ...
Try to optimize a child of an ``Output`` node by trying to convert it to constant, finalized data at compile time. If :exc:`Impossible` is raised, the node is not constant and will be evaluated at runtime. Any other exception will also be evaluated at runtime for easier debugging.
[ "Try", "to", "optimize", "a", "child", "of", "an", "`", "`", "Output", "`", "`", "node", "by", "trying", "to", "convert", "it", "to", "constant", "finalized", "data", "at", "compile", "time", ".", "If", ":", "exc", ":", "`", "Impossible", "`", "is", ...
def _output_child_to_const(self, node, frame, finalize): const = node.as_const(frame.eval_ctx) if frame.eval_ctx.autoescape: const = escape(const) if isinstance(node, nodes.TemplateData): return text_type(const) return finalize.const(const)
[ "def", "_output_child_to_const", "(", "self", ",", "node", ",", "frame", ",", "finalize", ")", ":", "const", "=", "node", ".", "as_const", "(", "frame", ".", "eval_ctx", ")", "if", "frame", ".", "eval_ctx", ".", "autoescape", ":", "const", "=", "escape",...
Try to optimize a child of an ``Output`` node by trying to convert it to constant, finalized data at compile time.
[ "Try", "to", "optimize", "a", "child", "of", "an", "`", "`", "Output", "`", "`", "node", "by", "trying", "to", "convert", "it", "to", "constant", "finalized", "data", "at", "compile", "time", "." ]
[ "\"\"\"Try to optimize a child of an ``Output`` node by trying to\n convert it to constant, finalized data at compile time.\n\n If :exc:`Impossible` is raised, the node is not constant and\n will be evaluated at runtime. Any other exception will also be\n evaluated at runtime for easier ...
[ { "param": "self", "type": null }, { "param": "node", "type": null }, { "param": "frame", "type": null }, { "param": "finalize", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "node", "type": null, "docstring": null, "docstring_tokens": [...
b39478d739df676db55ce5498a2aee813edb7c8c
sunlongbo/chromium
third_party/jinja2/compiler.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
_output_child_pre
null
def _output_child_pre(self, node, frame, finalize): """Output extra source code before visiting a child of an ``Output`` node. """ if frame.eval_ctx.volatile: self.write("(escape if context.eval_ctx.autoescape else to_string)(") elif frame.eval_ctx.autoescape: ...
Output extra source code before visiting a child of an ``Output`` node.
Output extra source code before visiting a child of an ``Output`` node.
[ "Output", "extra", "source", "code", "before", "visiting", "a", "child", "of", "an", "`", "`", "Output", "`", "`", "node", "." ]
def _output_child_pre(self, node, frame, finalize): if frame.eval_ctx.volatile: self.write("(escape if context.eval_ctx.autoescape else to_string)(") elif frame.eval_ctx.autoescape: self.write("escape(") else: self.write("to_string(") if finalize.src i...
[ "def", "_output_child_pre", "(", "self", ",", "node", ",", "frame", ",", "finalize", ")", ":", "if", "frame", ".", "eval_ctx", ".", "volatile", ":", "self", ".", "write", "(", "\"(escape if context.eval_ctx.autoescape else to_string)(\"", ")", "elif", "frame", "...
Output extra source code before visiting a child of an ``Output`` node.
[ "Output", "extra", "source", "code", "before", "visiting", "a", "child", "of", "an", "`", "`", "Output", "`", "`", "node", "." ]
[ "\"\"\"Output extra source code before visiting a child of an\n ``Output`` node.\n \"\"\"" ]
[ { "param": "self", "type": null }, { "param": "node", "type": null }, { "param": "frame", "type": null }, { "param": "finalize", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "node", "type": null, "docstring": null, "docstring_tokens": [...
0c79fe96d7de96efbe6f9ecd4c96ed928c6cbbec
sunlongbo/chromium
tools/json_schema_compiler/cpp_bundle_generator.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
_RemoveUnneededFields
<not_specific>
def _RemoveUnneededFields(schema): """Returns a copy of |schema| with fields that aren't necessary at runtime removed. """ # Return a copy so that we don't pollute the global api object, which may be # used elsewhere. ret = copy.deepcopy(schema) if sys.version_info.major == 2: _RemoveKey(ret, 'descrip...
Returns a copy of |schema| with fields that aren't necessary at runtime removed.
Returns a copy of |schema| with fields that aren't necessary at runtime removed.
[ "Returns", "a", "copy", "of", "|schema|", "with", "fields", "that", "aren", "'", "t", "necessary", "at", "runtime", "removed", "." ]
def _RemoveUnneededFields(schema): ret = copy.deepcopy(schema) if sys.version_info.major == 2: _RemoveKey(ret, 'description', basestring) else: _RemoveKey(ret, 'description', str) _RemoveKey(ret, 'compiler_options', dict) _RemoveKey(ret, 'nodoc', bool) _RemoveKey(ret, 'nocompile', bool) _RemoveKey...
[ "def", "_RemoveUnneededFields", "(", "schema", ")", ":", "ret", "=", "copy", ".", "deepcopy", "(", "schema", ")", "if", "sys", ".", "version_info", ".", "major", "==", "2", ":", "_RemoveKey", "(", "ret", ",", "'description'", ",", "basestring", ")", "els...
Returns a copy of |schema| with fields that aren't necessary at runtime removed.
[ "Returns", "a", "copy", "of", "|schema|", "with", "fields", "that", "aren", "'", "t", "necessary", "at", "runtime", "removed", "." ]
[ "\"\"\"Returns a copy of |schema| with fields that aren't necessary at runtime\n removed.\n \"\"\"", "# Return a copy so that we don't pollute the global api object, which may be", "# used elsewhere." ]
[ { "param": "schema", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "schema", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
0c79fe96d7de96efbe6f9ecd4c96ed928c6cbbec
sunlongbo/chromium
tools/json_schema_compiler/cpp_bundle_generator.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
_PrefixSchemaWithNamespace
<not_specific>
def _PrefixSchemaWithNamespace(schema): """Modifies |schema| in place to prefix all types and references with a namespace, if they aren't already qualified. That is, in the tabs API, this will turn type Tab into tabs.Tab, but will leave the fully-qualified windows.Window as-is. """ assert isinstance(schema,...
Modifies |schema| in place to prefix all types and references with a namespace, if they aren't already qualified. That is, in the tabs API, this will turn type Tab into tabs.Tab, but will leave the fully-qualified windows.Window as-is.
Modifies |schema| in place to prefix all types and references with a namespace, if they aren't already qualified. That is, in the tabs API, this will turn type Tab into tabs.Tab, but will leave the fully-qualified windows.Window as-is.
[ "Modifies", "|schema|", "in", "place", "to", "prefix", "all", "types", "and", "references", "with", "a", "namespace", "if", "they", "aren", "'", "t", "already", "qualified", ".", "That", "is", "in", "the", "tabs", "API", "this", "will", "turn", "type", "...
def _PrefixSchemaWithNamespace(schema): assert isinstance(schema, dict), "Schema is unexpected type" namespace = schema['namespace'] def prefix(obj, key, mandatory): if not key in obj: assert not mandatory, ( 'Required key "%s" is not present in object.' % key) return assert type(...
[ "def", "_PrefixSchemaWithNamespace", "(", "schema", ")", ":", "assert", "isinstance", "(", "schema", ",", "dict", ")", ",", "\"Schema is unexpected type\"", "namespace", "=", "schema", "[", "'namespace'", "]", "def", "prefix", "(", "obj", ",", "key", ",", "man...
Modifies |schema| in place to prefix all types and references with a namespace, if they aren't already qualified.
[ "Modifies", "|schema|", "in", "place", "to", "prefix", "all", "types", "and", "references", "with", "a", "namespace", "if", "they", "aren", "'", "t", "already", "qualified", "." ]
[ "\"\"\"Modifies |schema| in place to prefix all types and references with a\n namespace, if they aren't already qualified. That is, in the tabs API, this\n will turn type Tab into tabs.Tab, but will leave the fully-qualified\n windows.Window as-is.\n \"\"\"" ]
[ { "param": "schema", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "schema", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
0c79fe96d7de96efbe6f9ecd4c96ed928c6cbbec
sunlongbo/chromium
tools/json_schema_compiler/cpp_bundle_generator.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
_GetPlatformIfdefs
<not_specific>
def _GetPlatformIfdefs(self, model_object): """Generates the "defined" conditional for an #if check if |model_object| has platform restrictions. Returns None if there are no restrictions. """ if model_object.platforms is None: return None ifdefs = [] for platform in model_object.platforms:...
Generates the "defined" conditional for an #if check if |model_object| has platform restrictions. Returns None if there are no restrictions.
Generates the "defined" conditional for an #if check if |model_object| has platform restrictions. Returns None if there are no restrictions.
[ "Generates", "the", "\"", "defined", "\"", "conditional", "for", "an", "#if", "check", "if", "|model_object|", "has", "platform", "restrictions", ".", "Returns", "None", "if", "there", "are", "no", "restrictions", "." ]
def _GetPlatformIfdefs(self, model_object): if model_object.platforms is None: return None ifdefs = [] for platform in model_object.platforms: if platform == Platforms.CHROMEOS: ifdefs.append('(defined(OS_CHROMEOS) && ' '!BUILDFLAG(IS_CHROMEOS_LACROS))') elif ...
[ "def", "_GetPlatformIfdefs", "(", "self", ",", "model_object", ")", ":", "if", "model_object", ".", "platforms", "is", "None", ":", "return", "None", "ifdefs", "=", "[", "]", "for", "platform", "in", "model_object", ".", "platforms", ":", "if", "platform", ...
Generates the "defined" conditional for an #if check if |model_object| has platform restrictions.
[ "Generates", "the", "\"", "defined", "\"", "conditional", "for", "an", "#if", "check", "if", "|model_object|", "has", "platform", "restrictions", "." ]
[ "\"\"\"Generates the \"defined\" conditional for an #if check if |model_object|\n has platform restrictions. Returns None if there are no restrictions.\n \"\"\"", "# TODO(https://crbug.com/1052397): For readability, this should become", "# defined(OS_CHROMEOS) && BUILDFLAG(IS_CHROMEOS_ASH).", "# TODO(ht...
[ { "param": "self", "type": null }, { "param": "model_object", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "model_object", "type": null, "docstring": null, "docstring_to...
0c79fe96d7de96efbe6f9ecd4c96ed928c6cbbec
sunlongbo/chromium
tools/json_schema_compiler/cpp_bundle_generator.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
_GenerateBundleClass
<not_specific>
def _GenerateBundleClass(self, class_name): '''Generates the C++ class name to use for a bundle class, taking into account the bundle's name. ''' return self._bundle_name + class_name
Generates the C++ class name to use for a bundle class, taking into account the bundle's name.
Generates the C++ class name to use for a bundle class, taking into account the bundle's name.
[ "Generates", "the", "C", "++", "class", "name", "to", "use", "for", "a", "bundle", "class", "taking", "into", "account", "the", "bundle", "'", "s", "name", "." ]
def _GenerateBundleClass(self, class_name): return self._bundle_name + class_name
[ "def", "_GenerateBundleClass", "(", "self", ",", "class_name", ")", ":", "return", "self", ".", "_bundle_name", "+", "class_name" ]
Generates the C++ class name to use for a bundle class, taking into account the bundle's name.
[ "Generates", "the", "C", "++", "class", "name", "to", "use", "for", "a", "bundle", "class", "taking", "into", "account", "the", "bundle", "'", "s", "name", "." ]
[ "'''Generates the C++ class name to use for a bundle class, taking into\n account the bundle's name.\n '''" ]
[ { "param": "self", "type": null }, { "param": "class_name", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "class_name", "type": null, "docstring": null, "docstring_toke...
0c79fe96d7de96efbe6f9ecd4c96ed928c6cbbec
sunlongbo/chromium
tools/json_schema_compiler/cpp_bundle_generator.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
_FormatNameAsConstant
<not_specific>
def _FormatNameAsConstant(name): """Formats a name to be a C++ constant of the form kConstantName""" name = '%s%s' % (name[0].upper(), name[1:]) return 'k%s' % re.sub('_[a-z]', lambda m: m.group(0)[1].upper(), name.replace('.', '_'))
Formats a name to be a C++ constant of the form kConstantName
Formats a name to be a C++ constant of the form kConstantName
[ "Formats", "a", "name", "to", "be", "a", "C", "++", "constant", "of", "the", "form", "kConstantName" ]
def _FormatNameAsConstant(name): name = '%s%s' % (name[0].upper(), name[1:]) return 'k%s' % re.sub('_[a-z]', lambda m: m.group(0)[1].upper(), name.replace('.', '_'))
[ "def", "_FormatNameAsConstant", "(", "name", ")", ":", "name", "=", "'%s%s'", "%", "(", "name", "[", "0", "]", ".", "upper", "(", ")", ",", "name", "[", "1", ":", "]", ")", "return", "'k%s'", "%", "re", ".", "sub", "(", "'_[a-z]'", ",", "lambda",...
Formats a name to be a C++ constant of the form kConstantName
[ "Formats", "a", "name", "to", "be", "a", "C", "++", "constant", "of", "the", "form", "kConstantName" ]
[ "\"\"\"Formats a name to be a C++ constant of the form kConstantName\"\"\"" ]
[ { "param": "name", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "name", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
e0e2ce1b80ccdb3fb4ea3d1e0fde7fe1193244c4
sunlongbo/chromium
third_party/blink/tools/blinkpy/common/find_files.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
find
<not_specific>
def find(filesystem, base_dir, paths=None, skipped_directories=None, file_filter=None, directory_sort_key=None): """Finds the set of tests under a given list of sub-paths. Args: filesystem: A FileSystem instance. base_dir: A base directory to search ...
Finds the set of tests under a given list of sub-paths. Args: filesystem: A FileSystem instance. base_dir: A base directory to search under. paths: A list of path expressions relative to |base_dir|. Glob patterns are OK, as are path expressions with forward slashes on Windows. ...
Finds the set of tests under a given list of sub-paths.
[ "Finds", "the", "set", "of", "tests", "under", "a", "given", "list", "of", "sub", "-", "paths", "." ]
def find(filesystem, base_dir, paths=None, skipped_directories=None, file_filter=None, directory_sort_key=None): paths = paths or ['*'] skipped_directories = skipped_directories or set() absolute_paths = _normalize(filesystem, base_dir, paths) return _normali...
[ "def", "find", "(", "filesystem", ",", "base_dir", ",", "paths", "=", "None", ",", "skipped_directories", "=", "None", ",", "file_filter", "=", "None", ",", "directory_sort_key", "=", "None", ")", ":", "paths", "=", "paths", "or", "[", "'*'", "]", "skipp...
Finds the set of tests under a given list of sub-paths.
[ "Finds", "the", "set", "of", "tests", "under", "a", "given", "list", "of", "sub", "-", "paths", "." ]
[ "\"\"\"Finds the set of tests under a given list of sub-paths.\n\n Args:\n filesystem: A FileSystem instance.\n base_dir: A base directory to search under.\n paths: A list of path expressions relative to |base_dir|. Glob patterns\n are OK, as are path expressions with forward slas...
[ { "param": "filesystem", "type": null }, { "param": "base_dir", "type": null }, { "param": "paths", "type": null }, { "param": "skipped_directories", "type": null }, { "param": "file_filter", "type": null }, { "param": "directory_sort_key", "type":...
{ "returns": [ { "docstring": "An iterable of absolute paths that were found.", "docstring_tokens": [ "An", "iterable", "of", "absolute", "paths", "that", "were", "found", "." ], "type": null } ], "raises": [],...
e0e2ce1b80ccdb3fb4ea3d1e0fde7fe1193244c4
sunlongbo/chromium
third_party/blink/tools/blinkpy/common/find_files.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
_normalized_find
<not_specific>
def _normalized_find(filesystem, paths, skipped_directories, file_filter, directory_sort_key): """Finds the set of tests under the given list of paths.""" paths_to_walk = itertools.chain(*(filesystem.glob(path) for path in paths)) def sort_by_directory_key(files_list): if direc...
Finds the set of tests under the given list of paths.
Finds the set of tests under the given list of paths.
[ "Finds", "the", "set", "of", "tests", "under", "the", "given", "list", "of", "paths", "." ]
def _normalized_find(filesystem, paths, skipped_directories, file_filter, directory_sort_key): paths_to_walk = itertools.chain(*(filesystem.glob(path) for path in paths)) def sort_by_directory_key(files_list): if directory_sort_key: files_list.sort(key=directory_sort_key...
[ "def", "_normalized_find", "(", "filesystem", ",", "paths", ",", "skipped_directories", ",", "file_filter", ",", "directory_sort_key", ")", ":", "paths_to_walk", "=", "itertools", ".", "chain", "(", "*", "(", "filesystem", ".", "glob", "(", "path", ")", "for",...
Finds the set of tests under the given list of paths.
[ "Finds", "the", "set", "of", "tests", "under", "the", "given", "list", "of", "paths", "." ]
[ "\"\"\"Finds the set of tests under the given list of paths.\"\"\"" ]
[ { "param": "filesystem", "type": null }, { "param": "paths", "type": null }, { "param": "skipped_directories", "type": null }, { "param": "file_filter", "type": null }, { "param": "directory_sort_key", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "filesystem", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "paths", "type": null, "docstring": null, "docstring_tok...
9a17bf39bc1a1e53ce7931246f53c5493ab7d2f5
sunlongbo/chromium
third_party/android_crazy_linker/src/tests/generate_test_elf_hash_tables.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
ElfHash
<not_specific>
def ElfHash(name): """Compute the ELF hash of a given input string.""" h = 0 for c in name: h = (h << 4) + ord(c) g = h & 0xf0000000 h ^= g h ^= g >> 24 return h & 0xffffffff
Compute the ELF hash of a given input string.
Compute the ELF hash of a given input string.
[ "Compute", "the", "ELF", "hash", "of", "a", "given", "input", "string", "." ]
def ElfHash(name): h = 0 for c in name: h = (h << 4) + ord(c) g = h & 0xf0000000 h ^= g h ^= g >> 24 return h & 0xffffffff
[ "def", "ElfHash", "(", "name", ")", ":", "h", "=", "0", "for", "c", "in", "name", ":", "h", "=", "(", "h", "<<", "4", ")", "+", "ord", "(", "c", ")", "g", "=", "h", "&", "0xf0000000", "h", "^=", "g", "h", "^=", "g", ">>", "24", "return", ...
Compute the ELF hash of a given input string.
[ "Compute", "the", "ELF", "hash", "of", "a", "given", "input", "string", "." ]
[ "\"\"\"Compute the ELF hash of a given input string.\"\"\"" ]
[ { "param": "name", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "name", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
1f0db200549bc198f81c9c20f345477ac000bae5
sunlongbo/chromium
mojo/public/tools/mojom/mojom/parse/ast.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
Insert
null
def Insert(self, item): """Inserts item at the front of the list.""" assert isinstance(item, self._list_item_type) self.items.insert(0, item) self._UpdateFilenameAndLineno()
Inserts item at the front of the list.
Inserts item at the front of the list.
[ "Inserts", "item", "at", "the", "front", "of", "the", "list", "." ]
def Insert(self, item): assert isinstance(item, self._list_item_type) self.items.insert(0, item) self._UpdateFilenameAndLineno()
[ "def", "Insert", "(", "self", ",", "item", ")", ":", "assert", "isinstance", "(", "item", ",", "self", ".", "_list_item_type", ")", "self", ".", "items", ".", "insert", "(", "0", ",", "item", ")", "self", ".", "_UpdateFilenameAndLineno", "(", ")" ]
Inserts item at the front of the list.
[ "Inserts", "item", "at", "the", "front", "of", "the", "list", "." ]
[ "\"\"\"Inserts item at the front of the list.\"\"\"" ]
[ { "param": "self", "type": null }, { "param": "item", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "item", "type": null, "docstring": null, "docstring_tokens": [...
1f0db200549bc198f81c9c20f345477ac000bae5
sunlongbo/chromium
mojo/public/tools/mojom/mojom/parse/ast.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
Append
null
def Append(self, item): """Appends item to the end of the list.""" assert isinstance(item, self._list_item_type) self.items.append(item) self._UpdateFilenameAndLineno()
Appends item to the end of the list.
Appends item to the end of the list.
[ "Appends", "item", "to", "the", "end", "of", "the", "list", "." ]
def Append(self, item): assert isinstance(item, self._list_item_type) self.items.append(item) self._UpdateFilenameAndLineno()
[ "def", "Append", "(", "self", ",", "item", ")", ":", "assert", "isinstance", "(", "item", ",", "self", ".", "_list_item_type", ")", "self", ".", "items", ".", "append", "(", "item", ")", "self", ".", "_UpdateFilenameAndLineno", "(", ")" ]
Appends item to the end of the list.
[ "Appends", "item", "to", "the", "end", "of", "the", "list", "." ]
[ "\"\"\"Appends item to the end of the list.\"\"\"" ]
[ { "param": "self", "type": null }, { "param": "item", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "item", "type": null, "docstring": null, "docstring_tokens": [...
1f1ae3be0431386d38aaa4899ad599be2f6a3297
sunlongbo/chromium
ios/build/bots/scripts/file_util.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
zip_and_remove_folder
null
def zip_and_remove_folder(dir_path): """Zips folder storing in the parent folder and then removes original folder. Args: dir_path: (str) An absolute path to directory. """ shutil.make_archive( os.path.join(os.path.dirname(dir_path), os.path.basename(dir_path)), 'zip', dir_path) shutil.rmtree(...
Zips folder storing in the parent folder and then removes original folder. Args: dir_path: (str) An absolute path to directory.
Zips folder storing in the parent folder and then removes original folder.
[ "Zips", "folder", "storing", "in", "the", "parent", "folder", "and", "then", "removes", "original", "folder", "." ]
def zip_and_remove_folder(dir_path): shutil.make_archive( os.path.join(os.path.dirname(dir_path), os.path.basename(dir_path)), 'zip', dir_path) shutil.rmtree(dir_path)
[ "def", "zip_and_remove_folder", "(", "dir_path", ")", ":", "shutil", ".", "make_archive", "(", "os", ".", "path", ".", "join", "(", "os", ".", "path", ".", "dirname", "(", "dir_path", ")", ",", "os", ".", "path", ".", "basename", "(", "dir_path", ")", ...
Zips folder storing in the parent folder and then removes original folder.
[ "Zips", "folder", "storing", "in", "the", "parent", "folder", "and", "then", "removes", "original", "folder", "." ]
[ "\"\"\"Zips folder storing in the parent folder and then removes original folder.\n\n Args:\n dir_path: (str) An absolute path to directory.\n \"\"\"" ]
[ { "param": "dir_path", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "dir_path", "type": null, "docstring": "(str) An absolute path to directory.", "docstring_tokens": [ "(", "str", ")", "An", "absolute", "path", "to", "directory", ...
a07d68209917f4813a2a55ee1861c3568e5d4a3d
sunlongbo/chromium
third_party/blink/tools/blinkpy/web_tests/builder_list.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
load_default_builder_list
<not_specific>
def load_default_builder_list(filesystem): """Loads the set of builders from a JSON file and returns the BuilderList.""" path = PathFinder(filesystem).path_from_blink_tools( 'blinkpy', 'common', 'config', 'builders.json') contents = filesystem.read_text_file(path) return Buil...
Loads the set of builders from a JSON file and returns the BuilderList.
Loads the set of builders from a JSON file and returns the BuilderList.
[ "Loads", "the", "set", "of", "builders", "from", "a", "JSON", "file", "and", "returns", "the", "BuilderList", "." ]
def load_default_builder_list(filesystem): path = PathFinder(filesystem).path_from_blink_tools( 'blinkpy', 'common', 'config', 'builders.json') contents = filesystem.read_text_file(path) return BuilderList(json.loads(contents))
[ "def", "load_default_builder_list", "(", "filesystem", ")", ":", "path", "=", "PathFinder", "(", "filesystem", ")", ".", "path_from_blink_tools", "(", "'blinkpy'", ",", "'common'", ",", "'config'", ",", "'builders.json'", ")", "contents", "=", "filesystem", ".", ...
Loads the set of builders from a JSON file and returns the BuilderList.
[ "Loads", "the", "set", "of", "builders", "from", "a", "JSON", "file", "and", "returns", "the", "BuilderList", "." ]
[ "\"\"\"Loads the set of builders from a JSON file and returns the BuilderList.\"\"\"" ]
[ { "param": "filesystem", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "filesystem", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
a07d68209917f4813a2a55ee1861c3568e5d4a3d
sunlongbo/chromium
third_party/blink/tools/blinkpy/web_tests/builder_list.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
builder_name_for_port_name
<not_specific>
def builder_name_for_port_name(self, target_port_name): """Returns a builder name for the given port name. Multiple builders can have the same port name; this function only returns builder names for non-try-bot builders, and it gives preference to non-debug builders. If no builder is fo...
Returns a builder name for the given port name. Multiple builders can have the same port name; this function only returns builder names for non-try-bot builders, and it gives preference to non-debug builders. If no builder is found, None is returned.
Returns a builder name for the given port name. Multiple builders can have the same port name; this function only returns builder names for non-try-bot builders, and it gives preference to non-debug builders. If no builder is found, None is returned.
[ "Returns", "a", "builder", "name", "for", "the", "given", "port", "name", ".", "Multiple", "builders", "can", "have", "the", "same", "port", "name", ";", "this", "function", "only", "returns", "builder", "names", "for", "non", "-", "try", "-", "bot", "bu...
def builder_name_for_port_name(self, target_port_name): debug_builder_name = None for builder_name, builder_info in list(self._builders.items()): if builder_info.get('is_try_builder'): continue if builder_info['port_name'] == target_port_name: if '...
[ "def", "builder_name_for_port_name", "(", "self", ",", "target_port_name", ")", ":", "debug_builder_name", "=", "None", "for", "builder_name", ",", "builder_info", "in", "list", "(", "self", ".", "_builders", ".", "items", "(", ")", ")", ":", "if", "builder_in...
Returns a builder name for the given port name.
[ "Returns", "a", "builder", "name", "for", "the", "given", "port", "name", "." ]
[ "\"\"\"Returns a builder name for the given port name.\n\n Multiple builders can have the same port name; this function only\n returns builder names for non-try-bot builders, and it gives preference\n to non-debug builders. If no builder is found, None is returned.\n \"\"\"" ]
[ { "param": "self", "type": null }, { "param": "target_port_name", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "target_port_name", "type": null, "docstring": null, "docstrin...
a07d68209917f4813a2a55ee1861c3568e5d4a3d
sunlongbo/chromium
third_party/blink/tools/blinkpy/web_tests/builder_list.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
version_specifier_for_port_name
<not_specific>
def version_specifier_for_port_name(self, target_port_name): """Returns the OS version specifier for a given port name. This just uses information in the builder list, and it returns the version specifier for the first builder that matches, even if it's a try bot builder. """ ...
Returns the OS version specifier for a given port name. This just uses information in the builder list, and it returns the version specifier for the first builder that matches, even if it's a try bot builder.
Returns the OS version specifier for a given port name. This just uses information in the builder list, and it returns the version specifier for the first builder that matches, even if it's a try bot builder.
[ "Returns", "the", "OS", "version", "specifier", "for", "a", "given", "port", "name", ".", "This", "just", "uses", "information", "in", "the", "builder", "list", "and", "it", "returns", "the", "version", "specifier", "for", "the", "first", "builder", "that", ...
def version_specifier_for_port_name(self, target_port_name): for _, builder_info in sorted(self._builders.items()): if builder_info['port_name'] == target_port_name: return builder_info['specifiers'][0] return None
[ "def", "version_specifier_for_port_name", "(", "self", ",", "target_port_name", ")", ":", "for", "_", ",", "builder_info", "in", "sorted", "(", "self", ".", "_builders", ".", "items", "(", ")", ")", ":", "if", "builder_info", "[", "'port_name'", "]", "==", ...
Returns the OS version specifier for a given port name.
[ "Returns", "the", "OS", "version", "specifier", "for", "a", "given", "port", "name", "." ]
[ "\"\"\"Returns the OS version specifier for a given port name.\n\n This just uses information in the builder list, and it returns\n the version specifier for the first builder that matches, even\n if it's a try bot builder.\n \"\"\"" ]
[ { "param": "self", "type": null }, { "param": "target_port_name", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "target_port_name", "type": null, "docstring": null, "docstrin...
a07d68209917f4813a2a55ee1861c3568e5d4a3d
sunlongbo/chromium
third_party/blink/tools/blinkpy/web_tests/builder_list.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
builder_name_for_specifiers
<not_specific>
def builder_name_for_specifiers(self, version, build_type, is_try_builder): """Returns the builder name for a give version and build type. Args: version: A string with the OS version specifier. e.g. "Trusty", "Win10". build_type: A string with the build type. e.g. "Debug" or "Re...
Returns the builder name for a give version and build type. Args: version: A string with the OS version specifier. e.g. "Trusty", "Win10". build_type: A string with the build type. e.g. "Debug" or "Release". Returns: The builder name if found, or an empty string if ...
Returns the builder name for a give version and build type.
[ "Returns", "the", "builder", "name", "for", "a", "give", "version", "and", "build", "type", "." ]
def builder_name_for_specifiers(self, version, build_type, is_try_builder): for builder_name, info in sorted(self._builders.items()): specifiers = set(spec.lower() for spec in info['specifiers']) is_try_builder_info = info.get('is_try_builder', False) if (version.lower() in s...
[ "def", "builder_name_for_specifiers", "(", "self", ",", "version", ",", "build_type", ",", "is_try_builder", ")", ":", "for", "builder_name", ",", "info", "in", "sorted", "(", "self", ".", "_builders", ".", "items", "(", ")", ")", ":", "specifiers", "=", "...
Returns the builder name for a give version and build type.
[ "Returns", "the", "builder", "name", "for", "a", "give", "version", "and", "build", "type", "." ]
[ "\"\"\"Returns the builder name for a give version and build type.\n\n Args:\n version: A string with the OS version specifier. e.g. \"Trusty\", \"Win10\".\n build_type: A string with the build type. e.g. \"Debug\" or \"Release\".\n\n Returns:\n The builder name if fou...
[ { "param": "self", "type": null }, { "param": "version", "type": null }, { "param": "build_type", "type": null }, { "param": "is_try_builder", "type": null } ]
{ "returns": [ { "docstring": "The builder name if found, or an empty string if no match was found.", "docstring_tokens": [ "The", "builder", "name", "if", "found", "or", "an", "empty", "string", "if", "no", ...
aa173eb7fbfc7748d670f955643d78964d42da83
sunlongbo/chromium
third_party/blink/tools/blinkpy/common/system/log_testing.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
assertMessages
null
def assertMessages(self, messages): """Asserts the current array of log messages, and clear its contents. We clear the log messages after asserting since they are no longer needed after asserting. This serves two purposes: (1) it simplifies the calling code when we want to check multip...
Asserts the current array of log messages, and clear its contents. We clear the log messages after asserting since they are no longer needed after asserting. This serves two purposes: (1) it simplifies the calling code when we want to check multiple logging calls in a single test metho...
Asserts the current array of log messages, and clear its contents. We clear the log messages after asserting since they are no longer needed after asserting. This serves two purposes: (1) it simplifies the calling code when we want to check multiple logging calls in a single test method, and (2) it lets us check in th...
[ "Asserts", "the", "current", "array", "of", "log", "messages", "and", "clear", "its", "contents", ".", "We", "clear", "the", "log", "messages", "after", "asserting", "since", "they", "are", "no", "longer", "needed", "after", "asserting", ".", "This", "serves...
def assertMessages(self, messages): try: self._test_stream.assertMessages(messages) finally: self._test_stream.messages = []
[ "def", "assertMessages", "(", "self", ",", "messages", ")", ":", "try", ":", "self", ".", "_test_stream", ".", "assertMessages", "(", "messages", ")", "finally", ":", "self", ".", "_test_stream", ".", "messages", "=", "[", "]" ]
Asserts the current array of log messages, and clear its contents.
[ "Asserts", "the", "current", "array", "of", "log", "messages", "and", "clear", "its", "contents", "." ]
[ "\"\"\"Asserts the current array of log messages, and clear its contents.\n\n We clear the log messages after asserting since they are no longer\n needed after asserting. This serves two purposes: (1) it simplifies\n the calling code when we want to check multiple logging calls in a\n s...
[ { "param": "self", "type": null }, { "param": "messages", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "messages", "type": null, "docstring": "A list of log message string...
7808300c2a77ab317ff33e14e1374eb4f194f786
sunlongbo/chromium
ios/build/bots/scripts/file_util_test.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
create_origin_profraw_file_if_not_exist
null
def create_origin_profraw_file_if_not_exist(self): """Creates the profraw file in the correct udid data folder to move if it doesn't exist """ if not os.path.exists(self.origin_profraw_file_path): with open(self.origin_profraw_file_path, 'w') as outfile: outfile.write("Some raw coverage da...
Creates the profraw file in the correct udid data folder to move if it doesn't exist
Creates the profraw file in the correct udid data folder to move if it doesn't exist
[ "Creates", "the", "profraw", "file", "in", "the", "correct", "udid", "data", "folder", "to", "move", "if", "it", "doesn", "'", "t", "exist" ]
def create_origin_profraw_file_if_not_exist(self): if not os.path.exists(self.origin_profraw_file_path): with open(self.origin_profraw_file_path, 'w') as outfile: outfile.write("Some raw coverage data.\n")
[ "def", "create_origin_profraw_file_if_not_exist", "(", "self", ")", ":", "if", "not", "os", ".", "path", ".", "exists", "(", "self", ".", "origin_profraw_file_path", ")", ":", "with", "open", "(", "self", ".", "origin_profraw_file_path", ",", "'w'", ")", "as",...
Creates the profraw file in the correct udid data folder to move if it doesn't exist
[ "Creates", "the", "profraw", "file", "in", "the", "correct", "udid", "data", "folder", "to", "move", "if", "it", "doesn", "'", "t", "exist" ]
[ "\"\"\"Creates the profraw file in the correct udid data folder to move if it\n doesn't exist\n \"\"\"" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
acb268c70cd7c7f9db3da6cba55a97c6bb9ba12e
sunlongbo/chromium
tools/metrics/histograms/merge_xml_test.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
testMergeFiles_WithXmlEvents
null
def testMergeFiles_WithXmlEvents(self): """Checks that the UkmEventNameHash enum is populated correctly. If ukm.xml is provided, populate a list of ints to the UkmEventNameHash enum where each value is a truncated hash of the event name and each label is the corresponding event name, with obsolete labe...
Checks that the UkmEventNameHash enum is populated correctly. If ukm.xml is provided, populate a list of ints to the UkmEventNameHash enum where each value is a truncated hash of the event name and each label is the corresponding event name, with obsolete label when applicable.
Checks that the UkmEventNameHash enum is populated correctly. If ukm.xml is provided, populate a list of ints to the UkmEventNameHash enum where each value is a truncated hash of the event name and each label is the corresponding event name, with obsolete label when applicable.
[ "Checks", "that", "the", "UkmEventNameHash", "enum", "is", "populated", "correctly", ".", "If", "ukm", ".", "xml", "is", "provided", "populate", "a", "list", "of", "ints", "to", "the", "UkmEventNameHash", "enum", "where", "each", "value", "is", "a", "truncat...
def testMergeFiles_WithXmlEvents(self): merged = merge_xml.PrettyPrintMergedFiles(histogram_paths.ALL_TEST_XMLS) expected_merged_xml = """ <histogram-configuration> <enums> <enum name="Enum1"> <int value="0" label="Value0"/> <int value="1" label="Value1"/> </enum> <enum name="TestEnum"> <int value="0" lab...
[ "def", "testMergeFiles_WithXmlEvents", "(", "self", ")", ":", "merged", "=", "merge_xml", ".", "PrettyPrintMergedFiles", "(", "histogram_paths", ".", "ALL_TEST_XMLS", ")", "expected_merged_xml", "=", "\"\"\"\n<histogram-configuration>\n\n<enums>\n\n<enum name=\"Enum1\">\n <int v...
Checks that the UkmEventNameHash enum is populated correctly.
[ "Checks", "that", "the", "UkmEventNameHash", "enum", "is", "populated", "correctly", "." ]
[ "\"\"\"Checks that the UkmEventNameHash enum is populated correctly.\n\n If ukm.xml is provided, populate a list of ints to the UkmEventNameHash enum\n where each value is a truncated hash of the event name and each label is the\n corresponding event name, with obsolete label when applicable.\n \"\"\"" ...
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
23261aaba1a245f0e1a9b2b3a267ab85376a857a
sunlongbo/chromium
testing/libfuzzer/gen_fuzzer_owners.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
GetAuthorFromGitBlame
<not_specific>
def GetAuthorFromGitBlame(blame_output): """Return author from git blame output.""" for line in blame_output.decode('utf-8').splitlines(): m = AUTHOR_REGEX.match(line) if m: return m.group(1) return None
Return author from git blame output.
Return author from git blame output.
[ "Return", "author", "from", "git", "blame", "output", "." ]
def GetAuthorFromGitBlame(blame_output): for line in blame_output.decode('utf-8').splitlines(): m = AUTHOR_REGEX.match(line) if m: return m.group(1) return None
[ "def", "GetAuthorFromGitBlame", "(", "blame_output", ")", ":", "for", "line", "in", "blame_output", ".", "decode", "(", "'utf-8'", ")", ".", "splitlines", "(", ")", ":", "m", "=", "AUTHOR_REGEX", ".", "match", "(", "line", ")", "if", "m", ":", "return", ...
Return author from git blame output.
[ "Return", "author", "from", "git", "blame", "output", "." ]
[ "\"\"\"Return author from git blame output.\"\"\"" ]
[ { "param": "blame_output", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "blame_output", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
23261aaba1a245f0e1a9b2b3a267ab85376a857a
sunlongbo/chromium
testing/libfuzzer/gen_fuzzer_owners.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
GetGitCommand
<not_specific>
def GetGitCommand(): """Returns a git command that does not need to be executed using shell=True. On non-Windows platforms: 'git'. On Windows: 'git.bat'. """ return 'git.bat' if sys.platform == 'win32' else 'git'
Returns a git command that does not need to be executed using shell=True. On non-Windows platforms: 'git'. On Windows: 'git.bat'.
Returns a git command that does not need to be executed using shell=True. On non-Windows platforms: 'git'.
[ "Returns", "a", "git", "command", "that", "does", "not", "need", "to", "be", "executed", "using", "shell", "=", "True", ".", "On", "non", "-", "Windows", "platforms", ":", "'", "git", "'", "." ]
def GetGitCommand(): return 'git.bat' if sys.platform == 'win32' else 'git'
[ "def", "GetGitCommand", "(", ")", ":", "return", "'git.bat'", "if", "sys", ".", "platform", "==", "'win32'", "else", "'git'" ]
Returns a git command that does not need to be executed using shell=True.
[ "Returns", "a", "git", "command", "that", "does", "not", "need", "to", "be", "executed", "using", "shell", "=", "True", "." ]
[ "\"\"\"Returns a git command that does not need to be executed using shell=True.\n On non-Windows platforms: 'git'. On Windows: 'git.bat'.\n \"\"\"" ]
[]
{ "returns": [], "raises": [], "params": [], "outlier_params": [], "others": [] }
23261aaba1a245f0e1a9b2b3a267ab85376a857a
sunlongbo/chromium
testing/libfuzzer/gen_fuzzer_owners.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
GetOwnersIfThirdParty
<not_specific>
def GetOwnersIfThirdParty(source): """Return owners using the closest OWNERS file if in third_party.""" match_index = source.find(THIRD_PARTY_SEARCH_STRING) if match_index == -1: # Not in third_party, skip. return None path_prefix = source[:match_index + len(THIRD_PARTY_SEARCH_STRING)] path_after_thi...
Return owners using the closest OWNERS file if in third_party.
Return owners using the closest OWNERS file if in third_party.
[ "Return", "owners", "using", "the", "closest", "OWNERS", "file", "if", "in", "third_party", "." ]
def GetOwnersIfThirdParty(source): match_index = source.find(THIRD_PARTY_SEARCH_STRING) if match_index == -1: return None path_prefix = source[:match_index + len(THIRD_PARTY_SEARCH_STRING)] path_after_third_party = source[len(path_prefix):].split(os.path.sep) while path_after_third_party: owners_file_...
[ "def", "GetOwnersIfThirdParty", "(", "source", ")", ":", "match_index", "=", "source", ".", "find", "(", "THIRD_PARTY_SEARCH_STRING", ")", "if", "match_index", "==", "-", "1", ":", "return", "None", "path_prefix", "=", "source", "[", ":", "match_index", "+", ...
Return owners using the closest OWNERS file if in third_party.
[ "Return", "owners", "using", "the", "closest", "OWNERS", "file", "if", "in", "third_party", "." ]
[ "\"\"\"Return owners using the closest OWNERS file if in third_party.\"\"\"", "# Not in third_party, skip.", "# Test all the paths after third_party/<libname>, making sure that we don't", "# test third_party/OWNERS itself, otherwise we'd default to CCing them for", "# all fuzzer issues without OWNERS, which...
[ { "param": "source", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "source", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
23261aaba1a245f0e1a9b2b3a267ab85376a857a
sunlongbo/chromium
testing/libfuzzer/gen_fuzzer_owners.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
GetOwnersForFuzzer
<not_specific>
def GetOwnersForFuzzer(sources): """Return owners given a list of sources as input.""" if not sources: return for source in sources: full_source_path = os.path.join(CHROMIUM_SRC_DIR, source) if not os.path.exists(full_source_path): continue with open(full_source_path, 'r') as source_file_h...
Return owners given a list of sources as input.
Return owners given a list of sources as input.
[ "Return", "owners", "given", "a", "list", "of", "sources", "as", "input", "." ]
def GetOwnersForFuzzer(sources): if not sources: return for source in sources: full_source_path = os.path.join(CHROMIUM_SRC_DIR, source) if not os.path.exists(full_source_path): continue with open(full_source_path, 'r') as source_file_handle: source_content = source_file_handle.read() ...
[ "def", "GetOwnersForFuzzer", "(", "sources", ")", ":", "if", "not", "sources", ":", "return", "for", "source", "in", "sources", ":", "full_source_path", "=", "os", ".", "path", ".", "join", "(", "CHROMIUM_SRC_DIR", ",", "source", ")", "if", "not", "os", ...
Return owners given a list of sources as input.
[ "Return", "owners", "given", "a", "list", "of", "sources", "as", "input", "." ]
[ "\"\"\"Return owners given a list of sources as input.\"\"\"", "# Found the fuzzer source (and not dependency of fuzzer).", "# File is not in working tree. Return owners for third_party.", "# git log --follow and --reverse don't work together and using just", "# --follow is too slow. Make a best estimate wi...
[ { "param": "sources", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "sources", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
23261aaba1a245f0e1a9b2b3a267ab85376a857a
sunlongbo/chromium
testing/libfuzzer/gen_fuzzer_owners.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
FindGroupsAndDepsInDeps
<not_specific>
def FindGroupsAndDepsInDeps(deps_list, build_dir): """Return list of groups, as well as their deps, from a list of deps.""" groups = [] deps_for_groups = {} for deps in deps_list: output = subprocess.check_output( [GNPath(), 'desc', '--fail-on-unused-args', build_dir, deps]).decode( ...
Return list of groups, as well as their deps, from a list of deps.
Return list of groups, as well as their deps, from a list of deps.
[ "Return", "list", "of", "groups", "as", "well", "as", "their", "deps", "from", "a", "list", "of", "deps", "." ]
def FindGroupsAndDepsInDeps(deps_list, build_dir): groups = [] deps_for_groups = {} for deps in deps_list: output = subprocess.check_output( [GNPath(), 'desc', '--fail-on-unused-args', build_dir, deps]).decode( 'utf8') needle = 'Type: ' for line in output.splitlines(): if...
[ "def", "FindGroupsAndDepsInDeps", "(", "deps_list", ",", "build_dir", ")", ":", "groups", "=", "[", "]", "deps_for_groups", "=", "{", "}", "for", "deps", "in", "deps_list", ":", "output", "=", "subprocess", ".", "check_output", "(", "[", "GNPath", "(", ")"...
Return list of groups, as well as their deps, from a list of deps.
[ "Return", "list", "of", "groups", "as", "well", "as", "their", "deps", "from", "a", "list", "of", "deps", "." ]
[ "\"\"\"Return list of groups, as well as their deps, from a list of deps.\"\"\"" ]
[ { "param": "deps_list", "type": null }, { "param": "build_dir", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "deps_list", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "build_dir", "type": null, "docstring": null, "docstring_...
23261aaba1a245f0e1a9b2b3a267ab85376a857a
sunlongbo/chromium
testing/libfuzzer/gen_fuzzer_owners.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
TraverseGroups
<not_specific>
def TraverseGroups(deps_list, build_dir): """Filter out groups from a deps list. Add groups' direct dependencies.""" full_deps_set = set(deps_list) deps_to_check = full_deps_set.copy() # Keep track of groups to break circular dependendies, if any. seen_groups = set() while deps_to_check: # Look for gr...
Filter out groups from a deps list. Add groups' direct dependencies.
Filter out groups from a deps list. Add groups' direct dependencies.
[ "Filter", "out", "groups", "from", "a", "deps", "list", ".", "Add", "groups", "'", "direct", "dependencies", "." ]
def TraverseGroups(deps_list, build_dir): full_deps_set = set(deps_list) deps_to_check = full_deps_set.copy() seen_groups = set() while deps_to_check: groups, deps_for_groups = FindGroupsAndDepsInDeps(deps_to_check, build_dir) groups = set(groups).difference(seen_groups) if not groups: break ...
[ "def", "TraverseGroups", "(", "deps_list", ",", "build_dir", ")", ":", "full_deps_set", "=", "set", "(", "deps_list", ")", "deps_to_check", "=", "full_deps_set", ".", "copy", "(", ")", "seen_groups", "=", "set", "(", ")", "while", "deps_to_check", ":", "grou...
Filter out groups from a deps list.
[ "Filter", "out", "groups", "from", "a", "deps", "list", "." ]
[ "\"\"\"Filter out groups from a deps list. Add groups' direct dependencies.\"\"\"", "# Keep track of groups to break circular dependendies, if any.", "# Look for groups from the deps set.", "# Update sets. Filter out groups from the full deps set.", "# Get the direct dependencies, and filter out known group...
[ { "param": "deps_list", "type": null }, { "param": "build_dir", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "deps_list", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "build_dir", "type": null, "docstring": null, "docstring_...
23261aaba1a245f0e1a9b2b3a267ab85376a857a
sunlongbo/chromium
testing/libfuzzer/gen_fuzzer_owners.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
GetSourcesFromDeps
<not_specific>
def GetSourcesFromDeps(deps_list, build_dir): """Return list of sources from parsing deps.""" if not deps_list: return None full_deps_list = TraverseGroups(deps_list, build_dir) all_sources = [] for deps in full_deps_list: output = subprocess.check_output( [GNPath(), 'desc', '--fail-on-unused...
Return list of sources from parsing deps.
Return list of sources from parsing deps.
[ "Return", "list", "of", "sources", "from", "parsing", "deps", "." ]
def GetSourcesFromDeps(deps_list, build_dir): if not deps_list: return None full_deps_list = TraverseGroups(deps_list, build_dir) all_sources = [] for deps in full_deps_list: output = subprocess.check_output( [GNPath(), 'desc', '--fail-on-unused-args', build_dir, deps, 'sources']) for source...
[ "def", "GetSourcesFromDeps", "(", "deps_list", ",", "build_dir", ")", ":", "if", "not", "deps_list", ":", "return", "None", "full_deps_list", "=", "TraverseGroups", "(", "deps_list", ",", "build_dir", ")", "all_sources", "=", "[", "]", "for", "deps", "in", "...
Return list of sources from parsing deps.
[ "Return", "list", "of", "sources", "from", "parsing", "deps", "." ]
[ "\"\"\"Return list of sources from parsing deps.\"\"\"" ]
[ { "param": "deps_list", "type": null }, { "param": "build_dir", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "deps_list", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "build_dir", "type": null, "docstring": null, "docstring_...
03c9de36c17d62b3f22b7f5b879121bbdfe4b190
sunlongbo/chromium
chrome/android/webapk/PRESUBMIT.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
_FindFileNamesInDirectory
<not_specific>
def _FindFileNamesInDirectory(input_api, dir_path, search_file_names): """ Searches the directory recursively for files with the passed-in file name (not file path) set. Returns the file names of any matches. """ matches = [] for _, _, file_names in input_api.os_walk(dir_path): for file_name in file_nam...
Searches the directory recursively for files with the passed-in file name (not file path) set. Returns the file names of any matches.
Searches the directory recursively for files with the passed-in file name (not file path) set. Returns the file names of any matches.
[ "Searches", "the", "directory", "recursively", "for", "files", "with", "the", "passed", "-", "in", "file", "name", "(", "not", "file", "path", ")", "set", ".", "Returns", "the", "file", "names", "of", "any", "matches", "." ]
def _FindFileNamesInDirectory(input_api, dir_path, search_file_names): matches = [] for _, _, file_names in input_api.os_walk(dir_path): for file_name in file_names: if file_name in search_file_names: matches.append(file_name) return matches
[ "def", "_FindFileNamesInDirectory", "(", "input_api", ",", "dir_path", ",", "search_file_names", ")", ":", "matches", "=", "[", "]", "for", "_", ",", "_", ",", "file_names", "in", "input_api", ".", "os_walk", "(", "dir_path", ")", ":", "for", "file_name", ...
Searches the directory recursively for files with the passed-in file name (not file path) set.
[ "Searches", "the", "directory", "recursively", "for", "files", "with", "the", "passed", "-", "in", "file", "name", "(", "not", "file", "path", ")", "set", "." ]
[ "\"\"\"\n Searches the directory recursively for files with the passed-in file name\n (not file path) set. Returns the file names of any matches.\n \"\"\"" ]
[ { "param": "input_api", "type": null }, { "param": "dir_path", "type": null }, { "param": "search_file_names", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "input_api", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "dir_path", "type": null, "docstring": null, "docstring_t...
03c9de36c17d62b3f22b7f5b879121bbdfe4b190
sunlongbo/chromium
chrome/android/webapk/PRESUBMIT.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
_CheckChromeUpdateTriggerRule
<not_specific>
def _CheckChromeUpdateTriggerRule(input_api, output_api): """ Check that if |expected_shell_apk_version| is updated it is the only change in the CL. """ if _CheckVersionVariableChanged(input_api, REQUEST_UPDATE_FOR_VERSION_LOCAL_PATH, REQUEST...
Check that if |expected_shell_apk_version| is updated it is the only change in the CL.
Check that if |expected_shell_apk_version| is updated it is the only change in the CL.
[ "Check", "that", "if", "|expected_shell_apk_version|", "is", "updated", "it", "is", "the", "only", "change", "in", "the", "CL", "." ]
def _CheckChromeUpdateTriggerRule(input_api, output_api): if _CheckVersionVariableChanged(input_api, REQUEST_UPDATE_FOR_VERSION_LOCAL_PATH, REQUEST_UPDATE_FOR_VERSION_VARIABLE): if (len(input_api.AffectedFiles()) != 1 or len(input_api.Aff...
[ "def", "_CheckChromeUpdateTriggerRule", "(", "input_api", ",", "output_api", ")", ":", "if", "_CheckVersionVariableChanged", "(", "input_api", ",", "REQUEST_UPDATE_FOR_VERSION_LOCAL_PATH", ",", "REQUEST_UPDATE_FOR_VERSION_VARIABLE", ")", ":", "if", "(", "len", "(", "input...
Check that if |expected_shell_apk_version| is updated it is the only change in the CL.
[ "Check", "that", "if", "|expected_shell_apk_version|", "is", "updated", "it", "is", "the", "only", "change", "in", "the", "CL", "." ]
[ "\"\"\"\n Check that if |expected_shell_apk_version| is updated it is the only\n change in the CL.\n \"\"\"" ]
[ { "param": "input_api", "type": null }, { "param": "output_api", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "input_api", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "output_api", "type": null, "docstring": null, "docstring...
03c9de36c17d62b3f22b7f5b879121bbdfe4b190
sunlongbo/chromium
chrome/android/webapk/PRESUBMIT.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
_CheckNoOverlappingFileNamesInResourceDirsRule
<not_specific>
def _CheckNoOverlappingFileNamesInResourceDirsRule(input_api, output_api): """ Checks that if a file has been added to a res/ directory that its file name is unique to the res/ directory. res/values/dimens.xml and res/values-v17/dimens.xml -> OK res/values/dimens.xml and libs/common/res_splash/values/dime...
Checks that if a file has been added to a res/ directory that its file name is unique to the res/ directory. res/values/dimens.xml and res/values-v17/dimens.xml -> OK res/values/dimens.xml and libs/common/res_splash/values/dimens.xml -> BAD
Checks that if a file has been added to a res/ directory that its file name is unique to the res/ directory.
[ "Checks", "that", "if", "a", "file", "has", "been", "added", "to", "a", "res", "/", "directory", "that", "its", "file", "name", "is", "unique", "to", "the", "res", "/", "directory", "." ]
def _CheckNoOverlappingFileNamesInResourceDirsRule(input_api, output_api): res_dir_file_names_map = {} for f in input_api.AffectedFiles(): local_path = input_api.os_path.relpath(f.AbsoluteLocalPath(), input_api.PresubmitLocalPath()) for res_dir_local_path in RES_DI...
[ "def", "_CheckNoOverlappingFileNamesInResourceDirsRule", "(", "input_api", ",", "output_api", ")", ":", "res_dir_file_names_map", "=", "{", "}", "for", "f", "in", "input_api", ".", "AffectedFiles", "(", ")", ":", "local_path", "=", "input_api", ".", "os_path", "."...
Checks that if a file has been added to a res/ directory that its file name is unique to the res/ directory.
[ "Checks", "that", "if", "a", "file", "has", "been", "added", "to", "a", "res", "/", "directory", "that", "its", "file", "name", "is", "unique", "to", "the", "res", "/", "directory", "." ]
[ "\"\"\"\n Checks that if a file has been added to a res/ directory that its file name\n is unique to the res/ directory.\n res/values/dimens.xml and res/values-v17/dimens.xml -> OK\n res/values/dimens.xml and libs/common/res_splash/values/dimens.xml -> BAD\n \"\"\"", "# Check for affected files with iden...
[ { "param": "input_api", "type": null }, { "param": "output_api", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "input_api", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "output_api", "type": null, "docstring": null, "docstring...
03c9de36c17d62b3f22b7f5b879121bbdfe4b190
sunlongbo/chromium
chrome/android/webapk/PRESUBMIT.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
_CommonChecks
<not_specific>
def _CommonChecks(input_api, output_api): """Checks common to both upload and commit.""" result = [] result.extend(_CheckChromeUpdateTriggerRule(input_api, output_api)) result.extend(_CheckCurrentVersionIncreaseRule(input_api, output_api)) result.extend(_CheckNoOverlappingFileNamesInResourceDirsRule(input_api...
Checks common to both upload and commit.
Checks common to both upload and commit.
[ "Checks", "common", "to", "both", "upload", "and", "commit", "." ]
def _CommonChecks(input_api, output_api): result = [] result.extend(_CheckChromeUpdateTriggerRule(input_api, output_api)) result.extend(_CheckCurrentVersionIncreaseRule(input_api, output_api)) result.extend(_CheckNoOverlappingFileNamesInResourceDirsRule(input_api, ...
[ "def", "_CommonChecks", "(", "input_api", ",", "output_api", ")", ":", "result", "=", "[", "]", "result", ".", "extend", "(", "_CheckChromeUpdateTriggerRule", "(", "input_api", ",", "output_api", ")", ")", "result", ".", "extend", "(", "_CheckCurrentVersionIncre...
Checks common to both upload and commit.
[ "Checks", "common", "to", "both", "upload", "and", "commit", "." ]
[ "\"\"\"Checks common to both upload and commit.\"\"\"" ]
[ { "param": "input_api", "type": null }, { "param": "output_api", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "input_api", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "output_api", "type": null, "docstring": null, "docstring...
a4d62a85b1b7997def2c09928efc3887744bdc55
sunlongbo/chromium
third_party/protobuf/python/google/protobuf/internal/message_test.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
testSortingRepeatedScalarFieldsDefaultComparator
null
def testSortingRepeatedScalarFieldsDefaultComparator(self, message_module): """Check some different types with the default comparator.""" message = message_module.TestAllTypes() # TODO(mattp): would testing more scalar types strengthen test? message.repeated_int32.append(1) message.repeated_int32.a...
Check some different types with the default comparator.
Check some different types with the default comparator.
[ "Check", "some", "different", "types", "with", "the", "default", "comparator", "." ]
def testSortingRepeatedScalarFieldsDefaultComparator(self, message_module): message = message_module.TestAllTypes() message.repeated_int32.append(1) message.repeated_int32.append(3) message.repeated_int32.append(2) message.repeated_int32.sort() self.assertEqual(message.repeated_int32[0], 1) ...
[ "def", "testSortingRepeatedScalarFieldsDefaultComparator", "(", "self", ",", "message_module", ")", ":", "message", "=", "message_module", ".", "TestAllTypes", "(", ")", "message", ".", "repeated_int32", ".", "append", "(", "1", ")", "message", ".", "repeated_int32"...
Check some different types with the default comparator.
[ "Check", "some", "different", "types", "with", "the", "default", "comparator", "." ]
[ "\"\"\"Check some different types with the default comparator.\"\"\"", "# TODO(mattp): would testing more scalar types strengthen test?" ]
[ { "param": "self", "type": null }, { "param": "message_module", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "message_module", "type": null, "docstring": null, "docstring_...
a4d62a85b1b7997def2c09928efc3887744bdc55
sunlongbo/chromium
third_party/protobuf/python/google/protobuf/internal/message_test.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
testSortingRepeatedCompositeFieldsCustomComparator
null
def testSortingRepeatedCompositeFieldsCustomComparator(self, message_module): """Check passing a custom comparator to sort a repeated composite field.""" message = message_module.TestAllTypes() message.repeated_nested_message.add().bb = 1 message.repeated_nested_message.add().bb = 3 message.repeate...
Check passing a custom comparator to sort a repeated composite field.
Check passing a custom comparator to sort a repeated composite field.
[ "Check", "passing", "a", "custom", "comparator", "to", "sort", "a", "repeated", "composite", "field", "." ]
def testSortingRepeatedCompositeFieldsCustomComparator(self, message_module): message = message_module.TestAllTypes() message.repeated_nested_message.add().bb = 1 message.repeated_nested_message.add().bb = 3 message.repeated_nested_message.add().bb = 2 message.repeated_nested_message.add().bb = 6 ...
[ "def", "testSortingRepeatedCompositeFieldsCustomComparator", "(", "self", ",", "message_module", ")", ":", "message", "=", "message_module", ".", "TestAllTypes", "(", ")", "message", ".", "repeated_nested_message", ".", "add", "(", ")", ".", "bb", "=", "1", "messa...
Check passing a custom comparator to sort a repeated composite field.
[ "Check", "passing", "a", "custom", "comparator", "to", "sort", "a", "repeated", "composite", "field", "." ]
[ "\"\"\"Check passing a custom comparator to sort a repeated composite field.\"\"\"" ]
[ { "param": "self", "type": null }, { "param": "message_module", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "message_module", "type": null, "docstring": null, "docstring_...
a4d62a85b1b7997def2c09928efc3887744bdc55
sunlongbo/chromium
third_party/protobuf/python/google/protobuf/internal/message_test.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
testReleasedNestedMessages
null
def testReleasedNestedMessages(self, message_module): """A case that lead to a segfault when a message detached from its parent container has itself a child container. """ m = message_module.NestedTestAllTypes() m = m.repeated_child.add() m = m.child m = m.repeated_child.add() self.asser...
A case that lead to a segfault when a message detached from its parent container has itself a child container.
A case that lead to a segfault when a message detached from its parent container has itself a child container.
[ "A", "case", "that", "lead", "to", "a", "segfault", "when", "a", "message", "detached", "from", "its", "parent", "container", "has", "itself", "a", "child", "container", "." ]
def testReleasedNestedMessages(self, message_module): m = message_module.NestedTestAllTypes() m = m.repeated_child.add() m = m.child m = m.repeated_child.add() self.assertEqual(m.payload.optional_int32, 0)
[ "def", "testReleasedNestedMessages", "(", "self", ",", "message_module", ")", ":", "m", "=", "message_module", ".", "NestedTestAllTypes", "(", ")", "m", "=", "m", ".", "repeated_child", ".", "add", "(", ")", "m", "=", "m", ".", "child", "m", "=", "m", ...
A case that lead to a segfault when a message detached from its parent container has itself a child container.
[ "A", "case", "that", "lead", "to", "a", "segfault", "when", "a", "message", "detached", "from", "its", "parent", "container", "has", "itself", "a", "child", "container", "." ]
[ "\"\"\"A case that lead to a segfault when a message detached from its parent\n container has itself a child container.\n \"\"\"" ]
[ { "param": "self", "type": null }, { "param": "message_module", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "message_module", "type": null, "docstring": null, "docstring_...
a4d62a85b1b7997def2c09928efc3887744bdc55
sunlongbo/chromium
third_party/protobuf/python/google/protobuf/internal/message_test.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
testAssignInvalidEnum
null
def testAssignInvalidEnum(self): """Assigning an invalid enum number is not allowed in proto2.""" m = unittest_pb2.TestAllTypes() # Proto2 can not assign unknown enum. with self.assertRaises(ValueError) as _: m.optional_nested_enum = 1234567 self.assertRaises(ValueError, m.repeated_nested_enu...
Assigning an invalid enum number is not allowed in proto2.
Assigning an invalid enum number is not allowed in proto2.
[ "Assigning", "an", "invalid", "enum", "number", "is", "not", "allowed", "in", "proto2", "." ]
def testAssignInvalidEnum(self): m = unittest_pb2.TestAllTypes() with self.assertRaises(ValueError) as _: m.optional_nested_enum = 1234567 self.assertRaises(ValueError, m.repeated_nested_enum.append, 1234567) m.repeated_nested_enum.append(2) m.repeated_nested_enum[0] = 2 with self.assertRa...
[ "def", "testAssignInvalidEnum", "(", "self", ")", ":", "m", "=", "unittest_pb2", ".", "TestAllTypes", "(", ")", "with", "self", ".", "assertRaises", "(", "ValueError", ")", "as", "_", ":", "m", ".", "optional_nested_enum", "=", "1234567", "self", ".", "ass...
Assigning an invalid enum number is not allowed in proto2.
[ "Assigning", "an", "invalid", "enum", "number", "is", "not", "allowed", "in", "proto2", "." ]
[ "\"\"\"Assigning an invalid enum number is not allowed in proto2.\"\"\"", "# Proto2 can not assign unknown enum.", "# Assignment is a different code path than append for the C++ impl.", "# Unknown enum value can be parsed but is ignored.", "# 1 is the default value for optional_nested_enum." ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
24acf6da5e1432ab9d71f95d90ade398531c2a6a
sunlongbo/chromium
third_party/blink/tools/blinkpy/w3c/common.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
read_credentials
<not_specific>
def read_credentials(host, credentials_json): """Extracts GitHub and Gerrit credentials. The data is read from the environment and (optionally) a JSON file. When a JSON file is specified, any variables from the environment are discarded and the values are all expected to be present in the file. Ar...
Extracts GitHub and Gerrit credentials. The data is read from the environment and (optionally) a JSON file. When a JSON file is specified, any variables from the environment are discarded and the values are all expected to be present in the file. Args: credentials_json: Path to a JSON file con...
Extracts GitHub and Gerrit credentials. The data is read from the environment and (optionally) a JSON file. When a JSON file is specified, any variables from the environment are discarded and the values are all expected to be present in the file.
[ "Extracts", "GitHub", "and", "Gerrit", "credentials", ".", "The", "data", "is", "read", "from", "the", "environment", "and", "(", "optionally", ")", "a", "JSON", "file", ".", "When", "a", "JSON", "file", "is", "specified", "any", "variables", "from", "the"...
def read_credentials(host, credentials_json): env_credentials = {} for key in ('GH_USER', 'GH_TOKEN', 'GERRIT_USER', 'GERRIT_TOKEN'): if key in host.environ: env_credentials[key] = host.environ[key] if not credentials_json: return env_credentials if not host.filesystem.exists...
[ "def", "read_credentials", "(", "host", ",", "credentials_json", ")", ":", "env_credentials", "=", "{", "}", "for", "key", "in", "(", "'GH_USER'", ",", "'GH_TOKEN'", ",", "'GERRIT_USER'", ",", "'GERRIT_TOKEN'", ")", ":", "if", "key", "in", "host", ".", "en...
Extracts GitHub and Gerrit credentials.
[ "Extracts", "GitHub", "and", "Gerrit", "credentials", "." ]
[ "\"\"\"Extracts GitHub and Gerrit credentials.\n\n The data is read from the environment and (optionally) a JSON file. When a\n JSON file is specified, any variables from the environment are discarded\n and the values are all expected to be present in the file.\n\n Args:\n credentials_json: Path ...
[ { "param": "host", "type": null }, { "param": "credentials_json", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "host", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "credentials_json", "type": null, "docstring": "Path to a JSON file ...
24acf6da5e1432ab9d71f95d90ade398531c2a6a
sunlongbo/chromium
third_party/blink/tools/blinkpy/w3c/common.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
is_disallowed_ini
<not_specific>
def is_disallowed_ini(filename): """Checks whether the file is a disallowed (.ini) file. This is primarily intended to skip WPT metadata .ini files, which are used in WPT to set expected statuses for tests. Chromium maintains its own list of such files and we don't want those to be shared with upstream...
Checks whether the file is a disallowed (.ini) file. This is primarily intended to skip WPT metadata .ini files, which are used in WPT to set expected statuses for tests. Chromium maintains its own list of such files and we don't want those to be shared with upstream. There are a few .ini files that w...
Checks whether the file is a disallowed (.ini) file. This is primarily intended to skip WPT metadata .ini files, which are used in WPT to set expected statuses for tests. Chromium maintains its own list of such files and we don't want those to be shared with upstream. There are a few .ini files that we do allow, which...
[ "Checks", "whether", "the", "file", "is", "a", "disallowed", "(", ".", "ini", ")", "file", ".", "This", "is", "primarily", "intended", "to", "skip", "WPT", "metadata", ".", "ini", "files", "which", "are", "used", "in", "WPT", "to", "set", "expected", "...
def is_disallowed_ini(filename): if not filename.endswith('.ini'): return False allowed_inis = [ 'mypy.ini', 'py27-flake8.ini', 'py3-flake8.ini', 'pytest.ini', 'tox.ini', 'wptrunner.default.ini', ] return filename not in allowed_inis
[ "def", "is_disallowed_ini", "(", "filename", ")", ":", "if", "not", "filename", ".", "endswith", "(", "'.ini'", ")", ":", "return", "False", "allowed_inis", "=", "[", "'mypy.ini'", ",", "'py27-flake8.ini'", ",", "'py3-flake8.ini'", ",", "'pytest.ini'", ",", "'...
Checks whether the file is a disallowed (.ini) file.
[ "Checks", "whether", "the", "file", "is", "a", "disallowed", "(", ".", "ini", ")", "file", "." ]
[ "\"\"\"Checks whether the file is a disallowed (.ini) file.\n\n This is primarily intended to skip WPT metadata .ini files, which are used\n in WPT to set expected statuses for tests. Chromium maintains its own list\n of such files and we don't want those to be shared with upstream.\n\n There are a few ...
[ { "param": "filename", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "filename", "type": null, "docstring": "the basename of the file to check", "docstring_tokens": [ "the", "basename", "of", "the", "file", "to", "check" ], "def...
24acf6da5e1432ab9d71f95d90ade398531c2a6a
sunlongbo/chromium
third_party/blink/tools/blinkpy/w3c/common.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
is_basename_skipped
<not_specific>
def is_basename_skipped(basename): """Checks whether to skip (not sync) a file based on its basename. Note: this function is used during both import and export, i.e., files with skipped basenames are never imported or exported. """ assert '/' not in basename skipped_basenames = [ 'MANIF...
Checks whether to skip (not sync) a file based on its basename. Note: this function is used during both import and export, i.e., files with skipped basenames are never imported or exported.
Checks whether to skip (not sync) a file based on its basename. Note: this function is used during both import and export, i.e., files with skipped basenames are never imported or exported.
[ "Checks", "whether", "to", "skip", "(", "not", "sync", ")", "a", "file", "based", "on", "its", "basename", ".", "Note", ":", "this", "function", "is", "used", "during", "both", "import", "and", "export", "i", ".", "e", ".", "files", "with", "skipped", ...
def is_basename_skipped(basename): assert '/' not in basename skipped_basenames = [ 'MANIFEST.json', 'OWNERS', 'reftest.list', 'DIR_METADATA', ] return (basename in skipped_basenames or is_testharness_baseline(basename) or basename.startswith('.') or i...
[ "def", "is_basename_skipped", "(", "basename", ")", ":", "assert", "'/'", "not", "in", "basename", "skipped_basenames", "=", "[", "'MANIFEST.json'", ",", "'OWNERS'", ",", "'reftest.list'", ",", "'DIR_METADATA'", ",", "]", "return", "(", "basename", "in", "skippe...
Checks whether to skip (not sync) a file based on its basename.
[ "Checks", "whether", "to", "skip", "(", "not", "sync", ")", "a", "file", "based", "on", "its", "basename", "." ]
[ "\"\"\"Checks whether to skip (not sync) a file based on its basename.\n\n Note: this function is used during both import and export, i.e., files with\n skipped basenames are never imported or exported.\n \"\"\"", "# MANIFEST.json is automatically regenerated.", "# https://crbug.com/584660 https://crbu...
[ { "param": "basename", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "basename", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
2a13325194872a9509137b5cfa1739f85effb050
sunlongbo/chromium
chrome/test/webapps/graph_analysis.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
build_action_node_graph
None
def build_action_node_graph(root_node: ActionNode, tests: List[CoverageTest]) -> None: """ Builds a graph of ActionNodes on the given `root_node`. The graph is generated by iterating the `tests`, starting at the `root_node` for each test, and adding ActionNodes to the graph f...
Builds a graph of ActionNodes on the given `root_node`. The graph is generated by iterating the `tests`, starting at the `root_node` for each test, and adding ActionNodes to the graph for each state-change action (following the graph for every state-change action). State-check actions are added to ...
Builds a graph of ActionNodes on the given `root_node`. The graph is generated by iterating the `tests`, starting at the `root_node` for each test, and adding ActionNodes to the graph for each state-change action (following the graph for every state-change action). State-check actions are added to the previous state-ch...
[ "Builds", "a", "graph", "of", "ActionNodes", "on", "the", "given", "`", "root_node", "`", ".", "The", "graph", "is", "generated", "by", "iterating", "the", "`", "tests", "`", "starting", "at", "the", "`", "root_node", "`", "for", "each", "test", "and", ...
def build_action_node_graph(root_node: ActionNode, tests: List[CoverageTest]) -> None: assert root_node is not None assert isinstance(root_node, ActionNode) assert isinstance(tests, list) for test in tests: assert isinstance(test, CoverageTest) parent = root_n...
[ "def", "build_action_node_graph", "(", "root_node", ":", "ActionNode", ",", "tests", ":", "List", "[", "CoverageTest", "]", ")", "->", "None", ":", "assert", "root_node", "is", "not", "None", "assert", "isinstance", "(", "root_node", ",", "ActionNode", ")", ...
Builds a graph of ActionNodes on the given `root_node`.
[ "Builds", "a", "graph", "of", "ActionNodes", "on", "the", "given", "`", "root_node", "`", "." ]
[ "\"\"\"\n Builds a graph of ActionNodes on the given `root_node`. The graph is\n generated by iterating the `tests`, starting at the `root_node` for each\n test, and adding ActionNodes to the graph for each state-change action\n (following the graph for every state-change action). State-check actions ar...
[ { "param": "root_node", "type": "ActionNode" }, { "param": "tests", "type": "List[CoverageTest]" } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "root_node", "type": "ActionNode", "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "tests", "type": "List[CoverageTest]", "docstring": nul...
2a13325194872a9509137b5cfa1739f85effb050
sunlongbo/chromium
chrome/test/webapps/graph_analysis.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
trim_graph_to_platform_actions
None
def trim_graph_to_platform_actions(root_node: ActionNode, platform: TestPlatform) -> None: """ Removes any nodes and actions from the graph that are not supported by the given platform. """ new_children = {} for child in root_node.children.values(): if ...
Removes any nodes and actions from the graph that are not supported by the given platform.
Removes any nodes and actions from the graph that are not supported by the given platform.
[ "Removes", "any", "nodes", "and", "actions", "from", "the", "graph", "that", "are", "not", "supported", "by", "the", "given", "platform", "." ]
def trim_graph_to_platform_actions(root_node: ActionNode, platform: TestPlatform) -> None: new_children = {} for child in root_node.children.values(): if child.action.supported_for_platform(platform): new_children[child.action.name] = child root_node.ch...
[ "def", "trim_graph_to_platform_actions", "(", "root_node", ":", "ActionNode", ",", "platform", ":", "TestPlatform", ")", "->", "None", ":", "new_children", "=", "{", "}", "for", "child", "in", "root_node", ".", "children", ".", "values", "(", ")", ":", "if",...
Removes any nodes and actions from the graph that are not supported by the given platform.
[ "Removes", "any", "nodes", "and", "actions", "from", "the", "graph", "that", "are", "not", "supported", "by", "the", "given", "platform", "." ]
[ "\"\"\"\n Removes any nodes and actions from the graph that are not supported by the\n given platform.\n \"\"\"" ]
[ { "param": "root_node", "type": "ActionNode" }, { "param": "platform", "type": "TestPlatform" } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "root_node", "type": "ActionNode", "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "platform", "type": "TestPlatform", "docstring": null, ...
f95c5453c0748e11f6a5a3c1ca5ace3fdc306a2e
sunlongbo/chromium
chrome/updater/test/service/win/run_command_as_standard_user.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
ParseCommandLine
<not_specific>
def ParseCommandLine(): """Parse the command line arguments.""" cmd_parser = argparse.ArgumentParser(description='Run command as user') cmd_parser.add_argument( '--command', dest='command', type=str, help='The command to run.') return cmd_parser.parse_known_args()
Parse the command line arguments.
Parse the command line arguments.
[ "Parse", "the", "command", "line", "arguments", "." ]
def ParseCommandLine(): cmd_parser = argparse.ArgumentParser(description='Run command as user') cmd_parser.add_argument( '--command', dest='command', type=str, help='The command to run.') return cmd_parser.parse_known_args()
[ "def", "ParseCommandLine", "(", ")", ":", "cmd_parser", "=", "argparse", ".", "ArgumentParser", "(", "description", "=", "'Run command as user'", ")", "cmd_parser", ".", "add_argument", "(", "'--command'", ",", "dest", "=", "'command'", ",", "type", "=", "str", ...
Parse the command line arguments.
[ "Parse", "the", "command", "line", "arguments", "." ]
[ "\"\"\"Parse the command line arguments.\"\"\"" ]
[]
{ "returns": [], "raises": [], "params": [], "outlier_params": [], "others": [] }
f975a689cde2f4b1a3c4be4ba08fdf59b61cb6ff
sunlongbo/chromium
tools/android/modularization/loc/modularization_loc_stat.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
GetDateRange
Tuple[str, str]
def GetDateRange(*, past_days: int) -> Tuple[str, str]: """Returns start and end date for a period of past days. Use the results as start_date and end_date of GenerateLOCStats. """ today = datetime.date.today() delta = datetime.timedelta(days=past_days) past = datetime.datetime(today.year, today.month, tod...
Returns start and end date for a period of past days. Use the results as start_date and end_date of GenerateLOCStats.
Returns start and end date for a period of past days.
[ "Returns", "start", "and", "end", "date", "for", "a", "period", "of", "past", "days", "." ]
def GetDateRange(*, past_days: int) -> Tuple[str, str]: today = datetime.date.today() delta = datetime.timedelta(days=past_days) past = datetime.datetime(today.year, today.month, today.day) - delta return (past.date().isoformat(), today.isoformat())
[ "def", "GetDateRange", "(", "*", ",", "past_days", ":", "int", ")", "->", "Tuple", "[", "str", ",", "str", "]", ":", "today", "=", "datetime", ".", "date", ".", "today", "(", ")", "delta", "=", "datetime", ".", "timedelta", "(", "days", "=", "past_...
Returns start and end date for a period of past days.
[ "Returns", "start", "and", "end", "date", "for", "a", "period", "of", "past", "days", "." ]
[ "\"\"\"Returns start and end date for a period of past days.\n\n Use the results as start_date and end_date of GenerateLOCStats.\n \"\"\"" ]
[ { "param": "past_days", "type": "int" } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "past_days", "type": "int", "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
67140fbd54c35d8cd4b8c0707d74cca449bbde74
sunlongbo/chromium
third_party/blink/tools/blinkpy/common/system/executive.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
kill_process
<not_specific>
def kill_process(self, pid, kill_tree=True): """Attempts to kill the given pid. if kill_tree is True, the whole process group will be killed. Will fail silently if pid does not exist. """ if sys.platform == 'win32': # Workaround for race condition that occurs when t...
Attempts to kill the given pid. if kill_tree is True, the whole process group will be killed. Will fail silently if pid does not exist.
Attempts to kill the given pid. if kill_tree is True, the whole process group will be killed. Will fail silently if pid does not exist.
[ "Attempts", "to", "kill", "the", "given", "pid", ".", "if", "kill_tree", "is", "True", "the", "whole", "process", "group", "will", "be", "killed", ".", "Will", "fail", "silently", "if", "pid", "does", "not", "exist", "." ]
def kill_process(self, pid, kill_tree=True): if sys.platform == 'win32': OpenProcess = ctypes.windll.kernel32.OpenProcess CloseHandle = ctypes.windll.kernel32.CloseHandle NtSuspendProcess = ctypes.windll.ntdll.NtSuspendProcess PROCESS_ALL_ACCESS = 0x1F0FFF ...
[ "def", "kill_process", "(", "self", ",", "pid", ",", "kill_tree", "=", "True", ")", ":", "if", "sys", ".", "platform", "==", "'win32'", ":", "OpenProcess", "=", "ctypes", ".", "windll", ".", "kernel32", ".", "OpenProcess", "CloseHandle", "=", "ctypes", "...
Attempts to kill the given pid.
[ "Attempts", "to", "kill", "the", "given", "pid", "." ]
[ "\"\"\"Attempts to kill the given pid.\n\n if kill_tree is True, the whole process group will be killed.\n\n Will fail silently if pid does not exist.\n \"\"\"", "# Workaround for race condition that occurs when the browser is", "# killed as it's launching a process. This sometimes leaves a...
[ { "param": "self", "type": null }, { "param": "pid", "type": null }, { "param": "kill_tree", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "pid", "type": null, "docstring": null, "docstring_tokens": []...
67140fbd54c35d8cd4b8c0707d74cca449bbde74
sunlongbo/chromium
third_party/blink/tools/blinkpy/common/system/executive.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
check_running_pid
<not_specific>
def check_running_pid(self, pid): """Return True if pid is alive, otherwise return False.""" _log.debug('Checking whether pid %d is alive.', pid) if sys.platform == 'win32': return self._win32_check_running_pid(pid) try: os.kill(pid, 0) return True ...
Return True if pid is alive, otherwise return False.
Return True if pid is alive, otherwise return False.
[ "Return", "True", "if", "pid", "is", "alive", "otherwise", "return", "False", "." ]
def check_running_pid(self, pid): _log.debug('Checking whether pid %d is alive.', pid) if sys.platform == 'win32': return self._win32_check_running_pid(pid) try: os.kill(pid, 0) return True except OSError: return False
[ "def", "check_running_pid", "(", "self", ",", "pid", ")", ":", "_log", ".", "debug", "(", "'Checking whether pid %d is alive.'", ",", "pid", ")", "if", "sys", ".", "platform", "==", "'win32'", ":", "return", "self", ".", "_win32_check_running_pid", "(", "pid",...
Return True if pid is alive, otherwise return False.
[ "Return", "True", "if", "pid", "is", "alive", "otherwise", "return", "False", "." ]
[ "\"\"\"Return True if pid is alive, otherwise return False.\"\"\"" ]
[ { "param": "self", "type": null }, { "param": "pid", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "pid", "type": null, "docstring": null, "docstring_tokens": []...
67140fbd54c35d8cd4b8c0707d74cca449bbde74
sunlongbo/chromium
third_party/blink/tools/blinkpy/common/system/executive.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
command_for_printing
<not_specific>
def command_for_printing(self, args): """Returns a print-ready string representing command args. The string should be copy/paste ready for execution in a shell. """ args = self._stringify_args(args) escaped_args = [] for arg in args: if isinstance(arg, six.tex...
Returns a print-ready string representing command args. The string should be copy/paste ready for execution in a shell.
Returns a print-ready string representing command args. The string should be copy/paste ready for execution in a shell.
[ "Returns", "a", "print", "-", "ready", "string", "representing", "command", "args", ".", "The", "string", "should", "be", "copy", "/", "paste", "ready", "for", "execution", "in", "a", "shell", "." ]
def command_for_printing(self, args): args = self._stringify_args(args) escaped_args = [] for arg in args: if isinstance(arg, six.text_type): arg = arg.encode('unicode_escape') escaped_args.append(arg.decode(self._child_process_encoding())) return ...
[ "def", "command_for_printing", "(", "self", ",", "args", ")", ":", "args", "=", "self", ".", "_stringify_args", "(", "args", ")", "escaped_args", "=", "[", "]", "for", "arg", "in", "args", ":", "if", "isinstance", "(", "arg", ",", "six", ".", "text_typ...
Returns a print-ready string representing command args.
[ "Returns", "a", "print", "-", "ready", "string", "representing", "command", "args", "." ]
[ "\"\"\"Returns a print-ready string representing command args.\n The string should be copy/paste ready for execution in a shell.\n \"\"\"", "# Escape any non-ascii characters for easy copy/paste", "# FIXME: Do we need to fix quotes here?" ]
[ { "param": "self", "type": null }, { "param": "args", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "args", "type": null, "docstring": null, "docstring_tokens": [...
67140fbd54c35d8cd4b8c0707d74cca449bbde74
sunlongbo/chromium
third_party/blink/tools/blinkpy/common/system/executive.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
run_command
<not_specific>
def run_command( self, args, cwd=None, env=None, input=None, # pylint: disable=redefined-builtin timeout_seconds=None, error_handler=None, return_exit_code=False, return_stderr=True, ignore_stderr=Fa...
Popen wrapper for convenience and to work around python bugs. By default, run_command will expect a zero exit code and will return the program output in that case, or throw a ScriptError if the program has a non-zero exit code. This behavior can be changed by setting the appropriate inp...
Popen wrapper for convenience and to work around python bugs. By default, run_command will expect a zero exit code and will return the program output in that case, or throw a ScriptError if the program has a non-zero exit code. This behavior can be changed by setting the appropriate input parameters.
[ "Popen", "wrapper", "for", "convenience", "and", "to", "work", "around", "python", "bugs", ".", "By", "default", "run_command", "will", "expect", "a", "zero", "exit", "code", "and", "will", "return", "the", "program", "output", "in", "that", "case", "or", ...
def run_command( self, args, cwd=None, env=None, input=None, timeout_seconds=None, error_handler=None, return_exit_code=False, return_stderr=True, ignore_stderr=False, decode_output=True...
[ "def", "run_command", "(", "self", ",", "args", ",", "cwd", "=", "None", ",", "env", "=", "None", ",", "input", "=", "None", ",", "timeout_seconds", "=", "None", ",", "error_handler", "=", "None", ",", "return_exit_code", "=", "False", ",", "return_stder...
Popen wrapper for convenience and to work around python bugs.
[ "Popen", "wrapper", "for", "convenience", "and", "to", "work", "around", "python", "bugs", "." ]
[ "# pylint: disable=redefined-builtin", "\"\"\"Popen wrapper for convenience and to work around python bugs.\n\n By default, run_command will expect a zero exit code and will return the\n program output in that case, or throw a ScriptError if the program has a\n non-zero exit code. This behavi...
[ { "param": "self", "type": null }, { "param": "args", "type": null }, { "param": "cwd", "type": null }, { "param": "env", "type": null }, { "param": "input", "type": null }, { "param": "timeout_seconds", "type": null }, { "param": "error_ha...
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "args", "type": null, "docstring": "the program arguments. Passed to...