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
fb15c25288f8391cea8efacb3ddb3340661d2aff
sunlongbo/chromium
tools/android/elf_compression/compress_section.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
MatchVaddrAlignment
<not_specific>
def MatchVaddrAlignment(vaddr, offset, align=ADDRESS_ALIGN): """Align vaddr to comply with ELF standard binary alignment. Increases vaddr until the following is true: vaddr % align == offset % align Args: vaddr: virtual address to be aligned. offset: file offset to be aligned. align: alignment v...
Align vaddr to comply with ELF standard binary alignment. Increases vaddr until the following is true: vaddr % align == offset % align Args: vaddr: virtual address to be aligned. offset: file offset to be aligned. align: alignment value. Returns: Aligned virtual address, bigger or equal tha...
Align vaddr to comply with ELF standard binary alignment. Increases vaddr until the following is true: vaddr % align == offset % align
[ "Align", "vaddr", "to", "comply", "with", "ELF", "standard", "binary", "alignment", ".", "Increases", "vaddr", "until", "the", "following", "is", "true", ":", "vaddr", "%", "align", "==", "offset", "%", "align" ]
def MatchVaddrAlignment(vaddr, offset, align=ADDRESS_ALIGN): delta = offset % align - vaddr % align if delta < 0: delta += align return vaddr + delta
[ "def", "MatchVaddrAlignment", "(", "vaddr", ",", "offset", ",", "align", "=", "ADDRESS_ALIGN", ")", ":", "delta", "=", "offset", "%", "align", "-", "vaddr", "%", "align", "if", "delta", "<", "0", ":", "delta", "+=", "align", "return", "vaddr", "+", "de...
Align vaddr to comply with ELF standard binary alignment.
[ "Align", "vaddr", "to", "comply", "with", "ELF", "standard", "binary", "alignment", "." ]
[ "\"\"\"Align vaddr to comply with ELF standard binary alignment.\n\n Increases vaddr until the following is true:\n vaddr % align == offset % align\n\n Args:\n vaddr: virtual address to be aligned.\n offset: file offset to be aligned.\n align: alignment value.\n\n Returns:\n Aligned virtual addres...
[ { "param": "vaddr", "type": null }, { "param": "offset", "type": null }, { "param": "align", "type": null } ]
{ "returns": [ { "docstring": "Aligned virtual address, bigger or equal than the vaddr.", "docstring_tokens": [ "Aligned", "virtual", "address", "bigger", "or", "equal", "than", "the", "vaddr", "." ], "type": n...
fb15c25288f8391cea8efacb3ddb3340661d2aff
sunlongbo/chromium
tools/android/elf_compression/compress_section.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
_FileRangeToVirtualAddressRange
<not_specific>
def _FileRangeToVirtualAddressRange(data, l, r): """Returns virtual address range corresponding to given file range. Since we have to resolve them by their virtual address, parsing of LOAD segments is required here. """ elf = elf_headers.ElfHeader(data) for phdr in elf.GetProgramHeadersByType( elf_he...
Returns virtual address range corresponding to given file range. Since we have to resolve them by their virtual address, parsing of LOAD segments is required here.
Returns virtual address range corresponding to given file range. Since we have to resolve them by their virtual address, parsing of LOAD segments is required here.
[ "Returns", "virtual", "address", "range", "corresponding", "to", "given", "file", "range", ".", "Since", "we", "have", "to", "resolve", "them", "by", "their", "virtual", "address", "parsing", "of", "LOAD", "segments", "is", "required", "here", "." ]
def _FileRangeToVirtualAddressRange(data, l, r): elf = elf_headers.ElfHeader(data) for phdr in elf.GetProgramHeadersByType( elf_headers.ProgramHeader.Type.PT_LOAD): if not SegmentsIntersect(phdr.p_offset, phdr.FilePositionEnd(), l, r): continue if not SegmentContains(phdr.p_offset, phdr.FilePosi...
[ "def", "_FileRangeToVirtualAddressRange", "(", "data", ",", "l", ",", "r", ")", ":", "elf", "=", "elf_headers", ".", "ElfHeader", "(", "data", ")", "for", "phdr", "in", "elf", ".", "GetProgramHeadersByType", "(", "elf_headers", ".", "ProgramHeader", ".", "Ty...
Returns virtual address range corresponding to given file range.
[ "Returns", "virtual", "address", "range", "corresponding", "to", "given", "file", "range", "." ]
[ "\"\"\"Returns virtual address range corresponding to given file range.\n\n Since we have to resolve them by their virtual address, parsing of LOAD\n segments is required here.\n \"\"\"", "# Current version of the prototype only supports ranges which are fully", "# contained inside one LOAD segment. It shoul...
[ { "param": "data", "type": null }, { "param": "l", "type": null }, { "param": "r", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "data", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "l", "type": null, "docstring": null, "docstring_tokens": [], ...
fb15c25288f8391cea8efacb3ddb3340661d2aff
sunlongbo/chromium
tools/android/elf_compression/compress_section.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
_CopyRangeIntoCompressedSection
null
def _CopyRangeIntoCompressedSection(data, l, r): """Adds a new section containing compressed version of provided range.""" compressed_range = compression.CompressData(data[l:r]) with tempfile.TemporaryDirectory() as tmpdir: # The easiest way to add a new section is to use objcopy, but it requires # for a...
Adds a new section containing compressed version of provided range.
Adds a new section containing compressed version of provided range.
[ "Adds", "a", "new", "section", "containing", "compressed", "version", "of", "provided", "range", "." ]
def _CopyRangeIntoCompressedSection(data, l, r): compressed_range = compression.CompressData(data[l:r]) with tempfile.TemporaryDirectory() as tmpdir: objcopy_input_file = os.path.join(tmpdir, 'input') objcopy_data_file = os.path.join(tmpdir, 'data') objcopy_output_file = os.path.join(tmpdir, 'output') ...
[ "def", "_CopyRangeIntoCompressedSection", "(", "data", ",", "l", ",", "r", ")", ":", "compressed_range", "=", "compression", ".", "CompressData", "(", "data", "[", "l", ":", "r", "]", ")", "with", "tempfile", ".", "TemporaryDirectory", "(", ")", "as", "tmp...
Adds a new section containing compressed version of provided range.
[ "Adds", "a", "new", "section", "containing", "compressed", "version", "of", "provided", "range", "." ]
[ "\"\"\"Adds a new section containing compressed version of provided range.\"\"\"", "# The easiest way to add a new section is to use objcopy, but it requires", "# for all of the data to be stored in files." ]
[ { "param": "data", "type": null }, { "param": "l", "type": null }, { "param": "r", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "data", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "l", "type": null, "docstring": null, "docstring_tokens": [], ...
fb15c25288f8391cea8efacb3ddb3340661d2aff
sunlongbo/chromium
tools/android/elf_compression/compress_section.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
_FindNewVaddr
<not_specific>
def _FindNewVaddr(phdrs): """Returns the virt address that is safe to use for insertion of new data.""" max_vaddr = 0 # Strictly speaking it should be sufficient to look through only LOAD # segments, but better be safe than sorry. for phdr in phdrs: max_vaddr = max(max_vaddr, phdr.p_vaddr + phdr.p_memsz) ...
Returns the virt address that is safe to use for insertion of new data.
Returns the virt address that is safe to use for insertion of new data.
[ "Returns", "the", "virt", "address", "that", "is", "safe", "to", "use", "for", "insertion", "of", "new", "data", "." ]
def _FindNewVaddr(phdrs): max_vaddr = 0 for phdr in phdrs: max_vaddr = max(max_vaddr, phdr.p_vaddr + phdr.p_memsz) max_vaddr = AlignUp(max_vaddr) return max_vaddr
[ "def", "_FindNewVaddr", "(", "phdrs", ")", ":", "max_vaddr", "=", "0", "for", "phdr", "in", "phdrs", ":", "max_vaddr", "=", "max", "(", "max_vaddr", ",", "phdr", ".", "p_vaddr", "+", "phdr", ".", "p_memsz", ")", "max_vaddr", "=", "AlignUp", "(", "max_v...
Returns the virt address that is safe to use for insertion of new data.
[ "Returns", "the", "virt", "address", "that", "is", "safe", "to", "use", "for", "insertion", "of", "new", "data", "." ]
[ "\"\"\"Returns the virt address that is safe to use for insertion of new data.\"\"\"", "# Strictly speaking it should be sufficient to look through only LOAD", "# segments, but better be safe than sorry.", "# When the mapping occurs end address is increased to be a multiple", "# of page size. To ensure comp...
[ { "param": "phdrs", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "phdrs", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
fb15c25288f8391cea8efacb3ddb3340661d2aff
sunlongbo/chromium
tools/android/elf_compression/compress_section.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
_MovePhdrToTheEnd
<not_specific>
def _MovePhdrToTheEnd(data): """Moves Phdrs to the end of the file and adjusts all references to it.""" elf_hdr = elf_headers.ElfHeader(data) # If program headers are already in the end of the file, nothing to do. if elf_hdr.e_phoff + elf_hdr.e_phnum * elf_hdr.e_phentsize == len(data): return old_phoff ...
Moves Phdrs to the end of the file and adjusts all references to it.
Moves Phdrs to the end of the file and adjusts all references to it.
[ "Moves", "Phdrs", "to", "the", "end", "of", "the", "file", "and", "adjusts", "all", "references", "to", "it", "." ]
def _MovePhdrToTheEnd(data): elf_hdr = elf_headers.ElfHeader(data) if elf_hdr.e_phoff + elf_hdr.e_phnum * elf_hdr.e_phentsize == len(data): return old_phoff = elf_hdr.e_phoff new_phoff = elf_hdr.e_phoff = len(data) unaligned_new_vaddr = _FindNewVaddr(elf_hdr.GetProgramHeaders()) new_vaddr = MatchVaddrAl...
[ "def", "_MovePhdrToTheEnd", "(", "data", ")", ":", "elf_hdr", "=", "elf_headers", ".", "ElfHeader", "(", "data", ")", "if", "elf_hdr", ".", "e_phoff", "+", "elf_hdr", ".", "e_phnum", "*", "elf_hdr", ".", "e_phentsize", "==", "len", "(", "data", ")", ":",...
Moves Phdrs to the end of the file and adjusts all references to it.
[ "Moves", "Phdrs", "to", "the", "end", "of", "the", "file", "and", "adjusts", "all", "references", "to", "it", "." ]
[ "\"\"\"Moves Phdrs to the end of the file and adjusts all references to it.\"\"\"", "# If program headers are already in the end of the file, nothing to do.", "# Since we moved the PHDR section to the end of the file, we need to create a", "# new LOAD segment to load it in.", "# We are using current_filesiz...
[ { "param": "data", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "data", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
fb15c25288f8391cea8efacb3ddb3340661d2aff
sunlongbo/chromium
tools/android/elf_compression/compress_section.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
_CreateLoadForCompressedSection
<not_specific>
def _CreateLoadForCompressedSection(data): """Creates a LOAD segment to previously created COMPRESSED_SECTION_NAME. Returns the virtual address range corresponding to created segment.""" elf_hdr = elf_headers.ElfHeader(data) section_offset = None section_size = None for shdr in elf_hdr.GetSectionHeaders()...
Creates a LOAD segment to previously created COMPRESSED_SECTION_NAME. Returns the virtual address range corresponding to created segment.
Creates a LOAD segment to previously created COMPRESSED_SECTION_NAME. Returns the virtual address range corresponding to created segment.
[ "Creates", "a", "LOAD", "segment", "to", "previously", "created", "COMPRESSED_SECTION_NAME", ".", "Returns", "the", "virtual", "address", "range", "corresponding", "to", "created", "segment", "." ]
def _CreateLoadForCompressedSection(data): elf_hdr = elf_headers.ElfHeader(data) section_offset = None section_size = None for shdr in elf_hdr.GetSectionHeaders(): if shdr.GetStrName() == COMPRESSED_SECTION_NAME: section_offset = shdr.sh_offset section_size = shdr.sh_size break if sectio...
[ "def", "_CreateLoadForCompressedSection", "(", "data", ")", ":", "elf_hdr", "=", "elf_headers", ".", "ElfHeader", "(", "data", ")", "section_offset", "=", "None", "section_size", "=", "None", "for", "shdr", "in", "elf_hdr", ".", "GetSectionHeaders", "(", ")", ...
Creates a LOAD segment to previously created COMPRESSED_SECTION_NAME.
[ "Creates", "a", "LOAD", "segment", "to", "previously", "created", "COMPRESSED_SECTION_NAME", "." ]
[ "\"\"\"Creates a LOAD segment to previously created COMPRESSED_SECTION_NAME.\n\n Returns the virtual address range corresponding to created segment.\"\"\"" ]
[ { "param": "data", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "data", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
fb15c25288f8391cea8efacb3ddb3340661d2aff
sunlongbo/chromium
tools/android/elf_compression/compress_section.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
_SplitLoadSegmentAndNullifyRange
<not_specific>
def _SplitLoadSegmentAndNullifyRange(data, l, r): """Find LOAD segment covering [l, r) and splits it into three segments. Split is done so one of the LOAD segments contains only [l, r) and nothing else. If the range is located at the start or at the end of the segment less than three segments may be created. ...
Find LOAD segment covering [l, r) and splits it into three segments. Split is done so one of the LOAD segments contains only [l, r) and nothing else. If the range is located at the start or at the end of the segment less than three segments may be created. The resulting LOAD segment containing [l, r) is edite...
Find LOAD segment covering [l, r) and splits it into three segments. Split is done so one of the LOAD segments contains only [l, r) and nothing else. If the range is located at the start or at the end of the segment less than three segments may be created. The resulting LOAD segment containing [l, r) is edited so it s...
[ "Find", "LOAD", "segment", "covering", "[", "l", "r", ")", "and", "splits", "it", "into", "three", "segments", ".", "Split", "is", "done", "so", "one", "of", "the", "LOAD", "segments", "contains", "only", "[", "l", "r", ")", "and", "nothing", "else", ...
def _SplitLoadSegmentAndNullifyRange(data, l, r): elf_hdr = elf_headers.ElfHeader(data) range_phdr = None for phdr in elf_hdr.GetProgramHeadersByType( elf_headers.ProgramHeader.Type.PT_LOAD): if SegmentContains(phdr.p_offset, phdr.FilePositionEnd(), l, r): range_phdr = phdr break if range_...
[ "def", "_SplitLoadSegmentAndNullifyRange", "(", "data", ",", "l", ",", "r", ")", ":", "elf_hdr", "=", "elf_headers", ".", "ElfHeader", "(", "data", ")", "range_phdr", "=", "None", "for", "phdr", "in", "elf_hdr", ".", "GetProgramHeadersByType", "(", "elf_header...
Find LOAD segment covering [l, r) and splits it into three segments.
[ "Find", "LOAD", "segment", "covering", "[", "l", "r", ")", "and", "splits", "it", "into", "three", "segments", "." ]
[ "\"\"\"Find LOAD segment covering [l, r) and splits it into three segments.\n\n Split is done so one of the LOAD segments contains only [l, r) and nothing\n else. If the range is located at the start or at the end of the segment less\n than three segments may be created.\n\n The resulting LOAD segment containin...
[ { "param": "data", "type": null }, { "param": "l", "type": null }, { "param": "r", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "data", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "l", "type": null, "docstring": null, "docstring_tokens": [], ...
fb15c25288f8391cea8efacb3ddb3340661d2aff
sunlongbo/chromium
tools/android/elf_compression/compress_section.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
_CutRangeAndCorrectFile
null
def _CutRangeAndCorrectFile(data, l, r): """Removes [l, r) from the data and fixes offsets to stabilize the ELF.""" elf = elf_headers.ElfHeader(data) # Removing the range from the file: del data[l:r] range_length = r - l for phdr in elf.GetProgramHeaders(): # Any other program header intersecting the [...
Removes [l, r) from the data and fixes offsets to stabilize the ELF.
Removes [l, r) from the data and fixes offsets to stabilize the ELF.
[ "Removes", "[", "l", "r", ")", "from", "the", "data", "and", "fixes", "offsets", "to", "stabilize", "the", "ELF", "." ]
def _CutRangeAndCorrectFile(data, l, r): elf = elf_headers.ElfHeader(data) del data[l:r] range_length = r - l for phdr in elf.GetProgramHeaders(): if SegmentsIntersect(phdr.p_offset, phdr.FilePositionEnd(), l, r): raise RuntimeError('Segment intersects with provided range') if phdr.p_offset >= r: ...
[ "def", "_CutRangeAndCorrectFile", "(", "data", ",", "l", ",", "r", ")", ":", "elf", "=", "elf_headers", ".", "ElfHeader", "(", "data", ")", "del", "data", "[", "l", ":", "r", "]", "range_length", "=", "r", "-", "l", "for", "phdr", "in", "elf", ".",...
Removes [l, r) from the data and fixes offsets to stabilize the ELF.
[ "Removes", "[", "l", "r", ")", "from", "the", "data", "and", "fixes", "offsets", "to", "stabilize", "the", "ELF", "." ]
[ "\"\"\"Removes [l, r) from the data and fixes offsets to stabilize the ELF.\"\"\"", "# Removing the range from the file:", "# Any other program header intersecting the [l, r) range poses serious", "# problem as this header needs to be split if possible. However since we are", "# compressing part of program'...
[ { "param": "data", "type": null }, { "param": "l", "type": null }, { "param": "r", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "data", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "l", "type": null, "docstring": null, "docstring_tokens": [], ...
fb385312333ec25f07496e02083a8fe3dbd77a02
sunlongbo/chromium
tools/resources/list_resources_removed_by_repack.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
GetResourceIdsFromRepackMessage
<not_specific>
def GetResourceIdsFromRepackMessage(in_data): """Returns sorted set of resource ids that are not used from in_data. """ unused_resources = set() unused_pattern = re.compile( 'RePackFromDataPackStrings Removed Key: (?P<resource_id>[0-9]+)') for line in in_data: match = unused_pattern.match(line) ...
Returns sorted set of resource ids that are not used from in_data.
Returns sorted set of resource ids that are not used from in_data.
[ "Returns", "sorted", "set", "of", "resource", "ids", "that", "are", "not", "used", "from", "in_data", "." ]
def GetResourceIdsFromRepackMessage(in_data): unused_resources = set() unused_pattern = re.compile( 'RePackFromDataPackStrings Removed Key: (?P<resource_id>[0-9]+)') for line in in_data: match = unused_pattern.match(line) if match: resource_id = int(match.group('resource_id')) unused_res...
[ "def", "GetResourceIdsFromRepackMessage", "(", "in_data", ")", ":", "unused_resources", "=", "set", "(", ")", "unused_pattern", "=", "re", ".", "compile", "(", "'RePackFromDataPackStrings Removed Key: (?P<resource_id>[0-9]+)'", ")", "for", "line", "in", "in_data", ":", ...
Returns sorted set of resource ids that are not used from in_data.
[ "Returns", "sorted", "set", "of", "resource", "ids", "that", "are", "not", "used", "from", "in_data", "." ]
[ "\"\"\"Returns sorted set of resource ids that are not used from in_data.\n \"\"\"" ]
[ { "param": "in_data", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "in_data", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
2a52d5b0aaf3ea090b669f02b25e1f49ddf0925a
sunlongbo/chromium
third_party/blink/tools/blinkpy/web_tests/port/browser_test_driver.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
start
null
def start(self, per_test_args, deadline): """Same as Driver.start() however, it has an extra step. It waits for a path to a file to be used for stdin to be printed by the browser test. If a path is found by the deadline test test will open the file and assign it to the stdin of the proce...
Same as Driver.start() however, it has an extra step. It waits for a path to a file to be used for stdin to be printed by the browser test. If a path is found by the deadline test test will open the file and assign it to the stdin of the process that is owned by this driver's server proc...
Same as Driver.start() however, it has an extra step. It waits for a path to a file to be used for stdin to be printed by the browser test. If a path is found by the deadline test test will open the file and assign it to the stdin of the process that is owned by this driver's server process.
[ "Same", "as", "Driver", ".", "start", "()", "however", "it", "has", "an", "extra", "step", ".", "It", "waits", "for", "a", "path", "to", "a", "file", "to", "be", "used", "for", "stdin", "to", "be", "printed", "by", "the", "browser", "test", ".", "I...
def start(self, per_test_args, deadline): new_cmd_line = self.cmd_line(per_test_args) if not self._server_process or new_cmd_line != self._current_cmd_line: self._start(per_test_args) self._run_post_start_tasks() self._open_stdin_path(deadline)
[ "def", "start", "(", "self", ",", "per_test_args", ",", "deadline", ")", ":", "new_cmd_line", "=", "self", ".", "cmd_line", "(", "per_test_args", ")", "if", "not", "self", ".", "_server_process", "or", "new_cmd_line", "!=", "self", ".", "_current_cmd_line", ...
Same as Driver.start() however, it has an extra step.
[ "Same", "as", "Driver", ".", "start", "()", "however", "it", "has", "an", "extra", "step", "." ]
[ "\"\"\"Same as Driver.start() however, it has an extra step. It waits for\n a path to a file to be used for stdin to be printed by the browser test.\n If a path is found by the deadline test test will open the file and\n assign it to the stdin of the process that is owned by this driver's\n ...
[ { "param": "self", "type": null }, { "param": "per_test_args", "type": null }, { "param": "deadline", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "per_test_args", "type": null, "docstring": null, "docstring_t...
2a52d5b0aaf3ea090b669f02b25e1f49ddf0925a
sunlongbo/chromium
third_party/blink/tools/blinkpy/web_tests/port/browser_test_driver.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
cmd_line
<not_specific>
def cmd_line(self, per_test_args): """Command line arguments to run the browser test.""" cmd = self._command_wrapper(self._port.get_option('wrapper')) cmd.append(self._port._path_to_driver()) cmd.append( '--gtest_filter=PrintPreviewPdfGeneratedBrowserTest.MANUAL_LayoutTestDri...
Command line arguments to run the browser test.
Command line arguments to run the browser test.
[ "Command", "line", "arguments", "to", "run", "the", "browser", "test", "." ]
def cmd_line(self, per_test_args): cmd = self._command_wrapper(self._port.get_option('wrapper')) cmd.append(self._port._path_to_driver()) cmd.append( '--gtest_filter=PrintPreviewPdfGeneratedBrowserTest.MANUAL_LayoutTestDriver' ) cmd.append('--run-manual') cmd....
[ "def", "cmd_line", "(", "self", ",", "per_test_args", ")", ":", "cmd", "=", "self", ".", "_command_wrapper", "(", "self", ".", "_port", ".", "get_option", "(", "'wrapper'", ")", ")", "cmd", ".", "append", "(", "self", ".", "_port", ".", "_path_to_driver"...
Command line arguments to run the browser test.
[ "Command", "line", "arguments", "to", "run", "the", "browser", "test", "." ]
[ "\"\"\"Command line arguments to run the browser test.\"\"\"" ]
[ { "param": "self", "type": null }, { "param": "per_test_args", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "per_test_args", "type": null, "docstring": null, "docstring_t...
2a72e43446391430b92b65048ea1d016cbaf11f6
sunlongbo/chromium
build/fuchsia/binary_size_differ.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
ComputePackageDiffs
<not_specific>
def ComputePackageDiffs(before_blobs_file, after_blobs_file): '''Computes difference between after and before diff, for each package.''' before_blobs = GetPackageBlobsFromFile(before_blobs_file) after_blobs = GetPackageBlobsFromFile(after_blobs_file) assert before_blobs.keys() == after_blobs.keys(), ( 'P...
Computes difference between after and before diff, for each package.
Computes difference between after and before diff, for each package.
[ "Computes", "difference", "between", "after", "and", "before", "diff", "for", "each", "package", "." ]
def ComputePackageDiffs(before_blobs_file, after_blobs_file): before_blobs = GetPackageBlobsFromFile(before_blobs_file) after_blobs = GetPackageBlobsFromFile(after_blobs_file) assert before_blobs.keys() == after_blobs.keys(), ( 'Package files cannot' ' be compared with different packages: ' '%s ...
[ "def", "ComputePackageDiffs", "(", "before_blobs_file", ",", "after_blobs_file", ")", ":", "before_blobs", "=", "GetPackageBlobsFromFile", "(", "before_blobs_file", ")", "after_blobs", "=", "GetPackageBlobsFromFile", "(", "after_blobs_file", ")", "assert", "before_blobs", ...
Computes difference between after and before diff, for each package.
[ "Computes", "difference", "between", "after", "and", "before", "diff", "for", "each", "package", "." ]
[ "'''Computes difference between after and before diff, for each package.'''", "# TODO(crbug.com/1266085): Investigate using these fields." ]
[ { "param": "before_blobs_file", "type": null }, { "param": "after_blobs_file", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "before_blobs_file", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "after_blobs_file", "type": null, "docstring": null, ...
1aa7ca5f43562b236e8b6e82c4cc36656cd84087
sunlongbo/chromium
components/exo/wayland/fuzzer/wayland_utils.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
AllInterfaces
null
def AllInterfaces(protocols): """Get the interfaces in these protocols. Args: protocols: the list of protocols you want the interfaces of. Yields: Tuples (p, i) of (p)rotocol (i)nterface. """ for p in protocols: for i in p.findall('interface'): yield (p, i)
Get the interfaces in these protocols. Args: protocols: the list of protocols you want the interfaces of. Yields: Tuples (p, i) of (p)rotocol (i)nterface.
Get the interfaces in these protocols.
[ "Get", "the", "interfaces", "in", "these", "protocols", "." ]
def AllInterfaces(protocols): for p in protocols: for i in p.findall('interface'): yield (p, i)
[ "def", "AllInterfaces", "(", "protocols", ")", ":", "for", "p", "in", "protocols", ":", "for", "i", "in", "p", ".", "findall", "(", "'interface'", ")", ":", "yield", "(", "p", ",", "i", ")" ]
Get the interfaces in these protocols.
[ "Get", "the", "interfaces", "in", "these", "protocols", "." ]
[ "\"\"\"Get the interfaces in these protocols.\n\n Args:\n protocols: the list of protocols you want the interfaces of.\n\n Yields:\n Tuples (p, i) of (p)rotocol (i)nterface.\n \"\"\"" ]
[ { "param": "protocols", "type": null } ]
{ "returns": [ { "docstring": "Tuples (p, i) of (p)rotocol (i)nterface.", "docstring_tokens": [ "Tuples", "(", "p", "i", ")", "of", "(", "p", ")", "rotocol", "(", "i", ")", "nterface", ...
1aa7ca5f43562b236e8b6e82c4cc36656cd84087
sunlongbo/chromium
components/exo/wayland/fuzzer/wayland_utils.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
AllMessages
null
def AllMessages(protocols): """Get the messages in these protocols. Args: protocols: the list of protocols you want the messages of. Yields: Tuples (p, i, m) of (p)rotocol, (i)nterface, and (m)essage. """ for (p, i) in AllInterfaces(protocols): for r in i.findall('request'): yield (p, i, r...
Get the messages in these protocols. Args: protocols: the list of protocols you want the messages of. Yields: Tuples (p, i, m) of (p)rotocol, (i)nterface, and (m)essage.
Get the messages in these protocols.
[ "Get", "the", "messages", "in", "these", "protocols", "." ]
def AllMessages(protocols): for (p, i) in AllInterfaces(protocols): for r in i.findall('request'): yield (p, i, r) for e in i.findall('event'): yield (p, i, e)
[ "def", "AllMessages", "(", "protocols", ")", ":", "for", "(", "p", ",", "i", ")", "in", "AllInterfaces", "(", "protocols", ")", ":", "for", "r", "in", "i", ".", "findall", "(", "'request'", ")", ":", "yield", "(", "p", ",", "i", ",", "r", ")", ...
Get the messages in these protocols.
[ "Get", "the", "messages", "in", "these", "protocols", "." ]
[ "\"\"\"Get the messages in these protocols.\n\n Args:\n protocols: the list of protocols you want the messages of.\n\n Yields:\n Tuples (p, i, m) of (p)rotocol, (i)nterface, and (m)essage.\n \"\"\"" ]
[ { "param": "protocols", "type": null } ]
{ "returns": [ { "docstring": "Tuples (p, i, m) of (p)rotocol, (i)nterface, and (m)essage.", "docstring_tokens": [ "Tuples", "(", "p", "i", "m", ")", "of", "(", "p", ")", "rotocol", "(", "i", ...
1aa7ca5f43562b236e8b6e82c4cc36656cd84087
sunlongbo/chromium
components/exo/wayland/fuzzer/wayland_utils.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
IsDestructor
<not_specific>
def IsDestructor(message): """Check if a message is a destructor. Args: message: the message which you want to check. Returns: True if the message has the type='destructor' attribute, false otherwise. """ return message.get('type') == 'destructor'
Check if a message is a destructor. Args: message: the message which you want to check. Returns: True if the message has the type='destructor' attribute, false otherwise.
Check if a message is a destructor.
[ "Check", "if", "a", "message", "is", "a", "destructor", "." ]
def IsDestructor(message): return message.get('type') == 'destructor'
[ "def", "IsDestructor", "(", "message", ")", ":", "return", "message", ".", "get", "(", "'type'", ")", "==", "'destructor'" ]
Check if a message is a destructor.
[ "Check", "if", "a", "message", "is", "a", "destructor", "." ]
[ "\"\"\"Check if a message is a destructor.\n\n Args:\n message: the message which you want to check.\n\n Returns:\n True if the message has the type='destructor' attribute, false otherwise.\n \"\"\"" ]
[ { "param": "message", "type": null } ]
{ "returns": [ { "docstring": "True if the message has the type='destructor' attribute, false otherwise.", "docstring_tokens": [ "True", "if", "the", "message", "has", "the", "type", "=", "'", "destructor", "'", ...
1aa7ca5f43562b236e8b6e82c4cc36656cd84087
sunlongbo/chromium
components/exo/wayland/fuzzer/wayland_utils.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
GetConstructedInterface
<not_specific>
def GetConstructedInterface(message): """Gets the interface constructed by a message. Note that even if IsConstructor(message) returns true, get_constructed can still return None when the message constructs an unknown interface (e.g. wl_registry.bind()). Args: message: the event/request which may be a c...
Gets the interface constructed by a message. Note that even if IsConstructor(message) returns true, get_constructed can still return None when the message constructs an unknown interface (e.g. wl_registry.bind()). Args: message: the event/request which may be a constructor. Returns: The name of the...
Gets the interface constructed by a message. Note that even if IsConstructor(message) returns true, get_constructed can still return None when the message constructs an unknown interface ).
[ "Gets", "the", "interface", "constructed", "by", "a", "message", ".", "Note", "that", "even", "if", "IsConstructor", "(", "message", ")", "returns", "true", "get_constructed", "can", "still", "return", "None", "when", "the", "message", "constructs", "an", "unk...
def GetConstructedInterface(message): cons_arg = GetConstructorArg(message) if cons_arg is None: return None return cons_arg.get('interface')
[ "def", "GetConstructedInterface", "(", "message", ")", ":", "cons_arg", "=", "GetConstructorArg", "(", "message", ")", "if", "cons_arg", "is", "None", ":", "return", "None", "return", "cons_arg", ".", "get", "(", "'interface'", ")" ]
Gets the interface constructed by a message.
[ "Gets", "the", "interface", "constructed", "by", "a", "message", "." ]
[ "\"\"\"Gets the interface constructed by a message.\n\n Note that even if IsConstructor(message) returns true, get_constructed can\n still return None when the message constructs an unknown interface (e.g.\n wl_registry.bind()).\n\n Args:\n message: the event/request which may be a constructor.\n\n Returns:...
[ { "param": "message", "type": null } ]
{ "returns": [ { "docstring": "The name of the constructed interface (if there is one), or None.", "docstring_tokens": [ "The", "name", "of", "the", "constructed", "interface", "(", "if", "there", "is", "one", ...
1aa7ca5f43562b236e8b6e82c4cc36656cd84087
sunlongbo/chromium
components/exo/wayland/fuzzer/wayland_utils.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
GetDocumentation
<not_specific>
def GetDocumentation(element): """Return this element's documentation as a list of strings. Args: element: the xml.etree.ElementTree node you want the documentation for. Returns: A list of strings, containing the data from this node's "summary" attribute, or its "description" subelement. """ doc...
Return this element's documentation as a list of strings. Args: element: the xml.etree.ElementTree node you want the documentation for. Returns: A list of strings, containing the data from this node's "summary" attribute, or its "description" subelement.
Return this element's documentation as a list of strings.
[ "Return", "this", "element", "'", "s", "documentation", "as", "a", "list", "of", "strings", "." ]
def GetDocumentation(element): doc = element.find('description') if doc is None: summary = element.get('summary') return [summary] if summary is not None else [] ret = [doc.get('summary')] if doc.text: ret += [l.strip() for l in doc.text.split('\n')] while not ret[-1]: ret.pop() return r...
[ "def", "GetDocumentation", "(", "element", ")", ":", "doc", "=", "element", ".", "find", "(", "'description'", ")", "if", "doc", "is", "None", ":", "summary", "=", "element", ".", "get", "(", "'summary'", ")", "return", "[", "summary", "]", "if", "summ...
Return this element's documentation as a list of strings.
[ "Return", "this", "element", "'", "s", "documentation", "as", "a", "list", "of", "strings", "." ]
[ "\"\"\"Return this element's documentation as a list of strings.\n\n Args:\n element: the xml.etree.ElementTree node you want the documentation for.\n\n Returns:\n A list of strings, containing the data from this node's \"summary\" attribute,\n or its \"description\" subelement.\n \"\"\"", "# Remove b...
[ { "param": "element", "type": null } ]
{ "returns": [ { "docstring": "A list of strings, containing the data from this node's \"summary\" attribute,\nor its \"description\" subelement.", "docstring_tokens": [ "A", "list", "of", "strings", "containing", "the", "data", "from", ...
1aa7ca5f43562b236e8b6e82c4cc36656cd84087
sunlongbo/chromium
components/exo/wayland/fuzzer/wayland_utils.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
ParseOpts
<not_specific>
def ParseOpts(argv): """Parses the given command line arguments for the templater. Args: argv: the arguments to be parsed. Returns: An argparse.ArgumentParser which provides the user's chosen configuration for this templater run. """ parser = argparse.ArgumentParser() parser.add_argument( ...
Parses the given command line arguments for the templater. Args: argv: the arguments to be parsed. Returns: An argparse.ArgumentParser which provides the user's chosen configuration for this templater run.
Parses the given command line arguments for the templater.
[ "Parses", "the", "given", "command", "line", "arguments", "for", "the", "templater", "." ]
def ParseOpts(argv): parser = argparse.ArgumentParser() parser.add_argument( '-d', '--directory', help='treat input paths as relative to this directory', default='.') parser.add_argument( '-i', '--input', help='path to the input template file (relative to -d)', requ...
[ "def", "ParseOpts", "(", "argv", ")", ":", "parser", "=", "argparse", ".", "ArgumentParser", "(", ")", "parser", ".", "add_argument", "(", "'-d'", ",", "'--directory'", ",", "help", "=", "'treat input paths as relative to this directory'", ",", "default", "=", "...
Parses the given command line arguments for the templater.
[ "Parses", "the", "given", "command", "line", "arguments", "for", "the", "templater", "." ]
[ "\"\"\"Parses the given command line arguments for the templater.\n\n Args:\n argv: the arguments to be parsed.\n\n Returns:\n An argparse.ArgumentParser which provides the user's chosen configuration\n for this templater run.\n \"\"\"" ]
[ { "param": "argv", "type": null } ]
{ "returns": [ { "docstring": "An argparse.ArgumentParser which provides the user's chosen configuration\nfor this templater run.", "docstring_tokens": [ "An", "argparse", ".", "ArgumentParser", "which", "provides", "the", "user", ...
1ae3811518e9e442e38c081afdc17e5c6504c3f0
sunlongbo/chromium
tools/android/kerberos/negotiate_test_server.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
do_GET
null
def do_GET(self): """Respond to a GET request.""" print('Path: ' + self.path) print(self.headers) auth_header = self.headers.getheader('Authorization') if not auth_header: self.send_response(401) self.send_header('WWW-Authenticate', 'negotiate') self.send_header('Content-type', 't...
Respond to a GET request.
Respond to a GET request.
[ "Respond", "to", "a", "GET", "request", "." ]
def do_GET(self): print('Path: ' + self.path) print(self.headers) auth_header = self.headers.getheader('Authorization') if not auth_header: self.send_response(401) self.send_header('WWW-Authenticate', 'negotiate') self.send_header('Content-type', 'text/html') self.end_headers() ...
[ "def", "do_GET", "(", "self", ")", ":", "print", "(", "'Path: '", "+", "self", ".", "path", ")", "print", "(", "self", ".", "headers", ")", "auth_header", "=", "self", ".", "headers", ".", "getheader", "(", "'Authorization'", ")", "if", "not", "auth_he...
Respond to a GET request.
[ "Respond", "to", "a", "GET", "request", "." ]
[ "\"\"\"Respond to a GET request.\"\"\"" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
244feb5b88500a0e333588eaf85ace572dac908a
sunlongbo/chromium
third_party/blink/web_tests/wpt_internal/reporting/resources/report.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
retrieve_from_stash
<not_specific>
def retrieve_from_stash(request, key, timeout, default_value, min_count=None, retain=False): """Retrieve the set of reports for a given report ID. This will extract either the set of reports, c...
Retrieve the set of reports for a given report ID. This will extract either the set of reports, credentials, or request count from the stash (depending on the key passed in) and return it encoded as JSON. When retrieving reports, this will not return any reports until min_count reports have been received. ...
Retrieve the set of reports for a given report ID. This will extract either the set of reports, credentials, or request count from the stash (depending on the key passed in) and return it encoded as JSON. When retrieving reports, this will not return any reports until min_count reports have been received. If timeout ...
[ "Retrieve", "the", "set", "of", "reports", "for", "a", "given", "report", "ID", ".", "This", "will", "extract", "either", "the", "set", "of", "reports", "credentials", "or", "request", "count", "from", "the", "stash", "(", "depending", "on", "the", "key", ...
def retrieve_from_stash(request, key, timeout, default_value, min_count=None, retain=False): t0 = time.time() while time.time() - t0 < timeout: time.sleep(0.5) with request.ser...
[ "def", "retrieve_from_stash", "(", "request", ",", "key", ",", "timeout", ",", "default_value", ",", "min_count", "=", "None", ",", "retain", "=", "False", ")", ":", "t0", "=", "time", ".", "time", "(", ")", "while", "time", ".", "time", "(", ")", "-...
Retrieve the set of reports for a given report ID.
[ "Retrieve", "the", "set", "of", "reports", "for", "a", "given", "report", "ID", "." ]
[ "\"\"\"Retrieve the set of reports for a given report ID.\n\n This will extract either the set of reports, credentials, or request count\n from the stash (depending on the key passed in) and return it encoded as JSON.\n\n When retrieving reports, this will not return any reports until min_count\n reports have b...
[ { "param": "request", "type": null }, { "param": "key", "type": null }, { "param": "timeout", "type": null }, { "param": "default_value", "type": null }, { "param": "min_count", "type": null }, { "param": "retain", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "request", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "key", "type": null, "docstring": null, "docstring_tokens":...
d1b388f2bc92be5b8a027d99681133937e560424
sunlongbo/chromium
third_party/blink/tools/blinkpy/common/checkout/git.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
find_executable_name
<not_specific>
def find_executable_name(executive, platform): """Finds the git executable name which may be different on Windows. The Win port uses the depot_tools package, which contains a number of development tools, including Python and git. Instead of using a real git executable, depot_tools indir...
Finds the git executable name which may be different on Windows. The Win port uses the depot_tools package, which contains a number of development tools, including Python and git. Instead of using a real git executable, depot_tools indirects via a batch file, called "git.bat". This batc...
Finds the git executable name which may be different on Windows. The Win port uses the depot_tools package, which contains a number of development tools, including Python and git. Instead of using a real git executable, depot_tools indirects via a batch file, called "git.bat". This batch file is used because it allows ...
[ "Finds", "the", "git", "executable", "name", "which", "may", "be", "different", "on", "Windows", ".", "The", "Win", "port", "uses", "the", "depot_tools", "package", "which", "contains", "a", "number", "of", "development", "tools", "including", "Python", "and",...
def find_executable_name(executive, platform): if not platform or not platform.is_win(): return 'git' try: executive.run_command(['git', 'help']) return 'git' except OSError: _log.debug('Using "git.bat" as git executable.') return 'git....
[ "def", "find_executable_name", "(", "executive", ",", "platform", ")", ":", "if", "not", "platform", "or", "not", "platform", ".", "is_win", "(", ")", ":", "return", "'git'", "try", ":", "executive", ".", "run_command", "(", "[", "'git'", ",", "'help'", ...
Finds the git executable name which may be different on Windows.
[ "Finds", "the", "git", "executable", "name", "which", "may", "be", "different", "on", "Windows", "." ]
[ "\"\"\"Finds the git executable name which may be different on Windows.\n\n The Win port uses the depot_tools package, which contains a number\n of development tools, including Python and git. Instead of using a\n real git executable, depot_tools indirects via a batch file, called\n \"gi...
[ { "param": "executive", "type": null }, { "param": "platform", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "executive", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "platform", "type": null, "docstring": null, "docstring_t...
d1b388f2bc92be5b8a027d99681133937e560424
sunlongbo/chromium
third_party/blink/tools/blinkpy/common/checkout/git.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
run
<not_specific>
def run(self, command_args, cwd=None, stdin=None, decode_output=True, return_exit_code=False): """Invokes git with the given args.""" full_command_args = [self._executable_name] + command_args cwd = cwd or self.checkout_root ret...
Invokes git with the given args.
Invokes git with the given args.
[ "Invokes", "git", "with", "the", "given", "args", "." ]
def run(self, command_args, cwd=None, stdin=None, decode_output=True, return_exit_code=False): full_command_args = [self._executable_name] + command_args cwd = cwd or self.checkout_root return self._executive.run_command(full_command_ar...
[ "def", "run", "(", "self", ",", "command_args", ",", "cwd", "=", "None", ",", "stdin", "=", "None", ",", "decode_output", "=", "True", ",", "return_exit_code", "=", "False", ")", ":", "full_command_args", "=", "[", "self", ".", "_executable_name", "]", "...
Invokes git with the given args.
[ "Invokes", "git", "with", "the", "given", "args", "." ]
[ "\"\"\"Invokes git with the given args.\"\"\"" ]
[ { "param": "self", "type": null }, { "param": "command_args", "type": null }, { "param": "cwd", "type": null }, { "param": "stdin", "type": null }, { "param": "decode_output", "type": null }, { "param": "return_exit_code", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "command_args", "type": null, "docstring": null, "docstring_to...
d1b388f2bc92be5b8a027d99681133937e560424
sunlongbo/chromium
third_party/blink/tools/blinkpy/common/checkout/git.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
has_working_directory_changes
<not_specific>
def has_working_directory_changes(self, pathspec=None): """Checks whether there are uncommitted changes.""" command = ['diff', 'HEAD', '--no-renames', '--name-only'] if pathspec: command.extend(['--', pathspec]) return self.run(command) != ''
Checks whether there are uncommitted changes.
Checks whether there are uncommitted changes.
[ "Checks", "whether", "there", "are", "uncommitted", "changes", "." ]
def has_working_directory_changes(self, pathspec=None): command = ['diff', 'HEAD', '--no-renames', '--name-only'] if pathspec: command.extend(['--', pathspec]) return self.run(command) != ''
[ "def", "has_working_directory_changes", "(", "self", ",", "pathspec", "=", "None", ")", ":", "command", "=", "[", "'diff'", ",", "'HEAD'", ",", "'--no-renames'", ",", "'--name-only'", "]", "if", "pathspec", ":", "command", ".", "extend", "(", "[", "'--'", ...
Checks whether there are uncommitted changes.
[ "Checks", "whether", "there", "are", "uncommitted", "changes", "." ]
[ "\"\"\"Checks whether there are uncommitted changes.\"\"\"" ]
[ { "param": "self", "type": null }, { "param": "pathspec", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "pathspec", "type": null, "docstring": null, "docstring_tokens...
d1b388f2bc92be5b8a027d99681133937e560424
sunlongbo/chromium
third_party/blink/tools/blinkpy/common/checkout/git.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
unstaged_changes
<not_specific>
def unstaged_changes(self): """Lists files with unstaged changes, including untracked files. Returns a dict mapping modified file paths (relative to checkout root) to one-character codes identifying the change, e.g. 'M' for modified, 'D' for deleted, '?' for untracked. """ ...
Lists files with unstaged changes, including untracked files. Returns a dict mapping modified file paths (relative to checkout root) to one-character codes identifying the change, e.g. 'M' for modified, 'D' for deleted, '?' for untracked.
Lists files with unstaged changes, including untracked files. Returns a dict mapping modified file paths (relative to checkout root) to one-character codes identifying the change, e.g.
[ "Lists", "files", "with", "unstaged", "changes", "including", "untracked", "files", ".", "Returns", "a", "dict", "mapping", "modified", "file", "paths", "(", "relative", "to", "checkout", "root", ")", "to", "one", "-", "character", "codes", "identifying", "the...
def unstaged_changes(self): change_lines = self.run(['status', '-z', '--untracked-files=all']).rstrip('\x00') if not change_lines: return {} unstaged_changes = {} for line in change_lines.split('\x00'): assert len(line) >= 4, 'Un...
[ "def", "unstaged_changes", "(", "self", ")", ":", "change_lines", "=", "self", ".", "run", "(", "[", "'status'", ",", "'-z'", ",", "'--untracked-files=all'", "]", ")", ".", "rstrip", "(", "'\\x00'", ")", "if", "not", "change_lines", ":", "return", "{", "...
Lists files with unstaged changes, including untracked files.
[ "Lists", "files", "with", "unstaged", "changes", "including", "untracked", "files", "." ]
[ "\"\"\"Lists files with unstaged changes, including untracked files.\n\n Returns a dict mapping modified file paths (relative to checkout root)\n to one-character codes identifying the change, e.g. 'M' for modified,\n 'D' for deleted, '?' for untracked.\n \"\"\"", "# `git status -z` is...
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
d1b388f2bc92be5b8a027d99681133937e560424
sunlongbo/chromium
third_party/blink/tools/blinkpy/common/checkout/git.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
current_branch
<not_specific>
def current_branch(self): """Returns the name of the current branch, or empty string if HEAD is detached.""" ref = self.run(['rev-parse', '--symbolic-full-name', 'HEAD']).strip() if ref == 'HEAD': # HEAD is detached; return an empty string. return '' return self._...
Returns the name of the current branch, or empty string if HEAD is detached.
Returns the name of the current branch, or empty string if HEAD is detached.
[ "Returns", "the", "name", "of", "the", "current", "branch", "or", "empty", "string", "if", "HEAD", "is", "detached", "." ]
def current_branch(self): ref = self.run(['rev-parse', '--symbolic-full-name', 'HEAD']).strip() if ref == 'HEAD': return '' return self._branch_from_ref(ref)
[ "def", "current_branch", "(", "self", ")", ":", "ref", "=", "self", ".", "run", "(", "[", "'rev-parse'", ",", "'--symbolic-full-name'", ",", "'HEAD'", "]", ")", ".", "strip", "(", ")", "if", "ref", "==", "'HEAD'", ":", "return", "''", "return", "self",...
Returns the name of the current branch, or empty string if HEAD is detached.
[ "Returns", "the", "name", "of", "the", "current", "branch", "or", "empty", "string", "if", "HEAD", "is", "detached", "." ]
[ "\"\"\"Returns the name of the current branch, or empty string if HEAD is detached.\"\"\"", "# HEAD is detached; return an empty string." ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
d1b388f2bc92be5b8a027d99681133937e560424
sunlongbo/chromium
third_party/blink/tools/blinkpy/common/checkout/git.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
create_patch
<not_specific>
def create_patch(self, git_commit=None, changed_files=None): """Returns a byte array (str) representing the patch file. Patch files are effectively binary since they may contain files of multiple different encodings. """ command = [ 'diff', '--binary', ...
Returns a byte array (str) representing the patch file. Patch files are effectively binary since they may contain files of multiple different encodings.
Returns a byte array (str) representing the patch file. Patch files are effectively binary since they may contain files of multiple different encodings.
[ "Returns", "a", "byte", "array", "(", "str", ")", "representing", "the", "patch", "file", ".", "Patch", "files", "are", "effectively", "binary", "since", "they", "may", "contain", "files", "of", "multiple", "different", "encodings", "." ]
def create_patch(self, git_commit=None, changed_files=None): command = [ 'diff', '--binary', '--no-color', '--no-ext-diff', '--full-index', '-M', '--src-prefix=a/', '--dst-prefix=b/', ] command += [se...
[ "def", "create_patch", "(", "self", ",", "git_commit", "=", "None", ",", "changed_files", "=", "None", ")", ":", "command", "=", "[", "'diff'", ",", "'--binary'", ",", "'--no-color'", ",", "'--no-ext-diff'", ",", "'--full-index'", ",", "'-M'", ",", "'--src-p...
Returns a byte array (str) representing the patch file.
[ "Returns", "a", "byte", "array", "(", "str", ")", "representing", "the", "patch", "file", "." ]
[ "\"\"\"Returns a byte array (str) representing the patch file.\n\n Patch files are effectively binary since they may contain\n files of multiple different encodings.\n \"\"\"" ]
[ { "param": "self", "type": null }, { "param": "git_commit", "type": null }, { "param": "changed_files", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "git_commit", "type": null, "docstring": null, "docstring_toke...
739c985d92fd80004b7f29b4b6a6df08aa548b9d
sunlongbo/chromium
testing/merge_scripts/merge_api.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
ArgumentParser
<not_specific>
def ArgumentParser(*args, **kwargs): """Creates an argument parser and adds the merge API arguments to it. See collect_task.collect_task for more on the merge script API. """ parser = argparse.ArgumentParser(*args, **kwargs) parser.add_argument('--build-properties', help=argparse.SUPPRESS) parser.add_argum...
Creates an argument parser and adds the merge API arguments to it. See collect_task.collect_task for more on the merge script API.
Creates an argument parser and adds the merge API arguments to it. See collect_task.collect_task for more on the merge script API.
[ "Creates", "an", "argument", "parser", "and", "adds", "the", "merge", "API", "arguments", "to", "it", ".", "See", "collect_task", ".", "collect_task", "for", "more", "on", "the", "merge", "script", "API", "." ]
def ArgumentParser(*args, **kwargs): parser = argparse.ArgumentParser(*args, **kwargs) parser.add_argument('--build-properties', help=argparse.SUPPRESS) parser.add_argument('--summary-json', help=argparse.SUPPRESS) parser.add_argument('--task-output-dir', help=argparse.SUPPRESS) parser.add_argument('-o', '--o...
[ "def", "ArgumentParser", "(", "*", "args", ",", "**", "kwargs", ")", ":", "parser", "=", "argparse", ".", "ArgumentParser", "(", "*", "args", ",", "**", "kwargs", ")", "parser", ".", "add_argument", "(", "'--build-properties'", ",", "help", "=", "argparse"...
Creates an argument parser and adds the merge API arguments to it.
[ "Creates", "an", "argument", "parser", "and", "adds", "the", "merge", "API", "arguments", "to", "it", "." ]
[ "\"\"\"Creates an argument parser and adds the merge API arguments to it.\n\n See collect_task.collect_task for more on the merge script API.\n \"\"\"" ]
[]
{ "returns": [], "raises": [], "params": [], "outlier_params": [], "others": [] }
6278ede0aeb21b152fd96e64d6341e4789bc4bfc
sunlongbo/chromium
tools/binary_size/libsupersize/linker_map_parser.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
ParseArmAnnotations
<not_specific>
def ParseArmAnnotations(tok): """Decides whether a Level 3 token is an annotation. Returns: A 2-tuple (is_annotation, next_thumb2_mode): is_annotation: Whether |tok| is an annotation. next_thumb2_mode: New |thumb2_mode| value, or None if keep old value. """ # Annotations for ARM m...
Decides whether a Level 3 token is an annotation. Returns: A 2-tuple (is_annotation, next_thumb2_mode): is_annotation: Whether |tok| is an annotation. next_thumb2_mode: New |thumb2_mode| value, or None if keep old value.
Decides whether a Level 3 token is an annotation.
[ "Decides", "whether", "a", "Level", "3", "token", "is", "an", "annotation", "." ]
def ParseArmAnnotations(tok): if tok.startswith('$') and (len(tok) == 2 or (len(tok) >= 3 and tok[2] == '.')): if tok.startswith('$t'): return True, True if tok.startswith('$a'): return True, False return True, None return False, None
[ "def", "ParseArmAnnotations", "(", "tok", ")", ":", "if", "tok", ".", "startswith", "(", "'$'", ")", "and", "(", "len", "(", "tok", ")", "==", "2", "or", "(", "len", "(", "tok", ")", ">=", "3", "and", "tok", "[", "2", "]", "==", "'.'", ")", "...
Decides whether a Level 3 token is an annotation.
[ "Decides", "whether", "a", "Level", "3", "token", "is", "an", "annotation", "." ]
[ "\"\"\"Decides whether a Level 3 token is an annotation.\n\n Returns:\n A 2-tuple (is_annotation, next_thumb2_mode):\n is_annotation: Whether |tok| is an annotation.\n next_thumb2_mode: New |thumb2_mode| value, or None if keep old value.\n \"\"\"", "# Annotations for ARM match '$t', '$d.1...
[ { "param": "tok", "type": null } ]
{ "returns": [ { "docstring": "A 2-tuple (is_annotation, next_thumb2_mode):\nis_annotation: Whether |tok| is an annotation.\nnext_thumb2_mode: New |thumb2_mode| value, or None if keep old value.", "docstring_tokens": [ "A", "2", "-", "tuple", "(", "is_an...
6278ede0aeb21b152fd96e64d6341e4789bc4bfc
sunlongbo/chromium
tools/binary_size/libsupersize/linker_map_parser.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
Tokenize
null
def Tokenize(self, lines): """Generator to filter and tokenize linker map lines.""" # Extract e.g., 'lld_v0' -> 0, or 'lld-lto_v1' -> 1. map_file_version = int(self._linker_name.split('_v')[1]) pattern = MapFileParserLld._LINE_RE[map_file_version] # A Level 3 symbol can have |size == 0| in some sit...
Generator to filter and tokenize linker map lines.
Generator to filter and tokenize linker map lines.
[ "Generator", "to", "filter", "and", "tokenize", "linker", "map", "lines", "." ]
def Tokenize(self, lines): map_file_version = int(self._linker_name.split('_v')[1]) pattern = MapFileParserLld._LINE_RE[map_file_version] sentinel = '0 0 0 0 THE_END' assert pattern.match(sentinel) level2_end_address = None thumb2_mode = False (line, address, size, level, tok) = (None, None,...
[ "def", "Tokenize", "(", "self", ",", "lines", ")", ":", "map_file_version", "=", "int", "(", "self", ".", "_linker_name", ".", "split", "(", "'_v'", ")", "[", "1", "]", ")", "pattern", "=", "MapFileParserLld", ".", "_LINE_RE", "[", "map_file_version", "]...
Generator to filter and tokenize linker map lines.
[ "Generator", "to", "filter", "and", "tokenize", "linker", "map", "lines", "." ]
[ "\"\"\"Generator to filter and tokenize linker map lines.\"\"\"", "# Extract e.g., 'lld_v0' -> 0, or 'lld-lto_v1' -> 1.", "# A Level 3 symbol can have |size == 0| in some situations (e.g., assembly", "# code symbols). To provided better size estimates in this case, the \"span\"", "# of a Level 3 symbol is c...
[ { "param": "self", "type": null }, { "param": "lines", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "lines", "type": null, "docstring": null, "docstring_tokens": ...
6278ede0aeb21b152fd96e64d6341e4789bc4bfc
sunlongbo/chromium
tools/binary_size/libsupersize/linker_map_parser.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
_DetectLto
<not_specific>
def _DetectLto(lines): """Scans LLD linker map file and returns whether LTO was used.""" # It's assumed that the first line in |lines| was consumed to determine that # LLD was used. Seek 'thinlto-cache' prefix within an "indicator section" as # indicator for LTO. found_indicator_section = False # Potential ...
Scans LLD linker map file and returns whether LTO was used.
Scans LLD linker map file and returns whether LTO was used.
[ "Scans", "LLD", "linker", "map", "file", "and", "returns", "whether", "LTO", "was", "used", "." ]
def _DetectLto(lines): found_indicator_section = False indicator_section_set = set(['.rodata', '.ARM.exidx']) start_pos = -1 for line in lines: if start_pos < 0: start_pos = line.index('.') if len(line) < start_pos: continue line = line[start_pos:] tok = line.lstrip() indent_si...
[ "def", "_DetectLto", "(", "lines", ")", ":", "found_indicator_section", "=", "False", "indicator_section_set", "=", "set", "(", "[", "'.rodata'", ",", "'.ARM.exidx'", "]", ")", "start_pos", "=", "-", "1", "for", "line", "in", "lines", ":", "if", "start_pos",...
Scans LLD linker map file and returns whether LTO was used.
[ "Scans", "LLD", "linker", "map", "file", "and", "returns", "whether", "LTO", "was", "used", "." ]
[ "\"\"\"Scans LLD linker map file and returns whether LTO was used.\"\"\"", "# It's assumed that the first line in |lines| was consumed to determine that", "# LLD was used. Seek 'thinlto-cache' prefix within an \"indicator section\" as", "# indicator for LTO.", "# Potential names of \"main section\". Only on...
[ { "param": "lines", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "lines", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
6278ede0aeb21b152fd96e64d6341e4789bc4bfc
sunlongbo/chromium
tools/binary_size/libsupersize/linker_map_parser.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
DetectLinkerNameFromMapFile
<not_specific>
def DetectLinkerNameFromMapFile(lines): """Heuristic linker detection from partial scan of the linker map. Args: lines: Iterable of lines from the linker map. Returns: A coded linker name. """ first_line = next(lines) if first_line.startswith('Address'): return 'lld-lto_v0' if _DetectLto(lin...
Heuristic linker detection from partial scan of the linker map. Args: lines: Iterable of lines from the linker map. Returns: A coded linker name.
Heuristic linker detection from partial scan of the linker map.
[ "Heuristic", "linker", "detection", "from", "partial", "scan", "of", "the", "linker", "map", "." ]
def DetectLinkerNameFromMapFile(lines): first_line = next(lines) if first_line.startswith('Address'): return 'lld-lto_v0' if _DetectLto(lines) else 'lld_v0' if first_line.lstrip().startswith('VMA'): return 'lld-lto_v1' if _DetectLto(lines) else 'lld_v1' if first_line.startswith('Archive member'): re...
[ "def", "DetectLinkerNameFromMapFile", "(", "lines", ")", ":", "first_line", "=", "next", "(", "lines", ")", "if", "first_line", ".", "startswith", "(", "'Address'", ")", ":", "return", "'lld-lto_v0'", "if", "_DetectLto", "(", "lines", ")", "else", "'lld_v0'", ...
Heuristic linker detection from partial scan of the linker map.
[ "Heuristic", "linker", "detection", "from", "partial", "scan", "of", "the", "linker", "map", "." ]
[ "\"\"\"Heuristic linker detection from partial scan of the linker map.\n\n Args:\n lines: Iterable of lines from the linker map.\n\n Returns:\n A coded linker name.\n\n \"\"\"" ]
[ { "param": "lines", "type": null } ]
{ "returns": [ { "docstring": "A coded linker name.", "docstring_tokens": [ "A", "coded", "linker", "name", "." ], "type": null } ], "raises": [], "params": [ { "identifier": "lines", "type": null, "docstring": "Iterab...
6278ede0aeb21b152fd96e64d6341e4789bc4bfc
sunlongbo/chromium
tools/binary_size/libsupersize/linker_map_parser.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
Parse
<not_specific>
def Parse(self, linker_name, lines): """Parses a linker map file. Args: linker_name: Coded linker name to specify a linker. lines: Iterable of lines from the linker map. Returns: A tuple of (section_ranges, symbols, extras). """ next(lines) # Consume the first line of headers. ...
Parses a linker map file. Args: linker_name: Coded linker name to specify a linker. lines: Iterable of lines from the linker map. Returns: A tuple of (section_ranges, symbols, extras).
Parses a linker map file.
[ "Parses", "a", "linker", "map", "file", "." ]
def Parse(self, linker_name, lines): next(lines) if linker_name.startswith('lld'): inner_parser = MapFileParserLld(linker_name) elif linker_name == 'gold': inner_parser = MapFileParserGold() else: raise Exception('.map file is from a unsupported linker.') section_ranges, syms, ex...
[ "def", "Parse", "(", "self", ",", "linker_name", ",", "lines", ")", ":", "next", "(", "lines", ")", "if", "linker_name", ".", "startswith", "(", "'lld'", ")", ":", "inner_parser", "=", "MapFileParserLld", "(", "linker_name", ")", "elif", "linker_name", "==...
Parses a linker map file.
[ "Parses", "a", "linker", "map", "file", "." ]
[ "\"\"\"Parses a linker map file.\n\n Args:\n linker_name: Coded linker name to specify a linker.\n lines: Iterable of lines from the linker map.\n\n Returns:\n A tuple of (section_ranges, symbols, extras).\n \"\"\"", "# Consume the first line of headers.", "# Don't want '' to become '.'....
[ { "param": "self", "type": null }, { "param": "linker_name", "type": null }, { "param": "lines", "type": null } ]
{ "returns": [ { "docstring": "A tuple of (section_ranges, symbols, extras).", "docstring_tokens": [ "A", "tuple", "of", "(", "section_ranges", "symbols", "extras", ")", "." ], "type": null } ], "raises": [], ...
6278ede0aeb21b152fd96e64d6341e4789bc4bfc
sunlongbo/chromium
tools/binary_size/libsupersize/linker_map_parser.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
DeduceObjectPathsFromThinMap
<not_specific>
def DeduceObjectPathsFromThinMap(raw_symbols, extras): """Uses Thin-LTO object paths to find object_paths of symbols. """ thin_map = extras.get('thin_map', None) # |address| -> |thin_obj| if not thin_map: # None or empty. logging.info('No thin-object-path found: Skipping object path deduction.') return ...
Uses Thin-LTO object paths to find object_paths of symbols.
Uses Thin-LTO object paths to find object_paths of symbols.
[ "Uses", "Thin", "-", "LTO", "object", "paths", "to", "find", "object_paths", "of", "symbols", "." ]
def DeduceObjectPathsFromThinMap(raw_symbols, extras): thin_map = extras.get('thin_map', None) if not thin_map: logging.info('No thin-object-path found: Skipping object path deduction.') return thin_obj_to_object_paths = collections.defaultdict(set) logging.info('Building map of thin-object-path -> ...
[ "def", "DeduceObjectPathsFromThinMap", "(", "raw_symbols", ",", "extras", ")", ":", "thin_map", "=", "extras", ".", "get", "(", "'thin_map'", ",", "None", ")", "if", "not", "thin_map", ":", "logging", ".", "info", "(", "'No thin-object-path found: Skipping object ...
Uses Thin-LTO object paths to find object_paths of symbols.
[ "Uses", "Thin", "-", "LTO", "object", "paths", "to", "find", "object_paths", "of", "symbols", "." ]
[ "\"\"\"Uses Thin-LTO object paths to find object_paths of symbols. \"\"\"", "# |address| -> |thin_obj|", "# None or empty.", "# Build map of |thin_obj| -> |object_paths|.", "# For each symbol without |object_path|, translate |address| -> |thin_obj| ->", "# |object_paths|. If unique, then assign to symbol....
[ { "param": "raw_symbols", "type": null }, { "param": "extras", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "raw_symbols", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "extras", "type": null, "docstring": null, "docstring_t...
0894c5eb5a520542745807eda99cfee9e27d2958
sunlongbo/chromium
tools/android/native_lib_memory/process_residency.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
CreateArgumentParser
<not_specific>
def CreateArgumentParser(): """Creates and returns an argument parser.""" parser = argparse.ArgumentParser( description='Reads and shows native library residency data.') parser.add_argument('--dump', type=str, required=True, help='Residency dump') parser.add_argument('--output', type=str, required=True, ...
Creates and returns an argument parser.
Creates and returns an argument parser.
[ "Creates", "and", "returns", "an", "argument", "parser", "." ]
def CreateArgumentParser(): parser = argparse.ArgumentParser( description='Reads and shows native library residency data.') parser.add_argument('--dump', type=str, required=True, help='Residency dump') parser.add_argument('--output', type=str, required=True, help='Output filename in te...
[ "def", "CreateArgumentParser", "(", ")", ":", "parser", "=", "argparse", ".", "ArgumentParser", "(", "description", "=", "'Reads and shows native library residency data.'", ")", "parser", ".", "add_argument", "(", "'--dump'", ",", "type", "=", "str", ",", "required"...
Creates and returns an argument parser.
[ "Creates", "and", "returns", "an", "argument", "parser", "." ]
[ "\"\"\"Creates and returns an argument parser.\"\"\"" ]
[]
{ "returns": [], "raises": [], "params": [], "outlier_params": [], "others": [] }
0894c5eb5a520542745807eda99cfee9e27d2958
sunlongbo/chromium
tools/android/native_lib_memory/process_residency.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
ParseDump
<not_specific>
def ParseDump(filename): """Parses a residency dump, as generated from orderfile_instrumentation.cc. Args: filename: (str) dump filename. Returns: {"start": offset, "end": offset, "residency": {timestamp (int): data ([bool])}} """ result = {} with open(filename, 'r') as f: (start, end) = ...
Parses a residency dump, as generated from orderfile_instrumentation.cc. Args: filename: (str) dump filename. Returns: {"start": offset, "end": offset, "residency": {timestamp (int): data ([bool])}}
Parses a residency dump, as generated from orderfile_instrumentation.cc.
[ "Parses", "a", "residency", "dump", "as", "generated", "from", "orderfile_instrumentation", ".", "cc", "." ]
def ParseDump(filename): result = {} with open(filename, 'r') as f: (start, end) = f.readline().strip().split(' ') result = {'start': int(start), 'end': int(end), 'residency': {}} for line in f: line = line.strip() timestamp, data = line.split(' ') data_array = [x == '1' for x in data]...
[ "def", "ParseDump", "(", "filename", ")", ":", "result", "=", "{", "}", "with", "open", "(", "filename", ",", "'r'", ")", "as", "f", ":", "(", "start", ",", "end", ")", "=", "f", ".", "readline", "(", ")", ".", "strip", "(", ")", ".", "split", ...
Parses a residency dump, as generated from orderfile_instrumentation.cc.
[ "Parses", "a", "residency", "dump", "as", "generated", "from", "orderfile_instrumentation", ".", "cc", "." ]
[ "\"\"\"Parses a residency dump, as generated from orderfile_instrumentation.cc.\n\n Args:\n filename: (str) dump filename.\n\n Returns:\n {\"start\": offset, \"end\": offset,\n \"residency\": {timestamp (int): data ([bool])}}\n \"\"\"" ]
[ { "param": "filename", "type": null } ]
{ "returns": [ { "docstring": "offset, \"end\": offset,\n\"residency\": {timestamp (int): data ([bool])}}", "docstring_tokens": [ "offset", "\"", "end", "\"", ":", "offset", "\"", "residency", "\"", ":", "{", ...
0894c5eb5a520542745807eda99cfee9e27d2958
sunlongbo/chromium
tools/android/native_lib_memory/process_residency.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
WriteJsonOutput
null
def WriteJsonOutput(data, filename): """Serializes the parsed data to JSON. Args: data: (dict) As returned by ParseDump() filename: (str) output filename. JSON format: {'offset': int, 'data': { relative_timestamp: [{'page_offset': int, 'resident': bool}]}} Where: - offset is the code start ...
Serializes the parsed data to JSON. Args: data: (dict) As returned by ParseDump() filename: (str) output filename. JSON format: {'offset': int, 'data': { relative_timestamp: [{'page_offset': int, 'resident': bool}]}} Where: - offset is the code start offset into its page - relative_timest...
Serializes the parsed data to JSON.
[ "Serializes", "the", "parsed", "data", "to", "JSON", "." ]
def WriteJsonOutput(data, filename): result = {'offset': data['start'], 'data': {}} start_timestamp = min(data['residency'].keys()) for timestamp in data['residency']: adjusted_timestamp = timestamp - start_timestamp result[adjusted_timestamp] = [] residency = data['residency'][timestamp] for (ind...
[ "def", "WriteJsonOutput", "(", "data", ",", "filename", ")", ":", "result", "=", "{", "'offset'", ":", "data", "[", "'start'", "]", ",", "'data'", ":", "{", "}", "}", "start_timestamp", "=", "min", "(", "data", "[", "'residency'", "]", ".", "keys", "...
Serializes the parsed data to JSON.
[ "Serializes", "the", "parsed", "data", "to", "JSON", "." ]
[ "\"\"\"Serializes the parsed data to JSON.\n\n Args:\n data: (dict) As returned by ParseDump()\n filename: (str) output filename.\n\n JSON format:\n {'offset': int, 'data': {\n relative_timestamp: [{'page_offset': int, 'resident': bool}]}}\n\n Where:\n - offset is the code start offset into its page...
[ { "param": "data", "type": null }, { "param": "filename", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "data", "type": null, "docstring": "(dict) As returned by ParseDump()", "docstring_tokens": [ "(", "dict", ")", "As", "returned", "by", "ParseDump", "()" ], ...
0894c5eb5a520542745807eda99cfee9e27d2958
sunlongbo/chromium
tools/android/native_lib_memory/process_residency.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
PlotResidency
null
def PlotResidency(data, output_filename): """Creates a graph of residency. Args: data: (dict) As returned by ParseDump(). output_filename: (str) Output filename. """ residency = data['residency'] max_percentage = max((100. * sum(d)) / len(d) for d in residency.values()) logging.info('Max residency ...
Creates a graph of residency. Args: data: (dict) As returned by ParseDump(). output_filename: (str) Output filename.
Creates a graph of residency.
[ "Creates", "a", "graph", "of", "residency", "." ]
def PlotResidency(data, output_filename): residency = data['residency'] max_percentage = max((100. * sum(d)) / len(d) for d in residency.values()) logging.info('Max residency = %.2f%%', max_percentage) start = data['start'] end = data['end'] _, ax = plt.subplots(figsize=(20, 10)) timestamps = sorted(resid...
[ "def", "PlotResidency", "(", "data", ",", "output_filename", ")", ":", "residency", "=", "data", "[", "'residency'", "]", "max_percentage", "=", "max", "(", "(", "100.", "*", "sum", "(", "d", ")", ")", "/", "len", "(", "d", ")", "for", "d", "in", "...
Creates a graph of residency.
[ "Creates", "a", "graph", "of", "residency", "." ]
[ "\"\"\"Creates a graph of residency.\n\n Args:\n data: (dict) As returned by ParseDump().\n output_filename: (str) Output filename.\n \"\"\"" ]
[ { "param": "data", "type": null }, { "param": "output_filename", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "data", "type": null, "docstring": "(dict) As returned by ParseDump().", "docstring_tokens": [ "(", "dict", ")", "As", "returned", "by", "ParseDump", "()", ...
439aff748fdeff52e93776af91dde5f923ac35a6
sunlongbo/chromium
build/fuchsia/generic_x64_target.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
_ProvisionDevice
null
def _ProvisionDevice(self): """Pave a device with a generic image of Fuchsia.""" bootserver_path = GetHostToolPathFromPlatform('bootserver') bootserver_command = [ bootserver_path, '-1', '--fvm', EnsurePathExists( boot_data.GetTargetFile('storage-sparse.blk', ...
Pave a device with a generic image of Fuchsia.
Pave a device with a generic image of Fuchsia.
[ "Pave", "a", "device", "with", "a", "generic", "image", "of", "Fuchsia", "." ]
def _ProvisionDevice(self): bootserver_path = GetHostToolPathFromPlatform('bootserver') bootserver_command = [ bootserver_path, '-1', '--fvm', EnsurePathExists( boot_data.GetTargetFile('storage-sparse.blk', self._GetTargetSdkArch(), ...
[ "def", "_ProvisionDevice", "(", "self", ")", ":", "bootserver_path", "=", "GetHostToolPathFromPlatform", "(", "'bootserver'", ")", "bootserver_command", "=", "[", "bootserver_path", ",", "'-1'", ",", "'--fvm'", ",", "EnsurePathExists", "(", "boot_data", ".", "GetTar...
Pave a device with a generic image of Fuchsia.
[ "Pave", "a", "device", "with", "a", "generic", "image", "of", "Fuchsia", "." ]
[ "\"\"\"Pave a device with a generic image of Fuchsia.\"\"\"", "# Update the target's hash to match the current tree's." ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
d9b834f2713c1c88ea51d1799deb92d1b0197306
sunlongbo/chromium
third_party/blink/renderer/modules/bluetooth/testing/clusterfuzz/fuzz_main_run.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
_GetArguments
<not_specific>
def _GetArguments(): """Parses the arguments passed when running this script. Returns: An argparse.Namespace object containing the arguments in sys.argv. """ parser = argparse.ArgumentParser() # Arguments used by ClusterFuzz: parser.add_argument( '-n', '--no_of_files', ...
Parses the arguments passed when running this script. Returns: An argparse.Namespace object containing the arguments in sys.argv.
Parses the arguments passed when running this script.
[ "Parses", "the", "arguments", "passed", "when", "running", "this", "script", "." ]
def _GetArguments(): parser = argparse.ArgumentParser() parser.add_argument( '-n', '--no_of_files', type=int, required=True, help='The number of test cases that the fuzzer is ' 'expected to generate') parser.add_argument( '-i', '--input_dir', ...
[ "def", "_GetArguments", "(", ")", ":", "parser", "=", "argparse", ".", "ArgumentParser", "(", ")", "parser", ".", "add_argument", "(", "'-n'", ",", "'--no_of_files'", ",", "type", "=", "int", ",", "required", "=", "True", ",", "help", "=", "'The number of ...
Parses the arguments passed when running this script.
[ "Parses", "the", "arguments", "passed", "when", "running", "this", "script", "." ]
[ "\"\"\"Parses the arguments passed when running this script.\n\n Returns:\n An argparse.Namespace object containing the arguments in sys.argv.\n \"\"\"", "# Arguments used by ClusterFuzz:" ]
[]
{ "returns": [ { "docstring": "An argparse.Namespace object containing the arguments in sys.argv.", "docstring_tokens": [ "An", "argparse", ".", "Namespace", "object", "containing", "the", "arguments", "in", "sys", ...
d9b834f2713c1c88ea51d1799deb92d1b0197306
sunlongbo/chromium
third_party/blink/renderer/modules/bluetooth/testing/clusterfuzz/fuzz_main_run.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
FuzzTemplate
<not_specific>
def FuzzTemplate(template_path, resources_path): """Uses a template to return a test case that can be run as a web test. This functions reads the template in |template_path|, injects the necessary js files to run as a web test and fuzzes the template's parameters to generate a test case. Args: ...
Uses a template to return a test case that can be run as a web test. This functions reads the template in |template_path|, injects the necessary js files to run as a web test and fuzzes the template's parameters to generate a test case. Args: template_path: The path to the template that will be ...
Uses a template to return a test case that can be run as a web test. This functions reads the template in |template_path|, injects the necessary js files to run as a web test and fuzzes the template's parameters to generate a test case.
[ "Uses", "a", "template", "to", "return", "a", "test", "case", "that", "can", "be", "run", "as", "a", "web", "test", ".", "This", "functions", "reads", "the", "template", "in", "|template_path|", "injects", "the", "necessary", "js", "files", "to", "run", ...
def FuzzTemplate(template_path, resources_path): print 'Generating test file based on {}'.format(template_path) template_file_handle = open(template_path) template_file_data = template_file_handle.read().decode('utf-8') template_file_handle.close() generated_test = test_case_fuzzer.GenerateTestFile(...
[ "def", "FuzzTemplate", "(", "template_path", ",", "resources_path", ")", ":", "print", "'Generating test file based on {}'", ".", "format", "(", "template_path", ")", "template_file_handle", "=", "open", "(", "template_path", ")", "template_file_data", "=", "template_fi...
Uses a template to return a test case that can be run as a web test.
[ "Uses", "a", "template", "to", "return", "a", "test", "case", "that", "can", "be", "run", "as", "a", "web", "test", "." ]
[ "\"\"\"Uses a template to return a test case that can be run as a web test.\n\n This functions reads the template in |template_path|, injects the necessary\n js files to run as a web test and fuzzes the template's parameters to\n generate a test case.\n\n Args:\n template_path: The path to the temp...
[ { "param": "template_path", "type": null }, { "param": "resources_path", "type": null } ]
{ "returns": [ { "docstring": "A string containing the test case.", "docstring_tokens": [ "A", "string", "containing", "the", "test", "case", "." ], "type": null } ], "raises": [], "params": [ { "identifier": "temp...
d9b834f2713c1c88ea51d1799deb92d1b0197306
sunlongbo/chromium
third_party/blink/renderer/modules/bluetooth/testing/clusterfuzz/fuzz_main_run.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
WriteTestFile
<not_specific>
def WriteTestFile(test_file_data, test_file_prefix, output_dir): """Creates a new file with a unique name and writes the test case to it. Args: test_file_data: The data to be included in the new file. test_file_prefix: Used as a prefix when generating a new file. output_dir: The directory whe...
Creates a new file with a unique name and writes the test case to it. Args: test_file_data: The data to be included in the new file. test_file_prefix: Used as a prefix when generating a new file. output_dir: The directory where the new file should be created. Returns: A string represen...
Creates a new file with a unique name and writes the test case to it.
[ "Creates", "a", "new", "file", "with", "a", "unique", "name", "and", "writes", "the", "test", "case", "to", "it", "." ]
def WriteTestFile(test_file_data, test_file_prefix, output_dir): file_descriptor, file_path = tempfile.mkstemp( prefix=test_file_prefix, suffix='.html', dir=output_dir) with os.fdopen(file_descriptor, 'wb') as output: print 'Writing {} bytes to \'{}\''.format( len(test_file_data), fi...
[ "def", "WriteTestFile", "(", "test_file_data", ",", "test_file_prefix", ",", "output_dir", ")", ":", "file_descriptor", ",", "file_path", "=", "tempfile", ".", "mkstemp", "(", "prefix", "=", "test_file_prefix", ",", "suffix", "=", "'.html'", ",", "dir", "=", "...
Creates a new file with a unique name and writes the test case to it.
[ "Creates", "a", "new", "file", "with", "a", "unique", "name", "and", "writes", "the", "test", "case", "to", "it", "." ]
[ "\"\"\"Creates a new file with a unique name and writes the test case to it.\n\n Args:\n test_file_data: The data to be included in the new file.\n test_file_prefix: Used as a prefix when generating a new file.\n output_dir: The directory where the new file should be created.\n\n Returns:\n ...
[ { "param": "test_file_data", "type": null }, { "param": "test_file_prefix", "type": null }, { "param": "output_dir", "type": null } ]
{ "returns": [ { "docstring": "A string representing the file path to access the new file.", "docstring_tokens": [ "A", "string", "representing", "the", "file", "path", "to", "access", "the", "new", "file", ...
6dc6a7fa13f2d191502c8e266cdc2c46d2b48690
sunlongbo/chromium
chrome/test/chromedriver/client/chromedriver.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
_WrapValue
<not_specific>
def _WrapValue(self, value): """Wrap value from client side for chromedriver side.""" if isinstance(value, dict): converted = {} for key, val in value.items(): converted[key] = self._WrapValue(val) return converted elif isinstance(value, WebElement): if (self.w3c_compliant): ...
Wrap value from client side for chromedriver side.
Wrap value from client side for chromedriver side.
[ "Wrap", "value", "from", "client", "side", "for", "chromedriver", "side", "." ]
def _WrapValue(self, value): if isinstance(value, dict): converted = {} for key, val in value.items(): converted[key] = self._WrapValue(val) return converted elif isinstance(value, WebElement): if (self.w3c_compliant): return {ELEMENT_KEY_W3C: value._id} else: ...
[ "def", "_WrapValue", "(", "self", ",", "value", ")", ":", "if", "isinstance", "(", "value", ",", "dict", ")", ":", "converted", "=", "{", "}", "for", "key", ",", "val", "in", "value", ".", "items", "(", ")", ":", "converted", "[", "key", "]", "="...
Wrap value from client side for chromedriver side.
[ "Wrap", "value", "from", "client", "side", "for", "chromedriver", "side", "." ]
[ "\"\"\"Wrap value from client side for chromedriver side.\"\"\"" ]
[ { "param": "self", "type": null }, { "param": "value", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "value", "type": null, "docstring": null, "docstring_tokens": ...
6dc6a7fa13f2d191502c8e266cdc2c46d2b48690
sunlongbo/chromium
chrome/test/chromedriver/client/chromedriver.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
PerformActions
null
def PerformActions(self, actions): """ actions: a dictionary containing the specified actions users wish to perform """ self.ExecuteCommand(Command.PERFORM_ACTIONS, actions)
actions: a dictionary containing the specified actions users wish to perform
a dictionary containing the specified actions users wish to perform
[ "a", "dictionary", "containing", "the", "specified", "actions", "users", "wish", "to", "perform" ]
def PerformActions(self, actions): self.ExecuteCommand(Command.PERFORM_ACTIONS, actions)
[ "def", "PerformActions", "(", "self", ",", "actions", ")", ":", "self", ".", "ExecuteCommand", "(", "Command", ".", "PERFORM_ACTIONS", ",", "actions", ")" ]
actions: a dictionary containing the specified actions users wish to perform
[ "actions", ":", "a", "dictionary", "containing", "the", "specified", "actions", "users", "wish", "to", "perform" ]
[ "\"\"\"\n actions: a dictionary containing the specified actions users wish to perform\n \"\"\"" ]
[ { "param": "self", "type": null }, { "param": "actions", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "actions", "type": null, "docstring": null, "docstring_tokens"...
e64ed3fdd795804bc004bd2b2ef1dd7e85242fcf
sunlongbo/chromium
tools/metrics/histograms/split_xml.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
_ParseMergedXML
<not_specific>
def _ParseMergedXML(): """Parses merged xml into different types of nodes""" merged_histograms = merge_xml.MergeFiles(histogram_paths.HISTOGRAMS_XMLS + [histogram_paths.OBSOLETE_XML]) histogram_nodes = merged_histograms.getElementsByTagName('histogram') variants_nodes ...
Parses merged xml into different types of nodes
Parses merged xml into different types of nodes
[ "Parses", "merged", "xml", "into", "different", "types", "of", "nodes" ]
def _ParseMergedXML(): merged_histograms = merge_xml.MergeFiles(histogram_paths.HISTOGRAMS_XMLS + [histogram_paths.OBSOLETE_XML]) histogram_nodes = merged_histograms.getElementsByTagName('histogram') variants_nodes = merged_histograms.getElementsByTagName('variants') h...
[ "def", "_ParseMergedXML", "(", ")", ":", "merged_histograms", "=", "merge_xml", ".", "MergeFiles", "(", "histogram_paths", ".", "HISTOGRAMS_XMLS", "+", "[", "histogram_paths", ".", "OBSOLETE_XML", "]", ")", "histogram_nodes", "=", "merged_histograms", ".", "getEleme...
Parses merged xml into different types of nodes
[ "Parses", "merged", "xml", "into", "different", "types", "of", "nodes" ]
[ "\"\"\"Parses merged xml into different types of nodes\"\"\"" ]
[]
{ "returns": [], "raises": [], "params": [], "outlier_params": [], "others": [] }
e64ed3fdd795804bc004bd2b2ef1dd7e85242fcf
sunlongbo/chromium
tools/metrics/histograms/split_xml.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
_GetCamelCaseName
<not_specific>
def _GetCamelCaseName(node, depth=0): """Returns the first camelcase name part of the given |node|. Args: node: The node to get name from. depth: The depth that specifies which name part will be returned. e.g. For a node of name 'CustomTabs.DynamicModule.CreatePackageContextTime' Th...
Returns the first camelcase name part of the given |node|. Args: node: The node to get name from. depth: The depth that specifies which name part will be returned. e.g. For a node of name 'CustomTabs.DynamicModule.CreatePackageContextTime' The returned camel name for depth 0 is 'Custo...
Returns the first camelcase name part of the given |node|.
[ "Returns", "the", "first", "camelcase", "name", "part", "of", "the", "given", "|node|", "." ]
def _GetCamelCaseName(node, depth=0): name = node.getAttribute('name') split_string_list = name.split('.') if len(split_string_list) <= depth: return 'others' elif split_string_list[depth] in _PREDEFINED_NAMES_MAPPING: return _PREDEFINED_NAMES_MAPPING[split_string_list[depth]] else: name_part = sp...
[ "def", "_GetCamelCaseName", "(", "node", ",", "depth", "=", "0", ")", ":", "name", "=", "node", ".", "getAttribute", "(", "'name'", ")", "split_string_list", "=", "name", ".", "split", "(", "'.'", ")", "if", "len", "(", "split_string_list", ")", "<=", ...
Returns the first camelcase name part of the given |node|.
[ "Returns", "the", "first", "camelcase", "name", "part", "of", "the", "given", "|node|", "." ]
[ "\"\"\"Returns the first camelcase name part of the given |node|.\n\n Args:\n node: The node to get name from.\n depth: The depth that specifies which name part will be returned.\n e.g. For a node of name\n 'CustomTabs.DynamicModule.CreatePackageContextTime'\n The returned camel name for...
[ { "param": "node", "type": null }, { "param": "depth", "type": null } ]
{ "returns": [ { "docstring": "The camelcase name part at specified depth. If the number of name parts is\nless than the depth, return 'others'.", "docstring_tokens": [ "The", "camelcase", "name", "part", "at", "specified", "depth", ".", ...
e64ed3fdd795804bc004bd2b2ef1dd7e85242fcf
sunlongbo/chromium
tools/metrics/histograms/split_xml.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
GetDirForNode
<not_specific>
def GetDirForNode(node): """Returns the correct directory that the given |node| should be placed in.""" camel_name = _GetCamelCaseName(node) # Check if the directory of its prefix exists. Return the |camel_name| if the # folder exists. Otherwise, this |node| should be placed in 'others' folder. if camel_name ...
Returns the correct directory that the given |node| should be placed in.
Returns the correct directory that the given |node| should be placed in.
[ "Returns", "the", "correct", "directory", "that", "the", "given", "|node|", "should", "be", "placed", "in", "." ]
def GetDirForNode(node): camel_name = _GetCamelCaseName(node) if camel_name in histogram_paths.HISTOGRAMS_PREFIX_LIST: return camel_name return 'others'
[ "def", "GetDirForNode", "(", "node", ")", ":", "camel_name", "=", "_GetCamelCaseName", "(", "node", ")", "if", "camel_name", "in", "histogram_paths", ".", "HISTOGRAMS_PREFIX_LIST", ":", "return", "camel_name", "return", "'others'" ]
Returns the correct directory that the given |node| should be placed in.
[ "Returns", "the", "correct", "directory", "that", "the", "given", "|node|", "should", "be", "placed", "in", "." ]
[ "\"\"\"Returns the correct directory that the given |node| should be placed in.\"\"\"", "# Check if the directory of its prefix exists. Return the |camel_name| if the", "# folder exists. Otherwise, this |node| should be placed in 'others' folder." ]
[ { "param": "node", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "node", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
e64ed3fdd795804bc004bd2b2ef1dd7e85242fcf
sunlongbo/chromium
tools/metrics/histograms/split_xml.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
_OutputToFolderAndXML
null
def _OutputToFolderAndXML(nodes, output_dir, key): """Creates new folder and XML file for separated histograms. Args: nodes: A list of histogram/variants nodes of a prefix. output_dir: The output directory. key: The prefix of the histograms, also the name of the new folder. """ # Convert CamelCase ...
Creates new folder and XML file for separated histograms. Args: nodes: A list of histogram/variants nodes of a prefix. output_dir: The output directory. key: The prefix of the histograms, also the name of the new folder.
Creates new folder and XML file for separated histograms.
[ "Creates", "new", "folder", "and", "XML", "file", "for", "separated", "histograms", "." ]
def _OutputToFolderAndXML(nodes, output_dir, key): output_dir = os.path.join(output_dir, _CamelCaseToSnakeCase(key)) if not os.path.exists(output_dir): os.makedirs(output_dir) _CreateXMLFile(key + ' histograms', 'histograms', nodes, output_dir, 'histograms.xml')
[ "def", "_OutputToFolderAndXML", "(", "nodes", ",", "output_dir", ",", "key", ")", ":", "output_dir", "=", "os", ".", "path", ".", "join", "(", "output_dir", ",", "_CamelCaseToSnakeCase", "(", "key", ")", ")", "if", "not", "os", ".", "path", ".", "exists"...
Creates new folder and XML file for separated histograms.
[ "Creates", "new", "folder", "and", "XML", "file", "for", "separated", "histograms", "." ]
[ "\"\"\"Creates new folder and XML file for separated histograms.\n\n Args:\n nodes: A list of histogram/variants nodes of a prefix.\n output_dir: The output directory.\n key: The prefix of the histograms, also the name of the new folder.\n \"\"\"", "# Convert CamelCase name to snake_case when creating ...
[ { "param": "nodes", "type": null }, { "param": "output_dir", "type": null }, { "param": "key", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "nodes", "type": null, "docstring": "A list of histogram/variants nodes of a prefix.", "docstring_tokens": [ "A", "list", "of", "histogram", "/", "variants", "nodes", ...
e64ed3fdd795804bc004bd2b2ef1dd7e85242fcf
sunlongbo/chromium
tools/metrics/histograms/split_xml.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
_AggregateMinorNodes
null
def _AggregateMinorNodes(node_dict): """Aggregates groups of nodes below threshold number into 'others'. Args: node_dict: A dictionary where the key is the prefix of the histogram/variant and value is a list of histogram/variant nodes. """ others = node_dict.pop('others', []) for key, nodes in n...
Aggregates groups of nodes below threshold number into 'others'. Args: node_dict: A dictionary where the key is the prefix of the histogram/variant and value is a list of histogram/variant nodes.
Aggregates groups of nodes below threshold number into 'others'.
[ "Aggregates", "groups", "of", "nodes", "below", "threshold", "number", "into", "'", "others", "'", "." ]
def _AggregateMinorNodes(node_dict): others = node_dict.pop('others', []) for key, nodes in node_dict.items(): if len(nodes) < AGGREGATE_THRESHOLD: others.extend(nodes) del node_dict[key] if others: node_dict['others'] = others
[ "def", "_AggregateMinorNodes", "(", "node_dict", ")", ":", "others", "=", "node_dict", ".", "pop", "(", "'others'", ",", "[", "]", ")", "for", "key", ",", "nodes", "in", "node_dict", ".", "items", "(", ")", ":", "if", "len", "(", "nodes", ")", "<", ...
Aggregates groups of nodes below threshold number into 'others'.
[ "Aggregates", "groups", "of", "nodes", "below", "threshold", "number", "into", "'", "others", "'", "." ]
[ "\"\"\"Aggregates groups of nodes below threshold number into 'others'.\n\n Args:\n node_dict: A dictionary where the key is the prefix of the histogram/variant\n and value is a list of histogram/variant nodes.\n \"\"\"", "# For a prefix, if the number of histograms is fewer than threshold,", "# agg...
[ { "param": "node_dict", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "node_dict", "type": null, "docstring": "A dictionary where the key is the prefix of the histogram/variant\nand value is a list of histogram/variant nodes.", "docstring_tokens": [ "A", "dictionary", "whe...
e64ed3fdd795804bc004bd2b2ef1dd7e85242fcf
sunlongbo/chromium
tools/metrics/histograms/split_xml.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
_BuildDocumentDict
<not_specific>
def _BuildDocumentDict(nodes, depth): """Recursively builds a document dict which will be written later. This function recursively builds a document dict which the key of the dict is the first word of the node's name at the given |depth| and the value of the dict is either a list of nodes that correspond to th...
Recursively builds a document dict which will be written later. This function recursively builds a document dict which the key of the dict is the first word of the node's name at the given |depth| and the value of the dict is either a list of nodes that correspond to the key or another dict if it doesn't reach...
Recursively builds a document dict which will be written later. This function recursively builds a document dict which the key of the dict is the first word of the node's name at the given |depth| and the value of the dict is either a list of nodes that correspond to the key or another dict if it doesn't reach to |TARG...
[ "Recursively", "builds", "a", "document", "dict", "which", "will", "be", "written", "later", ".", "This", "function", "recursively", "builds", "a", "document", "dict", "which", "the", "key", "of", "the", "dict", "is", "the", "first", "word", "of", "the", "...
def _BuildDocumentDict(nodes, depth): if depth == TARGET_DEPTH: return nodes temp_dict = document_dict = {} for node in nodes: name_part = _GetCamelCaseName(node, depth) if name_part not in temp_dict: temp_dict[name_part] = [] temp_dict[name_part].append(node) _AggregateMinorNodes(temp_dic...
[ "def", "_BuildDocumentDict", "(", "nodes", ",", "depth", ")", ":", "if", "depth", "==", "TARGET_DEPTH", ":", "return", "nodes", "temp_dict", "=", "document_dict", "=", "{", "}", "for", "node", "in", "nodes", ":", "name_part", "=", "_GetCamelCaseName", "(", ...
Recursively builds a document dict which will be written later.
[ "Recursively", "builds", "a", "document", "dict", "which", "will", "be", "written", "later", "." ]
[ "\"\"\"Recursively builds a document dict which will be written later.\n\n This function recursively builds a document dict which the key of the dict is\n the first word of the node's name at the given |depth| and the value of the\n dict is either a list of nodes that correspond to the key or another dict if\n ...
[ { "param": "nodes", "type": null }, { "param": "depth", "type": null } ]
{ "returns": [ { "docstring": "The document dict.", "docstring_tokens": [ "The", "document", "dict", "." ], "type": null } ], "raises": [], "params": [ { "identifier": "nodes", "type": null, "docstring": "A list of histogram n...
e64ed3fdd795804bc004bd2b2ef1dd7e85242fcf
sunlongbo/chromium
tools/metrics/histograms/split_xml.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
_SeparateObsoleteHistogram
<not_specific>
def _SeparateObsoleteHistogram(histogram_nodes): """Separates a NodeList of histograms into obsolete and non-obsolete. Args: histogram_nodes: A NodeList object containing histogram nodes. Returns: obsolete_nodes: A list of obsolete nodes. non_obsolete_nodes: A list of non-obsolete nodes. """ obs...
Separates a NodeList of histograms into obsolete and non-obsolete. Args: histogram_nodes: A NodeList object containing histogram nodes. Returns: obsolete_nodes: A list of obsolete nodes. non_obsolete_nodes: A list of non-obsolete nodes.
Separates a NodeList of histograms into obsolete and non-obsolete.
[ "Separates", "a", "NodeList", "of", "histograms", "into", "obsolete", "and", "non", "-", "obsolete", "." ]
def _SeparateObsoleteHistogram(histogram_nodes): obsolete_nodes = [] non_obsolete_nodes = [] for histogram in histogram_nodes: obsolete_tag_nodelist = histogram.getElementsByTagName('obsolete') if len(obsolete_tag_nodelist) > 0: obsolete_nodes.append(histogram) else: non_obsolete_nodes.app...
[ "def", "_SeparateObsoleteHistogram", "(", "histogram_nodes", ")", ":", "obsolete_nodes", "=", "[", "]", "non_obsolete_nodes", "=", "[", "]", "for", "histogram", "in", "histogram_nodes", ":", "obsolete_tag_nodelist", "=", "histogram", ".", "getElementsByTagName", "(", ...
Separates a NodeList of histograms into obsolete and non-obsolete.
[ "Separates", "a", "NodeList", "of", "histograms", "into", "obsolete", "and", "non", "-", "obsolete", "." ]
[ "\"\"\"Separates a NodeList of histograms into obsolete and non-obsolete.\n\n Args:\n histogram_nodes: A NodeList object containing histogram nodes.\n\n Returns:\n obsolete_nodes: A list of obsolete nodes.\n non_obsolete_nodes: A list of non-obsolete nodes.\n \"\"\"" ]
[ { "param": "histogram_nodes", "type": null } ]
{ "returns": [ { "docstring": "A list of obsolete nodes.\nnon_obsolete_nodes: A list of non-obsolete nodes.", "docstring_tokens": [ "A", "list", "of", "obsolete", "nodes", ".", "non_obsolete_nodes", ":", "A", "list", ...
e64ed3fdd795804bc004bd2b2ef1dd7e85242fcf
sunlongbo/chromium
tools/metrics/histograms/split_xml.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
SplitIntoMultipleHistogramXMLs
null
def SplitIntoMultipleHistogramXMLs(output_base_dir): """Splits a large histograms.xml and writes out the split xmls. Args: output_base_dir: The output base directory. """ if not os.path.exists(output_base_dir): os.mkdir(output_base_dir) histogram_nodes, variants_nodes, histogram_suffixes_nodes = _Pa...
Splits a large histograms.xml and writes out the split xmls. Args: output_base_dir: The output base directory.
Splits a large histograms.xml and writes out the split xmls.
[ "Splits", "a", "large", "histograms", ".", "xml", "and", "writes", "out", "the", "split", "xmls", "." ]
def SplitIntoMultipleHistogramXMLs(output_base_dir): if not os.path.exists(output_base_dir): os.mkdir(output_base_dir) histogram_nodes, variants_nodes, histogram_suffixes_nodes = _ParseMergedXML() _CreateXMLFile('histogram suffixes', 'histogram_suffixes_list', histogram_suffixes_nodes, output...
[ "def", "SplitIntoMultipleHistogramXMLs", "(", "output_base_dir", ")", ":", "if", "not", "os", ".", "path", ".", "exists", "(", "output_base_dir", ")", ":", "os", ".", "mkdir", "(", "output_base_dir", ")", "histogram_nodes", ",", "variants_nodes", ",", "histogram...
Splits a large histograms.xml and writes out the split xmls.
[ "Splits", "a", "large", "histograms", ".", "xml", "and", "writes", "out", "the", "split", "xmls", "." ]
[ "\"\"\"Splits a large histograms.xml and writes out the split xmls.\n\n Args:\n output_base_dir: The output base directory.\n \"\"\"", "# Create separate XML file for histogram suffixes.", "# Create separate XML file for obsolete histograms." ]
[ { "param": "output_base_dir", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "output_base_dir", "type": null, "docstring": "The output base directory.", "docstring_tokens": [ "The", "output", "base", "directory", "." ], "default": null, "is_optio...
e68039d78f1de03f7ffc68017cbb9f948f67f440
sunlongbo/chromium
components/crash/content/tools/generate_breakpad_symbols.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
GetDumpSymsBinary
<not_specific>
def GetDumpSymsBinary(build_dir=None): """Returns the path to the dump_syms binary.""" DUMP_SYMS = 'dump_syms' dump_syms_bin = os.path.join(os.path.expanduser(build_dir), DUMP_SYMS) if not os.access(dump_syms_bin, os.X_OK): print('Cannot find %s.' % dump_syms_bin) return None return dump_syms_bin
Returns the path to the dump_syms binary.
Returns the path to the dump_syms binary.
[ "Returns", "the", "path", "to", "the", "dump_syms", "binary", "." ]
def GetDumpSymsBinary(build_dir=None): DUMP_SYMS = 'dump_syms' dump_syms_bin = os.path.join(os.path.expanduser(build_dir), DUMP_SYMS) if not os.access(dump_syms_bin, os.X_OK): print('Cannot find %s.' % dump_syms_bin) return None return dump_syms_bin
[ "def", "GetDumpSymsBinary", "(", "build_dir", "=", "None", ")", ":", "DUMP_SYMS", "=", "'dump_syms'", "dump_syms_bin", "=", "os", ".", "path", ".", "join", "(", "os", ".", "path", ".", "expanduser", "(", "build_dir", ")", ",", "DUMP_SYMS", ")", "if", "no...
Returns the path to the dump_syms binary.
[ "Returns", "the", "path", "to", "the", "dump_syms", "binary", "." ]
[ "\"\"\"Returns the path to the dump_syms binary.\"\"\"" ]
[ { "param": "build_dir", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "build_dir", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
e68039d78f1de03f7ffc68017cbb9f948f67f440
sunlongbo/chromium
components/crash/content/tools/generate_breakpad_symbols.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
GetSharedLibraryDependenciesLinux
<not_specific>
def GetSharedLibraryDependenciesLinux(binary): """Return absolute paths to all shared library dependencies of the binary. This implementation assumes that we're running on a Linux system.""" ldd = subprocess.check_output(['ldd', binary]).decode('utf-8') lib_re = re.compile('\t.* => (.+) \(.*\)$') result = []...
Return absolute paths to all shared library dependencies of the binary. This implementation assumes that we're running on a Linux system.
Return absolute paths to all shared library dependencies of the binary. This implementation assumes that we're running on a Linux system.
[ "Return", "absolute", "paths", "to", "all", "shared", "library", "dependencies", "of", "the", "binary", ".", "This", "implementation", "assumes", "that", "we", "'", "re", "running", "on", "a", "Linux", "system", "." ]
def GetSharedLibraryDependenciesLinux(binary): ldd = subprocess.check_output(['ldd', binary]).decode('utf-8') lib_re = re.compile('\t.* => (.+) \(.*\)$') result = [] for line in ldd.splitlines(): m = lib_re.match(line) if m: result.append(os.path.abspath(m.group(1))) return result
[ "def", "GetSharedLibraryDependenciesLinux", "(", "binary", ")", ":", "ldd", "=", "subprocess", ".", "check_output", "(", "[", "'ldd'", ",", "binary", "]", ")", ".", "decode", "(", "'utf-8'", ")", "lib_re", "=", "re", ".", "compile", "(", "'\\t.* => (.+) \\(....
Return absolute paths to all shared library dependencies of the binary.
[ "Return", "absolute", "paths", "to", "all", "shared", "library", "dependencies", "of", "the", "binary", "." ]
[ "\"\"\"Return absolute paths to all shared library dependencies of the binary.\n\n This implementation assumes that we're running on a Linux system.\"\"\"" ]
[ { "param": "binary", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "binary", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
e68039d78f1de03f7ffc68017cbb9f948f67f440
sunlongbo/chromium
components/crash/content/tools/generate_breakpad_symbols.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
GetSharedLibraryDependenciesAndroid
<not_specific>
def GetSharedLibraryDependenciesAndroid(binary): """Return absolute paths to all shared library dependencies of the binary. This implementation assumes that we're running on a Linux system, but compiled for Android.""" return _GetSharedLibraryDependenciesAndroidOrChromeOS(binary)
Return absolute paths to all shared library dependencies of the binary. This implementation assumes that we're running on a Linux system, but compiled for Android.
Return absolute paths to all shared library dependencies of the binary. This implementation assumes that we're running on a Linux system, but compiled for Android.
[ "Return", "absolute", "paths", "to", "all", "shared", "library", "dependencies", "of", "the", "binary", ".", "This", "implementation", "assumes", "that", "we", "'", "re", "running", "on", "a", "Linux", "system", "but", "compiled", "for", "Android", "." ]
def GetSharedLibraryDependenciesAndroid(binary): return _GetSharedLibraryDependenciesAndroidOrChromeOS(binary)
[ "def", "GetSharedLibraryDependenciesAndroid", "(", "binary", ")", ":", "return", "_GetSharedLibraryDependenciesAndroidOrChromeOS", "(", "binary", ")" ]
Return absolute paths to all shared library dependencies of the binary.
[ "Return", "absolute", "paths", "to", "all", "shared", "library", "dependencies", "of", "the", "binary", "." ]
[ "\"\"\"Return absolute paths to all shared library dependencies of the binary.\n\n This implementation assumes that we're running on a Linux system, but\n compiled for Android.\"\"\"" ]
[ { "param": "binary", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "binary", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
e68039d78f1de03f7ffc68017cbb9f948f67f440
sunlongbo/chromium
components/crash/content/tools/generate_breakpad_symbols.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
GetDeveloperDirMac
<not_specific>
def GetDeveloperDirMac(): """Finds a good DEVELOPER_DIR value to run Mac dev tools. It checks the existing DEVELOPER_DIR and `xcode-select -p` and uses one of those if the folder exists, and falls back to one of the existing system folders with dev tools. Returns: (string) path to assign to DEVELOPER_DI...
Finds a good DEVELOPER_DIR value to run Mac dev tools. It checks the existing DEVELOPER_DIR and `xcode-select -p` and uses one of those if the folder exists, and falls back to one of the existing system folders with dev tools. Returns: (string) path to assign to DEVELOPER_DIR env var.
Finds a good DEVELOPER_DIR value to run Mac dev tools. It checks the existing DEVELOPER_DIR and `xcode-select -p` and uses one of those if the folder exists, and falls back to one of the existing system folders with dev tools.
[ "Finds", "a", "good", "DEVELOPER_DIR", "value", "to", "run", "Mac", "dev", "tools", ".", "It", "checks", "the", "existing", "DEVELOPER_DIR", "and", "`", "xcode", "-", "select", "-", "p", "`", "and", "uses", "one", "of", "those", "if", "the", "folder", ...
def GetDeveloperDirMac(): candidate_paths = [] if 'DEVELOPER_DIR' in os.environ: candidate_paths.append(os.environ['DEVELOPER_DIR']) candidate_paths.extend([ subprocess.check_output(['xcode-select', '-p']).decode('utf-8').strip(), '/Applications/Xcode.app', '/Applications/Xcode9.0.app', '/Appl...
[ "def", "GetDeveloperDirMac", "(", ")", ":", "candidate_paths", "=", "[", "]", "if", "'DEVELOPER_DIR'", "in", "os", ".", "environ", ":", "candidate_paths", ".", "append", "(", "os", ".", "environ", "[", "'DEVELOPER_DIR'", "]", ")", "candidate_paths", ".", "ex...
Finds a good DEVELOPER_DIR value to run Mac dev tools.
[ "Finds", "a", "good", "DEVELOPER_DIR", "value", "to", "run", "Mac", "dev", "tools", "." ]
[ "\"\"\"Finds a good DEVELOPER_DIR value to run Mac dev tools.\n\n It checks the existing DEVELOPER_DIR and `xcode-select -p` and uses\n one of those if the folder exists, and falls back to one of the\n existing system folders with dev tools.\n\n Returns:\n (string) path to assign to DEVELOPER_DIR env var.\n ...
[]
{ "returns": [ { "docstring": "(string) path to assign to DEVELOPER_DIR env var.", "docstring_tokens": [ "(", "string", ")", "path", "to", "assign", "to", "DEVELOPER_DIR", "env", "var", "." ], "type": n...
e68039d78f1de03f7ffc68017cbb9f948f67f440
sunlongbo/chromium
components/crash/content/tools/generate_breakpad_symbols.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
GetSharedLibraryDependenciesMac
<not_specific>
def GetSharedLibraryDependenciesMac(binary, exe_path): """Return absolute paths to all shared library dependencies of the binary. This implementation assumes that we're running on a Mac system.""" # realpath() serves two purposes: # 1. If an executable is linked against a framework, it links against # Fra...
Return absolute paths to all shared library dependencies of the binary. This implementation assumes that we're running on a Mac system.
Return absolute paths to all shared library dependencies of the binary. This implementation assumes that we're running on a Mac system.
[ "Return", "absolute", "paths", "to", "all", "shared", "library", "dependencies", "of", "the", "binary", ".", "This", "implementation", "assumes", "that", "we", "'", "re", "running", "on", "a", "Mac", "system", "." ]
def GetSharedLibraryDependenciesMac(binary, exe_path): loader_path = os.path.dirname(os.path.realpath(binary)) env = os.environ.copy() SRC_ROOT_PATH = os.path.join(os.path.dirname(__file__), '../../../..') hermetic_otool_path = os.path.join( SRC_ROOT_PATH, 'build', 'mac_files', 'xcode_binaries', 'Contents...
[ "def", "GetSharedLibraryDependenciesMac", "(", "binary", ",", "exe_path", ")", ":", "loader_path", "=", "os", ".", "path", ".", "dirname", "(", "os", ".", "path", ".", "realpath", "(", "binary", ")", ")", "env", "=", "os", ".", "environ", ".", "copy", ...
Return absolute paths to all shared library dependencies of the binary.
[ "Return", "absolute", "paths", "to", "all", "shared", "library", "dependencies", "of", "the", "binary", "." ]
[ "\"\"\"Return absolute paths to all shared library dependencies of the binary.\n\n This implementation assumes that we're running on a Mac system.\"\"\"", "# realpath() serves two purposes:", "# 1. If an executable is linked against a framework, it links against", "# Framework.framework/Framework, which i...
[ { "param": "binary", "type": null }, { "param": "exe_path", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "binary", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "exe_path", "type": null, "docstring": null, "docstring_toke...
e68039d78f1de03f7ffc68017cbb9f948f67f440
sunlongbo/chromium
components/crash/content/tools/generate_breakpad_symbols.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
GetSharedLibraryDependenciesChromeOS
<not_specific>
def GetSharedLibraryDependenciesChromeOS(binary): """Return absolute paths to all shared library dependencies of the binary. This implementation assumes that we're running on a Linux system, but compiled for ChromeOS.""" return _GetSharedLibraryDependenciesAndroidOrChromeOS(binary)
Return absolute paths to all shared library dependencies of the binary. This implementation assumes that we're running on a Linux system, but compiled for ChromeOS.
Return absolute paths to all shared library dependencies of the binary. This implementation assumes that we're running on a Linux system, but compiled for ChromeOS.
[ "Return", "absolute", "paths", "to", "all", "shared", "library", "dependencies", "of", "the", "binary", ".", "This", "implementation", "assumes", "that", "we", "'", "re", "running", "on", "a", "Linux", "system", "but", "compiled", "for", "ChromeOS", "." ]
def GetSharedLibraryDependenciesChromeOS(binary): return _GetSharedLibraryDependenciesAndroidOrChromeOS(binary)
[ "def", "GetSharedLibraryDependenciesChromeOS", "(", "binary", ")", ":", "return", "_GetSharedLibraryDependenciesAndroidOrChromeOS", "(", "binary", ")" ]
Return absolute paths to all shared library dependencies of the binary.
[ "Return", "absolute", "paths", "to", "all", "shared", "library", "dependencies", "of", "the", "binary", "." ]
[ "\"\"\"Return absolute paths to all shared library dependencies of the binary.\n\n This implementation assumes that we're running on a Linux system, but\n compiled for ChromeOS.\"\"\"" ]
[ { "param": "binary", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "binary", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
e68039d78f1de03f7ffc68017cbb9f948f67f440
sunlongbo/chromium
components/crash/content/tools/generate_breakpad_symbols.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
GetSharedLibraryDependencies
<not_specific>
def GetSharedLibraryDependencies(options, binary, exe_path): """Return absolute paths to all shared library dependencies of the binary.""" deps = [] if options.platform.startswith('linux'): deps = GetSharedLibraryDependenciesLinux(binary) elif options.platform == 'android': deps = GetSharedLibraryDepend...
Return absolute paths to all shared library dependencies of the binary.
Return absolute paths to all shared library dependencies of the binary.
[ "Return", "absolute", "paths", "to", "all", "shared", "library", "dependencies", "of", "the", "binary", "." ]
def GetSharedLibraryDependencies(options, binary, exe_path): deps = [] if options.platform.startswith('linux'): deps = GetSharedLibraryDependenciesLinux(binary) elif options.platform == 'android': deps = GetSharedLibraryDependenciesAndroid(binary) elif options.platform == 'darwin': deps = GetSharedL...
[ "def", "GetSharedLibraryDependencies", "(", "options", ",", "binary", ",", "exe_path", ")", ":", "deps", "=", "[", "]", "if", "options", ".", "platform", ".", "startswith", "(", "'linux'", ")", ":", "deps", "=", "GetSharedLibraryDependenciesLinux", "(", "binar...
Return absolute paths to all shared library dependencies of the binary.
[ "Return", "absolute", "paths", "to", "all", "shared", "library", "dependencies", "of", "the", "binary", "." ]
[ "\"\"\"Return absolute paths to all shared library dependencies of the binary.\"\"\"" ]
[ { "param": "options", "type": null }, { "param": "binary", "type": null }, { "param": "exe_path", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "options", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "binary", "type": null, "docstring": null, "docstring_token...
e68039d78f1de03f7ffc68017cbb9f948f67f440
sunlongbo/chromium
components/crash/content/tools/generate_breakpad_symbols.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
GetTransitiveDependencies
<not_specific>
def GetTransitiveDependencies(options): """Return absolute paths to the transitive closure of all shared library dependencies of the binary, along with the binary itself.""" binary = os.path.abspath(options.binary) exe_path = os.path.dirname(binary) if options.platform.startswith('linux'): # 'ldd' retu...
Return absolute paths to the transitive closure of all shared library dependencies of the binary, along with the binary itself.
Return absolute paths to the transitive closure of all shared library dependencies of the binary, along with the binary itself.
[ "Return", "absolute", "paths", "to", "the", "transitive", "closure", "of", "all", "shared", "library", "dependencies", "of", "the", "binary", "along", "with", "the", "binary", "itself", "." ]
def GetTransitiveDependencies(options): binary = os.path.abspath(options.binary) exe_path = os.path.dirname(binary) if options.platform.startswith('linux'): deps = set(GetSharedLibraryDependencies(options, binary, exe_path)) deps.add(binary) return list(deps) elif (options.platform == 'darwin' or op...
[ "def", "GetTransitiveDependencies", "(", "options", ")", ":", "binary", "=", "os", ".", "path", ".", "abspath", "(", "options", ".", "binary", ")", "exe_path", "=", "os", ".", "path", ".", "dirname", "(", "binary", ")", "if", "options", ".", "platform", ...
Return absolute paths to the transitive closure of all shared library dependencies of the binary, along with the binary itself.
[ "Return", "absolute", "paths", "to", "the", "transitive", "closure", "of", "all", "shared", "library", "dependencies", "of", "the", "binary", "along", "with", "the", "binary", "itself", "." ]
[ "\"\"\"Return absolute paths to the transitive closure of all shared library\n dependencies of the binary, along with the binary itself.\"\"\"", "# 'ldd' returns all transitive dependencies for us." ]
[ { "param": "options", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "options", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
e68039d78f1de03f7ffc68017cbb9f948f67f440
sunlongbo/chromium
components/crash/content/tools/generate_breakpad_symbols.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
CreateSymbolDir
null
def CreateSymbolDir(options, output_dir, relative_hash_dir): """Create the directory to store breakpad symbols in. On Android/Linux, we also create a symlink in case the hash in the binary is missing.""" mkdir_p(output_dir) if options.platform == 'android' or options.platform.startswith('linux'): try: ...
Create the directory to store breakpad symbols in. On Android/Linux, we also create a symlink in case the hash in the binary is missing.
Create the directory to store breakpad symbols in. On Android/Linux, we also create a symlink in case the hash in the binary is missing.
[ "Create", "the", "directory", "to", "store", "breakpad", "symbols", "in", ".", "On", "Android", "/", "Linux", "we", "also", "create", "a", "symlink", "in", "case", "the", "hash", "in", "the", "binary", "is", "missing", "." ]
def CreateSymbolDir(options, output_dir, relative_hash_dir): mkdir_p(output_dir) if options.platform == 'android' or options.platform.startswith('linux'): try: os.symlink(relative_hash_dir, os.path.join(os.path.dirname(output_dir), '000000000000000000000000000000000')) except: p...
[ "def", "CreateSymbolDir", "(", "options", ",", "output_dir", ",", "relative_hash_dir", ")", ":", "mkdir_p", "(", "output_dir", ")", "if", "options", ".", "platform", "==", "'android'", "or", "options", ".", "platform", ".", "startswith", "(", "'linux'", ")", ...
Create the directory to store breakpad symbols in.
[ "Create", "the", "directory", "to", "store", "breakpad", "symbols", "in", "." ]
[ "\"\"\"Create the directory to store breakpad symbols in. On Android/Linux, we\n also create a symlink in case the hash in the binary is missing.\"\"\"" ]
[ { "param": "options", "type": null }, { "param": "output_dir", "type": null }, { "param": "relative_hash_dir", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "options", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "output_dir", "type": null, "docstring": null, "docstring_t...
e68039d78f1de03f7ffc68017cbb9f948f67f440
sunlongbo/chromium
components/crash/content/tools/generate_breakpad_symbols.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
GenerateSymbols
null
def GenerateSymbols(options, binaries): """Dumps the symbols of binary and places them in the given directory.""" queue = six.moves.queue.Queue() exceptions = [] print_lock = threading.Lock() exceptions_lock = threading.Lock() def _Worker(): dump_syms = GetDumpSymsBinary(options.build_dir) while T...
Dumps the symbols of binary and places them in the given directory.
Dumps the symbols of binary and places them in the given directory.
[ "Dumps", "the", "symbols", "of", "binary", "and", "places", "them", "in", "the", "given", "directory", "." ]
def GenerateSymbols(options, binaries): queue = six.moves.queue.Queue() exceptions = [] print_lock = threading.Lock() exceptions_lock = threading.Lock() def _Worker(): dump_syms = GetDumpSymsBinary(options.build_dir) while True: try: should_dump_syms = True reason = "no reason" ...
[ "def", "GenerateSymbols", "(", "options", ",", "binaries", ")", ":", "queue", "=", "six", ".", "moves", ".", "queue", ".", "Queue", "(", ")", "exceptions", "=", "[", "]", "print_lock", "=", "threading", ".", "Lock", "(", ")", "exceptions_lock", "=", "t...
Dumps the symbols of binary and places them in the given directory.
[ "Dumps", "the", "symbols", "of", "binary", "and", "places", "them", "in", "the", "given", "directory", "." ]
[ "\"\"\"Dumps the symbols of binary and places them in the given directory.\"\"\"", "# See if the output file already exists.", "# See if there is a symbol file already found next to the binary" ]
[ { "param": "options", "type": null }, { "param": "binaries", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "options", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "binaries", "type": null, "docstring": null, "docstring_tok...
29c99c613ec0b06e597327f78b2497b4fd5eb16e
sunlongbo/chromium
chrome/updater/test/service/win/answer_uac.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
_ParseCommandLine
<not_specific>
def _ParseCommandLine(): """Parse the command line arguments.""" cmd_parser = argparse.ArgumentParser(description='Window UAC prompt handler') cmd_parser.add_argument( '--actions', dest='actions', type=str, default='A', help='How to handle UAC prompt, A for accept, D for deny.') c...
Parse the command line arguments.
Parse the command line arguments.
[ "Parse", "the", "command", "line", "arguments", "." ]
def _ParseCommandLine(): cmd_parser = argparse.ArgumentParser(description='Window UAC prompt handler') cmd_parser.add_argument( '--actions', dest='actions', type=str, default='A', help='How to handle UAC prompt, A for accept, D for deny.') cmd_parser.add_argument( '--timeout', ...
[ "def", "_ParseCommandLine", "(", ")", ":", "cmd_parser", "=", "argparse", ".", "ArgumentParser", "(", "description", "=", "'Window UAC prompt handler'", ")", "cmd_parser", ".", "add_argument", "(", "'--actions'", ",", "dest", "=", "'actions'", ",", "type", "=", ...
Parse the command line arguments.
[ "Parse", "the", "command", "line", "arguments", "." ]
[ "\"\"\"Parse the command line arguments.\"\"\"" ]
[]
{ "returns": [], "raises": [], "params": [], "outlier_params": [], "others": [] }
29cb514386f957d7ff89c9d7ae9a8e620b68cc29
sunlongbo/chromium
tools/perf/cli_tools/pinpoint_cli/job_results.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
ChangeToStr
<not_specific>
def ChangeToStr(change): """Turn a pinpoint change dict into a string id.""" change_id = ','.join( '{repository}@{git_hash}'.format(**commit) for commit in change['commits']) if 'patch' in change: change_id += '+' + change['patch']['url'] return change_id
Turn a pinpoint change dict into a string id.
Turn a pinpoint change dict into a string id.
[ "Turn", "a", "pinpoint", "change", "dict", "into", "a", "string", "id", "." ]
def ChangeToStr(change): change_id = ','.join( '{repository}@{git_hash}'.format(**commit) for commit in change['commits']) if 'patch' in change: change_id += '+' + change['patch']['url'] return change_id
[ "def", "ChangeToStr", "(", "change", ")", ":", "change_id", "=", "','", ".", "join", "(", "'{repository}@{git_hash}'", ".", "format", "(", "**", "commit", ")", "for", "commit", "in", "change", "[", "'commits'", "]", ")", "if", "'patch'", "in", "change", ...
Turn a pinpoint change dict into a string id.
[ "Turn", "a", "pinpoint", "change", "dict", "into", "a", "string", "id", "." ]
[ "\"\"\"Turn a pinpoint change dict into a string id.\"\"\"" ]
[ { "param": "change", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "change", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
29cb514386f957d7ff89c9d7ae9a8e620b68cc29
sunlongbo/chromium
tools/perf/cli_tools/pinpoint_cli/job_results.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
IterTestOutputIsolates
null
def IterTestOutputIsolates(job, only_differences=False): """Iterate over test execution results for all changes tested in the job. Args: job: A pinpoint job dict with state. Yields: (change_id, isolate_hash) pairs for each completed test execution found in the job. """ quests = job['quests'] f...
Iterate over test execution results for all changes tested in the job. Args: job: A pinpoint job dict with state. Yields: (change_id, isolate_hash) pairs for each completed test execution found in the job.
Iterate over test execution results for all changes tested in the job.
[ "Iterate", "over", "test", "execution", "results", "for", "all", "changes", "tested", "in", "the", "job", "." ]
def IterTestOutputIsolates(job, only_differences=False): quests = job['quests'] for change_state in job['state']: if only_differences and not any( v == 'different' for v in change_state['comparisons'].values()): continue change_id = ChangeToStr(change_state['change']) for attempt in change...
[ "def", "IterTestOutputIsolates", "(", "job", ",", "only_differences", "=", "False", ")", ":", "quests", "=", "job", "[", "'quests'", "]", "for", "change_state", "in", "job", "[", "'state'", "]", ":", "if", "only_differences", "and", "not", "any", "(", "v",...
Iterate over test execution results for all changes tested in the job.
[ "Iterate", "over", "test", "execution", "results", "for", "all", "changes", "tested", "in", "the", "job", "." ]
[ "\"\"\"Iterate over test execution results for all changes tested in the job.\n\n Args:\n job: A pinpoint job dict with state.\n\n Yields:\n (change_id, isolate_hash) pairs for each completed test execution found in\n the job.\n \"\"\"" ]
[ { "param": "job", "type": null }, { "param": "only_differences", "type": null } ]
{ "returns": [ { "docstring": "(change_id, isolate_hash) pairs for each completed test execution found in\nthe job.", "docstring_tokens": [ "(", "change_id", "isolate_hash", ")", "pairs", "for", "each", "completed", "test", ...
29fc4ab3947dd892e5076015b57d81f0c8c9c7e5
sunlongbo/chromium
components/sync/PRESUBMIT.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
CheckModelTypeInfoMap
<not_specific>
def CheckModelTypeInfoMap(input_api, output_api, model_type_file): """Checks the kModelTypeInfoMap in model_type.cc follows conventions. Checks that the kModelTypeInfoMap follows the below rules: 1) The model type string should match the model type name, but with only the first letter capitalized and spa...
Checks the kModelTypeInfoMap in model_type.cc follows conventions. Checks that the kModelTypeInfoMap follows the below rules: 1) The model type string should match the model type name, but with only the first letter capitalized and spaces instead of underscores. 2) The root tag should be the same as th...
Checks the kModelTypeInfoMap in model_type.cc follows conventions. Checks that the kModelTypeInfoMap follows the below rules: 1) The model type string should match the model type name, but with only the first letter capitalized and spaces instead of underscores. 2) The root tag should be the same as the model type but ...
[ "Checks", "the", "kModelTypeInfoMap", "in", "model_type", ".", "cc", "follows", "conventions", ".", "Checks", "that", "the", "kModelTypeInfoMap", "follows", "the", "below", "rules", ":", "1", ")", "The", "model", "type", "string", "should", "match", "the", "mo...
def CheckModelTypeInfoMap(input_api, output_api, model_type_file): accumulated_problems = [] map_entries = ParseModelTypeEntries( input_api, model_type_file.AbsoluteLocalPath()) check_map = False for line_num, _ in model_type_file.ChangedContents(): for map_entry in map_entries: if line_num in map...
[ "def", "CheckModelTypeInfoMap", "(", "input_api", ",", "output_api", ",", "model_type_file", ")", ":", "accumulated_problems", "=", "[", "]", "map_entries", "=", "ParseModelTypeEntries", "(", "input_api", ",", "model_type_file", ".", "AbsoluteLocalPath", "(", ")", "...
Checks the kModelTypeInfoMap in model_type.cc follows conventions.
[ "Checks", "the", "kModelTypeInfoMap", "in", "model_type", ".", "cc", "follows", "conventions", "." ]
[ "\"\"\"Checks the kModelTypeInfoMap in model_type.cc follows conventions.\n Checks that the kModelTypeInfoMap follows the below rules:\n 1) The model type string should match the model type name, but with\n only the first letter capitalized and spaces instead of underscores.\n 2) The root tag should be...
[ { "param": "input_api", "type": null }, { "param": "output_api", "type": null }, { "param": "model_type_file", "type": null } ]
{ "returns": [ { "docstring": "A (potentially empty) list PresubmitError objects corresponding to\nviolations of the above rules.", "docstring_tokens": [ "A", "(", "potentially", "empty", ")", "list", "PresubmitError", "objects", ...
29fc4ab3947dd892e5076015b57d81f0c8c9c7e5
sunlongbo/chromium
components/sync/PRESUBMIT.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
ParseEntitySpecificsProtoFieldIdentifiers
<not_specific>
def ParseEntitySpecificsProtoFieldIdentifiers(input_api, proto_path): """Parses proto field identifiers from the EntitySpecifics definition. Args: input_api: presubmit_support InputAPI instance proto_path: path to the file containing the proto field definitions Returns: A dictionary of the format {'Sy...
Parses proto field identifiers from the EntitySpecifics definition. Args: input_api: presubmit_support InputAPI instance proto_path: path to the file containing the proto field definitions Returns: A dictionary of the format {'SyncDataType': 'field_identifier'} e.g. {'AutofillSpecifics': 'autofill'}...
Parses proto field identifiers from the EntitySpecifics definition.
[ "Parses", "proto", "field", "identifiers", "from", "the", "EntitySpecifics", "definition", "." ]
def ParseEntitySpecificsProtoFieldIdentifiers(input_api, proto_path): proto_field_definitions = {} proto_file_contents = input_api.ReadFile(proto_path).splitlines() start_pattern = input_api.re.compile(PROTO_DEFINITION_START_PATTERN) end_pattern = input_api.re.compile(PROTO_DEFINITION_END_PATTERN) in_proto_de...
[ "def", "ParseEntitySpecificsProtoFieldIdentifiers", "(", "input_api", ",", "proto_path", ")", ":", "proto_field_definitions", "=", "{", "}", "proto_file_contents", "=", "input_api", ".", "ReadFile", "(", "proto_path", ")", ".", "splitlines", "(", ")", "start_pattern",...
Parses proto field identifiers from the EntitySpecifics definition.
[ "Parses", "proto", "field", "identifiers", "from", "the", "EntitySpecifics", "definition", "." ]
[ "\"\"\"Parses proto field identifiers from the EntitySpecifics definition.\n Args:\n input_api: presubmit_support InputAPI instance\n proto_path: path to the file containing the proto field definitions\n Returns:\n A dictionary of the format {'SyncDataType': 'field_identifier'}\n e.g. {'AutofillSpecif...
[ { "param": "input_api", "type": null }, { "param": "proto_path", "type": null } ]
{ "returns": [ { "docstring": "A dictionary of the format {'SyncDataType': 'field_identifier'}\ne.g. {'AutofillSpecifics': 'autofill'}", "docstring_tokens": [ "A", "dictionary", "of", "the", "format", "{", "'", "SyncDataType", "'"...
29fc4ab3947dd892e5076015b57d81f0c8c9c7e5
sunlongbo/chromium
components/sync/PRESUBMIT.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
FormatPresubmitError
<not_specific>
def FormatPresubmitError(output_api, message, affected_lines): """ Outputs a formatted error message with filename and line number(s). """ if len(affected_lines) > 1: message_including_lines = 'Error at lines %d-%d in model_type.cc: %s' %( affected_lines[0], affected_lines[-1], message) else: mess...
Outputs a formatted error message with filename and line number(s).
Outputs a formatted error message with filename and line number(s).
[ "Outputs", "a", "formatted", "error", "message", "with", "filename", "and", "line", "number", "(", "s", ")", "." ]
def FormatPresubmitError(output_api, message, affected_lines): if len(affected_lines) > 1: message_including_lines = 'Error at lines %d-%d in model_type.cc: %s' %( affected_lines[0], affected_lines[-1], message) else: message_including_lines = 'Error at line %d in model_type.cc: %s' %( affected_...
[ "def", "FormatPresubmitError", "(", "output_api", ",", "message", ",", "affected_lines", ")", ":", "if", "len", "(", "affected_lines", ")", ">", "1", ":", "message_including_lines", "=", "'Error at lines %d-%d in model_type.cc: %s'", "%", "(", "affected_lines", "[", ...
Outputs a formatted error message with filename and line number(s).
[ "Outputs", "a", "formatted", "error", "message", "with", "filename", "and", "line", "number", "(", "s", ")", "." ]
[ "\"\"\" Outputs a formatted error message with filename and line number(s).\n \"\"\"" ]
[ { "param": "output_api", "type": null }, { "param": "message", "type": null }, { "param": "affected_lines", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "output_api", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "message", "type": null, "docstring": null, "docstring_t...
29fc4ab3947dd892e5076015b57d81f0c8c9c7e5
sunlongbo/chromium
components/sync/PRESUBMIT.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
CheckNotificationTypeMatchesProtoMessageName
<not_specific>
def CheckNotificationTypeMatchesProtoMessageName( output_api, map_entry, proto_field_definitions): """Check that map_entry's notification type matches entity_specifics.proto. Verifies that the notification_type matches the name of the field defined in the entity_specifics.proto by looking it up in the proto_fie...
Check that map_entry's notification type matches entity_specifics.proto. Verifies that the notification_type matches the name of the field defined in the entity_specifics.proto by looking it up in the proto_field_definitions map. Args: output_api: presubmit_support OutputApi instance map_entry: ModelTyp...
Check that map_entry's notification type matches entity_specifics.proto. Verifies that the notification_type matches the name of the field defined in the entity_specifics.proto by looking it up in the proto_field_definitions map.
[ "Check", "that", "map_entry", "'", "s", "notification", "type", "matches", "entity_specifics", ".", "proto", ".", "Verifies", "that", "the", "notification_type", "matches", "the", "name", "of", "the", "field", "defined", "in", "the", "entity_specifics", ".", "pr...
def CheckNotificationTypeMatchesProtoMessageName( output_api, map_entry, proto_field_definitions): if map_entry.field_number == '-1': return [] proto_message_name = proto_field_definitions[ FieldNumberToPrototypeString(map_entry.field_number)] if map_entry.notification_type.lower() != proto_message_name...
[ "def", "CheckNotificationTypeMatchesProtoMessageName", "(", "output_api", ",", "map_entry", ",", "proto_field_definitions", ")", ":", "if", "map_entry", ".", "field_number", "==", "'-1'", ":", "return", "[", "]", "proto_message_name", "=", "proto_field_definitions", "["...
Check that map_entry's notification type matches entity_specifics.proto.
[ "Check", "that", "map_entry", "'", "s", "notification", "type", "matches", "entity_specifics", ".", "proto", "." ]
[ "\"\"\"Check that map_entry's notification type matches entity_specifics.proto.\n Verifies that the notification_type matches the name of the field defined\n in the entity_specifics.proto by looking it up in the proto_field_definitions\n map.\n Args:\n output_api: presubmit_support OutputApi instance\n ma...
[ { "param": "output_api", "type": null }, { "param": "map_entry", "type": null }, { "param": "proto_field_definitions", "type": null } ]
{ "returns": [ { "docstring": "A potentially empty list of PresubmitError objects corresponding to\nviolations of the above rule", "docstring_tokens": [ "A", "potentially", "empty", "list", "of", "PresubmitError", "objects", "correspondin...
29fc4ab3947dd892e5076015b57d81f0c8c9c7e5
sunlongbo/chromium
components/sync/PRESUBMIT.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
CheckNoDuplicatedFieldValues
<not_specific>
def CheckNoDuplicatedFieldValues(output_api, map_entries): """Check that map_entries has no duplicated field values. Verifies that every map_entry in map_entries doesn't have a field value used elsewhere in map_entries, ignoring special values ("" and -1). Args: output_api: presubmit_support OutputApi insta...
Check that map_entries has no duplicated field values. Verifies that every map_entry in map_entries doesn't have a field value used elsewhere in map_entries, ignoring special values ("" and -1). Args: output_api: presubmit_support OutputApi instance map_entries: list of ModelTypeEnumEntry objects to check...
Check that map_entries has no duplicated field values. Verifies that every map_entry in map_entries doesn't have a field value used elsewhere in map_entries, ignoring special values ("" and -1).
[ "Check", "that", "map_entries", "has", "no", "duplicated", "field", "values", ".", "Verifies", "that", "every", "map_entry", "in", "map_entries", "doesn", "'", "t", "have", "a", "field", "value", "used", "elsewhere", "in", "map_entries", "ignoring", "special", ...
def CheckNoDuplicatedFieldValues(output_api, map_entries): problem_list = [] field_value_sets = [set() for i in range(MAP_ENTRY_FIELD_COUNT)] for map_entry in map_entries: field_values = [ map_entry.model_type, map_entry.notification_type, map_entry.root_tag, map_entry.model_type_string, map...
[ "def", "CheckNoDuplicatedFieldValues", "(", "output_api", ",", "map_entries", ")", ":", "problem_list", "=", "[", "]", "field_value_sets", "=", "[", "set", "(", ")", "for", "i", "in", "range", "(", "MAP_ENTRY_FIELD_COUNT", ")", "]", "for", "map_entry", "in", ...
Check that map_entries has no duplicated field values.
[ "Check", "that", "map_entries", "has", "no", "duplicated", "field", "values", "." ]
[ "\"\"\"Check that map_entries has no duplicated field values.\n Verifies that every map_entry in map_entries doesn't have a field value\n used elsewhere in map_entries, ignoring special values (\"\" and -1).\n Args:\n output_api: presubmit_support OutputApi instance\n map_entries: list of ModelTypeEnumEntr...
[ { "param": "output_api", "type": null }, { "param": "map_entries", "type": null } ]
{ "returns": [ { "docstring": "A list PresubmitError objects for each duplicated field value", "docstring_tokens": [ "A", "list", "PresubmitError", "objects", "for", "each", "duplicated", "field", "value" ], "type": nu...
29fc4ab3947dd892e5076015b57d81f0c8c9c7e5
sunlongbo/chromium
components/sync/PRESUBMIT.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
CheckRootTagMatchesModelType
<not_specific>
def CheckRootTagMatchesModelType(output_api, map_entry): """Check that map_entry's root tag matches ModelType. Args: output_api: presubmit_support OutputAPI instance map_entry: ModelTypeEnumEntry object to check Returns: A list of PresubmitError objects for each violation """ expected_root_tag = m...
Check that map_entry's root tag matches ModelType. Args: output_api: presubmit_support OutputAPI instance map_entry: ModelTypeEnumEntry object to check Returns: A list of PresubmitError objects for each violation
Check that map_entry's root tag matches ModelType.
[ "Check", "that", "map_entry", "'", "s", "root", "tag", "matches", "ModelType", "." ]
def CheckRootTagMatchesModelType(output_api, map_entry): expected_root_tag = map_entry.model_type.lower() if (StripTrailingS(expected_root_tag) != StripTrailingS(map_entry.root_tag)): return [ FormatPresubmitError( output_api,'root tag "%s" does not match model type. It should' 'be "%s...
[ "def", "CheckRootTagMatchesModelType", "(", "output_api", ",", "map_entry", ")", ":", "expected_root_tag", "=", "map_entry", ".", "model_type", ".", "lower", "(", ")", "if", "(", "StripTrailingS", "(", "expected_root_tag", ")", "!=", "StripTrailingS", "(", "map_en...
Check that map_entry's root tag matches ModelType.
[ "Check", "that", "map_entry", "'", "s", "root", "tag", "matches", "ModelType", "." ]
[ "\"\"\"Check that map_entry's root tag matches ModelType.\n Args:\n output_api: presubmit_support OutputAPI instance\n map_entry: ModelTypeEnumEntry object to check\n Returns:\n A list of PresubmitError objects for each violation\n \"\"\"" ]
[ { "param": "output_api", "type": null }, { "param": "map_entry", "type": null } ]
{ "returns": [ { "docstring": "A list of PresubmitError objects for each violation", "docstring_tokens": [ "A", "list", "of", "PresubmitError", "objects", "for", "each", "violation" ], "type": null } ], "raises": [], ...
29fc4ab3947dd892e5076015b57d81f0c8c9c7e5
sunlongbo/chromium
components/sync/PRESUBMIT.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
CheckRootTagNotInBlocklist
<not_specific>
def CheckRootTagNotInBlocklist(output_api, map_entry): """ Checks that map_entry's root isn't a blocklisted string. Args: output_api: presubmit_support OutputAPI instance map_entry: ModelTypeEnumEntry object to check Returns: A list of PresubmitError objects for each violation """ if map_entry.roo...
Checks that map_entry's root isn't a blocklisted string. Args: output_api: presubmit_support OutputAPI instance map_entry: ModelTypeEnumEntry object to check Returns: A list of PresubmitError objects for each violation
Checks that map_entry's root isn't a blocklisted string.
[ "Checks", "that", "map_entry", "'", "s", "root", "isn", "'", "t", "a", "blocklisted", "string", "." ]
def CheckRootTagNotInBlocklist(output_api, map_entry): if map_entry.root_tag in BLOCKLISTED_ROOT_TAGS: return [FormatPresubmitError( output_api,'root tag "%s" is a blocklisted root tag' % (map_entry.root_tag), map_entry.affected_lines)] return []
[ "def", "CheckRootTagNotInBlocklist", "(", "output_api", ",", "map_entry", ")", ":", "if", "map_entry", ".", "root_tag", "in", "BLOCKLISTED_ROOT_TAGS", ":", "return", "[", "FormatPresubmitError", "(", "output_api", ",", "'root tag \"%s\" is a blocklisted root tag'", "%", ...
Checks that map_entry's root isn't a blocklisted string.
[ "Checks", "that", "map_entry", "'", "s", "root", "isn", "'", "t", "a", "blocklisted", "string", "." ]
[ "\"\"\" Checks that map_entry's root isn't a blocklisted string.\n Args:\n output_api: presubmit_support OutputAPI instance\n map_entry: ModelTypeEnumEntry object to check\n Returns:\n A list of PresubmitError objects for each violation\n \"\"\"" ]
[ { "param": "output_api", "type": null }, { "param": "map_entry", "type": null } ]
{ "returns": [ { "docstring": "A list of PresubmitError objects for each violation", "docstring_tokens": [ "A", "list", "of", "PresubmitError", "objects", "for", "each", "violation" ], "type": null } ], "raises": [], ...
29fc4ab3947dd892e5076015b57d81f0c8c9c7e5
sunlongbo/chromium
components/sync/PRESUBMIT.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
FieldNumberToPrototypeString
<not_specific>
def FieldNumberToPrototypeString(field_number): """Converts a field number enum reference to an EntitySpecifics string. Converts a reference to the field number enum to the corresponding proto data type string. Args: field_number: string representation of a field number enum reference Returns: A strin...
Converts a field number enum reference to an EntitySpecifics string. Converts a reference to the field number enum to the corresponding proto data type string. Args: field_number: string representation of a field number enum reference Returns: A string that is the corresponding proto field data type. e....
Converts a field number enum reference to an EntitySpecifics string. Converts a reference to the field number enum to the corresponding proto data type string.
[ "Converts", "a", "field", "number", "enum", "reference", "to", "an", "EntitySpecifics", "string", ".", "Converts", "a", "reference", "to", "the", "field", "number", "enum", "to", "the", "corresponding", "proto", "data", "type", "string", "." ]
def FieldNumberToPrototypeString(field_number): return field_number.replace(FIELD_NUMBER_PREFIX, '').replace( 'FieldNumber', 'Specifics')
[ "def", "FieldNumberToPrototypeString", "(", "field_number", ")", ":", "return", "field_number", ".", "replace", "(", "FIELD_NUMBER_PREFIX", ",", "''", ")", ".", "replace", "(", "'FieldNumber'", ",", "'Specifics'", ")" ]
Converts a field number enum reference to an EntitySpecifics string.
[ "Converts", "a", "field", "number", "enum", "reference", "to", "an", "EntitySpecifics", "string", "." ]
[ "\"\"\"Converts a field number enum reference to an EntitySpecifics string.\n Converts a reference to the field number enum to the corresponding\n proto data type string.\n Args:\n field_number: string representation of a field number enum reference\n Returns:\n A string that is the corresponding proto fi...
[ { "param": "field_number", "type": null } ]
{ "returns": [ { "docstring": "A string that is the corresponding proto field data type. e.g.\nFieldNumberToPrototypeString('EntitySpecifics::kAppFieldNumber')\n> 'AppSpecifics'", "docstring_tokens": [ "A", "string", "that", "is", "the", "corresponding",...
9ecf38974795f65a67cca87596936333ec09e144
sunlongbo/chromium
tools/variations/fieldtrial_to_struct.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
_LoadFieldTrialConfig
<not_specific>
def _LoadFieldTrialConfig(filename, platforms, invert): """Loads a field trial config JSON and converts it into a format that can be used by json_to_struct. """ return _FieldTrialConfigToDescription(_Load(filename), platforms, invert)
Loads a field trial config JSON and converts it into a format that can be used by json_to_struct.
Loads a field trial config JSON and converts it into a format that can be used by json_to_struct.
[ "Loads", "a", "field", "trial", "config", "JSON", "and", "converts", "it", "into", "a", "format", "that", "can", "be", "used", "by", "json_to_struct", "." ]
def _LoadFieldTrialConfig(filename, platforms, invert): return _FieldTrialConfigToDescription(_Load(filename), platforms, invert)
[ "def", "_LoadFieldTrialConfig", "(", "filename", ",", "platforms", ",", "invert", ")", ":", "return", "_FieldTrialConfigToDescription", "(", "_Load", "(", "filename", ")", ",", "platforms", ",", "invert", ")" ]
Loads a field trial config JSON and converts it into a format that can be used by json_to_struct.
[ "Loads", "a", "field", "trial", "config", "JSON", "and", "converts", "it", "into", "a", "format", "that", "can", "be", "used", "by", "json_to_struct", "." ]
[ "\"\"\"Loads a field trial config JSON and converts it into a format that can be\n used by json_to_struct.\n \"\"\"" ]
[ { "param": "filename", "type": null }, { "param": "platforms", "type": null }, { "param": "invert", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "filename", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "platforms", "type": null, "docstring": null, "docstring_t...
9ecf38974795f65a67cca87596936333ec09e144
sunlongbo/chromium
tools/variations/fieldtrial_to_struct.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
_ConvertOverrideUIStrings
<not_specific>
def _ConvertOverrideUIStrings(override_ui_strings): """Converts override_ui_strings to formatted dicts.""" overrides = [] for ui_string, override in override_ui_strings.iteritems(): overrides.append({ 'name_hash': generate_ui_string_overrider.HashName(ui_string), 'value': override }) ret...
Converts override_ui_strings to formatted dicts.
Converts override_ui_strings to formatted dicts.
[ "Converts", "override_ui_strings", "to", "formatted", "dicts", "." ]
def _ConvertOverrideUIStrings(override_ui_strings): overrides = [] for ui_string, override in override_ui_strings.iteritems(): overrides.append({ 'name_hash': generate_ui_string_overrider.HashName(ui_string), 'value': override }) return overrides
[ "def", "_ConvertOverrideUIStrings", "(", "override_ui_strings", ")", ":", "overrides", "=", "[", "]", "for", "ui_string", ",", "override", "in", "override_ui_strings", ".", "iteritems", "(", ")", ":", "overrides", ".", "append", "(", "{", "'name_hash'", ":", "...
Converts override_ui_strings to formatted dicts.
[ "Converts", "override_ui_strings", "to", "formatted", "dicts", "." ]
[ "\"\"\"Converts override_ui_strings to formatted dicts.\"\"\"" ]
[ { "param": "override_ui_strings", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "override_ui_strings", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
9ecf38974795f65a67cca87596936333ec09e144
sunlongbo/chromium
tools/variations/fieldtrial_to_struct.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
_CreateExperiment
<not_specific>
def _CreateExperiment(experiment_data, platforms, form_factors, is_low_end_device, invert=False): """Creates an experiment dictionary with all necessary information. Args: experiment_data: An experiment json config. pla...
Creates an experiment dictionary with all necessary information. Args: experiment_data: An experiment json config. platforms: A list of platforms for this trial. This should be a subset of |_platforms|. form_factors: A list of form factors for this trial. This should be a subset of |_form_fac...
Creates an experiment dictionary with all necessary information.
[ "Creates", "an", "experiment", "dictionary", "with", "all", "necessary", "information", "." ]
def _CreateExperiment(experiment_data, platforms, form_factors, is_low_end_device, invert=False): experiment = { 'name': experiment_data['name'], 'platforms': [_PlatformEnumValue(p) for p in platforms], 'form_factors':...
[ "def", "_CreateExperiment", "(", "experiment_data", ",", "platforms", ",", "form_factors", ",", "is_low_end_device", ",", "invert", "=", "False", ")", ":", "experiment", "=", "{", "'name'", ":", "experiment_data", "[", "'name'", "]", ",", "'platforms'", ":", "...
Creates an experiment dictionary with all necessary information.
[ "Creates", "an", "experiment", "dictionary", "with", "all", "necessary", "information", "." ]
[ "\"\"\"Creates an experiment dictionary with all necessary information.\n\n Args:\n experiment_data: An experiment json config.\n platforms: A list of platforms for this trial. This should be\n a subset of |_platforms|.\n form_factors: A list of form factors for this trial. This should be\n a su...
[ { "param": "experiment_data", "type": null }, { "param": "platforms", "type": null }, { "param": "form_factors", "type": null }, { "param": "is_low_end_device", "type": null }, { "param": "invert", "type": null } ]
{ "returns": [ { "docstring": "An experiment dict.", "docstring_tokens": [ "An", "experiment", "dict", "." ], "type": null } ], "raises": [], "params": [ { "identifier": "experiment_data", "type": null, "docstring": "An experi...
9ecf38974795f65a67cca87596936333ec09e144
sunlongbo/chromium
tools/variations/fieldtrial_to_struct.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
_CreateTrial
<not_specific>
def _CreateTrial(study_name, experiment_configs, platforms, invert): """Returns the applicable experiments for |study_name| and |platforms|. This iterates through all of the experiment_configs for |study_name| and picks out the applicable experiments based off of the valid platforms and device type settings if...
Returns the applicable experiments for |study_name| and |platforms|. This iterates through all of the experiment_configs for |study_name| and picks out the applicable experiments based off of the valid platforms and device type settings if specified.
Returns the applicable experiments for |study_name| and |platforms|. This iterates through all of the experiment_configs for |study_name| and picks out the applicable experiments based off of the valid platforms and device type settings if specified.
[ "Returns", "the", "applicable", "experiments", "for", "|study_name|", "and", "|platforms|", ".", "This", "iterates", "through", "all", "of", "the", "experiment_configs", "for", "|study_name|", "and", "picks", "out", "the", "applicable", "experiments", "based", "off"...
def _CreateTrial(study_name, experiment_configs, platforms, invert): experiments = [] for config in experiment_configs: platform_intersection = [p for p in platforms if p in config['platforms']] if platform_intersection: experiments += [ _CreateExperiment(e, platf...
[ "def", "_CreateTrial", "(", "study_name", ",", "experiment_configs", ",", "platforms", ",", "invert", ")", ":", "experiments", "=", "[", "]", "for", "config", "in", "experiment_configs", ":", "platform_intersection", "=", "[", "p", "for", "p", "in", "platforms...
Returns the applicable experiments for |study_name| and |platforms|.
[ "Returns", "the", "applicable", "experiments", "for", "|study_name|", "and", "|platforms|", "." ]
[ "\"\"\"Returns the applicable experiments for |study_name| and |platforms|.\n\n This iterates through all of the experiment_configs for |study_name|\n and picks out the applicable experiments based off of the valid platforms\n and device type settings if specified.\n \"\"\"" ]
[ { "param": "study_name", "type": null }, { "param": "experiment_configs", "type": null }, { "param": "platforms", "type": null }, { "param": "invert", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "study_name", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "experiment_configs", "type": null, "docstring": null, "...
9ed100ea42252d5544a2365922802601a944dc3b
sunlongbo/chromium
net/data/parse_certificate_unittest/rebase-errors.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
fixup_pem_file
null
def fixup_pem_file(path, actual_errors): """Updates the ERRORS block in the test .pem file""" contents = read_file_to_string(path) errors_block_text = '\n' + gencerts.text_data_to_pem('ERRORS', actual_errors) # Strip the trailing newline. errors_block_text = errors_block_text[:-1] m = errors_block_regex.s...
Updates the ERRORS block in the test .pem file
Updates the ERRORS block in the test .pem file
[ "Updates", "the", "ERRORS", "block", "in", "the", "test", ".", "pem", "file" ]
def fixup_pem_file(path, actual_errors): contents = read_file_to_string(path) errors_block_text = '\n' + gencerts.text_data_to_pem('ERRORS', actual_errors) errors_block_text = errors_block_text[:-1] m = errors_block_regex.search(contents) if not m: contents += errors_block_text else: contents = repl...
[ "def", "fixup_pem_file", "(", "path", ",", "actual_errors", ")", ":", "contents", "=", "read_file_to_string", "(", "path", ")", "errors_block_text", "=", "'\\n'", "+", "gencerts", ".", "text_data_to_pem", "(", "'ERRORS'", ",", "actual_errors", ")", "errors_block_t...
Updates the ERRORS block in the test .pem file
[ "Updates", "the", "ERRORS", "block", "in", "the", "test", ".", "pem", "file" ]
[ "\"\"\"Updates the ERRORS block in the test .pem file\"\"\"", "# Strip the trailing newline.", "# Update the file." ]
[ { "param": "path", "type": null }, { "param": "actual_errors", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "path", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "actual_errors", "type": null, "docstring": null, "docstring_t...
9ed3fce6a7b4e0ab15f3ca279b61b59ef80078cf
sunlongbo/chromium
tools/android/find_unused_resources.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
GetLibraryResources
<not_specific>
def GetLibraryResources(r_txt_paths): """Returns the resources packaged in a list of libraries. Args: r_txt_paths: paths to each library's generated R.txt file which lists the resources it contains. Returns: The resources in the libraries as a list of tuples (type, name). Example: [('drawabl...
Returns the resources packaged in a list of libraries. Args: r_txt_paths: paths to each library's generated R.txt file which lists the resources it contains. Returns: The resources in the libraries as a list of tuples (type, name). Example: [('drawable', 'arrow'), ('layout', 'month_picker'), ....
Returns the resources packaged in a list of libraries.
[ "Returns", "the", "resources", "packaged", "in", "a", "list", "of", "libraries", "." ]
def GetLibraryResources(r_txt_paths): resources = [] for r_txt_path in r_txt_paths: with open(r_txt_path, 'r') as f: for line in f: line = line.strip() if not line: continue data_type, res_type, name, _ = line.split(None, 3) assert data_type in ('int', 'int[]') ...
[ "def", "GetLibraryResources", "(", "r_txt_paths", ")", ":", "resources", "=", "[", "]", "for", "r_txt_path", "in", "r_txt_paths", ":", "with", "open", "(", "r_txt_path", ",", "'r'", ")", "as", "f", ":", "for", "line", "in", "f", ":", "line", "=", "line...
Returns the resources packaged in a list of libraries.
[ "Returns", "the", "resources", "packaged", "in", "a", "list", "of", "libraries", "." ]
[ "\"\"\"Returns the resources packaged in a list of libraries.\n\n Args:\n r_txt_paths: paths to each library's generated R.txt file which lists the\n resources it contains.\n\n Returns:\n The resources in the libraries as a list of tuples (type, name). Example:\n [('drawable', 'arrow'), ('layout',...
[ { "param": "r_txt_paths", "type": null } ]
{ "returns": [ { "docstring": "The resources in the libraries as a list of tuples (type, name).", "docstring_tokens": [ "The", "resources", "in", "the", "libraries", "as", "a", "list", "of", "tuples", "(", ...
9ed3fce6a7b4e0ab15f3ca279b61b59ef80078cf
sunlongbo/chromium
tools/android/find_unused_resources.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
GetUsedResources
<not_specific>
def GetUsedResources(source_paths, resource_types): """Returns the types and names of resources used in Java or resource files. Args: source_paths: a list of files or folders collectively containing all the Java files, resource files, and the AndroidManifest.xml. resource_types: a list of resource ...
Returns the types and names of resources used in Java or resource files. Args: source_paths: a list of files or folders collectively containing all the Java files, resource files, and the AndroidManifest.xml. resource_types: a list of resource types to look for. Example: ['string', 'drawable...
Returns the types and names of resources used in Java or resource files.
[ "Returns", "the", "types", "and", "names", "of", "resources", "used", "in", "Java", "or", "resource", "files", "." ]
def GetUsedResources(source_paths, resource_types): type_regex = '|'.join(map(re.escape, resource_types)) patterns = [ r'@((\+?))(%s)/(\w+)' % type_regex, r'\b((\w+\.)*)R\.(%s)\.(\w+)' % type_regex, r'<(())(%s).*parent="(\w+)">' % type_regex, ] resources = [] for pattern in patterns: p =...
[ "def", "GetUsedResources", "(", "source_paths", ",", "resource_types", ")", ":", "type_regex", "=", "'|'", ".", "join", "(", "map", "(", "re", ".", "escape", ",", "resource_types", ")", ")", "patterns", "=", "[", "r'@((\\+?))(%s)/(\\w+)'", "%", "type_regex", ...
Returns the types and names of resources used in Java or resource files.
[ "Returns", "the", "types", "and", "names", "of", "resources", "used", "in", "Java", "or", "resource", "files", "." ]
[ "\"\"\"Returns the types and names of resources used in Java or resource files.\n\n Args:\n source_paths: a list of files or folders collectively containing all the\n Java files, resource files, and the AndroidManifest.xml.\n resource_types: a list of resource types to look for. Example:\n ['s...
[ { "param": "source_paths", "type": null }, { "param": "resource_types", "type": null } ]
{ "returns": [ { "docstring": "The resources referenced by the Java and resource files as a list of tuples\n(type, name).", "docstring_tokens": [ "The", "resources", "referenced", "by", "the", "Java", "and", "resource", "files", ...
9ed3fce6a7b4e0ab15f3ca279b61b59ef80078cf
sunlongbo/chromium
tools/android/find_unused_resources.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
FormatResources
<not_specific>
def FormatResources(resources): """Formats a list of resources for printing. Args: resources: a list of resources, given as (type, name) tuples. """ return '\n'.join(['%-12s %s' % (t, n) for t, n in sorted(resources)])
Formats a list of resources for printing. Args: resources: a list of resources, given as (type, name) tuples.
Formats a list of resources for printing.
[ "Formats", "a", "list", "of", "resources", "for", "printing", "." ]
def FormatResources(resources): return '\n'.join(['%-12s %s' % (t, n) for t, n in sorted(resources)])
[ "def", "FormatResources", "(", "resources", ")", ":", "return", "'\\n'", ".", "join", "(", "[", "'%-12s %s'", "%", "(", "t", ",", "n", ")", "for", "t", ",", "n", "in", "sorted", "(", "resources", ")", "]", ")" ]
Formats a list of resources for printing.
[ "Formats", "a", "list", "of", "resources", "for", "printing", "." ]
[ "\"\"\"Formats a list of resources for printing.\n\n Args:\n resources: a list of resources, given as (type, name) tuples.\n \"\"\"" ]
[ { "param": "resources", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "resources", "type": null, "docstring": "a list of resources, given as (type, name) tuples.", "docstring_tokens": [ "a", "list", "of", "resources", "given", "as", "(", ...
e50ec4a0d798b2f15886f25debdc26d210dae6db
sunlongbo/chromium
infra/scripts/build_directory.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
AreNinjaFilesNewerThanXcodeFiles
<not_specific>
def AreNinjaFilesNewerThanXcodeFiles(src_dir=None): """Returns True if the generated ninja files are newer than the generated xcode files. Parameters: src_dir: The path to the src directory. If None, it's assumed to be at src/ relative to the current working directory. """ src_dir = src_dir...
Returns True if the generated ninja files are newer than the generated xcode files. Parameters: src_dir: The path to the src directory. If None, it's assumed to be at src/ relative to the current working directory.
Returns True if the generated ninja files are newer than the generated xcode files.
[ "Returns", "True", "if", "the", "generated", "ninja", "files", "are", "newer", "than", "the", "generated", "xcode", "files", "." ]
def AreNinjaFilesNewerThanXcodeFiles(src_dir=None): src_dir = src_dir or 'src' ninja_path = os.path.join(src_dir, 'out', 'Release', 'build.ninja') xcode_path = os.path.join( src_dir, 'build', 'all.xcodeproj', 'project.pbxproj') return IsFileNewerThanFile(ninja_path, xcode_path)
[ "def", "AreNinjaFilesNewerThanXcodeFiles", "(", "src_dir", "=", "None", ")", ":", "src_dir", "=", "src_dir", "or", "'src'", "ninja_path", "=", "os", ".", "path", ".", "join", "(", "src_dir", ",", "'out'", ",", "'Release'", ",", "'build.ninja'", ")", "xcode_p...
Returns True if the generated ninja files are newer than the generated xcode files.
[ "Returns", "True", "if", "the", "generated", "ninja", "files", "are", "newer", "than", "the", "generated", "xcode", "files", "." ]
[ "\"\"\"Returns True if the generated ninja files are newer than the generated\n xcode files.\n\n Parameters:\n src_dir: The path to the src directory. If None, it's assumed to be\n at src/ relative to the current working directory.\n \"\"\"" ]
[ { "param": "src_dir", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "src_dir", "type": null, "docstring": "The path to the src directory. If None, it's assumed to be\nat src/ relative to the current working directory.", "docstring_tokens": [ "The", "path", "to", ...
e50ec4a0d798b2f15886f25debdc26d210dae6db
sunlongbo/chromium
infra/scripts/build_directory.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
GetBuildOutputDirectory
<not_specific>
def GetBuildOutputDirectory(src_dir=None, cros_board=None): """Returns the path to the build directory, relative to the checkout root. Assumes that the current working directory is the checkout root. """ # src_dir is only needed for compiling v8, which uses compile.py (but no other # of the build scripts), b...
Returns the path to the build directory, relative to the checkout root. Assumes that the current working directory is the checkout root.
Returns the path to the build directory, relative to the checkout root. Assumes that the current working directory is the checkout root.
[ "Returns", "the", "path", "to", "the", "build", "directory", "relative", "to", "the", "checkout", "root", ".", "Assumes", "that", "the", "current", "working", "directory", "is", "the", "checkout", "root", "." ]
def GetBuildOutputDirectory(src_dir=None, cros_board=None): if src_dir is None: src_dir = 'src' if sys.platform.startswith('linux'): out_dirname = 'out' if cros_board: out_dirname += '_%s' % (cros_board,) return os.path.join(src_dir, out_dirname) assert not cros_board, "'cros_board' not supp...
[ "def", "GetBuildOutputDirectory", "(", "src_dir", "=", "None", ",", "cros_board", "=", "None", ")", ":", "if", "src_dir", "is", "None", ":", "src_dir", "=", "'src'", "if", "sys", ".", "platform", ".", "startswith", "(", "'linux'", ")", ":", "out_dirname", ...
Returns the path to the build directory, relative to the checkout root.
[ "Returns", "the", "path", "to", "the", "build", "directory", "relative", "to", "the", "checkout", "root", "." ]
[ "\"\"\"Returns the path to the build directory, relative to the checkout root.\n\n Assumes that the current working directory is the checkout root.\n \"\"\"", "# src_dir is only needed for compiling v8, which uses compile.py (but no other", "# of the build scripts), but its source root isn't \"src\" -- crbug....
[ { "param": "src_dir", "type": null }, { "param": "cros_board", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "src_dir", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "cros_board", "type": null, "docstring": null, "docstring_t...
a5ecd352f00647ceede2dd155dce9fac64e17bd0
sunlongbo/chromium
tools/metrics/actions/actions_model.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
PrettifyTree
<not_specific>
def PrettifyTree(minidom_doc): """Parses the input minidom document and return a pretty-printed version. Args: minidom_doc: A minidom document. Returns: A pretty-printed xml string, or None if the config contains errors. """ actions = ACTION_XML_TYPE.Parse(minidom_doc) return ACTION_XML_TYPE.Pre...
Parses the input minidom document and return a pretty-printed version. Args: minidom_doc: A minidom document. Returns: A pretty-printed xml string, or None if the config contains errors.
Parses the input minidom document and return a pretty-printed version.
[ "Parses", "the", "input", "minidom", "document", "and", "return", "a", "pretty", "-", "printed", "version", "." ]
def PrettifyTree(minidom_doc): actions = ACTION_XML_TYPE.Parse(minidom_doc) return ACTION_XML_TYPE.PrettyPrint(actions)
[ "def", "PrettifyTree", "(", "minidom_doc", ")", ":", "actions", "=", "ACTION_XML_TYPE", ".", "Parse", "(", "minidom_doc", ")", "return", "ACTION_XML_TYPE", ".", "PrettyPrint", "(", "actions", ")" ]
Parses the input minidom document and return a pretty-printed version.
[ "Parses", "the", "input", "minidom", "document", "and", "return", "a", "pretty", "-", "printed", "version", "." ]
[ "\"\"\"Parses the input minidom document and return a pretty-printed\n version.\n\n Args:\n minidom_doc: A minidom document.\n\n Returns:\n A pretty-printed xml string, or None if the config contains errors.\n \"\"\"" ]
[ { "param": "minidom_doc", "type": null } ]
{ "returns": [ { "docstring": "A pretty-printed xml string, or None if the config contains errors.", "docstring_tokens": [ "A", "pretty", "-", "printed", "xml", "string", "or", "None", "if", "the", "config", ...
2e15c17ae60adf64e048ea6757fe37b5cbcbd8f4
sunlongbo/chromium
tools/perf/generate_legacy_perf_dashboard_json_unittest.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
_ProcessLog
null
def _ProcessLog(self, log_processor, logfile): # pylint: disable=R0201 """Reads in a input log file and processes it. This changes the state of the log processor object; the output is stored in the object and can be gotten using the PerformanceLogs() method. Args: log_processor: An PerformanceL...
Reads in a input log file and processes it. This changes the state of the log processor object; the output is stored in the object and can be gotten using the PerformanceLogs() method. Args: log_processor: An PerformanceLogProcessor instance. logfile: File name of an input performance results ...
Reads in a input log file and processes it. This changes the state of the log processor object; the output is stored in the object and can be gotten using the PerformanceLogs() method.
[ "Reads", "in", "a", "input", "log", "file", "and", "processes", "it", ".", "This", "changes", "the", "state", "of", "the", "log", "processor", "object", ";", "the", "output", "is", "stored", "in", "the", "object", "and", "can", "be", "gotten", "using", ...
def _ProcessLog(self, log_processor, logfile): for line in open(os.path.join(self.data_directory, logfile)): log_processor.ProcessLine(line)
[ "def", "_ProcessLog", "(", "self", ",", "log_processor", ",", "logfile", ")", ":", "for", "line", "in", "open", "(", "os", ".", "path", ".", "join", "(", "self", ".", "data_directory", ",", "logfile", ")", ")", ":", "log_processor", ".", "ProcessLine", ...
Reads in a input log file and processes it.
[ "Reads", "in", "a", "input", "log", "file", "and", "processes", "it", "." ]
[ "# pylint: disable=R0201", "\"\"\"Reads in a input log file and processes it.\n\n This changes the state of the log processor object; the output is stored\n in the object and can be gotten using the PerformanceLogs() method.\n\n Args:\n log_processor: An PerformanceLogProcessor instance.\n logf...
[ { "param": "self", "type": null }, { "param": "log_processor", "type": null }, { "param": "logfile", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "log_processor", "type": null, "docstring": "An PerformanceLogProces...
2e15c17ae60adf64e048ea6757fe37b5cbcbd8f4
sunlongbo/chromium
tools/perf/generate_legacy_perf_dashboard_json_unittest.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
_ConstructParseAndCheckLogfiles
<not_specific>
def _ConstructParseAndCheckLogfiles(self, inputfiles, graphs): """Uses a log processor to process the given input files. Args: inputfiles: A list of input performance results log file names. logfiles: List of expected output ".dat" file names. Returns: A dictionary mapping output file na...
Uses a log processor to process the given input files. Args: inputfiles: A list of input performance results log file names. logfiles: List of expected output ".dat" file names. Returns: A dictionary mapping output file name to output file lines.
Uses a log processor to process the given input files.
[ "Uses", "a", "log", "processor", "to", "process", "the", "given", "input", "files", "." ]
def _ConstructParseAndCheckLogfiles(self, inputfiles, graphs): parser = self._ConstructDefaultProcessor() for inputfile in inputfiles: self._ProcessLog(parser, inputfile) logs = json.loads(parser.GenerateGraphJson()) for graph in graphs: self._CheckFileExistsWithData(logs, graph) return ...
[ "def", "_ConstructParseAndCheckLogfiles", "(", "self", ",", "inputfiles", ",", "graphs", ")", ":", "parser", "=", "self", ".", "_ConstructDefaultProcessor", "(", ")", "for", "inputfile", "in", "inputfiles", ":", "self", ".", "_ProcessLog", "(", "parser", ",", ...
Uses a log processor to process the given input files.
[ "Uses", "a", "log", "processor", "to", "process", "the", "given", "input", "files", "." ]
[ "\"\"\"Uses a log processor to process the given input files.\n\n Args:\n inputfiles: A list of input performance results log file names.\n logfiles: List of expected output \".dat\" file names.\n\n Returns:\n A dictionary mapping output file name to output file lines.\n \"\"\"" ]
[ { "param": "self", "type": null }, { "param": "inputfiles", "type": null }, { "param": "graphs", "type": null } ]
{ "returns": [ { "docstring": "A dictionary mapping output file name to output file lines.", "docstring_tokens": [ "A", "dictionary", "mapping", "output", "file", "name", "to", "output", "file", "lines", "." ...
2e15c17ae60adf64e048ea6757fe37b5cbcbd8f4
sunlongbo/chromium
tools/perf/generate_legacy_perf_dashboard_json_unittest.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
_ConstructParseAndCheckJSON
null
def _ConstructParseAndCheckJSON( self, inputfiles, logfiles, graphs): """Processes input with a log processor and checks against expectations. Args: inputfiles: A list of input performance result log file names. logfiles: A list of expected output ".dat" file names. subdir: Subdirectory...
Processes input with a log processor and checks against expectations. Args: inputfiles: A list of input performance result log file names. logfiles: A list of expected output ".dat" file names. subdir: Subdirectory containing expected output files. log_processor_class: A log processor class...
Processes input with a log processor and checks against expectations.
[ "Processes", "input", "with", "a", "log", "processor", "and", "checks", "against", "expectations", "." ]
def _ConstructParseAndCheckJSON( self, inputfiles, logfiles, graphs): logs = self._ConstructParseAndCheckLogfiles(inputfiles, graphs) index = 0 for filename in logfiles: graph_name = graphs[index] actual = logs[graph_name] path = os.path.join(self.data_directory, filename) expe...
[ "def", "_ConstructParseAndCheckJSON", "(", "self", ",", "inputfiles", ",", "logfiles", ",", "graphs", ")", ":", "logs", "=", "self", ".", "_ConstructParseAndCheckLogfiles", "(", "inputfiles", ",", "graphs", ")", "index", "=", "0", "for", "filename", "in", "log...
Processes input with a log processor and checks against expectations.
[ "Processes", "input", "with", "a", "log", "processor", "and", "checks", "against", "expectations", "." ]
[ "\"\"\"Processes input with a log processor and checks against expectations.\n\n Args:\n inputfiles: A list of input performance result log file names.\n logfiles: A list of expected output \".dat\" file names.\n subdir: Subdirectory containing expected output files.\n log_processor_class: A ...
[ { "param": "self", "type": null }, { "param": "inputfiles", "type": null }, { "param": "logfiles", "type": null }, { "param": "graphs", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "inputfiles", "type": null, "docstring": "A list of input performanc...
8dd55be7fa2744b2feb03915fcfb6edff60bcdc1
sunlongbo/chromium
third_party/blink/tools/blinkpy/w3c/gerrit.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
post
<not_specific>
def post(self, path, data): """Sends a POST request to path with data as the JSON payload. The path has to be prefixed with '/a/': https://gerrit-review.googlesource.com/Documentation/rest-api.html#authentication """ assert path.startswith('/a/'), \ 'POST requests ne...
Sends a POST request to path with data as the JSON payload. The path has to be prefixed with '/a/': https://gerrit-review.googlesource.com/Documentation/rest-api.html#authentication
Sends a POST request to path with data as the JSON payload.
[ "Sends", "a", "POST", "request", "to", "path", "with", "data", "as", "the", "JSON", "payload", "." ]
def post(self, path, data): assert path.startswith('/a/'), \ 'POST requests need to use authenticated routes.' url = URL_BASE + path assert self.user and self.token, 'Gerrit user and token required for authenticated routes.' b64auth = base64.b64encode('{}:{}'.format(self.user...
[ "def", "post", "(", "self", ",", "path", ",", "data", ")", ":", "assert", "path", ".", "startswith", "(", "'/a/'", ")", ",", "'POST requests need to use authenticated routes.'", "url", "=", "URL_BASE", "+", "path", "assert", "self", ".", "user", "and", "self...
Sends a POST request to path with data as the JSON payload.
[ "Sends", "a", "POST", "request", "to", "path", "with", "data", "as", "the", "JSON", "payload", "." ]
[ "\"\"\"Sends a POST request to path with data as the JSON payload.\n\n The path has to be prefixed with '/a/':\n https://gerrit-review.googlesource.com/Documentation/rest-api.html#authentication\n \"\"\"" ]
[ { "param": "self", "type": null }, { "param": "path", "type": null }, { "param": "data", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "path", "type": null, "docstring": null, "docstring_tokens": [...
8dd55be7fa2744b2feb03915fcfb6edff60bcdc1
sunlongbo/chromium
third_party/blink/tools/blinkpy/w3c/gerrit.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
query_cl
<not_specific>
def query_cl(self, change_id, query_options=QUERY_OPTIONS): """Queries a commit information from Gerrit.""" path = '/changes/chromium%2Fsrc~main~{}?{}'.format( change_id, query_options) try: cl_data = self.get(path, return_none_on_404=True) except NetworkTimeout: ...
Queries a commit information from Gerrit.
Queries a commit information from Gerrit.
[ "Queries", "a", "commit", "information", "from", "Gerrit", "." ]
def query_cl(self, change_id, query_options=QUERY_OPTIONS): path = '/changes/chromium%2Fsrc~main~{}?{}'.format( change_id, query_options) try: cl_data = self.get(path, return_none_on_404=True) except NetworkTimeout: raise GerritError('Timed out querying CL usi...
[ "def", "query_cl", "(", "self", ",", "change_id", ",", "query_options", "=", "QUERY_OPTIONS", ")", ":", "path", "=", "'/changes/chromium%2Fsrc~main~{}?{}'", ".", "format", "(", "change_id", ",", "query_options", ")", "try", ":", "cl_data", "=", "self", ".", "g...
Queries a commit information from Gerrit.
[ "Queries", "a", "commit", "information", "from", "Gerrit", "." ]
[ "\"\"\"Queries a commit information from Gerrit.\"\"\"" ]
[ { "param": "self", "type": null }, { "param": "change_id", "type": null }, { "param": "query_options", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "change_id", "type": null, "docstring": null, "docstring_token...
8dd55be7fa2744b2feb03915fcfb6edff60bcdc1
sunlongbo/chromium
third_party/blink/tools/blinkpy/w3c/gerrit.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
post_comment
<not_specific>
def post_comment(self, message): """Posts a comment to the CL.""" path = '/a/changes/{change_id}/revisions/current/review'.format( change_id=self.change_id, ) try: return self.api.post(path, {'message': message}) except HTTPError as e: raise GerritErro...
Posts a comment to the CL.
Posts a comment to the CL.
[ "Posts", "a", "comment", "to", "the", "CL", "." ]
def post_comment(self, message): path = '/a/changes/{change_id}/revisions/current/review'.format( change_id=self.change_id, ) try: return self.api.post(path, {'message': message}) except HTTPError as e: raise GerritError( 'Failed to post a comm...
[ "def", "post_comment", "(", "self", ",", "message", ")", ":", "path", "=", "'/a/changes/{change_id}/revisions/current/review'", ".", "format", "(", "change_id", "=", "self", ".", "change_id", ",", ")", "try", ":", "return", "self", ".", "api", ".", "post", "...
Posts a comment to the CL.
[ "Posts", "a", "comment", "to", "the", "CL", "." ]
[ "\"\"\"Posts a comment to the CL.\"\"\"" ]
[ { "param": "self", "type": null }, { "param": "message", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "message", "type": null, "docstring": null, "docstring_tokens"...
8dd55be7fa2744b2feb03915fcfb6edff60bcdc1
sunlongbo/chromium
third_party/blink/tools/blinkpy/w3c/gerrit.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
fetch_current_revision_commit
<not_specific>
def fetch_current_revision_commit(self, host): """Fetches the git commit for the latest revision of CL. This method fetches the commit corresponding to the latest revision of CL to local Chromium repository, but does not checkout the commit to the working tree. All changes in the CL are...
Fetches the git commit for the latest revision of CL. This method fetches the commit corresponding to the latest revision of CL to local Chromium repository, but does not checkout the commit to the working tree. All changes in the CL are squashed into this one commit, regardless of how ...
Fetches the git commit for the latest revision of CL. This method fetches the commit corresponding to the latest revision of CL to local Chromium repository, but does not checkout the commit to the working tree. All changes in the CL are squashed into this one commit, regardless of how many revisions have been uploaded...
[ "Fetches", "the", "git", "commit", "for", "the", "latest", "revision", "of", "CL", ".", "This", "method", "fetches", "the", "commit", "corresponding", "to", "the", "latest", "revision", "of", "CL", "to", "local", "Chromium", "repository", "but", "does", "not...
def fetch_current_revision_commit(self, host): git = host.git(absolute_chromium_dir(host)) url = self.current_revision['fetch']['http']['url'] ref = self.current_revision['fetch']['http']['ref'] git.run(['fetch', url, ref]) sha = git.run(['rev-parse', 'FETCH_HEAD']).strip() ...
[ "def", "fetch_current_revision_commit", "(", "self", ",", "host", ")", ":", "git", "=", "host", ".", "git", "(", "absolute_chromium_dir", "(", "host", ")", ")", "url", "=", "self", ".", "current_revision", "[", "'fetch'", "]", "[", "'http'", "]", "[", "'...
Fetches the git commit for the latest revision of CL.
[ "Fetches", "the", "git", "commit", "for", "the", "latest", "revision", "of", "CL", "." ]
[ "\"\"\"Fetches the git commit for the latest revision of CL.\n\n This method fetches the commit corresponding to the latest revision of\n CL to local Chromium repository, but does not checkout the commit to the\n working tree. All changes in the CL are squashed into this one commit,\n re...
[ { "param": "self", "type": null }, { "param": "host", "type": null } ]
{ "returns": [ { "docstring": "A ChromiumCommit object (the fetched commit).", "docstring_tokens": [ "A", "ChromiumCommit", "object", "(", "the", "fetched", "commit", ")", "." ], "type": null } ], "raises": [],...
a02cfdaca8d22743f58adfbc4db4e71b475be63c
sunlongbo/chromium
net/data/gencerts/__init__.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
make_serial_number
<not_specific>
def make_serial_number(self): """Returns a hex number that is generated based on the certificate file path. This serial number will likely be globally unique, which makes it easier to use the certificates with NSS (which assumes certificate equivalence based on issuer and serial number).""" # Hash ...
Returns a hex number that is generated based on the certificate file path. This serial number will likely be globally unique, which makes it easier to use the certificates with NSS (which assumes certificate equivalence based on issuer and serial number).
Returns a hex number that is generated based on the certificate file path. This serial number will likely be globally unique, which makes it easier to use the certificates with NSS (which assumes certificate equivalence based on issuer and serial number).
[ "Returns", "a", "hex", "number", "that", "is", "generated", "based", "on", "the", "certificate", "file", "path", ".", "This", "serial", "number", "will", "likely", "be", "globally", "unique", "which", "makes", "it", "easier", "to", "use", "the", "certificate...
def make_serial_number(self): m = hashlib.sha1() script_path = os.path.realpath(g_invoking_script_path) script_path = "/".join(script_path.split(os.sep)[-3:]) m.update(script_path) m.update(self.path_id) serial_bytes = m.digest() serial_bytes = chr(ord(serial_bytes[0]) & 0x7F) + serial_bytes...
[ "def", "make_serial_number", "(", "self", ")", ":", "m", "=", "hashlib", ".", "sha1", "(", ")", "script_path", "=", "os", ".", "path", ".", "realpath", "(", "g_invoking_script_path", ")", "script_path", "=", "\"/\"", ".", "join", "(", "script_path", ".", ...
Returns a hex number that is generated based on the certificate file path.
[ "Returns", "a", "hex", "number", "that", "is", "generated", "based", "on", "the", "certificate", "file", "path", "." ]
[ "\"\"\"Returns a hex number that is generated based on the certificate file\n path. This serial number will likely be globally unique, which makes it\n easier to use the certificates with NSS (which assumes certificate\n equivalence based on issuer and serial number).\"\"\"", "# Hash some predictable val...
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
a02cfdaca8d22743f58adfbc4db4e71b475be63c
sunlongbo/chromium
net/data/gencerts/__init__.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
init
null
def init(invoking_script_path): """Creates an output directory to contain all the temporary files that may be created, as well as determining the path for the final output. These paths are all based off of the name of the calling script. """ global g_tmp_dir global g_invoking_script_path g_invoking_scri...
Creates an output directory to contain all the temporary files that may be created, as well as determining the path for the final output. These paths are all based off of the name of the calling script.
Creates an output directory to contain all the temporary files that may be created, as well as determining the path for the final output. These paths are all based off of the name of the calling script.
[ "Creates", "an", "output", "directory", "to", "contain", "all", "the", "temporary", "files", "that", "may", "be", "created", "as", "well", "as", "determining", "the", "path", "for", "the", "final", "output", ".", "These", "paths", "are", "all", "based", "o...
def init(invoking_script_path): global g_tmp_dir global g_invoking_script_path g_invoking_script_path = invoking_script_path expected_cwd = os.path.realpath(os.path.dirname(invoking_script_path)) actual_cwd = os.path.realpath(os.getcwd()) if actual_cwd != expected_cwd: sys.stderr.write( ('Your c...
[ "def", "init", "(", "invoking_script_path", ")", ":", "global", "g_tmp_dir", "global", "g_invoking_script_path", "g_invoking_script_path", "=", "invoking_script_path", "expected_cwd", "=", "os", ".", "path", ".", "realpath", "(", "os", ".", "path", ".", "dirname", ...
Creates an output directory to contain all the temporary files that may be created, as well as determining the path for the final output.
[ "Creates", "an", "output", "directory", "to", "contain", "all", "the", "temporary", "files", "that", "may", "be", "created", "as", "well", "as", "determining", "the", "path", "for", "the", "final", "output", "." ]
[ "\"\"\"Creates an output directory to contain all the temporary files that may be\n created, as well as determining the path for the final output. These paths\n are all based off of the name of the calling script.\n \"\"\"", "# The scripts assume to be run from within their containing directory (paths", "# t...
[ { "param": "invoking_script_path", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "invoking_script_path", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
a032d92f34be52fbacea7a5a32d5c00b18217965
sunlongbo/chromium
tools/disable_tests/gtest.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
disabler
str
def disabler(full_test_name: str, source_file: str, new_cond: Condition) -> str: """Disable a GTest test within the given file. Args: test_name: The name of the test, in the form TestSuite.TestName lines: The existing file, split into lines. Note that each line ends with a newline character. new_...
Disable a GTest test within the given file. Args: test_name: The name of the test, in the form TestSuite.TestName lines: The existing file, split into lines. Note that each line ends with a newline character. new_cond: The additional conditions under which to disable the test. These will be m...
Disable a GTest test within the given file.
[ "Disable", "a", "GTest", "test", "within", "the", "given", "file", "." ]
def disabler(full_test_name: str, source_file: str, new_cond: Condition) -> str: lines = source_file.split('\n') test_name = full_test_name.split('.')[1] disabled = 'DISABLED_' + test_name maybe = 'MAYBE_' + test_name current_name = None src_range = None for i in range(len(lines) - 1, -1, -1): line = ...
[ "def", "disabler", "(", "full_test_name", ":", "str", ",", "source_file", ":", "str", ",", "new_cond", ":", "Condition", ")", "->", "str", ":", "lines", "=", "source_file", ".", "split", "(", "'\\n'", ")", "test_name", "=", "full_test_name", ".", "split", ...
Disable a GTest test within the given file.
[ "Disable", "a", "GTest", "test", "within", "the", "given", "file", "." ]
[ "\"\"\"Disable a GTest test within the given file.\n\n Args:\n test_name: The name of the test, in the form TestSuite.TestName\n lines: The existing file, split into lines. Note that each line ends with a\n newline character.\n new_cond: The additional conditions under which to disable the test. Thes...
[ { "param": "full_test_name", "type": "str" }, { "param": "source_file", "type": "str" }, { "param": "new_cond", "type": "Condition" } ]
{ "returns": [ { "docstring": "The new contents to write into the file, with the test disabled.", "docstring_tokens": [ "The", "new", "contents", "to", "write", "into", "the", "file", "with", "the", "test", ...
a032d92f34be52fbacea7a5a32d5c00b18217965
sunlongbo/chromium
tools/disable_tests/gtest.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
find_conditions
<not_specific>
def find_conditions(lines: List[str], start_line: int, test_name: str): """Starting from a given line, find the conditions relating to this test. We step backwards until we find a preprocessor conditional block which defines the MAYBE_Foo macro for this test. The logic is fairly rigid - there are many ways in ...
Starting from a given line, find the conditions relating to this test. We step backwards until we find a preprocessor conditional block which defines the MAYBE_Foo macro for this test. The logic is fairly rigid - there are many ways in which test disabling could be expressed that we don't handle. We rely on th...
Starting from a given line, find the conditions relating to this test. We step backwards until we find a preprocessor conditional block which defines the MAYBE_Foo macro for this test. The logic is fairly rigid - there are many ways in which test disabling could be expressed that we don't handle. We rely on the fact th...
[ "Starting", "from", "a", "given", "line", "find", "the", "conditions", "relating", "to", "this", "test", ".", "We", "step", "backwards", "until", "we", "find", "a", "preprocessor", "conditional", "block", "which", "defines", "the", "MAYBE_Foo", "macro", "for",...
def find_conditions(lines: List[str], start_line: int, test_name: str): The range between the if/ifdef and the endif is the range defining the conditions under which this test is disabled. We also keep track of which branch disables the test, so we know whether to negate the condition. disabled_test = 'DI...
[ "def", "find_conditions", "(", "lines", ":", "List", "[", "str", "]", ",", "start_line", ":", "int", ",", "test_name", ":", "str", ")", ":", "disabled_test", "=", "'DISABLED_'", "+", "test_name", "maybe_test", "=", "'MAYBE_'", "+", "test_name", "start", "=...
Starting from a given line, find the conditions relating to this test.
[ "Starting", "from", "a", "given", "line", "find", "the", "conditions", "relating", "to", "this", "test", "." ]
[ "\"\"\"Starting from a given line, find the conditions relating to this test.\n\n We step backwards until we find a preprocessor conditional block which defines\n the MAYBE_Foo macro for this test. The logic is fairly rigid - there are many\n ways in which test disabling could be expressed that we don't handle. ...
[ { "param": "lines", "type": "List[str]" }, { "param": "start_line", "type": "int" }, { "param": "test_name", "type": "str" } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "lines", "type": "List[str]", "docstring": "The lines of the file, in which to search.", "docstring_tokens": [ "The", "lines", "of", "the", "file", "in", "which", ...
a032d92f34be52fbacea7a5a32d5c00b18217965
sunlongbo/chromium
tools/disable_tests/gtest.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
peek
Optional[str]
def peek(tokens: List[str]) -> Optional[str]: """Return the next token without consuming it, if tokens is non-empty.""" if tokens: return tokens[-1] return None
Return the next token without consuming it, if tokens is non-empty.
Return the next token without consuming it, if tokens is non-empty.
[ "Return", "the", "next", "token", "without", "consuming", "it", "if", "tokens", "is", "non", "-", "empty", "." ]
def peek(tokens: List[str]) -> Optional[str]: if tokens: return tokens[-1] return None
[ "def", "peek", "(", "tokens", ":", "List", "[", "str", "]", ")", "->", "Optional", "[", "str", "]", ":", "if", "tokens", ":", "return", "tokens", "[", "-", "1", "]", "return", "None" ]
Return the next token without consuming it, if tokens is non-empty.
[ "Return", "the", "next", "token", "without", "consuming", "it", "if", "tokens", "is", "non", "-", "empty", "." ]
[ "\"\"\"Return the next token without consuming it, if tokens is non-empty.\"\"\"" ]
[ { "param": "tokens", "type": "List[str]" } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "tokens", "type": "List[str]", "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
a032d92f34be52fbacea7a5a32d5c00b18217965
sunlongbo/chromium
tools/disable_tests/gtest.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
is_ident
bool
def is_ident(s: str) -> bool: """Checks if s is a valid identifier. This doesn't handle the full intricacies of the spec. """ return all(c.isalnum() or c == '_' for c in s)
Checks if s is a valid identifier. This doesn't handle the full intricacies of the spec.
Checks if s is a valid identifier. This doesn't handle the full intricacies of the spec.
[ "Checks", "if", "s", "is", "a", "valid", "identifier", ".", "This", "doesn", "'", "t", "handle", "the", "full", "intricacies", "of", "the", "spec", "." ]
def is_ident(s: str) -> bool: return all(c.isalnum() or c == '_' for c in s)
[ "def", "is_ident", "(", "s", ":", "str", ")", "->", "bool", ":", "return", "all", "(", "c", ".", "isalnum", "(", ")", "or", "c", "==", "'_'", "for", "c", "in", "s", ")" ]
Checks if s is a valid identifier.
[ "Checks", "if", "s", "is", "a", "valid", "identifier", "." ]
[ "\"\"\"Checks if s is a valid identifier.\n\n This doesn't handle the full intricacies of the spec.\n \"\"\"" ]
[ { "param": "s", "type": "str" } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "s", "type": "str", "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
a032d92f34be52fbacea7a5a32d5c00b18217965
sunlongbo/chromium
tools/disable_tests/gtest.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
canonicalise
Condition
def canonicalise(parsed_condition) -> Condition: """Make a Condition from a raw preprocessor AST. Take the raw form of the condition we've parsed from the file and convert it into its canonical form, replacing any domain-specific stuff with its generic form. """ if not isinstance(parsed_condition, tuple):...
Make a Condition from a raw preprocessor AST. Take the raw form of the condition we've parsed from the file and convert it into its canonical form, replacing any domain-specific stuff with its generic form.
Make a Condition from a raw preprocessor AST. Take the raw form of the condition we've parsed from the file and convert it into its canonical form, replacing any domain-specific stuff with its generic form.
[ "Make", "a", "Condition", "from", "a", "raw", "preprocessor", "AST", ".", "Take", "the", "raw", "form", "of", "the", "condition", "we", "'", "ve", "parsed", "from", "the", "file", "and", "convert", "it", "into", "its", "canonical", "form", "replacing", "...
def canonicalise(parsed_condition) -> Condition: if not isinstance(parsed_condition, tuple): return parsed_condition op, args = parsed_condition if op == '!': return ('not', canonicalise(args)) if (logical_fn := {'&&': 'and', '||': 'or'}.get(op, None)) is not None: return (logical_fn, [canonicalise(...
[ "def", "canonicalise", "(", "parsed_condition", ")", "->", "Condition", ":", "if", "not", "isinstance", "(", "parsed_condition", ",", "tuple", ")", ":", "return", "parsed_condition", "op", ",", "args", "=", "parsed_condition", "if", "op", "==", "'!'", ":", "...
Make a Condition from a raw preprocessor AST.
[ "Make", "a", "Condition", "from", "a", "raw", "preprocessor", "AST", "." ]
[ "\"\"\"Make a Condition from a raw preprocessor AST.\n\n Take the raw form of the condition we've parsed from the file and convert it\n into its canonical form, replacing any domain-specific stuff with its generic\n form.\n \"\"\"", "# Convert logical operators into their canonical Condition form.", "# Just...
[ { "param": "parsed_condition", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "parsed_condition", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
a032d92f34be52fbacea7a5a32d5c00b18217965
sunlongbo/chromium
tools/disable_tests/gtest.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
cc_format_condition
str
def cc_format_condition(cond: Condition, add_brackets=False) -> str: """The reverse of canonicalise - produce a C++ expression for a Condition.""" def bracket(s: str) -> str: return f"({s})" if add_brackets else s assert cond != conditions.ALWAYS assert cond != conditions.NEVER if isinstance(cond, cond...
The reverse of canonicalise - produce a C++ expression for a Condition.
The reverse of canonicalise - produce a C++ expression for a Condition.
[ "The", "reverse", "of", "canonicalise", "-", "produce", "a", "C", "++", "expression", "for", "a", "Condition", "." ]
def cc_format_condition(cond: Condition, add_brackets=False) -> str: def bracket(s: str) -> str: return f"({s})" if add_brackets else s assert cond != conditions.ALWAYS assert cond != conditions.NEVER if isinstance(cond, conditions.Terminal): value = cond.gtest_info.name if cond.gtest_info.type == M...
[ "def", "cc_format_condition", "(", "cond", ":", "Condition", ",", "add_brackets", "=", "False", ")", "->", "str", ":", "def", "bracket", "(", "s", ":", "str", ")", "->", "str", ":", "return", "f\"({s})\"", "if", "add_brackets", "else", "s", "assert", "co...
The reverse of canonicalise - produce a C++ expression for a Condition.
[ "The", "reverse", "of", "canonicalise", "-", "produce", "a", "C", "++", "expression", "for", "a", "Condition", "." ]
[ "\"\"\"The reverse of canonicalise - produce a C++ expression for a Condition.\"\"\"", "# TODO: Avoid redundant brackets? We probably want to keep them even when", "# redundant in most cases, but !(defined(X)) should be !defined(X)." ]
[ { "param": "cond", "type": "Condition" }, { "param": "add_brackets", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "cond", "type": "Condition", "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "add_brackets", "type": null, "docstring": null, "docst...
9f802290047077db9537d0ca812465f8ecece7d3
sunlongbo/chromium
third_party/blink/renderer/bindings/scripts/web_idl/database_builder.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
build_database
<not_specific>
def build_database(filepaths, report_error): """ Compiles IDL definitions in |filepaths| and builds a database. Args: filepaths: Paths to files of AstGroup. report_error: A callback that will be invoked when an error occurs due to inconsistent/invalid IDL definitions. This call...
Compiles IDL definitions in |filepaths| and builds a database. Args: filepaths: Paths to files of AstGroup. report_error: A callback that will be invoked when an error occurs due to inconsistent/invalid IDL definitions. This callback takes an error message of type str ...
Compiles IDL definitions in |filepaths| and builds a database.
[ "Compiles", "IDL", "definitions", "in", "|filepaths|", "and", "builds", "a", "database", "." ]
def build_database(filepaths, report_error): assert isinstance(filepaths, (list, tuple)) assert all(isinstance(filepath, str) for filepath in filepaths) assert callable(report_error) ir_map = IRMap() ref_to_idl_def_factory = RefByIdFactory() idl_type_factory = IdlTypeFactory() load_and_regis...
[ "def", "build_database", "(", "filepaths", ",", "report_error", ")", ":", "assert", "isinstance", "(", "filepaths", ",", "(", "list", ",", "tuple", ")", ")", "assert", "all", "(", "isinstance", "(", "filepath", ",", "str", ")", "for", "filepath", "in", "...
Compiles IDL definitions in |filepaths| and builds a database.
[ "Compiles", "IDL", "definitions", "in", "|filepaths|", "and", "builds", "a", "database", "." ]
[ "\"\"\"\n Compiles IDL definitions in |filepaths| and builds a database.\n\n Args:\n filepaths: Paths to files of AstGroup.\n report_error: A callback that will be invoked when an error occurs due\n to inconsistent/invalid IDL definitions. This callback takes an\n error me...
[ { "param": "filepaths", "type": null }, { "param": "report_error", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "filepaths", "type": null, "docstring": "Paths to files of AstGroup.", "docstring_tokens": [ "Paths", "to", "files", "of", "AstGroup", "." ], "default": null, "i...
9f92347a6cbeebbed5564df79a968a171c624e79
sunlongbo/chromium
components/policy/tools/template_writers/writers/doc_atomic_groups_writer.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
GetWriter
<not_specific>
def GetWriter(config): '''Factory method for creating DocAtomicGroupsWriter objects. See the constructor of TemplateWriter for description of arguments. ''' return DocAtomicGroupsWriter(['*'], config)
Factory method for creating DocAtomicGroupsWriter objects. See the constructor of TemplateWriter for description of arguments.
Factory method for creating DocAtomicGroupsWriter objects. See the constructor of TemplateWriter for description of arguments.
[ "Factory", "method", "for", "creating", "DocAtomicGroupsWriter", "objects", ".", "See", "the", "constructor", "of", "TemplateWriter", "for", "description", "of", "arguments", "." ]
def GetWriter(config): return DocAtomicGroupsWriter(['*'], config)
[ "def", "GetWriter", "(", "config", ")", ":", "return", "DocAtomicGroupsWriter", "(", "[", "'*'", "]", ",", "config", ")" ]
Factory method for creating DocAtomicGroupsWriter objects.
[ "Factory", "method", "for", "creating", "DocAtomicGroupsWriter", "objects", "." ]
[ "'''Factory method for creating DocAtomicGroupsWriter objects.\n See the constructor of TemplateWriter for description of\n arguments.\n '''" ]
[ { "param": "config", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "config", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }