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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
ac210784ee9cfc7c3615e1a401160b9b413d17d8 | sunlongbo/chromium | tools/python/llvm_symbolizer.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | GetSymbolInformation | <not_specific> | def GetSymbolInformation(self, lib, addr):
"""Return the corresponding function names and line numbers.
Args:
lib: library to search for info.
addr: address to look for info.
Returns:
A list of (function name, line numbers) tuple.
"""
if (self._llvm_symbolizer_subprocess is None ... | Return the corresponding function names and line numbers.
Args:
lib: library to search for info.
addr: address to look for info.
Returns:
A list of (function name, line numbers) tuple.
| Return the corresponding function names and line numbers. | [
"Return",
"the",
"corresponding",
"function",
"names",
"and",
"line",
"numbers",
"."
] | def GetSymbolInformation(self, lib, addr):
if (self._llvm_symbolizer_subprocess is None or not lib
or not _CheckValidAddr(addr) or not os.path.isfile(lib)):
return [(_UNKNOWN, lib)]
proc = self._llvm_symbolizer_subprocess
with self._lock:
proc.stdin.write('%s %s\n' % (lib, addr))
p... | [
"def",
"GetSymbolInformation",
"(",
"self",
",",
"lib",
",",
"addr",
")",
":",
"if",
"(",
"self",
".",
"_llvm_symbolizer_subprocess",
"is",
"None",
"or",
"not",
"lib",
"or",
"not",
"_CheckValidAddr",
"(",
"addr",
")",
"or",
"not",
"os",
".",
"path",
".",... | Return the corresponding function names and line numbers. | [
"Return",
"the",
"corresponding",
"function",
"names",
"and",
"line",
"numbers",
"."
] | [
"\"\"\"Return the corresponding function names and line numbers.\n\n Args:\n lib: library to search for info.\n addr: address to look for info.\n\n Returns:\n A list of (function name, line numbers) tuple.\n \"\"\"",
"# Read until an empty line is observed, which indicates the end of the",... | [
{
"param": "self",
"type": null
},
{
"param": "lib",
"type": null
},
{
"param": "addr",
"type": null
}
] | {
"returns": [
{
"docstring": "A list of (function name, line numbers) tuple.",
"docstring_tokens": [
"A",
"list",
"of",
"(",
"function",
"name",
"line",
"numbers",
")",
"tuple",
"."
],
"type": null
... |
732479bbf5975289bd251ab6d41c8dda7e808a50 | sunlongbo/chromium | chrome/tools/build/win/create_installer_archive.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | CopyAllFilesToStagingDir | null | def CopyAllFilesToStagingDir(config, distribution, staging_dir, build_dir,
enable_hidpi, include_snapshotblob,
component_build, component_ffmpeg_build, verbose):
"""Copies the files required for installer archive.
Copies all common files required for various... | Copies the files required for installer archive.
Copies all common files required for various distributions of Chromium and
also files for the specific Chromium build specified by distribution.
| Copies the files required for installer archive.
Copies all common files required for various distributions of Chromium and
also files for the specific Chromium build specified by distribution. | [
"Copies",
"the",
"files",
"required",
"for",
"installer",
"archive",
".",
"Copies",
"all",
"common",
"files",
"required",
"for",
"various",
"distributions",
"of",
"Chromium",
"and",
"also",
"files",
"for",
"the",
"specific",
"Chromium",
"build",
"specified",
"by... | def CopyAllFilesToStagingDir(config, distribution, staging_dir, build_dir,
enable_hidpi, include_snapshotblob,
component_build, component_ffmpeg_build, verbose):
CopySectionFilesToStagingDir(config, 'GENERAL', staging_dir, build_dir,
... | [
"def",
"CopyAllFilesToStagingDir",
"(",
"config",
",",
"distribution",
",",
"staging_dir",
",",
"build_dir",
",",
"enable_hidpi",
",",
"include_snapshotblob",
",",
"component_build",
",",
"component_ffmpeg_build",
",",
"verbose",
")",
":",
"CopySectionFilesToStagingDir",
... | Copies the files required for installer archive. | [
"Copies",
"the",
"files",
"required",
"for",
"installer",
"archive",
"."
] | [
"\"\"\"Copies the files required for installer archive.\n Copies all common files required for various distributions of Chromium and\n also files for the specific Chromium build specified by distribution.\n \"\"\""
] | [
{
"param": "config",
"type": null
},
{
"param": "distribution",
"type": null
},
{
"param": "staging_dir",
"type": null
},
{
"param": "build_dir",
"type": null
},
{
"param": "enable_hidpi",
"type": null
},
{
"param": "include_snapshotblob",
"type": ... | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "config",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "distribution",
"type": null,
"docstring": null,
"docstring_... |
732479bbf5975289bd251ab6d41c8dda7e808a50 | sunlongbo/chromium | chrome/tools/build/win/create_installer_archive.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | CopySectionFilesToStagingDir | null | def CopySectionFilesToStagingDir(config, section, staging_dir, src_dir,
verbose):
"""Copies installer archive files specified in section from src_dir to
staging_dir. This method reads section from config and copies all the
files specified from src_dir to staging dir.
"""
for o... | Copies installer archive files specified in section from src_dir to
staging_dir. This method reads section from config and copies all the
files specified from src_dir to staging dir.
| Copies installer archive files specified in section from src_dir to
staging_dir. This method reads section from config and copies all the
files specified from src_dir to staging dir. | [
"Copies",
"installer",
"archive",
"files",
"specified",
"in",
"section",
"from",
"src_dir",
"to",
"staging_dir",
".",
"This",
"method",
"reads",
"section",
"from",
"config",
"and",
"copies",
"all",
"the",
"files",
"specified",
"from",
"src_dir",
"to",
"staging",... | def CopySectionFilesToStagingDir(config, section, staging_dir, src_dir,
verbose):
for option in config.options(section):
if option.endswith('dir'):
continue
src_subdir = option.replace('\\', os.sep)
dst_dir = os.path.join(staging_dir, config.get(section, option))
... | [
"def",
"CopySectionFilesToStagingDir",
"(",
"config",
",",
"section",
",",
"staging_dir",
",",
"src_dir",
",",
"verbose",
")",
":",
"for",
"option",
"in",
"config",
".",
"options",
"(",
"section",
")",
":",
"if",
"option",
".",
"endswith",
"(",
"'dir'",
")... | Copies installer archive files specified in section from src_dir to
staging_dir. | [
"Copies",
"installer",
"archive",
"files",
"specified",
"in",
"section",
"from",
"src_dir",
"to",
"staging_dir",
"."
] | [
"\"\"\"Copies installer archive files specified in section from src_dir to\n staging_dir. This method reads section from config and copies all the\n files specified from src_dir to staging dir.\n \"\"\"",
"# There are specific issues with libEGL.dll and libGLESv2.dll which require",
"# insensitive globbing o... | [
{
"param": "config",
"type": null
},
{
"param": "section",
"type": null
},
{
"param": "staging_dir",
"type": null
},
{
"param": "src_dir",
"type": null
},
{
"param": "verbose",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "config",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "section",
"type": null,
"docstring": null,
"docstring_token... |
732479bbf5975289bd251ab6d41c8dda7e808a50 | sunlongbo/chromium | chrome/tools/build/win/create_installer_archive.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | Readconfig | <not_specific> | def Readconfig(input_file, current_version):
"""Reads config information from input file after setting default value of
global variabes.
"""
variables = {}
variables['ChromeDir'] = CHROME_DIR
variables['VersionDir'] = os.path.join(variables['ChromeDir'],
current_ver... | Reads config information from input file after setting default value of
global variabes.
| Reads config information from input file after setting default value of
global variabes. | [
"Reads",
"config",
"information",
"from",
"input",
"file",
"after",
"setting",
"default",
"value",
"of",
"global",
"variabes",
"."
] | def Readconfig(input_file, current_version):
variables = {}
variables['ChromeDir'] = CHROME_DIR
variables['VersionDir'] = os.path.join(variables['ChromeDir'],
current_version)
config = configparser.ConfigParser(variables)
config.read(input_file)
return config | [
"def",
"Readconfig",
"(",
"input_file",
",",
"current_version",
")",
":",
"variables",
"=",
"{",
"}",
"variables",
"[",
"'ChromeDir'",
"]",
"=",
"CHROME_DIR",
"variables",
"[",
"'VersionDir'",
"]",
"=",
"os",
".",
"path",
".",
"join",
"(",
"variables",
"["... | Reads config information from input file after setting default value of
global variabes. | [
"Reads",
"config",
"information",
"from",
"input",
"file",
"after",
"setting",
"default",
"value",
"of",
"global",
"variabes",
"."
] | [
"\"\"\"Reads config information from input file after setting default value of\n global variabes.\n \"\"\""
] | [
{
"param": "input_file",
"type": null
},
{
"param": "current_version",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "input_file",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "current_version",
"type": null,
"docstring": null,
"doc... |
732479bbf5975289bd251ab6d41c8dda7e808a50 | sunlongbo/chromium | chrome/tools/build/win/create_installer_archive.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | CreateArchiveFile | <not_specific> | def CreateArchiveFile(options, staging_dir, current_version, prev_version):
"""Creates a new installer archive file after deleting any existing old file.
"""
# First create an uncompressed archive file for the current build (chrome.7z)
lzma_exec = GetLZMAExec(options.build_dir)
archive_file = os.path.join(opt... | Creates a new installer archive file after deleting any existing old file.
| Creates a new installer archive file after deleting any existing old file. | [
"Creates",
"a",
"new",
"installer",
"archive",
"file",
"after",
"deleting",
"any",
"existing",
"old",
"file",
"."
] | def CreateArchiveFile(options, staging_dir, current_version, prev_version):
lzma_exec = GetLZMAExec(options.build_dir)
archive_file = os.path.join(options.output_dir,
options.output_name + ARCHIVE_SUFFIX)
if options.depfile:
def path_fixup(path):
return path.replace('\\', '... | [
"def",
"CreateArchiveFile",
"(",
"options",
",",
"staging_dir",
",",
"current_version",
",",
"prev_version",
")",
":",
"lzma_exec",
"=",
"GetLZMAExec",
"(",
"options",
".",
"build_dir",
")",
"archive_file",
"=",
"os",
".",
"path",
".",
"join",
"(",
"options",
... | Creates a new installer archive file after deleting any existing old file. | [
"Creates",
"a",
"new",
"installer",
"archive",
"file",
"after",
"deleting",
"any",
"existing",
"old",
"file",
"."
] | [
"\"\"\"Creates a new installer archive file after deleting any existing old file.\n \"\"\"",
"# First create an uncompressed archive file for the current build (chrome.7z)",
"# If a depfile was requested, do the glob of the staging dir and generate",
"# a list of dependencies in .d format. We list the files ... | [
{
"param": "options",
"type": null
},
{
"param": "staging_dir",
"type": null
},
{
"param": "current_version",
"type": null
},
{
"param": "prev_version",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "options",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "staging_dir",
"type": null,
"docstring": null,
"docstring_... |
732479bbf5975289bd251ab6d41c8dda7e808a50 | sunlongbo/chromium | chrome/tools/build/win/create_installer_archive.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | main | null | def main(options):
"""Main method that reads input file, creates archive file and writes
resource input file.
"""
current_version = BuildVersion(options.build_dir)
config = Readconfig(options.input_file, current_version)
staging_dir = MakeStagingDirectory(options.staging_dir)
prev_version = GetPrevVers... | Main method that reads input file, creates archive file and writes
resource input file.
| Main method that reads input file, creates archive file and writes
resource input file. | [
"Main",
"method",
"that",
"reads",
"input",
"file",
"creates",
"archive",
"file",
"and",
"writes",
"resource",
"input",
"file",
"."
] | def main(options):
current_version = BuildVersion(options.build_dir)
config = Readconfig(options.input_file, current_version)
staging_dir = MakeStagingDirectory(options.staging_dir)
prev_version = GetPrevVersion(options.build_dir, staging_dir,
options.last_chrome_installer,
... | [
"def",
"main",
"(",
"options",
")",
":",
"current_version",
"=",
"BuildVersion",
"(",
"options",
".",
"build_dir",
")",
"config",
"=",
"Readconfig",
"(",
"options",
".",
"input_file",
",",
"current_version",
")",
"staging_dir",
"=",
"MakeStagingDirectory",
"(",
... | Main method that reads input file, creates archive file and writes
resource input file. | [
"Main",
"method",
"that",
"reads",
"input",
"file",
"creates",
"archive",
"file",
"and",
"writes",
"resource",
"input",
"file",
"."
] | [
"\"\"\"Main method that reads input file, creates archive file and writes\n resource input file.\n \"\"\"",
"# Copy the files from the build dir.",
"# Name of the archive file built (for example - chrome.7z or",
"# patch-<old_version>-<new_version>.7z or patch-<new_version>.7z"
] | [
{
"param": "options",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "options",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
73f45865235ada8640c6a619c37a8c7a69e7e91d | sunlongbo/chromium | tools/checkteamtags/extract_components.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | display_stat | null | def display_stat(stats, root, options):
""""Display coverage statistic.
The following three values are always displayed:
- The total number of OWNERS files under directory root and its sub-
directories.
- The number of OWNERS files (and its percentage of the total) that have
component informati... | Display coverage statistic.
The following three values are always displayed:
- The total number of OWNERS files under directory root and its sub-
directories.
- The number of OWNERS files (and its percentage of the total) that have
component information but no team information.
- The number o... | Display coverage statistic.
The following three values are always displayed:
The total number of OWNERS files under directory root and its sub
directories.
The number of OWNERS files (and its percentage of the total) that have
component information but no team information.
The number of OWNERS files (and its percentage... | [
"Display",
"coverage",
"statistic",
".",
"The",
"following",
"three",
"values",
"are",
"always",
"displayed",
":",
"The",
"total",
"number",
"of",
"OWNERS",
"files",
"under",
"directory",
"root",
"and",
"its",
"sub",
"directories",
".",
"The",
"number",
"of",
... | def display_stat(stats, root, options):
file_total = stats['OWNERS-count']
print("%d OWNERS files in total." % file_total)
file_with_component = stats['OWNERS-with-component-only-count']
file_pct_with_component = "N/A"
if file_total > 0:
file_pct_with_component = "{0:.2f}".format(
100.0 * file_wit... | [
"def",
"display_stat",
"(",
"stats",
",",
"root",
",",
"options",
")",
":",
"file_total",
"=",
"stats",
"[",
"'OWNERS-count'",
"]",
"print",
"(",
"\"%d OWNERS files in total.\"",
"%",
"file_total",
")",
"file_with_component",
"=",
"stats",
"[",
"'OWNERS-with-compo... | Display coverage statistic. | [
"Display",
"coverage",
"statistic",
"."
] | [
"\"\"\"\"Display coverage statistic.\n\n The following three values are always displayed:\n - The total number of OWNERS files under directory root and its sub-\n directories.\n - The number of OWNERS files (and its percentage of the total) that have\n component information but no team information.... | [
{
"param": "stats",
"type": null
},
{
"param": "root",
"type": null
},
{
"param": "options",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "stats",
"type": null,
"docstring": "Tha statistics in dictionary form as produced by the\nowners_file_tags module.",
"docstring_tokens": [
"Tha",
"statistics",
"in",
"dictionary",
"form"... |
73f45865235ada8640c6a619c37a8c7a69e7e91d | sunlongbo/chromium | tools/checkteamtags/extract_components.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | display_missing_info_OWNERS_files | null | def display_missing_info_OWNERS_files(stats, num_output_depth):
"""Display OWNERS files that have missing team and component by depth.
OWNERS files that have no team and no component information will be shown
for each depth level (up to the level given by num_output_depth).
Args:
stats (dict): The statist... | Display OWNERS files that have missing team and component by depth.
OWNERS files that have no team and no component information will be shown
for each depth level (up to the level given by num_output_depth).
Args:
stats (dict): The statistics in dictionary form as produced by the
owners_file_tags modu... | Display OWNERS files that have missing team and component by depth.
OWNERS files that have no team and no component information will be shown
for each depth level (up to the level given by num_output_depth). | [
"Display",
"OWNERS",
"files",
"that",
"have",
"missing",
"team",
"and",
"component",
"by",
"depth",
".",
"OWNERS",
"files",
"that",
"have",
"no",
"team",
"and",
"no",
"component",
"information",
"will",
"be",
"shown",
"for",
"each",
"depth",
"level",
"(",
... | def display_missing_info_OWNERS_files(stats, num_output_depth):
print("OWNERS files that have missing team and component by depth:")
max_output_depth = len(stats['OWNERS-count-by-depth'])
if (num_output_depth < 0
or num_output_depth > max_output_depth):
num_output_depth = max_output_depth
for depth in... | [
"def",
"display_missing_info_OWNERS_files",
"(",
"stats",
",",
"num_output_depth",
")",
":",
"print",
"(",
"\"OWNERS files that have missing team and component by depth:\"",
")",
"max_output_depth",
"=",
"len",
"(",
"stats",
"[",
"'OWNERS-count-by-depth'",
"]",
")",
"if",
... | Display OWNERS files that have missing team and component by depth. | [
"Display",
"OWNERS",
"files",
"that",
"have",
"missing",
"team",
"and",
"component",
"by",
"depth",
"."
] | [
"\"\"\"Display OWNERS files that have missing team and component by depth.\n\n OWNERS files that have no team and no component information will be shown\n for each depth level (up to the level given by num_output_depth).\n\n Args:\n stats (dict): The statistics in dictionary form as produced by the\n own... | [
{
"param": "stats",
"type": null
},
{
"param": "num_output_depth",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "stats",
"type": null,
"docstring": "The statistics in dictionary form as produced by the\nowners_file_tags module.",
"docstring_tokens": [
"The",
"statistics",
"in",
"dictionary",
"form"... |
17825c3de10a16339c7ae0f08e1614132bae8e21 | sunlongbo/chromium | third_party/blink/renderer/bindings/scripts/web_idl/exposure.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | global_names_and_features | <not_specific> | def global_names_and_features(self):
"""
Returns a list of pairs of global name and runtime enabled feature,
which is None if not applicable.
"""
return self._global_names_and_features |
Returns a list of pairs of global name and runtime enabled feature,
which is None if not applicable.
| Returns a list of pairs of global name and runtime enabled feature,
which is None if not applicable. | [
"Returns",
"a",
"list",
"of",
"pairs",
"of",
"global",
"name",
"and",
"runtime",
"enabled",
"feature",
"which",
"is",
"None",
"if",
"not",
"applicable",
"."
] | def global_names_and_features(self):
return self._global_names_and_features | [
"def",
"global_names_and_features",
"(",
"self",
")",
":",
"return",
"self",
".",
"_global_names_and_features"
] | Returns a list of pairs of global name and runtime enabled feature,
which is None if not applicable. | [
"Returns",
"a",
"list",
"of",
"pairs",
"of",
"global",
"name",
"and",
"runtime",
"enabled",
"feature",
"which",
"is",
"None",
"if",
"not",
"applicable",
"."
] | [
"\"\"\"\n Returns a list of pairs of global name and runtime enabled feature,\n which is None if not 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": []
} |
17825c3de10a16339c7ae0f08e1614132bae8e21 | sunlongbo/chromium | third_party/blink/renderer/bindings/scripts/web_idl/exposure.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | runtime_enabled_features | <not_specific> | def runtime_enabled_features(self):
"""
Returns a list of runtime enabled features. This construct is exposed
only when all these features are enabled.
"""
return self._runtime_enabled_features |
Returns a list of runtime enabled features. This construct is exposed
only when all these features are enabled.
| Returns a list of runtime enabled features. This construct is exposed
only when all these features are enabled. | [
"Returns",
"a",
"list",
"of",
"runtime",
"enabled",
"features",
".",
"This",
"construct",
"is",
"exposed",
"only",
"when",
"all",
"these",
"features",
"are",
"enabled",
"."
] | def runtime_enabled_features(self):
return self._runtime_enabled_features | [
"def",
"runtime_enabled_features",
"(",
"self",
")",
":",
"return",
"self",
".",
"_runtime_enabled_features"
] | Returns a list of runtime enabled features. | [
"Returns",
"a",
"list",
"of",
"runtime",
"enabled",
"features",
"."
] | [
"\"\"\"\n Returns a list of runtime enabled features. This construct is exposed\n only when all these features are enabled.\n \"\"\""
] | [
{
"param": "self",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
17825c3de10a16339c7ae0f08e1614132bae8e21 | sunlongbo/chromium | third_party/blink/renderer/bindings/scripts/web_idl/exposure.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | context_enabled_features | <not_specific> | def context_enabled_features(self):
"""
Returns a list of context enabled features. This construct is exposed
only when one of these features is enabled in the context.
"""
return self._context_enabled_features |
Returns a list of context enabled features. This construct is exposed
only when one of these features is enabled in the context.
| Returns a list of context enabled features. This construct is exposed
only when one of these features is enabled in the context. | [
"Returns",
"a",
"list",
"of",
"context",
"enabled",
"features",
".",
"This",
"construct",
"is",
"exposed",
"only",
"when",
"one",
"of",
"these",
"features",
"is",
"enabled",
"in",
"the",
"context",
"."
] | def context_enabled_features(self):
return self._context_enabled_features | [
"def",
"context_enabled_features",
"(",
"self",
")",
":",
"return",
"self",
".",
"_context_enabled_features"
] | Returns a list of context enabled features. | [
"Returns",
"a",
"list",
"of",
"context",
"enabled",
"features",
"."
] | [
"\"\"\"\n Returns a list of context enabled features. This construct is exposed\n only when one of these features is enabled in the context.\n \"\"\""
] | [
{
"param": "self",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
17825c3de10a16339c7ae0f08e1614132bae8e21 | sunlongbo/chromium | third_party/blink/renderer/bindings/scripts/web_idl/exposure.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | only_in_coi_contexts | <not_specific> | def only_in_coi_contexts(self):
"""
Returns whether this construct is available only in cross-origin
isolated contexts. The returned value is a boolean: True if the
construct is restricted to COI contexts, or False if not.
https://webidl.spec.whatwg.org/#CrossOriginIsolated
... |
Returns whether this construct is available only in cross-origin
isolated contexts. The returned value is a boolean: True if the
construct is restricted to COI contexts, or False if not.
https://webidl.spec.whatwg.org/#CrossOriginIsolated
| Returns whether this construct is available only in cross-origin
isolated contexts. The returned value is a boolean: True if the
construct is restricted to COI contexts, or False if not.
| [
"Returns",
"whether",
"this",
"construct",
"is",
"available",
"only",
"in",
"cross",
"-",
"origin",
"isolated",
"contexts",
".",
"The",
"returned",
"value",
"is",
"a",
"boolean",
":",
"True",
"if",
"the",
"construct",
"is",
"restricted",
"to",
"COI",
"contex... | def only_in_coi_contexts(self):
return self._only_in_coi_contexts | [
"def",
"only_in_coi_contexts",
"(",
"self",
")",
":",
"return",
"self",
".",
"_only_in_coi_contexts"
] | Returns whether this construct is available only in cross-origin
isolated contexts. | [
"Returns",
"whether",
"this",
"construct",
"is",
"available",
"only",
"in",
"cross",
"-",
"origin",
"isolated",
"contexts",
"."
] | [
"\"\"\"\n Returns whether this construct is available only in cross-origin\n isolated contexts. The returned value is a boolean: True if the\n construct is restricted to COI contexts, or False if not.\n\n https://webidl.spec.whatwg.org/#CrossOriginIsolated\n \"\"\""
] | [
{
"param": "self",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
17825c3de10a16339c7ae0f08e1614132bae8e21 | sunlongbo/chromium | third_party/blink/renderer/bindings/scripts/web_idl/exposure.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | only_in_direct_socket_contexts | <not_specific> | def only_in_direct_socket_contexts(self):
"""
Returns whether this construct is available only in contexts deemed
suitable to host Direct Sockets. The returned value is a boolean:
True if the construct is restricted to these contexts, False if not.
TODO(crbug.com/1206150): This ... |
Returns whether this construct is available only in contexts deemed
suitable to host Direct Sockets. The returned value is a boolean:
True if the construct is restricted to these contexts, False if not.
TODO(crbug.com/1206150): This needs a specification (and definition).
| Returns whether this construct is available only in contexts deemed
suitable to host Direct Sockets. The returned value is a boolean:
True if the construct is restricted to these contexts, False if not.
| [
"Returns",
"whether",
"this",
"construct",
"is",
"available",
"only",
"in",
"contexts",
"deemed",
"suitable",
"to",
"host",
"Direct",
"Sockets",
".",
"The",
"returned",
"value",
"is",
"a",
"boolean",
":",
"True",
"if",
"the",
"construct",
"is",
"restricted",
... | def only_in_direct_socket_contexts(self):
return self._only_in_direct_socket_contexts | [
"def",
"only_in_direct_socket_contexts",
"(",
"self",
")",
":",
"return",
"self",
".",
"_only_in_direct_socket_contexts"
] | Returns whether this construct is available only in contexts deemed
suitable to host Direct Sockets. | [
"Returns",
"whether",
"this",
"construct",
"is",
"available",
"only",
"in",
"contexts",
"deemed",
"suitable",
"to",
"host",
"Direct",
"Sockets",
"."
] | [
"\"\"\"\n Returns whether this construct is available only in contexts deemed\n suitable to host Direct Sockets. The returned value is a boolean:\n True if the construct is restricted to these contexts, False if not.\n\n TODO(crbug.com/1206150): This needs a specification (and definition... | [
{
"param": "self",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
17825c3de10a16339c7ae0f08e1614132bae8e21 | sunlongbo/chromium | third_party/blink/renderer/bindings/scripts/web_idl/exposure.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | only_in_secure_contexts | <not_specific> | def only_in_secure_contexts(self):
"""
Returns whether this construct is available only in secure contexts or
not. The returned value is either of a boolean (True: unconditionally
restricted in secure contexts, or False: never restricted) or a list of
flag names (restricted only... |
Returns whether this construct is available only in secure contexts or
not. The returned value is either of a boolean (True: unconditionally
restricted in secure contexts, or False: never restricted) or a list of
flag names (restricted only when all flags are enabled).
https:/... | Returns whether this construct is available only in secure contexts or
not. The returned value is either of a boolean (True: unconditionally
restricted in secure contexts, or False: never restricted) or a list of
flag names (restricted only when all flags are enabled).
| [
"Returns",
"whether",
"this",
"construct",
"is",
"available",
"only",
"in",
"secure",
"contexts",
"or",
"not",
".",
"The",
"returned",
"value",
"is",
"either",
"of",
"a",
"boolean",
"(",
"True",
":",
"unconditionally",
"restricted",
"in",
"secure",
"contexts",... | def only_in_secure_contexts(self):
if self._only_in_secure_contexts is None:
return False
return self._only_in_secure_contexts | [
"def",
"only_in_secure_contexts",
"(",
"self",
")",
":",
"if",
"self",
".",
"_only_in_secure_contexts",
"is",
"None",
":",
"return",
"False",
"return",
"self",
".",
"_only_in_secure_contexts"
] | Returns whether this construct is available only in secure contexts or
not. | [
"Returns",
"whether",
"this",
"construct",
"is",
"available",
"only",
"in",
"secure",
"contexts",
"or",
"not",
"."
] | [
"\"\"\"\n Returns whether this construct is available only in secure contexts or\n not. The returned value is either of a boolean (True: unconditionally\n restricted in secure contexts, or False: never restricted) or a list of\n flag names (restricted only when all flags are enabled).\n... | [
{
"param": "self",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
17825c3de10a16339c7ae0f08e1614132bae8e21 | sunlongbo/chromium | third_party/blink/renderer/bindings/scripts/web_idl/exposure.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | is_context_dependent | <not_specific> | def is_context_dependent(self, global_names=None):
"""
Returns True if the exposure of this construct depends on a context.
Args:
global_names: When specified, it's taken into account that the
global object implements |global_names|.
"""
assert (globa... |
Returns True if the exposure of this construct depends on a context.
Args:
global_names: When specified, it's taken into account that the
global object implements |global_names|.
| Returns True if the exposure of this construct depends on a context. | [
"Returns",
"True",
"if",
"the",
"exposure",
"of",
"this",
"construct",
"depends",
"on",
"a",
"context",
"."
] | def is_context_dependent(self, global_names=None):
assert (global_names is None
or (isinstance(global_names, (list, tuple))
and all(isinstance(name, str) for name in global_names)))
if (self.context_dependent_runtime_enabled_features
or self.context_en... | [
"def",
"is_context_dependent",
"(",
"self",
",",
"global_names",
"=",
"None",
")",
":",
"assert",
"(",
"global_names",
"is",
"None",
"or",
"(",
"isinstance",
"(",
"global_names",
",",
"(",
"list",
",",
"tuple",
")",
")",
"and",
"all",
"(",
"isinstance",
... | Returns True if the exposure of this construct depends on a context. | [
"Returns",
"True",
"if",
"the",
"exposure",
"of",
"this",
"construct",
"depends",
"on",
"a",
"context",
"."
] | [
"\"\"\"\n Returns True if the exposure of this construct depends on a context.\n\n Args:\n global_names: When specified, it's taken into account that the\n global object implements |global_names|.\n \"\"\""
] | [
{
"param": "self",
"type": null
},
{
"param": "global_names",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "global_names",
"type": null,
"docstring": "When specified, it's tak... |
5b88d0c1588a315cb860ce2e20c5b98b9658a752 | sunlongbo/chromium | tools/json_schema_compiler/features_h_generator.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | Generate | <not_specific> | def Generate(self):
"""Generates a Code object for features.
"""
c = Code()
(c.Append(cpp_util.CHROMIUM_LICENSE)
.Append()
.Append(cpp_util.GENERATED_FEATURE_MESSAGE %
cpp_util.ToPosixPath(self._source_file))
.Append()
)
# Hack: for the purpose of gyp the header ... | Generates a Code object for features.
| Generates a Code object for features. | [
"Generates",
"a",
"Code",
"object",
"for",
"features",
"."
] | def Generate(self):
c = Code()
(c.Append(cpp_util.CHROMIUM_LICENSE)
.Append()
.Append(cpp_util.GENERATED_FEATURE_MESSAGE %
cpp_util.ToPosixPath(self._source_file))
.Append()
)
output_file = os.path.splitext(self._namespace.source_file)[0] + '.h'
ifndef_name = cpp_util... | [
"def",
"Generate",
"(",
"self",
")",
":",
"c",
"=",
"Code",
"(",
")",
"(",
"c",
".",
"Append",
"(",
"cpp_util",
".",
"CHROMIUM_LICENSE",
")",
".",
"Append",
"(",
")",
".",
"Append",
"(",
"cpp_util",
".",
"GENERATED_FEATURE_MESSAGE",
"%",
"cpp_util",
".... | Generates a Code object for features. | [
"Generates",
"a",
"Code",
"object",
"for",
"features",
"."
] | [
"\"\"\"Generates a Code object for features.\n \"\"\"",
"# Hack: for the purpose of gyp the header file will always be the source",
"# file with its file extension replaced by '.h'. Assume so."
] | [
{
"param": "self",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
ec5c9785381d34749700c84e9ae5db20508a2ce2 | sunlongbo/chromium | tools/perf/core/results_processor/processor.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | ProcessResults | <not_specific> | def ProcessResults(options, is_unittest=False):
"""Process intermediate results and produce the requested outputs.
This function takes the intermediate results generated by Telemetry after
running benchmarks (including artifacts such as traces, etc.), and processes
them as requested by the result processing op... | Process intermediate results and produce the requested outputs.
This function takes the intermediate results generated by Telemetry after
running benchmarks (including artifacts such as traces, etc.), and processes
them as requested by the result processing options.
Args:
options: An options object with v... | Process intermediate results and produce the requested outputs.
This function takes the intermediate results generated by Telemetry after
running benchmarks (including artifacts such as traces, etc.), and processes
them as requested by the result processing options. | [
"Process",
"intermediate",
"results",
"and",
"produce",
"the",
"requested",
"outputs",
".",
"This",
"function",
"takes",
"the",
"intermediate",
"results",
"generated",
"by",
"Telemetry",
"after",
"running",
"benchmarks",
"(",
"including",
"artifacts",
"such",
"as",
... | def ProcessResults(options, is_unittest=False):
if not getattr(options, 'output_formats', None):
return 0
test_results = _LoadTestResults(options.intermediate_dir)
if not test_results:
logging.warning('No test results to process.')
test_suite_start = (test_results[0]['startTime']
if test_results a... | [
"def",
"ProcessResults",
"(",
"options",
",",
"is_unittest",
"=",
"False",
")",
":",
"if",
"not",
"getattr",
"(",
"options",
",",
"'output_formats'",
",",
"None",
")",
":",
"return",
"0",
"test_results",
"=",
"_LoadTestResults",
"(",
"options",
".",
"interme... | Process intermediate results and produce the requested outputs. | [
"Process",
"intermediate",
"results",
"and",
"produce",
"the",
"requested",
"outputs",
"."
] | [
"\"\"\"Process intermediate results and produce the requested outputs.\n\n This function takes the intermediate results generated by Telemetry after\n running benchmarks (including artifacts such as traces, etc.), and processes\n them as requested by the result processing options.\n\n Args:\n options: An opt... | [
{
"param": "options",
"type": null
},
{
"param": "is_unittest",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "options",
"type": null,
"docstring": "An options object with values parsed from the command line and\nafter any adjustments from ProcessOptions were applied.",
"docstring_tokens": [
"An",
"options",
"ob... |
ec5c9785381d34749700c84e9ae5db20508a2ce2 | sunlongbo/chromium | tools/perf/core/results_processor/processor.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | UploadArtifacts | null | def UploadArtifacts(test_result, upload_bucket, run_identifier):
"""Upload all artifacts to cloud.
For a test run, uploads all its artifacts to cloud and sets fetchUrl and
viewUrl fields in intermediate_results.
"""
artifacts = test_result.get('outputArtifacts', {})
for name, artifact in artifacts.items():... | Upload all artifacts to cloud.
For a test run, uploads all its artifacts to cloud and sets fetchUrl and
viewUrl fields in intermediate_results.
| Upload all artifacts to cloud.
For a test run, uploads all its artifacts to cloud and sets fetchUrl and
viewUrl fields in intermediate_results. | [
"Upload",
"all",
"artifacts",
"to",
"cloud",
".",
"For",
"a",
"test",
"run",
"uploads",
"all",
"its",
"artifacts",
"to",
"cloud",
"and",
"sets",
"fetchUrl",
"and",
"viewUrl",
"fields",
"in",
"intermediate_results",
"."
] | def UploadArtifacts(test_result, upload_bucket, run_identifier):
artifacts = test_result.get('outputArtifacts', {})
for name, artifact in artifacts.items():
if name in [DIAGNOSTICS_NAME, MEASUREMENTS_NAME]:
continue
retry_identifier = 'retry_%s' % test_result.get('resultId', '0')
remote_name = '/'... | [
"def",
"UploadArtifacts",
"(",
"test_result",
",",
"upload_bucket",
",",
"run_identifier",
")",
":",
"artifacts",
"=",
"test_result",
".",
"get",
"(",
"'outputArtifacts'",
",",
"{",
"}",
")",
"for",
"name",
",",
"artifact",
"in",
"artifacts",
".",
"items",
"... | Upload all artifacts to cloud. | [
"Upload",
"all",
"artifacts",
"to",
"cloud",
"."
] | [
"\"\"\"Upload all artifacts to cloud.\n\n For a test run, uploads all its artifacts to cloud and sets fetchUrl and\n viewUrl fields in intermediate_results.\n \"\"\"",
"# TODO(crbug.com/981349): Think of a more general way to",
"# specify which artifacts deserve uploading.",
"# Per crbug.com/1033755 some s... | [
{
"param": "test_result",
"type": null
},
{
"param": "upload_bucket",
"type": null
},
{
"param": "run_identifier",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "test_result",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "upload_bucket",
"type": null,
"docstring": null,
"docs... |
ec5c9785381d34749700c84e9ae5db20508a2ce2 | sunlongbo/chromium | tools/perf/core/results_processor/processor.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | ExtractMeasurements | null | def ExtractMeasurements(test_result):
"""Add ad-hoc measurements to histogram dicts"""
artifacts = test_result.get('outputArtifacts', {})
if MEASUREMENTS_NAME in artifacts:
with open(artifacts[MEASUREMENTS_NAME]['filePath']) as f:
measurements = json.load(f)['measurements']
for name, measurement in ... | Add ad-hoc measurements to histogram dicts | Add ad-hoc measurements to histogram dicts | [
"Add",
"ad",
"-",
"hoc",
"measurements",
"to",
"histogram",
"dicts"
] | def ExtractMeasurements(test_result):
artifacts = test_result.get('outputArtifacts', {})
if MEASUREMENTS_NAME in artifacts:
with open(artifacts[MEASUREMENTS_NAME]['filePath']) as f:
measurements = json.load(f)['measurements']
for name, measurement in measurements.items():
test_result['_histogram... | [
"def",
"ExtractMeasurements",
"(",
"test_result",
")",
":",
"artifacts",
"=",
"test_result",
".",
"get",
"(",
"'outputArtifacts'",
",",
"{",
"}",
")",
"if",
"MEASUREMENTS_NAME",
"in",
"artifacts",
":",
"with",
"open",
"(",
"artifacts",
"[",
"MEASUREMENTS_NAME",
... | Add ad-hoc measurements to histogram dicts | [
"Add",
"ad",
"-",
"hoc",
"measurements",
"to",
"histogram",
"dicts"
] | [
"\"\"\"Add ad-hoc measurements to histogram dicts\"\"\""
] | [
{
"param": "test_result",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "test_result",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
ec5c9785381d34749700c84e9ae5db20508a2ce2 | sunlongbo/chromium | tools/perf/core/results_processor/processor.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | main | <not_specific> | def main(args=None):
"""Entry point for the standalone version of the results_processor script."""
parser = command_line.ArgumentParser(standalone=True)
options = parser.parse_args(args)
command_line.ProcessOptions(options)
return ProcessResults(options, options.is_unittest) | Entry point for the standalone version of the results_processor script. | Entry point for the standalone version of the results_processor script. | [
"Entry",
"point",
"for",
"the",
"standalone",
"version",
"of",
"the",
"results_processor",
"script",
"."
] | def main(args=None):
parser = command_line.ArgumentParser(standalone=True)
options = parser.parse_args(args)
command_line.ProcessOptions(options)
return ProcessResults(options, options.is_unittest) | [
"def",
"main",
"(",
"args",
"=",
"None",
")",
":",
"parser",
"=",
"command_line",
".",
"ArgumentParser",
"(",
"standalone",
"=",
"True",
")",
"options",
"=",
"parser",
".",
"parse_args",
"(",
"args",
")",
"command_line",
".",
"ProcessOptions",
"(",
"option... | Entry point for the standalone version of the results_processor script. | [
"Entry",
"point",
"for",
"the",
"standalone",
"version",
"of",
"the",
"results_processor",
"script",
"."
] | [
"\"\"\"Entry point for the standalone version of the results_processor script.\"\"\""
] | [
{
"param": "args",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "args",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
a65fdc1208603aada3988f422c15ada7fd2f28e4 | sunlongbo/chromium | third_party/updater/chromium_mac_arm64/3pp/fetch.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | fetch | <not_specific> | def fetch(platform, minimum, minimum_lexographic):
"""
Queries GCS for versions and returns a tuple (min, max), where min is the
(numerically) lowest version greater than `minimum` returned by GCS, and
max is the greatest (lexographically) version returned by GCS. Because GCS
compares and returns it... |
Queries GCS for versions and returns a tuple (min, max), where min is the
(numerically) lowest version greater than `minimum` returned by GCS, and
max is the greatest (lexographically) version returned by GCS. Because GCS
compares and returns items in lexographic order, GCS may return no eligible
m... | Queries GCS for versions and returns a tuple (min, max), where min is the
(numerically) lowest version greater than `minimum` returned by GCS, and
max is the greatest (lexographically) version returned by GCS. Because GCS
compares and returns items in lexographic order, GCS may return no eligible
min items. (For exampl... | [
"Queries",
"GCS",
"for",
"versions",
"and",
"returns",
"a",
"tuple",
"(",
"min",
"max",
")",
"where",
"min",
"is",
"the",
"(",
"numerically",
")",
"lowest",
"version",
"greater",
"than",
"`",
"minimum",
"`",
"returned",
"by",
"GCS",
"and",
"max",
"is",
... | def fetch(platform, minimum, minimum_lexographic):
return functools.reduce(
lambda a, b: (min(a[0], int(b)) if int_or_inf(b) > minimum else a[0],
max(a[1], b)),
map(
lambda s: s[len(platform) + 1:-1],
json.loads(
six.moves.urllib.request.... | [
"def",
"fetch",
"(",
"platform",
",",
"minimum",
",",
"minimum_lexographic",
")",
":",
"return",
"functools",
".",
"reduce",
"(",
"lambda",
"a",
",",
"b",
":",
"(",
"min",
"(",
"a",
"[",
"0",
"]",
",",
"int",
"(",
"b",
")",
")",
"if",
"int_or_inf",... | Queries GCS for versions and returns a tuple (min, max), where min is the
(numerically) lowest version greater than `minimum` returned by GCS, and
max is the greatest (lexographically) version returned by GCS. | [
"Queries",
"GCS",
"for",
"versions",
"and",
"returns",
"a",
"tuple",
"(",
"min",
"max",
")",
"where",
"min",
"is",
"the",
"(",
"numerically",
")",
"lowest",
"version",
"greater",
"than",
"`",
"minimum",
"`",
"returned",
"by",
"GCS",
"and",
"max",
"is",
... | [
"\"\"\"\n Queries GCS for versions and returns a tuple (min, max), where min is the\n (numerically) lowest version greater than `minimum` returned by GCS, and\n max is the greatest (lexographically) version returned by GCS. Because GCS\n compares and returns items in lexographic order, GCS may return no... | [
{
"param": "platform",
"type": null
},
{
"param": "minimum",
"type": null
},
{
"param": "minimum_lexographic",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "platform",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "minimum",
"type": null,
"docstring": null,
"docstring_tok... |
a65fdc1208603aada3988f422c15ada7fd2f28e4 | sunlongbo/chromium | third_party/updater/chromium_mac_arm64/3pp/fetch.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | lastDatum | <not_specific> | def lastDatum(platform):
"""
Returns a version from GCS that is at least k versions old, and only
updates every n versions.
"""
latest = int(
six.moves.urllib.request.urlopen(
'https://storage.googleapis.com/storage/v1/b/'
'chromium-browser-snapshots/o/Mac%2FLAST_CHANGE... |
Returns a version from GCS that is at least k versions old, and only
updates every n versions.
| Returns a version from GCS that is at least k versions old, and only
updates every n versions. | [
"Returns",
"a",
"version",
"from",
"GCS",
"that",
"is",
"at",
"least",
"k",
"versions",
"old",
"and",
"only",
"updates",
"every",
"n",
"versions",
"."
] | def lastDatum(platform):
latest = int(
six.moves.urllib.request.urlopen(
'https://storage.googleapis.com/storage/v1/b/'
'chromium-browser-snapshots/o/Mac%2FLAST_CHANGE?alt=media').read())
min_datum = latest - 3000
min_datum -= min_datum % 10000
return find(platform, min_d... | [
"def",
"lastDatum",
"(",
"platform",
")",
":",
"latest",
"=",
"int",
"(",
"six",
".",
"moves",
".",
"urllib",
".",
"request",
".",
"urlopen",
"(",
"'https://storage.googleapis.com/storage/v1/b/'",
"'chromium-browser-snapshots/o/Mac%2FLAST_CHANGE?alt=media'",
")",
".",
... | Returns a version from GCS that is at least k versions old, and only
updates every n versions. | [
"Returns",
"a",
"version",
"from",
"GCS",
"that",
"is",
"at",
"least",
"k",
"versions",
"old",
"and",
"only",
"updates",
"every",
"n",
"versions",
"."
] | [
"\"\"\"\n Returns a version from GCS that is at least k versions old, and only\n updates every n versions.\n \"\"\""
] | [
{
"param": "platform",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "platform",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
a674a4daaf9461074621f4d618fed9f66ae25ca7 | sunlongbo/chromium | tools/android/python_utils/subprocess_utils.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | run_command | str | def run_command(
command: Sequence[str],
*, # Ensures that the rest of the args are passed explicitly.
cwd: Optional[str] = None,
cmd_input: Optional[str] = None,
exitcode_only: bool = False) -> str:
"""Runs a command and returns the output as a string.
For example, run_c... | Runs a command and returns the output as a string.
For example, run_command(['echo', ' Hello, world!\n']) returns the string
'Hello, world!' and run_command(['pwd'], cwd='/usr/local/bin') returns the
string '/usr/local/bin'.
Args:
command:
A sequence of strings representing the command to run, start... | Runs a command and returns the output as a string. | [
"Runs",
"a",
"command",
"and",
"returns",
"the",
"output",
"as",
"a",
"string",
"."
] | def run_command(
command: Sequence[str],
*,
cwd: Optional[str] = None,
cmd_input: Optional[str] = None,
exitcode_only: bool = False) -> str:
try:
run_result: subprocess.CompletedProcess = subprocess.run(
command,
capture_output=True,
... | [
"def",
"run_command",
"(",
"command",
":",
"Sequence",
"[",
"str",
"]",
",",
"*",
",",
"cwd",
":",
"Optional",
"[",
"str",
"]",
"=",
"None",
",",
"cmd_input",
":",
"Optional",
"[",
"str",
"]",
"=",
"None",
",",
"exitcode_only",
":",
"bool",
"=",
"F... | Runs a command and returns the output as a string. | [
"Runs",
"a",
"command",
"and",
"returns",
"the",
"output",
"as",
"a",
"string",
"."
] | [
"# Ensures that the rest of the args are passed explicitly.",
"\"\"\"Runs a command and returns the output as a string.\n\n For example, run_command(['echo', ' Hello, world!\\n']) returns the string\n 'Hello, world!' and run_command(['pwd'], cwd='/usr/local/bin') returns the\n string '/usr/local/bin'.\n\n Arg... | [
{
"param": "command",
"type": "Sequence[str]"
},
{
"param": "cwd",
"type": "Optional[str]"
},
{
"param": "cmd_input",
"type": "Optional[str]"
},
{
"param": "exitcode_only",
"type": "bool"
}
] | {
"returns": [
{
"docstring": "If |exitcode_only| is True, then only the exitcode is returned.\nOtherwise, output (stdout) of the command as a string. Leading and trailing\nwhitespace are stripped from the output.",
"docstring_tokens": [
"If",
"|exitcode_only|",
"is",
"... |
84a6360f91fb5dd81ba1dd4ef03fd9cd255aef52 | sunlongbo/chromium | ios/build/bots/scripts/variations_runner.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | _user_data_dir | <not_specific> | def _user_data_dir(self):
"""Returns path to user data dir containing "Local State" file.
Note: The path is under app data directory of host Chrome app under test.
The path changes each time launching app but the content is consistent.
"""
# This is required for next cmd to work.
iossim_util.bo... | Returns path to user data dir containing "Local State" file.
Note: The path is under app data directory of host Chrome app under test.
The path changes each time launching app but the content is consistent.
| Returns path to user data dir containing "Local State" file.
Note: The path is under app data directory of host Chrome app under test.
The path changes each time launching app but the content is consistent. | [
"Returns",
"path",
"to",
"user",
"data",
"dir",
"containing",
"\"",
"Local",
"State",
"\"",
"file",
".",
"Note",
":",
"The",
"path",
"is",
"under",
"app",
"data",
"directory",
"of",
"host",
"Chrome",
"app",
"under",
"test",
".",
"The",
"path",
"changes",... | def _user_data_dir(self):
iossim_util.boot_simulator_if_not_booted(self.udid)
app_data_path = iossim_util.get_app_data_directory(self.host_app_bundle_id,
self.udid)
return os.path.join(app_data_path, 'Library', 'Application Support',
... | [
"def",
"_user_data_dir",
"(",
"self",
")",
":",
"iossim_util",
".",
"boot_simulator_if_not_booted",
"(",
"self",
".",
"udid",
")",
"app_data_path",
"=",
"iossim_util",
".",
"get_app_data_directory",
"(",
"self",
".",
"host_app_bundle_id",
",",
"self",
".",
"udid",... | Returns path to user data dir containing "Local State" file. | [
"Returns",
"path",
"to",
"user",
"data",
"dir",
"containing",
"\"",
"Local",
"State",
"\"",
"file",
"."
] | [
"\"\"\"Returns path to user data dir containing \"Local State\" file.\n\n Note: The path is under app data directory of host Chrome app under test.\n The path changes each time launching app but the content is consistent.\n \"\"\"",
"# This is required for next cmd to work."
] | [
{
"param": "self",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
84a6360f91fb5dd81ba1dd4ef03fd9cd255aef52 | sunlongbo/chromium | ios/build/bots/scripts/variations_runner.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | _write_accepted_eula | null | def _write_accepted_eula(self):
"""Writes eula accepted to Local State.
This is needed once. Chrome host app doesn't have it accepted and variations
seed fetching requires it.
"""
seed_helper.update_local_state(self._user_data_dir(),
{'EulaAccepted': True})
LO... | Writes eula accepted to Local State.
This is needed once. Chrome host app doesn't have it accepted and variations
seed fetching requires it.
| Writes eula accepted to Local State.
This is needed once. Chrome host app doesn't have it accepted and variations
seed fetching requires it. | [
"Writes",
"eula",
"accepted",
"to",
"Local",
"State",
".",
"This",
"is",
"needed",
"once",
".",
"Chrome",
"host",
"app",
"doesn",
"'",
"t",
"have",
"it",
"accepted",
"and",
"variations",
"seed",
"fetching",
"requires",
"it",
"."
] | def _write_accepted_eula(self):
seed_helper.update_local_state(self._user_data_dir(),
{'EulaAccepted': True})
LOGGER.info('Wrote EulaAccepted: true to Local State.') | [
"def",
"_write_accepted_eula",
"(",
"self",
")",
":",
"seed_helper",
".",
"update_local_state",
"(",
"self",
".",
"_user_data_dir",
"(",
")",
",",
"{",
"'EulaAccepted'",
":",
"True",
"}",
")",
"LOGGER",
".",
"info",
"(",
"'Wrote EulaAccepted: true to Local State.'... | Writes eula accepted to Local State. | [
"Writes",
"eula",
"accepted",
"to",
"Local",
"State",
"."
] | [
"\"\"\"Writes eula accepted to Local State.\n\n This is needed once. Chrome host app doesn't have it accepted and variations\n seed fetching requires it.\n \"\"\""
] | [
{
"param": "self",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
84a6360f91fb5dd81ba1dd4ef03fd9cd255aef52 | sunlongbo/chromium | ios/build/bots/scripts/variations_runner.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | _reset_last_fetch_time | null | def _reset_last_fetch_time(self):
"""Resets last fetch time to one day before so the next fetch can happen.
On mobile devices the fetch will only happen 30 min after last fetch by
checking |variations_last_fetch_time| key in Local State.
"""
# Last fetch time in local state uses win timestamp in mi... | Resets last fetch time to one day before so the next fetch can happen.
On mobile devices the fetch will only happen 30 min after last fetch by
checking |variations_last_fetch_time| key in Local State.
| Resets last fetch time to one day before so the next fetch can happen.
On mobile devices the fetch will only happen 30 min after last fetch by
checking |variations_last_fetch_time| key in Local State. | [
"Resets",
"last",
"fetch",
"time",
"to",
"one",
"day",
"before",
"so",
"the",
"next",
"fetch",
"can",
"happen",
".",
"On",
"mobile",
"devices",
"the",
"fetch",
"will",
"only",
"happen",
"30",
"min",
"after",
"last",
"fetch",
"by",
"checking",
"|variations_... | def _reset_last_fetch_time(self):
win_delta = datetime.utcnow() - datetime(1601, 1, 1)
win_now = int(win_delta.total_seconds())
win_one_day_before = win_now - 60 * 60 * 24
win_one_day_before_microseconds = win_one_day_before * 1000000
seed_helper.update_local_state(
self._user_data_dir(), {
... | [
"def",
"_reset_last_fetch_time",
"(",
"self",
")",
":",
"win_delta",
"=",
"datetime",
".",
"utcnow",
"(",
")",
"-",
"datetime",
"(",
"1601",
",",
"1",
",",
"1",
")",
"win_now",
"=",
"int",
"(",
"win_delta",
".",
"total_seconds",
"(",
")",
")",
"win_one... | Resets last fetch time to one day before so the next fetch can happen. | [
"Resets",
"last",
"fetch",
"time",
"to",
"one",
"day",
"before",
"so",
"the",
"next",
"fetch",
"can",
"happen",
"."
] | [
"\"\"\"Resets last fetch time to one day before so the next fetch can happen.\n\n On mobile devices the fetch will only happen 30 min after last fetch by\n checking |variations_last_fetch_time| key in Local State.\n \"\"\"",
"# Last fetch time in local state uses win timestamp in microseconds."
] | [
{
"param": "self",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
84a6360f91fb5dd81ba1dd4ef03fd9cd255aef52 | sunlongbo/chromium | ios/build/bots/scripts/variations_runner.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | launch | <not_specific> | def launch(self):
"""Entrance to launch tests in this runner."""
success, log = self._launch_variations_smoke_test()
test_status = TestStatus.PASS if success else TestStatus.FAIL
# Report a single test named |VariationsSmokeTest| as part of runner output.
overall_result = ResultCollection(test_resu... | Entrance to launch tests in this runner. | Entrance to launch tests in this runner. | [
"Entrance",
"to",
"launch",
"tests",
"in",
"this",
"runner",
"."
] | def launch(self):
success, log = self._launch_variations_smoke_test()
test_status = TestStatus.PASS if success else TestStatus.FAIL
overall_result = ResultCollection(test_results=[
TestResult('VariationsSmokeTest', test_status, test_log=log)
])
overall_result.report_to_result_sink()
self... | [
"def",
"launch",
"(",
"self",
")",
":",
"success",
",",
"log",
"=",
"self",
".",
"_launch_variations_smoke_test",
"(",
")",
"test_status",
"=",
"TestStatus",
".",
"PASS",
"if",
"success",
"else",
"TestStatus",
".",
"FAIL",
"overall_result",
"=",
"ResultCollect... | Entrance to launch tests in this runner. | [
"Entrance",
"to",
"launch",
"tests",
"in",
"this",
"runner",
"."
] | [
"\"\"\"Entrance to launch tests in this runner.\"\"\"",
"# Report a single test named |VariationsSmokeTest| as part of runner output."
] | [
{
"param": "self",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
6b6b1a9e22d7cdf66d1ed57657815f7104d19c5a | sunlongbo/chromium | tools/vim/chromium.ycm_extra_conf.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | FindChromeSrcFromFilename | <not_specific> | def FindChromeSrcFromFilename(filename):
"""Searches for the root of the Chromium checkout.
Simply checks parent directories until it finds .gclient and src/.
Args:
filename: (String) Path to source file being edited.
Returns:
(String) Path of 'src/', or None if unable to find.
"""
curdir = os.pa... | Searches for the root of the Chromium checkout.
Simply checks parent directories until it finds .gclient and src/.
Args:
filename: (String) Path to source file being edited.
Returns:
(String) Path of 'src/', or None if unable to find.
| Searches for the root of the Chromium checkout.
Simply checks parent directories until it finds .gclient and src/. | [
"Searches",
"for",
"the",
"root",
"of",
"the",
"Chromium",
"checkout",
".",
"Simply",
"checks",
"parent",
"directories",
"until",
"it",
"finds",
".",
"gclient",
"and",
"src",
"/",
"."
] | def FindChromeSrcFromFilename(filename):
curdir = os.path.normpath(os.path.dirname(filename))
while not (
os.path.basename(curdir) == 'src' and PathExists(curdir, 'DEPS') and
(PathExists(curdir, '..', '.gclient') or PathExists(curdir, '.git'))):
nextdir = os.path.normpath(os.path.join(curdir, '..'))... | [
"def",
"FindChromeSrcFromFilename",
"(",
"filename",
")",
":",
"curdir",
"=",
"os",
".",
"path",
".",
"normpath",
"(",
"os",
".",
"path",
".",
"dirname",
"(",
"filename",
")",
")",
"while",
"not",
"(",
"os",
".",
"path",
".",
"basename",
"(",
"curdir",... | Searches for the root of the Chromium checkout. | [
"Searches",
"for",
"the",
"root",
"of",
"the",
"Chromium",
"checkout",
"."
] | [
"\"\"\"Searches for the root of the Chromium checkout.\n\n Simply checks parent directories until it finds .gclient and src/.\n\n Args:\n filename: (String) Path to source file being edited.\n\n Returns:\n (String) Path of 'src/', or None if unable to find.\n \"\"\""
] | [
{
"param": "filename",
"type": null
}
] | {
"returns": [
{
"docstring": "(String) Path of 'src/', or None if unable to find.",
"docstring_tokens": [
"(",
"String",
")",
"Path",
"of",
"'",
"src",
"/",
"'",
"or",
"None",
"if",
"unable",
... |
6b6b1a9e22d7cdf66d1ed57657815f7104d19c5a | sunlongbo/chromium | tools/vim/chromium.ycm_extra_conf.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | GetDefaultSourceFile | <not_specific> | def GetDefaultSourceFile(chrome_root, filename):
"""Returns the default source file to use as an alternative to |filename|.
Compile flags used to build the default source file is assumed to be a
close-enough approximation for building |filename|.
Args:
chrome_root: (String) Absolute path to the root of Ch... | Returns the default source file to use as an alternative to |filename|.
Compile flags used to build the default source file is assumed to be a
close-enough approximation for building |filename|.
Args:
chrome_root: (String) Absolute path to the root of Chromium checkout.
filename: (String) Absolute path ... | Returns the default source file to use as an alternative to |filename|.
Compile flags used to build the default source file is assumed to be a
close-enough approximation for building |filename|. | [
"Returns",
"the",
"default",
"source",
"file",
"to",
"use",
"as",
"an",
"alternative",
"to",
"|filename|",
".",
"Compile",
"flags",
"used",
"to",
"build",
"the",
"default",
"source",
"file",
"is",
"assumed",
"to",
"be",
"a",
"close",
"-",
"enough",
"approx... | def GetDefaultSourceFile(chrome_root, filename):
blink_root = os.path.join(chrome_root, 'third_party', 'WebKit')
if filename.startswith(blink_root):
return os.path.join(blink_root, 'Source', 'core', 'CoreInitializer.cpp')
else:
if 'test.' in filename:
return os.path.join(chrome_root, 'base', 'loggin... | [
"def",
"GetDefaultSourceFile",
"(",
"chrome_root",
",",
"filename",
")",
":",
"blink_root",
"=",
"os",
".",
"path",
".",
"join",
"(",
"chrome_root",
",",
"'third_party'",
",",
"'WebKit'",
")",
"if",
"filename",
".",
"startswith",
"(",
"blink_root",
")",
":",... | Returns the default source file to use as an alternative to |filename|. | [
"Returns",
"the",
"default",
"source",
"file",
"to",
"use",
"as",
"an",
"alternative",
"to",
"|filename|",
"."
] | [
"\"\"\"Returns the default source file to use as an alternative to |filename|.\n\n Compile flags used to build the default source file is assumed to be a\n close-enough approximation for building |filename|.\n\n Args:\n chrome_root: (String) Absolute path to the root of Chromium checkout.\n filename: (Stri... | [
{
"param": "chrome_root",
"type": null
},
{
"param": "filename",
"type": null
}
] | {
"returns": [
{
"docstring": "(String) Absolute path to substitute source file.",
"docstring_tokens": [
"(",
"String",
")",
"Absolute",
"path",
"to",
"substitute",
"source",
"file",
"."
],
"type": null
}
... |
6b6b1a9e22d7cdf66d1ed57657815f7104d19c5a | sunlongbo/chromium | tools/vim/chromium.ycm_extra_conf.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | GetNinjaBuildOutputsForSourceFile | <not_specific> | def GetNinjaBuildOutputsForSourceFile(out_dir, filename):
"""Returns a list of build outputs for filename.
The list is generated by invoking 'ninja -t query' tool to retrieve a list of
inputs and outputs of |filename|. This list is then filtered to only include
.o and .obj outputs.
Args:
out_dir: (Strin... | Returns a list of build outputs for filename.
The list is generated by invoking 'ninja -t query' tool to retrieve a list of
inputs and outputs of |filename|. This list is then filtered to only include
.o and .obj outputs.
Args:
out_dir: (String) Absolute path to ninja build output directory.
filename:... | Returns a list of build outputs for filename.
The list is generated by invoking 'ninja -t query' tool to retrieve a list of
inputs and outputs of |filename|. This list is then filtered to only include
.o and .obj outputs. | [
"Returns",
"a",
"list",
"of",
"build",
"outputs",
"for",
"filename",
".",
"The",
"list",
"is",
"generated",
"by",
"invoking",
"'",
"ninja",
"-",
"t",
"query",
"'",
"tool",
"to",
"retrieve",
"a",
"list",
"of",
"inputs",
"and",
"outputs",
"of",
"|filename|... | def GetNinjaBuildOutputsForSourceFile(out_dir, filename):
rel_filename = os.path.relpath(filename, out_dir)
p = subprocess.Popen(
['ninja', '-C', out_dir, '-t', 'query', rel_filename],
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT,
universal_newlines=True)
stdout, _ = p.communicate()
... | [
"def",
"GetNinjaBuildOutputsForSourceFile",
"(",
"out_dir",
",",
"filename",
")",
":",
"rel_filename",
"=",
"os",
".",
"path",
".",
"relpath",
"(",
"filename",
",",
"out_dir",
")",
"p",
"=",
"subprocess",
".",
"Popen",
"(",
"[",
"'ninja'",
",",
"'-C'",
","... | Returns a list of build outputs for filename. | [
"Returns",
"a",
"list",
"of",
"build",
"outputs",
"for",
"filename",
"."
] | [
"\"\"\"Returns a list of build outputs for filename.\n\n The list is generated by invoking 'ninja -t query' tool to retrieve a list of\n inputs and outputs of |filename|. This list is then filtered to only include\n .o and .obj outputs.\n\n Args:\n out_dir: (String) Absolute path to ninja build output direct... | [
{
"param": "out_dir",
"type": null
},
{
"param": "filename",
"type": null
}
] | {
"returns": [
{
"docstring": "(List of Strings) List of target names. Will return [] if |filename| doesn't\nyield any .o or .obj outputs.",
"docstring_tokens": [
"(",
"List",
"of",
"Strings",
")",
"List",
"of",
"target",
"names",... |
6b6b1a9e22d7cdf66d1ed57657815f7104d19c5a | sunlongbo/chromium | tools/vim/chromium.ycm_extra_conf.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | GetClangCommandLineForNinjaOutput | <not_specific> | def GetClangCommandLineForNinjaOutput(out_dir, build_target):
"""Returns the Clang command line for building |build_target|
Asks ninja for the list of commands used to build |filename| and returns the
final Clang invocation.
Args:
out_dir: (String) Absolute path to ninja build output directory.
build_... | Returns the Clang command line for building |build_target|
Asks ninja for the list of commands used to build |filename| and returns the
final Clang invocation.
Args:
out_dir: (String) Absolute path to ninja build output directory.
build_target: (String) A build target understood by ninja
Returns:
... | Returns the Clang command line for building |build_target|
Asks ninja for the list of commands used to build |filename| and returns the
final Clang invocation. | [
"Returns",
"the",
"Clang",
"command",
"line",
"for",
"building",
"|build_target|",
"Asks",
"ninja",
"for",
"the",
"list",
"of",
"commands",
"used",
"to",
"build",
"|filename|",
"and",
"returns",
"the",
"final",
"Clang",
"invocation",
"."
] | def GetClangCommandLineForNinjaOutput(out_dir, build_target):
p = subprocess.Popen(
['ninja', '-v', '-C', out_dir, '-t', 'commands', build_target],
stdout=subprocess.PIPE,
universal_newlines=True)
stdout, stderr = p.communicate()
if p.returncode != 0:
return None
for line in reversed(stdou... | [
"def",
"GetClangCommandLineForNinjaOutput",
"(",
"out_dir",
",",
"build_target",
")",
":",
"p",
"=",
"subprocess",
".",
"Popen",
"(",
"[",
"'ninja'",
",",
"'-v'",
",",
"'-C'",
",",
"out_dir",
",",
"'-t'",
",",
"'commands'",
",",
"build_target",
"]",
",",
"... | Returns the Clang command line for building |build_target|
Asks ninja for the list of commands used to build |filename| and returns the
final Clang invocation. | [
"Returns",
"the",
"Clang",
"command",
"line",
"for",
"building",
"|build_target|",
"Asks",
"ninja",
"for",
"the",
"list",
"of",
"commands",
"used",
"to",
"build",
"|filename|",
"and",
"returns",
"the",
"final",
"Clang",
"invocation",
"."
] | [
"\"\"\"Returns the Clang command line for building |build_target|\n\n Asks ninja for the list of commands used to build |filename| and returns the\n final Clang invocation.\n\n Args:\n out_dir: (String) Absolute path to ninja build output directory.\n build_target: (String) A build target understood by nin... | [
{
"param": "out_dir",
"type": null
},
{
"param": "build_target",
"type": null
}
] | {
"returns": [
{
"docstring": "(String or None) Clang command line or None if a Clang command line couldn't\nbe determined.",
"docstring_tokens": [
"(",
"String",
"or",
"None",
")",
"Clang",
"command",
"line",
"or",
"None"... |
6b6b1a9e22d7cdf66d1ed57657815f7104d19c5a | sunlongbo/chromium | tools/vim/chromium.ycm_extra_conf.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | GetClangOptionsFromCommandLine | <not_specific> | def GetClangOptionsFromCommandLine(clang_commandline, out_dir,
additional_flags):
"""Extracts relevant command line options from |clang_commandline|
Args:
clang_commandline: (String) Full Clang invocation.
out_dir: (String) Absolute path to ninja build directory. Relative... | Extracts relevant command line options from |clang_commandline|
Args:
clang_commandline: (String) Full Clang invocation.
out_dir: (String) Absolute path to ninja build directory. Relative paths in
the command line are relative to |out_dir|.
additional_flags: (List of String) Additional flags to r... | Extracts relevant command line options from |clang_commandline| | [
"Extracts",
"relevant",
"command",
"line",
"options",
"from",
"|clang_commandline|"
] | def GetClangOptionsFromCommandLine(clang_commandline, out_dir,
additional_flags):
clang_flags = [] + additional_flags
def abspath(path):
return os.path.normpath(os.path.join(out_dir, path))
clang_tokens = shlex.split(clang_commandline)
include_pattern = re.compile(r'^(-I|-... | [
"def",
"GetClangOptionsFromCommandLine",
"(",
"clang_commandline",
",",
"out_dir",
",",
"additional_flags",
")",
":",
"clang_flags",
"=",
"[",
"]",
"+",
"additional_flags",
"def",
"abspath",
"(",
"path",
")",
":",
"return",
"os",
".",
"path",
".",
"normpath",
... | Extracts relevant command line options from |clang_commandline| | [
"Extracts",
"relevant",
"command",
"line",
"options",
"from",
"|clang_commandline|"
] | [
"\"\"\"Extracts relevant command line options from |clang_commandline|\n\n Args:\n clang_commandline: (String) Full Clang invocation.\n out_dir: (String) Absolute path to ninja build directory. Relative paths in\n the command line are relative to |out_dir|.\n additional_flags: (List of String) Addi... | [
{
"param": "clang_commandline",
"type": null
},
{
"param": "out_dir",
"type": null
},
{
"param": "additional_flags",
"type": null
}
] | {
"returns": [
{
"docstring": "(List of Strings) The list of command line flags for this source file. Can\nbe empty.",
"docstring_tokens": [
"(",
"List",
"of",
"Strings",
")",
"The",
"list",
"of",
"command",
"line",
... |
6b6b1a9e22d7cdf66d1ed57657815f7104d19c5a | sunlongbo/chromium | tools/vim/chromium.ycm_extra_conf.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | GetClangOptionsFromNinjaForFilename | <not_specific> | def GetClangOptionsFromNinjaForFilename(chrome_root, filename):
"""Returns the Clang command line options needed for building |filename|.
Command line options are based on the command used by ninja for building
|filename|. If |filename| is a .h file, uses its companion .cc or .cpp file.
If a suitable companion... | Returns the Clang command line options needed for building |filename|.
Command line options are based on the command used by ninja for building
|filename|. If |filename| is a .h file, uses its companion .cc or .cpp file.
If a suitable companion file can't be located or if ninja doesn't know about
|filename|, t... | Returns the Clang command line options needed for building |filename|.
Command line options are based on the command used by ninja for building
|filename|. If |filename| is a .h file, uses its companion .cc or .cpp file.
If a suitable companion file can't be located or if ninja doesn't know about
|filename|, then uses ... | [
"Returns",
"the",
"Clang",
"command",
"line",
"options",
"needed",
"for",
"building",
"|filename|",
".",
"Command",
"line",
"options",
"are",
"based",
"on",
"the",
"command",
"used",
"by",
"ninja",
"for",
"building",
"|filename|",
".",
"If",
"|filename|",
"is"... | def GetClangOptionsFromNinjaForFilename(chrome_root, filename):
if not chrome_root:
return []
additional_flags = ['-I' + os.path.join(chrome_root)]
additional_flags.append('-Wno-unknown-warning-option')
sys.path.append(os.path.join(chrome_root, 'tools', 'vim'))
from ninja_output import GetNinjaOutputDirec... | [
"def",
"GetClangOptionsFromNinjaForFilename",
"(",
"chrome_root",
",",
"filename",
")",
":",
"if",
"not",
"chrome_root",
":",
"return",
"[",
"]",
"additional_flags",
"=",
"[",
"'-I'",
"+",
"os",
".",
"path",
".",
"join",
"(",
"chrome_root",
")",
"]",
"additi... | Returns the Clang command line options needed for building |filename|. | [
"Returns",
"the",
"Clang",
"command",
"line",
"options",
"needed",
"for",
"building",
"|filename|",
"."
] | [
"\"\"\"Returns the Clang command line options needed for building |filename|.\n\n Command line options are based on the command used by ninja for building\n |filename|. If |filename| is a .h file, uses its companion .cc or .cpp file.\n If a suitable companion file can't be located or if ninja doesn't know about\... | [
{
"param": "chrome_root",
"type": null
},
{
"param": "filename",
"type": null
}
] | {
"returns": [
{
"docstring": "(List of Strings) The list of command line flags for this source file. Can\nbe empty.",
"docstring_tokens": [
"(",
"List",
"of",
"Strings",
")",
"The",
"list",
"of",
"command",
"line",
... |
cc117d80f69780aad082e46ab6d2283ff5b5123e | sunlongbo/chromium | third_party/blink/tools/blinkpy/web_tests/controllers/single_test_runner.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | _run_rebaseline | <not_specific> | def _run_rebaseline(self):
"""Similar to _run_compare_test(), but has the side effect of updating
or adding baselines. This is called when --reset-results and/or
--copy-baselines are specified in the command line. If --reset-results,
in the returned result we treat baseline mismatch as s... | Similar to _run_compare_test(), but has the side effect of updating
or adding baselines. This is called when --reset-results and/or
--copy-baselines are specified in the command line. If --reset-results,
in the returned result we treat baseline mismatch as success. | Similar to _run_compare_test(), but has the side effect of updating
or adding baselines. This is called when --reset-results and/or
copy-baselines are specified in the command line. If --reset-results,
in the returned result we treat baseline mismatch as success. | [
"Similar",
"to",
"_run_compare_test",
"()",
"but",
"has",
"the",
"side",
"effect",
"of",
"updating",
"or",
"adding",
"baselines",
".",
"This",
"is",
"called",
"when",
"--",
"reset",
"-",
"results",
"and",
"/",
"or",
"copy",
"-",
"baselines",
"are",
"specif... | def _run_rebaseline(self):
driver_output = self._driver.run_test(self._driver_input())
expected_driver_output = self._expected_driver_output()
all_failures = self._compare_output(expected_driver_output,
driver_output)
if self._options.reset_res... | [
"def",
"_run_rebaseline",
"(",
"self",
")",
":",
"driver_output",
"=",
"self",
".",
"_driver",
".",
"run_test",
"(",
"self",
".",
"_driver_input",
"(",
")",
")",
"expected_driver_output",
"=",
"self",
".",
"_expected_driver_output",
"(",
")",
"all_failures",
"... | Similar to _run_compare_test(), but has the side effect of updating
or adding baselines. | [
"Similar",
"to",
"_run_compare_test",
"()",
"but",
"has",
"the",
"side",
"effect",
"of",
"updating",
"or",
"adding",
"baselines",
"."
] | [
"\"\"\"Similar to _run_compare_test(), but has the side effect of updating\n or adding baselines. This is called when --reset-results and/or\n --copy-baselines are specified in the command line. If --reset-results,\n in the returned result we treat baseline mismatch as success.\"\"\"",
"# Onl... | [
{
"param": "self",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
cc117d80f69780aad082e46ab6d2283ff5b5123e | sunlongbo/chromium | third_party/blink/tools/blinkpy/web_tests/controllers/single_test_runner.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | _update_or_add_new_baselines | <not_specific> | def _update_or_add_new_baselines(self, driver_output, failures):
"""Updates or adds new baselines for the test if necessary."""
if (test_failures.has_failure_type(test_failures.FailureTimeout,
failures)
or test_failures.has_failure_type(test_fai... | Updates or adds new baselines for the test if necessary. | Updates or adds new baselines for the test if necessary. | [
"Updates",
"or",
"adds",
"new",
"baselines",
"for",
"the",
"test",
"if",
"necessary",
"."
] | def _update_or_add_new_baselines(self, driver_output, failures):
if (test_failures.has_failure_type(test_failures.FailureTimeout,
failures)
or test_failures.has_failure_type(test_failures.FailureCrash,
f... | [
"def",
"_update_or_add_new_baselines",
"(",
"self",
",",
"driver_output",
",",
"failures",
")",
":",
"if",
"(",
"test_failures",
".",
"has_failure_type",
"(",
"test_failures",
".",
"FailureTimeout",
",",
"failures",
")",
"or",
"test_failures",
".",
"has_failure_type... | Updates or adds new baselines for the test if necessary. | [
"Updates",
"or",
"adds",
"new",
"baselines",
"for",
"the",
"test",
"if",
"necessary",
"."
] | [
"\"\"\"Updates or adds new baselines for the test if necessary.\"\"\"",
"# We usually don't want to create a new baseline if there isn't one",
"# existing (which usually means this baseline isn't necessary, e.g.",
"# an image-only test without text expectation files). However, in the",
"# following cases, w... | [
{
"param": "self",
"type": null
},
{
"param": "driver_output",
"type": null
},
{
"param": "failures",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "driver_output",
"type": null,
"docstring": null,
"docstring_t... |
cc117d80f69780aad082e46ab6d2283ff5b5123e | sunlongbo/chromium | third_party/blink/tools/blinkpy/web_tests/controllers/single_test_runner.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | _handle_error | <not_specific> | def _handle_error(self, driver_output, reference_filename=None):
"""Returns test failures if some unusual errors happen in driver's run.
Args:
driver_output: The output from the driver.
reference_filename: The full path to the reference file which produced
the driver_... | Returns test failures if some unusual errors happen in driver's run.
Args:
driver_output: The output from the driver.
reference_filename: The full path to the reference file which produced
the driver_output. This arg is optional and should be used only in
refte... | Returns test failures if some unusual errors happen in driver's run. | [
"Returns",
"test",
"failures",
"if",
"some",
"unusual",
"errors",
"happen",
"in",
"driver",
"'",
"s",
"run",
"."
] | def _handle_error(self, driver_output, reference_filename=None):
failures = []
if driver_output.timeout:
failures.append(
test_failures.FailureTimeout(driver_output,
bool(reference_filename)))
if reference_filename:
... | [
"def",
"_handle_error",
"(",
"self",
",",
"driver_output",
",",
"reference_filename",
"=",
"None",
")",
":",
"failures",
"=",
"[",
"]",
"if",
"driver_output",
".",
"timeout",
":",
"failures",
".",
"append",
"(",
"test_failures",
".",
"FailureTimeout",
"(",
"... | Returns test failures if some unusual errors happen in driver's run. | [
"Returns",
"test",
"failures",
"if",
"some",
"unusual",
"errors",
"happen",
"in",
"driver",
"'",
"s",
"run",
"."
] | [
"\"\"\"Returns test failures if some unusual errors happen in driver's run.\n\n Args:\n driver_output: The output from the driver.\n reference_filename: The full path to the reference file which produced\n the driver_output. This arg is optional and should be used only in\n ... | [
{
"param": "self",
"type": null
},
{
"param": "driver_output",
"type": null
},
{
"param": "reference_filename",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "driver_output",
"type": null,
"docstring": "The output from the dri... |
cc117d80f69780aad082e46ab6d2283ff5b5123e | sunlongbo/chromium | third_party/blink/tools/blinkpy/web_tests/controllers/single_test_runner.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | _report_extra_baseline | <not_specific> | def _report_extra_baseline(self, driver_output, extension, message):
"""If the baseline file exists, logs an error and returns True."""
if driver_output.crash or driver_output.timeout:
return False
# If the baseline overrides a fallback one, we need the empty file to
# match ... | If the baseline file exists, logs an error and returns True. | If the baseline file exists, logs an error and returns True. | [
"If",
"the",
"baseline",
"file",
"exists",
"logs",
"an",
"error",
"and",
"returns",
"True",
"."
] | def _report_extra_baseline(self, driver_output, extension, message):
if driver_output.crash or driver_output.timeout:
return False
if self._port.fallback_expected_filename(self._test_name, extension):
return False
expected_file = self._port.expected_filename(
... | [
"def",
"_report_extra_baseline",
"(",
"self",
",",
"driver_output",
",",
"extension",
",",
"message",
")",
":",
"if",
"driver_output",
".",
"crash",
"or",
"driver_output",
".",
"timeout",
":",
"return",
"False",
"if",
"self",
".",
"_port",
".",
"fallback_expec... | If the baseline file exists, logs an error and returns True. | [
"If",
"the",
"baseline",
"file",
"exists",
"logs",
"an",
"error",
"and",
"returns",
"True",
"."
] | [
"\"\"\"If the baseline file exists, logs an error and returns True.\"\"\"",
"# If the baseline overrides a fallback one, we need the empty file to",
"# match the empty result."
] | [
{
"param": "self",
"type": null
},
{
"param": "driver_output",
"type": null
},
{
"param": "extension",
"type": null
},
{
"param": "message",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "driver_output",
"type": null,
"docstring": null,
"docstring_t... |
cc3f7cb8e5a7776d61551bc36080d05fe59b0406 | sunlongbo/chromium | native_client_sdk/src/tools/create_nmf.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | SplitPath | <not_specific> | def SplitPath(path):
"""Returns all components of a path as a list.
e.g.
'foo/bar/baz.blah' => ['foo', 'bar', 'baz.blah']
"""
result = []
while path:
path, part = os.path.split(path)
result.append(part)
return result[::-1] # Reverse. | Returns all components of a path as a list.
e.g.
'foo/bar/baz.blah' => ['foo', 'bar', 'baz.blah']
| Returns all components of a path as a list. | [
"Returns",
"all",
"components",
"of",
"a",
"path",
"as",
"a",
"list",
"."
] | def SplitPath(path):
result = []
while path:
path, part = os.path.split(path)
result.append(part)
return result[::-1] | [
"def",
"SplitPath",
"(",
"path",
")",
":",
"result",
"=",
"[",
"]",
"while",
"path",
":",
"path",
",",
"part",
"=",
"os",
".",
"path",
".",
"split",
"(",
"path",
")",
"result",
".",
"append",
"(",
"part",
")",
"return",
"result",
"[",
":",
":",
... | Returns all components of a path as a list. | [
"Returns",
"all",
"components",
"of",
"a",
"path",
"as",
"a",
"list",
"."
] | [
"\"\"\"Returns all components of a path as a list.\n\n e.g.\n 'foo/bar/baz.blah' => ['foo', 'bar', 'baz.blah']\n \"\"\"",
"# Reverse."
] | [
{
"param": "path",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "path",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
cc3f7cb8e5a7776d61551bc36080d05fe59b0406 | sunlongbo/chromium | native_client_sdk/src/tools/create_nmf.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | MakePosixPath | <not_specific> | def MakePosixPath(path):
"""Converts from the native format to posixpath format.
e.g. on Windows, "foo\\bar\\baz.blah" => "foo/bar/baz.blah"
on Mac/Linux this is a no-op.
"""
if os.path == posixpath:
return path
return posixpath.join(*SplitPath(path)) | Converts from the native format to posixpath format.
e.g. on Windows, "foo\\bar\\baz.blah" => "foo/bar/baz.blah"
on Mac/Linux this is a no-op.
| Converts from the native format to posixpath format. | [
"Converts",
"from",
"the",
"native",
"format",
"to",
"posixpath",
"format",
"."
] | def MakePosixPath(path):
if os.path == posixpath:
return path
return posixpath.join(*SplitPath(path)) | [
"def",
"MakePosixPath",
"(",
"path",
")",
":",
"if",
"os",
".",
"path",
"==",
"posixpath",
":",
"return",
"path",
"return",
"posixpath",
".",
"join",
"(",
"*",
"SplitPath",
"(",
"path",
")",
")"
] | Converts from the native format to posixpath format. | [
"Converts",
"from",
"the",
"native",
"format",
"to",
"posixpath",
"format",
"."
] | [
"\"\"\"Converts from the native format to posixpath format.\n\n e.g. on Windows, \"foo\\\\bar\\\\baz.blah\" => \"foo/bar/baz.blah\"\n on Mac/Linux this is a no-op.\n \"\"\""
] | [
{
"param": "path",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "path",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
cc3f7cb8e5a7776d61551bc36080d05fe59b0406 | sunlongbo/chromium | native_client_sdk/src/tools/create_nmf.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | DirectoryTreeContainsFile | <not_specific> | def DirectoryTreeContainsFile(dirname, filename):
"""Returns True if a file is in a directory, or any of that directory's
subdirectories recursively.
e.g.
DirectoryTreeContainsFile("foo", "foo/quux.txt") => True
DirectoryTreeContainsFile("foo", "foo/bar/baz/blah.txt") => True
DirectoryTreeContainsFile("foo... | Returns True if a file is in a directory, or any of that directory's
subdirectories recursively.
e.g.
DirectoryTreeContainsFile("foo", "foo/quux.txt") => True
DirectoryTreeContainsFile("foo", "foo/bar/baz/blah.txt") => True
DirectoryTreeContainsFile("foo", "bar/blah.txt") => False
| Returns True if a file is in a directory, or any of that directory's
subdirectories recursively.
| [
"Returns",
"True",
"if",
"a",
"file",
"is",
"in",
"a",
"directory",
"or",
"any",
"of",
"that",
"directory",
"'",
"s",
"subdirectories",
"recursively",
"."
] | def DirectoryTreeContainsFile(dirname, filename):
real_dirname = os.path.realpath(dirname)
real_filename = os.path.realpath(filename)
return real_filename.startswith(real_dirname) | [
"def",
"DirectoryTreeContainsFile",
"(",
"dirname",
",",
"filename",
")",
":",
"real_dirname",
"=",
"os",
".",
"path",
".",
"realpath",
"(",
"dirname",
")",
"real_filename",
"=",
"os",
".",
"path",
".",
"realpath",
"(",
"filename",
")",
"return",
"real_filen... | Returns True if a file is in a directory, or any of that directory's
subdirectories recursively. | [
"Returns",
"True",
"if",
"a",
"file",
"is",
"in",
"a",
"directory",
"or",
"any",
"of",
"that",
"directory",
"'",
"s",
"subdirectories",
"recursively",
"."
] | [
"\"\"\"Returns True if a file is in a directory, or any of that directory's\n subdirectories recursively.\n\n e.g.\n DirectoryTreeContainsFile(\"foo\", \"foo/quux.txt\") => True\n DirectoryTreeContainsFile(\"foo\", \"foo/bar/baz/blah.txt\") => True\n DirectoryTreeContainsFile(\"foo\", \"bar/blah.txt\") => Fals... | [
{
"param": "dirname",
"type": null
},
{
"param": "filename",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "dirname",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "filename",
"type": null,
"docstring": null,
"docstring_tok... |
cc3f7cb8e5a7776d61551bc36080d05fe59b0406 | sunlongbo/chromium | native_client_sdk/src/tools/create_nmf.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | ParseElfHeader | <not_specific> | def ParseElfHeader(path):
"""Wrap elf.ParseElfHeader to return raise this module's Error on failure."""
try:
return elf.ParseElfHeader(path)
except elf.Error as e:
raise Error(str(e)) | Wrap elf.ParseElfHeader to return raise this module's Error on failure. | Wrap elf.ParseElfHeader to return raise this module's Error on failure. | [
"Wrap",
"elf",
".",
"ParseElfHeader",
"to",
"return",
"raise",
"this",
"module",
"'",
"s",
"Error",
"on",
"failure",
"."
] | def ParseElfHeader(path):
try:
return elf.ParseElfHeader(path)
except elf.Error as e:
raise Error(str(e)) | [
"def",
"ParseElfHeader",
"(",
"path",
")",
":",
"try",
":",
"return",
"elf",
".",
"ParseElfHeader",
"(",
"path",
")",
"except",
"elf",
".",
"Error",
"as",
"e",
":",
"raise",
"Error",
"(",
"str",
"(",
"e",
")",
")"
] | Wrap elf.ParseElfHeader to return raise this module's Error on failure. | [
"Wrap",
"elf",
".",
"ParseElfHeader",
"to",
"return",
"raise",
"this",
"module",
"'",
"s",
"Error",
"on",
"failure",
"."
] | [
"\"\"\"Wrap elf.ParseElfHeader to return raise this module's Error on failure.\"\"\""
] | [
{
"param": "path",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "path",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
cc3f7cb8e5a7776d61551bc36080d05fe59b0406 | sunlongbo/chromium | native_client_sdk/src/tools/create_nmf.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | GetNeeded | <not_specific> | def GetNeeded(self):
"""Collect the list of dependencies for the main_files
Returns:
A dict with key=filename and value=ArchFile of input files.
Includes the input files as well, with arch filled in if absent.
Example: { '/path/to/my.nexe': ArchFile(my.nexe),
'/pa... | Collect the list of dependencies for the main_files
Returns:
A dict with key=filename and value=ArchFile of input files.
Includes the input files as well, with arch filled in if absent.
Example: { '/path/to/my.nexe': ArchFile(my.nexe),
'/path/to/libfoo.so': ArchFile(l... | Collect the list of dependencies for the main_files | [
"Collect",
"the",
"list",
"of",
"dependencies",
"for",
"the",
"main_files"
] | def GetNeeded(self):
if self.needed:
return self.needed
DebugPrint('GetNeeded(%s)' % self.main_files)
if not self.objdump:
self.objdump = FindObjdumpExecutable()
try:
all_files = get_shared_deps.GetNeeded(self.main_files, self.objdump,
self.l... | [
"def",
"GetNeeded",
"(",
"self",
")",
":",
"if",
"self",
".",
"needed",
":",
"return",
"self",
".",
"needed",
"DebugPrint",
"(",
"'GetNeeded(%s)'",
"%",
"self",
".",
"main_files",
")",
"if",
"not",
"self",
".",
"objdump",
":",
"self",
".",
"objdump",
"... | Collect the list of dependencies for the main_files | [
"Collect",
"the",
"list",
"of",
"dependencies",
"for",
"the",
"main_files"
] | [
"\"\"\"Collect the list of dependencies for the main_files\n\n Returns:\n A dict with key=filename and value=ArchFile of input files.\n Includes the input files as well, with arch filled in if absent.\n Example: { '/path/to/my.nexe': ArchFile(my.nexe),\n '/path/to/libfo... | [
{
"param": "self",
"type": null
}
] | {
"returns": [
{
"docstring": "A dict with key=filename and value=ArchFile of input files.\nIncludes the input files as well, with arch filled in if absent.\nExample: { '/path/to/my.nexe': ArchFile(my.nexe),\n'/path/to/libfoo.so': ArchFile(libfoo.so) }",
"docstring_tokens": [
"A",
"dic... |
cc3f7cb8e5a7776d61551bc36080d05fe59b0406 | sunlongbo/chromium | native_client_sdk/src/tools/create_nmf.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | _SetArchFileUrls | null | def _SetArchFileUrls(self):
"""Fill in the url member of all ArchFiles in self.needed.
All urls are relative to the nmf_root. In addition, architecture-specific
files are relative to the .nexe with the matching architecture. This is
useful when making a multi-platform packaged app, so each architecture... | Fill in the url member of all ArchFiles in self.needed.
All urls are relative to the nmf_root. In addition, architecture-specific
files are relative to the .nexe with the matching architecture. This is
useful when making a multi-platform packaged app, so each architecture's
files are in a different dir... | Fill in the url member of all ArchFiles in self.needed.
All urls are relative to the nmf_root. In addition, architecture-specific
files are relative to the .nexe with the matching architecture. This is
useful when making a multi-platform packaged app, so each architecture's
files are in a different directory. | [
"Fill",
"in",
"the",
"url",
"member",
"of",
"all",
"ArchFiles",
"in",
"self",
".",
"needed",
".",
"All",
"urls",
"are",
"relative",
"to",
"the",
"nmf_root",
".",
"In",
"addition",
"architecture",
"-",
"specific",
"files",
"are",
"relative",
"to",
"the",
... | def _SetArchFileUrls(self):
assert self.needed is not None
main_nexes = [f for f in self.main_files if f.endswith('.nexe')]
arch_to_main_dir = {}
for main_file in main_nexes:
arch, _ = ParseElfHeader(main_file)
main_dir = os.path.dirname(main_file)
main_dir = PosixRelPath(main_dir, sel... | [
"def",
"_SetArchFileUrls",
"(",
"self",
")",
":",
"assert",
"self",
".",
"needed",
"is",
"not",
"None",
"main_nexes",
"=",
"[",
"f",
"for",
"f",
"in",
"self",
".",
"main_files",
"if",
"f",
".",
"endswith",
"(",
"'.nexe'",
")",
"]",
"arch_to_main_dir",
... | Fill in the url member of all ArchFiles in self.needed. | [
"Fill",
"in",
"the",
"url",
"member",
"of",
"all",
"ArchFiles",
"in",
"self",
".",
"needed",
"."
] | [
"\"\"\"Fill in the url member of all ArchFiles in self.needed.\n\n All urls are relative to the nmf_root. In addition, architecture-specific\n files are relative to the .nexe with the matching architecture. This is\n useful when making a multi-platform packaged app, so each architecture's\n files are in... | [
{
"param": "self",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
cc3f7cb8e5a7776d61551bc36080d05fe59b0406 | sunlongbo/chromium | native_client_sdk/src/tools/create_nmf.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | StageDependencies | null | def StageDependencies(self, destination_dir):
"""Copies over the dependencies into a given destination directory
Each library will be put into a subdirectory that corresponds to the arch.
Args:
destination_dir: The destination directory for staging the dependencies
"""
assert self.needed is ... | Copies over the dependencies into a given destination directory
Each library will be put into a subdirectory that corresponds to the arch.
Args:
destination_dir: The destination directory for staging the dependencies
| Copies over the dependencies into a given destination directory
Each library will be put into a subdirectory that corresponds to the arch. | [
"Copies",
"over",
"the",
"dependencies",
"into",
"a",
"given",
"destination",
"directory",
"Each",
"library",
"will",
"be",
"put",
"into",
"a",
"subdirectory",
"that",
"corresponds",
"to",
"the",
"arch",
"."
] | def StageDependencies(self, destination_dir):
assert self.needed is not None
for arch_file in self.needed.values():
source = arch_file.path
destination = os.path.join(destination_dir, arch_file.url)
if (os.path.normcase(os.path.realpath(source)) ==
os.path.normcase(os.path.realpath(d... | [
"def",
"StageDependencies",
"(",
"self",
",",
"destination_dir",
")",
":",
"assert",
"self",
".",
"needed",
"is",
"not",
"None",
"for",
"arch_file",
"in",
"self",
".",
"needed",
".",
"values",
"(",
")",
":",
"source",
"=",
"arch_file",
".",
"path",
"dest... | Copies over the dependencies into a given destination directory
Each library will be put into a subdirectory that corresponds to the arch. | [
"Copies",
"over",
"the",
"dependencies",
"into",
"a",
"given",
"destination",
"directory",
"Each",
"library",
"will",
"be",
"put",
"into",
"a",
"subdirectory",
"that",
"corresponds",
"to",
"the",
"arch",
"."
] | [
"\"\"\"Copies over the dependencies into a given destination directory\n\n Each library will be put into a subdirectory that corresponds to the arch.\n\n Args:\n destination_dir: The destination directory for staging the dependencies\n \"\"\"",
"# make sure target dir exists"
] | [
{
"param": "self",
"type": null
},
{
"param": "destination_dir",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "destination_dir",
"type": null,
"docstring": "The destination direc... |
cc3f7cb8e5a7776d61551bc36080d05fe59b0406 | sunlongbo/chromium | native_client_sdk/src/tools/create_nmf.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | _GenerateManifest | null | def _GenerateManifest(self):
"""Create a JSON formatted dict containing the files
NaCl will map url requests based on architecture. The startup NEXE
can always be found under the top key PROGRAM. Additional files are under
the FILES key further mapped by file name. In the case of 'runnable' the
... | Create a JSON formatted dict containing the files
NaCl will map url requests based on architecture. The startup NEXE
can always be found under the top key PROGRAM. Additional files are under
the FILES key further mapped by file name. In the case of 'runnable' the
PROGRAM key is populated with urls p... | Create a JSON formatted dict containing the files
NaCl will map url requests based on architecture. The startup NEXE
can always be found under the top key PROGRAM. Additional files are under
the FILES key further mapped by file name. In the case of 'runnable' the
PROGRAM key is populated with urls pointing the runna... | [
"Create",
"a",
"JSON",
"formatted",
"dict",
"containing",
"the",
"files",
"NaCl",
"will",
"map",
"url",
"requests",
"based",
"on",
"architecture",
".",
"The",
"startup",
"NEXE",
"can",
"always",
"be",
"found",
"under",
"the",
"top",
"key",
"PROGRAM",
".",
... | def _GenerateManifest(self):
manifest = { FILES_KEY: {}, PROGRAM_KEY: {} }
needed = self.GetNeeded()
extra_files_kv = [(key, ArchFile(name=key,
arch=arch,
path=url,
url=url))
... | [
"def",
"_GenerateManifest",
"(",
"self",
")",
":",
"manifest",
"=",
"{",
"FILES_KEY",
":",
"{",
"}",
",",
"PROGRAM_KEY",
":",
"{",
"}",
"}",
"needed",
"=",
"self",
".",
"GetNeeded",
"(",
")",
"extra_files_kv",
"=",
"[",
"(",
"key",
",",
"ArchFile",
"... | Create a JSON formatted dict containing the files
NaCl will map url requests based on architecture. | [
"Create",
"a",
"JSON",
"formatted",
"dict",
"containing",
"the",
"files",
"NaCl",
"will",
"map",
"url",
"requests",
"based",
"on",
"architecture",
"."
] | [
"\"\"\"Create a JSON formatted dict containing the files\n\n NaCl will map url requests based on architecture. The startup NEXE\n can always be found under the top key PROGRAM. Additional files are under\n the FILES key further mapped by file name. In the case of 'runnable' the\n PROGRAM key is popul... | [
{
"param": "self",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
cc3f7cb8e5a7776d61551bc36080d05fe59b0406 | sunlongbo/chromium | native_client_sdk/src/tools/create_nmf.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | GetManifest | <not_specific> | def GetManifest(self):
"""Returns a JSON-formatted dict containing the NaCl dependencies"""
if self.manifest is None:
if self.pnacl:
self._GeneratePNaClManifest()
else:
self._GenerateManifest()
return self.manifest | Returns a JSON-formatted dict containing the NaCl dependencies | Returns a JSON-formatted dict containing the NaCl dependencies | [
"Returns",
"a",
"JSON",
"-",
"formatted",
"dict",
"containing",
"the",
"NaCl",
"dependencies"
] | def GetManifest(self):
if self.manifest is None:
if self.pnacl:
self._GeneratePNaClManifest()
else:
self._GenerateManifest()
return self.manifest | [
"def",
"GetManifest",
"(",
"self",
")",
":",
"if",
"self",
".",
"manifest",
"is",
"None",
":",
"if",
"self",
".",
"pnacl",
":",
"self",
".",
"_GeneratePNaClManifest",
"(",
")",
"else",
":",
"self",
".",
"_GenerateManifest",
"(",
")",
"return",
"self",
... | Returns a JSON-formatted dict containing the NaCl dependencies | [
"Returns",
"a",
"JSON",
"-",
"formatted",
"dict",
"containing",
"the",
"NaCl",
"dependencies"
] | [
"\"\"\"Returns a JSON-formatted dict containing the NaCl dependencies\"\"\""
] | [
{
"param": "self",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
cc3f7cb8e5a7776d61551bc36080d05fe59b0406 | sunlongbo/chromium | native_client_sdk/src/tools/create_nmf.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | GetSDKRoot | <not_specific> | def GetSDKRoot():
"""Returns the root directory of the NaCl SDK.
"""
# This script should be installed in NACL_SDK_ROOT/tools. Assert that
# the 'toolchain' folder exists within this directory in case, for
# example, this script is moved to a different location.
# During the Chrome build this script is some... | Returns the root directory of the NaCl SDK.
| Returns the root directory of the NaCl SDK. | [
"Returns",
"the",
"root",
"directory",
"of",
"the",
"NaCl",
"SDK",
"."
] | def GetSDKRoot():
sdk_root = os.path.dirname(SCRIPT_DIR)
assert(os.path.exists(os.path.join(sdk_root, 'toolchain')))
return sdk_root | [
"def",
"GetSDKRoot",
"(",
")",
":",
"sdk_root",
"=",
"os",
".",
"path",
".",
"dirname",
"(",
"SCRIPT_DIR",
")",
"assert",
"(",
"os",
".",
"path",
".",
"exists",
"(",
"os",
".",
"path",
".",
"join",
"(",
"sdk_root",
",",
"'toolchain'",
")",
")",
")"... | Returns the root directory of the NaCl SDK. | [
"Returns",
"the",
"root",
"directory",
"of",
"the",
"NaCl",
"SDK",
"."
] | [
"\"\"\"Returns the root directory of the NaCl SDK.\n \"\"\"",
"# This script should be installed in NACL_SDK_ROOT/tools. Assert that",
"# the 'toolchain' folder exists within this directory in case, for",
"# example, this script is moved to a different location.",
"# During the Chrome build this script is ... | [] | {
"returns": [],
"raises": [],
"params": [],
"outlier_params": [],
"others": []
} |
cc3f7cb8e5a7776d61551bc36080d05fe59b0406 | sunlongbo/chromium | native_client_sdk/src/tools/create_nmf.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | FindObjdumpExecutable | <not_specific> | def FindObjdumpExecutable():
"""Derive path to objdump executable to use for determining shared
object dependencies.
"""
osname = getos.GetPlatform()
toolchain = os.path.join(GetSDKRoot(), 'toolchain', '%s_x86_glibc' % osname)
objdump = os.path.join(toolchain, 'bin', 'x86_64-nacl-objdump')
if osname == 'w... | Derive path to objdump executable to use for determining shared
object dependencies.
| Derive path to objdump executable to use for determining shared
object dependencies. | [
"Derive",
"path",
"to",
"objdump",
"executable",
"to",
"use",
"for",
"determining",
"shared",
"object",
"dependencies",
"."
] | def FindObjdumpExecutable():
osname = getos.GetPlatform()
toolchain = os.path.join(GetSDKRoot(), 'toolchain', '%s_x86_glibc' % osname)
objdump = os.path.join(toolchain, 'bin', 'x86_64-nacl-objdump')
if osname == 'win':
objdump += '.exe'
if not os.path.exists(objdump):
sys.stderr.write('WARNING: failed... | [
"def",
"FindObjdumpExecutable",
"(",
")",
":",
"osname",
"=",
"getos",
".",
"GetPlatform",
"(",
")",
"toolchain",
"=",
"os",
".",
"path",
".",
"join",
"(",
"GetSDKRoot",
"(",
")",
",",
"'toolchain'",
",",
"'%s_x86_glibc'",
"%",
"osname",
")",
"objdump",
... | Derive path to objdump executable to use for determining shared
object dependencies. | [
"Derive",
"path",
"to",
"objdump",
"executable",
"to",
"use",
"for",
"determining",
"shared",
"object",
"dependencies",
"."
] | [
"\"\"\"Derive path to objdump executable to use for determining shared\n object dependencies.\n \"\"\""
] | [] | {
"returns": [],
"raises": [],
"params": [],
"outlier_params": [],
"others": []
} |
cc3f7cb8e5a7776d61551bc36080d05fe59b0406 | sunlongbo/chromium | native_client_sdk/src/tools/create_nmf.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | GetDefaultLibPath | <not_specific> | def GetDefaultLibPath(config):
"""Derive default library path.
This path is used when searching for shared objects. This currently includes
the toolchain library folders and the top level SDK lib folder.
"""
sdk_root = GetSDKRoot()
osname = getos.GetPlatform()
libpath = [
# Core toolchain libraries... | Derive default library path.
This path is used when searching for shared objects. This currently includes
the toolchain library folders and the top level SDK lib folder.
| Derive default library path.
This path is used when searching for shared objects. This currently includes
the toolchain library folders and the top level SDK lib folder. | [
"Derive",
"default",
"library",
"path",
".",
"This",
"path",
"is",
"used",
"when",
"searching",
"for",
"shared",
"objects",
".",
"This",
"currently",
"includes",
"the",
"toolchain",
"library",
"folders",
"and",
"the",
"top",
"level",
"SDK",
"lib",
"folder",
... | def GetDefaultLibPath(config):
sdk_root = GetSDKRoot()
osname = getos.GetPlatform()
libpath = [
'toolchain/%s_x86_glibc/x86_64-nacl/lib' % osname,
'toolchain/%s_x86_glibc/x86_64-nacl/lib32' % osname,
'toolchain/%s_arm_glibc/arm-nacl/lib' % osname,
'toolchain/%s_x86_glibc/x86_64-nacl/usr/lib' % osn... | [
"def",
"GetDefaultLibPath",
"(",
"config",
")",
":",
"sdk_root",
"=",
"GetSDKRoot",
"(",
")",
"osname",
"=",
"getos",
".",
"GetPlatform",
"(",
")",
"libpath",
"=",
"[",
"'toolchain/%s_x86_glibc/x86_64-nacl/lib'",
"%",
"osname",
",",
"'toolchain/%s_x86_glibc/x86_64-n... | Derive default library path. | [
"Derive",
"default",
"library",
"path",
"."
] | [
"\"\"\"Derive default library path.\n\n This path is used when searching for shared objects. This currently includes\n the toolchain library folders and the top level SDK lib folder.\n \"\"\"",
"# Core toolchain libraries",
"# user installed libraries (used by webports)",
"# SDK bundle libraries",
"# In... | [
{
"param": "config",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "config",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
7476da1bef86dda76eb724fdcab33e235b1a3368 | sunlongbo/chromium | tools/binary_size/libsupersize/demangle.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | StripLlvmPromotedGlobalNames | <not_specific> | def StripLlvmPromotedGlobalNames(name):
"""Strips LLVM promoted global names suffix, and returns the result.
LLVM can promote global names by adding the suffix '.llvm.1234', or
'.1.llvm.1234', where the last numeric suffix is a hash. If demangle is
sucessful, the suffix transforms into, e.g., ' (.llvm.1234)' o... | Strips LLVM promoted global names suffix, and returns the result.
LLVM can promote global names by adding the suffix '.llvm.1234', or
'.1.llvm.1234', where the last numeric suffix is a hash. If demangle is
sucessful, the suffix transforms into, e.g., ' (.llvm.1234)' or
' (.1.llvm.1234)'. Otherwise the suffix i... | Strips LLVM promoted global names suffix, and returns the result.
LLVM can promote global names by adding the suffix '.llvm.1234', or
'.1.llvm.1234', where the last numeric suffix is a hash. | [
"Strips",
"LLVM",
"promoted",
"global",
"names",
"suffix",
"and",
"returns",
"the",
"result",
".",
"LLVM",
"can",
"promote",
"global",
"names",
"by",
"adding",
"the",
"suffix",
"'",
".",
"llvm",
".",
"1234",
"'",
"or",
"'",
".",
"1",
".",
"llvm",
".",
... | def StripLlvmPromotedGlobalNames(name):
llvm_pos = name.find('.llvm.')
if llvm_pos < 0:
return name
if name.endswith(')'):
return _PROMOTED_GLOBAL_NAME_DEMANGLED_PATTERN.sub('', name)
return _PROMOTED_GLOBAL_NAME_RAW_PATTERN.sub('', name) | [
"def",
"StripLlvmPromotedGlobalNames",
"(",
"name",
")",
":",
"llvm_pos",
"=",
"name",
".",
"find",
"(",
"'.llvm.'",
")",
"if",
"llvm_pos",
"<",
"0",
":",
"return",
"name",
"if",
"name",
".",
"endswith",
"(",
"')'",
")",
":",
"return",
"_PROMOTED_GLOBAL_NA... | Strips LLVM promoted global names suffix, and returns the result. | [
"Strips",
"LLVM",
"promoted",
"global",
"names",
"suffix",
"and",
"returns",
"the",
"result",
"."
] | [
"\"\"\"Strips LLVM promoted global names suffix, and returns the result.\n\n LLVM can promote global names by adding the suffix '.llvm.1234', or\n '.1.llvm.1234', where the last numeric suffix is a hash. If demangle is\n sucessful, the suffix transforms into, e.g., ' (.llvm.1234)' or\n ' (.1.llvm.1234)'. Otherw... | [
{
"param": "name",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "name",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
7476da1bef86dda76eb724fdcab33e235b1a3368 | sunlongbo/chromium | tools/binary_size/libsupersize/demangle.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | _ExtractDemanglablePart | <not_specific> | def _ExtractDemanglablePart(names):
"""For each name in |names|, yields the part that can be demangled."""
def _IsLowerHex(s):
return _LOWER_HEX_PATTERN.match(s) is not None
for name in names:
# Strip prefixes before '_Z', e.g., '.Lswitch.table.'.
pos = name.find('_Z')
if pos > 0:
name = n... | For each name in |names|, yields the part that can be demangled. | For each name in |names|, yields the part that can be demangled. | [
"For",
"each",
"name",
"in",
"|names|",
"yields",
"the",
"part",
"that",
"can",
"be",
"demangled",
"."
] | def _ExtractDemanglablePart(names):
def _IsLowerHex(s):
return _LOWER_HEX_PATTERN.match(s) is not None
for name in names:
pos = name.find('_Z')
if pos > 0:
name = name[pos:]
if name.endswith('.cfi'):
name = name[:-4]
if len(name) > 33 and name[-33] == '$' and _IsLowerHex(name[-32:]):... | [
"def",
"_ExtractDemanglablePart",
"(",
"names",
")",
":",
"def",
"_IsLowerHex",
"(",
"s",
")",
":",
"return",
"_LOWER_HEX_PATTERN",
".",
"match",
"(",
"s",
")",
"is",
"not",
"None",
"for",
"name",
"in",
"names",
":",
"pos",
"=",
"name",
".",
"find",
"(... | For each name in |names|, yields the part that can be demangled. | [
"For",
"each",
"name",
"in",
"|names|",
"yields",
"the",
"part",
"that",
"can",
"be",
"demangled",
"."
] | [
"\"\"\"For each name in |names|, yields the part that can be demangled.\"\"\"",
"# Strip prefixes before '_Z', e.g., '.Lswitch.table.'.",
"# Some mangled symbols end with '$' followed by 32 lower-case hex digits,",
"# and possibly '.cfi'. These interfere with demangling by c++filt, and",
"# should be stripp... | [
{
"param": "names",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "names",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
7476da1bef86dda76eb724fdcab33e235b1a3368 | sunlongbo/chromium | tools/binary_size/libsupersize/demangle.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | _DemangleNames | <not_specific> | def _DemangleNames(names, tool_prefix):
"""Uses c++filt to demangle a list of names."""
# pylint: disable=unexpected-keyword-arg
proc = subprocess.Popen([path_util.GetCppFiltPath(tool_prefix)],
stdin=subprocess.PIPE,
stdout=subprocess.PIPE,
... | Uses c++filt to demangle a list of names. | Uses c++filt to demangle a list of names. | [
"Uses",
"c",
"++",
"filt",
"to",
"demangle",
"a",
"list",
"of",
"names",
"."
] | def _DemangleNames(names, tool_prefix):
proc = subprocess.Popen([path_util.GetCppFiltPath(tool_prefix)],
stdin=subprocess.PIPE,
stdout=subprocess.PIPE,
encoding='utf-8')
in_data = '\n'.join(_ExtractDemanglablePart(names))
stdout = proc.... | [
"def",
"_DemangleNames",
"(",
"names",
",",
"tool_prefix",
")",
":",
"proc",
"=",
"subprocess",
".",
"Popen",
"(",
"[",
"path_util",
".",
"GetCppFiltPath",
"(",
"tool_prefix",
")",
"]",
",",
"stdin",
"=",
"subprocess",
".",
"PIPE",
",",
"stdout",
"=",
"s... | Uses c++filt to demangle a list of names. | [
"Uses",
"c",
"++",
"filt",
"to",
"demangle",
"a",
"list",
"of",
"names",
"."
] | [
"\"\"\"Uses c++filt to demangle a list of names.\"\"\"",
"# pylint: disable=unexpected-keyword-arg"
] | [
{
"param": "names",
"type": null
},
{
"param": "tool_prefix",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "names",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "tool_prefix",
"type": null,
"docstring": null,
"docstring_to... |
7476da1bef86dda76eb724fdcab33e235b1a3368 | sunlongbo/chromium | tools/binary_size/libsupersize/demangle.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | DemangleRemainingSymbols | <not_specific> | def DemangleRemainingSymbols(raw_symbols, tool_prefix):
"""Demangles any symbols that need it."""
to_process = [s for s in raw_symbols if _CanDemangle(s.full_name)]
if not to_process:
return
logging.info('Demangling %d symbols', len(to_process))
names = _DemangleNames([s.full_name for s in to_process], t... | Demangles any symbols that need it. | Demangles any symbols that need it. | [
"Demangles",
"any",
"symbols",
"that",
"need",
"it",
"."
] | def DemangleRemainingSymbols(raw_symbols, tool_prefix):
to_process = [s for s in raw_symbols if _CanDemangle(s.full_name)]
if not to_process:
return
logging.info('Demangling %d symbols', len(to_process))
names = _DemangleNames([s.full_name for s in to_process], tool_prefix)
for i, name in enumerate(names)... | [
"def",
"DemangleRemainingSymbols",
"(",
"raw_symbols",
",",
"tool_prefix",
")",
":",
"to_process",
"=",
"[",
"s",
"for",
"s",
"in",
"raw_symbols",
"if",
"_CanDemangle",
"(",
"s",
".",
"full_name",
")",
"]",
"if",
"not",
"to_process",
":",
"return",
"logging"... | Demangles any symbols that need it. | [
"Demangles",
"any",
"symbols",
"that",
"need",
"it",
"."
] | [
"\"\"\"Demangles any symbols that need it.\"\"\""
] | [
{
"param": "raw_symbols",
"type": null
},
{
"param": "tool_prefix",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "raw_symbols",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "tool_prefix",
"type": null,
"docstring": null,
"docstr... |
7476da1bef86dda76eb724fdcab33e235b1a3368 | sunlongbo/chromium | tools/binary_size/libsupersize/demangle.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | DemangleKeysAndMergeLists | <not_specific> | def DemangleKeysAndMergeLists(name_to_list, tool_prefix):
"""Demangles keys of a dict of lists, and returns the result.
Keys may demangle to a common name. When this happens, the corresponding lists
are merged in arbitrary order.
"""
keys = [key for key in name_to_list if _CanDemangle(key)]
if not keys:
... | Demangles keys of a dict of lists, and returns the result.
Keys may demangle to a common name. When this happens, the corresponding lists
are merged in arbitrary order.
| Demangles keys of a dict of lists, and returns the result.
Keys may demangle to a common name. When this happens, the corresponding lists
are merged in arbitrary order. | [
"Demangles",
"keys",
"of",
"a",
"dict",
"of",
"lists",
"and",
"returns",
"the",
"result",
".",
"Keys",
"may",
"demangle",
"to",
"a",
"common",
"name",
".",
"When",
"this",
"happens",
"the",
"corresponding",
"lists",
"are",
"merged",
"in",
"arbitrary",
"ord... | def DemangleKeysAndMergeLists(name_to_list, tool_prefix):
keys = [key for key in name_to_list if _CanDemangle(key)]
if not keys:
return name_to_list
logging.info('Demangling %d keys', len(keys))
key_iter = iter(_DemangleNames(keys, tool_prefix))
ret = collections.defaultdict(list)
for key, val in name_t... | [
"def",
"DemangleKeysAndMergeLists",
"(",
"name_to_list",
",",
"tool_prefix",
")",
":",
"keys",
"=",
"[",
"key",
"for",
"key",
"in",
"name_to_list",
"if",
"_CanDemangle",
"(",
"key",
")",
"]",
"if",
"not",
"keys",
":",
"return",
"name_to_list",
"logging",
"."... | Demangles keys of a dict of lists, and returns the result. | [
"Demangles",
"keys",
"of",
"a",
"dict",
"of",
"lists",
"and",
"returns",
"the",
"result",
"."
] | [
"\"\"\"Demangles keys of a dict of lists, and returns the result.\n\n Keys may demangle to a common name. When this happens, the corresponding lists\n are merged in arbitrary order.\n \"\"\""
] | [
{
"param": "name_to_list",
"type": null
},
{
"param": "tool_prefix",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "name_to_list",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "tool_prefix",
"type": null,
"docstring": null,
"docst... |
2841d5b6484678ba89a569c81e4443f9a6b78a4e | sunlongbo/chromium | chrome/test/data/android/upload_download_utils_test.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | filter_image_only | <not_specific> | def filter_image_only(f):
"""Filter only png file through."""
if f.endswith('png'):
return True
return False | Filter only png file through. | Filter only png file through. | [
"Filter",
"only",
"png",
"file",
"through",
"."
] | def filter_image_only(f):
if f.endswith('png'):
return True
return False | [
"def",
"filter_image_only",
"(",
"f",
")",
":",
"if",
"f",
".",
"endswith",
"(",
"'png'",
")",
":",
"return",
"True",
"return",
"False"
] | Filter only png file through. | [
"Filter",
"only",
"png",
"file",
"through",
"."
] | [
"\"\"\"Filter only png file through.\"\"\""
] | [
{
"param": "f",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "f",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
27dafd669a578026c4a4c26abf91a0e9cb7a5bbb | sunlongbo/chromium | chrome/browser/resources/chromeos/accessibility/tools/path_helpers.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | AccessibilityPath | <not_specific> | def AccessibilityPath(path='.'):
'''Converts a path relative to the top-level accessibility directory to a
path relative to the current directory.
'''
return os.path.relpath(os.path.join(_SCRIPT_DIR, '..', path)) | Converts a path relative to the top-level accessibility directory to a
path relative to the current directory.
| Converts a path relative to the top-level accessibility directory to a
path relative to the current directory. | [
"Converts",
"a",
"path",
"relative",
"to",
"the",
"top",
"-",
"level",
"accessibility",
"directory",
"to",
"a",
"path",
"relative",
"to",
"the",
"current",
"directory",
"."
] | def AccessibilityPath(path='.'):
return os.path.relpath(os.path.join(_SCRIPT_DIR, '..', path)) | [
"def",
"AccessibilityPath",
"(",
"path",
"=",
"'.'",
")",
":",
"return",
"os",
".",
"path",
".",
"relpath",
"(",
"os",
".",
"path",
".",
"join",
"(",
"_SCRIPT_DIR",
",",
"'..'",
",",
"path",
")",
")"
] | Converts a path relative to the top-level accessibility directory to a
path relative to the current directory. | [
"Converts",
"a",
"path",
"relative",
"to",
"the",
"top",
"-",
"level",
"accessibility",
"directory",
"to",
"a",
"path",
"relative",
"to",
"the",
"current",
"directory",
"."
] | [
"'''Converts a path relative to the top-level accessibility directory to a\n path relative to the current directory.\n '''"
] | [
{
"param": "path",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "path",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
d9005078671ee514a13710131bd901123f15b2e5 | sunlongbo/chromium | mojo/public/tools/mojom/enum_unittest.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | testExplicitValues | null | def testExplicitValues(self):
"""Verifies basic parsing of assigned integral values."""
types = self.ExtractTypes('enum E { kFoo=0, kBar=2, kBaz };')
self.assertEqual('kFoo', types['E'].fields[0].mojom_name)
self.assertEqual(0, types['E'].fields[0].numeric_value)
self.assertEqual('kBar', types['E'].... | Verifies basic parsing of assigned integral values. | Verifies basic parsing of assigned integral values. | [
"Verifies",
"basic",
"parsing",
"of",
"assigned",
"integral",
"values",
"."
] | def testExplicitValues(self):
types = self.ExtractTypes('enum E { kFoo=0, kBar=2, kBaz };')
self.assertEqual('kFoo', types['E'].fields[0].mojom_name)
self.assertEqual(0, types['E'].fields[0].numeric_value)
self.assertEqual('kBar', types['E'].fields[1].mojom_name)
self.assertEqual(2, types['E'].field... | [
"def",
"testExplicitValues",
"(",
"self",
")",
":",
"types",
"=",
"self",
".",
"ExtractTypes",
"(",
"'enum E { kFoo=0, kBar=2, kBaz };'",
")",
"self",
".",
"assertEqual",
"(",
"'kFoo'",
",",
"types",
"[",
"'E'",
"]",
".",
"fields",
"[",
"0",
"]",
".",
"moj... | Verifies basic parsing of assigned integral values. | [
"Verifies",
"basic",
"parsing",
"of",
"assigned",
"integral",
"values",
"."
] | [
"\"\"\"Verifies basic parsing of assigned integral values.\"\"\""
] | [
{
"param": "self",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
d9005078671ee514a13710131bd901123f15b2e5 | sunlongbo/chromium | mojo/public/tools/mojom/enum_unittest.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | testImplicitValues | null | def testImplicitValues(self):
"""Verifies basic automatic assignment of integral values at parse time."""
types = self.ExtractTypes('enum E { kFoo, kBar, kBaz };')
self.assertEqual('kFoo', types['E'].fields[0].mojom_name)
self.assertEqual(0, types['E'].fields[0].numeric_value)
self.assertEqual('kBar... | Verifies basic automatic assignment of integral values at parse time. | Verifies basic automatic assignment of integral values at parse time. | [
"Verifies",
"basic",
"automatic",
"assignment",
"of",
"integral",
"values",
"at",
"parse",
"time",
"."
] | def testImplicitValues(self):
types = self.ExtractTypes('enum E { kFoo, kBar, kBaz };')
self.assertEqual('kFoo', types['E'].fields[0].mojom_name)
self.assertEqual(0, types['E'].fields[0].numeric_value)
self.assertEqual('kBar', types['E'].fields[1].mojom_name)
self.assertEqual(1, types['E'].fields[1]... | [
"def",
"testImplicitValues",
"(",
"self",
")",
":",
"types",
"=",
"self",
".",
"ExtractTypes",
"(",
"'enum E { kFoo, kBar, kBaz };'",
")",
"self",
".",
"assertEqual",
"(",
"'kFoo'",
",",
"types",
"[",
"'E'",
"]",
".",
"fields",
"[",
"0",
"]",
".",
"mojom_n... | Verifies basic automatic assignment of integral values at parse time. | [
"Verifies",
"basic",
"automatic",
"assignment",
"of",
"integral",
"values",
"at",
"parse",
"time",
"."
] | [
"\"\"\"Verifies basic automatic assignment of integral values at parse time.\"\"\""
] | [
{
"param": "self",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
d9005078671ee514a13710131bd901123f15b2e5 | sunlongbo/chromium | mojo/public/tools/mojom/enum_unittest.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | testSameEnumReference | null | def testSameEnumReference(self):
"""Verifies that an enum value can be assigned from the value of another
field within the same enum."""
types = self.ExtractTypes('enum E { kA, kB, kFirst=kA };')
self.assertEqual('kA', types['E'].fields[0].mojom_name)
self.assertEqual(0, types['E'].fields[0].numeric... | Verifies that an enum value can be assigned from the value of another
field within the same enum. | Verifies that an enum value can be assigned from the value of another
field within the same enum. | [
"Verifies",
"that",
"an",
"enum",
"value",
"can",
"be",
"assigned",
"from",
"the",
"value",
"of",
"another",
"field",
"within",
"the",
"same",
"enum",
"."
] | def testSameEnumReference(self):
types = self.ExtractTypes('enum E { kA, kB, kFirst=kA };')
self.assertEqual('kA', types['E'].fields[0].mojom_name)
self.assertEqual(0, types['E'].fields[0].numeric_value)
self.assertEqual('kB', types['E'].fields[1].mojom_name)
self.assertEqual(1, types['E'].fields[1]... | [
"def",
"testSameEnumReference",
"(",
"self",
")",
":",
"types",
"=",
"self",
".",
"ExtractTypes",
"(",
"'enum E { kA, kB, kFirst=kA };'",
")",
"self",
".",
"assertEqual",
"(",
"'kA'",
",",
"types",
"[",
"'E'",
"]",
".",
"fields",
"[",
"0",
"]",
".",
"mojom... | Verifies that an enum value can be assigned from the value of another
field within the same enum. | [
"Verifies",
"that",
"an",
"enum",
"value",
"can",
"be",
"assigned",
"from",
"the",
"value",
"of",
"another",
"field",
"within",
"the",
"same",
"enum",
"."
] | [
"\"\"\"Verifies that an enum value can be assigned from the value of another\n field within the same enum.\"\"\""
] | [
{
"param": "self",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
d9005078671ee514a13710131bd901123f15b2e5 | sunlongbo/chromium | mojo/public/tools/mojom/enum_unittest.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | testSameModuleOtherEnumReference | null | def testSameModuleOtherEnumReference(self):
"""Verifies that an enum value can be assigned from the value of a field
in another enum within the same module."""
types = self.ExtractTypes('enum E { kA, kB }; enum F { kA = E.kB };')
self.assertEqual(1, types['F'].fields[0].numeric_value) | Verifies that an enum value can be assigned from the value of a field
in another enum within the same module. | Verifies that an enum value can be assigned from the value of a field
in another enum within the same module. | [
"Verifies",
"that",
"an",
"enum",
"value",
"can",
"be",
"assigned",
"from",
"the",
"value",
"of",
"a",
"field",
"in",
"another",
"enum",
"within",
"the",
"same",
"module",
"."
] | def testSameModuleOtherEnumReference(self):
types = self.ExtractTypes('enum E { kA, kB }; enum F { kA = E.kB };')
self.assertEqual(1, types['F'].fields[0].numeric_value) | [
"def",
"testSameModuleOtherEnumReference",
"(",
"self",
")",
":",
"types",
"=",
"self",
".",
"ExtractTypes",
"(",
"'enum E { kA, kB }; enum F { kA = E.kB };'",
")",
"self",
".",
"assertEqual",
"(",
"1",
",",
"types",
"[",
"'F'",
"]",
".",
"fields",
"[",
"0",
"... | Verifies that an enum value can be assigned from the value of a field
in another enum within the same module. | [
"Verifies",
"that",
"an",
"enum",
"value",
"can",
"be",
"assigned",
"from",
"the",
"value",
"of",
"a",
"field",
"in",
"another",
"enum",
"within",
"the",
"same",
"module",
"."
] | [
"\"\"\"Verifies that an enum value can be assigned from the value of a field\n in another enum within the same module.\"\"\""
] | [
{
"param": "self",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
d9005078671ee514a13710131bd901123f15b2e5 | sunlongbo/chromium | mojo/public/tools/mojom/enum_unittest.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | testImportedEnumReference | null | def testImportedEnumReference(self):
"""Verifies that an enum value can be assigned from the value of a field
in another enum within a different module."""
a_mojom = 'a.mojom'
self.WriteFile(a_mojom, 'module a; enum E { kFoo=42, kBar };')
b_mojom = 'b.mojom'
self.WriteFile(b_mojom,
... | Verifies that an enum value can be assigned from the value of a field
in another enum within a different module. | Verifies that an enum value can be assigned from the value of a field
in another enum within a different module. | [
"Verifies",
"that",
"an",
"enum",
"value",
"can",
"be",
"assigned",
"from",
"the",
"value",
"of",
"a",
"field",
"in",
"another",
"enum",
"within",
"a",
"different",
"module",
"."
] | def testImportedEnumReference(self):
a_mojom = 'a.mojom'
self.WriteFile(a_mojom, 'module a; enum E { kFoo=42, kBar };')
b_mojom = 'b.mojom'
self.WriteFile(b_mojom,
'module b; import "a.mojom"; enum F { kFoo = a.E.kBar };')
self.ParseMojoms([a_mojom, b_mojom])
b = self.LoadModu... | [
"def",
"testImportedEnumReference",
"(",
"self",
")",
":",
"a_mojom",
"=",
"'a.mojom'",
"self",
".",
"WriteFile",
"(",
"a_mojom",
",",
"'module a; enum E { kFoo=42, kBar };'",
")",
"b_mojom",
"=",
"'b.mojom'",
"self",
".",
"WriteFile",
"(",
"b_mojom",
",",
"'modul... | Verifies that an enum value can be assigned from the value of a field
in another enum within a different module. | [
"Verifies",
"that",
"an",
"enum",
"value",
"can",
"be",
"assigned",
"from",
"the",
"value",
"of",
"a",
"field",
"in",
"another",
"enum",
"within",
"a",
"different",
"module",
"."
] | [
"\"\"\"Verifies that an enum value can be assigned from the value of a field\n in another enum within a different module.\"\"\""
] | [
{
"param": "self",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
d9005078671ee514a13710131bd901123f15b2e5 | sunlongbo/chromium | mojo/public/tools/mojom/enum_unittest.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | testConstantReference | null | def testConstantReference(self):
"""Verifies that an enum value can be assigned from the value of an
integral constant within the same module."""
types = self.ExtractTypes('const int32 kFoo = 42; enum E { kA = kFoo };')
self.assertEqual(42, types['E'].fields[0].numeric_value) | Verifies that an enum value can be assigned from the value of an
integral constant within the same module. | Verifies that an enum value can be assigned from the value of an
integral constant within the same module. | [
"Verifies",
"that",
"an",
"enum",
"value",
"can",
"be",
"assigned",
"from",
"the",
"value",
"of",
"an",
"integral",
"constant",
"within",
"the",
"same",
"module",
"."
] | def testConstantReference(self):
types = self.ExtractTypes('const int32 kFoo = 42; enum E { kA = kFoo };')
self.assertEqual(42, types['E'].fields[0].numeric_value) | [
"def",
"testConstantReference",
"(",
"self",
")",
":",
"types",
"=",
"self",
".",
"ExtractTypes",
"(",
"'const int32 kFoo = 42; enum E { kA = kFoo };'",
")",
"self",
".",
"assertEqual",
"(",
"42",
",",
"types",
"[",
"'E'",
"]",
".",
"fields",
"[",
"0",
"]",
... | Verifies that an enum value can be assigned from the value of an
integral constant within the same module. | [
"Verifies",
"that",
"an",
"enum",
"value",
"can",
"be",
"assigned",
"from",
"the",
"value",
"of",
"an",
"integral",
"constant",
"within",
"the",
"same",
"module",
"."
] | [
"\"\"\"Verifies that an enum value can be assigned from the value of an\n integral constant within the same module.\"\"\""
] | [
{
"param": "self",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
d9005078671ee514a13710131bd901123f15b2e5 | sunlongbo/chromium | mojo/public/tools/mojom/enum_unittest.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | testInvalidConstantReference | null | def testInvalidConstantReference(self):
"""Verifies that enum values cannot be assigned from the value of
non-integral constants."""
with self.assertRaisesRegexp(ValueError, 'not an integer'):
self.ExtractTypes('const float kFoo = 1.0; enum E { kA = kFoo };')
with self.assertRaisesRegexp(ValueErro... | Verifies that enum values cannot be assigned from the value of
non-integral constants. | Verifies that enum values cannot be assigned from the value of
non-integral constants. | [
"Verifies",
"that",
"enum",
"values",
"cannot",
"be",
"assigned",
"from",
"the",
"value",
"of",
"non",
"-",
"integral",
"constants",
"."
] | def testInvalidConstantReference(self):
with self.assertRaisesRegexp(ValueError, 'not an integer'):
self.ExtractTypes('const float kFoo = 1.0; enum E { kA = kFoo };')
with self.assertRaisesRegexp(ValueError, 'not an integer'):
self.ExtractTypes('const double kFoo = 1.0; enum E { kA = kFoo };')
w... | [
"def",
"testInvalidConstantReference",
"(",
"self",
")",
":",
"with",
"self",
".",
"assertRaisesRegexp",
"(",
"ValueError",
",",
"'not an integer'",
")",
":",
"self",
".",
"ExtractTypes",
"(",
"'const float kFoo = 1.0; enum E { kA = kFoo };'",
")",
"with",
"self",
"."... | Verifies that enum values cannot be assigned from the value of
non-integral constants. | [
"Verifies",
"that",
"enum",
"values",
"cannot",
"be",
"assigned",
"from",
"the",
"value",
"of",
"non",
"-",
"integral",
"constants",
"."
] | [
"\"\"\"Verifies that enum values cannot be assigned from the value of\n non-integral constants.\"\"\""
] | [
{
"param": "self",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
d9005078671ee514a13710131bd901123f15b2e5 | sunlongbo/chromium | mojo/public/tools/mojom/enum_unittest.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | testImportedConstantReference | null | def testImportedConstantReference(self):
"""Verifies that an enum value can be assigned from the value of an integral
constant within an imported module."""
a_mojom = 'a.mojom'
self.WriteFile(a_mojom, 'module a; const int32 kFoo = 37;')
b_mojom = 'b.mojom'
self.WriteFile(b_mojom,
... | Verifies that an enum value can be assigned from the value of an integral
constant within an imported module. | Verifies that an enum value can be assigned from the value of an integral
constant within an imported module. | [
"Verifies",
"that",
"an",
"enum",
"value",
"can",
"be",
"assigned",
"from",
"the",
"value",
"of",
"an",
"integral",
"constant",
"within",
"an",
"imported",
"module",
"."
] | def testImportedConstantReference(self):
a_mojom = 'a.mojom'
self.WriteFile(a_mojom, 'module a; const int32 kFoo = 37;')
b_mojom = 'b.mojom'
self.WriteFile(b_mojom,
'module b; import "a.mojom"; enum F { kFoo = a.kFoo };')
self.ParseMojoms([a_mojom, b_mojom])
b = self.LoadModul... | [
"def",
"testImportedConstantReference",
"(",
"self",
")",
":",
"a_mojom",
"=",
"'a.mojom'",
"self",
".",
"WriteFile",
"(",
"a_mojom",
",",
"'module a; const int32 kFoo = 37;'",
")",
"b_mojom",
"=",
"'b.mojom'",
"self",
".",
"WriteFile",
"(",
"b_mojom",
",",
"'modu... | Verifies that an enum value can be assigned from the value of an integral
constant within an imported module. | [
"Verifies",
"that",
"an",
"enum",
"value",
"can",
"be",
"assigned",
"from",
"the",
"value",
"of",
"an",
"integral",
"constant",
"within",
"an",
"imported",
"module",
"."
] | [
"\"\"\"Verifies that an enum value can be assigned from the value of an integral\n constant within an imported module.\"\"\""
] | [
{
"param": "self",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
3769a77d1db13ffe27e1b648244b1792fb55ac9e | sunlongbo/chromium | mojo/public/tools/bindings/generators/mojom_js_generator.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | _GetWebUiModulePath | <not_specific> | def _GetWebUiModulePath(module):
"""Returns the path to a WebUI module, from the perspective of a WebUI page
that makes it available. This is based on the corresponding mojom target's
webui_module_path value. Returns None if the target specifies no module
path. Otherwise, returned paths always end in a '/' and ... | Returns the path to a WebUI module, from the perspective of a WebUI page
that makes it available. This is based on the corresponding mojom target's
webui_module_path value. Returns None if the target specifies no module
path. Otherwise, returned paths always end in a '/' and begin with either
`_SHARED_MODULE_PR... | Returns the path to a WebUI module, from the perspective of a WebUI page
that makes it available. This is based on the corresponding mojom target's
webui_module_path value. Returns None if the target specifies no module
path. Otherwise, returned paths always end in a '/' and begin with either
`_SHARED_MODULE_PREFIX` or... | [
"Returns",
"the",
"path",
"to",
"a",
"WebUI",
"module",
"from",
"the",
"perspective",
"of",
"a",
"WebUI",
"page",
"that",
"makes",
"it",
"available",
".",
"This",
"is",
"based",
"on",
"the",
"corresponding",
"mojom",
"target",
"'",
"s",
"webui_module_path",
... | def _GetWebUiModulePath(module):
path = module.metadata.get('webui_module_path')
if path is None or path == '/':
return path
if path.startswith(_SHARED_MODULE_PREFIX):
return path.rstrip('/') + '/'
return '/{}/'.format(path.strip('/')) | [
"def",
"_GetWebUiModulePath",
"(",
"module",
")",
":",
"path",
"=",
"module",
".",
"metadata",
".",
"get",
"(",
"'webui_module_path'",
")",
"if",
"path",
"is",
"None",
"or",
"path",
"==",
"'/'",
":",
"return",
"path",
"if",
"path",
".",
"startswith",
"("... | Returns the path to a WebUI module, from the perspective of a WebUI page
that makes it available. | [
"Returns",
"the",
"path",
"to",
"a",
"WebUI",
"module",
"from",
"the",
"perspective",
"of",
"a",
"WebUI",
"page",
"that",
"makes",
"it",
"available",
"."
] | [
"\"\"\"Returns the path to a WebUI module, from the perspective of a WebUI page\n that makes it available. This is based on the corresponding mojom target's\n webui_module_path value. Returns None if the target specifies no module\n path. Otherwise, returned paths always end in a '/' and begin with either\n `_S... | [
{
"param": "module",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "module",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
6d38961553dd9fe9707990afdd128aa54a3a3797 | sunlongbo/chromium | third_party/blink/tools/blinkpy/common/system/log_utils.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | _default_handlers | <not_specific> | def _default_handlers(stream, logging_level, include_time):
"""Return a list of the default logging handlers to use.
Args:
stream: See the configure_logging() docstring.
include_time: See the configure_logging() docstring.
"""
# Create the filter.
def should_log(record):
"""Ret... | Return a list of the default logging handlers to use.
Args:
stream: See the configure_logging() docstring.
include_time: See the configure_logging() docstring.
| Return a list of the default logging handlers to use. | [
"Return",
"a",
"list",
"of",
"the",
"default",
"logging",
"handlers",
"to",
"use",
"."
] | def _default_handlers(stream, logging_level, include_time):
def should_log(record):
if record.name.startswith('blinkpy.third_party'):
return False
return True
logging_filter = logging.Filter()
logging_filter.filter = should_log
handler = logging.StreamHandler(stream)
if i... | [
"def",
"_default_handlers",
"(",
"stream",
",",
"logging_level",
",",
"include_time",
")",
":",
"def",
"should_log",
"(",
"record",
")",
":",
"\"\"\"Return whether a logging.LogRecord should be logged.\"\"\"",
"if",
"record",
".",
"name",
".",
"startswith",
"(",
"'bli... | Return a list of the default logging handlers to use. | [
"Return",
"a",
"list",
"of",
"the",
"default",
"logging",
"handlers",
"to",
"use",
"."
] | [
"\"\"\"Return a list of the default logging handlers to use.\n\n Args:\n stream: See the configure_logging() docstring.\n include_time: See the configure_logging() docstring.\n \"\"\"",
"# Create the filter.",
"\"\"\"Return whether a logging.LogRecord should be logged.\"\"\"",
"# Create the ha... | [
{
"param": "stream",
"type": null
},
{
"param": "logging_level",
"type": null
},
{
"param": "include_time",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "stream",
"type": null,
"docstring": "See the configure_logging() docstring.",
"docstring_tokens": [
"See",
"the",
"configure_logging",
"()",
"docstring",
"."
],
"defa... |
6d38961553dd9fe9707990afdd128aa54a3a3797 | sunlongbo/chromium | third_party/blink/tools/blinkpy/common/system/log_utils.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | should_log | <not_specific> | def should_log(record):
"""Return whether a logging.LogRecord should be logged."""
if record.name.startswith('blinkpy.third_party'):
return False
return True | Return whether a logging.LogRecord should be logged. | Return whether a logging.LogRecord should be logged. | [
"Return",
"whether",
"a",
"logging",
".",
"LogRecord",
"should",
"be",
"logged",
"."
] | def should_log(record):
if record.name.startswith('blinkpy.third_party'):
return False
return True | [
"def",
"should_log",
"(",
"record",
")",
":",
"if",
"record",
".",
"name",
".",
"startswith",
"(",
"'blinkpy.third_party'",
")",
":",
"return",
"False",
"return",
"True"
] | Return whether a logging.LogRecord should be logged. | [
"Return",
"whether",
"a",
"logging",
".",
"LogRecord",
"should",
"be",
"logged",
"."
] | [
"\"\"\"Return whether a logging.LogRecord should be logged.\"\"\""
] | [
{
"param": "record",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "record",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
6d38961553dd9fe9707990afdd128aa54a3a3797 | sunlongbo/chromium | third_party/blink/tools/blinkpy/common/system/log_utils.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | configure_logging | <not_specific> | def configure_logging(logging_level=None,
logger=None,
stream=None,
handlers=None,
include_time=True):
"""Configure logging for standard purposes.
Returns:
A list of references to the logging handlers added to the roo... | Configure logging for standard purposes.
Returns:
A list of references to the logging handlers added to the root
logger. This allows the caller to later remove the handlers
using logger.removeHandler. This is useful primarily during unit
testing where the caller may want to configure logg... | Configure logging for standard purposes. | [
"Configure",
"logging",
"for",
"standard",
"purposes",
"."
] | def configure_logging(logging_level=None,
logger=None,
stream=None,
handlers=None,
include_time=True):
Traceback (most recent call last):
File "/System/Library/Frameworks/Python.framework/Versions/2.6/...
li... | [
"def",
"configure_logging",
"(",
"logging_level",
"=",
"None",
",",
"logger",
"=",
"None",
",",
"stream",
"=",
"None",
",",
"handlers",
"=",
"None",
",",
"include_time",
"=",
"True",
")",
":",
"if",
"logging_level",
"is",
"None",
":",
"logging_level",
"=",... | Configure logging for standard purposes. | [
"Configure",
"logging",
"for",
"standard",
"purposes",
"."
] | [
"\"\"\"Configure logging for standard purposes.\n\n Returns:\n A list of references to the logging handlers added to the root\n logger. This allows the caller to later remove the handlers\n using logger.removeHandler. This is useful primarily during unit\n testing where the caller may want ... | [
{
"param": "logging_level",
"type": null
},
{
"param": "logger",
"type": null
},
{
"param": "stream",
"type": null
},
{
"param": "handlers",
"type": null
},
{
"param": "include_time",
"type": null
}
] | {
"returns": [
{
"docstring": "A list of references to the logging handlers added to the root\nlogger. This allows the caller to later remove the handlers\nusing logger.removeHandler. This is useful primarily during unit\ntesting where the caller may want to configure logging temporarily\nand then undo th... |
6d3bddfa7aa8b6d0bfc41f0bbe0287ffb36581dd | sunlongbo/chromium | tools/json_schema_compiler/js_interface_generator_test.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | _GetNamespace | <not_specific> | def _GetNamespace(self, fake_content, filename):
"""Returns a namespace object for the given content"""
api_def = idl_schema.Process(fake_content, filename)
m = model.Model()
return m.AddNamespace(api_def[0], filename) | Returns a namespace object for the given content | Returns a namespace object for the given content | [
"Returns",
"a",
"namespace",
"object",
"for",
"the",
"given",
"content"
] | def _GetNamespace(self, fake_content, filename):
api_def = idl_schema.Process(fake_content, filename)
m = model.Model()
return m.AddNamespace(api_def[0], filename) | [
"def",
"_GetNamespace",
"(",
"self",
",",
"fake_content",
",",
"filename",
")",
":",
"api_def",
"=",
"idl_schema",
".",
"Process",
"(",
"fake_content",
",",
"filename",
")",
"m",
"=",
"model",
".",
"Model",
"(",
")",
"return",
"m",
".",
"AddNamespace",
"... | Returns a namespace object for the given content | [
"Returns",
"a",
"namespace",
"object",
"for",
"the",
"given",
"content"
] | [
"\"\"\"Returns a namespace object for the given content\"\"\""
] | [
{
"param": "self",
"type": null
},
{
"param": "fake_content",
"type": null
},
{
"param": "filename",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "fake_content",
"type": null,
"docstring": null,
"docstring_to... |
23576d778873273e25440ef432aadc23e47dac8a | sunlongbo/chromium | third_party/tensorflow-text/src/tensorflow_text/python/ops/unicode_script_tokenizer.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | tokenize_with_offsets | <not_specific> | def tokenize_with_offsets(self, input): # pylint: disable=redefined-builtin
"""Tokenizes a tensor of UTF-8 strings on Unicode script boundaries.
The strings are split when a change in the Unicode script is detected
between sequential tokens. The script codes used correspond to International
Components... | Tokenizes a tensor of UTF-8 strings on Unicode script boundaries.
The strings are split when a change in the Unicode script is detected
between sequential tokens. The script codes used correspond to International
Components for Unicode (ICU) UScriptCode values. See:
http://icu-project.org/apiref/icu4c/... | Tokenizes a tensor of UTF-8 strings on Unicode script boundaries.
The strings are split when a change in the Unicode script is detected
between sequential tokens. The script codes used correspond to International
Components for Unicode (ICU) UScriptCode values.
ICU defined whitespace characters are dropped, unless the... | [
"Tokenizes",
"a",
"tensor",
"of",
"UTF",
"-",
"8",
"strings",
"on",
"Unicode",
"script",
"boundaries",
".",
"The",
"strings",
"are",
"split",
"when",
"a",
"change",
"in",
"the",
"Unicode",
"script",
"is",
"detected",
"between",
"sequential",
"tokens",
".",
... | def tokenize_with_offsets(self, input):
name = None
with ops.name_scope(name, "UnicodeScriptTokenize", [input]):
input_tensor = ragged_tensor.convert_to_tensor_or_ragged_tensor(input)
if input_tensor.shape.ndims is None:
raise ValueError("Rank of input_tensor must be statically known.")
... | [
"def",
"tokenize_with_offsets",
"(",
"self",
",",
"input",
")",
":",
"name",
"=",
"None",
"with",
"ops",
".",
"name_scope",
"(",
"name",
",",
"\"UnicodeScriptTokenize\"",
",",
"[",
"input",
"]",
")",
":",
"input_tensor",
"=",
"ragged_tensor",
".",
"convert_t... | Tokenizes a tensor of UTF-8 strings on Unicode script boundaries. | [
"Tokenizes",
"a",
"tensor",
"of",
"UTF",
"-",
"8",
"strings",
"on",
"Unicode",
"script",
"boundaries",
"."
] | [
"# pylint: disable=redefined-builtin",
"\"\"\"Tokenizes a tensor of UTF-8 strings on Unicode script boundaries.\n\n The strings are split when a change in the Unicode script is detected\n between sequential tokens. The script codes used correspond to International\n Components for Unicode (ICU) UScriptCo... | [
{
"param": "self",
"type": null
},
{
"param": "input",
"type": null
}
] | {
"returns": [
{
"docstring": "A tuple `(tokens, start_offsets, end_offsets)` where.\n\n`tokens`: A `RaggedTensor` of tokenized text.\n`start_offsets`: A `RaggedTensor` of the tokens' starting byte offset.\n`end_offsets`: A `RaggedTensor` of the tokens' ending byte offset.",
"docstring_tokens": [
... |
4a0ed0070c39853c8024c8eb85dfa31e3d9d7f24 | sunlongbo/chromium | tools/perry.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | _GetTestList | <not_specific> | def _GetTestList(path_to_binary):
"""Returns a set of full test names.
Each test will be of the form "Case.Test". There will be a separate line
for each combination of Case/Test (there are often multiple tests in each
case).
"""
raw_output = subprocess.check_output([path_to_binary, "--gtest_list_tests"])
... | Returns a set of full test names.
Each test will be of the form "Case.Test". There will be a separate line
for each combination of Case/Test (there are often multiple tests in each
case).
| Returns a set of full test names.
Each test will be of the form "Case.Test". There will be a separate line
for each combination of Case/Test (there are often multiple tests in each
case). | [
"Returns",
"a",
"set",
"of",
"full",
"test",
"names",
".",
"Each",
"test",
"will",
"be",
"of",
"the",
"form",
"\"",
"Case",
".",
"Test",
"\"",
".",
"There",
"will",
"be",
"a",
"separate",
"line",
"for",
"each",
"combination",
"of",
"Case",
"/",
"Test... | def _GetTestList(path_to_binary):
raw_output = subprocess.check_output([path_to_binary, "--gtest_list_tests"])
input_lines = raw_output.splitlines()
case_name = ''
test_set = set()
for line in input_lines:
if len(line) > 1:
if '#' in line:
line = line[:line.find('#')]
if line[0] == '... | [
"def",
"_GetTestList",
"(",
"path_to_binary",
")",
":",
"raw_output",
"=",
"subprocess",
".",
"check_output",
"(",
"[",
"path_to_binary",
",",
"\"--gtest_list_tests\"",
"]",
")",
"input_lines",
"=",
"raw_output",
".",
"splitlines",
"(",
")",
"case_name",
"=",
"'... | Returns a set of full test names. | [
"Returns",
"a",
"set",
"of",
"full",
"test",
"names",
"."
] | [
"\"\"\"Returns a set of full test names.\n\n Each test will be of the form \"Case.Test\". There will be a separate line\n for each combination of Case/Test (there are often multiple tests in each\n case).\n \"\"\"",
"# The format of the gtest_list_tests output is:",
"# \"Case1.\"",
"# \" Test1 # <Option... | [
{
"param": "path_to_binary",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "path_to_binary",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
d4d287544ddbf53d7be9244867211c8993014058 | sunlongbo/chromium | ash/webui/file_manager/resources/gen_main_html.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | GenerateSwaMainHtml | null | def GenerateSwaMainHtml(source, target):
"""Copy source file to target, do SWA edits, then add BUILD time stamp."""
# Copy source (main.html) file to the target (main.html) file.
shutil.copyfile(source, target)
# Edit the target file.
for line in fileinput.input(target, inplace=True):
# Add _SWA <script... | Copy source file to target, do SWA edits, then add BUILD time stamp. | Copy source file to target, do SWA edits, then add BUILD time stamp. | [
"Copy",
"source",
"file",
"to",
"target",
"do",
"SWA",
"edits",
"then",
"add",
"BUILD",
"time",
"stamp",
"."
] | def GenerateSwaMainHtml(source, target):
shutil.copyfile(source, target)
for line in fileinput.input(target, inplace=True):
if line.find('<head>') >= 0:
print(line + ' ' + _SWA)
elif line.find('<meta ') >= 0:
sys.stdout.write(line.replace('<meta ', '<meta charset="utf-8" '))
elif 'rel="im... | [
"def",
"GenerateSwaMainHtml",
"(",
"source",
",",
"target",
")",
":",
"shutil",
".",
"copyfile",
"(",
"source",
",",
"target",
")",
"for",
"line",
"in",
"fileinput",
".",
"input",
"(",
"target",
",",
"inplace",
"=",
"True",
")",
":",
"if",
"line",
".",... | Copy source file to target, do SWA edits, then add BUILD time stamp. | [
"Copy",
"source",
"file",
"to",
"target",
"do",
"SWA",
"edits",
"then",
"add",
"BUILD",
"time",
"stamp",
"."
] | [
"\"\"\"Copy source file to target, do SWA edits, then add BUILD time stamp.\"\"\"",
"# Copy source (main.html) file to the target (main.html) file.",
"# Edit the target file.",
"# Add _SWA <script> tag after the <head> tag.",
"# Add <meta> charset=\"utf-8\" attribute.",
"# Ignore HTML Imports and its poly... | [
{
"param": "source",
"type": null
},
{
"param": "target",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "source",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "target",
"type": null,
"docstring": null,
"docstring_tokens... |
d4dd23e35c98649bed2ce28f3821eacd855c75d4 | sunlongbo/chromium | tools/android/dependency_analysis/print_package_dependencies.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | print_package_dependencies_for_edge | <not_specific> | def print_package_dependencies_for_edge(begin, end):
"""Prints dependencies for an edge in the package graph.
Since these are package edges, we also print the class dependency edges
comprising the printed package edge.
"""
if begin == end:
return
print(f'\t{begin.name} -> {end.name}')
... | Prints dependencies for an edge in the package graph.
Since these are package edges, we also print the class dependency edges
comprising the printed package edge.
| Prints dependencies for an edge in the package graph.
Since these are package edges, we also print the class dependency edges
comprising the printed package edge. | [
"Prints",
"dependencies",
"for",
"an",
"edge",
"in",
"the",
"package",
"graph",
".",
"Since",
"these",
"are",
"package",
"edges",
"we",
"also",
"print",
"the",
"class",
"dependency",
"edges",
"comprising",
"the",
"printed",
"package",
"edge",
"."
] | def print_package_dependencies_for_edge(begin, end):
if begin == end:
return
print(f'\t{begin.name} -> {end.name}')
class_deps = begin.get_class_dependencies_in_outbound_edge(end)
print(f'\t{len(class_deps)} class edge(s) comprising the dependency:')
for begin_class, end_class in graph.sorte... | [
"def",
"print_package_dependencies_for_edge",
"(",
"begin",
",",
"end",
")",
":",
"if",
"begin",
"==",
"end",
":",
"return",
"print",
"(",
"f'\\t{begin.name} -> {end.name}'",
")",
"class_deps",
"=",
"begin",
".",
"get_class_dependencies_in_outbound_edge",
"(",
"end",
... | Prints dependencies for an edge in the package graph. | [
"Prints",
"dependencies",
"for",
"an",
"edge",
"in",
"the",
"package",
"graph",
"."
] | [
"\"\"\"Prints dependencies for an edge in the package graph.\n\n Since these are package edges, we also print the class dependency edges\n comprising the printed package edge.\n \"\"\""
] | [
{
"param": "begin",
"type": null
},
{
"param": "end",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "begin",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "end",
"type": null,
"docstring": null,
"docstring_tokens": [... |
d4dd23e35c98649bed2ce28f3821eacd855c75d4 | sunlongbo/chromium | tools/android/dependency_analysis/print_package_dependencies.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | print_package_dependencies_for_key | null | def print_package_dependencies_for_key(package_graph, key, ignore_subpackages):
"""Prints dependencies for a valid key into the package graph.
Since we store self-edges for the package graph
but they aren't relevant in this case, we skip them.
"""
node = package_graph.get_node_by_key(key)
inbo... | Prints dependencies for a valid key into the package graph.
Since we store self-edges for the package graph
but they aren't relevant in this case, we skip them.
| Prints dependencies for a valid key into the package graph.
Since we store self-edges for the package graph
but they aren't relevant in this case, we skip them. | [
"Prints",
"dependencies",
"for",
"a",
"valid",
"key",
"into",
"the",
"package",
"graph",
".",
"Since",
"we",
"store",
"self",
"-",
"edges",
"for",
"the",
"package",
"graph",
"but",
"they",
"aren",
"'",
"t",
"relevant",
"in",
"this",
"case",
"we",
"skip",... | def print_package_dependencies_for_key(package_graph, key, ignore_subpackages):
node = package_graph.get_node_by_key(key)
inbound_without_self = [other for other in node.inbound if other != node]
print(f'{len(inbound_without_self)} inbound dependency(ies) '
f'for {node.name}:')
for inbound_dep... | [
"def",
"print_package_dependencies_for_key",
"(",
"package_graph",
",",
"key",
",",
"ignore_subpackages",
")",
":",
"node",
"=",
"package_graph",
".",
"get_node_by_key",
"(",
"key",
")",
"inbound_without_self",
"=",
"[",
"other",
"for",
"other",
"in",
"node",
".",... | Prints dependencies for a valid key into the package graph. | [
"Prints",
"dependencies",
"for",
"a",
"valid",
"key",
"into",
"the",
"package",
"graph",
"."
] | [
"\"\"\"Prints dependencies for a valid key into the package graph.\n\n Since we store self-edges for the package graph\n but they aren't relevant in this case, we skip them.\n \"\"\""
] | [
{
"param": "package_graph",
"type": null
},
{
"param": "key",
"type": null
},
{
"param": "ignore_subpackages",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "package_graph",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "key",
"type": null,
"docstring": null,
"docstring_to... |
d4dd23e35c98649bed2ce28f3821eacd855c75d4 | sunlongbo/chromium | tools/android/dependency_analysis/print_package_dependencies.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | main | null | def main():
"""Prints package-level dependencies for an input package."""
arg_parser = argparse.ArgumentParser(
description='Given a JSON dependency graph, output the package-level '
'dependencies for a given package and the '
'class dependencies comprising those dependencies')
requi... | Prints package-level dependencies for an input package. | Prints package-level dependencies for an input package. | [
"Prints",
"package",
"-",
"level",
"dependencies",
"for",
"an",
"input",
"package",
"."
] | def main():
arg_parser = argparse.ArgumentParser(
description='Given a JSON dependency graph, output the package-level '
'dependencies for a given package and the '
'class dependencies comprising those dependencies')
required_arg_group = arg_parser.add_argument_group('required arguments'... | [
"def",
"main",
"(",
")",
":",
"arg_parser",
"=",
"argparse",
".",
"ArgumentParser",
"(",
"description",
"=",
"'Given a JSON dependency graph, output the package-level '",
"'dependencies for a given package and the '",
"'class dependencies comprising those dependencies'",
")",
"requ... | Prints package-level dependencies for an input package. | [
"Prints",
"package",
"-",
"level",
"dependencies",
"for",
"an",
"input",
"package",
"."
] | [
"\"\"\"Prints package-level dependencies for an input package.\"\"\""
] | [] | {
"returns": [],
"raises": [],
"params": [],
"outlier_params": [],
"others": []
} |
265606a415befd140df8b0d6298e2f984a6532e9 | sunlongbo/chromium | tools/perf/core/testing.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | GetRunOptions | <not_specific> | def GetRunOptions(*args, **kwargs):
"""Augment telemetry options for tests with results_processor defaults."""
options = options_for_unittests.GetRunOptions(*args, **kwargs)
parser = command_line.ArgumentParser()
processor_options = parser.parse_args([])
for arg in vars(processor_options):
if not hasattr(... | Augment telemetry options for tests with results_processor defaults. | Augment telemetry options for tests with results_processor defaults. | [
"Augment",
"telemetry",
"options",
"for",
"tests",
"with",
"results_processor",
"defaults",
"."
] | def GetRunOptions(*args, **kwargs):
options = options_for_unittests.GetRunOptions(*args, **kwargs)
parser = command_line.ArgumentParser()
processor_options = parser.parse_args([])
for arg in vars(processor_options):
if not hasattr(options, arg):
setattr(options, arg, getattr(processor_options, arg))
... | [
"def",
"GetRunOptions",
"(",
"*",
"args",
",",
"**",
"kwargs",
")",
":",
"options",
"=",
"options_for_unittests",
".",
"GetRunOptions",
"(",
"*",
"args",
",",
"**",
"kwargs",
")",
"parser",
"=",
"command_line",
".",
"ArgumentParser",
"(",
")",
"processor_opt... | Augment telemetry options for tests with results_processor defaults. | [
"Augment",
"telemetry",
"options",
"for",
"tests",
"with",
"results_processor",
"defaults",
"."
] | [
"\"\"\"Augment telemetry options for tests with results_processor defaults.\"\"\""
] | [] | {
"returns": [],
"raises": [],
"params": [],
"outlier_params": [],
"others": []
} |
152daab15b879030f5729b41bbecf012988bc900 | sunlongbo/chromium | third_party/markdown/treeprocessors.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | __handleInline | <not_specific> | def __handleInline(self, data, patternIndex=0):
"""
Process string with inline patterns and replace it
with placeholders
Keyword arguments:
* data: A line of Markdown text
* patternIndex: The index of the inlinePattern to start with
Returns: String with placeho... |
Process string with inline patterns and replace it
with placeholders
Keyword arguments:
* data: A line of Markdown text
* patternIndex: The index of the inlinePattern to start with
Returns: String with placeholders.
| Process string with inline patterns and replace it
with placeholders
Keyword arguments.
A line of Markdown text
patternIndex: The index of the inlinePattern to start with
String with placeholders. | [
"Process",
"string",
"with",
"inline",
"patterns",
"and",
"replace",
"it",
"with",
"placeholders",
"Keyword",
"arguments",
".",
"A",
"line",
"of",
"Markdown",
"text",
"patternIndex",
":",
"The",
"index",
"of",
"the",
"inlinePattern",
"to",
"start",
"with",
"St... | def __handleInline(self, data, patternIndex=0):
if not isinstance(data, util.AtomicString):
startIndex = 0
while patternIndex < len(self.markdown.inlinePatterns):
data, matched, startIndex = self.__applyPattern(
self.markdown.inlinePatterns.value_for_i... | [
"def",
"__handleInline",
"(",
"self",
",",
"data",
",",
"patternIndex",
"=",
"0",
")",
":",
"if",
"not",
"isinstance",
"(",
"data",
",",
"util",
".",
"AtomicString",
")",
":",
"startIndex",
"=",
"0",
"while",
"patternIndex",
"<",
"len",
"(",
"self",
".... | Process string with inline patterns and replace it
with placeholders | [
"Process",
"string",
"with",
"inline",
"patterns",
"and",
"replace",
"it",
"with",
"placeholders"
] | [
"\"\"\"\n Process string with inline patterns and replace it\n with placeholders\n\n Keyword arguments:\n\n * data: A line of Markdown text\n * patternIndex: The index of the inlinePattern to start with\n\n Returns: String with placeholders.\n\n \"\"\""
] | [
{
"param": "self",
"type": null
},
{
"param": "data",
"type": null
},
{
"param": "patternIndex",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "data",
"type": null,
"docstring": null,
"docstring_tokens": [... |
152daab15b879030f5729b41bbecf012988bc900 | sunlongbo/chromium | third_party/markdown/treeprocessors.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | __processPlaceholders | <not_specific> | def __processPlaceholders(self, data, parent):
"""
Process string with placeholders and generate ElementTree tree.
Keyword arguments:
* data: string with placeholders instead of ElementTree elements.
* parent: Element, which contains processing inline data
Returns: lis... |
Process string with placeholders and generate ElementTree tree.
Keyword arguments:
* data: string with placeholders instead of ElementTree elements.
* parent: Element, which contains processing inline data
Returns: list with ElementTree elements with applied inline patterns.
... | Process string with placeholders and generate ElementTree tree.
Keyword arguments.
string with placeholders instead of ElementTree elements.
parent: Element, which contains processing inline data
list with ElementTree elements with applied inline patterns. | [
"Process",
"string",
"with",
"placeholders",
"and",
"generate",
"ElementTree",
"tree",
".",
"Keyword",
"arguments",
".",
"string",
"with",
"placeholders",
"instead",
"of",
"ElementTree",
"elements",
".",
"parent",
":",
"Element",
"which",
"contains",
"processing",
... | def __processPlaceholders(self, data, parent):
def linkText(text):
if text:
if result:
if result[-1].tail:
result[-1].tail += text
else:
result[-1].tail = text
else:
... | [
"def",
"__processPlaceholders",
"(",
"self",
",",
"data",
",",
"parent",
")",
":",
"def",
"linkText",
"(",
"text",
")",
":",
"if",
"text",
":",
"if",
"result",
":",
"if",
"result",
"[",
"-",
"1",
"]",
".",
"tail",
":",
"result",
"[",
"-",
"1",
"]... | Process string with placeholders and generate ElementTree tree. | [
"Process",
"string",
"with",
"placeholders",
"and",
"generate",
"ElementTree",
"tree",
"."
] | [
"\"\"\"\n Process string with placeholders and generate ElementTree tree.\n\n Keyword arguments:\n\n * data: string with placeholders instead of ElementTree elements.\n * parent: Element, which contains processing inline data\n\n Returns: list with ElementTree elements with applie... | [
{
"param": "self",
"type": null
},
{
"param": "data",
"type": null
},
{
"param": "parent",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "data",
"type": null,
"docstring": null,
"docstring_tokens": [... |
152daab15b879030f5729b41bbecf012988bc900 | sunlongbo/chromium | third_party/markdown/treeprocessors.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | __applyPattern | <not_specific> | def __applyPattern(self, pattern, data, patternIndex, startIndex=0):
"""
Check if the line fits the pattern, create the necessary
elements, add it to stashed_nodes.
Keyword arguments:
* data: the text to be processed
* pattern: the pattern to be checked
* patter... |
Check if the line fits the pattern, create the necessary
elements, add it to stashed_nodes.
Keyword arguments:
* data: the text to be processed
* pattern: the pattern to be checked
* patternIndex: index of current pattern
* startIndex: string index, from which ... | Check if the line fits the pattern, create the necessary
elements, add it to stashed_nodes.
Keyword arguments.
the text to be processed
pattern: the pattern to be checked
patternIndex: index of current pattern
startIndex: string index, from which we start searching
String with placeholders instead of ElementTree ele... | [
"Check",
"if",
"the",
"line",
"fits",
"the",
"pattern",
"create",
"the",
"necessary",
"elements",
"add",
"it",
"to",
"stashed_nodes",
".",
"Keyword",
"arguments",
".",
"the",
"text",
"to",
"be",
"processed",
"pattern",
":",
"the",
"pattern",
"to",
"be",
"c... | def __applyPattern(self, pattern, data, patternIndex, startIndex=0):
match = pattern.getCompiledRegExp().match(data[startIndex:])
leftData = data[:startIndex]
if not match:
return data, False, 0
node = pattern.handleMatch(match)
if node is None:
return dat... | [
"def",
"__applyPattern",
"(",
"self",
",",
"pattern",
",",
"data",
",",
"patternIndex",
",",
"startIndex",
"=",
"0",
")",
":",
"match",
"=",
"pattern",
".",
"getCompiledRegExp",
"(",
")",
".",
"match",
"(",
"data",
"[",
"startIndex",
":",
"]",
")",
"le... | Check if the line fits the pattern, create the necessary
elements, add it to stashed_nodes. | [
"Check",
"if",
"the",
"line",
"fits",
"the",
"pattern",
"create",
"the",
"necessary",
"elements",
"add",
"it",
"to",
"stashed_nodes",
"."
] | [
"\"\"\"\n Check if the line fits the pattern, create the necessary\n elements, add it to stashed_nodes.\n\n Keyword arguments:\n\n * data: the text to be processed\n * pattern: the pattern to be checked\n * patternIndex: index of current pattern\n * startIndex: strin... | [
{
"param": "self",
"type": null
},
{
"param": "pattern",
"type": null
},
{
"param": "data",
"type": null
},
{
"param": "patternIndex",
"type": null
},
{
"param": "startIndex",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "pattern",
"type": null,
"docstring": null,
"docstring_tokens"... |
152daab15b879030f5729b41bbecf012988bc900 | sunlongbo/chromium | third_party/markdown/treeprocessors.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | run | <not_specific> | def run(self, tree):
"""Apply inline patterns to a parsed Markdown tree.
Iterate over ElementTree, find elements with inline tag, apply inline
patterns and append newly created Elements to tree. If you don't
want to process your data with inline paterns, instead of normal string,
... | Apply inline patterns to a parsed Markdown tree.
Iterate over ElementTree, find elements with inline tag, apply inline
patterns and append newly created Elements to tree. If you don't
want to process your data with inline paterns, instead of normal string,
use subclass AtomicString:
... | Apply inline patterns to a parsed Markdown tree.
Iterate over ElementTree, find elements with inline tag, apply inline
patterns and append newly created Elements to tree. If you don't
want to process your data with inline paterns, instead of normal string,
use subclass AtomicString.
ElementTree object, representi... | [
"Apply",
"inline",
"patterns",
"to",
"a",
"parsed",
"Markdown",
"tree",
".",
"Iterate",
"over",
"ElementTree",
"find",
"elements",
"with",
"inline",
"tag",
"apply",
"inline",
"patterns",
"and",
"append",
"newly",
"created",
"Elements",
"to",
"tree",
".",
"If",... | def run(self, tree):
self.stashed_nodes = {}
stack = [tree]
while stack:
currElement = stack.pop()
insertQueue = []
for child in currElement:
if child.text and not isinstance(child.text, util.AtomicString):
text = child.text... | [
"def",
"run",
"(",
"self",
",",
"tree",
")",
":",
"self",
".",
"stashed_nodes",
"=",
"{",
"}",
"stack",
"=",
"[",
"tree",
"]",
"while",
"stack",
":",
"currElement",
"=",
"stack",
".",
"pop",
"(",
")",
"insertQueue",
"=",
"[",
"]",
"for",
"child",
... | Apply inline patterns to a parsed Markdown tree. | [
"Apply",
"inline",
"patterns",
"to",
"a",
"parsed",
"Markdown",
"tree",
"."
] | [
"\"\"\"Apply inline patterns to a parsed Markdown tree.\n\n Iterate over ElementTree, find elements with inline tag, apply inline\n patterns and append newly created Elements to tree. If you don't\n want to process your data with inline paterns, instead of normal string,\n use subclass ... | [
{
"param": "self",
"type": null
},
{
"param": "tree",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "tree",
"type": null,
"docstring": null,
"docstring_tokens": [... |
152daab15b879030f5729b41bbecf012988bc900 | sunlongbo/chromium | third_party/markdown/treeprocessors.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | run | null | def run(self, root):
""" Add linebreaks to ElementTree root object. """
self._prettifyETree(root)
# Do <br />'s seperately as they are often in the middle of
# inline content and missed by _prettifyETree.
brs = root.iter('br')
for br in brs:
if not br.tail or... | Add linebreaks to ElementTree root object. | Add linebreaks to ElementTree root object. | [
"Add",
"linebreaks",
"to",
"ElementTree",
"root",
"object",
"."
] | def run(self, root):
self._prettifyETree(root)
brs = root.iter('br')
for br in brs:
if not br.tail or not br.tail.strip():
br.tail = '\n'
else:
br.tail = '\n%s' % br.tail
pres = root.iter('pre')
for pre in pres:
... | [
"def",
"run",
"(",
"self",
",",
"root",
")",
":",
"self",
".",
"_prettifyETree",
"(",
"root",
")",
"brs",
"=",
"root",
".",
"iter",
"(",
"'br'",
")",
"for",
"br",
"in",
"brs",
":",
"if",
"not",
"br",
".",
"tail",
"or",
"not",
"br",
".",
"tail",... | Add linebreaks to ElementTree root object. | [
"Add",
"linebreaks",
"to",
"ElementTree",
"root",
"object",
"."
] | [
"\"\"\" Add linebreaks to ElementTree root object. \"\"\"",
"# Do <br />'s seperately as they are often in the middle of",
"# inline content and missed by _prettifyETree.",
"# Clean up extra empty lines at end of code blocks."
] | [
{
"param": "self",
"type": null
},
{
"param": "root",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "root",
"type": null,
"docstring": null,
"docstring_tokens": [... |
1543a016bb92e12d43b92f7e8c42bf2d62ab8419 | sunlongbo/chromium | components/policy/tools/template_writers/writers/admx_writer_unittest.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | _initWriterForPolicy | null | def _initWriterForPolicy(self, writer, policy):
'''Initializes the writer to write the given policy next.
'''
policy_group = {'name': 'PolicyGroup', 'policies': [policy]}
writer.BeginTemplate()
writer.BeginPolicyGroup(policy_group) | Initializes the writer to write the given policy next.
| Initializes the writer to write the given policy next. | [
"Initializes",
"the",
"writer",
"to",
"write",
"the",
"given",
"policy",
"next",
"."
] | def _initWriterForPolicy(self, writer, policy):
policy_group = {'name': 'PolicyGroup', 'policies': [policy]}
writer.BeginTemplate()
writer.BeginPolicyGroup(policy_group) | [
"def",
"_initWriterForPolicy",
"(",
"self",
",",
"writer",
",",
"policy",
")",
":",
"policy_group",
"=",
"{",
"'name'",
":",
"'PolicyGroup'",
",",
"'policies'",
":",
"[",
"policy",
"]",
"}",
"writer",
".",
"BeginTemplate",
"(",
")",
"writer",
".",
"BeginPo... | Initializes the writer to write the given policy next. | [
"Initializes",
"the",
"writer",
"to",
"write",
"the",
"given",
"policy",
"next",
"."
] | [
"'''Initializes the writer to write the given policy next.\n '''"
] | [
{
"param": "self",
"type": null
},
{
"param": "writer",
"type": null
},
{
"param": "policy",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "writer",
"type": null,
"docstring": null,
"docstring_tokens":... |
c860a5a6a5d573546dda1c9f035f45ac8ee7a364 | sunlongbo/chromium | native_client_sdk/src/tools/lib/elf.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | ParseElfHeader | <not_specific> | def ParseElfHeader(path):
"""Determine properties of a nexe by parsing elf header.
Return tuple of architecture and boolean signalling whether
the executable is dynamic (has INTERP header) or static.
"""
# From elf.h:
# typedef struct
# {
# unsigned char e_ident[EI_NIDENT]; /* Magic number and other i... | Determine properties of a nexe by parsing elf header.
Return tuple of architecture and boolean signalling whether
the executable is dynamic (has INTERP header) or static.
| Determine properties of a nexe by parsing elf header.
Return tuple of architecture and boolean signalling whether
the executable is dynamic (has INTERP header) or static. | [
"Determine",
"properties",
"of",
"a",
"nexe",
"by",
"parsing",
"elf",
"header",
".",
"Return",
"tuple",
"of",
"architecture",
"and",
"boolean",
"signalling",
"whether",
"the",
"executable",
"is",
"dynamic",
"(",
"has",
"INTERP",
"header",
")",
"or",
"static",
... | def ParseElfHeader(path):
elf_header_format = '16s2H'
elf_header_size = struct.calcsize(elf_header_format)
with open(path, 'rb') as f:
header = f.read(elf_header_size)
try:
header = struct.unpack(elf_header_format, header)
except struct.error:
raise Error("error parsing elf header: %s" % path)
e... | [
"def",
"ParseElfHeader",
"(",
"path",
")",
":",
"elf_header_format",
"=",
"'16s2H'",
"elf_header_size",
"=",
"struct",
".",
"calcsize",
"(",
"elf_header_format",
")",
"with",
"open",
"(",
"path",
",",
"'rb'",
")",
"as",
"f",
":",
"header",
"=",
"f",
".",
... | Determine properties of a nexe by parsing elf header. | [
"Determine",
"properties",
"of",
"a",
"nexe",
"by",
"parsing",
"elf",
"header",
"."
] | [
"\"\"\"Determine properties of a nexe by parsing elf header.\n Return tuple of architecture and boolean signalling whether\n the executable is dynamic (has INTERP header) or static.\n \"\"\"",
"# From elf.h:",
"# typedef struct",
"# {",
"# unsigned char e_ident[EI_NIDENT]; /* Magic number and other inf... | [
{
"param": "path",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "path",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
8a424d0aa76426ad4b1c8e35fb21d2387d217f0a | sunlongbo/chromium | third_party/blink/renderer/build/scripts/keyword_utils.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | sort_keyword_properties_by_canonical_order | <not_specific> | def sort_keyword_properties_by_canonical_order(
css_properties, css_value_keywords_file, json5_file_parameters):
"""Sort all keyword CSS properties by the order of the keyword in
css_value_keywords.json5
Args:
css_properties: css_properties excluding extra fields.
css_value_keywo... | Sort all keyword CSS properties by the order of the keyword in
css_value_keywords.json5
Args:
css_properties: css_properties excluding extra fields.
css_value_keywords_file: file containing all css keywords.
json5_file_parameters: current context json5 parameters.
Returns:
... | Sort all keyword CSS properties by the order of the keyword in
css_value_keywords.json5 | [
"Sort",
"all",
"keyword",
"CSS",
"properties",
"by",
"the",
"order",
"of",
"the",
"keyword",
"in",
"css_value_keywords",
".",
"json5"
] | def sort_keyword_properties_by_canonical_order(
css_properties, css_value_keywords_file, json5_file_parameters):
css_values_dictionary = json5_generator.Json5File.load_from_files(
[css_value_keywords_file],
default_parameters=json5_file_parameters).name_dictionaries
css_values_dictionary... | [
"def",
"sort_keyword_properties_by_canonical_order",
"(",
"css_properties",
",",
"css_value_keywords_file",
",",
"json5_file_parameters",
")",
":",
"css_values_dictionary",
"=",
"json5_generator",
".",
"Json5File",
".",
"load_from_files",
"(",
"[",
"css_value_keywords_file",
... | Sort all keyword CSS properties by the order of the keyword in
css_value_keywords.json5 | [
"Sort",
"all",
"keyword",
"CSS",
"properties",
"by",
"the",
"order",
"of",
"the",
"keyword",
"in",
"css_value_keywords",
".",
"json5"
] | [
"\"\"\"Sort all keyword CSS properties by the order of the keyword in\n css_value_keywords.json5\n\n Args:\n css_properties: css_properties excluding extra fields.\n css_value_keywords_file: file containing all css keywords.\n json5_file_parameters: current context json5 parameters.\n\... | [
{
"param": "css_properties",
"type": null
},
{
"param": "css_value_keywords_file",
"type": null
},
{
"param": "json5_file_parameters",
"type": null
}
] | {
"returns": [
{
"docstring": "New css_properties object with sorted keywords.",
"docstring_tokens": [
"New",
"css_properties",
"object",
"with",
"sorted",
"keywords",
"."
],
"type": null
}
],
"raises": [],
"params": [
{... |
ca2b7cebefb8a17a7f64d45231a1fc4b29d188fa | sunlongbo/chromium | tools/binary_size/generate_commit_size_analysis.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | _generate_resource_sizes | null | def _generate_resource_sizes(to_resource_sizes_py, make_chromium_output_path,
make_staging_path):
"""Creates results-chart.json file in staging_dir"""
cmd = [
_RESOURCE_SIZES_PATH,
make_chromium_output_path(to_resource_sizes_py['apk_name']),
'--output-format=chartjson'... | Creates results-chart.json file in staging_dir | Creates results-chart.json file in staging_dir | [
"Creates",
"results",
"-",
"chart",
".",
"json",
"file",
"in",
"staging_dir"
] | def _generate_resource_sizes(to_resource_sizes_py, make_chromium_output_path,
make_staging_path):
cmd = [
_RESOURCE_SIZES_PATH,
make_chromium_output_path(to_resource_sizes_py['apk_name']),
'--output-format=chartjson',
'--chromium-output-directory',
make_chrom... | [
"def",
"_generate_resource_sizes",
"(",
"to_resource_sizes_py",
",",
"make_chromium_output_path",
",",
"make_staging_path",
")",
":",
"cmd",
"=",
"[",
"_RESOURCE_SIZES_PATH",
",",
"make_chromium_output_path",
"(",
"to_resource_sizes_py",
"[",
"'apk_name'",
"]",
")",
",",
... | Creates results-chart.json file in staging_dir | [
"Creates",
"results",
"-",
"chart",
".",
"json",
"file",
"in",
"staging_dir"
] | [
"\"\"\"Creates results-chart.json file in staging_dir\"\"\""
] | [
{
"param": "to_resource_sizes_py",
"type": null
},
{
"param": "make_chromium_output_path",
"type": null
},
{
"param": "make_staging_path",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "to_resource_sizes_py",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "make_chromium_output_path",
"type": null,
"docstrin... |
ca2b7cebefb8a17a7f64d45231a1fc4b29d188fa | sunlongbo/chromium | tools/binary_size/generate_commit_size_analysis.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | _generate_supersize_archive | null | def _generate_supersize_archive(supersize_input_file, make_chromium_output_path,
make_staging_path):
"""Creates a .size file for the given .apk or .minimal.apks"""
subprocess.run([_CLANG_UPDATE_PATH, '--package=objdump'], check=True)
supersize_input_path = make_chromium_output_path... | Creates a .size file for the given .apk or .minimal.apks | Creates a .size file for the given .apk or .minimal.apks | [
"Creates",
"a",
".",
"size",
"file",
"for",
"the",
"given",
".",
"apk",
"or",
".",
"minimal",
".",
"apks"
] | def _generate_supersize_archive(supersize_input_file, make_chromium_output_path,
make_staging_path):
subprocess.run([_CLANG_UPDATE_PATH, '--package=objdump'], check=True)
supersize_input_path = make_chromium_output_path(supersize_input_file)
size_path = make_staging_path(supersize_... | [
"def",
"_generate_supersize_archive",
"(",
"supersize_input_file",
",",
"make_chromium_output_path",
",",
"make_staging_path",
")",
":",
"subprocess",
".",
"run",
"(",
"[",
"_CLANG_UPDATE_PATH",
",",
"'--package=objdump'",
"]",
",",
"check",
"=",
"True",
")",
"supersi... | Creates a .size file for the given .apk or .minimal.apks | [
"Creates",
"a",
".",
"size",
"file",
"for",
"the",
"given",
".",
"apk",
"or",
".",
"minimal",
".",
"apks"
] | [
"\"\"\"Creates a .size file for the given .apk or .minimal.apks\"\"\""
] | [
{
"param": "supersize_input_file",
"type": null
},
{
"param": "make_chromium_output_path",
"type": null
},
{
"param": "make_staging_path",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "supersize_input_file",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "make_chromium_output_path",
"type": null,
"docstrin... |
ca2f0c1107c93c1120d257b939a0715bcefa137e | sunlongbo/chromium | weblayer/browser/java/org/chromium/weblayer_private/interfaces/PRESUBMIT.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | GetPathRelativeTo | <not_specific> | def GetPathRelativeTo(self, other_dir):
"""Returns the path of the file relative to another directory.
The path is built using the java packages.
"""
return os.path.join(os.path.join(other_dir, *self.packages), self.file_name) | Returns the path of the file relative to another directory.
The path is built using the java packages.
| Returns the path of the file relative to another directory.
The path is built using the java packages. | [
"Returns",
"the",
"path",
"of",
"the",
"file",
"relative",
"to",
"another",
"directory",
".",
"The",
"path",
"is",
"built",
"using",
"the",
"java",
"packages",
"."
] | def GetPathRelativeTo(self, other_dir):
return os.path.join(os.path.join(other_dir, *self.packages), self.file_name) | [
"def",
"GetPathRelativeTo",
"(",
"self",
",",
"other_dir",
")",
":",
"return",
"os",
".",
"path",
".",
"join",
"(",
"os",
".",
"path",
".",
"join",
"(",
"other_dir",
",",
"*",
"self",
".",
"packages",
")",
",",
"self",
".",
"file_name",
")"
] | Returns the path of the file relative to another directory. | [
"Returns",
"the",
"path",
"of",
"the",
"file",
"relative",
"to",
"another",
"directory",
"."
] | [
"\"\"\"Returns the path of the file relative to another directory.\n\n The path is built using the java packages.\n \"\"\""
] | [
{
"param": "self",
"type": null
},
{
"param": "other_dir",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "other_dir",
"type": null,
"docstring": null,
"docstring_token... |
4d1f79c0b4b66bd30af12ed9a2fe6d8845274829 | sunlongbo/chromium | third_party/blink/tools/blinkpy/web_tests/servers/wptserve.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | _check_and_kill | <not_specific> | def _check_and_kill(self):
"""Tries to kill wptserve.
Returns True if it appears to be not running. Or, if it appears to be
running, tries to kill the process and returns False.
"""
if not self._pid:
_log.warning('No PID; wptserve has not started.')
retur... | Tries to kill wptserve.
Returns True if it appears to be not running. Or, if it appears to be
running, tries to kill the process and returns False.
| Tries to kill wptserve.
Returns True if it appears to be not running. Or, if it appears to be
running, tries to kill the process and returns False. | [
"Tries",
"to",
"kill",
"wptserve",
".",
"Returns",
"True",
"if",
"it",
"appears",
"to",
"be",
"not",
"running",
".",
"Or",
"if",
"it",
"appears",
"to",
"be",
"running",
"tries",
"to",
"kill",
"the",
"process",
"and",
"returns",
"False",
"."
] | def _check_and_kill(self):
if not self._pid:
_log.warning('No PID; wptserve has not started.')
return True
if (self._process and self._process.poll()) or \
(not self._executive.check_running_pid(self._pid)):
_log.debug('pid %d is not running', self._pi... | [
"def",
"_check_and_kill",
"(",
"self",
")",
":",
"if",
"not",
"self",
".",
"_pid",
":",
"_log",
".",
"warning",
"(",
"'No PID; wptserve has not started.'",
")",
"return",
"True",
"if",
"(",
"self",
".",
"_process",
"and",
"self",
".",
"_process",
".",
"pol... | Tries to kill wptserve. | [
"Tries",
"to",
"kill",
"wptserve",
"."
] | [
"\"\"\"Tries to kill wptserve.\n\n Returns True if it appears to be not running. Or, if it appears to be\n running, tries to kill the process and returns False.\n \"\"\"",
"# Polls the process in case it has died; otherwise, the process might be",
"# defunct and check_running_pid can still ... | [
{
"param": "self",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
4d36f6d9857ac9fefa49d15f371871b52c2ded61 | sunlongbo/chromium | tools/perf/core/services/buildbucket_service.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | Request | <not_specific> | def Request(method, **kwargs):
"""Send a request to some buildbucket service method."""
kwargs.setdefault('use_auth', True)
kwargs.setdefault('method', 'POST')
kwargs.setdefault('content_type', 'json')
kwargs.setdefault('accept', 'json')
return request.Request(SERVICE_URL + method, **kwargs) | Send a request to some buildbucket service method. | Send a request to some buildbucket service method. | [
"Send",
"a",
"request",
"to",
"some",
"buildbucket",
"service",
"method",
"."
] | def Request(method, **kwargs):
kwargs.setdefault('use_auth', True)
kwargs.setdefault('method', 'POST')
kwargs.setdefault('content_type', 'json')
kwargs.setdefault('accept', 'json')
return request.Request(SERVICE_URL + method, **kwargs) | [
"def",
"Request",
"(",
"method",
",",
"**",
"kwargs",
")",
":",
"kwargs",
".",
"setdefault",
"(",
"'use_auth'",
",",
"True",
")",
"kwargs",
".",
"setdefault",
"(",
"'method'",
",",
"'POST'",
")",
"kwargs",
".",
"setdefault",
"(",
"'content_type'",
",",
"... | Send a request to some buildbucket service method. | [
"Send",
"a",
"request",
"to",
"some",
"buildbucket",
"service",
"method",
"."
] | [
"\"\"\"Send a request to some buildbucket service method.\"\"\""
] | [
{
"param": "method",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "method",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
4d36f6d9857ac9fefa49d15f371871b52c2ded61 | sunlongbo/chromium | tools/perf/core/services/buildbucket_service.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | GetBuild | <not_specific> | def GetBuild(project, bucket, builder, build_number):
"""Get the status of a build by its build number.
Args:
project: The LUCI project name (e.g. 'chromium').
bucket: The LUCI bucket name (e.g. 'ci' or 'try').
builder: The builder name (e.g. 'linux_chromium_rel_ng').
build_number: An int with the ... | Get the status of a build by its build number.
Args:
project: The LUCI project name (e.g. 'chromium').
bucket: The LUCI bucket name (e.g. 'ci' or 'try').
builder: The builder name (e.g. 'linux_chromium_rel_ng').
build_number: An int with the build number to get.
| Get the status of a build by its build number. | [
"Get",
"the",
"status",
"of",
"a",
"build",
"by",
"its",
"build",
"number",
"."
] | def GetBuild(project, bucket, builder, build_number):
return Request('GetBuild', data={
'builder': {
'project': project,
'bucket': bucket,
'builder': builder,
},
'buildNumber': build_number,
}) | [
"def",
"GetBuild",
"(",
"project",
",",
"bucket",
",",
"builder",
",",
"build_number",
")",
":",
"return",
"Request",
"(",
"'GetBuild'",
",",
"data",
"=",
"{",
"'builder'",
":",
"{",
"'project'",
":",
"project",
",",
"'bucket'",
":",
"bucket",
",",
"'bui... | Get the status of a build by its build number. | [
"Get",
"the",
"status",
"of",
"a",
"build",
"by",
"its",
"build",
"number",
"."
] | [
"\"\"\"Get the status of a build by its build number.\n\n Args:\n project: The LUCI project name (e.g. 'chromium').\n bucket: The LUCI bucket name (e.g. 'ci' or 'try').\n builder: The builder name (e.g. 'linux_chromium_rel_ng').\n build_number: An int with the build number to get.\n \"\"\""
] | [
{
"param": "project",
"type": null
},
{
"param": "bucket",
"type": null
},
{
"param": "builder",
"type": null
},
{
"param": "build_number",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "project",
"type": null,
"docstring": "The LUCI project name .",
"docstring_tokens": [
"The",
"LUCI",
"project",
"name",
"."
],
"default": null,
"is_optional": null
... |
4d36f6d9857ac9fefa49d15f371871b52c2ded61 | sunlongbo/chromium | tools/perf/core/services/buildbucket_service.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | GetBuilds | <not_specific> | def GetBuilds(project, bucket, builder, only_completed=True):
"""Get a list of recent builds from a given builder.
Args:
project: The LUCI project name (e.g. 'chromium').
bucket: The LUCI bucket name (e.g. 'ci' or 'try').
builder: The builder name (e.g. 'linux_chromium_rel_ng').
only_completed: An ... | Get a list of recent builds from a given builder.
Args:
project: The LUCI project name (e.g. 'chromium').
bucket: The LUCI bucket name (e.g. 'ci' or 'try').
builder: The builder name (e.g. 'linux_chromium_rel_ng').
only_completed: An optional bool to indicate whehter builds that have
not yet fi... | Get a list of recent builds from a given builder. | [
"Get",
"a",
"list",
"of",
"recent",
"builds",
"from",
"a",
"given",
"builder",
"."
] | def GetBuilds(project, bucket, builder, only_completed=True):
data = {
'predicate': {
'builder': {
'project': project,
'bucket': bucket,
'builder': builder
}
}
}
if only_completed:
data['predicate']['status'] = 'ENDED_MASK'
return Req... | [
"def",
"GetBuilds",
"(",
"project",
",",
"bucket",
",",
"builder",
",",
"only_completed",
"=",
"True",
")",
":",
"data",
"=",
"{",
"'predicate'",
":",
"{",
"'builder'",
":",
"{",
"'project'",
":",
"project",
",",
"'bucket'",
":",
"bucket",
",",
"'builder... | Get a list of recent builds from a given builder. | [
"Get",
"a",
"list",
"of",
"recent",
"builds",
"from",
"a",
"given",
"builder",
"."
] | [
"\"\"\"Get a list of recent builds from a given builder.\n\n Args:\n project: The LUCI project name (e.g. 'chromium').\n bucket: The LUCI bucket name (e.g. 'ci' or 'try').\n builder: The builder name (e.g. 'linux_chromium_rel_ng').\n only_completed: An optional bool to indicate whehter builds that have... | [
{
"param": "project",
"type": null
},
{
"param": "bucket",
"type": null
},
{
"param": "builder",
"type": null
},
{
"param": "only_completed",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "project",
"type": null,
"docstring": "The LUCI project name .",
"docstring_tokens": [
"The",
"LUCI",
"project",
"name",
"."
],
"default": null,
"is_optional": null
... |
4b967b308c38b8518b140fb202ad1aa1bdf83121 | sunlongbo/chromium | ui/views/PRESUBMIT.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | CheckChangeLintsClean | <not_specific> | def CheckChangeLintsClean(input_api, output_api):
"""Makes sure that the change is cpplint clean."""
sources = lambda x: input_api.FilterSourceFile(
x, files_to_check=INCLUDE_CPP_FILES_ONLY,
files_to_skip=input_api.DEFAULT_FILES_TO_SKIP)
return input_api.canned_checks.CheckChangeLintsClean(
input_ap... | Makes sure that the change is cpplint clean. | Makes sure that the change is cpplint clean. | [
"Makes",
"sure",
"that",
"the",
"change",
"is",
"cpplint",
"clean",
"."
] | def CheckChangeLintsClean(input_api, output_api):
sources = lambda x: input_api.FilterSourceFile(
x, files_to_check=INCLUDE_CPP_FILES_ONLY,
files_to_skip=input_api.DEFAULT_FILES_TO_SKIP)
return input_api.canned_checks.CheckChangeLintsClean(
input_api, output_api, sources, lint_filters=[], verbose_leve... | [
"def",
"CheckChangeLintsClean",
"(",
"input_api",
",",
"output_api",
")",
":",
"sources",
"=",
"lambda",
"x",
":",
"input_api",
".",
"FilterSourceFile",
"(",
"x",
",",
"files_to_check",
"=",
"INCLUDE_CPP_FILES_ONLY",
",",
"files_to_skip",
"=",
"input_api",
".",
... | Makes sure that the change is cpplint clean. | [
"Makes",
"sure",
"that",
"the",
"change",
"is",
"cpplint",
"clean",
"."
] | [
"\"\"\"Makes sure that the change is cpplint clean.\"\"\""
] | [
{
"param": "input_api",
"type": null
},
{
"param": "output_api",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "input_api",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "output_api",
"type": null,
"docstring": null,
"docstring... |
77b4ff6d77e22baa72aa8325b13fe5242548815c | sunlongbo/chromium | ios/build/tools/setup-gn.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | _GetGnArgs | <not_specific> | def _GetGnArgs(self, extra_args=None):
"""Build the list of arguments to pass to gn.
Returns:
A list of tuple containing gn variable names and variable values (it
is not a dictionary as the order needs to be preserved).
"""
args = []
# build/config/ios/ios_sdk.gni asserts that goma is ... | Build the list of arguments to pass to gn.
Returns:
A list of tuple containing gn variable names and variable values (it
is not a dictionary as the order needs to be preserved).
| Build the list of arguments to pass to gn. | [
"Build",
"the",
"list",
"of",
"arguments",
"to",
"pass",
"to",
"gn",
"."
] | def _GetGnArgs(self, extra_args=None):
args = []
if self._config != 'Official':
if self._settings.getboolean('goma', 'enabled'):
args.append(('use_goma', True))
goma_dir = self._settings.getstring('goma', 'install')
if goma_dir:
args.append(('goma_dir', '"%s"' % os.path.e... | [
"def",
"_GetGnArgs",
"(",
"self",
",",
"extra_args",
"=",
"None",
")",
":",
"args",
"=",
"[",
"]",
"if",
"self",
".",
"_config",
"!=",
"'Official'",
":",
"if",
"self",
".",
"_settings",
".",
"getboolean",
"(",
"'goma'",
",",
"'enabled'",
")",
":",
"a... | Build the list of arguments to pass to gn. | [
"Build",
"the",
"list",
"of",
"arguments",
"to",
"pass",
"to",
"gn",
"."
] | [
"\"\"\"Build the list of arguments to pass to gn.\n\n Returns:\n A list of tuple containing gn variable names and variable values (it\n is not a dictionary as the order needs to be preserved).\n \"\"\"",
"# build/config/ios/ios_sdk.gni asserts that goma is not enabled when",
"# building Official... | [
{
"param": "self",
"type": null
},
{
"param": "extra_args",
"type": null
}
] | {
"returns": [
{
"docstring": "A list of tuple containing gn variable names and variable values (it\nis not a dictionary as the order needs to be preserved).",
"docstring_tokens": [
"A",
"list",
"of",
"tuple",
"containing",
"gn",
"variable",
... |
5536a41fca30919cab15d1da56b8cd47ac6129c0 | sunlongbo/chromium | components/policy/tools/template_writers/writers/android_policy_writer.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | GetWriter | <not_specific> | def GetWriter(config):
'''Factory method for creating AndroidPolicyWriter objects.
See the constructor of TemplateWriter for description of
arguments.
'''
return AndroidPolicyWriter(['android'], config) | Factory method for creating AndroidPolicyWriter objects.
See the constructor of TemplateWriter for description of
arguments.
| Factory method for creating AndroidPolicyWriter objects.
See the constructor of TemplateWriter for description of
arguments. | [
"Factory",
"method",
"for",
"creating",
"AndroidPolicyWriter",
"objects",
".",
"See",
"the",
"constructor",
"of",
"TemplateWriter",
"for",
"description",
"of",
"arguments",
"."
] | def GetWriter(config):
return AndroidPolicyWriter(['android'], config) | [
"def",
"GetWriter",
"(",
"config",
")",
":",
"return",
"AndroidPolicyWriter",
"(",
"[",
"'android'",
"]",
",",
"config",
")"
] | Factory method for creating AndroidPolicyWriter objects. | [
"Factory",
"method",
"for",
"creating",
"AndroidPolicyWriter",
"objects",
"."
] | [
"'''Factory method for creating AndroidPolicyWriter 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": []
} |
5536a41fca30919cab15d1da56b8cd47ac6129c0 | sunlongbo/chromium | components/policy/tools/template_writers/writers/android_policy_writer.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | _EscapeResource | <not_specific> | def _EscapeResource(resource):
'''Escape the resource for usage in an Android resource XML file.
This includes standard XML escaping as well as those specific to Android.
'''
if resource == None or type(resource) in (int, bool):
return str(resource)
return xml_escape.escape(
resource,
{
... | Escape the resource for usage in an Android resource XML file.
This includes standard XML escaping as well as those specific to Android.
| Escape the resource for usage in an Android resource XML file.
This includes standard XML escaping as well as those specific to Android. | [
"Escape",
"the",
"resource",
"for",
"usage",
"in",
"an",
"Android",
"resource",
"XML",
"file",
".",
"This",
"includes",
"standard",
"XML",
"escaping",
"as",
"well",
"as",
"those",
"specific",
"to",
"Android",
"."
] | def _EscapeResource(resource):
if resource == None or type(resource) in (int, bool):
return str(resource)
return xml_escape.escape(
resource,
{
"\\": "\\\\",
"'": "\\'",
'"': '\\"',
}) | [
"def",
"_EscapeResource",
"(",
"resource",
")",
":",
"if",
"resource",
"==",
"None",
"or",
"type",
"(",
"resource",
")",
"in",
"(",
"int",
",",
"bool",
")",
":",
"return",
"str",
"(",
"resource",
")",
"return",
"xml_escape",
".",
"escape",
"(",
"resour... | Escape the resource for usage in an Android resource XML file. | [
"Escape",
"the",
"resource",
"for",
"usage",
"in",
"an",
"Android",
"resource",
"XML",
"file",
"."
] | [
"'''Escape the resource for usage in an Android resource XML file.\n This includes standard XML escaping as well as those specific to Android.\n '''",
"# Written order is matter to prevent \"'\" becomes \"\\\\\\\\'\" instead of",
"# \"\\\\'\"."
] | [
{
"param": "resource",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "resource",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
5536a41fca30919cab15d1da56b8cd47ac6129c0 | sunlongbo/chromium | components/policy/tools/template_writers/writers/android_policy_writer.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | AddStringResource | null | def AddStringResource(self, name, string):
'''Add a string resource of the given name.
'''
string_node = self._doc.createElement('string')
string_node.setAttribute('name', name)
string_node.appendChild(self._doc.createTextNode(_EscapeResource(string)))
self._resources.appendChild(string_node) | Add a string resource of the given name.
| Add a string resource of the given name. | [
"Add",
"a",
"string",
"resource",
"of",
"the",
"given",
"name",
"."
] | def AddStringResource(self, name, string):
string_node = self._doc.createElement('string')
string_node.setAttribute('name', name)
string_node.appendChild(self._doc.createTextNode(_EscapeResource(string)))
self._resources.appendChild(string_node) | [
"def",
"AddStringResource",
"(",
"self",
",",
"name",
",",
"string",
")",
":",
"string_node",
"=",
"self",
".",
"_doc",
".",
"createElement",
"(",
"'string'",
")",
"string_node",
".",
"setAttribute",
"(",
"'name'",
",",
"name",
")",
"string_node",
".",
"ap... | Add a string resource of the given name. | [
"Add",
"a",
"string",
"resource",
"of",
"the",
"given",
"name",
"."
] | [
"'''Add a string resource of the given name.\n '''"
] | [
{
"param": "self",
"type": null
},
{
"param": "name",
"type": null
},
{
"param": "string",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "name",
"type": null,
"docstring": null,
"docstring_tokens": [... |
5536a41fca30919cab15d1da56b8cd47ac6129c0 | sunlongbo/chromium | components/policy/tools/template_writers/writers/android_policy_writer.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | AddStringArrayResource | null | def AddStringArrayResource(self, name, string_items):
'''Add a string-array resource of the given name and
elements from string_items.
'''
string_array_node = self._doc.createElement('string-array')
string_array_node.setAttribute('name', name)
self._resources.appendChild(string_array_node)
f... | Add a string-array resource of the given name and
elements from string_items.
| Add a string-array resource of the given name and
elements from string_items. | [
"Add",
"a",
"string",
"-",
"array",
"resource",
"of",
"the",
"given",
"name",
"and",
"elements",
"from",
"string_items",
"."
] | def AddStringArrayResource(self, name, string_items):
string_array_node = self._doc.createElement('string-array')
string_array_node.setAttribute('name', name)
self._resources.appendChild(string_array_node)
for item in string_items:
string_node = self._doc.createElement('item')
string_node.ap... | [
"def",
"AddStringArrayResource",
"(",
"self",
",",
"name",
",",
"string_items",
")",
":",
"string_array_node",
"=",
"self",
".",
"_doc",
".",
"createElement",
"(",
"'string-array'",
")",
"string_array_node",
".",
"setAttribute",
"(",
"'name'",
",",
"name",
")",
... | Add a string-array resource of the given name and
elements from string_items. | [
"Add",
"a",
"string",
"-",
"array",
"resource",
"of",
"the",
"given",
"name",
"and",
"elements",
"from",
"string_items",
"."
] | [
"'''Add a string-array resource of the given name and\n elements from string_items.\n '''"
] | [
{
"param": "self",
"type": null
},
{
"param": "name",
"type": null
},
{
"param": "string_items",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "name",
"type": null,
"docstring": null,
"docstring_tokens": [... |
05b31a944deb60ba2c7f4d5ce9de861d819b56db | sunlongbo/chromium | tools/web_bluetooth/compact_blocklist.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | ShortenUUID | <not_specific> | def ShortenUUID(uuid):
"""Shorten a UUUD that use Bluetooth base UUID.
Note: this function shortens all UUIDs that use the Bluetooth base
UUID even though the specification states that only an assigned UUID
can be shortened. In this case it works fine, since the constructor in
bluetooth_uuid.cc also works th... | Shorten a UUUD that use Bluetooth base UUID.
Note: this function shortens all UUIDs that use the Bluetooth base
UUID even though the specification states that only an assigned UUID
can be shortened. In this case it works fine, since the constructor in
bluetooth_uuid.cc also works the same way.
| Shorten a UUUD that use Bluetooth base UUID.
Note: this function shortens all UUIDs that use the Bluetooth base
UUID even though the specification states that only an assigned UUID
can be shortened. In this case it works fine, since the constructor in
bluetooth_uuid.cc also works the same way. | [
"Shorten",
"a",
"UUUD",
"that",
"use",
"Bluetooth",
"base",
"UUID",
".",
"Note",
":",
"this",
"function",
"shortens",
"all",
"UUIDs",
"that",
"use",
"the",
"Bluetooth",
"base",
"UUID",
"even",
"though",
"the",
"specification",
"states",
"that",
"only",
"an",... | def ShortenUUID(uuid):
if uuid[8:] == UUID_BASE_POSTFIX:
new_uuid = '%x' % int(uuid[:8], 16)
if len(new_uuid) in [4, 8]:
uuid = new_uuid
return uuid | [
"def",
"ShortenUUID",
"(",
"uuid",
")",
":",
"if",
"uuid",
"[",
"8",
":",
"]",
"==",
"UUID_BASE_POSTFIX",
":",
"new_uuid",
"=",
"'%x'",
"%",
"int",
"(",
"uuid",
"[",
":",
"8",
"]",
",",
"16",
")",
"if",
"len",
"(",
"new_uuid",
")",
"in",
"[",
"... | Shorten a UUUD that use Bluetooth base UUID. | [
"Shorten",
"a",
"UUUD",
"that",
"use",
"Bluetooth",
"base",
"UUID",
"."
] | [
"\"\"\"Shorten a UUUD that use Bluetooth base UUID.\n\n Note: this function shortens all UUIDs that use the Bluetooth base\n UUID even though the specification states that only an assigned UUID\n can be shortened. In this case it works fine, since the constructor in\n bluetooth_uuid.cc also works the same way.\... | [
{
"param": "uuid",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "uuid",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
04d5266fbd18669587603349de0d432f35428da0 | sunlongbo/chromium | tools/perf/PRESUBMIT.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | _CommonChecks | <not_specific> | def _CommonChecks(input_api, output_api, block_on_failure=False):
"""Performs common checks, which includes running pylint.
block_on_failure: For some failures, we would like to warn the
user but still allow them to upload the change. However, we
don't want them to commit code with those failures... | Performs common checks, which includes running pylint.
block_on_failure: For some failures, we would like to warn the
user but still allow them to upload the change. However, we
don't want them to commit code with those failures, so we
need to block the change on commit.
| Performs common checks, which includes running pylint.
block_on_failure: For some failures, we would like to warn the
user but still allow them to upload the change. However, we
don't want them to commit code with those failures, so we
need to block the change on commit. | [
"Performs",
"common",
"checks",
"which",
"includes",
"running",
"pylint",
".",
"block_on_failure",
":",
"For",
"some",
"failures",
"we",
"would",
"like",
"to",
"warn",
"the",
"user",
"but",
"still",
"allow",
"them",
"to",
"upload",
"the",
"change",
".",
"How... | def _CommonChecks(input_api, output_api, block_on_failure=False):
results = []
results.extend(_CheckExpectations(input_api, output_api))
results.extend(_CheckJson(input_api, output_api))
results.extend(
_CheckPerfDataCurrentness(input_api, output_api, block_on_failure))
results.extend(
_CheckPerfJ... | [
"def",
"_CommonChecks",
"(",
"input_api",
",",
"output_api",
",",
"block_on_failure",
"=",
"False",
")",
":",
"results",
"=",
"[",
"]",
"results",
".",
"extend",
"(",
"_CheckExpectations",
"(",
"input_api",
",",
"output_api",
")",
")",
"results",
".",
"exten... | Performs common checks, which includes running pylint. | [
"Performs",
"common",
"checks",
"which",
"includes",
"running",
"pylint",
"."
] | [
"\"\"\"Performs common checks, which includes running pylint.\n\n block_on_failure: For some failures, we would like to warn the\n user but still allow them to upload the change. However, we\n don't want them to commit code with those failures, so we\n need to block the change on commit.\n ... | [
{
"param": "input_api",
"type": null
},
{
"param": "output_api",
"type": null
},
{
"param": "block_on_failure",
"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... |
04d5266fbd18669587603349de0d432f35428da0 | sunlongbo/chromium | tools/perf/PRESUBMIT.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | _CheckWprShaFiles | <not_specific> | def _CheckWprShaFiles(input_api, output_api):
"""Check whether the wpr sha files have matching URLs."""
wpr_archive_shas = []
for affected_file in input_api.AffectedFiles(include_deletes=False):
filename = affected_file.AbsoluteLocalPath()
if not filename.endswith('.sha1'):
continue
wpr_archive_... | Check whether the wpr sha files have matching URLs. | Check whether the wpr sha files have matching URLs. | [
"Check",
"whether",
"the",
"wpr",
"sha",
"files",
"have",
"matching",
"URLs",
"."
] | def _CheckWprShaFiles(input_api, output_api):
wpr_archive_shas = []
for affected_file in input_api.AffectedFiles(include_deletes=False):
filename = affected_file.AbsoluteLocalPath()
if not filename.endswith('.sha1'):
continue
wpr_archive_shas.append(filename)
return _RunValidationScript(
i... | [
"def",
"_CheckWprShaFiles",
"(",
"input_api",
",",
"output_api",
")",
":",
"wpr_archive_shas",
"=",
"[",
"]",
"for",
"affected_file",
"in",
"input_api",
".",
"AffectedFiles",
"(",
"include_deletes",
"=",
"False",
")",
":",
"filename",
"=",
"affected_file",
".",
... | Check whether the wpr sha files have matching URLs. | [
"Check",
"whether",
"the",
"wpr",
"sha",
"files",
"have",
"matching",
"URLs",
"."
] | [
"\"\"\"Check whether the wpr sha files have matching URLs.\"\"\""
] | [
{
"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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.