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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
882c72b27e53335850cd1377f94c672b3287a56f | Jerem2360/multitools | multi_tools/functional/data.py | [
"Unlicense"
] | Python | copy_func_data | <not_specific> | def copy_func_data(source_func, dest_func):
"""
Copy all useful data that is not the __code__ from source to
destination and return destination.
"""
dest_func.__name__ = source_func.__name__
dest_func.__qualname__ = source_func.__qualname__
dest_func.__doc__ = source_func.__doc__
dest_fu... |
Copy all useful data that is not the __code__ from source to
destination and return destination.
| Copy all useful data that is not the __code__ from source to
destination and return destination. | [
"Copy",
"all",
"useful",
"data",
"that",
"is",
"not",
"the",
"__code__",
"from",
"source",
"to",
"destination",
"and",
"return",
"destination",
"."
] | def copy_func_data(source_func, dest_func):
dest_func.__name__ = source_func.__name__
dest_func.__qualname__ = source_func.__qualname__
dest_func.__doc__ = source_func.__doc__
dest_func.__annotations__ = source_func.__annotations__
dest_func.__defaults__ = source_func.__defaults__
dest_func.__mo... | [
"def",
"copy_func_data",
"(",
"source_func",
",",
"dest_func",
")",
":",
"dest_func",
".",
"__name__",
"=",
"source_func",
".",
"__name__",
"dest_func",
".",
"__qualname__",
"=",
"source_func",
".",
"__qualname__",
"dest_func",
".",
"__doc__",
"=",
"source_func",
... | Copy all useful data that is not the __code__ from source to
destination and return destination. | [
"Copy",
"all",
"useful",
"data",
"that",
"is",
"not",
"the",
"__code__",
"from",
"source",
"to",
"destination",
"and",
"return",
"destination",
"."
] | [
"\"\"\"\n Copy all useful data that is not the __code__ from source to\n destination and return destination.\n \"\"\""
] | [
{
"param": "source_func",
"type": null
},
{
"param": "dest_func",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "source_func",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "dest_func",
"type": null,
"docstring": null,
"docstrin... |
fad36db824230d265eb44510cd405d54c143dcda | Jerem2360/multitools | multi_tools/cpp/class_extension.py | [
"Unlicense"
] | Python | search_dll | ctypes.CDLL | def search_dll(name: str) -> ctypes.CDLL:
"""
Utility for searching .dll libraries.
"""
for path in config.Cpp.search_paths:
if os.path.exists(path + name) and name.endswith('.dll'):
return config.Cpp.dll_type(path + name)
raise ReferenceError(f"Failed to solve external reference... |
Utility for searching .dll libraries.
| Utility for searching .dll libraries. | [
"Utility",
"for",
"searching",
".",
"dll",
"libraries",
"."
] | def search_dll(name: str) -> ctypes.CDLL:
for path in config.Cpp.search_paths:
if os.path.exists(path + name) and name.endswith('.dll'):
return config.Cpp.dll_type(path + name)
raise ReferenceError(f"Failed to solve external reference '{name}' in {tuple(config.Cpp.search_paths)}.") | [
"def",
"search_dll",
"(",
"name",
":",
"str",
")",
"->",
"ctypes",
".",
"CDLL",
":",
"for",
"path",
"in",
"config",
".",
"Cpp",
".",
"search_paths",
":",
"if",
"os",
".",
"path",
".",
"exists",
"(",
"path",
"+",
"name",
")",
"and",
"name",
".",
"... | Utility for searching .dll libraries. | [
"Utility",
"for",
"searching",
".",
"dll",
"libraries",
"."
] | [
"\"\"\"\n Utility for searching .dll libraries.\n \"\"\""
] | [
{
"param": "name",
"type": "str"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "name",
"type": "str",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
fad36db824230d265eb44510cd405d54c143dcda | Jerem2360/multitools | multi_tools/cpp/class_extension.py | [
"Unlicense"
] | Python | search_method | <not_specific> | def search_method(dll: ctypes.CDLL, name: str):
"""
Utility for searching specific functions inside a .dll library.
"""
if hasattr(dll, name):
return getattr(dll, name)
raise ReferenceError(f"Failed to solve external reference '{name}' in library {dll}.") |
Utility for searching specific functions inside a .dll library.
| Utility for searching specific functions inside a .dll library. | [
"Utility",
"for",
"searching",
"specific",
"functions",
"inside",
"a",
".",
"dll",
"library",
"."
] | def search_method(dll: ctypes.CDLL, name: str):
if hasattr(dll, name):
return getattr(dll, name)
raise ReferenceError(f"Failed to solve external reference '{name}' in library {dll}.") | [
"def",
"search_method",
"(",
"dll",
":",
"ctypes",
".",
"CDLL",
",",
"name",
":",
"str",
")",
":",
"if",
"hasattr",
"(",
"dll",
",",
"name",
")",
":",
"return",
"getattr",
"(",
"dll",
",",
"name",
")",
"raise",
"ReferenceError",
"(",
"f\"Failed to solv... | Utility for searching specific functions inside a .dll library. | [
"Utility",
"for",
"searching",
"specific",
"functions",
"inside",
"a",
".",
"dll",
"library",
"."
] | [
"\"\"\"\n Utility for searching specific functions inside a .dll library.\n \"\"\""
] | [
{
"param": "dll",
"type": "ctypes.CDLL"
},
{
"param": "name",
"type": "str"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "dll",
"type": "ctypes.CDLL",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "name",
"type": "str",
"docstring": null,
"docstring_t... |
fad36db824230d265eb44510cd405d54c143dcda | Jerem2360/multitools | multi_tools/cpp/class_extension.py | [
"Unlicense"
] | Python | HeaderFunc | <not_specific> | def HeaderFunc(func):
"""
If the owner class is decorated with @HeaderClass , decorated function will be replaced by
the corresponding function of the dll that was specified to the class
decorator. If the owner class is not correctly decorated, TypeError is raised.
-> return type: '_ctypes.FuncPtr'... |
If the owner class is decorated with @HeaderClass , decorated function will be replaced by
the corresponding function of the dll that was specified to the class
decorator. If the owner class is not correctly decorated, TypeError is raised.
-> return type: '_ctypes.FuncPtr'
-> possible raised erro... | If the owner class is decorated with @HeaderClass , decorated function will be replaced by
the corresponding function of the dll that was specified to the class
decorator. If the owner class is not correctly decorated, TypeError is raised.
The right dll function is chosen depending on the header
function's name. P... | [
"If",
"the",
"owner",
"class",
"is",
"decorated",
"with",
"@HeaderClass",
"decorated",
"function",
"will",
"be",
"replaced",
"by",
"the",
"corresponding",
"function",
"of",
"the",
"dll",
"that",
"was",
"specified",
"to",
"the",
"class",
"decorator",
".",
"If",... | def HeaderFunc(func):
_h = _Header(func)
return _h.func | [
"def",
"HeaderFunc",
"(",
"func",
")",
":",
"_h",
"=",
"_Header",
"(",
"func",
")",
"return",
"_h",
".",
"func"
] | If the owner class is decorated with @HeaderClass , decorated function will be replaced by
the corresponding function of the dll that was specified to the class
decorator. | [
"If",
"the",
"owner",
"class",
"is",
"decorated",
"with",
"@HeaderClass",
"decorated",
"function",
"will",
"be",
"replaced",
"by",
"the",
"corresponding",
"function",
"of",
"the",
"dll",
"that",
"was",
"specified",
"to",
"the",
"class",
"decorator",
"."
] | [
"\"\"\"\n If the owner class is decorated with @HeaderClass , decorated function will be replaced by\n the corresponding function of the dll that was specified to the class\n decorator. If the owner class is not correctly decorated, TypeError is raised.\n\n -> return type: '_ctypes.FuncPtr'\n\n -> po... | [
{
"param": "func",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "func",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
0121895b4ea2a8e866cc02b91fda0f9eff85e1c2 | Jerem2360/multitools | multi_tools/data.py | [
"Unlicense"
] | Python | save | null | def save(self, name: str, object_):
"""
Save object_ to the registry.
"""
self._dict[name] = object |
Save object_ to the registry.
| Save object_ to the registry. | [
"Save",
"object_",
"to",
"the",
"registry",
"."
] | def save(self, name: str, object_):
self._dict[name] = object | [
"def",
"save",
"(",
"self",
",",
"name",
":",
"str",
",",
"object_",
")",
":",
"self",
".",
"_dict",
"[",
"name",
"]",
"=",
"object"
] | Save object_ to the registry. | [
"Save",
"object_",
"to",
"the",
"registry",
"."
] | [
"\"\"\"\n Save object_ to the registry.\n \"\"\""
] | [
{
"param": "self",
"type": null
},
{
"param": "name",
"type": "str"
},
{
"param": "object_",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "name",
"type": "str",
"docstring": null,
"docstring_tokens": ... |
7e64e94f0ac21bd47aeb72209e0563da924a96c5 | Jerem2360/multitools | multi_tools/system/memory.py | [
"Unlicense"
] | Python | _getaddress | int | def _getaddress(self) -> int:
"""
Get the numerical address self points to.
"""
pass |
Get the numerical address self points to.
| Get the numerical address self points to. | [
"Get",
"the",
"numerical",
"address",
"self",
"points",
"to",
"."
] | def _getaddress(self) -> int:
pass | [
"def",
"_getaddress",
"(",
"self",
")",
"->",
"int",
":",
"pass"
] | Get the numerical address self points to. | [
"Get",
"the",
"numerical",
"address",
"self",
"points",
"to",
"."
] | [
"\"\"\"\n Get the numerical address self points to.\n \"\"\""
] | [
{
"param": "self",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
7e64e94f0ac21bd47aeb72209e0563da924a96c5 | Jerem2360/multitools | multi_tools/system/memory.py | [
"Unlicense"
] | Python | address | <not_specific> | def address(self):
"""
The address of self, in form of an Address object.
"""
return Address(self._getaddress()) |
The address of self, in form of an Address object.
| The address of self, in form of an Address object. | [
"The",
"address",
"of",
"self",
"in",
"form",
"of",
"an",
"Address",
"object",
"."
] | def address(self):
return Address(self._getaddress()) | [
"def",
"address",
"(",
"self",
")",
":",
"return",
"Address",
"(",
"self",
".",
"_getaddress",
"(",
")",
")"
] | The address of self, in form of an Address object. | [
"The",
"address",
"of",
"self",
"in",
"form",
"of",
"an",
"Address",
"object",
"."
] | [
"\"\"\"\n The address of self, in form of an Address object.\n \"\"\""
] | [
{
"param": "self",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
e3b57520a6c8b8846f3f2d081c0ef511b80e8572 | Jerem2360/multitools | multi_tools/c/wrapper.py | [
"Unlicense"
] | Python | call_with_wrap | <not_specific> | def call_with_wrap(func, *args, **kwargs):
"""
Call an external function as
func(*args, *kwargs)
and return it's result.
Keyword arguments are converted to positional arguments and are
added to the end of the standard positional arguments.
"""
kwds = []
for key in kwargs:
kw... |
Call an external function as
func(*args, *kwargs)
and return it's result.
Keyword arguments are converted to positional arguments and are
added to the end of the standard positional arguments.
| Call an external function as
func(*args, *kwargs)
and return it's result.
Keyword arguments are converted to positional arguments and are
added to the end of the standard positional arguments. | [
"Call",
"an",
"external",
"function",
"as",
"func",
"(",
"*",
"args",
"*",
"kwargs",
")",
"and",
"return",
"it",
"'",
"s",
"result",
".",
"Keyword",
"arguments",
"are",
"converted",
"to",
"positional",
"arguments",
"and",
"are",
"added",
"to",
"the",
"en... | def call_with_wrap(func, *args, **kwargs):
kwds = []
for key in kwargs:
kwds.append(kwargs.get(key))
wrapped = TypeWrap(func, *args, *kwds)
return wrapped.ret | [
"def",
"call_with_wrap",
"(",
"func",
",",
"*",
"args",
",",
"**",
"kwargs",
")",
":",
"kwds",
"=",
"[",
"]",
"for",
"key",
"in",
"kwargs",
":",
"kwds",
".",
"append",
"(",
"kwargs",
".",
"get",
"(",
"key",
")",
")",
"wrapped",
"=",
"TypeWrap",
"... | Call an external function as
func(*args, *kwargs)
and return it's result. | [
"Call",
"an",
"external",
"function",
"as",
"func",
"(",
"*",
"args",
"*",
"kwargs",
")",
"and",
"return",
"it",
"'",
"s",
"result",
"."
] | [
"\"\"\"\n Call an external function as\n func(*args, *kwargs)\n and return it's result.\n\n Keyword arguments are converted to positional arguments and are\n added to the end of the standard positional arguments.\n \"\"\""
] | [
{
"param": "func",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "func",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
6033a57d24b48a895523d5b03310521edd8dff67 | sunlongbo/chromium | tools/metrics/md2xml.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | GetMetricsFromMdFile | <not_specific> | def GetMetricsFromMdFile(mdfile):
"""Returns an array of metrics parsed from the markdown file. See the top of
the file for documentation on the format of the markdown file.
"""
with open(mdfile) as f:
raw_md = f.read()
metrics = []
sections = re.split('\n---+\n', raw_md)
tag_pattern = re.compile('^\*... | Returns an array of metrics parsed from the markdown file. See the top of
the file for documentation on the format of the markdown file.
| Returns an array of metrics parsed from the markdown file. See the top of
the file for documentation on the format of the markdown file. | [
"Returns",
"an",
"array",
"of",
"metrics",
"parsed",
"from",
"the",
"markdown",
"file",
".",
"See",
"the",
"top",
"of",
"the",
"file",
"for",
"documentation",
"on",
"the",
"format",
"of",
"the",
"markdown",
"file",
"."
] | def GetMetricsFromMdFile(mdfile):
with open(mdfile) as f:
raw_md = f.read()
metrics = []
sections = re.split('\n---+\n', raw_md)
tag_pattern = re.compile('^\* ([^:]*): (.*)$')
for section in sections:
if len(section.strip()) == 0: break
lines = section.strip().split('\n')
header_match = re.mat... | [
"def",
"GetMetricsFromMdFile",
"(",
"mdfile",
")",
":",
"with",
"open",
"(",
"mdfile",
")",
"as",
"f",
":",
"raw_md",
"=",
"f",
".",
"read",
"(",
")",
"metrics",
"=",
"[",
"]",
"sections",
"=",
"re",
".",
"split",
"(",
"'\\n---+\\n'",
",",
"raw_md",
... | Returns an array of metrics parsed from the markdown file. | [
"Returns",
"an",
"array",
"of",
"metrics",
"parsed",
"from",
"the",
"markdown",
"file",
"."
] | [
"\"\"\"Returns an array of metrics parsed from the markdown file. See the top of\n the file for documentation on the format of the markdown file.\n \"\"\"",
"# The first line should have the header, containing the name of the metric."
] | [
{
"param": "mdfile",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "mdfile",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
605f2d6d18bdd46e6ec50c84f2fc5681ac06de36 | sunlongbo/chromium | third_party/zxcvbn-cpp/data-scripts/build_keyboard_adjacency_graphs.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | build_graph | <not_specific> | def build_graph(layout_str, slanted):
'''
builds an adjacency graph as a dictionary: {character: [adjacent_characters]}.
adjacent characters occur in a clockwise order.
for example:
* on qwerty layout, 'g' maps to ['fF', 'tT', 'yY', 'hH', 'bB', 'vV']
* on keypad layout, '7' maps to [None, None, ... |
builds an adjacency graph as a dictionary: {character: [adjacent_characters]}.
adjacent characters occur in a clockwise order.
for example:
* on qwerty layout, 'g' maps to ['fF', 'tT', 'yY', 'hH', 'bB', 'vV']
* on keypad layout, '7' maps to [None, None, None, '=', '8', '5', '4', None]
| builds an adjacency graph as a dictionary: {character: [adjacent_characters]}.
adjacent characters occur in a clockwise order. | [
"builds",
"an",
"adjacency",
"graph",
"as",
"a",
"dictionary",
":",
"{",
"character",
":",
"[",
"adjacent_characters",
"]",
"}",
".",
"adjacent",
"characters",
"occur",
"in",
"a",
"clockwise",
"order",
"."
] | def build_graph(layout_str, slanted):
position_table = {}
tokens = layout_str.split()
token_size = len(tokens[0])
x_unit = token_size + 1
adjacency_func = get_slanted_adjacent_coords if slanted else get_aligned_adjacent_coords
assert all(len(token) == token_size for token in tokens), 'token le... | [
"def",
"build_graph",
"(",
"layout_str",
",",
"slanted",
")",
":",
"position_table",
"=",
"{",
"}",
"tokens",
"=",
"layout_str",
".",
"split",
"(",
")",
"token_size",
"=",
"len",
"(",
"tokens",
"[",
"0",
"]",
")",
"x_unit",
"=",
"token_size",
"+",
"1",... | builds an adjacency graph as a dictionary: {character: [adjacent_characters]}. | [
"builds",
"an",
"adjacency",
"graph",
"as",
"a",
"dictionary",
":",
"{",
"character",
":",
"[",
"adjacent_characters",
"]",
"}",
"."
] | [
"'''\n builds an adjacency graph as a dictionary: {character: [adjacent_characters]}.\n adjacent characters occur in a clockwise order.\n for example:\n * on qwerty layout, 'g' maps to ['fF', 'tT', 'yY', 'hH', 'bB', 'vV']\n * on keypad layout, '7' maps to [None, None, None, '=', '8', '5', '4', None]\... | [
{
"param": "layout_str",
"type": null
},
{
"param": "slanted",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "layout_str",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "slanted",
"type": null,
"docstring": null,
"docstring_t... |
73703a1b8d04a74f5d6ba6c6823ead2420c80c4b | sunlongbo/chromium | tools/translation/helper/git_helper.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | list_grds_in_repository | <not_specific> | def list_grds_in_repository(repo_path):
"""Returns a list of all the grd files in the current git repository."""
# This works because git does its own glob expansion even though there is no
# shell to do it.
# TODO(meacer): This should use list_grds_in_repository() from the internal
# translate.... | Returns a list of all the grd files in the current git repository. | Returns a list of all the grd files in the current git repository. | [
"Returns",
"a",
"list",
"of",
"all",
"the",
"grd",
"files",
"in",
"the",
"current",
"git",
"repository",
"."
] | def list_grds_in_repository(repo_path):
output = subprocess.check_output([GIT, 'ls-files', '--', '*.grd'],
cwd=repo_path)
return output.decode('utf8').strip().splitlines() | [
"def",
"list_grds_in_repository",
"(",
"repo_path",
")",
":",
"output",
"=",
"subprocess",
".",
"check_output",
"(",
"[",
"GIT",
",",
"'ls-files'",
",",
"'--'",
",",
"'*.grd'",
"]",
",",
"cwd",
"=",
"repo_path",
")",
"return",
"output",
".",
"decode",
"(",... | Returns a list of all the grd files in the current git repository. | [
"Returns",
"a",
"list",
"of",
"all",
"the",
"grd",
"files",
"in",
"the",
"current",
"git",
"repository",
"."
] | [
"\"\"\"Returns a list of all the grd files in the current git repository.\"\"\"",
"# This works because git does its own glob expansion even though there is no",
"# shell to do it.",
"# TODO(meacer): This should use list_grds_in_repository() from the internal",
"# translate.py.",
"# Need to ... | [
{
"param": "repo_path",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "repo_path",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
73703a1b8d04a74f5d6ba6c6823ead2420c80c4b | sunlongbo/chromium | tools/translation/helper/git_helper.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | git_add | null | def git_add(files, repo_root):
"""Adds relative paths given in files to the current CL."""
# Upload in batches in order to not exceed command line length limit.
BATCH_SIZE = 50
added_count = 0
while added_count < len(files):
batch = files[added_count:added_count + BATCH_SIZE]
command = [GIT, 'add'] + ... | Adds relative paths given in files to the current CL. | Adds relative paths given in files to the current CL. | [
"Adds",
"relative",
"paths",
"given",
"in",
"files",
"to",
"the",
"current",
"CL",
"."
] | def git_add(files, repo_root):
BATCH_SIZE = 50
added_count = 0
while added_count < len(files):
batch = files[added_count:added_count + BATCH_SIZE]
command = [GIT, 'add'] + batch
subprocess.check_call(command, cwd=repo_root)
added_count += len(batch) | [
"def",
"git_add",
"(",
"files",
",",
"repo_root",
")",
":",
"BATCH_SIZE",
"=",
"50",
"added_count",
"=",
"0",
"while",
"added_count",
"<",
"len",
"(",
"files",
")",
":",
"batch",
"=",
"files",
"[",
"added_count",
":",
"added_count",
"+",
"BATCH_SIZE",
"]... | Adds relative paths given in files to the current CL. | [
"Adds",
"relative",
"paths",
"given",
"in",
"files",
"to",
"the",
"current",
"CL",
"."
] | [
"\"\"\"Adds relative paths given in files to the current CL.\"\"\"",
"# Upload in batches in order to not exceed command line length limit."
] | [
{
"param": "files",
"type": null
},
{
"param": "repo_root",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "files",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "repo_root",
"type": null,
"docstring": null,
"docstring_toke... |
13499d319dfb9c96beac5f8079fc8e2bf62fbf5d | sunlongbo/chromium | third_party/blink/renderer/bindings/scripts/web_idl/reference.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | create | <not_specific> | def create(self, identifier, debug_info=None):
"""
Creates a new instance of RefById.
Args:
identifier: An identifier to be resolved later.
debug_info: Where the reference is created, which is useful
especially when the reference is unreso... |
Creates a new instance of RefById.
Args:
identifier: An identifier to be resolved later.
debug_info: Where the reference is created, which is useful
especially when the reference is unresolvable.
| Creates a new instance of RefById.
Args:
identifier: An identifier to be resolved later.
debug_info: Where the reference is created, which is useful
especially when the reference is unresolvable. | [
"Creates",
"a",
"new",
"instance",
"of",
"RefById",
".",
"Args",
":",
"identifier",
":",
"An",
"identifier",
"to",
"be",
"resolved",
"later",
".",
"debug_info",
":",
"Where",
"the",
"reference",
"is",
"created",
"which",
"is",
"useful",
"especially",
"when",... | def create(self, identifier, debug_info=None):
assert not self._is_frozen
ref = RefById(
identifier,
debug_info=debug_info,
target_attrs=self._target_attrs,
target_attrs_with_priority=self._target_attrs_with_priority,
pass_key=_REF_BY_ID_PASS_K... | [
"def",
"create",
"(",
"self",
",",
"identifier",
",",
"debug_info",
"=",
"None",
")",
":",
"assert",
"not",
"self",
".",
"_is_frozen",
"ref",
"=",
"RefById",
"(",
"identifier",
",",
"debug_info",
"=",
"debug_info",
",",
"target_attrs",
"=",
"self",
".",
... | Creates a new instance of RefById. | [
"Creates",
"a",
"new",
"instance",
"of",
"RefById",
"."
] | [
"\"\"\"\n Creates a new instance of RefById.\n\n Args:\n identifier: An identifier to be resolved later.\n debug_info: Where the reference is created, which is useful\n especially when the reference is unresolvable.\n \"\"\""
] | [
{
"param": "self",
"type": null
},
{
"param": "identifier",
"type": null
},
{
"param": "debug_info",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "identifier",
"type": null,
"docstring": null,
"docstring_toke... |
13499d319dfb9c96beac5f8079fc8e2bf62fbf5d | sunlongbo/chromium | third_party/blink/renderer/bindings/scripts/web_idl/reference.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | init_subclass_instance | null | def init_subclass_instance(self, instance, identifier, debug_info=None):
"""
Initializes an instance of a subclass of RefById.
"""
assert type(instance) is not RefById
assert isinstance(instance, RefById)
assert not self._is_frozen
RefById.__init__(
in... |
Initializes an instance of a subclass of RefById.
| Initializes an instance of a subclass of RefById. | [
"Initializes",
"an",
"instance",
"of",
"a",
"subclass",
"of",
"RefById",
"."
] | def init_subclass_instance(self, instance, identifier, debug_info=None):
assert type(instance) is not RefById
assert isinstance(instance, RefById)
assert not self._is_frozen
RefById.__init__(
instance,
identifier,
debug_info=debug_info,
tar... | [
"def",
"init_subclass_instance",
"(",
"self",
",",
"instance",
",",
"identifier",
",",
"debug_info",
"=",
"None",
")",
":",
"assert",
"type",
"(",
"instance",
")",
"is",
"not",
"RefById",
"assert",
"isinstance",
"(",
"instance",
",",
"RefById",
")",
"assert"... | Initializes an instance of a subclass of RefById. | [
"Initializes",
"an",
"instance",
"of",
"a",
"subclass",
"of",
"RefById",
"."
] | [
"\"\"\"\n Initializes an instance of a subclass of RefById.\n \"\"\""
] | [
{
"param": "self",
"type": null
},
{
"param": "instance",
"type": null
},
{
"param": "identifier",
"type": null
},
{
"param": "debug_info",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "instance",
"type": null,
"docstring": null,
"docstring_tokens... |
13499d319dfb9c96beac5f8079fc8e2bf62fbf5d | sunlongbo/chromium | third_party/blink/renderer/bindings/scripts/web_idl/reference.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | for_each | null | def for_each(self, callback):
"""
Applies |callback| to all the references created by this factory.
You can no longer create a new reference.
Args:
callback: A callable that takes a reference as only the argument.
Return value is not used.
"""
... |
Applies |callback| to all the references created by this factory.
You can no longer create a new reference.
Args:
callback: A callable that takes a reference as only the argument.
Return value is not used.
| Applies |callback| to all the references created by this factory.
You can no longer create a new reference. | [
"Applies",
"|callback|",
"to",
"all",
"the",
"references",
"created",
"by",
"this",
"factory",
".",
"You",
"can",
"no",
"longer",
"create",
"a",
"new",
"reference",
"."
] | def for_each(self, callback):
assert callable(callback)
self._is_frozen = True
for ref in self._references:
callback(ref) | [
"def",
"for_each",
"(",
"self",
",",
"callback",
")",
":",
"assert",
"callable",
"(",
"callback",
")",
"self",
".",
"_is_frozen",
"=",
"True",
"for",
"ref",
"in",
"self",
".",
"_references",
":",
"callback",
"(",
"ref",
")"
] | Applies |callback| to all the references created by this factory. | [
"Applies",
"|callback|",
"to",
"all",
"the",
"references",
"created",
"by",
"this",
"factory",
"."
] | [
"\"\"\"\n Applies |callback| to all the references created by this factory.\n\n You can no longer create a new reference.\n\n Args:\n callback: A callable that takes a reference as only the argument.\n Return value is not used.\n \"\"\""
] | [
{
"param": "self",
"type": null
},
{
"param": "callback",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "callback",
"type": null,
"docstring": "A callable that takes a refe... |
56011d8d70c9ef96789f2d82f38944f5c9152ea4 | sunlongbo/chromium | third_party/blink/tools/blinkpy/style/patchreader.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | check | null | def check(self, patch_string):
"""Checks style in the given patch."""
patch_files = DiffParser(patch_string.splitlines()).files
for path, diff_file in patch_files.items():
line_numbers = diff_file.added_or_modified_line_numbers()
_log.debug('Found %s new or modified line... | Checks style in the given patch. | Checks style in the given patch. | [
"Checks",
"style",
"in",
"the",
"given",
"patch",
"."
] | def check(self, patch_string):
patch_files = DiffParser(patch_string.splitlines()).files
for path, diff_file in patch_files.items():
line_numbers = diff_file.added_or_modified_line_numbers()
_log.debug('Found %s new or modified lines in: %s',
len(line_numbe... | [
"def",
"check",
"(",
"self",
",",
"patch_string",
")",
":",
"patch_files",
"=",
"DiffParser",
"(",
"patch_string",
".",
"splitlines",
"(",
")",
")",
".",
"files",
"for",
"path",
",",
"diff_file",
"in",
"patch_files",
".",
"items",
"(",
")",
":",
"line_nu... | Checks style in the given patch. | [
"Checks",
"style",
"in",
"the",
"given",
"patch",
"."
] | [
"\"\"\"Checks style in the given patch.\"\"\"",
"# Don't check files which contain only deleted lines",
"# as they can never add style errors. However, mark them as",
"# processed so that we count up number of such files."
] | [
{
"param": "self",
"type": null
},
{
"param": "patch_string",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "patch_string",
"type": null,
"docstring": null,
"docstring_to... |
7091a85798ba3c9a751c7544d873f7e2fab26bdd | sunlongbo/chromium | tools/coverity/coverity.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | _ReadPassword | <not_specific> | def _ReadPassword(pwfilename):
"""Reads the coverity password in from a file where it was stashed"""
pwfile = open(pwfilename, 'r')
password = pwfile.readline()
pwfile.close()
return password.rstrip() | Reads the coverity password in from a file where it was stashed | Reads the coverity password in from a file where it was stashed | [
"Reads",
"the",
"coverity",
"password",
"in",
"from",
"a",
"file",
"where",
"it",
"was",
"stashed"
] | def _ReadPassword(pwfilename):
pwfile = open(pwfilename, 'r')
password = pwfile.readline()
pwfile.close()
return password.rstrip() | [
"def",
"_ReadPassword",
"(",
"pwfilename",
")",
":",
"pwfile",
"=",
"open",
"(",
"pwfilename",
",",
"'r'",
")",
"password",
"=",
"pwfile",
".",
"readline",
"(",
")",
"pwfile",
".",
"close",
"(",
")",
"return",
"password",
".",
"rstrip",
"(",
")"
] | Reads the coverity password in from a file where it was stashed | [
"Reads",
"the",
"coverity",
"password",
"in",
"from",
"a",
"file",
"where",
"it",
"was",
"stashed"
] | [
"\"\"\"Reads the coverity password in from a file where it was stashed\"\"\""
] | [
{
"param": "pwfilename",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "pwfilename",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
7091a85798ba3c9a751c7544d873f7e2fab26bdd | sunlongbo/chromium | tools/coverity/coverity.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | _RunCommand | <not_specific> | def _RunCommand(cmd, dry_run, shell=False, echo_cmd=True):
"""Runs the command if dry_run is false, otherwise just prints the command."""
if echo_cmd:
print(cmd)
if not dry_run:
return subprocess.call(cmd, shell=shell)
else:
return 0 | Runs the command if dry_run is false, otherwise just prints the command. | Runs the command if dry_run is false, otherwise just prints the command. | [
"Runs",
"the",
"command",
"if",
"dry_run",
"is",
"false",
"otherwise",
"just",
"prints",
"the",
"command",
"."
] | def _RunCommand(cmd, dry_run, shell=False, echo_cmd=True):
if echo_cmd:
print(cmd)
if not dry_run:
return subprocess.call(cmd, shell=shell)
else:
return 0 | [
"def",
"_RunCommand",
"(",
"cmd",
",",
"dry_run",
",",
"shell",
"=",
"False",
",",
"echo_cmd",
"=",
"True",
")",
":",
"if",
"echo_cmd",
":",
"print",
"(",
"cmd",
")",
"if",
"not",
"dry_run",
":",
"return",
"subprocess",
".",
"call",
"(",
"cmd",
",",
... | Runs the command if dry_run is false, otherwise just prints the command. | [
"Runs",
"the",
"command",
"if",
"dry_run",
"is",
"false",
"otherwise",
"just",
"prints",
"the",
"command",
"."
] | [
"\"\"\"Runs the command if dry_run is false, otherwise just prints the command.\"\"\""
] | [
{
"param": "cmd",
"type": null
},
{
"param": "dry_run",
"type": null
},
{
"param": "shell",
"type": null
},
{
"param": "echo_cmd",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "cmd",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "dry_run",
"type": null,
"docstring": null,
"docstring_tokens":... |
7091a85798ba3c9a751c7544d873f7e2fab26bdd | sunlongbo/chromium | tools/coverity/coverity.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | run_coverity | <not_specific> | def run_coverity(options, args):
"""Runs all the selected tests for the given build type and target."""
# Create the lock file to prevent another instance of this script from
# running.
lock_filename = os.path.join(options.source_dir, LOCK_FILE)
try:
lock_file = os.open(lock_filename,
... | Runs all the selected tests for the given build type and target. | Runs all the selected tests for the given build type and target. | [
"Runs",
"all",
"the",
"selected",
"tests",
"for",
"the",
"given",
"build",
"type",
"and",
"target",
"."
] | def run_coverity(options, args):
lock_filename = os.path.join(options.source_dir, LOCK_FILE)
try:
lock_file = os.open(lock_filename,
os.O_CREAT | os.O_EXCL | os.O_TRUNC | os.O_RDWR)
except OSError, err:
print('Failed to open lock file:\n ' + str(err))
return 1
os.write(lock_... | [
"def",
"run_coverity",
"(",
"options",
",",
"args",
")",
":",
"lock_filename",
"=",
"os",
".",
"path",
".",
"join",
"(",
"options",
".",
"source_dir",
",",
"LOCK_FILE",
")",
"try",
":",
"lock_file",
"=",
"os",
".",
"open",
"(",
"lock_filename",
",",
"o... | Runs all the selected tests for the given build type and target. | [
"Runs",
"all",
"the",
"selected",
"tests",
"for",
"the",
"given",
"build",
"type",
"and",
"target",
"."
] | [
"\"\"\"Runs all the selected tests for the given build type and target.\"\"\"",
"# Create the lock file to prevent another instance of this script from",
"# running.",
"# Write the pid of this script (the python.exe process) to the lock file.",
"# The coverity-password filename may have been a relative path... | [
{
"param": "options",
"type": null
},
{
"param": "args",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "options",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "args",
"type": null,
"docstring": null,
"docstring_tokens"... |
34302cf1f11c95763aac715c584b97fea82a8f14 | sunlongbo/chromium | third_party/blink/tools/blinkpy/common/system/platform_info.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | terminal_width | <not_specific> | def terminal_width(self):
"""Returns sys.maxint if the width cannot be determined."""
try:
if self.is_win():
# From http://code.activestate.com/recipes/440694-determine-size-of-console-window-on-windows/
from ctypes import windll, create_string_buffer
... | Returns sys.maxint if the width cannot be determined. | Returns sys.maxint if the width cannot be determined. | [
"Returns",
"sys",
".",
"maxint",
"if",
"the",
"width",
"cannot",
"be",
"determined",
"."
] | def terminal_width(self):
try:
if self.is_win():
from ctypes import windll, create_string_buffer
handle = windll.kernel32.GetStdHandle(-12)
console_screen_buffer_info = create_string_buffer(22)
if windll.kernel32.GetConsoleScreenBuffe... | [
"def",
"terminal_width",
"(",
"self",
")",
":",
"try",
":",
"if",
"self",
".",
"is_win",
"(",
")",
":",
"from",
"ctypes",
"import",
"windll",
",",
"create_string_buffer",
"handle",
"=",
"windll",
".",
"kernel32",
".",
"GetStdHandle",
"(",
"-",
"12",
")",... | Returns sys.maxint if the width cannot be determined. | [
"Returns",
"sys",
".",
"maxint",
"if",
"the",
"width",
"cannot",
"be",
"determined",
"."
] | [
"\"\"\"Returns sys.maxint if the width cannot be determined.\"\"\"",
"# From http://code.activestate.com/recipes/440694-determine-size-of-console-window-on-windows/",
"# -12 == stderr",
"# 22 == sizeof(console_screen_buffer_info)",
"# Note that we return 1 less than the width since writing into the rightmos... | [
{
"param": "self",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
293505160efd7d9281ecffe44c8045cfa2f49150 | sunlongbo/chromium | tools/python/google/path_utils.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | FindAncestor | <not_specific> | def FindAncestor(start_dir, ancestor):
"""Finds an ancestor dir in a path.
For example, FindAncestor('c:\foo\bar\baz', 'bar') would return
'c:\foo\bar'. Unlike FindUpward*, this only looks at direct path ancestors.
"""
start_dir = os.path.abspath(start_dir)
path = start_dir
while True:
(parent, tail... | Finds an ancestor dir in a path.
For example, FindAncestor('c:\foo\bar\baz', 'bar') would return
'c:\foo\bar'. Unlike FindUpward*, this only looks at direct path ancestors.
| Finds an ancestor dir in a path. | [
"Finds",
"an",
"ancestor",
"dir",
"in",
"a",
"path",
"."
] | def FindAncestor(start_dir, ancestor):
start_dir = os.path.abspath(start_dir)
path = start_dir
while True:
(parent, tail) = os.path.split(path)
if tail == ancestor:
return path
if not tail:
break
path = parent
raise PathNotFound("Unable to find ancestor %s in %s" % (ancestor, start_d... | [
"def",
"FindAncestor",
"(",
"start_dir",
",",
"ancestor",
")",
":",
"start_dir",
"=",
"os",
".",
"path",
".",
"abspath",
"(",
"start_dir",
")",
"path",
"=",
"start_dir",
"while",
"True",
":",
"(",
"parent",
",",
"tail",
")",
"=",
"os",
".",
"path",
"... | Finds an ancestor dir in a path. | [
"Finds",
"an",
"ancestor",
"dir",
"in",
"a",
"path",
"."
] | [
"\"\"\"Finds an ancestor dir in a path.\n\n For example, FindAncestor('c:\\foo\\bar\\baz', 'bar') would return\n 'c:\\foo\\bar'. Unlike FindUpward*, this only looks at direct path ancestors.\n \"\"\""
] | [
{
"param": "start_dir",
"type": null
},
{
"param": "ancestor",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "start_dir",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "ancestor",
"type": null,
"docstring": null,
"docstring_t... |
293505160efd7d9281ecffe44c8045cfa2f49150 | sunlongbo/chromium | tools/python/google/path_utils.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | FindUpwardParent | <not_specific> | def FindUpwardParent(start_dir, *desired_list):
"""Finds the desired object's parent, searching upward from the start_dir.
Searches start_dir and all its parents looking for the desired directory
or file, which may be given in one or more path components. Returns the
first directory in which the top desired pa... | Finds the desired object's parent, searching upward from the start_dir.
Searches start_dir and all its parents looking for the desired directory
or file, which may be given in one or more path components. Returns the
first directory in which the top desired path component was found, or raises
PathNotFound if i... | Finds the desired object's parent, searching upward from the start_dir.
Searches start_dir and all its parents looking for the desired directory
or file, which may be given in one or more path components. Returns the
first directory in which the top desired path component was found, or raises
PathNotFound if it wasn't. | [
"Finds",
"the",
"desired",
"object",
"'",
"s",
"parent",
"searching",
"upward",
"from",
"the",
"start_dir",
".",
"Searches",
"start_dir",
"and",
"all",
"its",
"parents",
"looking",
"for",
"the",
"desired",
"directory",
"or",
"file",
"which",
"may",
"be",
"gi... | def FindUpwardParent(start_dir, *desired_list):
desired_path = os.path.join(*desired_list)
last_dir = ''
cur_dir = start_dir
found_path = os.path.join(cur_dir, desired_path)
while not os.path.exists(found_path):
last_dir = cur_dir
cur_dir = os.path.dirname(cur_dir)
if last_dir == cur_dir:
ra... | [
"def",
"FindUpwardParent",
"(",
"start_dir",
",",
"*",
"desired_list",
")",
":",
"desired_path",
"=",
"os",
".",
"path",
".",
"join",
"(",
"*",
"desired_list",
")",
"last_dir",
"=",
"''",
"cur_dir",
"=",
"start_dir",
"found_path",
"=",
"os",
".",
"path",
... | Finds the desired object's parent, searching upward from the start_dir. | [
"Finds",
"the",
"desired",
"object",
"'",
"s",
"parent",
"searching",
"upward",
"from",
"the",
"start_dir",
"."
] | [
"\"\"\"Finds the desired object's parent, searching upward from the start_dir.\n\n Searches start_dir and all its parents looking for the desired directory\n or file, which may be given in one or more path components. Returns the\n first directory in which the top desired path component was found, or raises\n P... | [
{
"param": "start_dir",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "start_dir",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
293505160efd7d9281ecffe44c8045cfa2f49150 | sunlongbo/chromium | tools/python/google/path_utils.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | FindUpward | <not_specific> | def FindUpward(start_dir, *desired_list):
"""Returns a path to the desired directory or file, searching upward.
Searches start_dir and all its parents looking for the desired directory
or file, which may be given in one or more path components. Returns the full
path to the desired object, or raises PathNotFoun... | Returns a path to the desired directory or file, searching upward.
Searches start_dir and all its parents looking for the desired directory
or file, which may be given in one or more path components. Returns the full
path to the desired object, or raises PathNotFound if it wasn't found.
| Returns a path to the desired directory or file, searching upward.
Searches start_dir and all its parents looking for the desired directory
or file, which may be given in one or more path components. Returns the full
path to the desired object, or raises PathNotFound if it wasn't found. | [
"Returns",
"a",
"path",
"to",
"the",
"desired",
"directory",
"or",
"file",
"searching",
"upward",
".",
"Searches",
"start_dir",
"and",
"all",
"its",
"parents",
"looking",
"for",
"the",
"desired",
"directory",
"or",
"file",
"which",
"may",
"be",
"given",
"in"... | def FindUpward(start_dir, *desired_list):
parent = FindUpwardParent(start_dir, *desired_list)
return os.path.join(parent, *desired_list) | [
"def",
"FindUpward",
"(",
"start_dir",
",",
"*",
"desired_list",
")",
":",
"parent",
"=",
"FindUpwardParent",
"(",
"start_dir",
",",
"*",
"desired_list",
")",
"return",
"os",
".",
"path",
".",
"join",
"(",
"parent",
",",
"*",
"desired_list",
")"
] | Returns a path to the desired directory or file, searching upward. | [
"Returns",
"a",
"path",
"to",
"the",
"desired",
"directory",
"or",
"file",
"searching",
"upward",
"."
] | [
"\"\"\"Returns a path to the desired directory or file, searching upward.\n\n Searches start_dir and all its parents looking for the desired directory\n or file, which may be given in one or more path components. Returns the full\n path to the desired object, or raises PathNotFound if it wasn't found.\n \"\"\""... | [
{
"param": "start_dir",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "start_dir",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
293505160efd7d9281ecffe44c8045cfa2f49150 | sunlongbo/chromium | tools/python/google/path_utils.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | MaybeMakeDirectory | null | def MaybeMakeDirectory(*path):
"""Creates an entire path, if it doesn't already exist."""
file_path = os.path.join(*path)
try:
os.makedirs(file_path)
except OSError as e:
# errno.EEXIST is "File exists". If we see another error, re-raise.
if e.errno != errno.EEXIST:
raise | Creates an entire path, if it doesn't already exist. | Creates an entire path, if it doesn't already exist. | [
"Creates",
"an",
"entire",
"path",
"if",
"it",
"doesn",
"'",
"t",
"already",
"exist",
"."
] | def MaybeMakeDirectory(*path):
file_path = os.path.join(*path)
try:
os.makedirs(file_path)
except OSError as e:
if e.errno != errno.EEXIST:
raise | [
"def",
"MaybeMakeDirectory",
"(",
"*",
"path",
")",
":",
"file_path",
"=",
"os",
".",
"path",
".",
"join",
"(",
"*",
"path",
")",
"try",
":",
"os",
".",
"makedirs",
"(",
"file_path",
")",
"except",
"OSError",
"as",
"e",
":",
"if",
"e",
".",
"errno"... | Creates an entire path, if it doesn't already exist. | [
"Creates",
"an",
"entire",
"path",
"if",
"it",
"doesn",
"'",
"t",
"already",
"exist",
"."
] | [
"\"\"\"Creates an entire path, if it doesn't already exist.\"\"\"",
"# errno.EEXIST is \"File exists\". If we see another error, re-raise."
] | [] | {
"returns": [],
"raises": [],
"params": [],
"outlier_params": [],
"others": []
} |
29565b9d98473cc9137eb1abf0921186a02969d0 | sunlongbo/chromium | chrome/tools/build/win/makecab.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | WriteCab | null | def WriteCab(output_file, input_file, cab_stored_filename, input_size,
input_mtimestamp):
"""Reads data from input_file and stores its MSZIP-compressed data
in output_file. cab_stored_filename is the filename stored in the
cab file, input_size is the size of the input file, and input_mtimestamp
th... | Reads data from input_file and stores its MSZIP-compressed data
in output_file. cab_stored_filename is the filename stored in the
cab file, input_size is the size of the input file, and input_mtimestamp
the mtime timestamp of the input file (must be at least midnight 1980-1-1). | Reads data from input_file and stores its MSZIP-compressed data
in output_file. cab_stored_filename is the filename stored in the
cab file, input_size is the size of the input file, and input_mtimestamp
the mtime timestamp of the input file (must be at least midnight 1980-1-1). | [
"Reads",
"data",
"from",
"input_file",
"and",
"stores",
"its",
"MSZIP",
"-",
"compressed",
"data",
"in",
"output_file",
".",
"cab_stored_filename",
"is",
"the",
"filename",
"stored",
"in",
"the",
"cab",
"file",
"input_size",
"is",
"the",
"size",
"of",
"the",
... | def WriteCab(output_file, input_file, cab_stored_filename, input_size,
input_mtimestamp):
cffile_offset = 36 + 8
cfdata_offset = cffile_offset + 16 + len(cab_stored_filename) + 1
chunk_size = 1 << 15
num_chunks = int((input_size + chunk_size - 1) / chunk_size)
CFHEADER = ('<'
'4s'
'I'
... | [
"def",
"WriteCab",
"(",
"output_file",
",",
"input_file",
",",
"cab_stored_filename",
",",
"input_size",
",",
"input_mtimestamp",
")",
":",
"cffile_offset",
"=",
"36",
"+",
"8",
"cfdata_offset",
"=",
"cffile_offset",
"+",
"16",
"+",
"len",
"(",
"cab_stored_filen... | Reads data from input_file and stores its MSZIP-compressed data
in output_file. | [
"Reads",
"data",
"from",
"input_file",
"and",
"stores",
"its",
"MSZIP",
"-",
"compressed",
"data",
"in",
"output_file",
"."
] | [
"\"\"\"Reads data from input_file and stores its MSZIP-compressed data\n in output_file. cab_stored_filename is the filename stored in the\n cab file, input_size is the size of the input file, and input_mtimestamp\n the mtime timestamp of the input file (must be at least midnight 1980-1-1).\"\"\"",
"# Need to... | [
{
"param": "output_file",
"type": null
},
{
"param": "input_file",
"type": null
},
{
"param": "cab_stored_filename",
"type": null
},
{
"param": "input_size",
"type": null
},
{
"param": "input_mtimestamp",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "output_file",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "input_file",
"type": null,
"docstring": null,
"docstri... |
e69f00dcb68f82befc7bc4df39d4c6c9e85c425d | sunlongbo/chromium | components/policy/tools/template_writers/writers/plist_helper.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | GetPlistFriendlyName | <not_specific> | def GetPlistFriendlyName(name):
'''Transforms a string so that it will be suitable for use as
a pfm_name in the plist manifest file.
'''
return name.replace(' ', '_') | Transforms a string so that it will be suitable for use as
a pfm_name in the plist manifest file.
| Transforms a string so that it will be suitable for use as
a pfm_name in the plist manifest file. | [
"Transforms",
"a",
"string",
"so",
"that",
"it",
"will",
"be",
"suitable",
"for",
"use",
"as",
"a",
"pfm_name",
"in",
"the",
"plist",
"manifest",
"file",
"."
] | def GetPlistFriendlyName(name):
return name.replace(' ', '_') | [
"def",
"GetPlistFriendlyName",
"(",
"name",
")",
":",
"return",
"name",
".",
"replace",
"(",
"' '",
",",
"'_'",
")"
] | Transforms a string so that it will be suitable for use as
a pfm_name in the plist manifest file. | [
"Transforms",
"a",
"string",
"so",
"that",
"it",
"will",
"be",
"suitable",
"for",
"use",
"as",
"a",
"pfm_name",
"in",
"the",
"plist",
"manifest",
"file",
"."
] | [
"'''Transforms a string so that it will be suitable for use as\n a pfm_name in the plist manifest file.\n '''"
] | [
{
"param": "name",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "name",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
b795a64e0118606096ff570791d25aadbd76a0fc | sunlongbo/chromium | tools/metrics/actions/extract_actions_test.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | _GetProcessedAction | <not_specific> | def _GetProcessedAction(self, owner, description, obsolete,
not_user_triggered=NO_VALUE, new_actions=[],
comment=NO_VALUE):
"""Forms an actions XML string and returns it after processing.
It parses the original XML string, adds new user actions (if there is a... | Forms an actions XML string and returns it after processing.
It parses the original XML string, adds new user actions (if there is any),
and pretty prints it.
Args:
owner: the owner tag to be inserted in the original XML string.
description: the description tag to be inserted in the original X... | Forms an actions XML string and returns it after processing.
It parses the original XML string, adds new user actions (if there is any),
and pretty prints it. | [
"Forms",
"an",
"actions",
"XML",
"string",
"and",
"returns",
"it",
"after",
"processing",
".",
"It",
"parses",
"the",
"original",
"XML",
"string",
"adds",
"new",
"user",
"actions",
"(",
"if",
"there",
"is",
"any",
")",
"and",
"pretty",
"prints",
"it",
".... | def _GetProcessedAction(self, owner, description, obsolete,
not_user_triggered=NO_VALUE, new_actions=[],
comment=NO_VALUE):
current_xml = ACTIONS_XML.format(owners=owner, description=description,
obsolete=obsolete, comment=comm... | [
"def",
"_GetProcessedAction",
"(",
"self",
",",
"owner",
",",
"description",
",",
"obsolete",
",",
"not_user_triggered",
"=",
"NO_VALUE",
",",
"new_actions",
"=",
"[",
"]",
",",
"comment",
"=",
"NO_VALUE",
")",
":",
"current_xml",
"=",
"ACTIONS_XML",
".",
"f... | Forms an actions XML string and returns it after processing. | [
"Forms",
"an",
"actions",
"XML",
"string",
"and",
"returns",
"it",
"after",
"processing",
"."
] | [
"\"\"\"Forms an actions XML string and returns it after processing.\n\n It parses the original XML string, adds new user actions (if there is any),\n and pretty prints it.\n\n Args:\n owner: the owner tag to be inserted in the original XML string.\n description: the description tag to be inserted... | [
{
"param": "self",
"type": null
},
{
"param": "owner",
"type": null
},
{
"param": "description",
"type": null
},
{
"param": "obsolete",
"type": null
},
{
"param": "not_user_triggered",
"type": null
},
{
"param": "new_actions",
"type": null
},
{... | {
"returns": [
{
"docstring": "An updated and pretty-printed action XML string.",
"docstring_tokens": [
"An",
"updated",
"and",
"pretty",
"-",
"printed",
"action",
"XML",
"string",
"."
],
"type": null
}
]... |
b795a64e0118606096ff570791d25aadbd76a0fc | sunlongbo/chromium | tools/metrics/actions/extract_actions_test.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | _ExpandSuffixesInActionsXML | <not_specific> | def _ExpandSuffixesInActionsXML(self, actions_xml):
"""Parses the given actions XML, expands suffixes and pretty prints it.
Args:
actions_xml: actions XML string.
Returns:
An updated and pretty-printed actions XML string with suffixes expanded.
"""
actions_dict, comments, suffixes = ex... | Parses the given actions XML, expands suffixes and pretty prints it.
Args:
actions_xml: actions XML string.
Returns:
An updated and pretty-printed actions XML string with suffixes expanded.
| Parses the given actions XML, expands suffixes and pretty prints it. | [
"Parses",
"the",
"given",
"actions",
"XML",
"expands",
"suffixes",
"and",
"pretty",
"prints",
"it",
"."
] | def _ExpandSuffixesInActionsXML(self, actions_xml):
actions_dict, comments, suffixes = extract_actions.ParseActionFile(
actions_xml)
suffixes = []
for action in actions_dict.values():
action.from_suffix = False
return extract_actions.PrettyPrint(actions_dict, comments, suffixes) | [
"def",
"_ExpandSuffixesInActionsXML",
"(",
"self",
",",
"actions_xml",
")",
":",
"actions_dict",
",",
"comments",
",",
"suffixes",
"=",
"extract_actions",
".",
"ParseActionFile",
"(",
"actions_xml",
")",
"suffixes",
"=",
"[",
"]",
"for",
"action",
"in",
"actions... | Parses the given actions XML, expands suffixes and pretty prints it. | [
"Parses",
"the",
"given",
"actions",
"XML",
"expands",
"suffixes",
"and",
"pretty",
"prints",
"it",
"."
] | [
"\"\"\"Parses the given actions XML, expands suffixes and pretty prints it.\n\n Args:\n actions_xml: actions XML string.\n\n Returns:\n An updated and pretty-printed actions XML string with suffixes expanded.\n \"\"\"",
"# Clear suffixes and mark actions as not coming from suffixes, so that",
... | [
{
"param": "self",
"type": null
},
{
"param": "actions_xml",
"type": null
}
] | {
"returns": [
{
"docstring": "An updated and pretty-printed actions XML string with suffixes expanded.",
"docstring_tokens": [
"An",
"updated",
"and",
"pretty",
"-",
"printed",
"actions",
"XML",
"string",
"with",
... |
b795a64e0118606096ff570791d25aadbd76a0fc | sunlongbo/chromium | tools/metrics/actions/extract_actions_test.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | _PrettyPrintActionsXML | <not_specific> | def _PrettyPrintActionsXML(self, actions_xml):
"""Parses the given actions XML and pretty prints it.
Args:
actions_xml: actions XML string.
Returns:
A pretty-printed actions XML string.
"""
actions_dict, comments, suffixes = extract_actions.ParseActionFile(
actions_xml)
ret... | Parses the given actions XML and pretty prints it.
Args:
actions_xml: actions XML string.
Returns:
A pretty-printed actions XML string.
| Parses the given actions XML and pretty prints it. | [
"Parses",
"the",
"given",
"actions",
"XML",
"and",
"pretty",
"prints",
"it",
"."
] | def _PrettyPrintActionsXML(self, actions_xml):
actions_dict, comments, suffixes = extract_actions.ParseActionFile(
actions_xml)
return extract_actions.PrettyPrint(actions_dict, comments, suffixes) | [
"def",
"_PrettyPrintActionsXML",
"(",
"self",
",",
"actions_xml",
")",
":",
"actions_dict",
",",
"comments",
",",
"suffixes",
"=",
"extract_actions",
".",
"ParseActionFile",
"(",
"actions_xml",
")",
"return",
"extract_actions",
".",
"PrettyPrint",
"(",
"actions_dict... | Parses the given actions XML and pretty prints it. | [
"Parses",
"the",
"given",
"actions",
"XML",
"and",
"pretty",
"prints",
"it",
"."
] | [
"\"\"\"Parses the given actions XML and pretty prints it.\n\n Args:\n actions_xml: actions XML string.\n\n Returns:\n A pretty-printed actions XML string.\n \"\"\""
] | [
{
"param": "self",
"type": null
},
{
"param": "actions_xml",
"type": null
}
] | {
"returns": [
{
"docstring": "A pretty-printed actions XML string.",
"docstring_tokens": [
"A",
"pretty",
"-",
"printed",
"actions",
"XML",
"string",
"."
],
"type": null
}
],
"raises": [],
"params": [
{
"i... |
b795a64e0118606096ff570791d25aadbd76a0fc | sunlongbo/chromium | tools/metrics/actions/extract_actions_test.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | testSuffixPrettyPrint | null | def testSuffixPrettyPrint(self):
"""Tests that suffixes are preserved when pretty-printing."""
original_xml = """
<actions>
<action name="action1">
<owner>name1@chromium.org</owner>
<description>Description.</description>
</action>
<action name="action2">
<owner>name1@chromium.... | Tests that suffixes are preserved when pretty-printing. | Tests that suffixes are preserved when pretty-printing. | [
"Tests",
"that",
"suffixes",
"are",
"preserved",
"when",
"pretty",
"-",
"printing",
"."
] | def testSuffixPrettyPrint(self):
original_xml = """
<actions>
<action name="action1">
<owner>name1@chromium.org</owner>
<description>Description.</description>
</action>
<action name="action2">
<owner>name1@chromium.org</owner>
<description>Description.</description>
</ac... | [
"def",
"testSuffixPrettyPrint",
"(",
"self",
")",
":",
"original_xml",
"=",
"\"\"\"\n <actions>\n <action name=\"action1\">\n <owner>name1@chromium.org</owner>\n <description>Description.</description>\n </action>\n <action name=\"action2\">\n <owner>name1@chromium.org</ow... | Tests that suffixes are preserved when pretty-printing. | [
"Tests",
"that",
"suffixes",
"are",
"preserved",
"when",
"pretty",
"-",
"printing",
"."
] | [
"\"\"\"Tests that suffixes are preserved when pretty-printing.\"\"\""
] | [
{
"param": "self",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
306cd189587d6ac4d7a386946841f0df2a12d155 | sunlongbo/chromium | tools/linux/dump-static-initializers.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | Demangle | <not_specific> | def Demangle(self, sym):
"""Given mangled symbol |sym|, return its demangled form."""
self.cppfilt.stdin.write(sym + '\n')
self.cppfilt.stdin.flush()
return self.cppfilt.stdout.readline().strip() | Given mangled symbol |sym|, return its demangled form. | Given mangled symbol |sym|, return its demangled form. | [
"Given",
"mangled",
"symbol",
"|sym|",
"return",
"its",
"demangled",
"form",
"."
] | def Demangle(self, sym):
self.cppfilt.stdin.write(sym + '\n')
self.cppfilt.stdin.flush()
return self.cppfilt.stdout.readline().strip() | [
"def",
"Demangle",
"(",
"self",
",",
"sym",
")",
":",
"self",
".",
"cppfilt",
".",
"stdin",
".",
"write",
"(",
"sym",
"+",
"'\\n'",
")",
"self",
".",
"cppfilt",
".",
"stdin",
".",
"flush",
"(",
")",
"return",
"self",
".",
"cppfilt",
".",
"stdout",
... | Given mangled symbol |sym|, return its demangled form. | [
"Given",
"mangled",
"symbol",
"|sym|",
"return",
"its",
"demangled",
"form",
"."
] | [
"\"\"\"Given mangled symbol |sym|, return its demangled form.\"\"\""
] | [
{
"param": "self",
"type": null
},
{
"param": "sym",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "sym",
"type": null,
"docstring": null,
"docstring_tokens": []... |
306cd189587d6ac4d7a386946841f0df2a12d155 | sunlongbo/chromium | tools/linux/dump-static-initializers.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | QualifyFilenameAsProto | <not_specific> | def QualifyFilenameAsProto(filename):
"""Attempt to qualify a bare |filename| with a src-relative path, assuming it
is a protoc-generated file. If a single match is found, it is returned.
Otherwise the original filename is returned."""
if not IS_GIT_WORKSPACE:
return filename
match = protobuf_filename_re... | Attempt to qualify a bare |filename| with a src-relative path, assuming it
is a protoc-generated file. If a single match is found, it is returned.
Otherwise the original filename is returned. | Attempt to qualify a bare |filename| with a src-relative path, assuming it
is a protoc-generated file. If a single match is found, it is returned.
Otherwise the original filename is returned. | [
"Attempt",
"to",
"qualify",
"a",
"bare",
"|filename|",
"with",
"a",
"src",
"-",
"relative",
"path",
"assuming",
"it",
"is",
"a",
"protoc",
"-",
"generated",
"file",
".",
"If",
"a",
"single",
"match",
"is",
"found",
"it",
"is",
"returned",
".",
"Otherwise... | def QualifyFilenameAsProto(filename):
if not IS_GIT_WORKSPACE:
return filename
match = protobuf_filename_re.match(filename)
if not match:
return filename
basename = match.groups(0)
cmd = ['git', 'ls-files', '--', '*/%s.proto' % basename]
gitlsfiles = subprocess.Popen(cmd,
... | [
"def",
"QualifyFilenameAsProto",
"(",
"filename",
")",
":",
"if",
"not",
"IS_GIT_WORKSPACE",
":",
"return",
"filename",
"match",
"=",
"protobuf_filename_re",
".",
"match",
"(",
"filename",
")",
"if",
"not",
"match",
":",
"return",
"filename",
"basename",
"=",
... | Attempt to qualify a bare |filename| with a src-relative path, assuming it
is a protoc-generated file. | [
"Attempt",
"to",
"qualify",
"a",
"bare",
"|filename|",
"with",
"a",
"src",
"-",
"relative",
"path",
"assuming",
"it",
"is",
"a",
"protoc",
"-",
"generated",
"file",
"."
] | [
"\"\"\"Attempt to qualify a bare |filename| with a src-relative path, assuming it\n is a protoc-generated file. If a single match is found, it is returned.\n Otherwise the original filename is returned.\"\"\"",
"# Multiple hits, can't help."
] | [
{
"param": "filename",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "filename",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
306cd189587d6ac4d7a386946841f0df2a12d155 | sunlongbo/chromium | tools/linux/dump-static-initializers.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | QualifyFilename | <not_specific> | def QualifyFilename(filename, symbol):
"""Given a bare filename and a symbol that occurs in it, attempt to qualify
it with a src-relative path. If more than one file matches, return the
original filename."""
if not IS_GIT_WORKSPACE:
return filename
match = symbol_code_name_re.match(symbol)
if not match... | Given a bare filename and a symbol that occurs in it, attempt to qualify
it with a src-relative path. If more than one file matches, return the
original filename. | Given a bare filename and a symbol that occurs in it, attempt to qualify
it with a src-relative path. If more than one file matches, return the
original filename. | [
"Given",
"a",
"bare",
"filename",
"and",
"a",
"symbol",
"that",
"occurs",
"in",
"it",
"attempt",
"to",
"qualify",
"it",
"with",
"a",
"src",
"-",
"relative",
"path",
".",
"If",
"more",
"than",
"one",
"file",
"matches",
"return",
"the",
"original",
"filena... | def QualifyFilename(filename, symbol):
if not IS_GIT_WORKSPACE:
return filename
match = symbol_code_name_re.match(symbol)
if not match:
return filename
symbol = match.group(1)
cmd = ['git', 'grep', '-l', symbol, '--', '*/' + filename]
gitgrep = subprocess.Popen(cmd,
stdo... | [
"def",
"QualifyFilename",
"(",
"filename",
",",
"symbol",
")",
":",
"if",
"not",
"IS_GIT_WORKSPACE",
":",
"return",
"filename",
"match",
"=",
"symbol_code_name_re",
".",
"match",
"(",
"symbol",
")",
"if",
"not",
"match",
":",
"return",
"filename",
"symbol",
... | Given a bare filename and a symbol that occurs in it, attempt to qualify
it with a src-relative path. | [
"Given",
"a",
"bare",
"filename",
"and",
"a",
"symbol",
"that",
"occurs",
"in",
"it",
"attempt",
"to",
"qualify",
"it",
"with",
"a",
"src",
"-",
"relative",
"path",
"."
] | [
"\"\"\"Given a bare filename and a symbol that occurs in it, attempt to qualify\n it with a src-relative path. If more than one file matches, return the\n original filename.\"\"\"",
"# More than one candidate; return bare filename."
] | [
{
"param": "filename",
"type": null
},
{
"param": "symbol",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "filename",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "symbol",
"type": null,
"docstring": null,
"docstring_toke... |
306cd189587d6ac4d7a386946841f0df2a12d155 | sunlongbo/chromium | tools/linux/dump-static-initializers.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | ParseNmLine | <not_specific> | def ParseNmLine(line):
"""Parse static initializers from a line of nm output.
Given a line of nm output, parse static initializers as a
(file, start, size, symbol) tuple."""
match = nm_re.match(line)
if match:
addr, size, prefix, filename = match.groups()
return (filename, int(addr, 16), int(size, 16... | Parse static initializers from a line of nm output.
Given a line of nm output, parse static initializers as a
(file, start, size, symbol) tuple. | Parse static initializers from a line of nm output.
Given a line of nm output, parse static initializers as a
(file, start, size, symbol) tuple. | [
"Parse",
"static",
"initializers",
"from",
"a",
"line",
"of",
"nm",
"output",
".",
"Given",
"a",
"line",
"of",
"nm",
"output",
"parse",
"static",
"initializers",
"as",
"a",
"(",
"file",
"start",
"size",
"symbol",
")",
"tuple",
"."
] | def ParseNmLine(line):
match = nm_re.match(line)
if match:
addr, size, prefix, filename = match.groups()
return (filename, int(addr, 16), int(size, 16), prefix+filename) | [
"def",
"ParseNmLine",
"(",
"line",
")",
":",
"match",
"=",
"nm_re",
".",
"match",
"(",
"line",
")",
"if",
"match",
":",
"addr",
",",
"size",
",",
"prefix",
",",
"filename",
"=",
"match",
".",
"groups",
"(",
")",
"return",
"(",
"filename",
",",
"int... | Parse static initializers from a line of nm output. | [
"Parse",
"static",
"initializers",
"from",
"a",
"line",
"of",
"nm",
"output",
"."
] | [
"\"\"\"Parse static initializers from a line of nm output.\n\n Given a line of nm output, parse static initializers as a\n (file, start, size, symbol) tuple.\"\"\""
] | [
{
"param": "line",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "line",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
306cd189587d6ac4d7a386946841f0df2a12d155 | sunlongbo/chromium | tools/linux/dump-static-initializers.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | ParseNm | null | def ParseNm(toolchain, binary):
"""Yield static initializers for the given binary.
Given a binary, yield static initializers as (file, start, size, symbol)
tuples."""
nm = subprocess.Popen([toolchain + 'nm', '-S', binary],
stdout=subprocess.PIPE,
universal_newlin... | Yield static initializers for the given binary.
Given a binary, yield static initializers as (file, start, size, symbol)
tuples. | Yield static initializers for the given binary.
Given a binary, yield static initializers as (file, start, size, symbol)
tuples. | [
"Yield",
"static",
"initializers",
"for",
"the",
"given",
"binary",
".",
"Given",
"a",
"binary",
"yield",
"static",
"initializers",
"as",
"(",
"file",
"start",
"size",
"symbol",
")",
"tuples",
"."
] | def ParseNm(toolchain, binary):
nm = subprocess.Popen([toolchain + 'nm', '-S', binary],
stdout=subprocess.PIPE,
universal_newlines=True)
for line in nm.stdout:
parse = ParseNmLine(line)
if parse:
yield parse | [
"def",
"ParseNm",
"(",
"toolchain",
",",
"binary",
")",
":",
"nm",
"=",
"subprocess",
".",
"Popen",
"(",
"[",
"toolchain",
"+",
"'nm'",
",",
"'-S'",
",",
"binary",
"]",
",",
"stdout",
"=",
"subprocess",
".",
"PIPE",
",",
"universal_newlines",
"=",
"Tru... | Yield static initializers for the given binary. | [
"Yield",
"static",
"initializers",
"for",
"the",
"given",
"binary",
"."
] | [
"\"\"\"Yield static initializers for the given binary.\n\n Given a binary, yield static initializers as (file, start, size, symbol)\n tuples.\"\"\""
] | [
{
"param": "toolchain",
"type": null
},
{
"param": "binary",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "toolchain",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "binary",
"type": null,
"docstring": null,
"docstring_tok... |
306cd189587d6ac4d7a386946841f0df2a12d155 | sunlongbo/chromium | tools/linux/dump-static-initializers.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | ExtractSymbolReferences | <not_specific> | def ExtractSymbolReferences(toolchain, binary, start, end, symbol):
"""Given a span of addresses, returns symbol references from disassembly."""
cmd = [toolchain + 'objdump', binary, '--disassemble',
'--start-address=0x%x' % start, '--stop-address=0x%x' % end]
objdump = subprocess.Popen(cmd,
... | Given a span of addresses, returns symbol references from disassembly. | Given a span of addresses, returns symbol references from disassembly. | [
"Given",
"a",
"span",
"of",
"addresses",
"returns",
"symbol",
"references",
"from",
"disassembly",
"."
] | def ExtractSymbolReferences(toolchain, binary, start, end, symbol):
cmd = [toolchain + 'objdump', binary, '--disassemble',
'--start-address=0x%x' % start, '--stop-address=0x%x' % end]
objdump = subprocess.Popen(cmd,
stdout=subprocess.PIPE,
universal... | [
"def",
"ExtractSymbolReferences",
"(",
"toolchain",
",",
"binary",
",",
"start",
",",
"end",
",",
"symbol",
")",
":",
"cmd",
"=",
"[",
"toolchain",
"+",
"'objdump'",
",",
"binary",
",",
"'--disassemble'",
",",
"'--start-address=0x%x'",
"%",
"start",
",",
"'-... | Given a span of addresses, returns symbol references from disassembly. | [
"Given",
"a",
"span",
"of",
"addresses",
"returns",
"symbol",
"references",
"from",
"disassembly",
"."
] | [
"\"\"\"Given a span of addresses, returns symbol references from disassembly.\"\"\"",
"# Ignore these, they are uninformative.",
"# Probably a relative jump within this function."
] | [
{
"param": "toolchain",
"type": null
},
{
"param": "binary",
"type": null
},
{
"param": "start",
"type": null
},
{
"param": "end",
"type": null
},
{
"param": "symbol",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "toolchain",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "binary",
"type": null,
"docstring": null,
"docstring_tok... |
3afb8a2217e32e39a448ffb123074a995e7c6767 | sunlongbo/chromium | tools/metrics/histograms/print_expanded_histograms.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | ConstructHistogram | <not_specific> | def ConstructHistogram(doc, name, histogram_dict):
"""Constructs a histogram node based on the |histogram_dict|."""
histogram = doc.createElement('histogram')
# Set histogram node attributes.
histogram.setAttribute('name', name)
if 'enum' in histogram_dict:
histogram.setAttribute('enum', histogram_dict['e... | Constructs a histogram node based on the |histogram_dict|. | Constructs a histogram node based on the |histogram_dict|. | [
"Constructs",
"a",
"histogram",
"node",
"based",
"on",
"the",
"|histogram_dict|",
"."
] | def ConstructHistogram(doc, name, histogram_dict):
histogram = doc.createElement('histogram')
histogram.setAttribute('name', name)
if 'enum' in histogram_dict:
histogram.setAttribute('enum', histogram_dict['enum']['name'])
else:
histogram.setAttribute('units', histogram_dict['units'])
if 'expires_afte... | [
"def",
"ConstructHistogram",
"(",
"doc",
",",
"name",
",",
"histogram_dict",
")",
":",
"histogram",
"=",
"doc",
".",
"createElement",
"(",
"'histogram'",
")",
"histogram",
".",
"setAttribute",
"(",
"'name'",
",",
"name",
")",
"if",
"'enum'",
"in",
"histogram... | Constructs a histogram node based on the |histogram_dict|. | [
"Constructs",
"a",
"histogram",
"node",
"based",
"on",
"the",
"|histogram_dict|",
"."
] | [
"\"\"\"Constructs a histogram node based on the |histogram_dict|.\"\"\"",
"# Set histogram node attributes.",
"# Populate the obsolete node.",
"# Populate owner nodes.",
"# Populate the summary nodes."
] | [
{
"param": "doc",
"type": null
},
{
"param": "name",
"type": null
},
{
"param": "histogram_dict",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "doc",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "name",
"type": null,
"docstring": null,
"docstring_tokens": []... |
6f59c85dea4d5161c786abc30abc7b17da832657 | sunlongbo/chromium | tools/cr/main.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | Main | <not_specific> | def Main():
"""Chromium cr tool main function.
This is the main entry point of the cr tool, it finds and loads all the
plugins, creates the context and then activates and runs the specified
command.
"""
# Add the users plugin dir to the cr.auto.user package scan
user_path = os.path.expanduser(os.path.jo... | Chromium cr tool main function.
This is the main entry point of the cr tool, it finds and loads all the
plugins, creates the context and then activates and runs the specified
command.
| Chromium cr tool main function.
This is the main entry point of the cr tool, it finds and loads all the
plugins, creates the context and then activates and runs the specified
command. | [
"Chromium",
"cr",
"tool",
"main",
"function",
".",
"This",
"is",
"the",
"main",
"entry",
"point",
"of",
"the",
"cr",
"tool",
"it",
"finds",
"and",
"loads",
"all",
"the",
"plugins",
"creates",
"the",
"context",
"and",
"then",
"activates",
"and",
"runs",
"... | def Main():
user_path = os.path.expanduser(os.path.join('~', '.config', 'cr'))
cr.auto.user.__path__.append(user_path)
cr.loader.Scan()
with cr.base.context.Create(
description='The chrome dev build tool.',
epilog='Contact ' + _CONTACT + ' if you have issues with this tool.',
) as context:
... | [
"def",
"Main",
"(",
")",
":",
"user_path",
"=",
"os",
".",
"path",
".",
"expanduser",
"(",
"os",
".",
"path",
".",
"join",
"(",
"'~'",
",",
"'.config'",
",",
"'cr'",
")",
")",
"cr",
".",
"auto",
".",
"user",
".",
"__path__",
".",
"append",
"(",
... | Chromium cr tool main function. | [
"Chromium",
"cr",
"tool",
"main",
"function",
"."
] | [
"\"\"\"Chromium cr tool main function.\n\n This is the main entry point of the cr tool, it finds and loads all the\n plugins, creates the context and then activates and runs the specified\n command.\n \"\"\"",
"# Add the users plugin dir to the cr.auto.user package scan",
"# Build the command context",
"#... | [] | {
"returns": [],
"raises": [],
"params": [],
"outlier_params": [],
"others": []
} |
6f7233a0366b3b06ea258bfa7228b0b169e78530 | sunlongbo/chromium | components/policy/tools/template_writers/writers/adml_writer.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | GetWriter | <not_specific> | def GetWriter(config):
'''Factory method for instanciating the ADMLWriter. Every Writer needs a
GetWriter method because the TemplateFormatter uses this method to
instantiate a Writer.
'''
return ADMLWriter(['win', 'win7'], config) | Factory method for instanciating the ADMLWriter. Every Writer needs a
GetWriter method because the TemplateFormatter uses this method to
instantiate a Writer.
| Factory method for instanciating the ADMLWriter. Every Writer needs a
GetWriter method because the TemplateFormatter uses this method to
instantiate a Writer. | [
"Factory",
"method",
"for",
"instanciating",
"the",
"ADMLWriter",
".",
"Every",
"Writer",
"needs",
"a",
"GetWriter",
"method",
"because",
"the",
"TemplateFormatter",
"uses",
"this",
"method",
"to",
"instantiate",
"a",
"Writer",
"."
] | def GetWriter(config):
return ADMLWriter(['win', 'win7'], config) | [
"def",
"GetWriter",
"(",
"config",
")",
":",
"return",
"ADMLWriter",
"(",
"[",
"'win'",
",",
"'win7'",
"]",
",",
"config",
")"
] | Factory method for instanciating the ADMLWriter. | [
"Factory",
"method",
"for",
"instanciating",
"the",
"ADMLWriter",
"."
] | [
"'''Factory method for instanciating the ADMLWriter. Every Writer needs a\n GetWriter method because the TemplateFormatter uses this method to\n instantiate a Writer.\n '''"
] | [
{
"param": "config",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "config",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
6f7233a0366b3b06ea258bfa7228b0b169e78530 | sunlongbo/chromium | components/policy/tools/template_writers/writers/adml_writer.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | BeginPolicyGroup | null | def BeginPolicyGroup(self, group):
'''Generates ADML elements for a Policy-Group. For each Policy-Group two
ADML "string" elements are added to the string-table. One contains the
caption of the Policy-Group and the other a description. A Policy-Group also
requires an ADML "presentation" element that mus... | Generates ADML elements for a Policy-Group. For each Policy-Group two
ADML "string" elements are added to the string-table. One contains the
caption of the Policy-Group and the other a description. A Policy-Group also
requires an ADML "presentation" element that must be added to the
presentation-table. ... | Generates ADML elements for a Policy-Group. For each Policy-Group two
ADML "string" elements are added to the string-table. One contains the
caption of the Policy-Group and the other a description. A Policy-Group also
requires an ADML "presentation" element that must be added to the
presentation-table. The "presentatio... | [
"Generates",
"ADML",
"elements",
"for",
"a",
"Policy",
"-",
"Group",
".",
"For",
"each",
"Policy",
"-",
"Group",
"two",
"ADML",
"\"",
"string",
"\"",
"elements",
"are",
"added",
"to",
"the",
"string",
"-",
"table",
".",
"One",
"contains",
"the",
"caption... | def BeginPolicyGroup(self, group):
self._AddString(group['name'] + '_group', group['caption']) | [
"def",
"BeginPolicyGroup",
"(",
"self",
",",
"group",
")",
":",
"self",
".",
"_AddString",
"(",
"group",
"[",
"'name'",
"]",
"+",
"'_group'",
",",
"group",
"[",
"'caption'",
"]",
")"
] | Generates ADML elements for a Policy-Group. | [
"Generates",
"ADML",
"elements",
"for",
"a",
"Policy",
"-",
"Group",
"."
] | [
"'''Generates ADML elements for a Policy-Group. For each Policy-Group two\n ADML \"string\" elements are added to the string-table. One contains the\n caption of the Policy-Group and the other a description. A Policy-Group also\n requires an ADML \"presentation\" element that must be added to the\n pres... | [
{
"param": "self",
"type": null
},
{
"param": "group",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "group",
"type": null,
"docstring": "The Policy-Group to generate AD... |
6f7233a0366b3b06ea258bfa7228b0b169e78530 | sunlongbo/chromium | components/policy/tools/template_writers/writers/adml_writer.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | _AddBaseStrings | null | def _AddBaseStrings(self):
''' Adds ADML "string" elements to the string-table that are referenced by
the ADMX file but not related to any specific Policy-Group or Policy.
'''
self._AddString(self.config['win_supported_os'],
self.messages['win_supported_all']['text'])
self._AddSt... | Adds ADML "string" elements to the string-table that are referenced by
the ADMX file but not related to any specific Policy-Group or Policy.
| Adds ADML "string" elements to the string-table that are referenced by
the ADMX file but not related to any specific Policy-Group or Policy. | [
"Adds",
"ADML",
"\"",
"string",
"\"",
"elements",
"to",
"the",
"string",
"-",
"table",
"that",
"are",
"referenced",
"by",
"the",
"ADMX",
"file",
"but",
"not",
"related",
"to",
"any",
"specific",
"Policy",
"-",
"Group",
"or",
"Policy",
"."
] | def _AddBaseStrings(self):
self._AddString(self.config['win_supported_os'],
self.messages['win_supported_all']['text'])
self._AddString(self.config['win_supported_os_win7'],
self.messages['win_supported_win7']['text'])
categories = self.winconfig['mandatory_category_p... | [
"def",
"_AddBaseStrings",
"(",
"self",
")",
":",
"self",
".",
"_AddString",
"(",
"self",
".",
"config",
"[",
"'win_supported_os'",
"]",
",",
"self",
".",
"messages",
"[",
"'win_supported_all'",
"]",
"[",
"'text'",
"]",
")",
"self",
".",
"_AddString",
"(",
... | Adds ADML "string" elements to the string-table that are referenced by
the ADMX file but not related to any specific Policy-Group or Policy. | [
"Adds",
"ADML",
"\"",
"string",
"\"",
"elements",
"to",
"the",
"string",
"-",
"table",
"that",
"are",
"referenced",
"by",
"the",
"ADMX",
"file",
"but",
"not",
"related",
"to",
"any",
"specific",
"Policy",
"-",
"Group",
"or",
"Policy",
"."
] | [
"''' Adds ADML \"string\" elements to the string-table that are referenced by\n the ADMX file but not related to any specific Policy-Group or Policy.\n '''",
"# Replace {...} by localized messages."
] | [
{
"param": "self",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
6f7233a0366b3b06ea258bfa7228b0b169e78530 | sunlongbo/chromium | components/policy/tools/template_writers/writers/adml_writer.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | _GetExampleValueText | <not_specific> | def _GetExampleValueText(self, policy):
'''Generates a string that describes the example value, if needed.
Returns None if no string is needed. For instance, if the setting is a
boolean, the user can only select true or false, so example text is not
useful.'''
example_value = policy.get('example_val... | Generates a string that describes the example value, if needed.
Returns None if no string is needed. For instance, if the setting is a
boolean, the user can only select true or false, so example text is not
useful. | Generates a string that describes the example value, if needed.
Returns None if no string is needed. For instance, if the setting is a
boolean, the user can only select true or false, so example text is not
useful. | [
"Generates",
"a",
"string",
"that",
"describes",
"the",
"example",
"value",
"if",
"needed",
".",
"Returns",
"None",
"if",
"no",
"string",
"is",
"needed",
".",
"For",
"instance",
"if",
"the",
"setting",
"is",
"a",
"boolean",
"the",
"user",
"can",
"only",
... | def _GetExampleValueText(self, policy):
example_value = policy.get('example_value')
if not example_value:
return None
if isinstance(example_value, str):
return self.GetLocalizedMessage('example_value') + ' ' + example_value
if isinstance(example_value, dict):
value_as_text = json.dumps... | [
"def",
"_GetExampleValueText",
"(",
"self",
",",
"policy",
")",
":",
"example_value",
"=",
"policy",
".",
"get",
"(",
"'example_value'",
")",
"if",
"not",
"example_value",
":",
"return",
"None",
"if",
"isinstance",
"(",
"example_value",
",",
"str",
")",
":",... | Generates a string that describes the example value, if needed. | [
"Generates",
"a",
"string",
"that",
"describes",
"the",
"example",
"value",
"if",
"needed",
"."
] | [
"'''Generates a string that describes the example value, if needed.\n Returns None if no string is needed. For instance, if the setting is a\n boolean, the user can only select true or false, so example text is not\n useful.'''",
"# If there is no example_value, we show nothing.",
"# Strings are simple... | [
{
"param": "self",
"type": null
},
{
"param": "policy",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "policy",
"type": null,
"docstring": null,
"docstring_tokens":... |
0576e71f80c72972f1f71956d38ab7aa05d4290b | sunlongbo/chromium | components/autofill/content/renderer/PRESUBMIT.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | _CheckNoDirectPasswordCalls | <not_specific> | def _CheckNoDirectPasswordCalls(input_api, output_api):
"""Checks that no files call IsPasswordField() or FormControlType()."""
pattern = input_api.re.compile(
r'(IsPasswordField|FormControlType)\(\)',
input_api.re.MULTILINE)
files = []
for f in input_api.AffectedSourceFiles(input_api.FilterSourceFi... | Checks that no files call IsPasswordField() or FormControlType(). | Checks that no files call IsPasswordField() or FormControlType(). | [
"Checks",
"that",
"no",
"files",
"call",
"IsPasswordField",
"()",
"or",
"FormControlType",
"()",
"."
] | def _CheckNoDirectPasswordCalls(input_api, output_api):
pattern = input_api.re.compile(
r'(IsPasswordField|FormControlType)\(\)',
input_api.re.MULTILINE)
files = []
for f in input_api.AffectedSourceFiles(input_api.FilterSourceFile):
if (f.LocalPath().startswith('components/autofill/content/rendere... | [
"def",
"_CheckNoDirectPasswordCalls",
"(",
"input_api",
",",
"output_api",
")",
":",
"pattern",
"=",
"input_api",
".",
"re",
".",
"compile",
"(",
"r'(IsPasswordField|FormControlType)\\(\\)'",
",",
"input_api",
".",
"re",
".",
"MULTILINE",
")",
"files",
"=",
"[",
... | Checks that no files call IsPasswordField() or FormControlType(). | [
"Checks",
"that",
"no",
"files",
"call",
"IsPasswordField",
"()",
"or",
"FormControlType",
"()",
"."
] | [
"\"\"\"Checks that no files call IsPasswordField() or FormControlType().\"\"\""
] | [
{
"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... |
0576e71f80c72972f1f71956d38ab7aa05d4290b | sunlongbo/chromium | components/autofill/content/renderer/PRESUBMIT.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | _CommonChecks | <not_specific> | def _CommonChecks(input_api, output_api):
"""Checks common to both upload and commit."""
results = []
results.extend(_CheckNoDirectPasswordCalls(input_api, output_api))
return results | Checks common to both upload and commit. | Checks common to both upload and commit. | [
"Checks",
"common",
"to",
"both",
"upload",
"and",
"commit",
"."
] | def _CommonChecks(input_api, output_api):
results = []
results.extend(_CheckNoDirectPasswordCalls(input_api, output_api))
return results | [
"def",
"_CommonChecks",
"(",
"input_api",
",",
"output_api",
")",
":",
"results",
"=",
"[",
"]",
"results",
".",
"extend",
"(",
"_CheckNoDirectPasswordCalls",
"(",
"input_api",
",",
"output_api",
")",
")",
"return",
"results"
] | Checks common to both upload and commit. | [
"Checks",
"common",
"to",
"both",
"upload",
"and",
"commit",
"."
] | [
"\"\"\"Checks common to both upload and commit.\"\"\""
] | [
{
"param": "input_api",
"type": null
},
{
"param": "output_api",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "input_api",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "output_api",
"type": null,
"docstring": null,
"docstring... |
059be025711dcca5605032f817b06cf92729826b | sunlongbo/chromium | tools/android/modularization/owners/owners_dir_metadata.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | read_raw_dir_metadata | Dict | def read_raw_dir_metadata(chromium_root: str, dirmd_path: str) -> Dict:
'''Runs all DIR_METADATA files with dirmd and returns a dict of raw data.'''
raw_str: str = subprocess_utils.run_command(
[dirmd_path, 'read', chromium_root])
raw_dict: Dict = json.loads(raw_str)
return raw_dict['dirs'] | Runs all DIR_METADATA files with dirmd and returns a dict of raw data. | Runs all DIR_METADATA files with dirmd and returns a dict of raw data. | [
"Runs",
"all",
"DIR_METADATA",
"files",
"with",
"dirmd",
"and",
"returns",
"a",
"dict",
"of",
"raw",
"data",
"."
] | def read_raw_dir_metadata(chromium_root: str, dirmd_path: str) -> Dict:
raw_str: str = subprocess_utils.run_command(
[dirmd_path, 'read', chromium_root])
raw_dict: Dict = json.loads(raw_str)
return raw_dict['dirs'] | [
"def",
"read_raw_dir_metadata",
"(",
"chromium_root",
":",
"str",
",",
"dirmd_path",
":",
"str",
")",
"->",
"Dict",
":",
"raw_str",
":",
"str",
"=",
"subprocess_utils",
".",
"run_command",
"(",
"[",
"dirmd_path",
",",
"'read'",
",",
"chromium_root",
"]",
")"... | Runs all DIR_METADATA files with dirmd and returns a dict of raw data. | [
"Runs",
"all",
"DIR_METADATA",
"files",
"with",
"dirmd",
"and",
"returns",
"a",
"dict",
"of",
"raw",
"data",
"."
] | [
"'''Runs all DIR_METADATA files with dirmd and returns a dict of raw data.'''"
] | [
{
"param": "chromium_root",
"type": "str"
},
{
"param": "dirmd_path",
"type": "str"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "chromium_root",
"type": "str",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "dirmd_path",
"type": "str",
"docstring": null,
"doc... |
059be025711dcca5605032f817b06cf92729826b | sunlongbo/chromium | tools/android/modularization/owners/owners_dir_metadata.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | build_dir_metadata | owners_data.DirMetadata | def build_dir_metadata(all_dir_metadata: Dict,
requested_path: owners_data.RequestedPath
) -> owners_data.DirMetadata:
'''Creates a synthetic representation of an DIR_METADATA file.'''
return _build_dir_metadata_recursive(all_dir_metadata,
... | Creates a synthetic representation of an DIR_METADATA file. | Creates a synthetic representation of an DIR_METADATA file. | [
"Creates",
"a",
"synthetic",
"representation",
"of",
"an",
"DIR_METADATA",
"file",
"."
] | def build_dir_metadata(all_dir_metadata: Dict,
requested_path: owners_data.RequestedPath
) -> owners_data.DirMetadata:
return _build_dir_metadata_recursive(all_dir_metadata,
pathlib.Path(requested_path.path)) | [
"def",
"build_dir_metadata",
"(",
"all_dir_metadata",
":",
"Dict",
",",
"requested_path",
":",
"owners_data",
".",
"RequestedPath",
")",
"->",
"owners_data",
".",
"DirMetadata",
":",
"return",
"_build_dir_metadata_recursive",
"(",
"all_dir_metadata",
",",
"pathlib",
"... | Creates a synthetic representation of an DIR_METADATA file. | [
"Creates",
"a",
"synthetic",
"representation",
"of",
"an",
"DIR_METADATA",
"file",
"."
] | [
"'''Creates a synthetic representation of an DIR_METADATA file.'''"
] | [
{
"param": "all_dir_metadata",
"type": "Dict"
},
{
"param": "requested_path",
"type": "owners_data.RequestedPath"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "all_dir_metadata",
"type": "Dict",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "requested_path",
"type": "owners_data.RequestedPath",
... |
680ae7e81ece2a620a4a08c295fbade5e45de82a | sunlongbo/chromium | tools/android/dependency_analysis/subprocess_utils.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | run_command | str | def run_command(command: List[str]) -> str:
"""Runs a command and returns the output.
Raises an exception and prints the command output if the command fails."""
try:
run_result = subprocess.run(command,
capture_output=True,
tex... | Runs a command and returns the output.
Raises an exception and prints the command output if the command fails. | Runs a command and returns the output.
Raises an exception and prints the command output if the command fails. | [
"Runs",
"a",
"command",
"and",
"returns",
"the",
"output",
".",
"Raises",
"an",
"exception",
"and",
"prints",
"the",
"command",
"output",
"if",
"the",
"command",
"fails",
"."
] | def run_command(command: List[str]) -> str:
try:
run_result = subprocess.run(command,
capture_output=True,
text=True,
check=True)
except subprocess.CalledProcessError as e:
print(f'{comman... | [
"def",
"run_command",
"(",
"command",
":",
"List",
"[",
"str",
"]",
")",
"->",
"str",
":",
"try",
":",
"run_result",
"=",
"subprocess",
".",
"run",
"(",
"command",
",",
"capture_output",
"=",
"True",
",",
"text",
"=",
"True",
",",
"check",
"=",
"True... | Runs a command and returns the output. | [
"Runs",
"a",
"command",
"and",
"returns",
"the",
"output",
"."
] | [
"\"\"\"Runs a command and returns the output.\n\n Raises an exception and prints the command output if the command fails.\"\"\""
] | [
{
"param": "command",
"type": "List[str]"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "command",
"type": "List[str]",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
d88fac3a228efe104556e7e7021377f5d49d90e0 | sunlongbo/chromium | third_party/blink/renderer/bindings/scripts/bind_gen/codegen_format.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | format_template | <not_specific> | def format_template(format_string, *args, **kwargs):
"""
Formats a string like the built-in |format| allowing unbound keys.
format_template("${template_var} {format_var}", format_var=42)
will produce
"${template_var} 42"
without raising an exception that |template_var| is unbound.
"... |
Formats a string like the built-in |format| allowing unbound keys.
format_template("${template_var} {format_var}", format_var=42)
will produce
"${template_var} 42"
without raising an exception that |template_var| is unbound.
| Formats a string like the built-in |format| allowing unbound keys. | [
"Formats",
"a",
"string",
"like",
"the",
"built",
"-",
"in",
"|format|",
"allowing",
"unbound",
"keys",
"."
] | def format_template(format_string, *args, **kwargs):
return _TemplateFormatter().format(format_string, *args, **kwargs) | [
"def",
"format_template",
"(",
"format_string",
",",
"*",
"args",
",",
"**",
"kwargs",
")",
":",
"return",
"_TemplateFormatter",
"(",
")",
".",
"format",
"(",
"format_string",
",",
"*",
"args",
",",
"**",
"kwargs",
")"
] | Formats a string like the built-in |format| allowing unbound keys. | [
"Formats",
"a",
"string",
"like",
"the",
"built",
"-",
"in",
"|format|",
"allowing",
"unbound",
"keys",
"."
] | [
"\"\"\"\n Formats a string like the built-in |format| allowing unbound keys.\n\n format_template(\"${template_var} {format_var}\", format_var=42)\n will produce\n \"${template_var} 42\"\n without raising an exception that |template_var| is unbound.\n \"\"\""
] | [
{
"param": "format_string",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "format_string",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
d8b1f4ccb7a523ee84000a1b39a6a9a5f5cf8a16 | sunlongbo/chromium | tools/android/modularization/owners/owners_git.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | run_command | str | def run_command(command: List[str], cwd: str) -> str:
'''Runs a command and returns the output.
Raises an exception and prints the command output if the command fails.'''
try:
run_result = subprocess.run(command,
capture_output=True,
text=True... | Runs a command and returns the output.
Raises an exception and prints the command output if the command fails. | Runs a command and returns the output.
Raises an exception and prints the command output if the command fails. | [
"Runs",
"a",
"command",
"and",
"returns",
"the",
"output",
".",
"Raises",
"an",
"exception",
"and",
"prints",
"the",
"command",
"output",
"if",
"the",
"command",
"fails",
"."
] | def run_command(command: List[str], cwd: str) -> str:
try:
run_result = subprocess.run(command,
capture_output=True,
text=True,
check=True,
cwd=cwd)
except subprocess.CalledProcessErro... | [
"def",
"run_command",
"(",
"command",
":",
"List",
"[",
"str",
"]",
",",
"cwd",
":",
"str",
")",
"->",
"str",
":",
"try",
":",
"run_result",
"=",
"subprocess",
".",
"run",
"(",
"command",
",",
"capture_output",
"=",
"True",
",",
"text",
"=",
"True",
... | Runs a command and returns the output. | [
"Runs",
"a",
"command",
"and",
"returns",
"the",
"output",
"."
] | [
"'''Runs a command and returns the output.\n\n Raises an exception and prints the command output if the command fails.'''"
] | [
{
"param": "command",
"type": "List[str]"
},
{
"param": "cwd",
"type": "str"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "command",
"type": "List[str]",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "cwd",
"type": "str",
"docstring": null,
"docstring_... |
5a9aa960c0f96fb3b5f6b1932feab9be1d47465a | sunlongbo/chromium | tools/grit/grit/node/structure.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | Process | <not_specific> | def Process(self, output_dir):
"""Writes the processed data to output_dir. In the case of a chrome_html
structure this will add references to other scale factors. If flattening
this will also write file references to be base64 encoded data URLs. The
name of the new file is returned."""
filename =... | Writes the processed data to output_dir. In the case of a chrome_html
structure this will add references to other scale factors. If flattening
this will also write file references to be base64 encoded data URLs. The
name of the new file is returned. | Writes the processed data to output_dir. In the case of a chrome_html
structure this will add references to other scale factors. If flattening
this will also write file references to be base64 encoded data URLs. The
name of the new file is returned. | [
"Writes",
"the",
"processed",
"data",
"to",
"output_dir",
".",
"In",
"the",
"case",
"of",
"a",
"chrome_html",
"structure",
"this",
"will",
"add",
"references",
"to",
"other",
"scale",
"factors",
".",
"If",
"flattening",
"this",
"will",
"also",
"write",
"file... | def Process(self, output_dir):
filename = self.ToRealPath(self.GetInputPath())
flat_filename = os.path.join(output_dir,
self.attrs['name'] + '_' + os.path.basename(filename))
if self._last_flat_filename == flat_filename:
return
with open(flat_filename, 'wb') as outfile:
if self.Expan... | [
"def",
"Process",
"(",
"self",
",",
"output_dir",
")",
":",
"filename",
"=",
"self",
".",
"ToRealPath",
"(",
"self",
".",
"GetInputPath",
"(",
")",
")",
"flat_filename",
"=",
"os",
".",
"path",
".",
"join",
"(",
"output_dir",
",",
"self",
".",
"attrs",... | Writes the processed data to output_dir. | [
"Writes",
"the",
"processed",
"data",
"to",
"output_dir",
"."
] | [
"\"\"\"Writes the processed data to output_dir. In the case of a chrome_html\n structure this will add references to other scale factors. If flattening\n this will also write file references to be base64 encoded data URLs. The\n name of the new file is returned.\"\"\""
] | [
{
"param": "self",
"type": null
},
{
"param": "output_dir",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "output_dir",
"type": null,
"docstring": null,
"docstring_toke... |
5a9aa960c0f96fb3b5f6b1932feab9be1d47465a | sunlongbo/chromium | tools/grit/grit/node/structure.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | GetDataPackValue | <not_specific> | def GetDataPackValue(self, lang, encoding):
"""Returns a bytes representation for a data_pack entry."""
if self.ExpandVariables():
text = self.gatherer.GetText()
data = util.Encode(self._Substitute(text), encoding)
else:
data = self.gatherer.GetData(lang, encoding)
if encoding != util.... | Returns a bytes representation for a data_pack entry. | Returns a bytes representation for a data_pack entry. | [
"Returns",
"a",
"bytes",
"representation",
"for",
"a",
"data_pack",
"entry",
"."
] | def GetDataPackValue(self, lang, encoding):
if self.ExpandVariables():
text = self.gatherer.GetText()
data = util.Encode(self._Substitute(text), encoding)
else:
data = self.gatherer.GetData(lang, encoding)
if encoding != util.BINARY:
data = data.encode(encoding)
data = self.Compr... | [
"def",
"GetDataPackValue",
"(",
"self",
",",
"lang",
",",
"encoding",
")",
":",
"if",
"self",
".",
"ExpandVariables",
"(",
")",
":",
"text",
"=",
"self",
".",
"gatherer",
".",
"GetText",
"(",
")",
"data",
"=",
"util",
".",
"Encode",
"(",
"self",
".",... | Returns a bytes representation for a data_pack entry. | [
"Returns",
"a",
"bytes",
"representation",
"for",
"a",
"data_pack",
"entry",
"."
] | [
"\"\"\"Returns a bytes representation for a data_pack entry.\"\"\"",
"# If the asset is in the Lottie format, indicate it by prepending \"LOTTIE\"."
] | [
{
"param": "self",
"type": null
},
{
"param": "lang",
"type": null
},
{
"param": "encoding",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "lang",
"type": null,
"docstring": null,
"docstring_tokens": [... |
5a9aa960c0f96fb3b5f6b1932feab9be1d47465a | sunlongbo/chromium | tools/grit/grit/node/structure.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | GetSkeletonGatherer | <not_specific> | def GetSkeletonGatherer(self):
'''Returns the gatherer for the alternate skeleton that should be used,
based on the expressions for selecting skeletons, or None if the skeleton
from the English version of the structure should be used.
'''
for expr in self.skeletons:
if self.EvaluateCondition(e... | Returns the gatherer for the alternate skeleton that should be used,
based on the expressions for selecting skeletons, or None if the skeleton
from the English version of the structure should be used.
| Returns the gatherer for the alternate skeleton that should be used,
based on the expressions for selecting skeletons, or None if the skeleton
from the English version of the structure should be used. | [
"Returns",
"the",
"gatherer",
"for",
"the",
"alternate",
"skeleton",
"that",
"should",
"be",
"used",
"based",
"on",
"the",
"expressions",
"for",
"selecting",
"skeletons",
"or",
"None",
"if",
"the",
"skeleton",
"from",
"the",
"English",
"version",
"of",
"the",
... | def GetSkeletonGatherer(self):
for expr in self.skeletons:
if self.EvaluateCondition(expr):
return self.skeletons[expr]
return None | [
"def",
"GetSkeletonGatherer",
"(",
"self",
")",
":",
"for",
"expr",
"in",
"self",
".",
"skeletons",
":",
"if",
"self",
".",
"EvaluateCondition",
"(",
"expr",
")",
":",
"return",
"self",
".",
"skeletons",
"[",
"expr",
"]",
"return",
"None"
] | Returns the gatherer for the alternate skeleton that should be used,
based on the expressions for selecting skeletons, or None if the skeleton
from the English version of the structure should be used. | [
"Returns",
"the",
"gatherer",
"for",
"the",
"alternate",
"skeleton",
"that",
"should",
"be",
"used",
"based",
"on",
"the",
"expressions",
"for",
"selecting",
"skeletons",
"or",
"None",
"if",
"the",
"skeleton",
"from",
"the",
"English",
"version",
"of",
"the",
... | [
"'''Returns the gatherer for the alternate skeleton that should be used,\n based on the expressions for selecting skeletons, or None if the skeleton\n from the English version of the structure should be used.\n '''"
] | [
{
"param": "self",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
5a9aa960c0f96fb3b5f6b1932feab9be1d47465a | sunlongbo/chromium | tools/grit/grit/node/structure.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | ExpandVariables | <not_specific> | def ExpandVariables(self):
'''Variable expansion on structures is controlled by an XML attribute.
However, old files assume that expansion is always on for Rc files.
Returns:
A boolean.
'''
attrs = self.GetRoot().attrs
if 'grit_version' in attrs and attrs['grit_version'] > 1:
retur... | Variable expansion on structures is controlled by an XML attribute.
However, old files assume that expansion is always on for Rc files.
Returns:
A boolean.
| Variable expansion on structures is controlled by an XML attribute.
However, old files assume that expansion is always on for Rc files. | [
"Variable",
"expansion",
"on",
"structures",
"is",
"controlled",
"by",
"an",
"XML",
"attribute",
".",
"However",
"old",
"files",
"assume",
"that",
"expansion",
"is",
"always",
"on",
"for",
"Rc",
"files",
"."
] | def ExpandVariables(self):
attrs = self.GetRoot().attrs
if 'grit_version' in attrs and attrs['grit_version'] > 1:
return self.attrs['expand_variables'] == 'true'
else:
return (self.attrs['expand_variables'] == 'true' or
self.attrs['file'].lower().endswith('.rc')) | [
"def",
"ExpandVariables",
"(",
"self",
")",
":",
"attrs",
"=",
"self",
".",
"GetRoot",
"(",
")",
".",
"attrs",
"if",
"'grit_version'",
"in",
"attrs",
"and",
"attrs",
"[",
"'grit_version'",
"]",
">",
"1",
":",
"return",
"self",
".",
"attrs",
"[",
"'expa... | Variable expansion on structures is controlled by an XML attribute. | [
"Variable",
"expansion",
"on",
"structures",
"is",
"controlled",
"by",
"an",
"XML",
"attribute",
"."
] | [
"'''Variable expansion on structures is controlled by an XML attribute.\n\n However, old files assume that expansion is always on for Rc files.\n\n Returns:\n A boolean.\n '''"
] | [
{
"param": "self",
"type": null
}
] | {
"returns": [
{
"docstring": null,
"docstring_tokens": [
"None"
],
"type": null
}
],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
... |
5a9aa960c0f96fb3b5f6b1932feab9be1d47465a | sunlongbo/chromium | tools/grit/grit/node/structure.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | _Substitute | <not_specific> | def _Substitute(self, text):
'''Perform local and global variable substitution.'''
if self.substituter:
text = self.substituter.Substitute(text)
return self.GetRoot().GetSubstituter().Substitute(text) | Perform local and global variable substitution. | Perform local and global variable substitution. | [
"Perform",
"local",
"and",
"global",
"variable",
"substitution",
"."
] | def _Substitute(self, text):
if self.substituter:
text = self.substituter.Substitute(text)
return self.GetRoot().GetSubstituter().Substitute(text) | [
"def",
"_Substitute",
"(",
"self",
",",
"text",
")",
":",
"if",
"self",
".",
"substituter",
":",
"text",
"=",
"self",
".",
"substituter",
".",
"Substitute",
"(",
"text",
")",
"return",
"self",
".",
"GetRoot",
"(",
")",
".",
"GetSubstituter",
"(",
")",
... | Perform local and global variable substitution. | [
"Perform",
"local",
"and",
"global",
"variable",
"substitution",
"."
] | [
"'''Perform local and global variable substitution.'''"
] | [
{
"param": "self",
"type": null
},
{
"param": "text",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "text",
"type": null,
"docstring": null,
"docstring_tokens": [... |
5a9aa960c0f96fb3b5f6b1932feab9be1d47465a | sunlongbo/chromium | tools/grit/grit/node/structure.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | FileForLanguage | <not_specific> | def FileForLanguage(self, lang, output_dir, create_file=True,
return_if_not_generated=True):
'''Returns the filename of the file associated with this structure,
for the specified language.
Args:
lang: 'fr'
output_dir: 'c:\temp'
create_file: True
'''
assert se... | Returns the filename of the file associated with this structure,
for the specified language.
Args:
lang: 'fr'
output_dir: 'c:\temp'
create_file: True
| Returns the filename of the file associated with this structure,
for the specified language. | [
"Returns",
"the",
"filename",
"of",
"the",
"file",
"associated",
"with",
"this",
"structure",
"for",
"the",
"specified",
"language",
"."
] | def FileForLanguage(self, lang, output_dir, create_file=True,
return_if_not_generated=True):
assert self.HasFileForLanguage()
if ((not lang or lang == self.GetRoot().GetSourceLanguage()) and
self.attrs['expand_variables'] != 'true' and
(not self.attrs['run_command'] or
... | [
"def",
"FileForLanguage",
"(",
"self",
",",
"lang",
",",
"output_dir",
",",
"create_file",
"=",
"True",
",",
"return_if_not_generated",
"=",
"True",
")",
":",
"assert",
"self",
".",
"HasFileForLanguage",
"(",
")",
"if",
"(",
"(",
"not",
"lang",
"or",
"lang... | Returns the filename of the file associated with this structure,
for the specified language. | [
"Returns",
"the",
"filename",
"of",
"the",
"file",
"associated",
"with",
"this",
"structure",
"for",
"the",
"specified",
"language",
"."
] | [
"'''Returns the filename of the file associated with this structure,\n for the specified language.\n\n Args:\n lang: 'fr'\n output_dir: 'c:\\temp'\n create_file: True\n '''",
"# If the source language is requested, and no extra changes are requested,",
"# use the existing file.",
"# On... | [
{
"param": "self",
"type": null
},
{
"param": "lang",
"type": null
},
{
"param": "output_dir",
"type": null
},
{
"param": "create_file",
"type": null
},
{
"param": "return_if_not_generated",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "lang",
"type": null,
"docstring": null,
"docstring_tokens": [... |
5a9aa960c0f96fb3b5f6b1932feab9be1d47465a | sunlongbo/chromium | tools/grit/grit/node/structure.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | Construct | <not_specific> | def Construct(parent, name, type, file, encoding='cp1252'):
'''Creates a new node which is a child of 'parent', with attributes set
by parameters of the same name.
'''
node = StructureNode()
node.StartParsing('structure', parent)
node.HandleAttribute('name', name)
node.HandleAttribute('type'... | Creates a new node which is a child of 'parent', with attributes set
by parameters of the same name.
| Creates a new node which is a child of 'parent', with attributes set
by parameters of the same name. | [
"Creates",
"a",
"new",
"node",
"which",
"is",
"a",
"child",
"of",
"'",
"parent",
"'",
"with",
"attributes",
"set",
"by",
"parameters",
"of",
"the",
"same",
"name",
"."
] | def Construct(parent, name, type, file, encoding='cp1252'):
node = StructureNode()
node.StartParsing('structure', parent)
node.HandleAttribute('name', name)
node.HandleAttribute('type', type)
node.HandleAttribute('file', file)
node.HandleAttribute('encoding', encoding)
node.EndParsing()
... | [
"def",
"Construct",
"(",
"parent",
",",
"name",
",",
"type",
",",
"file",
",",
"encoding",
"=",
"'cp1252'",
")",
":",
"node",
"=",
"StructureNode",
"(",
")",
"node",
".",
"StartParsing",
"(",
"'structure'",
",",
"parent",
")",
"node",
".",
"HandleAttribu... | Creates a new node which is a child of 'parent', with attributes set
by parameters of the same name. | [
"Creates",
"a",
"new",
"node",
"which",
"is",
"a",
"child",
"of",
"'",
"parent",
"'",
"with",
"attributes",
"set",
"by",
"parameters",
"of",
"the",
"same",
"name",
"."
] | [
"'''Creates a new node which is a child of 'parent', with attributes set\n by parameters of the same name.\n '''"
] | [
{
"param": "parent",
"type": null
},
{
"param": "name",
"type": null
},
{
"param": "type",
"type": null
},
{
"param": "file",
"type": null
},
{
"param": "encoding",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "parent",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "name",
"type": null,
"docstring": null,
"docstring_tokens":... |
5aaeaa2fee19f238a56366ecf3fbdfe48b5383db | sunlongbo/chromium | content/test/gpu/unexpected_passes/gpu_builders_unittest.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | testMatch | null | def testMatch(self):
"""Tests that a match can be successfully found."""
test_map = {
'isolated_scripts': [
{
'args': [
'webgl_conformance',
],
'isolate_name': 'telemetry_gpu_integration_test',
},
],
... | Tests that a match can be successfully found. | Tests that a match can be successfully found. | [
"Tests",
"that",
"a",
"match",
"can",
"be",
"successfully",
"found",
"."
] | def testMatch(self):
test_map = {
'isolated_scripts': [
{
'args': [
'webgl_conformance',
],
'isolate_name': 'telemetry_gpu_integration_test',
},
],
}
self.assertTrue(
self.instance._BuilderRun... | [
"def",
"testMatch",
"(",
"self",
")",
":",
"test_map",
"=",
"{",
"'isolated_scripts'",
":",
"[",
"{",
"'args'",
":",
"[",
"'webgl_conformance'",
",",
"]",
",",
"'isolate_name'",
":",
"'telemetry_gpu_integration_test'",
",",
"}",
",",
"]",
",",
"}",
"self",
... | Tests that a match can be successfully found. | [
"Tests",
"that",
"a",
"match",
"can",
"be",
"successfully",
"found",
"."
] | [
"\"\"\"Tests that a match can be successfully found.\"\"\""
] | [
{
"param": "self",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
5aaeaa2fee19f238a56366ecf3fbdfe48b5383db | sunlongbo/chromium | content/test/gpu/unexpected_passes/gpu_builders_unittest.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | testNoMatchIsolate | null | def testNoMatchIsolate(self):
"""Tests that a match is not found if the isolate name is not valid."""
test_map = {
'isolated_scripts': [
{
'args': [
'webgl_conformance',
],
'isolate_name': 'not_telemetry',
},
... | Tests that a match is not found if the isolate name is not valid. | Tests that a match is not found if the isolate name is not valid. | [
"Tests",
"that",
"a",
"match",
"is",
"not",
"found",
"if",
"the",
"isolate",
"name",
"is",
"not",
"valid",
"."
] | def testNoMatchIsolate(self):
test_map = {
'isolated_scripts': [
{
'args': [
'webgl_conformance',
],
'isolate_name': 'not_telemetry',
},
],
}
self.assertFalse(
self.instance._BuilderRunsTestOf... | [
"def",
"testNoMatchIsolate",
"(",
"self",
")",
":",
"test_map",
"=",
"{",
"'isolated_scripts'",
":",
"[",
"{",
"'args'",
":",
"[",
"'webgl_conformance'",
",",
"]",
",",
"'isolate_name'",
":",
"'not_telemetry'",
",",
"}",
",",
"]",
",",
"}",
"self",
".",
... | Tests that a match is not found if the isolate name is not valid. | [
"Tests",
"that",
"a",
"match",
"is",
"not",
"found",
"if",
"the",
"isolate",
"name",
"is",
"not",
"valid",
"."
] | [
"\"\"\"Tests that a match is not found if the isolate name is not valid.\"\"\""
] | [
{
"param": "self",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
5aaeaa2fee19f238a56366ecf3fbdfe48b5383db | sunlongbo/chromium | content/test/gpu/unexpected_passes/gpu_builders_unittest.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | testNoMatchSuite | null | def testNoMatchSuite(self):
"""Tests that a match is not found if the suite name is not valid."""
test_map = {
'isolated_scripts': [
{
'args': [
'not_a_suite',
],
'isolate_name': 'telemetry_gpu_integration_test',
... | Tests that a match is not found if the suite name is not valid. | Tests that a match is not found if the suite name is not valid. | [
"Tests",
"that",
"a",
"match",
"is",
"not",
"found",
"if",
"the",
"suite",
"name",
"is",
"not",
"valid",
"."
] | def testNoMatchSuite(self):
test_map = {
'isolated_scripts': [
{
'args': [
'not_a_suite',
],
'isolate_name': 'telemetry_gpu_integration_test',
},
],
}
self.assertFalse(
self.instance._BuilderR... | [
"def",
"testNoMatchSuite",
"(",
"self",
")",
":",
"test_map",
"=",
"{",
"'isolated_scripts'",
":",
"[",
"{",
"'args'",
":",
"[",
"'not_a_suite'",
",",
"]",
",",
"'isolate_name'",
":",
"'telemetry_gpu_integration_test'",
",",
"}",
",",
"]",
",",
"}",
"self",
... | Tests that a match is not found if the suite name is not valid. | [
"Tests",
"that",
"a",
"match",
"is",
"not",
"found",
"if",
"the",
"suite",
"name",
"is",
"not",
"valid",
"."
] | [
"\"\"\"Tests that a match is not found if the suite name is not valid.\"\"\""
] | [
{
"param": "self",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
5aaeaa2fee19f238a56366ecf3fbdfe48b5383db | sunlongbo/chromium | content/test/gpu/unexpected_passes/gpu_builders_unittest.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | testAndroidSuffixes | <not_specific> | def testAndroidSuffixes(self):
"""Tests that Android-specific isolates are added."""
isolate_names = self.instance.GetIsolateNames()
for isolate in isolate_names:
if 'telemetry_gpu_integration_test' in isolate and 'android' in isolate:
return
self.fail('Did not find any Android-specific is... | Tests that Android-specific isolates are added. | Tests that Android-specific isolates are added. | [
"Tests",
"that",
"Android",
"-",
"specific",
"isolates",
"are",
"added",
"."
] | def testAndroidSuffixes(self):
isolate_names = self.instance.GetIsolateNames()
for isolate in isolate_names:
if 'telemetry_gpu_integration_test' in isolate and 'android' in isolate:
return
self.fail('Did not find any Android-specific isolate names') | [
"def",
"testAndroidSuffixes",
"(",
"self",
")",
":",
"isolate_names",
"=",
"self",
".",
"instance",
".",
"GetIsolateNames",
"(",
")",
"for",
"isolate",
"in",
"isolate_names",
":",
"if",
"'telemetry_gpu_integration_test'",
"in",
"isolate",
"and",
"'android'",
"in",... | Tests that Android-specific isolates are added. | [
"Tests",
"that",
"Android",
"-",
"specific",
"isolates",
"are",
"added",
"."
] | [
"\"\"\"Tests that Android-specific isolates are added.\"\"\""
] | [
{
"param": "self",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
2ca648199d9f3dd6244bfd4a1c55f8aa3d268809 | sunlongbo/chromium | tools/perf/page_sets/login_helpers/linkedin_login.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | LoginDesktopAccount | null | def LoginDesktopAccount(action_runner, credential,
credentials_path=login_utils.DEFAULT_CREDENTIAL_PATH):
"""Logs in into a Linkedin account.
This function navigates the tab into Linkedin's login page and logs in a user
using credentials in |credential| part of the |credentials_path| file.
Ar... | Logs in into a Linkedin account.
This function navigates the tab into Linkedin's login page and logs in a user
using credentials in |credential| part of the |credentials_path| file.
Args:
action_runner: Action runner responsible for running actions on the page.
credential: The credential to retrieve fro... | Logs in into a Linkedin account.
This function navigates the tab into Linkedin's login page and logs in a user
using credentials in |credential| part of the |credentials_path| file.
Action runner responsible for running actions on the page.
credential: The credential to retrieve from the credentials file (string).
cre... | [
"Logs",
"in",
"into",
"a",
"Linkedin",
"account",
".",
"This",
"function",
"navigates",
"the",
"tab",
"into",
"Linkedin",
"'",
"s",
"login",
"page",
"and",
"logs",
"in",
"a",
"user",
"using",
"credentials",
"in",
"|credential|",
"part",
"of",
"the",
"|cred... | def LoginDesktopAccount(action_runner, credential,
credentials_path=login_utils.DEFAULT_CREDENTIAL_PATH):
account_name, password = login_utils.GetAccountNameAndPassword(
credential, credentials_path=credentials_path)
action_runner.Navigate('https://www.linkedin.com/uas/login')
action_runner... | [
"def",
"LoginDesktopAccount",
"(",
"action_runner",
",",
"credential",
",",
"credentials_path",
"=",
"login_utils",
".",
"DEFAULT_CREDENTIAL_PATH",
")",
":",
"account_name",
",",
"password",
"=",
"login_utils",
".",
"GetAccountNameAndPassword",
"(",
"credential",
",",
... | Logs in into a Linkedin account. | [
"Logs",
"in",
"into",
"a",
"Linkedin",
"account",
"."
] | [
"\"\"\"Logs in into a Linkedin account.\n\n This function navigates the tab into Linkedin's login page and logs in a user\n using credentials in |credential| part of the |credentials_path| file.\n\n Args:\n action_runner: Action runner responsible for running actions on the page.\n credential: The credenti... | [
{
"param": "action_runner",
"type": null
},
{
"param": "credential",
"type": null
},
{
"param": "credentials_path",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "action_runner",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "credential",
"type": null,
"docstring": null,
"docst... |
d6dbf4fbc99b5c55b720ec26eba9d1fb02748f62 | sunlongbo/chromium | components/policy/tools/template_writers/writers/admx_writer.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | GetType | <not_specific> | def GetType(policy, allow_multi_strings=False):
'''Returns the ADMX element type that should be used for the given policy.
This logic is shared between the ADMX writer and the ADML writer, to ensure
that the ADMX and ADML generated from policy_tempates.json are compatible.
Args:
policy: A dict de... | Returns the ADMX element type that should be used for the given policy.
This logic is shared between the ADMX writer and the ADML writer, to ensure
that the ADMX and ADML generated from policy_tempates.json are compatible.
Args:
policy: A dict describing the policy, as found in policy_templates.json.... | Returns the ADMX element type that should be used for the given policy.
This logic is shared between the ADMX writer and the ADML writer, to ensure
that the ADMX and ADML generated from policy_tempates.json are compatible. | [
"Returns",
"the",
"ADMX",
"element",
"type",
"that",
"should",
"be",
"used",
"for",
"the",
"given",
"policy",
".",
"This",
"logic",
"is",
"shared",
"between",
"the",
"ADMX",
"writer",
"and",
"the",
"ADML",
"writer",
"to",
"ensure",
"that",
"the",
"ADMX",
... | def GetType(policy, allow_multi_strings=False):
policy_type = policy['type']
policy_example = policy.get('example_value')
if (policy_type == 'string' and allow_multi_strings and
policy_example is not None and policy_example.strip().startswith('{')):
return AdmxElementType.MULTI_STRING
admx... | [
"def",
"GetType",
"(",
"policy",
",",
"allow_multi_strings",
"=",
"False",
")",
":",
"policy_type",
"=",
"policy",
"[",
"'type'",
"]",
"policy_example",
"=",
"policy",
".",
"get",
"(",
"'example_value'",
")",
"if",
"(",
"policy_type",
"==",
"'string'",
"and"... | Returns the ADMX element type that should be used for the given policy. | [
"Returns",
"the",
"ADMX",
"element",
"type",
"that",
"should",
"be",
"used",
"for",
"the",
"given",
"policy",
"."
] | [
"'''Returns the ADMX element type that should be used for the given policy.\n This logic is shared between the ADMX writer and the ADML writer, to ensure\n that the ADMX and ADML generated from policy_tempates.json are compatible.\n\n Args:\n policy: A dict describing the policy, as found in policy_te... | [
{
"param": "policy",
"type": null
},
{
"param": "allow_multi_strings",
"type": null
}
] | {
"returns": [
{
"docstring": "One of the enum values of AdmxElementType.",
"docstring_tokens": [
"One",
"of",
"the",
"enum",
"values",
"of",
"AdmxElementType",
"."
],
"type": null
}
],
"raises": [
{
"docstri... |
d6dbf4fbc99b5c55b720ec26eba9d1fb02748f62 | sunlongbo/chromium | components/policy/tools/template_writers/writers/admx_writer.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | GetWriter | <not_specific> | def GetWriter(config):
'''Factory method for instanciating the ADMXWriter. Every Writer needs a
GetWriter method because the TemplateFormatter uses this method to
instantiate a Writer.
'''
return ADMXWriter(['win', 'win7'], config) | Factory method for instanciating the ADMXWriter. Every Writer needs a
GetWriter method because the TemplateFormatter uses this method to
instantiate a Writer.
| Factory method for instanciating the ADMXWriter. Every Writer needs a
GetWriter method because the TemplateFormatter uses this method to
instantiate a Writer. | [
"Factory",
"method",
"for",
"instanciating",
"the",
"ADMXWriter",
".",
"Every",
"Writer",
"needs",
"a",
"GetWriter",
"method",
"because",
"the",
"TemplateFormatter",
"uses",
"this",
"method",
"to",
"instantiate",
"a",
"Writer",
"."
] | def GetWriter(config):
return ADMXWriter(['win', 'win7'], config) | [
"def",
"GetWriter",
"(",
"config",
")",
":",
"return",
"ADMXWriter",
"(",
"[",
"'win'",
",",
"'win7'",
"]",
",",
"config",
")"
] | Factory method for instanciating the ADMXWriter. | [
"Factory",
"method",
"for",
"instanciating",
"the",
"ADMXWriter",
"."
] | [
"'''Factory method for instanciating the ADMXWriter. Every Writer needs a\n GetWriter method because the TemplateFormatter uses this method to\n instantiate a Writer.\n '''"
] | [
{
"param": "config",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "config",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
d6dbf4fbc99b5c55b720ec26eba9d1fb02748f62 | sunlongbo/chromium | components/policy/tools/template_writers/writers/admx_writer.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | _AdmlString | <not_specific> | def _AdmlString(self, name):
'''Creates a reference to the named string in an ADML file.
Args:
name: Name of the referenced ADML string.
'''
name = name.replace('.', '_')
return '$(string.' + name + ')' | Creates a reference to the named string in an ADML file.
Args:
name: Name of the referenced ADML string.
| Creates a reference to the named string in an ADML file. | [
"Creates",
"a",
"reference",
"to",
"the",
"named",
"string",
"in",
"an",
"ADML",
"file",
"."
] | def _AdmlString(self, name):
name = name.replace('.', '_')
return '$(string.' + name + ')' | [
"def",
"_AdmlString",
"(",
"self",
",",
"name",
")",
":",
"name",
"=",
"name",
".",
"replace",
"(",
"'.'",
",",
"'_'",
")",
"return",
"'$(string.'",
"+",
"name",
"+",
"')'"
] | Creates a reference to the named string in an ADML file. | [
"Creates",
"a",
"reference",
"to",
"the",
"named",
"string",
"in",
"an",
"ADML",
"file",
"."
] | [
"'''Creates a reference to the named string in an ADML file.\n Args:\n name: Name of the referenced ADML string.\n '''"
] | [
{
"param": "self",
"type": null
},
{
"param": "name",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "name",
"type": null,
"docstring": "Name of the referenced ADML stri... |
d6dbf4fbc99b5c55b720ec26eba9d1fb02748f62 | sunlongbo/chromium | components/policy/tools/template_writers/writers/admx_writer.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | _AdmlStringExplain | <not_specific> | def _AdmlStringExplain(self, name):
'''Creates a reference to the named explanation string in an ADML file.
Args:
name: Name of the referenced ADML explanation.
'''
name = name.replace('.', '_')
return '$(string.' + name + '_Explain)' | Creates a reference to the named explanation string in an ADML file.
Args:
name: Name of the referenced ADML explanation.
| Creates a reference to the named explanation string in an ADML file. | [
"Creates",
"a",
"reference",
"to",
"the",
"named",
"explanation",
"string",
"in",
"an",
"ADML",
"file",
"."
] | def _AdmlStringExplain(self, name):
name = name.replace('.', '_')
return '$(string.' + name + '_Explain)' | [
"def",
"_AdmlStringExplain",
"(",
"self",
",",
"name",
")",
":",
"name",
"=",
"name",
".",
"replace",
"(",
"'.'",
",",
"'_'",
")",
"return",
"'$(string.'",
"+",
"name",
"+",
"'_Explain)'"
] | Creates a reference to the named explanation string in an ADML file. | [
"Creates",
"a",
"reference",
"to",
"the",
"named",
"explanation",
"string",
"in",
"an",
"ADML",
"file",
"."
] | [
"'''Creates a reference to the named explanation string in an ADML file.\n Args:\n name: Name of the referenced ADML explanation.\n '''"
] | [
{
"param": "self",
"type": null
},
{
"param": "name",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "name",
"type": null,
"docstring": "Name of the referenced ADML expl... |
d6dbf4fbc99b5c55b720ec26eba9d1fb02748f62 | sunlongbo/chromium | components/policy/tools/template_writers/writers/admx_writer.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | _AdmlPresentation | <not_specific> | def _AdmlPresentation(self, name):
'''Creates a reference to the named presentation element in an ADML file.
Args:
name: Name of the referenced ADML presentation element.
'''
return '$(presentation.' + name + ')' | Creates a reference to the named presentation element in an ADML file.
Args:
name: Name of the referenced ADML presentation element.
| Creates a reference to the named presentation element in an ADML file. | [
"Creates",
"a",
"reference",
"to",
"the",
"named",
"presentation",
"element",
"in",
"an",
"ADML",
"file",
"."
] | def _AdmlPresentation(self, name):
return '$(presentation.' + name + ')' | [
"def",
"_AdmlPresentation",
"(",
"self",
",",
"name",
")",
":",
"return",
"'$(presentation.'",
"+",
"name",
"+",
"')'"
] | Creates a reference to the named presentation element in an ADML file. | [
"Creates",
"a",
"reference",
"to",
"the",
"named",
"presentation",
"element",
"in",
"an",
"ADML",
"file",
"."
] | [
"'''Creates a reference to the named presentation element in an ADML file.\n Args:\n name: Name of the referenced ADML presentation element.\n '''"
] | [
{
"param": "self",
"type": null
},
{
"param": "name",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "name",
"type": null,
"docstring": "Name of the referenced ADML pres... |
d6dbf4fbc99b5c55b720ec26eba9d1fb02748f62 | sunlongbo/chromium | components/policy/tools/template_writers/writers/admx_writer.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | _AddPolicyNamespaces | null | def _AddPolicyNamespaces(self, parent, prefix, namespace):
'''Generates the ADMX "policyNamespace" element and adds the elements to the
passed parent element. The namespace of the generated ADMX document is
define via the ADMX "target" element. Used namespaces are declared with an
ADMX "using" element. ... | Generates the ADMX "policyNamespace" element and adds the elements to the
passed parent element. The namespace of the generated ADMX document is
define via the ADMX "target" element. Used namespaces are declared with an
ADMX "using" element. ADMX "target" and "using" elements are children of the
ADMX "p... | Generates the ADMX "policyNamespace" element and adds the elements to the
passed parent element. The namespace of the generated ADMX document is
define via the ADMX "target" element. Used namespaces are declared with an
ADMX "using" element. | [
"Generates",
"the",
"ADMX",
"\"",
"policyNamespace",
"\"",
"element",
"and",
"adds",
"the",
"elements",
"to",
"the",
"passed",
"parent",
"element",
".",
"The",
"namespace",
"of",
"the",
"generated",
"ADMX",
"document",
"is",
"define",
"via",
"the",
"ADMX",
"... | def _AddPolicyNamespaces(self, parent, prefix, namespace):
policy_namespaces_elem = self.AddElement(parent, 'policyNamespaces')
attributes = {
'prefix': prefix,
'namespace': namespace,
}
self.AddElement(policy_namespaces_elem, 'target', attributes)
if 'admx_using_namespaces' in self.... | [
"def",
"_AddPolicyNamespaces",
"(",
"self",
",",
"parent",
",",
"prefix",
",",
"namespace",
")",
":",
"policy_namespaces_elem",
"=",
"self",
".",
"AddElement",
"(",
"parent",
",",
"'policyNamespaces'",
")",
"attributes",
"=",
"{",
"'prefix'",
":",
"prefix",
",... | Generates the ADMX "policyNamespace" element and adds the elements to the
passed parent element. | [
"Generates",
"the",
"ADMX",
"\"",
"policyNamespace",
"\"",
"element",
"and",
"adds",
"the",
"elements",
"to",
"the",
"passed",
"parent",
"element",
"."
] | [
"'''Generates the ADMX \"policyNamespace\" element and adds the elements to the\n passed parent element. The namespace of the generated ADMX document is\n define via the ADMX \"target\" element. Used namespaces are declared with an\n ADMX \"using\" element. ADMX \"target\" and \"using\" elements are childr... | [
{
"param": "self",
"type": null
},
{
"param": "parent",
"type": null
},
{
"param": "prefix",
"type": null
},
{
"param": "namespace",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "parent",
"type": null,
"docstring": "The parent node to which all g... |
d6dbf4fbc99b5c55b720ec26eba9d1fb02748f62 | sunlongbo/chromium | components/policy/tools/template_writers/writers/admx_writer.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | _AddCategory | <not_specific> | def _AddCategory(self, parent, name, display_name, parent_category_name=None):
'''Adds an ADMX category element to the passed parent node. The following
snippet shows an example of a category element where "chromium" is the value
of the parameter name:
<category displayName="$(string.chromium)" name="c... | Adds an ADMX category element to the passed parent node. The following
snippet shows an example of a category element where "chromium" is the value
of the parameter name:
<category displayName="$(string.chromium)" name="chromium"/>
Each parent node can have only one category with a given name. Adding ... | Adds an ADMX category element to the passed parent node. The following
snippet shows an example of a category element where "chromium" is the value
of the parameter name.
Each parent node can have only one category with a given name. Adding the
same category again with the same attributes is ignored, but adding it
a... | [
"Adds",
"an",
"ADMX",
"category",
"element",
"to",
"the",
"passed",
"parent",
"node",
".",
"The",
"following",
"snippet",
"shows",
"an",
"example",
"of",
"a",
"category",
"element",
"where",
"\"",
"chromium",
"\"",
"is",
"the",
"value",
"of",
"the",
"param... | def _AddCategory(self, parent, name, display_name, parent_category_name=None):
existing = list(
filter(lambda e: e.getAttribute('name') == name,
parent.getElementsByTagName('category')))
if existing:
assert len(existing) == 1
assert existing[0].getAttribute('name') == name
... | [
"def",
"_AddCategory",
"(",
"self",
",",
"parent",
",",
"name",
",",
"display_name",
",",
"parent_category_name",
"=",
"None",
")",
":",
"existing",
"=",
"list",
"(",
"filter",
"(",
"lambda",
"e",
":",
"e",
".",
"getAttribute",
"(",
"'name'",
")",
"==",
... | Adds an ADMX category element to the passed parent node. | [
"Adds",
"an",
"ADMX",
"category",
"element",
"to",
"the",
"passed",
"parent",
"node",
"."
] | [
"'''Adds an ADMX category element to the passed parent node. The following\n snippet shows an example of a category element where \"chromium\" is the value\n of the parameter name:\n\n <category displayName=\"$(string.chromium)\" name=\"chromium\"/>\n\n Each parent node can have only one category with a... | [
{
"param": "self",
"type": null
},
{
"param": "parent",
"type": null
},
{
"param": "name",
"type": null
},
{
"param": "display_name",
"type": null
},
{
"param": "parent_category_name",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "parent",
"type": null,
"docstring": "The parent node to which all g... |
d6dbf4fbc99b5c55b720ec26eba9d1fb02748f62 | sunlongbo/chromium | components/policy/tools/template_writers/writers/admx_writer.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | _AddCategories | null | def _AddCategories(self, categories):
'''Generates the ADMX "categories" element and adds it to the categories
main node. The "categories" element defines the category for the policies
defined in this ADMX document. Here is an example of an ADMX "categories"
element:
<categories>
<category di... | Generates the ADMX "categories" element and adds it to the categories
main node. The "categories" element defines the category for the policies
defined in this ADMX document. Here is an example of an ADMX "categories"
element:
<categories>
<category displayName="$(string.googlechrome)" name="goog... | Generates the ADMX "categories" element and adds it to the categories
main node. The "categories" element defines the category for the policies
defined in this ADMX document. Here is an example of an ADMX "categories"
element.
| [
"Generates",
"the",
"ADMX",
"\"",
"categories",
"\"",
"element",
"and",
"adds",
"it",
"to",
"the",
"categories",
"main",
"node",
".",
"The",
"\"",
"categories",
"\"",
"element",
"defines",
"the",
"category",
"for",
"the",
"policies",
"defined",
"in",
"this",... | def _AddCategories(self, categories):
category_name = None
for category in categories:
parent_category_name = category_name
category_name = category
if (":" not in category_name):
self._AddCategory(self._categories_elem, category_name,
self._AdmlString(categor... | [
"def",
"_AddCategories",
"(",
"self",
",",
"categories",
")",
":",
"category_name",
"=",
"None",
"for",
"category",
"in",
"categories",
":",
"parent_category_name",
"=",
"category_name",
"category_name",
"=",
"category",
"if",
"(",
"\":\"",
"not",
"in",
"categor... | Generates the ADMX "categories" element and adds it to the categories
main node. | [
"Generates",
"the",
"ADMX",
"\"",
"categories",
"\"",
"element",
"and",
"adds",
"it",
"to",
"the",
"categories",
"main",
"node",
"."
] | [
"'''Generates the ADMX \"categories\" element and adds it to the categories\n main node. The \"categories\" element defines the category for the policies\n defined in this ADMX document. Here is an example of an ADMX \"categories\"\n element:\n\n <categories>\n <category displayName=\"$(string.goog... | [
{
"param": "self",
"type": null
},
{
"param": "categories",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "categories",
"type": null,
"docstring": null,
"docstring_toke... |
d6dbf4fbc99b5c55b720ec26eba9d1fb02748f62 | sunlongbo/chromium | components/policy/tools/template_writers/writers/admx_writer.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | _AddSupportedOn | null | def _AddSupportedOn(self, parent, supported_os_list):
'''Generates the "supportedOn" ADMX element and adds it to the passed
parent node. The "supportedOn" element contains information about supported
Windows OS versions. The following code snippet contains an example of a
"supportedOn" element:
<su... | Generates the "supportedOn" ADMX element and adds it to the passed
parent node. The "supportedOn" element contains information about supported
Windows OS versions. The following code snippet contains an example of a
"supportedOn" element:
<supportedOn>
<definitions>
<definition name="$(su... | Generates the "supportedOn" ADMX element and adds it to the passed
parent node. The "supportedOn" element contains information about supported
Windows OS versions. The following code snippet contains an example of a
"supportedOn" element.
| [
"Generates",
"the",
"\"",
"supportedOn",
"\"",
"ADMX",
"element",
"and",
"adds",
"it",
"to",
"the",
"passed",
"parent",
"node",
".",
"The",
"\"",
"supportedOn",
"\"",
"element",
"contains",
"information",
"about",
"supported",
"Windows",
"OS",
"versions",
".",... | def _AddSupportedOn(self, parent, supported_os_list):
supported_on_elem = self.AddElement(parent, 'supportedOn')
definitions_elem = self.AddElement(supported_on_elem, 'definitions')
for supported_os in supported_os_list:
attributes = {
'name': supported_os,
'displayName': self._Adm... | [
"def",
"_AddSupportedOn",
"(",
"self",
",",
"parent",
",",
"supported_os_list",
")",
":",
"supported_on_elem",
"=",
"self",
".",
"AddElement",
"(",
"parent",
",",
"'supportedOn'",
")",
"definitions_elem",
"=",
"self",
".",
"AddElement",
"(",
"supported_on_elem",
... | Generates the "supportedOn" ADMX element and adds it to the passed
parent node. | [
"Generates",
"the",
"\"",
"supportedOn",
"\"",
"ADMX",
"element",
"and",
"adds",
"it",
"to",
"the",
"passed",
"parent",
"node",
"."
] | [
"'''Generates the \"supportedOn\" ADMX element and adds it to the passed\n parent node. The \"supportedOn\" element contains information about supported\n Windows OS versions. The following code snippet contains an example of a\n \"supportedOn\" element:\n\n <supportedOn>\n <definitions>\n <... | [
{
"param": "self",
"type": null
},
{
"param": "parent",
"type": null
},
{
"param": "supported_os_list",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "parent",
"type": null,
"docstring": "The parent element to which al... |
d6dbf4fbc99b5c55b720ec26eba9d1fb02748f62 | sunlongbo/chromium | components/policy/tools/template_writers/writers/admx_writer.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | _AddStringPolicy | null | def _AddStringPolicy(self, parent, name, id=None):
'''Generates ADMX elements for a String-Policy and adds them to the
passed parent node.
'''
attributes = {
'id': id or name,
'valueName': name,
'maxLength': '1000000',
}
self.AddElement(parent, 'text', attributes) | Generates ADMX elements for a String-Policy and adds them to the
passed parent node.
| Generates ADMX elements for a String-Policy and adds them to the
passed parent node. | [
"Generates",
"ADMX",
"elements",
"for",
"a",
"String",
"-",
"Policy",
"and",
"adds",
"them",
"to",
"the",
"passed",
"parent",
"node",
"."
] | def _AddStringPolicy(self, parent, name, id=None):
attributes = {
'id': id or name,
'valueName': name,
'maxLength': '1000000',
}
self.AddElement(parent, 'text', attributes) | [
"def",
"_AddStringPolicy",
"(",
"self",
",",
"parent",
",",
"name",
",",
"id",
"=",
"None",
")",
":",
"attributes",
"=",
"{",
"'id'",
":",
"id",
"or",
"name",
",",
"'valueName'",
":",
"name",
",",
"'maxLength'",
":",
"'1000000'",
",",
"}",
"self",
".... | Generates ADMX elements for a String-Policy and adds them to the
passed parent node. | [
"Generates",
"ADMX",
"elements",
"for",
"a",
"String",
"-",
"Policy",
"and",
"adds",
"them",
"to",
"the",
"passed",
"parent",
"node",
"."
] | [
"'''Generates ADMX elements for a String-Policy and adds them to the\n passed parent node.\n '''"
] | [
{
"param": "self",
"type": null
},
{
"param": "parent",
"type": null
},
{
"param": "name",
"type": null
},
{
"param": "id",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "parent",
"type": null,
"docstring": null,
"docstring_tokens":... |
d6dbf4fbc99b5c55b720ec26eba9d1fb02748f62 | sunlongbo/chromium | components/policy/tools/template_writers/writers/admx_writer.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | _AddMultiStringPolicy | null | def _AddMultiStringPolicy(self, parent, name):
'''Generates ADMX elements for a multi-line String-Policy and adds them to
the passed parent node.
'''
# We currently also show a single-line textbox - see http://crbug/829328
self._AddStringPolicy(parent, name, id=name + '_Legacy')
attributes = {
... | Generates ADMX elements for a multi-line String-Policy and adds them to
the passed parent node.
| Generates ADMX elements for a multi-line String-Policy and adds them to
the passed parent node. | [
"Generates",
"ADMX",
"elements",
"for",
"a",
"multi",
"-",
"line",
"String",
"-",
"Policy",
"and",
"adds",
"them",
"to",
"the",
"passed",
"parent",
"node",
"."
] | def _AddMultiStringPolicy(self, parent, name):
self._AddStringPolicy(parent, name, id=name + '_Legacy')
attributes = {
'id': name,
'valueName': name,
'maxLength': '1000000',
}
self.AddElement(parent, 'multiText', attributes) | [
"def",
"_AddMultiStringPolicy",
"(",
"self",
",",
"parent",
",",
"name",
")",
":",
"self",
".",
"_AddStringPolicy",
"(",
"parent",
",",
"name",
",",
"id",
"=",
"name",
"+",
"'_Legacy'",
")",
"attributes",
"=",
"{",
"'id'",
":",
"name",
",",
"'valueName'"... | Generates ADMX elements for a multi-line String-Policy and adds them to
the passed parent node. | [
"Generates",
"ADMX",
"elements",
"for",
"a",
"multi",
"-",
"line",
"String",
"-",
"Policy",
"and",
"adds",
"them",
"to",
"the",
"passed",
"parent",
"node",
"."
] | [
"'''Generates ADMX elements for a multi-line String-Policy and adds them to\n the passed parent node.\n '''",
"# We currently also show a single-line textbox - see http://crbug/829328"
] | [
{
"param": "self",
"type": null
},
{
"param": "parent",
"type": null
},
{
"param": "name",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "parent",
"type": null,
"docstring": null,
"docstring_tokens":... |
d6dbf4fbc99b5c55b720ec26eba9d1fb02748f62 | sunlongbo/chromium | components/policy/tools/template_writers/writers/admx_writer.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | _AddIntPolicy | null | def _AddIntPolicy(self, parent, policy):
'''Generates ADMX elements for an Int-Policy and adds them to the passed
parent node.
'''
#default max value for an integer
max = 2000000000
min = 0
if self.PolicyHasRestrictions(policy):
schema = policy['schema']
if 'minimum' in schema an... | Generates ADMX elements for an Int-Policy and adds them to the passed
parent node.
| Generates ADMX elements for an Int-Policy and adds them to the passed
parent node. | [
"Generates",
"ADMX",
"elements",
"for",
"an",
"Int",
"-",
"Policy",
"and",
"adds",
"them",
"to",
"the",
"passed",
"parent",
"node",
"."
] | def _AddIntPolicy(self, parent, policy):
max = 2000000000
min = 0
if self.PolicyHasRestrictions(policy):
schema = policy['schema']
if 'minimum' in schema and schema['minimum'] >= 0:
min = schema['minimum']
if 'maximum' in schema and schema['maximum'] >= 0:
max = schema['max... | [
"def",
"_AddIntPolicy",
"(",
"self",
",",
"parent",
",",
"policy",
")",
":",
"max",
"=",
"2000000000",
"min",
"=",
"0",
"if",
"self",
".",
"PolicyHasRestrictions",
"(",
"policy",
")",
":",
"schema",
"=",
"policy",
"[",
"'schema'",
"]",
"if",
"'minimum'",... | Generates ADMX elements for an Int-Policy and adds them to the passed
parent node. | [
"Generates",
"ADMX",
"elements",
"for",
"an",
"Int",
"-",
"Policy",
"and",
"adds",
"them",
"to",
"the",
"passed",
"parent",
"node",
"."
] | [
"'''Generates ADMX elements for an Int-Policy and adds them to the passed\n parent node.\n '''",
"#default max value for an integer"
] | [
{
"param": "self",
"type": null
},
{
"param": "parent",
"type": null
},
{
"param": "policy",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "parent",
"type": null,
"docstring": null,
"docstring_tokens":... |
d6dbf4fbc99b5c55b720ec26eba9d1fb02748f62 | sunlongbo/chromium | components/policy/tools/template_writers/writers/admx_writer.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | _AddEnumPolicy | null | def _AddEnumPolicy(self, parent, policy):
'''Generates ADMX elements for an Enum-Policy and adds them to the
passed parent element.
'''
name = policy['name']
items = policy['items']
attributes = {
'id': name,
'valueName': name,
}
enum_elem = self.AddElement(parent, 'enum'... | Generates ADMX elements for an Enum-Policy and adds them to the
passed parent element.
| Generates ADMX elements for an Enum-Policy and adds them to the
passed parent element. | [
"Generates",
"ADMX",
"elements",
"for",
"an",
"Enum",
"-",
"Policy",
"and",
"adds",
"them",
"to",
"the",
"passed",
"parent",
"element",
"."
] | def _AddEnumPolicy(self, parent, policy):
name = policy['name']
items = policy['items']
attributes = {
'id': name,
'valueName': name,
}
enum_elem = self.AddElement(parent, 'enum', attributes)
for item in items:
attributes = {'displayName': self._AdmlString(name + "_" + item... | [
"def",
"_AddEnumPolicy",
"(",
"self",
",",
"parent",
",",
"policy",
")",
":",
"name",
"=",
"policy",
"[",
"'name'",
"]",
"items",
"=",
"policy",
"[",
"'items'",
"]",
"attributes",
"=",
"{",
"'id'",
":",
"name",
",",
"'valueName'",
":",
"name",
",",
"... | Generates ADMX elements for an Enum-Policy and adds them to the
passed parent element. | [
"Generates",
"ADMX",
"elements",
"for",
"an",
"Enum",
"-",
"Policy",
"and",
"adds",
"them",
"to",
"the",
"passed",
"parent",
"element",
"."
] | [
"'''Generates ADMX elements for an Enum-Policy and adds them to the\n passed parent element.\n '''"
] | [
{
"param": "self",
"type": null
},
{
"param": "parent",
"type": null
},
{
"param": "policy",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "parent",
"type": null,
"docstring": null,
"docstring_tokens":... |
d6dbf4fbc99b5c55b720ec26eba9d1fb02748f62 | sunlongbo/chromium | components/policy/tools/template_writers/writers/admx_writer.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | _AddListPolicy | null | def _AddListPolicy(self, parent, key, name):
'''Generates ADMX XML elements for a List-Policy and adds them to the
passed parent element.
'''
attributes = {
# The ID must be in sync with ID of the corresponding element in the
# ADML file.
'id': name + 'Desc',
'valuePrefix... | Generates ADMX XML elements for a List-Policy and adds them to the
passed parent element.
| Generates ADMX XML elements for a List-Policy and adds them to the
passed parent element. | [
"Generates",
"ADMX",
"XML",
"elements",
"for",
"a",
"List",
"-",
"Policy",
"and",
"adds",
"them",
"to",
"the",
"passed",
"parent",
"element",
"."
] | def _AddListPolicy(self, parent, key, name):
attributes = {
'id': name + 'Desc',
'valuePrefix': '',
'key': key + '\\' + name,
}
self.AddElement(parent, 'list', attributes) | [
"def",
"_AddListPolicy",
"(",
"self",
",",
"parent",
",",
"key",
",",
"name",
")",
":",
"attributes",
"=",
"{",
"'id'",
":",
"name",
"+",
"'Desc'",
",",
"'valuePrefix'",
":",
"''",
",",
"'key'",
":",
"key",
"+",
"'\\\\'",
"+",
"name",
",",
"}",
"se... | Generates ADMX XML elements for a List-Policy and adds them to the
passed parent element. | [
"Generates",
"ADMX",
"XML",
"elements",
"for",
"a",
"List",
"-",
"Policy",
"and",
"adds",
"them",
"to",
"the",
"passed",
"parent",
"element",
"."
] | [
"'''Generates ADMX XML elements for a List-Policy and adds them to the\n passed parent element.\n '''",
"# The ID must be in sync with ID of the corresponding element in the",
"# ADML file."
] | [
{
"param": "self",
"type": null
},
{
"param": "parent",
"type": null
},
{
"param": "key",
"type": null
},
{
"param": "name",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "parent",
"type": null,
"docstring": null,
"docstring_tokens":... |
d6dbf4fbc99b5c55b720ec26eba9d1fb02748f62 | sunlongbo/chromium | components/policy/tools/template_writers/writers/admx_writer.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | _AddMainPolicy | null | def _AddMainPolicy(self, parent):
'''Generates ADMX elements for a Main-Policy amd adds them to the
passed parent element.
'''
enabled_value_elem = self.AddElement(parent, 'enabledValue')
self.AddElement(enabled_value_elem, 'decimal', {'value': '1'})
disabled_value_elem = self.AddElement(parent,... | Generates ADMX elements for a Main-Policy amd adds them to the
passed parent element.
| Generates ADMX elements for a Main-Policy amd adds them to the
passed parent element. | [
"Generates",
"ADMX",
"elements",
"for",
"a",
"Main",
"-",
"Policy",
"amd",
"adds",
"them",
"to",
"the",
"passed",
"parent",
"element",
"."
] | def _AddMainPolicy(self, parent):
enabled_value_elem = self.AddElement(parent, 'enabledValue')
self.AddElement(enabled_value_elem, 'decimal', {'value': '1'})
disabled_value_elem = self.AddElement(parent, 'disabledValue')
self.AddElement(disabled_value_elem, 'decimal', {'value': '0'}) | [
"def",
"_AddMainPolicy",
"(",
"self",
",",
"parent",
")",
":",
"enabled_value_elem",
"=",
"self",
".",
"AddElement",
"(",
"parent",
",",
"'enabledValue'",
")",
"self",
".",
"AddElement",
"(",
"enabled_value_elem",
",",
"'decimal'",
",",
"{",
"'value'",
":",
... | Generates ADMX elements for a Main-Policy amd adds them to the
passed parent element. | [
"Generates",
"ADMX",
"elements",
"for",
"a",
"Main",
"-",
"Policy",
"amd",
"adds",
"them",
"to",
"the",
"passed",
"parent",
"element",
"."
] | [
"'''Generates ADMX elements for a Main-Policy amd adds them to the\n passed parent element.\n '''"
] | [
{
"param": "self",
"type": null
},
{
"param": "parent",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "parent",
"type": null,
"docstring": null,
"docstring_tokens":... |
d6dbf4fbc99b5c55b720ec26eba9d1fb02748f62 | sunlongbo/chromium | components/policy/tools/template_writers/writers/admx_writer.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | _WritePolicy | null | def _WritePolicy(self, policy, name, key, parent):
'''Generates ADMX elements for a Policy.'''
policies_elem = self._active_policies_elem
policy_name = policy['name']
attributes = {
'name': name,
'class': self.GetClass(policy),
'displayName': self._AdmlString(policy_name),
... | Generates ADMX elements for a Policy. | Generates ADMX elements for a Policy. | [
"Generates",
"ADMX",
"elements",
"for",
"a",
"Policy",
"."
] | def _WritePolicy(self, policy, name, key, parent):
policies_elem = self._active_policies_elem
policy_name = policy['name']
attributes = {
'name': name,
'class': self.GetClass(policy),
'displayName': self._AdmlString(policy_name),
'explainText': self._AdmlStringExplain(policy_... | [
"def",
"_WritePolicy",
"(",
"self",
",",
"policy",
",",
"name",
",",
"key",
",",
"parent",
")",
":",
"policies_elem",
"=",
"self",
".",
"_active_policies_elem",
"policy_name",
"=",
"policy",
"[",
"'name'",
"]",
"attributes",
"=",
"{",
"'name'",
":",
"name"... | Generates ADMX elements for a Policy. | [
"Generates",
"ADMX",
"elements",
"for",
"a",
"Policy",
"."
] | [
"'''Generates ADMX elements for a Policy.'''",
"# Store the current \"policy\" AMDX element in self for later use by the",
"# WritePolicy method."
] | [
{
"param": "self",
"type": null
},
{
"param": "policy",
"type": null
},
{
"param": "name",
"type": null
},
{
"param": "key",
"type": null
},
{
"param": "parent",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "policy",
"type": null,
"docstring": null,
"docstring_tokens":... |
d6dbf4fbc99b5c55b720ec26eba9d1fb02748f62 | sunlongbo/chromium | components/policy/tools/template_writers/writers/admx_writer.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | _BeginPolicyGroup | null | def _BeginPolicyGroup(self, group, name, parent):
'''Generates ADMX elements for a Policy-Group.
'''
attributes = {
'name': name,
'displayName': self._AdmlString(group['name'] + '_group'),
}
category_elem = self.AddElement(self._categories_elem, 'category',
... | Generates ADMX elements for a Policy-Group.
| Generates ADMX elements for a Policy-Group. | [
"Generates",
"ADMX",
"elements",
"for",
"a",
"Policy",
"-",
"Group",
"."
] | def _BeginPolicyGroup(self, group, name, parent):
attributes = {
'name': name,
'displayName': self._AdmlString(group['name'] + '_group'),
}
category_elem = self.AddElement(self._categories_elem, 'category',
attributes)
attributes = {'ref': parent}
... | [
"def",
"_BeginPolicyGroup",
"(",
"self",
",",
"group",
",",
"name",
",",
"parent",
")",
":",
"attributes",
"=",
"{",
"'name'",
":",
"name",
",",
"'displayName'",
":",
"self",
".",
"_AdmlString",
"(",
"group",
"[",
"'name'",
"]",
"+",
"'_group'",
")",
"... | Generates ADMX elements for a Policy-Group. | [
"Generates",
"ADMX",
"elements",
"for",
"a",
"Policy",
"-",
"Group",
"."
] | [
"'''Generates ADMX elements for a Policy-Group.\n '''"
] | [
{
"param": "self",
"type": null
},
{
"param": "group",
"type": null
},
{
"param": "name",
"type": null
},
{
"param": "parent",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "group",
"type": null,
"docstring": null,
"docstring_tokens": ... |
d6dbf4fbc99b5c55b720ec26eba9d1fb02748f62 | sunlongbo/chromium | components/policy/tools/template_writers/writers/admx_writer.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | BeginTemplate | null | def BeginTemplate(self):
'''Generates the skeleton of the ADMX template. An ADMX template contains
an ADMX "PolicyDefinitions" element with four child nodes: "policies"
"policyNamspaces", "resources", "supportedOn" and "categories"
'''
dom_impl = minidom.getDOMImplementation('')
self._doc = dom_... | Generates the skeleton of the ADMX template. An ADMX template contains
an ADMX "PolicyDefinitions" element with four child nodes: "policies"
"policyNamspaces", "resources", "supportedOn" and "categories"
| Generates the skeleton of the ADMX template. | [
"Generates",
"the",
"skeleton",
"of",
"the",
"ADMX",
"template",
"."
] | def BeginTemplate(self):
dom_impl = minidom.getDOMImplementation('')
self._doc = dom_impl.createDocument(None, 'policyDefinitions', None)
if self._GetChromiumVersionString() is not None:
self.AddComment(self._doc.documentElement, self.config['build'] + \
' version: ' + self._GetChromiumVersi... | [
"def",
"BeginTemplate",
"(",
"self",
")",
":",
"dom_impl",
"=",
"minidom",
".",
"getDOMImplementation",
"(",
"''",
")",
"self",
".",
"_doc",
"=",
"dom_impl",
".",
"createDocument",
"(",
"None",
",",
"'policyDefinitions'",
",",
"None",
")",
"if",
"self",
".... | Generates the skeleton of the ADMX template. | [
"Generates",
"the",
"skeleton",
"of",
"the",
"ADMX",
"template",
"."
] | [
"'''Generates the skeleton of the ADMX template. An ADMX template contains\n an ADMX \"PolicyDefinitions\" element with four child nodes: \"policies\"\n \"policyNamspaces\", \"resources\", \"supportedOn\" and \"categories\"\n '''"
] | [
{
"param": "self",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
00b0b8bc08528b780316550a85f6f969d81cf856 | sunlongbo/chromium | gpu/ipc/common/generate_vulkan_types.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | main | <not_specific> | def main(argv):
"""This is the main function."""
parser = optparse.OptionParser()
parser.add_option(
"--output-dir",
help="Output directory for generated files. Defaults to this script's "
"directory.")
parser.add_option(
"-c", "--check", action="store_true",
help="Check if output... | This is the main function. | This is the main function. | [
"This",
"is",
"the",
"main",
"function",
"."
] | def main(argv):
parser = optparse.OptionParser()
parser.add_option(
"--output-dir",
help="Output directory for generated files. Defaults to this script's "
"directory.")
parser.add_option(
"-c", "--check", action="store_true",
help="Check if output files match generated files in chro... | [
"def",
"main",
"(",
"argv",
")",
":",
"parser",
"=",
"optparse",
".",
"OptionParser",
"(",
")",
"parser",
".",
"add_option",
"(",
"\"--output-dir\"",
",",
"help",
"=",
"\"Output directory for generated files. Defaults to this script's \"",
"\"directory.\"",
")",
"pars... | This is the main function. | [
"This",
"is",
"the",
"main",
"function",
"."
] | [
"\"\"\"This is the main function.\"\"\"",
"# Support generating files for PRESUBMIT."
] | [
{
"param": "argv",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "argv",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
00c11a7cdf612173ce4240f399d2a6211f473388 | sunlongbo/chromium | third_party/blink/renderer/bindings/scripts/bind_gen/codegen_context.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | init | <not_specific> | def init(cls):
"""Initialize the class. Must be called exactly once."""
assert not hasattr(cls, "_was_initialized"), "Do not call twice."
cls._was_initialized = True
# List of
# attribute name: default value
cls._context_attrs = {
# Top-level definition
... | Initialize the class. Must be called exactly once. | Initialize the class. Must be called exactly once. | [
"Initialize",
"the",
"class",
".",
"Must",
"be",
"called",
"exactly",
"once",
"."
] | def init(cls):
assert not hasattr(cls, "_was_initialized"), "Do not call twice."
cls._was_initialized = True
cls._context_attrs = {
"callback_function": None,
"callback_interface": None,
"dictionary": None,
"enumeration": None,
"interfa... | [
"def",
"init",
"(",
"cls",
")",
":",
"assert",
"not",
"hasattr",
"(",
"cls",
",",
"\"_was_initialized\"",
")",
",",
"\"Do not call twice.\"",
"cls",
".",
"_was_initialized",
"=",
"True",
"cls",
".",
"_context_attrs",
"=",
"{",
"\"callback_function\"",
":",
"No... | Initialize the class. | [
"Initialize",
"the",
"class",
"."
] | [
"\"\"\"Initialize the class. Must be called exactly once.\"\"\"",
"# List of",
"# attribute name: default value",
"# Top-level definition",
"# Class-member-ish definition",
"# Special member-ish definition",
"# Cache of a tuple of dictionary._DictionaryMember for the own",
"# members of the diction... | [
{
"param": "cls",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "cls",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
00c11a7cdf612173ce4240f399d2a6211f473388 | sunlongbo/chromium | third_party/blink/renderer/bindings/scripts/bind_gen/codegen_context.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | make_copy | <not_specific> | def make_copy(self, **kwargs):
"""
Returns a copy of this context applying the updates given as the
arguments.
"""
for arg in kwargs.keys():
assert arg in self._context_attrs, "Unknown argument: {}".format(
arg)
new_object = copy.copy(self)
... |
Returns a copy of this context applying the updates given as the
arguments.
| Returns a copy of this context applying the updates given as the
arguments. | [
"Returns",
"a",
"copy",
"of",
"this",
"context",
"applying",
"the",
"updates",
"given",
"as",
"the",
"arguments",
"."
] | def make_copy(self, **kwargs):
for arg in kwargs.keys():
assert arg in self._context_attrs, "Unknown argument: {}".format(
arg)
new_object = copy.copy(self)
for attr, new_value in kwargs.items():
old_value = getattr(self, attr)
assert old_value... | [
"def",
"make_copy",
"(",
"self",
",",
"**",
"kwargs",
")",
":",
"for",
"arg",
"in",
"kwargs",
".",
"keys",
"(",
")",
":",
"assert",
"arg",
"in",
"self",
".",
"_context_attrs",
",",
"\"Unknown argument: {}\"",
".",
"format",
"(",
"arg",
")",
"new_object",... | Returns a copy of this context applying the updates given as the
arguments. | [
"Returns",
"a",
"copy",
"of",
"this",
"context",
"applying",
"the",
"updates",
"given",
"as",
"the",
"arguments",
"."
] | [
"\"\"\"\n Returns a copy of this context applying the updates given as the\n arguments.\n \"\"\""
] | [
{
"param": "self",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
00c11a7cdf612173ce4240f399d2a6211f473388 | sunlongbo/chromium | third_party/blink/renderer/bindings/scripts/bind_gen/codegen_context.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | template_bindings | <not_specific> | def template_bindings(self):
"""
Returns a bindings object to be passed into
|CodeNode.add_template_vars|. Only properties with a non-None value are
bound so that it's easy to detect invalid use cases (use of an unbound
template variable raises a NameError).
"""
... |
Returns a bindings object to be passed into
|CodeNode.add_template_vars|. Only properties with a non-None value are
bound so that it's easy to detect invalid use cases (use of an unbound
template variable raises a NameError).
| Returns a bindings object to be passed into
|CodeNode.add_template_vars|. Only properties with a non-None value are
bound so that it's easy to detect invalid use cases (use of an unbound
template variable raises a NameError). | [
"Returns",
"a",
"bindings",
"object",
"to",
"be",
"passed",
"into",
"|CodeNode",
".",
"add_template_vars|",
".",
"Only",
"properties",
"with",
"a",
"non",
"-",
"None",
"value",
"are",
"bound",
"so",
"that",
"it",
"'",
"s",
"easy",
"to",
"detect",
"invalid"... | def template_bindings(self):
bindings = {}
for attr in self._context_attrs.keys():
value = getattr(self, attr)
if value is None:
value = NonRenderable(attr)
bindings[attr] = value
for attr in self._computational_attrs:
value = getat... | [
"def",
"template_bindings",
"(",
"self",
")",
":",
"bindings",
"=",
"{",
"}",
"for",
"attr",
"in",
"self",
".",
"_context_attrs",
".",
"keys",
"(",
")",
":",
"value",
"=",
"getattr",
"(",
"self",
",",
"attr",
")",
"if",
"value",
"is",
"None",
":",
... | Returns a bindings object to be passed into
|CodeNode.add_template_vars|. | [
"Returns",
"a",
"bindings",
"object",
"to",
"be",
"passed",
"into",
"|CodeNode",
".",
"add_template_vars|",
"."
] | [
"\"\"\"\n Returns a bindings object to be passed into\n |CodeNode.add_template_vars|. Only properties with a non-None value are\n bound so that it's easy to detect invalid use cases (use of an unbound\n template variable raises a NameError).\n \"\"\""
] | [
{
"param": "self",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
f1f37cd8d02ff168b1e52736e9efa38c00997904 | sunlongbo/chromium | tools/cr/cr/commands/command.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | Select | <not_specific> | def Select(cls):
"""Called to select which command is active.
This picks a command based on the first non - argument on the command
line.
Returns:
the selected command, or None if not specified on the command line.
"""
if cr.context.args:
return getattr(cr.context.args, '_command', ... | Called to select which command is active.
This picks a command based on the first non - argument on the command
line.
Returns:
the selected command, or None if not specified on the command line.
| Called to select which command is active.
This picks a command based on the first non - argument on the command
line. | [
"Called",
"to",
"select",
"which",
"command",
"is",
"active",
".",
"This",
"picks",
"a",
"command",
"based",
"on",
"the",
"first",
"non",
"-",
"argument",
"on",
"the",
"command",
"line",
"."
] | def Select(cls):
if cr.context.args:
return getattr(cr.context.args, '_command', None)
return None | [
"def",
"Select",
"(",
"cls",
")",
":",
"if",
"cr",
".",
"context",
".",
"args",
":",
"return",
"getattr",
"(",
"cr",
".",
"context",
".",
"args",
",",
"'_command'",
",",
"None",
")",
"return",
"None"
] | Called to select which command is active. | [
"Called",
"to",
"select",
"which",
"command",
"is",
"active",
"."
] | [
"\"\"\"Called to select which command is active.\n\n This picks a command based on the first non - argument on the command\n line.\n Returns:\n the selected command, or None if not specified on the command line.\n \"\"\""
] | [
{
"param": "cls",
"type": null
}
] | {
"returns": [
{
"docstring": "the selected command, or None if not specified on the command line.",
"docstring_tokens": [
"the",
"selected",
"command",
"or",
"None",
"if",
"not",
"specified",
"on",
"the",
"command... |
f1f37cd8d02ff168b1e52736e9efa38c00997904 | sunlongbo/chromium | tools/cr/cr/commands/command.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | AddArguments | <not_specific> | def AddArguments(self, subparsers):
"""Add arguments to the command line parser.
Called by the main function to add the command to the command line parser.
Commands that override this function to add more arguments must invoke
this method.
Args:
subparsers: The argparse subparser manager to a... | Add arguments to the command line parser.
Called by the main function to add the command to the command line parser.
Commands that override this function to add more arguments must invoke
this method.
Args:
subparsers: The argparse subparser manager to add this command to.
Returns:
the ... | Add arguments to the command line parser.
Called by the main function to add the command to the command line parser.
Commands that override this function to add more arguments must invoke
this method. | [
"Add",
"arguments",
"to",
"the",
"command",
"line",
"parser",
".",
"Called",
"by",
"the",
"main",
"function",
"to",
"add",
"the",
"command",
"to",
"the",
"command",
"line",
"parser",
".",
"Commands",
"that",
"override",
"this",
"function",
"to",
"add",
"mo... | def AddArguments(self, subparsers):
self.parser = subparsers.add_parser(
self.name,
add_help=False,
help=self.help,
description=self.description or self.help,
epilog=self.epilog,
)
self.parser.set_defaults(_command=self)
cr.context.AddCommonArguments(self.parser)
... | [
"def",
"AddArguments",
"(",
"self",
",",
"subparsers",
")",
":",
"self",
".",
"parser",
"=",
"subparsers",
".",
"add_parser",
"(",
"self",
".",
"name",
",",
"add_help",
"=",
"False",
",",
"help",
"=",
"self",
".",
"help",
",",
"description",
"=",
"self... | Add arguments to the command line parser. | [
"Add",
"arguments",
"to",
"the",
"command",
"line",
"parser",
"."
] | [
"\"\"\"Add arguments to the command line parser.\n\n Called by the main function to add the command to the command line parser.\n Commands that override this function to add more arguments must invoke\n this method.\n Args:\n subparsers: The argparse subparser manager to add this command to.\n R... | [
{
"param": "self",
"type": null
},
{
"param": "subparsers",
"type": null
}
] | {
"returns": [
{
"docstring": "the parser that was built for the command.",
"docstring_tokens": [
"the",
"parser",
"that",
"was",
"built",
"for",
"the",
"command",
"."
],
"type": null
}
],
"raises": [],
"para... |
f1f37cd8d02ff168b1e52736e9efa38c00997904 | sunlongbo/chromium | tools/cr/cr/commands/command.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | ConsumeArgs | null | def ConsumeArgs(self, parser, reason):
"""Adds a remaining argument consumer to the parser.
A helper method that commands can use to consume all remaining arguments.
Use for things like lists of targets.
Args:
parser: The parser to consume remains for.
reason: The reason to give the user in... | Adds a remaining argument consumer to the parser.
A helper method that commands can use to consume all remaining arguments.
Use for things like lists of targets.
Args:
parser: The parser to consume remains for.
reason: The reason to give the user in the help text.
| Adds a remaining argument consumer to the parser.
A helper method that commands can use to consume all remaining arguments.
Use for things like lists of targets. | [
"Adds",
"a",
"remaining",
"argument",
"consumer",
"to",
"the",
"parser",
".",
"A",
"helper",
"method",
"that",
"commands",
"can",
"use",
"to",
"consume",
"all",
"remaining",
"arguments",
".",
"Use",
"for",
"things",
"like",
"lists",
"of",
"targets",
"."
] | def ConsumeArgs(self, parser, reason):
parser.add_argument(
'_remains', metavar='arguments',
nargs=argparse.REMAINDER,
help='The additional arguments to {0}.'.format(reason)
) | [
"def",
"ConsumeArgs",
"(",
"self",
",",
"parser",
",",
"reason",
")",
":",
"parser",
".",
"add_argument",
"(",
"'_remains'",
",",
"metavar",
"=",
"'arguments'",
",",
"nargs",
"=",
"argparse",
".",
"REMAINDER",
",",
"help",
"=",
"'The additional arguments to {0... | Adds a remaining argument consumer to the parser. | [
"Adds",
"a",
"remaining",
"argument",
"consumer",
"to",
"the",
"parser",
"."
] | [
"\"\"\"Adds a remaining argument consumer to the parser.\n\n A helper method that commands can use to consume all remaining arguments.\n Use for things like lists of targets.\n Args:\n parser: The parser to consume remains for.\n reason: The reason to give the user in the help text.\n \"\"\""
... | [
{
"param": "self",
"type": null
},
{
"param": "parser",
"type": null
},
{
"param": "reason",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "parser",
"type": null,
"docstring": "The parser to consume remains ... |
f1f37cd8d02ff168b1e52736e9efa38c00997904 | sunlongbo/chromium | tools/cr/cr/commands/command.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | EarlyArgProcessing | null | def EarlyArgProcessing(self):
"""Called to make decisions based on speculative argument parsing.
When this method is called, enough of the command line parsing has been
done that the command is selected. This allows the command to make any
modifications needed before the final argument parsing is done.... | Called to make decisions based on speculative argument parsing.
When this method is called, enough of the command line parsing has been
done that the command is selected. This allows the command to make any
modifications needed before the final argument parsing is done.
| Called to make decisions based on speculative argument parsing.
When this method is called, enough of the command line parsing has been
done that the command is selected. This allows the command to make any
modifications needed before the final argument parsing is done. | [
"Called",
"to",
"make",
"decisions",
"based",
"on",
"speculative",
"argument",
"parsing",
".",
"When",
"this",
"method",
"is",
"called",
"enough",
"of",
"the",
"command",
"line",
"parsing",
"has",
"been",
"done",
"that",
"the",
"command",
"is",
"selected",
"... | def EarlyArgProcessing(self):
cr.base.client.ApplyOutArgument() | [
"def",
"EarlyArgProcessing",
"(",
"self",
")",
":",
"cr",
".",
"base",
".",
"client",
".",
"ApplyOutArgument",
"(",
")"
] | Called to make decisions based on speculative argument parsing. | [
"Called",
"to",
"make",
"decisions",
"based",
"on",
"speculative",
"argument",
"parsing",
"."
] | [
"\"\"\"Called to make decisions based on speculative argument parsing.\n\n When this method is called, enough of the command line parsing has been\n done that the command is selected. This allows the command to make any\n modifications needed before the final argument parsing is done.\n \"\"\""
] | [
{
"param": "self",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
f1f37cd8d02ff168b1e52736e9efa38c00997904 | sunlongbo/chromium | tools/cr/cr/commands/command.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | Run | null | def Run(self):
"""The main method of the command.
This is the only thing that a command has to implement, and it should not
call this base version.
"""
raise NotImplementedError('Must be overridden.') | The main method of the command.
This is the only thing that a command has to implement, and it should not
call this base version.
| The main method of the command.
This is the only thing that a command has to implement, and it should not
call this base version. | [
"The",
"main",
"method",
"of",
"the",
"command",
".",
"This",
"is",
"the",
"only",
"thing",
"that",
"a",
"command",
"has",
"to",
"implement",
"and",
"it",
"should",
"not",
"call",
"this",
"base",
"version",
"."
] | def Run(self):
raise NotImplementedError('Must be overridden.') | [
"def",
"Run",
"(",
"self",
")",
":",
"raise",
"NotImplementedError",
"(",
"'Must be overridden.'",
")"
] | The main method of the command. | [
"The",
"main",
"method",
"of",
"the",
"command",
"."
] | [
"\"\"\"The main method of the command.\n\n This is the only thing that a command has to implement, and it should not\n call this base version.\n \"\"\""
] | [
{
"param": "self",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
bcb6875190c8910ea58f78f9888bd3067afd988a | sunlongbo/chromium | third_party/blink/tools/blinkpy/web_tests/stale_expectation_removal/builders_unittest.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | testMatch | null | def testMatch(self):
"""Tests that a match can be successfully found."""
test_map = {
'isolated_scripts': [
{
'isolate_name': 'blink_web_tests',
},
],
}
self.assertTrue(
self.instance._BuilderRunsTest... | Tests that a match can be successfully found. | Tests that a match can be successfully found. | [
"Tests",
"that",
"a",
"match",
"can",
"be",
"successfully",
"found",
"."
] | def testMatch(self):
test_map = {
'isolated_scripts': [
{
'isolate_name': 'blink_web_tests',
},
],
}
self.assertTrue(
self.instance._BuilderRunsTestOfInterest(test_map, None)) | [
"def",
"testMatch",
"(",
"self",
")",
":",
"test_map",
"=",
"{",
"'isolated_scripts'",
":",
"[",
"{",
"'isolate_name'",
":",
"'blink_web_tests'",
",",
"}",
",",
"]",
",",
"}",
"self",
".",
"assertTrue",
"(",
"self",
".",
"instance",
".",
"_BuilderRunsTestO... | Tests that a match can be successfully found. | [
"Tests",
"that",
"a",
"match",
"can",
"be",
"successfully",
"found",
"."
] | [
"\"\"\"Tests that a match can be successfully found.\"\"\"",
"# Re-add once WebGPU tests are supported.",
"# test_map = {",
"# 'isolated_scripts': [",
"# {",
"# 'isolate_name': 'webgpu_blink_web_tests',",
"# },",
"# ],",
"# }",
"# self.assertTrue(",
"# sel... | [
{
"param": "self",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
bcd1685e5cc91a3b2475d4daf0832b10d883c823 | sunlongbo/chromium | third_party/android_platform/development/scripts/stack.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | PrintUsage | null | def PrintUsage():
"""Print usage and exit with error."""
print()
print(" usage: " + sys.argv[0] + " [options] [FILE]")
print()
print(" --symbols-dir=path")
print(" the path to a symbols dir, such as")
print(" =/tmp/out/target/product/dream/symbols")
print()
print(" --chrome-symbols-dir=... | Print usage and exit with error. | Print usage and exit with error. | [
"Print",
"usage",
"and",
"exit",
"with",
"error",
"."
] | def PrintUsage():
print()
print(" usage: " + sys.argv[0] + " [options] [FILE]")
print()
print(" --symbols-dir=path")
print(" the path to a symbols dir, such as")
print(" =/tmp/out/target/product/dream/symbols")
print()
print(" --chrome-symbols-dir=path")
print(" the path to a Chro... | [
"def",
"PrintUsage",
"(",
")",
":",
"print",
"(",
")",
"print",
"(",
"\" usage: \"",
"+",
"sys",
".",
"argv",
"[",
"0",
"]",
"+",
"\" [options] [FILE]\"",
")",
"print",
"(",
")",
"print",
"(",
"\" --symbols-dir=path\"",
")",
"print",
"(",
"\" the p... | Print usage and exit with error. | [
"Print",
"usage",
"and",
"exit",
"with",
"error",
"."
] | [
"\"\"\"Print usage and exit with error.\"\"\""
] | [] | {
"returns": [],
"raises": [],
"params": [],
"outlier_params": [],
"others": []
} |
bcd1685e5cc91a3b2475d4daf0832b10d883c823 | sunlongbo/chromium | third_party/android_platform/development/scripts/stack.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | UnzipSymbols | <not_specific> | def UnzipSymbols(symbolfile, symdir=None):
"""Unzips a file to DEFAULT_SYMROOT and returns the unzipped location.
Args:
symbolfile: The .zip file to unzip
symdir: Optional temporary directory to use for extraction
Returns:
A tuple containing (the directory into which the zip file was unzipped,
t... | Unzips a file to DEFAULT_SYMROOT and returns the unzipped location.
Args:
symbolfile: The .zip file to unzip
symdir: Optional temporary directory to use for extraction
Returns:
A tuple containing (the directory into which the zip file was unzipped,
the path to the "symbols" directory in the unzipp... | Unzips a file to DEFAULT_SYMROOT and returns the unzipped location. | [
"Unzips",
"a",
"file",
"to",
"DEFAULT_SYMROOT",
"and",
"returns",
"the",
"unzipped",
"location",
"."
] | def UnzipSymbols(symbolfile, symdir=None):
if not symdir:
symdir = "%s/%s" % (DEFAULT_SYMROOT, hash(symbolfile))
if not os.path.exists(symdir):
os.makedirs(symdir)
logging.info('extracting %s...', symbolfile)
saveddir = os.getcwd()
os.chdir(symdir)
try:
unzipcode = subprocess.call(["unzip", "-qq... | [
"def",
"UnzipSymbols",
"(",
"symbolfile",
",",
"symdir",
"=",
"None",
")",
":",
"if",
"not",
"symdir",
":",
"symdir",
"=",
"\"%s/%s\"",
"%",
"(",
"DEFAULT_SYMROOT",
",",
"hash",
"(",
"symbolfile",
")",
")",
"if",
"not",
"os",
".",
"path",
".",
"exists"... | Unzips a file to DEFAULT_SYMROOT and returns the unzipped location. | [
"Unzips",
"a",
"file",
"to",
"DEFAULT_SYMROOT",
"and",
"returns",
"the",
"unzipped",
"location",
"."
] | [
"\"\"\"Unzips a file to DEFAULT_SYMROOT and returns the unzipped location.\n\n Args:\n symbolfile: The .zip file to unzip\n symdir: Optional temporary directory to use for extraction\n\n Returns:\n A tuple containing (the directory into which the zip file was unzipped,\n the path to the \"symbols\" di... | [
{
"param": "symbolfile",
"type": null
},
{
"param": "symdir",
"type": null
}
] | {
"returns": [
{
"docstring": "A tuple containing (the directory into which the zip file was unzipped,\nthe path to the \"symbols\" directory in the unzipped file). To clean\nup, the caller can delete the first element of the tuple.",
"docstring_tokens": [
"A",
"tuple",
"conta... |
075ef0ef1f71f359dd18247cf3c3cb2706c8f86f | sunlongbo/chromium | third_party/blink/tools/blinkpy/common/checkout/baseline_optimizer.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | write_by_directory | null | def write_by_directory(self, results_by_directory, writer, indent):
"""Logs results_by_directory in a pretty format."""
for path in sorted(results_by_directory):
writer('%s%s: %s' % (indent, self._platform(path),
results_by_directory[path])) | Logs results_by_directory in a pretty format. | Logs results_by_directory in a pretty format. | [
"Logs",
"results_by_directory",
"in",
"a",
"pretty",
"format",
"."
] | def write_by_directory(self, results_by_directory, writer, indent):
for path in sorted(results_by_directory):
writer('%s%s: %s' % (indent, self._platform(path),
results_by_directory[path])) | [
"def",
"write_by_directory",
"(",
"self",
",",
"results_by_directory",
",",
"writer",
",",
"indent",
")",
":",
"for",
"path",
"in",
"sorted",
"(",
"results_by_directory",
")",
":",
"writer",
"(",
"'%s%s: %s'",
"%",
"(",
"indent",
",",
"self",
".",
"_platform... | Logs results_by_directory in a pretty format. | [
"Logs",
"results_by_directory",
"in",
"a",
"pretty",
"format",
"."
] | [
"\"\"\"Logs results_by_directory in a pretty format.\"\"\""
] | [
{
"param": "self",
"type": null
},
{
"param": "results_by_directory",
"type": null
},
{
"param": "writer",
"type": null
},
{
"param": "indent",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "results_by_directory",
"type": null,
"docstring": null,
"docs... |
075ef0ef1f71f359dd18247cf3c3cb2706c8f86f | sunlongbo/chromium | third_party/blink/tools/blinkpy/common/checkout/baseline_optimizer.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | read_results_by_directory | <not_specific> | def read_results_by_directory(self, test_name, baseline_name):
"""Reads the baselines with the given file name in all directories.
Returns:
A dict from directory names to the digest of file content.
"""
results_by_directory = {}
directories = set()
for port i... | Reads the baselines with the given file name in all directories.
Returns:
A dict from directory names to the digest of file content.
| Reads the baselines with the given file name in all directories. | [
"Reads",
"the",
"baselines",
"with",
"the",
"given",
"file",
"name",
"in",
"all",
"directories",
"."
] | def read_results_by_directory(self, test_name, baseline_name):
results_by_directory = {}
directories = set()
for port in self._ports.values():
directories.update(set(self._relative_baseline_search_path(port)))
for directory in directories:
path = self._join_direct... | [
"def",
"read_results_by_directory",
"(",
"self",
",",
"test_name",
",",
"baseline_name",
")",
":",
"results_by_directory",
"=",
"{",
"}",
"directories",
"=",
"set",
"(",
")",
"for",
"port",
"in",
"self",
".",
"_ports",
".",
"values",
"(",
")",
":",
"direct... | Reads the baselines with the given file name in all directories. | [
"Reads",
"the",
"baselines",
"with",
"the",
"given",
"file",
"name",
"in",
"all",
"directories",
"."
] | [
"\"\"\"Reads the baselines with the given file name in all directories.\n\n Returns:\n A dict from directory names to the digest of file content.\n \"\"\""
] | [
{
"param": "self",
"type": null
},
{
"param": "test_name",
"type": null
},
{
"param": "baseline_name",
"type": null
}
] | {
"returns": [
{
"docstring": "A dict from directory names to the digest of file content.",
"docstring_tokens": [
"A",
"dict",
"from",
"directory",
"names",
"to",
"the",
"digest",
"of",
"file",
"content",
"... |
075ef0ef1f71f359dd18247cf3c3cb2706c8f86f | sunlongbo/chromium | third_party/blink/tools/blinkpy/common/checkout/baseline_optimizer.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | _platform | <not_specific> | def _platform(self, filename):
"""Guesses the platform from a path (absolute or relative).
Returns:
The platform name, or '(generic)' if unable to make a guess.
"""
platform_dir = self._web_tests_dir_name + self._filesystem.sep + 'platform' + self._filesystem.sep
if ... | Guesses the platform from a path (absolute or relative).
Returns:
The platform name, or '(generic)' if unable to make a guess.
| Guesses the platform from a path (absolute or relative). | [
"Guesses",
"the",
"platform",
"from",
"a",
"path",
"(",
"absolute",
"or",
"relative",
")",
"."
] | def _platform(self, filename):
platform_dir = self._web_tests_dir_name + self._filesystem.sep + 'platform' + self._filesystem.sep
if filename.startswith(platform_dir):
return filename.replace(platform_dir,
'').split(self._filesystem.sep)[0]
platfor... | [
"def",
"_platform",
"(",
"self",
",",
"filename",
")",
":",
"platform_dir",
"=",
"self",
".",
"_web_tests_dir_name",
"+",
"self",
".",
"_filesystem",
".",
"sep",
"+",
"'platform'",
"+",
"self",
".",
"_filesystem",
".",
"sep",
"if",
"filename",
".",
"starts... | Guesses the platform from a path (absolute or relative). | [
"Guesses",
"the",
"platform",
"from",
"a",
"path",
"(",
"absolute",
"or",
"relative",
")",
"."
] | [
"\"\"\"Guesses the platform from a path (absolute or relative).\n\n Returns:\n The platform name, or '(generic)' if unable to make a guess.\n \"\"\""
] | [
{
"param": "self",
"type": null
},
{
"param": "filename",
"type": null
}
] | {
"returns": [
{
"docstring": "The platform name, or '(generic)' if unable to make a guess.",
"docstring_tokens": [
"The",
"platform",
"name",
"or",
"'",
"(",
"generic",
")",
"'",
"if",
"unable",
"to",
... |
075ef0ef1f71f359dd18247cf3c3cb2706c8f86f | sunlongbo/chromium | third_party/blink/tools/blinkpy/common/checkout/baseline_optimizer.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | _port_from_baseline_dir | <not_specific> | def _port_from_baseline_dir(self, baseline_dir):
"""Returns a Port object from the given baseline directory."""
baseline_dir = self._filesystem.basename(baseline_dir)
for port in self._ports.values():
if self._filesystem.basename(
port.baseline_version_dir()) == b... | Returns a Port object from the given baseline directory. | Returns a Port object from the given baseline directory. | [
"Returns",
"a",
"Port",
"object",
"from",
"the",
"given",
"baseline",
"directory",
"."
] | def _port_from_baseline_dir(self, baseline_dir):
baseline_dir = self._filesystem.basename(baseline_dir)
for port in self._ports.values():
if self._filesystem.basename(
port.baseline_version_dir()) == baseline_dir:
return port
raise Exception(
... | [
"def",
"_port_from_baseline_dir",
"(",
"self",
",",
"baseline_dir",
")",
":",
"baseline_dir",
"=",
"self",
".",
"_filesystem",
".",
"basename",
"(",
"baseline_dir",
")",
"for",
"port",
"in",
"self",
".",
"_ports",
".",
"values",
"(",
")",
":",
"if",
"self"... | Returns a Port object from the given baseline directory. | [
"Returns",
"a",
"Port",
"object",
"from",
"the",
"given",
"baseline",
"directory",
"."
] | [
"\"\"\"Returns a Port object from the given baseline directory.\"\"\""
] | [
{
"param": "self",
"type": null
},
{
"param": "baseline_dir",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "baseline_dir",
"type": null,
"docstring": null,
"docstring_to... |
075ef0ef1f71f359dd18247cf3c3cb2706c8f86f | sunlongbo/chromium | third_party/blink/tools/blinkpy/common/checkout/baseline_optimizer.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | _walk_immediate_predecessors_of_virtual_root | null | def _walk_immediate_predecessors_of_virtual_root(
self, test_name, extension, baseline_name, worker_func):
"""Maps a function onto each immediate predecessor of the virtual root.
For each immediate predecessor, we call
worker_func(virtual_baseline, non_virtual_fallback)
... | Maps a function onto each immediate predecessor of the virtual root.
For each immediate predecessor, we call
worker_func(virtual_baseline, non_virtual_fallback)
where the two arguments are the absolute paths to the virtual platform
baseline and the non-virtual fallback respectively.... | Maps a function onto each immediate predecessor of the virtual root.
For each immediate predecessor, we call
worker_func(virtual_baseline, non_virtual_fallback)
where the two arguments are the absolute paths to the virtual platform
baseline and the non-virtual fallback respectively. | [
"Maps",
"a",
"function",
"onto",
"each",
"immediate",
"predecessor",
"of",
"the",
"virtual",
"root",
".",
"For",
"each",
"immediate",
"predecessor",
"we",
"call",
"worker_func",
"(",
"virtual_baseline",
"non_virtual_fallback",
")",
"where",
"the",
"two",
"argument... | def _walk_immediate_predecessors_of_virtual_root(
self, test_name, extension, baseline_name, worker_func):
actual_test_name = self._virtual_base(test_name)
assert actual_test_name, '%s is not a virtual test.' % test_name
for directory in self._directories_immediately_preceding_root()... | [
"def",
"_walk_immediate_predecessors_of_virtual_root",
"(",
"self",
",",
"test_name",
",",
"extension",
",",
"baseline_name",
",",
"worker_func",
")",
":",
"actual_test_name",
"=",
"self",
".",
"_virtual_base",
"(",
"test_name",
")",
"assert",
"actual_test_name",
",",... | Maps a function onto each immediate predecessor of the virtual root. | [
"Maps",
"a",
"function",
"onto",
"each",
"immediate",
"predecessor",
"of",
"the",
"virtual",
"root",
"."
] | [
"\"\"\"Maps a function onto each immediate predecessor of the virtual root.\n\n For each immediate predecessor, we call\n worker_func(virtual_baseline, non_virtual_fallback)\n where the two arguments are the absolute paths to the virtual platform\n baseline and the non-virtual fallba... | [
{
"param": "self",
"type": null
},
{
"param": "test_name",
"type": null
},
{
"param": "extension",
"type": null
},
{
"param": "baseline_name",
"type": null
},
{
"param": "worker_func",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "test_name",
"type": null,
"docstring": null,
"docstring_token... |
075ef0ef1f71f359dd18247cf3c3cb2706c8f86f | sunlongbo/chromium | third_party/blink/tools/blinkpy/common/checkout/baseline_optimizer.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | _relative_baseline_search_path | <not_specific> | def _relative_baseline_search_path(self, port):
"""Returns a list of paths to check for baselines in order.
The generic baseline path is appended to the list. All paths are
relative to the parent of the test directory.
"""
baseline_search_path = self._baseline_search_path(port)
... | Returns a list of paths to check for baselines in order.
The generic baseline path is appended to the list. All paths are
relative to the parent of the test directory.
| Returns a list of paths to check for baselines in order.
The generic baseline path is appended to the list. All paths are
relative to the parent of the test directory. | [
"Returns",
"a",
"list",
"of",
"paths",
"to",
"check",
"for",
"baselines",
"in",
"order",
".",
"The",
"generic",
"baseline",
"path",
"is",
"appended",
"to",
"the",
"list",
".",
"All",
"paths",
"are",
"relative",
"to",
"the",
"parent",
"of",
"the",
"test",... | def _relative_baseline_search_path(self, port):
baseline_search_path = self._baseline_search_path(port)
relative_paths = [
self._filesystem.relpath(path, self._parent_of_tests)
for path in baseline_search_path
]
relative_baseline_root = self._baseline_root()
... | [
"def",
"_relative_baseline_search_path",
"(",
"self",
",",
"port",
")",
":",
"baseline_search_path",
"=",
"self",
".",
"_baseline_search_path",
"(",
"port",
")",
"relative_paths",
"=",
"[",
"self",
".",
"_filesystem",
".",
"relpath",
"(",
"path",
",",
"self",
... | Returns a list of paths to check for baselines in order. | [
"Returns",
"a",
"list",
"of",
"paths",
"to",
"check",
"for",
"baselines",
"in",
"order",
"."
] | [
"\"\"\"Returns a list of paths to check for baselines in order.\n\n The generic baseline path is appended to the list. All paths are\n relative to the parent of the test directory.\n \"\"\""
] | [
{
"param": "self",
"type": null
},
{
"param": "port",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "port",
"type": null,
"docstring": null,
"docstring_tokens": [... |
075ef0ef1f71f359dd18247cf3c3cb2706c8f86f | sunlongbo/chromium | third_party/blink/tools/blinkpy/common/checkout/baseline_optimizer.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | _virtual_base | <not_specific> | def _virtual_base(self, baseline_name):
"""Returns the base (non-virtual) version of baseline_name, or None if
baseline_name is not virtual."""
# Note: port.lookup_virtual_test_base in fact expects a test_name,
# but baseline_name also works here.
return self._default_port.lookup... | Returns the base (non-virtual) version of baseline_name, or None if
baseline_name is not virtual. | Returns the base (non-virtual) version of baseline_name, or None if
baseline_name is not virtual. | [
"Returns",
"the",
"base",
"(",
"non",
"-",
"virtual",
")",
"version",
"of",
"baseline_name",
"or",
"None",
"if",
"baseline_name",
"is",
"not",
"virtual",
"."
] | def _virtual_base(self, baseline_name):
return self._default_port.lookup_virtual_test_base(baseline_name) | [
"def",
"_virtual_base",
"(",
"self",
",",
"baseline_name",
")",
":",
"return",
"self",
".",
"_default_port",
".",
"lookup_virtual_test_base",
"(",
"baseline_name",
")"
] | Returns the base (non-virtual) version of baseline_name, or None if
baseline_name is not virtual. | [
"Returns",
"the",
"base",
"(",
"non",
"-",
"virtual",
")",
"version",
"of",
"baseline_name",
"or",
"None",
"if",
"baseline_name",
"is",
"not",
"virtual",
"."
] | [
"\"\"\"Returns the base (non-virtual) version of baseline_name, or None if\n baseline_name is not virtual.\"\"\"",
"# Note: port.lookup_virtual_test_base in fact expects a test_name,",
"# but baseline_name also works here."
] | [
{
"param": "self",
"type": null
},
{
"param": "baseline_name",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "baseline_name",
"type": null,
"docstring": null,
"docstring_t... |
075ef0ef1f71f359dd18247cf3c3cb2706c8f86f | sunlongbo/chromium | third_party/blink/tools/blinkpy/common/checkout/baseline_optimizer.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | _results_by_port_name | <not_specific> | def _results_by_port_name(self, results_by_directory):
"""Transforms a by-directory result dict to by-port-name.
The method mimicks the baseline search behaviour, i.e. results[port] is
the first baseline found on the baseline search path of the port. If no
baseline is found on the searc... | Transforms a by-directory result dict to by-port-name.
The method mimicks the baseline search behaviour, i.e. results[port] is
the first baseline found on the baseline search path of the port. If no
baseline is found on the search path, the test is assumed to be an all-
PASS testharness... | Transforms a by-directory result dict to by-port-name.
The method mimicks the baseline search behaviour, i.e. results[port] is
the first baseline found on the baseline search path of the port. If no
baseline is found on the search path, the test is assumed to be an all
PASS testharness.js test. | [
"Transforms",
"a",
"by",
"-",
"directory",
"result",
"dict",
"to",
"by",
"-",
"port",
"-",
"name",
".",
"The",
"method",
"mimicks",
"the",
"baseline",
"search",
"behaviour",
"i",
".",
"e",
".",
"results",
"[",
"port",
"]",
"is",
"the",
"first",
"baseli... | def _results_by_port_name(self, results_by_directory):
results_by_port_name = {}
for port_name, port in self._ports.items():
for directory in self._relative_baseline_search_path(port):
if directory in results_by_directory:
results_by_port_name[port_name] =... | [
"def",
"_results_by_port_name",
"(",
"self",
",",
"results_by_directory",
")",
":",
"results_by_port_name",
"=",
"{",
"}",
"for",
"port_name",
",",
"port",
"in",
"self",
".",
"_ports",
".",
"items",
"(",
")",
":",
"for",
"directory",
"in",
"self",
".",
"_r... | Transforms a by-directory result dict to by-port-name. | [
"Transforms",
"a",
"by",
"-",
"directory",
"result",
"dict",
"to",
"by",
"-",
"port",
"-",
"name",
"."
] | [
"\"\"\"Transforms a by-directory result dict to by-port-name.\n\n The method mimicks the baseline search behaviour, i.e. results[port] is\n the first baseline found on the baseline search path of the port. If no\n baseline is found on the search path, the test is assumed to be an all-\n ... | [
{
"param": "self",
"type": null
},
{
"param": "results_by_directory",
"type": null
}
] | {
"returns": [
{
"docstring": "A dictionary mapping port names to their baselines.",
"docstring_tokens": [
"A",
"dictionary",
"mapping",
"port",
"names",
"to",
"their",
"baselines",
"."
],
"type": null
}
],
"ra... |
075ef0ef1f71f359dd18247cf3c3cb2706c8f86f | sunlongbo/chromium | third_party/blink/tools/blinkpy/common/checkout/baseline_optimizer.py | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | Python | _directories_immediately_preceding_root | <not_specific> | def _directories_immediately_preceding_root(self):
"""Returns a list of directories immediately preceding the root on
search paths."""
directories = set()
for port in self._ports.values():
directory = self._filesystem.relpath(
self._baseline_search_path(port)[... | Returns a list of directories immediately preceding the root on
search paths. | Returns a list of directories immediately preceding the root on
search paths. | [
"Returns",
"a",
"list",
"of",
"directories",
"immediately",
"preceding",
"the",
"root",
"on",
"search",
"paths",
"."
] | def _directories_immediately_preceding_root(self):
directories = set()
for port in self._ports.values():
directory = self._filesystem.relpath(
self._baseline_search_path(port)[-1], self._parent_of_tests)
directories.add(directory)
return frozenset(director... | [
"def",
"_directories_immediately_preceding_root",
"(",
"self",
")",
":",
"directories",
"=",
"set",
"(",
")",
"for",
"port",
"in",
"self",
".",
"_ports",
".",
"values",
"(",
")",
":",
"directory",
"=",
"self",
".",
"_filesystem",
".",
"relpath",
"(",
"self... | Returns a list of directories immediately preceding the root on
search paths. | [
"Returns",
"a",
"list",
"of",
"directories",
"immediately",
"preceding",
"the",
"root",
"on",
"search",
"paths",
"."
] | [
"\"\"\"Returns a list of directories immediately preceding the root on\n search paths.\"\"\""
] | [
{
"param": "self",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.