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.
195320
def parse(self, extent, length, fp, log_block_size):
        # type: (int, int, BinaryIO, int) -> None
        '''
        
        '''
        if self._initialized:
            raise pycdlibexception.PyCdlibInternalError('Inode is already initialized')

        self.orig_extent_loc = extent

        self.data_length = length

        self.data_fp = fp
        self.manage_fp = False
        self.fp_offset = extent * log_block_size
        self.original_data_location = self.DATA_ON_ORIGINAL_ISO

        self._initialized = True
945552
def _getextra(self):
        '''
        
        '''
        current = self
        while hasattr(current, '_sub'):
            current = current._sub
        return getattr(current, '_extra', None)
510432
def as_extension(self):
        """"""
        return x509.extensions.Extension(oid=self.oid, critical=self.critical, value=self.extension_type)
340140
def set_data_location(self, current_extent, tag_location):  # pylint: disable=unused-argument
        # type: (int, int) -> None
        '''
        
        '''
        if not self._initialized:
            raise pycdlibexception.PyCdlibInternalError('Directory Record not yet initialized')

        self.new_extent_loc = current_extent
        if self.ptr is not None:
            self.ptr.update_extent_location(current_extent)
820125
def parse_extend(self, c, i):
        """"""

        # Start list parsing
        success = True
        index = i.index
        list_type = c
        try:
            c = next(i)
            if c != '(':
                raise StopIteration
            while c != ')':
                c = next(i)

                if self.extend and c in EXT_TYPES and self.parse_extend(c, i):
                    continue

                if c == '\\':
                    try:
                        self._references(i)
                    except StopIteration:
                        pass
                elif c == '[':
                    index = i.index
                    try:
                        self._sequence(i)
                    except StopIteration:
                        i.rewind(i.index - index)

        except StopIteration:
            success = False
            c = list_type
            i.rewind(i.index - index)

        return success
330525
def fetch(self):
        
        params = values.of({})

        payload = self._version.fetch(
            'GET',
            self._uri,
            params=params,
        )

        return InstalledAddOnExtensionInstance(
            self._version,
            payload,
            installed_add_on_sid=self._solution['installed_add_on_sid'],
            sid=self._solution['sid'],
        )
998929
def interpolate(self, target, extent):
        
        target = cast_anything_to_vector(target)
        self += extent * (target - self)
5637
private void parseExtension(Extension ext) throws IOException {
        try {
            Class<?> extClass = OIDMap.getClass(ext.getExtensionId());
            if (extClass == null) {   // Unsupported extension
                if (ext.isCritical()) {
                    unsupportedCritExt = true;
                }
                if (map.put(ext.getExtensionId().toString(), ext) == null) {
                    return;
                } else {
                    throw new IOException("Duplicate extensions not allowed");
                }
            }
            Constructor<?> cons = extClass.getConstructor(PARAMS);

            Object[] passed = new Object[] {Boolean.valueOf(ext.isCritical()),
                    ext.getExtensionValue()};
                    CertAttrSet<?> certExt = (CertAttrSet<?>)
                            cons.newInstance(passed);
                    if (map.put(certExt.getName(), (Extension)certExt) != null) {
                        throw new IOException("Duplicate extensions not allowed");
                    }
        } catch (InvocationTargetException invk) {
            Throwable e = invk.getTargetException();
            if (ext.isCritical() == false) {
                // ignore errors parsing non-critical extensions
                if (unparseableExtensions == null) {
                    unparseableExtensions = new TreeMap<String,Extension>();
                }
                unparseableExtensions.put(ext.getExtensionId().toString(),
                        new UnparseableExtension(ext, e));
                if (debug != null) {
                    debug.println("Error parsing extension: " + ext);
                    e.printStackTrace();
                    HexDumpEncoder h = new HexDumpEncoder();
                    System.err.println(h.encodeBuffer(ext.getExtensionValue()));
                }
                return;
            }
            if (e instanceof IOException) {
                throw (IOException)e;
            } else {
                throw new IOException(e);
            }
        } catch (IOException e) {
            throw e;
        } catch (Exception e) {
            throw new IOException(e);
        }
    }
890056
def parse(self, data, extent):
        # type: (bytes, int) -> None
        '''
        
        '''
        if self._initialized:
            raise pycdlibexception.PyCdlibInternalError('UDF Tag already initialized')

        (self.tag_ident, self.desc_version, tag_checksum, reserved,
         self.tag_serial_number, desc_crc, self.desc_crc_length,
         self.tag_location) = struct.unpack_from(self.FMT, data, 0)

        if reserved != 0:
            raise pycdlibexception.PyCdlibInvalidISO('Reserved data not 0!')

        if _compute_csum(data[:16]) != tag_checksum:
            raise pycdlibexception.PyCdlibInvalidISO('Tag checksum does not match!')

        if self.tag_location != extent:
            # In theory, we should abort (throw an exception) if we see that a
            # tag location that doesn't match an actual location.  However, we
            # have seen UDF ISOs in the wild (most notably PS2 GT4 ISOs) that
            # have an invalid tag location for the second anchor and File Set
            # Terminator.  So that we can support those ISOs, just silently
            # fix it up.  We lose a little bit of detection of whether this is
            # "truly" a UDFTag, but it is really not a big risk.
            self.tag_location = extent

        if self.desc_version not in (2, 3):
            raise pycdlibexception.PyCdlibInvalidISO('Tag version not 2 or 3')

        if (len(data) - 16) < self.desc_crc_length:
            raise pycdlibexception.PyCdlibInternalError('Not enough CRC bytes to compute (expected at least %d, got %d)' % (self.desc_crc_length, len(data) - 16))

        if desc_crc != crc_ccitt(data[16:16 + self.desc_crc_length]):
            raise pycdlibexception.PyCdlibInvalidISO('Tag CRC does not match!')

        self._initialized = True
24979
def get_extents(self, element, ranges, range_type='combined'):
        
        xdim, ydim = element.nodes.kdims[:2]
        if range_type not in ('combined', 'data', 'extents'):
            return xdim.range[0], ydim.range[0], xdim.range[1], ydim.range[1]
        no_labels = (element.nodes.get_dimension(self.label_index) is None and
                     self.labels is None)
        rng = 1.1 if no_labels else 1.4
        x0, x1 = max_range([xdim.range, (-rng, rng)])
        y0, y1 = max_range([ydim.range, (-rng, rng)])
        return (x0, y0, x1, y1)
616536
def extent_all(self):
		
		segs = tuple(seglist.extent() for seglist in self.values() if seglist)
		if not segs:
			raise ValueError("empty list")
		return segment(min(seg[0] for seg in segs), max(seg[1] for seg in segs))
1332213
def _get_extension(file):
    
    if isinstance(file, str):
        return os.path.splitext(file)[-1]
    elif isinstance(file, bytes):
        kind = imghdr.what(io.BytesIO(file))
        return ('.' + kind) if kind else ''
    elif isinstance(file, io.IOBase) and file.seekable():
        kind = imghdr.what(file)
        return ('.' + kind) if kind is not None else ''
    elif getattr(file, 'name', None):
        # Note: ``file.name`` works for :tl:`InputFile` and some `IOBase`
        return _get_extension(file.name)
    else:
        return ''
26923
def get_ext(self, obj=None):
        
        if obj is None:
            obj = self._obj
        return self._extel.get_ext(obj)
1193230
def parse_at_root(
            self,
            root,  # type: ET.Element
            state  # type: _ProcessorState
    ):
        # type: (...) -> Any
        """"""
        xml_value = self._processor.parse_at_root(root, state)
        return _hooks_apply_after_parse(self._hooks, state, xml_value)
324977
def _apply(self, ctx: ExtensionContext) -> AugmentedDict:
        
        node_key, node_value = ctx.node

        def process(pattern: Pattern[str], _str: str) -> str:
            _match = pattern.match(_str)
            if _match is None:
                return _str
            # We got a match
            # Group 0: Whole match; Group 1: Our placeholder; Group 2: The environment variable
            placeholder, envvar = _match.group(1), _match.group(2)
            envvalue = os.environ.get(envvar, None)
            if envvalue is None and self.fail_on_unset:
                raise ExtensionError("Environment variable '{}' is unset.".format(envvar))

            return _str.replace(placeholder, envvalue or self.default)

        _pattern = re.compile(self.__pattern__)
        node_key = process(_pattern, node_key)
        node_value = process(_pattern, node_value)

        return {node_key: node_value}
41366
def _apply(self, ctx: ExtensionContext) -> AugmentedDict:
        
        node_key, node_value = ctx.node

        def process(pattern: Pattern[str], _str: str) -> Any:
            _match = pattern.match(_str)
            if _match is None:
                return _str
            # We got a match
            # Group 0: Whole match; Group 1: Our placeholder; Group 2: The environment variable
            placeholder, varname = _match.group(1), _match.group(2)
            varval = self.vars.get(varname, None)
            if varval is None and self.fail_on_unset:
                raise ExtensionError("Variable '{}' is unset.".format(varname))

            return _str.replace(placeholder, varval or self.default)

        _pattern = re.compile(self.__pattern__)
        node_key = process(_pattern, node_key)
        node_value = process(_pattern, node_value)

        return {node_key: node_value}
299013
def bind(self, extension: Extension) -> 'DictMentor':
        
        if not Extension.is_valid_extension(extension):
            raise ValueError("Cannot bind extension due to missing interface requirements")
        self._extensions.append(extension)

        return self