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
15a677ddc6b9d8c5fcb3ef85b3078e6276b30033
sunlongbo/chromium
third_party/tflite_support/src/tensorflow_lite_support/metadata/python/metadata.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
with_model_file
<not_specific>
def with_model_file(cls, model_file): """Creates a MetadataPopulator object that populates data to a model file. Args: model_file: valid path to a TensorFlow Lite model file. Returns: MetadataPopulator object. Raises: IOError: File not found. ValueError: the model does not hav...
Creates a MetadataPopulator object that populates data to a model file. Args: model_file: valid path to a TensorFlow Lite model file. Returns: MetadataPopulator object. Raises: IOError: File not found. ValueError: the model does not have the expected flatbuffer identifer.
Creates a MetadataPopulator object that populates data to a model file.
[ "Creates", "a", "MetadataPopulator", "object", "that", "populates", "data", "to", "a", "model", "file", "." ]
def with_model_file(cls, model_file): return cls(model_file)
[ "def", "with_model_file", "(", "cls", ",", "model_file", ")", ":", "return", "cls", "(", "model_file", ")" ]
Creates a MetadataPopulator object that populates data to a model file.
[ "Creates", "a", "MetadataPopulator", "object", "that", "populates", "data", "to", "a", "model", "file", "." ]
[ "\"\"\"Creates a MetadataPopulator object that populates data to a model file.\n\n Args:\n model_file: valid path to a TensorFlow Lite model file.\n\n Returns:\n MetadataPopulator object.\n\n Raises:\n IOError: File not found.\n ValueError: the model does not have the expected flatbuffe...
[ { "param": "cls", "type": null }, { "param": "model_file", "type": null } ]
{ "returns": [ { "docstring": null, "docstring_tokens": [ "None" ], "type": null } ], "raises": [ { "docstring": "File not found.", "docstring_tokens": [ "File", "not", "found", "." ], "type": "IOError" }, ...
15a677ddc6b9d8c5fcb3ef85b3078e6276b30033
sunlongbo/chromium
third_party/tflite_support/src/tensorflow_lite_support/metadata/python/metadata.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
with_model_buffer
<not_specific>
def with_model_buffer(cls, model_buf): """Creates a MetadataPopulator object that populates data to a model buffer. Args: model_buf: TensorFlow Lite model buffer in bytearray. Returns: A MetadataPopulator(_MetadataPopulatorWithBuffer) object. Raises: ValueError: the model does not h...
Creates a MetadataPopulator object that populates data to a model buffer. Args: model_buf: TensorFlow Lite model buffer in bytearray. Returns: A MetadataPopulator(_MetadataPopulatorWithBuffer) object. Raises: ValueError: the model does not have the expected flatbuffer identifer.
Creates a MetadataPopulator object that populates data to a model buffer.
[ "Creates", "a", "MetadataPopulator", "object", "that", "populates", "data", "to", "a", "model", "buffer", "." ]
def with_model_buffer(cls, model_buf): return _MetadataPopulatorWithBuffer(model_buf)
[ "def", "with_model_buffer", "(", "cls", ",", "model_buf", ")", ":", "return", "_MetadataPopulatorWithBuffer", "(", "model_buf", ")" ]
Creates a MetadataPopulator object that populates data to a model buffer.
[ "Creates", "a", "MetadataPopulator", "object", "that", "populates", "data", "to", "a", "model", "buffer", "." ]
[ "\"\"\"Creates a MetadataPopulator object that populates data to a model buffer.\n\n Args:\n model_buf: TensorFlow Lite model buffer in bytearray.\n\n Returns:\n A MetadataPopulator(_MetadataPopulatorWithBuffer) object.\n\n Raises:\n ValueError: the model does not have the expected flatbuffe...
[ { "param": "cls", "type": null }, { "param": "model_buf", "type": null } ]
{ "returns": [ { "docstring": "A MetadataPopulator(_MetadataPopulatorWithBuffer) object.", "docstring_tokens": [ "A", "MetadataPopulator", "(", "_MetadataPopulatorWithBuffer", ")", "object", "." ], "type": null } ], "raises": ...
15a677ddc6b9d8c5fcb3ef85b3078e6276b30033
sunlongbo/chromium
third_party/tflite_support/src/tensorflow_lite_support/metadata/python/metadata.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
load_associated_files
null
def load_associated_files(self, associated_files): """Loads associated files that to be concatenated after the model file. Args: associated_files: list of file paths. Raises: IOError: File not found. """ for af in associated_files: _assert_file_exist(af) self._assoc...
Loads associated files that to be concatenated after the model file. Args: associated_files: list of file paths. Raises: IOError: File not found.
Loads associated files that to be concatenated after the model file.
[ "Loads", "associated", "files", "that", "to", "be", "concatenated", "after", "the", "model", "file", "." ]
def load_associated_files(self, associated_files): for af in associated_files: _assert_file_exist(af) self._associated_files.add(af)
[ "def", "load_associated_files", "(", "self", ",", "associated_files", ")", ":", "for", "af", "in", "associated_files", ":", "_assert_file_exist", "(", "af", ")", "self", ".", "_associated_files", ".", "add", "(", "af", ")" ]
Loads associated files that to be concatenated after the model file.
[ "Loads", "associated", "files", "that", "to", "be", "concatenated", "after", "the", "model", "file", "." ]
[ "\"\"\"Loads associated files that to be concatenated after the model file.\n\n Args:\n associated_files: list of file paths.\n\n Raises:\n IOError:\n File not found.\n \"\"\"" ]
[ { "param": "self", "type": null }, { "param": "associated_files", "type": null } ]
{ "returns": [], "raises": [ { "docstring": "File not found.", "docstring_tokens": [ "File", "not", "found", "." ], "type": "IOError" } ], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_t...
15a677ddc6b9d8c5fcb3ef85b3078e6276b30033
sunlongbo/chromium
third_party/tflite_support/src/tensorflow_lite_support/metadata/python/metadata.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
load_metadata_buffer
null
def load_metadata_buffer(self, metadata_buf): """Loads the metadata buffer (in bytearray) to be populated. Args: metadata_buf: metadata buffer (in bytearray) to be populated. Raises: ValueError: The metadata to be populated is empty. ValueError: The metadata does not have the expected fl...
Loads the metadata buffer (in bytearray) to be populated. Args: metadata_buf: metadata buffer (in bytearray) to be populated. Raises: ValueError: The metadata to be populated is empty. ValueError: The metadata does not have the expected flatbuffer identifer. ValueError: Cannot get mini...
Loads the metadata buffer (in bytearray) to be populated.
[ "Loads", "the", "metadata", "buffer", "(", "in", "bytearray", ")", "to", "be", "populated", "." ]
def load_metadata_buffer(self, metadata_buf): if not metadata_buf: raise ValueError("The metadata to be populated is empty.") self._validate_metadata(metadata_buf) min_version = _pywrap_metadata_version.GetMinimumMetadataParserVersion( bytes(metadata_buf)) metadata = _metadata_fb.ModelMeta...
[ "def", "load_metadata_buffer", "(", "self", ",", "metadata_buf", ")", ":", "if", "not", "metadata_buf", ":", "raise", "ValueError", "(", "\"The metadata to be populated is empty.\"", ")", "self", ".", "_validate_metadata", "(", "metadata_buf", ")", "min_version", "=",...
Loads the metadata buffer (in bytearray) to be populated.
[ "Loads", "the", "metadata", "buffer", "(", "in", "bytearray", ")", "to", "be", "populated", "." ]
[ "\"\"\"Loads the metadata buffer (in bytearray) to be populated.\n\n Args:\n metadata_buf: metadata buffer (in bytearray) to be populated.\n\n Raises:\n ValueError: The metadata to be populated is empty.\n ValueError: The metadata does not have the expected flatbuffer identifer.\n ValueErr...
[ { "param": "self", "type": null }, { "param": "metadata_buf", "type": null } ]
{ "returns": [], "raises": [ { "docstring": "The metadata to be populated is empty.", "docstring_tokens": [ "The", "metadata", "to", "be", "populated", "is", "empty", "." ], "type": "ValueError" }, { "docstring...
15a677ddc6b9d8c5fcb3ef85b3078e6276b30033
sunlongbo/chromium
third_party/tflite_support/src/tensorflow_lite_support/metadata/python/metadata.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
load_metadata_file
null
def load_metadata_file(self, metadata_file): """Loads the metadata file to be populated. Args: metadata_file: path to the metadata file to be populated. Raises: IOError: File not found. ValueError: The metadata to be populated is empty. ValueError: The metadata does not have the ex...
Loads the metadata file to be populated. Args: metadata_file: path to the metadata file to be populated. Raises: IOError: File not found. ValueError: The metadata to be populated is empty. ValueError: The metadata does not have the expected flatbuffer identifer. ValueError: Canno...
Loads the metadata file to be populated.
[ "Loads", "the", "metadata", "file", "to", "be", "populated", "." ]
def load_metadata_file(self, metadata_file): _assert_file_exist(metadata_file) with open(metadata_file, "rb") as f: metadata_buf = f.read() self.load_metadata_buffer(bytearray(metadata_buf))
[ "def", "load_metadata_file", "(", "self", ",", "metadata_file", ")", ":", "_assert_file_exist", "(", "metadata_file", ")", "with", "open", "(", "metadata_file", ",", "\"rb\"", ")", "as", "f", ":", "metadata_buf", "=", "f", ".", "read", "(", ")", "self", "....
Loads the metadata file to be populated.
[ "Loads", "the", "metadata", "file", "to", "be", "populated", "." ]
[ "\"\"\"Loads the metadata file to be populated.\n\n Args:\n metadata_file: path to the metadata file to be populated.\n\n Raises:\n IOError: File not found.\n ValueError: The metadata to be populated is empty.\n ValueError: The metadata does not have the expected flatbuffer identifer.\n ...
[ { "param": "self", "type": null }, { "param": "metadata_file", "type": null } ]
{ "returns": [], "raises": [ { "docstring": "File not found.", "docstring_tokens": [ "File", "not", "found", "." ], "type": "IOError" }, { "docstring": "The metadata to be populated is empty.", "docstring_tokens": [ "The", ...
15a677ddc6b9d8c5fcb3ef85b3078e6276b30033
sunlongbo/chromium
third_party/tflite_support/src/tensorflow_lite_support/metadata/python/metadata.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
populate
null
def populate(self): """Populates loaded metadata and associated files into the model file.""" self._assert_validate() self._populate_metadata_buffer() self._populate_associated_files()
Populates loaded metadata and associated files into the model file.
Populates loaded metadata and associated files into the model file.
[ "Populates", "loaded", "metadata", "and", "associated", "files", "into", "the", "model", "file", "." ]
def populate(self): self._assert_validate() self._populate_metadata_buffer() self._populate_associated_files()
[ "def", "populate", "(", "self", ")", ":", "self", ".", "_assert_validate", "(", ")", "self", ".", "_populate_metadata_buffer", "(", ")", "self", ".", "_populate_associated_files", "(", ")" ]
Populates loaded metadata and associated files into the model file.
[ "Populates", "loaded", "metadata", "and", "associated", "files", "into", "the", "model", "file", "." ]
[ "\"\"\"Populates loaded metadata and associated files into the model file.\"\"\"" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
15a677ddc6b9d8c5fcb3ef85b3078e6276b30033
sunlongbo/chromium
third_party/tflite_support/src/tensorflow_lite_support/metadata/python/metadata.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
_assert_validate
null
def _assert_validate(self): """Validates the metadata and associated files to be populated. Raises: ValueError: File is recorded in the metadata, but is not going to be populated. File has already been packed. """ # Gets files that are recorded in metadata. recorded_files = se...
Validates the metadata and associated files to be populated. Raises: ValueError: File is recorded in the metadata, but is not going to be populated. File has already been packed.
Validates the metadata and associated files to be populated.
[ "Validates", "the", "metadata", "and", "associated", "files", "to", "be", "populated", "." ]
def _assert_validate(self): recorded_files = self.get_recorded_associated_file_list() packed_files = self.get_packed_associated_file_list() to_be_populated_files = [] for af in self._associated_files: to_be_populated_files.append(os.path.basename(af)) for rf in recorded_files: if rf not ...
[ "def", "_assert_validate", "(", "self", ")", ":", "recorded_files", "=", "self", ".", "get_recorded_associated_file_list", "(", ")", "packed_files", "=", "self", ".", "get_packed_associated_file_list", "(", ")", "to_be_populated_files", "=", "[", "]", "for", "af", ...
Validates the metadata and associated files to be populated.
[ "Validates", "the", "metadata", "and", "associated", "files", "to", "be", "populated", "." ]
[ "\"\"\"Validates the metadata and associated files to be populated.\n\n Raises:\n ValueError:\n File is recorded in the metadata, but is not going to be populated.\n File has already been packed.\n \"\"\"", "# Gets files that are recorded in metadata.", "# Gets files that have been pack...
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [ { "docstring": "File is recorded in the metadata, but is not going to be populated.\nFile has already been packed.", "docstring_tokens": [ "File", "is", "recorded", "in", "the", "metadata", "but", "is", ...
15a677ddc6b9d8c5fcb3ef85b3078e6276b30033
sunlongbo/chromium
third_party/tflite_support/src/tensorflow_lite_support/metadata/python/metadata.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
_get_associated_files_from_process_units
<not_specific>
def _get_associated_files_from_process_units(self, table, field_name): """Gets the files that are attached the process units field of a table. Args: table: a Flatbuffers table object that contains fields of an array of ProcessUnit, such as TensorMetadata and SubGraphMetadata. field_name: th...
Gets the files that are attached the process units field of a table. Args: table: a Flatbuffers table object that contains fields of an array of ProcessUnit, such as TensorMetadata and SubGraphMetadata. field_name: the name of the field in the table that represents an array of ProcessUn...
Gets the files that are attached the process units field of a table.
[ "Gets", "the", "files", "that", "are", "attached", "the", "process", "units", "field", "of", "a", "table", "." ]
def _get_associated_files_from_process_units(self, table, field_name): if table is None: return file_list = [] length_method = getattr(table, field_name + "Length", None) member_method = getattr(table, field_name, None) if length_method is None or member_method is None: raise ValueError(...
[ "def", "_get_associated_files_from_process_units", "(", "self", ",", "table", ",", "field_name", ")", ":", "if", "table", "is", "None", ":", "return", "file_list", "=", "[", "]", "length_method", "=", "getattr", "(", "table", ",", "field_name", "+", "\"Length\...
Gets the files that are attached the process units field of a table.
[ "Gets", "the", "files", "that", "are", "attached", "the", "process", "units", "field", "of", "a", "table", "." ]
[ "\"\"\"Gets the files that are attached the process units field of a table.\n\n Args:\n table: a Flatbuffers table object that contains fields of an array of\n ProcessUnit, such as TensorMetadata and SubGraphMetadata.\n field_name: the name of the field in the table that represents an array of\n...
[ { "param": "self", "type": null }, { "param": "table", "type": null }, { "param": "field_name", "type": null } ]
{ "returns": [ { "docstring": "the associated files list.", "docstring_tokens": [ "the", "associated", "files", "list", "." ], "type": null } ], "raises": [], "params": [ { "identifier": "self", "type": null, "docstrin...
15a677ddc6b9d8c5fcb3ef85b3078e6276b30033
sunlongbo/chromium
third_party/tflite_support/src/tensorflow_lite_support/metadata/python/metadata.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
_get_associated_files_from_table
<not_specific>
def _get_associated_files_from_table(self, table, field_name): """Gets the associated files that are attached a table directly. Args: table: a Flatbuffers table object that contains fields of an array of AssociatedFile, such as TensorMetadata and BertTokenizerOptions. field_name: the name o...
Gets the associated files that are attached a table directly. Args: table: a Flatbuffers table object that contains fields of an array of AssociatedFile, such as TensorMetadata and BertTokenizerOptions. field_name: the name of the field in the table that represents an array of ProcessUn...
Gets the associated files that are attached a table directly.
[ "Gets", "the", "associated", "files", "that", "are", "attached", "a", "table", "directly", "." ]
def _get_associated_files_from_table(self, table, field_name): if table is None: return file_list = [] length_method = getattr(table, field_name + "Length") member_method = getattr(table, field_name) for j in range(length_method()): file_list.append(member_method(j).Name().decode("utf-8"...
[ "def", "_get_associated_files_from_table", "(", "self", ",", "table", ",", "field_name", ")", ":", "if", "table", "is", "None", ":", "return", "file_list", "=", "[", "]", "length_method", "=", "getattr", "(", "table", ",", "field_name", "+", "\"Length\"", ")...
Gets the associated files that are attached a table directly.
[ "Gets", "the", "associated", "files", "that", "are", "attached", "a", "table", "directly", "." ]
[ "\"\"\"Gets the associated files that are attached a table directly.\n\n Args:\n table: a Flatbuffers table object that contains fields of an array of\n AssociatedFile, such as TensorMetadata and BertTokenizerOptions.\n field_name: the name of the field in the table that represents an array of\n...
[ { "param": "self", "type": null }, { "param": "table", "type": null }, { "param": "field_name", "type": null } ]
{ "returns": [ { "docstring": "the associated files list.", "docstring_tokens": [ "the", "associated", "files", "list", "." ], "type": null } ], "raises": [], "params": [ { "identifier": "self", "type": null, "docstrin...
15a677ddc6b9d8c5fcb3ef85b3078e6276b30033
sunlongbo/chromium
third_party/tflite_support/src/tensorflow_lite_support/metadata/python/metadata.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
_populate_associated_files
null
def _populate_associated_files(self): """Concatenates associated files after TensorFlow Lite model file. If the MetadataPopulator object is created using the method, with_model_file(model_file), the model file will be updated. """ # Opens up the model file in "appending" mode. # If self._model_...
Concatenates associated files after TensorFlow Lite model file. If the MetadataPopulator object is created using the method, with_model_file(model_file), the model file will be updated.
Concatenates associated files after TensorFlow Lite model file. If the MetadataPopulator object is created using the method, with_model_file(model_file), the model file will be updated.
[ "Concatenates", "associated", "files", "after", "TensorFlow", "Lite", "model", "file", ".", "If", "the", "MetadataPopulator", "object", "is", "created", "using", "the", "method", "with_model_file", "(", "model_file", ")", "the", "model", "file", "will", "be", "u...
def _populate_associated_files(self): | label3.txt with zipfile.ZipFile(self._model_file, "a") as zf: for af in self._associated_files: filename = os.path.basename(af) zf.write(af, filename)
[ "def", "_populate_associated_files", "(", "self", ")", ":", "with", "zipfile", ".", "ZipFile", "(", "self", ".", "_model_file", ",", "\"a\"", ")", "as", "zf", ":", "for", "af", "in", "self", ".", "_associated_files", ":", "filename", "=", "os", ".", "pat...
Concatenates associated files after TensorFlow Lite model file.
[ "Concatenates", "associated", "files", "after", "TensorFlow", "Lite", "model", "file", "." ]
[ "\"\"\"Concatenates associated files after TensorFlow Lite model file.\n\n If the MetadataPopulator object is created using the method,\n with_model_file(model_file), the model file will be updated.\n \"\"\"", "# Opens up the model file in \"appending\" mode.", "# If self._model_file already has pack f...
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
15a677ddc6b9d8c5fcb3ef85b3078e6276b30033
sunlongbo/chromium
third_party/tflite_support/src/tensorflow_lite_support/metadata/python/metadata.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
_populate_metadata_buffer
null
def _populate_metadata_buffer(self): """Populates the metadata buffer (in bytearray) into the model file. Inserts metadata_buf into the metadata field of schema.Model. If the MetadataPopulator object is created using the method, with_model_file(model_file), the model file will be updated. Existing...
Populates the metadata buffer (in bytearray) into the model file. Inserts metadata_buf into the metadata field of schema.Model. If the MetadataPopulator object is created using the method, with_model_file(model_file), the model file will be updated. Existing metadata buffer (if applied) will be overri...
Populates the metadata buffer (in bytearray) into the model file. Inserts metadata_buf into the metadata field of schema.Model. If the MetadataPopulator object is created using the method, with_model_file(model_file), the model file will be updated. Existing metadata buffer (if applied) will be overridden by the new m...
[ "Populates", "the", "metadata", "buffer", "(", "in", "bytearray", ")", "into", "the", "model", "file", ".", "Inserts", "metadata_buf", "into", "the", "metadata", "field", "of", "schema", ".", "Model", ".", "If", "the", "MetadataPopulator", "object", "is", "c...
def _populate_metadata_buffer(self): with open(self._model_file, "rb") as f: model_buf = f.read() model = _schema_fb.ModelT.InitFromObj( _schema_fb.Model.GetRootAsModel(model_buf, 0)) buffer_field = _schema_fb.BufferT() buffer_field.data = self._metadata_buf is_populated = False if...
[ "def", "_populate_metadata_buffer", "(", "self", ")", ":", "with", "open", "(", "self", ".", "_model_file", ",", "\"rb\"", ")", "as", "f", ":", "model_buf", "=", "f", ".", "read", "(", ")", "model", "=", "_schema_fb", ".", "ModelT", ".", "InitFromObj", ...
Populates the metadata buffer (in bytearray) into the model file.
[ "Populates", "the", "metadata", "buffer", "(", "in", "bytearray", ")", "into", "the", "model", "file", "." ]
[ "\"\"\"Populates the metadata buffer (in bytearray) into the model file.\n\n Inserts metadata_buf into the metadata field of schema.Model. If the\n MetadataPopulator object is created using the method,\n with_model_file(model_file), the model file will be updated.\n\n Existing metadata buffer (if applie...
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
15a677ddc6b9d8c5fcb3ef85b3078e6276b30033
sunlongbo/chromium
third_party/tflite_support/src/tensorflow_lite_support/metadata/python/metadata.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
_validate_metadata
null
def _validate_metadata(self, metadata_buf): """Validates the metadata to be populated.""" _assert_metadata_buffer_identifier(metadata_buf) # Verify the number of SubgraphMetadata is exactly one. # TFLite currently only support one subgraph. model_meta = _metadata_fb.ModelMetadata.GetRootAsModelMeta...
Validates the metadata to be populated.
Validates the metadata to be populated.
[ "Validates", "the", "metadata", "to", "be", "populated", "." ]
def _validate_metadata(self, metadata_buf): _assert_metadata_buffer_identifier(metadata_buf) model_meta = _metadata_fb.ModelMetadata.GetRootAsModelMetadata( metadata_buf, 0) if model_meta.SubgraphMetadataLength() != 1: raise ValueError("The number of SubgraphMetadata should be exactly one, " ...
[ "def", "_validate_metadata", "(", "self", ",", "metadata_buf", ")", ":", "_assert_metadata_buffer_identifier", "(", "metadata_buf", ")", "model_meta", "=", "_metadata_fb", ".", "ModelMetadata", ".", "GetRootAsModelMetadata", "(", "metadata_buf", ",", "0", ")", "if", ...
Validates the metadata to be populated.
[ "Validates", "the", "metadata", "to", "be", "populated", "." ]
[ "\"\"\"Validates the metadata to be populated.\"\"\"", "# Verify the number of SubgraphMetadata is exactly one.", "# TFLite currently only support one subgraph.", "# Verify if the number of tensor metadata matches the number of tensors." ]
[ { "param": "self", "type": null }, { "param": "metadata_buf", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "metadata_buf", "type": null, "docstring": null, "docstring_to...
15a677ddc6b9d8c5fcb3ef85b3078e6276b30033
sunlongbo/chromium
third_party/tflite_support/src/tensorflow_lite_support/metadata/python/metadata.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
with_model_file
<not_specific>
def with_model_file(cls, model_file): """Creates a MetadataDisplayer object for the model file. Args: model_file: valid path to a TensorFlow Lite model file. Returns: MetadataDisplayer object. Raises: IOError: File not found. ValueError: The model does not have metadata. "...
Creates a MetadataDisplayer object for the model file. Args: model_file: valid path to a TensorFlow Lite model file. Returns: MetadataDisplayer object. Raises: IOError: File not found. ValueError: The model does not have metadata.
Creates a MetadataDisplayer object for the model file.
[ "Creates", "a", "MetadataDisplayer", "object", "for", "the", "model", "file", "." ]
def with_model_file(cls, model_file): _assert_file_exist(model_file) with open(model_file, "rb") as f: return cls.with_model_buffer(f.read())
[ "def", "with_model_file", "(", "cls", ",", "model_file", ")", ":", "_assert_file_exist", "(", "model_file", ")", "with", "open", "(", "model_file", ",", "\"rb\"", ")", "as", "f", ":", "return", "cls", ".", "with_model_buffer", "(", "f", ".", "read", "(", ...
Creates a MetadataDisplayer object for the model file.
[ "Creates", "a", "MetadataDisplayer", "object", "for", "the", "model", "file", "." ]
[ "\"\"\"Creates a MetadataDisplayer object for the model file.\n\n Args:\n model_file: valid path to a TensorFlow Lite model file.\n\n Returns:\n MetadataDisplayer object.\n\n Raises:\n IOError: File not found.\n ValueError: The model does not have metadata.\n \"\"\"" ]
[ { "param": "cls", "type": null }, { "param": "model_file", "type": null } ]
{ "returns": [ { "docstring": null, "docstring_tokens": [ "None" ], "type": null } ], "raises": [ { "docstring": "File not found.", "docstring_tokens": [ "File", "not", "found", "." ], "type": "IOError" }, ...
15a677ddc6b9d8c5fcb3ef85b3078e6276b30033
sunlongbo/chromium
third_party/tflite_support/src/tensorflow_lite_support/metadata/python/metadata.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
with_model_buffer
<not_specific>
def with_model_buffer(cls, model_buffer): """Creates a MetadataDisplayer object for a file buffer. Args: model_buffer: TensorFlow Lite model buffer in bytearray. Returns: MetadataDisplayer object. """ if not model_buffer: raise ValueError("model_buffer cannot be empty.") meta...
Creates a MetadataDisplayer object for a file buffer. Args: model_buffer: TensorFlow Lite model buffer in bytearray. Returns: MetadataDisplayer object.
Creates a MetadataDisplayer object for a file buffer.
[ "Creates", "a", "MetadataDisplayer", "object", "for", "a", "file", "buffer", "." ]
def with_model_buffer(cls, model_buffer): if not model_buffer: raise ValueError("model_buffer cannot be empty.") metadata_buffer = cls._get_metadata_buffer(model_buffer) associated_file_list = cls._parse_packed_associted_file_list(model_buffer) return cls(model_buffer, metadata_buffer, associated_...
[ "def", "with_model_buffer", "(", "cls", ",", "model_buffer", ")", ":", "if", "not", "model_buffer", ":", "raise", "ValueError", "(", "\"model_buffer cannot be empty.\"", ")", "metadata_buffer", "=", "cls", ".", "_get_metadata_buffer", "(", "model_buffer", ")", "asso...
Creates a MetadataDisplayer object for a file buffer.
[ "Creates", "a", "MetadataDisplayer", "object", "for", "a", "file", "buffer", "." ]
[ "\"\"\"Creates a MetadataDisplayer object for a file buffer.\n\n Args:\n model_buffer: TensorFlow Lite model buffer in bytearray.\n\n Returns:\n MetadataDisplayer object.\n \"\"\"" ]
[ { "param": "cls", "type": null }, { "param": "model_buffer", "type": null } ]
{ "returns": [ { "docstring": null, "docstring_tokens": [ "None" ], "type": null } ], "raises": [], "params": [ { "identifier": "cls", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null ...
15a677ddc6b9d8c5fcb3ef85b3078e6276b30033
sunlongbo/chromium
third_party/tflite_support/src/tensorflow_lite_support/metadata/python/metadata.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
_get_metadata_buffer
<not_specific>
def _get_metadata_buffer(model_buf): """Returns the metadata in the model file as a buffer. Args: model_buf: valid buffer of the model file. Returns: Metadata buffer. Raises: ValueError: The model does not have metadata. """ tflite_model = _schema_fb.Model.GetRootAsModel(mod...
Returns the metadata in the model file as a buffer. Args: model_buf: valid buffer of the model file. Returns: Metadata buffer. Raises: ValueError: The model does not have metadata.
Returns the metadata in the model file as a buffer.
[ "Returns", "the", "metadata", "in", "the", "model", "file", "as", "a", "buffer", "." ]
def _get_metadata_buffer(model_buf): tflite_model = _schema_fb.Model.GetRootAsModel(model_buf, 0) for i in range(tflite_model.MetadataLength()): meta = tflite_model.Metadata(i) if meta.Name().decode("utf-8") == MetadataPopulator.METADATA_FIELD_NAME: buffer_index = meta.Buffer() metad...
[ "def", "_get_metadata_buffer", "(", "model_buf", ")", ":", "tflite_model", "=", "_schema_fb", ".", "Model", ".", "GetRootAsModel", "(", "model_buf", ",", "0", ")", "for", "i", "in", "range", "(", "tflite_model", ".", "MetadataLength", "(", ")", ")", ":", "...
Returns the metadata in the model file as a buffer.
[ "Returns", "the", "metadata", "in", "the", "model", "file", "as", "a", "buffer", "." ]
[ "\"\"\"Returns the metadata in the model file as a buffer.\n\n Args:\n model_buf: valid buffer of the model file.\n\n Returns:\n Metadata buffer.\n\n Raises:\n ValueError: The model does not have metadata.\n \"\"\"", "# Gets metadata from the model file." ]
[ { "param": "model_buf", "type": null } ]
{ "returns": [ { "docstring": null, "docstring_tokens": [ "None" ], "type": null } ], "raises": [ { "docstring": "The model does not have metadata.", "docstring_tokens": [ "The", "model", "does", "not", "have", ...
15a677ddc6b9d8c5fcb3ef85b3078e6276b30033
sunlongbo/chromium
third_party/tflite_support/src/tensorflow_lite_support/metadata/python/metadata.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
_parse_packed_associted_file_list
<not_specific>
def _parse_packed_associted_file_list(model_buf): """Gets a list of associated files packed to the model file. Args: model_buf: valid file buffer. Returns: List of packed associated files. """ try: with zipfile.ZipFile(io.BytesIO(model_buf)) as zf: return zf.namelist() ...
Gets a list of associated files packed to the model file. Args: model_buf: valid file buffer. Returns: List of packed associated files.
Gets a list of associated files packed to the model file.
[ "Gets", "a", "list", "of", "associated", "files", "packed", "to", "the", "model", "file", "." ]
def _parse_packed_associted_file_list(model_buf): try: with zipfile.ZipFile(io.BytesIO(model_buf)) as zf: return zf.namelist() except zipfile.BadZipFile: return []
[ "def", "_parse_packed_associted_file_list", "(", "model_buf", ")", ":", "try", ":", "with", "zipfile", ".", "ZipFile", "(", "io", ".", "BytesIO", "(", "model_buf", ")", ")", "as", "zf", ":", "return", "zf", ".", "namelist", "(", ")", "except", "zipfile", ...
Gets a list of associated files packed to the model file.
[ "Gets", "a", "list", "of", "associated", "files", "packed", "to", "the", "model", "file", "." ]
[ "\"\"\"Gets a list of associated files packed to the model file.\n\n Args:\n model_buf: valid file buffer.\n\n Returns:\n List of packed associated files.\n \"\"\"" ]
[ { "param": "model_buf", "type": null } ]
{ "returns": [ { "docstring": "List of packed associated files.", "docstring_tokens": [ "List", "of", "packed", "associated", "files", "." ], "type": null } ], "raises": [], "params": [ { "identifier": "model_buf", "...
15a677ddc6b9d8c5fcb3ef85b3078e6276b30033
sunlongbo/chromium
third_party/tflite_support/src/tensorflow_lite_support/metadata/python/metadata.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
_assert_model_file_identifier
null
def _assert_model_file_identifier(model_file): """Checks if a model file has the expected TFLite schema identifier.""" _assert_file_exist(model_file) with open(model_file, "rb") as f: _assert_model_buffer_identifier(f.read())
Checks if a model file has the expected TFLite schema identifier.
Checks if a model file has the expected TFLite schema identifier.
[ "Checks", "if", "a", "model", "file", "has", "the", "expected", "TFLite", "schema", "identifier", "." ]
def _assert_model_file_identifier(model_file): _assert_file_exist(model_file) with open(model_file, "rb") as f: _assert_model_buffer_identifier(f.read())
[ "def", "_assert_model_file_identifier", "(", "model_file", ")", ":", "_assert_file_exist", "(", "model_file", ")", "with", "open", "(", "model_file", ",", "\"rb\"", ")", "as", "f", ":", "_assert_model_buffer_identifier", "(", "f", ".", "read", "(", ")", ")" ]
Checks if a model file has the expected TFLite schema identifier.
[ "Checks", "if", "a", "model", "file", "has", "the", "expected", "TFLite", "schema", "identifier", "." ]
[ "\"\"\"Checks if a model file has the expected TFLite schema identifier.\"\"\"" ]
[ { "param": "model_file", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "model_file", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
15a677ddc6b9d8c5fcb3ef85b3078e6276b30033
sunlongbo/chromium
third_party/tflite_support/src/tensorflow_lite_support/metadata/python/metadata.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
_assert_metadata_buffer_identifier
null
def _assert_metadata_buffer_identifier(metadata_buf): """Checks if a metadata buffer has the expected Metadata schema identifier.""" if not _metadata_fb.ModelMetadata.ModelMetadataBufferHasIdentifier( metadata_buf, 0): raise ValueError( "The metadata buffer does not have the expected identifier, a...
Checks if a metadata buffer has the expected Metadata schema identifier.
Checks if a metadata buffer has the expected Metadata schema identifier.
[ "Checks", "if", "a", "metadata", "buffer", "has", "the", "expected", "Metadata", "schema", "identifier", "." ]
def _assert_metadata_buffer_identifier(metadata_buf): if not _metadata_fb.ModelMetadata.ModelMetadataBufferHasIdentifier( metadata_buf, 0): raise ValueError( "The metadata buffer does not have the expected identifier, and may not" " be a valid TFLite Metadata.")
[ "def", "_assert_metadata_buffer_identifier", "(", "metadata_buf", ")", ":", "if", "not", "_metadata_fb", ".", "ModelMetadata", ".", "ModelMetadataBufferHasIdentifier", "(", "metadata_buf", ",", "0", ")", ":", "raise", "ValueError", "(", "\"The metadata buffer does not hav...
Checks if a metadata buffer has the expected Metadata schema identifier.
[ "Checks", "if", "a", "metadata", "buffer", "has", "the", "expected", "Metadata", "schema", "identifier", "." ]
[ "\"\"\"Checks if a metadata buffer has the expected Metadata schema identifier.\"\"\"" ]
[ { "param": "metadata_buf", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "metadata_buf", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
15a86e50232d32e13d6b9e5d02332d4a39bb46e6
sunlongbo/chromium
testing/merge_scripts/code_coverage/merge_lib.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
_call_profdata_tool
<not_specific>
def _call_profdata_tool(profile_input_file_paths, profile_output_file_path, profdata_tool_path, sparse=False): """Calls the llvm-profdata tool. Args: profile_input_file_paths: A list of relative paths to the files that are to be me...
Calls the llvm-profdata tool. Args: profile_input_file_paths: A list of relative paths to the files that are to be merged. profile_output_file_path: The path to the merged file to write. profdata_tool_path: The path to the llvm-profdata executable. sparse (bool): flag to indicate whether to r...
Calls the llvm-profdata tool.
[ "Calls", "the", "llvm", "-", "profdata", "tool", "." ]
def _call_profdata_tool(profile_input_file_paths, profile_output_file_path, profdata_tool_path, sparse=False): try: subprocess_cmd = [ profdata_tool_path, 'merge', '-o', profile_output_file_path, ] if sparse: subprocess_...
[ "def", "_call_profdata_tool", "(", "profile_input_file_paths", ",", "profile_output_file_path", ",", "profdata_tool_path", ",", "sparse", "=", "False", ")", ":", "try", ":", "subprocess_cmd", "=", "[", "profdata_tool_path", ",", "'merge'", ",", "'-o'", ",", "profile...
Calls the llvm-profdata tool.
[ "Calls", "the", "llvm", "-", "profdata", "tool", "." ]
[ "\"\"\"Calls the llvm-profdata tool.\n\n Args:\n profile_input_file_paths: A list of relative paths to the files that\n are to be merged.\n profile_output_file_path: The path to the merged file to write.\n profdata_tool_path: The path to the llvm-profdata executable.\n sparse (bool): flag to ind...
[ { "param": "profile_input_file_paths", "type": null }, { "param": "profile_output_file_path", "type": null }, { "param": "profdata_tool_path", "type": null }, { "param": "sparse", "type": null } ]
{ "returns": [ { "docstring": "A list of paths to profiles that had to be excluded to get the merge to\nsucceed, suspected of being corrupted or malformed.", "docstring_tokens": [ "A", "list", "of", "paths", "to", "profiles", "that", "had...
15a86e50232d32e13d6b9e5d02332d4a39bb46e6
sunlongbo/chromium
testing/merge_scripts/code_coverage/merge_lib.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
_get_profile_paths
<not_specific>
def _get_profile_paths(input_dir, input_extension, input_filename_pattern='.*'): """Finds all the profiles in the given directory (recursively).""" paths = [] for dir_path, _sub_dirs, file_names in os.walk(input_dir): paths.extend([ os.path.join(dir_path, ...
Finds all the profiles in the given directory (recursively).
Finds all the profiles in the given directory (recursively).
[ "Finds", "all", "the", "profiles", "in", "the", "given", "directory", "(", "recursively", ")", "." ]
def _get_profile_paths(input_dir, input_extension, input_filename_pattern='.*'): paths = [] for dir_path, _sub_dirs, file_names in os.walk(input_dir): paths.extend([ os.path.join(dir_path, fn) for fn in file_names if fn.endswith(input_extensi...
[ "def", "_get_profile_paths", "(", "input_dir", ",", "input_extension", ",", "input_filename_pattern", "=", "'.*'", ")", ":", "paths", "=", "[", "]", "for", "dir_path", ",", "_sub_dirs", ",", "file_names", "in", "os", ".", "walk", "(", "input_dir", ")", ":", ...
Finds all the profiles in the given directory (recursively).
[ "Finds", "all", "the", "profiles", "in", "the", "given", "directory", "(", "recursively", ")", "." ]
[ "\"\"\"Finds all the profiles in the given directory (recursively).\"\"\"" ]
[ { "param": "input_dir", "type": null }, { "param": "input_extension", "type": null }, { "param": "input_filename_pattern", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "input_dir", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "input_extension", "type": null, "docstring": null, "docs...
15a86e50232d32e13d6b9e5d02332d4a39bb46e6
sunlongbo/chromium
testing/merge_scripts/code_coverage/merge_lib.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
_validate_and_convert_profraws
<not_specific>
def _validate_and_convert_profraws(profraw_files, profdata_tool_path, sparse=False): """Validates and converts profraws to profdatas. For each given .profraw file in the input, this method first validates it by trying to convert it to an index...
Validates and converts profraws to profdatas. For each given .profraw file in the input, this method first validates it by trying to convert it to an indexed .profdata file, and if the validation and conversion succeeds, the generated .profdata file will be included in the output, otherwise, won't. This met...
Validates and converts profraws to profdatas. For each given .profraw file in the input, this method first validates it by trying to convert it to an indexed .profdata file, and if the validation and conversion succeeds, the generated .profdata file will be included in the output, otherwise, won't. This method is main...
[ "Validates", "and", "converts", "profraws", "to", "profdatas", ".", "For", "each", "given", ".", "profraw", "file", "in", "the", "input", "this", "method", "first", "validates", "it", "by", "trying", "to", "convert", "it", "to", "an", "indexed", ".", "prof...
def _validate_and_convert_profraws(profraw_files, profdata_tool_path, sparse=False): for profraw_file in profraw_files: if not profraw_file.endswith('.profraw'): raise RuntimeError('%r is expected to be a .profraw file.' % profraw_file) ...
[ "def", "_validate_and_convert_profraws", "(", "profraw_files", ",", "profdata_tool_path", ",", "sparse", "=", "False", ")", ":", "for", "profraw_file", "in", "profraw_files", ":", "if", "not", "profraw_file", ".", "endswith", "(", "'.profraw'", ")", ":", "raise", ...
Validates and converts profraws to profdatas.
[ "Validates", "and", "converts", "profraws", "to", "profdatas", "." ]
[ "\"\"\"Validates and converts profraws to profdatas.\n\n For each given .profraw file in the input, this method first validates it by\n trying to convert it to an indexed .profdata file, and if the validation and\n conversion succeeds, the generated .profdata file will be included in the\n output, otherwise, wo...
[ { "param": "profraw_files", "type": null }, { "param": "profdata_tool_path", "type": null }, { "param": "sparse", "type": null } ]
{ "returns": [ { "docstring": "A tulple:\nA list of converted .profdata files of *valid* profraw files.\nA list of *invalid* profraw files.\nA list of profraw files that have counter overflows.", "docstring_tokens": [ "A", "tulple", ":", "A", "list", "of...
15a86e50232d32e13d6b9e5d02332d4a39bb46e6
sunlongbo/chromium
testing/merge_scripts/code_coverage/merge_lib.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
merge_java_exec_files
<not_specific>
def merge_java_exec_files(input_dir, output_path, jacococli_path): """Merges generated .exec files to output_path. Args: input_dir (str): The path to traverse to find input files. output_path (str): Where to write the merged .exec file. jacococli_path: The path to jacococli.jar. Raises: CalledPr...
Merges generated .exec files to output_path. Args: input_dir (str): The path to traverse to find input files. output_path (str): Where to write the merged .exec file. jacococli_path: The path to jacococli.jar. Raises: CalledProcessError: merge command failed.
Merges generated .exec files to output_path.
[ "Merges", "generated", ".", "exec", "files", "to", "output_path", "." ]
def merge_java_exec_files(input_dir, output_path, jacococli_path): exec_input_file_paths = _get_profile_paths(input_dir, '.exec') if not exec_input_file_paths: logging.info('No exec file found under %s', input_dir) return cmd = [_JAVA_PATH, '-jar', jacococli_path, 'merge'] cmd.extend(exec_input_file_pat...
[ "def", "merge_java_exec_files", "(", "input_dir", ",", "output_path", ",", "jacococli_path", ")", ":", "exec_input_file_paths", "=", "_get_profile_paths", "(", "input_dir", ",", "'.exec'", ")", "if", "not", "exec_input_file_paths", ":", "logging", ".", "info", "(", ...
Merges generated .exec files to output_path.
[ "Merges", "generated", ".", "exec", "files", "to", "output_path", "." ]
[ "\"\"\"Merges generated .exec files to output_path.\n\n Args:\n input_dir (str): The path to traverse to find input files.\n output_path (str): Where to write the merged .exec file.\n jacococli_path: The path to jacococli.jar.\n\n Raises:\n CalledProcessError: merge command failed.\n \"\"\"" ]
[ { "param": "input_dir", "type": null }, { "param": "output_path", "type": null }, { "param": "jacococli_path", "type": null } ]
{ "returns": [], "raises": [ { "docstring": "merge command failed.", "docstring_tokens": [ "merge", "command", "failed", "." ], "type": "CalledProcessError" } ], "params": [ { "identifier": "input_dir", "type": null, "docstrin...
15a86e50232d32e13d6b9e5d02332d4a39bb46e6
sunlongbo/chromium
testing/merge_scripts/code_coverage/merge_lib.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
merge_profiles
<not_specific>
def merge_profiles(input_dir, output_file, input_extension, profdata_tool_path, input_filename_pattern='.*', sparse=False, skip_validation=False): """Merges the profiles produced by the shards using llvm-...
Merges the profiles produced by the shards using llvm-profdata. Args: input_dir (str): The path to traverse to find input profiles. output_file (str): Where to write the merged profile. input_extension (str): File extension to look for in the input_dir. e.g. '.profdata' or '.profraw' profdata...
Merges the profiles produced by the shards using llvm-profdata.
[ "Merges", "the", "profiles", "produced", "by", "the", "shards", "using", "llvm", "-", "profdata", "." ]
def merge_profiles(input_dir, output_file, input_extension, profdata_tool_path, input_filename_pattern='.*', sparse=False, skip_validation=False): profile_input_file_paths = _get_profile_paths(input_dir, ...
[ "def", "merge_profiles", "(", "input_dir", ",", "output_file", ",", "input_extension", ",", "profdata_tool_path", ",", "input_filename_pattern", "=", "'.*'", ",", "sparse", "=", "False", ",", "skip_validation", "=", "False", ")", ":", "profile_input_file_paths", "="...
Merges the profiles produced by the shards using llvm-profdata.
[ "Merges", "the", "profiles", "produced", "by", "the", "shards", "using", "llvm", "-", "profdata", "." ]
[ "\"\"\"Merges the profiles produced by the shards using llvm-profdata.\n\n Args:\n input_dir (str): The path to traverse to find input profiles.\n output_file (str): Where to write the merged profile.\n input_extension (str): File extension to look for in the input_dir.\n e.g. '.profdata' or '.prof...
[ { "param": "input_dir", "type": null }, { "param": "output_file", "type": null }, { "param": "input_extension", "type": null }, { "param": "profdata_tool_path", "type": null }, { "param": "input_filename_pattern", "type": null }, { "param": "sparse", ...
{ "returns": [ { "docstring": "The list of profiles that had to be excluded to get the merge to\nsucceed and a list of profiles that had a counter overflow.", "docstring_tokens": [ "The", "list", "of", "profiles", "that", "had", "to", "be...
15b1e5ee0bdf5b495954863b5a71408417e5ab84
sunlongbo/chromium
tools/metrics/common/pretty_print_xml.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
LastLineLength
<not_specific>
def LastLineLength(s): """Returns the length of the last line in s. Args: s: A multi-line string, including newlines. Returns: The length of the last line in s, in characters. """ if s.rfind('\n') == -1: return len(s) return len(s) - s.rfind('\n') - len('\n')
Returns the length of the last line in s. Args: s: A multi-line string, including newlines. Returns: The length of the last line in s, in characters.
Returns the length of the last line in s.
[ "Returns", "the", "length", "of", "the", "last", "line", "in", "s", "." ]
def LastLineLength(s): if s.rfind('\n') == -1: return len(s) return len(s) - s.rfind('\n') - len('\n')
[ "def", "LastLineLength", "(", "s", ")", ":", "if", "s", ".", "rfind", "(", "'\\n'", ")", "==", "-", "1", ":", "return", "len", "(", "s", ")", "return", "len", "(", "s", ")", "-", "s", ".", "rfind", "(", "'\\n'", ")", "-", "len", "(", "'\\n'",...
Returns the length of the last line in s.
[ "Returns", "the", "length", "of", "the", "last", "line", "in", "s", "." ]
[ "\"\"\"Returns the length of the last line in s.\n\n Args:\n s: A multi-line string, including newlines.\n\n Returns:\n The length of the last line in s, in characters.\n \"\"\"" ]
[ { "param": "s", "type": null } ]
{ "returns": [ { "docstring": "The length of the last line in s, in characters.", "docstring_tokens": [ "The", "length", "of", "the", "last", "line", "in", "s", "in", "characters", "." ], "type": null ...
15b1e5ee0bdf5b495954863b5a71408417e5ab84
sunlongbo/chromium
tools/metrics/common/pretty_print_xml.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
SplitParagraphs
<not_specific>
def SplitParagraphs(text): """Split a block of text into paragraphs. Args: text: The text to split. Returns: A list of paragraphs as strings. """ text = textwrap.dedent(text.strip('\n')) lines = text.split('\n') # Split the text into paragraphs at blank line boundaries. paragraphs = [[]] for...
Split a block of text into paragraphs. Args: text: The text to split. Returns: A list of paragraphs as strings.
Split a block of text into paragraphs.
[ "Split", "a", "block", "of", "text", "into", "paragraphs", "." ]
def SplitParagraphs(text): text = textwrap.dedent(text.strip('\n')) lines = text.split('\n') paragraphs = [[]] for l in lines: if paragraphs[-1] and not l.strip(): paragraphs.append([]) else: transformed_line = ' '.join(l.split()) paragraphs[-1].append(transformed_line) if paragraphs...
[ "def", "SplitParagraphs", "(", "text", ")", ":", "text", "=", "textwrap", ".", "dedent", "(", "text", ".", "strip", "(", "'\\n'", ")", ")", "lines", "=", "text", ".", "split", "(", "'\\n'", ")", "paragraphs", "=", "[", "[", "]", "]", "for", "l", ...
Split a block of text into paragraphs.
[ "Split", "a", "block", "of", "text", "into", "paragraphs", "." ]
[ "\"\"\"Split a block of text into paragraphs.\n\n Args:\n text: The text to split.\n\n Returns:\n A list of paragraphs as strings.\n \"\"\"", "# Split the text into paragraphs at blank line boundaries.", "# Replace runs of repeated whitespace with a single space.", "# Remove trailing empty paragraph ...
[ { "param": "text", "type": null } ]
{ "returns": [ { "docstring": "A list of paragraphs as strings.", "docstring_tokens": [ "A", "list", "of", "paragraphs", "as", "strings", "." ], "type": null } ], "raises": [], "params": [ { "identifier": "text", ...
15b1e5ee0bdf5b495954863b5a71408417e5ab84
sunlongbo/chromium
tools/metrics/common/pretty_print_xml.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
_PrettyPrintMinidom
<not_specific>
def _PrettyPrintMinidom(self, doc): """Transforms minidom to ElementTree before pretty printing it.""" raw_xml = doc.toxml() # minidom prepends a document type, so remove it. raw_xml = raw_xml.replace(minidom.Document().toxml(), '') etree_root = etree_util.ParseXMLString(raw_xml) top_content =...
Transforms minidom to ElementTree before pretty printing it.
Transforms minidom to ElementTree before pretty printing it.
[ "Transforms", "minidom", "to", "ElementTree", "before", "pretty", "printing", "it", "." ]
def _PrettyPrintMinidom(self, doc): raw_xml = doc.toxml() raw_xml = raw_xml.replace(minidom.Document().toxml(), '') etree_root = etree_util.ParseXMLString(raw_xml) top_content = etree_util.GetTopLevelContent(raw_xml) top_content = top_content.replace('--><!--', '-->\n\n<!--') formatted_xml = sel...
[ "def", "_PrettyPrintMinidom", "(", "self", ",", "doc", ")", ":", "raw_xml", "=", "doc", ".", "toxml", "(", ")", "raw_xml", "=", "raw_xml", ".", "replace", "(", "minidom", ".", "Document", "(", ")", ".", "toxml", "(", ")", ",", "''", ")", "etree_root"...
Transforms minidom to ElementTree before pretty printing it.
[ "Transforms", "minidom", "to", "ElementTree", "before", "pretty", "printing", "it", "." ]
[ "\"\"\"Transforms minidom to ElementTree before pretty printing it.\"\"\"", "# minidom prepends a document type, so remove it.", "# Add newlines between top-level comments." ]
[ { "param": "self", "type": null }, { "param": "doc", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "doc", "type": null, "docstring": null, "docstring_tokens": []...
15b1e5ee0bdf5b495954863b5a71408417e5ab84
sunlongbo/chromium
tools/metrics/common/pretty_print_xml.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
_TransformByAlphabetizing
<not_specific>
def _TransformByAlphabetizing(self, node): """Transform the given XML by alphabetizing nodes. Args: node: The elementtree node to transform. Returns: The elementtree node, with children appropriately alphabetized. Note that the transformation is done in-place, i.e. the original tree is m...
Transform the given XML by alphabetizing nodes. Args: node: The elementtree node to transform. Returns: The elementtree node, with children appropriately alphabetized. Note that the transformation is done in-place, i.e. the original tree is modified directly.
Transform the given XML by alphabetizing nodes.
[ "Transform", "the", "given", "XML", "by", "alphabetizing", "nodes", "." ]
def _TransformByAlphabetizing(self, node): alpha_rules = self.tags_alphabetization_rules if node.tag in alpha_rules: subtags = {} for index, (subtag, key_function) in enumerate(alpha_rules[node.tag]): subtags[subtag] = (index, key_function) subnodes = [] sort_key = -1 pendi...
[ "def", "_TransformByAlphabetizing", "(", "self", ",", "node", ")", ":", "alpha_rules", "=", "self", ".", "tags_alphabetization_rules", "if", "node", ".", "tag", "in", "alpha_rules", ":", "subtags", "=", "{", "}", "for", "index", ",", "(", "subtag", ",", "k...
Transform the given XML by alphabetizing nodes.
[ "Transform", "the", "given", "XML", "by", "alphabetizing", "nodes", "." ]
[ "\"\"\"Transform the given XML by alphabetizing nodes.\n\n Args:\n node: The elementtree node to transform.\n\n Returns:\n The elementtree node, with children appropriately alphabetized. Note that\n the transformation is done in-place, i.e. the original tree is modified\n directly.\n \"...
[ { "param": "self", "type": null }, { "param": "node", "type": null } ]
{ "returns": [ { "docstring": "The elementtree node, with children appropriately alphabetized. Note that\nthe transformation is done in-place, i.e. the original tree is modified\ndirectly.", "docstring_tokens": [ "The", "elementtree", "node", "with", "children",...
15b1e5ee0bdf5b495954863b5a71408417e5ab84
sunlongbo/chromium
tools/metrics/common/pretty_print_xml.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
PrettyPrintElementTreeNode
<not_specific>
def PrettyPrintElementTreeNode(self, node, indent=0): """Pretty-prints the given XML node at the given indent level. Args: node: The ElementTree node to pretty-print. indent: The current indent level. Returns: The pretty-printed string (including embedded newlines). Raises: Er...
Pretty-prints the given XML node at the given indent level. Args: node: The ElementTree node to pretty-print. indent: The current indent level. Returns: The pretty-printed string (including embedded newlines). Raises: Error: if the XML has unknown tags or attributes.
Pretty-prints the given XML node at the given indent level.
[ "Pretty", "-", "prints", "the", "given", "XML", "node", "at", "the", "given", "indent", "level", "." ]
def PrettyPrintElementTreeNode(self, node, indent=0): if node.tag is ET.Comment: return '<!--%s-->\n' % node.text return self._PrettyPrintElement(node, indent)
[ "def", "PrettyPrintElementTreeNode", "(", "self", ",", "node", ",", "indent", "=", "0", ")", ":", "if", "node", ".", "tag", "is", "ET", ".", "Comment", ":", "return", "'<!--%s-->\\n'", "%", "node", ".", "text", "return", "self", ".", "_PrettyPrintElement",...
Pretty-prints the given XML node at the given indent level.
[ "Pretty", "-", "prints", "the", "given", "XML", "node", "at", "the", "given", "indent", "level", "." ]
[ "\"\"\"Pretty-prints the given XML node at the given indent level.\n\n Args:\n node: The ElementTree node to pretty-print.\n indent: The current indent level.\n\n Returns:\n The pretty-printed string (including embedded newlines).\n\n Raises:\n Error: if the XML has unknown tags or attr...
[ { "param": "self", "type": null }, { "param": "node", "type": null }, { "param": "indent", "type": null } ]
{ "returns": [ { "docstring": "The pretty-printed string (including embedded newlines).", "docstring_tokens": [ "The", "pretty", "-", "printed", "string", "(", "including", "embedded", "newlines", ")", "." ],...
e5d4ed4343c1d7f85bb5f37e012190a9fd7f6684
sunlongbo/chromium
content/test/gpu/gpu_tests/gpu_process_integration_test.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
_GetBrowserBridgeProperty
<not_specific>
def _GetBrowserBridgeProperty(tab, path): """The GPU WebUI uses JS modules and may not have initialized the global browserBridge object by the time we can start injecting JavaScript. This ensures we don't have that problem.""" tab.WaitForJavaScriptCondition('window.gpuPagePopulated', ...
The GPU WebUI uses JS modules and may not have initialized the global browserBridge object by the time we can start injecting JavaScript. This ensures we don't have that problem.
The GPU WebUI uses JS modules and may not have initialized the global browserBridge object by the time we can start injecting JavaScript. This ensures we don't have that problem.
[ "The", "GPU", "WebUI", "uses", "JS", "modules", "and", "may", "not", "have", "initialized", "the", "global", "browserBridge", "object", "by", "the", "time", "we", "can", "start", "injecting", "JavaScript", ".", "This", "ensures", "we", "don", "'", "t", "ha...
def _GetBrowserBridgeProperty(tab, path): tab.WaitForJavaScriptCondition('window.gpuPagePopulated', timeout=_GPU_PAGE_TIMEOUT) return tab.EvaluateJavaScript('browserBridge.' + path)
[ "def", "_GetBrowserBridgeProperty", "(", "tab", ",", "path", ")", ":", "tab", ".", "WaitForJavaScriptCondition", "(", "'window.gpuPagePopulated'", ",", "timeout", "=", "_GPU_PAGE_TIMEOUT", ")", "return", "tab", ".", "EvaluateJavaScript", "(", "'browserBridge.'", "+", ...
The GPU WebUI uses JS modules and may not have initialized the global browserBridge object by the time we can start injecting JavaScript.
[ "The", "GPU", "WebUI", "uses", "JS", "modules", "and", "may", "not", "have", "initialized", "the", "global", "browserBridge", "object", "by", "the", "time", "we", "can", "start", "injecting", "JavaScript", "." ]
[ "\"\"\"The GPU WebUI uses JS modules and may not have initialized the global\n browserBridge object by the time we can start injecting JavaScript. This\n ensures we don't have that problem.\"\"\"" ]
[ { "param": "tab", "type": null }, { "param": "path", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "tab", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "path", "type": null, "docstring": null, "docstring_tokens": []...
e5d4ed4343c1d7f85bb5f37e012190a9fd7f6684
sunlongbo/chromium
content/test/gpu/gpu_tests/gpu_process_integration_test.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
GenerateBrowserArgs
<not_specific>
def GenerateBrowserArgs(cls, additional_args): """Adds default arguments to |additional_args|. See the parent class' method documentation for additional information. """ default_args = super(GpuProcessIntegrationTest, cls).GenerateBrowserArgs(additional_args) default_args.e...
Adds default arguments to |additional_args|. See the parent class' method documentation for additional information.
Adds default arguments to |additional_args|. See the parent class' method documentation for additional information.
[ "Adds", "default", "arguments", "to", "|additional_args|", ".", "See", "the", "parent", "class", "'", "method", "documentation", "for", "additional", "information", "." ]
def GenerateBrowserArgs(cls, additional_args): default_args = super(GpuProcessIntegrationTest, cls).GenerateBrowserArgs(additional_args) default_args.extend([ cba.ENABLE_GPU_BENCHMARKING, '--no-first-run', cba.DISABLE_DEVICE_DISCOVERY_NOTIFICATIONS, ]) re...
[ "def", "GenerateBrowserArgs", "(", "cls", ",", "additional_args", ")", ":", "default_args", "=", "super", "(", "GpuProcessIntegrationTest", ",", "cls", ")", ".", "GenerateBrowserArgs", "(", "additional_args", ")", "default_args", ".", "extend", "(", "[", "cba", ...
Adds default arguments to |additional_args|.
[ "Adds", "default", "arguments", "to", "|additional_args|", "." ]
[ "\"\"\"Adds default arguments to |additional_args|.\n\n See the parent class' method documentation for additional information.\n \"\"\"", "# TODO(kbr): figure out why the following option seems to be", "# needed on Android for robustness.", "# https://github.com/catapult-project/catapult/issues/3122", ...
[ { "param": "cls", "type": null }, { "param": "additional_args", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "cls", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "additional_args", "type": null, "docstring": null, "docstring_...
85a65b28577eb696e3f35b11dd36a7a752bc6ccb
sunlongbo/chromium
testing/xvfb.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
kill
<not_specific>
def kill(proc, name, timeout_in_seconds=10): """Tries to kill |proc| gracefully with a timeout for each signal.""" if not proc: return proc.terminate() thread = threading.Thread(target=proc.wait) thread.start() thread.join(timeout_in_seconds) if thread.is_alive(): print('%s running after SIGTERM...
Tries to kill |proc| gracefully with a timeout for each signal.
Tries to kill |proc| gracefully with a timeout for each signal.
[ "Tries", "to", "kill", "|proc|", "gracefully", "with", "a", "timeout", "for", "each", "signal", "." ]
def kill(proc, name, timeout_in_seconds=10): if not proc: return proc.terminate() thread = threading.Thread(target=proc.wait) thread.start() thread.join(timeout_in_seconds) if thread.is_alive(): print('%s running after SIGTERM, trying SIGKILL.\n' % name, file=sys.stderr) proc.kill() thread.joi...
[ "def", "kill", "(", "proc", ",", "name", ",", "timeout_in_seconds", "=", "10", ")", ":", "if", "not", "proc", ":", "return", "proc", ".", "terminate", "(", ")", "thread", "=", "threading", ".", "Thread", "(", "target", "=", "proc", ".", "wait", ")", ...
Tries to kill |proc| gracefully with a timeout for each signal.
[ "Tries", "to", "kill", "|proc|", "gracefully", "with", "a", "timeout", "for", "each", "signal", "." ]
[ "\"\"\"Tries to kill |proc| gracefully with a timeout for each signal.\"\"\"" ]
[ { "param": "proc", "type": null }, { "param": "name", "type": null }, { "param": "timeout_in_seconds", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "proc", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "name", "type": null, "docstring": null, "docstring_tokens": [...
85a65b28577eb696e3f35b11dd36a7a752bc6ccb
sunlongbo/chromium
testing/xvfb.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
launch_dbus
<not_specific>
def launch_dbus(env): """Starts a DBus session. Works around a bug in GLib where it performs operations which aren't async-signal-safe (in particular, memory allocations) between fork and exec when it spawns subprocesses. This causes threads inside Chrome's browser and utility processes to get stuck, and thi...
Starts a DBus session. Works around a bug in GLib where it performs operations which aren't async-signal-safe (in particular, memory allocations) between fork and exec when it spawns subprocesses. This causes threads inside Chrome's browser and utility processes to get stuck, and this harness to hang waiting f...
Starts a DBus session. Works around a bug in GLib where it performs operations which aren't async-signal-safe (in particular, memory allocations) between fork and exec when it spawns subprocesses. This causes threads inside Chrome's browser and utility processes to get stuck, and this harness to hang waiting for those ...
[ "Starts", "a", "DBus", "session", ".", "Works", "around", "a", "bug", "in", "GLib", "where", "it", "performs", "operations", "which", "aren", "'", "t", "async", "-", "signal", "-", "safe", "(", "in", "particular", "memory", "allocations", ")", "between", ...
def launch_dbus(env): if 'DBUS_SESSION_BUS_ADDRESS' in os.environ: return try: dbus_output = subprocess.check_output( ['dbus-launch'], env=env).decode('utf-8').split('\n') for line in dbus_output: m = re.match(r'([^=]+)\=(.+)', line) if m: env[m.group(1)] = m.group(2) ret...
[ "def", "launch_dbus", "(", "env", ")", ":", "if", "'DBUS_SESSION_BUS_ADDRESS'", "in", "os", ".", "environ", ":", "return", "try", ":", "dbus_output", "=", "subprocess", ".", "check_output", "(", "[", "'dbus-launch'", "]", ",", "env", "=", "env", ")", ".", ...
Starts a DBus session.
[ "Starts", "a", "DBus", "session", "." ]
[ "\"\"\"Starts a DBus session.\n\n Works around a bug in GLib where it performs operations which aren't\n async-signal-safe (in particular, memory allocations) between fork and exec\n when it spawns subprocesses. This causes threads inside Chrome's browser and\n utility processes to get stuck, and this harness t...
[ { "param": "env", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "env", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
85a65b28577eb696e3f35b11dd36a7a752bc6ccb
sunlongbo/chromium
testing/xvfb.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
run_executable
<not_specific>
def run_executable( cmd, env, stdoutfile=None, use_openbox=True, use_xcompmgr=True): """Runs an executable within Weston or Xvfb on Linux or normally on other platforms. The method sets SIGUSR1 handler for Xvfb to return SIGUSR1 when it is ready for connections. https://www.x.org/archive/X11R7.5/doc/m...
Runs an executable within Weston or Xvfb on Linux or normally on other platforms. The method sets SIGUSR1 handler for Xvfb to return SIGUSR1 when it is ready for connections. https://www.x.org/archive/X11R7.5/doc/man/man1/Xserver.1.html under Signals. Args: cmd: Command to be executed. env: A cop...
Runs an executable within Weston or Xvfb on Linux or normally on other platforms. The method sets SIGUSR1 handler for Xvfb to return SIGUSR1 when it is ready for connections.
[ "Runs", "an", "executable", "within", "Weston", "or", "Xvfb", "on", "Linux", "or", "normally", "on", "other", "platforms", ".", "The", "method", "sets", "SIGUSR1", "handler", "for", "Xvfb", "to", "return", "SIGUSR1", "when", "it", "is", "ready", "for", "co...
def run_executable( cmd, env, stdoutfile=None, use_openbox=True, use_xcompmgr=True): use_xvfb = True if '--no-xvfb' in cmd: use_xvfb = False cmd.remove('--no-xvfb') use_weston = False if '--use-weston' in cmd: if use_xvfb: print('Unable to use Weston with xvfb.\n', file=sys.stderr) r...
[ "def", "run_executable", "(", "cmd", ",", "env", ",", "stdoutfile", "=", "None", ",", "use_openbox", "=", "True", ",", "use_xcompmgr", "=", "True", ")", ":", "use_xvfb", "=", "True", "if", "'--no-xvfb'", "in", "cmd", ":", "use_xvfb", "=", "False", "cmd",...
Runs an executable within Weston or Xvfb on Linux or normally on other platforms.
[ "Runs", "an", "executable", "within", "Weston", "or", "Xvfb", "on", "Linux", "or", "normally", "on", "other", "platforms", "." ]
[ "\"\"\"Runs an executable within Weston or Xvfb on Linux or normally on other\n platforms.\n\n The method sets SIGUSR1 handler for Xvfb to return SIGUSR1\n when it is ready for connections.\n https://www.x.org/archive/X11R7.5/doc/man/man1/Xserver.1.html under Signals.\n\n Args:\n cmd: Command to be execu...
[ { "param": "cmd", "type": null }, { "param": "env", "type": null }, { "param": "stdoutfile", "type": null }, { "param": "use_openbox", "type": null }, { "param": "use_xcompmgr", "type": null } ]
{ "returns": [ { "docstring": "the exit code of the specified commandline, or 1 on failure.", "docstring_tokens": [ "the", "exit", "code", "of", "the", "specified", "commandline", "or", "1", "on", "failure", ...
85a65b28577eb696e3f35b11dd36a7a752bc6ccb
sunlongbo/chromium
testing/xvfb.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
_get_display_from_weston
<not_specific>
def _get_display_from_weston(weston_proc_pid): """Retrieves $WAYLAND_DISPLAY set by Weston. Searches for the child "weston-desktop-shell" process, takes its environmental variables, and returns $WAYLAND_DISPLAY variable set by that process. If the variable is not set, tries up to 10 times and then gives up. ...
Retrieves $WAYLAND_DISPLAY set by Weston. Searches for the child "weston-desktop-shell" process, takes its environmental variables, and returns $WAYLAND_DISPLAY variable set by that process. If the variable is not set, tries up to 10 times and then gives up. Args: weston_proc_pid: The process of id of t...
Retrieves $WAYLAND_DISPLAY set by Weston. Searches for the child "weston-desktop-shell" process, takes its environmental variables, and returns $WAYLAND_DISPLAY variable set by that process. If the variable is not set, tries up to 10 times and then gives up.
[ "Retrieves", "$WAYLAND_DISPLAY", "set", "by", "Weston", ".", "Searches", "for", "the", "child", "\"", "weston", "-", "desktop", "-", "shell", "\"", "process", "takes", "its", "environmental", "variables", "and", "returns", "$WAYLAND_DISPLAY", "variable", "set", ...
def _get_display_from_weston(weston_proc_pid): for _ in range(100): time.sleep(.05) parent = psutil.Process(weston_proc_pid) if parent is None: break children = parent.children(recursive=True) for process in children: if process.name() == "weston-desktop-shell": weston_proc_di...
[ "def", "_get_display_from_weston", "(", "weston_proc_pid", ")", ":", "for", "_", "in", "range", "(", "100", ")", ":", "time", ".", "sleep", "(", ".05", ")", "parent", "=", "psutil", ".", "Process", "(", "weston_proc_pid", ")", "if", "parent", "is", "None...
Retrieves $WAYLAND_DISPLAY set by Weston.
[ "Retrieves", "$WAYLAND_DISPLAY", "set", "by", "Weston", "." ]
[ "\"\"\"Retrieves $WAYLAND_DISPLAY set by Weston.\n\n Searches for the child \"weston-desktop-shell\" process, takes its\n environmental variables, and returns $WAYLAND_DISPLAY variable set\n by that process. If the variable is not set, tries up to 10 times\n and then gives up.\n\n Args:\n weston_proc_pid: T...
[ { "param": "weston_proc_pid", "type": null } ]
{ "returns": [ { "docstring": "the display set by Wayland, which clients can use to connect to.", "docstring_tokens": [ "the", "display", "set", "by", "Wayland", "which", "clients", "can", "use", "to", "connect", ...
85a65b28577eb696e3f35b11dd36a7a752bc6ccb
sunlongbo/chromium
testing/xvfb.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
_set_xdg_runtime_dir
null
def _set_xdg_runtime_dir(env): """Sets the $XDG_RUNTIME_DIR variable if it hasn't been set before.""" runtime_dir = env.get('XDG_RUNTIME_DIR') if not runtime_dir: runtime_dir = '/tmp/xdg-tmp-dir/' if not os.path.exists(runtime_dir): os.makedirs(runtime_dir, 0o700) env['XDG_RUNTIME_DIR'] = runtim...
Sets the $XDG_RUNTIME_DIR variable if it hasn't been set before.
Sets the $XDG_RUNTIME_DIR variable if it hasn't been set before.
[ "Sets", "the", "$XDG_RUNTIME_DIR", "variable", "if", "it", "hasn", "'", "t", "been", "set", "before", "." ]
def _set_xdg_runtime_dir(env): runtime_dir = env.get('XDG_RUNTIME_DIR') if not runtime_dir: runtime_dir = '/tmp/xdg-tmp-dir/' if not os.path.exists(runtime_dir): os.makedirs(runtime_dir, 0o700) env['XDG_RUNTIME_DIR'] = runtime_dir
[ "def", "_set_xdg_runtime_dir", "(", "env", ")", ":", "runtime_dir", "=", "env", ".", "get", "(", "'XDG_RUNTIME_DIR'", ")", "if", "not", "runtime_dir", ":", "runtime_dir", "=", "'/tmp/xdg-tmp-dir/'", "if", "not", "os", ".", "path", ".", "exists", "(", "runtim...
Sets the $XDG_RUNTIME_DIR variable if it hasn't been set before.
[ "Sets", "the", "$XDG_RUNTIME_DIR", "variable", "if", "it", "hasn", "'", "t", "been", "set", "before", "." ]
[ "\"\"\"Sets the $XDG_RUNTIME_DIR variable if it hasn't been set before.\"\"\"" ]
[ { "param": "env", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "env", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
cfc863778a67e140cdfe183569882cceb34b323b
sunlongbo/chromium
mojo/public/tools/mojom/mojom/parse/parser.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
p_handletype
null
def p_handletype(self, p): """handletype : HANDLE | HANDLE LANGLE NAME RANGLE""" if len(p) == 2: p[0] = p[1] else: if p[3] not in ('data_pipe_consumer', 'data_pipe_producer', 'message_pipe', 'shared_buffer', 'platform'): # Note: We don't enable tra...
handletype : HANDLE | HANDLE LANGLE NAME RANGLE
handletype : HANDLE | HANDLE LANGLE NAME RANGLE
[ "handletype", ":", "HANDLE", "|", "HANDLE", "LANGLE", "NAME", "RANGLE" ]
def p_handletype(self, p): if len(p) == 2: p[0] = p[1] else: if p[3] not in ('data_pipe_consumer', 'data_pipe_producer', 'message_pipe', 'shared_buffer', 'platform'): raise ParseError( self.filename, "Invalid handle type %r:" % p[3], ...
[ "def", "p_handletype", "(", "self", ",", "p", ")", ":", "if", "len", "(", "p", ")", "==", "2", ":", "p", "[", "0", "]", "=", "p", "[", "1", "]", "else", ":", "if", "p", "[", "3", "]", "not", "in", "(", "'data_pipe_consumer'", ",", "'data_pipe...
handletype : HANDLE | HANDLE LANGLE NAME RANGLE
[ "handletype", ":", "HANDLE", "|", "HANDLE", "LANGLE", "NAME", "RANGLE" ]
[ "\"\"\"handletype : HANDLE\n | HANDLE LANGLE NAME RANGLE\"\"\"", "# Note: We don't enable tracking of line numbers for everything, so we", "# can't use |p.lineno(3)|." ]
[ { "param": "self", "type": null }, { "param": "p", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "p", "type": null, "docstring": null, "docstring_tokens": [], ...
cfc863778a67e140cdfe183569882cceb34b323b
sunlongbo/chromium
mojo/public/tools/mojom/mojom/parse/parser.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
p_fixed_array
null
def p_fixed_array(self, p): """fixed_array : ARRAY LANGLE typename COMMA INT_CONST_DEC RANGLE""" value = int(p[5]) if value == 0 or value > _MAX_ARRAY_SIZE: raise ParseError( self.filename, "Fixed array size %d invalid:" % value, lineno=p.lineno(5), snippet=self...
fixed_array : ARRAY LANGLE typename COMMA INT_CONST_DEC RANGLE
fixed_array : ARRAY LANGLE typename COMMA INT_CONST_DEC RANGLE
[ "fixed_array", ":", "ARRAY", "LANGLE", "typename", "COMMA", "INT_CONST_DEC", "RANGLE" ]
def p_fixed_array(self, p): value = int(p[5]) if value == 0 or value > _MAX_ARRAY_SIZE: raise ParseError( self.filename, "Fixed array size %d invalid:" % value, lineno=p.lineno(5), snippet=self._GetSnippet(p.lineno(5))) p[0] = p[3] + "[" + p[5] + "]"
[ "def", "p_fixed_array", "(", "self", ",", "p", ")", ":", "value", "=", "int", "(", "p", "[", "5", "]", ")", "if", "value", "==", "0", "or", "value", ">", "_MAX_ARRAY_SIZE", ":", "raise", "ParseError", "(", "self", ".", "filename", ",", "\"Fixed array...
fixed_array : ARRAY LANGLE typename COMMA INT_CONST_DEC RANGLE
[ "fixed_array", ":", "ARRAY", "LANGLE", "typename", "COMMA", "INT_CONST_DEC", "RANGLE" ]
[ "\"\"\"fixed_array : ARRAY LANGLE typename COMMA INT_CONST_DEC RANGLE\"\"\"" ]
[ { "param": "self", "type": null }, { "param": "p", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "p", "type": null, "docstring": null, "docstring_tokens": [], ...
89dde70a349eeb0f1014de156e86052c9a0a4db5
sunlongbo/chromium
tools/bisect_repackage/bisect_repackage.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
create_cp_from_hash_map
<not_specific>
def create_cp_from_hash_map(hash_list): """Returns dict used for conversion of hash list. Creates a dictionary that maps from Commit position number to corresponding GitHash. """ hash_map = {} for git_hash in hash_list: try: cp_num = get_cp_from_hash(git_hash) hash_map[cp_num] = git_hash ...
Returns dict used for conversion of hash list. Creates a dictionary that maps from Commit position number to corresponding GitHash.
Returns dict used for conversion of hash list. Creates a dictionary that maps from Commit position number to corresponding GitHash.
[ "Returns", "dict", "used", "for", "conversion", "of", "hash", "list", ".", "Creates", "a", "dictionary", "that", "maps", "from", "Commit", "position", "number", "to", "corresponding", "GitHash", "." ]
def create_cp_from_hash_map(hash_list): hash_map = {} for git_hash in hash_list: try: cp_num = get_cp_from_hash(git_hash) hash_map[cp_num] = git_hash except GitConversionError: pass return hash_map
[ "def", "create_cp_from_hash_map", "(", "hash_list", ")", ":", "hash_map", "=", "{", "}", "for", "git_hash", "in", "hash_list", ":", "try", ":", "cp_num", "=", "get_cp_from_hash", "(", "git_hash", ")", "hash_map", "[", "cp_num", "]", "=", "git_hash", "except"...
Returns dict used for conversion of hash list.
[ "Returns", "dict", "used", "for", "conversion", "of", "hash", "list", "." ]
[ "\"\"\"Returns dict used for conversion of hash list.\n\n Creates a dictionary that maps from Commit position number\n to corresponding GitHash.\n \"\"\"" ]
[ { "param": "hash_list", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "hash_list", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
89dde70a349eeb0f1014de156e86052c9a0a4db5
sunlongbo/chromium
tools/bisect_repackage/bisect_repackage.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
download_build
<not_specific>
def download_build(cp_num, revision_map, zip_file_name, context): """Download a single build corresponding to the cp_num and context.""" remote_file_path = '%s/%s_%s.zip' % (context.original_remote_path, context.file_prefix, revision_map[...
Download a single build corresponding to the cp_num and context.
Download a single build corresponding to the cp_num and context.
[ "Download", "a", "single", "build", "corresponding", "to", "the", "cp_num", "and", "context", "." ]
def download_build(cp_num, revision_map, zip_file_name, context): remote_file_path = '%s/%s_%s.zip' % (context.original_remote_path, context.file_prefix, revision_map[cp_num]) try: cloud_storage.Get(context.original_gs_bucket, ...
[ "def", "download_build", "(", "cp_num", ",", "revision_map", ",", "zip_file_name", ",", "context", ")", ":", "remote_file_path", "=", "'%s/%s_%s.zip'", "%", "(", "context", ".", "original_remote_path", ",", "context", ".", "file_prefix", ",", "revision_map", "[", ...
Download a single build corresponding to the cp_num and context.
[ "Download", "a", "single", "build", "corresponding", "to", "the", "cp_num", "and", "context", "." ]
[ "\"\"\"Download a single build corresponding to the cp_num and context.\"\"\"" ]
[ { "param": "cp_num", "type": null }, { "param": "revision_map", "type": null }, { "param": "zip_file_name", "type": null }, { "param": "context", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "cp_num", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "revision_map", "type": null, "docstring": null, "docstring_...
89dde70a349eeb0f1014de156e86052c9a0a4db5
sunlongbo/chromium
tools/bisect_repackage/bisect_repackage.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
download_revision_map
null
def download_revision_map(context): """Downloads the revision map in original_gs_url in context.""" download_file = '%s/%s' % (context.repackage_remote_path, REVISION_MAP_FILE) cloud_storage.Get(context.repackage_gs_bucket, download_file, context.revision_file)
Downloads the revision map in original_gs_url in context.
Downloads the revision map in original_gs_url in context.
[ "Downloads", "the", "revision", "map", "in", "original_gs_url", "in", "context", "." ]
def download_revision_map(context): download_file = '%s/%s' % (context.repackage_remote_path, REVISION_MAP_FILE) cloud_storage.Get(context.repackage_gs_bucket, download_file, context.revision_file)
[ "def", "download_revision_map", "(", "context", ")", ":", "download_file", "=", "'%s/%s'", "%", "(", "context", ".", "repackage_remote_path", ",", "REVISION_MAP_FILE", ")", "cloud_storage", ".", "Get", "(", "context", ".", "repackage_gs_bucket", ",", "download_file"...
Downloads the revision map in original_gs_url in context.
[ "Downloads", "the", "revision", "map", "in", "original_gs_url", "in", "context", "." ]
[ "\"\"\"Downloads the revision map in original_gs_url in context.\"\"\"" ]
[ { "param": "context", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "context", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
89dde70a349eeb0f1014de156e86052c9a0a4db5
sunlongbo/chromium
tools/bisect_repackage/bisect_repackage.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
upload_revision_map
null
def upload_revision_map(revision_map, context): """Upload the given revision_map to the repackage_gs_url in context.""" with open(context.revision_file, 'w') as revision_file: json.dump(revision_map, revision_file) cloud_storage.Insert(context.repackage_gs_bucket, context.repackage_remo...
Upload the given revision_map to the repackage_gs_url in context.
Upload the given revision_map to the repackage_gs_url in context.
[ "Upload", "the", "given", "revision_map", "to", "the", "repackage_gs_url", "in", "context", "." ]
def upload_revision_map(revision_map, context): with open(context.revision_file, 'w') as revision_file: json.dump(revision_map, revision_file) cloud_storage.Insert(context.repackage_gs_bucket, context.repackage_remote_path, context.revision_file) bisect_repackage_...
[ "def", "upload_revision_map", "(", "revision_map", ",", "context", ")", ":", "with", "open", "(", "context", ".", "revision_file", ",", "'w'", ")", "as", "revision_file", ":", "json", ".", "dump", "(", "revision_map", ",", "revision_file", ")", "cloud_storage"...
Upload the given revision_map to the repackage_gs_url in context.
[ "Upload", "the", "given", "revision_map", "to", "the", "repackage_gs_url", "in", "context", "." ]
[ "\"\"\"Upload the given revision_map to the repackage_gs_url in context.\"\"\"" ]
[ { "param": "revision_map", "type": null }, { "param": "context", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "revision_map", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "context", "type": null, "docstring": null, "docstring...
89dde70a349eeb0f1014de156e86052c9a0a4db5
sunlongbo/chromium
tools/bisect_repackage/bisect_repackage.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
create_upload_revision_map
null
def create_upload_revision_map(context): """Creates and uploads a dictionary that maps from GitHash to CP number.""" gs_base_url = '%s/%s' % (context.original_gs_bucket, context.original_remote_path) hash_list = get_list_of_suffix(gs_base_url, context.file_prefix, ...
Creates and uploads a dictionary that maps from GitHash to CP number.
Creates and uploads a dictionary that maps from GitHash to CP number.
[ "Creates", "and", "uploads", "a", "dictionary", "that", "maps", "from", "GitHash", "to", "CP", "number", "." ]
def create_upload_revision_map(context): gs_base_url = '%s/%s' % (context.original_gs_bucket, context.original_remote_path) hash_list = get_list_of_suffix(gs_base_url, context.file_prefix, bisect_repackage_utils.IsGitCommitHash) cp_num_to_hash_map = crea...
[ "def", "create_upload_revision_map", "(", "context", ")", ":", "gs_base_url", "=", "'%s/%s'", "%", "(", "context", ".", "original_gs_bucket", ",", "context", ".", "original_remote_path", ")", "hash_list", "=", "get_list_of_suffix", "(", "gs_base_url", ",", "context"...
Creates and uploads a dictionary that maps from GitHash to CP number.
[ "Creates", "and", "uploads", "a", "dictionary", "that", "maps", "from", "GitHash", "to", "CP", "number", "." ]
[ "\"\"\"Creates and uploads a dictionary that maps from GitHash to CP number.\"\"\"" ]
[ { "param": "context", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "context", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
89dde70a349eeb0f1014de156e86052c9a0a4db5
sunlongbo/chromium
tools/bisect_repackage/bisect_repackage.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
update_upload_revision_map
null
def update_upload_revision_map(context): """Updates and uploads a dictionary that maps from GitHash to CP number.""" gs_base_url = '%s/%s' % (context.original_gs_bucket, context.original_remote_path) revision_map = get_revision_map(context) hash_list = get_list_of_suffix(gs_base_url, ...
Updates and uploads a dictionary that maps from GitHash to CP number.
Updates and uploads a dictionary that maps from GitHash to CP number.
[ "Updates", "and", "uploads", "a", "dictionary", "that", "maps", "from", "GitHash", "to", "CP", "number", "." ]
def update_upload_revision_map(context): gs_base_url = '%s/%s' % (context.original_gs_bucket, context.original_remote_path) revision_map = get_revision_map(context) hash_list = get_list_of_suffix(gs_base_url, context.file_prefix, bisect_repackage_utils.I...
[ "def", "update_upload_revision_map", "(", "context", ")", ":", "gs_base_url", "=", "'%s/%s'", "%", "(", "context", ".", "original_gs_bucket", ",", "context", ".", "original_remote_path", ")", "revision_map", "=", "get_revision_map", "(", "context", ")", "hash_list",...
Updates and uploads a dictionary that maps from GitHash to CP number.
[ "Updates", "and", "uploads", "a", "dictionary", "that", "maps", "from", "GitHash", "to", "CP", "number", "." ]
[ "\"\"\"Updates and uploads a dictionary that maps from GitHash to CP number.\"\"\"" ]
[ { "param": "context", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "context", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
89dde70a349eeb0f1014de156e86052c9a0a4db5
sunlongbo/chromium
tools/bisect_repackage/bisect_repackage.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
make_lightweight_archive
<not_specific>
def make_lightweight_archive(file_archive, archive_name, files_to_archive, context, staging_dir, ignore_sub_folder): """Repackages and strips the archive. Repacakges and strips according to CHROME_REQUIRED_FILES and CHROME_STRIP_LIST. """ strip_list = CHROME_STRIP_LIST.get(contex...
Repackages and strips the archive. Repacakges and strips according to CHROME_REQUIRED_FILES and CHROME_STRIP_LIST.
Repackages and strips the archive. Repacakges and strips according to CHROME_REQUIRED_FILES and CHROME_STRIP_LIST.
[ "Repackages", "and", "strips", "the", "archive", ".", "Repacakges", "and", "strips", "according", "to", "CHROME_REQUIRED_FILES", "and", "CHROME_STRIP_LIST", "." ]
def make_lightweight_archive(file_archive, archive_name, files_to_archive, context, staging_dir, ignore_sub_folder): strip_list = CHROME_STRIP_LIST.get(context.archive) tmp_archive = os.path.join(staging_dir, 'tmp_%s' % archive_name) (zip_dir, zip_file) = bisect_repackage_utils.MakeZi...
[ "def", "make_lightweight_archive", "(", "file_archive", ",", "archive_name", ",", "files_to_archive", ",", "context", ",", "staging_dir", ",", "ignore_sub_folder", ")", ":", "strip_list", "=", "CHROME_STRIP_LIST", ".", "get", "(", "context", ".", "archive", ")", "...
Repackages and strips the archive.
[ "Repackages", "and", "strips", "the", "archive", "." ]
[ "\"\"\"Repackages and strips the archive.\n\n Repacakges and strips according to CHROME_REQUIRED_FILES and\n CHROME_STRIP_LIST.\n \"\"\"" ]
[ { "param": "file_archive", "type": null }, { "param": "archive_name", "type": null }, { "param": "files_to_archive", "type": null }, { "param": "context", "type": null }, { "param": "staging_dir", "type": null }, { "param": "ignore_sub_folder", "ty...
{ "returns": [], "raises": [], "params": [ { "identifier": "file_archive", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "archive_name", "type": null, "docstring": null, "docs...
89dde70a349eeb0f1014de156e86052c9a0a4db5
sunlongbo/chromium
tools/bisect_repackage/bisect_repackage.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
remove_created_files_and_path
null
def remove_created_files_and_path(files, paths): """Removes all the files and paths passed in.""" for file in files: bisect_repackage_utils.RemoveFile(file) for path in paths: bisect_repackage_utils.RemovePath(path)
Removes all the files and paths passed in.
Removes all the files and paths passed in.
[ "Removes", "all", "the", "files", "and", "paths", "passed", "in", "." ]
def remove_created_files_and_path(files, paths): for file in files: bisect_repackage_utils.RemoveFile(file) for path in paths: bisect_repackage_utils.RemovePath(path)
[ "def", "remove_created_files_and_path", "(", "files", ",", "paths", ")", ":", "for", "file", "in", "files", ":", "bisect_repackage_utils", ".", "RemoveFile", "(", "file", ")", "for", "path", "in", "paths", ":", "bisect_repackage_utils", ".", "RemovePath", "(", ...
Removes all the files and paths passed in.
[ "Removes", "all", "the", "files", "and", "paths", "passed", "in", "." ]
[ "\"\"\"Removes all the files and paths passed in.\"\"\"" ]
[ { "param": "files", "type": null }, { "param": "paths", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "files", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "paths", "type": null, "docstring": null, "docstring_tokens":...
89dde70a349eeb0f1014de156e86052c9a0a4db5
sunlongbo/chromium
tools/bisect_repackage/bisect_repackage.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
verify_chrome_run
null
def verify_chrome_run(zip_dir): """This function executes chrome executable in zip_dir. Currently, it is only supported for Linux Chrome builds. Raises error if the execution fails for any reason. """ try: command = [os.path.join(zip_dir, 'chrome')] code = bisect_repackage_utils.RunCommand(command) ...
This function executes chrome executable in zip_dir. Currently, it is only supported for Linux Chrome builds. Raises error if the execution fails for any reason.
This function executes chrome executable in zip_dir. Currently, it is only supported for Linux Chrome builds. Raises error if the execution fails for any reason.
[ "This", "function", "executes", "chrome", "executable", "in", "zip_dir", ".", "Currently", "it", "is", "only", "supported", "for", "Linux", "Chrome", "builds", ".", "Raises", "error", "if", "the", "execution", "fails", "for", "any", "reason", "." ]
def verify_chrome_run(zip_dir): try: command = [os.path.join(zip_dir, 'chrome')] code = bisect_repackage_utils.RunCommand(command) if code != 0: raise ChromeExecutionError('An error occurred when executing Chrome') except ChromeExecutionError,e: print(str(e))
[ "def", "verify_chrome_run", "(", "zip_dir", ")", ":", "try", ":", "command", "=", "[", "os", ".", "path", ".", "join", "(", "zip_dir", ",", "'chrome'", ")", "]", "code", "=", "bisect_repackage_utils", ".", "RunCommand", "(", "command", ")", "if", "code",...
This function executes chrome executable in zip_dir.
[ "This", "function", "executes", "chrome", "executable", "in", "zip_dir", "." ]
[ "\"\"\"This function executes chrome executable in zip_dir.\n\n Currently, it is only supported for Linux Chrome builds.\n Raises error if the execution fails for any reason.\n \"\"\"" ]
[ { "param": "zip_dir", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "zip_dir", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
89dde70a349eeb0f1014de156e86052c9a0a4db5
sunlongbo/chromium
tools/bisect_repackage/bisect_repackage.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
repackage_single_revision
<not_specific>
def repackage_single_revision(revision_map, verify_run, staging_dir, context, cp_num): """Repackages a single Chrome build for manual bisect.""" archive_name = '%s_%s' %(context.file_prefix, cp_num) file_archive = os.path.join(staging_dir, archive_name) zip_file_name = '%s.zip' % (...
Repackages a single Chrome build for manual bisect.
Repackages a single Chrome build for manual bisect.
[ "Repackages", "a", "single", "Chrome", "build", "for", "manual", "bisect", "." ]
def repackage_single_revision(revision_map, verify_run, staging_dir, context, cp_num): archive_name = '%s_%s' %(context.file_prefix, cp_num) file_archive = os.path.join(staging_dir, archive_name) zip_file_name = '%s.zip' % (file_archive) if not download_build(cp_num, revision_map, ...
[ "def", "repackage_single_revision", "(", "revision_map", ",", "verify_run", ",", "staging_dir", ",", "context", ",", "cp_num", ")", ":", "archive_name", "=", "'%s_%s'", "%", "(", "context", ".", "file_prefix", ",", "cp_num", ")", "file_archive", "=", "os", "."...
Repackages a single Chrome build for manual bisect.
[ "Repackages", "a", "single", "Chrome", "build", "for", "manual", "bisect", "." ]
[ "\"\"\"Repackages a single Chrome build for manual bisect.\"\"\"", "# Only extract required files and directories.", "# And when there is no pattern checking for files.", "# Removed temporary files created during repackaging process." ]
[ { "param": "revision_map", "type": null }, { "param": "verify_run", "type": null }, { "param": "staging_dir", "type": null }, { "param": "context", "type": null }, { "param": "cp_num", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "revision_map", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "verify_run", "type": null, "docstring": null, "docstr...
89dde70a349eeb0f1014de156e86052c9a0a4db5
sunlongbo/chromium
tools/bisect_repackage/bisect_repackage.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
repackage_revisions
null
def repackage_revisions(revisions, revision_map, verify_run, staging_dir, context, quit_event=None, progress_event=None): """Repackages all Chrome builds listed in revisions. This function calls 'repackage_single_revision' with multithreading pool. """ p = Pool(3) func = partial(repac...
Repackages all Chrome builds listed in revisions. This function calls 'repackage_single_revision' with multithreading pool.
Repackages all Chrome builds listed in revisions. This function calls 'repackage_single_revision' with multithreading pool.
[ "Repackages", "all", "Chrome", "builds", "listed", "in", "revisions", ".", "This", "function", "calls", "'", "repackage_single_revision", "'", "with", "multithreading", "pool", "." ]
def repackage_revisions(revisions, revision_map, verify_run, staging_dir, context, quit_event=None, progress_event=None): p = Pool(3) func = partial(repackage_single_revision, revision_map, verify_run, staging_dir, context) p.imap(func, revisions) p.close() p.join()
[ "def", "repackage_revisions", "(", "revisions", ",", "revision_map", ",", "verify_run", ",", "staging_dir", ",", "context", ",", "quit_event", "=", "None", ",", "progress_event", "=", "None", ")", ":", "p", "=", "Pool", "(", "3", ")", "func", "=", "partial...
Repackages all Chrome builds listed in revisions.
[ "Repackages", "all", "Chrome", "builds", "listed", "in", "revisions", "." ]
[ "\"\"\"Repackages all Chrome builds listed in revisions.\n\n This function calls 'repackage_single_revision' with multithreading pool.\n \"\"\"" ]
[ { "param": "revisions", "type": null }, { "param": "revision_map", "type": null }, { "param": "verify_run", "type": null }, { "param": "staging_dir", "type": null }, { "param": "context", "type": null }, { "param": "quit_event", "type": null }, ...
{ "returns": [], "raises": [], "params": [ { "identifier": "revisions", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "revision_map", "type": null, "docstring": null, "docstri...
89dde70a349eeb0f1014de156e86052c9a0a4db5
sunlongbo/chromium
tools/bisect_repackage/bisect_repackage.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
Stop
null
def Stop(self): """Stops the download which must have been started previously.""" assert self.thread, 'DownloadJob must be started before Stop is called.' self.quit_event.set() self.thread.join()
Stops the download which must have been started previously.
Stops the download which must have been started previously.
[ "Stops", "the", "download", "which", "must", "have", "been", "started", "previously", "." ]
def Stop(self): assert self.thread, 'DownloadJob must be started before Stop is called.' self.quit_event.set() self.thread.join()
[ "def", "Stop", "(", "self", ")", ":", "assert", "self", ".", "thread", ",", "'DownloadJob must be started before Stop is called.'", "self", ".", "quit_event", ".", "set", "(", ")", "self", ".", "thread", ".", "join", "(", ")" ]
Stops the download which must have been started previously.
[ "Stops", "the", "download", "which", "must", "have", "been", "started", "previously", "." ]
[ "\"\"\"Stops the download which must have been started previously.\"\"\"" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
89dde70a349eeb0f1014de156e86052c9a0a4db5
sunlongbo/chromium
tools/bisect_repackage/bisect_repackage.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
WaitFor
null
def WaitFor(self): """Prints a message and waits for the download to complete.""" assert self.thread, 'DownloadJob must be started before WaitFor is called.' self.progress_event.set() # Display progress of download. def Stop(self): assert self.thread, 'DownloadJob must be started before Stop is called...
Prints a message and waits for the download to complete.
Prints a message and waits for the download to complete.
[ "Prints", "a", "message", "and", "waits", "for", "the", "download", "to", "complete", "." ]
def WaitFor(self): assert self.thread, 'DownloadJob must be started before WaitFor is called.' self.progress_event.set() assert self.thread, 'DownloadJob must be started before Stop is called.' self.quit_event.set() self.thread.join()
[ "def", "WaitFor", "(", "self", ")", ":", "assert", "self", ".", "thread", ",", "'DownloadJob must be started before WaitFor is called.'", "self", ".", "progress_event", ".", "set", "(", ")", "assert", "self", ".", "thread", ",", "'DownloadJob must be started before St...
Prints a message and waits for the download to complete.
[ "Prints", "a", "message", "and", "waits", "for", "the", "download", "to", "complete", "." ]
[ "\"\"\"Prints a message and waits for the download to complete.\"\"\"", "# Display progress of download. def Stop(self):" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
af699561ffa1ba257c2d5d6586a49987b47d2cf7
sunlongbo/chromium
components/viz/presubmit_checks.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
CheckForUseOfWrongClock
<not_specific>
def CheckForUseOfWrongClock(input_api, output_api, allowlist, denylist=None): """Make sure new lines of code don't use a clock susceptible to skew.""" denylist = tuple(denylist or input_api.DEFAULT_FILES_TO_SKIP) source_file_filte...
Make sure new lines of code don't use a clock susceptible to skew.
Make sure new lines of code don't use a clock susceptible to skew.
[ "Make", "sure", "new", "lines", "of", "code", "don", "'", "t", "use", "a", "clock", "susceptible", "to", "skew", "." ]
def CheckForUseOfWrongClock(input_api, output_api, allowlist, denylist=None): denylist = tuple(denylist or input_api.DEFAULT_FILES_TO_SKIP) source_file_filter = lambda x: input_api.FilterSourceFile(x, ...
[ "def", "CheckForUseOfWrongClock", "(", "input_api", ",", "output_api", ",", "allowlist", ",", "denylist", "=", "None", ")", ":", "denylist", "=", "tuple", "(", "denylist", "or", "input_api", ".", "DEFAULT_FILES_TO_SKIP", ")", "source_file_filter", "=", "lambda", ...
Make sure new lines of code don't use a clock susceptible to skew.
[ "Make", "sure", "new", "lines", "of", "code", "don", "'", "t", "use", "a", "clock", "susceptible", "to", "skew", "." ]
[ "\"\"\"Make sure new lines of code don't use a clock susceptible to skew.\"\"\"", "# Regular expression that should detect any explicit references to the", "# base::Time type (or base::Clock/DefaultClock), whether in using decls,", "# typedefs, or to call static methods.", "# Regular expression that should ...
[ { "param": "input_api", "type": null }, { "param": "output_api", "type": null }, { "param": "allowlist", "type": null }, { "param": "denylist", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "input_api", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "output_api", "type": null, "docstring": null, "docstring...
6a40ca2839054eaa2fc77af698b6f2c396e696d0
sunlongbo/chromium
third_party/blink/tools/blinkpy/w3c/wpt_github.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
request
<not_specific>
def request(self, path, method, body=None, accept_header=None): """Sends a request to GitHub API and deserializes the response. Args: path: API endpoint without base URL (starting with '/'). method: HTTP method to be used for this request. body: Optional payload in t...
Sends a request to GitHub API and deserializes the response. Args: path: API endpoint without base URL (starting with '/'). method: HTTP method to be used for this request. body: Optional payload in the request body (default=None). accept_header: Custom media typ...
Sends a request to GitHub API and deserializes the response.
[ "Sends", "a", "request", "to", "GitHub", "API", "and", "deserializes", "the", "response", "." ]
def request(self, path, method, body=None, accept_header=None): assert path.startswith('/') if body: if six.PY3: body = json.dumps(body).encode("utf-8") else: body = json.dumps(body) if accept_header: headers = {'Accept': accept...
[ "def", "request", "(", "self", ",", "path", ",", "method", ",", "body", "=", "None", ",", "accept_header", "=", "None", ")", ":", "assert", "path", ".", "startswith", "(", "'/'", ")", "if", "body", ":", "if", "six", ".", "PY3", ":", "body", "=", ...
Sends a request to GitHub API and deserializes the response.
[ "Sends", "a", "request", "to", "GitHub", "API", "and", "deserializes", "the", "response", "." ]
[ "\"\"\"Sends a request to GitHub API and deserializes the response.\n\n Args:\n path: API endpoint without base URL (starting with '/').\n method: HTTP method to be used for this request.\n body: Optional payload in the request body (default=None).\n accept_header:...
[ { "param": "self", "type": null }, { "param": "path", "type": null }, { "param": "method", "type": null }, { "param": "body", "type": null }, { "param": "accept_header", "type": null } ]
{ "returns": [ { "docstring": "A JSONResponse instance.", "docstring_tokens": [ "A", "JSONResponse", "instance", "." ], "type": null } ], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, ...
6a40ca2839054eaa2fc77af698b6f2c396e696d0
sunlongbo/chromium
third_party/blink/tools/blinkpy/w3c/wpt_github.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
extract_link_next
<not_specific>
def extract_link_next(link_header): """Extracts the URI to the next page of results from a response. As per GitHub API specs, the link to the next page of results is extracted from the Link header -- the link with relation type "next". Docs: https://developer.github.com/v3/#pagination (...
Extracts the URI to the next page of results from a response. As per GitHub API specs, the link to the next page of results is extracted from the Link header -- the link with relation type "next". Docs: https://developer.github.com/v3/#pagination (and RFC 5988) Args: link_h...
Extracts the URI to the next page of results from a response. As per GitHub API specs, the link to the next page of results is extracted from the Link header -- the link with relation type "next".
[ "Extracts", "the", "URI", "to", "the", "next", "page", "of", "results", "from", "a", "response", ".", "As", "per", "GitHub", "API", "specs", "the", "link", "to", "the", "next", "page", "of", "results", "is", "extracted", "from", "the", "Link", "header", ...
def extract_link_next(link_header): if link_header is None: return None link_re = re.compile(r'<(.+?)>; *rel="(.+?)"') match = link_re.search(link_header) while match: link, rel = match.groups() if rel.lower() == 'next': assert link.sta...
[ "def", "extract_link_next", "(", "link_header", ")", ":", "if", "link_header", "is", "None", ":", "return", "None", "link_re", "=", "re", ".", "compile", "(", "r'<(.+?)>; *rel=\"(.+?)\"'", ")", "match", "=", "link_re", ".", "search", "(", "link_header", ")", ...
Extracts the URI to the next page of results from a response.
[ "Extracts", "the", "URI", "to", "the", "next", "page", "of", "results", "from", "a", "response", "." ]
[ "\"\"\"Extracts the URI to the next page of results from a response.\n\n As per GitHub API specs, the link to the next page of results is\n extracted from the Link header -- the link with relation type \"next\".\n Docs: https://developer.github.com/v3/#pagination (and RFC 5988)\n\n Args:...
[ { "param": "link_header", "type": null } ]
{ "returns": [ { "docstring": "Path to the next page (without base URL), or None if not found.", "docstring_tokens": [ "Path", "to", "the", "next", "page", "(", "without", "base", "URL", ")", "or", "None", ...
6a40ca2839054eaa2fc77af698b6f2c396e696d0
sunlongbo/chromium
third_party/blink/tools/blinkpy/w3c/wpt_github.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
create_pr
<not_specific>
def create_pr(self, remote_branch_name, desc_title, body): """Creates a PR on GitHub. API doc: https://developer.github.com/v3/pulls/#create-a-pull-request Returns: The issue number of the created PR. """ assert remote_branch_name assert desc_title a...
Creates a PR on GitHub. API doc: https://developer.github.com/v3/pulls/#create-a-pull-request Returns: The issue number of the created PR.
Creates a PR on GitHub.
[ "Creates", "a", "PR", "on", "GitHub", "." ]
def create_pr(self, remote_branch_name, desc_title, body): assert remote_branch_name assert desc_title assert body path = '/repos/%s/%s/pulls' % (WPT_GH_ORG, WPT_GH_REPO_NAME) body = { 'title': desc_title, 'body': body, 'head': remote_branch_na...
[ "def", "create_pr", "(", "self", ",", "remote_branch_name", ",", "desc_title", ",", "body", ")", ":", "assert", "remote_branch_name", "assert", "desc_title", "assert", "body", "path", "=", "'/repos/%s/%s/pulls'", "%", "(", "WPT_GH_ORG", ",", "WPT_GH_REPO_NAME", ")...
Creates a PR on GitHub.
[ "Creates", "a", "PR", "on", "GitHub", "." ]
[ "\"\"\"Creates a PR on GitHub.\n\n API doc: https://developer.github.com/v3/pulls/#create-a-pull-request\n\n Returns:\n The issue number of the created PR.\n \"\"\"" ]
[ { "param": "self", "type": null }, { "param": "remote_branch_name", "type": null }, { "param": "desc_title", "type": null }, { "param": "body", "type": null } ]
{ "returns": [ { "docstring": "The issue number of the created PR.", "docstring_tokens": [ "The", "issue", "number", "of", "the", "created", "PR", "." ], "type": null } ], "raises": [], "params": [ { "ident...
6a40ca2839054eaa2fc77af698b6f2c396e696d0
sunlongbo/chromium
third_party/blink/tools/blinkpy/w3c/wpt_github.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
update_pr
null
def update_pr(self, pr_number, desc_title=None, body=None, state=None): """Updates a PR on GitHub. API doc: https://developer.github.com/v3/pulls/#update-a-pull-request """ path = '/repos/{}/{}/pulls/{}'.format(WPT_GH_ORG, WPT_GH_REPO_NAME, ...
Updates a PR on GitHub. API doc: https://developer.github.com/v3/pulls/#update-a-pull-request
Updates a PR on GitHub.
[ "Updates", "a", "PR", "on", "GitHub", "." ]
def update_pr(self, pr_number, desc_title=None, body=None, state=None): path = '/repos/{}/{}/pulls/{}'.format(WPT_GH_ORG, WPT_GH_REPO_NAME, pr_number) payload = {} if desc_title: payload['title'] = desc_title if body: ...
[ "def", "update_pr", "(", "self", ",", "pr_number", ",", "desc_title", "=", "None", ",", "body", "=", "None", ",", "state", "=", "None", ")", ":", "path", "=", "'/repos/{}/{}/pulls/{}'", ".", "format", "(", "WPT_GH_ORG", ",", "WPT_GH_REPO_NAME", ",", "pr_nu...
Updates a PR on GitHub.
[ "Updates", "a", "PR", "on", "GitHub", "." ]
[ "\"\"\"Updates a PR on GitHub.\n\n API doc: https://developer.github.com/v3/pulls/#update-a-pull-request\n \"\"\"" ]
[ { "param": "self", "type": null }, { "param": "pr_number", "type": null }, { "param": "desc_title", "type": null }, { "param": "body", "type": null }, { "param": "state", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "pr_number", "type": null, "docstring": null, "docstring_token...
6a40ca2839054eaa2fc77af698b6f2c396e696d0
sunlongbo/chromium
third_party/blink/tools/blinkpy/w3c/wpt_github.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
add_label
null
def add_label(self, number, label): """Adds a label to a GitHub issue (or PR). API doc: https://developer.github.com/v3/issues/labels/#add-labels-to-an-issue """ path = '/repos/%s/%s/issues/%d/labels' % (WPT_GH_ORG, WPT_GH_REPO_NAME, num...
Adds a label to a GitHub issue (or PR). API doc: https://developer.github.com/v3/issues/labels/#add-labels-to-an-issue
Adds a label to a GitHub issue (or PR).
[ "Adds", "a", "label", "to", "a", "GitHub", "issue", "(", "or", "PR", ")", "." ]
def add_label(self, number, label): path = '/repos/%s/%s/issues/%d/labels' % (WPT_GH_ORG, WPT_GH_REPO_NAME, number) body = [label] response = self.request(path, method='POST', body=body) if response.status_code != 200: raise G...
[ "def", "add_label", "(", "self", ",", "number", ",", "label", ")", ":", "path", "=", "'/repos/%s/%s/issues/%d/labels'", "%", "(", "WPT_GH_ORG", ",", "WPT_GH_REPO_NAME", ",", "number", ")", "body", "=", "[", "label", "]", "response", "=", "self", ".", "requ...
Adds a label to a GitHub issue (or PR).
[ "Adds", "a", "label", "to", "a", "GitHub", "issue", "(", "or", "PR", ")", "." ]
[ "\"\"\"Adds a label to a GitHub issue (or PR).\n\n API doc: https://developer.github.com/v3/issues/labels/#add-labels-to-an-issue\n \"\"\"" ]
[ { "param": "self", "type": null }, { "param": "number", "type": null }, { "param": "label", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "number", "type": null, "docstring": null, "docstring_tokens":...
6a40ca2839054eaa2fc77af698b6f2c396e696d0
sunlongbo/chromium
third_party/blink/tools/blinkpy/w3c/wpt_github.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
remove_label
null
def remove_label(self, number, label): """Removes a label from a GitHub issue (or PR). API doc: https://developer.github.com/v3/issues/labels/#remove-a-label-from-an-issue """ path = '/repos/%s/%s/issues/%d/labels/%s' % ( WPT_GH_ORG, WPT_GH_REPO_NAME, ...
Removes a label from a GitHub issue (or PR). API doc: https://developer.github.com/v3/issues/labels/#remove-a-label-from-an-issue
Removes a label from a GitHub issue (or PR).
[ "Removes", "a", "label", "from", "a", "GitHub", "issue", "(", "or", "PR", ")", "." ]
def remove_label(self, number, label): path = '/repos/%s/%s/issues/%d/labels/%s' % ( WPT_GH_ORG, WPT_GH_REPO_NAME, number, quote(label), ) response = self.request(path, method='DELETE') if response.status_code not in (200, 204): ...
[ "def", "remove_label", "(", "self", ",", "number", ",", "label", ")", ":", "path", "=", "'/repos/%s/%s/issues/%d/labels/%s'", "%", "(", "WPT_GH_ORG", ",", "WPT_GH_REPO_NAME", ",", "number", ",", "quote", "(", "label", ")", ",", ")", "response", "=", "self", ...
Removes a label from a GitHub issue (or PR).
[ "Removes", "a", "label", "from", "a", "GitHub", "issue", "(", "or", "PR", ")", "." ]
[ "\"\"\"Removes a label from a GitHub issue (or PR).\n\n API doc: https://developer.github.com/v3/issues/labels/#remove-a-label-from-an-issue\n \"\"\"", "# The GitHub API documentation claims that this endpoint returns a 204", "# on success. However in reality it returns a 200." ]
[ { "param": "self", "type": null }, { "param": "number", "type": null }, { "param": "label", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "number", "type": null, "docstring": null, "docstring_tokens":...
6a40ca2839054eaa2fc77af698b6f2c396e696d0
sunlongbo/chromium
third_party/blink/tools/blinkpy/w3c/wpt_github.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
recent_failing_chromium_exports
<not_specific>
def recent_failing_chromium_exports(self): """Fetches open PRs with an export label, failing status, and updated within the last month. API doc: https://developer.github.com/v3/search/#search-issues-and-pull-requests Returns: A list of PullRequest namedtuples. """ ...
Fetches open PRs with an export label, failing status, and updated within the last month. API doc: https://developer.github.com/v3/search/#search-issues-and-pull-requests Returns: A list of PullRequest namedtuples.
Fetches open PRs with an export label, failing status, and updated within the last month.
[ "Fetches", "open", "PRs", "with", "an", "export", "label", "failing", "status", "and", "updated", "within", "the", "last", "month", "." ]
def recent_failing_chromium_exports(self): one_month_ago = datetime.date.today() - datetime.timedelta(days=31) path = ( '/search/issues' '?q=repo:{}/{}%20type:pr+is:open%20label:{}%20status:failure%20updated:>{}' '&sort=updated' '&page=1' '&per...
[ "def", "recent_failing_chromium_exports", "(", "self", ")", ":", "one_month_ago", "=", "datetime", ".", "date", ".", "today", "(", ")", "-", "datetime", ".", "timedelta", "(", "days", "=", "31", ")", "path", "=", "(", "'/search/issues'", "'?q=repo:{}/{}%20type...
Fetches open PRs with an export label, failing status, and updated within the last month.
[ "Fetches", "open", "PRs", "with", "an", "export", "label", "failing", "status", "and", "updated", "within", "the", "last", "month", "." ]
[ "\"\"\"Fetches open PRs with an export label, failing status, and updated\n within the last month.\n\n API doc: https://developer.github.com/v3/search/#search-issues-and-pull-requests\n\n Returns:\n A list of PullRequest namedtuples.\n \"\"\"" ]
[ { "param": "self", "type": null } ]
{ "returns": [ { "docstring": "A list of PullRequest namedtuples.", "docstring_tokens": [ "A", "list", "of", "PullRequest", "namedtuples", "." ], "type": null } ], "raises": [], "params": [ { "identifier": "self", "t...
6a40ca2839054eaa2fc77af698b6f2c396e696d0
sunlongbo/chromium
third_party/blink/tools/blinkpy/w3c/wpt_github.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
all_pull_requests
<not_specific>
def all_pull_requests(self): """Fetches the most recent (open and closed) PRs with the export label. The maximum number of PRs is pr_history_window. Search endpoint is used instead of listing PRs, because we need to filter by labels. Note that there are already more than MAX_PR_HISTORY_...
Fetches the most recent (open and closed) PRs with the export label. The maximum number of PRs is pr_history_window. Search endpoint is used instead of listing PRs, because we need to filter by labels. Note that there are already more than MAX_PR_HISTORY_WINDOW export PRs, so we can't r...
Fetches the most recent (open and closed) PRs with the export label. The maximum number of PRs is pr_history_window. Search endpoint is used instead of listing PRs, because we need to filter by labels. Note that there are already more than MAX_PR_HISTORY_WINDOW export PRs, so we can't really find *all* of them; we fetc...
[ "Fetches", "the", "most", "recent", "(", "open", "and", "closed", ")", "PRs", "with", "the", "export", "label", ".", "The", "maximum", "number", "of", "PRs", "is", "pr_history_window", ".", "Search", "endpoint", "is", "used", "instead", "of", "listing", "P...
def all_pull_requests(self): path = ('/search/issues' '?q=repo:{}/{}%20type:pr%20label:{}' '&sort=updated' '&page=1' '&per_page={}').format( WPT_GH_ORG, WPT_GH_REPO_NAME, EXPORT_PR_LABEL, min(MAX_PER_PAGE, se...
[ "def", "all_pull_requests", "(", "self", ")", ":", "path", "=", "(", "'/search/issues'", "'?q=repo:{}/{}%20type:pr%20label:{}'", "'&sort=updated'", "'&page=1'", "'&per_page={}'", ")", ".", "format", "(", "WPT_GH_ORG", ",", "WPT_GH_REPO_NAME", ",", "EXPORT_PR_LABEL", ","...
Fetches the most recent (open and closed) PRs with the export label.
[ "Fetches", "the", "most", "recent", "(", "open", "and", "closed", ")", "PRs", "with", "the", "export", "label", "." ]
[ "\"\"\"Fetches the most recent (open and closed) PRs with the export label.\n\n The maximum number of PRs is pr_history_window. Search endpoint is used\n instead of listing PRs, because we need to filter by labels. Note that\n there are already more than MAX_PR_HISTORY_WINDOW export PRs, so we\...
[ { "param": "self", "type": null } ]
{ "returns": [ { "docstring": "A list of PullRequest namedtuples.", "docstring_tokens": [ "A", "list", "of", "PullRequest", "namedtuples", "." ], "type": null } ], "raises": [], "params": [ { "identifier": "self", "t...
6a40ca2839054eaa2fc77af698b6f2c396e696d0
sunlongbo/chromium
third_party/blink/tools/blinkpy/w3c/wpt_github.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
is_pr_merged
<not_specific>
def is_pr_merged(self, pr_number): """Checks if a PR has been merged. API doc: https://developer.github.com/v3/pulls/#get-if-a-pull-request-has-been-merged Returns: True if merged, False if not. """ path = '/repos/%s/%s/pulls/%d/merge' % (WPT_GH_ORG, WPT_GH_REPO_NAM...
Checks if a PR has been merged. API doc: https://developer.github.com/v3/pulls/#get-if-a-pull-request-has-been-merged Returns: True if merged, False if not.
Checks if a PR has been merged.
[ "Checks", "if", "a", "PR", "has", "been", "merged", "." ]
def is_pr_merged(self, pr_number): path = '/repos/%s/%s/pulls/%d/merge' % (WPT_GH_ORG, WPT_GH_REPO_NAME, pr_number) cached_error = None for i in range(5): try: response = self.request(path, method='GET') ...
[ "def", "is_pr_merged", "(", "self", ",", "pr_number", ")", ":", "path", "=", "'/repos/%s/%s/pulls/%d/merge'", "%", "(", "WPT_GH_ORG", ",", "WPT_GH_REPO_NAME", ",", "pr_number", ")", "cached_error", "=", "None", "for", "i", "in", "range", "(", "5", ")", ":", ...
Checks if a PR has been merged.
[ "Checks", "if", "a", "PR", "has", "been", "merged", "." ]
[ "\"\"\"Checks if a PR has been merged.\n\n API doc: https://developer.github.com/v3/pulls/#get-if-a-pull-request-has-been-merged\n\n Returns:\n True if merged, False if not.\n \"\"\"", "# After migrate to py3 we met random timeout issue here,", "# Retry this request in this case"...
[ { "param": "self", "type": null }, { "param": "pr_number", "type": null } ]
{ "returns": [ { "docstring": "True if merged, False if not.", "docstring_tokens": [ "True", "if", "merged", "False", "if", "not", "." ], "type": null } ], "raises": [], "params": [ { "identifier": "self", "t...
6a40ca2839054eaa2fc77af698b6f2c396e696d0
sunlongbo/chromium
third_party/blink/tools/blinkpy/w3c/wpt_github.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
merge_pr
null
def merge_pr(self, pr_number): """Merges a PR. If merge cannot be performed, MergeError is raised. GitHubError is raised when other unknown errors happen. API doc: https://developer.github.com/v3/pulls/#merge-a-pull-request-merge-button """ path = '/repos/%s/%s/pulls/%d...
Merges a PR. If merge cannot be performed, MergeError is raised. GitHubError is raised when other unknown errors happen. API doc: https://developer.github.com/v3/pulls/#merge-a-pull-request-merge-button
Merges a PR. If merge cannot be performed, MergeError is raised. GitHubError is raised when other unknown errors happen.
[ "Merges", "a", "PR", ".", "If", "merge", "cannot", "be", "performed", "MergeError", "is", "raised", ".", "GitHubError", "is", "raised", "when", "other", "unknown", "errors", "happen", "." ]
def merge_pr(self, pr_number): path = '/repos/%s/%s/pulls/%d/merge' % (WPT_GH_ORG, WPT_GH_REPO_NAME, pr_number) body = { 'merge_method': 'rebase', } try: response = self.request(path, method='PUT', body=body) ...
[ "def", "merge_pr", "(", "self", ",", "pr_number", ")", ":", "path", "=", "'/repos/%s/%s/pulls/%d/merge'", "%", "(", "WPT_GH_ORG", ",", "WPT_GH_REPO_NAME", ",", "pr_number", ")", "body", "=", "{", "'merge_method'", ":", "'rebase'", ",", "}", "try", ":", "resp...
Merges a PR.
[ "Merges", "a", "PR", "." ]
[ "\"\"\"Merges a PR.\n\n If merge cannot be performed, MergeError is raised. GitHubError is\n raised when other unknown errors happen.\n\n API doc: https://developer.github.com/v3/pulls/#merge-a-pull-request-merge-button\n \"\"\"" ]
[ { "param": "self", "type": null }, { "param": "pr_number", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "pr_number", "type": null, "docstring": null, "docstring_token...
6a5276a671caf15cbe409a96b0a5777b31a30ab7
sunlongbo/chromium
content/test/gpu/flake_suppressor/data_types_unittest.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
testAppliesToResultNonResult
null
def testAppliesToResultNonResult(self): """Tests that AppliesToResult properly fails when given a non-Result.""" e = data_types.Expectation('test', ['win', 'nvidia'], ['Failure']) with self.assertRaises(AssertionError): e.AppliesToResult(None)
Tests that AppliesToResult properly fails when given a non-Result.
Tests that AppliesToResult properly fails when given a non-Result.
[ "Tests", "that", "AppliesToResult", "properly", "fails", "when", "given", "a", "non", "-", "Result", "." ]
def testAppliesToResultNonResult(self): e = data_types.Expectation('test', ['win', 'nvidia'], ['Failure']) with self.assertRaises(AssertionError): e.AppliesToResult(None)
[ "def", "testAppliesToResultNonResult", "(", "self", ")", ":", "e", "=", "data_types", ".", "Expectation", "(", "'test'", ",", "[", "'win'", ",", "'nvidia'", "]", ",", "[", "'Failure'", "]", ")", "with", "self", ".", "assertRaises", "(", "AssertionError", "...
Tests that AppliesToResult properly fails when given a non-Result.
[ "Tests", "that", "AppliesToResult", "properly", "fails", "when", "given", "a", "non", "-", "Result", "." ]
[ "\"\"\"Tests that AppliesToResult properly fails when given a non-Result.\"\"\"" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
6a5276a671caf15cbe409a96b0a5777b31a30ab7
sunlongbo/chromium
content/test/gpu/flake_suppressor/data_types_unittest.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
testAppliesToResultApplies
null
def testAppliesToResultApplies(self): """Tests that AppliesToResult properly returns True on expected Results.""" # Exact match. e = data_types.Expectation('test', ['win', 'nvidia'], ['Failure']) r = data_types.Result('suite', 'test', ('win', 'nvidia'), 'id') self.assertTrue(e.AppliesToResult(r)) ...
Tests that AppliesToResult properly returns True on expected Results.
Tests that AppliesToResult properly returns True on expected Results.
[ "Tests", "that", "AppliesToResult", "properly", "returns", "True", "on", "expected", "Results", "." ]
def testAppliesToResultApplies(self): e = data_types.Expectation('test', ['win', 'nvidia'], ['Failure']) r = data_types.Result('suite', 'test', ('win', 'nvidia'), 'id') self.assertTrue(e.AppliesToResult(r)) r = data_types.Result('suite', 'test', ('win', 'nvidia', 'release'), 'id') self.assertTrue(e....
[ "def", "testAppliesToResultApplies", "(", "self", ")", ":", "e", "=", "data_types", ".", "Expectation", "(", "'test'", ",", "[", "'win'", ",", "'nvidia'", "]", ",", "[", "'Failure'", "]", ")", "r", "=", "data_types", ".", "Result", "(", "'suite'", ",", ...
Tests that AppliesToResult properly returns True on expected Results.
[ "Tests", "that", "AppliesToResult", "properly", "returns", "True", "on", "expected", "Results", "." ]
[ "\"\"\"Tests that AppliesToResult properly returns True on expected Results.\"\"\"", "# Exact match.", "# Tag subset", "# Glob match" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
6a5276a671caf15cbe409a96b0a5777b31a30ab7
sunlongbo/chromium
content/test/gpu/flake_suppressor/data_types_unittest.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
testAppliesToResultDoesNotApply
null
def testAppliesToResultDoesNotApply(self): """Tests that AppliesToResult properly returns False on expected Results.""" # Name mismatch e = data_types.Expectation('test', ['win', 'nvidia'], ['Failure']) r = data_types.Result('suite', 'notatest', ('win', 'nvidia'), 'id') self.assertFalse(e.AppliesToR...
Tests that AppliesToResult properly returns False on expected Results.
Tests that AppliesToResult properly returns False on expected Results.
[ "Tests", "that", "AppliesToResult", "properly", "returns", "False", "on", "expected", "Results", "." ]
def testAppliesToResultDoesNotApply(self): e = data_types.Expectation('test', ['win', 'nvidia'], ['Failure']) r = data_types.Result('suite', 'notatest', ('win', 'nvidia'), 'id') self.assertFalse(e.AppliesToResult(r)) r = data_types.Result('suite', 'test', tuple(['win']), 'id') self.assertFalse(e.App...
[ "def", "testAppliesToResultDoesNotApply", "(", "self", ")", ":", "e", "=", "data_types", ".", "Expectation", "(", "'test'", ",", "[", "'win'", ",", "'nvidia'", "]", ",", "[", "'Failure'", "]", ")", "r", "=", "data_types", ".", "Result", "(", "'suite'", "...
Tests that AppliesToResult properly returns False on expected Results.
[ "Tests", "that", "AppliesToResult", "properly", "returns", "False", "on", "expected", "Results", "." ]
[ "\"\"\"Tests that AppliesToResult properly returns False on expected Results.\"\"\"", "# Name mismatch", "# Tag superset" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
6a5276a671caf15cbe409a96b0a5777b31a30ab7
sunlongbo/chromium
content/test/gpu/flake_suppressor/data_types_unittest.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
testEquality
null
def testEquality(self): """Tests that equality is properly calculated.""" r = data_types.Result('suite', 'test', ('win', 'nvidia'), 'id') other = data_types.Result('suite', 'test', ('win', 'nvidia'), 'id') self.assertEqual(r, other) other = data_types.Result('notsuite', 'test', ('win', 'nvidia'), '...
Tests that equality is properly calculated.
Tests that equality is properly calculated.
[ "Tests", "that", "equality", "is", "properly", "calculated", "." ]
def testEquality(self): r = data_types.Result('suite', 'test', ('win', 'nvidia'), 'id') other = data_types.Result('suite', 'test', ('win', 'nvidia'), 'id') self.assertEqual(r, other) other = data_types.Result('notsuite', 'test', ('win', 'nvidia'), 'id') self.assertNotEqual(r, other) other = data...
[ "def", "testEquality", "(", "self", ")", ":", "r", "=", "data_types", ".", "Result", "(", "'suite'", ",", "'test'", ",", "(", "'win'", ",", "'nvidia'", ")", ",", "'id'", ")", "other", "=", "data_types", ".", "Result", "(", "'suite'", ",", "'test'", "...
Tests that equality is properly calculated.
[ "Tests", "that", "equality", "is", "properly", "calculated", "." ]
[ "\"\"\"Tests that equality is properly calculated.\"\"\"" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
2e637fa146f1b33e2bed37da6b29daa5d62563e9
sunlongbo/chromium
chrome/test/mini_installer/registry_operations.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
_RootKeyConstant
<not_specific>
def _RootKeyConstant(root_key): """Converts a root registry key string into a _winreg.HKEY_* constant.""" if root_key not in _ROOT_KEY_MAPPING: raise KeyError("Unknown root registry key '%s'" % root_key) return _ROOT_KEY_MAPPING[root_key]
Converts a root registry key string into a _winreg.HKEY_* constant.
Converts a root registry key string into a _winreg.HKEY_* constant.
[ "Converts", "a", "root", "registry", "key", "string", "into", "a", "_winreg", ".", "HKEY_", "*", "constant", "." ]
def _RootKeyConstant(root_key): if root_key not in _ROOT_KEY_MAPPING: raise KeyError("Unknown root registry key '%s'" % root_key) return _ROOT_KEY_MAPPING[root_key]
[ "def", "_RootKeyConstant", "(", "root_key", ")", ":", "if", "root_key", "not", "in", "_ROOT_KEY_MAPPING", ":", "raise", "KeyError", "(", "\"Unknown root registry key '%s'\"", "%", "root_key", ")", "return", "_ROOT_KEY_MAPPING", "[", "root_key", "]" ]
Converts a root registry key string into a _winreg.HKEY_* constant.
[ "Converts", "a", "root", "registry", "key", "string", "into", "a", "_winreg", ".", "HKEY_", "*", "constant", "." ]
[ "\"\"\"Converts a root registry key string into a _winreg.HKEY_* constant.\"\"\"" ]
[ { "param": "root_key", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "root_key", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
2e637fa146f1b33e2bed37da6b29daa5d62563e9
sunlongbo/chromium
chrome/test/mini_installer/registry_operations.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
_RegistryViewConstant
<not_specific>
def _RegistryViewConstant(registry_view): """Converts a registry view string into a _winreg.KEY_WOW64* constant.""" if registry_view not in _REGISTRY_VIEW_MAPPING: raise KeyError("Unknown registry view '%s'" % registry_view) return _REGISTRY_VIEW_MAPPING[registry_view]
Converts a registry view string into a _winreg.KEY_WOW64* constant.
Converts a registry view string into a _winreg.KEY_WOW64* constant.
[ "Converts", "a", "registry", "view", "string", "into", "a", "_winreg", ".", "KEY_WOW64", "*", "constant", "." ]
def _RegistryViewConstant(registry_view): if registry_view not in _REGISTRY_VIEW_MAPPING: raise KeyError("Unknown registry view '%s'" % registry_view) return _REGISTRY_VIEW_MAPPING[registry_view]
[ "def", "_RegistryViewConstant", "(", "registry_view", ")", ":", "if", "registry_view", "not", "in", "_REGISTRY_VIEW_MAPPING", ":", "raise", "KeyError", "(", "\"Unknown registry view '%s'\"", "%", "registry_view", ")", "return", "_REGISTRY_VIEW_MAPPING", "[", "registry_vie...
Converts a registry view string into a _winreg.KEY_WOW64* constant.
[ "Converts", "a", "registry", "view", "string", "into", "a", "_winreg", ".", "KEY_WOW64", "*", "constant", "." ]
[ "\"\"\"Converts a registry view string into a _winreg.KEY_WOW64* constant.\"\"\"" ]
[ { "param": "registry_view", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "registry_view", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
2e637fa146f1b33e2bed37da6b29daa5d62563e9
sunlongbo/chromium
chrome/test/mini_installer/registry_operations.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
_ValueTypeConstant
<not_specific>
def _ValueTypeConstant(value_type): """Converts a registry value type string into a _winreg.REG_* constant.""" value_type_mapping = { 'BINARY': _winreg.REG_BINARY, 'DWORD': _winreg.REG_DWORD, 'DWORD_LITTLE_ENDIAN': _winreg.REG_DWORD_LITTLE_ENDIAN, 'DWORD_BIG_ENDIAN': _winreg.REG_...
Converts a registry value type string into a _winreg.REG_* constant.
Converts a registry value type string into a _winreg.REG_* constant.
[ "Converts", "a", "registry", "value", "type", "string", "into", "a", "_winreg", ".", "REG_", "*", "constant", "." ]
def _ValueTypeConstant(value_type): value_type_mapping = { 'BINARY': _winreg.REG_BINARY, 'DWORD': _winreg.REG_DWORD, 'DWORD_LITTLE_ENDIAN': _winreg.REG_DWORD_LITTLE_ENDIAN, 'DWORD_BIG_ENDIAN': _winreg.REG_DWORD_BIG_ENDIAN, 'EXPAND_SZ': _winreg.REG_EXPAND_SZ, 'LINK': _...
[ "def", "_ValueTypeConstant", "(", "value_type", ")", ":", "value_type_mapping", "=", "{", "'BINARY'", ":", "_winreg", ".", "REG_BINARY", ",", "'DWORD'", ":", "_winreg", ".", "REG_DWORD", ",", "'DWORD_LITTLE_ENDIAN'", ":", "_winreg", ".", "REG_DWORD_LITTLE_ENDIAN", ...
Converts a registry value type string into a _winreg.REG_* constant.
[ "Converts", "a", "registry", "value", "type", "string", "into", "a", "_winreg", ".", "REG_", "*", "constant", "." ]
[ "\"\"\"Converts a registry value type string into a _winreg.REG_* constant.\"\"\"" ]
[ { "param": "value_type", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "value_type", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
2e637fa146f1b33e2bed37da6b29daa5d62563e9
sunlongbo/chromium
chrome/test/mini_installer/registry_operations.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
VerifyRegistryEntryExpectation
<not_specific>
def VerifyRegistryEntryExpectation(expectation_name, expectation, variable_expander): """Verifies a registry key according to the |expectation|. Args: expectation_name: The registry key being verified. It is expanded using Expand. expectation: A di...
Verifies a registry key according to the |expectation|. Args: expectation_name: The registry key being verified. It is expanded using Expand. expectation: A dictionary with the following keys and values: 'exists' a string indicating whether the registry key's existence is ...
Verifies a registry key according to the |expectation|.
[ "Verifies", "a", "registry", "key", "according", "to", "the", "|expectation|", "." ]
def VerifyRegistryEntryExpectation(expectation_name, expectation, variable_expander): key = variable_expander.Expand(expectation_name) root_key, sub_key = key.split('\\', 1) try: registry_view = _winreg.KEY_WOW64_32KEY if 'wow_key' in expectation: ...
[ "def", "VerifyRegistryEntryExpectation", "(", "expectation_name", ",", "expectation", ",", "variable_expander", ")", ":", "key", "=", "variable_expander", ".", "Expand", "(", "expectation_name", ")", "root_key", ",", "sub_key", "=", "key", ".", "split", "(", "'\\\...
Verifies a registry key according to the |expectation|.
[ "Verifies", "a", "registry", "key", "according", "to", "the", "|expectation|", "." ]
[ "\"\"\"Verifies a registry key according to the |expectation|.\n\n Args:\n expectation_name: The registry key being verified. It is expanded using\n Expand.\n expectation: A dictionary with the following keys and values:\n 'exists' a string indicating whether the registry key'...
[ { "param": "expectation_name", "type": null }, { "param": "expectation", "type": null }, { "param": "variable_expander", "type": null } ]
{ "returns": [], "raises": [ { "docstring": "If an expectation is not satisfied.", "docstring_tokens": [ "If", "an", "expectation", "is", "not", "satisfied", "." ], "type": "AssertionError" } ], "params": [ { "iden...
2e637fa146f1b33e2bed37da6b29daa5d62563e9
sunlongbo/chromium
chrome/test/mini_installer/registry_operations.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
CleanRegistryEntry
<not_specific>
def CleanRegistryEntry(expectation_name, expectation, variable_expander): """Cleans registry keys and/or values based on expectations. Args: expectation_name: The registry key being cleaned. expectation: A dictionary describing the state of the key: 'exists': Either the string 'forb...
Cleans registry keys and/or values based on expectations. Args: expectation_name: The registry key being cleaned. expectation: A dictionary describing the state of the key: 'exists': Either the string 'forbidden', indicating that the key is to be deleted if it is found, ...
Cleans registry keys and/or values based on expectations.
[ "Cleans", "registry", "keys", "and", "/", "or", "values", "based", "on", "expectations", "." ]
def CleanRegistryEntry(expectation_name, expectation, variable_expander): key = variable_expander.Expand(expectation_name) assert not expectation['exists'] == 'required', ( 'Invalid expectation for CleanRegistryEntry operation: \'exists\' ' + 'property for key %s must not be \'required\'' % key)...
[ "def", "CleanRegistryEntry", "(", "expectation_name", ",", "expectation", ",", "variable_expander", ")", ":", "key", "=", "variable_expander", ".", "Expand", "(", "expectation_name", ")", "assert", "not", "expectation", "[", "'exists'", "]", "==", "'required'", ",...
Cleans registry keys and/or values based on expectations.
[ "Cleans", "registry", "keys", "and", "/", "or", "values", "based", "on", "expectations", "." ]
[ "\"\"\"Cleans registry keys and/or values based on expectations.\n\n Args:\n expectation_name: The registry key being cleaned.\n expectation: A dictionary describing the state of the key:\n 'exists': Either the string 'forbidden', indicating that the key is\n to be deleted...
[ { "param": "expectation_name", "type": null }, { "param": "expectation", "type": null }, { "param": "variable_expander", "type": null } ]
{ "returns": [], "raises": [ { "docstring": "If an expectation is not satisfied.", "docstring_tokens": [ "If", "an", "expectation", "is", "not", "satisfied", "." ], "type": "AssertionError" }, { "docstring": "If an err...
2e6dbd9171b7d3b6299ba02e714173be0e96097a
sunlongbo/chromium
third_party/blink/renderer/build/scripts/update_css_ranking.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
update_css_ranking
null
def update_css_ranking(css_ranking_file, css_ranking_api): """Create the css_properties_ranking.json5 for uses in Computed Style grouping Args: css_ranking_file: file directory to css_properties_ranking.json5 css_ranking_api: url to CSS ranking api """ css_ranking = json.loads(urlopen(...
Create the css_properties_ranking.json5 for uses in Computed Style grouping Args: css_ranking_file: file directory to css_properties_ranking.json5 css_ranking_api: url to CSS ranking api
Create the css_properties_ranking.json5 for uses in Computed Style grouping
[ "Create", "the", "css_properties_ranking", ".", "json5", "for", "uses", "in", "Computed", "Style", "grouping" ]
def update_css_ranking(css_ranking_file, css_ranking_api): css_ranking = json.loads(urlopen(css_ranking_api).read()) css_ranking_content = {"properties": {}, "data": []} css_ranking_content["data"] = [ property_["property_name"] for property_ in sorted( css_ranking, key=lambda x: -float(...
[ "def", "update_css_ranking", "(", "css_ranking_file", ",", "css_ranking_api", ")", ":", "css_ranking", "=", "json", ".", "loads", "(", "urlopen", "(", "css_ranking_api", ")", ".", "read", "(", ")", ")", "css_ranking_content", "=", "{", "\"properties\"", ":", "...
Create the css_properties_ranking.json5 for uses in Computed Style grouping
[ "Create", "the", "css_properties_ranking", ".", "json5", "for", "uses", "in", "Computed", "Style", "grouping" ]
[ "\"\"\"Create the css_properties_ranking.json5 for uses in Computed Style grouping\n\n Args:\n css_ranking_file: file directory to css_properties_ranking.json5\n css_ranking_api: url to CSS ranking api\n\n \"\"\"" ]
[ { "param": "css_ranking_file", "type": null }, { "param": "css_ranking_api", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "css_ranking_file", "type": null, "docstring": "file directory to css_properties_ranking.json5", "docstring_tokens": [ "file", "directory", "to", "css_properties_ranking", ".", "j...
2e6dbd9171b7d3b6299ba02e714173be0e96097a
sunlongbo/chromium
third_party/blink/renderer/build/scripts/update_css_ranking.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
find_partition_rule
<not_specific>
def find_partition_rule(css_property_set, all_properties, n_cluster, transform=lambda x: x): """Find partition rule for a set of CSS property based on its popularity Args: css_property_set: list of CSS properties and their populari...
Find partition rule for a set of CSS property based on its popularity Args: css_property_set: list of CSS properties and their popularity of form [(css_property_name, popularity_score)..] n_cluster: number of cluster to divide the set into all_properties: all CSS p...
Find partition rule for a set of CSS property based on its popularity
[ "Find", "partition", "rule", "for", "a", "set", "of", "CSS", "property", "based", "on", "its", "popularity" ]
def find_partition_rule(css_property_set, all_properties, n_cluster, transform=lambda x: x): _, cluster_alloc, _ = cluster.k_means( [transform(p[1]) for p in css_property_set], n_cluster=n_cluster) return [ all_properties[cs...
[ "def", "find_partition_rule", "(", "css_property_set", ",", "all_properties", ",", "n_cluster", ",", "transform", "=", "lambda", "x", ":", "x", ")", ":", "_", ",", "cluster_alloc", ",", "_", "=", "cluster", ".", "k_means", "(", "[", "transform", "(", "p", ...
Find partition rule for a set of CSS property based on its popularity
[ "Find", "partition", "rule", "for", "a", "set", "of", "CSS", "property", "based", "on", "its", "popularity" ]
[ "\"\"\"Find partition rule for a set of CSS property based on its popularity\n\n Args:\n css_property_set: list of CSS properties and their popularity of form\n [(css_property_name, popularity_score)..]\n n_cluster: number of cluster to divide the set into\n all_prop...
[ { "param": "css_property_set", "type": null }, { "param": "all_properties", "type": null }, { "param": "n_cluster", "type": null }, { "param": "transform", "type": null } ]
{ "returns": [ { "docstring": "partition rule for css_property_set", "docstring_tokens": [ "partition", "rule", "for", "css_property_set" ], "type": null } ], "raises": [], "params": [ { "identifier": "css_property_set", "type": nul...
2e6dbd9171b7d3b6299ba02e714173be0e96097a
sunlongbo/chromium
third_party/blink/renderer/build/scripts/update_css_ranking.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
produce_partition_rule
null
def produce_partition_rule(config_file, css_ranking_api): """Find the partition rule for the groups and print them to config_file Args: config_file: the file to write the parameters to css_ranking_api: url to CSS ranking api """ css_ranking = sorted(json.loads(urlopen(css_ranking_api)....
Find the partition rule for the groups and print them to config_file Args: config_file: the file to write the parameters to css_ranking_api: url to CSS ranking api
Find the partition rule for the groups and print them to config_file
[ "Find", "the", "partition", "rule", "for", "the", "groups", "and", "print", "them", "to", "config_file" ]
def produce_partition_rule(config_file, css_ranking_api): css_ranking = sorted(json.loads(urlopen(css_ranking_api).read()), key=lambda x: -x["day_percentage"]) total_css_properties = len(css_ranking) css_ranking_dictionary = dict( [(x["property_name"], x["day_percentage"] * ...
[ "def", "produce_partition_rule", "(", "config_file", ",", "css_ranking_api", ")", ":", "css_ranking", "=", "sorted", "(", "json", ".", "loads", "(", "urlopen", "(", "css_ranking_api", ")", ".", "read", "(", ")", ")", ",", "key", "=", "lambda", "x", ":", ...
Find the partition rule for the groups and print them to config_file
[ "Find", "the", "partition", "rule", "for", "the", "groups", "and", "print", "them", "to", "config_file" ]
[ "\"\"\"Find the partition rule for the groups and print them to config_file\n\n Args:\n config_file: the file to write the parameters to\n css_ranking_api: url to CSS ranking api\n\n \"\"\"" ]
[ { "param": "config_file", "type": null }, { "param": "css_ranking_api", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "config_file", "type": null, "docstring": "the file to write the parameters to", "docstring_tokens": [ "the", "file", "to", "write", "the", "parameters", "to" ], ...
8d1d82c791d790dc3451f197aa2776178d69b619
sunlongbo/chromium
third_party/blink/tools/blinkpy/style/checker.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
_all_categories
<not_specific>
def _all_categories(): """Return the set of all categories used by check_blink_style.py.""" # Take the union across all checkers. categories = CommonCategories.union(CppChecker.categories) categories = categories.union(JSONChecker.categories) categories = categories.union(TestExpectationsChecker.cat...
Return the set of all categories used by check_blink_style.py.
Return the set of all categories used by check_blink_style.py.
[ "Return", "the", "set", "of", "all", "categories", "used", "by", "check_blink_style", ".", "py", "." ]
def _all_categories(): categories = CommonCategories.union(CppChecker.categories) categories = categories.union(JSONChecker.categories) categories = categories.union(TestExpectationsChecker.categories) categories = categories.union(PNGChecker.categories) categories = categories.union(['pep8/W191', '...
[ "def", "_all_categories", "(", ")", ":", "categories", "=", "CommonCategories", ".", "union", "(", "CppChecker", ".", "categories", ")", "categories", "=", "categories", ".", "union", "(", "JSONChecker", ".", "categories", ")", "categories", "=", "categories", ...
Return the set of all categories used by check_blink_style.py.
[ "Return", "the", "set", "of", "all", "categories", "used", "by", "check_blink_style", ".", "py", "." ]
[ "\"\"\"Return the set of all categories used by check_blink_style.py.\"\"\"", "# Take the union across all checkers.", "# FIXME: Consider adding all of the pep8 categories. Since they", "# are not too meaningful for documentation purposes, for", "# now we add only the categories needed for th...
[]
{ "returns": [], "raises": [], "params": [], "outlier_params": [], "others": [] }
8d1d82c791d790dc3451f197aa2776178d69b619
sunlongbo/chromium
third_party/blink/tools/blinkpy/style/checker.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
_check_blink_style_defaults
<not_specific>
def _check_blink_style_defaults(): """Return the default command-line options for check_blink_style.py.""" return DefaultCommandOptionValues( min_confidence=_DEFAULT_MIN_CONFIDENCE, output_format=_DEFAULT_OUTPUT_FORMAT)
Return the default command-line options for check_blink_style.py.
Return the default command-line options for check_blink_style.py.
[ "Return", "the", "default", "command", "-", "line", "options", "for", "check_blink_style", ".", "py", "." ]
def _check_blink_style_defaults(): return DefaultCommandOptionValues( min_confidence=_DEFAULT_MIN_CONFIDENCE, output_format=_DEFAULT_OUTPUT_FORMAT)
[ "def", "_check_blink_style_defaults", "(", ")", ":", "return", "DefaultCommandOptionValues", "(", "min_confidence", "=", "_DEFAULT_MIN_CONFIDENCE", ",", "output_format", "=", "_DEFAULT_OUTPUT_FORMAT", ")" ]
Return the default command-line options for check_blink_style.py.
[ "Return", "the", "default", "command", "-", "line", "options", "for", "check_blink_style", ".", "py", "." ]
[ "\"\"\"Return the default command-line options for check_blink_style.py.\"\"\"" ]
[]
{ "returns": [], "raises": [], "params": [], "outlier_params": [], "others": [] }
8d1d82c791d790dc3451f197aa2776178d69b619
sunlongbo/chromium
third_party/blink/tools/blinkpy/style/checker.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
_create_log_handlers
<not_specific>
def _create_log_handlers(stream): """Create and return a default list of logging.Handler instances. Format WARNING messages and above to display the logging level, and messages strictly below WARNING not to display it. Args: stream: See the configure_logging() docstring. """ # Handles lo...
Create and return a default list of logging.Handler instances. Format WARNING messages and above to display the logging level, and messages strictly below WARNING not to display it. Args: stream: See the configure_logging() docstring.
Create and return a default list of logging.Handler instances. Format WARNING messages and above to display the logging level, and messages strictly below WARNING not to display it.
[ "Create", "and", "return", "a", "default", "list", "of", "logging", ".", "Handler", "instances", ".", "Format", "WARNING", "messages", "and", "above", "to", "display", "the", "logging", "level", "and", "messages", "strictly", "below", "WARNING", "not", "to", ...
def _create_log_handlers(stream): error_handler = logging.StreamHandler(stream) error_handler.setLevel(logging.WARNING) formatter = logging.Formatter('%(levelname)s: %(message)s') error_handler.setFormatter(formatter) non_error_filter = logging.Filter() non_error_filter.filter = lambda record: r...
[ "def", "_create_log_handlers", "(", "stream", ")", ":", "error_handler", "=", "logging", ".", "StreamHandler", "(", "stream", ")", "error_handler", ".", "setLevel", "(", "logging", ".", "WARNING", ")", "formatter", "=", "logging", ".", "Formatter", "(", "'%(le...
Create and return a default list of logging.Handler instances.
[ "Create", "and", "return", "a", "default", "list", "of", "logging", ".", "Handler", "instances", "." ]
[ "\"\"\"Create and return a default list of logging.Handler instances.\n\n Format WARNING messages and above to display the logging level, and\n messages strictly below WARNING not to display it.\n\n Args:\n stream: See the configure_logging() docstring.\n \"\"\"", "# Handles logging.WARNING and a...
[ { "param": "stream", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "stream", "type": null, "docstring": "See the configure_logging() docstring.", "docstring_tokens": [ "See", "the", "configure_logging", "()", "docstring", "." ], "defa...
8d1d82c791d790dc3451f197aa2776178d69b619
sunlongbo/chromium
third_party/blink/tools/blinkpy/style/checker.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
_create_debug_log_handlers
<not_specific>
def _create_debug_log_handlers(stream): """Create and return a list of logging.Handler instances for debugging. Args: stream: See the configure_logging() docstring. """ handler = logging.StreamHandler(stream) formatter = logging.Formatter('%(name)s: %(levelname)-8s %(message)s') handler.s...
Create and return a list of logging.Handler instances for debugging. Args: stream: See the configure_logging() docstring.
Create and return a list of logging.Handler instances for debugging.
[ "Create", "and", "return", "a", "list", "of", "logging", ".", "Handler", "instances", "for", "debugging", "." ]
def _create_debug_log_handlers(stream): handler = logging.StreamHandler(stream) formatter = logging.Formatter('%(name)s: %(levelname)-8s %(message)s') handler.setFormatter(formatter) return [handler]
[ "def", "_create_debug_log_handlers", "(", "stream", ")", ":", "handler", "=", "logging", ".", "StreamHandler", "(", "stream", ")", "formatter", "=", "logging", ".", "Formatter", "(", "'%(name)s: %(levelname)-8s %(message)s'", ")", "handler", ".", "setFormatter", "("...
Create and return a list of logging.Handler instances for debugging.
[ "Create", "and", "return", "a", "list", "of", "logging", ".", "Handler", "instances", "for", "debugging", "." ]
[ "\"\"\"Create and return a list of logging.Handler instances for debugging.\n\n Args:\n stream: See the configure_logging() docstring.\n \"\"\"" ]
[ { "param": "stream", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "stream", "type": null, "docstring": "See the configure_logging() docstring.", "docstring_tokens": [ "See", "the", "configure_logging", "()", "docstring", "." ], "defa...
8d1d82c791d790dc3451f197aa2776178d69b619
sunlongbo/chromium
third_party/blink/tools/blinkpy/style/checker.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
configure_logging
<not_specific>
def configure_logging(stream, logger=None, is_verbose=False): """Configure logging, and return the list of handlers added. Returns: A list of references to the logging handlers added to the root logger. This allows the caller to later remove the handlers using logger.removeHandler. This is ...
Configure logging, and return the list of handlers added. Returns: A list of references to the logging handlers added to the root logger. This allows the caller to later remove the handlers using logger.removeHandler. This is useful primarily during unit testing where the caller may want ...
Configure logging, and return the list of handlers added.
[ "Configure", "logging", "and", "return", "the", "list", "of", "handlers", "added", "." ]
def configure_logging(stream, logger=None, is_verbose=False): Traceback (most recent call last): File "/System/Library/Frameworks/Python.framework/Versions/2.6/... lib/python2.6/logging/__init__.py", line 761, in emit self.stream.write(fs % msg.encode(self.stream.encoding)) Lookup...
[ "def", "configure_logging", "(", "stream", ",", "logger", "=", "None", ",", "is_verbose", "=", "False", ")", ":", "if", "logger", "is", "None", ":", "logger", "=", "logging", ".", "getLogger", "(", ")", "if", "is_verbose", ":", "logging_level", "=", "log...
Configure logging, and return the list of handlers added.
[ "Configure", "logging", "and", "return", "the", "list", "of", "handlers", "added", "." ]
[ "\"\"\"Configure logging, and return the list of handlers added.\n\n Returns:\n A list of references to the logging handlers added to the root\n logger. This allows the caller to later remove the handlers\n using logger.removeHandler. This is useful primarily during unit\n testing where the...
[ { "param": "stream", "type": null }, { "param": "logger", "type": null }, { "param": "is_verbose", "type": null } ]
{ "returns": [ { "docstring": "A list of references to the logging handlers added to the root\nlogger. This allows the caller to later remove the handlers\nusing logger.removeHandler. This is useful primarily during unit\ntesting where the caller may want to configure logging temporarily\nand then undo th...
8d1d82c791d790dc3451f197aa2776178d69b619
sunlongbo/chromium
third_party/blink/tools/blinkpy/style/checker.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
should_skip_without_warning
<not_specific>
def should_skip_without_warning(self, file_path): """Return whether the given file should be skipped without a warning.""" if not self._file_type(file_path): # FileType.NONE. return True # Since "web_tests" is in _SKIPPED_FILES_WITHOUT_WARNING, make # an exception to prevent...
Return whether the given file should be skipped without a warning.
Return whether the given file should be skipped without a warning.
[ "Return", "whether", "the", "given", "file", "should", "be", "skipped", "without", "a", "warning", "." ]
def should_skip_without_warning(self, file_path): if not self._file_type(file_path): return True FIXME: Figure out a good way to avoid having to add special logic for this special case. basename = os.path.basename(file_path) if basename == 'TestExpectations...
[ "def", "should_skip_without_warning", "(", "self", ",", "file_path", ")", ":", "if", "not", "self", ".", "_file_type", "(", "file_path", ")", ":", "return", "True", "basename", "=", "os", ".", "path", ".", "basename", "(", "file_path", ")", "if", "basename...
Return whether the given file should be skipped without a warning.
[ "Return", "whether", "the", "given", "file", "should", "be", "skipped", "without", "a", "warning", "." ]
[ "\"\"\"Return whether the given file should be skipped without a warning.\"\"\"", "# FileType.NONE.", "# Since \"web_tests\" is in _SKIPPED_FILES_WITHOUT_WARNING, make", "# an exception to prevent files like 'TestExpectations' from being skipped.", "#", "# FIXME: Figure out a good way to avoid having to a...
[ { "param": "self", "type": null }, { "param": "file_path", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "file_path", "type": null, "docstring": null, "docstring_token...
8d1d82c791d790dc3451f197aa2776178d69b619
sunlongbo/chromium
third_party/blink/tools/blinkpy/style/checker.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
_file_type
<not_specific>
def _file_type(self, file_path): """Return the file type corresponding to the given file.""" file_extension = self._file_extension(file_path) if (file_extension in _CPP_FILE_EXTENSIONS) or (file_path == '-'): # FIXME: Do something about the comment below and the issue it ...
Return the file type corresponding to the given file.
Return the file type corresponding to the given file.
[ "Return", "the", "file", "type", "corresponding", "to", "the", "given", "file", "." ]
def _file_type(self, file_path): file_extension = self._file_extension(file_path) if (file_extension in _CPP_FILE_EXTENSIONS) or (file_path == '-'): Treat stdin as C++. Since the extension is unknown when reading from stdin, cpp_style tests should not rely on the e...
[ "def", "_file_type", "(", "self", ",", "file_path", ")", ":", "file_extension", "=", "self", ".", "_file_extension", "(", "file_path", ")", "if", "(", "file_extension", "in", "_CPP_FILE_EXTENSIONS", ")", "or", "(", "file_path", "==", "'-'", ")", ":", "return...
Return the file type corresponding to the given file.
[ "Return", "the", "file", "type", "corresponding", "to", "the", "given", "file", "." ]
[ "\"\"\"Return the file type corresponding to the given file.\"\"\"", "# FIXME: Do something about the comment below and the issue it", "# raises since cpp_style already relies on the extension.", "#", "# Treat stdin as C++. Since the extension is unknown when", "# reading from stdin, cpp_style test...
[ { "param": "self", "type": null }, { "param": "file_path", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "file_path", "type": null, "docstring": null, "docstring_token...
8d1d82c791d790dc3451f197aa2776178d69b619
sunlongbo/chromium
third_party/blink/tools/blinkpy/style/checker.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
_create_checker
<not_specific>
def _create_checker(self, file_type, file_path, handle_style_error, min_confidence): """Instantiate and return a style checker based on file type.""" if file_type == FileType.NONE: checker = None elif file_type == FileType.CPP: file_extension = sel...
Instantiate and return a style checker based on file type.
Instantiate and return a style checker based on file type.
[ "Instantiate", "and", "return", "a", "style", "checker", "based", "on", "file", "type", "." ]
def _create_checker(self, file_type, file_path, handle_style_error, min_confidence): if file_type == FileType.NONE: checker = None elif file_type == FileType.CPP: file_extension = self._file_extension(file_path) checker = CppChecker(file_path, ...
[ "def", "_create_checker", "(", "self", ",", "file_type", ",", "file_path", ",", "handle_style_error", ",", "min_confidence", ")", ":", "if", "file_type", "==", "FileType", ".", "NONE", ":", "checker", "=", "None", "elif", "file_type", "==", "FileType", ".", ...
Instantiate and return a style checker based on file type.
[ "Instantiate", "and", "return", "a", "style", "checker", "based", "on", "file", "type", "." ]
[ "\"\"\"Instantiate and return a style checker based on file type.\"\"\"" ]
[ { "param": "self", "type": null }, { "param": "file_type", "type": null }, { "param": "file_path", "type": null }, { "param": "handle_style_error", "type": null }, { "param": "min_confidence", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "file_type", "type": null, "docstring": null, "docstring_token...
8d1d82c791d790dc3451f197aa2776178d69b619
sunlongbo/chromium
third_party/blink/tools/blinkpy/style/checker.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
dispatch
<not_specific>
def dispatch(self, file_path, handle_style_error, min_confidence): """Instantiate and return a style checker based on file path.""" file_type = self._file_type(file_path) checker = self._create_checker(file_type, file_path, handle_style_error, min_confiden...
Instantiate and return a style checker based on file path.
Instantiate and return a style checker based on file path.
[ "Instantiate", "and", "return", "a", "style", "checker", "based", "on", "file", "path", "." ]
def dispatch(self, file_path, handle_style_error, min_confidence): file_type = self._file_type(file_path) checker = self._create_checker(file_type, file_path, handle_style_error, min_confidence) return checker
[ "def", "dispatch", "(", "self", ",", "file_path", ",", "handle_style_error", ",", "min_confidence", ")", ":", "file_type", "=", "self", ".", "_file_type", "(", "file_path", ")", "checker", "=", "self", ".", "_create_checker", "(", "file_type", ",", "file_path"...
Instantiate and return a style checker based on file path.
[ "Instantiate", "and", "return", "a", "style", "checker", "based", "on", "file", "path", "." ]
[ "\"\"\"Instantiate and return a style checker based on file path.\"\"\"" ]
[ { "param": "self", "type": null }, { "param": "file_path", "type": null }, { "param": "handle_style_error", "type": null }, { "param": "min_confidence", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "file_path", "type": null, "docstring": null, "docstring_token...
8d1d82c791d790dc3451f197aa2776178d69b619
sunlongbo/chromium
third_party/blink/tools/blinkpy/style/checker.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
is_reportable
<not_specific>
def is_reportable(self, category, confidence_in_error, file_path): """Return whether an error is reportable. An error is reportable if both the confidence in the error is at least the minimum confidence level and the current filter says the category should be checked for the given path....
Return whether an error is reportable. An error is reportable if both the confidence in the error is at least the minimum confidence level and the current filter says the category should be checked for the given path. Args: category: A string that is a style category. ...
Return whether an error is reportable. An error is reportable if both the confidence in the error is at least the minimum confidence level and the current filter says the category should be checked for the given path.
[ "Return", "whether", "an", "error", "is", "reportable", ".", "An", "error", "is", "reportable", "if", "both", "the", "confidence", "in", "the", "error", "is", "at", "least", "the", "minimum", "confidence", "level", "and", "the", "current", "filter", "says", ...
def is_reportable(self, category, confidence_in_error, file_path): if confidence_in_error < self.min_confidence: return False return self._filter_configuration.should_check(category, file_path)
[ "def", "is_reportable", "(", "self", ",", "category", ",", "confidence_in_error", ",", "file_path", ")", ":", "if", "confidence_in_error", "<", "self", ".", "min_confidence", ":", "return", "False", "return", "self", ".", "_filter_configuration", ".", "should_chec...
Return whether an error is reportable.
[ "Return", "whether", "an", "error", "is", "reportable", "." ]
[ "\"\"\"Return whether an error is reportable.\n\n An error is reportable if both the confidence in the error is\n at least the minimum confidence level and the current filter\n says the category should be checked for the given path.\n\n Args:\n category: A string that is a style...
[ { "param": "self", "type": null }, { "param": "category", "type": null }, { "param": "confidence_in_error", "type": null }, { "param": "file_path", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "category", "type": null, "docstring": "A string that is a style cat...
8d1d82c791d790dc3451f197aa2776178d69b619
sunlongbo/chromium
third_party/blink/tools/blinkpy/style/checker.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
write_style_error
null
def write_style_error(self, category, confidence_in_error, file_path, line_number, message): """Write a style error to the configured stderr.""" if self._output_format == 'vs7': format_string = '%s(%s): %s [%s] [%d]\n' else: format_string = '%s...
Write a style error to the configured stderr.
Write a style error to the configured stderr.
[ "Write", "a", "style", "error", "to", "the", "configured", "stderr", "." ]
def write_style_error(self, category, confidence_in_error, file_path, line_number, message): if self._output_format == 'vs7': format_string = '%s(%s): %s [%s] [%d]\n' else: format_string = '%s:%s: %s [%s] [%d]\n' self.stderr_write(format_stri...
[ "def", "write_style_error", "(", "self", ",", "category", ",", "confidence_in_error", ",", "file_path", ",", "line_number", ",", "message", ")", ":", "if", "self", ".", "_output_format", "==", "'vs7'", ":", "format_string", "=", "'%s(%s): %s [%s] [%d]\\n'", "els...
Write a style error to the configured stderr.
[ "Write", "a", "style", "error", "to", "the", "configured", "stderr", "." ]
[ "\"\"\"Write a style error to the configured stderr.\"\"\"" ]
[ { "param": "self", "type": null }, { "param": "category", "type": null }, { "param": "confidence_in_error", "type": null }, { "param": "file_path", "type": null }, { "param": "line_number", "type": null }, { "param": "message", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "category", "type": null, "docstring": null, "docstring_tokens...
8d1d82c791d790dc3451f197aa2776178d69b619
sunlongbo/chromium
third_party/blink/tools/blinkpy/style/checker.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
should_process
null
def should_process(self, file_path): """Return whether the file at file_path should be processed. The TextFileReader class calls this method prior to reading in the lines of a file. Use this method, for example, to prevent the style checker from reading binary files into memory. ...
Return whether the file at file_path should be processed. The TextFileReader class calls this method prior to reading in the lines of a file. Use this method, for example, to prevent the style checker from reading binary files into memory.
Return whether the file at file_path should be processed. The TextFileReader class calls this method prior to reading in the lines of a file. Use this method, for example, to prevent the style checker from reading binary files into memory.
[ "Return", "whether", "the", "file", "at", "file_path", "should", "be", "processed", ".", "The", "TextFileReader", "class", "calls", "this", "method", "prior", "to", "reading", "in", "the", "lines", "of", "a", "file", ".", "Use", "this", "method", "for", "e...
def should_process(self, file_path): raise NotImplementedError('Subclasses should implement.')
[ "def", "should_process", "(", "self", ",", "file_path", ")", ":", "raise", "NotImplementedError", "(", "'Subclasses should implement.'", ")" ]
Return whether the file at file_path should be processed.
[ "Return", "whether", "the", "file", "at", "file_path", "should", "be", "processed", "." ]
[ "\"\"\"Return whether the file at file_path should be processed.\n\n The TextFileReader class calls this method prior to reading in\n the lines of a file. Use this method, for example, to prevent\n the style checker from reading binary files into memory.\n \"\"\"" ]
[ { "param": "self", "type": null }, { "param": "file_path", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "file_path", "type": null, "docstring": null, "docstring_token...
8d1d82c791d790dc3451f197aa2776178d69b619
sunlongbo/chromium
third_party/blink/tools/blinkpy/style/checker.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
process
null
def process(self, lines, file_path, **kwargs): """Process lines of text read from a file. Args: lines: A list of lines of text to process. file_path: The path from which the lines were read. **kwargs: This argument signifies that the process() method of ...
Process lines of text read from a file. Args: lines: A list of lines of text to process. file_path: The path from which the lines were read. **kwargs: This argument signifies that the process() method of subclasses of ProcessorBase may support additional ...
Process lines of text read from a file.
[ "Process", "lines", "of", "text", "read", "from", "a", "file", "." ]
def process(self, lines, file_path, **kwargs): raise NotImplementedError('Subclasses should implement.')
[ "def", "process", "(", "self", ",", "lines", ",", "file_path", ",", "**", "kwargs", ")", ":", "raise", "NotImplementedError", "(", "'Subclasses should implement.'", ")" ]
Process lines of text read from a file.
[ "Process", "lines", "of", "text", "read", "from", "a", "file", "." ]
[ "\"\"\"Process lines of text read from a file.\n\n Args:\n lines: A list of lines of text to process.\n file_path: The path from which the lines were read.\n **kwargs: This argument signifies that the process() method of\n subclasses of ProcessorBase may support ...
[ { "param": "self", "type": null }, { "param": "lines", "type": null }, { "param": "file_path", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "lines", "type": null, "docstring": "A list of lines of text to proc...
8d1d82c791d790dc3451f197aa2776178d69b619
sunlongbo/chromium
third_party/blink/tools/blinkpy/style/checker.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
should_process
<not_specific>
def should_process(self, file_path): """Return whether the file should be checked for style.""" if self._dispatcher.should_skip_without_warning(file_path): return False return True
Return whether the file should be checked for style.
Return whether the file should be checked for style.
[ "Return", "whether", "the", "file", "should", "be", "checked", "for", "style", "." ]
def should_process(self, file_path): if self._dispatcher.should_skip_without_warning(file_path): return False return True
[ "def", "should_process", "(", "self", ",", "file_path", ")", ":", "if", "self", ".", "_dispatcher", ".", "should_skip_without_warning", "(", "file_path", ")", ":", "return", "False", "return", "True" ]
Return whether the file should be checked for style.
[ "Return", "whether", "the", "file", "should", "be", "checked", "for", "style", "." ]
[ "\"\"\"Return whether the file should be checked for style.\"\"\"" ]
[ { "param": "self", "type": null }, { "param": "file_path", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "file_path", "type": null, "docstring": null, "docstring_token...
8d1d82c791d790dc3451f197aa2776178d69b619
sunlongbo/chromium
third_party/blink/tools/blinkpy/style/checker.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
process
null
def process(self, lines, file_path, line_numbers=None): """Check the given lines for style. Arguments: lines: A list of all lines in the file to check. file_path: The path of the file to process. If possible, the path should be relative to the source root. Oth...
Check the given lines for style. Arguments: lines: A list of all lines in the file to check. file_path: The path of the file to process. If possible, the path should be relative to the source root. Otherwise, path-specific logic may not behave as ...
Check the given lines for style.
[ "Check", "the", "given", "lines", "for", "style", "." ]
def process(self, lines, file_path, line_numbers=None): _log.debug('Checking style: ' + file_path) style_error_handler = DefaultStyleErrorHandler( configuration=self._configuration, file_path=file_path, increment_error_count=self._increment_error_count, li...
[ "def", "process", "(", "self", ",", "lines", ",", "file_path", ",", "line_numbers", "=", "None", ")", ":", "_log", ".", "debug", "(", "'Checking style: '", "+", "file_path", ")", "style_error_handler", "=", "DefaultStyleErrorHandler", "(", "configuration", "=", ...
Check the given lines for style.
[ "Check", "the", "given", "lines", "for", "style", "." ]
[ "\"\"\"Check the given lines for style.\n\n Arguments:\n lines: A list of all lines in the file to check.\n file_path: The path of the file to process. If possible, the path\n should be relative to the source root. Otherwise,\n path-specific logic m...
[ { "param": "self", "type": null }, { "param": "lines", "type": null }, { "param": "file_path", "type": null }, { "param": "line_numbers", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "lines", "type": null, "docstring": "A list of all lines in the file...
bc03b3d14d5f2c34f1b007ec6ab275327c04fc1b
sunlongbo/chromium
chrome/updater/mac/signing/parts.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
sign_all
null
def sign_all(paths, config): """Code signs the application bundle and all of its internal nested code parts. Args: paths: A |model.Paths| object. config: The |model.CodeSignConfig| object. The |app_product| binary and nested binaries must exist in |paths.work|. """ parts...
Code signs the application bundle and all of its internal nested code parts. Args: paths: A |model.Paths| object. config: The |model.CodeSignConfig| object. The |app_product| binary and nested binaries must exist in |paths.work|.
Code signs the application bundle and all of its internal nested code parts.
[ "Code", "signs", "the", "application", "bundle", "and", "all", "of", "its", "internal", "nested", "code", "parts", "." ]
def sign_all(paths, config): parts = get_parts(config) for part in parts: signing.sign_part(paths, config, part) signing.verify_part(paths, part) signing.validate_app(paths, config, parts[-1])
[ "def", "sign_all", "(", "paths", ",", "config", ")", ":", "parts", "=", "get_parts", "(", "config", ")", "for", "part", "in", "parts", ":", "signing", ".", "sign_part", "(", "paths", ",", "config", ",", "part", ")", "signing", ".", "verify_part", "(", ...
Code signs the application bundle and all of its internal nested code parts.
[ "Code", "signs", "the", "application", "bundle", "and", "all", "of", "its", "internal", "nested", "code", "parts", "." ]
[ "\"\"\"Code signs the application bundle and all of its internal nested code\n parts.\n\n Args:\n paths: A |model.Paths| object.\n config: The |model.CodeSignConfig| object. The |app_product| binary and\n nested binaries must exist in |paths.work|.\n \"\"\"" ]
[ { "param": "paths", "type": null }, { "param": "config", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "paths", "type": null, "docstring": "A |model.Paths| object.", "docstring_tokens": [ "A", "|model", ".", "Paths|", "object", "." ], "default": null, "is_optional...
bc1c3489f7ff77c43236da1d90d352649461a64d
sunlongbo/chromium
components/policy/tools/template_writers/writers/template_writer.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
IsCloudOnlyPolicySupported
<not_specific>
def IsCloudOnlyPolicySupported(self, policy): '''Checks if the given cloud only policy is supported by the writer. Args: policy: The dictionary of the policy. Returns: True if the writer chooses to include the cloud only 'policy' in its output. ''' return False
Checks if the given cloud only policy is supported by the writer. Args: policy: The dictionary of the policy. Returns: True if the writer chooses to include the cloud only 'policy' in its output.
Checks if the given cloud only policy is supported by the writer.
[ "Checks", "if", "the", "given", "cloud", "only", "policy", "is", "supported", "by", "the", "writer", "." ]
def IsCloudOnlyPolicySupported(self, policy): return False
[ "def", "IsCloudOnlyPolicySupported", "(", "self", ",", "policy", ")", ":", "return", "False" ]
Checks if the given cloud only policy is supported by the writer.
[ "Checks", "if", "the", "given", "cloud", "only", "policy", "is", "supported", "by", "the", "writer", "." ]
[ "'''Checks if the given cloud only policy is supported by the writer.\n\n Args:\n policy: The dictionary of the policy.\n\n Returns:\n True if the writer chooses to include the cloud only 'policy' in its\n output.\n '''" ]
[ { "param": "self", "type": null }, { "param": "policy", "type": null } ]
{ "returns": [ { "docstring": "True if the writer chooses to include the cloud only 'policy' in its\noutput.", "docstring_tokens": [ "True", "if", "the", "writer", "chooses", "to", "include", "the", "cloud", "only", ...
bc1c3489f7ff77c43236da1d90d352649461a64d
sunlongbo/chromium
components/policy/tools/template_writers/writers/template_writer.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
IsInternalOnlyPolicySupported
<not_specific>
def IsInternalOnlyPolicySupported(self, policy): '''Checks if the given internal policy is supported by the writer. Args: policy: The dictionary of the policy. Returns: True if the writer chooses to include the internal only 'policy' in its output. ''' return False
Checks if the given internal policy is supported by the writer. Args: policy: The dictionary of the policy. Returns: True if the writer chooses to include the internal only 'policy' in its output.
Checks if the given internal policy is supported by the writer.
[ "Checks", "if", "the", "given", "internal", "policy", "is", "supported", "by", "the", "writer", "." ]
def IsInternalOnlyPolicySupported(self, policy): return False
[ "def", "IsInternalOnlyPolicySupported", "(", "self", ",", "policy", ")", ":", "return", "False" ]
Checks if the given internal policy is supported by the writer.
[ "Checks", "if", "the", "given", "internal", "policy", "is", "supported", "by", "the", "writer", "." ]
[ "'''Checks if the given internal policy is supported by the writer.\n\n Args:\n policy: The dictionary of the policy.\n\n Returns:\n True if the writer chooses to include the internal only 'policy' in its\n output.\n '''" ]
[ { "param": "self", "type": null }, { "param": "policy", "type": null } ]
{ "returns": [ { "docstring": "True if the writer chooses to include the internal only 'policy' in its\noutput.", "docstring_tokens": [ "True", "if", "the", "writer", "chooses", "to", "include", "the", "internal", "only", ...
bc1c3489f7ff77c43236da1d90d352649461a64d
sunlongbo/chromium
components/policy/tools/template_writers/writers/template_writer.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
IsPolicySupported
<not_specific>
def IsPolicySupported(self, policy): '''Checks if the given policy is supported by the writer. In other words, the set of platforms supported by the writer has a common subset with the set of platforms that support the policy. Args: policy: The dictionary of the policy. Returns: Tr...
Checks if the given policy is supported by the writer. In other words, the set of platforms supported by the writer has a common subset with the set of platforms that support the policy. Args: policy: The dictionary of the policy. Returns: True if the writer chooses to include 'policy'...
Checks if the given policy is supported by the writer. In other words, the set of platforms supported by the writer has a common subset with the set of platforms that support the policy.
[ "Checks", "if", "the", "given", "policy", "is", "supported", "by", "the", "writer", ".", "In", "other", "words", "the", "set", "of", "platforms", "supported", "by", "the", "writer", "has", "a", "common", "subset", "with", "the", "set", "of", "platforms", ...
def IsPolicySupported(self, policy): if ('deprecated' in policy and policy['deprecated'] is True and not self.IsDeprecatedPolicySupported(policy)): return False if ('future' in policy and policy['future'] is True and not self.IsFuturePolicySupported(policy)): return False if (sel...
[ "def", "IsPolicySupported", "(", "self", ",", "policy", ")", ":", "if", "(", "'deprecated'", "in", "policy", "and", "policy", "[", "'deprecated'", "]", "is", "True", "and", "not", "self", ".", "IsDeprecatedPolicySupported", "(", "policy", ")", ")", ":", "r...
Checks if the given policy is supported by the writer.
[ "Checks", "if", "the", "given", "policy", "is", "supported", "by", "the", "writer", "." ]
[ "'''Checks if the given policy is supported by the writer.\n In other words, the set of platforms supported by the writer\n has a common subset with the set of platforms that support\n the policy.\n\n Args:\n policy: The dictionary of the policy.\n\n Returns:\n True if the writer chooses to...
[ { "param": "self", "type": null }, { "param": "policy", "type": null } ]
{ "returns": [ { "docstring": "True if the writer chooses to include 'policy' in its output.", "docstring_tokens": [ "True", "if", "the", "writer", "chooses", "to", "include", "'", "policy", "'", "in", "its...
bc1c3489f7ff77c43236da1d90d352649461a64d
sunlongbo/chromium
components/policy/tools/template_writers/writers/template_writer.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
IsPolicySupportedOnWindows
<not_specific>
def IsPolicySupportedOnWindows(self, policy, product=None): ''' Checks if |policy| is supported on any Windows platform. Args: policy: The dictionary of the policy. product: Optional product to check; one of 'chrome', 'chrome_frame', 'chrome_os', 'webview' ''' return (self.IsPolicyO...
Checks if |policy| is supported on any Windows platform. Args: policy: The dictionary of the policy. product: Optional product to check; one of 'chrome', 'chrome_frame', 'chrome_os', 'webview'
Checks if |policy| is supported on any Windows platform.
[ "Checks", "if", "|policy|", "is", "supported", "on", "any", "Windows", "platform", "." ]
def IsPolicySupportedOnWindows(self, policy, product=None): return (self.IsPolicyOrItemSupportedOnPlatform(policy, 'win', product) or self.IsPolicyOrItemSupportedOnPlatform(policy, 'win7', product))
[ "def", "IsPolicySupportedOnWindows", "(", "self", ",", "policy", ",", "product", "=", "None", ")", ":", "return", "(", "self", ".", "IsPolicyOrItemSupportedOnPlatform", "(", "policy", ",", "'win'", ",", "product", ")", "or", "self", ".", "IsPolicyOrItemSupported...
Checks if |policy| is supported on any Windows platform.
[ "Checks", "if", "|policy|", "is", "supported", "on", "any", "Windows", "platform", "." ]
[ "''' Checks if |policy| is supported on any Windows platform.\n\n Args:\n policy: The dictionary of the policy.\n product: Optional product to check; one of\n 'chrome', 'chrome_frame', 'chrome_os', 'webview'\n '''" ]
[ { "param": "self", "type": null }, { "param": "policy", "type": null }, { "param": "product", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "policy", "type": null, "docstring": "The dictionary of the policy."...
bc1c3489f7ff77c43236da1d90d352649461a64d
sunlongbo/chromium
components/policy/tools/template_writers/writers/template_writer.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
IsVersionSupported
<not_specific>
def IsVersionSupported(self, policy, supported_on): '''Checks whether the policy is supported on current version''' major_version = self._GetChromiumMajorVersion() if not major_version: return True since_version = supported_on.get('since_version', None) until_version = supported_on.get('until...
Checks whether the policy is supported on current version
Checks whether the policy is supported on current version
[ "Checks", "whether", "the", "policy", "is", "supported", "on", "current", "version" ]
def IsVersionSupported(self, policy, supported_on): major_version = self._GetChromiumMajorVersion() if not major_version: return True since_version = supported_on.get('since_version', None) until_version = supported_on.get('until_version', None) return ((not since_version or int(since_version)...
[ "def", "IsVersionSupported", "(", "self", ",", "policy", ",", "supported_on", ")", ":", "major_version", "=", "self", ".", "_GetChromiumMajorVersion", "(", ")", "if", "not", "major_version", ":", "return", "True", "since_version", "=", "supported_on", ".", "get"...
Checks whether the policy is supported on current version
[ "Checks", "whether", "the", "policy", "is", "supported", "on", "current", "version" ]
[ "'''Checks whether the policy is supported on current version'''" ]
[ { "param": "self", "type": null }, { "param": "policy", "type": null }, { "param": "supported_on", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "policy", "type": null, "docstring": null, "docstring_tokens":...
bc1c3489f7ff77c43236da1d90d352649461a64d
sunlongbo/chromium
components/policy/tools/template_writers/writers/template_writer.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
WriteTemplate
<not_specific>
def WriteTemplate(self, template): '''Writes the given template definition. Args: template: Template definition to write. Returns: Generated output for the passed template definition. ''' self.messages = template['messages'] self.Init() template['policy_definitions'] = \ ...
Writes the given template definition. Args: template: Template definition to write. Returns: Generated output for the passed template definition.
Writes the given template definition.
[ "Writes", "the", "given", "template", "definition", "." ]
def WriteTemplate(self, template): self.messages = template['messages'] self.Init() template['policy_definitions'] = \ self.PreprocessPolicies(template['policy_definitions']) self.BeginTemplate() self.WritePolicies(template['policy_definitions']) self.EndTemplate() return self.GetTem...
[ "def", "WriteTemplate", "(", "self", ",", "template", ")", ":", "self", ".", "messages", "=", "template", "[", "'messages'", "]", "self", ".", "Init", "(", ")", "template", "[", "'policy_definitions'", "]", "=", "self", ".", "PreprocessPolicies", "(", "tem...
Writes the given template definition.
[ "Writes", "the", "given", "template", "definition", "." ]
[ "'''Writes the given template definition.\n\n Args:\n template: Template definition to write.\n\n Returns:\n Generated output for the passed template definition.\n '''" ]
[ { "param": "self", "type": null }, { "param": "template", "type": null } ]
{ "returns": [ { "docstring": "Generated output for the passed template definition.", "docstring_tokens": [ "Generated", "output", "for", "the", "passed", "template", "definition", "." ], "type": null } ], "raises": []...
bc1c3489f7ff77c43236da1d90d352649461a64d
sunlongbo/chromium
components/policy/tools/template_writers/writers/template_writer.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
WritePolicies
null
def WritePolicies(self, policy_list): '''Appends the template text corresponding to all the policies into the internal buffer. Args: policy_list: A list containing the policies to write. ''' for policy in policy_list: if policy['type'] == 'group': child_policies = list(self._Get...
Appends the template text corresponding to all the policies into the internal buffer. Args: policy_list: A list containing the policies to write.
Appends the template text corresponding to all the policies into the internal buffer.
[ "Appends", "the", "template", "text", "corresponding", "to", "all", "the", "policies", "into", "the", "internal", "buffer", "." ]
def WritePolicies(self, policy_list): for policy in policy_list: if policy['type'] == 'group': child_policies = list(self._GetPoliciesForWriter(policy)) child_recommended_policies = list( filter(self.CanBeRecommended, child_policies)) if child_policies: self.Begin...
[ "def", "WritePolicies", "(", "self", ",", "policy_list", ")", ":", "for", "policy", "in", "policy_list", ":", "if", "policy", "[", "'type'", "]", "==", "'group'", ":", "child_policies", "=", "list", "(", "self", ".", "_GetPoliciesForWriter", "(", "policy", ...
Appends the template text corresponding to all the policies into the internal buffer.
[ "Appends", "the", "template", "text", "corresponding", "to", "all", "the", "policies", "into", "the", "internal", "buffer", "." ]
[ "'''Appends the template text corresponding to all the policies into the\n internal buffer.\n\n Args:\n policy_list: A list containing the policies to write.\n '''", "# Only write nonempty groups.", "# Nesting of groups is currently not supported." ]
[ { "param": "self", "type": null }, { "param": "policy_list", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "policy_list", "type": null, "docstring": "A list containing the pol...
bc1c3489f7ff77c43236da1d90d352649461a64d
sunlongbo/chromium
components/policy/tools/template_writers/writers/template_writer.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
GetLocalizedMessage
<not_specific>
def GetLocalizedMessage(self, msg_id): '''Returns a localized message for this writer. Args: msg_id: The identifier of the message. Returns: The localized message. ''' return self.messages['doc_' + msg_id]['text']
Returns a localized message for this writer. Args: msg_id: The identifier of the message. Returns: The localized message.
Returns a localized message for this writer.
[ "Returns", "a", "localized", "message", "for", "this", "writer", "." ]
def GetLocalizedMessage(self, msg_id): return self.messages['doc_' + msg_id]['text']
[ "def", "GetLocalizedMessage", "(", "self", ",", "msg_id", ")", ":", "return", "self", ".", "messages", "[", "'doc_'", "+", "msg_id", "]", "[", "'text'", "]" ]
Returns a localized message for this writer.
[ "Returns", "a", "localized", "message", "for", "this", "writer", "." ]
[ "'''Returns a localized message for this writer.\n\n Args:\n msg_id: The identifier of the message.\n\n Returns:\n The localized message.\n '''" ]
[ { "param": "self", "type": null }, { "param": "msg_id", "type": null } ]
{ "returns": [ { "docstring": "The localized message.", "docstring_tokens": [ "The", "localized", "message", "." ], "type": null } ], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "do...
bc1c3489f7ff77c43236da1d90d352649461a64d
sunlongbo/chromium
components/policy/tools/template_writers/writers/template_writer.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
HasExpandedPolicyDescription
<not_specific>
def HasExpandedPolicyDescription(self, policy): '''Returns whether the policy has expanded documentation containing the link to the documentation with schema and formatting. ''' return (policy['type'] in ('dict', 'external') or 'url_schema' in policy or 'validation_schema' in policy or 'desc...
Returns whether the policy has expanded documentation containing the link to the documentation with schema and formatting.
Returns whether the policy has expanded documentation containing the link to the documentation with schema and formatting.
[ "Returns", "whether", "the", "policy", "has", "expanded", "documentation", "containing", "the", "link", "to", "the", "documentation", "with", "schema", "and", "formatting", "." ]
def HasExpandedPolicyDescription(self, policy): return (policy['type'] in ('dict', 'external') or 'url_schema' in policy or 'validation_schema' in policy or 'description_schema' in policy)
[ "def", "HasExpandedPolicyDescription", "(", "self", ",", "policy", ")", ":", "return", "(", "policy", "[", "'type'", "]", "in", "(", "'dict'", ",", "'external'", ")", "or", "'url_schema'", "in", "policy", "or", "'validation_schema'", "in", "policy", "or", "'...
Returns whether the policy has expanded documentation containing the link to the documentation with schema and formatting.
[ "Returns", "whether", "the", "policy", "has", "expanded", "documentation", "containing", "the", "link", "to", "the", "documentation", "with", "schema", "and", "formatting", "." ]
[ "'''Returns whether the policy has expanded documentation containing the link\n to the documentation with schema and formatting.\n '''" ]
[ { "param": "self", "type": null }, { "param": "policy", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "policy", "type": null, "docstring": null, "docstring_tokens":...
bc1c3489f7ff77c43236da1d90d352649461a64d
sunlongbo/chromium
components/policy/tools/template_writers/writers/template_writer.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
GetExpandedPolicyDescription
<not_specific>
def GetExpandedPolicyDescription(self, policy): '''Returns the expanded description of the policy containing the link to the documentation with schema and formatting. ''' schema_description_link_text = self.GetLocalizedMessage( 'schema_description_link') url = None if 'url_schema' in pol...
Returns the expanded description of the policy containing the link to the documentation with schema and formatting.
Returns the expanded description of the policy containing the link to the documentation with schema and formatting.
[ "Returns", "the", "expanded", "description", "of", "the", "policy", "containing", "the", "link", "to", "the", "documentation", "with", "schema", "and", "formatting", "." ]
def GetExpandedPolicyDescription(self, policy): schema_description_link_text = self.GetLocalizedMessage( 'schema_description_link') url = None if 'url_schema' in policy: url = policy['url_schema'] if (policy['type'] in ('dict', 'external') or 'validation_schema' in policy or 'descr...
[ "def", "GetExpandedPolicyDescription", "(", "self", ",", "policy", ")", ":", "schema_description_link_text", "=", "self", ".", "GetLocalizedMessage", "(", "'schema_description_link'", ")", "url", "=", "None", "if", "'url_schema'", "in", "policy", ":", "url", "=", ...
Returns the expanded description of the policy containing the link to the documentation with schema and formatting.
[ "Returns", "the", "expanded", "description", "of", "the", "policy", "containing", "the", "link", "to", "the", "documentation", "with", "schema", "and", "formatting", "." ]
[ "'''Returns the expanded description of the policy containing the link to the\n documentation with schema and formatting.\n '''" ]
[ { "param": "self", "type": null }, { "param": "policy", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "policy", "type": null, "docstring": null, "docstring_tokens":...
bb334ff081208e14eab95aaa4c752fac2dd755a5
sunlongbo/chromium
net/data/ssl/scripts/crlsetutil.py
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
Python
_pem_cert_to_binary
<not_specific>
def _pem_cert_to_binary(pem_filename): """Decodes the first PEM-encoded certificate in a given file into binary Args: pem_filename: A filename that contains a PEM-encoded certificate. It may contain additional data (keys, textual representation) which will be ignored Returns: A byte arra...
Decodes the first PEM-encoded certificate in a given file into binary Args: pem_filename: A filename that contains a PEM-encoded certificate. It may contain additional data (keys, textual representation) which will be ignored Returns: A byte array containing the decoded certificate data
Decodes the first PEM-encoded certificate in a given file into binary
[ "Decodes", "the", "first", "PEM", "-", "encoded", "certificate", "in", "a", "given", "file", "into", "binary" ]
def _pem_cert_to_binary(pem_filename): pem_data = "" started = False with open(pem_filename, 'r') as pem_file: for line in pem_file: if not started: if line.startswith('-----BEGIN CERTIFICATE'): started = True else: if line.startswith('-----END CERTIFICATE'): br...
[ "def", "_pem_cert_to_binary", "(", "pem_filename", ")", ":", "pem_data", "=", "\"\"", "started", "=", "False", "with", "open", "(", "pem_filename", ",", "'r'", ")", "as", "pem_file", ":", "for", "line", "in", "pem_file", ":", "if", "not", "started", ":", ...
Decodes the first PEM-encoded certificate in a given file into binary
[ "Decodes", "the", "first", "PEM", "-", "encoded", "certificate", "in", "a", "given", "file", "into", "binary" ]
[ "\"\"\"Decodes the first PEM-encoded certificate in a given file into binary\n\n Args:\n pem_filename: A filename that contains a PEM-encoded certificate. It may\n contain additional data (keys, textual representation) which will be\n ignored\n\n Returns:\n A byte array containing the decoded ...
[ { "param": "pem_filename", "type": null } ]
{ "returns": [ { "docstring": "A byte array containing the decoded certificate data", "docstring_tokens": [ "A", "byte", "array", "containing", "the", "decoded", "certificate", "data" ], "type": null } ], "raises": [],...