Code
stringlengths
103
85.9k
Summary
listlengths
0
94
Please provide a description of the function:def _hierarchy_bounds(intervals_hier): '''Compute the covered time range of a hierarchical segmentation. Parameters ---------- intervals_hier : list of ndarray A hierarchical segmentation, encoded as a list of arrays of segment intervals. ...
[]
Please provide a description of the function:def _align_intervals(int_hier, lab_hier, t_min=0.0, t_max=None): '''Align a hierarchical annotation to span a fixed start and end time. Parameters ---------- int_hier : list of list of intervals lab_hier : list of list of str Hierarchical segment...
[]
Please provide a description of the function:def _lca(intervals_hier, frame_size): '''Compute the (sparse) least-common-ancestor (LCA) matrix for a hierarchical segmentation. For any pair of frames ``(s, t)``, the LCA is the deepest level in the hierarchy such that ``(s, t)`` are contained within a sin...
[]
Please provide a description of the function:def _meet(intervals_hier, labels_hier, frame_size): '''Compute the (sparse) least-common-ancestor (LCA) matrix for a hierarchical segmentation. For any pair of frames ``(s, t)``, the LCA is the deepest level in the hierarchy such that ``(s, t)`` are containe...
[]
Please provide a description of the function:def _gauc(ref_lca, est_lca, transitive, window): '''Generalized area under the curve (GAUC) This function computes the normalized recall score for correctly ordering triples ``(q, i, j)`` where frames ``(q, i)`` are closer than ``(q, j)`` in the reference an...
[]
Please provide a description of the function:def _count_inversions(a, b): '''Count the number of inversions in two numpy arrays: # points i, j where a[i] >= b[j] Parameters ---------- a, b : np.ndarray, shape=(n,) (m,) The arrays to be compared. This implementation is optimized fo...
[]
Please provide a description of the function:def _compare_frame_rankings(ref, est, transitive=False): '''Compute the number of ranking disagreements in two lists. Parameters ---------- ref : np.ndarray, shape=(n,) est : np.ndarray, shape=(n,) Reference and estimate ranked lists. `re...
[]
Please provide a description of the function:def validate_hier_intervals(intervals_hier): '''Validate a hierarchical segment annotation. Parameters ---------- intervals_hier : ordered list of segmentations Raises ------ ValueError If any segmentation does not span the full duration...
[]
Please provide a description of the function:def tmeasure(reference_intervals_hier, estimated_intervals_hier, transitive=False, window=15.0, frame_size=0.1, beta=1.0): '''Computes the tree measures for hierarchical segment annotations. Parameters ---------- reference_intervals_hier : list ...
[]
Please provide a description of the function:def lmeasure(reference_intervals_hier, reference_labels_hier, estimated_intervals_hier, estimated_labels_hier, frame_size=0.1, beta=1.0): '''Computes the tree measures for hierarchical segment annotations. Parameters ---------- refe...
[]
Please provide a description of the function:def evaluate(ref_intervals_hier, ref_labels_hier, est_intervals_hier, est_labels_hier, **kwargs): '''Compute all hierarchical structure metrics for the given reference and estimated annotations. Examples -------- A toy example with two two-l...
[]
Please provide a description of the function:def __expand_limits(ax, limits, which='x'): '''Helper function to expand axis limits''' if which == 'x': getter, setter = ax.get_xlim, ax.set_xlim elif which == 'y': getter, setter = ax.get_ylim, ax.set_ylim else: raise ValueError('in...
[]
Please provide a description of the function:def __get_axes(ax=None, fig=None): '''Get or construct the target axes object for a new plot. Parameters ---------- ax : matplotlib.pyplot.axes, optional If provided, return this axes object directly. fig : matplotlib.figure.Figure, optional ...
[]
Please provide a description of the function:def segments(intervals, labels, base=None, height=None, text=False, text_kw=None, ax=None, **kwargs): '''Plot a segmentation as a set of disjoint rectangles. Parameters ---------- intervals : np.ndarray, shape=(n, 2) segment intervals, i...
[]
Please provide a description of the function:def labeled_intervals(intervals, labels, label_set=None, base=None, height=None, extend_labels=True, ax=None, tick=True, **kwargs): '''Plot labeled intervals with each label on its own row. Parameters ---------- in...
[]
Please provide a description of the function:def hierarchy(intervals_hier, labels_hier, levels=None, ax=None, **kwargs): '''Plot a hierarchical segmentation Parameters ---------- intervals_hier : list of np.ndarray A list of segmentation intervals. Each element should be an n-by-2 arra...
[]
Please provide a description of the function:def events(times, labels=None, base=None, height=None, ax=None, text_kw=None, **kwargs): '''Plot event times as a set of vertical lines Parameters ---------- times : np.ndarray, shape=(n,) event times, in the format returned by :fu...
[]
Please provide a description of the function:def pitch(times, frequencies, midi=False, unvoiced=False, ax=None, **kwargs): '''Visualize pitch contours Parameters ---------- times : np.ndarray, shape=(n,) Sample times of frequencies frequencies : np.ndarray, shape=(n,) frequencies (...
[]
Please provide a description of the function:def multipitch(times, frequencies, midi=False, unvoiced=False, ax=None, **kwargs): '''Visualize multiple f0 measurements Parameters ---------- times : np.ndarray, shape=(n,) Sample times of frequencies frequencies : list of np.nda...
[]
Please provide a description of the function:def piano_roll(intervals, pitches=None, midi=None, ax=None, **kwargs): '''Plot a quantized piano roll as intervals Parameters ---------- intervals : np.ndarray, shape=(n, 2) timing intervals for notes pitches : np.ndarray, shape=(n,), optional ...
[]
Please provide a description of the function:def separation(sources, fs=22050, labels=None, alpha=0.75, ax=None, **kwargs): '''Source-separation visualization Parameters ---------- sources : np.ndarray, shape=(nsrc, nsampl) A list of waveform buffers corresponding to each source fs : numbe...
[]
Please provide a description of the function:def __ticker_midi_note(x, pos): '''A ticker function for midi notes. Inputs x are interpreted as midi numbers, and converted to [NOTE][OCTAVE]+[cents]. ''' NOTES = ['C', 'C#', 'D', 'D#', 'E', 'F', 'F#', 'G', 'G#', 'A', 'A#', 'B'] cents = float(np.m...
[]
Please provide a description of the function:def ticker_notes(ax=None): '''Set the y-axis of the given axes to MIDI notes Parameters ---------- ax : matplotlib.pyplot.axes The axes handle to apply the ticker. By default, uses the current axes handle. ''' ax, _ = __get_axes(ax=a...
[]
Please provide a description of the function:def ticker_pitch(ax=None): '''Set the y-axis of the given axes to MIDI frequencies Parameters ---------- ax : matplotlib.pyplot.axes The axes handle to apply the ticker. By default, uses the current axes handle. ''' ax, _ = __get_axes...
[]
Please provide a description of the function:def run(self, **import_params): if self.file: import_params["url"] = self.file self.id_field = "id" if "connection" in import_params: self.fields.append("connector") self.update_from_dict(import_params["c...
[ "\n Actually creates the import job on the CARTO server\n\n :param import_params: To be send to the Import API, see CARTO's docs\n on Import API for an updated list of accepted\n params\n :type import_params: kwargs\n\n :retur...
Please provide a description of the function:def filter(self): try: response = self.send(self.get_collection_endpoint(), "get") if self.json_collection_attribute is not None: resource_ids = self.client.get_response_data( response, ...
[ "\n Get a filtered list of file imports\n\n :return: A list of file imports, with only the id set (you need to\n refresh them if you want all the attributes to be filled in)\n :rtype: list of :class:`carto.file_import.FileImportJob`\n\n :raise: CartoException\n " ]
Please provide a description of the function:def send(self, relative_path, http_method, **requests_args): try: http_method, requests_args = self.prepare_send(http_method, **requests_args) response = super(APIKeyAuthClient, self).send(relative_path, http_method, **requests_args)...
[ "\n Makes an API-key-authorized request\n\n :param relative_path: URL path relative to self.base_url\n :param http_method: HTTP method\n :param requests_args: kwargs to be sent to requests\n :type relative_path: str\n :type http_method: str\n :type requests_args: kwa...
Please provide a description of the function:def is_valid_api_key(self): res = self.send('api/v3/api_keys', 'get') return \ res.ok and \ self.api_key in (ak['token'] for ak in res.json()['result'])
[ "\n Checks validity. Right now, an API key is considered valid if it\n can list user API keys and the result contains that API key.\n This might change in the future.\n\n :return: True if the API key is considered valid for current user.\n " ]
Please provide a description of the function:def run(self, **export_params): export_params["visualization_id"] = self.visualization_id return super(ExportJob, self).run(params=export_params)
[ "\n Make the actual request to the Import API (exporting is part of the\n Import API).\n\n :param export_params: Any additional parameters to be sent to the\n Import API\n :type export_params: kwargs\n\n :return:\n\n .. note:: The export is as...
Please provide a description of the function:def send(self, url, http_method, **client_args): try: client_args = client_args or {} if "params" not in client_args: client_args["params"] = {} client_args["params"].update({"type": "table", ...
[ "\n Sends an API request, taking into account that datasets are part of\n the visualization endpoint.\n\n :param url: Endpoint URL\n :param http_method: The method used to make the request to the API\n :param client_args: Arguments to be sent to the auth client\n :type url:...
Please provide a description of the function:def is_sync_table(self, archive, interval, **import_args): return (hasattr(archive, "startswith") and archive.startswith("http") or "connection" in import_args) \ and interval is not None
[ "\n Checks if this is a request for a sync dataset.\n\n The condition for creating a sync dataset is to provide a URL or a\n connection to an external database and an interval in seconds\n\n :param archive: URL to the file (both remote URLs or local paths are\n support...
Please provide a description of the function:def create(self, archive, interval=None, **import_args): archive = archive.lower() if hasattr(archive, "lower") else archive if self.is_sync_table(archive, interval, **import_args): manager = SyncTableJobManager(self.client) else...
[ "\n Creating a table means uploading a file or setting up a sync table\n\n :param archive: URL to the file (both remote URLs or local paths are\n supported) or StringIO object\n :param interval: Interval in seconds.\n If not None, CARTO will try to set ...
Please provide a description of the function:def export(self): export_job = ExportJob(self.client, self.get_id()) export_job.run() export_job.refresh() count = 0 while export_job.state in ("exporting", "enqueued", "pending"): if count >= MAX_NUMBER_OF_RETRI...
[ "\n Make the actual request to the Import API (exporting is part of the\n Import API) to export a map visualization as a .carto file\n\n :return: A URL pointing to the .carto file\n :rtype: str\n\n :raise: CartoException\n\n .. warning:: Non-public API. It may change with n...
Please provide a description of the function:def send(self, url, http_method, **client_args): try: client_args.setdefault('params', {}) client_args["params"].update({"type": "derived", "exclude_shared": "true"}) return super...
[ "\n Sends API request, taking into account that visualizations are only a\n subset of the resources available at the visualization endpoint\n\n :param url: Endpoint URL\n :param http_method: The method used to make the request to the API\n :param client_args: Arguments to be sent ...
Please provide a description of the function:def is_rate_limited(response): if (response.status_code == codes.too_many_requests and 'Retry-After' in response.headers and int(response.headers['Retry-After']) >= 0): return True return False
[ "\n Checks if the response has been rate limited by CARTO APIs\n\n :param response: The response rate limited by CARTO APIs\n :type response: requests.models.Response class\n\n :return: Boolean\n " ]
Please provide a description of the function:def get_tile_url(self, x, y, z, layer_id=None, feature_id=None, filter=None, extension="png"): base_url = self.client.base_url + self.Meta.collection_endpoint template_id = self.template_id if hasattr(self, 'template_id') \ ...
[ "\n Prepares a URL to get data (raster or vector) from a NamedMap or\n AnonymousMap\n\n :param x: The x tile\n :param y: The y tile\n :param z: The zoom level\n :param layer_id: Can be a number (referring to the # layer of your \\\n map), all layers ...
Please provide a description of the function:def instantiate(self, params, auth=None): try: endpoint = (self.Meta.collection_endpoint + "{template_id}"). \ format(template_id=self.template_id) if (auth is not None): endpoin...
[ "\n Allows you to fetch the map tiles of a created map\n\n :param params: The json with the styling info for the named map\n :param auth: The auth client\n :type params: dict\n :type auth: :class:`carto.auth.APIKeyAuthClient`\n\n :return:\n\n :raise: CartoException\n...
Please provide a description of the function:def update_from_dict(self, attribute_dict): if 'template' in attribute_dict: self.update_from_dict(attribute_dict['template']) setattr(self, self.Meta.id_field, attribute_dict['template']['name']) retur...
[ "\n Method overriden from the base class\n\n " ]
Please provide a description of the function:def instantiate(self, params): try: self.send(self.Meta.collection_endpoint, "POST", json=params) except CartoRateLimitException as e: raise e except Exception as e: raise CartoException(e)
[ "\n Allows you to fetch the map tiles of a created map\n\n :param params: The json with the styling info for the named map\n :type params: dict\n\n :return:\n\n :raise: CartoException\n " ]
Please provide a description of the function:def run(self, **client_params): try: self.send(self.get_collection_endpoint(), http_method="POST", **client_params) except Exception as e: raise CartoException(e)
[ "\n Actually creates the async job on the CARTO server\n\n\n :param client_params: To be send to the CARTO API. See CARTO's\n documentation depending on the subclass\n you are using\n :type client_params: kwargs\n\n\n :return:...
Please provide a description of the function:def send(self, sql, parse_json=True, do_post=True, format=None, **request_args): try: params = {'q': sql} if format: params['format'] = format if format not in ['json', 'geojson']: p...
[ "\n Executes SQL query in a CARTO server\n\n :param sql: The SQL\n :param parse_json: Set it to False if you want raw reponse\n :param do_post: Set it to True to force post request\n :param format: Any of the data export formats allowed by CARTO's\n SQL API\...
Please provide a description of the function: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.id = data_dict["item_queue_id"]
[ "\n :param data_dict: Dictionary to be mapped into object attributes\n :type data_dict: dict\n\n :return:\n " ]
Please provide a description of the function:def send(self, url, http_method, json_body=None, http_header=None): try: data = self.client.send(url, http_method=http_method, headers=http_header, ...
[ "\n Executes Batch SQL query in a CARTO server\n\n :param url: Endpoint url\n :param http_method: The method used to make the request to the API\n :param json_body: The information that needs to be sent, by default\n is set to None\n :param http_header: ...
Please provide a description of the function:def create(self, sql_query): header = {'content-type': 'application/json'} data = self.send(self.api_url, http_method="POST", json_body={"query": sql_query}, http_header=heade...
[ "\n Creates a new batch SQL query.\n\n Batch SQL jobs are asynchronous, once created you should call\n :func:`carto.sql.BatchSQLClient.read` method given the `job_id`\n to retrieve the state of the batch query\n\n :param sql_query: The SQL query to be used\n :type sql_query...
Please provide a description of the function:def create_and_wait_for_completion(self, sql_query): header = {'content-type': 'application/json'} data = self.send(self.api_url, http_method="POST", json_body={"query": sql_query}, ...
[ "\n Creates a new batch SQL query and waits for its completion or failure\n\n Batch SQL jobs are asynchronous, once created this method\n automatically queries the job status until it's one of 'done',\n 'failed', 'canceled', 'unknown'\n\n :param sql_query: The SQL query to be used...
Please provide a description of the function:def read(self, job_id): data = self.send(self.api_url + job_id, http_method="GET") return data
[ "\n Reads the information for a specific Batch API request\n\n :param job_id: The id of the job to be read from\n :type job_id: str\n\n :return: Response data, either as json or as a regular response.content\n object\n :rtype: object\n\n :raise: CartoExce...
Please provide a description of the function:def update(self, job_id, sql_query): header = {'content-type': 'application/json'} data = self.send(self.api_url + job_id, http_method="PUT", json_body={"query": sql_query}, h...
[ "\n Updates the sql query of a specific job\n\n :param job_id: The id of the job to be updated\n :param sql_query: The new SQL query for the job\n :type job_id: str\n :type sql_query: str\n\n :return: Response data, either as json or as a regular response.content\n ...
Please provide a description of the function:def cancel(self, job_id): try: confirmation = self.send(self.api_url + job_id, http_method="DELETE") except CartoException as e: if 'Cannot set status from done to cancelled' in e.args[0].args[0]: return 'done'...
[ "\n Cancels a job\n\n :param job_id: The id of the job to be cancelled\n :type job_id: str\n\n :return: A status code depending on whether the cancel request was\n successful\n :rtype: str\n\n :raise CartoException:\n " ]
Please provide a description of the function:def copyfrom(self, query, iterable_data, compress=True, compression_level=DEFAULT_COMPRESSION_LEVEL): url = self.api_url + '/copyfrom' headers = { 'Content-Type': 'application/octet-stream', 'Transfer-Encoding...
[ "\n Gets data from an iterable object into a table\n\n :param query: The \"COPY table_name [(column_name[, ...])]\n FROM STDIN [WITH(option[,...])]\" query to execute\n :type query: str\n\n :param iterable_data: An object that can be iterated\n ...
Please provide a description of the function:def copyfrom_file_object(self, query, file_object, compress=True, compression_level=DEFAULT_COMPRESSION_LEVEL): chunk_generator = self._read_in_chunks(file_object) return self.copyfrom(query, chunk_generator, compress, ...
[ "\n Gets data from a readable file object into a table\n\n :param query: The \"COPY table_name [(column_name[, ...])]\n FROM STDIN [WITH(option[,...])]\" query to execute\n :type query: str\n\n :param file_object: A file-like object.\n ...
Please provide a description of the function:def copyfrom_file_path(self, query, path, compress=True, compression_level=DEFAULT_COMPRESSION_LEVEL): with open(path, 'rb') as f: result = self.copyfrom_file_object(query, f, compress, ...
[ "\n Gets data from a readable file into a table\n\n :param query: The \"COPY table_name [(column_name[, ...])]\n FROM STDIN [WITH(option[,...])]\" query to execute\n :type query: str\n\n :param path: A path to a file\n :type path: str\n\n :return: ...
Please provide a description of the function:def copyto(self, query): url = self.api_url + '/copyto' params = {'api_key': self.api_key, 'q': query} try: response = self.client.send(url, http_method='GET', ...
[ "\n Gets data from a table into a Response object that can be iterated\n\n :param query: The \"COPY { table_name [(column_name[, ...])] | (query) }\n TO STDOUT [WITH(option[,...])]\" query to execute\n :type query: str\n\n :return: response object\n :rtyp...
Please provide a description of the function:def copyto_file_object(self, query, file_object): response = self.copyto(query) for block in response.iter_content(DEFAULT_CHUNK_SIZE): file_object.write(block)
[ "\n Gets data from a table into a writable file object\n\n :param query: The \"COPY { table_name [(column_name[, ...])] | (query) }\n TO STDOUT [WITH(option[,...])]\" query to execute\n :type query: str\n\n :param file_object: A file-like object.\n ...
Please provide a description of the function: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.copyto_file_object(query, f)
[ "\n Gets data from a table into a writable file\n\n :param query: The \"COPY { table_name [(column_name[, ...])] | (query) }\n TO STDOUT [WITH(option[,...])]\" query to execute\n :type query: str\n\n :param path: A path to a writable file\n :type path: st...
Please provide a description of the function:def run(self, **import_params): import_params["url"] = self.url import_params["interval"] = self.interval if "connection" in import_params: self.fields.append("connector") import_params["connection"]["interval"] = sel...
[ "\n Actually creates the job import on the CARTO server\n\n :param import_params: To be send to the Import API, see CARTO's docs\n on Import API for an updated list of accepted\n params\n :type import_params: kwargs\n\n :retur...
Please provide a description of the function:def force_sync(self): try: self.send(self.get_resource_endpoint(), "put") except Exception as e: raise CartoException(e)
[ "\n Forces to sync the SyncTableJob\n\n :return:\n\n :raise: CartoException\n " ]
Please provide a description of the function: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_s...
[]
Please provide a description of the function: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 classification_type in classification_type_list,\ ...
[ " Set problem type " ]
Please provide a description of the function: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
[]
Please provide a description of the function: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.xatt...
[]
Please provide a description of the function: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. ...
[]
Please provide a description of the function: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 lit...
[]
Please provide a description of the function: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 endia...
[]
Please provide a description of the function: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 th...
[]
Please provide a description of the function: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: ...
[]
Please provide a description of the function: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. '...
[]
Please provide a description of the function: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 par...
[]
Please provide a description of the function: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 ...
[]
Please provide a description of the function: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, ...
[]
Please provide a description of the function: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 unti...
[]
Please provide a description of the function: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 ...
[]
Please provide a description of the function: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 ...
[]
Please provide a description of the function: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 ...
[]
Please provide a description of the function: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 obje...
[]
Please provide a description of the function: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 se...
[]
Please provide a description of the function: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: ...
[]
Please provide a description of the function: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. ...
[]
Please provide a description of the function: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 contai...
[]
Please provide a description of the function: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...
[]
Please provide a description of the function: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. '...
[]
Please provide a description of the function: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: ...
[]
Please provide a description of the function:def new(self): # type: () -> None ''' Create a new Extended Attribute Record. Parameters: None. Returns: Nothing. ''' if self._initialized: raise pycdlibexception.PyCdlibInternalError('Thi...
[]
Please provide a description of the function:def record(self): # type: () -> bytes ''' Record this Extended Attribute Record. Parameters: None. Returns: A string representing this Extended Attribute Record. ''' if not self._initialized: ...
[]
Please provide a description of the function: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. ...
[]
Please provide a description of the function: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 Director...
[]
Please provide a description of the function: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: ...
[]
Please provide a description of the function: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 Recor...
[]
Please provide a description of the function: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 ...
[]
Please provide a description of the function: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 - Th...
[]
Please provide a description of the function: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. Paramete...
[]
Please provide a description of the function: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'...
[]
Please provide a description of the function: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...
[]
Please provide a description of the function: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: ...
[]
Please provide a description of the function: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: ...
[]
Please provide a description of the function: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 a...
[]
Please provide a description of the function: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 ad...
[]
Please provide a description of the function: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 ob...
[]
Please provide a description of the function: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. ...
[]
Please provide a description of the function: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._ini...
[]
Please provide a description of the function: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 anoth...
[]