repository_name
stringlengths
5
67
func_path_in_repository
stringlengths
4
234
func_name
stringlengths
0
314
whole_func_string
stringlengths
52
3.87M
language
stringclasses
6 values
func_code_string
stringlengths
52
3.87M
func_code_tokens
listlengths
15
672k
func_documentation_string
stringlengths
1
47.2k
func_documentation_tokens
listlengths
1
3.92k
split_name
stringclasses
1 value
func_code_url
stringlengths
85
339
CartoDB/carto-python
carto/maps.py
NamedMap.update_from_dict
def update_from_dict(self, attribute_dict): """ Method overriden from the base class """ if 'template' in attribute_dict: self.update_from_dict(attribute_dict['template']) setattr(self, self.Meta.id_field, attribute_dict['template']['name']) ...
python
def update_from_dict(self, attribute_dict): """ Method overriden from the base class """ if 'template' in attribute_dict: self.update_from_dict(attribute_dict['template']) setattr(self, self.Meta.id_field, attribute_dict['template']['name']) ...
[ "def", "update_from_dict", "(", "self", ",", "attribute_dict", ")", ":", "if", "'template'", "in", "attribute_dict", ":", "self", ".", "update_from_dict", "(", "attribute_dict", "[", "'template'", "]", ")", "setattr", "(", "self", ",", "self", ".", "Meta", "...
Method overriden from the base class
[ "Method", "overriden", "from", "the", "base", "class" ]
train
https://github.com/CartoDB/carto-python/blob/f6ac3d17ed08e5bc3f99edd2bde4fb7dba3eee16/carto/maps.py#L165-L179
CartoDB/carto-python
carto/maps.py
AnonymousMap.instantiate
def instantiate(self, params): """ Allows you to fetch the map tiles of a created map :param params: The json with the styling info for the named map :type params: dict :return: :raise: CartoException """ try: self.send(self.Meta.collection_...
python
def instantiate(self, params): """ Allows you to fetch the map tiles of a created map :param params: The json with the styling info for the named map :type params: dict :return: :raise: CartoException """ try: self.send(self.Meta.collection_...
[ "def", "instantiate", "(", "self", ",", "params", ")", ":", "try", ":", "self", ".", "send", "(", "self", ".", "Meta", ".", "collection_endpoint", ",", "\"POST\"", ",", "json", "=", "params", ")", "except", "CartoRateLimitException", "as", "e", ":", "rai...
Allows you to fetch the map tiles of a created map :param params: The json with the styling info for the named map :type params: dict :return: :raise: CartoException
[ "Allows", "you", "to", "fetch", "the", "map", "tiles", "of", "a", "created", "map" ]
train
https://github.com/CartoDB/carto-python/blob/f6ac3d17ed08e5bc3f99edd2bde4fb7dba3eee16/carto/maps.py#L190-L206
CartoDB/carto-python
carto/resources.py
AsyncResource.run
def run(self, **client_params): """ Actually creates the async job on the CARTO server :param client_params: To be send to the CARTO API. See CARTO's documentation depending on the subclass you are using :type client_param...
python
def run(self, **client_params): """ Actually creates the async job on the CARTO server :param client_params: To be send to the CARTO API. See CARTO's documentation depending on the subclass you are using :type client_param...
[ "def", "run", "(", "self", ",", "*", "*", "client_params", ")", ":", "try", ":", "self", ".", "send", "(", "self", ".", "get_collection_endpoint", "(", ")", ",", "http_method", "=", "\"POST\"", ",", "*", "*", "client_params", ")", "except", "Exception", ...
Actually creates the async job on the CARTO server :param client_params: To be send to the CARTO API. See CARTO's documentation depending on the subclass you are using :type client_params: kwargs :return: :raise: CartoEx...
[ "Actually", "creates", "the", "async", "job", "on", "the", "CARTO", "server" ]
train
https://github.com/CartoDB/carto-python/blob/f6ac3d17ed08e5bc3f99edd2bde4fb7dba3eee16/carto/resources.py#L22-L41
CartoDB/carto-python
carto/sql.py
SQLClient.send
def send(self, sql, parse_json=True, do_post=True, format=None, **request_args): """ Executes SQL query in a CARTO server :param sql: The SQL :param parse_json: Set it to False if you want raw reponse :param do_post: Set it to True to force post request :param format: An...
python
def send(self, sql, parse_json=True, do_post=True, format=None, **request_args): """ Executes SQL query in a CARTO server :param sql: The SQL :param parse_json: Set it to False if you want raw reponse :param do_post: Set it to True to force post request :param format: An...
[ "def", "send", "(", "self", ",", "sql", ",", "parse_json", "=", "True", ",", "do_post", "=", "True", ",", "format", "=", "None", ",", "*", "*", "request_args", ")", ":", "try", ":", "params", "=", "{", "'q'", ":", "sql", "}", "if", "format", ":",...
Executes SQL query in a CARTO server :param sql: The SQL :param parse_json: Set it to False if you want raw reponse :param do_post: Set it to True to force post request :param format: Any of the data export formats allowed by CARTO's SQL API :param reques...
[ "Executes", "SQL", "query", "in", "a", "CARTO", "server" ]
train
https://github.com/CartoDB/carto-python/blob/f6ac3d17ed08e5bc3f99edd2bde4fb7dba3eee16/carto/sql.py#L70-L114
CartoDB/carto-python
carto/sql.py
BatchSQLClient.update_from_dict
def update_from_dict(self, data_dict): """ :param data_dict: Dictionary to be mapped into object attributes :type data_dict: dict :return: """ for k, v in data_dict.items(): setattr(self, k, v) if "item_queue_id" in data_dict: self.id = da...
python
def update_from_dict(self, data_dict): """ :param data_dict: Dictionary to be mapped into object attributes :type data_dict: dict :return: """ for k, v in data_dict.items(): setattr(self, k, v) if "item_queue_id" in data_dict: self.id = da...
[ "def", "update_from_dict", "(", "self", ",", "data_dict", ")", ":", "for", "k", ",", "v", "in", "data_dict", ".", "items", "(", ")", ":", "setattr", "(", "self", ",", "k", ",", "v", ")", "if", "\"item_queue_id\"", "in", "data_dict", ":", "self", ".",...
:param data_dict: Dictionary to be mapped into object attributes :type data_dict: dict :return:
[ ":", "param", "data_dict", ":", "Dictionary", "to", "be", "mapped", "into", "object", "attributes", ":", "type", "data_dict", ":", "dict" ]
train
https://github.com/CartoDB/carto-python/blob/f6ac3d17ed08e5bc3f99edd2bde4fb7dba3eee16/carto/sql.py#L137-L147
CartoDB/carto-python
carto/sql.py
BatchSQLClient.send
def send(self, url, http_method, json_body=None, http_header=None): """ Executes Batch SQL query in a CARTO server :param url: Endpoint url :param http_method: The method used to make the request to the API :param json_body: The information that needs to be sent, by default ...
python
def send(self, url, http_method, json_body=None, http_header=None): """ Executes Batch SQL query in a CARTO server :param url: Endpoint url :param http_method: The method used to make the request to the API :param json_body: The information that needs to be sent, by default ...
[ "def", "send", "(", "self", ",", "url", ",", "http_method", ",", "json_body", "=", "None", ",", "http_header", "=", "None", ")", ":", "try", ":", "data", "=", "self", ".", "client", ".", "send", "(", "url", ",", "http_method", "=", "http_method", ","...
Executes Batch SQL query in a CARTO server :param url: Endpoint url :param http_method: The method used to make the request to the API :param json_body: The information that needs to be sent, by default is set to None :param http_header: The header used to ma...
[ "Executes", "Batch", "SQL", "query", "in", "a", "CARTO", "server" ]
train
https://github.com/CartoDB/carto-python/blob/f6ac3d17ed08e5bc3f99edd2bde4fb7dba3eee16/carto/sql.py#L149-L180
CartoDB/carto-python
carto/sql.py
BatchSQLClient.create
def create(self, sql_query): """ Creates a new batch SQL query. Batch SQL jobs are asynchronous, once created you should call :func:`carto.sql.BatchSQLClient.read` method given the `job_id` to retrieve the state of the batch query :param sql_query: The SQL query to be u...
python
def create(self, sql_query): """ Creates a new batch SQL query. Batch SQL jobs are asynchronous, once created you should call :func:`carto.sql.BatchSQLClient.read` method given the `job_id` to retrieve the state of the batch query :param sql_query: The SQL query to be u...
[ "def", "create", "(", "self", ",", "sql_query", ")", ":", "header", "=", "{", "'content-type'", ":", "'application/json'", "}", "data", "=", "self", ".", "send", "(", "self", ".", "api_url", ",", "http_method", "=", "\"POST\"", ",", "json_body", "=", "{"...
Creates a new batch SQL query. Batch SQL jobs are asynchronous, once created you should call :func:`carto.sql.BatchSQLClient.read` method given the `job_id` to retrieve the state of the batch query :param sql_query: The SQL query to be used :type sql_query: str or list of str ...
[ "Creates", "a", "new", "batch", "SQL", "query", "." ]
train
https://github.com/CartoDB/carto-python/blob/f6ac3d17ed08e5bc3f99edd2bde4fb7dba3eee16/carto/sql.py#L182-L204
CartoDB/carto-python
carto/sql.py
BatchSQLClient.create_and_wait_for_completion
def create_and_wait_for_completion(self, sql_query): """ Creates a new batch SQL query and waits for its completion or failure Batch SQL jobs are asynchronous, once created this method automatically queries the job status until it's one of 'done', 'failed', 'canceled', 'unknown'...
python
def create_and_wait_for_completion(self, sql_query): """ Creates a new batch SQL query and waits for its completion or failure Batch SQL jobs are asynchronous, once created this method automatically queries the job status until it's one of 'done', 'failed', 'canceled', 'unknown'...
[ "def", "create_and_wait_for_completion", "(", "self", ",", "sql_query", ")", ":", "header", "=", "{", "'content-type'", ":", "'application/json'", "}", "data", "=", "self", ".", "send", "(", "self", ".", "api_url", ",", "http_method", "=", "\"POST\"", ",", "...
Creates a new batch SQL query and waits for its completion or failure Batch SQL jobs are asynchronous, once created this method automatically queries the job status until it's one of 'done', 'failed', 'canceled', 'unknown' :param sql_query: The SQL query to be used :type sql_qu...
[ "Creates", "a", "new", "batch", "SQL", "query", "and", "waits", "for", "its", "completion", "or", "failure" ]
train
https://github.com/CartoDB/carto-python/blob/f6ac3d17ed08e5bc3f99edd2bde4fb7dba3eee16/carto/sql.py#L206-L238
CartoDB/carto-python
carto/sql.py
BatchSQLClient.read
def read(self, job_id): """ Reads the information for a specific Batch API request :param job_id: The id of the job to be read from :type job_id: str :return: Response data, either as json or as a regular response.content object :rtype: object ...
python
def read(self, job_id): """ Reads the information for a specific Batch API request :param job_id: The id of the job to be read from :type job_id: str :return: Response data, either as json or as a regular response.content object :rtype: object ...
[ "def", "read", "(", "self", ",", "job_id", ")", ":", "data", "=", "self", ".", "send", "(", "self", ".", "api_url", "+", "job_id", ",", "http_method", "=", "\"GET\"", ")", "return", "data" ]
Reads the information for a specific Batch API request :param job_id: The id of the job to be read from :type job_id: str :return: Response data, either as json or as a regular response.content object :rtype: object :raise: CartoException
[ "Reads", "the", "information", "for", "a", "specific", "Batch", "API", "request" ]
train
https://github.com/CartoDB/carto-python/blob/f6ac3d17ed08e5bc3f99edd2bde4fb7dba3eee16/carto/sql.py#L240-L254
CartoDB/carto-python
carto/sql.py
BatchSQLClient.update
def update(self, job_id, sql_query): """ Updates the sql query of a specific job :param job_id: The id of the job to be updated :param sql_query: The new SQL query for the job :type job_id: str :type sql_query: str :return: Response data, either as json or as a ...
python
def update(self, job_id, sql_query): """ Updates the sql query of a specific job :param job_id: The id of the job to be updated :param sql_query: The new SQL query for the job :type job_id: str :type sql_query: str :return: Response data, either as json or as a ...
[ "def", "update", "(", "self", ",", "job_id", ",", "sql_query", ")", ":", "header", "=", "{", "'content-type'", ":", "'application/json'", "}", "data", "=", "self", ".", "send", "(", "self", ".", "api_url", "+", "job_id", ",", "http_method", "=", "\"PUT\"...
Updates the sql query of a specific job :param job_id: The id of the job to be updated :param sql_query: The new SQL query for the job :type job_id: str :type sql_query: str :return: Response data, either as json or as a regular response.content object ...
[ "Updates", "the", "sql", "query", "of", "a", "specific", "job" ]
train
https://github.com/CartoDB/carto-python/blob/f6ac3d17ed08e5bc3f99edd2bde4fb7dba3eee16/carto/sql.py#L256-L276
CartoDB/carto-python
carto/sql.py
BatchSQLClient.cancel
def cancel(self, job_id): """ Cancels a job :param job_id: The id of the job to be cancelled :type job_id: str :return: A status code depending on whether the cancel request was successful :rtype: str :raise CartoException: """ ...
python
def cancel(self, job_id): """ Cancels a job :param job_id: The id of the job to be cancelled :type job_id: str :return: A status code depending on whether the cancel request was successful :rtype: str :raise CartoException: """ ...
[ "def", "cancel", "(", "self", ",", "job_id", ")", ":", "try", ":", "confirmation", "=", "self", ".", "send", "(", "self", ".", "api_url", "+", "job_id", ",", "http_method", "=", "\"DELETE\"", ")", "except", "CartoException", "as", "e", ":", "if", "'Can...
Cancels a job :param job_id: The id of the job to be cancelled :type job_id: str :return: A status code depending on whether the cancel request was successful :rtype: str :raise CartoException:
[ "Cancels", "a", "job" ]
train
https://github.com/CartoDB/carto-python/blob/f6ac3d17ed08e5bc3f99edd2bde4fb7dba3eee16/carto/sql.py#L278-L298
CartoDB/carto-python
carto/sql.py
CopySQLClient.copyfrom
def copyfrom(self, query, iterable_data, compress=True, compression_level=DEFAULT_COMPRESSION_LEVEL): """ Gets data from an iterable object into a table :param query: The "COPY table_name [(column_name[, ...])] FROM STDIN [WITH(option[,...])]" query t...
python
def copyfrom(self, query, iterable_data, compress=True, compression_level=DEFAULT_COMPRESSION_LEVEL): """ Gets data from an iterable object into a table :param query: The "COPY table_name [(column_name[, ...])] FROM STDIN [WITH(option[,...])]" query t...
[ "def", "copyfrom", "(", "self", ",", "query", ",", "iterable_data", ",", "compress", "=", "True", ",", "compression_level", "=", "DEFAULT_COMPRESSION_LEVEL", ")", ":", "url", "=", "self", ".", "api_url", "+", "'/copyfrom'", "headers", "=", "{", "'Content-Type'...
Gets data from an iterable object into a table :param query: The "COPY table_name [(column_name[, ...])] FROM STDIN [WITH(option[,...])]" query to execute :type query: str :param iterable_data: An object that can be iterated to retrieve ...
[ "Gets", "data", "from", "an", "iterable", "object", "into", "a", "table" ]
train
https://github.com/CartoDB/carto-python/blob/f6ac3d17ed08e5bc3f99edd2bde4fb7dba3eee16/carto/sql.py#L341-L386
CartoDB/carto-python
carto/sql.py
CopySQLClient.copyfrom_file_object
def copyfrom_file_object(self, query, file_object, compress=True, compression_level=DEFAULT_COMPRESSION_LEVEL): """ Gets data from a readable file object into a table :param query: The "COPY table_name [(column_name[, ...])] FROM STDIN [WI...
python
def copyfrom_file_object(self, query, file_object, compress=True, compression_level=DEFAULT_COMPRESSION_LEVEL): """ Gets data from a readable file object into a table :param query: The "COPY table_name [(column_name[, ...])] FROM STDIN [WI...
[ "def", "copyfrom_file_object", "(", "self", ",", "query", ",", "file_object", ",", "compress", "=", "True", ",", "compression_level", "=", "DEFAULT_COMPRESSION_LEVEL", ")", ":", "chunk_generator", "=", "self", ".", "_read_in_chunks", "(", "file_object", ")", "retu...
Gets data from a readable file object into a table :param query: The "COPY table_name [(column_name[, ...])] FROM STDIN [WITH(option[,...])]" query to execute :type query: str :param file_object: A file-like object. Normally the return val...
[ "Gets", "data", "from", "a", "readable", "file", "object", "into", "a", "table" ]
train
https://github.com/CartoDB/carto-python/blob/f6ac3d17ed08e5bc3f99edd2bde4fb7dba3eee16/carto/sql.py#L388-L408
CartoDB/carto-python
carto/sql.py
CopySQLClient.copyfrom_file_path
def copyfrom_file_path(self, query, path, compress=True, compression_level=DEFAULT_COMPRESSION_LEVEL): """ Gets data from a readable file into a table :param query: The "COPY table_name [(column_name[, ...])] FROM STDIN [WITH(option[,...])]"...
python
def copyfrom_file_path(self, query, path, compress=True, compression_level=DEFAULT_COMPRESSION_LEVEL): """ Gets data from a readable file into a table :param query: The "COPY table_name [(column_name[, ...])] FROM STDIN [WITH(option[,...])]"...
[ "def", "copyfrom_file_path", "(", "self", ",", "query", ",", "path", ",", "compress", "=", "True", ",", "compression_level", "=", "DEFAULT_COMPRESSION_LEVEL", ")", ":", "with", "open", "(", "path", ",", "'rb'", ")", "as", "f", ":", "result", "=", "self", ...
Gets data from a readable file into a table :param query: The "COPY table_name [(column_name[, ...])] FROM STDIN [WITH(option[,...])]" query to execute :type query: str :param path: A path to a file :type path: str :return: Response data as json ...
[ "Gets", "data", "from", "a", "readable", "file", "into", "a", "table" ]
train
https://github.com/CartoDB/carto-python/blob/f6ac3d17ed08e5bc3f99edd2bde4fb7dba3eee16/carto/sql.py#L410-L430
CartoDB/carto-python
carto/sql.py
CopySQLClient.copyto
def copyto(self, query): """ Gets data from a table into a Response object that can be iterated :param query: The "COPY { table_name [(column_name[, ...])] | (query) } TO STDOUT [WITH(option[,...])]" query to execute :type query: str :return: response...
python
def copyto(self, query): """ Gets data from a table into a Response object that can be iterated :param query: The "COPY { table_name [(column_name[, ...])] | (query) } TO STDOUT [WITH(option[,...])]" query to execute :type query: str :return: response...
[ "def", "copyto", "(", "self", ",", "query", ")", ":", "url", "=", "self", ".", "api_url", "+", "'/copyto'", "params", "=", "{", "'api_key'", ":", "self", ".", "api_key", ",", "'q'", ":", "query", "}", "try", ":", "response", "=", "self", ".", "clie...
Gets data from a table into a Response object that can be iterated :param query: The "COPY { table_name [(column_name[, ...])] | (query) } TO STDOUT [WITH(option[,...])]" query to execute :type query: str :return: response object :rtype: Response :ra...
[ "Gets", "data", "from", "a", "table", "into", "a", "Response", "object", "that", "can", "be", "iterated" ]
train
https://github.com/CartoDB/carto-python/blob/f6ac3d17ed08e5bc3f99edd2bde4fb7dba3eee16/carto/sql.py#L432-L468
CartoDB/carto-python
carto/sql.py
CopySQLClient.copyto_file_object
def copyto_file_object(self, query, file_object): """ Gets data from a table into a writable file object :param query: The "COPY { table_name [(column_name[, ...])] | (query) } TO STDOUT [WITH(option[,...])]" query to execute :type query: str :param f...
python
def copyto_file_object(self, query, file_object): """ Gets data from a table into a writable file object :param query: The "COPY { table_name [(column_name[, ...])] | (query) } TO STDOUT [WITH(option[,...])]" query to execute :type query: str :param f...
[ "def", "copyto_file_object", "(", "self", ",", "query", ",", "file_object", ")", ":", "response", "=", "self", ".", "copyto", "(", "query", ")", "for", "block", "in", "response", ".", "iter_content", "(", "DEFAULT_CHUNK_SIZE", ")", ":", "file_object", ".", ...
Gets data from a table into a writable file object :param query: The "COPY { table_name [(column_name[, ...])] | (query) } TO STDOUT [WITH(option[,...])]" query to execute :type query: str :param file_object: A file-like object. Normally t...
[ "Gets", "data", "from", "a", "table", "into", "a", "writable", "file", "object" ]
train
https://github.com/CartoDB/carto-python/blob/f6ac3d17ed08e5bc3f99edd2bde4fb7dba3eee16/carto/sql.py#L470-L486
CartoDB/carto-python
carto/sql.py
CopySQLClient.copyto_file_path
def copyto_file_path(self, query, path, append=False): """ Gets data from a table into a writable file :param query: The "COPY { table_name [(column_name[, ...])] | (query) } TO STDOUT [WITH(option[,...])]" query to execute :type query: str :param pat...
python
def copyto_file_path(self, query, path, append=False): """ Gets data from a table into a writable file :param query: The "COPY { table_name [(column_name[, ...])] | (query) } TO STDOUT [WITH(option[,...])]" query to execute :type query: str :param pat...
[ "def", "copyto_file_path", "(", "self", ",", "query", ",", "path", ",", "append", "=", "False", ")", ":", "file_mode", "=", "'wb'", "if", "not", "append", "else", "'ab'", "with", "open", "(", "path", ",", "file_mode", ")", "as", "f", ":", "self", "."...
Gets data from a table into a writable file :param query: The "COPY { table_name [(column_name[, ...])] | (query) } TO STDOUT [WITH(option[,...])]" query to execute :type query: str :param path: A path to a writable file :type path: str :param append...
[ "Gets", "data", "from", "a", "table", "into", "a", "writable", "file" ]
train
https://github.com/CartoDB/carto-python/blob/f6ac3d17ed08e5bc3f99edd2bde4fb7dba3eee16/carto/sql.py#L488-L507
CartoDB/carto-python
carto/sync_tables.py
SyncTableJob.run
def run(self, **import_params): """ Actually creates the job import on the CARTO server :param import_params: To be send to the Import API, see CARTO's docs on Import API for an updated list of accepted params :type import_...
python
def run(self, **import_params): """ Actually creates the job import on the CARTO server :param import_params: To be send to the Import API, see CARTO's docs on Import API for an updated list of accepted params :type import_...
[ "def", "run", "(", "self", ",", "*", "*", "import_params", ")", ":", "import_params", "[", "\"url\"", "]", "=", "self", ".", "url", "import_params", "[", "\"interval\"", "]", "=", "self", ".", "interval", "if", "\"connection\"", "in", "import_params", ":",...
Actually creates the job import on the CARTO server :param import_params: To be send to the Import API, see CARTO's docs on Import API for an updated list of accepted params :type import_params: kwargs :return: .. note:: ...
[ "Actually", "creates", "the", "job", "import", "on", "the", "CARTO", "server" ]
train
https://github.com/CartoDB/carto-python/blob/f6ac3d17ed08e5bc3f99edd2bde4fb7dba3eee16/carto/sync_tables.py#L84-L106
CartoDB/carto-python
carto/sync_tables.py
SyncTableJob.force_sync
def force_sync(self): """ Forces to sync the SyncTableJob :return: :raise: CartoException """ try: self.send(self.get_resource_endpoint(), "put") except Exception as e: raise CartoException(e)
python
def force_sync(self): """ Forces to sync the SyncTableJob :return: :raise: CartoException """ try: self.send(self.get_resource_endpoint(), "put") except Exception as e: raise CartoException(e)
[ "def", "force_sync", "(", "self", ")", ":", "try", ":", "self", ".", "send", "(", "self", ".", "get_resource_endpoint", "(", ")", ",", "\"put\"", ")", "except", "Exception", "as", "e", ":", "raise", "CartoException", "(", "e", ")" ]
Forces to sync the SyncTableJob :return: :raise: CartoException
[ "Forces", "to", "sync", "the", "SyncTableJob" ]
train
https://github.com/CartoDB/carto-python/blob/f6ac3d17ed08e5bc3f99edd2bde4fb7dba3eee16/carto/sync_tables.py#L118-L129
ikki407/stacking
stacking/base.py
load_data
def load_data(flist, drop_duplicates=False): ''' Usage: set train, target, and test key and feature files. FEATURE_LIST_stage2 = { 'train':( TEMP_PATH + 'v1_stage1_all_fold.csv', TEMP_PATH + 'v2_stage1_all_fold.csv', ...
python
def load_data(flist, drop_duplicates=False): ''' Usage: set train, target, and test key and feature files. FEATURE_LIST_stage2 = { 'train':( TEMP_PATH + 'v1_stage1_all_fold.csv', TEMP_PATH + 'v2_stage1_all_fold.csv', ...
[ "def", "load_data", "(", "flist", ",", "drop_duplicates", "=", "False", ")", ":", "if", "(", "len", "(", "flist", "[", "'train'", "]", ")", "==", "0", ")", "or", "(", "len", "(", "flist", "[", "'target'", "]", ")", "==", "0", ")", "or", "(", "l...
Usage: set train, target, and test key and feature files. FEATURE_LIST_stage2 = { 'train':( TEMP_PATH + 'v1_stage1_all_fold.csv', TEMP_PATH + 'v2_stage1_all_fold.csv', TEMP_PATH + 'v3_stage1_all_fold.csv', ...
[ "Usage", ":", "set", "train", "target", "and", "test", "key", "and", "feature", "files", "." ]
train
https://github.com/ikki407/stacking/blob/105073598fd4f9481212d9db9dea92559d9a9d5a/stacking/base.py#L98-L163
ikki407/stacking
stacking/base.py
BaseModel.set_prob_type
def set_prob_type(cls, problem_type, classification_type, eval_type): """ Set problem type """ assert problem_type in problem_type_list, 'Need to set Problem Type' if problem_type == 'classification': assert classification_type in classification_type_list,\ ...
python
def set_prob_type(cls, problem_type, classification_type, eval_type): """ Set problem type """ assert problem_type in problem_type_list, 'Need to set Problem Type' if problem_type == 'classification': assert classification_type in classification_type_list,\ ...
[ "def", "set_prob_type", "(", "cls", ",", "problem_type", ",", "classification_type", ",", "eval_type", ")", ":", "assert", "problem_type", "in", "problem_type_list", ",", "'Need to set Problem Type'", "if", "problem_type", "==", "'classification'", ":", "assert", "cla...
Set problem type
[ "Set", "problem", "type" ]
train
https://github.com/ikki407/stacking/blob/105073598fd4f9481212d9db9dea92559d9a9d5a/stacking/base.py#L280-L301
ikki407/stacking
stacking/base.py
BaseModel.make_multi_cols
def make_multi_cols(self, num_class, name): '''make cols for multi-class predictions''' cols = ['c' + str(i) + '_' for i in xrange(num_class)] cols = map(lambda x: x + name, cols) return cols
python
def make_multi_cols(self, num_class, name): '''make cols for multi-class predictions''' cols = ['c' + str(i) + '_' for i in xrange(num_class)] cols = map(lambda x: x + name, cols) return cols
[ "def", "make_multi_cols", "(", "self", ",", "num_class", ",", "name", ")", ":", "cols", "=", "[", "'c'", "+", "str", "(", "i", ")", "+", "'_'", "for", "i", "in", "xrange", "(", "num_class", ")", "]", "cols", "=", "map", "(", "lambda", "x", ":", ...
make cols for multi-class predictions
[ "make", "cols", "for", "multi", "-", "class", "predictions" ]
train
https://github.com/ikki407/stacking/blob/105073598fd4f9481212d9db9dea92559d9a9d5a/stacking/base.py#L308-L312
clalancette/pycdlib
pycdlib/path_table_record.py
PathTableRecord.parse
def parse(self, data): # type: (bytes) -> None ''' A method to parse an ISO9660 Path Table Record out of a string. Parameters: data - The string to parse. Returns: Nothing. ''' (self.len_di, self.xattr_length, self.extent_location, self...
python
def parse(self, data): # type: (bytes) -> None ''' A method to parse an ISO9660 Path Table Record out of a string. Parameters: data - The string to parse. Returns: Nothing. ''' (self.len_di, self.xattr_length, self.extent_location, self...
[ "def", "parse", "(", "self", ",", "data", ")", ":", "# type: (bytes) -> None", "(", "self", ".", "len_di", ",", "self", ".", "xattr_length", ",", "self", ".", "extent_location", ",", "self", ".", "parent_directory_num", ")", "=", "struct", ".", "unpack_from"...
A method to parse an ISO9660 Path Table Record out of a string. Parameters: data - The string to parse. Returns: Nothing.
[ "A", "method", "to", "parse", "an", "ISO9660", "Path", "Table", "Record", "out", "of", "a", "string", "." ]
train
https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/path_table_record.py#L46-L64
clalancette/pycdlib
pycdlib/path_table_record.py
PathTableRecord._record
def _record(self, ext_loc, parent_dir_num): # type: (int, int) -> bytes ''' An internal method to generate a string representing this Path Table Record. Parameters: ext_loc - The extent location to place in this Path Table Record. parent_dir_num - The parent directory ...
python
def _record(self, ext_loc, parent_dir_num): # type: (int, int) -> bytes ''' An internal method to generate a string representing this Path Table Record. Parameters: ext_loc - The extent location to place in this Path Table Record. parent_dir_num - The parent directory ...
[ "def", "_record", "(", "self", ",", "ext_loc", ",", "parent_dir_num", ")", ":", "# type: (int, int) -> bytes", "return", "struct", ".", "pack", "(", "self", ".", "FMT", ",", "self", ".", "len_di", ",", "self", ".", "xattr_length", ",", "ext_loc", ",", "par...
An internal method to generate a string representing this Path Table Record. Parameters: ext_loc - The extent location to place in this Path Table Record. parent_dir_num - The parent directory number to place in this Path Table Record. Returns: A str...
[ "An", "internal", "method", "to", "generate", "a", "string", "representing", "this", "Path", "Table", "Record", "." ]
train
https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/path_table_record.py#L66-L79
clalancette/pycdlib
pycdlib/path_table_record.py
PathTableRecord.record_little_endian
def record_little_endian(self): # type: () -> bytes ''' A method to generate a string representing the little endian version of this Path Table Record. Parameters: None. Returns: A string representing the little endian version of this Path Table Record....
python
def record_little_endian(self): # type: () -> bytes ''' A method to generate a string representing the little endian version of this Path Table Record. Parameters: None. Returns: A string representing the little endian version of this Path Table Record....
[ "def", "record_little_endian", "(", "self", ")", ":", "# type: () -> bytes", "if", "not", "self", ".", "_initialized", ":", "raise", "pycdlibexception", ".", "PyCdlibInternalError", "(", "'Path Table Record not yet initialized'", ")", "return", "self", ".", "_record", ...
A method to generate a string representing the little endian version of this Path Table Record. Parameters: None. Returns: A string representing the little endian version of this Path Table Record.
[ "A", "method", "to", "generate", "a", "string", "representing", "the", "little", "endian", "version", "of", "this", "Path", "Table", "Record", "." ]
train
https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/path_table_record.py#L81-L95
clalancette/pycdlib
pycdlib/path_table_record.py
PathTableRecord.record_big_endian
def record_big_endian(self): # type: () -> bytes ''' A method to generate a string representing the big endian version of this Path Table Record. Parameters: None. Returns: A string representing the big endian version of this Path Table Record. ...
python
def record_big_endian(self): # type: () -> bytes ''' A method to generate a string representing the big endian version of this Path Table Record. Parameters: None. Returns: A string representing the big endian version of this Path Table Record. ...
[ "def", "record_big_endian", "(", "self", ")", ":", "# type: () -> bytes", "if", "not", "self", ".", "_initialized", ":", "raise", "pycdlibexception", ".", "PyCdlibInternalError", "(", "'Path Table Record not yet initialized'", ")", "return", "self", ".", "_record", "(...
A method to generate a string representing the big endian version of this Path Table Record. Parameters: None. Returns: A string representing the big endian version of this Path Table Record.
[ "A", "method", "to", "generate", "a", "string", "representing", "the", "big", "endian", "version", "of", "this", "Path", "Table", "Record", "." ]
train
https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/path_table_record.py#L97-L112
clalancette/pycdlib
pycdlib/path_table_record.py
PathTableRecord._new
def _new(self, name, parent_dir_num): # type: (bytes, int) -> None ''' An internal method to create a new Path Table Record. Parameters: name - The name for this Path Table Record. parent_dir_num - The directory number of the parent of this Path Table ...
python
def _new(self, name, parent_dir_num): # type: (bytes, int) -> None ''' An internal method to create a new Path Table Record. Parameters: name - The name for this Path Table Record. parent_dir_num - The directory number of the parent of this Path Table ...
[ "def", "_new", "(", "self", ",", "name", ",", "parent_dir_num", ")", ":", "# type: (bytes, int) -> None", "self", ".", "len_di", "=", "len", "(", "name", ")", "self", ".", "xattr_length", "=", "0", "# FIXME: we don't support xattr for now", "self", ".", "parent_...
An internal method to create a new Path Table Record. Parameters: name - The name for this Path Table Record. parent_dir_num - The directory number of the parent of this Path Table Record. Returns: Nothing.
[ "An", "internal", "method", "to", "create", "a", "new", "Path", "Table", "Record", "." ]
train
https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/path_table_record.py#L127-L143
clalancette/pycdlib
pycdlib/path_table_record.py
PathTableRecord.new_dir
def new_dir(self, name): # type: (bytes) -> None ''' A method to create a new Path Table Record. Parameters: name - The name for this Path Table Record. Returns: Nothing. ''' if self._initialized: raise pycdlibexception.PyCdlibIntern...
python
def new_dir(self, name): # type: (bytes) -> None ''' A method to create a new Path Table Record. Parameters: name - The name for this Path Table Record. Returns: Nothing. ''' if self._initialized: raise pycdlibexception.PyCdlibIntern...
[ "def", "new_dir", "(", "self", ",", "name", ")", ":", "# type: (bytes) -> None", "if", "self", ".", "_initialized", ":", "raise", "pycdlibexception", ".", "PyCdlibInternalError", "(", "'Path Table Record already initialized'", ")", "# Zero for the parent dir num is bogus, b...
A method to create a new Path Table Record. Parameters: name - The name for this Path Table Record. Returns: Nothing.
[ "A", "method", "to", "create", "a", "new", "Path", "Table", "Record", "." ]
train
https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/path_table_record.py#L160-L174
clalancette/pycdlib
pycdlib/path_table_record.py
PathTableRecord.update_extent_location
def update_extent_location(self, extent_loc): # type: (int) -> None ''' A method to update the extent location for this Path Table Record. Parameters: extent_loc - The new extent location. Returns: Nothing. ''' if not self._initialized: ...
python
def update_extent_location(self, extent_loc): # type: (int) -> None ''' A method to update the extent location for this Path Table Record. Parameters: extent_loc - The new extent location. Returns: Nothing. ''' if not self._initialized: ...
[ "def", "update_extent_location", "(", "self", ",", "extent_loc", ")", ":", "# type: (int) -> None", "if", "not", "self", ".", "_initialized", ":", "raise", "pycdlibexception", ".", "PyCdlibInternalError", "(", "'Path Table Record not yet initialized'", ")", "self", ".",...
A method to update the extent location for this Path Table Record. Parameters: extent_loc - The new extent location. Returns: Nothing.
[ "A", "method", "to", "update", "the", "extent", "location", "for", "this", "Path", "Table", "Record", "." ]
train
https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/path_table_record.py#L176-L189
clalancette/pycdlib
pycdlib/path_table_record.py
PathTableRecord.update_parent_directory_number
def update_parent_directory_number(self, parent_dir_num): # type: (int) -> None ''' A method to update the parent directory number for this Path Table Record from the directory record. Parameters: parent_dir_num - The new parent directory number to assign to this PTR. ...
python
def update_parent_directory_number(self, parent_dir_num): # type: (int) -> None ''' A method to update the parent directory number for this Path Table Record from the directory record. Parameters: parent_dir_num - The new parent directory number to assign to this PTR. ...
[ "def", "update_parent_directory_number", "(", "self", ",", "parent_dir_num", ")", ":", "# type: (int) -> None", "if", "not", "self", ".", "_initialized", ":", "raise", "pycdlibexception", ".", "PyCdlibInternalError", "(", "'Path Table Record not yet initialized'", ")", "s...
A method to update the parent directory number for this Path Table Record from the directory record. Parameters: parent_dir_num - The new parent directory number to assign to this PTR. Returns: Nothing.
[ "A", "method", "to", "update", "the", "parent", "directory", "number", "for", "this", "Path", "Table", "Record", "from", "the", "directory", "record", "." ]
train
https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/path_table_record.py#L191-L204
clalancette/pycdlib
pycdlib/path_table_record.py
PathTableRecord.equal_to_be
def equal_to_be(self, be_record): # type: (PathTableRecord) -> bool ''' A method to compare a little-endian path table record to its big-endian counterpart. This is used to ensure that the ISO is sane. Parameters: be_record - The big-endian object to compare with the l...
python
def equal_to_be(self, be_record): # type: (PathTableRecord) -> bool ''' A method to compare a little-endian path table record to its big-endian counterpart. This is used to ensure that the ISO is sane. Parameters: be_record - The big-endian object to compare with the l...
[ "def", "equal_to_be", "(", "self", ",", "be_record", ")", ":", "# type: (PathTableRecord) -> bool", "if", "not", "self", ".", "_initialized", ":", "raise", "pycdlibexception", ".", "PyCdlibInternalError", "(", "'This Path Table Record is not yet initialized'", ")", "if", ...
A method to compare a little-endian path table record to its big-endian counterpart. This is used to ensure that the ISO is sane. Parameters: be_record - The big-endian object to compare with the little-endian object. Returns: True if this record is equal...
[ "A", "method", "to", "compare", "a", "little", "-", "endian", "path", "table", "record", "to", "its", "big", "-", "endian", "counterpart", ".", "This", "is", "used", "to", "ensure", "that", "the", "ISO", "is", "sane", "." ]
train
https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/path_table_record.py#L206-L228
clalancette/pycdlib
pycdlib/utils.py
copy_data
def copy_data(data_length, blocksize, infp, outfp): # type: (int, int, BinaryIO, BinaryIO) -> None ''' A utility function to copy data from the input file object to the output file object. This function will use the most efficient copy method available, which is often sendfile. Parameters: ...
python
def copy_data(data_length, blocksize, infp, outfp): # type: (int, int, BinaryIO, BinaryIO) -> None ''' A utility function to copy data from the input file object to the output file object. This function will use the most efficient copy method available, which is often sendfile. Parameters: ...
[ "def", "copy_data", "(", "data_length", ",", "blocksize", ",", "infp", ",", "outfp", ")", ":", "# type: (int, int, BinaryIO, BinaryIO) -> None", "use_sendfile", "=", "False", "if", "have_sendfile", ":", "# Python 3 implements the fileno method for all file-like objects, so", ...
A utility function to copy data from the input file object to the output file object. This function will use the most efficient copy method available, which is often sendfile. Parameters: data_length - The amount of data to copy. blocksize - How much data to copy per iteration. infp - The f...
[ "A", "utility", "function", "to", "copy", "data", "from", "the", "input", "file", "object", "to", "the", "output", "file", "object", ".", "This", "function", "will", "use", "the", "most", "efficient", "copy", "method", "available", "which", "is", "often", ...
train
https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/utils.py#L93-L151
clalancette/pycdlib
pycdlib/utils.py
encode_space_pad
def encode_space_pad(instr, length, encoding): # type: (bytes, int, str) -> bytes ''' A function to pad out an input string with spaces to the length specified. The space is first encoded into the specified encoding, then appended to the input string until the length is reached. Parameters: ...
python
def encode_space_pad(instr, length, encoding): # type: (bytes, int, str) -> bytes ''' A function to pad out an input string with spaces to the length specified. The space is first encoded into the specified encoding, then appended to the input string until the length is reached. Parameters: ...
[ "def", "encode_space_pad", "(", "instr", ",", "length", ",", "encoding", ")", ":", "# type: (bytes, int, str) -> bytes", "output", "=", "instr", ".", "decode", "(", "'utf-8'", ")", ".", "encode", "(", "encoding", ")", "if", "len", "(", "output", ")", ">", ...
A function to pad out an input string with spaces to the length specified. The space is first encoded into the specified encoding, then appended to the input string until the length is reached. Parameters: instr - The input string to encode and pad. length - The length to pad the input string to....
[ "A", "function", "to", "pad", "out", "an", "input", "string", "with", "spaces", "to", "the", "length", "specified", ".", "The", "space", "is", "first", "encoded", "into", "the", "specified", "encoding", "then", "appended", "to", "the", "input", "string", "...
train
https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/utils.py#L154-L182
clalancette/pycdlib
pycdlib/utils.py
normpath
def normpath(path): # type: (str) -> bytes ''' A method to normalize the path, eliminating double slashes, etc. This method is a copy of the built-in python normpath, except we do *not* allow double slashes at the start. Parameters: path - The path to normalize. Returns: The norm...
python
def normpath(path): # type: (str) -> bytes ''' A method to normalize the path, eliminating double slashes, etc. This method is a copy of the built-in python normpath, except we do *not* allow double slashes at the start. Parameters: path - The path to normalize. Returns: The norm...
[ "def", "normpath", "(", "path", ")", ":", "# type: (str) -> bytes", "sep", "=", "'/'", "empty", "=", "''", "dot", "=", "'.'", "dotdot", "=", "'..'", "if", "path", "==", "empty", ":", "return", "dot", ".", "encode", "(", "'utf-8'", ")", "initial_slashes",...
A method to normalize the path, eliminating double slashes, etc. This method is a copy of the built-in python normpath, except we do *not* allow double slashes at the start. Parameters: path - The path to normalize. Returns: The normalized path.
[ "A", "method", "to", "normalize", "the", "path", "eliminating", "double", "slashes", "etc", ".", "This", "method", "is", "a", "copy", "of", "the", "built", "-", "in", "python", "normpath", "except", "we", "do", "*", "not", "*", "allow", "double", "slashe...
train
https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/utils.py#L185-L220
clalancette/pycdlib
pycdlib/utils.py
gmtoffset_from_tm
def gmtoffset_from_tm(tm, local): # type: (float, time.struct_time) -> int ''' A function to compute the GMT offset from the time in seconds since the epoch and the local time object. Parameters: tm - The time in seconds since the epoch. local - The struct_time object representing the loc...
python
def gmtoffset_from_tm(tm, local): # type: (float, time.struct_time) -> int ''' A function to compute the GMT offset from the time in seconds since the epoch and the local time object. Parameters: tm - The time in seconds since the epoch. local - The struct_time object representing the loc...
[ "def", "gmtoffset_from_tm", "(", "tm", ",", "local", ")", ":", "# type: (float, time.struct_time) -> int", "gmtime", "=", "time", ".", "gmtime", "(", "tm", ")", "tmpyear", "=", "gmtime", ".", "tm_year", "-", "local", ".", "tm_year", "tmpyday", "=", "gmtime", ...
A function to compute the GMT offset from the time in seconds since the epoch and the local time object. Parameters: tm - The time in seconds since the epoch. local - The struct_time object representing the local time. Returns: The gmtoffset.
[ "A", "function", "to", "compute", "the", "GMT", "offset", "from", "the", "time", "in", "seconds", "since", "the", "epoch", "and", "the", "local", "time", "object", "." ]
train
https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/utils.py#L223-L246
clalancette/pycdlib
pycdlib/utils.py
zero_pad
def zero_pad(fp, data_size, pad_size): # type: (BinaryIO, int, int) -> None ''' A function to write padding out from data_size up to pad_size efficiently. Parameters: fp - The file object to use to write padding out to. data_size - The current size of the data. pad_size - The boundar...
python
def zero_pad(fp, data_size, pad_size): # type: (BinaryIO, int, int) -> None ''' A function to write padding out from data_size up to pad_size efficiently. Parameters: fp - The file object to use to write padding out to. data_size - The current size of the data. pad_size - The boundar...
[ "def", "zero_pad", "(", "fp", ",", "data_size", ",", "pad_size", ")", ":", "# type: (BinaryIO, int, int) -> None", "padbytes", "=", "pad_size", "-", "(", "data_size", "%", "pad_size", ")", "if", "padbytes", "==", "pad_size", ":", "# Nothing to pad, get out.", "ret...
A function to write padding out from data_size up to pad_size efficiently. Parameters: fp - The file object to use to write padding out to. data_size - The current size of the data. pad_size - The boundary size of data to pad out to. Returns: Nothing.
[ "A", "function", "to", "write", "padding", "out", "from", "data_size", "up", "to", "pad_size", "efficiently", "." ]
train
https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/utils.py#L249-L268
clalancette/pycdlib
pycdlib/utils.py
file_object_supports_binary
def file_object_supports_binary(fp): # type: (BinaryIO) -> bool ''' A function to check whether a file-like object supports binary mode. Parameters: fp - The file-like object to check for binary mode support. Returns: True if the file-like object supports binary mode, False otherwise. ...
python
def file_object_supports_binary(fp): # type: (BinaryIO) -> bool ''' A function to check whether a file-like object supports binary mode. Parameters: fp - The file-like object to check for binary mode support. Returns: True if the file-like object supports binary mode, False otherwise. ...
[ "def", "file_object_supports_binary", "(", "fp", ")", ":", "# type: (BinaryIO) -> bool", "if", "hasattr", "(", "fp", ",", "'mode'", ")", ":", "return", "'b'", "in", "fp", ".", "mode", "# Python 3", "if", "sys", ".", "version_info", ">=", "(", "3", ",", "0"...
A function to check whether a file-like object supports binary mode. Parameters: fp - The file-like object to check for binary mode support. Returns: True if the file-like object supports binary mode, False otherwise.
[ "A", "function", "to", "check", "whether", "a", "file", "-", "like", "object", "supports", "binary", "mode", "." ]
train
https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/utils.py#L304-L322
clalancette/pycdlib
pycdlib/isohybrid.py
IsoHybrid.parse
def parse(self, instr): # type: (bytes) -> bool ''' A method to parse ISO hybridization info out of an existing ISO. Parameters: instr - The data for the ISO hybridization. Returns: Nothing. ''' if self._initialized: raise pycdlibexc...
python
def parse(self, instr): # type: (bytes) -> bool ''' A method to parse ISO hybridization info out of an existing ISO. Parameters: instr - The data for the ISO hybridization. Returns: Nothing. ''' if self._initialized: raise pycdlibexc...
[ "def", "parse", "(", "self", ",", "instr", ")", ":", "# type: (bytes) -> bool", "if", "self", ".", "_initialized", ":", "raise", "pycdlibexception", ".", "PyCdlibInternalError", "(", "'This IsoHybrid object is already initialized'", ")", "if", "len", "(", "instr", "...
A method to parse ISO hybridization info out of an existing ISO. Parameters: instr - The data for the ISO hybridization. Returns: Nothing.
[ "A", "method", "to", "parse", "ISO", "hybridization", "info", "out", "of", "an", "existing", "ISO", "." ]
train
https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/isohybrid.py#L50-L107
clalancette/pycdlib
pycdlib/isohybrid.py
IsoHybrid.new
def new(self, mac, part_entry, mbr_id, part_offset, geometry_sectors, geometry_heads, part_type): # type: (bool, int, Optional[int], int, int, int, int) -> None ''' A method to add ISO hybridization to an ISO. Parameters: mac - Whether this ISO should be made bootab...
python
def new(self, mac, part_entry, mbr_id, part_offset, geometry_sectors, geometry_heads, part_type): # type: (bool, int, Optional[int], int, int, int, int) -> None ''' A method to add ISO hybridization to an ISO. Parameters: mac - Whether this ISO should be made bootab...
[ "def", "new", "(", "self", ",", "mac", ",", "part_entry", ",", "mbr_id", ",", "part_offset", ",", "geometry_sectors", ",", "geometry_heads", ",", "part_type", ")", ":", "# type: (bool, int, Optional[int], int, int, int, int) -> None", "if", "self", ".", "_initialized"...
A method to add ISO hybridization to an ISO. Parameters: mac - Whether this ISO should be made bootable for the Macintosh. part_entry - The partition entry for the hybridization. mbr_id - The mbr_id to use for the hybridization. part_offset - The partition offset to use for ...
[ "A", "method", "to", "add", "ISO", "hybridization", "to", "an", "ISO", "." ]
train
https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/isohybrid.py#L109-L154
clalancette/pycdlib
pycdlib/isohybrid.py
IsoHybrid._calc_cc
def _calc_cc(self, iso_size): # type: (int) -> Tuple[int, int] ''' A method to calculate the 'cc' and the 'padding' values for this hybridization. Parameters: iso_size - The size of the ISO, excluding the hybridization. Returns: A tuple containing the c...
python
def _calc_cc(self, iso_size): # type: (int) -> Tuple[int, int] ''' A method to calculate the 'cc' and the 'padding' values for this hybridization. Parameters: iso_size - The size of the ISO, excluding the hybridization. Returns: A tuple containing the c...
[ "def", "_calc_cc", "(", "self", ",", "iso_size", ")", ":", "# type: (int) -> Tuple[int, int]", "cylsize", "=", "self", ".", "geometry_heads", "*", "self", ".", "geometry_sectors", "*", "512", "frac", "=", "iso_size", "%", "cylsize", "padding", "=", "0", "if", ...
A method to calculate the 'cc' and the 'padding' values for this hybridization. Parameters: iso_size - The size of the ISO, excluding the hybridization. Returns: A tuple containing the cc value and the padding.
[ "A", "method", "to", "calculate", "the", "cc", "and", "the", "padding", "values", "for", "this", "hybridization", "." ]
train
https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/isohybrid.py#L156-L176
clalancette/pycdlib
pycdlib/isohybrid.py
IsoHybrid.record
def record(self, iso_size): # type: (int) -> bytes ''' A method to generate a string containing the ISO hybridization. Parameters: iso_size - The size of the ISO, excluding the hybridization. Returns: A string containing the ISO hybridization. ''' ...
python
def record(self, iso_size): # type: (int) -> bytes ''' A method to generate a string containing the ISO hybridization. Parameters: iso_size - The size of the ISO, excluding the hybridization. Returns: A string containing the ISO hybridization. ''' ...
[ "def", "record", "(", "self", ",", "iso_size", ")", ":", "# type: (int) -> bytes", "if", "not", "self", ".", "_initialized", ":", "raise", "pycdlibexception", ".", "PyCdlibInternalError", "(", "'This IsoHybrid object is not yet initialized'", ")", "outlist", "=", "[",...
A method to generate a string containing the ISO hybridization. Parameters: iso_size - The size of the ISO, excluding the hybridization. Returns: A string containing the ISO hybridization.
[ "A", "method", "to", "generate", "a", "string", "containing", "the", "ISO", "hybridization", "." ]
train
https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/isohybrid.py#L178-L208
clalancette/pycdlib
pycdlib/isohybrid.py
IsoHybrid.record_padding
def record_padding(self, iso_size): # type: (int) -> bytes ''' A method to record padding for the ISO hybridization. Parameters: iso_size - The size of the ISO, excluding the hybridization. Returns: A string of zeros the right size to pad the ISO. ''' ...
python
def record_padding(self, iso_size): # type: (int) -> bytes ''' A method to record padding for the ISO hybridization. Parameters: iso_size - The size of the ISO, excluding the hybridization. Returns: A string of zeros the right size to pad the ISO. ''' ...
[ "def", "record_padding", "(", "self", ",", "iso_size", ")", ":", "# type: (int) -> bytes", "if", "not", "self", ".", "_initialized", ":", "raise", "pycdlibexception", ".", "PyCdlibInternalError", "(", "'This IsoHybrid object is not yet initialized'", ")", "return", "b'\...
A method to record padding for the ISO hybridization. Parameters: iso_size - The size of the ISO, excluding the hybridization. Returns: A string of zeros the right size to pad the ISO.
[ "A", "method", "to", "record", "padding", "for", "the", "ISO", "hybridization", "." ]
train
https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/isohybrid.py#L210-L223
clalancette/pycdlib
pycdlib/isohybrid.py
IsoHybrid.update_rba
def update_rba(self, current_extent): # type: (int) -> None ''' A method to update the current rba for the ISO hybridization. Parameters: current_extent - The new extent to set the RBA to. Returns: Nothing. ''' if not self._initialized: ...
python
def update_rba(self, current_extent): # type: (int) -> None ''' A method to update the current rba for the ISO hybridization. Parameters: current_extent - The new extent to set the RBA to. Returns: Nothing. ''' if not self._initialized: ...
[ "def", "update_rba", "(", "self", ",", "current_extent", ")", ":", "# type: (int) -> None", "if", "not", "self", ".", "_initialized", ":", "raise", "pycdlibexception", ".", "PyCdlibInternalError", "(", "'This IsoHybrid object is not yet initialized'", ")", "self", ".", ...
A method to update the current rba for the ISO hybridization. Parameters: current_extent - The new extent to set the RBA to. Returns: Nothing.
[ "A", "method", "to", "update", "the", "current", "rba", "for", "the", "ISO", "hybridization", "." ]
train
https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/isohybrid.py#L225-L238
clalancette/pycdlib
pycdlib/dr.py
XARecord.parse
def parse(self, xastr): # type: (bytes) -> None ''' Parse an Extended Attribute Record out of a string. Parameters: xastr - The string to parse. Returns: Nothing. ''' if self._initialized: raise pycdlibexception.PyCdlibInternalError(...
python
def parse(self, xastr): # type: (bytes) -> None ''' Parse an Extended Attribute Record out of a string. Parameters: xastr - The string to parse. Returns: Nothing. ''' if self._initialized: raise pycdlibexception.PyCdlibInternalError(...
[ "def", "parse", "(", "self", ",", "xastr", ")", ":", "# type: (bytes) -> None", "if", "self", ".", "_initialized", ":", "raise", "pycdlibexception", ".", "PyCdlibInternalError", "(", "'This XARecord is already initialized!'", ")", "(", "self", ".", "_group_id", ",",...
Parse an Extended Attribute Record out of a string. Parameters: xastr - The string to parse. Returns: Nothing.
[ "Parse", "an", "Extended", "Attribute", "Record", "out", "of", "a", "string", "." ]
train
https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/dr.py#L54-L76
clalancette/pycdlib
pycdlib/dr.py
XARecord.new
def new(self): # type: () -> None ''' Create a new Extended Attribute Record. Parameters: None. Returns: Nothing. ''' if self._initialized: raise pycdlibexception.PyCdlibInternalError('This XARecord is already initialized!') ...
python
def new(self): # type: () -> None ''' Create a new Extended Attribute Record. Parameters: None. Returns: Nothing. ''' if self._initialized: raise pycdlibexception.PyCdlibInternalError('This XARecord is already initialized!') ...
[ "def", "new", "(", "self", ")", ":", "# type: () -> None", "if", "self", ".", "_initialized", ":", "raise", "pycdlibexception", ".", "PyCdlibInternalError", "(", "'This XARecord is already initialized!'", ")", "# FIXME: we should allow the user to set these", "self", ".", ...
Create a new Extended Attribute Record. Parameters: None. Returns: Nothing.
[ "Create", "a", "new", "Extended", "Attribute", "Record", "." ]
train
https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/dr.py#L78-L96
clalancette/pycdlib
pycdlib/dr.py
XARecord.record
def record(self): # type: () -> bytes ''' Record this Extended Attribute Record. Parameters: None. Returns: A string representing this Extended Attribute Record. ''' if not self._initialized: raise pycdlibexception.PyCdlibInternalErr...
python
def record(self): # type: () -> bytes ''' Record this Extended Attribute Record. Parameters: None. Returns: A string representing this Extended Attribute Record. ''' if not self._initialized: raise pycdlibexception.PyCdlibInternalErr...
[ "def", "record", "(", "self", ")", ":", "# type: () -> bytes", "if", "not", "self", ".", "_initialized", ":", "raise", "pycdlibexception", ".", "PyCdlibInternalError", "(", "'This XARecord is not yet initialized!'", ")", "return", "struct", ".", "pack", "(", "self",...
Record this Extended Attribute Record. Parameters: None. Returns: A string representing this Extended Attribute Record.
[ "Record", "this", "Extended", "Attribute", "Record", "." ]
train
https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/dr.py#L98-L112
clalancette/pycdlib
pycdlib/dr.py
DirectoryRecord.parse
def parse(self, vd, record, parent): # type: (headervd.PrimaryOrSupplementaryVD, bytes, Optional[DirectoryRecord]) -> str ''' Parse a directory record out of a string. Parameters: vd - The Volume Descriptor this record is part of. record - The string to parse for this ...
python
def parse(self, vd, record, parent): # type: (headervd.PrimaryOrSupplementaryVD, bytes, Optional[DirectoryRecord]) -> str ''' Parse a directory record out of a string. Parameters: vd - The Volume Descriptor this record is part of. record - The string to parse for this ...
[ "def", "parse", "(", "self", ",", "vd", ",", "record", ",", "parent", ")", ":", "# type: (headervd.PrimaryOrSupplementaryVD, bytes, Optional[DirectoryRecord]) -> str", "if", "self", ".", "_initialized", ":", "raise", "pycdlibexception", ".", "PyCdlibInternalError", "(", ...
Parse a directory record out of a string. Parameters: vd - The Volume Descriptor this record is part of. record - The string to parse for this record. parent - The parent of this record. Returns: The Rock Ridge version as a string if this Directory Record has Rock ...
[ "Parse", "a", "directory", "record", "out", "of", "a", "string", "." ]
train
https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/dr.py#L162-L309
clalancette/pycdlib
pycdlib/dr.py
DirectoryRecord._rr_new
def _rr_new(self, rr_version, rr_name, rr_symlink_target, rr_relocated_child, rr_relocated, rr_relocated_parent, file_mode): # type: (str, bytes, bytes, bool, bool, bool, int) -> None ''' Internal method to add Rock Ridge to a Directory Record. Parameters: rr_ve...
python
def _rr_new(self, rr_version, rr_name, rr_symlink_target, rr_relocated_child, rr_relocated, rr_relocated_parent, file_mode): # type: (str, bytes, bytes, bool, bool, bool, int) -> None ''' Internal method to add Rock Ridge to a Directory Record. Parameters: rr_ve...
[ "def", "_rr_new", "(", "self", ",", "rr_version", ",", "rr_name", ",", "rr_symlink_target", ",", "rr_relocated_child", ",", "rr_relocated", ",", "rr_relocated_parent", ",", "file_mode", ")", ":", "# type: (str, bytes, bytes, bool, bool, bool, int) -> None", "if", "self", ...
Internal method to add Rock Ridge to a Directory Record. Parameters: rr_version - A string containing the version of Rock Ridge to use for this record. rr_name - The Rock Ridge name to associate with this directory record. rr_symlink_target - The target for the ...
[ "Internal", "method", "to", "add", "Rock", "Ridge", "to", "a", "Directory", "Record", "." ]
train
https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/dr.py#L311-L400
clalancette/pycdlib
pycdlib/dr.py
DirectoryRecord._new
def _new(self, vd, name, parent, seqnum, isdir, length, xa): # type: (headervd.PrimaryOrSupplementaryVD, bytes, Optional[DirectoryRecord], int, bool, int, bool) -> None ''' Internal method to create a new Directory Record. Parameters: vd - The Volume Descriptor this record is p...
python
def _new(self, vd, name, parent, seqnum, isdir, length, xa): # type: (headervd.PrimaryOrSupplementaryVD, bytes, Optional[DirectoryRecord], int, bool, int, bool) -> None ''' Internal method to create a new Directory Record. Parameters: vd - The Volume Descriptor this record is p...
[ "def", "_new", "(", "self", ",", "vd", ",", "name", ",", "parent", ",", "seqnum", ",", "isdir", ",", "length", ",", "xa", ")", ":", "# type: (headervd.PrimaryOrSupplementaryVD, bytes, Optional[DirectoryRecord], int, bool, int, bool) -> None", "# Adding a new time should rea...
Internal method to create a new Directory Record. Parameters: vd - The Volume Descriptor this record is part of. name - The name for this directory record. parent - The parent of this directory record. seqnum - The sequence number to associate with this directory record. ...
[ "Internal", "method", "to", "create", "a", "new", "Directory", "Record", "." ]
train
https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/dr.py#L402-L487
clalancette/pycdlib
pycdlib/dr.py
DirectoryRecord.new_symlink
def new_symlink(self, vd, name, parent, rr_target, seqnum, rock_ridge, rr_name, xa): # type: (headervd.PrimaryOrSupplementaryVD, bytes, DirectoryRecord, bytes, int, str, bytes, bool) -> None ''' Create a new symlink Directory Record. This implies that the new record ...
python
def new_symlink(self, vd, name, parent, rr_target, seqnum, rock_ridge, rr_name, xa): # type: (headervd.PrimaryOrSupplementaryVD, bytes, DirectoryRecord, bytes, int, str, bytes, bool) -> None ''' Create a new symlink Directory Record. This implies that the new record ...
[ "def", "new_symlink", "(", "self", ",", "vd", ",", "name", ",", "parent", ",", "rr_target", ",", "seqnum", ",", "rock_ridge", ",", "rr_name", ",", "xa", ")", ":", "# type: (headervd.PrimaryOrSupplementaryVD, bytes, DirectoryRecord, bytes, int, str, bytes, bool) -> None", ...
Create a new symlink Directory Record. This implies that the new record will be Rock Ridge. Parameters: vd - The Volume Descriptor this record is part of. name - The name for this directory record. parent - The parent of this directory record. rr_target - The symlin...
[ "Create", "a", "new", "symlink", "Directory", "Record", ".", "This", "implies", "that", "the", "new", "record", "will", "be", "Rock", "Ridge", "." ]
train
https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/dr.py#L489-L514
clalancette/pycdlib
pycdlib/dr.py
DirectoryRecord.new_file
def new_file(self, vd, length, isoname, parent, seqnum, rock_ridge, rr_name, xa, file_mode): # type: (headervd.PrimaryOrSupplementaryVD, int, bytes, DirectoryRecord, int, str, bytes, bool, int) -> None ''' Create a new file Directory Record. Parameters: vd - Th...
python
def new_file(self, vd, length, isoname, parent, seqnum, rock_ridge, rr_name, xa, file_mode): # type: (headervd.PrimaryOrSupplementaryVD, int, bytes, DirectoryRecord, int, str, bytes, bool, int) -> None ''' Create a new file Directory Record. Parameters: vd - Th...
[ "def", "new_file", "(", "self", ",", "vd", ",", "length", ",", "isoname", ",", "parent", ",", "seqnum", ",", "rock_ridge", ",", "rr_name", ",", "xa", ",", "file_mode", ")", ":", "# type: (headervd.PrimaryOrSupplementaryVD, int, bytes, DirectoryRecord, int, str, bytes,...
Create a new file Directory Record. Parameters: vd - The Volume Descriptor this record is part of. length - The length of the data. isoname - The name for this directory record. parent - The parent of this directory record. seqnum - The sequence number for this dire...
[ "Create", "a", "new", "file", "Directory", "Record", "." ]
train
https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/dr.py#L516-L541
clalancette/pycdlib
pycdlib/dr.py
DirectoryRecord.new_root
def new_root(self, vd, seqnum, log_block_size): # type: (headervd.PrimaryOrSupplementaryVD, int, int) -> None ''' Create a new root Directory Record. Parameters: vd - The Volume Descriptor this record is part of. seqnum - The sequence number for this directory record. ...
python
def new_root(self, vd, seqnum, log_block_size): # type: (headervd.PrimaryOrSupplementaryVD, int, int) -> None ''' Create a new root Directory Record. Parameters: vd - The Volume Descriptor this record is part of. seqnum - The sequence number for this directory record. ...
[ "def", "new_root", "(", "self", ",", "vd", ",", "seqnum", ",", "log_block_size", ")", ":", "# type: (headervd.PrimaryOrSupplementaryVD, int, int) -> None", "if", "self", ".", "_initialized", ":", "raise", "pycdlibexception", ".", "PyCdlibInternalError", "(", "'Directory...
Create a new root Directory Record. Parameters: vd - The Volume Descriptor this record is part of. seqnum - The sequence number for this directory record. log_block_size - The logical block size to use. Returns: Nothing.
[ "Create", "a", "new", "root", "Directory", "Record", "." ]
train
https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/dr.py#L543-L558
clalancette/pycdlib
pycdlib/dr.py
DirectoryRecord.new_dot
def new_dot(self, vd, parent, seqnum, rock_ridge, log_block_size, xa, file_mode): # type: (headervd.PrimaryOrSupplementaryVD, DirectoryRecord, int, str, int, bool, int) -> None ''' Create a new 'dot' Directory Record. Parameters: vd - The Volume Descriptor this ...
python
def new_dot(self, vd, parent, seqnum, rock_ridge, log_block_size, xa, file_mode): # type: (headervd.PrimaryOrSupplementaryVD, DirectoryRecord, int, str, int, bool, int) -> None ''' Create a new 'dot' Directory Record. Parameters: vd - The Volume Descriptor this ...
[ "def", "new_dot", "(", "self", ",", "vd", ",", "parent", ",", "seqnum", ",", "rock_ridge", ",", "log_block_size", ",", "xa", ",", "file_mode", ")", ":", "# type: (headervd.PrimaryOrSupplementaryVD, DirectoryRecord, int, str, int, bool, int) -> None", "if", "self", ".", ...
Create a new 'dot' Directory Record. Parameters: vd - The Volume Descriptor this record is part of. parent - The parent of this directory record. seqnum - The sequence number for this directory record. rock_ridge - Whether to make this a Rock Ridge directory record. ...
[ "Create", "a", "new", "dot", "Directory", "Record", "." ]
train
https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/dr.py#L560-L582
clalancette/pycdlib
pycdlib/dr.py
DirectoryRecord.new_dotdot
def new_dotdot(self, vd, parent, seqnum, rock_ridge, log_block_size, rr_relocated_parent, xa, file_mode): # type: (headervd.PrimaryOrSupplementaryVD, DirectoryRecord, int, str, int, bool, bool, int) -> None ''' Create a new 'dotdot' Directory Record. Parameters: ...
python
def new_dotdot(self, vd, parent, seqnum, rock_ridge, log_block_size, rr_relocated_parent, xa, file_mode): # type: (headervd.PrimaryOrSupplementaryVD, DirectoryRecord, int, str, int, bool, bool, int) -> None ''' Create a new 'dotdot' Directory Record. Parameters: ...
[ "def", "new_dotdot", "(", "self", ",", "vd", ",", "parent", ",", "seqnum", ",", "rock_ridge", ",", "log_block_size", ",", "rr_relocated_parent", ",", "xa", ",", "file_mode", ")", ":", "# type: (headervd.PrimaryOrSupplementaryVD, DirectoryRecord, int, str, int, bool, bool,...
Create a new 'dotdot' Directory Record. Parameters: vd - The Volume Descriptor this record is part of. parent - The parent of this directory record. seqnum - The sequence number for this directory record. rock_ridge - Whether to make this a Rock Ridge directory record. ...
[ "Create", "a", "new", "dotdot", "Directory", "Record", "." ]
train
https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/dr.py#L584-L607
clalancette/pycdlib
pycdlib/dr.py
DirectoryRecord.new_dir
def new_dir(self, vd, name, parent, seqnum, rock_ridge, rr_name, log_block_size, rr_relocated_child, rr_relocated, xa, file_mode): # type: (headervd.PrimaryOrSupplementaryVD, bytes, DirectoryRecord, int, str, bytes, int, bool, bool, bool, int) -> None ''' Create a new directory D...
python
def new_dir(self, vd, name, parent, seqnum, rock_ridge, rr_name, log_block_size, rr_relocated_child, rr_relocated, xa, file_mode): # type: (headervd.PrimaryOrSupplementaryVD, bytes, DirectoryRecord, int, str, bytes, int, bool, bool, bool, int) -> None ''' Create a new directory D...
[ "def", "new_dir", "(", "self", ",", "vd", ",", "name", ",", "parent", ",", "seqnum", ",", "rock_ridge", ",", "rr_name", ",", "log_block_size", ",", "rr_relocated_child", ",", "rr_relocated", ",", "xa", ",", "file_mode", ")", ":", "# type: (headervd.PrimaryOrSu...
Create a new directory Directory Record. Parameters: vd - The Volume Descriptor this record is part of. name - The name for this directory record. parent - The parent of this directory record. seqnum - The sequence number for this directory record. rock_ridge - Whet...
[ "Create", "a", "new", "directory", "Directory", "Record", "." ]
train
https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/dr.py#L609-L642
clalancette/pycdlib
pycdlib/dr.py
DirectoryRecord.change_existence
def change_existence(self, is_hidden): # type: (bool) -> None ''' Change the ISO9660 existence flag of this Directory Record. Parameters: is_hidden - True if this Directory Record should be hidden, False otherwise. Returns: Nothing. ''' if not s...
python
def change_existence(self, is_hidden): # type: (bool) -> None ''' Change the ISO9660 existence flag of this Directory Record. Parameters: is_hidden - True if this Directory Record should be hidden, False otherwise. Returns: Nothing. ''' if not s...
[ "def", "change_existence", "(", "self", ",", "is_hidden", ")", ":", "# type: (bool) -> None", "if", "not", "self", ".", "_initialized", ":", "raise", "pycdlibexception", ".", "PyCdlibInternalError", "(", "'Directory Record not yet initialized'", ")", "if", "is_hidden", ...
Change the ISO9660 existence flag of this Directory Record. Parameters: is_hidden - True if this Directory Record should be hidden, False otherwise. Returns: Nothing.
[ "Change", "the", "ISO9660", "existence", "flag", "of", "this", "Directory", "Record", "." ]
train
https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/dr.py#L644-L660
clalancette/pycdlib
pycdlib/dr.py
DirectoryRecord._recalculate_extents_and_offsets
def _recalculate_extents_and_offsets(self, index, logical_block_size): # type: (int, int) -> Tuple[int, int] ''' Internal method to recalculate the extents and offsets associated with children of this directory record. Parameters: index - The index at which to start the...
python
def _recalculate_extents_and_offsets(self, index, logical_block_size): # type: (int, int) -> Tuple[int, int] ''' Internal method to recalculate the extents and offsets associated with children of this directory record. Parameters: index - The index at which to start the...
[ "def", "_recalculate_extents_and_offsets", "(", "self", ",", "index", ",", "logical_block_size", ")", ":", "# type: (int, int) -> Tuple[int, int]", "if", "index", "==", "0", ":", "dirrecord_offset", "=", "0", "num_extents", "=", "1", "else", ":", "dirrecord_offset", ...
Internal method to recalculate the extents and offsets associated with children of this directory record. Parameters: index - The index at which to start the recalculation. logical_block_size - The block size to use for comparisons. Returns: A tuple where the first el...
[ "Internal", "method", "to", "recalculate", "the", "extents", "and", "offsets", "associated", "with", "children", "of", "this", "directory", "record", "." ]
train
https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/dr.py#L662-L694
clalancette/pycdlib
pycdlib/dr.py
DirectoryRecord._add_child
def _add_child(self, child, logical_block_size, allow_duplicate, check_overflow): # type: (DirectoryRecord, int, bool, bool) -> bool ''' An internal method to add a child to this object. Note that this is called both during parsing and when adding a new object to the system, so it ...
python
def _add_child(self, child, logical_block_size, allow_duplicate, check_overflow): # type: (DirectoryRecord, int, bool, bool) -> bool ''' An internal method to add a child to this object. Note that this is called both during parsing and when adding a new object to the system, so it ...
[ "def", "_add_child", "(", "self", ",", "child", ",", "logical_block_size", ",", "allow_duplicate", ",", "check_overflow", ")", ":", "# type: (DirectoryRecord, int, bool, bool) -> bool", "if", "not", "self", ".", "isdir", ":", "raise", "pycdlibexception", ".", "PyCdlib...
An internal method to add a child to this object. Note that this is called both during parsing and when adding a new object to the system, so it it shouldn't have any functionality that is not appropriate for both. Parameters: child - The child directory record object to add. ...
[ "An", "internal", "method", "to", "add", "a", "child", "to", "this", "object", ".", "Note", "that", "this", "is", "called", "both", "during", "parsing", "and", "when", "adding", "a", "new", "object", "to", "the", "system", "so", "it", "it", "shouldn", ...
train
https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/dr.py#L696-L776
clalancette/pycdlib
pycdlib/dr.py
DirectoryRecord.add_child
def add_child(self, child, logical_block_size, allow_duplicate=False): # type: (DirectoryRecord, int, bool) -> bool ''' A method to add a new child to this directory record. Parameters: child - The child directory record object to add. logical_block_size - The size of ...
python
def add_child(self, child, logical_block_size, allow_duplicate=False): # type: (DirectoryRecord, int, bool) -> bool ''' A method to add a new child to this directory record. Parameters: child - The child directory record object to add. logical_block_size - The size of ...
[ "def", "add_child", "(", "self", ",", "child", ",", "logical_block_size", ",", "allow_duplicate", "=", "False", ")", ":", "# type: (DirectoryRecord, int, bool) -> bool", "if", "not", "self", ".", "_initialized", ":", "raise", "pycdlibexception", ".", "PyCdlibInternalE...
A method to add a new child to this directory record. Parameters: child - The child directory record object to add. logical_block_size - The size of a logical block for this volume descriptor. allow_duplicate - Whether to allow duplicate names, as there are ...
[ "A", "method", "to", "add", "a", "new", "child", "to", "this", "directory", "record", "." ]
train
https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/dr.py#L778-L795
clalancette/pycdlib
pycdlib/dr.py
DirectoryRecord.track_child
def track_child(self, child, logical_block_size, allow_duplicate=False): # type: (DirectoryRecord, int, bool) -> None ''' A method to track an existing child of this directory record. Parameters: child - The child directory record object to add. logical_block_size - Th...
python
def track_child(self, child, logical_block_size, allow_duplicate=False): # type: (DirectoryRecord, int, bool) -> None ''' A method to track an existing child of this directory record. Parameters: child - The child directory record object to add. logical_block_size - Th...
[ "def", "track_child", "(", "self", ",", "child", ",", "logical_block_size", ",", "allow_duplicate", "=", "False", ")", ":", "# type: (DirectoryRecord, int, bool) -> None", "if", "not", "self", ".", "_initialized", ":", "raise", "pycdlibexception", ".", "PyCdlibInterna...
A method to track an existing child of this directory record. Parameters: child - The child directory record object to add. logical_block_size - The size of a logical block for this volume descriptor. allow_duplicate - Whether to allow duplicate names, as there are ...
[ "A", "method", "to", "track", "an", "existing", "child", "of", "this", "directory", "record", "." ]
train
https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/dr.py#L797-L813
clalancette/pycdlib
pycdlib/dr.py
DirectoryRecord.remove_child
def remove_child(self, child, index, logical_block_size): # type: (DirectoryRecord, int, int) -> bool ''' A method to remove a child from this Directory Record. Parameters: child - The child DirectoryRecord object to remove. index - The index of the child into this Dir...
python
def remove_child(self, child, index, logical_block_size): # type: (DirectoryRecord, int, int) -> bool ''' A method to remove a child from this Directory Record. Parameters: child - The child DirectoryRecord object to remove. index - The index of the child into this Dir...
[ "def", "remove_child", "(", "self", ",", "child", ",", "index", ",", "logical_block_size", ")", ":", "# type: (DirectoryRecord, int, int) -> bool", "if", "not", "self", ".", "_initialized", ":", "raise", "pycdlibexception", ".", "PyCdlibInternalError", "(", "'Director...
A method to remove a child from this Directory Record. Parameters: child - The child DirectoryRecord object to remove. index - The index of the child into this DirectoryRecord children list. logical_block_size - The size of a logical block on this volume descriptor. Returns: ...
[ "A", "method", "to", "remove", "a", "child", "from", "this", "Directory", "Record", "." ]
train
https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/dr.py#L815-L887
clalancette/pycdlib
pycdlib/dr.py
DirectoryRecord.record
def record(self): # type: () -> bytes ''' A method to generate the string representing this Directory Record. Parameters: None. Returns: String representing this Directory Record. ''' if not self._initialized: raise pycdlibexception....
python
def record(self): # type: () -> bytes ''' A method to generate the string representing this Directory Record. Parameters: None. Returns: String representing this Directory Record. ''' if not self._initialized: raise pycdlibexception....
[ "def", "record", "(", "self", ")", ":", "# type: () -> bytes", "if", "not", "self", ".", "_initialized", ":", "raise", "pycdlibexception", ".", "PyCdlibInternalError", "(", "'Directory Record not yet initialized'", ")", "# Ecma-119 9.1.5 says the date should reflect the time ...
A method to generate the string representing this Directory Record. Parameters: None. Returns: String representing this Directory Record.
[ "A", "method", "to", "generate", "the", "string", "representing", "this", "Directory", "Record", "." ]
train
https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/dr.py#L1001-L1042
clalancette/pycdlib
pycdlib/dr.py
DirectoryRecord.is_associated_file
def is_associated_file(self): # type: () -> bool ''' A method to determine whether this file is 'associated' with another file on the ISO. Parameters: None. Returns: True if this file is associated with another file on the ISO, False otherwise....
python
def is_associated_file(self): # type: () -> bool ''' A method to determine whether this file is 'associated' with another file on the ISO. Parameters: None. Returns: True if this file is associated with another file on the ISO, False otherwise....
[ "def", "is_associated_file", "(", "self", ")", ":", "# type: () -> bool", "if", "not", "self", ".", "_initialized", ":", "raise", "pycdlibexception", ".", "PyCdlibInternalError", "(", "'Directory Record not yet initialized'", ")", "return", "self", ".", "file_flags", ...
A method to determine whether this file is 'associated' with another file on the ISO. Parameters: None. Returns: True if this file is associated with another file on the ISO, False otherwise.
[ "A", "method", "to", "determine", "whether", "this", "file", "is", "associated", "with", "another", "file", "on", "the", "ISO", "." ]
train
https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/dr.py#L1044-L1059
clalancette/pycdlib
pycdlib/dr.py
DirectoryRecord.set_ptr
def set_ptr(self, ptr): # type: (path_table_record.PathTableRecord) -> None ''' A method to set the Path Table Record associated with this Directory Record. Parameters: ptr - The path table record to associate with this Directory Record. Returns: Nothin...
python
def set_ptr(self, ptr): # type: (path_table_record.PathTableRecord) -> None ''' A method to set the Path Table Record associated with this Directory Record. Parameters: ptr - The path table record to associate with this Directory Record. Returns: Nothin...
[ "def", "set_ptr", "(", "self", ",", "ptr", ")", ":", "# type: (path_table_record.PathTableRecord) -> None", "if", "not", "self", ".", "_initialized", ":", "raise", "pycdlibexception", ".", "PyCdlibInternalError", "(", "'Directory Record not yet initialized'", ")", "self",...
A method to set the Path Table Record associated with this Directory Record. Parameters: ptr - The path table record to associate with this Directory Record. Returns: Nothing.
[ "A", "method", "to", "set", "the", "Path", "Table", "Record", "associated", "with", "this", "Directory", "Record", "." ]
train
https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/dr.py#L1061-L1075
clalancette/pycdlib
pycdlib/dr.py
DirectoryRecord.set_data_location
def set_data_location(self, current_extent, tag_location): # pylint: disable=unused-argument # type: (int, int) -> None ''' A method to set the new extent location that the data for this Directory Record should live at. Parameters: current_extent - The new extent. ...
python
def set_data_location(self, current_extent, tag_location): # pylint: disable=unused-argument # type: (int, int) -> None ''' A method to set the new extent location that the data for this Directory Record should live at. Parameters: current_extent - The new extent. ...
[ "def", "set_data_location", "(", "self", ",", "current_extent", ",", "tag_location", ")", ":", "# pylint: disable=unused-argument", "# type: (int, int) -> None", "if", "not", "self", ".", "_initialized", ":", "raise", "pycdlibexception", ".", "PyCdlibInternalError", "(", ...
A method to set the new extent location that the data for this Directory Record should live at. Parameters: current_extent - The new extent. Returns: Nothing.
[ "A", "method", "to", "set", "the", "new", "extent", "location", "that", "the", "data", "for", "this", "Directory", "Record", "should", "live", "at", "." ]
train
https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/dr.py#L1077-L1093
clalancette/pycdlib
pycdlib/dr.py
DirectoryRecord.get_data_length
def get_data_length(self): # type: () -> int ''' A method to get the length of the data that this Directory Record points to. Parameters: None. Returns: The length of the data that this Directory Record points to. ''' if not self._initia...
python
def get_data_length(self): # type: () -> int ''' A method to get the length of the data that this Directory Record points to. Parameters: None. Returns: The length of the data that this Directory Record points to. ''' if not self._initia...
[ "def", "get_data_length", "(", "self", ")", ":", "# type: () -> int", "if", "not", "self", ".", "_initialized", ":", "raise", "pycdlibexception", ".", "PyCdlibInternalError", "(", "'Directory Record not yet initialized'", ")", "if", "self", ".", "inode", "is", "not"...
A method to get the length of the data that this Directory Record points to. Parameters: None. Returns: The length of the data that this Directory Record points to.
[ "A", "method", "to", "get", "the", "length", "of", "the", "data", "that", "this", "Directory", "Record", "points", "to", "." ]
train
https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/dr.py#L1095-L1110
clalancette/pycdlib
pycdlib/dr.py
DirectoryRecord.set_data_length
def set_data_length(self, length): # type: (int) -> None ''' A method to set the length of the data that this Directory Record points to. Parameters: length - The new length for the data. Returns: The length of the data that this Directory Record points...
python
def set_data_length(self, length): # type: (int) -> None ''' A method to set the length of the data that this Directory Record points to. Parameters: length - The new length for the data. Returns: The length of the data that this Directory Record points...
[ "def", "set_data_length", "(", "self", ",", "length", ")", ":", "# type: (int) -> None", "if", "not", "self", ".", "_initialized", ":", "raise", "pycdlibexception", ".", "PyCdlibInternalError", "(", "'Directory Record not yet initialized'", ")", "self", ".", "data_len...
A method to set the length of the data that this Directory Record points to. Parameters: length - The new length for the data. Returns: The length of the data that this Directory Record points to.
[ "A", "method", "to", "set", "the", "length", "of", "the", "data", "that", "this", "Directory", "Record", "points", "to", "." ]
train
https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/dr.py#L1112-L1125
clalancette/pycdlib
pycdlib/inode.py
Inode.new
def new(self, length, fp, manage_fp, offset): # type: (int, BinaryIO, bool, int) -> None ''' Initialize a new Inode. Parameters: None. Returns: Nothing. ''' if self._initialized: raise pycdlibexception.PyCdlibInternalError('Inode is ...
python
def new(self, length, fp, manage_fp, offset): # type: (int, BinaryIO, bool, int) -> None ''' Initialize a new Inode. Parameters: None. Returns: Nothing. ''' if self._initialized: raise pycdlibexception.PyCdlibInternalError('Inode is ...
[ "def", "new", "(", "self", ",", "length", ",", "fp", ",", "manage_fp", ",", "offset", ")", ":", "# type: (int, BinaryIO, bool, int) -> None", "if", "self", ".", "_initialized", ":", "raise", "pycdlibexception", ".", "PyCdlibInternalError", "(", "'Inode is already in...
Initialize a new Inode. Parameters: None. Returns: Nothing.
[ "Initialize", "a", "new", "Inode", "." ]
train
https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/inode.py#L56-L76
clalancette/pycdlib
pycdlib/inode.py
Inode.parse
def parse(self, extent, length, fp, log_block_size): # type: (int, int, BinaryIO, int) -> None ''' Parse an existing Inode. This just saves off the extent for later use. Parameters: extent - The original extent that the data lives at. Returns: Nothing. ...
python
def parse(self, extent, length, fp, log_block_size): # type: (int, int, BinaryIO, int) -> None ''' Parse an existing Inode. This just saves off the extent for later use. Parameters: extent - The original extent that the data lives at. Returns: Nothing. ...
[ "def", "parse", "(", "self", ",", "extent", ",", "length", ",", "fp", ",", "log_block_size", ")", ":", "# type: (int, int, BinaryIO, int) -> None", "if", "self", ".", "_initialized", ":", "raise", "pycdlibexception", ".", "PyCdlibInternalError", "(", "'Inode is alre...
Parse an existing Inode. This just saves off the extent for later use. Parameters: extent - The original extent that the data lives at. Returns: Nothing.
[ "Parse", "an", "existing", "Inode", ".", "This", "just", "saves", "off", "the", "extent", "for", "later", "use", "." ]
train
https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/inode.py#L78-L100
clalancette/pycdlib
pycdlib/inode.py
Inode.add_boot_info_table
def add_boot_info_table(self, boot_info_table): # type: (eltorito.EltoritoBootInfoTable) -> None ''' A method to add a boot info table to this Inode. Parameters: boot_info_table - The Boot Info Table object to add to this Inode. Returns: Nothing. ''' ...
python
def add_boot_info_table(self, boot_info_table): # type: (eltorito.EltoritoBootInfoTable) -> None ''' A method to add a boot info table to this Inode. Parameters: boot_info_table - The Boot Info Table object to add to this Inode. Returns: Nothing. ''' ...
[ "def", "add_boot_info_table", "(", "self", ",", "boot_info_table", ")", ":", "# type: (eltorito.EltoritoBootInfoTable) -> None", "if", "not", "self", ".", "_initialized", ":", "raise", "pycdlibexception", ".", "PyCdlibInternalError", "(", "'Inode is not yet initialized'", "...
A method to add a boot info table to this Inode. Parameters: boot_info_table - The Boot Info Table object to add to this Inode. Returns: Nothing.
[ "A", "method", "to", "add", "a", "boot", "info", "table", "to", "this", "Inode", "." ]
train
https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/inode.py#L149-L162
clalancette/pycdlib
pycdlib/inode.py
Inode.update_fp
def update_fp(self, fp, length): # type: (BinaryIO, int) -> None ''' Update the Inode to use a different file object and length. Parameters: fp - A file object that contains the data for this Inode. length - The length of the data. Returns: Nothing. ...
python
def update_fp(self, fp, length): # type: (BinaryIO, int) -> None ''' Update the Inode to use a different file object and length. Parameters: fp - A file object that contains the data for this Inode. length - The length of the data. Returns: Nothing. ...
[ "def", "update_fp", "(", "self", ",", "fp", ",", "length", ")", ":", "# type: (BinaryIO, int) -> None", "if", "not", "self", ".", "_initialized", ":", "raise", "pycdlibexception", ".", "PyCdlibInternalError", "(", "'Inode is not yet initialized'", ")", "self", ".", ...
Update the Inode to use a different file object and length. Parameters: fp - A file object that contains the data for this Inode. length - The length of the data. Returns: Nothing.
[ "Update", "the", "Inode", "to", "use", "a", "different", "file", "object", "and", "length", "." ]
train
https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/inode.py#L164-L181
clalancette/pycdlib
pycdlib/dates.py
string_to_timestruct
def string_to_timestruct(input_string): # type: (bytes) -> time.struct_time ''' A cacheable function to take an input string and decode it into a time.struct_time from the time module. If the string cannot be decoded because of an illegal value, then the all-zero time.struct_time will be return...
python
def string_to_timestruct(input_string): # type: (bytes) -> time.struct_time ''' A cacheable function to take an input string and decode it into a time.struct_time from the time module. If the string cannot be decoded because of an illegal value, then the all-zero time.struct_time will be return...
[ "def", "string_to_timestruct", "(", "input_string", ")", ":", "# type: (bytes) -> time.struct_time", "try", ":", "timestruct", "=", "time", ".", "strptime", "(", "input_string", ".", "decode", "(", "'utf-8'", ")", ",", "VolumeDescriptorDate", ".", "TIME_FMT", ")", ...
A cacheable function to take an input string and decode it into a time.struct_time from the time module. If the string cannot be decoded because of an illegal value, then the all-zero time.struct_time will be returned instead. Parameters: input_string - The string to attempt to parse. Returns...
[ "A", "cacheable", "function", "to", "take", "an", "input", "string", "and", "decode", "it", "into", "a", "time", ".", "struct_time", "from", "the", "time", "module", ".", "If", "the", "string", "cannot", "be", "decoded", "because", "of", "an", "illegal", ...
train
https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/dates.py#L35-L59
clalancette/pycdlib
pycdlib/dates.py
DirectoryRecordDate.parse
def parse(self, datestr): # type: (bytes) -> None ''' Parse a Directory Record date out of a string. Parameters: datestr - The string to parse the date out of. Returns: Nothing. ''' if self._initialized: raise pycdlibexception.PyCdli...
python
def parse(self, datestr): # type: (bytes) -> None ''' Parse a Directory Record date out of a string. Parameters: datestr - The string to parse the date out of. Returns: Nothing. ''' if self._initialized: raise pycdlibexception.PyCdli...
[ "def", "parse", "(", "self", ",", "datestr", ")", ":", "# type: (bytes) -> None", "if", "self", ".", "_initialized", ":", "raise", "pycdlibexception", ".", "PyCdlibInternalError", "(", "'Directory Record Date already initialized'", ")", "(", "self", ".", "years_since_...
Parse a Directory Record date out of a string. Parameters: datestr - The string to parse the date out of. Returns: Nothing.
[ "Parse", "a", "Directory", "Record", "date", "out", "of", "a", "string", "." ]
train
https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/dates.py#L81-L98
clalancette/pycdlib
pycdlib/dates.py
DirectoryRecordDate.new
def new(self): # type: () -> None ''' Create a new Directory Record date based on the current time. Parameters: tm - An optional argument that must be None Returns: Nothing. ''' if self._initialized: raise pycdlibexception.PyCdlibInt...
python
def new(self): # type: () -> None ''' Create a new Directory Record date based on the current time. Parameters: tm - An optional argument that must be None Returns: Nothing. ''' if self._initialized: raise pycdlibexception.PyCdlibInt...
[ "def", "new", "(", "self", ")", ":", "# type: () -> None", "if", "self", ".", "_initialized", ":", "raise", "pycdlibexception", ".", "PyCdlibInternalError", "(", "'Directory Record Date already initialized'", ")", "# This algorithm was ported from cdrkit, genisoimage.c:iso9660_...
Create a new Directory Record date based on the current time. Parameters: tm - An optional argument that must be None Returns: Nothing.
[ "Create", "a", "new", "Directory", "Record", "date", "based", "on", "the", "current", "time", "." ]
train
https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/dates.py#L100-L123
clalancette/pycdlib
pycdlib/dates.py
DirectoryRecordDate.record
def record(self): # type: () -> bytes ''' Return a string representation of the Directory Record date. Parameters: None. Returns: A string representing this Directory Record Date. ''' if not self._initialized: raise pycdlibexception....
python
def record(self): # type: () -> bytes ''' Return a string representation of the Directory Record date. Parameters: None. Returns: A string representing this Directory Record Date. ''' if not self._initialized: raise pycdlibexception....
[ "def", "record", "(", "self", ")", ":", "# type: () -> bytes", "if", "not", "self", ".", "_initialized", ":", "raise", "pycdlibexception", ".", "PyCdlibInternalError", "(", "'Directory Record Date not initialized'", ")", "return", "struct", ".", "pack", "(", "self",...
Return a string representation of the Directory Record date. Parameters: None. Returns: A string representing this Directory Record Date.
[ "Return", "a", "string", "representation", "of", "the", "Directory", "Record", "date", "." ]
train
https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/dates.py#L125-L140
clalancette/pycdlib
pycdlib/dates.py
VolumeDescriptorDate.parse
def parse(self, datestr): # type: (bytes) -> None ''' Parse a Volume Descriptor Date out of a string. A string of all zeros is valid, which means that the date in this field was not specified. Parameters: datestr - string to be parsed Returns: Nothin...
python
def parse(self, datestr): # type: (bytes) -> None ''' Parse a Volume Descriptor Date out of a string. A string of all zeros is valid, which means that the date in this field was not specified. Parameters: datestr - string to be parsed Returns: Nothin...
[ "def", "parse", "(", "self", ",", "datestr", ")", ":", "# type: (bytes) -> None", "if", "self", ".", "_initialized", ":", "raise", "pycdlibexception", ".", "PyCdlibInternalError", "(", "'This Volume Descriptor Date object is already initialized'", ")", "if", "len", "(",...
Parse a Volume Descriptor Date out of a string. A string of all zeros is valid, which means that the date in this field was not specified. Parameters: datestr - string to be parsed Returns: Nothing.
[ "Parse", "a", "Volume", "Descriptor", "Date", "out", "of", "a", "string", ".", "A", "string", "of", "all", "zeros", "is", "valid", "which", "means", "that", "the", "date", "in", "this", "field", "was", "not", "specified", "." ]
train
https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/dates.py#L170-L203
clalancette/pycdlib
pycdlib/dates.py
VolumeDescriptorDate.new
def new(self, tm=0.0): # type: (float) -> None ''' Create a new Volume Descriptor Date. If tm is None, then this Volume Descriptor Date will be full of zeros (meaning not specified). If tm is not None, it is expected to be a struct_time object, at which point this Volum...
python
def new(self, tm=0.0): # type: (float) -> None ''' Create a new Volume Descriptor Date. If tm is None, then this Volume Descriptor Date will be full of zeros (meaning not specified). If tm is not None, it is expected to be a struct_time object, at which point this Volum...
[ "def", "new", "(", "self", ",", "tm", "=", "0.0", ")", ":", "# type: (float) -> None", "if", "self", ".", "_initialized", ":", "raise", "pycdlibexception", ".", "PyCdlibInternalError", "(", "'This Volume Descriptor Date object is already initialized'", ")", "if", "tm"...
Create a new Volume Descriptor Date. If tm is None, then this Volume Descriptor Date will be full of zeros (meaning not specified). If tm is not None, it is expected to be a struct_time object, at which point this Volume Descriptor Date object will be filled in with data from that stru...
[ "Create", "a", "new", "Volume", "Descriptor", "Date", ".", "If", "tm", "is", "None", "then", "this", "Volume", "Descriptor", "Date", "will", "be", "full", "of", "zeros", "(", "meaning", "not", "specified", ")", ".", "If", "tm", "is", "not", "None", "it...
train
https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/dates.py#L220-L260
clalancette/pycdlib
pycdlib/rockridge.py
RRSPRecord.parse
def parse(self, rrstr): # type: (bytes) -> None ''' Parse a Rock Ridge Sharing Protocol record out of a string. Parameters: rrstr - The string to parse the record out of. Returns: Nothing. ''' if self._initialized: raise pycdlibexcep...
python
def parse(self, rrstr): # type: (bytes) -> None ''' Parse a Rock Ridge Sharing Protocol record out of a string. Parameters: rrstr - The string to parse the record out of. Returns: Nothing. ''' if self._initialized: raise pycdlibexcep...
[ "def", "parse", "(", "self", ",", "rrstr", ")", ":", "# type: (bytes) -> None", "if", "self", ".", "_initialized", ":", "raise", "pycdlibexception", ".", "PyCdlibInternalError", "(", "'SP record already initialized!'", ")", "(", "su_len", ",", "su_entry_version_unused...
Parse a Rock Ridge Sharing Protocol record out of a string. Parameters: rrstr - The string to parse the record out of. Returns: Nothing.
[ "Parse", "a", "Rock", "Ridge", "Sharing", "Protocol", "record", "out", "of", "a", "string", "." ]
train
https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/rockridge.py#L59-L83
clalancette/pycdlib
pycdlib/rockridge.py
RRSPRecord.new
def new(self, bytes_to_skip): # type: (int) -> None ''' Create a new Rock Ridge Sharing Protocol record. Parameters: bytes_to_skip - The number of bytes to skip. Returns: Nothing. ''' if self._initialized: raise pycdlibexception.PyCdl...
python
def new(self, bytes_to_skip): # type: (int) -> None ''' Create a new Rock Ridge Sharing Protocol record. Parameters: bytes_to_skip - The number of bytes to skip. Returns: Nothing. ''' if self._initialized: raise pycdlibexception.PyCdl...
[ "def", "new", "(", "self", ",", "bytes_to_skip", ")", ":", "# type: (int) -> None", "if", "self", ".", "_initialized", ":", "raise", "pycdlibexception", ".", "PyCdlibInternalError", "(", "'SP record already initialized!'", ")", "self", ".", "bytes_to_skip", "=", "by...
Create a new Rock Ridge Sharing Protocol record. Parameters: bytes_to_skip - The number of bytes to skip. Returns: Nothing.
[ "Create", "a", "new", "Rock", "Ridge", "Sharing", "Protocol", "record", "." ]
train
https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/rockridge.py#L85-L99
clalancette/pycdlib
pycdlib/rockridge.py
RRSPRecord.record
def record(self): # type: () -> bytes ''' Generate a string representing the Rock Ridge Sharing Protocol record. Parameters: None. Returns: String containing the Rock Ridge record. ''' if not self._initialized: raise pycdlibexception...
python
def record(self): # type: () -> bytes ''' Generate a string representing the Rock Ridge Sharing Protocol record. Parameters: None. Returns: String containing the Rock Ridge record. ''' if not self._initialized: raise pycdlibexception...
[ "def", "record", "(", "self", ")", ":", "# type: () -> bytes", "if", "not", "self", ".", "_initialized", ":", "raise", "pycdlibexception", ".", "PyCdlibInternalError", "(", "'SP record not yet initialized!'", ")", "return", "b'SP'", "+", "struct", ".", "pack", "("...
Generate a string representing the Rock Ridge Sharing Protocol record. Parameters: None. Returns: String containing the Rock Ridge record.
[ "Generate", "a", "string", "representing", "the", "Rock", "Ridge", "Sharing", "Protocol", "record", "." ]
train
https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/rockridge.py#L101-L114
clalancette/pycdlib
pycdlib/rockridge.py
RRRRRecord.new
def new(self): # type: () -> None ''' Create a new Rock Ridge Rock Ridge record. Parameters: None. Returns: Nothing. ''' if self._initialized: raise pycdlibexception.PyCdlibInternalError('RR record already initialized!') sel...
python
def new(self): # type: () -> None ''' Create a new Rock Ridge Rock Ridge record. Parameters: None. Returns: Nothing. ''' if self._initialized: raise pycdlibexception.PyCdlibInternalError('RR record already initialized!') sel...
[ "def", "new", "(", "self", ")", ":", "# type: () -> None", "if", "self", ".", "_initialized", ":", "raise", "pycdlibexception", ".", "PyCdlibInternalError", "(", "'RR record already initialized!'", ")", "self", ".", "rr_flags", "=", "0", "self", ".", "_initialized...
Create a new Rock Ridge Rock Ridge record. Parameters: None. Returns: Nothing.
[ "Create", "a", "new", "Rock", "Ridge", "Rock", "Ridge", "record", "." ]
train
https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/rockridge.py#L167-L181
clalancette/pycdlib
pycdlib/rockridge.py
RRRRRecord.append_field
def append_field(self, fieldname): # type: (str) -> None ''' Mark a field as present in the Rock Ridge records. Parameters: fieldname - The name of the field to mark as present; should be one of 'PX', 'PN', 'SL', 'NM', 'CL', 'PL', 'RE', or 'TF'. Ret...
python
def append_field(self, fieldname): # type: (str) -> None ''' Mark a field as present in the Rock Ridge records. Parameters: fieldname - The name of the field to mark as present; should be one of 'PX', 'PN', 'SL', 'NM', 'CL', 'PL', 'RE', or 'TF'. Ret...
[ "def", "append_field", "(", "self", ",", "fieldname", ")", ":", "# type: (str) -> None", "if", "not", "self", ".", "_initialized", ":", "raise", "pycdlibexception", ".", "PyCdlibInternalError", "(", "'RR record not yet initialized!'", ")", "if", "fieldname", "==", "...
Mark a field as present in the Rock Ridge records. Parameters: fieldname - The name of the field to mark as present; should be one of 'PX', 'PN', 'SL', 'NM', 'CL', 'PL', 'RE', or 'TF'. Returns: Nothing.
[ "Mark", "a", "field", "as", "present", "in", "the", "Rock", "Ridge", "records", "." ]
train
https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/rockridge.py#L183-L216
clalancette/pycdlib
pycdlib/rockridge.py
RRRRRecord.record
def record(self): # type: () -> bytes ''' Generate a string representing the Rock Ridge Rock Ridge record. Parameters: None. Returns: String containing the Rock Ridge record. ''' if not self._initialized: raise pycdlibexception.PyCdl...
python
def record(self): # type: () -> bytes ''' Generate a string representing the Rock Ridge Rock Ridge record. Parameters: None. Returns: String containing the Rock Ridge record. ''' if not self._initialized: raise pycdlibexception.PyCdl...
[ "def", "record", "(", "self", ")", ":", "# type: () -> bytes", "if", "not", "self", ".", "_initialized", ":", "raise", "pycdlibexception", ".", "PyCdlibInternalError", "(", "'RR record not yet initialized!'", ")", "return", "b'RR'", "+", "struct", ".", "pack", "("...
Generate a string representing the Rock Ridge Rock Ridge record. Parameters: None. Returns: String containing the Rock Ridge record.
[ "Generate", "a", "string", "representing", "the", "Rock", "Ridge", "Rock", "Ridge", "record", "." ]
train
https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/rockridge.py#L218-L231
clalancette/pycdlib
pycdlib/rockridge.py
RRCERecord.parse
def parse(self, rrstr): # type: (bytes) -> None ''' Parse a Rock Ridge Continuation Entry record out of a string. Parameters: rrstr - The string to parse the record out of. Returns: Nothing. ''' if self._initialized: raise pycdlibexc...
python
def parse(self, rrstr): # type: (bytes) -> None ''' Parse a Rock Ridge Continuation Entry record out of a string. Parameters: rrstr - The string to parse the record out of. Returns: Nothing. ''' if self._initialized: raise pycdlibexc...
[ "def", "parse", "(", "self", ",", "rrstr", ")", ":", "# type: (bytes) -> None", "if", "self", ".", "_initialized", ":", "raise", "pycdlibexception", ".", "PyCdlibInternalError", "(", "'CE record already initialized!'", ")", "(", "su_len", ",", "su_entry_version_unused...
Parse a Rock Ridge Continuation Entry record out of a string. Parameters: rrstr - The string to parse the record out of. Returns: Nothing.
[ "Parse", "a", "Rock", "Ridge", "Continuation", "Entry", "record", "out", "of", "a", "string", "." ]
train
https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/rockridge.py#L261-L297
clalancette/pycdlib
pycdlib/rockridge.py
RRCERecord.new
def new(self): # type: () -> None ''' Create a new Rock Ridge Continuation Entry record. Parameters: None. Returns: Nothing. ''' if self._initialized: raise pycdlibexception.PyCdlibInternalError('CE record already initialized!') ...
python
def new(self): # type: () -> None ''' Create a new Rock Ridge Continuation Entry record. Parameters: None. Returns: Nothing. ''' if self._initialized: raise pycdlibexception.PyCdlibInternalError('CE record already initialized!') ...
[ "def", "new", "(", "self", ")", ":", "# type: () -> None", "if", "self", ".", "_initialized", ":", "raise", "pycdlibexception", ".", "PyCdlibInternalError", "(", "'CE record already initialized!'", ")", "self", ".", "bl_cont_area", "=", "0", "# This will get set durin...
Create a new Rock Ridge Continuation Entry record. Parameters: None. Returns: Nothing.
[ "Create", "a", "new", "Rock", "Ridge", "Continuation", "Entry", "record", "." ]
train
https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/rockridge.py#L299-L316
clalancette/pycdlib
pycdlib/rockridge.py
RRCERecord.update_extent
def update_extent(self, extent): # type: (int) -> None ''' Update the extent for this CE record. Parameters: extent - The new extent for this CE record. Returns: Nothing. ''' if not self._initialized: raise pycdlibexception.PyCdlibIn...
python
def update_extent(self, extent): # type: (int) -> None ''' Update the extent for this CE record. Parameters: extent - The new extent for this CE record. Returns: Nothing. ''' if not self._initialized: raise pycdlibexception.PyCdlibIn...
[ "def", "update_extent", "(", "self", ",", "extent", ")", ":", "# type: (int) -> None", "if", "not", "self", ".", "_initialized", ":", "raise", "pycdlibexception", ".", "PyCdlibInternalError", "(", "'CE record not yet initialized!'", ")", "self", ".", "bl_cont_area", ...
Update the extent for this CE record. Parameters: extent - The new extent for this CE record. Returns: Nothing.
[ "Update", "the", "extent", "for", "this", "CE", "record", "." ]
train
https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/rockridge.py#L318-L331
clalancette/pycdlib
pycdlib/rockridge.py
RRCERecord.update_offset
def update_offset(self, offset): # type: (int) -> None ''' Update the offset for this CE record. Parameters: extent - The new offset for this CE record. Returns: Nothing. ''' if not self._initialized: raise pycdlibexception.PyCdlibIn...
python
def update_offset(self, offset): # type: (int) -> None ''' Update the offset for this CE record. Parameters: extent - The new offset for this CE record. Returns: Nothing. ''' if not self._initialized: raise pycdlibexception.PyCdlibIn...
[ "def", "update_offset", "(", "self", ",", "offset", ")", ":", "# type: (int) -> None", "if", "not", "self", ".", "_initialized", ":", "raise", "pycdlibexception", ".", "PyCdlibInternalError", "(", "'CE record not yet initialized!'", ")", "self", ".", "offset_cont_area...
Update the offset for this CE record. Parameters: extent - The new offset for this CE record. Returns: Nothing.
[ "Update", "the", "offset", "for", "this", "CE", "record", "." ]
train
https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/rockridge.py#L333-L346
clalancette/pycdlib
pycdlib/rockridge.py
RRCERecord.add_record
def add_record(self, length): # type: (int) -> None ''' Add some more length to this CE record. Used when a new record is going to get recorded into the CE (rather than the DR). Parameters: length - The length to add to this CE record. Returns: Nothing...
python
def add_record(self, length): # type: (int) -> None ''' Add some more length to this CE record. Used when a new record is going to get recorded into the CE (rather than the DR). Parameters: length - The length to add to this CE record. Returns: Nothing...
[ "def", "add_record", "(", "self", ",", "length", ")", ":", "# type: (int) -> None", "if", "not", "self", ".", "_initialized", ":", "raise", "pycdlibexception", ".", "PyCdlibInternalError", "(", "'CE record not yet initialized!'", ")", "self", ".", "len_cont_area", "...
Add some more length to this CE record. Used when a new record is going to get recorded into the CE (rather than the DR). Parameters: length - The length to add to this CE record. Returns: Nothing.
[ "Add", "some", "more", "length", "to", "this", "CE", "record", ".", "Used", "when", "a", "new", "record", "is", "going", "to", "get", "recorded", "into", "the", "CE", "(", "rather", "than", "the", "DR", ")", "." ]
train
https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/rockridge.py#L348-L362
clalancette/pycdlib
pycdlib/rockridge.py
RRCERecord.record
def record(self): # type: () -> bytes ''' Generate a string representing the Rock Ridge Continuation Entry record. Parameters: None. Returns: String containing the Rock Ridge record. ''' if not self._initialized: raise pycdlibexcepti...
python
def record(self): # type: () -> bytes ''' Generate a string representing the Rock Ridge Continuation Entry record. Parameters: None. Returns: String containing the Rock Ridge record. ''' if not self._initialized: raise pycdlibexcepti...
[ "def", "record", "(", "self", ")", ":", "# type: () -> bytes", "if", "not", "self", ".", "_initialized", ":", "raise", "pycdlibexception", ".", "PyCdlibInternalError", "(", "'CE record not yet initialized!'", ")", "return", "b'CE'", "+", "struct", ".", "pack", "("...
Generate a string representing the Rock Ridge Continuation Entry record. Parameters: None. Returns: String containing the Rock Ridge record.
[ "Generate", "a", "string", "representing", "the", "Rock", "Ridge", "Continuation", "Entry", "record", "." ]
train
https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/rockridge.py#L364-L385
clalancette/pycdlib
pycdlib/rockridge.py
RRPXRecord.parse
def parse(self, rrstr): # type: (bytes) -> int ''' Parse a Rock Ridge POSIX File Attributes record out of a string. Parameters: rrstr - The string to parse the record out of. Returns: A string representing the RR version, either 1.09 or 1.12. ''' ...
python
def parse(self, rrstr): # type: (bytes) -> int ''' Parse a Rock Ridge POSIX File Attributes record out of a string. Parameters: rrstr - The string to parse the record out of. Returns: A string representing the RR version, either 1.09 or 1.12. ''' ...
[ "def", "parse", "(", "self", ",", "rrstr", ")", ":", "# type: (bytes) -> int", "if", "self", ".", "_initialized", ":", "raise", "pycdlibexception", ".", "PyCdlibInternalError", "(", "'PX record already initialized!'", ")", "(", "su_len", ",", "su_entry_version_unused"...
Parse a Rock Ridge POSIX File Attributes record out of a string. Parameters: rrstr - The string to parse the record out of. Returns: A string representing the RR version, either 1.09 or 1.12.
[ "Parse", "a", "Rock", "Ridge", "POSIX", "File", "Attributes", "record", "out", "of", "a", "string", "." ]
train
https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/rockridge.py#L421-L476
clalancette/pycdlib
pycdlib/rockridge.py
RRPXRecord.new
def new(self, mode): # type: (int) -> None ''' Create a new Rock Ridge POSIX File Attributes record. Parameters: mode - The Unix file mode for this record. Returns: Nothing. ''' if self._initialized: raise pycdlibexception.PyCdlibInt...
python
def new(self, mode): # type: (int) -> None ''' Create a new Rock Ridge POSIX File Attributes record. Parameters: mode - The Unix file mode for this record. Returns: Nothing. ''' if self._initialized: raise pycdlibexception.PyCdlibInt...
[ "def", "new", "(", "self", ",", "mode", ")", ":", "# type: (int) -> None", "if", "self", ".", "_initialized", ":", "raise", "pycdlibexception", ".", "PyCdlibInternalError", "(", "'PX record already initialized!'", ")", "self", ".", "posix_file_mode", "=", "mode", ...
Create a new Rock Ridge POSIX File Attributes record. Parameters: mode - The Unix file mode for this record. Returns: Nothing.
[ "Create", "a", "new", "Rock", "Ridge", "POSIX", "File", "Attributes", "record", "." ]
train
https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/rockridge.py#L478-L497
clalancette/pycdlib
pycdlib/rockridge.py
RRPXRecord.record
def record(self, rr_version): # type: (str) -> bytes ''' Generate a string representing the Rock Ridge POSIX File Attributes record. Parameters: rr_version - The Rock Ridge version to use. Returns: String containing the Rock Ridge record. ''' ...
python
def record(self, rr_version): # type: (str) -> bytes ''' Generate a string representing the Rock Ridge POSIX File Attributes record. Parameters: rr_version - The Rock Ridge version to use. Returns: String containing the Rock Ridge record. ''' ...
[ "def", "record", "(", "self", ",", "rr_version", ")", ":", "# type: (str) -> bytes", "if", "not", "self", ".", "_initialized", ":", "raise", "pycdlibexception", ".", "PyCdlibInternalError", "(", "'PX record not yet initialized!'", ")", "outlist", "=", "[", "b'PX'", ...
Generate a string representing the Rock Ridge POSIX File Attributes record. Parameters: rr_version - The Rock Ridge version to use. Returns: String containing the Rock Ridge record.
[ "Generate", "a", "string", "representing", "the", "Rock", "Ridge", "POSIX", "File", "Attributes", "record", "." ]
train
https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/rockridge.py#L499-L529
clalancette/pycdlib
pycdlib/rockridge.py
RRERRecord.parse
def parse(self, rrstr): # type: (bytes) -> None ''' Parse a Rock Ridge Extensions Reference record out of a string. Parameters: rrstr - The string to parse the record out of. Returns: Nothing. ''' if self._initialized: raise pycdlibe...
python
def parse(self, rrstr): # type: (bytes) -> None ''' Parse a Rock Ridge Extensions Reference record out of a string. Parameters: rrstr - The string to parse the record out of. Returns: Nothing. ''' if self._initialized: raise pycdlibe...
[ "def", "parse", "(", "self", ",", "rrstr", ")", ":", "# type: (bytes) -> None", "if", "self", ".", "_initialized", ":", "raise", "pycdlibexception", ".", "PyCdlibInternalError", "(", "'ER record already initialized!'", ")", "(", "su_len", ",", "su_entry_version_unused...
Parse a Rock Ridge Extensions Reference record out of a string. Parameters: rrstr - The string to parse the record out of. Returns: Nothing.
[ "Parse", "a", "Rock", "Ridge", "Extensions", "Reference", "record", "out", "of", "a", "string", "." ]
train
https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/rockridge.py#L566-L599
clalancette/pycdlib
pycdlib/rockridge.py
RRERRecord.new
def new(self, ext_id, ext_des, ext_src): # type: (bytes, bytes, bytes) -> None ''' Create a new Rock Ridge Extensions Reference record. Parameters: ext_id - The extension identifier to use. ext_des - The extension descriptor to use. ext_src - The extension spe...
python
def new(self, ext_id, ext_des, ext_src): # type: (bytes, bytes, bytes) -> None ''' Create a new Rock Ridge Extensions Reference record. Parameters: ext_id - The extension identifier to use. ext_des - The extension descriptor to use. ext_src - The extension spe...
[ "def", "new", "(", "self", ",", "ext_id", ",", "ext_des", ",", "ext_src", ")", ":", "# type: (bytes, bytes, bytes) -> None", "if", "self", ".", "_initialized", ":", "raise", "pycdlibexception", ".", "PyCdlibInternalError", "(", "'ER record already initialized!'", ")",...
Create a new Rock Ridge Extensions Reference record. Parameters: ext_id - The extension identifier to use. ext_des - The extension descriptor to use. ext_src - The extension specification source to use. Returns: Nothing.
[ "Create", "a", "new", "Rock", "Ridge", "Extensions", "Reference", "record", "." ]
train
https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/rockridge.py#L601-L621
clalancette/pycdlib
pycdlib/rockridge.py
RRERRecord.record
def record(self): # type: () -> bytes ''' Generate a string representing the Rock Ridge Extensions Reference record. Parameters: None. Returns: String containing the Rock Ridge record. ''' if not self._initialized: raise pycd...
python
def record(self): # type: () -> bytes ''' Generate a string representing the Rock Ridge Extensions Reference record. Parameters: None. Returns: String containing the Rock Ridge record. ''' if not self._initialized: raise pycd...
[ "def", "record", "(", "self", ")", ":", "# type: () -> bytes", "if", "not", "self", ".", "_initialized", ":", "raise", "pycdlibexception", ".", "PyCdlibInternalError", "(", "'ER record not yet initialized!'", ")", "return", "b'ER'", "+", "struct", ".", "pack", "("...
Generate a string representing the Rock Ridge Extensions Reference record. Parameters: None. Returns: String containing the Rock Ridge record.
[ "Generate", "a", "string", "representing", "the", "Rock", "Ridge", "Extensions", "Reference", "record", "." ]
train
https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/rockridge.py#L623-L637
clalancette/pycdlib
pycdlib/rockridge.py
RRERRecord.length
def length(ext_id, ext_des, ext_src): # type: (bytes, bytes, bytes) -> int ''' Static method to return the length of the Rock Ridge Extensions Reference record. Parameters: ext_id - The extension identifier to use. ext_des - The extension descriptor to use. ...
python
def length(ext_id, ext_des, ext_src): # type: (bytes, bytes, bytes) -> int ''' Static method to return the length of the Rock Ridge Extensions Reference record. Parameters: ext_id - The extension identifier to use. ext_des - The extension descriptor to use. ...
[ "def", "length", "(", "ext_id", ",", "ext_des", ",", "ext_src", ")", ":", "# type: (bytes, bytes, bytes) -> int", "return", "8", "+", "len", "(", "ext_id", ")", "+", "len", "(", "ext_des", ")", "+", "len", "(", "ext_src", ")" ]
Static method to return the length of the Rock Ridge Extensions Reference record. Parameters: ext_id - The extension identifier to use. ext_des - The extension descriptor to use. ext_src - The extension specification source to use. Returns: The length of this...
[ "Static", "method", "to", "return", "the", "length", "of", "the", "Rock", "Ridge", "Extensions", "Reference", "record", "." ]
train
https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/rockridge.py#L640-L653
clalancette/pycdlib
pycdlib/rockridge.py
RRESRecord.new
def new(self, extension_sequence): # type: (int) -> None ''' Create a new Rock Ridge Extension Selector record. Parameters: extension_sequence - The sequence number of this extension. Returns: Nothing. ''' if self._initialized: raise...
python
def new(self, extension_sequence): # type: (int) -> None ''' Create a new Rock Ridge Extension Selector record. Parameters: extension_sequence - The sequence number of this extension. Returns: Nothing. ''' if self._initialized: raise...
[ "def", "new", "(", "self", ",", "extension_sequence", ")", ":", "# type: (int) -> None", "if", "self", ".", "_initialized", ":", "raise", "pycdlibexception", ".", "PyCdlibInternalError", "(", "'ES record already initialized!'", ")", "self", ".", "extension_sequence", ...
Create a new Rock Ridge Extension Selector record. Parameters: extension_sequence - The sequence number of this extension. Returns: Nothing.
[ "Create", "a", "new", "Rock", "Ridge", "Extension", "Selector", "record", "." ]
train
https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/rockridge.py#L689-L703
clalancette/pycdlib
pycdlib/rockridge.py
RRESRecord.record
def record(self): # type: () -> bytes ''' Generate a string representing the Rock Ridge Extension Selector record. Parameters: None. Returns: String containing the Rock Ridge record. ''' if not self._initialized: raise pycdlibexcepti...
python
def record(self): # type: () -> bytes ''' Generate a string representing the Rock Ridge Extension Selector record. Parameters: None. Returns: String containing the Rock Ridge record. ''' if not self._initialized: raise pycdlibexcepti...
[ "def", "record", "(", "self", ")", ":", "# type: () -> bytes", "if", "not", "self", ".", "_initialized", ":", "raise", "pycdlibexception", ".", "PyCdlibInternalError", "(", "'ES record not yet initialized!'", ")", "return", "b'ES'", "+", "struct", ".", "pack", "("...
Generate a string representing the Rock Ridge Extension Selector record. Parameters: None. Returns: String containing the Rock Ridge record.
[ "Generate", "a", "string", "representing", "the", "Rock", "Ridge", "Extension", "Selector", "record", "." ]
train
https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/rockridge.py#L705-L718
clalancette/pycdlib
pycdlib/rockridge.py
RRPNRecord.parse
def parse(self, rrstr): # type: (bytes) -> None ''' Parse a Rock Ridge POSIX Device Number record out of a string. Parameters: rrstr - The string to parse the record out of. Returns: Nothing. ''' if self._initialized: raise pycdlibex...
python
def parse(self, rrstr): # type: (bytes) -> None ''' Parse a Rock Ridge POSIX Device Number record out of a string. Parameters: rrstr - The string to parse the record out of. Returns: Nothing. ''' if self._initialized: raise pycdlibex...
[ "def", "parse", "(", "self", ",", "rrstr", ")", ":", "# type: (bytes) -> None", "if", "self", ".", "_initialized", ":", "raise", "pycdlibexception", ".", "PyCdlibInternalError", "(", "'PN record already initialized!'", ")", "(", "su_len", ",", "su_entry_version_unused...
Parse a Rock Ridge POSIX Device Number record out of a string. Parameters: rrstr - The string to parse the record out of. Returns: Nothing.
[ "Parse", "a", "Rock", "Ridge", "POSIX", "Device", "Number", "record", "out", "of", "a", "string", "." ]
train
https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/rockridge.py#L748-L779
clalancette/pycdlib
pycdlib/rockridge.py
RRPNRecord.new
def new(self, dev_t_high, dev_t_low): # type: (int, int) -> None ''' Create a new Rock Ridge POSIX device number record. Parameters: dev_t_high - The high-order 32-bits of the device number. dev_t_low - The low-order 32-bits of the device number. Returns: ...
python
def new(self, dev_t_high, dev_t_low): # type: (int, int) -> None ''' Create a new Rock Ridge POSIX device number record. Parameters: dev_t_high - The high-order 32-bits of the device number. dev_t_low - The low-order 32-bits of the device number. Returns: ...
[ "def", "new", "(", "self", ",", "dev_t_high", ",", "dev_t_low", ")", ":", "# type: (int, int) -> None", "if", "self", ".", "_initialized", ":", "raise", "pycdlibexception", ".", "PyCdlibInternalError", "(", "'PN record already initialized!'", ")", "self", ".", "dev_...
Create a new Rock Ridge POSIX device number record. Parameters: dev_t_high - The high-order 32-bits of the device number. dev_t_low - The low-order 32-bits of the device number. Returns: Nothing.
[ "Create", "a", "new", "Rock", "Ridge", "POSIX", "device", "number", "record", "." ]
train
https://github.com/clalancette/pycdlib/blob/1e7b77a809e905d67dc71e12d70e850be26b6233/pycdlib/rockridge.py#L781-L798