diff --git a/.gitattributes b/.gitattributes index 55c1f06aa87a8bd1f3618d9107ce30640716934d..bdc73d5d350187ffaab2e5b25333d965b0f009e0 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1163,3 +1163,8 @@ vlmpy310/lib/python3.10/site-packages/av.libs/libavformat-071c54bd.so.61.7.100 f vlmpy310/lib/python3.10/site-packages/transformers/models/oneformer/__pycache__/modeling_oneformer.cpython-310.pyc filter=lfs diff=lfs merge=lfs -text vlmpy310/lib/python3.10/site-packages/transformers/models/seamless_m4t/__pycache__/modeling_seamless_m4t.cpython-310.pyc filter=lfs diff=lfs merge=lfs -text llava_next/lib/python3.10/site-packages/rich/__pycache__/_emoji_codes.cpython-310.pyc filter=lfs diff=lfs merge=lfs -text +vlmpy310/lib/python3.10/site-packages/babel/locale-data/he.dat filter=lfs diff=lfs merge=lfs -text +vlmpy310/lib/python3.10/site-packages/babel/locale-data/zh_Hant.dat filter=lfs diff=lfs merge=lfs -text +vlmpy310/lib/python3.10/site-packages/babel/locale-data/so.dat filter=lfs diff=lfs merge=lfs -text +vlmpy310/lib/python3.10/site-packages/babel/locale-data/bn.dat filter=lfs diff=lfs merge=lfs -text +vlmpy310/lib/python3.10/site-packages/babel/locale-data/gu.dat filter=lfs diff=lfs merge=lfs -text diff --git a/llava_next/lib/python3.10/site-packages/sympy/polys/matrices/_dfm.py b/llava_next/lib/python3.10/site-packages/sympy/polys/matrices/_dfm.py new file mode 100644 index 0000000000000000000000000000000000000000..d84fe136e6db146a2570739aaa968ae94473f665 --- /dev/null +++ b/llava_next/lib/python3.10/site-packages/sympy/polys/matrices/_dfm.py @@ -0,0 +1,898 @@ +# +# sympy.polys.matrices.dfm +# +# This modules defines the DFM class which is a wrapper for dense flint +# matrices as found in python-flint. +# +# As of python-flint 0.4.1 matrices over the following domains can be supported +# by python-flint: +# +# ZZ: flint.fmpz_mat +# QQ: flint.fmpq_mat +# GF(p): flint.nmod_mat (p prime and p < ~2**62) +# +# The underlying flint library has many more domains, but these are not yet +# supported by python-flint. +# +# The DFM class is a wrapper for the flint matrices and provides a common +# interface for all supported domains that is interchangeable with the DDM +# and SDM classes so that DomainMatrix can be used with any as its internal +# matrix representation. +# + +# TODO: +# +# Implement the following methods that are provided by python-flint: +# +# - hnf (Hermite normal form) +# - snf (Smith normal form) +# - minpoly +# - is_hnf +# - is_snf +# - rank +# +# The other types DDM and SDM do not have these methods and the algorithms +# for hnf, snf and rank are already implemented. Algorithms for minpoly, +# is_hnf and is_snf would need to be added. +# +# Add more methods to python-flint to expose more of Flint's functionality +# and also to make some of the above methods simpler or more efficient e.g. +# slicing, fancy indexing etc. + +from sympy.external.gmpy import GROUND_TYPES +from sympy.external.importtools import import_module +from sympy.utilities.decorator import doctest_depends_on + +from sympy.polys.domains import ZZ, QQ + +from .exceptions import ( + DMBadInputError, + DMDomainError, + DMNonSquareMatrixError, + DMNonInvertibleMatrixError, + DMRankError, + DMShapeError, + DMValueError, +) + + +if GROUND_TYPES != 'flint': + __doctest_skip__ = ['*'] + + +flint = import_module('flint') + + +__all__ = ['DFM'] + + +@doctest_depends_on(ground_types=['flint']) +class DFM: + """ + Dense FLINT matrix. This class is a wrapper for matrices from python-flint. + + >>> from sympy.polys.domains import ZZ + >>> from sympy.polys.matrices.dfm import DFM + >>> dfm = DFM([[ZZ(1), ZZ(2)], [ZZ(3), ZZ(4)]], (2, 2), ZZ) + >>> dfm + [[1, 2], [3, 4]] + >>> dfm.rep + [1, 2] + [3, 4] + >>> type(dfm.rep) # doctest: +SKIP + + + Usually, the DFM class is not instantiated directly, but is created as the + internal representation of :class:`~.DomainMatrix`. When + `SYMPY_GROUND_TYPES` is set to `flint` and `python-flint` is installed, the + :class:`DFM` class is used automatically as the internal representation of + :class:`~.DomainMatrix` in dense format if the domain is supported by + python-flint. + + >>> from sympy.polys.matrices.domainmatrix import DM + >>> dM = DM([[1, 2], [3, 4]], ZZ) + >>> dM.rep + [[1, 2], [3, 4]] + + A :class:`~.DomainMatrix` can be converted to :class:`DFM` by calling the + :meth:`to_dfm` method: + + >>> dM.to_dfm() + [[1, 2], [3, 4]] + + """ + + fmt = 'dense' + is_DFM = True + is_DDM = False + + def __new__(cls, rowslist, shape, domain): + """Construct from a nested list.""" + flint_mat = cls._get_flint_func(domain) + + if 0 not in shape: + try: + rep = flint_mat(rowslist) + except (ValueError, TypeError): + raise DMBadInputError(f"Input should be a list of list of {domain}") + else: + rep = flint_mat(*shape) + + return cls._new(rep, shape, domain) + + @classmethod + def _new(cls, rep, shape, domain): + """Internal constructor from a flint matrix.""" + cls._check(rep, shape, domain) + obj = object.__new__(cls) + obj.rep = rep + obj.shape = obj.rows, obj.cols = shape + obj.domain = domain + return obj + + def _new_rep(self, rep): + """Create a new DFM with the same shape and domain but a new rep.""" + return self._new(rep, self.shape, self.domain) + + @classmethod + def _check(cls, rep, shape, domain): + repshape = (rep.nrows(), rep.ncols()) + if repshape != shape: + raise DMBadInputError("Shape of rep does not match shape of DFM") + if domain == ZZ and not isinstance(rep, flint.fmpz_mat): + raise RuntimeError("Rep is not a flint.fmpz_mat") + elif domain == QQ and not isinstance(rep, flint.fmpq_mat): + raise RuntimeError("Rep is not a flint.fmpq_mat") + elif domain not in (ZZ, QQ): + raise NotImplementedError("Only ZZ and QQ are supported by DFM") + + @classmethod + def _supports_domain(cls, domain): + """Return True if the given domain is supported by DFM.""" + return domain in (ZZ, QQ) + + @classmethod + def _get_flint_func(cls, domain): + """Return the flint matrix class for the given domain.""" + if domain == ZZ: + return flint.fmpz_mat + elif domain == QQ: + return flint.fmpq_mat + else: + raise NotImplementedError("Only ZZ and QQ are supported by DFM") + + @property + def _func(self): + """Callable to create a flint matrix of the same domain.""" + return self._get_flint_func(self.domain) + + def __str__(self): + """Return ``str(self)``.""" + return str(self.to_ddm()) + + def __repr__(self): + """Return ``repr(self)``.""" + return f'DFM{repr(self.to_ddm())[3:]}' + + def __eq__(self, other): + """Return ``self == other``.""" + if not isinstance(other, DFM): + return NotImplemented + # Compare domains first because we do *not* want matrices with + # different domains to be equal but e.g. a flint fmpz_mat and fmpq_mat + # with the same entries will compare equal. + return self.domain == other.domain and self.rep == other.rep + + @classmethod + def from_list(cls, rowslist, shape, domain): + """Construct from a nested list.""" + return cls(rowslist, shape, domain) + + def to_list(self): + """Convert to a nested list.""" + return self.rep.tolist() + + def copy(self): + """Return a copy of self.""" + return self._new_rep(self._func(self.rep)) + + def to_ddm(self): + """Convert to a DDM.""" + return DDM.from_list(self.to_list(), self.shape, self.domain) + + def to_sdm(self): + """Convert to a SDM.""" + return SDM.from_list(self.to_list(), self.shape, self.domain) + + def to_dfm(self): + """Return self.""" + return self + + def to_dfm_or_ddm(self): + """ + Convert to a :class:`DFM`. + + This :class:`DFM` method exists to parallel the :class:`~.DDM` and + :class:`~.SDM` methods. For :class:`DFM` it will always return self. + + See Also + ======== + + to_ddm + to_sdm + sympy.polys.matrices.domainmatrix.DomainMatrix.to_dfm_or_ddm + """ + return self + + @classmethod + def from_ddm(cls, ddm): + """Convert from a DDM.""" + return cls.from_list(ddm.to_list(), ddm.shape, ddm.domain) + + @classmethod + def from_list_flat(cls, elements, shape, domain): + """Inverse of :meth:`to_list_flat`.""" + func = cls._get_flint_func(domain) + try: + rep = func(*shape, elements) + except ValueError: + raise DMBadInputError(f"Incorrect number of elements for shape {shape}") + except TypeError: + raise DMBadInputError(f"Input should be a list of {domain}") + return cls(rep, shape, domain) + + def to_list_flat(self): + """Convert to a flat list.""" + return self.rep.entries() + + def to_flat_nz(self): + """Convert to a flat list of non-zeros.""" + return self.to_ddm().to_flat_nz() + + @classmethod + def from_flat_nz(cls, elements, data, domain): + """Inverse of :meth:`to_flat_nz`.""" + return DDM.from_flat_nz(elements, data, domain).to_dfm() + + def to_dod(self): + """Convert to a DOD.""" + return self.to_ddm().to_dod() + + @classmethod + def from_dod(cls, dod, shape, domain): + """Inverse of :meth:`to_dod`.""" + return DDM.from_dod(dod, shape, domain).to_dfm() + + def to_dok(self): + """Convert to a DOK.""" + return self.to_ddm().to_dok() + + @classmethod + def from_dok(cls, dok, shape, domain): + """Inverse of :math:`to_dod`.""" + return DDM.from_dok(dok, shape, domain).to_dfm() + + def iter_values(self): + """Iterater over the non-zero values of the matrix.""" + m, n = self.shape + rep = self.rep + for i in range(m): + for j in range(n): + repij = rep[i, j] + if repij: + yield rep[i, j] + + def iter_items(self): + """Iterate over indices and values of nonzero elements of the matrix.""" + m, n = self.shape + rep = self.rep + for i in range(m): + for j in range(n): + repij = rep[i, j] + if repij: + yield ((i, j), repij) + + def convert_to(self, domain): + """Convert to a new domain.""" + if domain == self.domain: + return self.copy() + elif domain == QQ and self.domain == ZZ: + return self._new(flint.fmpq_mat(self.rep), self.shape, domain) + elif domain == ZZ and self.domain == QQ: + # XXX: python-flint has no fmpz_mat.from_fmpq_mat + return self.to_ddm().convert_to(domain).to_dfm() + else: + # It is the callers responsibility to convert to DDM before calling + # this method if the domain is not supported by DFM. + raise NotImplementedError("Only ZZ and QQ are supported by DFM") + + def getitem(self, i, j): + """Get the ``(i, j)``-th entry.""" + # XXX: flint matrices do not support negative indices + # XXX: They also raise ValueError instead of IndexError + m, n = self.shape + if i < 0: + i += m + if j < 0: + j += n + try: + return self.rep[i, j] + except ValueError: + raise IndexError(f"Invalid indices ({i}, {j}) for Matrix of shape {self.shape}") + + def setitem(self, i, j, value): + """Set the ``(i, j)``-th entry.""" + # XXX: flint matrices do not support negative indices + # XXX: They also raise ValueError instead of IndexError + m, n = self.shape + if i < 0: + i += m + if j < 0: + j += n + try: + self.rep[i, j] = value + except ValueError: + raise IndexError(f"Invalid indices ({i}, {j}) for Matrix of shape {self.shape}") + + def _extract(self, i_indices, j_indices): + """Extract a submatrix with no checking.""" + # Indices must be positive and in range. + M = self.rep + lol = [[M[i, j] for j in j_indices] for i in i_indices] + shape = (len(i_indices), len(j_indices)) + return self.from_list(lol, shape, self.domain) + + def extract(self, rowslist, colslist): + """Extract a submatrix.""" + # XXX: flint matrices do not support fancy indexing or negative indices + # + # Check and convert negative indices before calling _extract. + m, n = self.shape + + new_rows = [] + new_cols = [] + + for i in rowslist: + if i < 0: + i_pos = i + m + else: + i_pos = i + if not 0 <= i_pos < m: + raise IndexError(f"Invalid row index {i} for Matrix of shape {self.shape}") + new_rows.append(i_pos) + + for j in colslist: + if j < 0: + j_pos = j + n + else: + j_pos = j + if not 0 <= j_pos < n: + raise IndexError(f"Invalid column index {j} for Matrix of shape {self.shape}") + new_cols.append(j_pos) + + return self._extract(new_rows, new_cols) + + def extract_slice(self, rowslice, colslice): + """Slice a DFM.""" + # XXX: flint matrices do not support slicing + m, n = self.shape + i_indices = range(m)[rowslice] + j_indices = range(n)[colslice] + return self._extract(i_indices, j_indices) + + def neg(self): + """Negate a DFM matrix.""" + return self._new_rep(-self.rep) + + def add(self, other): + """Add two DFM matrices.""" + return self._new_rep(self.rep + other.rep) + + def sub(self, other): + """Subtract two DFM matrices.""" + return self._new_rep(self.rep - other.rep) + + def mul(self, other): + """Multiply a DFM matrix from the right by a scalar.""" + return self._new_rep(self.rep * other) + + def rmul(self, other): + """Multiply a DFM matrix from the left by a scalar.""" + return self._new_rep(other * self.rep) + + def mul_elementwise(self, other): + """Elementwise multiplication of two DFM matrices.""" + # XXX: flint matrices do not support elementwise multiplication + return self.to_ddm().mul_elementwise(other.to_ddm()).to_dfm() + + def matmul(self, other): + """Multiply two DFM matrices.""" + shape = (self.rows, other.cols) + return self._new(self.rep * other.rep, shape, self.domain) + + # XXX: For the most part DomainMatrix does not expect DDM, SDM, or DFM to + # have arithmetic operators defined. The only exception is negation. + # Perhaps that should be removed. + + def __neg__(self): + """Negate a DFM matrix.""" + return self.neg() + + @classmethod + def zeros(cls, shape, domain): + """Return a zero DFM matrix.""" + func = cls._get_flint_func(domain) + return cls._new(func(*shape), shape, domain) + + # XXX: flint matrices do not have anything like ones or eye + # In the methods below we convert to DDM and then back to DFM which is + # probably about as efficient as implementing these methods directly. + + @classmethod + def ones(cls, shape, domain): + """Return a one DFM matrix.""" + # XXX: flint matrices do not have anything like ones + return DDM.ones(shape, domain).to_dfm() + + @classmethod + def eye(cls, n, domain): + """Return the identity matrix of size n.""" + # XXX: flint matrices do not have anything like eye + return DDM.eye(n, domain).to_dfm() + + @classmethod + def diag(cls, elements, domain): + """Return a diagonal matrix.""" + return DDM.diag(elements, domain).to_dfm() + + def applyfunc(self, func, domain): + """Apply a function to each entry of a DFM matrix.""" + return self.to_ddm().applyfunc(func, domain).to_dfm() + + def transpose(self): + """Transpose a DFM matrix.""" + return self._new(self.rep.transpose(), (self.cols, self.rows), self.domain) + + def hstack(self, *others): + """Horizontally stack matrices.""" + return self.to_ddm().hstack(*[o.to_ddm() for o in others]).to_dfm() + + def vstack(self, *others): + """Vertically stack matrices.""" + return self.to_ddm().vstack(*[o.to_ddm() for o in others]).to_dfm() + + def diagonal(self): + """Return the diagonal of a DFM matrix.""" + M = self.rep + m, n = self.shape + return [M[i, i] for i in range(min(m, n))] + + def is_upper(self): + """Return ``True`` if the matrix is upper triangular.""" + M = self.rep + for i in range(self.rows): + for j in range(i): + if M[i, j]: + return False + return True + + def is_lower(self): + """Return ``True`` if the matrix is lower triangular.""" + M = self.rep + for i in range(self.rows): + for j in range(i + 1, self.cols): + if M[i, j]: + return False + return True + + def is_diagonal(self): + """Return ``True`` if the matrix is diagonal.""" + return self.is_upper() and self.is_lower() + + def is_zero_matrix(self): + """Return ``True`` if the matrix is the zero matrix.""" + M = self.rep + for i in range(self.rows): + for j in range(self.cols): + if M[i, j]: + return False + return True + + def nnz(self): + """Return the number of non-zero elements in the matrix.""" + return self.to_ddm().nnz() + + def scc(self): + """Return the strongly connected components of the matrix.""" + return self.to_ddm().scc() + + @doctest_depends_on(ground_types='flint') + def det(self): + """ + Compute the determinant of the matrix using FLINT. + + Examples + ======== + + >>> from sympy import Matrix + >>> M = Matrix([[1, 2], [3, 4]]) + >>> dfm = M.to_DM().to_dfm() + >>> dfm + [[1, 2], [3, 4]] + >>> dfm.det() + -2 + + Notes + ===== + + Calls the ``.det()`` method of the underlying FLINT matrix. + + For :ref:`ZZ` or :ref:`QQ` this calls ``fmpz_mat_det`` or + ``fmpq_mat_det`` respectively. + + At the time of writing the implementation of ``fmpz_mat_det`` uses one + of several algorithms depending on the size of the matrix and bit size + of the entries. The algorithms used are: + + - Cofactor for very small (up to 4x4) matrices. + - Bareiss for small (up to 25x25) matrices. + - Modular algorithms for larger matrices (up to 60x60) or for larger + matrices with large bit sizes. + - Modular "accelerated" for larger matrices (60x60 upwards) if the bit + size is smaller than the dimensions of the matrix. + + The implementation of ``fmpq_mat_det`` clears denominators from each + row (not the whole matrix) and then calls ``fmpz_mat_det`` and divides + by the product of the denominators. + + See Also + ======== + + sympy.polys.matrices.domainmatrix.DomainMatrix.det + Higher level interface to compute the determinant of a matrix. + """ + # XXX: At least the first three algorithms described above should also + # be implemented in the pure Python DDM and SDM classes which at the + # time of writng just use Bareiss for all matrices and domains. + # Probably in Python the thresholds would be different though. + return self.rep.det() + + @doctest_depends_on(ground_types='flint') + def charpoly(self): + """ + Compute the characteristic polynomial of the matrix using FLINT. + + Examples + ======== + + >>> from sympy import Matrix + >>> M = Matrix([[1, 2], [3, 4]]) + >>> dfm = M.to_DM().to_dfm() # need ground types = 'flint' + >>> dfm + [[1, 2], [3, 4]] + >>> dfm.charpoly() + [1, -5, -2] + + Notes + ===== + + Calls the ``.charpoly()`` method of the underlying FLINT matrix. + + For :ref:`ZZ` or :ref:`QQ` this calls ``fmpz_mat_charpoly`` or + ``fmpq_mat_charpoly`` respectively. + + At the time of writing the implementation of ``fmpq_mat_charpoly`` + clears a denominator from the whole matrix and then calls + ``fmpz_mat_charpoly``. The coefficients of the characteristic + polynomial are then multiplied by powers of the denominator. + + The ``fmpz_mat_charpoly`` method uses a modular algorithm with CRT + reconstruction. The modular algorithm uses ``nmod_mat_charpoly`` which + uses Berkowitz for small matrices and non-prime moduli or otherwise + the Danilevsky method. + + See Also + ======== + + sympy.polys.matrices.domainmatrix.DomainMatrix.charpoly + Higher level interface to compute the characteristic polynomial of + a matrix. + """ + # FLINT polynomial coefficients are in reverse order compared to SymPy. + return self.rep.charpoly().coeffs()[::-1] + + @doctest_depends_on(ground_types='flint') + def inv(self): + """ + Compute the inverse of a matrix using FLINT. + + Examples + ======== + + >>> from sympy import Matrix, QQ + >>> M = Matrix([[1, 2], [3, 4]]) + >>> dfm = M.to_DM().to_dfm().convert_to(QQ) + >>> dfm + [[1, 2], [3, 4]] + >>> dfm.inv() + [[-2, 1], [3/2, -1/2]] + >>> dfm.matmul(dfm.inv()) + [[1, 0], [0, 1]] + + Notes + ===== + + Calls the ``.inv()`` method of the underlying FLINT matrix. + + For now this will raise an error if the domain is :ref:`ZZ` but will + use the FLINT method for :ref:`QQ`. + + The FLINT methods for :ref:`ZZ` and :ref:`QQ` are ``fmpz_mat_inv`` and + ``fmpq_mat_inv`` respectively. The ``fmpz_mat_inv`` method computes an + inverse with denominator. This is implemented by calling + ``fmpz_mat_solve`` (see notes in :meth:`lu_solve` about the algorithm). + + The ``fmpq_mat_inv`` method clears denominators from each row and then + multiplies those into the rhs identity matrix before calling + ``fmpz_mat_solve``. + + See Also + ======== + + sympy.polys.matrices.domainmatrix.DomainMatrix.inv + Higher level method for computing the inverse of a matrix. + """ + # TODO: Implement similar algorithms for DDM and SDM. + # + # XXX: The flint fmpz_mat and fmpq_mat inv methods both return fmpq_mat + # by default. The fmpz_mat method has an optional argument to return + # fmpz_mat instead for unimodular matrices. + # + # The convention in DomainMatrix is to raise an error if the matrix is + # not over a field regardless of whether the matrix is invertible over + # its domain or over any associated field. Maybe DomainMatrix.inv + # should be changed to always return a matrix over an associated field + # except with a unimodular argument for returning an inverse over a + # ring if possible. + # + # For now we follow the existing DomainMatrix convention... + K = self.domain + m, n = self.shape + + if m != n: + raise DMNonSquareMatrixError("cannot invert a non-square matrix") + + if K == ZZ: + raise DMDomainError("field expected, got %s" % K) + elif K == QQ: + try: + return self._new_rep(self.rep.inv()) + except ZeroDivisionError: + raise DMNonInvertibleMatrixError("matrix is not invertible") + else: + # If more domains are added for DFM then we will need to consider + # what happens here. + raise NotImplementedError("DFM.inv() is not implemented for %s" % K) + + def lu(self): + """Return the LU decomposition of the matrix.""" + L, U, swaps = self.to_ddm().lu() + return L.to_dfm(), U.to_dfm(), swaps + + # XXX: The lu_solve function should be renamed to solve. Whether or not it + # uses an LU decomposition is an implementation detail. A method called + # lu_solve would make sense for a situation in which an LU decomposition is + # reused several times to solve iwth different rhs but that would imply a + # different call signature. + # + # The underlying python-flint method has an algorithm= argument so we could + # use that and have e.g. solve_lu and solve_modular or perhaps also a + # method= argument to choose between the two. Flint itself has more + # possible algorithms to choose from than are exposed by python-flint. + + @doctest_depends_on(ground_types='flint') + def lu_solve(self, rhs): + """ + Solve a matrix equation using FLINT. + + Examples + ======== + + >>> from sympy import Matrix, QQ + >>> M = Matrix([[1, 2], [3, 4]]) + >>> dfm = M.to_DM().to_dfm().convert_to(QQ) + >>> dfm + [[1, 2], [3, 4]] + >>> rhs = Matrix([1, 2]).to_DM().to_dfm().convert_to(QQ) + >>> dfm.lu_solve(rhs) + [[0], [1/2]] + + Notes + ===== + + Calls the ``.solve()`` method of the underlying FLINT matrix. + + For now this will raise an error if the domain is :ref:`ZZ` but will + use the FLINT method for :ref:`QQ`. + + The FLINT methods for :ref:`ZZ` and :ref:`QQ` are ``fmpz_mat_solve`` + and ``fmpq_mat_solve`` respectively. The ``fmpq_mat_solve`` method + uses one of two algorithms: + + - For small matrices (<25 rows) it clears denominators between the + matrix and rhs and uses ``fmpz_mat_solve``. + - For larger matrices it uses ``fmpq_mat_solve_dixon`` which is a + modular approach with CRT reconstruction over :ref:`QQ`. + + The ``fmpz_mat_solve`` method uses one of four algorithms: + + - For very small (<= 3x3) matrices it uses a Cramer's rule. + - For small (<= 15x15) matrices it uses a fraction-free LU solve. + - Otherwise it uses either Dixon or another multimodular approach. + + See Also + ======== + + sympy.polys.matrices.domainmatrix.DomainMatrix.lu_solve + Higher level interface to solve a matrix equation. + """ + if not self.domain == rhs.domain: + raise DMDomainError("Domains must match: %s != %s" % (self.domain, rhs.domain)) + + # XXX: As for inv we should consider whether to return a matrix over + # over an associated field or attempt to find a solution in the ring. + # For now we follow the existing DomainMatrix convention... + if not self.domain.is_Field: + raise DMDomainError("Field expected, got %s" % self.domain) + + m, n = self.shape + j, k = rhs.shape + if m != j: + raise DMShapeError("Matrix size mismatch: %s * %s vs %s * %s" % (m, n, j, k)) + sol_shape = (n, k) + + # XXX: The Flint solve method only handles square matrices. Probably + # Flint has functions that could be used to solve non-square systems + # but they are not exposed in python-flint yet. Alternatively we could + # put something here using the features that are available like rref. + if m != n: + return self.to_ddm().lu_solve(rhs.to_ddm()).to_dfm() + + try: + sol = self.rep.solve(rhs.rep) + except ZeroDivisionError: + raise DMNonInvertibleMatrixError("Matrix det == 0; not invertible.") + + return self._new(sol, sol_shape, self.domain) + + def nullspace(self): + """Return a basis for the nullspace of the matrix.""" + # Code to compute nullspace using flint: + # + # V, nullity = self.rep.nullspace() + # V_dfm = self._new_rep(V)._extract(range(self.rows), range(nullity)) + # + # XXX: That gives the nullspace but does not give us nonpivots. So we + # use the slower DDM method anyway. It would be better to change the + # signature of the nullspace method to not return nonpivots. + # + # XXX: Also python-flint exposes a nullspace method for fmpz_mat but + # not for fmpq_mat. This is the reverse of the situation for DDM etc + # which only allow nullspace over a field. The nullspace method for + # DDM, SDM etc should be changed to allow nullspace over ZZ as well. + # The DomainMatrix nullspace method does allow the domain to be a ring + # but does not directly call the lower-level nullspace methods and uses + # rref_den instead. Nullspace methods should also be added to all + # matrix types in python-flint. + ddm, nonpivots = self.to_ddm().nullspace() + return ddm.to_dfm(), nonpivots + + def nullspace_from_rref(self, pivots=None): + """Return a basis for the nullspace of the matrix.""" + # XXX: Use the flint nullspace method!!! + sdm, nonpivots = self.to_sdm().nullspace_from_rref(pivots=pivots) + return sdm.to_dfm(), nonpivots + + def particular(self): + """Return a particular solution to the system.""" + return self.to_ddm().particular().to_dfm() + + def _lll(self, transform=False, delta=0.99, eta=0.51, rep='zbasis', gram='approx'): + """Call the fmpz_mat.lll() method but check rank to avoid segfaults.""" + + # XXX: There are tests that pass e.g. QQ(5,6) for delta. That fails + # with a TypeError in flint because if QQ is fmpq then conversion with + # float fails. We handle that here but there are two better fixes: + # + # - Make python-flint's fmpq convert with float(x) + # - Change the tests because delta should just be a float. + + def to_float(x): + if QQ.of_type(x): + return float(x.numerator) / float(x.denominator) + else: + return float(x) + + delta = to_float(delta) + eta = to_float(eta) + + if not 0.25 < delta < 1: + raise DMValueError("delta must be between 0.25 and 1") + + # XXX: The flint lll method segfaults if the matrix is not full rank. + m, n = self.shape + if self.rep.rank() != m: + raise DMRankError("Matrix must have full row rank for Flint LLL.") + + # Actually call the flint method. + return self.rep.lll(transform=transform, delta=delta, eta=eta, rep=rep, gram=gram) + + @doctest_depends_on(ground_types='flint') + def lll(self, delta=0.75): + """Compute LLL-reduced basis using FLINT. + + See :meth:`lll_transform` for more information. + + Examples + ======== + + >>> from sympy import Matrix + >>> M = Matrix([[1, 2, 3], [4, 5, 6]]) + >>> M.to_DM().to_dfm().lll() + [[2, 1, 0], [-1, 1, 3]] + + See Also + ======== + + sympy.polys.matrices.domainmatrix.DomainMatrix.lll + Higher level interface to compute LLL-reduced basis. + lll_transform + Compute LLL-reduced basis and transform matrix. + """ + if self.domain != ZZ: + raise DMDomainError("ZZ expected, got %s" % self.domain) + elif self.rows > self.cols: + raise DMShapeError("Matrix must not have more rows than columns.") + + rep = self._lll(delta=delta) + return self._new_rep(rep) + + @doctest_depends_on(ground_types='flint') + def lll_transform(self, delta=0.75): + """Compute LLL-reduced basis and transform using FLINT. + + Examples + ======== + + >>> from sympy import Matrix + >>> M = Matrix([[1, 2, 3], [4, 5, 6]]).to_DM().to_dfm() + >>> M_lll, T = M.lll_transform() + >>> M_lll + [[2, 1, 0], [-1, 1, 3]] + >>> T + [[-2, 1], [3, -1]] + >>> T.matmul(M) == M_lll + True + + See Also + ======== + + sympy.polys.matrices.domainmatrix.DomainMatrix.lll + Higher level interface to compute LLL-reduced basis. + lll + Compute LLL-reduced basis without transform matrix. + """ + if self.domain != ZZ: + raise DMDomainError("ZZ expected, got %s" % self.domain) + elif self.rows > self.cols: + raise DMShapeError("Matrix must not have more rows than columns.") + + rep, T = self._lll(transform=True, delta=delta) + basis = self._new_rep(rep) + T_dfm = self._new(T, (self.rows, self.rows), self.domain) + return basis, T_dfm + + +# Avoid circular imports +from sympy.polys.matrices.ddm import DDM +from sympy.polys.matrices.ddm import SDM diff --git a/llava_next/lib/python3.10/site-packages/sympy/polys/matrices/eigen.py b/llava_next/lib/python3.10/site-packages/sympy/polys/matrices/eigen.py new file mode 100644 index 0000000000000000000000000000000000000000..17d673c6ea09002e1cfd5357f301c447a7af4341 --- /dev/null +++ b/llava_next/lib/python3.10/site-packages/sympy/polys/matrices/eigen.py @@ -0,0 +1,90 @@ +""" + +Routines for computing eigenvectors with DomainMatrix. + +""" +from sympy.core.symbol import Dummy + +from ..agca.extensions import FiniteExtension +from ..factortools import dup_factor_list +from ..polyroots import roots +from ..polytools import Poly +from ..rootoftools import CRootOf + +from .domainmatrix import DomainMatrix + + +def dom_eigenvects(A, l=Dummy('lambda')): + charpoly = A.charpoly() + rows, cols = A.shape + domain = A.domain + _, factors = dup_factor_list(charpoly, domain) + + rational_eigenvects = [] + algebraic_eigenvects = [] + for base, exp in factors: + if len(base) == 2: + field = domain + eigenval = -base[1] / base[0] + + EE_items = [ + [eigenval if i == j else field.zero for j in range(cols)] + for i in range(rows)] + EE = DomainMatrix(EE_items, (rows, cols), field) + + basis = (A - EE).nullspace(divide_last=True) + rational_eigenvects.append((field, eigenval, exp, basis)) + else: + minpoly = Poly.from_list(base, l, domain=domain) + field = FiniteExtension(minpoly) + eigenval = field(l) + + AA_items = [ + [Poly.from_list([item], l, domain=domain).rep for item in row] + for row in A.rep.to_ddm()] + AA_items = [[field(item) for item in row] for row in AA_items] + AA = DomainMatrix(AA_items, (rows, cols), field) + EE_items = [ + [eigenval if i == j else field.zero for j in range(cols)] + for i in range(rows)] + EE = DomainMatrix(EE_items, (rows, cols), field) + + basis = (AA - EE).nullspace(divide_last=True) + algebraic_eigenvects.append((field, minpoly, exp, basis)) + + return rational_eigenvects, algebraic_eigenvects + + +def dom_eigenvects_to_sympy( + rational_eigenvects, algebraic_eigenvects, + Matrix, **kwargs +): + result = [] + + for field, eigenvalue, multiplicity, eigenvects in rational_eigenvects: + eigenvects = eigenvects.rep.to_ddm() + eigenvalue = field.to_sympy(eigenvalue) + new_eigenvects = [ + Matrix([field.to_sympy(x) for x in vect]) + for vect in eigenvects] + result.append((eigenvalue, multiplicity, new_eigenvects)) + + for field, minpoly, multiplicity, eigenvects in algebraic_eigenvects: + eigenvects = eigenvects.rep.to_ddm() + l = minpoly.gens[0] + + eigenvects = [[field.to_sympy(x) for x in vect] for vect in eigenvects] + + degree = minpoly.degree() + minpoly = minpoly.as_expr() + eigenvals = roots(minpoly, l, **kwargs) + if len(eigenvals) != degree: + eigenvals = [CRootOf(minpoly, l, idx) for idx in range(degree)] + + for eigenvalue in eigenvals: + new_eigenvects = [ + Matrix([x.subs(l, eigenvalue) for x in vect]) + for vect in eigenvects] + result.append((eigenvalue, multiplicity, new_eigenvects)) + + return result diff --git a/llava_next/lib/python3.10/site-packages/sympy/polys/matrices/linsolve.py b/llava_next/lib/python3.10/site-packages/sympy/polys/matrices/linsolve.py new file mode 100644 index 0000000000000000000000000000000000000000..af74058d859b744cf8fe1059ddb7c775fece79c7 --- /dev/null +++ b/llava_next/lib/python3.10/site-packages/sympy/polys/matrices/linsolve.py @@ -0,0 +1,230 @@ +# +# sympy.polys.matrices.linsolve module +# +# This module defines the _linsolve function which is the internal workhorse +# used by linsolve. This computes the solution of a system of linear equations +# using the SDM sparse matrix implementation in sympy.polys.matrices.sdm. This +# is a replacement for solve_lin_sys in sympy.polys.solvers which is +# inefficient for large sparse systems due to the use of a PolyRing with many +# generators: +# +# https://github.com/sympy/sympy/issues/20857 +# +# The implementation of _linsolve here handles: +# +# - Extracting the coefficients from the Expr/Eq input equations. +# - Constructing a domain and converting the coefficients to +# that domain. +# - Using the SDM.rref, SDM.nullspace etc methods to generate the full +# solution working with arithmetic only in the domain of the coefficients. +# +# The routines here are particularly designed to be efficient for large sparse +# systems of linear equations although as well as dense systems. It is +# possible that for some small dense systems solve_lin_sys which uses the +# dense matrix implementation DDM will be more efficient. With smaller systems +# though the bulk of the time is spent just preprocessing the inputs and the +# relative time spent in rref is too small to be noticeable. +# + +from collections import defaultdict + +from sympy.core.add import Add +from sympy.core.mul import Mul +from sympy.core.singleton import S + +from sympy.polys.constructor import construct_domain +from sympy.polys.solvers import PolyNonlinearError + +from .sdm import ( + SDM, + sdm_irref, + sdm_particular_from_rref, + sdm_nullspace_from_rref +) + +from sympy.utilities.misc import filldedent + + +def _linsolve(eqs, syms): + + """Solve a linear system of equations. + + Examples + ======== + + Solve a linear system with a unique solution: + + >>> from sympy import symbols, Eq + >>> from sympy.polys.matrices.linsolve import _linsolve + >>> x, y = symbols('x, y') + >>> eqs = [Eq(x + y, 1), Eq(x - y, 2)] + >>> _linsolve(eqs, [x, y]) + {x: 3/2, y: -1/2} + + In the case of underdetermined systems the solution will be expressed in + terms of the unknown symbols that are unconstrained: + + >>> _linsolve([Eq(x + y, 0)], [x, y]) + {x: -y, y: y} + + """ + # Number of unknowns (columns in the non-augmented matrix) + nsyms = len(syms) + + # Convert to sparse augmented matrix (len(eqs) x (nsyms+1)) + eqsdict, const = _linear_eq_to_dict(eqs, syms) + Aaug = sympy_dict_to_dm(eqsdict, const, syms) + K = Aaug.domain + + # sdm_irref has issues with float matrices. This uses the ddm_rref() + # function. When sdm_rref() can handle float matrices reasonably this + # should be removed... + if K.is_RealField or K.is_ComplexField: + Aaug = Aaug.to_ddm().rref()[0].to_sdm() + + # Compute reduced-row echelon form (RREF) + Arref, pivots, nzcols = sdm_irref(Aaug) + + # No solution: + if pivots and pivots[-1] == nsyms: + return None + + # Particular solution for non-homogeneous system: + P = sdm_particular_from_rref(Arref, nsyms+1, pivots) + + # Nullspace - general solution to homogeneous system + # Note: using nsyms not nsyms+1 to ignore last column + V, nonpivots = sdm_nullspace_from_rref(Arref, K.one, nsyms, pivots, nzcols) + + # Collect together terms from particular and nullspace: + sol = defaultdict(list) + for i, v in P.items(): + sol[syms[i]].append(K.to_sympy(v)) + for npi, Vi in zip(nonpivots, V): + sym = syms[npi] + for i, v in Vi.items(): + sol[syms[i]].append(sym * K.to_sympy(v)) + + # Use a single call to Add for each term: + sol = {s: Add(*terms) for s, terms in sol.items()} + + # Fill in the zeros: + zero = S.Zero + for s in set(syms) - set(sol): + sol[s] = zero + + # All done! + return sol + + +def sympy_dict_to_dm(eqs_coeffs, eqs_rhs, syms): + """Convert a system of dict equations to a sparse augmented matrix""" + elems = set(eqs_rhs).union(*(e.values() for e in eqs_coeffs)) + K, elems_K = construct_domain(elems, field=True, extension=True) + elem_map = dict(zip(elems, elems_K)) + neqs = len(eqs_coeffs) + nsyms = len(syms) + sym2index = dict(zip(syms, range(nsyms))) + eqsdict = [] + for eq, rhs in zip(eqs_coeffs, eqs_rhs): + eqdict = {sym2index[s]: elem_map[c] for s, c in eq.items()} + if rhs: + eqdict[nsyms] = -elem_map[rhs] + if eqdict: + eqsdict.append(eqdict) + sdm_aug = SDM(enumerate(eqsdict), (neqs, nsyms + 1), K) + return sdm_aug + + +def _linear_eq_to_dict(eqs, syms): + """Convert a system Expr/Eq equations into dict form, returning + the coefficient dictionaries and a list of syms-independent terms + from each expression in ``eqs```. + + Examples + ======== + + >>> from sympy.polys.matrices.linsolve import _linear_eq_to_dict + >>> from sympy.abc import x + >>> _linear_eq_to_dict([2*x + 3], {x}) + ([{x: 2}], [3]) + """ + coeffs = [] + ind = [] + symset = set(syms) + for e in eqs: + if e.is_Equality: + coeff, terms = _lin_eq2dict(e.lhs, symset) + cR, tR = _lin_eq2dict(e.rhs, symset) + # there were no nonlinear errors so now + # cancellation is allowed + coeff -= cR + for k, v in tR.items(): + if k in terms: + terms[k] -= v + else: + terms[k] = -v + # don't store coefficients of 0, however + terms = {k: v for k, v in terms.items() if v} + c, d = coeff, terms + else: + c, d = _lin_eq2dict(e, symset) + coeffs.append(d) + ind.append(c) + return coeffs, ind + + +def _lin_eq2dict(a, symset): + """return (c, d) where c is the sym-independent part of ``a`` and + ``d`` is an efficiently calculated dictionary mapping symbols to + their coefficients. A PolyNonlinearError is raised if non-linearity + is detected. + + The values in the dictionary will be non-zero. + + Examples + ======== + + >>> from sympy.polys.matrices.linsolve import _lin_eq2dict + >>> from sympy.abc import x, y + >>> _lin_eq2dict(x + 2*y + 3, {x, y}) + (3, {x: 1, y: 2}) + """ + if a in symset: + return S.Zero, {a: S.One} + elif a.is_Add: + terms_list = defaultdict(list) + coeff_list = [] + for ai in a.args: + ci, ti = _lin_eq2dict(ai, symset) + coeff_list.append(ci) + for mij, cij in ti.items(): + terms_list[mij].append(cij) + coeff = Add(*coeff_list) + terms = {sym: Add(*coeffs) for sym, coeffs in terms_list.items()} + return coeff, terms + elif a.is_Mul: + terms = terms_coeff = None + coeff_list = [] + for ai in a.args: + ci, ti = _lin_eq2dict(ai, symset) + if not ti: + coeff_list.append(ci) + elif terms is None: + terms = ti + terms_coeff = ci + else: + # since ti is not null and we already have + # a term, this is a cross term + raise PolyNonlinearError(filldedent(''' + nonlinear cross-term: %s''' % a)) + coeff = Mul._from_args(coeff_list) + if terms is None: + return coeff, {} + else: + terms = {sym: coeff * c for sym, c in terms.items()} + return coeff * terms_coeff, terms + elif not a.has_xfree(symset): + return a, {} + else: + raise PolyNonlinearError('nonlinear term: %s' % a) diff --git a/llava_next/lib/python3.10/site-packages/sympy/polys/matrices/tests/__init__.py b/llava_next/lib/python3.10/site-packages/sympy/polys/matrices/tests/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/llava_next/lib/python3.10/site-packages/sympy/polys/matrices/tests/__pycache__/test_domainmatrix.cpython-310.pyc b/llava_next/lib/python3.10/site-packages/sympy/polys/matrices/tests/__pycache__/test_domainmatrix.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2a4a4a21092fbca26f62ace75701d3e71092d1b4 Binary files /dev/null and b/llava_next/lib/python3.10/site-packages/sympy/polys/matrices/tests/__pycache__/test_domainmatrix.cpython-310.pyc differ diff --git a/llava_next/lib/python3.10/site-packages/sympy/polys/matrices/tests/__pycache__/test_domainscalar.cpython-310.pyc b/llava_next/lib/python3.10/site-packages/sympy/polys/matrices/tests/__pycache__/test_domainscalar.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..1e2248dfce230e5be8d1fac6f5145578ef212d0f Binary files /dev/null and b/llava_next/lib/python3.10/site-packages/sympy/polys/matrices/tests/__pycache__/test_domainscalar.cpython-310.pyc differ diff --git a/llava_next/lib/python3.10/site-packages/sympy/polys/matrices/tests/__pycache__/test_eigen.cpython-310.pyc b/llava_next/lib/python3.10/site-packages/sympy/polys/matrices/tests/__pycache__/test_eigen.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..163f661c11fa91265735359bbf7ae5e2d75ec87a Binary files /dev/null and b/llava_next/lib/python3.10/site-packages/sympy/polys/matrices/tests/__pycache__/test_eigen.cpython-310.pyc differ diff --git a/llava_next/lib/python3.10/site-packages/sympy/polys/matrices/tests/__pycache__/test_inverse.cpython-310.pyc b/llava_next/lib/python3.10/site-packages/sympy/polys/matrices/tests/__pycache__/test_inverse.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..511f5ee44b62930f70f43e0f50f6d048a42bfd50 Binary files /dev/null and b/llava_next/lib/python3.10/site-packages/sympy/polys/matrices/tests/__pycache__/test_inverse.cpython-310.pyc differ diff --git a/llava_next/lib/python3.10/site-packages/sympy/polys/matrices/tests/__pycache__/test_linsolve.cpython-310.pyc b/llava_next/lib/python3.10/site-packages/sympy/polys/matrices/tests/__pycache__/test_linsolve.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..1f2f6204c5ad11d04899a7701eaaf182c62b20be Binary files /dev/null and b/llava_next/lib/python3.10/site-packages/sympy/polys/matrices/tests/__pycache__/test_linsolve.cpython-310.pyc differ diff --git a/llava_next/lib/python3.10/site-packages/sympy/polys/matrices/tests/__pycache__/test_normalforms.cpython-310.pyc b/llava_next/lib/python3.10/site-packages/sympy/polys/matrices/tests/__pycache__/test_normalforms.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..78597d58a9a7928b0cf4007adee2bc237d118218 Binary files /dev/null and b/llava_next/lib/python3.10/site-packages/sympy/polys/matrices/tests/__pycache__/test_normalforms.cpython-310.pyc differ diff --git a/llava_next/lib/python3.10/site-packages/sympy/polys/matrices/tests/__pycache__/test_xxm.cpython-310.pyc b/llava_next/lib/python3.10/site-packages/sympy/polys/matrices/tests/__pycache__/test_xxm.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..3923cc1ddea184c40c1cbad4bcd81b69a3ef4564 Binary files /dev/null and b/llava_next/lib/python3.10/site-packages/sympy/polys/matrices/tests/__pycache__/test_xxm.cpython-310.pyc differ diff --git a/llava_next/lib/python3.10/site-packages/sympy/polys/matrices/tests/test_eigen.py b/llava_next/lib/python3.10/site-packages/sympy/polys/matrices/tests/test_eigen.py new file mode 100644 index 0000000000000000000000000000000000000000..70482eab686d5b4e1c45d552f5eccb5bdaa9e1ed --- /dev/null +++ b/llava_next/lib/python3.10/site-packages/sympy/polys/matrices/tests/test_eigen.py @@ -0,0 +1,90 @@ +""" +Tests for the sympy.polys.matrices.eigen module +""" + +from sympy.core.singleton import S +from sympy.functions.elementary.miscellaneous import sqrt +from sympy.matrices.dense import Matrix + +from sympy.polys.agca.extensions import FiniteExtension +from sympy.polys.domains import QQ +from sympy.polys.polytools import Poly +from sympy.polys.rootoftools import CRootOf +from sympy.polys.matrices.domainmatrix import DomainMatrix + +from sympy.polys.matrices.eigen import dom_eigenvects, dom_eigenvects_to_sympy + + +def test_dom_eigenvects_rational(): + # Rational eigenvalues + A = DomainMatrix([[QQ(1), QQ(2)], [QQ(1), QQ(2)]], (2, 2), QQ) + rational_eigenvects = [ + (QQ, QQ(3), 1, DomainMatrix([[QQ(1), QQ(1)]], (1, 2), QQ)), + (QQ, QQ(0), 1, DomainMatrix([[QQ(-2), QQ(1)]], (1, 2), QQ)), + ] + assert dom_eigenvects(A) == (rational_eigenvects, []) + + # Test converting to Expr: + sympy_eigenvects = [ + (S(3), 1, [Matrix([1, 1])]), + (S(0), 1, [Matrix([-2, 1])]), + ] + assert dom_eigenvects_to_sympy(rational_eigenvects, [], Matrix) == sympy_eigenvects + + +def test_dom_eigenvects_algebraic(): + # Algebraic eigenvalues + A = DomainMatrix([[QQ(1), QQ(2)], [QQ(3), QQ(4)]], (2, 2), QQ) + Avects = dom_eigenvects(A) + + # Extract the dummy to build the expected result: + lamda = Avects[1][0][1].gens[0] + irreducible = Poly(lamda**2 - 5*lamda - 2, lamda, domain=QQ) + K = FiniteExtension(irreducible) + KK = K.from_sympy + algebraic_eigenvects = [ + (K, irreducible, 1, DomainMatrix([[KK((lamda-4)/3), KK(1)]], (1, 2), K)), + ] + assert Avects == ([], algebraic_eigenvects) + + # Test converting to Expr: + sympy_eigenvects = [ + (S(5)/2 - sqrt(33)/2, 1, [Matrix([[-sqrt(33)/6 - S(1)/2], [1]])]), + (S(5)/2 + sqrt(33)/2, 1, [Matrix([[-S(1)/2 + sqrt(33)/6], [1]])]), + ] + assert dom_eigenvects_to_sympy([], algebraic_eigenvects, Matrix) == sympy_eigenvects + + +def test_dom_eigenvects_rootof(): + # Algebraic eigenvalues + A = DomainMatrix([ + [0, 0, 0, 0, -1], + [1, 0, 0, 0, 1], + [0, 1, 0, 0, 0], + [0, 0, 1, 0, 0], + [0, 0, 0, 1, 0]], (5, 5), QQ) + Avects = dom_eigenvects(A) + + # Extract the dummy to build the expected result: + lamda = Avects[1][0][1].gens[0] + irreducible = Poly(lamda**5 - lamda + 1, lamda, domain=QQ) + K = FiniteExtension(irreducible) + KK = K.from_sympy + algebraic_eigenvects = [ + (K, irreducible, 1, + DomainMatrix([ + [KK(lamda**4-1), KK(lamda**3), KK(lamda**2), KK(lamda), KK(1)] + ], (1, 5), K)), + ] + assert Avects == ([], algebraic_eigenvects) + + # Test converting to Expr (slow): + l0, l1, l2, l3, l4 = [CRootOf(lamda**5 - lamda + 1, i) for i in range(5)] + sympy_eigenvects = [ + (l0, 1, [Matrix([-1 + l0**4, l0**3, l0**2, l0, 1])]), + (l1, 1, [Matrix([-1 + l1**4, l1**3, l1**2, l1, 1])]), + (l2, 1, [Matrix([-1 + l2**4, l2**3, l2**2, l2, 1])]), + (l3, 1, [Matrix([-1 + l3**4, l3**3, l3**2, l3, 1])]), + (l4, 1, [Matrix([-1 + l4**4, l4**3, l4**2, l4, 1])]), + ] + assert dom_eigenvects_to_sympy([], algebraic_eigenvects, Matrix) == sympy_eigenvects diff --git a/llava_next/lib/python3.10/site-packages/sympy/polys/matrices/tests/test_inverse.py b/llava_next/lib/python3.10/site-packages/sympy/polys/matrices/tests/test_inverse.py new file mode 100644 index 0000000000000000000000000000000000000000..47c82799324518bd7d1cc2405ade0aa0a5a4f6e9 --- /dev/null +++ b/llava_next/lib/python3.10/site-packages/sympy/polys/matrices/tests/test_inverse.py @@ -0,0 +1,193 @@ +from sympy import ZZ, Matrix +from sympy.polys.matrices import DM, DomainMatrix +from sympy.polys.matrices.dense import ddm_iinv +from sympy.polys.matrices.exceptions import DMNonInvertibleMatrixError +from sympy.matrices.exceptions import NonInvertibleMatrixError + +import pytest +from sympy.testing.pytest import raises +from sympy.core.numbers import all_close + +from sympy.abc import x + + +# Examples are given as adjugate matrix and determinant adj_det should match +# these exactly but inv_den only matches after cancel_denom. + + +INVERSE_EXAMPLES = [ + + ( + 'zz_1', + DomainMatrix([], (0, 0), ZZ), + DomainMatrix([], (0, 0), ZZ), + ZZ(1), + ), + + ( + 'zz_2', + DM([[2]], ZZ), + DM([[1]], ZZ), + ZZ(2), + ), + + ( + 'zz_3', + DM([[2, 0], + [0, 2]], ZZ), + DM([[2, 0], + [0, 2]], ZZ), + ZZ(4), + ), + + ( + 'zz_4', + DM([[1, 2], + [3, 4]], ZZ), + DM([[ 4, -2], + [-3, 1]], ZZ), + ZZ(-2), + ), + + ( + 'zz_5', + DM([[2, 2, 0], + [0, 2, 2], + [0, 0, 2]], ZZ), + DM([[4, -4, 4], + [0, 4, -4], + [0, 0, 4]], ZZ), + ZZ(8), + ), + + ( + 'zz_6', + DM([[1, 2, 3], + [4, 5, 6], + [7, 8, 9]], ZZ), + DM([[-3, 6, -3], + [ 6, -12, 6], + [-3, 6, -3]], ZZ), + ZZ(0), + ), +] + + +@pytest.mark.parametrize('name, A, A_inv, den', INVERSE_EXAMPLES) +def test_Matrix_inv(name, A, A_inv, den): + + def _check(**kwargs): + if den != 0: + assert A.inv(**kwargs) == A_inv + else: + raises(NonInvertibleMatrixError, lambda: A.inv(**kwargs)) + + K = A.domain + A = A.to_Matrix() + A_inv = A_inv.to_Matrix() / K.to_sympy(den) + _check() + for method in ['GE', 'LU', 'ADJ', 'CH', 'LDL', 'QR']: + _check(method=method) + + +@pytest.mark.parametrize('name, A, A_inv, den', INVERSE_EXAMPLES) +def test_dm_inv_den(name, A, A_inv, den): + if den != 0: + A_inv_f, den_f = A.inv_den() + assert A_inv_f.cancel_denom(den_f) == A_inv.cancel_denom(den) + else: + raises(DMNonInvertibleMatrixError, lambda: A.inv_den()) + + +@pytest.mark.parametrize('name, A, A_inv, den', INVERSE_EXAMPLES) +def test_dm_inv(name, A, A_inv, den): + A = A.to_field() + if den != 0: + A_inv = A_inv.to_field() / den + assert A.inv() == A_inv + else: + raises(DMNonInvertibleMatrixError, lambda: A.inv()) + + +@pytest.mark.parametrize('name, A, A_inv, den', INVERSE_EXAMPLES) +def test_ddm_inv(name, A, A_inv, den): + A = A.to_field().to_ddm() + if den != 0: + A_inv = (A_inv.to_field() / den).to_ddm() + assert A.inv() == A_inv + else: + raises(DMNonInvertibleMatrixError, lambda: A.inv()) + + +@pytest.mark.parametrize('name, A, A_inv, den', INVERSE_EXAMPLES) +def test_sdm_inv(name, A, A_inv, den): + A = A.to_field().to_sdm() + if den != 0: + A_inv = (A_inv.to_field() / den).to_sdm() + assert A.inv() == A_inv + else: + raises(DMNonInvertibleMatrixError, lambda: A.inv()) + + +@pytest.mark.parametrize('name, A, A_inv, den', INVERSE_EXAMPLES) +def test_dense_ddm_iinv(name, A, A_inv, den): + A = A.to_field().to_ddm().copy() + K = A.domain + A_result = A.copy() + if den != 0: + A_inv = (A_inv.to_field() / den).to_ddm() + ddm_iinv(A_result, A, K) + assert A_result == A_inv + else: + raises(DMNonInvertibleMatrixError, lambda: ddm_iinv(A_result, A, K)) + + +@pytest.mark.parametrize('name, A, A_inv, den', INVERSE_EXAMPLES) +def test_Matrix_adjugate(name, A, A_inv, den): + A = A.to_Matrix() + A_inv = A_inv.to_Matrix() + assert A.adjugate() == A_inv + for method in ["bareiss", "berkowitz", "bird", "laplace", "lu"]: + assert A.adjugate(method=method) == A_inv + + +@pytest.mark.parametrize('name, A, A_inv, den', INVERSE_EXAMPLES) +def test_dm_adj_det(name, A, A_inv, den): + assert A.adj_det() == (A_inv, den) + + +def test_inverse_inexact(): + + M = Matrix([[x-0.3, -0.06, -0.22], + [-0.46, x-0.48, -0.41], + [-0.14, -0.39, x-0.64]]) + + Mn = Matrix([[1.0*x**2 - 1.12*x + 0.1473, 0.06*x + 0.0474, 0.22*x - 0.081], + [0.46*x - 0.237, 1.0*x**2 - 0.94*x + 0.1612, 0.41*x - 0.0218], + [0.14*x + 0.1122, 0.39*x - 0.1086, 1.0*x**2 - 0.78*x + 0.1164]]) + + d = 1.0*x**3 - 1.42*x**2 + 0.4249*x - 0.0546540000000002 + + Mi = Mn / d + + M_dm = M.to_DM() + M_dmd = M_dm.to_dense() + M_dm_num, M_dm_den = M_dm.inv_den() + M_dmd_num, M_dmd_den = M_dmd.inv_den() + + # XXX: We don't check M_dm().to_field().inv() which currently uses division + # and produces a more complicate result from gcd cancellation failing. + # DomainMatrix.inv() over RR(x) should be changed to clear denominators and + # use DomainMatrix.inv_den(). + + Minvs = [ + M.inv(), + (M_dm_num.to_field() / M_dm_den).to_Matrix(), + (M_dmd_num.to_field() / M_dmd_den).to_Matrix(), + M_dm_num.to_Matrix() / M_dm_den.as_expr(), + M_dmd_num.to_Matrix() / M_dmd_den.as_expr(), + ] + + for Minv in Minvs: + for Mi1, Mi2 in zip(Minv.flat(), Mi.flat()): + assert all_close(Mi2, Mi1) diff --git a/llava_next/lib/python3.10/site-packages/sympy/polys/matrices/tests/test_linsolve.py b/llava_next/lib/python3.10/site-packages/sympy/polys/matrices/tests/test_linsolve.py new file mode 100644 index 0000000000000000000000000000000000000000..25300ef2cb4792e4424c9c15c0bbbc313ce062e6 --- /dev/null +++ b/llava_next/lib/python3.10/site-packages/sympy/polys/matrices/tests/test_linsolve.py @@ -0,0 +1,112 @@ +# +# test_linsolve.py +# +# Test the internal implementation of linsolve. +# + +from sympy.testing.pytest import raises + +from sympy.core.numbers import I +from sympy.core.relational import Eq +from sympy.core.singleton import S +from sympy.abc import x, y, z + +from sympy.polys.matrices.linsolve import _linsolve +from sympy.polys.solvers import PolyNonlinearError + + +def test__linsolve(): + assert _linsolve([], [x]) == {x:x} + assert _linsolve([S.Zero], [x]) == {x:x} + assert _linsolve([x-1,x-2], [x]) is None + assert _linsolve([x-1], [x]) == {x:1} + assert _linsolve([x-1, y], [x, y]) == {x:1, y:S.Zero} + assert _linsolve([2*I], [x]) is None + raises(PolyNonlinearError, lambda: _linsolve([x*(1 + x)], [x])) + + +def test__linsolve_float(): + + # This should give the exact answer: + eqs = [ + y - x, + y - 0.0216 * x + ] + # Should _linsolve return floats here? + sol = {x:0, y:0} + assert _linsolve(eqs, (x, y)) == sol + + # Other cases should be close to eps + + def all_close(sol1, sol2, eps=1e-15): + close = lambda a, b: abs(a - b) < eps + assert sol1.keys() == sol2.keys() + return all(close(sol1[s], sol2[s]) for s in sol1) + + eqs = [ + 0.8*x + 0.8*z + 0.2, + 0.9*x + 0.7*y + 0.2*z + 0.9, + 0.7*x + 0.2*y + 0.2*z + 0.5 + ] + sol_exact = {x:-29/42, y:-11/21, z:37/84} + sol_linsolve = _linsolve(eqs, [x,y,z]) + assert all_close(sol_exact, sol_linsolve) + + eqs = [ + 0.9*x + 0.3*y + 0.4*z + 0.6, + 0.6*x + 0.9*y + 0.1*z + 0.7, + 0.4*x + 0.6*y + 0.9*z + 0.5 + ] + sol_exact = {x:-88/175, y:-46/105, z:-1/25} + sol_linsolve = _linsolve(eqs, [x,y,z]) + assert all_close(sol_exact, sol_linsolve) + + eqs = [ + 0.4*x + 0.3*y + 0.6*z + 0.7, + 0.4*x + 0.3*y + 0.9*z + 0.9, + 0.7*x + 0.9*y, + ] + sol_exact = {x:-9/5, y:7/5, z:-2/3} + sol_linsolve = _linsolve(eqs, [x,y,z]) + assert all_close(sol_exact, sol_linsolve) + + eqs = [ + x*(0.7 + 0.6*I) + y*(0.4 + 0.7*I) + z*(0.9 + 0.1*I) + 0.5, + 0.2*I*x + 0.2*I*y + z*(0.9 + 0.2*I) + 0.1, + x*(0.9 + 0.7*I) + y*(0.9 + 0.7*I) + z*(0.9 + 0.4*I) + 0.4, + ] + sol_exact = { + x:-6157/7995 - 411/5330*I, + y:8519/15990 + 1784/7995*I, + z:-34/533 + 107/1599*I, + } + sol_linsolve = _linsolve(eqs, [x,y,z]) + assert all_close(sol_exact, sol_linsolve) + + # XXX: This system for x and y over RR(z) is problematic. + # + # eqs = [ + # x*(0.2*z + 0.9) + y*(0.5*z + 0.8) + 0.6, + # 0.1*x*z + y*(0.1*z + 0.6) + 0.9, + # ] + # + # linsolve(eqs, [x, y]) + # The solution for x comes out as + # + # -3.9e-5*z**2 - 3.6e-5*z - 8.67361737988404e-20 + # x = ---------------------------------------------- + # 3.0e-6*z**3 - 1.3e-5*z**2 - 5.4e-5*z + # + # The 8e-20 in the numerator should be zero which would allow z to cancel + # from top and bottom. It should be possible to avoid this somehow because + # the inverse of the matrix only has a quadratic factor (the determinant) + # in the denominator. + + +def test__linsolve_deprecated(): + raises(PolyNonlinearError, lambda: + _linsolve([Eq(x**2, x**2 + y)], [x, y])) + raises(PolyNonlinearError, lambda: + _linsolve([(x + y)**2 - x**2], [x])) + raises(PolyNonlinearError, lambda: + _linsolve([Eq((x + y)**2, x**2)], [x])) diff --git a/llava_next/lib/python3.10/site-packages/sympy/polys/matrices/tests/test_nullspace.py b/llava_next/lib/python3.10/site-packages/sympy/polys/matrices/tests/test_nullspace.py new file mode 100644 index 0000000000000000000000000000000000000000..dbb025b7dc9dff31bc97d86e175147ffede5a7e3 --- /dev/null +++ b/llava_next/lib/python3.10/site-packages/sympy/polys/matrices/tests/test_nullspace.py @@ -0,0 +1,209 @@ +from sympy import ZZ, Matrix +from sympy.polys.matrices import DM, DomainMatrix +from sympy.polys.matrices.ddm import DDM +from sympy.polys.matrices.sdm import SDM + +import pytest + +zeros = lambda shape, K: DomainMatrix.zeros(shape, K).to_dense() +eye = lambda n, K: DomainMatrix.eye(n, K).to_dense() + + +# +# DomainMatrix.nullspace can have a divided answer or can return an undivided +# uncanonical answer. The uncanonical answer is not unique but we can make it +# unique by making it primitive (remove gcd). The tests here all show the +# primitive form. We test two things: +# +# A.nullspace().primitive()[1] == answer. +# A.nullspace(divide_last=True) == _divide_last(answer). +# +# The nullspace as returned by DomainMatrix and related classes is the +# transpose of the nullspace as returned by Matrix. Matrix returns a list of +# of column vectors whereas DomainMatrix returns a matrix whose rows are the +# nullspace vectors. +# + + +NULLSPACE_EXAMPLES = [ + + ( + 'zz_1', + DM([[ 1, 2, 3]], ZZ), + DM([[-2, 1, 0], + [-3, 0, 1]], ZZ), + ), + + ( + 'zz_2', + zeros((0, 0), ZZ), + zeros((0, 0), ZZ), + ), + + ( + 'zz_3', + zeros((2, 0), ZZ), + zeros((0, 0), ZZ), + ), + + ( + 'zz_4', + zeros((0, 2), ZZ), + eye(2, ZZ), + ), + + ( + 'zz_5', + zeros((2, 2), ZZ), + eye(2, ZZ), + ), + + ( + 'zz_6', + DM([[1, 2], + [3, 4]], ZZ), + zeros((0, 2), ZZ), + ), + + ( + 'zz_7', + DM([[1, 1], + [1, 1]], ZZ), + DM([[-1, 1]], ZZ), + ), + + ( + 'zz_8', + DM([[1], + [1]], ZZ), + zeros((0, 1), ZZ), + ), + + ( + 'zz_9', + DM([[1, 1]], ZZ), + DM([[-1, 1]], ZZ), + ), + + ( + 'zz_10', + DM([[0, 0, 0, 0, 0, 1, 0, 0, 0, 0], + [1, 0, 0, 0, 0, 0, 1, 0, 0, 0], + [0, 1, 0, 0, 0, 0, 0, 1, 0, 0], + [0, 0, 0, 1, 0, 0, 0, 0, 1, 0], + [0, 0, 0, 0, 1, 0, 0, 0, 0, 1]], ZZ), + DM([[ 0, 0, 1, 0, 0, 0, 0, 0, 0, 0], + [-1, 0, 0, 0, 0, 0, 1, 0, 0, 0], + [ 0, -1, 0, 0, 0, 0, 0, 1, 0, 0], + [ 0, 0, 0, -1, 0, 0, 0, 0, 1, 0], + [ 0, 0, 0, 0, -1, 0, 0, 0, 0, 1]], ZZ), + ), + +] + + +def _to_DM(A, ans): + """Convert the answer to DomainMatrix.""" + if isinstance(A, DomainMatrix): + return A.to_dense() + elif isinstance(A, DDM): + return DomainMatrix(list(A), A.shape, A.domain).to_dense() + elif isinstance(A, SDM): + return DomainMatrix(dict(A), A.shape, A.domain).to_dense() + else: + assert False # pragma: no cover + + +def _divide_last(null): + """Normalize the nullspace by the rightmost non-zero entry.""" + null = null.to_field() + + if null.is_zero_matrix: + return null + + rows = [] + for i in range(null.shape[0]): + for j in reversed(range(null.shape[1])): + if null[i, j]: + rows.append(null[i, :] / null[i, j]) + break + else: + assert False # pragma: no cover + + return DomainMatrix.vstack(*rows) + + +def _check_primitive(null, null_ans): + """Check that the primitive of the answer matches.""" + null = _to_DM(null, null_ans) + cont, null_prim = null.primitive() + assert null_prim == null_ans + + +def _check_divided(null, null_ans): + """Check the divided answer.""" + null = _to_DM(null, null_ans) + null_ans_norm = _divide_last(null_ans) + assert null == null_ans_norm + + +@pytest.mark.parametrize('name, A, A_null', NULLSPACE_EXAMPLES) +def test_Matrix_nullspace(name, A, A_null): + A = A.to_Matrix() + + A_null_cols = A.nullspace() + + # We have to patch up the case where the nullspace is empty + if A_null_cols: + A_null_found = Matrix.hstack(*A_null_cols) + else: + A_null_found = Matrix.zeros(A.cols, 0) + + A_null_found = A_null_found.to_DM().to_field().to_dense() + + # The Matrix result is the transpose of DomainMatrix result. + A_null_found = A_null_found.transpose() + + _check_divided(A_null_found, A_null) + + +@pytest.mark.parametrize('name, A, A_null', NULLSPACE_EXAMPLES) +def test_dm_dense_nullspace(name, A, A_null): + A = A.to_field().to_dense() + A_null_found = A.nullspace(divide_last=True) + _check_divided(A_null_found, A_null) + + +@pytest.mark.parametrize('name, A, A_null', NULLSPACE_EXAMPLES) +def test_dm_sparse_nullspace(name, A, A_null): + A = A.to_field().to_sparse() + A_null_found = A.nullspace(divide_last=True) + _check_divided(A_null_found, A_null) + + +@pytest.mark.parametrize('name, A, A_null', NULLSPACE_EXAMPLES) +def test_ddm_nullspace(name, A, A_null): + A = A.to_field().to_ddm() + A_null_found, _ = A.nullspace() + _check_divided(A_null_found, A_null) + + +@pytest.mark.parametrize('name, A, A_null', NULLSPACE_EXAMPLES) +def test_sdm_nullspace(name, A, A_null): + A = A.to_field().to_sdm() + A_null_found, _ = A.nullspace() + _check_divided(A_null_found, A_null) + + +@pytest.mark.parametrize('name, A, A_null', NULLSPACE_EXAMPLES) +def test_dm_dense_nullspace_fracfree(name, A, A_null): + A = A.to_dense() + A_null_found = A.nullspace() + _check_primitive(A_null_found, A_null) + + +@pytest.mark.parametrize('name, A, A_null', NULLSPACE_EXAMPLES) +def test_dm_sparse_nullspace_fracfree(name, A, A_null): + A = A.to_sparse() + A_null_found = A.nullspace() + _check_primitive(A_null_found, A_null) diff --git a/llava_next/lib/python3.10/site-packages/sympy/polys/matrices/tests/test_rref.py b/llava_next/lib/python3.10/site-packages/sympy/polys/matrices/tests/test_rref.py new file mode 100644 index 0000000000000000000000000000000000000000..49def18c8132c0537540163a96bf6cf323c5a85c --- /dev/null +++ b/llava_next/lib/python3.10/site-packages/sympy/polys/matrices/tests/test_rref.py @@ -0,0 +1,737 @@ +from sympy import ZZ, QQ, ZZ_I, EX, Matrix, eye, zeros, symbols +from sympy.polys.matrices import DM, DomainMatrix +from sympy.polys.matrices.dense import ddm_irref_den, ddm_irref +from sympy.polys.matrices.ddm import DDM +from sympy.polys.matrices.sdm import SDM, sdm_irref, sdm_rref_den + +import pytest + + +# +# The dense and sparse implementations of rref_den are ddm_irref_den and +# sdm_irref_den. These can give results that differ by some factor and also +# give different results if the order of the rows is changed. The tests below +# show all results on lowest terms as should be returned by cancel_denom. +# +# The EX domain is also a case where the dense and sparse implementations +# can give results in different forms: the results should be equivalent but +# are not canonical because EX does not have a canonical form. +# + + +a, b, c, d = symbols('a, b, c, d') + + +qq_large_1 = DM([ +[ (1,2), (1,3), (1,5), (1,7), (1,11), (1,13), (1,17), (1,19), (1,23), (1,29), (1,31)], +[ (1,37), (1,41), (1,43), (1,47), (1,53), (1,59), (1,61), (1,67), (1,71), (1,73), (1,79)], +[ (1,83), (1,89), (1,97),(1,101),(1,103),(1,107),(1,109),(1,113),(1,127),(1,131),(1,137)], +[(1,139),(1,149),(1,151),(1,157),(1,163),(1,167),(1,173),(1,179),(1,181),(1,191),(1,193)], +[(1,197),(1,199),(1,211),(1,223),(1,227),(1,229),(1,233),(1,239),(1,241),(1,251),(1,257)], +[(1,263),(1,269),(1,271),(1,277),(1,281),(1,283),(1,293),(1,307),(1,311),(1,313),(1,317)], +[(1,331),(1,337),(1,347),(1,349),(1,353),(1,359),(1,367),(1,373),(1,379),(1,383),(1,389)], +[(1,397),(1,401),(1,409),(1,419),(1,421),(1,431),(1,433),(1,439),(1,443),(1,449),(1,457)], +[(1,461),(1,463),(1,467),(1,479),(1,487),(1,491),(1,499),(1,503),(1,509),(1,521),(1,523)], +[(1,541),(1,547),(1,557),(1,563),(1,569),(1,571),(1,577),(1,587),(1,593),(1,599),(1,601)], +[(1,607),(1,613),(1,617),(1,619),(1,631),(1,641),(1,643),(1,647),(1,653),(1,659),(1,661)]], + QQ) + +qq_large_2 = qq_large_1 + 10**100 * DomainMatrix.eye(11, QQ) + + +RREF_EXAMPLES = [ + ( + 'zz_1', + DM([[1, 2, 3]], ZZ), + DM([[1, 2, 3]], ZZ), + ZZ(1), + ), + + ( + 'zz_2', + DomainMatrix([], (0, 0), ZZ), + DomainMatrix([], (0, 0), ZZ), + ZZ(1), + ), + + ( + 'zz_3', + DM([[1, 2], + [3, 4]], ZZ), + DM([[1, 0], + [0, 1]], ZZ), + ZZ(1), + ), + + ( + 'zz_4', + DM([[1, 0], + [3, 4]], ZZ), + DM([[1, 0], + [0, 1]], ZZ), + ZZ(1), + ), + + ( + 'zz_5', + DM([[0, 2], + [3, 4]], ZZ), + DM([[1, 0], + [0, 1]], ZZ), + ZZ(1), + ), + + ( + 'zz_6', + DM([[1, 2, 3], + [4, 5, 6], + [7, 8, 9]], ZZ), + DM([[1, 0, -1], + [0, 1, 2], + [0, 0, 0]], ZZ), + ZZ(1), + ), + + ( + 'zz_7', + DM([[0, 0, 0], + [0, 0, 0], + [1, 0, 0]], ZZ), + DM([[1, 0, 0], + [0, 0, 0], + [0, 0, 0]], ZZ), + ZZ(1), + ), + + ( + 'zz_8', + DM([[0, 0, 0], + [0, 0, 0], + [0, 0, 0]], ZZ), + DM([[0, 0, 0], + [0, 0, 0], + [0, 0, 0]], ZZ), + ZZ(1), + ), + + ( + 'zz_9', + DM([[1, 1, 0], + [0, 0, 2], + [0, 0, 0]], ZZ), + DM([[1, 1, 0], + [0, 0, 1], + [0, 0, 0]], ZZ), + ZZ(1), + ), + + ( + 'zz_10', + DM([[2, 2, 0], + [0, 0, 2], + [0, 0, 0]], ZZ), + DM([[1, 1, 0], + [0, 0, 1], + [0, 0, 0]], ZZ), + ZZ(1), + ), + + ( + 'zz_11', + DM([[2, 2, 0], + [0, 2, 2], + [0, 0, 2]], ZZ), + DM([[1, 0, 0], + [0, 1, 0], + [0, 0, 1]], ZZ), + ZZ(1), + ), + + ( + 'zz_12', + DM([[ 1, 2, 3], + [ 4, 5, 6], + [ 7, 8, 9], + [10, 11, 12]], ZZ), + DM([[1, 0, -1], + [0, 1, 2], + [0, 0, 0], + [0, 0, 0]], ZZ), + ZZ(1), + ), + + ( + 'zz_13', + DM([[ 1, 2, 3], + [ 4, 5, 6], + [ 7, 8, 9], + [10, 11, 13]], ZZ), + DM([[ 1, 0, 0], + [ 0, 1, 0], + [ 0, 0, 1], + [ 0, 0, 0]], ZZ), + ZZ(1), + ), + + ( + 'zz_14', + DM([[1, 2, 4, 3], + [4, 5, 10, 6], + [7, 8, 16, 9]], ZZ), + DM([[1, 0, 0, -1], + [0, 1, 2, 2], + [0, 0, 0, 0]], ZZ), + ZZ(1), + ), + + ( + 'zz_15', + DM([[1, 2, 4, 3], + [4, 5, 10, 6], + [7, 8, 17, 9]], ZZ), + DM([[1, 0, 0, -1], + [0, 1, 0, 2], + [0, 0, 1, 0]], ZZ), + ZZ(1), + ), + + ( + 'zz_16', + DM([[1, 2, 0, 1], + [1, 1, 9, 0]], ZZ), + DM([[1, 0, 18, -1], + [0, 1, -9, 1]], ZZ), + ZZ(1), + ), + + ( + 'zz_17', + DM([[1, 1, 1], + [1, 2, 2]], ZZ), + DM([[1, 0, 0], + [0, 1, 1]], ZZ), + ZZ(1), + ), + + ( + # Here the sparse implementation and dense implementation give very + # different denominators: 4061232 and -1765176. + 'zz_18', + DM([[94, 24, 0, 27, 0], + [79, 0, 0, 0, 0], + [85, 16, 71, 81, 0], + [ 0, 0, 72, 77, 0], + [21, 0, 34, 0, 0]], ZZ), + DM([[ 1, 0, 0, 0, 0], + [ 0, 1, 0, 0, 0], + [ 0, 0, 1, 0, 0], + [ 0, 0, 0, 1, 0], + [ 0, 0, 0, 0, 0]], ZZ), + ZZ(1), + ), + + ( + # Let's have a denominator that cannot be cancelled. + 'zz_19', + DM([[1, 2, 4], + [4, 5, 6]], ZZ), + DM([[3, 0, -8], + [0, 3, 10]], ZZ), + ZZ(3), + ), + + ( + 'zz_20', + DM([[0, 0, 0, 0, 0], + [0, 0, 0, 0, 0], + [0, 0, 0, 0, 4]], ZZ), + DM([[0, 0, 0, 0, 1], + [0, 0, 0, 0, 0], + [0, 0, 0, 0, 0]], ZZ), + ZZ(1), + ), + + ( + 'zz_21', + DM([[0, 0, 0, 0, 0, 1, 0, 0, 0, 0], + [1, 0, 0, 0, 0, 0, 1, 0, 0, 0], + [0, 1, 0, 0, 0, 0, 0, 1, 0, 0], + [0, 0, 0, 1, 0, 0, 0, 0, 1, 0], + [0, 0, 0, 0, 1, 0, 0, 0, 0, 1]], ZZ), + DM([[1, 0, 0, 0, 0, 0, 1, 0, 0, 0], + [0, 1, 0, 0, 0, 0, 0, 1, 0, 0], + [0, 0, 0, 1, 0, 0, 0, 0, 1, 0], + [0, 0, 0, 0, 1, 0, 0, 0, 0, 1], + [0, 0, 0, 0, 0, 1, 0, 0, 0, 0]], ZZ), + ZZ(1), + ), + + ( + 'zz_22', + DM([[1, 1, 1, 0, 1], + [1, 1, 0, 1, 0], + [1, 0, 1, 0, 1], + [1, 1, 0, 1, 0], + [1, 0, 0, 0, 0]], ZZ), + DM([[1, 0, 0, 0, 0], + [0, 1, 0, 0, 0], + [0, 0, 1, 0, 1], + [0, 0, 0, 1, 0], + [0, 0, 0, 0, 0]], ZZ), + ZZ(1), + ), + + ( + 'zz_large_1', + DM([ +[ 0, 0, 0, 81, 0, 0, 75, 0, 0, 0, 0, 0, 0, 27, 0, 0, 0, 0, 0, 0], +[ 0, 0, 0, 0, 0, 86, 0, 92, 79, 54, 0, 7, 0, 0, 0, 0, 79, 0, 0, 0], +[89, 54, 81, 0, 0, 20, 0, 0, 0, 0, 0, 0, 51, 0, 94, 0, 0, 77, 0, 0], +[ 0, 0, 0, 96, 0, 0, 0, 0, 0, 0, 0, 0, 48, 29, 0, 0, 5, 0, 32, 0], +[ 0, 70, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 60, 0, 0, 0, 11], +[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 37, 0, 43, 0, 0], +[ 0, 0, 0, 0, 0, 38, 91, 0, 0, 0, 0, 38, 0, 0, 0, 0, 0, 26, 0, 0], +[69, 0, 0, 0, 0, 0, 94, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 55], +[ 0, 13, 18, 49, 49, 88, 0, 0, 35, 54, 0, 0, 51, 0, 0, 0, 0, 0, 0, 87], +[ 0, 0, 0, 0, 31, 0, 40, 0, 0, 0, 0, 0, 0, 50, 0, 0, 0, 0, 88, 0], +[ 0, 0, 0, 0, 0, 0, 0, 0, 98, 0, 0, 0, 15, 53, 0, 92, 0, 0, 0, 0], +[ 0, 0, 0, 95, 0, 0, 0, 36, 0, 0, 0, 0, 0, 72, 0, 0, 0, 0, 73, 19], +[ 0, 65, 14, 96, 0, 0, 0, 0, 0, 0, 0, 0, 0, 90, 0, 0, 0, 34, 0, 0], +[ 0, 0, 0, 16, 39, 44, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 51, 0, 0], +[ 0, 17, 0, 0, 0, 99, 84, 13, 50, 84, 0, 0, 0, 0, 95, 0, 43, 33, 20, 0], +[79, 0, 17, 52, 99, 12, 69, 0, 98, 0, 68, 0, 0, 0, 0, 0, 0, 0, 0, 0], +[ 0, 0, 0, 82, 0, 44, 0, 0, 0, 97, 0, 0, 0, 0, 0, 10, 0, 0, 31, 0], +[ 0, 0, 21, 0, 67, 0, 0, 0, 0, 0, 4, 0, 50, 0, 0, 0, 33, 0, 0, 0], +[ 0, 0, 0, 0, 9, 42, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8], +[ 0, 77, 0, 0, 0, 0, 0, 0, 0, 0, 34, 93, 0, 0, 0, 0, 47, 0, 0, 0]], + ZZ), + DM([[1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0], + [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0], + [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0], + [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0], + [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0], + [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0], + [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0], + [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0], + [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1]], ZZ), + ZZ(1), + ), + + ( + 'zz_large_2', + DM([ +[ 0, 0, 0, 0, 50, 0, 6, 81, 0, 1, 86, 0, 0, 98, 82, 94, 4, 0, 0, 29], +[ 0, 44, 43, 0, 62, 0, 0, 0, 60, 0, 0, 0, 0, 71, 9, 0, 57, 41, 0, 93], +[ 0, 0, 28, 0, 74, 89, 42, 0, 28, 0, 6, 0, 0, 0, 44, 0, 0, 0, 77, 19], +[ 0, 21, 82, 0, 30, 88, 0, 89, 68, 0, 0, 0, 79, 41, 0, 0, 99, 0, 0, 0], +[31, 0, 0, 0, 19, 64, 0, 0, 79, 0, 5, 0, 72, 10, 60, 32, 64, 59, 0, 24], +[ 0, 0, 0, 0, 0, 57, 0, 94, 0, 83, 20, 0, 0, 9, 31, 0, 49, 26, 58, 0], +[ 0, 65, 56, 31, 64, 0, 0, 0, 0, 0, 0, 52, 85, 0, 0, 0, 0, 51, 0, 0], +[ 0, 35, 0, 0, 0, 69, 0, 0, 64, 0, 0, 0, 0, 70, 0, 0, 90, 0, 75, 76], +[69, 7, 0, 90, 0, 0, 84, 0, 47, 69, 19, 20, 42, 0, 0, 32, 71, 35, 0, 0], +[39, 0, 90, 0, 0, 4, 85, 0, 0, 55, 0, 0, 0, 35, 67, 40, 0, 40, 0, 77], +[98, 63, 0, 71, 0, 50, 0, 2, 61, 0, 38, 0, 0, 0, 0, 75, 0, 40, 33, 56], +[ 0, 73, 0, 64, 0, 38, 0, 35, 61, 0, 0, 52, 0, 7, 0, 51, 0, 0, 0, 34], +[ 0, 0, 28, 0, 34, 5, 63, 45, 14, 42, 60, 16, 76, 54, 99, 0, 28, 30, 0, 0], +[58, 37, 14, 0, 0, 0, 94, 0, 0, 90, 0, 0, 0, 0, 0, 0, 0, 8, 90, 53], +[86, 74, 94, 0, 49, 10, 60, 0, 40, 18, 0, 0, 0, 31, 60, 24, 0, 1, 0, 29], +[53, 0, 0, 97, 0, 0, 58, 0, 0, 39, 44, 47, 0, 0, 0, 12, 50, 0, 0, 11], +[ 4, 0, 92, 10, 28, 0, 0, 89, 0, 0, 18, 54, 23, 39, 0, 2, 0, 48, 0, 92], +[ 0, 0, 90, 77, 95, 33, 0, 0, 49, 22, 39, 0, 0, 0, 0, 0, 0, 40, 0, 0], +[96, 0, 0, 0, 0, 38, 86, 0, 22, 76, 0, 0, 0, 0, 83, 88, 95, 65, 72, 0], +[81, 65, 0, 4, 60, 0, 19, 0, 0, 68, 0, 0, 89, 0, 67, 22, 0, 0, 55, 33]], + ZZ), + DM([ +[1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], +[0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], +[0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], +[0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], +[0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], +[0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], +[0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], +[0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], +[0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], +[0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], +[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0], +[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0], +[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0], +[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0], +[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0], +[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0], +[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0], +[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0], +[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0], +[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1]], + ZZ), + ZZ(1), + ), + + ( + 'zz_large_3', + DM([ +[62,35,89,58,22,47,30,28,52,72,17,56,80,26,64,21,10,35,24,42,96,32,23,50,92,37,76,94,63,66], +[20,47,96,34,10,98,19,6,29,2,19,92,61,94,38,41,32,9,5,94,31,58,27,41,72,85,61,62,40,46], +[69,26,35,68,25,52,94,13,38,65,81,10,29,15,5,4,13,99,85,0,80,51,60,60,26,77,85,2,87,25], +[99,58,69,15,52,12,18,7,27,56,12,54,21,92,38,95,33,83,28,1,44,8,29,84,92,12,2,25,46,46], +[93,13,55,48,35,87,24,40,23,35,25,32,0,19,0,85,4,79,26,11,46,75,7,96,76,11,7,57,99,75], +[128,85,26,51,161,173,77,78,85,103,123,58,91,147,38,91,161,36,123,81,102,25,75,59,17,150,112,65,77,143], +[15,59,61,82,12,83,34,8,94,71,66,7,91,21,48,69,26,12,64,38,97,87,38,15,51,33,93,43,66,89], +[74,74,53,39,69,90,41,80,32,66,40,83,87,87,61,38,12,80,24,49,37,90,19,33,56,0,46,57,56,60], +[82,11,0,25,56,58,39,49,92,93,80,38,19,62,33,85,19,61,14,30,45,91,97,34,97,53,92,28,33,43], +[83,79,41,16,95,35,53,45,26,4,71,76,61,69,69,72,87,92,59,72,54,11,22,83,8,57,77,55,19,22], +[49,34,13,31,72,77,52,70,46,41,37,6,42,66,35,6,75,33,62,57,30,14,26,31,9,95,89,13,12,90], +[29,3,49,30,51,32,77,41,38,50,16,1,87,81,93,88,58,91,83,0,38,67,29,64,60,84,5,60,23,28], +[79,51,13,20,89,96,25,8,39,62,86,52,49,81,3,85,86,3,61,24,72,11,49,28,8,55,23,52,65,53], +[96,86,73,20,41,20,37,18,10,61,85,24,40,83,69,41,4,92,23,99,64,33,18,36,32,56,60,98,39,24], +[32,62,47,80,51,66,17,1,9,30,65,75,75,88,99,92,64,53,53,86,38,51,41,14,35,18,39,25,26,32], +[39,21,8,16,33,6,35,85,75,62,43,34,18,68,71,28,32,18,12,0,81,53,1,99,3,5,45,99,35,33], +[19,95,89,45,75,94,92,5,84,93,34,17,50,56,79,98,68,82,65,81,51,90,5,95,33,71,46,61,14,7], +[53,92,8,49,67,84,21,79,49,95,66,48,36,14,62,97,26,45,58,31,83,48,11,89,67,72,91,34,56,89], +[56,76,99,92,40,8,0,16,15,48,35,72,91,46,81,14,86,60,51,7,33,12,53,78,48,21,3,89,15,79], +[81,43,33,49,6,49,36,32,57,74,87,91,17,37,31,17,67,1,40,38,69,8,3,48,59,37,64,97,11,3], +[98,48,77,16,2,48,57,38,63,59,79,35,16,71,60,86,71,41,14,76,80,97,77,69,4,58,22,55,26,73], +[80,47,78,44,31,48,47,29,29,62,19,21,17,24,19,3,53,93,97,57,13,54,12,10,77,66,60,75,32,21], +[86,63,2,13,71,38,86,23,18,15,91,65,77,65,9,92,50,0,17,42,99,80,99,27,10,99,92,9,87,84], +[66,27,72,13,13,15,72,75,39,3,14,71,15,68,10,19,49,54,11,29,47,20,63,13,97,47,24,62,16,96], +[42,63,83,60,49,68,9,53,75,87,40,25,12,63,0,12,0,95,46,46,55,25,89,1,51,1,1,96,80,52], +[35,9,97,13,86,39,66,48,41,57,23,38,11,9,35,72,88,13,41,60,10,64,71,23,1,5,23,57,6,19], +[70,61,5,50,72,60,77,13,41,94,1,45,52,22,99,47,27,18,99,42,16,48,26,9,88,77,10,94,11,92], +[55,68,58,2,72,56,81,52,79,37,1,40,21,46,27,60,37,13,97,42,85,98,69,60,76,44,42,46,29,73], +[73,0,43,17,89,97,45,2,68,14,55,60,95,2,74,85,88,68,93,76,38,76,2,51,45,76,50,79,56,18], +[72,58,41,39,24,80,23,79,44,7,98,75,30,6,85,60,20,58,77,71,90,51,38,80,30,15,33,10,82,8]], + ZZ), + Matrix([ + [eye(29) * 2028539767964472550625641331179545072876560857886207583101, + Matrix([ 4260575808093245475167216057435155595594339172099000182569, + 169148395880755256182802335904188369274227936894862744452, + 4915975976683942569102447281579134986891620721539038348914, + 6113916866367364958834844982578214901958429746875633283248, + 5585689617819894460378537031623265659753379011388162534838, + 359776822829880747716695359574308645968094838905181892423, + -2800926112141776386671436511182421432449325232461665113305, + 941642292388230001722444876624818265766384442910688463158, + 3648811843256146649321864698600908938933015862008642023935, + -4104526163246702252932955226754097174212129127510547462419, + -704814955438106792441896903238080197619233342348191408078, + 1640882266829725529929398131287244562048075707575030019335, + -4068330845192910563212155694231438198040299927120544468520, + 136589038308366497790495711534532612862715724187671166593, + 2544937011460702462290799932536905731142196510605191645593, + 755591839174293940486133926192300657264122907519174116472, + -3683838489869297144348089243628436188645897133242795965021, + -522207137101161299969706310062775465103537953077871128403, + -2260451796032703984456606059649402832441331339246756656334, + -6476809325293587953616004856993300606040336446656916663680, + 3521944238996782387785653800944972787867472610035040989081, + 2270762115788407950241944504104975551914297395787473242379, + -3259947194628712441902262570532921252128444706733549251156, + -5624569821491886970999097239695637132075823246850431083557, + -3262698255682055804320585332902837076064075936601504555698, + 5786719943788937667411185880136324396357603606944869545501, + -955257841973865996077323863289453200904051299086000660036, + -1294235552446355326174641248209752679127075717918392702116, + -3718353510747301598130831152458342785269166356215331448279, + ]),], + [zeros(1, 29), zeros(1, 1)], + ]).to_DM().to_dense(), + ZZ(2028539767964472550625641331179545072876560857886207583101), + ), + + + ( + 'qq_1', + DM([[(1,2), 0], [0, 2]], QQ), + DM([[1, 0], [0, 1]], QQ), + QQ(1), + ), + + ( + # Standard square case + 'qq_2', + DM([[0, 1], + [1, 1]], QQ), + DM([[1, 0], + [0, 1]], QQ), + QQ(1), + ), + + ( + # m < n case + 'qq_3', + DM([[1, 2, 1], + [3, 4, 1]], QQ), + DM([[1, 0, -1], + [0, 1, 1]], QQ), + QQ(1), + ), + + ( + # same m < n but reversed + 'qq_4', + DM([[3, 4, 1], + [1, 2, 1]], QQ), + DM([[1, 0, -1], + [0, 1, 1]], QQ), + QQ(1), + ), + + ( + # m > n case + 'qq_5', + DM([[1, 0], + [1, 3], + [0, 1]], QQ), + DM([[1, 0], + [0, 1], + [0, 0]], QQ), + QQ(1), + ), + + ( + # Example with missing pivot + 'qq_6', + DM([[1, 0, 1], + [3, 0, 1]], QQ), + DM([[1, 0, 0], + [0, 0, 1]], QQ), + QQ(1), + ), + + ( + # This is intended to trigger the threshold where we give up on + # clearing denominators. + 'qq_large_1', + qq_large_1, + DomainMatrix.eye(11, QQ).to_dense(), + QQ(1), + ), + + ( + # This is intended to trigger the threshold where we use rref_den over + # QQ. + 'qq_large_2', + qq_large_2, + DomainMatrix.eye(11, QQ).to_dense(), + QQ(1), + ), + + ( + # Example with missing pivot and no replacement + + # This example is just enough to show a different result from the dense + # and sparse versions of the algorithm: + # + # >>> A = Matrix([[0, 1], [0, 2], [1, 0]]) + # >>> A.to_DM().to_sparse().rref_den()[0].to_Matrix() + # Matrix([ + # [1, 0], + # [0, 1], + # [0, 0]]) + # >>> A.to_DM().to_dense().rref_den()[0].to_Matrix() + # Matrix([ + # [2, 0], + # [0, 2], + # [0, 0]]) + # + 'qq_7', + DM([[0, 1], + [0, 2], + [1, 0]], QQ), + DM([[1, 0], + [0, 1], + [0, 0]], QQ), + QQ(1), + ), + + ( + # Gaussian integers + 'zz_i_1', + DM([[(0,1), 1, 1], + [ 1, 1, 1]], ZZ_I), + DM([[1, 0, 0], + [0, 1, 1]], ZZ_I), + ZZ_I(1), + ), + + ( + # EX: test_issue_23718 + 'EX_1', + DM([ + [a, b, 1], + [c, d, 1]], EX), + DM([[a*d - b*c, 0, -b + d], + [ 0, a*d - b*c, a - c]], EX), + EX(a*d - b*c), + ), + +] + + +def _to_DM(A, ans): + """Convert the answer to DomainMatrix.""" + if isinstance(A, DomainMatrix): + return A.to_dense() + elif isinstance(A, Matrix): + return A.to_DM(ans.domain).to_dense() + + if not (hasattr(A, 'shape') and hasattr(A, 'domain')): + shape, domain = ans.shape, ans.domain + else: + shape, domain = A.shape, A.domain + + if isinstance(A, (DDM, list)): + return DomainMatrix(list(A), shape, domain).to_dense() + elif isinstance(A, (SDM, dict)): + return DomainMatrix(dict(A), shape, domain).to_dense() + else: + assert False # pragma: no cover + + +def _pivots(A_rref): + """Return the pivots from the rref of A.""" + return tuple(sorted(map(min, A_rref.to_sdm().values()))) + + +def _check_cancel(result, rref_ans, den_ans): + """Check the cancelled result.""" + rref, den, pivots = result + if isinstance(rref, (DDM, SDM, list, dict)): + assert type(pivots) is list + pivots = tuple(pivots) + rref = _to_DM(rref, rref_ans) + rref2, den2 = rref.cancel_denom(den) + assert rref2 == rref_ans + assert den2 == den_ans + assert pivots == _pivots(rref) + + +def _check_divide(result, rref_ans, den_ans): + """Check the divided result.""" + rref, pivots = result + if isinstance(rref, (DDM, SDM, list, dict)): + assert type(pivots) is list + pivots = tuple(pivots) + rref_ans = rref_ans.to_field() / den_ans + rref = _to_DM(rref, rref_ans) + assert rref == rref_ans + assert _pivots(rref) == pivots + + +@pytest.mark.parametrize('name, A, A_rref, den', RREF_EXAMPLES) +def test_Matrix_rref(name, A, A_rref, den): + K = A.domain + A = A.to_Matrix() + A_rref_found, pivots = A.rref() + if K.is_EX: + A_rref_found = A_rref_found.expand() + _check_divide((A_rref_found, pivots), A_rref, den) + + +@pytest.mark.parametrize('name, A, A_rref, den', RREF_EXAMPLES) +def test_dm_dense_rref(name, A, A_rref, den): + A = A.to_field() + _check_divide(A.rref(), A_rref, den) + + +@pytest.mark.parametrize('name, A, A_rref, den', RREF_EXAMPLES) +def test_dm_dense_rref_den(name, A, A_rref, den): + _check_cancel(A.rref_den(), A_rref, den) + + +@pytest.mark.parametrize('name, A, A_rref, den', RREF_EXAMPLES) +def test_dm_sparse_rref(name, A, A_rref, den): + A = A.to_field().to_sparse() + _check_divide(A.rref(), A_rref, den) + + +@pytest.mark.parametrize('name, A, A_rref, den', RREF_EXAMPLES) +def test_dm_sparse_rref_den(name, A, A_rref, den): + A = A.to_sparse() + _check_cancel(A.rref_den(), A_rref, den) + + +@pytest.mark.parametrize('name, A, A_rref, den', RREF_EXAMPLES) +def test_dm_sparse_rref_den_keep_domain(name, A, A_rref, den): + A = A.to_sparse() + A_rref_f, den_f, pivots_f = A.rref_den(keep_domain=False) + A_rref_f = A_rref_f.to_field() / den_f + _check_divide((A_rref_f, pivots_f), A_rref, den) + + +@pytest.mark.parametrize('name, A, A_rref, den', RREF_EXAMPLES) +def test_dm_sparse_rref_den_keep_domain_CD(name, A, A_rref, den): + A = A.to_sparse() + A_rref_f, den_f, pivots_f = A.rref_den(keep_domain=False, method='CD') + A_rref_f = A_rref_f.to_field() / den_f + _check_divide((A_rref_f, pivots_f), A_rref, den) + + +@pytest.mark.parametrize('name, A, A_rref, den', RREF_EXAMPLES) +def test_dm_sparse_rref_den_keep_domain_GJ(name, A, A_rref, den): + A = A.to_sparse() + A_rref_f, den_f, pivots_f = A.rref_den(keep_domain=False, method='GJ') + A_rref_f = A_rref_f.to_field() / den_f + _check_divide((A_rref_f, pivots_f), A_rref, den) + + +@pytest.mark.parametrize('name, A, A_rref, den', RREF_EXAMPLES) +def test_ddm_rref_den(name, A, A_rref, den): + A = A.to_ddm() + _check_cancel(A.rref_den(), A_rref, den) + + +@pytest.mark.parametrize('name, A, A_rref, den', RREF_EXAMPLES) +def test_sdm_rref_den(name, A, A_rref, den): + A = A.to_sdm() + _check_cancel(A.rref_den(), A_rref, den) + + +@pytest.mark.parametrize('name, A, A_rref, den', RREF_EXAMPLES) +def test_ddm_rref(name, A, A_rref, den): + A = A.to_field().to_ddm() + _check_divide(A.rref(), A_rref, den) + + +@pytest.mark.parametrize('name, A, A_rref, den', RREF_EXAMPLES) +def test_sdm_rref(name, A, A_rref, den): + A = A.to_field().to_sdm() + _check_divide(A.rref(), A_rref, den) + + +@pytest.mark.parametrize('name, A, A_rref, den', RREF_EXAMPLES) +def test_ddm_irref(name, A, A_rref, den): + A = A.to_field().to_ddm().copy() + pivots_found = ddm_irref(A) + _check_divide((A, pivots_found), A_rref, den) + + +@pytest.mark.parametrize('name, A, A_rref, den', RREF_EXAMPLES) +def test_ddm_irref_den(name, A, A_rref, den): + A = A.to_ddm().copy() + (den_found, pivots_found) = ddm_irref_den(A, A.domain) + result = (A, den_found, pivots_found) + _check_cancel(result, A_rref, den) + + +@pytest.mark.parametrize('name, A, A_rref, den', RREF_EXAMPLES) +def test_sparse_sdm_rref(name, A, A_rref, den): + A = A.to_field().to_sdm() + _check_divide(sdm_irref(A)[:2], A_rref, den) + + +@pytest.mark.parametrize('name, A, A_rref, den', RREF_EXAMPLES) +def test_sparse_sdm_rref_den(name, A, A_rref, den): + A = A.to_sdm().copy() + K = A.domain + _check_cancel(sdm_rref_den(A, K), A_rref, den) diff --git a/llava_next/lib/python3.10/site-packages/sympy/polys/matrices/tests/test_xxm.py b/llava_next/lib/python3.10/site-packages/sympy/polys/matrices/tests/test_xxm.py new file mode 100644 index 0000000000000000000000000000000000000000..96a660123aa232107258a6f0e0a3e24a0bba07b4 --- /dev/null +++ b/llava_next/lib/python3.10/site-packages/sympy/polys/matrices/tests/test_xxm.py @@ -0,0 +1,864 @@ +# +# Test basic features of DDM, SDM and DFM. +# +# These three types are supposed to be interchangeable, so we should use the +# same tests for all of them for the most part. +# +# The tests here cover the basic part of the inerface that the three types +# should expose and that DomainMatrix should mostly rely on. +# +# More in-depth tests of the heavier algorithms like rref etc should go in +# their own test files. +# +# Any new methods added to the DDM, SDM or DFM classes should be tested here +# and added to all classes. +# + +from sympy.external.gmpy import GROUND_TYPES + +from sympy import ZZ, QQ, GF, ZZ_I, symbols + +from sympy.polys.matrices.exceptions import ( + DMBadInputError, + DMDomainError, + DMNonSquareMatrixError, + DMNonInvertibleMatrixError, + DMShapeError, +) + +from sympy.polys.matrices.domainmatrix import DM, DomainMatrix, DDM, SDM, DFM + +from sympy.testing.pytest import raises, skip +import pytest + + +def test_XXM_constructors(): + """Test the DDM, etc constructors.""" + + lol = [ + [ZZ(1), ZZ(2)], + [ZZ(3), ZZ(4)], + [ZZ(5), ZZ(6)], + ] + dod = { + 0: {0: ZZ(1), 1: ZZ(2)}, + 1: {0: ZZ(3), 1: ZZ(4)}, + 2: {0: ZZ(5), 1: ZZ(6)}, + } + + lol_0x0 = [] + lol_0x2 = [] + lol_2x0 = [[], []] + dod_0x0 = {} + dod_0x2 = {} + dod_2x0 = {} + + lol_bad = [ + [ZZ(1), ZZ(2)], + [ZZ(3), ZZ(4)], + [ZZ(5), ZZ(6), ZZ(7)], + ] + dod_bad = { + 0: {0: ZZ(1), 1: ZZ(2)}, + 1: {0: ZZ(3), 1: ZZ(4)}, + 2: {0: ZZ(5), 1: ZZ(6), 2: ZZ(7)}, + } + + XDM_dense = [DDM] + XDM_sparse = [SDM] + + if GROUND_TYPES == 'flint': + XDM_dense.append(DFM) + + for XDM in XDM_dense: + + A = XDM(lol, (3, 2), ZZ) + assert A.rows == 3 + assert A.cols == 2 + assert A.domain == ZZ + assert A.shape == (3, 2) + if XDM is not DFM: + assert ZZ.of_type(A[0][0]) is True + else: + assert ZZ.of_type(A.rep[0, 0]) is True + + Adm = DomainMatrix(lol, (3, 2), ZZ) + if XDM is DFM: + assert Adm.rep == A + assert Adm.rep.to_ddm() != A + elif GROUND_TYPES == 'flint': + assert Adm.rep.to_ddm() == A + assert Adm.rep != A + else: + assert Adm.rep == A + assert Adm.rep.to_ddm() == A + + assert XDM(lol_0x0, (0, 0), ZZ).shape == (0, 0) + assert XDM(lol_0x2, (0, 2), ZZ).shape == (0, 2) + assert XDM(lol_2x0, (2, 0), ZZ).shape == (2, 0) + raises(DMBadInputError, lambda: XDM(lol, (2, 3), ZZ)) + raises(DMBadInputError, lambda: XDM(lol_bad, (3, 2), ZZ)) + raises(DMBadInputError, lambda: XDM(dod, (3, 2), ZZ)) + + for XDM in XDM_sparse: + + A = XDM(dod, (3, 2), ZZ) + assert A.rows == 3 + assert A.cols == 2 + assert A.domain == ZZ + assert A.shape == (3, 2) + assert ZZ.of_type(A[0][0]) is True + + assert DomainMatrix(dod, (3, 2), ZZ).rep == A + + assert XDM(dod_0x0, (0, 0), ZZ).shape == (0, 0) + assert XDM(dod_0x2, (0, 2), ZZ).shape == (0, 2) + assert XDM(dod_2x0, (2, 0), ZZ).shape == (2, 0) + raises(DMBadInputError, lambda: XDM(dod, (2, 3), ZZ)) + raises(DMBadInputError, lambda: XDM(lol, (3, 2), ZZ)) + raises(DMBadInputError, lambda: XDM(dod_bad, (3, 2), ZZ)) + + raises(DMBadInputError, lambda: DomainMatrix(lol, (2, 3), ZZ)) + raises(DMBadInputError, lambda: DomainMatrix(lol_bad, (3, 2), ZZ)) + raises(DMBadInputError, lambda: DomainMatrix(dod_bad, (3, 2), ZZ)) + + +def test_XXM_eq(): + """Test equality for DDM, SDM, DFM and DomainMatrix.""" + + lol1 = [[ZZ(1), ZZ(2)], [ZZ(3), ZZ(4)]] + dod1 = {0: {0: ZZ(1), 1: ZZ(2)}, 1: {0: ZZ(3), 1: ZZ(4)}} + + lol2 = [[ZZ(1), ZZ(2)], [ZZ(3), ZZ(5)]] + dod2 = {0: {0: ZZ(1), 1: ZZ(2)}, 1: {0: ZZ(3), 1: ZZ(5)}} + + A1_ddm = DDM(lol1, (2, 2), ZZ) + A1_sdm = SDM(dod1, (2, 2), ZZ) + A1_dm_d = DomainMatrix(lol1, (2, 2), ZZ) + A1_dm_s = DomainMatrix(dod1, (2, 2), ZZ) + + A2_ddm = DDM(lol2, (2, 2), ZZ) + A2_sdm = SDM(dod2, (2, 2), ZZ) + A2_dm_d = DomainMatrix(lol2, (2, 2), ZZ) + A2_dm_s = DomainMatrix(dod2, (2, 2), ZZ) + + A1_all = [A1_ddm, A1_sdm, A1_dm_d, A1_dm_s] + A2_all = [A2_ddm, A2_sdm, A2_dm_d, A2_dm_s] + + if GROUND_TYPES == 'flint': + + A1_dfm = DFM([[1, 2], [3, 4]], (2, 2), ZZ) + A2_dfm = DFM([[1, 2], [3, 5]], (2, 2), ZZ) + + A1_all.append(A1_dfm) + A2_all.append(A2_dfm) + + for n, An in enumerate(A1_all): + for m, Am in enumerate(A1_all): + if n == m: + assert (An == Am) is True + assert (An != Am) is False + else: + assert (An == Am) is False + assert (An != Am) is True + + for n, An in enumerate(A2_all): + for m, Am in enumerate(A2_all): + if n == m: + assert (An == Am) is True + assert (An != Am) is False + else: + assert (An == Am) is False + assert (An != Am) is True + + for n, A1 in enumerate(A1_all): + for m, A2 in enumerate(A2_all): + assert (A1 == A2) is False + assert (A1 != A2) is True + + +def test_to_XXM(): + """Test to_ddm etc. for DDM, SDM, DFM and DomainMatrix.""" + + lol = [[ZZ(1), ZZ(2)], [ZZ(3), ZZ(4)]] + dod = {0: {0: ZZ(1), 1: ZZ(2)}, 1: {0: ZZ(3), 1: ZZ(4)}} + + A_ddm = DDM(lol, (2, 2), ZZ) + A_sdm = SDM(dod, (2, 2), ZZ) + A_dm_d = DomainMatrix(lol, (2, 2), ZZ) + A_dm_s = DomainMatrix(dod, (2, 2), ZZ) + + A_all = [A_ddm, A_sdm, A_dm_d, A_dm_s] + + if GROUND_TYPES == 'flint': + A_dfm = DFM(lol, (2, 2), ZZ) + A_all.append(A_dfm) + + for A in A_all: + assert A.to_ddm() == A_ddm + assert A.to_sdm() == A_sdm + if GROUND_TYPES != 'flint': + raises(NotImplementedError, lambda: A.to_dfm()) + assert A.to_dfm_or_ddm() == A_ddm + + # Add e.g. DDM.to_DM()? + # assert A.to_DM() == A_dm + + if GROUND_TYPES == 'flint': + for A in A_all: + assert A.to_dfm() == A_dfm + for K in [ZZ, QQ, GF(5), ZZ_I]: + if isinstance(A, DFM) and not DFM._supports_domain(K): + raises(NotImplementedError, lambda: A.convert_to(K)) + else: + A_K = A.convert_to(K) + if DFM._supports_domain(K): + A_dfm_K = A_dfm.convert_to(K) + assert A_K.to_dfm() == A_dfm_K + assert A_K.to_dfm_or_ddm() == A_dfm_K + else: + raises(NotImplementedError, lambda: A_K.to_dfm()) + assert A_K.to_dfm_or_ddm() == A_ddm.convert_to(K) + + +def test_DFM_domains(): + """Test which domains are supported by DFM.""" + + x, y = symbols('x, y') + + if GROUND_TYPES in ('python', 'gmpy'): + + supported = [] + flint_funcs = {} + not_supported = [ZZ, QQ, GF(5), QQ[x], QQ[x,y]] + + elif GROUND_TYPES == 'flint': + + import flint + supported = [ZZ, QQ] + flint_funcs = { + ZZ: flint.fmpz_mat, + QQ: flint.fmpq_mat, + } + not_supported = [ + # This could be supported but not yet implemented in SymPy: + GF(5), + # Other domains could be supported but not implemented as matrices + # in python-flint: + QQ[x], + QQ[x,y], + QQ.frac_field(x,y), + # Others would potentially never be supported by python-flint: + ZZ_I, + ] + + else: + assert False, "Unknown GROUND_TYPES: %s" % GROUND_TYPES + + for domain in supported: + assert DFM._supports_domain(domain) is True + assert DFM._get_flint_func(domain) == flint_funcs[domain] + for domain in not_supported: + assert DFM._supports_domain(domain) is False + raises(NotImplementedError, lambda: DFM._get_flint_func(domain)) + + +def _DM(lol, typ, K): + """Make a DM of type typ over K from lol.""" + A = DM(lol, K) + + if typ == 'DDM': + return A.to_ddm() + elif typ == 'SDM': + return A.to_sdm() + elif typ == 'DFM': + if GROUND_TYPES != 'flint': + skip("DFM not supported in this ground type") + return A.to_dfm() + else: + assert False, "Unknown type %s" % typ + + +def _DMZ(lol, typ): + """Make a DM of type typ over ZZ from lol.""" + return _DM(lol, typ, ZZ) + + +def _DMQ(lol, typ): + """Make a DM of type typ over QQ from lol.""" + return _DM(lol, typ, QQ) + + +def DM_ddm(lol, K): + """Make a DDM over K from lol.""" + return _DM(lol, 'DDM', K) + + +def DM_sdm(lol, K): + """Make a SDM over K from lol.""" + return _DM(lol, 'SDM', K) + + +def DM_dfm(lol, K): + """Make a DFM over K from lol.""" + return _DM(lol, 'DFM', K) + + +def DMZ_ddm(lol): + """Make a DDM from lol.""" + return _DMZ(lol, 'DDM') + + +def DMZ_sdm(lol): + """Make a SDM from lol.""" + return _DMZ(lol, 'SDM') + + +def DMZ_dfm(lol): + """Make a DFM from lol.""" + return _DMZ(lol, 'DFM') + + +def DMQ_ddm(lol): + """Make a DDM from lol.""" + return _DMQ(lol, 'DDM') + + +def DMQ_sdm(lol): + """Make a SDM from lol.""" + return _DMQ(lol, 'SDM') + + +def DMQ_dfm(lol): + """Make a DFM from lol.""" + return _DMQ(lol, 'DFM') + + +DM_all = [DM_ddm, DM_sdm, DM_dfm] +DMZ_all = [DMZ_ddm, DMZ_sdm, DMZ_dfm] +DMQ_all = [DMQ_ddm, DMQ_sdm, DMQ_dfm] + + +@pytest.mark.parametrize('DM', DMZ_all) +def test_XDM_getitem(DM): + """Test getitem for DDM, etc.""" + + lol = [[0, 1], [2, 0]] + A = DM(lol) + m, n = A.shape + + indices = [-3, -2, -1, 0, 1, 2] + + for i in indices: + for j in indices: + if -2 <= i < m and -2 <= j < n: + assert A.getitem(i, j) == ZZ(lol[i][j]) + else: + raises(IndexError, lambda: A.getitem(i, j)) + + +@pytest.mark.parametrize('DM', DMZ_all) +def test_XDM_setitem(DM): + """Test setitem for DDM, etc.""" + + A = DM([[0, 1, 2], [3, 4, 5]]) + + A.setitem(0, 0, ZZ(6)) + assert A == DM([[6, 1, 2], [3, 4, 5]]) + + A.setitem(0, 1, ZZ(7)) + assert A == DM([[6, 7, 2], [3, 4, 5]]) + + A.setitem(0, 2, ZZ(8)) + assert A == DM([[6, 7, 8], [3, 4, 5]]) + + A.setitem(0, -1, ZZ(9)) + assert A == DM([[6, 7, 9], [3, 4, 5]]) + + A.setitem(0, -2, ZZ(10)) + assert A == DM([[6, 10, 9], [3, 4, 5]]) + + A.setitem(0, -3, ZZ(11)) + assert A == DM([[11, 10, 9], [3, 4, 5]]) + + raises(IndexError, lambda: A.setitem(0, 3, ZZ(12))) + raises(IndexError, lambda: A.setitem(0, -4, ZZ(13))) + + A.setitem(1, 0, ZZ(14)) + assert A == DM([[11, 10, 9], [14, 4, 5]]) + + A.setitem(1, 1, ZZ(15)) + assert A == DM([[11, 10, 9], [14, 15, 5]]) + + A.setitem(-1, 1, ZZ(16)) + assert A == DM([[11, 10, 9], [14, 16, 5]]) + + A.setitem(-2, 1, ZZ(17)) + assert A == DM([[11, 17, 9], [14, 16, 5]]) + + raises(IndexError, lambda: A.setitem(2, 0, ZZ(18))) + raises(IndexError, lambda: A.setitem(-3, 0, ZZ(19))) + + A.setitem(1, 2, ZZ(0)) + assert A == DM([[11, 17, 9], [14, 16, 0]]) + + A.setitem(1, -2, ZZ(0)) + assert A == DM([[11, 17, 9], [14, 0, 0]]) + + A.setitem(1, -3, ZZ(0)) + assert A == DM([[11, 17, 9], [0, 0, 0]]) + + A.setitem(0, 0, ZZ(0)) + assert A == DM([[0, 17, 9], [0, 0, 0]]) + + A.setitem(0, -1, ZZ(0)) + assert A == DM([[0, 17, 0], [0, 0, 0]]) + + A.setitem(0, 0, ZZ(0)) + assert A == DM([[0, 17, 0], [0, 0, 0]]) + + A.setitem(0, -2, ZZ(0)) + assert A == DM([[0, 0, 0], [0, 0, 0]]) + + A.setitem(0, -3, ZZ(1)) + assert A == DM([[1, 0, 0], [0, 0, 0]]) + + +class _Sliced: + def __getitem__(self, item): + return item + + +_slice = _Sliced() + + +@pytest.mark.parametrize('DM', DMZ_all) +def test_XXM_extract_slice(DM): + A = DM([[1, 2, 3], [4, 5, 6], [7, 8, 9]]) + assert A.extract_slice(*_slice[:,:]) == A + assert A.extract_slice(*_slice[1:,:]) == DM([[4, 5, 6], [7, 8, 9]]) + assert A.extract_slice(*_slice[1:,1:]) == DM([[5, 6], [8, 9]]) + assert A.extract_slice(*_slice[1:,:-1]) == DM([[4, 5], [7, 8]]) + assert A.extract_slice(*_slice[1:,:-1:2]) == DM([[4], [7]]) + assert A.extract_slice(*_slice[:,::2]) == DM([[1, 3], [4, 6], [7, 9]]) + assert A.extract_slice(*_slice[::2,:]) == DM([[1, 2, 3], [7, 8, 9]]) + assert A.extract_slice(*_slice[::2,::2]) == DM([[1, 3], [7, 9]]) + assert A.extract_slice(*_slice[::2,::-2]) == DM([[3, 1], [9, 7]]) + assert A.extract_slice(*_slice[::-2,::2]) == DM([[7, 9], [1, 3]]) + assert A.extract_slice(*_slice[::-2,::-2]) == DM([[9, 7], [3, 1]]) + assert A.extract_slice(*_slice[:,::-1]) == DM([[3, 2, 1], [6, 5, 4], [9, 8, 7]]) + assert A.extract_slice(*_slice[::-1,:]) == DM([[7, 8, 9], [4, 5, 6], [1, 2, 3]]) + + +@pytest.mark.parametrize('DM', DMZ_all) +def test_XXM_extract(DM): + + A = DM([[1, 2, 3], [4, 5, 6], [7, 8, 9]]) + + assert A.extract([0, 1, 2], [0, 1, 2]) == A + assert A.extract([1, 2], [1, 2]) == DM([[5, 6], [8, 9]]) + assert A.extract([1, 2], [0, 1]) == DM([[4, 5], [7, 8]]) + assert A.extract([1, 2], [0, 2]) == DM([[4, 6], [7, 9]]) + assert A.extract([1, 2], [0]) == DM([[4], [7]]) + assert A.extract([1, 2], []) == DM([[1]]).zeros((2, 0), ZZ) + assert A.extract([], [0, 1, 2]) == DM([[1]]).zeros((0, 3), ZZ) + + raises(IndexError, lambda: A.extract([1, 2], [0, 3])) + raises(IndexError, lambda: A.extract([1, 2], [0, -4])) + raises(IndexError, lambda: A.extract([3, 1], [0, 1])) + raises(IndexError, lambda: A.extract([-4, 2], [3, 1])) + + B = DM([[0, 0, 0], [0, 0, 0], [0, 0, 0]]) + assert B.extract([1, 2], [1, 2]) == DM([[0, 0], [0, 0]]) + + +def test_XXM_str(): + + A = DomainMatrix([[1, 2, 3], [4, 5, 6], [7, 8, 9]], (3, 3), ZZ) + + assert str(A) == \ + 'DomainMatrix([[1, 2, 3], [4, 5, 6], [7, 8, 9]], (3, 3), ZZ)' + assert str(A.to_ddm()) == \ + '[[1, 2, 3], [4, 5, 6], [7, 8, 9]]' + assert str(A.to_sdm()) == \ + '{0: {0: 1, 1: 2, 2: 3}, 1: {0: 4, 1: 5, 2: 6}, 2: {0: 7, 1: 8, 2: 9}}' + + assert repr(A) == \ + 'DomainMatrix([[1, 2, 3], [4, 5, 6], [7, 8, 9]], (3, 3), ZZ)' + assert repr(A.to_ddm()) == \ + 'DDM([[1, 2, 3], [4, 5, 6], [7, 8, 9]], (3, 3), ZZ)' + assert repr(A.to_sdm()) == \ + 'SDM({0: {0: 1, 1: 2, 2: 3}, 1: {0: 4, 1: 5, 2: 6}, 2: {0: 7, 1: 8, 2: 9}}, (3, 3), ZZ)' + + B = DomainMatrix({0: {0: ZZ(1), 1: ZZ(2)}, 1: {0: ZZ(3)}}, (2, 2), ZZ) + + assert str(B) == \ + 'DomainMatrix({0: {0: 1, 1: 2}, 1: {0: 3}}, (2, 2), ZZ)' + assert str(B.to_ddm()) == \ + '[[1, 2], [3, 0]]' + assert str(B.to_sdm()) == \ + '{0: {0: 1, 1: 2}, 1: {0: 3}}' + + assert repr(B) == \ + 'DomainMatrix({0: {0: 1, 1: 2}, 1: {0: 3}}, (2, 2), ZZ)' + + if GROUND_TYPES != 'gmpy': + assert repr(B.to_ddm()) == \ + 'DDM([[1, 2], [3, 0]], (2, 2), ZZ)' + assert repr(B.to_sdm()) == \ + 'SDM({0: {0: 1, 1: 2}, 1: {0: 3}}, (2, 2), ZZ)' + else: + assert repr(B.to_ddm()) == \ + 'DDM([[mpz(1), mpz(2)], [mpz(3), mpz(0)]], (2, 2), ZZ)' + assert repr(B.to_sdm()) == \ + 'SDM({0: {0: mpz(1), 1: mpz(2)}, 1: {0: mpz(3)}}, (2, 2), ZZ)' + + if GROUND_TYPES == 'flint': + + assert str(A.to_dfm()) == \ + '[[1, 2, 3], [4, 5, 6], [7, 8, 9]]' + assert str(B.to_dfm()) == \ + '[[1, 2], [3, 0]]' + + assert repr(A.to_dfm()) == \ + 'DFM([[1, 2, 3], [4, 5, 6], [7, 8, 9]], (3, 3), ZZ)' + assert repr(B.to_dfm()) == \ + 'DFM([[1, 2], [3, 0]], (2, 2), ZZ)' + + +@pytest.mark.parametrize('DM', DMZ_all) +def test_XXM_from_list(DM): + T = type(DM([[0]])) + + lol = [[1, 2, 4], [4, 5, 6]] + lol_ZZ = [[ZZ(1), ZZ(2), ZZ(4)], [ZZ(4), ZZ(5), ZZ(6)]] + lol_ZZ_bad = [[ZZ(1), ZZ(2), ZZ(4)], [ZZ(4), ZZ(5), ZZ(6), ZZ(7)]] + + assert T.from_list(lol_ZZ, (2, 3), ZZ) == DM(lol) + raises(DMBadInputError, lambda: T.from_list(lol_ZZ_bad, (3, 2), ZZ)) + + +@pytest.mark.parametrize('DM', DMZ_all) +def test_XXM_to_list(DM): + lol = [[1, 2, 4], [4, 5, 6]] + assert DM(lol).to_list() == [[ZZ(1), ZZ(2), ZZ(4)], [ZZ(4), ZZ(5), ZZ(6)]] + + +@pytest.mark.parametrize('DM', DMZ_all) +def test_XXM_to_list_flat(DM): + lol = [[1, 2, 4], [4, 5, 6]] + assert DM(lol).to_list_flat() == [ZZ(1), ZZ(2), ZZ(4), ZZ(4), ZZ(5), ZZ(6)] + + +@pytest.mark.parametrize('DM', DMZ_all) +def test_XXM_from_list_flat(DM): + T = type(DM([[0]])) + flat = [ZZ(1), ZZ(2), ZZ(4), ZZ(4), ZZ(5), ZZ(6)] + assert T.from_list_flat(flat, (2, 3), ZZ) == DM([[1, 2, 4], [4, 5, 6]]) + raises(DMBadInputError, lambda: T.from_list_flat(flat, (3, 3), ZZ)) + + +@pytest.mark.parametrize('DM', DMZ_all) +def test_XXM_to_flat_nz(DM): + M = DM([[1, 2, 0], [0, 0, 0], [0, 0, 3]]) + elements = [ZZ(1), ZZ(2), ZZ(3)] + indices = ((0, 0), (0, 1), (2, 2)) + assert M.to_flat_nz() == (elements, (indices, M.shape)) + + +@pytest.mark.parametrize('DM', DMZ_all) +def test_XXM_from_flat_nz(DM): + T = type(DM([[0]])) + elements = [ZZ(1), ZZ(2), ZZ(3)] + indices = ((0, 0), (0, 1), (2, 2)) + data = (indices, (3, 3)) + result = DM([[1, 2, 0], [0, 0, 0], [0, 0, 3]]) + assert T.from_flat_nz(elements, data, ZZ) == result + raises(DMBadInputError, lambda: T.from_flat_nz(elements, (indices, (2, 3)), ZZ)) + + +@pytest.mark.parametrize('DM', DMZ_all) +def test_XXM_to_dod(DM): + dod = {0: {0: ZZ(1), 2: ZZ(4)}, 1: {0: ZZ(4), 1: ZZ(5), 2: ZZ(6)}} + assert DM([[1, 0, 4], [4, 5, 6]]).to_dod() == dod + + +@pytest.mark.parametrize('DM', DMZ_all) +def test_XXM_from_dod(DM): + T = type(DM([[0]])) + dod = {0: {0: ZZ(1), 2: ZZ(4)}, 1: {0: ZZ(4), 1: ZZ(5), 2: ZZ(6)}} + assert T.from_dod(dod, (2, 3), ZZ) == DM([[1, 0, 4], [4, 5, 6]]) + + +@pytest.mark.parametrize('DM', DMZ_all) +def test_XXM_to_dok(DM): + dod = {(0, 0): ZZ(1), (0, 2): ZZ(4), + (1, 0): ZZ(4), (1, 1): ZZ(5), (1, 2): ZZ(6)} + assert DM([[1, 0, 4], [4, 5, 6]]).to_dok() == dod + + +@pytest.mark.parametrize('DM', DMZ_all) +def test_XXM_from_dok(DM): + T = type(DM([[0]])) + dod = {(0, 0): ZZ(1), (0, 2): ZZ(4), + (1, 0): ZZ(4), (1, 1): ZZ(5), (1, 2): ZZ(6)} + assert T.from_dok(dod, (2, 3), ZZ) == DM([[1, 0, 4], [4, 5, 6]]) + + +@pytest.mark.parametrize('DM', DMZ_all) +def test_XXM_iter_values(DM): + values = [ZZ(1), ZZ(4), ZZ(4), ZZ(5), ZZ(6)] + assert sorted(DM([[1, 0, 4], [4, 5, 6]]).iter_values()) == values + + +@pytest.mark.parametrize('DM', DMZ_all) +def test_XXM_iter_items(DM): + items = [((0, 0), ZZ(1)), ((0, 2), ZZ(4)), + ((1, 0), ZZ(4)), ((1, 1), ZZ(5)), ((1, 2), ZZ(6))] + assert sorted(DM([[1, 0, 4], [4, 5, 6]]).iter_items()) == items + + +@pytest.mark.parametrize('DM', DMZ_all) +def test_XXM_from_ddm(DM): + T = type(DM([[0]])) + ddm = DDM([[1, 2, 4], [4, 5, 6]], (2, 3), ZZ) + assert T.from_ddm(ddm) == DM([[1, 2, 4], [4, 5, 6]]) + + +@pytest.mark.parametrize('DM', DMZ_all) +def test_XXM_zeros(DM): + T = type(DM([[0]])) + assert T.zeros((2, 3), ZZ) == DM([[0, 0, 0], [0, 0, 0]]) + + +@pytest.mark.parametrize('DM', DMZ_all) +def test_XXM_ones(DM): + T = type(DM([[0]])) + assert T.ones((2, 3), ZZ) == DM([[1, 1, 1], [1, 1, 1]]) + + +@pytest.mark.parametrize('DM', DMZ_all) +def test_XXM_eye(DM): + T = type(DM([[0]])) + assert T.eye(3, ZZ) == DM([[1, 0, 0], [0, 1, 0], [0, 0, 1]]) + assert T.eye((3, 2), ZZ) == DM([[1, 0], [0, 1], [0, 0]]) + + +@pytest.mark.parametrize('DM', DMZ_all) +def test_XXM_diag(DM): + T = type(DM([[0]])) + assert T.diag([1, 2, 3], ZZ) == DM([[1, 0, 0], [0, 2, 0], [0, 0, 3]]) + + +@pytest.mark.parametrize('DM', DMZ_all) +def test_XXM_transpose(DM): + A = DM([[1, 2, 3], [4, 5, 6]]) + assert A.transpose() == DM([[1, 4], [2, 5], [3, 6]]) + + +@pytest.mark.parametrize('DM', DMZ_all) +def test_XXM_add(DM): + A = DM([[1, 2, 3], [4, 5, 6]]) + B = DM([[1, 2, 3], [4, 5, 6]]) + C = DM([[2, 4, 6], [8, 10, 12]]) + assert A.add(B) == C + + +@pytest.mark.parametrize('DM', DMZ_all) +def test_XXM_sub(DM): + A = DM([[1, 2, 3], [4, 5, 6]]) + B = DM([[1, 2, 3], [4, 5, 6]]) + C = DM([[0, 0, 0], [0, 0, 0]]) + assert A.sub(B) == C + + +@pytest.mark.parametrize('DM', DMZ_all) +def test_XXM_mul(DM): + A = DM([[1, 2, 3], [4, 5, 6]]) + b = ZZ(2) + assert A.mul(b) == DM([[2, 4, 6], [8, 10, 12]]) + assert A.rmul(b) == DM([[2, 4, 6], [8, 10, 12]]) + + +@pytest.mark.parametrize('DM', DMZ_all) +def test_XXM_matmul(DM): + A = DM([[1, 2, 3], [4, 5, 6]]) + B = DM([[1, 2], [3, 4], [5, 6]]) + C = DM([[22, 28], [49, 64]]) + assert A.matmul(B) == C + + +@pytest.mark.parametrize('DM', DMZ_all) +def test_XXM_mul_elementwise(DM): + A = DM([[1, 2, 3], [4, 5, 6]]) + B = DM([[1, 2, 3], [4, 5, 6]]) + C = DM([[1, 4, 9], [16, 25, 36]]) + assert A.mul_elementwise(B) == C + + +@pytest.mark.parametrize('DM', DMZ_all) +def test_XXM_neg(DM): + A = DM([[1, 2, 3], [4, 5, 6]]) + C = DM([[-1, -2, -3], [-4, -5, -6]]) + assert A.neg() == C + + +@pytest.mark.parametrize('DM', DM_all) +def test_XXM_convert_to(DM): + A = DM([[1, 2, 3], [4, 5, 6]], ZZ) + B = DM([[1, 2, 3], [4, 5, 6]], QQ) + assert A.convert_to(QQ) == B + assert B.convert_to(ZZ) == A + + +@pytest.mark.parametrize('DM', DMZ_all) +def test_XXM_scc(DM): + A = DM([ + [0, 1, 0, 0, 0, 0], + [1, 0, 0, 0, 0, 0], + [0, 0, 1, 0, 0, 0], + [0, 0, 0, 1, 0, 1], + [0, 0, 0, 0, 1, 0], + [0, 0, 0, 1, 0, 1]]) + assert A.scc() == [[0, 1], [2], [3, 5], [4]] + + +@pytest.mark.parametrize('DM', DMZ_all) +def test_XXM_hstack(DM): + A = DM([[1, 2, 3], [4, 5, 6]]) + B = DM([[7, 8], [9, 10]]) + C = DM([[1, 2, 3, 7, 8], [4, 5, 6, 9, 10]]) + ABC = DM([[1, 2, 3, 7, 8, 1, 2, 3, 7, 8], + [4, 5, 6, 9, 10, 4, 5, 6, 9, 10]]) + assert A.hstack(B) == C + assert A.hstack(B, C) == ABC + + +@pytest.mark.parametrize('DM', DMZ_all) +def test_XXM_vstack(DM): + A = DM([[1, 2, 3], [4, 5, 6]]) + B = DM([[7, 8, 9]]) + C = DM([[1, 2, 3], [4, 5, 6], [7, 8, 9]]) + ABC = DM([[1, 2, 3], [4, 5, 6], [7, 8, 9], [1, 2, 3], [4, 5, 6], [7, 8, 9]]) + assert A.vstack(B) == C + assert A.vstack(B, C) == ABC + + +@pytest.mark.parametrize('DM', DMZ_all) +def test_XXM_applyfunc(DM): + A = DM([[1, 2, 3], [4, 5, 6]]) + B = DM([[2, 4, 6], [8, 10, 12]]) + assert A.applyfunc(lambda x: 2*x, ZZ) == B + + +@pytest.mark.parametrize('DM', DMZ_all) +def test_XXM_is_upper(DM): + assert DM([[1, 2, 3], [0, 5, 6]]).is_upper() is True + assert DM([[1, 2, 3], [4, 5, 6]]).is_upper() is False + + +@pytest.mark.parametrize('DM', DMZ_all) +def test_XXM_is_lower(DM): + assert DM([[1, 0, 0], [4, 5, 0]]).is_lower() is True + assert DM([[1, 2, 3], [4, 5, 6]]).is_lower() is False + + +@pytest.mark.parametrize('DM', DMZ_all) +def test_XXM_is_diagonal(DM): + assert DM([[1, 0, 0], [0, 5, 0]]).is_diagonal() is True + assert DM([[1, 2, 3], [4, 5, 6]]).is_diagonal() is False + + +@pytest.mark.parametrize('DM', DMZ_all) +def test_XXM_diagonal(DM): + assert DM([[1, 0, 0], [0, 5, 0]]).diagonal() == [1, 5] + + +@pytest.mark.parametrize('DM', DMZ_all) +def test_XXM_is_zero_matrix(DM): + assert DM([[0, 0, 0], [0, 0, 0]]).is_zero_matrix() is True + assert DM([[1, 0, 0], [0, 0, 0]]).is_zero_matrix() is False + + +@pytest.mark.parametrize('DM', DMZ_all) +def test_XXM_det_ZZ(DM): + assert DM([[1, 2, 3], [4, 5, 6], [7, 8, 9]]).det() == 0 + assert DM([[1, 2, 3], [4, 5, 6], [7, 8, 10]]).det() == -3 + + +@pytest.mark.parametrize('DM', DMQ_all) +def test_XXM_det_QQ(DM): + dM1 = DM([[(1,2), (2,3)], [(3,4), (4,5)]]) + assert dM1.det() == QQ(-1,10) + + +@pytest.mark.parametrize('DM', DMQ_all) +def test_XXM_inv_QQ(DM): + dM1 = DM([[(1,2), (2,3)], [(3,4), (4,5)]]) + dM2 = DM([[(-8,1), (20,3)], [(15,2), (-5,1)]]) + assert dM1.inv() == dM2 + assert dM1.matmul(dM2) == DM([[1, 0], [0, 1]]) + + dM3 = DM([[(1,2), (2,3)], [(1,4), (1,3)]]) + raises(DMNonInvertibleMatrixError, lambda: dM3.inv()) + + dM4 = DM([[(1,2), (2,3), (3,4)], [(1,4), (1,3), (1,2)]]) + raises(DMNonSquareMatrixError, lambda: dM4.inv()) + + +@pytest.mark.parametrize('DM', DMZ_all) +def test_XXM_inv_ZZ(DM): + dM1 = DM([[1, 2, 3], [4, 5, 6], [7, 8, 10]]) + # XXX: Maybe this should return a DM over QQ instead? + # XXX: Handle unimodular matrices? + raises(DMDomainError, lambda: dM1.inv()) + + +@pytest.mark.parametrize('DM', DMZ_all) +def test_XXM_charpoly_ZZ(DM): + dM1 = DM([[1, 2, 3], [4, 5, 6], [7, 8, 10]]) + assert dM1.charpoly() == [1, -16, -12, 3] + + +@pytest.mark.parametrize('DM', DMQ_all) +def test_XXM_charpoly_QQ(DM): + dM1 = DM([[(1,2), (2,3)], [(3,4), (4,5)]]) + assert dM1.charpoly() == [QQ(1,1), QQ(-13,10), QQ(-1,10)] + + +@pytest.mark.parametrize('DM', DMZ_all) +def test_XXM_lu_solve_ZZ(DM): + dM1 = DM([[1, 2, 3], [4, 5, 6], [7, 8, 10]]) + dM2 = DM([[1, 0, 0], [0, 1, 0], [0, 0, 1]]) + raises(DMDomainError, lambda: dM1.lu_solve(dM2)) + + +@pytest.mark.parametrize('DM', DMQ_all) +def test_XXM_lu_solve_QQ(DM): + dM1 = DM([[1, 2, 3], [4, 5, 6], [7, 8, 10]]) + dM2 = DM([[1, 0, 0], [0, 1, 0], [0, 0, 1]]) + dM3 = DM([[(-2,3),(-4,3),(1,1)],[(-2,3),(11,3),(-2,1)],[(1,1),(-2,1),(1,1)]]) + assert dM1.lu_solve(dM2) == dM3 == dM1.inv() + + dM4 = DM([[1, 2, 3], [4, 5, 6]]) + dM5 = DM([[1, 0], [0, 1], [0, 0]]) + raises(DMShapeError, lambda: dM4.lu_solve(dM5)) + + +@pytest.mark.parametrize('DM', DMQ_all) +def test_XXM_nullspace_QQ(DM): + dM1 = DM([[1, 2, 3], [4, 5, 6], [7, 8, 9]]) + # XXX: Change the signature to just return the nullspace. Possibly + # returning the rank or nullity makes sense but the list of nonpivots is + # not useful. + assert dM1.nullspace() == (DM([[1, -2, 1]]), [2]) + + +@pytest.mark.parametrize('DM', DMZ_all) +def test_XXM_lll(DM): + M = DM([[1, 2, 3], [4, 5, 20]]) + M_lll = DM([[1, 2, 3], [-1, -5, 5]]) + T = DM([[1, 0], [-5, 1]]) + assert M.lll() == M_lll + assert M.lll_transform() == (M_lll, T) + assert T.matmul(M) == M_lll diff --git a/vlmpy310/lib/python3.10/site-packages/babel/locale-data/bal_Latn.dat b/vlmpy310/lib/python3.10/site-packages/babel/locale-data/bal_Latn.dat new file mode 100644 index 0000000000000000000000000000000000000000..6030ac971707f32d16dafa8369a5e499f83b905e Binary files /dev/null and b/vlmpy310/lib/python3.10/site-packages/babel/locale-data/bal_Latn.dat differ diff --git a/vlmpy310/lib/python3.10/site-packages/babel/locale-data/bn.dat b/vlmpy310/lib/python3.10/site-packages/babel/locale-data/bn.dat new file mode 100644 index 0000000000000000000000000000000000000000..b084d6ddba2b5007d416353ca766cda5d1219663 --- /dev/null +++ b/vlmpy310/lib/python3.10/site-packages/babel/locale-data/bn.dat @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c917a9df4b64c5204a90e82d216cd9044d58de9973b42228bbc5a285a9d6f12c +size 217482 diff --git a/vlmpy310/lib/python3.10/site-packages/babel/locale-data/ca_FR.dat b/vlmpy310/lib/python3.10/site-packages/babel/locale-data/ca_FR.dat new file mode 100644 index 0000000000000000000000000000000000000000..1e13497d0fe23a430123235472ebbee4f6948f4b Binary files /dev/null and b/vlmpy310/lib/python3.10/site-packages/babel/locale-data/ca_FR.dat differ diff --git a/vlmpy310/lib/python3.10/site-packages/babel/locale-data/en_AT.dat b/vlmpy310/lib/python3.10/site-packages/babel/locale-data/en_AT.dat new file mode 100644 index 0000000000000000000000000000000000000000..ff190b61e4d1ad47b038c9e84a020f25b645a09c Binary files /dev/null and b/vlmpy310/lib/python3.10/site-packages/babel/locale-data/en_AT.dat differ diff --git a/vlmpy310/lib/python3.10/site-packages/babel/locale-data/en_SC.dat b/vlmpy310/lib/python3.10/site-packages/babel/locale-data/en_SC.dat new file mode 100644 index 0000000000000000000000000000000000000000..4816bb86a2a977854c91682a6b4bb757379d2329 Binary files /dev/null and b/vlmpy310/lib/python3.10/site-packages/babel/locale-data/en_SC.dat differ diff --git a/vlmpy310/lib/python3.10/site-packages/babel/locale-data/et_EE.dat b/vlmpy310/lib/python3.10/site-packages/babel/locale-data/et_EE.dat new file mode 100644 index 0000000000000000000000000000000000000000..a08c682412ed948cf6b0d35c66bd5c5a98513c4a Binary files /dev/null and b/vlmpy310/lib/python3.10/site-packages/babel/locale-data/et_EE.dat differ diff --git a/vlmpy310/lib/python3.10/site-packages/babel/locale-data/fr_WF.dat b/vlmpy310/lib/python3.10/site-packages/babel/locale-data/fr_WF.dat new file mode 100644 index 0000000000000000000000000000000000000000..2d38ac6f0c9206ad95ccd0f9330b864f78123a97 Binary files /dev/null and b/vlmpy310/lib/python3.10/site-packages/babel/locale-data/fr_WF.dat differ diff --git a/vlmpy310/lib/python3.10/site-packages/babel/locale-data/gu.dat b/vlmpy310/lib/python3.10/site-packages/babel/locale-data/gu.dat new file mode 100644 index 0000000000000000000000000000000000000000..be7a90409b3f730b071cf7b14e36582252fd35f6 --- /dev/null +++ b/vlmpy310/lib/python3.10/site-packages/babel/locale-data/gu.dat @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d8b0511cdf49a126ff45e012b09b5598f597086e6b2e69a2a5078e9565fa8f4f +size 206876 diff --git a/vlmpy310/lib/python3.10/site-packages/babel/locale-data/he.dat b/vlmpy310/lib/python3.10/site-packages/babel/locale-data/he.dat new file mode 100644 index 0000000000000000000000000000000000000000..34359e02dea668f450111cdda5cc7fc1f64bcc5a --- /dev/null +++ b/vlmpy310/lib/python3.10/site-packages/babel/locale-data/he.dat @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:67d34108712607c9287293ce141a82b87c340fc0cc8c1661e9ca71c91727885f +size 219719 diff --git a/vlmpy310/lib/python3.10/site-packages/babel/locale-data/hnj.dat b/vlmpy310/lib/python3.10/site-packages/babel/locale-data/hnj.dat new file mode 100644 index 0000000000000000000000000000000000000000..07eeb51642690284dbd561c20dd5881f484a9ebc Binary files /dev/null and b/vlmpy310/lib/python3.10/site-packages/babel/locale-data/hnj.dat differ diff --git a/vlmpy310/lib/python3.10/site-packages/babel/locale-data/ru_KG.dat b/vlmpy310/lib/python3.10/site-packages/babel/locale-data/ru_KG.dat new file mode 100644 index 0000000000000000000000000000000000000000..f3e59502c9630323391f612d73430c070032f36e Binary files /dev/null and b/vlmpy310/lib/python3.10/site-packages/babel/locale-data/ru_KG.dat differ diff --git a/vlmpy310/lib/python3.10/site-packages/babel/locale-data/scn.dat b/vlmpy310/lib/python3.10/site-packages/babel/locale-data/scn.dat new file mode 100644 index 0000000000000000000000000000000000000000..4a1e4e7d8ed3b680ca752a914f0b15974ee148b8 Binary files /dev/null and b/vlmpy310/lib/python3.10/site-packages/babel/locale-data/scn.dat differ diff --git a/vlmpy310/lib/python3.10/site-packages/babel/locale-data/so.dat b/vlmpy310/lib/python3.10/site-packages/babel/locale-data/so.dat new file mode 100644 index 0000000000000000000000000000000000000000..d9fc2dd1564620224eef8052d6359a5a2fe8249f --- /dev/null +++ b/vlmpy310/lib/python3.10/site-packages/babel/locale-data/so.dat @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a3e3818cddb2df338dc9156c49b32091b6545428e20d3a7bfd490b782ee4fa6d +size 162786 diff --git a/vlmpy310/lib/python3.10/site-packages/babel/locale-data/yue_Hant_HK.dat b/vlmpy310/lib/python3.10/site-packages/babel/locale-data/yue_Hant_HK.dat new file mode 100644 index 0000000000000000000000000000000000000000..853efcbb39cd8feceb97d63ab194363fec67d658 Binary files /dev/null and b/vlmpy310/lib/python3.10/site-packages/babel/locale-data/yue_Hant_HK.dat differ diff --git a/vlmpy310/lib/python3.10/site-packages/babel/locale-data/zh_Hant.dat b/vlmpy310/lib/python3.10/site-packages/babel/locale-data/zh_Hant.dat new file mode 100644 index 0000000000000000000000000000000000000000..f44a4c4e33e45110ae554a4ced35a936463dc119 --- /dev/null +++ b/vlmpy310/lib/python3.10/site-packages/babel/locale-data/zh_Hant.dat @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6d57035e407e1ecfff4e17654e5c23048760ab1fc2152c122146c5599da09910 +size 153398 diff --git a/vlmpy310/lib/python3.10/site-packages/msgpack/__init__.py b/vlmpy310/lib/python3.10/site-packages/msgpack/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..b61510544a97a6a20051c0e0e60cb4c37a8e1bcd --- /dev/null +++ b/vlmpy310/lib/python3.10/site-packages/msgpack/__init__.py @@ -0,0 +1,55 @@ +# ruff: noqa: F401 +import os + +from .exceptions import * # noqa: F403 +from .ext import ExtType, Timestamp + +version = (1, 1, 0) +__version__ = "1.1.0" + + +if os.environ.get("MSGPACK_PUREPYTHON"): + from .fallback import Packer, Unpacker, unpackb +else: + try: + from ._cmsgpack import Packer, Unpacker, unpackb + except ImportError: + from .fallback import Packer, Unpacker, unpackb + + +def pack(o, stream, **kwargs): + """ + Pack object `o` and write it to `stream` + + See :class:`Packer` for options. + """ + packer = Packer(**kwargs) + stream.write(packer.pack(o)) + + +def packb(o, **kwargs): + """ + Pack object `o` and return packed bytes + + See :class:`Packer` for options. + """ + return Packer(**kwargs).pack(o) + + +def unpack(stream, **kwargs): + """ + Unpack an object from `stream`. + + Raises `ExtraData` when `stream` contains extra bytes. + See :class:`Unpacker` for options. + """ + data = stream.read() + return unpackb(data, **kwargs) + + +# alias for compatibility to simplejson/marshal/pickle. +load = unpack +loads = unpackb + +dump = pack +dumps = packb diff --git a/vlmpy310/lib/python3.10/site-packages/msgpack/__pycache__/__init__.cpython-310.pyc b/vlmpy310/lib/python3.10/site-packages/msgpack/__pycache__/__init__.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..66e19619dd65063a654a21143f4f6053f542f410 Binary files /dev/null and b/vlmpy310/lib/python3.10/site-packages/msgpack/__pycache__/__init__.cpython-310.pyc differ diff --git a/vlmpy310/lib/python3.10/site-packages/msgpack/__pycache__/exceptions.cpython-310.pyc b/vlmpy310/lib/python3.10/site-packages/msgpack/__pycache__/exceptions.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d138073828248652bd41c03ed195c6516c094716 Binary files /dev/null and b/vlmpy310/lib/python3.10/site-packages/msgpack/__pycache__/exceptions.cpython-310.pyc differ diff --git a/vlmpy310/lib/python3.10/site-packages/msgpack/__pycache__/ext.cpython-310.pyc b/vlmpy310/lib/python3.10/site-packages/msgpack/__pycache__/ext.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c7dfadd2ada1e2ed22095098b59b326add6d1637 Binary files /dev/null and b/vlmpy310/lib/python3.10/site-packages/msgpack/__pycache__/ext.cpython-310.pyc differ diff --git a/vlmpy310/lib/python3.10/site-packages/msgpack/__pycache__/fallback.cpython-310.pyc b/vlmpy310/lib/python3.10/site-packages/msgpack/__pycache__/fallback.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..271afe686dc16063a482089c1d99655ab4172b20 Binary files /dev/null and b/vlmpy310/lib/python3.10/site-packages/msgpack/__pycache__/fallback.cpython-310.pyc differ diff --git a/vlmpy310/lib/python3.10/site-packages/msgpack/exceptions.py b/vlmpy310/lib/python3.10/site-packages/msgpack/exceptions.py new file mode 100644 index 0000000000000000000000000000000000000000..d6d2615cfdd0b914d064cdf7eecd45761e4bcaf6 --- /dev/null +++ b/vlmpy310/lib/python3.10/site-packages/msgpack/exceptions.py @@ -0,0 +1,48 @@ +class UnpackException(Exception): + """Base class for some exceptions raised while unpacking. + + NOTE: unpack may raise exception other than subclass of + UnpackException. If you want to catch all error, catch + Exception instead. + """ + + +class BufferFull(UnpackException): + pass + + +class OutOfData(UnpackException): + pass + + +class FormatError(ValueError, UnpackException): + """Invalid msgpack format""" + + +class StackError(ValueError, UnpackException): + """Too nested""" + + +# Deprecated. Use ValueError instead +UnpackValueError = ValueError + + +class ExtraData(UnpackValueError): + """ExtraData is raised when there is trailing data. + + This exception is raised while only one-shot (not streaming) + unpack. + """ + + def __init__(self, unpacked, extra): + self.unpacked = unpacked + self.extra = extra + + def __str__(self): + return "unpack(b) received extra data." + + +# Deprecated. Use Exception instead to catch all exception during packing. +PackException = Exception +PackValueError = ValueError +PackOverflowError = OverflowError diff --git a/vlmpy310/lib/python3.10/site-packages/msgpack/ext.py b/vlmpy310/lib/python3.10/site-packages/msgpack/ext.py new file mode 100644 index 0000000000000000000000000000000000000000..9694819a7df1570ccbb41de065cb7052f9af8e79 --- /dev/null +++ b/vlmpy310/lib/python3.10/site-packages/msgpack/ext.py @@ -0,0 +1,170 @@ +import datetime +import struct +from collections import namedtuple + + +class ExtType(namedtuple("ExtType", "code data")): + """ExtType represents ext type in msgpack.""" + + def __new__(cls, code, data): + if not isinstance(code, int): + raise TypeError("code must be int") + if not isinstance(data, bytes): + raise TypeError("data must be bytes") + if not 0 <= code <= 127: + raise ValueError("code must be 0~127") + return super().__new__(cls, code, data) + + +class Timestamp: + """Timestamp represents the Timestamp extension type in msgpack. + + When built with Cython, msgpack uses C methods to pack and unpack `Timestamp`. + When using pure-Python msgpack, :func:`to_bytes` and :func:`from_bytes` are used to pack and + unpack `Timestamp`. + + This class is immutable: Do not override seconds and nanoseconds. + """ + + __slots__ = ["seconds", "nanoseconds"] + + def __init__(self, seconds, nanoseconds=0): + """Initialize a Timestamp object. + + :param int seconds: + Number of seconds since the UNIX epoch (00:00:00 UTC Jan 1 1970, minus leap seconds). + May be negative. + + :param int nanoseconds: + Number of nanoseconds to add to `seconds` to get fractional time. + Maximum is 999_999_999. Default is 0. + + Note: Negative times (before the UNIX epoch) are represented as neg. seconds + pos. ns. + """ + if not isinstance(seconds, int): + raise TypeError("seconds must be an integer") + if not isinstance(nanoseconds, int): + raise TypeError("nanoseconds must be an integer") + if not (0 <= nanoseconds < 10**9): + raise ValueError("nanoseconds must be a non-negative integer less than 999999999.") + self.seconds = seconds + self.nanoseconds = nanoseconds + + def __repr__(self): + """String representation of Timestamp.""" + return f"Timestamp(seconds={self.seconds}, nanoseconds={self.nanoseconds})" + + def __eq__(self, other): + """Check for equality with another Timestamp object""" + if type(other) is self.__class__: + return self.seconds == other.seconds and self.nanoseconds == other.nanoseconds + return False + + def __ne__(self, other): + """not-equals method (see :func:`__eq__()`)""" + return not self.__eq__(other) + + def __hash__(self): + return hash((self.seconds, self.nanoseconds)) + + @staticmethod + def from_bytes(b): + """Unpack bytes into a `Timestamp` object. + + Used for pure-Python msgpack unpacking. + + :param b: Payload from msgpack ext message with code -1 + :type b: bytes + + :returns: Timestamp object unpacked from msgpack ext payload + :rtype: Timestamp + """ + if len(b) == 4: + seconds = struct.unpack("!L", b)[0] + nanoseconds = 0 + elif len(b) == 8: + data64 = struct.unpack("!Q", b)[0] + seconds = data64 & 0x00000003FFFFFFFF + nanoseconds = data64 >> 34 + elif len(b) == 12: + nanoseconds, seconds = struct.unpack("!Iq", b) + else: + raise ValueError( + "Timestamp type can only be created from 32, 64, or 96-bit byte objects" + ) + return Timestamp(seconds, nanoseconds) + + def to_bytes(self): + """Pack this Timestamp object into bytes. + + Used for pure-Python msgpack packing. + + :returns data: Payload for EXT message with code -1 (timestamp type) + :rtype: bytes + """ + if (self.seconds >> 34) == 0: # seconds is non-negative and fits in 34 bits + data64 = self.nanoseconds << 34 | self.seconds + if data64 & 0xFFFFFFFF00000000 == 0: + # nanoseconds is zero and seconds < 2**32, so timestamp 32 + data = struct.pack("!L", data64) + else: + # timestamp 64 + data = struct.pack("!Q", data64) + else: + # timestamp 96 + data = struct.pack("!Iq", self.nanoseconds, self.seconds) + return data + + @staticmethod + def from_unix(unix_sec): + """Create a Timestamp from posix timestamp in seconds. + + :param unix_float: Posix timestamp in seconds. + :type unix_float: int or float + """ + seconds = int(unix_sec // 1) + nanoseconds = int((unix_sec % 1) * 10**9) + return Timestamp(seconds, nanoseconds) + + def to_unix(self): + """Get the timestamp as a floating-point value. + + :returns: posix timestamp + :rtype: float + """ + return self.seconds + self.nanoseconds / 1e9 + + @staticmethod + def from_unix_nano(unix_ns): + """Create a Timestamp from posix timestamp in nanoseconds. + + :param int unix_ns: Posix timestamp in nanoseconds. + :rtype: Timestamp + """ + return Timestamp(*divmod(unix_ns, 10**9)) + + def to_unix_nano(self): + """Get the timestamp as a unixtime in nanoseconds. + + :returns: posix timestamp in nanoseconds + :rtype: int + """ + return self.seconds * 10**9 + self.nanoseconds + + def to_datetime(self): + """Get the timestamp as a UTC datetime. + + :rtype: `datetime.datetime` + """ + utc = datetime.timezone.utc + return datetime.datetime.fromtimestamp(0, utc) + datetime.timedelta( + seconds=self.seconds, microseconds=self.nanoseconds // 1000 + ) + + @staticmethod + def from_datetime(dt): + """Create a Timestamp from datetime with tzinfo. + + :rtype: Timestamp + """ + return Timestamp(seconds=int(dt.timestamp()), nanoseconds=dt.microsecond * 1000) diff --git a/vlmpy310/lib/python3.10/site-packages/msgpack/fallback.py b/vlmpy310/lib/python3.10/site-packages/msgpack/fallback.py new file mode 100644 index 0000000000000000000000000000000000000000..b02e47cfb91a54a7205881ee87a5db2ea8d049a7 --- /dev/null +++ b/vlmpy310/lib/python3.10/site-packages/msgpack/fallback.py @@ -0,0 +1,929 @@ +"""Fallback pure Python implementation of msgpack""" + +import struct +import sys +from datetime import datetime as _DateTime + +if hasattr(sys, "pypy_version_info"): + from __pypy__ import newlist_hint + from __pypy__.builders import BytesBuilder + + _USING_STRINGBUILDER = True + + class BytesIO: + def __init__(self, s=b""): + if s: + self.builder = BytesBuilder(len(s)) + self.builder.append(s) + else: + self.builder = BytesBuilder() + + def write(self, s): + if isinstance(s, memoryview): + s = s.tobytes() + elif isinstance(s, bytearray): + s = bytes(s) + self.builder.append(s) + + def getvalue(self): + return self.builder.build() + +else: + from io import BytesIO + + _USING_STRINGBUILDER = False + + def newlist_hint(size): + return [] + + +from .exceptions import BufferFull, ExtraData, FormatError, OutOfData, StackError +from .ext import ExtType, Timestamp + +EX_SKIP = 0 +EX_CONSTRUCT = 1 +EX_READ_ARRAY_HEADER = 2 +EX_READ_MAP_HEADER = 3 + +TYPE_IMMEDIATE = 0 +TYPE_ARRAY = 1 +TYPE_MAP = 2 +TYPE_RAW = 3 +TYPE_BIN = 4 +TYPE_EXT = 5 + +DEFAULT_RECURSE_LIMIT = 511 + + +def _check_type_strict(obj, t, type=type, tuple=tuple): + if type(t) is tuple: + return type(obj) in t + else: + return type(obj) is t + + +def _get_data_from_buffer(obj): + view = memoryview(obj) + if view.itemsize != 1: + raise ValueError("cannot unpack from multi-byte object") + return view + + +def unpackb(packed, **kwargs): + """ + Unpack an object from `packed`. + + Raises ``ExtraData`` when *packed* contains extra bytes. + Raises ``ValueError`` when *packed* is incomplete. + Raises ``FormatError`` when *packed* is not valid msgpack. + Raises ``StackError`` when *packed* contains too nested. + Other exceptions can be raised during unpacking. + + See :class:`Unpacker` for options. + """ + unpacker = Unpacker(None, max_buffer_size=len(packed), **kwargs) + unpacker.feed(packed) + try: + ret = unpacker._unpack() + except OutOfData: + raise ValueError("Unpack failed: incomplete input") + except RecursionError: + raise StackError + if unpacker._got_extradata(): + raise ExtraData(ret, unpacker._get_extradata()) + return ret + + +_NO_FORMAT_USED = "" +_MSGPACK_HEADERS = { + 0xC4: (1, _NO_FORMAT_USED, TYPE_BIN), + 0xC5: (2, ">H", TYPE_BIN), + 0xC6: (4, ">I", TYPE_BIN), + 0xC7: (2, "Bb", TYPE_EXT), + 0xC8: (3, ">Hb", TYPE_EXT), + 0xC9: (5, ">Ib", TYPE_EXT), + 0xCA: (4, ">f"), + 0xCB: (8, ">d"), + 0xCC: (1, _NO_FORMAT_USED), + 0xCD: (2, ">H"), + 0xCE: (4, ">I"), + 0xCF: (8, ">Q"), + 0xD0: (1, "b"), + 0xD1: (2, ">h"), + 0xD2: (4, ">i"), + 0xD3: (8, ">q"), + 0xD4: (1, "b1s", TYPE_EXT), + 0xD5: (2, "b2s", TYPE_EXT), + 0xD6: (4, "b4s", TYPE_EXT), + 0xD7: (8, "b8s", TYPE_EXT), + 0xD8: (16, "b16s", TYPE_EXT), + 0xD9: (1, _NO_FORMAT_USED, TYPE_RAW), + 0xDA: (2, ">H", TYPE_RAW), + 0xDB: (4, ">I", TYPE_RAW), + 0xDC: (2, ">H", TYPE_ARRAY), + 0xDD: (4, ">I", TYPE_ARRAY), + 0xDE: (2, ">H", TYPE_MAP), + 0xDF: (4, ">I", TYPE_MAP), +} + + +class Unpacker: + """Streaming unpacker. + + Arguments: + + :param file_like: + File-like object having `.read(n)` method. + If specified, unpacker reads serialized data from it and `.feed()` is not usable. + + :param int read_size: + Used as `file_like.read(read_size)`. (default: `min(16*1024, max_buffer_size)`) + + :param bool use_list: + If true, unpack msgpack array to Python list. + Otherwise, unpack to Python tuple. (default: True) + + :param bool raw: + If true, unpack msgpack raw to Python bytes. + Otherwise, unpack to Python str by decoding with UTF-8 encoding (default). + + :param int timestamp: + Control how timestamp type is unpacked: + + 0 - Timestamp + 1 - float (Seconds from the EPOCH) + 2 - int (Nanoseconds from the EPOCH) + 3 - datetime.datetime (UTC). + + :param bool strict_map_key: + If true (default), only str or bytes are accepted for map (dict) keys. + + :param object_hook: + When specified, it should be callable. + Unpacker calls it with a dict argument after unpacking msgpack map. + (See also simplejson) + + :param object_pairs_hook: + When specified, it should be callable. + Unpacker calls it with a list of key-value pairs after unpacking msgpack map. + (See also simplejson) + + :param str unicode_errors: + The error handler for decoding unicode. (default: 'strict') + This option should be used only when you have msgpack data which + contains invalid UTF-8 string. + + :param int max_buffer_size: + Limits size of data waiting unpacked. 0 means 2**32-1. + The default value is 100*1024*1024 (100MiB). + Raises `BufferFull` exception when it is insufficient. + You should set this parameter when unpacking data from untrusted source. + + :param int max_str_len: + Deprecated, use *max_buffer_size* instead. + Limits max length of str. (default: max_buffer_size) + + :param int max_bin_len: + Deprecated, use *max_buffer_size* instead. + Limits max length of bin. (default: max_buffer_size) + + :param int max_array_len: + Limits max length of array. + (default: max_buffer_size) + + :param int max_map_len: + Limits max length of map. + (default: max_buffer_size//2) + + :param int max_ext_len: + Deprecated, use *max_buffer_size* instead. + Limits max size of ext type. (default: max_buffer_size) + + Example of streaming deserialize from file-like object:: + + unpacker = Unpacker(file_like) + for o in unpacker: + process(o) + + Example of streaming deserialize from socket:: + + unpacker = Unpacker() + while True: + buf = sock.recv(1024**2) + if not buf: + break + unpacker.feed(buf) + for o in unpacker: + process(o) + + Raises ``ExtraData`` when *packed* contains extra bytes. + Raises ``OutOfData`` when *packed* is incomplete. + Raises ``FormatError`` when *packed* is not valid msgpack. + Raises ``StackError`` when *packed* contains too nested. + Other exceptions can be raised during unpacking. + """ + + def __init__( + self, + file_like=None, + *, + read_size=0, + use_list=True, + raw=False, + timestamp=0, + strict_map_key=True, + object_hook=None, + object_pairs_hook=None, + list_hook=None, + unicode_errors=None, + max_buffer_size=100 * 1024 * 1024, + ext_hook=ExtType, + max_str_len=-1, + max_bin_len=-1, + max_array_len=-1, + max_map_len=-1, + max_ext_len=-1, + ): + if unicode_errors is None: + unicode_errors = "strict" + + if file_like is None: + self._feeding = True + else: + if not callable(file_like.read): + raise TypeError("`file_like.read` must be callable") + self.file_like = file_like + self._feeding = False + + #: array of bytes fed. + self._buffer = bytearray() + #: Which position we currently reads + self._buff_i = 0 + + # When Unpacker is used as an iterable, between the calls to next(), + # the buffer is not "consumed" completely, for efficiency sake. + # Instead, it is done sloppily. To make sure we raise BufferFull at + # the correct moments, we have to keep track of how sloppy we were. + # Furthermore, when the buffer is incomplete (that is: in the case + # we raise an OutOfData) we need to rollback the buffer to the correct + # state, which _buf_checkpoint records. + self._buf_checkpoint = 0 + + if not max_buffer_size: + max_buffer_size = 2**31 - 1 + if max_str_len == -1: + max_str_len = max_buffer_size + if max_bin_len == -1: + max_bin_len = max_buffer_size + if max_array_len == -1: + max_array_len = max_buffer_size + if max_map_len == -1: + max_map_len = max_buffer_size // 2 + if max_ext_len == -1: + max_ext_len = max_buffer_size + + self._max_buffer_size = max_buffer_size + if read_size > self._max_buffer_size: + raise ValueError("read_size must be smaller than max_buffer_size") + self._read_size = read_size or min(self._max_buffer_size, 16 * 1024) + self._raw = bool(raw) + self._strict_map_key = bool(strict_map_key) + self._unicode_errors = unicode_errors + self._use_list = use_list + if not (0 <= timestamp <= 3): + raise ValueError("timestamp must be 0..3") + self._timestamp = timestamp + self._list_hook = list_hook + self._object_hook = object_hook + self._object_pairs_hook = object_pairs_hook + self._ext_hook = ext_hook + self._max_str_len = max_str_len + self._max_bin_len = max_bin_len + self._max_array_len = max_array_len + self._max_map_len = max_map_len + self._max_ext_len = max_ext_len + self._stream_offset = 0 + + if list_hook is not None and not callable(list_hook): + raise TypeError("`list_hook` is not callable") + if object_hook is not None and not callable(object_hook): + raise TypeError("`object_hook` is not callable") + if object_pairs_hook is not None and not callable(object_pairs_hook): + raise TypeError("`object_pairs_hook` is not callable") + if object_hook is not None and object_pairs_hook is not None: + raise TypeError("object_pairs_hook and object_hook are mutually exclusive") + if not callable(ext_hook): + raise TypeError("`ext_hook` is not callable") + + def feed(self, next_bytes): + assert self._feeding + view = _get_data_from_buffer(next_bytes) + if len(self._buffer) - self._buff_i + len(view) > self._max_buffer_size: + raise BufferFull + + # Strip buffer before checkpoint before reading file. + if self._buf_checkpoint > 0: + del self._buffer[: self._buf_checkpoint] + self._buff_i -= self._buf_checkpoint + self._buf_checkpoint = 0 + + # Use extend here: INPLACE_ADD += doesn't reliably typecast memoryview in jython + self._buffer.extend(view) + view.release() + + def _consume(self): + """Gets rid of the used parts of the buffer.""" + self._stream_offset += self._buff_i - self._buf_checkpoint + self._buf_checkpoint = self._buff_i + + def _got_extradata(self): + return self._buff_i < len(self._buffer) + + def _get_extradata(self): + return self._buffer[self._buff_i :] + + def read_bytes(self, n): + ret = self._read(n, raise_outofdata=False) + self._consume() + return ret + + def _read(self, n, raise_outofdata=True): + # (int) -> bytearray + self._reserve(n, raise_outofdata=raise_outofdata) + i = self._buff_i + ret = self._buffer[i : i + n] + self._buff_i = i + len(ret) + return ret + + def _reserve(self, n, raise_outofdata=True): + remain_bytes = len(self._buffer) - self._buff_i - n + + # Fast path: buffer has n bytes already + if remain_bytes >= 0: + return + + if self._feeding: + self._buff_i = self._buf_checkpoint + raise OutOfData + + # Strip buffer before checkpoint before reading file. + if self._buf_checkpoint > 0: + del self._buffer[: self._buf_checkpoint] + self._buff_i -= self._buf_checkpoint + self._buf_checkpoint = 0 + + # Read from file + remain_bytes = -remain_bytes + if remain_bytes + len(self._buffer) > self._max_buffer_size: + raise BufferFull + while remain_bytes > 0: + to_read_bytes = max(self._read_size, remain_bytes) + read_data = self.file_like.read(to_read_bytes) + if not read_data: + break + assert isinstance(read_data, bytes) + self._buffer += read_data + remain_bytes -= len(read_data) + + if len(self._buffer) < n + self._buff_i and raise_outofdata: + self._buff_i = 0 # rollback + raise OutOfData + + def _read_header(self): + typ = TYPE_IMMEDIATE + n = 0 + obj = None + self._reserve(1) + b = self._buffer[self._buff_i] + self._buff_i += 1 + if b & 0b10000000 == 0: + obj = b + elif b & 0b11100000 == 0b11100000: + obj = -1 - (b ^ 0xFF) + elif b & 0b11100000 == 0b10100000: + n = b & 0b00011111 + typ = TYPE_RAW + if n > self._max_str_len: + raise ValueError(f"{n} exceeds max_str_len({self._max_str_len})") + obj = self._read(n) + elif b & 0b11110000 == 0b10010000: + n = b & 0b00001111 + typ = TYPE_ARRAY + if n > self._max_array_len: + raise ValueError(f"{n} exceeds max_array_len({self._max_array_len})") + elif b & 0b11110000 == 0b10000000: + n = b & 0b00001111 + typ = TYPE_MAP + if n > self._max_map_len: + raise ValueError(f"{n} exceeds max_map_len({self._max_map_len})") + elif b == 0xC0: + obj = None + elif b == 0xC2: + obj = False + elif b == 0xC3: + obj = True + elif 0xC4 <= b <= 0xC6: + size, fmt, typ = _MSGPACK_HEADERS[b] + self._reserve(size) + if len(fmt) > 0: + n = struct.unpack_from(fmt, self._buffer, self._buff_i)[0] + else: + n = self._buffer[self._buff_i] + self._buff_i += size + if n > self._max_bin_len: + raise ValueError(f"{n} exceeds max_bin_len({self._max_bin_len})") + obj = self._read(n) + elif 0xC7 <= b <= 0xC9: + size, fmt, typ = _MSGPACK_HEADERS[b] + self._reserve(size) + L, n = struct.unpack_from(fmt, self._buffer, self._buff_i) + self._buff_i += size + if L > self._max_ext_len: + raise ValueError(f"{L} exceeds max_ext_len({self._max_ext_len})") + obj = self._read(L) + elif 0xCA <= b <= 0xD3: + size, fmt = _MSGPACK_HEADERS[b] + self._reserve(size) + if len(fmt) > 0: + obj = struct.unpack_from(fmt, self._buffer, self._buff_i)[0] + else: + obj = self._buffer[self._buff_i] + self._buff_i += size + elif 0xD4 <= b <= 0xD8: + size, fmt, typ = _MSGPACK_HEADERS[b] + if self._max_ext_len < size: + raise ValueError(f"{size} exceeds max_ext_len({self._max_ext_len})") + self._reserve(size + 1) + n, obj = struct.unpack_from(fmt, self._buffer, self._buff_i) + self._buff_i += size + 1 + elif 0xD9 <= b <= 0xDB: + size, fmt, typ = _MSGPACK_HEADERS[b] + self._reserve(size) + if len(fmt) > 0: + (n,) = struct.unpack_from(fmt, self._buffer, self._buff_i) + else: + n = self._buffer[self._buff_i] + self._buff_i += size + if n > self._max_str_len: + raise ValueError(f"{n} exceeds max_str_len({self._max_str_len})") + obj = self._read(n) + elif 0xDC <= b <= 0xDD: + size, fmt, typ = _MSGPACK_HEADERS[b] + self._reserve(size) + (n,) = struct.unpack_from(fmt, self._buffer, self._buff_i) + self._buff_i += size + if n > self._max_array_len: + raise ValueError(f"{n} exceeds max_array_len({self._max_array_len})") + elif 0xDE <= b <= 0xDF: + size, fmt, typ = _MSGPACK_HEADERS[b] + self._reserve(size) + (n,) = struct.unpack_from(fmt, self._buffer, self._buff_i) + self._buff_i += size + if n > self._max_map_len: + raise ValueError(f"{n} exceeds max_map_len({self._max_map_len})") + else: + raise FormatError("Unknown header: 0x%x" % b) + return typ, n, obj + + def _unpack(self, execute=EX_CONSTRUCT): + typ, n, obj = self._read_header() + + if execute == EX_READ_ARRAY_HEADER: + if typ != TYPE_ARRAY: + raise ValueError("Expected array") + return n + if execute == EX_READ_MAP_HEADER: + if typ != TYPE_MAP: + raise ValueError("Expected map") + return n + # TODO should we eliminate the recursion? + if typ == TYPE_ARRAY: + if execute == EX_SKIP: + for i in range(n): + # TODO check whether we need to call `list_hook` + self._unpack(EX_SKIP) + return + ret = newlist_hint(n) + for i in range(n): + ret.append(self._unpack(EX_CONSTRUCT)) + if self._list_hook is not None: + ret = self._list_hook(ret) + # TODO is the interaction between `list_hook` and `use_list` ok? + return ret if self._use_list else tuple(ret) + if typ == TYPE_MAP: + if execute == EX_SKIP: + for i in range(n): + # TODO check whether we need to call hooks + self._unpack(EX_SKIP) + self._unpack(EX_SKIP) + return + if self._object_pairs_hook is not None: + ret = self._object_pairs_hook( + (self._unpack(EX_CONSTRUCT), self._unpack(EX_CONSTRUCT)) for _ in range(n) + ) + else: + ret = {} + for _ in range(n): + key = self._unpack(EX_CONSTRUCT) + if self._strict_map_key and type(key) not in (str, bytes): + raise ValueError("%s is not allowed for map key" % str(type(key))) + if isinstance(key, str): + key = sys.intern(key) + ret[key] = self._unpack(EX_CONSTRUCT) + if self._object_hook is not None: + ret = self._object_hook(ret) + return ret + if execute == EX_SKIP: + return + if typ == TYPE_RAW: + if self._raw: + obj = bytes(obj) + else: + obj = obj.decode("utf_8", self._unicode_errors) + return obj + if typ == TYPE_BIN: + return bytes(obj) + if typ == TYPE_EXT: + if n == -1: # timestamp + ts = Timestamp.from_bytes(bytes(obj)) + if self._timestamp == 1: + return ts.to_unix() + elif self._timestamp == 2: + return ts.to_unix_nano() + elif self._timestamp == 3: + return ts.to_datetime() + else: + return ts + else: + return self._ext_hook(n, bytes(obj)) + assert typ == TYPE_IMMEDIATE + return obj + + def __iter__(self): + return self + + def __next__(self): + try: + ret = self._unpack(EX_CONSTRUCT) + self._consume() + return ret + except OutOfData: + self._consume() + raise StopIteration + except RecursionError: + raise StackError + + next = __next__ + + def skip(self): + self._unpack(EX_SKIP) + self._consume() + + def unpack(self): + try: + ret = self._unpack(EX_CONSTRUCT) + except RecursionError: + raise StackError + self._consume() + return ret + + def read_array_header(self): + ret = self._unpack(EX_READ_ARRAY_HEADER) + self._consume() + return ret + + def read_map_header(self): + ret = self._unpack(EX_READ_MAP_HEADER) + self._consume() + return ret + + def tell(self): + return self._stream_offset + + +class Packer: + """ + MessagePack Packer + + Usage:: + + packer = Packer() + astream.write(packer.pack(a)) + astream.write(packer.pack(b)) + + Packer's constructor has some keyword arguments: + + :param default: + When specified, it should be callable. + Convert user type to builtin type that Packer supports. + See also simplejson's document. + + :param bool use_single_float: + Use single precision float type for float. (default: False) + + :param bool autoreset: + Reset buffer after each pack and return its content as `bytes`. (default: True). + If set this to false, use `bytes()` to get content and `.reset()` to clear buffer. + + :param bool use_bin_type: + Use bin type introduced in msgpack spec 2.0 for bytes. + It also enables str8 type for unicode. (default: True) + + :param bool strict_types: + If set to true, types will be checked to be exact. Derived classes + from serializable types will not be serialized and will be + treated as unsupported type and forwarded to default. + Additionally tuples will not be serialized as lists. + This is useful when trying to implement accurate serialization + for python types. + + :param bool datetime: + If set to true, datetime with tzinfo is packed into Timestamp type. + Note that the tzinfo is stripped in the timestamp. + You can get UTC datetime with `timestamp=3` option of the Unpacker. + + :param str unicode_errors: + The error handler for encoding unicode. (default: 'strict') + DO NOT USE THIS!! This option is kept for very specific usage. + + :param int buf_size: + Internal buffer size. This option is used only for C implementation. + """ + + def __init__( + self, + *, + default=None, + use_single_float=False, + autoreset=True, + use_bin_type=True, + strict_types=False, + datetime=False, + unicode_errors=None, + buf_size=None, + ): + self._strict_types = strict_types + self._use_float = use_single_float + self._autoreset = autoreset + self._use_bin_type = use_bin_type + self._buffer = BytesIO() + self._datetime = bool(datetime) + self._unicode_errors = unicode_errors or "strict" + if default is not None and not callable(default): + raise TypeError("default must be callable") + self._default = default + + def _pack( + self, + obj, + nest_limit=DEFAULT_RECURSE_LIMIT, + check=isinstance, + check_type_strict=_check_type_strict, + ): + default_used = False + if self._strict_types: + check = check_type_strict + list_types = list + else: + list_types = (list, tuple) + while True: + if nest_limit < 0: + raise ValueError("recursion limit exceeded") + if obj is None: + return self._buffer.write(b"\xc0") + if check(obj, bool): + if obj: + return self._buffer.write(b"\xc3") + return self._buffer.write(b"\xc2") + if check(obj, int): + if 0 <= obj < 0x80: + return self._buffer.write(struct.pack("B", obj)) + if -0x20 <= obj < 0: + return self._buffer.write(struct.pack("b", obj)) + if 0x80 <= obj <= 0xFF: + return self._buffer.write(struct.pack("BB", 0xCC, obj)) + if -0x80 <= obj < 0: + return self._buffer.write(struct.pack(">Bb", 0xD0, obj)) + if 0xFF < obj <= 0xFFFF: + return self._buffer.write(struct.pack(">BH", 0xCD, obj)) + if -0x8000 <= obj < -0x80: + return self._buffer.write(struct.pack(">Bh", 0xD1, obj)) + if 0xFFFF < obj <= 0xFFFFFFFF: + return self._buffer.write(struct.pack(">BI", 0xCE, obj)) + if -0x80000000 <= obj < -0x8000: + return self._buffer.write(struct.pack(">Bi", 0xD2, obj)) + if 0xFFFFFFFF < obj <= 0xFFFFFFFFFFFFFFFF: + return self._buffer.write(struct.pack(">BQ", 0xCF, obj)) + if -0x8000000000000000 <= obj < -0x80000000: + return self._buffer.write(struct.pack(">Bq", 0xD3, obj)) + if not default_used and self._default is not None: + obj = self._default(obj) + default_used = True + continue + raise OverflowError("Integer value out of range") + if check(obj, (bytes, bytearray)): + n = len(obj) + if n >= 2**32: + raise ValueError("%s is too large" % type(obj).__name__) + self._pack_bin_header(n) + return self._buffer.write(obj) + if check(obj, str): + obj = obj.encode("utf-8", self._unicode_errors) + n = len(obj) + if n >= 2**32: + raise ValueError("String is too large") + self._pack_raw_header(n) + return self._buffer.write(obj) + if check(obj, memoryview): + n = obj.nbytes + if n >= 2**32: + raise ValueError("Memoryview is too large") + self._pack_bin_header(n) + return self._buffer.write(obj) + if check(obj, float): + if self._use_float: + return self._buffer.write(struct.pack(">Bf", 0xCA, obj)) + return self._buffer.write(struct.pack(">Bd", 0xCB, obj)) + if check(obj, (ExtType, Timestamp)): + if check(obj, Timestamp): + code = -1 + data = obj.to_bytes() + else: + code = obj.code + data = obj.data + assert isinstance(code, int) + assert isinstance(data, bytes) + L = len(data) + if L == 1: + self._buffer.write(b"\xd4") + elif L == 2: + self._buffer.write(b"\xd5") + elif L == 4: + self._buffer.write(b"\xd6") + elif L == 8: + self._buffer.write(b"\xd7") + elif L == 16: + self._buffer.write(b"\xd8") + elif L <= 0xFF: + self._buffer.write(struct.pack(">BB", 0xC7, L)) + elif L <= 0xFFFF: + self._buffer.write(struct.pack(">BH", 0xC8, L)) + else: + self._buffer.write(struct.pack(">BI", 0xC9, L)) + self._buffer.write(struct.pack("b", code)) + self._buffer.write(data) + return + if check(obj, list_types): + n = len(obj) + self._pack_array_header(n) + for i in range(n): + self._pack(obj[i], nest_limit - 1) + return + if check(obj, dict): + return self._pack_map_pairs(len(obj), obj.items(), nest_limit - 1) + + if self._datetime and check(obj, _DateTime) and obj.tzinfo is not None: + obj = Timestamp.from_datetime(obj) + default_used = 1 + continue + + if not default_used and self._default is not None: + obj = self._default(obj) + default_used = 1 + continue + + if self._datetime and check(obj, _DateTime): + raise ValueError(f"Cannot serialize {obj!r} where tzinfo=None") + + raise TypeError(f"Cannot serialize {obj!r}") + + def pack(self, obj): + try: + self._pack(obj) + except: + self._buffer = BytesIO() # force reset + raise + if self._autoreset: + ret = self._buffer.getvalue() + self._buffer = BytesIO() + return ret + + def pack_map_pairs(self, pairs): + self._pack_map_pairs(len(pairs), pairs) + if self._autoreset: + ret = self._buffer.getvalue() + self._buffer = BytesIO() + return ret + + def pack_array_header(self, n): + if n >= 2**32: + raise ValueError + self._pack_array_header(n) + if self._autoreset: + ret = self._buffer.getvalue() + self._buffer = BytesIO() + return ret + + def pack_map_header(self, n): + if n >= 2**32: + raise ValueError + self._pack_map_header(n) + if self._autoreset: + ret = self._buffer.getvalue() + self._buffer = BytesIO() + return ret + + def pack_ext_type(self, typecode, data): + if not isinstance(typecode, int): + raise TypeError("typecode must have int type.") + if not 0 <= typecode <= 127: + raise ValueError("typecode should be 0-127") + if not isinstance(data, bytes): + raise TypeError("data must have bytes type") + L = len(data) + if L > 0xFFFFFFFF: + raise ValueError("Too large data") + if L == 1: + self._buffer.write(b"\xd4") + elif L == 2: + self._buffer.write(b"\xd5") + elif L == 4: + self._buffer.write(b"\xd6") + elif L == 8: + self._buffer.write(b"\xd7") + elif L == 16: + self._buffer.write(b"\xd8") + elif L <= 0xFF: + self._buffer.write(b"\xc7" + struct.pack("B", L)) + elif L <= 0xFFFF: + self._buffer.write(b"\xc8" + struct.pack(">H", L)) + else: + self._buffer.write(b"\xc9" + struct.pack(">I", L)) + self._buffer.write(struct.pack("B", typecode)) + self._buffer.write(data) + + def _pack_array_header(self, n): + if n <= 0x0F: + return self._buffer.write(struct.pack("B", 0x90 + n)) + if n <= 0xFFFF: + return self._buffer.write(struct.pack(">BH", 0xDC, n)) + if n <= 0xFFFFFFFF: + return self._buffer.write(struct.pack(">BI", 0xDD, n)) + raise ValueError("Array is too large") + + def _pack_map_header(self, n): + if n <= 0x0F: + return self._buffer.write(struct.pack("B", 0x80 + n)) + if n <= 0xFFFF: + return self._buffer.write(struct.pack(">BH", 0xDE, n)) + if n <= 0xFFFFFFFF: + return self._buffer.write(struct.pack(">BI", 0xDF, n)) + raise ValueError("Dict is too large") + + def _pack_map_pairs(self, n, pairs, nest_limit=DEFAULT_RECURSE_LIMIT): + self._pack_map_header(n) + for k, v in pairs: + self._pack(k, nest_limit - 1) + self._pack(v, nest_limit - 1) + + def _pack_raw_header(self, n): + if n <= 0x1F: + self._buffer.write(struct.pack("B", 0xA0 + n)) + elif self._use_bin_type and n <= 0xFF: + self._buffer.write(struct.pack(">BB", 0xD9, n)) + elif n <= 0xFFFF: + self._buffer.write(struct.pack(">BH", 0xDA, n)) + elif n <= 0xFFFFFFFF: + self._buffer.write(struct.pack(">BI", 0xDB, n)) + else: + raise ValueError("Raw is too large") + + def _pack_bin_header(self, n): + if not self._use_bin_type: + return self._pack_raw_header(n) + elif n <= 0xFF: + return self._buffer.write(struct.pack(">BB", 0xC4, n)) + elif n <= 0xFFFF: + return self._buffer.write(struct.pack(">BH", 0xC5, n)) + elif n <= 0xFFFFFFFF: + return self._buffer.write(struct.pack(">BI", 0xC6, n)) + else: + raise ValueError("Bin is too large") + + def bytes(self): + """Return internal buffer contents as bytes object""" + return self._buffer.getvalue() + + def reset(self): + """Reset internal buffer. + + This method is useful only when autoreset=False. + """ + self._buffer = BytesIO() + + def getbuffer(self): + """Return view of internal buffer.""" + if _USING_STRINGBUILDER: + return memoryview(self.bytes()) + else: + return self._buffer.getbuffer() diff --git a/vlmpy310/lib/python3.10/site-packages/py_cpuinfo-9.0.0.dist-info/INSTALLER b/vlmpy310/lib/python3.10/site-packages/py_cpuinfo-9.0.0.dist-info/INSTALLER new file mode 100644 index 0000000000000000000000000000000000000000..a1b589e38a32041e49332e5e81c2d363dc418d68 --- /dev/null +++ b/vlmpy310/lib/python3.10/site-packages/py_cpuinfo-9.0.0.dist-info/INSTALLER @@ -0,0 +1 @@ +pip diff --git a/vlmpy310/lib/python3.10/site-packages/py_cpuinfo-9.0.0.dist-info/LICENSE b/vlmpy310/lib/python3.10/site-packages/py_cpuinfo-9.0.0.dist-info/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..38438c121a8731fcf91c7cb6cb268baccf24fc4c --- /dev/null +++ b/vlmpy310/lib/python3.10/site-packages/py_cpuinfo-9.0.0.dist-info/LICENSE @@ -0,0 +1,20 @@ +The MIT License (MIT) + +Copyright (c) 2014-2022 Matthew Brennan Jones + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/vlmpy310/lib/python3.10/site-packages/py_cpuinfo-9.0.0.dist-info/METADATA b/vlmpy310/lib/python3.10/site-packages/py_cpuinfo-9.0.0.dist-info/METADATA new file mode 100644 index 0000000000000000000000000000000000000000..3f2fd71bbe71d450630269664cdb269151ad9b1a --- /dev/null +++ b/vlmpy310/lib/python3.10/site-packages/py_cpuinfo-9.0.0.dist-info/METADATA @@ -0,0 +1,27 @@ +Metadata-Version: 2.1 +Name: py-cpuinfo +Version: 9.0.0 +Summary: Get CPU info with pure Python +Home-page: https://github.com/workhorsy/py-cpuinfo +Author: Matthew Brennan Jones +Author-email: matthew.brennan.jones@gmail.com +License: MIT +Platform: UNKNOWN +Classifier: Development Status :: 5 - Production/Stable +Classifier: Topic :: Utilities +Classifier: License :: OSI Approved :: MIT License +Classifier: Programming Language :: Python :: 3 +License-File: LICENSE + +py-cpuinfo +========== + + +Py-cpuinfo gets CPU info with pure Python. Py-cpuinfo should work +without any extra programs or libraries, beyond what your OS provides. +It does not require any compilation(C/C++, assembly, et cetera) to use. +It works with Python 3. + +Documentation can be viewed here: https://github.com/workhorsy/py-cpuinfo + + diff --git a/vlmpy310/lib/python3.10/site-packages/py_cpuinfo-9.0.0.dist-info/RECORD b/vlmpy310/lib/python3.10/site-packages/py_cpuinfo-9.0.0.dist-info/RECORD new file mode 100644 index 0000000000000000000000000000000000000000..72f10f68350e0ada1e0a79316d32593319b73baf --- /dev/null +++ b/vlmpy310/lib/python3.10/site-packages/py_cpuinfo-9.0.0.dist-info/RECORD @@ -0,0 +1,15 @@ +../../../bin/cpuinfo,sha256=cbFrrk_uu3L9jDppjHzFSmKr4kR7CDbIh27vGRm3EsI,220 +cpuinfo/__init__.py,sha256=T6gndqGAggfJCu4_iOziTnomCN7KzaAK_OYTewE4FMA,44 +cpuinfo/__main__.py,sha256=nSxC6Hqhi-0lN7Z4WwtKdxQdf3cUJefb5hOahCzh4Yg,33 +cpuinfo/__pycache__/__init__.cpython-310.pyc,, +cpuinfo/__pycache__/__main__.cpython-310.pyc,, +cpuinfo/__pycache__/cpuinfo.cpython-310.pyc,, +cpuinfo/cpuinfo.py,sha256=HHyDlDUNovE3QzJ3hviiM1ngyOC4iD7i6oGiz2iTmVk,84388 +py_cpuinfo-9.0.0.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4 +py_cpuinfo-9.0.0.dist-info/LICENSE,sha256=3br3Y5a_XHqkWXWiHq_i4i7st9paoNt8sOYVL6r-800,1127 +py_cpuinfo-9.0.0.dist-info/METADATA,sha256=rRFelvhFdoYcXnXXYDAbgdIxQ8_iVUa5lUHgEmU3ncE,794 +py_cpuinfo-9.0.0.dist-info/RECORD,, +py_cpuinfo-9.0.0.dist-info/REQUESTED,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +py_cpuinfo-9.0.0.dist-info/WHEEL,sha256=G16H4A3IeoQmnOrYV4ueZGKSjhipXx8zc8nu9FGlvMA,92 +py_cpuinfo-9.0.0.dist-info/entry_points.txt,sha256=ZwrsclY_xUA0xJZK98bLxBdcowxnkK0ANYUT4FYcZJ8,42 +py_cpuinfo-9.0.0.dist-info/top_level.txt,sha256=XsjpunhkxD4hvznqQjrFNw0rtgizHEOGzewPZY3UEtU,8 diff --git a/vlmpy310/lib/python3.10/site-packages/py_cpuinfo-9.0.0.dist-info/REQUESTED b/vlmpy310/lib/python3.10/site-packages/py_cpuinfo-9.0.0.dist-info/REQUESTED new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/vlmpy310/lib/python3.10/site-packages/py_cpuinfo-9.0.0.dist-info/WHEEL b/vlmpy310/lib/python3.10/site-packages/py_cpuinfo-9.0.0.dist-info/WHEEL new file mode 100644 index 0000000000000000000000000000000000000000..becc9a66ea739ba941d48a749e248761cc6e658a --- /dev/null +++ b/vlmpy310/lib/python3.10/site-packages/py_cpuinfo-9.0.0.dist-info/WHEEL @@ -0,0 +1,5 @@ +Wheel-Version: 1.0 +Generator: bdist_wheel (0.37.1) +Root-Is-Purelib: true +Tag: py3-none-any + diff --git a/vlmpy310/lib/python3.10/site-packages/py_cpuinfo-9.0.0.dist-info/entry_points.txt b/vlmpy310/lib/python3.10/site-packages/py_cpuinfo-9.0.0.dist-info/entry_points.txt new file mode 100644 index 0000000000000000000000000000000000000000..c10718f4d497f1e333eaec47651ab41f5d196efc --- /dev/null +++ b/vlmpy310/lib/python3.10/site-packages/py_cpuinfo-9.0.0.dist-info/entry_points.txt @@ -0,0 +1,3 @@ +[console_scripts] +cpuinfo = cpuinfo:main + diff --git a/vlmpy310/lib/python3.10/site-packages/py_cpuinfo-9.0.0.dist-info/top_level.txt b/vlmpy310/lib/python3.10/site-packages/py_cpuinfo-9.0.0.dist-info/top_level.txt new file mode 100644 index 0000000000000000000000000000000000000000..b53b02d61061b32d70bf375f63e0e5d3ee8d4a1d --- /dev/null +++ b/vlmpy310/lib/python3.10/site-packages/py_cpuinfo-9.0.0.dist-info/top_level.txt @@ -0,0 +1 @@ +cpuinfo diff --git a/vlmpy310/lib/python3.10/site-packages/pyasn1-0.6.1.dist-info/INSTALLER b/vlmpy310/lib/python3.10/site-packages/pyasn1-0.6.1.dist-info/INSTALLER new file mode 100644 index 0000000000000000000000000000000000000000..a1b589e38a32041e49332e5e81c2d363dc418d68 --- /dev/null +++ b/vlmpy310/lib/python3.10/site-packages/pyasn1-0.6.1.dist-info/INSTALLER @@ -0,0 +1 @@ +pip diff --git a/vlmpy310/lib/python3.10/site-packages/pyasn1-0.6.1.dist-info/LICENSE.rst b/vlmpy310/lib/python3.10/site-packages/pyasn1-0.6.1.dist-info/LICENSE.rst new file mode 100644 index 0000000000000000000000000000000000000000..598b8430eff95ffcc7152feb2c9668d716f1c8eb --- /dev/null +++ b/vlmpy310/lib/python3.10/site-packages/pyasn1-0.6.1.dist-info/LICENSE.rst @@ -0,0 +1,24 @@ +Copyright (c) 2005-2020, Ilya Etingof +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. diff --git a/vlmpy310/lib/python3.10/site-packages/pyasn1-0.6.1.dist-info/METADATA b/vlmpy310/lib/python3.10/site-packages/pyasn1-0.6.1.dist-info/METADATA new file mode 100644 index 0000000000000000000000000000000000000000..8d8613e6a61c53b4cdf3bca9f2aa9b9fdb5589ce --- /dev/null +++ b/vlmpy310/lib/python3.10/site-packages/pyasn1-0.6.1.dist-info/METADATA @@ -0,0 +1,228 @@ +Metadata-Version: 2.1 +Name: pyasn1 +Version: 0.6.1 +Summary: Pure-Python implementation of ASN.1 types and DER/BER/CER codecs (X.208) +Home-page: https://github.com/pyasn1/pyasn1 +Author: Ilya Etingof +Author-email: etingof@gmail.com +Maintainer: pyasn1 maintenance organization +Maintainer-email: Christian Heimes +License: BSD-2-Clause +Project-URL: Documentation, https://pyasn1.readthedocs.io +Project-URL: Source, https://github.com/pyasn1/pyasn1 +Project-URL: Issues, https://github.com/pyasn1/pyasn1/issues +Project-URL: Changelog, https://pyasn1.readthedocs.io/en/latest/changelog.html +Platform: any +Classifier: Development Status :: 5 - Production/Stable +Classifier: Environment :: Console +Classifier: Intended Audience :: Developers +Classifier: Intended Audience :: Education +Classifier: Intended Audience :: Information Technology +Classifier: Intended Audience :: System Administrators +Classifier: Intended Audience :: Telecommunications Industry +Classifier: License :: OSI Approved :: BSD License +Classifier: Natural Language :: English +Classifier: Operating System :: OS Independent +Classifier: Programming Language :: Python :: 3 +Classifier: Programming Language :: Python :: 3.8 +Classifier: Programming Language :: Python :: 3.9 +Classifier: Programming Language :: Python :: 3.10 +Classifier: Programming Language :: Python :: 3.11 +Classifier: Programming Language :: Python :: 3.12 +Classifier: Programming Language :: Python :: 3.13 +Classifier: Programming Language :: Python :: Implementation :: CPython +Classifier: Programming Language :: Python :: Implementation :: PyPy +Classifier: Topic :: Communications +Classifier: Topic :: Software Development :: Libraries :: Python Modules +Requires-Python: >=3.8 +Description-Content-Type: text/markdown +License-File: LICENSE.rst + + +ASN.1 library for Python +------------------------ +[![PyPI](https://img.shields.io/pypi/v/pyasn1.svg?maxAge=2592000)](https://pypi.org/project/pyasn1) +[![Python Versions](https://img.shields.io/pypi/pyversions/pyasn1.svg)](https://pypi.org/project/pyasn1/) +[![Build status](https://github.com/pyasn1/pyasn1/actions/workflows/main.yml/badge.svg)](https://github.com/pyasn1/pyasn1/actions/workflows/main.yml) +[![Coverage Status](https://img.shields.io/codecov/c/github/pyasn1/pyasn1.svg)](https://codecov.io/github/pyasn1/pyasn1) +[![GitHub license](https://img.shields.io/badge/license-BSD-blue.svg)](https://raw.githubusercontent.com/pyasn1/pyasn1/master/LICENSE.txt) + +This is a free and open source implementation of ASN.1 types and codecs +as a Python package. It has been first written to support particular +protocol (SNMP) but then generalized to be suitable for a wide range +of protocols based on +[ASN.1 specification](https://www.itu.int/rec/dologin_pub.asp?lang=e&id=T-REC-X.208-198811-W!!PDF-E&type=items). + +**NOTE:** The package is now maintained by *Christian Heimes* and +*Simon Pichugin* in project https://github.com/pyasn1/pyasn1. + +Features +-------- + +* Generic implementation of ASN.1 types (X.208) +* Standards compliant BER/CER/DER codecs +* Can operate on streams of serialized data +* Dumps/loads ASN.1 structures from Python types +* 100% Python, works with Python 3.8+ +* MT-safe +* Contributed ASN.1 compiler [Asn1ate](https://github.com/kimgr/asn1ate) + +Why using pyasn1 +---------------- + +ASN.1 solves the data serialisation problem. This solution was +designed long ago by the wise Ancients. Back then, they did not +have the luxury of wasting bits. That is why ASN.1 is designed +to serialise data structures of unbounded complexity into +something compact and efficient when it comes to processing +the data. + +That probably explains why many network protocols and file formats +still rely on the 30+ years old technology. Including a number of +high-profile Internet protocols and file formats. + +Quite a number of books cover the topic of ASN.1. +[Communication between heterogeneous systems](http://www.oss.com/asn1/dubuisson.html) +by Olivier Dubuisson is one of those high quality books freely +available on the Internet. + +The pyasn1 package is designed to help Python programmers tackling +network protocols and file formats at the comfort of their Python +prompt. The tool struggles to capture all aspects of a rather +complicated ASN.1 system and to represent it on the Python terms. + +How to use pyasn1 +----------------- + +With pyasn1 you can build Python objects from ASN.1 data structures. +For example, the following ASN.1 data structure: + +```bash +Record ::= SEQUENCE { + id INTEGER, + room [0] INTEGER OPTIONAL, + house [1] INTEGER DEFAULT 0 +} +``` + +Could be expressed in pyasn1 like this: + +```python +class Record(Sequence): + componentType = NamedTypes( + NamedType('id', Integer()), + OptionalNamedType( + 'room', Integer().subtype( + implicitTag=Tag(tagClassContext, tagFormatSimple, 0) + ) + ), + DefaultedNamedType( + 'house', Integer(0).subtype( + implicitTag=Tag(tagClassContext, tagFormatSimple, 1) + ) + ) + ) +``` + +It is in the spirit of ASN.1 to take abstract data description +and turn it into a programming language specific form. +Once you have your ASN.1 data structure expressed in Python, you +can use it along the lines of similar Python type (e.g. ASN.1 +`SET` is similar to Python `dict`, `SET OF` to `list`): + +```python +>>> record = Record() +>>> record['id'] = 123 +>>> record['room'] = 321 +>>> str(record) +Record: + id=123 + room=321 +>>> +``` + +Part of the power of ASN.1 comes from its serialisation features. You +can serialise your data structure and send it over the network. + +```python +>>> from pyasn1.codec.der.encoder import encode +>>> substrate = encode(record) +>>> hexdump(substrate) +00000: 30 07 02 01 7B 80 02 01 41 +``` + +Conversely, you can turn serialised ASN.1 content, as received from +network or read from a file, into a Python object which you can +introspect, modify, encode and send back. + +```python +>>> from pyasn1.codec.der.decoder import decode +>>> received_record, rest_of_substrate = decode(substrate, asn1Spec=Record()) +>>> +>>> for field in received_record: +>>> print('{} is {}'.format(field, received_record[field])) +id is 123 +room is 321 +house is 0 +>>> +>>> record == received_record +True +>>> received_record.update(room=123) +>>> substrate = encode(received_record) +>>> hexdump(substrate) +00000: 30 06 02 01 7B 80 01 7B +``` + +The pyasn1 classes struggle to emulate their Python prototypes (e.g. int, +list, dict etc.). But ASN.1 types exhibit more complicated behaviour. +To make life easier for a Pythonista, they can turn their pyasn1 +classes into Python built-ins: + +```python +>>> from pyasn1.codec.native.encoder import encode +>>> encode(record) +{'id': 123, 'room': 321, 'house': 0} +``` + +Or vice-versa -- you can initialize an ASN.1 structure from a tree of +Python objects: + +```python +>>> from pyasn1.codec.native.decoder import decode +>>> record = decode({'id': 123, 'room': 321, 'house': 0}, asn1Spec=Record()) +>>> str(record) +Record: + id=123 + room=321 +>>> +``` + +With ASN.1 design, serialisation codecs are decoupled from data objects, +so you could turn every single ASN.1 object into many different +serialised forms. As of this moment, pyasn1 supports BER, DER, CER and +Python built-ins codecs. The extremely compact PER encoding is expected +to be introduced in the upcoming pyasn1 release. + +More information on pyasn1 APIs can be found in the +[documentation](https://pyasn1.readthedocs.io/en/latest/pyasn1/contents.html), +compiled ASN.1 modules for different protocols and file formats +could be found in the pyasn1-modules +[repo](https://github.com/pyasn1/pyasn1-modules). + +How to get pyasn1 +----------------- + +The pyasn1 package is distributed under terms and conditions of 2-clause +BSD [license](https://pyasn1.readthedocs.io/en/latest/license.html). Source code is freely +available as a GitHub [repo](https://github.com/pyasn1/pyasn1). + +You could `pip install pyasn1` or download it from [PyPI](https://pypi.org/project/pyasn1). + +If something does not work as expected, +[open an issue](https://github.com/epyasn1/pyasn1/issues) at GitHub or +post your question [on Stack Overflow](https://stackoverflow.com/questions/ask) +or try browsing pyasn1 +[mailing list archives](https://sourceforge.net/p/pyasn1/mailman/pyasn1-users/). + +Copyright (c) 2005-2020, [Ilya Etingof](mailto:etingof@gmail.com). +All rights reserved. diff --git a/vlmpy310/lib/python3.10/site-packages/pyasn1-0.6.1.dist-info/RECORD b/vlmpy310/lib/python3.10/site-packages/pyasn1-0.6.1.dist-info/RECORD new file mode 100644 index 0000000000000000000000000000000000000000..94ef838a34d249f0f0f44f9b5524abae1fc4b99b --- /dev/null +++ b/vlmpy310/lib/python3.10/site-packages/pyasn1-0.6.1.dist-info/RECORD @@ -0,0 +1,72 @@ +pyasn1-0.6.1.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4 +pyasn1-0.6.1.dist-info/LICENSE.rst,sha256=Kq1fwA9wXEoa3bg-7RCmp10oajd58M-FGdh-YrxHNf0,1334 +pyasn1-0.6.1.dist-info/METADATA,sha256=8e1KBL3kvp1MlLUqCM1uOCMaBKxwlo4N0xHXk-_sd2Y,8383 +pyasn1-0.6.1.dist-info/RECORD,, +pyasn1-0.6.1.dist-info/REQUESTED,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +pyasn1-0.6.1.dist-info/WHEEL,sha256=cVxcB9AmuTcXqmwrtPhNK88dr7IR_b6qagTj0UvIEbY,91 +pyasn1-0.6.1.dist-info/top_level.txt,sha256=dnNEQt3nIDIO5mSCCOB5obQHrjDOUsRycdBujc2vrWE,7 +pyasn1-0.6.1.dist-info/zip-safe,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1 +pyasn1/__init__.py,sha256=tc4WulUv4ZkpkmVtee9-Fsgc6gi9jZFH1VIbAvSWj3s,66 +pyasn1/__pycache__/__init__.cpython-310.pyc,, +pyasn1/__pycache__/debug.cpython-310.pyc,, +pyasn1/__pycache__/error.cpython-310.pyc,, +pyasn1/codec/__init__.py,sha256=EEDlJYS172EH39GUidN_8FbkNcWY9OVV8e30AV58pn0,59 +pyasn1/codec/__pycache__/__init__.cpython-310.pyc,, +pyasn1/codec/__pycache__/streaming.cpython-310.pyc,, +pyasn1/codec/ber/__init__.py,sha256=EEDlJYS172EH39GUidN_8FbkNcWY9OVV8e30AV58pn0,59 +pyasn1/codec/ber/__pycache__/__init__.cpython-310.pyc,, +pyasn1/codec/ber/__pycache__/decoder.cpython-310.pyc,, +pyasn1/codec/ber/__pycache__/encoder.cpython-310.pyc,, +pyasn1/codec/ber/__pycache__/eoo.cpython-310.pyc,, +pyasn1/codec/ber/decoder.py,sha256=HZWc3M9406bhApuJF-TAYpRfLWvQT54CrREDqDMyU0Y,79192 +pyasn1/codec/ber/encoder.py,sha256=eO_--5b-0HXmPpIW2JhYlejU6V7FwdORmXFyCfKHyzI,29796 +pyasn1/codec/ber/eoo.py,sha256=dspLKc2xr_W5Tbcr2WcfLd_bJLhOjotq1YxKn3DCQNI,639 +pyasn1/codec/cer/__init__.py,sha256=EEDlJYS172EH39GUidN_8FbkNcWY9OVV8e30AV58pn0,59 +pyasn1/codec/cer/__pycache__/__init__.cpython-310.pyc,, +pyasn1/codec/cer/__pycache__/decoder.cpython-310.pyc,, +pyasn1/codec/cer/__pycache__/encoder.cpython-310.pyc,, +pyasn1/codec/cer/decoder.py,sha256=S279_LRjwHyTUBuv4LPYOpib1X4hLmBh_3et49ocm4A,4589 +pyasn1/codec/cer/encoder.py,sha256=vsGrgOHJokTeZqBJwNGokejvqH5EfTvy8hExd_j5bbY,9838 +pyasn1/codec/der/__init__.py,sha256=EEDlJYS172EH39GUidN_8FbkNcWY9OVV8e30AV58pn0,59 +pyasn1/codec/der/__pycache__/__init__.cpython-310.pyc,, +pyasn1/codec/der/__pycache__/decoder.cpython-310.pyc,, +pyasn1/codec/der/__pycache__/encoder.cpython-310.pyc,, +pyasn1/codec/der/decoder.py,sha256=GOpKZ1wFRYU0EEF3kSmIaMfe1h2w17VdGu57AHUqQFw,3428 +pyasn1/codec/der/encoder.py,sha256=ldxrpvXDFsxLxtvN7aiR61JNNtainNagZCSpsZM9DZs,3479 +pyasn1/codec/native/__init__.py,sha256=EEDlJYS172EH39GUidN_8FbkNcWY9OVV8e30AV58pn0,59 +pyasn1/codec/native/__pycache__/__init__.cpython-310.pyc,, +pyasn1/codec/native/__pycache__/decoder.cpython-310.pyc,, +pyasn1/codec/native/__pycache__/encoder.cpython-310.pyc,, +pyasn1/codec/native/decoder.py,sha256=2vK9B0AJzLT2exSNtlCUlYzZvm0E7IzUU8Ygg_lLxNo,9118 +pyasn1/codec/native/encoder.py,sha256=C24L5FkwhXPSRytaLlcL0uuYDTC2BXD75ZwH_bCqKX8,9184 +pyasn1/codec/streaming.py,sha256=Vp-VDh0SlA5h7T133rne9UNlJlqv2ohpUzVlSCGjq24,6377 +pyasn1/compat/__init__.py,sha256=-9FOJV1STFBatf2pVRiOYn14GmCKC8RY3TYCxOqfRXY,112 +pyasn1/compat/__pycache__/__init__.cpython-310.pyc,, +pyasn1/compat/__pycache__/integer.cpython-310.pyc,, +pyasn1/compat/integer.py,sha256=lMXqbJBTyjg34Rhx6JlFcXyoQxDaeXGxhaIIab86hX8,404 +pyasn1/debug.py,sha256=u-WmIFfewqp0041ezvtTjvhZcU9K14OI6p00ArXZ63g,3494 +pyasn1/error.py,sha256=e352oqW33seeh2MbIF27sFSgpiegjstabCMFx2piR0M,3258 +pyasn1/type/__init__.py,sha256=EEDlJYS172EH39GUidN_8FbkNcWY9OVV8e30AV58pn0,59 +pyasn1/type/__pycache__/__init__.cpython-310.pyc,, +pyasn1/type/__pycache__/base.cpython-310.pyc,, +pyasn1/type/__pycache__/char.cpython-310.pyc,, +pyasn1/type/__pycache__/constraint.cpython-310.pyc,, +pyasn1/type/__pycache__/error.cpython-310.pyc,, +pyasn1/type/__pycache__/namedtype.cpython-310.pyc,, +pyasn1/type/__pycache__/namedval.cpython-310.pyc,, +pyasn1/type/__pycache__/opentype.cpython-310.pyc,, +pyasn1/type/__pycache__/tag.cpython-310.pyc,, +pyasn1/type/__pycache__/tagmap.cpython-310.pyc,, +pyasn1/type/__pycache__/univ.cpython-310.pyc,, +pyasn1/type/__pycache__/useful.cpython-310.pyc,, +pyasn1/type/base.py,sha256=tjBRvXIQSiHES5-e5rBbsnn5CtIvBgCuflujDbdrtkM,22050 +pyasn1/type/char.py,sha256=Rvj5ypQLPNXcdHkfUV8nul1XX66R_Akn0g2HUyLj1qY,9438 +pyasn1/type/constraint.py,sha256=jmrt5esLa095XdfS0beqaoRuUjnuHiTKdkTdCcKx1FI,21915 +pyasn1/type/error.py,sha256=2kwYYkbd2jXIVEE56ThLRmBEOGZfafwogEOo-9RV_GY,259 +pyasn1/type/namedtype.py,sha256=jnTClIUoRZi025GTY9GlMlMI-j5dqEcv_ilzZ7i0hUQ,16179 +pyasn1/type/namedval.py,sha256=84u6wKOfte7U47aWrFqIZRM3tO2ryivpsBqVblPezuc,4899 +pyasn1/type/opentype.py,sha256=jjqSbTgAaCxlSHSf66YcLbrxtfh_98nAx2v8wzW35MU,2861 +pyasn1/type/tag.py,sha256=hqIuspUhc5QwN182LeQMc23W_vFNTgASvnUUSX4SPHM,9497 +pyasn1/type/tagmap.py,sha256=alJ9ZfDGTAsPeygHT6yONTagUkCjlgij82YXpPaQ_-8,3000 +pyasn1/type/univ.py,sha256=Bnu2gHdA84UXMLtgb4LXbHI5TYw-kKljlsJ7dkJ8KfI,109212 +pyasn1/type/useful.py,sha256=-J7ej0hqdjF29h150dtNmIIcGcMBg_y-nKqcozvk-48,5284 diff --git a/vlmpy310/lib/python3.10/site-packages/pyasn1-0.6.1.dist-info/REQUESTED b/vlmpy310/lib/python3.10/site-packages/pyasn1-0.6.1.dist-info/REQUESTED new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/vlmpy310/lib/python3.10/site-packages/pyasn1-0.6.1.dist-info/WHEEL b/vlmpy310/lib/python3.10/site-packages/pyasn1-0.6.1.dist-info/WHEEL new file mode 100644 index 0000000000000000000000000000000000000000..0fde4dd96cac9c2431a08860c658f1a5789618f6 --- /dev/null +++ b/vlmpy310/lib/python3.10/site-packages/pyasn1-0.6.1.dist-info/WHEEL @@ -0,0 +1,5 @@ +Wheel-Version: 1.0 +Generator: setuptools (74.1.2) +Root-Is-Purelib: true +Tag: py3-none-any + diff --git a/vlmpy310/lib/python3.10/site-packages/pyasn1-0.6.1.dist-info/top_level.txt b/vlmpy310/lib/python3.10/site-packages/pyasn1-0.6.1.dist-info/top_level.txt new file mode 100644 index 0000000000000000000000000000000000000000..38fe4145754bf81c4dea2535da2bd438975e7da5 --- /dev/null +++ b/vlmpy310/lib/python3.10/site-packages/pyasn1-0.6.1.dist-info/top_level.txt @@ -0,0 +1 @@ +pyasn1 diff --git a/vlmpy310/lib/python3.10/site-packages/pyasn1-0.6.1.dist-info/zip-safe b/vlmpy310/lib/python3.10/site-packages/pyasn1-0.6.1.dist-info/zip-safe new file mode 100644 index 0000000000000000000000000000000000000000..8b137891791fe96927ad78e64b0aad7bded08bdc --- /dev/null +++ b/vlmpy310/lib/python3.10/site-packages/pyasn1-0.6.1.dist-info/zip-safe @@ -0,0 +1 @@ + diff --git a/vlmpy310/lib/python3.10/site-packages/requests_oauthlib/__init__.py b/vlmpy310/lib/python3.10/site-packages/requests_oauthlib/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..865d72fb768b4cac4912efd3afc62af2c774dbab --- /dev/null +++ b/vlmpy310/lib/python3.10/site-packages/requests_oauthlib/__init__.py @@ -0,0 +1,20 @@ +# ruff: noqa: F401 +import logging + +from .oauth1_auth import OAuth1 +from .oauth1_session import OAuth1Session +from .oauth2_auth import OAuth2 +from .oauth2_session import OAuth2Session, TokenUpdated + +__version__ = "2.0.0" + +import requests + +if requests.__version__ < "2.0.0": + msg = ( + "You are using requests version %s, which is older than " + "requests-oauthlib expects, please upgrade to 2.0.0 or later." + ) + raise Warning(msg % requests.__version__) + +logging.getLogger("requests_oauthlib").addHandler(logging.NullHandler()) diff --git a/vlmpy310/lib/python3.10/site-packages/requests_oauthlib/oauth1_auth.py b/vlmpy310/lib/python3.10/site-packages/requests_oauthlib/oauth1_auth.py new file mode 100644 index 0000000000000000000000000000000000000000..f8c0bd6e74e7caffb99874b62d363df92cd8f1a5 --- /dev/null +++ b/vlmpy310/lib/python3.10/site-packages/requests_oauthlib/oauth1_auth.py @@ -0,0 +1,112 @@ +# -*- coding: utf-8 -*- +import logging + +from oauthlib.common import extract_params +from oauthlib.oauth1 import Client, SIGNATURE_HMAC, SIGNATURE_TYPE_AUTH_HEADER +from oauthlib.oauth1 import SIGNATURE_TYPE_BODY +from requests.utils import to_native_string +from requests.auth import AuthBase + +CONTENT_TYPE_FORM_URLENCODED = "application/x-www-form-urlencoded" +CONTENT_TYPE_MULTI_PART = "multipart/form-data" + + +log = logging.getLogger(__name__) + +# OBS!: Correct signing of requests are conditional on invoking OAuth1 +# as the last step of preparing a request, or at least having the +# content-type set properly. +class OAuth1(AuthBase): + """Signs the request using OAuth 1 (RFC5849)""" + + client_class = Client + + def __init__( + self, + client_key, + client_secret=None, + resource_owner_key=None, + resource_owner_secret=None, + callback_uri=None, + signature_method=SIGNATURE_HMAC, + signature_type=SIGNATURE_TYPE_AUTH_HEADER, + rsa_key=None, + verifier=None, + decoding="utf-8", + client_class=None, + force_include_body=False, + **kwargs + ): + + try: + signature_type = signature_type.upper() + except AttributeError: + pass + + client_class = client_class or self.client_class + + self.force_include_body = force_include_body + + self.client = client_class( + client_key, + client_secret, + resource_owner_key, + resource_owner_secret, + callback_uri, + signature_method, + signature_type, + rsa_key, + verifier, + decoding=decoding, + **kwargs + ) + + def __call__(self, r): + """Add OAuth parameters to the request. + + Parameters may be included from the body if the content-type is + urlencoded, if no content type is set a guess is made. + """ + # Overwriting url is safe here as request will not modify it past + # this point. + log.debug("Signing request %s using client %s", r, self.client) + + content_type = r.headers.get("Content-Type", "") + if ( + not content_type + and extract_params(r.body) + or self.client.signature_type == SIGNATURE_TYPE_BODY + ): + content_type = CONTENT_TYPE_FORM_URLENCODED + if not isinstance(content_type, str): + content_type = content_type.decode("utf-8") + + is_form_encoded = CONTENT_TYPE_FORM_URLENCODED in content_type + + log.debug( + "Including body in call to sign: %s", + is_form_encoded or self.force_include_body, + ) + + if is_form_encoded: + r.headers["Content-Type"] = CONTENT_TYPE_FORM_URLENCODED + r.url, headers, r.body = self.client.sign( + str(r.url), str(r.method), r.body or "", r.headers + ) + elif self.force_include_body: + # To allow custom clients to work on non form encoded bodies. + r.url, headers, r.body = self.client.sign( + str(r.url), str(r.method), r.body or "", r.headers + ) + else: + # Omit body data in the signing of non form-encoded requests + r.url, headers, _ = self.client.sign( + str(r.url), str(r.method), None, r.headers + ) + + r.prepare_headers(headers) + r.url = to_native_string(r.url) + log.debug("Updated url: %s", r.url) + log.debug("Updated headers: %s", headers) + log.debug("Updated body: %r", r.body) + return r diff --git a/vlmpy310/lib/python3.10/site-packages/requests_oauthlib/oauth1_session.py b/vlmpy310/lib/python3.10/site-packages/requests_oauthlib/oauth1_session.py new file mode 100644 index 0000000000000000000000000000000000000000..7625c8084eecd402705e4bb76ea0604dcaa20560 --- /dev/null +++ b/vlmpy310/lib/python3.10/site-packages/requests_oauthlib/oauth1_session.py @@ -0,0 +1,395 @@ +from urllib.parse import urlparse + +import logging + +from oauthlib.common import add_params_to_uri +from oauthlib.common import urldecode as _urldecode +from oauthlib.oauth1 import SIGNATURE_HMAC, SIGNATURE_RSA, SIGNATURE_TYPE_AUTH_HEADER +import requests + +from . import OAuth1 + + +log = logging.getLogger(__name__) + + +def urldecode(body): + """Parse query or json to python dictionary""" + try: + return _urldecode(body) + except Exception: + import json + + return json.loads(body) + + +class TokenRequestDenied(ValueError): + def __init__(self, message, response): + super(TokenRequestDenied, self).__init__(message) + self.response = response + + @property + def status_code(self): + """For backwards-compatibility purposes""" + return self.response.status_code + + +class TokenMissing(ValueError): + def __init__(self, message, response): + super(TokenMissing, self).__init__(message) + self.response = response + + +class VerifierMissing(ValueError): + pass + + +class OAuth1Session(requests.Session): + """Request signing and convenience methods for the oauth dance. + + What is the difference between OAuth1Session and OAuth1? + + OAuth1Session actually uses OAuth1 internally and its purpose is to assist + in the OAuth workflow through convenience methods to prepare authorization + URLs and parse the various token and redirection responses. It also provide + rudimentary validation of responses. + + An example of the OAuth workflow using a basic CLI app and Twitter. + + >>> # Credentials obtained during the registration. + >>> client_key = 'client key' + >>> client_secret = 'secret' + >>> callback_uri = 'https://127.0.0.1/callback' + >>> + >>> # Endpoints found in the OAuth provider API documentation + >>> request_token_url = 'https://api.twitter.com/oauth/request_token' + >>> authorization_url = 'https://api.twitter.com/oauth/authorize' + >>> access_token_url = 'https://api.twitter.com/oauth/access_token' + >>> + >>> oauth_session = OAuth1Session(client_key,client_secret=client_secret, callback_uri=callback_uri) + >>> + >>> # First step, fetch the request token. + >>> oauth_session.fetch_request_token(request_token_url) + { + 'oauth_token': 'kjerht2309u', + 'oauth_token_secret': 'lsdajfh923874', + } + >>> + >>> # Second step. Follow this link and authorize + >>> oauth_session.authorization_url(authorization_url) + 'https://api.twitter.com/oauth/authorize?oauth_token=sdf0o9823sjdfsdf&oauth_callback=https%3A%2F%2F127.0.0.1%2Fcallback' + >>> + >>> # Third step. Fetch the access token + >>> redirect_response = input('Paste the full redirect URL here.') + >>> oauth_session.parse_authorization_response(redirect_response) + { + 'oauth_token: 'kjerht2309u', + 'oauth_token_secret: 'lsdajfh923874', + 'oauth_verifier: 'w34o8967345', + } + >>> oauth_session.fetch_access_token(access_token_url) + { + 'oauth_token': 'sdf0o9823sjdfsdf', + 'oauth_token_secret': '2kjshdfp92i34asdasd', + } + >>> # Done. You can now make OAuth requests. + >>> status_url = 'http://api.twitter.com/1/statuses/update.json' + >>> new_status = {'status': 'hello world!'} + >>> oauth_session.post(status_url, data=new_status) + + """ + + def __init__( + self, + client_key, + client_secret=None, + resource_owner_key=None, + resource_owner_secret=None, + callback_uri=None, + signature_method=SIGNATURE_HMAC, + signature_type=SIGNATURE_TYPE_AUTH_HEADER, + rsa_key=None, + verifier=None, + client_class=None, + force_include_body=False, + **kwargs + ): + """Construct the OAuth 1 session. + + :param client_key: A client specific identifier. + :param client_secret: A client specific secret used to create HMAC and + plaintext signatures. + :param resource_owner_key: A resource owner key, also referred to as + request token or access token depending on + when in the workflow it is used. + :param resource_owner_secret: A resource owner secret obtained with + either a request or access token. Often + referred to as token secret. + :param callback_uri: The URL the user is redirect back to after + authorization. + :param signature_method: Signature methods determine how the OAuth + signature is created. The three options are + oauthlib.oauth1.SIGNATURE_HMAC (default), + oauthlib.oauth1.SIGNATURE_RSA and + oauthlib.oauth1.SIGNATURE_PLAIN. + :param signature_type: Signature type decides where the OAuth + parameters are added. Either in the + Authorization header (default) or to the URL + query parameters or the request body. Defined as + oauthlib.oauth1.SIGNATURE_TYPE_AUTH_HEADER, + oauthlib.oauth1.SIGNATURE_TYPE_QUERY and + oauthlib.oauth1.SIGNATURE_TYPE_BODY + respectively. + :param rsa_key: The private RSA key as a string. Can only be used with + signature_method=oauthlib.oauth1.SIGNATURE_RSA. + :param verifier: A verifier string to prove authorization was granted. + :param client_class: A subclass of `oauthlib.oauth1.Client` to use with + `requests_oauthlib.OAuth1` instead of the default + :param force_include_body: Always include the request body in the + signature creation. + :param **kwargs: Additional keyword arguments passed to `OAuth1` + """ + super(OAuth1Session, self).__init__() + self._client = OAuth1( + client_key, + client_secret=client_secret, + resource_owner_key=resource_owner_key, + resource_owner_secret=resource_owner_secret, + callback_uri=callback_uri, + signature_method=signature_method, + signature_type=signature_type, + rsa_key=rsa_key, + verifier=verifier, + client_class=client_class, + force_include_body=force_include_body, + **kwargs + ) + self.auth = self._client + + @property + def token(self): + oauth_token = self._client.client.resource_owner_key + oauth_token_secret = self._client.client.resource_owner_secret + oauth_verifier = self._client.client.verifier + + token_dict = {} + if oauth_token: + token_dict["oauth_token"] = oauth_token + if oauth_token_secret: + token_dict["oauth_token_secret"] = oauth_token_secret + if oauth_verifier: + token_dict["oauth_verifier"] = oauth_verifier + + return token_dict + + @token.setter + def token(self, value): + self._populate_attributes(value) + + @property + def authorized(self): + """Boolean that indicates whether this session has an OAuth token + or not. If `self.authorized` is True, you can reasonably expect + OAuth-protected requests to the resource to succeed. If + `self.authorized` is False, you need the user to go through the OAuth + authentication dance before OAuth-protected requests to the resource + will succeed. + """ + if self._client.client.signature_method == SIGNATURE_RSA: + # RSA only uses resource_owner_key + return bool(self._client.client.resource_owner_key) + else: + # other methods of authentication use all three pieces + return ( + bool(self._client.client.client_secret) + and bool(self._client.client.resource_owner_key) + and bool(self._client.client.resource_owner_secret) + ) + + def authorization_url(self, url, request_token=None, **kwargs): + """Create an authorization URL by appending request_token and optional + kwargs to url. + + This is the second step in the OAuth 1 workflow. The user should be + redirected to this authorization URL, grant access to you, and then + be redirected back to you. The redirection back can either be specified + during client registration or by supplying a callback URI per request. + + :param url: The authorization endpoint URL. + :param request_token: The previously obtained request token. + :param kwargs: Optional parameters to append to the URL. + :returns: The authorization URL with new parameters embedded. + + An example using a registered default callback URI. + + >>> request_token_url = 'https://api.twitter.com/oauth/request_token' + >>> authorization_url = 'https://api.twitter.com/oauth/authorize' + >>> oauth_session = OAuth1Session('client-key', client_secret='secret') + >>> oauth_session.fetch_request_token(request_token_url) + { + 'oauth_token': 'sdf0o9823sjdfsdf', + 'oauth_token_secret': '2kjshdfp92i34asdasd', + } + >>> oauth_session.authorization_url(authorization_url) + 'https://api.twitter.com/oauth/authorize?oauth_token=sdf0o9823sjdfsdf' + >>> oauth_session.authorization_url(authorization_url, foo='bar') + 'https://api.twitter.com/oauth/authorize?oauth_token=sdf0o9823sjdfsdf&foo=bar' + + An example using an explicit callback URI. + + >>> request_token_url = 'https://api.twitter.com/oauth/request_token' + >>> authorization_url = 'https://api.twitter.com/oauth/authorize' + >>> oauth_session = OAuth1Session('client-key', client_secret='secret', callback_uri='https://127.0.0.1/callback') + >>> oauth_session.fetch_request_token(request_token_url) + { + 'oauth_token': 'sdf0o9823sjdfsdf', + 'oauth_token_secret': '2kjshdfp92i34asdasd', + } + >>> oauth_session.authorization_url(authorization_url) + 'https://api.twitter.com/oauth/authorize?oauth_token=sdf0o9823sjdfsdf&oauth_callback=https%3A%2F%2F127.0.0.1%2Fcallback' + """ + kwargs["oauth_token"] = request_token or self._client.client.resource_owner_key + log.debug("Adding parameters %s to url %s", kwargs, url) + return add_params_to_uri(url, kwargs.items()) + + def fetch_request_token(self, url, realm=None, **request_kwargs): + """Fetch a request token. + + This is the first step in the OAuth 1 workflow. A request token is + obtained by making a signed post request to url. The token is then + parsed from the application/x-www-form-urlencoded response and ready + to be used to construct an authorization url. + + :param url: The request token endpoint URL. + :param realm: A list of realms to request access to. + :param request_kwargs: Optional arguments passed to ''post'' + function in ''requests.Session'' + :returns: The response in dict format. + + Note that a previously set callback_uri will be reset for your + convenience, or else signature creation will be incorrect on + consecutive requests. + + >>> request_token_url = 'https://api.twitter.com/oauth/request_token' + >>> oauth_session = OAuth1Session('client-key', client_secret='secret') + >>> oauth_session.fetch_request_token(request_token_url) + { + 'oauth_token': 'sdf0o9823sjdfsdf', + 'oauth_token_secret': '2kjshdfp92i34asdasd', + } + """ + self._client.client.realm = " ".join(realm) if realm else None + token = self._fetch_token(url, **request_kwargs) + log.debug("Resetting callback_uri and realm (not needed in next phase).") + self._client.client.callback_uri = None + self._client.client.realm = None + return token + + def fetch_access_token(self, url, verifier=None, **request_kwargs): + """Fetch an access token. + + This is the final step in the OAuth 1 workflow. An access token is + obtained using all previously obtained credentials, including the + verifier from the authorization step. + + Note that a previously set verifier will be reset for your + convenience, or else signature creation will be incorrect on + consecutive requests. + + >>> access_token_url = 'https://api.twitter.com/oauth/access_token' + >>> redirect_response = 'https://127.0.0.1/callback?oauth_token=kjerht2309uf&oauth_token_secret=lsdajfh923874&oauth_verifier=w34o8967345' + >>> oauth_session = OAuth1Session('client-key', client_secret='secret') + >>> oauth_session.parse_authorization_response(redirect_response) + { + 'oauth_token: 'kjerht2309u', + 'oauth_token_secret: 'lsdajfh923874', + 'oauth_verifier: 'w34o8967345', + } + >>> oauth_session.fetch_access_token(access_token_url) + { + 'oauth_token': 'sdf0o9823sjdfsdf', + 'oauth_token_secret': '2kjshdfp92i34asdasd', + } + """ + if verifier: + self._client.client.verifier = verifier + if not getattr(self._client.client, "verifier", None): + raise VerifierMissing("No client verifier has been set.") + token = self._fetch_token(url, **request_kwargs) + log.debug("Resetting verifier attribute, should not be used anymore.") + self._client.client.verifier = None + return token + + def parse_authorization_response(self, url): + """Extract parameters from the post authorization redirect response URL. + + :param url: The full URL that resulted from the user being redirected + back from the OAuth provider to you, the client. + :returns: A dict of parameters extracted from the URL. + + >>> redirect_response = 'https://127.0.0.1/callback?oauth_token=kjerht2309uf&oauth_token_secret=lsdajfh923874&oauth_verifier=w34o8967345' + >>> oauth_session = OAuth1Session('client-key', client_secret='secret') + >>> oauth_session.parse_authorization_response(redirect_response) + { + 'oauth_token: 'kjerht2309u', + 'oauth_token_secret: 'lsdajfh923874', + 'oauth_verifier: 'w34o8967345', + } + """ + log.debug("Parsing token from query part of url %s", url) + token = dict(urldecode(urlparse(url).query)) + log.debug("Updating internal client token attribute.") + self._populate_attributes(token) + self.token = token + return token + + def _populate_attributes(self, token): + if "oauth_token" in token: + self._client.client.resource_owner_key = token["oauth_token"] + else: + raise TokenMissing( + "Response does not contain a token: {resp}".format(resp=token), token + ) + if "oauth_token_secret" in token: + self._client.client.resource_owner_secret = token["oauth_token_secret"] + if "oauth_verifier" in token: + self._client.client.verifier = token["oauth_verifier"] + + def _fetch_token(self, url, **request_kwargs): + log.debug("Fetching token from %s using client %s", url, self._client.client) + r = self.post(url, **request_kwargs) + + if r.status_code >= 400: + error = "Token request failed with code %s, response was '%s'." + raise TokenRequestDenied(error % (r.status_code, r.text), r) + + log.debug('Decoding token from response "%s"', r.text) + try: + token = dict(urldecode(r.text.strip())) + except ValueError as e: + error = ( + "Unable to decode token from token response. " + "This is commonly caused by an unsuccessful request where" + " a non urlencoded error message is returned. " + "The decoding error was %s" + "" % e + ) + raise ValueError(error) + + log.debug("Obtained token %s", token) + log.debug("Updating internal client attributes from token data.") + self._populate_attributes(token) + self.token = token + return token + + def rebuild_auth(self, prepared_request, response): + """ + When being redirected we should always strip Authorization + header, since nonce may not be reused as per OAuth spec. + """ + if "Authorization" in prepared_request.headers: + # If we get redirected to a new host, we should strip out + # any authentication headers. + prepared_request.headers.pop("Authorization", True) + prepared_request.prepare_auth(self.auth) + return diff --git a/vlmpy310/lib/python3.10/site-packages/requests_oauthlib/oauth2_session.py b/vlmpy310/lib/python3.10/site-packages/requests_oauthlib/oauth2_session.py new file mode 100644 index 0000000000000000000000000000000000000000..93cc4d7bbd2af7e74e1c8d79a805d3d5540b1a5d --- /dev/null +++ b/vlmpy310/lib/python3.10/site-packages/requests_oauthlib/oauth2_session.py @@ -0,0 +1,587 @@ +import logging + +from oauthlib.common import generate_token, urldecode +from oauthlib.oauth2 import WebApplicationClient, InsecureTransportError +from oauthlib.oauth2 import LegacyApplicationClient +from oauthlib.oauth2 import TokenExpiredError, is_secure_transport +import requests + +log = logging.getLogger(__name__) + + +class TokenUpdated(Warning): + def __init__(self, token): + super(TokenUpdated, self).__init__() + self.token = token + + +class OAuth2Session(requests.Session): + """Versatile OAuth 2 extension to :class:`requests.Session`. + + Supports any grant type adhering to :class:`oauthlib.oauth2.Client` spec + including the four core OAuth 2 grants. + + Can be used to create authorization urls, fetch tokens and access protected + resources using the :class:`requests.Session` interface you are used to. + + - :class:`oauthlib.oauth2.WebApplicationClient` (default): Authorization Code Grant + - :class:`oauthlib.oauth2.MobileApplicationClient`: Implicit Grant + - :class:`oauthlib.oauth2.LegacyApplicationClient`: Password Credentials Grant + - :class:`oauthlib.oauth2.BackendApplicationClient`: Client Credentials Grant + + Note that the only time you will be using Implicit Grant from python is if + you are driving a user agent able to obtain URL fragments. + """ + + def __init__( + self, + client_id=None, + client=None, + auto_refresh_url=None, + auto_refresh_kwargs=None, + scope=None, + redirect_uri=None, + token=None, + state=None, + token_updater=None, + pkce=None, + **kwargs + ): + """Construct a new OAuth 2 client session. + + :param client_id: Client id obtained during registration + :param client: :class:`oauthlib.oauth2.Client` to be used. Default is + WebApplicationClient which is useful for any + hosted application but not mobile or desktop. + :param scope: List of scopes you wish to request access to + :param redirect_uri: Redirect URI you registered as callback + :param token: Token dictionary, must include access_token + and token_type. + :param state: State string used to prevent CSRF. This will be given + when creating the authorization url and must be supplied + when parsing the authorization response. + Can be either a string or a no argument callable. + :auto_refresh_url: Refresh token endpoint URL, must be HTTPS. Supply + this if you wish the client to automatically refresh + your access tokens. + :auto_refresh_kwargs: Extra arguments to pass to the refresh token + endpoint. + :token_updater: Method with one argument, token, to be used to update + your token database on automatic token refresh. If not + set a TokenUpdated warning will be raised when a token + has been refreshed. This warning will carry the token + in its token argument. + :param pkce: Set "S256" or "plain" to enable PKCE. Default is disabled. + :param kwargs: Arguments to pass to the Session constructor. + """ + super(OAuth2Session, self).__init__(**kwargs) + self._client = client or WebApplicationClient(client_id, token=token) + self.token = token or {} + self._scope = scope + self.redirect_uri = redirect_uri + self.state = state or generate_token + self._state = state + self.auto_refresh_url = auto_refresh_url + self.auto_refresh_kwargs = auto_refresh_kwargs or {} + self.token_updater = token_updater + self._pkce = pkce + + if self._pkce not in ["S256", "plain", None]: + raise AttributeError("Wrong value for {}(.., pkce={})".format(self.__class__, self._pkce)) + + # Ensure that requests doesn't do any automatic auth. See #278. + # The default behavior can be re-enabled by setting auth to None. + self.auth = lambda r: r + + # Allow customizations for non compliant providers through various + # hooks to adjust requests and responses. + self.compliance_hook = { + "access_token_response": set(), + "refresh_token_response": set(), + "protected_request": set(), + "refresh_token_request": set(), + "access_token_request": set(), + } + + @property + def scope(self): + """By default the scope from the client is used, except if overridden""" + if self._scope is not None: + return self._scope + elif self._client is not None: + return self._client.scope + else: + return None + + @scope.setter + def scope(self, scope): + self._scope = scope + + def new_state(self): + """Generates a state string to be used in authorizations.""" + try: + self._state = self.state() + log.debug("Generated new state %s.", self._state) + except TypeError: + self._state = self.state + log.debug("Re-using previously supplied state %s.", self._state) + return self._state + + @property + def client_id(self): + return getattr(self._client, "client_id", None) + + @client_id.setter + def client_id(self, value): + self._client.client_id = value + + @client_id.deleter + def client_id(self): + del self._client.client_id + + @property + def token(self): + return getattr(self._client, "token", None) + + @token.setter + def token(self, value): + self._client.token = value + self._client.populate_token_attributes(value) + + @property + def access_token(self): + return getattr(self._client, "access_token", None) + + @access_token.setter + def access_token(self, value): + self._client.access_token = value + + @access_token.deleter + def access_token(self): + del self._client.access_token + + @property + def authorized(self): + """Boolean that indicates whether this session has an OAuth token + or not. If `self.authorized` is True, you can reasonably expect + OAuth-protected requests to the resource to succeed. If + `self.authorized` is False, you need the user to go through the OAuth + authentication dance before OAuth-protected requests to the resource + will succeed. + """ + return bool(self.access_token) + + def authorization_url(self, url, state=None, **kwargs): + """Form an authorization URL. + + :param url: Authorization endpoint url, must be HTTPS. + :param state: An optional state string for CSRF protection. If not + given it will be generated for you. + :param kwargs: Extra parameters to include. + :return: authorization_url, state + """ + state = state or self.new_state() + if self._pkce: + self._code_verifier = self._client.create_code_verifier(43) + kwargs["code_challenge_method"] = self._pkce + kwargs["code_challenge"] = self._client.create_code_challenge( + code_verifier=self._code_verifier, + code_challenge_method=self._pkce + ) + return ( + self._client.prepare_request_uri( + url, + redirect_uri=self.redirect_uri, + scope=self.scope, + state=state, + **kwargs + ), + state, + ) + + def fetch_token( + self, + token_url, + code=None, + authorization_response=None, + body="", + auth=None, + username=None, + password=None, + method="POST", + force_querystring=False, + timeout=None, + headers=None, + verify=None, + proxies=None, + include_client_id=None, + client_secret=None, + cert=None, + **kwargs + ): + """Generic method for fetching an access token from the token endpoint. + + If you are using the MobileApplicationClient you will want to use + `token_from_fragment` instead of `fetch_token`. + + The current implementation enforces the RFC guidelines. + + :param token_url: Token endpoint URL, must use HTTPS. + :param code: Authorization code (used by WebApplicationClients). + :param authorization_response: Authorization response URL, the callback + URL of the request back to you. Used by + WebApplicationClients instead of code. + :param body: Optional application/x-www-form-urlencoded body to add the + include in the token request. Prefer kwargs over body. + :param auth: An auth tuple or method as accepted by `requests`. + :param username: Username required by LegacyApplicationClients to appear + in the request body. + :param password: Password required by LegacyApplicationClients to appear + in the request body. + :param method: The HTTP method used to make the request. Defaults + to POST, but may also be GET. Other methods should + be added as needed. + :param force_querystring: If True, force the request body to be sent + in the querystring instead. + :param timeout: Timeout of the request in seconds. + :param headers: Dict to default request headers with. + :param verify: Verify SSL certificate. + :param proxies: The `proxies` argument is passed onto `requests`. + :param include_client_id: Should the request body include the + `client_id` parameter. Default is `None`, + which will attempt to autodetect. This can be + forced to always include (True) or never + include (False). + :param client_secret: The `client_secret` paired to the `client_id`. + This is generally required unless provided in the + `auth` tuple. If the value is `None`, it will be + omitted from the request, however if the value is + an empty string, an empty string will be sent. + :param cert: Client certificate to send for OAuth 2.0 Mutual-TLS Client + Authentication (draft-ietf-oauth-mtls). Can either be the + path of a file containing the private key and certificate or + a tuple of two filenames for certificate and key. + :param kwargs: Extra parameters to include in the token request. + :return: A token dict + """ + if not is_secure_transport(token_url): + raise InsecureTransportError() + + if not code and authorization_response: + self._client.parse_request_uri_response( + authorization_response, state=self._state + ) + code = self._client.code + elif not code and isinstance(self._client, WebApplicationClient): + code = self._client.code + if not code: + raise ValueError( + "Please supply either code or " "authorization_response parameters." + ) + + if self._pkce: + if self._code_verifier is None: + raise ValueError( + "Code verifier is not found, authorization URL must be generated before" + ) + kwargs["code_verifier"] = self._code_verifier + + # Earlier versions of this library build an HTTPBasicAuth header out of + # `username` and `password`. The RFC states, however these attributes + # must be in the request body and not the header. + # If an upstream server is not spec compliant and requires them to + # appear as an Authorization header, supply an explicit `auth` header + # to this function. + # This check will allow for empty strings, but not `None`. + # + # References + # 4.3.2 - Resource Owner Password Credentials Grant + # https://tools.ietf.org/html/rfc6749#section-4.3.2 + + if isinstance(self._client, LegacyApplicationClient): + if username is None: + raise ValueError( + "`LegacyApplicationClient` requires both the " + "`username` and `password` parameters." + ) + if password is None: + raise ValueError( + "The required parameter `username` was supplied, " + "but `password` was not." + ) + + # merge username and password into kwargs for `prepare_request_body` + if username is not None: + kwargs["username"] = username + if password is not None: + kwargs["password"] = password + + # is an auth explicitly supplied? + if auth is not None: + # if we're dealing with the default of `include_client_id` (None): + # we will assume the `auth` argument is for an RFC compliant server + # and we should not send the `client_id` in the body. + # This approach allows us to still force the client_id by submitting + # `include_client_id=True` along with an `auth` object. + if include_client_id is None: + include_client_id = False + + # otherwise we may need to create an auth header + else: + # since we don't have an auth header, we MAY need to create one + # it is possible that we want to send the `client_id` in the body + # if so, `include_client_id` should be set to True + # otherwise, we will generate an auth header + if include_client_id is not True: + client_id = self.client_id + if client_id: + log.debug( + 'Encoding `client_id` "%s" with `client_secret` ' + "as Basic auth credentials.", + client_id, + ) + client_secret = client_secret if client_secret is not None else "" + auth = requests.auth.HTTPBasicAuth(client_id, client_secret) + + if include_client_id: + # this was pulled out of the params + # it needs to be passed into prepare_request_body + if client_secret is not None: + kwargs["client_secret"] = client_secret + + body = self._client.prepare_request_body( + code=code, + body=body, + redirect_uri=self.redirect_uri, + include_client_id=include_client_id, + **kwargs + ) + + headers = headers or { + "Accept": "application/json", + "Content-Type": "application/x-www-form-urlencoded", + } + self.token = {} + request_kwargs = {} + if method.upper() == "POST": + request_kwargs["params" if force_querystring else "data"] = dict( + urldecode(body) + ) + elif method.upper() == "GET": + request_kwargs["params"] = dict(urldecode(body)) + else: + raise ValueError("The method kwarg must be POST or GET.") + + for hook in self.compliance_hook["access_token_request"]: + log.debug("Invoking access_token_request hook %s.", hook) + token_url, headers, request_kwargs = hook( + token_url, headers, request_kwargs + ) + + r = self.request( + method=method, + url=token_url, + timeout=timeout, + headers=headers, + auth=auth, + verify=verify, + proxies=proxies, + cert=cert, + **request_kwargs + ) + + log.debug("Request to fetch token completed with status %s.", r.status_code) + log.debug("Request url was %s", r.request.url) + log.debug("Request headers were %s", r.request.headers) + log.debug("Request body was %s", r.request.body) + log.debug("Response headers were %s and content %s.", r.headers, r.text) + log.debug( + "Invoking %d token response hooks.", + len(self.compliance_hook["access_token_response"]), + ) + for hook in self.compliance_hook["access_token_response"]: + log.debug("Invoking hook %s.", hook) + r = hook(r) + + self._client.parse_request_body_response(r.text, scope=self.scope) + self.token = self._client.token + log.debug("Obtained token %s.", self.token) + return self.token + + def token_from_fragment(self, authorization_response): + """Parse token from the URI fragment, used by MobileApplicationClients. + + :param authorization_response: The full URL of the redirect back to you + :return: A token dict + """ + self._client.parse_request_uri_response( + authorization_response, state=self._state + ) + self.token = self._client.token + return self.token + + def refresh_token( + self, + token_url, + refresh_token=None, + body="", + auth=None, + timeout=None, + headers=None, + verify=None, + proxies=None, + **kwargs + ): + """Fetch a new access token using a refresh token. + + :param token_url: The token endpoint, must be HTTPS. + :param refresh_token: The refresh_token to use. + :param body: Optional application/x-www-form-urlencoded body to add the + include in the token request. Prefer kwargs over body. + :param auth: An auth tuple or method as accepted by `requests`. + :param timeout: Timeout of the request in seconds. + :param headers: A dict of headers to be used by `requests`. + :param verify: Verify SSL certificate. + :param proxies: The `proxies` argument will be passed to `requests`. + :param kwargs: Extra parameters to include in the token request. + :return: A token dict + """ + if not token_url: + raise ValueError("No token endpoint set for auto_refresh.") + + if not is_secure_transport(token_url): + raise InsecureTransportError() + + refresh_token = refresh_token or self.token.get("refresh_token") + + log.debug( + "Adding auto refresh key word arguments %s.", self.auto_refresh_kwargs + ) + kwargs.update(self.auto_refresh_kwargs) + body = self._client.prepare_refresh_body( + body=body, refresh_token=refresh_token, scope=self.scope, **kwargs + ) + log.debug("Prepared refresh token request body %s", body) + + if headers is None: + headers = { + "Accept": "application/json", + "Content-Type": ("application/x-www-form-urlencoded"), + } + + for hook in self.compliance_hook["refresh_token_request"]: + log.debug("Invoking refresh_token_request hook %s.", hook) + token_url, headers, body = hook(token_url, headers, body) + + r = self.post( + token_url, + data=dict(urldecode(body)), + auth=auth, + timeout=timeout, + headers=headers, + verify=verify, + withhold_token=True, + proxies=proxies, + ) + log.debug("Request to refresh token completed with status %s.", r.status_code) + log.debug("Response headers were %s and content %s.", r.headers, r.text) + log.debug( + "Invoking %d token response hooks.", + len(self.compliance_hook["refresh_token_response"]), + ) + for hook in self.compliance_hook["refresh_token_response"]: + log.debug("Invoking hook %s.", hook) + r = hook(r) + + self.token = self._client.parse_request_body_response(r.text, scope=self.scope) + if "refresh_token" not in self.token: + log.debug("No new refresh token given. Re-using old.") + self.token["refresh_token"] = refresh_token + return self.token + + def request( + self, + method, + url, + data=None, + headers=None, + withhold_token=False, + client_id=None, + client_secret=None, + files=None, + **kwargs + ): + """Intercept all requests and add the OAuth 2 token if present.""" + if not is_secure_transport(url): + raise InsecureTransportError() + if self.token and not withhold_token: + log.debug( + "Invoking %d protected resource request hooks.", + len(self.compliance_hook["protected_request"]), + ) + for hook in self.compliance_hook["protected_request"]: + log.debug("Invoking hook %s.", hook) + url, headers, data = hook(url, headers, data) + + log.debug("Adding token %s to request.", self.token) + try: + url, headers, data = self._client.add_token( + url, http_method=method, body=data, headers=headers + ) + # Attempt to retrieve and save new access token if expired + except TokenExpiredError: + if self.auto_refresh_url: + log.debug( + "Auto refresh is set, attempting to refresh at %s.", + self.auto_refresh_url, + ) + + # We mustn't pass auth twice. + auth = kwargs.pop("auth", None) + if client_id and client_secret and (auth is None): + log.debug( + 'Encoding client_id "%s" with client_secret as Basic auth credentials.', + client_id, + ) + auth = requests.auth.HTTPBasicAuth(client_id, client_secret) + token = self.refresh_token( + self.auto_refresh_url, auth=auth, **kwargs + ) + if self.token_updater: + log.debug( + "Updating token to %s using %s.", token, self.token_updater + ) + self.token_updater(token) + url, headers, data = self._client.add_token( + url, http_method=method, body=data, headers=headers + ) + else: + raise TokenUpdated(token) + else: + raise + + log.debug("Requesting url %s using method %s.", url, method) + log.debug("Supplying headers %s and data %s", headers, data) + log.debug("Passing through key word arguments %s.", kwargs) + return super(OAuth2Session, self).request( + method, url, headers=headers, data=data, files=files, **kwargs + ) + + def register_compliance_hook(self, hook_type, hook): + """Register a hook for request/response tweaking. + + Available hooks are: + access_token_response invoked before token parsing. + refresh_token_response invoked before refresh token parsing. + protected_request invoked before making a request. + access_token_request invoked before making a token fetch request. + refresh_token_request invoked before making a refresh request. + + If you find a new hook is needed please send a GitHub PR request + or open an issue. + """ + if hook_type not in self.compliance_hook: + raise ValueError( + "Hook type %s is not in %s.", hook_type, self.compliance_hook + ) + self.compliance_hook[hook_type].add(hook) diff --git a/vlmpy310/lib/python3.10/site-packages/wavedrom/__init__.py b/vlmpy310/lib/python3.10/site-packages/wavedrom/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..52f5e53e1566e820112a60a2610a9f30ef967c8d --- /dev/null +++ b/vlmpy310/lib/python3.10/site-packages/wavedrom/__init__.py @@ -0,0 +1,55 @@ +# Copyright wavedrompy contributors. +# SPDX-License-Identifier: MIT + + +import argparse +import json +import yaml +import sys + +from .waveform import WaveDrom +from .assign import Assign +from .version import version +from .bitfield import BitField + +import json + + +def fixQuotes(inputString): + # fix double quotes in the input file. opening with yaml and dumping with json fix the issues. + yamlCode = yaml.load(inputString, Loader=yaml.FullLoader) + fixedString = json.dumps(yamlCode, indent=4) + return fixedString + + +def render(source="", output=[], strict_js_features = False): + source = json.loads(fixQuotes(source)) + if source.get("signal"): + return WaveDrom().render_waveform(0, source, output, strict_js_features) + elif source.get("assign"): + return Assign().render(0, source, output) + elif source.get("reg"): + return BitField().renderJson(source) + + +def render_write(source, output, strict_js_features = False): + jinput = source.read() + out = render(jinput, strict_js_features=strict_js_features) + out.write(output) + + +def render_file(source, output, strict_js_features = False): + out = open(output, "w") + render_write(open(source, "r"), out, strict_js_features=strict_js_features) + out.close() + + +def main(): + parser = argparse.ArgumentParser(description="") + parser.add_argument("--input", "-i", help="", + required=True, type=argparse.FileType('r')) + parser.add_argument("--svg", "-s", help="", + nargs='?', type=argparse.FileType('w'), default=sys.stdout) + args = parser.parse_args() + + render_write(args.input, args.svg, False) diff --git a/vlmpy310/lib/python3.10/site-packages/wavedrom/__pycache__/__init__.cpython-310.pyc b/vlmpy310/lib/python3.10/site-packages/wavedrom/__pycache__/__init__.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..7af6c1037e5c9f0a13909b531ce31a385f78bd4f Binary files /dev/null and b/vlmpy310/lib/python3.10/site-packages/wavedrom/__pycache__/__init__.cpython-310.pyc differ diff --git a/vlmpy310/lib/python3.10/site-packages/wavedrom/__pycache__/assign.cpython-310.pyc b/vlmpy310/lib/python3.10/site-packages/wavedrom/__pycache__/assign.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d37dd09ec15115e30d3a3dab89d4aa8cbf8898c3 Binary files /dev/null and b/vlmpy310/lib/python3.10/site-packages/wavedrom/__pycache__/assign.cpython-310.pyc differ diff --git a/vlmpy310/lib/python3.10/site-packages/wavedrom/__pycache__/attrdict.cpython-310.pyc b/vlmpy310/lib/python3.10/site-packages/wavedrom/__pycache__/attrdict.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..53c51a2a27186011818c7cd651deff8d0911b9bf Binary files /dev/null and b/vlmpy310/lib/python3.10/site-packages/wavedrom/__pycache__/attrdict.cpython-310.pyc differ diff --git a/vlmpy310/lib/python3.10/site-packages/wavedrom/__pycache__/base.cpython-310.pyc b/vlmpy310/lib/python3.10/site-packages/wavedrom/__pycache__/base.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..7ddb9b10b27da6d40d94bfd31d816877a4b8beb2 Binary files /dev/null and b/vlmpy310/lib/python3.10/site-packages/wavedrom/__pycache__/base.cpython-310.pyc differ diff --git a/vlmpy310/lib/python3.10/site-packages/wavedrom/__pycache__/bitfield.cpython-310.pyc b/vlmpy310/lib/python3.10/site-packages/wavedrom/__pycache__/bitfield.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e2f40ec2d3420cb24ada2759ad4172ac5ba0d47b Binary files /dev/null and b/vlmpy310/lib/python3.10/site-packages/wavedrom/__pycache__/bitfield.cpython-310.pyc differ diff --git a/vlmpy310/lib/python3.10/site-packages/wavedrom/__pycache__/css.cpython-310.pyc b/vlmpy310/lib/python3.10/site-packages/wavedrom/__pycache__/css.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..3d82fec74f9d8d6b7a42d671379a700ddd3f27d4 Binary files /dev/null and b/vlmpy310/lib/python3.10/site-packages/wavedrom/__pycache__/css.cpython-310.pyc differ diff --git a/vlmpy310/lib/python3.10/site-packages/wavedrom/__pycache__/tspan.cpython-310.pyc b/vlmpy310/lib/python3.10/site-packages/wavedrom/__pycache__/tspan.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..b5d1974ee9be2a2c7ee24f2692eb57a70d3246ff Binary files /dev/null and b/vlmpy310/lib/python3.10/site-packages/wavedrom/__pycache__/tspan.cpython-310.pyc differ diff --git a/vlmpy310/lib/python3.10/site-packages/wavedrom/__pycache__/version.cpython-310.pyc b/vlmpy310/lib/python3.10/site-packages/wavedrom/__pycache__/version.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..089c1561795053a7bf947522e4b9b4c7aa9d200a Binary files /dev/null and b/vlmpy310/lib/python3.10/site-packages/wavedrom/__pycache__/version.cpython-310.pyc differ diff --git a/vlmpy310/lib/python3.10/site-packages/wavedrom/__pycache__/waveform.cpython-310.pyc b/vlmpy310/lib/python3.10/site-packages/wavedrom/__pycache__/waveform.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..956f9788e019835a21887ac28f9c4afd9546e140 Binary files /dev/null and b/vlmpy310/lib/python3.10/site-packages/wavedrom/__pycache__/waveform.cpython-310.pyc differ diff --git a/vlmpy310/lib/python3.10/site-packages/wavedrom/__pycache__/waveskin.cpython-310.pyc b/vlmpy310/lib/python3.10/site-packages/wavedrom/__pycache__/waveskin.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..337d0609c591f5ca646a4b1700e6ebbeb54e19d9 Binary files /dev/null and b/vlmpy310/lib/python3.10/site-packages/wavedrom/__pycache__/waveskin.cpython-310.pyc differ diff --git a/vlmpy310/lib/python3.10/site-packages/wavedrom/assign.py b/vlmpy310/lib/python3.10/site-packages/wavedrom/assign.py new file mode 100644 index 0000000000000000000000000000000000000000..8213cecc50e57def24f42458ee04500d23e97891 --- /dev/null +++ b/vlmpy310/lib/python3.10/site-packages/wavedrom/assign.py @@ -0,0 +1,174 @@ +# Copyright wavedrompy contributors. +# SPDX-License-Identifier: MIT + +# Translated to Python from original file: +# https://github.com/drom/wavedrom/blob/master/src/WaveDrom.js + +from collections import namedtuple +import svgwrite + +from .base import SVGBase + + +class RenderState: + def __init__(self, x=0, y=0, xmax=0): + self.x = x + self.y = y + self.xmax = xmax + + def __str__(self): + return "x={} y={}, xmax={}".format(self.x, self.y, self.xmax) + + +RenderObject = namedtuple("RenderObject", "name x y") + + +class Assign(SVGBase): + def render_tree(self, tree, state): + state.xmax = max(state.xmax, state.x) + y = state.y + for i in range(1, len(tree)): + if isinstance(tree[i], list): + state = self.render_tree(tree[i], RenderState(x=state.x+1, y=state.y, xmax=state.xmax)) + else: + tree[i] = RenderObject(name=tree[i], x=state.x+1, y=state.y) + state.y += 2 + tree[0] = RenderObject(name=tree[0], x=state.x, y=round((y+state.y-2)/2)) + state.x -= 1 + + return state + + def draw_body(self, type, ymin, ymax): + circle = ' M 4,0 C 4,1.1 3.1,2 2,2 0.9,2 0,1.1 0,0 c 0,-1.1 0.9,-2 2,-2 1.1,0 2,0.9 2,2 z' + gates = { + '~': 'M -11,-6 -11,6 0,0 z m -5,6 5,0' + circle, + '=': 'M -11,-6 -11,6 0,0 z m -5,6 5,0', + '&': 'm -16,-10 5,0 c 6,0 11,4 11,10 0,6 -5,10 -11,10 l -5,0 z', + '~&': 'm -16,-10 5,0 c 6,0 11,4 11,10 0,6 -5,10 -11,10 l -5,0 z' + circle, + '|': 'm -18,-10 4,0 c 6,0 12,5 14,10 -2,5 -8,10 -14,10 l -4,0 c 2.5,-5 2.5,-15 0,-20 z', + '~|': 'm -18,-10 4,0 c 6,0 12,5 14,10 -2,5 -8,10 -14,10 l -4,0 c 2.5,-5 2.5,-15 0,-20 z' + circle, + '^': 'm -21,-10 c 1,3 2,6 2,10 m 0,0 c 0,4 -1,7 -2,10 m 3,-20 4,0 c 6,0 12,5 14,10 -2,5 -8,10 -14,10 l -4,0 c 1,-3 2,-6 2,-10 0,-4 -1,-7 -2,-10 z', + '~^': 'm -21,-10 c 1,3 2,6 2,10 m 0,0 c 0,4 -1,7 -2,10 m 3,-20 4,0 c 6,0 12,5 14,10 -2,5 -8,10 -14,10 l -4,0 c 1,-3 2,-6 2,-10 0,-4 -1,-7 -2,-10 z' + circle, + '+': 'm -8,5 0,-10 m -5,5 10,0 m 3,0 c 0,4.418278 -3.581722,8 -8,8 -4.418278,0 -8,-3.581722 -8,-8 0,-4.418278 3.581722,-8 8,-8 4.418278,0 8,3.581722 8,8 z', + '*': 'm -4,4 -8,-8 m 0,8 8,-8 m 4,4 c 0,4.418278 -3.581722,8 -8,8 -4.418278,0 -8,-3.581722 -8,-8 0,-4.418278 3.581722,-8 8,-8 4.418278,0 8,3.581722 8,8 z' + } + iec = { + "BUF": 1, "INV": 1, "AND": '&', "NAND": '&', + "OR": '\u22651', "NOR": '\u22651', "XOR": '=1', "XNOR": '=1', "box": '' + } + circled = { "INV", "NAND", "NOR", "XNOR" } + + if ymax == ymin: + ymax = 4 + ymin = -4 + + if type in gates: + return self.element.path(class_='gate', d=gates[type]) + elif type in iec: + g = self.container.g() + if type in circled: + path = self.element.path(class_="gate", d="m -16,{} 16,0 0,{} -16,0 z {}".format(ymin-3, ymax-ymin+6, circle)) + else: + path = self.element.path(class_="gate", d="m -16,{} 16,0 0,{} -16,0 z".format(ymin-3, ymax-ymin+6)) + g.add(path) + tspan = self.element.tspan(iec[type], x=[-14], y=[4], class_='wirename') + text = self.element.text('') + text.add(tspan) + g.add(text) + return g + else: + tspan = self.element.tspan(type, x=[-14], y=[4], class_='wirename') + text = self.element.text('') + text.add(tspan) + return text + + def draw_gate(self, spec): + ret = self.container.g() + + ys = [s[1] for s in spec[2:]] + + ymin = min(ys) + ymax = max(ys) + + g = self.container.g(transform="translate(16,0)") + g.add(self.element.path(d="M {},{} {},{}".format(spec[2][0], ymin, spec[2][0], ymax), class_='wire')) + ret.add(g) + + for s in spec[2:]: + path = self.element.path(d="m {},{} 16,0".format(s[0], s[1]), class_='wire') + ret.add(self.container.g().add(path)) + + g = self.container.g(transform="translate({},{})".format(spec[1][0], spec[1][1])) + g.add(self.element.title(spec[0])) + g.add(self.draw_body(spec[0], ymin - spec[1][1], ymax - spec[1][1])) + ret.add(g) + + return ret + + def draw_boxes(self, tree, xmax): + ret = self.container.g() + spec = [] + + if isinstance(tree, list): + spec.append(tree[0].name); + spec.append([32 * (xmax - tree[0].x), 8 * tree[0].y]); + for t in tree[1:]: + if isinstance(t, list): + spec.append([32 * (xmax - t[0].x), 8 * t[0].y]) + else: + spec.append([32 * (xmax - t.x), 8 * t.y]) + + ret.add(self.draw_gate(spec)) + + for t in tree[1:]: + ret.add(self.draw_boxes(t, xmax)) + else: + fname = tree.name + fx = 32 * (xmax - tree.x) + fy = 8 * tree.y + g = self.container.g(transform="translate({},{})".format(fx, fy)) + g.add(self.element.title(fname)) + g.add(self.element.path(d='M 2,0 a 2,2 0 1 1 -4,0 2,2 0 1 1 4,0 z')) + tspan = self.element.tspan(fname, x=[-4], y=[4], class_='pinname') + text = self.element.text('') + text.add(tspan) + g.add(text) + ret.add(g) + + return ret + + def render(self, index = 0, source = {}, output = []): + STYLE = ".pinname {font-size:12px; font-style:normal; font-variant:normal; font-weight:500; font-stretch:normal; text-align:center; text-anchor:end; font-family:Helvetica} .wirename {font-size:12px; font-style:normal; font-variant:normal; font-weight:500; font-stretch:normal; text-align:center; text-anchor:start; font-family:Helvetica} .wirename:hover {fill:blue} .gate {color:#000; fill:#ffc; fill-opacity: 1;stroke:#000; stroke-width:1; stroke-opacity:1} .gate:hover {fill:red !important; } .wire {fill:none; stroke:#000; stroke-width:1; stroke-opacity:1} .grid {fill:#fff; fill-opacity:1; stroke:none}" + + tree = source.get("assign") + state = RenderState(x=0, y=2, xmax=0) + + for t in tree: + state = self.render_tree(t, state) + state.x += 1 + + xmax = state.xmax + 3 + + width = 32 * (xmax + 1) + 1 + height = 8 * (state.y + 1) - 7 + ilen = 4 * (xmax + 1) + jlen = state.y + 1 + + grid = self.container.g() + + for i in range(ilen+1): + for j in range(jlen+1): + grid.add(self.element.rect(height=1, width=1, x=(i * 8 - 0.5), y=(j * 8 - 0.5), class_='grid')) + + for t in tree: + content = self.draw_boxes(t, xmax) + + + attr = { 'viewBox': "0 0 {} {}".format(width, height)} + template = svgwrite.Drawing(id="svgcontent_{index}".format(index=index), size=[width, height], **attr) + template.defs.add(svgwrite.container.Style(content=STYLE)) + g = self.container.g(transform="translate(0.5,0.5)") + g.add(grid) + g.add(content) + template.add(g) + return template diff --git a/vlmpy310/lib/python3.10/site-packages/wavedrom/attrdict.py b/vlmpy310/lib/python3.10/site-packages/wavedrom/attrdict.py new file mode 100644 index 0000000000000000000000000000000000000000..2692e56aba78c52bfa59536264206aa64ca9b3d2 --- /dev/null +++ b/vlmpy310/lib/python3.10/site-packages/wavedrom/attrdict.py @@ -0,0 +1,4 @@ +class AttrDict(dict): + def __init__(self, *args, **kwargs): + super(AttrDict, self).__init__(*args, **kwargs) + self.__dict__ = self \ No newline at end of file diff --git a/vlmpy310/lib/python3.10/site-packages/wavedrom/base.py b/vlmpy310/lib/python3.10/site-packages/wavedrom/base.py new file mode 100644 index 0000000000000000000000000000000000000000..25b2663cdab910a59a8212422e0c0b03443e3cd3 --- /dev/null +++ b/vlmpy310/lib/python3.10/site-packages/wavedrom/base.py @@ -0,0 +1,21 @@ +# Copyright wavedrompy contributors. +# SPDX-License-Identifier: MIT + +import svgwrite +from .attrdict import AttrDict + +class SVGBase(object): + container = AttrDict({ + "defs": svgwrite.container.Defs, + "g": svgwrite.container.Group, + "marker": svgwrite.container.Marker, + "use": svgwrite.container.Use, + }) + element = AttrDict({ + "rect": svgwrite.shapes.Rect, + "path": svgwrite.path.Path, + "text": svgwrite.text.Text, + "tspan": svgwrite.text.TSpan, + "title": svgwrite.base.Title, + "line": svgwrite.shapes.Line, + }) diff --git a/vlmpy310/lib/python3.10/site-packages/wavedrom/bitfield.py b/vlmpy310/lib/python3.10/site-packages/wavedrom/bitfield.py new file mode 100644 index 0000000000000000000000000000000000000000..3df13af15d82591418a2cf600ca123cd2fa8947a --- /dev/null +++ b/vlmpy310/lib/python3.10/site-packages/wavedrom/bitfield.py @@ -0,0 +1,259 @@ +# Copyright wavedrompy contributors. +# SPDX-License-Identifier: MIT + +# Translated to Python from original file: +# https://github.com/drom/wavedrom/blob/master/src/WaveDrom.js + +from math import floor + +import svgwrite + +from .base import SVGBase +from .tspan import TspanParser + +class Options: + def __init__(self, vspace=80, hspace=800, lanes=1, bits=32, hflip=False, vflip=False, fontsize=14, fontfamily='sans-serif', fontweight='normal'): + self.vspace = vspace if vspace > 19 else 80 + self.hspace = hspace if hspace > 39 else 800 + self.lanes = lanes if lanes > 0 else 1 + self.bits = bits if bits > 4 else 32 + self.hflip = hflip + self.vflip = vflip + self.fontsize = fontsize if fontsize > 5 else 14 + self.fontfamily = fontfamily + self.fontweight = fontweight + +colors = {2: 0, 3: 80, 4: 170, 5: 45, 6: 126, 7: 215} + +def type_style(t): + if t in colors.keys(): + return ";fill:hsl({},100%,50%)".format(colors[t]) + else: + return '' + + +class BitField(SVGBase): + def tspan_parse(self, text): + parser = TspanParser() + parser.feed(text) + return parser.get_text() + + def hline(self, len, x=0, y=0): + return self.element.line(start=(x,y), end=(x+len,y)) + + def vline(self, len, x=0, y=0): + return self.element.line(start=(x,y), end=(x,y+len)) + + def get_text(self, body, x, y=None): + x_list = None + if x: + x_list = [x] + y_list = None + if y: + y_list = [y] + text = self.element.text('', x=x_list, y=y_list) + for t in self.tspan_parse(str(body)): + text.add(t) + return text + + def get_label(self, attr, x, y, step=0, length=0): + if isinstance(attr, int): + attr = int(attr) + res = [] + for i in range(length): + val = (attr >> i) & 1 + xi = x + step * (length / 2 - i - 0.5) + res.append(self.get_text(val, xi, y)) + return res + else: + if '\n' in attr: + names = attr.split('\n') + count = len(names) + return [ + self.get_text(name, x, y + (-(count - 1) / 2 + i) * self.opt.fontsize) + for (i, name) in enumerate(names) + ] + return [self.get_text(attr, x, y)] + + def get_attrs(self, e, step, lsbm, msbm): + if self.opt.vflip: + x = step * (msbm + lsbm) / 2 + else: + x = step * (self.mod - ((msbm + lsbm) / 2) - 1) + attr = e['attr'] + bits = e['bits'] + attrs = [attr] + # 'attr' supports both a scalar and a list. + if isinstance(attr, list): + attrs = attr + return [self.get_label(a, x, 16 * i, step, bits) + for (i, a) in enumerate(attrs)] + + def labelArr(self, desc): + step = self.opt.hspace / self.mod + bits = self.container.g(transform="translate({},{})".format(step/2, self.opt.vspace/5)) + names = self.container.g(transform="translate({},{})".format(step/2, self.opt.vspace/2+4)) + attrs = self.container.g(transform="translate({},{})".format(step/2, self.opt.vspace)) + blanks = self.container.g(transform="translate(0,{})".format(self.opt.vspace/4)) + + for e in desc: + lsbm = 0 + msbm = self.mod - 1 + lsb = self.index * self.mod + msb = (self.index + 1) * self.mod - 1 + + if floor(e["lsb"] / self.mod) == self.index: + lsbm = e["lsbm"] + lsb = e["lsb"] + if floor(e["msb"] / self.mod) == self.index: + msb = e["msb"] + msbm = e["msbm"] + else: + if floor(e["msb"] / self.mod) == self.index: + msb = e["msb"] + msbm = e["msbm"] + else: + continue + + if self.opt.vflip: + bits.add(self.get_text(lsb, x=[step*lsbm])) + else: + bits.add(self.get_text(lsb, x=[step*(self.mod-lsbm - 1)])) + if lsbm != msbm: + if self.opt.vflip: + bits.add(self.get_text(msb, x=[step * msbm])) + else: + bits.add(self.get_text(msb, x=[step * (self.mod - msbm - 1)])) + if e.get('name'): + if self.opt.vflip: + x = step*(msbm+lsbm)/2 + else: + x = step*(self.mod-((msbm+lsbm)/2)-1) + for n in self.get_label(e['name'], x, 0): + names.add(n) + + if not e.get('name') or e.get('type'): + style = 'fill-opacity:0.1' + type_style(e.get('type', 0)) + if self.opt.vflip: + insert_x = lsbm + else: + insert_x = self.mod - msbm - 1 + insert = [step * insert_x, 0] + size = [step * (msbm - lsbm + 1), self.opt.vspace/2] + blanks.add(self.element.rect(insert=insert, size=size, style=style)) + if e.get('attr') is not None: + for attr in self.get_attrs(e, step, lsbm, msbm): + for a in attr: + attrs.add(a) + + g = self.container.g() + g.add(blanks) + g.add(bits) + g.add(names) + g.add(attrs) + return g + + def labels(self, desc): + g = self.container.g(text_anchor='middle') + g.add(self.labelArr(desc)) + return g + + def cage(self, desc): + hspace = self.opt.hspace + vspace = self.opt.vspace + mod = self.mod + + g = self.container.g(stroke='black', stroke_width=1, stroke_linecap='round', transform="translate(0,{})".format(vspace/4)) + + g.add(self.hline(hspace)); + if self.opt.vflip: + g.add(self.vline(0)); + else: + g.add(self.vline(vspace / 2)); + g.add(self.hline(hspace, 0, vspace / 2)); + + i = self.index * mod + if self.opt.vflip: + r = range(0, mod + 1) + else: + r = range(mod, 0, -1) + for j in r: + if j == mod or any([(e["lsb"] == i) for e in desc]): + g.add(self.vline((vspace / 2), j * (hspace / mod))); + else: + g.add(self.vline((vspace / 16), j * (hspace / mod))); + g.add(self.vline((vspace / 16), j * (hspace / mod), vspace * 7 / 16)); + i += 1 + + return g + + def lane(self, desc): + x = 4.5 + if self.opt.hflip: + i = self.index + else: + i = self.opt.lanes-self.index-1 + y = i * self.opt.vspace + 0.5 + g = self.container.g(transform = "translate({},{})".format(x, y), + text_anchor = "middle", + font_size = self.opt.fontsize, + font_family = self.opt.fontfamily, + font_weight = self.opt.fontweight) + + g.add(self.cage(desc)) + g.add(self.labels(desc)) + return g + + def get_max_attrs(self, desc): + max_count = 0 + for e in desc: + if 'attr' in e: + if isinstance(e['attr'], list): + max_count = max(max_count, len(e['attr'])) + else: + max_count = max(max_count, 1) + return max_count + + def render(self, desc, opt = Options()): + self.opt = opt + + # Compute extra per-lane space needed if there are more than one attr + # for any field. This spaces all lanes uniformly, matching the lane + # with the most attr's. + extra_attrs = 0 + max_attrs = self.get_max_attrs(desc) + if max_attrs > 1: + extra_attrs = max_attrs - 1 + self.extra_attr_space = extra_attrs * 16 + + width = opt.hspace + 9 + height = (opt.vspace + self.extra_attr_space) * opt.lanes + 5 + + template = svgwrite.Drawing() + template["width"] = width + template["height"] = height + template["class"] = "WaveDrom" + template.viewbox(0, 0, width, height) + + lsb = 0 + self.mod = int(opt.bits / opt.lanes) + + for e in desc: + e["lsb"] = lsb + e["lsbm"] = lsb % self.mod + lsb += e['bits'] + e['msb'] = lsb - 1 + e['msbm'] = e['msb'] % self.mod + + for i in range(opt.lanes): + self.index = i + template.add(self.lane(desc)) + + return template + + def renderJson(self, source): + opt = Options() + if source.get("config"): + opt = Options(**source['config']) + if source.get("reg"): + return self.render(source['reg'], opt) diff --git a/vlmpy310/lib/python3.10/site-packages/wavedrom/css.py b/vlmpy310/lib/python3.10/site-packages/wavedrom/css.py new file mode 100644 index 0000000000000000000000000000000000000000..bb76f58dbd4b0e66a4187275c14e5f94c5fbe1cc --- /dev/null +++ b/vlmpy310/lib/python3.10/site-packages/wavedrom/css.py @@ -0,0 +1,421 @@ +# Copyright wavedrompy contributors. +# SPDX-License-Identifier: MIT + +# Translated to Python from original file: +# https://github.com/drom/wavedrom/blob/master/src/WaveDrom.js + +from .attrdict import AttrDict +css = AttrDict({}) +css.default = """ +text{font-size:11pt; + font-style:normal; + font-variant:normal; + font-weight:normal; + font-stretch:normal; + text-align:center; + fill-opacity:1; + font-family:Helvetica} +.h1{font-size:33pt; + font-weight:bold} +.h2{font-size:27pt; + font-weight:bold} +.h3{font-size:20pt; + font-weight:bold} +.h4{font-size:14pt; + font-weight:bold} +.h5{font-size:11pt; + font-weight:bold} +.h6{font-size:8pt; + font-weight:bold} +.muted{fill:#aaa} +.warning{fill:#f6b900} +.error{fill:#f60000} +.info{fill:#0041c4} +.success{fill:#00ab00} +.s1{fill:none; + stroke:#000; + stroke-width:1; + stroke-linecap:round; + stroke-linejoin:miter; + stroke-miterlimit:4; + stroke-opacity:1; + stroke-dasharray:none} +.s2{fill:none; + stroke:#000; + stroke-width:0.5; + stroke-linecap:round; + stroke-linejoin:miter; + stroke-miterlimit:4; + stroke-opacity:1; + stroke-dasharray:none} +.s3{color:#000; + fill:none; + stroke:#000; + stroke-width:1; + stroke-linecap:round; + stroke-linejoin:miter; + stroke-miterlimit:4; + stroke-opacity:1; + stroke-dasharray:1, 3; + stroke-dashoffset:0; + marker:none; + visibility:visible; + display:inline; + overflow:visible} +.s4{color:#000; + fill:none; + stroke:#000; + stroke-width:1; + stroke-linecap:round; + stroke-linejoin:miter; + stroke-miterlimit:4; + stroke-opacity:1; + stroke-dasharray:none; + stroke-dashoffset:0; + marker:none; + visibility:visible; + display:inline; + overflow:visible} +.s5{fill:#fff; + stroke:none} +.s6{fill:#000; + fill-opacity:1; + stroke:none} +.s7{color:#000; + fill:#fff; + fill-opacity:1; + fill-rule:nonzero; + stroke:none; + stroke-width:1px; + marker:none; + visibility:visible; + display:inline; + overflow:visible} +.s8{color:#000; + fill:#ffffb4; + fill-opacity:1; + fill-rule:nonzero; + stroke:none; + stroke-width:1px; + marker:none; + visibility:visible; + display:inline; + overflow:visible} +.s9{color:#000; + fill:#ffe0b9; + fill-opacity:1; + fill-rule:nonzero; + stroke:none; + stroke-width:1px; + marker:none; + visibility:visible; + display:inline; + overflow:visible} +.s10{color:#000; + fill:#b9e0ff; + fill-opacity:1; + fill-rule:nonzero; + stroke:none; + stroke-width:1px; + marker:none; + visibility:visible; + display:inline; + overflow:visible} +.s11{color:#000; + fill:#ccfdfe; + fill-opacity:1; + fill-rule:nonzero; + stroke:none; + stroke-width:1px; + marker:none; + visibility:visible; + display:inline; + overflow:visible} +.s12{color:#000; + fill:#cdfdc5; + fill-opacity:1; + fill-rule:nonzero; + stroke:none; + stroke-width:1px; + marker:none; + visibility:visible; + display:inline; + overflow:visible} +.s13{color:#000; + fill:#f0c1fb; + fill-opacity:1; + fill-rule:nonzero; + stroke:none; + stroke-width:1px; + marker:none; + visibility:visible; + display:inline; + overflow:visible} +.s14{color:#000; + fill:#f5c2c0; + fill-opacity:1; + fill-rule:nonzero; + stroke:none; + stroke-width:1px; + marker:none; + visibility:visible; + display:inline; + overflow:visible} +.s15{fill:#0041c4; + fill-opacity:1; + stroke:none} +.s16{fill:none; + stroke:#0041c4; + stroke-width:1; + stroke-linecap:round; + stroke-linejoin:miter; + stroke-miterlimit:4; + stroke-opacity:1; + stroke-dasharray:none} +""" + +css.narrow = """ +text{font-size:11pt; + font-style:normal; + font-variant:normal; + font-weight:normal; + font-stretch:normal; + text-align:center; + fill-opacity:1; + font-family:Helvetica} +.muted{fill:#aaa} +.warning{fill:#f6b900} +.error{fill:#f60000} +.info{fill:#0041c4} +.success{fill:#00ab00} +.h1{font-size:33pt;font-weight:bold} +.h2{font-size:27pt;font-weight:bold} +.h3{font-size:20pt;font-weight:bold} +.h4{font-size:14pt;font-weight:bold} +.h5{font-size:11pt;font-weight:bold} +.h6{font-size:8pt;font-weight:bold} +.s1{fill:none; + stroke:#000000; + stroke-width:1; + stroke-linecap:round; + stroke-linejoin:miter; + stroke-miterlimit:4; + stroke-opacity:1; + stroke-dasharray:none} +.s2{fill:none; + stroke:#000000; + stroke-width:0.5; + stroke-linecap:round; + stroke-linejoin:miter; + stroke-miterlimit:4; + stroke-opacity:1; + stroke-dasharray:none} +.s3{color:#000000; + fill:none; + stroke:#000000; + stroke-width:1; + stroke-linecap:round; + stroke-linejoin:miter; + stroke-miterlimit:4; + stroke-opacity:1; + stroke-dasharray:1, 3; + stroke-dashoffset:0; + marker:none; + visibility:visible; + display:inline; + overflow:visible; + enable-background:accumulate} +.s4{color:#000000; + fill:none; + stroke:#000000; + stroke-width:1; + stroke-linecap:round; + stroke-linejoin:miter; + stroke-miterlimit:4; + stroke-opacity:1; + stroke-dasharray:none; + stroke-dashoffset:0; + marker:none; + visibility:visible; + display:inline; + overflow:visible} +.s5{fill:#ffffff;stroke:none} +.s6{color:#000000; + fill:#ffffb4; + fill-opacity:1; + fill-rule:nonzero; + stroke:none; + stroke-width:1px; + marker:none; + visibility:visible; + display:inline; + overflow:visible; + enable-background:accumulate} +.s7{color:#000000; + fill:#ffe0b9; + fill-opacity:1; + fill-rule:nonzero; + stroke:none; + stroke-width:1px; + marker:none; + visibility:visible; + display:inline; + overflow:visible; + enable-background:accumulate} +.s8{color:#000000; + fill:#b9e0ff; + fill-opacity:1; + fill-rule:nonzero; + stroke:none; + stroke-width:1px; + marker:none; + visibility:visible; + display:inline; + overflow:visible; + enable-background:accumulate} +.s9{fill:#000000;fill-opacity:1;stroke:none} +.s10{color:#000000; + fill:#ffffff; + fill-opacity:1; + fill-rule:nonzero; + stroke:none; + stroke-width:1px; + marker:none; + visibility:visible; + display:inline; + overflow:visible; + enable-background:accumulate} +""" + +css.lowkey=""" +text{font-size:11pt; + font-style:normal; + font-variant:normal; + font-weight:normal; + font-stretch:normal; + text-align:center; + fill-opacity:1; + font-family:Helvetica} +.muted{fill:#aaa} +.warning{fill:#f6b900} +.error{fill:#f60000} +.info{fill:#0041c4} +.success{fill:#00ab00} +.h1{font-size:33pt; + font-weight:bold} +.h2{font-size:27pt; + font-weight:bold} +.h3{font-size:20pt; + font-weight:bold} +.h4{font-size:14pt; + font-weight:bold} +.h5{font-size:11pt; + font-weight:bold} +.h6{font-size:8pt; + font-weight:bold} +.s1{fill:none; + stroke:#606060; + stroke-width:0.75px; + stroke-linecap:round; + stroke-linejoin:miter; + stroke-miterlimit:4; + stroke-opacity:1; + stroke-dasharray:none} +.s2{fill:none; + stroke:#606060; + stroke-width:0.5; + stroke-linecap:round; + stroke-linejoin:miter; + stroke-miterlimit:4; + stroke-opacity:1; + stroke-dasharray:none} +.s3{color:#000; + fill:none; + stroke:#606060; + stroke-width:0.75px; + stroke-linecap:round; + stroke-linejoin:miter; + stroke-miterlimit:4; + stroke-opacity:1; + stroke-dasharray:1, 3; + stroke-dashoffset:0; + marker:none; + visibility:visible; + display:inline; + overflow:visible; + enable-background:accumulate} +.s4{color:#000; + fill:none; + stroke:#606060; + stroke-width:0.75px; + stroke-linecap:round; + stroke-linejoin:miter; + stroke-miterlimit:4; + stroke-opacity:1; + stroke-dasharray:none; + stroke-dashoffset:0; + marker:none; + visibility:visible; + display:inline; + overflow:visible} +.s5{fill:#ffffff; + stroke:none} +.s6{color:#000; + fill:#eaeaea; + fill-opacity:1; + fill-rule:nonzero; + stroke:none; + stroke-width:0.25px; + marker:none; + visibility:visible; + display:inline; + overflow:visible; + enable-background:accumulate} +.s7{color:#000; + fill:#d7d7d7; + fill-opacity:1; + fill-rule:nonzero; + stroke:none; + stroke-width:0.25px; + marker:none; + visibility:visible; + display:inline; + overflow:visible; + enable-background:accumulate} +.s8{color:#000; + fill:#c0c0c0; + fill-opacity:1; + fill-rule:nonzero; + stroke:none; + stroke-width:0.25px; + marker:none; + visibility:visible; + display:inline; + overflow:visible; + enable-background:accumulate} +.s9{fill:#606060; + fill-opacity:1; + stroke:none} +.s10{color:#000; + fill:#fff; + fill-opacity:1; + fill-rule:nonzero; + stroke:none; + stroke-width:0.25px; + marker:none; + visibility:visible; + display:inline; + overflow:visible; + enable-background:accumulate} +.s11{fill:#0041c4; + fill-opacity:1; + stroke:none} +.s12{fill:none; + stroke:#0041c4; + stroke-width:0.75px; + stroke-linecap:round; + stroke-linejoin:miter; + stroke-miterlimit:4; + stroke-opacity:1; + stroke-dasharray:none} +""" diff --git a/vlmpy310/lib/python3.10/site-packages/wavedrom/tspan.py b/vlmpy310/lib/python3.10/site-packages/wavedrom/tspan.py new file mode 100644 index 0000000000000000000000000000000000000000..f2037baffa565df66196757b45817cf6b63a0a4a --- /dev/null +++ b/vlmpy310/lib/python3.10/site-packages/wavedrom/tspan.py @@ -0,0 +1,140 @@ +# Copyright wavedrompy contributors. +# SPDX-License-Identifier: MIT + +import sys + +import svgwrite +from six import string_types +from svgwrite.base import BaseElement +from svgwrite.etree import etree +from .attrdict import AttrDict + +if sys.version_info < (3, 0): + from HTMLParser import HTMLParser +else: + from html.parser import HTMLParser + + +class TspanParser(HTMLParser, object): + tags = { + 'o': {'text_decoration': 'overline'}, + 'ins': {'text_decoration': 'underline'}, + 'sub': {'baseline_shift': 'sub'}, + 'sup': {'baseline_shift': 'super'}, + 'b': {'font_weight': 'bold'}, + 'i': {'font_style': 'italic'}, + 's': {'text_decoration': 'line-through'}, + 'tt': {'font_family': 'monospace'}, + } + + def __init__(self): + super(TspanParser, self).__init__() + self.text = [] + self.state = [] + + def handle_starttag(self, tag, attrs): + self.state.append(tag) + + def handle_endtag(self, tag): + if self.state.pop() != tag: + raise RuntimeError("Unexpected closing tag: {}".format(tag)) + + def get_style(self): + return {k: v for d in [self.tags[t] for t in self.state] for k, v in d.items()} + + def handle_data(self, data): + if len(self.state) == 0: + self.text.append(svgwrite.text.TSpan(data)) + else: + self.text.append(svgwrite.text.TSpan(data, **self.get_style())) + + def get_text(self): + return self.text + + +class JsonMLElement(BaseElement): + """Class that generates xml elements from jsonml.""" + def __init__(self, source, **extra): + """Constructs from jsonml source.""" + self._jsonml = self.extract_element(source) + self.elementname = self._jsonml.tagname + self._jsonml.attributes.update(extra) + super(JsonMLElement, self).__init__(**extra) + + def extract_element(self, e): + """Extract AttrDict from jsonml + + This function non-recursively extracts an AttrDict from jsonml. + This AttrDict has the three elements tagname, attributes and + element_list according to the jsonml specification. + + :param e: element as jsonml list/tuple + :return: AttrDict + """ + if not isinstance(e, (list, tuple)): + raise ValueError("JsonML must be a list") + if len(e) == 0: + raise ValueError("JsonML cannot be an empty list") + if not isinstance(e[0], string_types): + raise ValueError("JsonML tagname must be string") + ret = AttrDict({"tagname": e[0], "attributes": {}, "element-list": []}) + if len(e) > 1: + if isinstance(e[1], dict): + ret.attributes = e[1] + if len(e) > 2: + ret.element_list = e[2:] + else: + ret.element_list = e[1:] + return ret + + def get_xml_element(self, e): + """Generate xml element from jsonml AttrDict + + Recursively generates xml element from jsonml AttrDict. + + :param e: jsonml AttrDict + :return: xml element + """ + + # create element + element = etree.Element(e.tagname) + # set element attributes + for attribute, value in sorted(e.attributes.items()): + # filter 'None' values + if value is not None: + value = self.value_to_string(value) + if value: # just add not empty attributes + element.set(attribute, value) + # store the last xml sibling, because we may need to add + # text to it's tail. This is to support the tagged text + # style ("abc") + last = None + for c in e.element_list: + if isinstance(c, string_types): + # Strings need special treatment for insertion + # as those are not elements + if last is None: + # No non-text element seen so far + if element.text is None: + # No other element seen so far + element.text = c + else: + # Append to other texts + element.text += c + else: + # There was an element already + if last.tail is None: + # No text after that so far + last.tail = c + else: + # Append to other text + last.tail += c + else: + # Recurse + last = self.get_xml_element(self.extract_element(c)) + element.append(last) + + return element + + def get_xml(self): + return self.get_xml_element(self._jsonml) \ No newline at end of file diff --git a/vlmpy310/lib/python3.10/site-packages/wavedrom/version.py b/vlmpy310/lib/python3.10/site-packages/wavedrom/version.py new file mode 100644 index 0000000000000000000000000000000000000000..1f22dd319e5800010fbf9d692941b689e467427e --- /dev/null +++ b/vlmpy310/lib/python3.10/site-packages/wavedrom/version.py @@ -0,0 +1,21 @@ +# file generated by setuptools-scm +# don't change, don't track in version control + +__all__ = ["__version__", "__version_tuple__", "version", "version_tuple"] + +TYPE_CHECKING = False +if TYPE_CHECKING: + from typing import Tuple + from typing import Union + + VERSION_TUPLE = Tuple[Union[int, str], ...] +else: + VERSION_TUPLE = object + +version: str +__version__: str +__version_tuple__: VERSION_TUPLE +version_tuple: VERSION_TUPLE + +__version__ = version = '2.0.3.post3' +__version_tuple__ = version_tuple = (2, 0, 3) diff --git a/vlmpy310/lib/python3.10/site-packages/wavedrom/waveform.py b/vlmpy310/lib/python3.10/site-packages/wavedrom/waveform.py new file mode 100644 index 0000000000000000000000000000000000000000..d53f7de31b88d7ffae018dde3e38e625c8623940 --- /dev/null +++ b/vlmpy310/lib/python3.10/site-packages/wavedrom/waveform.py @@ -0,0 +1,925 @@ +# Copyright wavedrompy contributors. +# SPDX-License-Identifier: MIT + +# Originally translated to Python from original file: +# https://github.com/drom/wavedrom/blob/master/src/WaveDrom.js +# Now many parts have been rewritten and diverged + +import sys +import math +import re +from itertools import chain +import svgwrite +from .attrdict import AttrDict +from collections import deque + +from six import string_types + +from wavedrom.tspan import JsonMLElement +from . import waveskin, css +from .base import SVGBase + + +class WaveDrom(SVGBase): + def __init__(self): + self.font_width = 7 + self.lane = AttrDict({ + "xs": 20, # tmpgraphlane0.width + "ys": 20, # tmpgraphlane0.height + "xg": 120, # tmpgraphlane0.x + "yg": 0, # head gap + "yh0": 0, # head gap title + "yh1": 0, # head gap + "yf0": 0, # foot gap + "yf1": 0, # foot gap + "y0": 5, # tmpgraphlane0.y + "yo": 30, # tmpgraphlane1.y - y0 + "tgo": -10, # tmptextlane0.x - xg + "ym": 15, # tmptextlane0.y - y0 + "xlabel": 6, # tmptextlabel.x - xg + "xmax": 1, + "scale": 1, + "head": {}, + "foot": {} + }) + + @staticmethod + def stretch_bricks(wave, stretch): + stretcher = { + "Pclk": "111", "Nclk": "000", + "pclk": "111", "nclk": "000", + "0": "000", "1": "111", "x": "xxx", "d": "ddd", "u": "uuu", "z": "zzz", + "2": "vvv-2", "3": "vvv-3", "4": "vvv-4", "5": "vvv-5", "6": "vvv-6", + "7": "vvv-7", "8": "vvv-8", "9": "vvv-9"} + + if stretch == -0.5: + # This is the only valid non-integer value, it essentially means halfing down. Further subsampling + # does not work I think.. + return wave[0::2] + else: + stretch = int(stretch) + + def getBrick(w): + if w in stretcher: + return stretcher[w] + elif w[2] in stretcher: + return stretcher[w[2]] + else: + return stretcher[w[-1]] + + if stretch > 0: + return list(chain.from_iterable(([w] + [getBrick(w)]*stretch for w in wave))) + else: + return wave + + def gen_wave_brick(self, prev=None, this=None, stretch=0, repeat=0, subcycle=False): + sharpedge_clk = { "p": "pclk", "n": "nclk", "P": "Pclk", "N": "Nclk" } + sharpedge_sig = { "h": "pclk", "l": "nclk", "H": "Pclk", "L": "Nclk" } + sharpedge = sharpedge_clk.copy() + sharpedge.update(sharpedge_sig) + + # level: logical levels of symbols at wave + level = {"=": "v", "2": "v", "3": "v", "4": "v", "5": "v", "6": "v", + "7": "v", "8": "v", "9": "v", "h": "1", "H": "1", "l": "0", "L": "0"} + # translevel: Those are the levels at the end of a cycle (special for clocks) + translevel = level.copy() + translevel.update({"p": "0", "P": "0", "n": "1", "N": "1"}) + # data: Modifiers of wavebricks that add data + data = {"=": "-2", "2": "-2", "3": "-3", "4": "-4", "5": "-5", "6": + "-6", "7": "-7", "8": "-8", "9": "-9"} + # clkinvert: The inverse brick to clock symbols + clkinvert = {"p": "nclk", "n": "pclk", "P": "nclk", "N": "pclk"} + # xclude: Those are actually identical levels, no transition + xclude = {"hp": "111", "Hp": "111", "ln": "000", "Ln": "000", + "nh": "111", "Nh": "111", "pl": "000", "Pl": "000"} + + if this in sharpedge.keys(): + if prev is None: + if this in sharpedge_clk.keys(): + first = sharpedge[this] + else: + first = level.get(this, this)*3 + else: + first = xclude.get(prev+this, sharpedge[this]) + + if this in sharpedge_clk.keys(): + wave = [first, clkinvert[this]] * (1 + repeat) + else: + wave = [first] + [level.get(this, this)*3]*(2 * repeat + 1) + else: + if prev is None: + transition = level.get(this, this)*3 + data.get(this, "") + else: + transition = translevel.get(prev, prev) + 'm' + level.get(this, this) + data.get(prev, "") + data.get(this, "") + value = level.get(this, this)*3 + data.get(this, "") + wave = [transition, value] + [value, value] * repeat + + if subcycle: + wave = wave[0:repeat+1] + + if not (stretch == -0.5 and this in sharpedge_clk.keys()): + wave = self.stretch_bricks(wave, stretch) + + return wave + + def parse_wave_lane(self, text, stretch=0): + R = [] + + Stack = deque(text) + + This = None + subCycle = False + + while len(Stack) > 0: + Top = This + This = Stack.popleft() + repeat = 0 + if This == '|': + This = 'x' + if This == '<': + subCycle = True + This = Top + Top = None + if Stack[0] in ['.', '|']: + Stack.popleft() + else: + continue + if This == '>': + subCycle = False + This = Top + Top = None + if Stack and Stack[0] in ['.', '|']: + Stack.popleft() + else: + continue + while Stack and Stack[0] in ['.', '|']: + Stack.popleft() + repeat += 1 + R.extend(self.gen_wave_brick(Top, This, stretch, repeat, subCycle)) + + for i in range(int(math.ceil(self.lane.phase))): + R = R[1:] + + return R + + def parse_wave_lanes(self, sig=""): + def data_extract(e): + tmp = e.get("data") + if tmp is not None: + tmp = tmp.split() if isinstance(tmp, string_types) else tmp + return tmp + + content = [] + for sigx in sig: + self.lane.period = sigx.get("period", 1) + self.lane.phase = sigx.get("phase", 0) * 2 + sub_content = [] + sub_content.append([sigx.get("name", " "), sigx.get("phase", 0)]) + if sigx.get("wave"): + sub_content.append(self.parse_wave_lane(sigx["wave"], self.lane.period * self.lane.hscale - 1)) + else: + sub_content.append(None) + sub_content.append(data_extract(sigx)) + content.append(sub_content) + + return content + + def find_lane_markers(self, lanetext=""): + + lcount = 0 + gcount = 0 + ret = [] + for idx, val in enumerate(lanetext): + if val in ["vvv-2", "vvv-3", "vvv-4", "vvv-5", "vvv-6", "vvv-7", "vvv-8", "vvv-9"]: + lcount += 1 + else: + if lcount != 0: + ret.append(gcount - ((lcount + 1) / 2)) + lcount = 0 + + gcount += 1 + + if lcount != 0: + ret.append(gcount - ((lcount + 1) / 2)) + + return ret + + def render_lane_uses(self, val, g): + if val[1]: + for i in range(len(val[1])): + b = self.container.use(href="#{}".format(val[1][i])) + b.translate(i * self.lane.xs) + g.add(b) + + if val[2] and len(val[2]): + labels = self.find_lane_markers(val[1]) + if len(labels) != 0: + for k in range(len(labels)): + if val[2] and k < len(val[2]): + tx = int(labels[k]) * self.lane.xs + self.lane.xlabel + title = self.element.text("", x=[tx], y=[self.lane.ym], text_anchor="middle") + title.add(self.element.tspan(val[2][k])) + title["xml:space"] = "preserve" + g.add(title) + + def text_width(self, string, size=11): + chars = [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,34,47,74,74,118,89,25,44,44,52,78,37, + 44,37,37,74,74,74,74,74,74,74,74,74,74,37,37,78,78,78,74,135,89,89,96,96,89,81,103,96,37,67,89,74,109, + 96,103,89,103,96,89,81,96,89,127,89,87,81,37,37,37,61,74,44,74,74,67,74,74,37,74,74,30,30,67,30,112,74, + 74,74,74,44,67,37,74,67,95,66,65,67,44,34,44,78,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,37,43,74,74,74,74,34,74,44,98,49,74,78,0,98,73,53,73,44,44,44,77,71,37,44,44,49,74,111,111, + 111,81,89,89,89,89,89,89,133,96,89,89,89,89,37,37,37,37,96,96,103,103,103,103,103,78,103,96,96,96,96, + 87,89,81,74,74,74,74,74,74,118,67,74,74,74,74,36,36,36,36,74,74,74,74,74,74,74,73,81,74,74,74,74,65,74, + 65,89,74,89,74,89,74,96,67,96,67,96,67,96,67,96,82,96,74,89,74,89,74,89,74,89,74,89,74,103,74,103,74, + 103,74,103,74,96,74,96,74,37,36,37,36,37,36,37,30,37,36,98,59,67,30,89,67,67,74,30,74,30,74,39,74,44, + 74,30,96,74,96,74,96,74,80,96,74,103,74,103,74,103,74,133,126,96,44,96,44,96,44,89,67,89,67,89,67,89, + 67,81,38,81,50,81,37,96,74,96,74,96,74,96,74,96,74,96,74,127,95,87,65,87,81,67,81,67,81,67,30,84,97,91, + 84,91,84,94,92,73,104,109,91,84,81,84,100,82,76,74,103,91,131,47,40,99,77,37,79,130,100,84,104,114,87, + 126,101,87,84,93,84,69,84,46,52,82,52,82,114,89,102,96,100,98,91,70,88,88,77,70,85,89,77,67,84,39,65, + 61,39,189,173,153,111,105,61,123,123,106,89,74,37,30,103,74,96,74,96,74,96,74,96,74,96,74,81,91,81,91, + 81,130,131,102,84,103,84,87,78,104,81,104,81,88,76,37,189,173,153,103,84,148,90,100,84,89,74,133,118, + 103,81] + + return sum([(chars[ord(c)] if ord(c) <= len(chars) else 114) for c in string])*size/100 + + def render_wave_lane(self, content="", index=0): + xmax = 0 + xgmax = 0 + glengths = [] + groups = [] + + for j, val in enumerate(content): + name = val[0][0].strip() + if name is not None: + dy = self.lane.y0 + j * self.lane.yo + g = self.container.g(id="wavelane_{j}_{index}".format(j=j, index=index)) + g.translate(0, dy) + title = self.element.text("", x=[self.lane.tgo], y=[self.lane.ym], text_anchor="end") + title.add(self.element.tspan(name)) + title["xml:space"] = "preserve" + title["class"] = "info" + g.add(title) + + glengths.append(self.text_width(name)) + + xoffset = val[0][1] + xoffset = math.ceil(2 * xoffset) - 2 * xoffset if xoffset > 0 else -2 * xoffset + gg = self.container.g(id="wavelane_draw_{j}_{index}".format(j=j, index=index)) + gg.translate(xoffset * self.lane.xs, 0) + + self.render_lane_uses(val, gg) + + if val[1] and len(val[1]) > xmax: + xmax = len(val[1]) + + g.add(gg) + groups.append(g) + self.lane.xmax = xmax + self.lane.xg = xgmax + 20 + return (glengths, groups) + + def captext(self, g, cxt, anchor, y): + if cxt.get(anchor) and cxt[anchor].get("text"): + tmark = self.element.text("", x=[float(cxt.xmax)*float(cxt.xs)/2], y=[y], text_anchor="middle", fill="#000") + tmark["xml:space"] = "preserve" + if isinstance(cxt[anchor]["text"], string_types): + tmark.add(self.element.tspan(cxt[anchor]["text"])) + else: + tmark.add(JsonMLElement(cxt[anchor]["text"])) + g.add(tmark) + + def ticktock(self, g, cxt, ref1, ref2, x, dx, y, length): + L = [] + + if cxt.get(ref1) is None or cxt[ref1].get(ref2) is None: + return + + val = cxt[ref1][ref2] + + if isinstance(val, string_types): + val = val.split() + elif isinstance(val, (int, float, bool)): + offset = int(val) + val = [] + for i in range(length): + val.append(i + offset) + + if type(val) is list: + if len(val) == 0: + return + elif len(val) == 1: + offset = val[0] + if isinstance(offset, string_types): + L = val + else: + for i in range(length): + L[i] = i + offset + elif len(val) == 2: + offset = int(val[0]) + step = int(val[1]) + tmp = val[1].split(".") + if len(tmp) == 2: + dp = len(tmp[1]) + + if isinstance(offset, string_types) or isinstance(step, string_types): + L = val + else: + offset = step * offset + for i in range(length): + L[i] = "{0:.", dp, "f}".format(step * i + offset) + else: + L = val + + else: + return + + for i in range(length): + tmp = L[i] + tmark = self.element.text(tmp, x=[i * dx + x], y=[y], text_anchor="middle") + tmark["class"] = "muted" + tmark["xml:space"] = "preserve" + g.add(tmark) + + def render_marks(self, content="", index=0): + def get_elem(e): + if len(e) == 3: + ret = self.element[e[0]](e[2]) + ret.attribs = e[1] + elif len(e) == 2: + ret = self.element[e[0]](e[1]) + else: + ret = self.element.tspan(e) + return ret + + mstep = 2 * int(self.lane.hscale) + mmstep = mstep * self.lane.xs + marks = int(self.lane.xmax / mstep) + gy = len(content) * int(self.lane.yo) + + g = self.container.g(id="gmarks_{}".format(index)) + + for i in range(marks + 1): + gg = self.element.path(id="gmark_{i}_{index}".format(i=i, index=index), + d="m {dx},0 0,{gy}".format(dx=i * mmstep, gy=gy), + style="stroke:#888;stroke-width:0.5;stroke-dasharray:1,3") + g.add(gg) + + self.captext(g, self.lane, "head", -33 if (self.lane.yh0 > 0) else -13) + self.captext(g, self.lane, "foot", gy + (45 if (self.lane.yf0 > 0) else 25)) + self.ticktock(g, self.lane, "head", "tick", 0, mmstep, -5, marks + 1) + self.ticktock(g, self.lane, "head", "tock", mmstep / 2, mmstep, -5, marks) + self.ticktock(g, self.lane, "foot", "tick", 0, mmstep, gy + 15, marks + 1) + self.ticktock(g, self.lane, "foot", "tock", mmstep / 2, mmstep, gy + 15, marks) + + return g + + def render_labels(self, root, source, index): + if source: + gg = self.container.g(id="labels_{index}".format(index=index)) + + for idx, val in enumerate(source): + self.lane.period = val.get("period", 1) + self.lane.phase = val.get("phase", 0) * 2 + + dy = self.lane.y0 + idx * self.lane.yo + g = self.container.g(id="labels_{i}_{index}".format(i=idx, index=index)) + g.translate(0, dy) + + label = val.get("label") + if label: + pos = 0 + for l in re.findall(r"([\.\w]|(?:\{\w+\}))(?:\((\d*\.?\d+)\))?", label): + if l[0] == ".": + pos += 1 + continue + + text = l[0] + try: + offset = float(l[1]) + except ValueError: + offset = 0 + + m = re.match(r"\{(\w+)\}", l[0]) + if m: + text = m.group(1) + x = int(float(self.lane.xs) * (2 * (pos + offset) * self.lane.period * + self.lane.hscale - self.lane.phase) + float(self.lane.xlabel)) + y = int(idx * self.lane.yo + self.lane.y0 + float(self.lane.ys) * 0.5) - dy + + lwidth = len(text) * self.font_width + lx = float(x) - float(lwidth) / 2 + ly = int(y) - 5 + underlabel = self.element.rect(insert=(lx, ly), + size=(lwidth, 8), style="fill:#FFF;") + g.add(underlabel) + lx = float(x) + ly = int(y) + 2 + label = self.element.text(text, style="font-size:8px;", text_anchor="middle", + x=[lx], y=[ly]) + g.add(label) + pos += 1 + gg.add(g) + root.add(gg) + + def arc_shape(self, Edge, frm, to): + dx = float(to.x) - float(frm.x) + dy = float(to.y) - float(frm.y) + lx = (float(frm.x) + float(to.x)) / 2 + ly = (float(frm.y) + float(to.y)) / 2 + + const_style = AttrDict({ + "a": "marker-end:url(#arrowhead);stroke:#0041c4;stroke-width:1;fill:none", + "b": "marker-end:url(#arrowhead);marker-start:url(#arrowtail);stroke:#0041c4;stroke-width:1;fill:none" + }) + + pattern = { + "-": { }, + "~": {"d": "M {fx},{fy} c {dx},{dy} {dxx},{dyy} {dxxx},{dyyy}".format(fx=frm.x, fy=frm.y, + dx=(0.7 * dx), dy=0, + dxx=(0.3 * dx), dyy=dy, + dxxx=dx, dyyy=dy)}, + "-~": {"d": "M {fx},{fy} c {dx},{dy} {dxx},{dyy} {dxxx},{dyyy}".format(fx=frm.x, fy=frm.y, + dx=(0.7 * dx), dy=0, + dxx=dx, dyy=dy, + dxxx=dx, dyyy=dy)}, + "~-": {"d": "M {fx},{fy} c {dx},{dy} {dxx},{dyy} {dxxx},{dyyy}".format(fx=frm.x, fy=frm.y, + dx=0, dy=0, + dxx=(0.3 * dx), dyy=dy, + dxxx=dx, dyyy=dy)}, + "-|": {"d": "m {fx},{fy} {dx},{dy} {dxx},{dyy}".format(fx=frm.x, fy=frm.y, + dx=dx, dy=0, + dxx=0, dyy=dy)}, + "|-": {"d": "m {fx},{fy} {dx},{dy} {dxx},{dyy}".format(fx=frm.x, fy=frm.y, + dx=0, dy=dy, + dxx=dx, dyy=0)}, + "-|-": {"d": "m {fx},{fy} {dx},{dy} {dxx},{dyy} {dxxx},{dyyy}".format(fx=frm.x, fy=frm.y, + dx=(dx / 2), dy=0, + dxx=0, dyy=dy, + dxxx=(dx / 2), dyyy=0)}, + "->": {"style": const_style.a}, + "~>": {"style": const_style.a, + "d": "M {fx},{fy} c {dx},{dy} {dxx},{dyy} {dxxx},{dyyy}".format(fx=frm.x, fy=frm.y, + dx=(0.7 * dx), dy=0, + dxx=(0.3 * dx), dyy=dy, + dxxx=dx, dyyy=dy)}, + "-~>": {"style": const_style.a, + "d": "M {fx},{fy} c {dx},{dy} {dxx},{dyy} {dxxx},{dyyy}".format(fx=frm.x, fy=frm.y, + dx=(0.7 * dx), dy=0, + dxx=dx, dyy=dy, + dxxx=dx, dyyy=dy)}, + "~->": {"style": const_style.a, + "d": "M {fx},{fy} c {dx},{dy} {dxx},{dyy} {dxxx},{dyyy}".format(fx=frm.x, fy=frm.y, + dx=0, dy=0, + dxx=(0.3 * dx), dyy=dy, + dxxx=dx, dyyy=dy)}, + "-|>": {"style": const_style.a, + "d": "m {fx},{fy} {dx},{dy} {dxx},{dyy}".format(fx=frm.x, fy=frm.y, + dx=dx, dy=0, + dxx=0, dyy=dy)}, + "|->": {"style": const_style.a, + "d": "m {fx},{fy} {dx},{dy} {dxx},{dyy}".format(fx=frm.x, fy=frm.y, + dx=0, dy=dy, + dxx=dx, dyy=0 + )}, + "-|->": {"style": const_style.a, + "d": "m {fx},{fy} {dx},{dy} {dxx},{dyy} {dxxx},{dyyy}".format(fx=frm.x, fy=frm.y, + dx=(dx / 2), dy=0, + dxx=0, dyy=dy, + dxxx=(dx / 2), dyyy=0 + )}, + "<->": {"style": const_style.b}, + "<~>": {"style": const_style.b, + "d": "M {fx},{fy} c {dx},{dy} {dxx},{dyy} {dxxx},{dyyy}".format(fx=frm.x, fy=frm.y, + dx=(0.7 * dx), dy=0, + dxx=(0.3 * dx), dyy=dy, + dxxx=dx, dyyy=dy + )}, + "<-~>": {"style": const_style.b, + "d": "M {fx},{fy} c {dx},{dy} {dxx},{dyy} {dxxx},{dyyy}".format(fx=frm.x, fy=frm.y, + dx=(0.7 * dx), dy=0, + dxx=dx, dyy=dy, + dxxx=dx, dyyy=dy + )}, + "<-|>": {"style": const_style.b, + "d": "m {fx},{fy} {dx},{dy} {dxx},{dyy}".format(fx=frm.x, fy=frm.y, + dx=dx, dy=0, + dxx=0, dyy=dy + )}, + "<-|->": {"style": const_style.b, + "d": "m {fx},{fy} {dx},{dy} {dxx},{dyy} {dxxx},{dyyy}".format(fx=frm.x, fy=frm.y, + dx=(dx / 2), dy=0, + dxx=0, dyy=dy, + dxxx=(dx / 2), dyyy=0, + )} + } + + props = AttrDict({"lx": lx, "ly": ly, "style": "fill:none;stroke:#00F;stroke-width:1", + "d": "M {fx},{fy} {tx},{ty}".format(fx=frm.x, fy=frm.y, tx=to.x, ty=to.y)}) + + if Edge.shape in pattern: + props.d = pattern[Edge.shape].get("d", props.d) + props.style = pattern[Edge.shape].get("style", props.style) + + if Edge.label: + if Edge.shape in ["-~", "-~>", "<-~>"]: + props.lx = float(frm.x) + (float(to.x) - float(frm.x)) * 0.75 + elif Edge.shape in ["~-", "~->"]: + props.lx = float(frm.x) + (float(to.x) - float(frm.x)) * 0.25 + elif Edge.shape in ["-|", "-|>", "<-|>"]: + props.lx = float(to.x) + elif Edge.shape in ["|-", "|->"]: + props.lx = float(frm.x) + + return props + + def render_arc(self, Edge, frm, to, shapeProps): + return self.element.path(id="gmark_{frm}_{to}".format(frm=Edge.frm, to=Edge.to), + d=shapeProps.d, style=shapeProps.style) + + def render_label(self, p, text): + w = self.text_width(text,8) + 2 + g = self.container.g(transform = "translate({},{})".format(p.x, p.y)) + # todo: I don't think this is correct. reported: + # https://github.com/wavedrom/wavedrom/issues/252 + rect = self.element.rect(insert=(int(0-w/2), -5), size=(w, 10), style="fill:#FFF;") + label = self.element.text("", style="font-size:8px;", text_anchor="middle", y=[3]) + label.add(self.element.tspan(text)) + g.add(rect) + g.add(label) + return g + + def render_arcs(self, source, index, top): + Edge = AttrDict({"words": [], "frm": 0, "shape": "", "to": 0, "label": ""}) + Events = AttrDict({}) + + if source: + for idx, val in enumerate(source): + self.lane.period = val.get("period", 1) + self.lane.phase = val.get("phase", 0) * 2 + text = val.get("node") + if text: + Stack = list(text) + Stack.reverse() + pos = 0 + step = 1 + while len(Stack) > 0: + eventname = Stack.pop() + if eventname == "<": + step = 0.25 + continue + elif eventname == ">": + step = 1 + continue + x = int(float(self.lane.xs) * (2 * pos * self.lane.period * + self.lane.hscale - self.lane.phase) + float(self.lane.xlabel)) + y = int(idx * self.lane.yo + self.lane.y0 + float(self.lane.ys) * 0.5) + if eventname != ".": + Events[eventname] = AttrDict({"x": str(x), "y": str(y)}) + pos += step + + gg = self.container.g(id="wavearcs_{index}".format(index=index)) + + if top.get("edge"): + for i, val in enumerate(top["edge"]): + Edge.words = val.split() + Edge.label = val[len(Edge.words[0]):] + Edge.label = Edge.label[1:] + Edge.frm = Edge.words[0][0] + Edge.to = Edge.words[0][-1] + Edge.shape = Edge.words[0][1:-1] + frm = AttrDict(Events[Edge.frm]) + to = AttrDict(Events[Edge.to]) + + shapeProps = self.arc_shape(Edge, frm, to) + gg.add(self.render_arc(Edge, frm, to, shapeProps)) + + if Edge.label: + gg.add(self.render_label(AttrDict({"x": shapeProps.lx, "y": shapeProps.ly}), Edge.label)) + + + for k in Events: + if k.islower() or k.isdigit(): + if int(Events[k].x) > 0: + gg.add(self.render_label(AttrDict({"x": Events[k].x, "y": Events[k].y}), k)) + + return gg + + def parse_config(self, source={}): + self.lane.hscale = 1 + if self.lane.get("hscale0"): + self.lane.hscale = self.lane.hscale0 + + if source and source.get("config") and source.get("config").get("hscale"): + hscale = round(source.get("config").get("hscale")) + if hscale > 0: + if hscale > 100: + hscale = 100 + self.lane.hscale = hscale + + self.lane.xmin_cfg = 0 + self.lane.xmax_cfg = sys.maxsize + if source and "config" in source and "hbounds" in source["config"]: + if len(source["config"]["hbounds"]) == 2: + source["config"]["hbounds"][0] = math.floor(source["config"]["hbounds"][0]) + source["config"]["hbounds"][1] = math.ceil(source["config"]["hbounds"][0]) + if source["config"]["hbounds"][0] < source["config"]["hbounds"][1]: + self.lane.xmin_cfg = 2 * source["config"]["hbounds"][0] + self.lane.xmax_cfg = 2 * source["config"]["hbounds"][1] + + self.lane.yh0 = 0 + self.lane.yh1 = 0 + if source and source.get("head"): + self.lane.head = source["head"] + if "tick" in source["head"] or "tock" in source["head"]: + self.lane.yh0 = 20 + if "tick" in source["head"]: + source["head"]["tick"] += self.lane.xmin_cfg/2 + if "tock" in source["head"]: + source["head"]["tock"] += self.lane.xmin_cfg/2 + if source.get("head").get("text"): + self.lane.yh1 = 46 + self.lane.head["text"] = source["head"]["text"] + + self.lane.yf0 = 0 + self.lane.yf1 = 0 + if source and source.get("foot"): + self.lane.foot = source["foot"] + if "tick" in source["foot"] or "tock" in source["foot"]: + self.lane.yf0 = 20 + if "tick" in source["foot"]: + source["foot"]["tick"] += self.lane.xmin_cfg/2 + if "tock" in source["foot"]: + source["foot"]["tock"] += self.lane.xmin_cfg/2 + if source.get("foot").get("text"): + self.lane.yf1 = 46 + self.lane.foot["text"] = source["foot"]["text"] + + def rec(self, tmp=[], state={}): + name = None + delta = AttrDict({"x": 10}) + if isinstance(tmp[0], str) or isinstance(tmp[0], int): + name = str(tmp[0]) + delta.x = 25 + + state.x += delta.x + for idx, val in enumerate(tmp): + if isinstance(val, list): + old_y = state.y + self.rec(val, state) + state["groups"].append({"x": state.xx, + "y": old_y, + "height": state.y - old_y, + "name": state.name}) + elif isinstance(val, dict): + state["lanes"].append(val) + state["width"].append(state.x) + state.y += 1 + + state.xx = state.x + state.x -= delta.x + state.name = name + + def another_template(self, index, source): + def get_container(elem): + ctype = elem[0] + ret = self.container[ctype]() + ret.attribs = elem[1] + + def gen_elem(e): + if e[0] == "path": + attr = e[1] + elem = self.element.path(d=attr["d"]) + elem.attribs = attr + elif e[0] == "rect": + attr = e[1] + x = attr["x"] + y = attr["y"] + w = attr["width"] + h = attr["height"] + elem = self.element.rect(insert=(x, y), size=(w, h)) + elem.attribs = attr + + return elem + [ret.add(gen_elem(e)) for e in elem[2:]] + + return ret + + skinname = source.get("config", {"skin" : "default"}).get("skin", "default") + skin = waveskin.WaveSkin.get(skinname, waveskin.WaveSkin["default"]) + + template = svgwrite.Drawing(id="svgcontent_{index}".format(index=index)) + if index == 0: + template.add(template.style(skin[2][2])) + [template.defs.add(get_container(e)) for e in skin[3][1:]] + self.lane.xs = int(skin[3][1][2][1]["width"]) + self.lane.ys = int(skin[3][1][2][1]["height"]) + self.lane.xlabel = int(skin[3][1][2][1]["x"]) + self.lane.ym = int(skin[3][1][2][1]["y"]) + + template["class"] = "WaveDrom" + template["overflow"] = "hidden" + + return template + + def insert_svg_template(self, index=0, parent=[], source={}): + e = waveskin.WaveSkin["default"] + + if source.get("config") and source.get("config").get("skin"): + if waveskin.WaveSkin.get(source.get("config").get("skin")): + e = waveskin.WaveSkin[source.get("config").get("skin")] + + if index == 0: + self.lane.xs = int(e[3][1][2][1]["width"]) + self.lane.ys = int(e[3][1][2][1]["height"]) + self.lane.xlabel = int(e[3][1][2][1]["x"]) + self.lane.ym = int(e[3][1][2][1]["y"]) + + else: + e = ["svg", + {"id": "svg", + "xmlns": "http://www.w3.org/2000/svg", + "xmlns:xlink": "http://www.w3.org/1999/xlink", + "height": "0"}, + [ # e[-1] + "g", # e[-1][0] + {"id": "waves"}, # e[-1][1] + [ # e[-1][2] + "g", # e[-1][2][0] + {"id": "lanes"} # e[-1][2][1] + ], + [ # e[-1][3] + "g", # e[-1][3][0] + {"id": "groups"} # e[-1][3][1] + ] + ] + ] + + e[-1][1]["id"] = "waves_{index}".format(index=index) + e[-1][2][1]["id"] = "lanes_{index}".format(index=index) + e[-1][3][1]["id"] = "groups_{index}".format(index=index) + e[1]["id"] = "svgcontent_{index}".format(index=index) + e[1]["height"] = 0 + + parent.extend(e) + + def render_waveform(self, index=0, source={}, output=[], strict_js_features=False): + xmax = 0 + + if source.get("signal"): + template = self.another_template(index, source) + waves = template.g(id="waves_{index}".format(index=index)) + lanes = template.g(id="lanes_{index}".format(index=index)) + groups = template.g(id="groups_{index}".format(index=index)) + self.parse_config(source) + ret = AttrDict({"x": 0, "y": 0, "xmax": 0, "width": [], "lanes": [], "groups": []}) + self.rec(source["signal"], ret) # parse lanes + content = self.parse_wave_lanes(ret.lanes) + (glengths, lanegroups) = self.render_wave_lane(content, index) + for i, val in enumerate(glengths): + xmax = max(xmax, (val + ret.width[i])) + marks = self.render_marks(content, index) + gaps = self.render_gaps(ret.lanes, index) + if not strict_js_features: + self.render_labels(lanes, ret.lanes, index) + arcs = self.render_arcs(ret.lanes, index, source) + + # Render + lanes.add(marks) + [lanes.add(l) for l in lanegroups] + lanes.add(arcs) + lanes.add(gaps) + + self.render_groups(groups, ret.groups, index) + self.lane.xg = int(math.ceil(float(xmax - self.lane.tgo) / float(self.lane.xs))) * self.lane.xs + width = self.lane.xg + self.lane.xs * (self.lane.xmax + 1) + height = len(content) * self.lane.yo + self.lane.yh0 + self.lane.yh1 + self.lane.yf0 + self.lane.yf1 + template["width"] = width + template["height"] = height + template.viewbox(0, 0, width, height) + dx = self.lane.xg + 0.5 + dy = float(self.lane.yh0) + float(self.lane.yh1) + 0.5 + lanes.translate(dx, dy) + + waves.add(lanes) + waves.add(groups) + template.add(waves) + return template + + def render_groups(self, root=[], groups=[], index=0): + for i, val in enumerate(groups): + dx = groups[i]["x"] + 0.5 + dy = groups[i]["y"] * self.lane.yo + 3.5 + self.lane.yh0 + self.lane.yh1 + h = int(groups[i]["height"] * self.lane.yo - 16) + group = self.element.path(id="group_{i}_{index}".format(i=i, index=index), + d="m {dx},{dy} c -3,0 -5,2 -5,5 l 0,{h} c 0,3 2,5 5,5".format(dx=dx, dy=dy, h=h), + style="stroke:#0041c4;stroke-width:1;fill:none") + + root.add(group) + + name = groups[i]["name"] + x = int(groups[i]["x"] - 10) + y = int(self.lane.yo * (groups[i]["y"] + (float(groups[i]["height"]) / 2)) + + self.lane.yh0 + self.lane.yh1) + label = self.container.g() + label.translate(x, y) + gg = self.container.g() + gg.rotate(270) + t = self.element.text("", text_anchor="middle") + t["class"] = "info" + t["xml:space"] = "preserve" + t.add(self.element.tspan(name)) + gg.add(t) + label.add(gg) + root.add(label) + + def render_gap_uses(self, wave, g): + subCycle = False + + if wave: + Stack = deque(wave) + pos = 0 + while len(Stack): + next = Stack.popleft() + if next == '<': + subCycle = True + continue + if next == '>': + subCycle = False + continue + if subCycle: + pos += self.lane.period + else: + pos += 2 * self.lane.period + if next == "|": + if subCycle: + dx = float(self.lane.xs) * (pos * float(self.lane.hscale) - float(self.lane.phase)) + else: + dx = float(self.lane.xs) * ((pos - self.lane.period) * float(self.lane.hscale) - float(self.lane.phase)) + b = self.container.use(href="#gap") + b.translate(dx) + g.add(b) + + def render_gaps(self, source, index): + if source: + gg = self.container.g(id="wavegaps_{index}".format(index=index)) + + for idx, val in enumerate(source): + self.lane.period = val.get("period", 1) + self.lane.phase = int(val.get("phase", 0) * 2) + self.lane.xmin_cfg + + dy = self.lane.y0 + idx * self.lane.yo + g = self.container.g(id="wavegap_{i}_{index}".format(i=idx, index=index)) + g.translate(0, dy) + + if "wave" in val: + self.render_gap_uses(val["wave"], g) + + gg.add(g) + + return gg + + def convert_to_svg(self, root): + svg_output = "" + + if type(root) is list: + if len(root) >= 2 and type(root[1]) is dict: + if len(root) == 2: + svg_output += "<{}{}/>\n".format(root[0], self.convert_to_svg(root[1])) + elif len(root) >= 3: + svg_output += "<{}{}/>\n".format(root[0], self.convert_to_svg(root[1])) + if len(root) == 3: + svg_output += self.convert_to_svg(root[2]) + else: + svg_output += self.convert_to_svg(root[2:]) + svg_output += "\n".format(root[0]) + elif type(root[0]) is list: + for eleml in root: + svg_output += self.convert_to_svg(eleml) + else: + svg_output += "<{}>\n".format(root[0]) + for eleml in root[1:]: + svg_output += self.convert_to_svg(eleml) + svg_output += "\n".format(root[0]) + elif type(root) is dict: + for elemd in root: + svg_output += " {}=\"{}\"".format(elemd, root[elemd]) + else: + svg_output += root + + return svg_output + + # Backward compatibility + genWaveBrick = gen_wave_brick + parseWaveLane = parse_wave_lane + parseWaveLanes = parse_wave_lanes + findLaneMarkers = find_lane_markers + renderWaveLane = render_wave_lane + renderMarks = render_marks + renderLabels = render_labels + renderArcs = render_arcs + parseConfig = parse_config + anotherTemplate = another_template + insertSVGTemplate = insert_svg_template + renderWaveForm = render_waveform + renderGroups = render_groups + renderGaps = render_gaps diff --git a/vlmpy310/lib/python3.10/site-packages/wavedrom/waveskin.py b/vlmpy310/lib/python3.10/site-packages/wavedrom/waveskin.py new file mode 100644 index 0000000000000000000000000000000000000000..42a55cb2c45604930a8fd2ae6cde2ac673e5441a --- /dev/null +++ b/vlmpy310/lib/python3.10/site-packages/wavedrom/waveskin.py @@ -0,0 +1,2001 @@ +# Copyright wavedrompy contributors. +# SPDX-License-Identifier: MIT + +# Translated to Python from original file: +# https://github.com/drom/wavedrom/blob/master/src/WaveDrom.js + +from . import css + +WaveSkin = {} + +WaveSkin['default'] = ["svg", {"id": "svg", "xmlns": "http://www.w3.org/2000/svg", + "xmlns:xlink": "http://www.w3.org/1999/xlink", "height": "0"}, + ["style", {"type": "text/css"}, css.css.default], + ["defs", + ["g", {"id": "socket"}, + ["rect", {"y": "15", "x": "6", "height": "20", "width": "20"}] + ], + ["g", {"id": "pclk"}, + ["path", {"d": "M0,20 0,0 20,0", "class": "s1"}] + ], + ["g", {"id": "nclk"}, + ["path", {"d": "m0,0 0,20 20,0", "class": "s1"}] + ], + ["g", {"id": "000"}, + ["path", {"d": "m0,20 20,0", "class": "s1"}] + ], + ["g", {"id": "0m0"}, + ["path", {"d": "m0,20 3,0 3,-10 3,10 11,0", "class": "s1"}] + ], + ["g", {"id": "0m1"}, + ["path", {"d": "M0,20 3,20 9,0 20,0", "class": "s1"}] + ], + ["g", {"id": "0mx"}, + ["path", {"d": "M3,20 9,0 20,0", "class": "s1"}], + ["path", {"d": "m20,15 -5,5", "class": "s2"}], + ["path", {"d": "M20,10 10,20", "class": "s2"}], + ["path", {"d": "M20,5 5,20", "class": "s2"}], + ["path", {"d": "M20,0 4,16", "class": "s2"}], + ["path", {"d": "M15,0 6,9", "class": "s2"}], + ["path", {"d": "M10,0 9,1", "class": "s2"}], + ["path", {"d": "m0,20 20,0", "class": "s1"}] + ], + ["g", {"id": "0md"}, + ["path", {"d": "m8,20 10,0", "class": "s3"}], + ["path", {"d": "m0,20 5,0", "class": "s1"}] + ], + ["g", {"id": "0mu"}, + ["path", {"d": "m0,20 3,0 C 7,10 10.107603,0 20,0", "class": "s1"}] + ], + ["g", {"id": "0mz"}, + ["path", {"d": "m0,20 3,0 C 10,10 15,10 20,10", "class": "s1"}] + ], + ["g", {"id": "111"}, + ["path", {"d": "M0,0 20,0", "class": "s1"}] + ], + ["g", {"id": "1m0"}, + ["path", {"d": "m0,0 3,0 6,20 11,0", "class": "s1"}] + ], + ["g", {"id": "1m1"}, + ["path", {"d": "M0,0 3,0 6,10 9,0 20,0", "class": "s1"}] + ], + ["g", {"id": "1mx"}, + ["path", {"d": "m3,0 6,20 11,0", "class": "s1"}], + ["path", {"d": "M0,0 20,0", "class": "s1"}], + ["path", {"d": "m20,15 -5,5", "class": "s2"}], + ["path", {"d": "M20,10 10,20", "class": "s2"}], + ["path", {"d": "M20,5 8,17", "class": "s2"}], + ["path", {"d": "M20,0 7,13", "class": "s2"}], + ["path", {"d": "M15,0 6,9", "class": "s2"}], + ["path", {"d": "M10,0 5,5", "class": "s2"}], + ["path", {"d": "M3.5,1.5 5,0", "class": "s2"}] + ], + ["g", {"id": "1md"}, + ["path", {"d": "m0,0 3,0 c 4,10 7,20 17,20", "class": "s1"}] + ], + ["g", {"id": "1mu"}, + ["path", {"d": "M0,0 5,0", "class": "s1"}], + ["path", {"d": "M8,0 18,0", "class": "s3"}] + ], + ["g", {"id": "1mz"}, + ["path", {"d": "m0,0 3,0 c 7,10 12,10 17,10", "class": "s1"}] + ], + ["g", {"id": "xxx"}, + ["path", {"d": "m0,20 20,0", "class": "s1"}], + ["path", {"d": "M0,0 20,0", "class": "s1"}], + ["path", {"d": "M0,5 5,0", "class": "s2"}], + ["path", {"d": "M0,10 10,0", "class": "s2"}], + ["path", {"d": "M0,15 15,0", "class": "s2"}], + ["path", {"d": "M0,20 20,0", "class": "s2"}], + ["path", {"d": "M5,20 20,5", "class": "s2"}], + ["path", {"d": "M10,20 20,10", "class": "s2"}], + ["path", {"d": "m15,20 5,-5", "class": "s2"}] + ], + ["g", {"id": "xm0"}, + ["path", {"d": "M0,0 4,0 9,20", "class": "s1"}], + ["path", {"d": "m0,20 20,0", "class": "s1"}], + ["path", {"d": "M0,5 4,1", "class": "s2"}], + ["path", {"d": "M0,10 5,5", "class": "s2"}], + ["path", {"d": "M0,15 6,9", "class": "s2"}], + ["path", {"d": "M0,20 7,13", "class": "s2"}], + ["path", {"d": "M5,20 8,17", "class": "s2"}] + ], + ["g", {"id": "xm1"}, + ["path", {"d": "M0,0 20,0", "class": "s1"}], + ["path", {"d": "M0,20 4,20 9,0", "class": "s1"}], + ["path", {"d": "M0,5 5,0", "class": "s2"}], + ["path", {"d": "M0,10 9,1", "class": "s2"}], + ["path", {"d": "M0,15 7,8", "class": "s2"}], + ["path", {"d": "M0,20 5,15", "class": "s2"}] + ], + ["g", {"id": "xmx"}, + ["path", {"d": "m0,20 20,0", "class": "s1"}], + ["path", {"d": "M0,0 20,0", "class": "s1"}], + ["path", {"d": "M0,5 5,0", "class": "s2"}], + ["path", {"d": "M0,10 10,0", "class": "s2"}], + ["path", {"d": "M0,15 15,0", "class": "s2"}], + ["path", {"d": "M0,20 20,0", "class": "s2"}], + ["path", {"d": "M5,20 20,5", "class": "s2"}], + ["path", {"d": "M10,20 20,10", "class": "s2"}], + ["path", {"d": "m15,20 5,-5", "class": "s2"}] + ], + ["g", {"id": "xmd"}, + ["path", {"d": "m0,0 4,0 c 3,10 6,20 16,20", "class": "s1"}], + ["path", {"d": "m0,20 20,0", "class": "s1"}], + ["path", {"d": "M0,5 4,1", "class": "s2"}], + ["path", {"d": "M0,10 5.5,4.5", "class": "s2"}], + ["path", {"d": "M0,15 6.5,8.5", "class": "s2"}], + ["path", {"d": "M0,20 8,12", "class": "s2"}], + ["path", {"d": "m5,20 5,-5", "class": "s2"}], + ["path", {"d": "m10,20 2.5,-2.5", "class": "s2"}] + ], + ["g", {"id": "xmu"}, + ["path", {"d": "M0,0 20,0", "class": "s1"}], + ["path", {"d": "m0,20 4,0 C 7,10 10,0 20,0", "class": "s1"}], + ["path", {"d": "M0,5 5,0", "class": "s2"}], + ["path", {"d": "M0,10 10,0", "class": "s2"}], + ["path", {"d": "M0,15 10,5", "class": "s2"}], + ["path", {"d": "M0,20 6,14", "class": "s2"}] + ], + ["g", {"id": "xmz"}, + ["path", {"d": "m0,0 4,0 c 6,10 11,10 16,10", "class": "s1"}], + ["path", {"d": "m0,20 4,0 C 10,10 15,10 20,10", "class": "s1"}], + ["path", {"d": "M0,5 4.5,0.5", "class": "s2"}], + ["path", {"d": "M0,10 6.5,3.5", "class": "s2"}], + ["path", {"d": "M0,15 8.5,6.5", "class": "s2"}], + ["path", {"d": "M0,20 11.5,8.5", "class": "s2"}] + ], + ["g", {"id": "ddd"}, + ["path", {"d": "m0,20 20,0", "class": "s3"}] + ], + ["g", {"id": "dm0"}, + ["path", {"d": "m0,20 10,0", "class": "s3"}], + ["path", {"d": "m12,20 8,0", "class": "s1"}] + ], + ["g", {"id": "dm1"}, + ["path", {"d": "M0,20 3,20 9,0 20,0", "class": "s1"}] + ], + ["g", {"id": "dmx"}, + ["path", {"d": "M3,20 9,0 20,0", "class": "s1"}], + ["path", {"d": "m20,15 -5,5", "class": "s2"}], + ["path", {"d": "M20,10 10,20", "class": "s2"}], + ["path", {"d": "M20,5 5,20", "class": "s2"}], + ["path", {"d": "M20,0 4,16", "class": "s2"}], + ["path", {"d": "M15,0 6,9", "class": "s2"}], + ["path", {"d": "M10,0 9,1", "class": "s2"}], + ["path", {"d": "m0,20 20,0", "class": "s1"}] + ], + ["g", {"id": "dmd"}, + ["path", {"d": "m0,20 20,0", "class": "s3"}] + ], + ["g", {"id": "dmu"}, + ["path", {"d": "m0,20 3,0 C 7,10 10.107603,0 20,0", "class": "s1"}] + ], + ["g", {"id": "dmz"}, + ["path", {"d": "m0,20 3,0 C 10,10 15,10 20,10", "class": "s1"}] + ], + ["g", {"id": "uuu"}, + ["path", {"d": "M0,0 20,0", "class": "s3"}] + ], + ["g", {"id": "um0"}, + ["path", {"d": "m0,0 3,0 6,20 11,0", "class": "s1"}] + ], + ["g", {"id": "um1"}, + ["path", {"d": "M0,0 10,0", "class": "s3"}], + ["path", {"d": "m12,0 8,0", "class": "s1"}] + ], + ["g", {"id": "umx"}, + ["path", {"d": "m3,0 6,20 11,0", "class": "s1"}], + ["path", {"d": "M0,0 20,0", "class": "s1"}], + ["path", {"d": "m20,15 -5,5", "class": "s2"}], + ["path", {"d": "M20,10 10,20", "class": "s2"}], + ["path", {"d": "M20,5 8,17", "class": "s2"}], + ["path", {"d": "M20,0 7,13", "class": "s2"}], + ["path", {"d": "M15,0 6,9", "class": "s2"}], + ["path", {"d": "M10,0 5,5", "class": "s2"}], + ["path", {"d": "M3.5,1.5 5,0", "class": "s2"}] + ], + ["g", {"id": "umd"}, + ["path", {"d": "m0,0 3,0 c 4,10 7,20 17,20", "class": "s1"}] + ], + ["g", {"id": "umu"}, + ["path", {"d": "M0,0 20,0", "class": "s3"}] + ], + ["g", {"id": "umz"}, + ["path", {"d": "m0,0 3,0 c 7,10 12,10 17,10", "class": "s4"}] + ], + ["g", {"id": "zzz"}, + ["path", {"d": "m0,10 20,0", "class": "s1"}] + ], + ["g", {"id": "zm0"}, + ["path", {"d": "m0,10 6,0 3,10 11,0", "class": "s1"}] + ], + ["g", {"id": "zm1"}, + ["path", {"d": "M0,10 6,10 9,0 20,0", "class": "s1"}] + ], + ["g", {"id": "zmx"}, + ["path", {"d": "m6,10 3,10 11,0", "class": "s1"}], + ["path", {"d": "M0,10 6,10 9,0 20,0", "class": "s1"}], + ["path", {"d": "m20,15 -5,5", "class": "s2"}], + ["path", {"d": "M20,10 10,20", "class": "s2"}], + ["path", {"d": "M20,5 8,17", "class": "s2"}], + ["path", {"d": "M20,0 7,13", "class": "s2"}], + ["path", {"d": "M15,0 6.5,8.5", "class": "s2"}], + ["path", {"d": "M10,0 9,1", "class": "s2"}] + ], + ["g", {"id": "zmd"}, + ["path", {"d": "m0,10 7,0 c 3,5 8,10 13,10", "class": "s1"}] + ], + ["g", {"id": "zmu"}, + ["path", {"d": "m0,10 7,0 C 10,5 15,0 20,0", "class": "s1"}] + ], + ["g", {"id": "zmz"}, + ["path", {"d": "m0,10 20,0", "class": "s1"}] + ], + ["g", {"id": "gap"}, + ["path", {"d": "m7,-2 -4,0 c -5,0 -5,24 -10,24 l 4,0 C 2,22 2,-2 7,-2 z", "class": "s5"}], + ["path", {"d": "M-7,22 C -2,22 -2,-2 3,-2", "class": "s1"}], + ["path", {"d": "M-3,22 C 2,22 2,-2 7,-2", "class": "s1"}] + ], + ["g", {"id": "Pclk"}, + ["path", {"d": "M-3,12 0,3 3,12 C 1,11 -1,11 -3,12 z", "class": "s6"}], + ["path", {"d": "M0,20 0,0 20,0", "class": "s1"}] + ], + ["g", {"id": "Nclk"}, + ["path", {"d": "M-3,8 0,17 3,8 C 1,9 -1,9 -3,8 z", "class": "s6"}], + ["path", {"d": "m0,0 0,20 20,0", "class": "s1"}] + ], + ["g", {"id": "0mv-2"}, + ["path", {"d": "M9,0 20,0 20,20 3,20 z", "class": "s7"}], + ["path", {"d": "M3,20 9,0 20,0", "class": "s1"}], + ["path", {"d": "m0,20 20,0", "class": "s1"}] + ], + ["g", {"id": "1mv-2"}, + ["path", {"d": "M2.875,0 20,0 20,20 9,20 z", "class": "s7"}], + ["path", {"d": "m3,0 6,20 11,0", "class": "s1"}], + ["path", {"d": "M0,0 20,0", "class": "s1"}] + ], + ["g", {"id": "xmv-2"}, + ["path", {"d": "M9,0 20,0 20,20 9,20 6,10 z", "class": "s7"}], + ["path", {"d": "M0,20 3,20 9,0 20,0", "class": "s1"}], + ["path", {"d": "m0,0 3,0 6,20 11,0", "class": "s1"}], + ["path", {"d": "M0,5 3.5,1.5", "class": "s2"}], + ["path", {"d": "M0,10 4.5,5.5", "class": "s2"}], + ["path", {"d": "M0,15 6,9", "class": "s2"}], + ["path", {"d": "M0,20 4,16", "class": "s2"}] + ], + ["g", {"id": "dmv-2"}, + ["path", {"d": "M9,0 20,0 20,20 3,20 z", "class": "s7"}], + ["path", {"d": "M3,20 9,0 20,0", "class": "s1"}], + ["path", {"d": "m0,20 20,0", "class": "s1"}] + ], + ["g", {"id": "umv-2"}, + ["path", {"d": "M3,0 20,0 20,20 9,20 z", "class": "s7"}], + ["path", {"d": "m3,0 6,20 11,0", "class": "s1"}], + ["path", {"d": "M0,0 20,0", "class": "s1"}] + ], + ["g", {"id": "zmv-2"}, + ["path", {"d": "M9,0 20,0 20,20 9,20 6,10 z", "class": "s7"}], + ["path", {"d": "m6,10 3,10 11,0", "class": "s1"}], + ["path", {"d": "M0,10 6,10 9,0 20,0", "class": "s1"}] + ], + ["g", {"id": "vvv-2"}, + ["path", {"d": "M20,20 0,20 0,0 20,0", "class": "s7"}], + ["path", {"d": "m0,20 20,0", "class": "s1"}], + ["path", {"d": "M0,0 20,0", "class": "s1"}] + ], + ["g", {"id": "vm0-2"}, + ["path", {"d": "M0,20 0,0 3,0 9,20", "class": "s7"}], + ["path", {"d": "M0,0 3,0 9,20", "class": "s1"}], + ["path", {"d": "m0,20 20,0", "class": "s1"}] + ], + ["g", {"id": "vm1-2"}, + ["path", {"d": "M0,0 0,20 3,20 9,0", "class": "s7"}], + ["path", {"d": "M0,0 20,0", "class": "s1"}], + ["path", {"d": "M0,20 3,20 9,0", "class": "s1"}] + ], + ["g", {"id": "vmx-2"}, + ["path", {"d": "M0,0 0,20 3,20 6,10 3,0", "class": "s7"}], + ["path", {"d": "m0,0 3,0 6,20 11,0", "class": "s1"}], + ["path", {"d": "M0,20 3,20 9,0 20,0", "class": "s1"}], + ["path", {"d": "m20,15 -5,5", "class": "s2"}], + ["path", {"d": "M20,10 10,20", "class": "s2"}], + ["path", {"d": "M20,5 8,17", "class": "s2"}], + ["path", {"d": "M20,0 7,13", "class": "s2"}], + ["path", {"d": "M15,0 7,8", "class": "s2"}], + ["path", {"d": "M10,0 9,1", "class": "s2"}] + ], + ["g", {"id": "vmd-2"}, + ["path", {"d": "m0,0 0,20 20,0 C 10,20 7,10 3,0", "class": "s7"}], + ["path", {"d": "m0,0 3,0 c 4,10 7,20 17,20", "class": "s1"}], + ["path", {"d": "m0,20 20,0", "class": "s1"}] + ], + ["g", {"id": "vmu-2"}, + ["path", {"d": "m0,0 0,20 3,0 C 7,10 10,0 20,0", "class": "s7"}], + ["path", {"d": "m0,20 3,0 C 7,10 10,0 20,0", "class": "s1"}], + ["path", {"d": "M0,0 20,0", "class": "s1"}] + ], + ["g", {"id": "vmz-2"}, + ["path", {"d": "M0,0 3,0 C 10,10 15,10 20,10 15,10 10,10 3,20 L 0,20", "class": "s7"}], + ["path", {"d": "m0,0 3,0 c 7,10 12,10 17,10", "class": "s1"}], + ["path", {"d": "m0,20 3,0 C 10,10 15,10 20,10", "class": "s1"}] + ], + ["g", {"id": "0mv-3"}, + ["path", {"d": "M9,0 20,0 20,20 3,20 z", "class": "s8"}], + ["path", {"d": "M3,20 9,0 20,0", "class": "s1"}], + ["path", {"d": "m0,20 20,0", "class": "s1"}] + ], + ["g", {"id": "1mv-3"}, + ["path", {"d": "M2.875,0 20,0 20,20 9,20 z", "class": "s8"}], + ["path", {"d": "m3,0 6,20 11,0", "class": "s1"}], + ["path", {"d": "M0,0 20,0", "class": "s1"}] + ], + ["g", {"id": "xmv-3"}, + ["path", {"d": "M9,0 20,0 20,20 9,20 6,10 z", "class": "s8"}], + ["path", {"d": "M0,20 3,20 9,0 20,0", "class": "s1"}], + ["path", {"d": "m0,0 3,0 6,20 11,0", "class": "s1"}], + ["path", {"d": "M0,5 3.5,1.5", "class": "s2"}], + ["path", {"d": "M0,10 4.5,5.5", "class": "s2"}], + ["path", {"d": "M0,15 6,9", "class": "s2"}], + ["path", {"d": "M0,20 4,16", "class": "s2"}] + ], + ["g", {"id": "dmv-3"}, + ["path", {"d": "M9,0 20,0 20,20 3,20 z", "class": "s8"}], + ["path", {"d": "M3,20 9,0 20,0", "class": "s1"}], + ["path", {"d": "m0,20 20,0", "class": "s1"}] + ], + ["g", {"id": "umv-3"}, + ["path", {"d": "M3,0 20,0 20,20 9,20 z", "class": "s8"}], + ["path", {"d": "m3,0 6,20 11,0", "class": "s1"}], + ["path", {"d": "M0,0 20,0", "class": "s1"}] + ], + ["g", {"id": "zmv-3"}, + ["path", {"d": "M9,0 20,0 20,20 9,20 6,10 z", "class": "s8"}], + ["path", {"d": "m6,10 3,10 11,0", "class": "s1"}], + ["path", {"d": "M0,10 6,10 9,0 20,0", "class": "s1"}] + ], + ["g", {"id": "vvv-3"}, + ["path", {"d": "M20,20 0,20 0,0 20,0", "class": "s8"}], + ["path", {"d": "m0,20 20,0", "class": "s1"}], + ["path", {"d": "M0,0 20,0", "class": "s1"}] + ], + ["g", {"id": "vm0-3"}, + ["path", {"d": "M0,20 0,0 3,0 9,20", "class": "s8"}], + ["path", {"d": "M0,0 3,0 9,20", "class": "s1"}], + ["path", {"d": "m0,20 20,0", "class": "s1"}] + ], + ["g", {"id": "vm1-3"}, + ["path", {"d": "M0,0 0,20 3,20 9,0", "class": "s8"}], + ["path", {"d": "M0,0 20,0", "class": "s1"}], + ["path", {"d": "M0,20 3,20 9,0", "class": "s1"}] + ], + ["g", {"id": "vmx-3"}, + ["path", {"d": "M0,0 0,20 3,20 6,10 3,0", "class": "s8"}], + ["path", {"d": "m0,0 3,0 6,20 11,0", "class": "s1"}], + ["path", {"d": "M0,20 3,20 9,0 20,0", "class": "s1"}], + ["path", {"d": "m20,15 -5,5", "class": "s2"}], + ["path", {"d": "M20,10 10,20", "class": "s2"}], + ["path", {"d": "M20,5 8,17", "class": "s2"}], + ["path", {"d": "M20,0 7,13", "class": "s2"}], + ["path", {"d": "M15,0 7,8", "class": "s2"}], + ["path", {"d": "M10,0 9,1", "class": "s2"}] + ], + ["g", {"id": "vmd-3"}, + ["path", {"d": "m0,0 0,20 20,0 C 10,20 7,10 3,0", "class": "s8"}], + ["path", {"d": "m0,0 3,0 c 4,10 7,20 17,20", "class": "s1"}], + ["path", {"d": "m0,20 20,0", "class": "s1"}] + ], + ["g", {"id": "vmu-3"}, + ["path", {"d": "m0,0 0,20 3,0 C 7,10 10,0 20,0", "class": "s8"}], + ["path", {"d": "m0,20 3,0 C 7,10 10,0 20,0", "class": "s1"}], + ["path", {"d": "M0,0 20,0", "class": "s1"}] + ], + ["g", {"id": "vmz-3"}, + ["path", {"d": "M0,0 3,0 C 10,10 15,10 20,10 15,10 10,10 3,20 L 0,20", "class": "s8"}], + ["path", {"d": "m0,0 3,0 c 7,10 12,10 17,10", "class": "s1"}], + ["path", {"d": "m0,20 3,0 C 10,10 15,10 20,10", "class": "s1"}] + ], + ["g", {"id": "0mv-4"}, + ["path", {"d": "M9,0 20,0 20,20 3,20 z", "class": "s9"}], + ["path", {"d": "M3,20 9,0 20,0", "class": "s1"}], + ["path", {"d": "m0,20 20,0", "class": "s1"}] + ], + ["g", {"id": "1mv-4"}, + ["path", {"d": "M2.875,0 20,0 20,20 9,20 z", "class": "s9"}], + ["path", {"d": "m3,0 6,20 11,0", "class": "s1"}], + ["path", {"d": "M0,0 20,0", "class": "s1"}] + ], + ["g", {"id": "xmv-4"}, + ["path", {"d": "M9,0 20,0 20,20 9,20 6,10 z", "class": "s9"}], + ["path", {"d": "M0,20 3,20 9,0 20,0", "class": "s1"}], + ["path", {"d": "m0,0 3,0 6,20 11,0", "class": "s1"}], + ["path", {"d": "M0,5 3.5,1.5", "class": "s2"}], + ["path", {"d": "M0,10 4.5,5.5", "class": "s2"}], + ["path", {"d": "M0,15 6,9", "class": "s2"}], + ["path", {"d": "M0,20 4,16", "class": "s2"}] + ], + ["g", {"id": "dmv-4"}, + ["path", {"d": "M9,0 20,0 20,20 3,20 z", "class": "s9"}], + ["path", {"d": "M3,20 9,0 20,0", "class": "s1"}], + ["path", {"d": "m0,20 20,0", "class": "s1"}] + ], + ["g", {"id": "umv-4"}, + ["path", {"d": "M3,0 20,0 20,20 9,20 z", "class": "s9"}], + ["path", {"d": "m3,0 6,20 11,0", "class": "s1"}], + ["path", {"d": "M0,0 20,0", "class": "s1"}] + ], + ["g", {"id": "zmv-4"}, + ["path", {"d": "M9,0 20,0 20,20 9,20 6,10 z", "class": "s9"}], + ["path", {"d": "m6,10 3,10 11,0", "class": "s1"}], + ["path", {"d": "M0,10 6,10 9,0 20,0", "class": "s1"}] + ], + ["g", {"id": "vvv-4"}, + ["path", {"d": "M20,20 0,20 0,0 20,0", "class": "s9"}], + ["path", {"d": "m0,20 20,0", "class": "s1"}], + ["path", {"d": "M0,0 20,0", "class": "s1"}] + ], + ["g", {"id": "vm0-4"}, + ["path", {"d": "M0,20 0,0 3,0 9,20", "class": "s9"}], + ["path", {"d": "M0,0 3,0 9,20", "class": "s1"}], + ["path", {"d": "m0,20 20,0", "class": "s1"}] + ], + ["g", {"id": "vm1-4"}, + ["path", {"d": "M0,0 0,20 3,20 9,0", "class": "s9"}], + ["path", {"d": "M0,0 20,0", "class": "s1"}], + ["path", {"d": "M0,20 3,20 9,0", "class": "s1"}] + ], + ["g", {"id": "vmx-4"}, + ["path", {"d": "M0,0 0,20 3,20 6,10 3,0", "class": "s9"}], + ["path", {"d": "m0,0 3,0 6,20 11,0", "class": "s1"}], + ["path", {"d": "M0,20 3,20 9,0 20,0", "class": "s1"}], + ["path", {"d": "m20,15 -5,5", "class": "s2"}], + ["path", {"d": "M20,10 10,20", "class": "s2"}], + ["path", {"d": "M20,5 8,17", "class": "s2"}], + ["path", {"d": "M20,0 7,13", "class": "s2"}], + ["path", {"d": "M15,0 7,8", "class": "s2"}], + ["path", {"d": "M10,0 9,1", "class": "s2"}] + ], + ["g", {"id": "vmd-4"}, + ["path", {"d": "m0,0 0,20 20,0 C 10,20 7,10 3,0", "class": "s9"}], + ["path", {"d": "m0,0 3,0 c 4,10 7,20 17,20", "class": "s1"}], + ["path", {"d": "m0,20 20,0", "class": "s1"}] + ], + ["g", {"id": "vmu-4"}, + ["path", {"d": "m0,0 0,20 3,0 C 7,10 10,0 20,0", "class": "s9"}], + ["path", {"d": "m0,20 3,0 C 7,10 10,0 20,0", "class": "s1"}], + ["path", {"d": "M0,0 20,0", "class": "s1"}] + ], + ["g", {"id": "vmz-4"}, + ["path", {"d": "M0,0 3,0 C 10,10 15,10 20,10 15,10 10,10 3,20 L 0,20", "class": "s9"}], + ["path", {"d": "m0,0 3,0 c 7,10 12,10 17,10", "class": "s1"}], + ["path", {"d": "m0,20 3,0 C 10,10 15,10 20,10", "class": "s1"}] + ], + ["g", {"id": "0mv-5"}, + ["path", {"d": "M9,0 20,0 20,20 3,20 z", "class": "s10"}], + ["path", {"d": "M3,20 9,0 20,0", "class": "s1"}], + ["path", {"d": "m0,20 20,0", "class": "s1"}] + ], + ["g", {"id": "1mv-5"}, + ["path", {"d": "M2.875,0 20,0 20,20 9,20 z", "class": "s10"}], + ["path", {"d": "m3,0 6,20 11,0", "class": "s1"}], + ["path", {"d": "M0,0 20,0", "class": "s1"}] + ], + ["g", {"id": "xmv-5"}, + ["path", {"d": "M9,0 20,0 20,20 9,20 6,10 z", "class": "s10"}], + ["path", {"d": "M0,20 3,20 9,0 20,0", "class": "s1"}], + ["path", {"d": "m0,0 3,0 6,20 11,0", "class": "s1"}], + ["path", {"d": "M0,5 3.5,1.5", "class": "s2"}], + ["path", {"d": "M0,10 4.5,5.5", "class": "s2"}], + ["path", {"d": "M0,15 6,9", "class": "s2"}], + ["path", {"d": "M0,20 4,16", "class": "s2"}] + ], + ["g", {"id": "dmv-5"}, + ["path", {"d": "M9,0 20,0 20,20 3,20 z", "class": "s10"}], + ["path", {"d": "M3,20 9,0 20,0", "class": "s1"}], + ["path", {"d": "m0,20 20,0", "class": "s1"}] + ], + ["g", {"id": "umv-5"}, + ["path", {"d": "M3,0 20,0 20,20 9,20 z", "class": "s10"}], + ["path", {"d": "m3,0 6,20 11,0", "class": "s1"}], + ["path", {"d": "M0,0 20,0", "class": "s1"}] + ], + ["g", {"id": "zmv-5"}, + ["path", {"d": "M9,0 20,0 20,20 9,20 6,10 z", "class": "s10"}], + ["path", {"d": "m6,10 3,10 11,0", "class": "s1"}], + ["path", {"d": "M0,10 6,10 9,0 20,0", "class": "s1"}] + ], + ["g", {"id": "vvv-5"}, + ["path", {"d": "M20,20 0,20 0,0 20,0", "class": "s10"}], + ["path", {"d": "m0,20 20,0", "class": "s1"}], + ["path", {"d": "M0,0 20,0", "class": "s1"}] + ], + ["g", {"id": "vm0-5"}, + ["path", {"d": "M0,20 0,0 3,0 9,20", "class": "s10"}], + ["path", {"d": "M0,0 3,0 9,20", "class": "s1"}], + ["path", {"d": "m0,20 20,0", "class": "s1"}] + ], + ["g", {"id": "vm1-5"}, + ["path", {"d": "M0,0 0,20 3,20 9,0", "class": "s10"}], + ["path", {"d": "M0,0 20,0", "class": "s1"}], + ["path", {"d": "M0,20 3,20 9,0", "class": "s1"}] + ], + ["g", {"id": "vmx-5"}, + ["path", {"d": "M0,0 0,20 3,20 6,10 3,0", "class": "s10"}], + ["path", {"d": "m0,0 3,0 6,20 11,0", "class": "s1"}], + ["path", {"d": "M0,20 3,20 9,0 20,0", "class": "s1"}], + ["path", {"d": "m20,15 -5,5", "class": "s2"}], + ["path", {"d": "M20,10 10,20", "class": "s2"}], + ["path", {"d": "M20,5 8,17", "class": "s2"}], + ["path", {"d": "M20,0 7,13", "class": "s2"}], + ["path", {"d": "M15,0 7,8", "class": "s2"}], + ["path", {"d": "M10,0 9,1", "class": "s2"}] + ], + ["g", {"id": "vmd-5"}, + ["path", {"d": "m0,0 0,20 20,0 C 10,20 7,10 3,0", "class": "s10"}], + ["path", {"d": "m0,0 3,0 c 4,10 7,20 17,20", "class": "s1"}], + ["path", {"d": "m0,20 20,0", "class": "s1"}] + ], + ["g", {"id": "vmu-5"}, + ["path", {"d": "m0,0 0,20 3,0 C 7,10 10,0 20,0", "class": "s10"}], + ["path", {"d": "m0,20 3,0 C 7,10 10,0 20,0", "class": "s1"}], + ["path", {"d": "M0,0 20,0", "class": "s1"}] + ], + ["g", {"id": "vmz-5"}, + ["path", {"d": "M0,0 3,0 C 10,10 15,10 20,10 15,10 10,10 3,20 L 0,20", "class": "s10"}], + ["path", {"d": "m0,0 3,0 c 7,10 12,10 17,10", "class": "s1"}], + ["path", {"d": "m0,20 3,0 C 10,10 15,10 20,10", "class": "s1"}] + ], + ["g", {"id": "0mv-6"}, + ["path", {"d": "M9,0 20,0 20,20 3,20 z", "class": "s11"}], + ["path", {"d": "M3,20 9,0 20,0", "class": "s1"}], + ["path", {"d": "m0,20 20,0", "class": "s1"}] + ], + ["g", {"id": "1mv-6"}, + ["path", {"d": "M2.875,0 20,0 20,20 9,20 z", "class": "s11"}], + ["path", {"d": "m3,0 6,20 11,0", "class": "s1"}], + ["path", {"d": "M0,0 20,0", "class": "s1"}] + ], + ["g", {"id": "xmv-6"}, + ["path", {"d": "M9,0 20,0 20,20 9,20 6,10 z", "class": "s11"}], + ["path", {"d": "M0,20 3,20 9,0 20,0", "class": "s1"}], + ["path", {"d": "m0,0 3,0 6,20 11,0", "class": "s1"}], + ["path", {"d": "M0,5 3.5,1.5", "class": "s2"}], + ["path", {"d": "M0,10 4.5,5.5", "class": "s2"}], + ["path", {"d": "M0,15 6,9", "class": "s2"}], + ["path", {"d": "M0,20 4,16", "class": "s2"}] + ], + ["g", {"id": "dmv-6"}, + ["path", {"d": "M9,0 20,0 20,20 3,20 z", "class": "s11"}], + ["path", {"d": "M3,20 9,0 20,0", "class": "s1"}], + ["path", {"d": "m0,20 20,0", "class": "s1"}] + ], + ["g", {"id": "umv-6"}, + ["path", {"d": "M3,0 20,0 20,20 9,20 z", "class": "s11"}], + ["path", {"d": "m3,0 6,20 11,0", "class": "s1"}], + ["path", {"d": "M0,0 20,0", "class": "s1"}] + ], + ["g", {"id": "zmv-6"}, + ["path", {"d": "M9,0 20,0 20,20 9,20 6,10 z", "class": "s11"}], + ["path", {"d": "m6,10 3,10 11,0", "class": "s1"}], + ["path", {"d": "M0,10 6,10 9,0 20,0", "class": "s1"}] + ], + ["g", {"id": "vvv-6"}, + ["path", {"d": "M20,20 0,20 0,0 20,0", "class": "s11"}], + ["path", {"d": "m0,20 20,0", "class": "s1"}], + ["path", {"d": "M0,0 20,0", "class": "s1"}] + ], + ["g", {"id": "vm0-6"}, + ["path", {"d": "M0,20 0,0 3,0 9,20", "class": "s11"}], + ["path", {"d": "M0,0 3,0 9,20", "class": "s1"}], + ["path", {"d": "m0,20 20,0", "class": "s1"}] + ], + ["g", {"id": "vm1-6"}, + ["path", {"d": "M0,0 0,20 3,20 9,0", "class": "s11"}], + ["path", {"d": "M0,0 20,0", "class": "s1"}], + ["path", {"d": "M0,20 3,20 9,0", "class": "s1"}] + ], + ["g", {"id": "vmx-6"}, + ["path", {"d": "M0,0 0,20 3,20 6,10 3,0", "class": "s11"}], + ["path", {"d": "m0,0 3,0 6,20 11,0", "class": "s1"}], + ["path", {"d": "M0,20 3,20 9,0 20,0", "class": "s1"}], + ["path", {"d": "m20,15 -5,5", "class": "s2"}], + ["path", {"d": "M20,10 10,20", "class": "s2"}], + ["path", {"d": "M20,5 8,17", "class": "s2"}], + ["path", {"d": "M20,0 7,13", "class": "s2"}], + ["path", {"d": "M15,0 7,8", "class": "s2"}], + ["path", {"d": "M10,0 9,1", "class": "s2"}] + ], + ["g", {"id": "vmd-6"}, + ["path", {"d": "m0,0 0,20 20,0 C 10,20 7,10 3,0", "class": "s11"}], + ["path", {"d": "m0,0 3,0 c 4,10 7,20 17,20", "class": "s1"}], + ["path", {"d": "m0,20 20,0", "class": "s1"}] + ], + ["g", {"id": "vmu-6"}, + ["path", {"d": "m0,0 0,20 3,0 C 7,10 10,0 20,0", "class": "s11"}], + ["path", {"d": "m0,20 3,0 C 7,10 10,0 20,0", "class": "s1"}], + ["path", {"d": "M0,0 20,0", "class": "s1"}] + ], + ["g", {"id": "vmz-6"}, + ["path", {"d": "M0,0 3,0 C 10,10 15,10 20,10 15,10 10,10 3,20 L 0,20", "class": "s11"}], + ["path", {"d": "m0,0 3,0 c 7,10 12,10 17,10", "class": "s1"}], + ["path", {"d": "m0,20 3,0 C 10,10 15,10 20,10", "class": "s1"}] + ], + ["g", {"id": "0mv-7"}, + ["path", {"d": "M9,0 20,0 20,20 3,20 z", "class": "s12"}], + ["path", {"d": "M3,20 9,0 20,0", "class": "s1"}], + ["path", {"d": "m0,20 20,0", "class": "s1"}] + ], + ["g", {"id": "1mv-7"}, + ["path", {"d": "M2.875,0 20,0 20,20 9,20 z", "class": "s12"}], + ["path", {"d": "m3,0 6,20 11,0", "class": "s1"}], + ["path", {"d": "M0,0 20,0", "class": "s1"}] + ], + ["g", {"id": "xmv-7"}, + ["path", {"d": "M9,0 20,0 20,20 9,20 6,10 z", "class": "s12"}], + ["path", {"d": "M0,20 3,20 9,0 20,0", "class": "s1"}], + ["path", {"d": "m0,0 3,0 6,20 11,0", "class": "s1"}], + ["path", {"d": "M0,5 3.5,1.5", "class": "s2"}], + ["path", {"d": "M0,10 4.5,5.5", "class": "s2"}], + ["path", {"d": "M0,15 6,9", "class": "s2"}], + ["path", {"d": "M0,20 4,16", "class": "s2"}] + ], + ["g", {"id": "dmv-7"}, + ["path", {"d": "M9,0 20,0 20,20 3,20 z", "class": "s12"}], + ["path", {"d": "M3,20 9,0 20,0", "class": "s1"}], + ["path", {"d": "m0,20 20,0", "class": "s1"}] + ], + ["g", {"id": "umv-7"}, + ["path", {"d": "M3,0 20,0 20,20 9,20 z", "class": "s12"}], + ["path", {"d": "m3,0 6,20 11,0", "class": "s1"}], + ["path", {"d": "M0,0 20,0", "class": "s1"}] + ], + ["g", {"id": "zmv-7"}, + ["path", {"d": "M9,0 20,0 20,20 9,20 6,10 z", "class": "s12"}], + ["path", {"d": "m6,10 3,10 11,0", "class": "s1"}], + ["path", {"d": "M0,10 6,10 9,0 20,0", "class": "s1"}] + ], + ["g", {"id": "vvv-7"}, + ["path", {"d": "M20,20 0,20 0,0 20,0", "class": "s12"}], + ["path", {"d": "m0,20 20,0", "class": "s1"}], + ["path", {"d": "M0,0 20,0", "class": "s1"}] + ], + ["g", {"id": "vm0-7"}, + ["path", {"d": "M0,20 0,0 3,0 9,20", "class": "s12"}], + ["path", {"d": "M0,0 3,0 9,20", "class": "s1"}], + ["path", {"d": "m0,20 20,0", "class": "s1"}] + ], + ["g", {"id": "vm1-7"}, + ["path", {"d": "M0,0 0,20 3,20 9,0", "class": "s12"}], + ["path", {"d": "M0,0 20,0", "class": "s1"}], + ["path", {"d": "M0,20 3,20 9,0", "class": "s1"}] + ], + ["g", {"id": "vmx-7"}, + ["path", {"d": "M0,0 0,20 3,20 6,10 3,0", "class": "s12"}], + ["path", {"d": "m0,0 3,0 6,20 11,0", "class": "s1"}], + ["path", {"d": "M0,20 3,20 9,0 20,0", "class": "s1"}], + ["path", {"d": "m20,15 -5,5", "class": "s2"}], + ["path", {"d": "M20,10 10,20", "class": "s2"}], + ["path", {"d": "M20,5 8,17", "class": "s2"}], + ["path", {"d": "M20,0 7,13", "class": "s2"}], + ["path", {"d": "M15,0 7,8", "class": "s2"}], + ["path", {"d": "M10,0 9,1", "class": "s2"}] + ], + ["g", {"id": "vmd-7"}, + ["path", {"d": "m0,0 0,20 20,0 C 10,20 7,10 3,0", "class": "s12"}], + ["path", {"d": "m0,0 3,0 c 4,10 7,20 17,20", "class": "s1"}], + ["path", {"d": "m0,20 20,0", "class": "s1"}] + ], + ["g", {"id": "vmu-7"}, + ["path", {"d": "m0,0 0,20 3,0 C 7,10 10,0 20,0", "class": "s12"}], + ["path", {"d": "m0,20 3,0 C 7,10 10,0 20,0", "class": "s1"}], + ["path", {"d": "M0,0 20,0", "class": "s1"}] + ], + ["g", {"id": "vmz-7"}, + ["path", {"d": "M0,0 3,0 C 10,10 15,10 20,10 15,10 10,10 3,20 L 0,20", "class": "s12"}], + ["path", {"d": "m0,0 3,0 c 7,10 12,10 17,10", "class": "s1"}], + ["path", {"d": "m0,20 3,0 C 10,10 15,10 20,10", "class": "s1"}] + ], + ["g", {"id": "0mv-8"}, + ["path", {"d": "M9,0 20,0 20,20 3,20 z", "class": "s13"}], + ["path", {"d": "M3,20 9,0 20,0", "class": "s1"}], + ["path", {"d": "m0,20 20,0", "class": "s1"}] + ], + ["g", {"id": "1mv-8"}, + ["path", {"d": "M2.875,0 20,0 20,20 9,20 z", "class": "s13"}], + ["path", {"d": "m3,0 6,20 11,0", "class": "s1"}], + ["path", {"d": "M0,0 20,0", "class": "s1"}] + ], + ["g", {"id": "xmv-8"}, + ["path", {"d": "M9,0 20,0 20,20 9,20 6,10 z", "class": "s13"}], + ["path", {"d": "M0,20 3,20 9,0 20,0", "class": "s1"}], + ["path", {"d": "m0,0 3,0 6,20 11,0", "class": "s1"}], + ["path", {"d": "M0,5 3.5,1.5", "class": "s2"}], + ["path", {"d": "M0,10 4.5,5.5", "class": "s2"}], + ["path", {"d": "M0,15 6,9", "class": "s2"}], + ["path", {"d": "M0,20 4,16", "class": "s2"}] + ], + ["g", {"id": "dmv-8"}, + ["path", {"d": "M9,0 20,0 20,20 3,20 z", "class": "s13"}], + ["path", {"d": "M3,20 9,0 20,0", "class": "s1"}], + ["path", {"d": "m0,20 20,0", "class": "s1"}] + ], + ["g", {"id": "umv-8"}, + ["path", {"d": "M3,0 20,0 20,20 9,20 z", "class": "s13"}], + ["path", {"d": "m3,0 6,20 11,0", "class": "s1"}], + ["path", {"d": "M0,0 20,0", "class": "s1"}] + ], + ["g", {"id": "zmv-8"}, + ["path", {"d": "M9,0 20,0 20,20 9,20 6,10 z", "class": "s13"}], + ["path", {"d": "m6,10 3,10 11,0", "class": "s1"}], + ["path", {"d": "M0,10 6,10 9,0 20,0", "class": "s1"}] + ], + ["g", {"id": "vvv-8"}, + ["path", {"d": "M20,20 0,20 0,0 20,0", "class": "s13"}], + ["path", {"d": "m0,20 20,0", "class": "s1"}], + ["path", {"d": "M0,0 20,0", "class": "s1"}] + ], + ["g", {"id": "vm0-8"}, + ["path", {"d": "M0,20 0,0 3,0 9,20", "class": "s13"}], + ["path", {"d": "M0,0 3,0 9,20", "class": "s1"}], + ["path", {"d": "m0,20 20,0", "class": "s1"}] + ], + ["g", {"id": "vm1-8"}, + ["path", {"d": "M0,0 0,20 3,20 9,0", "class": "s13"}], + ["path", {"d": "M0,0 20,0", "class": "s1"}], + ["path", {"d": "M0,20 3,20 9,0", "class": "s1"}] + ], + ["g", {"id": "vmx-8"}, + ["path", {"d": "M0,0 0,20 3,20 6,10 3,0", "class": "s13"}], + ["path", {"d": "m0,0 3,0 6,20 11,0", "class": "s1"}], + ["path", {"d": "M0,20 3,20 9,0 20,0", "class": "s1"}], + ["path", {"d": "m20,15 -5,5", "class": "s2"}], + ["path", {"d": "M20,10 10,20", "class": "s2"}], + ["path", {"d": "M20,5 8,17", "class": "s2"}], + ["path", {"d": "M20,0 7,13", "class": "s2"}], + ["path", {"d": "M15,0 7,8", "class": "s2"}], + ["path", {"d": "M10,0 9,1", "class": "s2"}] + ], + ["g", {"id": "vmd-8"}, + ["path", {"d": "m0,0 0,20 20,0 C 10,20 7,10 3,0", "class": "s13"}], + ["path", {"d": "m0,0 3,0 c 4,10 7,20 17,20", "class": "s1"}], + ["path", {"d": "m0,20 20,0", "class": "s1"}] + ], + ["g", {"id": "vmu-8"}, + ["path", {"d": "m0,0 0,20 3,0 C 7,10 10,0 20,0", "class": "s13"}], + ["path", {"d": "m0,20 3,0 C 7,10 10,0 20,0", "class": "s1"}], + ["path", {"d": "M0,0 20,0", "class": "s1"}] + ], + ["g", {"id": "vmz-8"}, + ["path", {"d": "M0,0 3,0 C 10,10 15,10 20,10 15,10 10,10 3,20 L 0,20", "class": "s13"}], + ["path", {"d": "m0,0 3,0 c 7,10 12,10 17,10", "class": "s1"}], + ["path", {"d": "m0,20 3,0 C 10,10 15,10 20,10", "class": "s1"}] + ], + ["g", {"id": "0mv-9"}, + ["path", {"d": "M9,0 20,0 20,20 3,20 z", "class": "s14"}], + ["path", {"d": "M3,20 9,0 20,0", "class": "s1"}], + ["path", {"d": "m0,20 20,0", "class": "s1"}] + ], + ["g", {"id": "1mv-9"}, + ["path", {"d": "M2.875,0 20,0 20,20 9,20 z", "class": "s14"}], + ["path", {"d": "m3,0 6,20 11,0", "class": "s1"}], + ["path", {"d": "M0,0 20,0", "class": "s1"}] + ], + ["g", {"id": "xmv-9"}, + ["path", {"d": "M9,0 20,0 20,20 9,20 6,10 z", "class": "s14"}], + ["path", {"d": "M0,20 3,20 9,0 20,0", "class": "s1"}], + ["path", {"d": "m0,0 3,0 6,20 11,0", "class": "s1"}], + ["path", {"d": "M0,5 3.5,1.5", "class": "s2"}], + ["path", {"d": "M0,10 4.5,5.5", "class": "s2"}], + ["path", {"d": "M0,15 6,9", "class": "s2"}], + ["path", {"d": "M0,20 4,16", "class": "s2"}] + ], + ["g", {"id": "dmv-9"}, + ["path", {"d": "M9,0 20,0 20,20 3,20 z", "class": "s14"}], + ["path", {"d": "M3,20 9,0 20,0", "class": "s1"}], + ["path", {"d": "m0,20 20,0", "class": "s1"}] + ], + ["g", {"id": "umv-9"}, + ["path", {"d": "M3,0 20,0 20,20 9,20 z", "class": "s14"}], + ["path", {"d": "m3,0 6,20 11,0", "class": "s1"}], + ["path", {"d": "M0,0 20,0", "class": "s1"}] + ], + ["g", {"id": "zmv-9"}, + ["path", {"d": "M9,0 20,0 20,20 9,20 6,10 z", "class": "s14"}], + ["path", {"d": "m6,10 3,10 11,0", "class": "s1"}], + ["path", {"d": "M0,10 6,10 9,0 20,0", "class": "s1"}] + ], + ["g", {"id": "vvv-9"}, + ["path", {"d": "M20,20 0,20 0,0 20,0", "class": "s14"}], + ["path", {"d": "m0,20 20,0", "class": "s1"}], + ["path", {"d": "M0,0 20,0", "class": "s1"}] + ], + ["g", {"id": "vm0-9"}, + ["path", {"d": "M0,20 0,0 3,0 9,20", "class": "s14"}], + ["path", {"d": "M0,0 3,0 9,20", "class": "s1"}], + ["path", {"d": "m0,20 20,0", "class": "s1"}] + ], + ["g", {"id": "vm1-9"}, + ["path", {"d": "M0,0 0,20 3,20 9,0", "class": "s14"}], + ["path", {"d": "M0,0 20,0", "class": "s1"}], + ["path", {"d": "M0,20 3,20 9,0", "class": "s1"}] + ], + ["g", {"id": "vmx-9"}, + ["path", {"d": "M0,0 0,20 3,20 6,10 3,0", "class": "s14"}], + ["path", {"d": "m0,0 3,0 6,20 11,0", "class": "s1"}], + ["path", {"d": "M0,20 3,20 9,0 20,0", "class": "s1"}], + ["path", {"d": "m20,15 -5,5", "class": "s2"}], + ["path", {"d": "M20,10 10,20", "class": "s2"}], + ["path", {"d": "M20,5 8,17", "class": "s2"}], + ["path", {"d": "M20,0 7,13", "class": "s2"}], + ["path", {"d": "M15,0 7,8", "class": "s2"}], + ["path", {"d": "M10,0 9,1", "class": "s2"}] + ], + ["g", {"id": "vmd-9"}, + ["path", {"d": "m0,0 0,20 20,0 C 10,20 7,10 3,0", "class": "s14"}], + ["path", {"d": "m0,0 3,0 c 4,10 7,20 17,20", "class": "s1"}], + ["path", {"d": "m0,20 20,0", "class": "s1"}] + ], + ["g", {"id": "vmu-9"}, + ["path", {"d": "m0,0 0,20 3,0 C 7,10 10,0 20,0", "class": "s14"}], + ["path", {"d": "m0,20 3,0 C 7,10 10,0 20,0", "class": "s1"}], + ["path", {"d": "M0,0 20,0", "class": "s1"}] + ], + ["g", {"id": "vmz-9"}, + ["path", {"d": "M0,0 3,0 C 10,10 15,10 20,10 15,10 10,10 3,20 L 0,20", "class": "s14"}], + ["path", {"d": "m0,0 3,0 c 7,10 12,10 17,10", "class": "s1"}], + ["path", {"d": "m0,20 3,0 C 10,10 15,10 20,10", "class": "s1"}] + ], + ["g", {"id": "vmv-2-2"}, + ["path", {"d": "M9,0 20,0 20,20 9,20 6,10 z", "class": "s7"}], + ["path", {"d": "M3,0 0,0 0,20 3,20 6,10 z", "class": "s7"}], + ["path", {"d": "m0,0 3,0 6,20 11,0", "class": "s1"}], + ["path", {"d": "M0,20 3,20 9,0 20,0", "class": "s1"}] + ], + ["g", {"id": "vmv-3-2"}, + ["path", {"d": "M9,0 20,0 20,20 9,20 6,10 z", "class": "s7"}], + ["path", {"d": "M3,0 0,0 0,20 3,20 6,10 z", "class": "s8"}], + ["path", {"d": "m0,0 3,0 6,20 11,0", "class": "s1"}], + ["path", {"d": "M0,20 3,20 9,0 20,0", "class": "s1"}] + ], + ["g", {"id": "vmv-4-2"}, + ["path", {"d": "M9,0 20,0 20,20 9,20 6,10 z", "class": "s7"}], + ["path", {"d": "M3,0 0,0 0,20 3,20 6,10 z", "class": "s9"}], + ["path", {"d": "m0,0 3,0 6,20 11,0", "class": "s1"}], + ["path", {"d": "M0,20 3,20 9,0 20,0", "class": "s1"}] + ], + ["g", {"id": "vmv-5-2"}, + ["path", {"d": "M9,0 20,0 20,20 9,20 6,10 z", "class": "s7"}], + ["path", {"d": "M3,0 0,0 0,20 3,20 6,10 z", "class": "s10"}], + ["path", {"d": "m0,0 3,0 6,20 11,0", "class": "s1"}], + ["path", {"d": "M0,20 3,20 9,0 20,0", "class": "s1"}] + ], + ["g", {"id": "vmv-6-2"}, + ["path", {"d": "M9,0 20,0 20,20 9,20 6,10 z", "class": "s7"}], + ["path", {"d": "M3,0 0,0 0,20 3,20 6,10 z", "class": "s11"}], + ["path", {"d": "m0,0 3,0 6,20 11,0", "class": "s1"}], + ["path", {"d": "M0,20 3,20 9,0 20,0", "class": "s1"}] + ], + ["g", {"id": "vmv-7-2"}, + ["path", {"d": "M9,0 20,0 20,20 9,20 6,10 z", "class": "s7"}], + ["path", {"d": "M3,0 0,0 0,20 3,20 6,10 z", "class": "s12"}], + ["path", {"d": "m0,0 3,0 6,20 11,0", "class": "s1"}], + ["path", {"d": "M0,20 3,20 9,0 20,0", "class": "s1"}] + ], + ["g", {"id": "vmv-8-2"}, + ["path", {"d": "M9,0 20,0 20,20 9,20 6,10 z", "class": "s7"}], + ["path", {"d": "M3,0 0,0 0,20 3,20 6,10 z", "class": "s13"}], + ["path", {"d": "m0,0 3,0 6,20 11,0", "class": "s1"}], + ["path", {"d": "M0,20 3,20 9,0 20,0", "class": "s1"}] + ], + ["g", {"id": "vmv-9-2"}, + ["path", {"d": "M9,0 20,0 20,20 9,20 6,10 z", "class": "s7"}], + ["path", {"d": "M3,0 0,0 0,20 3,20 6,10 z", "class": "s14"}], + ["path", {"d": "m0,0 3,0 6,20 11,0", "class": "s1"}], + ["path", {"d": "M0,20 3,20 9,0 20,0", "class": "s1"}] + ], + ["g", {"id": "vmv-2-3"}, + ["path", {"d": "M9,0 20,0 20,20 9,20 6,10 z", "class": "s8"}], + ["path", {"d": "M3,0 0,0 0,20 3,20 6,10 z", "class": "s7"}], + ["path", {"d": "m0,0 3,0 6,20 11,0", "class": "s1"}], + ["path", {"d": "M0,20 3,20 9,0 20,0", "class": "s1"}] + ], + ["g", {"id": "vmv-3-3"}, + ["path", {"d": "M9,0 20,0 20,20 9,20 6,10 z", "class": "s8"}], + ["path", {"d": "M3,0 0,0 0,20 3,20 6,10 z", "class": "s8"}], + ["path", {"d": "m0,0 3,0 6,20 11,0", "class": "s1"}], + ["path", {"d": "M0,20 3,20 9,0 20,0", "class": "s1"}] + ], + ["g", {"id": "vmv-4-3"}, + ["path", {"d": "M9,0 20,0 20,20 9,20 6,10 z", "class": "s8"}], + ["path", {"d": "M3,0 0,0 0,20 3,20 6,10 z", "class": "s9"}], + ["path", {"d": "m0,0 3,0 6,20 11,0", "class": "s1"}], + ["path", {"d": "M0,20 3,20 9,0 20,0", "class": "s1"}] + ], + ["g", {"id": "vmv-5-3"}, + ["path", {"d": "M9,0 20,0 20,20 9,20 6,10 z", "class": "s8"}], + ["path", {"d": "M3,0 0,0 0,20 3,20 6,10 z", "class": "s10"}], + ["path", {"d": "m0,0 3,0 6,20 11,0", "class": "s1"}], + ["path", {"d": "M0,20 3,20 9,0 20,0", "class": "s1"}] + ], + ["g", {"id": "vmv-6-3"}, + ["path", {"d": "M9,0 20,0 20,20 9,20 6,10 z", "class": "s8"}], + ["path", {"d": "M3,0 0,0 0,20 3,20 6,10 z", "class": "s11"}], + ["path", {"d": "m0,0 3,0 6,20 11,0", "class": "s1"}], + ["path", {"d": "M0,20 3,20 9,0 20,0", "class": "s1"}] + ], + ["g", {"id": "vmv-7-3"}, + ["path", {"d": "M9,0 20,0 20,20 9,20 6,10 z", "class": "s8"}], + ["path", {"d": "M3,0 0,0 0,20 3,20 6,10 z", "class": "s12"}], + ["path", {"d": "m0,0 3,0 6,20 11,0", "class": "s1"}], + ["path", {"d": "M0,20 3,20 9,0 20,0", "class": "s1"}] + ], + ["g", {"id": "vmv-8-3"}, + ["path", {"d": "M9,0 20,0 20,20 9,20 6,10 z", "class": "s8"}], + ["path", {"d": "M3,0 0,0 0,20 3,20 6,10 z", "class": "s13"}], + ["path", {"d": "m0,0 3,0 6,20 11,0", "class": "s1"}], + ["path", {"d": "M0,20 3,20 9,0 20,0", "class": "s1"}] + ], + ["g", {"id": "vmv-9-3"}, + ["path", {"d": "M9,0 20,0 20,20 9,20 6,10 z", "class": "s8"}], + ["path", {"d": "M3,0 0,0 0,20 3,20 6,10 z", "class": "s14"}], + ["path", {"d": "m0,0 3,0 6,20 11,0", "class": "s1"}], + ["path", {"d": "M0,20 3,20 9,0 20,0", "class": "s1"}] + ], + ["g", {"id": "vmv-2-4"}, + ["path", {"d": "M9,0 20,0 20,20 9,20 6,10 z", "class": "s9"}], + ["path", {"d": "M3,0 0,0 0,20 3,20 6,10 z", "class": "s7"}], + ["path", {"d": "m0,0 3,0 6,20 11,0", "class": "s1"}], + ["path", {"d": "M0,20 3,20 9,0 20,0", "class": "s1"}] + ], + ["g", {"id": "vmv-3-4"}, + ["path", {"d": "M9,0 20,0 20,20 9,20 6,10 z", "class": "s9"}], + ["path", {"d": "M3,0 0,0 0,20 3,20 6,10 z", "class": "s8"}], + ["path", {"d": "m0,0 3,0 6,20 11,0", "class": "s1"}], + ["path", {"d": "M0,20 3,20 9,0 20,0", "class": "s1"}] + ], + ["g", {"id": "vmv-4-4"}, + ["path", {"d": "M9,0 20,0 20,20 9,20 6,10 z", "class": "s9"}], + ["path", {"d": "M3,0 0,0 0,20 3,20 6,10 z", "class": "s9"}], + ["path", {"d": "m0,0 3,0 6,20 11,0", "class": "s1"}], + ["path", {"d": "M0,20 3,20 9,0 20,0", "class": "s1"}] + ], + ["g", {"id": "vmv-5-4"}, + ["path", {"d": "M9,0 20,0 20,20 9,20 6,10 z", "class": "s9"}], + ["path", {"d": "M3,0 0,0 0,20 3,20 6,10 z", "class": "s10"}], + ["path", {"d": "m0,0 3,0 6,20 11,0", "class": "s1"}], + ["path", {"d": "M0,20 3,20 9,0 20,0", "class": "s1"}] + ], + ["g", {"id": "vmv-6-4"}, + ["path", {"d": "M9,0 20,0 20,20 9,20 6,10 z", "class": "s9"}], + ["path", {"d": "M3,0 0,0 0,20 3,20 6,10 z", "class": "s11"}], + ["path", {"d": "m0,0 3,0 6,20 11,0", "class": "s1"}], + ["path", {"d": "M0,20 3,20 9,0 20,0", "class": "s1"}] + ], + ["g", {"id": "vmv-7-4"}, + ["path", {"d": "M9,0 20,0 20,20 9,20 6,10 z", "class": "s9"}], + ["path", {"d": "M3,0 0,0 0,20 3,20 6,10 z", "class": "s12"}], + ["path", {"d": "m0,0 3,0 6,20 11,0", "class": "s1"}], + ["path", {"d": "M0,20 3,20 9,0 20,0", "class": "s1"}] + ], + ["g", {"id": "vmv-8-4"}, + ["path", {"d": "M9,0 20,0 20,20 9,20 6,10 z", "class": "s9"}], + ["path", {"d": "M3,0 0,0 0,20 3,20 6,10 z", "class": "s13"}], + ["path", {"d": "m0,0 3,0 6,20 11,0", "class": "s1"}], + ["path", {"d": "M0,20 3,20 9,0 20,0", "class": "s1"}] + ], + ["g", {"id": "vmv-9-4"}, + ["path", {"d": "M9,0 20,0 20,20 9,20 6,10 z", "class": "s9"}], + ["path", {"d": "M3,0 0,0 0,20 3,20 6,10 z", "class": "s14"}], + ["path", {"d": "m0,0 3,0 6,20 11,0", "class": "s1"}], + ["path", {"d": "M0,20 3,20 9,0 20,0", "class": "s1"}] + ], + ["g", {"id": "vmv-2-5"}, + ["path", {"d": "M9,0 20,0 20,20 9,20 6,10 z", "class": "s10"}], + ["path", {"d": "M3,0 0,0 0,20 3,20 6,10 z", "class": "s7"}], + ["path", {"d": "m0,0 3,0 6,20 11,0", "class": "s1"}], + ["path", {"d": "M0,20 3,20 9,0 20,0", "class": "s1"}] + ], + ["g", {"id": "vmv-3-5"}, + ["path", {"d": "M9,0 20,0 20,20 9,20 6,10 z", "class": "s10"}], + ["path", {"d": "M3,0 0,0 0,20 3,20 6,10 z", "class": "s8"}], + ["path", {"d": "m0,0 3,0 6,20 11,0", "class": "s1"}], + ["path", {"d": "M0,20 3,20 9,0 20,0", "class": "s1"}] + ], + ["g", {"id": "vmv-4-5"}, + ["path", {"d": "M9,0 20,0 20,20 9,20 6,10 z", "class": "s10"}], + ["path", {"d": "M3,0 0,0 0,20 3,20 6,10 z", "class": "s9"}], + ["path", {"d": "m0,0 3,0 6,20 11,0", "class": "s1"}], + ["path", {"d": "M0,20 3,20 9,0 20,0", "class": "s1"}] + ], + ["g", {"id": "vmv-5-5"}, + ["path", {"d": "M9,0 20,0 20,20 9,20 6,10 z", "class": "s10"}], + ["path", {"d": "M3,0 0,0 0,20 3,20 6,10 z", "class": "s10"}], + ["path", {"d": "m0,0 3,0 6,20 11,0", "class": "s1"}], + ["path", {"d": "M0,20 3,20 9,0 20,0", "class": "s1"}] + ], + ["g", {"id": "vmv-6-5"}, + ["path", {"d": "M9,0 20,0 20,20 9,20 6,10 z", "class": "s10"}], + ["path", {"d": "M3,0 0,0 0,20 3,20 6,10 z", "class": "s11"}], + ["path", {"d": "m0,0 3,0 6,20 11,0", "class": "s1"}], + ["path", {"d": "M0,20 3,20 9,0 20,0", "class": "s1"}] + ], + ["g", {"id": "vmv-7-5"}, + ["path", {"d": "M9,0 20,0 20,20 9,20 6,10 z", "class": "s10"}], + ["path", {"d": "M3,0 0,0 0,20 3,20 6,10 z", "class": "s12"}], + ["path", {"d": "m0,0 3,0 6,20 11,0", "class": "s1"}], + ["path", {"d": "M0,20 3,20 9,0 20,0", "class": "s1"}] + ], + ["g", {"id": "vmv-8-5"}, + ["path", {"d": "M9,0 20,0 20,20 9,20 6,10 z", "class": "s10"}], + ["path", {"d": "M3,0 0,0 0,20 3,20 6,10 z", "class": "s13"}], + ["path", {"d": "m0,0 3,0 6,20 11,0", "class": "s1"}], + ["path", {"d": "M0,20 3,20 9,0 20,0", "class": "s1"}] + ], + ["g", {"id": "vmv-9-5"}, + ["path", {"d": "M9,0 20,0 20,20 9,20 6,10 z", "class": "s10"}], + ["path", {"d": "M3,0 0,0 0,20 3,20 6,10 z", "class": "s14"}], + ["path", {"d": "m0,0 3,0 6,20 11,0", "class": "s1"}], + ["path", {"d": "M0,20 3,20 9,0 20,0", "class": "s1"}] + ], + ["g", {"id": "vmv-2-6"}, + ["path", {"d": "M9,0 20,0 20,20 9,20 6,10 z", "class": "s11"}], + ["path", {"d": "M3,0 0,0 0,20 3,20 6,10 z", "class": "s7"}], + ["path", {"d": "m0,0 3,0 6,20 11,0", "class": "s1"}], + ["path", {"d": "M0,20 3,20 9,0 20,0", "class": "s1"}] + ], + ["g", {"id": "vmv-3-6"}, + ["path", {"d": "M9,0 20,0 20,20 9,20 6,10 z", "class": "s11"}], + ["path", {"d": "M3,0 0,0 0,20 3,20 6,10 z", "class": "s8"}], + ["path", {"d": "m0,0 3,0 6,20 11,0", "class": "s1"}], + ["path", {"d": "M0,20 3,20 9,0 20,0", "class": "s1"}] + ], + ["g", {"id": "vmv-4-6"}, + ["path", {"d": "M9,0 20,0 20,20 9,20 6,10 z", "class": "s11"}], + ["path", {"d": "M3,0 0,0 0,20 3,20 6,10 z", "class": "s9"}], + ["path", {"d": "m0,0 3,0 6,20 11,0", "class": "s1"}], + ["path", {"d": "M0,20 3,20 9,0 20,0", "class": "s1"}] + ], + ["g", {"id": "vmv-5-6"}, + ["path", {"d": "M9,0 20,0 20,20 9,20 6,10 z", "class": "s11"}], + ["path", {"d": "M3,0 0,0 0,20 3,20 6,10 z", "class": "s10"}], + ["path", {"d": "m0,0 3,0 6,20 11,0", "class": "s1"}], + ["path", {"d": "M0,20 3,20 9,0 20,0", "class": "s1"}] + ], + ["g", {"id": "vmv-6-6"}, + ["path", {"d": "M9,0 20,0 20,20 9,20 6,10 z", "class": "s11"}], + ["path", {"d": "M3,0 0,0 0,20 3,20 6,10 z", "class": "s11"}], + ["path", {"d": "m0,0 3,0 6,20 11,0", "class": "s1"}], + ["path", {"d": "M0,20 3,20 9,0 20,0", "class": "s1"}] + ], + ["g", {"id": "vmv-7-6"}, + ["path", {"d": "M9,0 20,0 20,20 9,20 6,10 z", "class": "s11"}], + ["path", {"d": "M3,0 0,0 0,20 3,20 6,10 z", "class": "s12"}], + ["path", {"d": "m0,0 3,0 6,20 11,0", "class": "s1"}], + ["path", {"d": "M0,20 3,20 9,0 20,0", "class": "s1"}] + ], + ["g", {"id": "vmv-8-6"}, + ["path", {"d": "M9,0 20,0 20,20 9,20 6,10 z", "class": "s11"}], + ["path", {"d": "M3,0 0,0 0,20 3,20 6,10 z", "class": "s13"}], + ["path", {"d": "m0,0 3,0 6,20 11,0", "class": "s1"}], + ["path", {"d": "M0,20 3,20 9,0 20,0", "class": "s1"}] + ], + ["g", {"id": "vmv-9-6"}, + ["path", {"d": "M9,0 20,0 20,20 9,20 6,10 z", "class": "s11"}], + ["path", {"d": "M3,0 0,0 0,20 3,20 6,10 z", "class": "s14"}], + ["path", {"d": "m0,0 3,0 6,20 11,0", "class": "s1"}], + ["path", {"d": "M0,20 3,20 9,0 20,0", "class": "s1"}] + ], + ["g", {"id": "vmv-2-7"}, + ["path", {"d": "M9,0 20,0 20,20 9,20 6,10 z", "class": "s12"}], + ["path", {"d": "M3,0 0,0 0,20 3,20 6,10 z", "class": "s7"}], + ["path", {"d": "m0,0 3,0 6,20 11,0", "class": "s1"}], + ["path", {"d": "M0,20 3,20 9,0 20,0", "class": "s1"}] + ], + ["g", {"id": "vmv-3-7"}, + ["path", {"d": "M9,0 20,0 20,20 9,20 6,10 z", "class": "s12"}], + ["path", {"d": "M3,0 0,0 0,20 3,20 6,10 z", "class": "s8"}], + ["path", {"d": "m0,0 3,0 6,20 11,0", "class": "s1"}], + ["path", {"d": "M0,20 3,20 9,0 20,0", "class": "s1"}] + ], + ["g", {"id": "vmv-4-7"}, + ["path", {"d": "M9,0 20,0 20,20 9,20 6,10 z", "class": "s12"}], + ["path", {"d": "M3,0 0,0 0,20 3,20 6,10 z", "class": "s9"}], + ["path", {"d": "m0,0 3,0 6,20 11,0", "class": "s1"}], + ["path", {"d": "M0,20 3,20 9,0 20,0", "class": "s1"}] + ], + ["g", {"id": "vmv-5-7"}, + ["path", {"d": "M9,0 20,0 20,20 9,20 6,10 z", "class": "s12"}], + ["path", {"d": "M3,0 0,0 0,20 3,20 6,10 z", "class": "s10"}], + ["path", {"d": "m0,0 3,0 6,20 11,0", "class": "s1"}], + ["path", {"d": "M0,20 3,20 9,0 20,0", "class": "s1"}] + ], + ["g", {"id": "vmv-6-7"}, + ["path", {"d": "M9,0 20,0 20,20 9,20 6,10 z", "class": "s12"}], + ["path", {"d": "M3,0 0,0 0,20 3,20 6,10 z", "class": "s11"}], + ["path", {"d": "m0,0 3,0 6,20 11,0", "class": "s1"}], + ["path", {"d": "M0,20 3,20 9,0 20,0", "class": "s1"}] + ], + ["g", {"id": "vmv-7-7"}, + ["path", {"d": "M9,0 20,0 20,20 9,20 6,10 z", "class": "s12"}], + ["path", {"d": "M3,0 0,0 0,20 3,20 6,10 z", "class": "s12"}], + ["path", {"d": "m0,0 3,0 6,20 11,0", "class": "s1"}], + ["path", {"d": "M0,20 3,20 9,0 20,0", "class": "s1"}] + ], + ["g", {"id": "vmv-8-7"}, + ["path", {"d": "M9,0 20,0 20,20 9,20 6,10 z", "class": "s12"}], + ["path", {"d": "M3,0 0,0 0,20 3,20 6,10 z", "class": "s13"}], + ["path", {"d": "m0,0 3,0 6,20 11,0", "class": "s1"}], + ["path", {"d": "M0,20 3,20 9,0 20,0", "class": "s1"}] + ], + ["g", {"id": "vmv-9-7"}, + ["path", {"d": "M9,0 20,0 20,20 9,20 6,10 z", "class": "s12"}], + ["path", {"d": "M3,0 0,0 0,20 3,20 6,10 z", "class": "s14"}], + ["path", {"d": "m0,0 3,0 6,20 11,0", "class": "s1"}], + ["path", {"d": "M0,20 3,20 9,0 20,0", "class": "s1"}] + ], + ["g", {"id": "vmv-2-8"}, + ["path", {"d": "M9,0 20,0 20,20 9,20 6,10 z", "class": "s13"}], + ["path", {"d": "M3,0 0,0 0,20 3,20 6,10 z", "class": "s7"}], + ["path", {"d": "m0,0 3,0 6,20 11,0", "class": "s1"}], + ["path", {"d": "M0,20 3,20 9,0 20,0", "class": "s1"}] + ], + ["g", {"id": "vmv-3-8"}, + ["path", {"d": "M9,0 20,0 20,20 9,20 6,10 z", "class": "s13"}], + ["path", {"d": "M3,0 0,0 0,20 3,20 6,10 z", "class": "s8"}], + ["path", {"d": "m0,0 3,0 6,20 11,0", "class": "s1"}], + ["path", {"d": "M0,20 3,20 9,0 20,0", "class": "s1"}] + ], + ["g", {"id": "vmv-4-8"}, + ["path", {"d": "M9,0 20,0 20,20 9,20 6,10 z", "class": "s13"}], + ["path", {"d": "M3,0 0,0 0,20 3,20 6,10 z", "class": "s9"}], + ["path", {"d": "m0,0 3,0 6,20 11,0", "class": "s1"}], + ["path", {"d": "M0,20 3,20 9,0 20,0", "class": "s1"}] + ], + ["g", {"id": "vmv-5-8"}, + ["path", {"d": "M9,0 20,0 20,20 9,20 6,10 z", "class": "s13"}], + ["path", {"d": "M3,0 0,0 0,20 3,20 6,10 z", "class": "s10"}], + ["path", {"d": "m0,0 3,0 6,20 11,0", "class": "s1"}], + ["path", {"d": "M0,20 3,20 9,0 20,0", "class": "s1"}] + ], + ["g", {"id": "vmv-6-8"}, + ["path", {"d": "M9,0 20,0 20,20 9,20 6,10 z", "class": "s13"}], + ["path", {"d": "M3,0 0,0 0,20 3,20 6,10 z", "class": "s11"}], + ["path", {"d": "m0,0 3,0 6,20 11,0", "class": "s1"}], + ["path", {"d": "M0,20 3,20 9,0 20,0", "class": "s1"}] + ], + ["g", {"id": "vmv-7-8"}, + ["path", {"d": "M9,0 20,0 20,20 9,20 6,10 z", "class": "s13"}], + ["path", {"d": "M3,0 0,0 0,20 3,20 6,10 z", "class": "s12"}], + ["path", {"d": "m0,0 3,0 6,20 11,0", "class": "s1"}], + ["path", {"d": "M0,20 3,20 9,0 20,0", "class": "s1"}] + ], + ["g", {"id": "vmv-8-8"}, + ["path", {"d": "M9,0 20,0 20,20 9,20 6,10 z", "class": "s13"}], + ["path", {"d": "M3,0 0,0 0,20 3,20 6,10 z", "class": "s13"}], + ["path", {"d": "m0,0 3,0 6,20 11,0", "class": "s1"}], + ["path", {"d": "M0,20 3,20 9,0 20,0", "class": "s1"}] + ], + ["g", {"id": "vmv-9-8"}, + ["path", {"d": "M9,0 20,0 20,20 9,20 6,10 z", "class": "s13"}], + ["path", {"d": "M3,0 0,0 0,20 3,20 6,10 z", "class": "s14"}], + ["path", {"d": "m0,0 3,0 6,20 11,0", "class": "s1"}], + ["path", {"d": "M0,20 3,20 9,0 20,0", "class": "s1"}] + ], + ["g", {"id": "vmv-2-9"}, + ["path", {"d": "M9,0 20,0 20,20 9,20 6,10 z", "class": "s14"}], + ["path", {"d": "M3,0 0,0 0,20 3,20 6,10 z", "class": "s7"}], + ["path", {"d": "m0,0 3,0 6,20 11,0", "class": "s1"}], + ["path", {"d": "M0,20 3,20 9,0 20,0", "class": "s1"}] + ], + ["g", {"id": "vmv-3-9"}, + ["path", {"d": "M9,0 20,0 20,20 9,20 6,10 z", "class": "s14"}], + ["path", {"d": "M3,0 0,0 0,20 3,20 6,10 z", "class": "s8"}], + ["path", {"d": "m0,0 3,0 6,20 11,0", "class": "s1"}], + ["path", {"d": "M0,20 3,20 9,0 20,0", "class": "s1"}] + ], + ["g", {"id": "vmv-4-9"}, + ["path", {"d": "M9,0 20,0 20,20 9,20 6,10 z", "class": "s14"}], + ["path", {"d": "M3,0 0,0 0,20 3,20 6,10 z", "class": "s9"}], + ["path", {"d": "m0,0 3,0 6,20 11,0", "class": "s1"}], + ["path", {"d": "M0,20 3,20 9,0 20,0", "class": "s1"}] + ], + ["g", {"id": "vmv-5-9"}, + ["path", {"d": "M9,0 20,0 20,20 9,20 6,10 z", "class": "s14"}], + ["path", {"d": "M3,0 0,0 0,20 3,20 6,10 z", "class": "s10"}], + ["path", {"d": "m0,0 3,0 6,20 11,0", "class": "s1"}], + ["path", {"d": "M0,20 3,20 9,0 20,0", "class": "s1"}] + ], + ["g", {"id": "vmv-6-9"}, + ["path", {"d": "M9,0 20,0 20,20 9,20 6,10 z", "class": "s14"}], + ["path", {"d": "M3,0 0,0 0,20 3,20 6,10 z", "class": "s11"}], + ["path", {"d": "m0,0 3,0 6,20 11,0", "class": "s1"}], + ["path", {"d": "M0,20 3,20 9,0 20,0", "class": "s1"}] + ], + ["g", {"id": "vmv-7-9"}, + ["path", {"d": "M9,0 20,0 20,20 9,20 6,10 z", "class": "s14"}], + ["path", {"d": "M3,0 0,0 0,20 3,20 6,10 z", "class": "s12"}], + ["path", {"d": "m0,0 3,0 6,20 11,0", "class": "s1"}], + ["path", {"d": "M0,20 3,20 9,0 20,0", "class": "s1"}] + ], + ["g", {"id": "vmv-8-9"}, + ["path", {"d": "M9,0 20,0 20,20 9,20 6,10 z", "class": "s14"}], + ["path", {"d": "M3,0 0,0 0,20 3,20 6,10 z", "class": "s13"}], + ["path", {"d": "m0,0 3,0 6,20 11,0", "class": "s1"}], + ["path", {"d": "M0,20 3,20 9,0 20,0", "class": "s1"}] + ], + ["g", {"id": "vmv-9-9"}, + ["path", {"d": "M9,0 20,0 20,20 9,20 6,10 z", "class": "s14"}], + ["path", {"d": "M3,0 0,0 0,20 3,20 6,10 z", "class": "s14"}], + ["path", {"d": "m0,0 3,0 6,20 11,0", "class": "s1"}], + ["path", {"d": "M0,20 3,20 9,0 20,0", "class": "s1"}] + ], + ["g", {"id": "arrow0"}, + ["path", {"d": "m-12,-3 9,3 -9,3 c 1,-2 1,-4 0,-6 z", "class": "s15"}], + ["path", {"d": "M0,0 -15,0", "class": "s16"}] + ], + ["marker", + {"id": "arrowhead", "style": "fill:#0041c4", "markerHeight": "7", "markerWidth": "10", + "markerUnits": "strokeWidth", + "viewBox": "0 -4 11 8", "refX": "15", "refY": "0", "orient": "auto"}, + ["path", {"d": "M0 -4 11 0 0 4z"}] + ], + ["marker", + {"id": "arrowtail", "style": "fill:#0041c4", "markerHeight": "7", "markerWidth": "10", + "markerUnits": "strokeWidth", "viewBox": "-11 -4 11 8", "refX": "-15", "refY": "0", + "orient": "auto"}, + ["path", {"d": "M0 -4 -11 0 0 4z"}] + ] + ], + ["g", {"id": "waves"}, + ["g", {"id": "lanes"}], + ["g", {"id": "groups"}] + ] + ] + +WaveSkin['narrow'] = ["svg", {"id": "svg", "xmlns": "http://www.w3.org/2000/svg", + "xmlns:xlink": "http://www.w3.org/1999/xlink", "height": "0"}, + ["style", {"type": "text/css"}, css.css.narrow], + ["defs", + ["g", {"id": "socket"}, + ["rect", {"y": "15", "x": "4", "height": "20", "width": "10"}] + ], + ["g", {"id": "pclk"}, + ["path", {"d": "M 0,20 0,0 10,0", "class": "s1"}] + ], + ["g", {"id": "nclk"}, + ["path", {"d": "m 0,0 0,20 10,0", "class": "s1"}] + ], + ["g", {"id": "000"}, + ["path", {"d": "m 0,20 10,0", "class": "s1"}] + ], + ["g", {"id": "0m0"}, + ["path", {"d": "m 0,20 1,0 3,-10 3,10 3,0", "class": "s1"}] + ], + ["g", {"id": "0m1"}, + ["path", {"d": "M 0,20 1,20 7,0 10,0", "class": "s1"}] + ], + ["g", {"id": "0mx"}, + ["path", {"d": "M 1,20 7,0 10,0", "class": "s1"}], + ["path", {"d": "M 10,15 5,20", "class": "s2"}], + ["path", {"d": "M 10,10 2,18", "class": "s2"}], + ["path", {"d": "M 10,5 4,11", "class": "s2"}], + ["path", {"d": "M 10,0 6,4", "class": "s2"}], + ["path", {"d": "m 0,20 10,0", "class": "s1"}] + ], + ["g", {"id": "0md"}, + ["path", {"d": "m 1,20 9,0", "class": "s3"}], + ["path", {"d": "m 0,20 1,0", "class": "s1"}] + ], + ["g", {"id": "0mu"}, + ["path", {"d": "m 0,20 1,0 C 2,13 5,0 10,0", "class": "s1"}] + ], + ["g", {"id": "0mz"}, + ["path", {"d": "m 0,20 1,0 C 3,14 7,10 10,10", "class": "s1"}] + ], + ["g", {"id": "111"}, + ["path", {"d": "M 0,0 10,0", "class": "s1"}] + ], + ["g", {"id": "1m0"}, + ["path", {"d": "m 0,0 1,0 6,20 3,0", "class": "s1"}] + ], + ["g", {"id": "1m1"}, + ["path", {"d": "M 0,0 1,0 4,10 7,0 10,0", "class": "s1"}] + ], + ["g", {"id": "1mx"}, + ["path", {"d": "m 1,0 6,20 3,0", "class": "s1"}], + ["path", {"d": "M 0,0 10,0", "class": "s1"}], + ["path", {"d": "M 10,15 6.5,18.5", "class": "s2"}], + ["path", {"d": "M 10,10 5.5,14.5", "class": "s2"}], + ["path", {"d": "M 10,5 4.5,10.5", "class": "s2"}], + ["path", {"d": "M 10,0 3,7", "class": "s2"}], + ["path", {"d": "M 2,3 5,0", "class": "s2"}] + ], + ["g", {"id": "1md"}, + ["path", {"d": "m 0,0 1,0 c 1,7 4,20 9,20", "class": "s1"}] + ], + ["g", {"id": "1mu"}, + ["path", {"d": "M 0,0 1,0", "class": "s1"}], + ["path", {"d": "m 1,0 9,0", "class": "s3"}] + ], + ["g", {"id": "1mz"}, ["path", {"d": "m 0,0 1,0 c 2,4 6,10 9,10", "class": "s1"}]], + ["g", {"id": "xxx"}, ["path", {"d": "m 0,20 10,0", "class": "s1"}], + ["path", {"d": "M 0,0 10,0", "class": "s1"}], ["path", {"d": "M 0,5 5,0", "class": "s2"}], + ["path", { + "d": "M 0,10 10,0", "class": "s2"}], ["path", {"d": "M 0,15 10,5", "class": "s2"}], + ["path", {"d": "M 0,20 10,10", "class": "s2"}], ["path", {"d": "m 5,20 5,-5", "class": "s2"}]], + ["g", {"id": "xm0"}, ["path", {"d": "M 0,0 1,0 7,20", "class": "s1"}], + ["path", {"d": "m 0,20 10,0", "class": "s1"}], ["path", {"d": "M 0,5 2,3", "class": "s2"}], + ["path", { + "d": "M 0,10 3,7", "class": "s2"}], ["path", {"d": "M 0,15 4,11", "class": "s2"}], + ["path", {"d": "M 0,20 5,15", "class": "s2"}], ["path", {"d": "M 5,20 6,19", "class": "s2"}]], + ["g", {"id": "xm1"}, ["path", {"d": "M 0,0 10,0", "class": "s1"}], + ["path", {"d": "M 0,20 1,20 7,0", "class": "s1"}], ["path", {"d": "M 0,5 5,0", "class": "s2"}], + [ + "path", {"d": "M 0,10 6,4", "class": "s2"}], ["path", {"d": "M 0,15 3,12", "class": "s2"}], + ["path", {"d": "M 0,20 1,19", "class": "s2"}]], + ["g", {"id": "xmx"}, ["path", {"d": "m 0,20 10,0", "class": "s1"}], + ["path", {"d": "M 0,0 10,0", "class": "s1"}], ["path", {"d": "M 0,5 5,0", "class": "s2"}], + ["path", { + "d": "M 0,10 10,0", "class": "s2"}], ["path", {"d": "M 0,15 10,5", "class": "s2"}], + ["path", {"d": "M 0,20 10,10", "class": "s2"}], ["path", {"d": "m 5,20 5,-5", "class": "s2"}]], + ["g", {"id": "xmd"}, ["path", {"d": "m 0,0 1,0 c 1,7 4,20 9,20", "class": "s1"}], + ["path", {"d": "m 0,20 10,0", "class": "s1"}], ["path", {"d": "M 0,5 1.5,3.5", "class": "s2"}], + ["path", { + "d": "M 0,10 2.5,7.5", "class": "s2"}], ["path", {"d": "M 0,15 3.5,11.5", "class": "s2"}], + ["path", {"d": "M 0,20 5,15", "class": "s2"}], ["path", {"d": "M 5,20 7,18", "class": "s2"}]], + ["g", {"id": "xmu"}, ["path", {"d": "M 0,0 10,0", "class": "s1"}], + ["path", {"d": "m 0,20 1,0 C 2,13 5,0 10,0", "class": "s1"}], ["path", {"d": "M 0,5 5,0", + "class": "s2"}], + ["path", {"d": "M 0,10 5,5", "class": "s2"}], ["path", {"d": "M 0,15 2,13", "class": "s2"}], + ["path", {"d": "M 0,20 1,19", "class": "s2"}]], + ["g", {"id": "xmz"}, ["path", {"d": "m 0,0 1,0 c 2,6 6,10 9,10", "class": "s1"}], + ["path", {"d": "m 0,20 1,0 C 3,14 7,10 10,10", "class": "s1"}], ["path", { + "d": "M 0,5 2,3", "class": "s2"}], ["path", {"d": "M 0,10 4,6", "class": "s2"}], + ["path", {"d": "m 0,15.5 6,-7", "class": "s2"}], ["path", {"d": "M 0,20 1,19", "class": "s2"}]], + ["g", {"id": "ddd"}, ["path", {"d": "m 0,20 10,0", "class": "s3"}]], + ["g", {"id": "dm0"}, ["path", {"d": "m 0,20 7,0", "class": "s3"}], + ["path", {"d": "m 7,20 3,0", "class": "s1"}]], + ["g", {"id": "dm1"}, ["path", {"d": "M 0,20 1,20 7,0 10,0", "class": "s1"}]], + ["g", {"id": "dmx"}, ["path", {"d": "M 1,20 7,0 10,0", "class": "s1"}], + ["path", {"d": "M 10,15 5,20", "class": "s2"}], ["path", {"d": "M 10,10 1.5,18.5", + "class": "s2"}], + ["path", {"d": "M 10,5 4,11", "class": "s2"}], ["path", {"d": "M 10,0 6,4", "class": "s2"}], + ["path", {"d": "m 0,20 10,0", "class": "s1"}]], + ["g", {"id": "dmd"}, ["path", {"d": "m 0,20 10,0", "class": "s3"}]], + ["g", {"id": "dmu"}, ["path", {"d": "m 0,20 1,0 C 2,13 5,0 10,0", "class": "s1"}]], + ["g", {"id": "dmz"}, ["path", {"d": "m 0,20 1,0 C 3,14 7,10 10,10", "class": "s1"}]], + ["g", {"id": "uuu"}, ["path", {"d": "M 0,0 10,0", "class": "s3"}]], + ["g", {"id": "um0"}, ["path", {"d": "m 0,0 1,0 6,20 3,0", "class": "s1"}]], + ["g", {"id": "um1"}, ["path", {"d": "M 0,0 7,0", "class": "s3"}], + ["path", {"d": "m 7,0 3,0", "class": "s1"}]], + ["g", {"id": "umx"}, ["path", {"d": "M 1.4771574,0 7,20 l 3,0", "class": "s1"}], + ["path", {"d": "M 0,0 10,0", "class": "s1"}], + ["path", {"d": "M 10,15 6.5,18.5", "class": "s2"}], ["path", { + "d": "M 10,10 5.5,14.5", "class": "s2"}], ["path", {"d": "M 10,5 4.5,10.5", "class": "s2"}], + ["path", {"d": "M 10,0 3.5,6.5", "class": "s2"}], + ["path", {"d": "M 2.463621,2.536379 5,0", "class": "s2"}]], + ["g", {"id": "umd"}, ["path", {"d": "m 0,0 1,0 c 1,7 4,20 9,20", "class": "s1"}]], + ["g", {"id": "umu"}, ["path", {"d": "M 0,0 10,0", "class": "s3"}]], + ["g", {"id": "umz"}, ["path", {"d": "m 0,0 1,0 c 2,6 6,10 9,10", "class": "s4"}]], + ["g", {"id": "zzz"}, ["path", {"d": "m 0,10 10,0", "class": "s1"}]], + ["g", {"id": "zm0"}, ["path", {"d": "m 0,10 1,0 4,10 5,0", "class": "s1"}]], + ["g", {"id": "zm1"}, ["path", {"d": "M 0,10 1,10 5,0 10,0", "class": "s1"}]], + ["g", {"id": "zmx"}, ["path", {"d": "m 1,10 4,10 5,0", "class": "s1"}], + ["path", {"d": "M 0,10 1,10 5,0 10,0", "class": "s1"}], + ["path", {"d": "M 10,15 5,20", "class": "s2"}], [ + "path", {"d": "M 10,10 4,16", "class": "s2"}], + ["path", {"d": "M 10,5 2.5,12.5", "class": "s2"}], + ["path", {"d": "M 10,0 2,8", "class": "s2"}]], + ["g", {"id": "zmd"}, ["path", {"d": "m 0,10 1,0 c 2,6 6,10 9,10", "class": "s1"}]], + ["g", {"id": "zmu"}, ["path", {"d": "m 0,10 1,0 C 3,4 7,0 10,0", "class": "s1"}]], + ["g", {"id": "zmz"}, ["path", {"d": "m 0,10 10,0", "class": "s1"}]], + ["g", {"id": "gap"}, + ["path", {"d": "m 7,-2 -4,0 c -5,0 -5,24 -10,24 l 4,0 C 2,22 2,-2 7,-2 z", "class": "s5"}], + ["path", {"d": "M -7,22 C -2,22 -2,-2 3,-2", "class": "s1"}], + ["path", {"d": "M -3,22 C 2,22 2,-2 7,-2", "class": "s1"}]], + ["g", {"id": "0mv-3"}, ["path", {"d": "m 7,0 3,0 0,20 -9,0 z", "class": "s8"}], + ["path", {"d": "M 1,20 7,0 10,0", "class": "s1"}], + ["path", {"d": "m 0,20 10,0", "class": "s1"}]], + ["g", {"id": "1mv-3"}, ["path", {"d": "m 1,0 9,0 0,20 -3,0 z", "class": "s8"}], + ["path", {"d": "m 1,0 6,20 3,0", "class": "s1"}], ["path", {"d": "M 0,0 10,0", "class": "s1"}]], + ["g", {"id": "xmv-3"}, ["path", {"d": "M 7,0 10,0 10,20 7,20 4,10 z", "class": "s8"}], + ["path", {"d": "M 0,20 1,20 7,0 10,0", "class": "s1"}], + ["path", {"d": "m 0,0 1,0 6,20 3,0", "class": "s1"}], + ["path", {"d": "M 0,5 2,3", "class": "s2"}], ["path", {"d": "M 0,10 3,7", "class": "s2"}], + ["path", {"d": "M 0,15 3,12", "class": "s2"}], ["path", {"d": "M 0,20 1,19", "class": "s2"}]], + ["g", {"id": "dmv-3"}, ["path", {"d": "m 7,0 3,0 0,20 -9,0 z", "class": "s8"}], + ["path", {"d": "M 1,20 7,0 10,0", "class": "s1"}], + ["path", {"d": "m 0,20 10,0", "class": "s1"}]], + ["g", {"id": "umv-3"}, ["path", {"d": "m 1,0 9,0 0,20 -3,0 z", "class": "s8"}], + ["path", {"d": "m 1,0 6,20 3,0", "class": "s1"}], ["path", {"d": "M 0,0 10,0", "class": "s1"}]], + ["g", {"id": "zmv-3"}, ["path", {"d": "M 5,0 10,0 10,20 5,20 1,10 z", "class": "s8"}], + ["path", {"d": "m 1,10 4,10 5,0", "class": "s1"}], + ["path", {"d": "M 0,10 1,10 5,0 10,0", "class": "s1"}]], + ["g", {"id": "vvv-3"}, ["path", {"d": "M 10,20 0,20 0,0 10,0", "class": "s8"}], + ["path", {"d": "m 0,20 10,0", "class": "s1"}], ["path", {"d": "M 0,0 10,0", "class": "s1"}]], + ["g", {"id": "vm0-3"}, ["path", {"d": "m 0,20 0,-20 1.000687,-0.00391 6,20", "class": "s8"}], + ["path", { + "d": "m 0,0 1.000687,-0.00391 6,20", "class": "s1"}], + ["path", {"d": "m 0,20 10.000687,-0.0039", "class": "s1"}]], + ["g", {"id": "vm1-3"}, ["path", {"d": "M 0,0 0,20 1,20 7,0", "class": "s8"}], + ["path", {"d": "M 0,0 10,0", "class": "s1"}], + ["path", {"d": "M 0,20 1,20 7,0", "class": "s1"}]], + ["g", {"id": "vmx-3"}, ["path", {"d": "M 0,0 0,20 1,20 4,10 1,0", "class": "s8"}], + ["path", {"d": "m 0,0 1,0 6,20 3,0", "class": "s1"}], + ["path", {"d": "M 0,20 1,20 7,0 10,0", "class": "s1"}], + ["path", {"d": "M 10,15 6.5,18.5", "class": "s2"}], + ["path", {"d": "M 10,10 5.5,14.5", "class": "s2"}], + ["path", {"d": "M 10,5 4,11", "class": "s2"}], ["path", {"d": "M 10,0 6,4", "class": "s2"}]], + ["g", {"id": "vmd-3"}, ["path", {"d": "m 0,0 0,20 10,0 C 5,20 2,7 1,0", "class": "s8"}], + ["path", {"d": "m 0,0 1,0 c 1,7 4,20 9,20", "class": "s1"}], + ["path", {"d": "m 0,20 10,0", "class": "s1"}]], + ["g", {"id": "vmu-3"}, ["path", {"d": "m 0,0 0,20 1,0 C 2,13 5,0 10,0", "class": "s8"}], + ["path", {"d": "m 0,20 1,0 C 2,13 5,0 10,0", "class": "s1"}], + ["path", {"d": "M 0,0 10,0", "class": "s1"}]], + ["g", {"id": "vmz-3"}, + ["path", {"d": "M 0,0 1,0 C 3,6 7,10 10,10 7,10 3,14 1,20 L 0,20", "class": "s8"}], ["path", + { + "d": "m 0,0 1,0 c 2,6 6,10 9,10", + "class": "s1"}], + ["path", {"d": "m 0,20 1,0 C 3,14 7,10 10,10", "class": "s1"}]], + ["g", {"id": "vmv-3-3"}, ["path", {"d": "M 7,0 10,0 10,20 7,20 4,10 z", "class": "s8"}], + ["path", {"d": "M 1,0 0,0 0,20 1,20 4,10 z", + "class": "s8"}], ["path", {"d": "m 0,0 1,0 6,20 3,0", "class": "s1"}], + ["path", {"d": "M 0,20 1,20 7,0 10,0", "class": "s1"}]], + ["g", {"id": "vmv-3-4"}, ["path", {"d": "M 7,0 10,0 10,20 7,20 4,10 z", "class": "s9"}], + ["path", {"d": "M 1,0 0,0 0,20 1,20 4,10 z", + "class": "s8"}], ["path", {"d": "m 0,0 1,0 6,20 3,0", "class": "s1"}], + ["path", {"d": "M 0,20 1,20 7,0 10,0", "class": "s1"}]], + ["g", {"id": "vmv-3-5"}, ["path", {"d": "M 7,0 10,0 10,20 7,20 4,10 z", "class": "s10"}], + ["path", {"d": "M 1,0 0,0 0,20 1,20 4,10 z", + "class": "s8"}], ["path", {"d": "m 0,0 1,0 6,20 3,0", "class": "s1"}], + ["path", {"d": "M 0,20 1,20 7,0 10,0", "class": "s1"}]], + ["g", {"id": "vmv-4-3"}, ["path", {"d": "M 7,0 10,0 10,20 7,20 4,10 z", "class": "s8"}], + ["path", {"d": "M 1,0 0,0 0,20 1,20 4,10 z", + "class": "s9"}], ["path", {"d": "m 0,0 1,0 6,20 3,0", "class": "s1"}], + ["path", {"d": "M 0,20 1,20 7,0 10,0", "class": "s1"}]], + ["g", {"id": "vmv-4-4"}, ["path", {"d": "M 7,0 10,0 10,20 7,20 4,10 z", "class": "s9"}], + ["path", {"d": "M 1,0 0,0 0,20 1,20 4,10 z", + "class": "s9"}], ["path", {"d": "m 0,0 1,0 6,20 3,0", "class": "s1"}], + ["path", {"d": "M 0,20 1,20 7,0 10,0", "class": "s1"}]], + ["g", {"id": "vmv-4-5"}, ["path", {"d": "M 7,0 10,0 10,20 7,20 4,10 z", "class": "s10"}], + ["path", {"d": "M 1,0 0,0 0,20 1,20 4,10 z", + "class": "s9"}], ["path", {"d": "m 0,0 1,0 6,20 3,0", "class": "s1"}], + ["path", {"d": "M 0,20 1,20 7,0 10,0", "class": "s1"}]], + ["g", {"id": "vmv-5-3"}, ["path", {"d": "M 7,0 10,0 10,20 7,20 4,10 z", "class": "s8"}], + ["path", {"d": "M 1,0 0,0 0,20 1,20 4,10 z", + "class": "s10"}], ["path", {"d": "m 0,0 1,0 6,20 3,0", "class": "s1"}], + ["path", {"d": "M 0,20 1,20 7,0 10,0", "class": "s1"}]], + ["g", {"id": "vmv-5-4"}, ["path", {"d": "M 7,0 10,0 10,20 7,20 4,10 z", "class": "s9"}], + ["path", {"d": "M 1,0 0,0 0,20 1,20 4,10 z", + "class": "s10"}], ["path", {"d": "m 0,0 1,0 6,20 3,0", "class": "s1"}], + ["path", {"d": "M 0,20 1,20 7,0 10,0", "class": "s1"}]], + ["g", {"id": "vmv-5-5"}, ["path", {"d": "M 7,0 10,0 10,20 7,20 4,10 z", "class": "s10"}], + ["path", {"d": "M 1,0 0,0 0,20 1,20 4,10 z", + "class": "s10"}], ["path", {"d": "m 0,0 1,0 6,20 3,0", "class": "s1"}], + ["path", {"d": "M 0,20 1,20 7,0 10,0", "class": "s1"}]], + ["g", {"id": "0mv-4"}, ["path", {"d": "m 7,0 3,0 0,20 -9,0 z", "class": "s9"}], + ["path", {"d": "M 1,20 7,0 10,0", "class": "s1"}], + ["path", {"d": "m 0,20 10,0", "class": "s1"}]], + ["g", {"id": "1mv-4"}, ["path", {"d": "m 1,0 9,0 0,20 -3,0 z", "class": "s9"}], + ["path", {"d": "m 1,0 6,20 3,0", "class": "s1"}], ["path", {"d": "M 0,0 10,0", "class": "s1"}]], + ["g", {"id": "xmv-4"}, ["path", {"d": "M 7,0 10,0 10,20 7,20 4,10 z", "class": "s9"}], + ["path", {"d": "M 0,20 1,20 7,0 10,0", "class": "s1"}], + ["path", {"d": "m 0,0 1,0 6,20 3,0", "class": "s1"}], + ["path", {"d": "M 0,5 2,3", "class": "s2"}], ["path", {"d": "M 0,10 3,7", "class": "s2"}], + ["path", {"d": "M 0,15 4,11", "class": "s2"}], ["path", {"d": "M 0,20 1,19", "class": "s2"}]], + ["g", {"id": "dmv-4"}, ["path", {"d": "m 7,0 3,0 0,20 -9,0 z", "class": "s9"}], + ["path", {"d": "M 1,20 7,0 10,0", "class": "s1"}], + ["path", {"d": "m 0,20 10,0", "class": "s1"}]], + ["g", {"id": "umv-4"}, ["path", {"d": "m 1,0 9,0 0,20 -3,0 z", "class": "s9"}], + ["path", {"d": "m 1,0 6,20 3,0", "class": "s1"}], ["path", {"d": "M 0,0 10,0", "class": "s1"}]], + ["g", {"id": "zmv-4"}, ["path", {"d": "M 5,0 10,0 10,20 5,20 1,10 z", "class": "s9"}], + ["path", {"d": "m 1,10 4,10 5,0", "class": "s1"}], + ["path", {"d": "M 0,10 1,10 5,0 10,0", "class": "s1"}]], + ["g", {"id": "0mv-5"}, ["path", {"d": "m 7,0 3,0 0,20 -9,0 z", "class": "s10"}], + ["path", {"d": "M 1,20 7,0 10,0", "class": "s1"}], + ["path", {"d": "m 0,20 10,0", "class": "s1"}]], + ["g", {"id": "1mv-5"}, ["path", {"d": "m 1,0 9,0 0,20 -3,0 z", "class": "s10"}], + ["path", {"d": "m 1,0 6,20 3,0", "class": "s1"}], ["path", {"d": "M 0,0 10,0", "class": "s1"}]], + ["g", {"id": "xmv-5"}, ["path", {"d": "M 7,0 10,0 10,20 7,20 4,10 z", "class": "s10"}], + ["path", {"d": "M 0,20 1,20 7,0 10,0", "class": "s1"}], + ["path", {"d": "m 0,0 1,0 6,20 3,0", "class": "s1"}], + ["path", {"d": "M 0,5 2,3", "class": "s2"}], ["path", {"d": "M 0,10 3,7", "class": "s2"}], + ["path", {"d": "M 0,15 4,11", "class": "s2"}], ["path", {"d": "M 0,20 1,19", "class": "s2"}]], + ["g", {"id": "dmv-5"}, ["path", {"d": "m 7,0 3,0 0,20 -9,0 z", "class": "s10"}], + ["path", {"d": "M 1,20 7,0 10,0", "class": "s1"}], + ["path", {"d": "m 0,20 10,0", "class": "s1"}]], + ["g", {"id": "umv-5"}, ["path", {"d": "m 1,0 9,0 0,20 -3,0 z", "class": "s10"}], + ["path", {"d": "m 1,0 6,20 3,0", "class": "s1"}], ["path", {"d": "M 0,0 10,0", "class": "s1"}]], + ["g", {"id": "zmv-5"}, ["path", {"d": "M 5,0 10,0 10,20 5,20 1,10 z", "class": "s10"}], + ["path", {"d": "m 1,10 4,10 5,0", "class": "s1"}], + ["path", {"d": "M 0,10 1,10 5,0 10,0", "class": "s1"}]], + ["g", {"id": "vvv-4"}, ["path", {"d": "M 10,20 0,20 0,0 10,0", "class": "s9"}], + ["path", {"d": "m 0,20 10,0", "class": "s1"}], ["path", {"d": "M 0,0 10,0", "class": "s1"}]], + ["g", {"id": "vm0-4"}, ["path", {"d": "M 0,20 0,0 1,0 7,20", "class": "s9"}], + ["path", {"d": "M 0,0 1,0 7,20", "class": "s1"}], + ["path", {"d": "m 0,20 10,0", "class": "s1"}]], + ["g", {"id": "vm1-4"}, ["path", {"d": "M 0,0 0,20 1,20 7,0", "class": "s9"}], + ["path", {"d": "M 0,0 10,0", "class": "s1"}], + ["path", {"d": "M 0,20 1,20 7,0", "class": "s1"}]], + ["g", {"id": "vmx-4"}, ["path", {"d": "M 0,0 0,20 1,20 4,10 1,0", "class": "s9"}], + ["path", {"d": "m 0,0 1,0 6,20 3,0", "class": "s1"}], + ["path", {"d": "M 0,20 1,20 7,0 10,0", "class": "s1"}], + ["path", {"d": "M 10,15 6.5,18.5", "class": "s2"}], + ["path", {"d": "M 10,10 5.5,14.5", "class": "s2"}], + ["path", {"d": "M 10,5 4,11", "class": "s2"}], ["path", {"d": "M 10,0 6,4", "class": "s2"}]], + ["g", {"id": "vmd-4"}, ["path", {"d": "m 0,0 0,20 10,0 C 5,20 2,7 1,0", "class": "s9"}], + ["path", {"d": "m 0,0 1,0 c 1,7 4,20 9,20", "class": "s1"}], + ["path", {"d": "m 0,20 10,0", "class": "s1"}]], + ["g", {"id": "vmu-4"}, ["path", {"d": "m 0,0 0,20 1,0 C 2,13 5,0 10,0", "class": "s9"}], + ["path", {"d": "m 0,20 1,0 C 2,13 5,0 10,0", "class": "s1"}], + ["path", {"d": "M 0,0 10,0", "class": "s1"}]], + ["g", {"id": "vmz-4"}, + ["path", {"d": "M 0,0 1,0 C 3,6 7,10 10,10 7,10 3,14 1,20 L 0,20", "class": "s9"}], ["path", + { + "d": "m 0,0 1,0 c 2,6 6,10 9,10", + "class": "s1"}], + ["path", {"d": "m 0,20 1,0 C 3,14 7,10 10,10", "class": "s1"}]], + ["g", {"id": "vvv-5"}, ["path", {"d": "M 10,20 0,20 0,0 10,0", "class": "s10"}], + ["path", {"d": "m 0,20 10,0", "class": "s1"}], ["path", {"d": "M 0,0 10,0", "class": "s1"}]], + ["g", {"id": "vm0-5"}, ["path", {"d": "M 0,20 0,0 1,0 7,20", "class": "s10"}], + ["path", {"d": "M 0,0 1,0 7,20", "class": "s1"}], + ["path", {"d": "m 0,20 10,0", "class": "s1"}]], + ["g", {"id": "vm1-5"}, ["path", {"d": "M 0,0 0,20 1,20 7,0", "class": "s10"}], + ["path", {"d": "M 0,0 10,0", "class": "s1"}], + ["path", {"d": "M 0,20 1,20 7,0", "class": "s1"}]], + ["g", {"id": "vmx-5"}, ["path", {"d": "M 0,0 0,20 1,20 4,10 1,0", "class": "s10"}], + ["path", {"d": "m 0,0 1,0 6,20 3,0", "class": "s1"}], + ["path", {"d": "M 0,20 1,20 7,0 10,0", "class": "s1"}], + ["path", {"d": "M 10,15 6.5,18.5", "class": "s2"}], + ["path", {"d": "M 10,10 5.5,14.5", "class": "s2"}], + ["path", {"d": "M 10,5 4,11", "class": "s2"}], ["path", {"d": "M 10,0 6,4", "class": "s2"}]], + ["g", {"id": "vmd-5"}, ["path", {"d": "m 0,0 0,20 10,0 C 5,20 2,7 1,0", "class": "s10"}], + ["path", {"d": "m 0,0 1,0 c 1,7 4,20 9,20", "class": "s1"}], + ["path", {"d": "m 0,20 10,0", "class": "s1"}]], + ["g", {"id": "vmu-5"}, ["path", {"d": "m 0,0 0,20 1,0 C 2,13 5,0 10,0", "class": "s10"}], + ["path", {"d": "m 0,20 1,0 C 2,13 5,0 10,0", "class": "s1"}], + ["path", {"d": "M 0,0 10,0", "class": "s1"}]], + ["g", {"id": "vmz-5"}, + ["path", {"d": "M 0,0 1,0 C 3,6 7,10 10,10 7,10 3,14 1,20 L 0,20", "class": "s10"}], ["path", + { + "d": "m 0,0 1,0 c 2,6 6,10 9,10", + "class": "s1"}], + ["path", {"d": "m 0,20 1,0 C 3,14 7,10 10,10", "class": "s1"}]], + ["g", {"id": "Pclk"}, ["path", {"d": "M -3,12 0,3 3,12 C 1,11 -1,11 -3,12 z", "class": "s99"}], + ["path", {"d": "M 0,20 0,0 10,0", "class": "s1"}]], + ["g", {"id": "Nclk"}, ["path", {"d": "M -3,8 0,17 3,8 C 1,9 -1,9 -3,8 z", "class": "s99"}], + ["path", {"d": "m 0,0 0,20 10,0", "class": "s1"}]], + ["g", {"id": "vvv-2"}, ["path", {"d": "M 10,20 0,20 0,0 10,0", "class": "s7"}], + ["path", {"d": "m 0,20 10,0", "class": "s1"}], ["path", {"d": "M 0,0 10,0", "class": "s1"}]], + ["g", {"id": "vm0-2"}, ["path", {"d": "m 0,20 0,-20 1.000687,-0.00391 5,20", "class": "s7"}], + ["path", + {"d": "m 0,0 1.000687,-0.00391 6,20", "class": "s1"}], + ["path", {"d": "m 0,20 10.000687,-0.0039", "class": "s1"}]], + ["g", {"id": "vm1-2"}, ["path", {"d": "M 0,0 0,20 3,20 9,0", "class": "s7"}], + ["path", {"d": "M 0,0 10,0", "class": "s1"}], + ["path", {"d": "M 0,20 1,20 7,0", "class": "s1"}]], + ["g", {"id": "vmx-2"}, ["path", {"d": "M 0,0 0,20 1,20 4,10 1,0", "class": "s7"}], + ["path", {"d": "m 0,0 1,0 6,20 3,0", "class": "s1"}], + ["path", {"d": "M 0,20 1,20 7,0 10,0", "class": "s1"}], + ["path", {"d": "M 10,15 6.5,18.5", "class": "s2"}], + ["path", {"d": "M 10,10 5.5,14.5", "class": "s2"}], + ["path", {"d": "M 10,5 4,11", "class": "s2"}], ["path", {"d": "M 10,0 6,4", "class": "s2"}]], + ["g", {"id": "vmd-2"}, ["path", {"d": "m 0,0 0,20 10,0 C 5,20 2,7 1,0", "class": "s7"}], + ["path", + {"d": "m 0,0 1,0 c 1,7 4.0217106,19.565788 9,20", "class": "s1"}], + ["path", {"d": "m 0,20 10,0", "class": "s1"}]], + ["g", {"id": "vmu-2"}, ["path", {"d": "m 0,0 0,20 1,0 C 2,13 5,0 10,0", "class": "s7"}], + ["path", {"d": "m 0,20 1,0 C 2,13 5,0 10,0", "class": "s1"}], + ["path", {"d": "M 0,0 10,0", "class": "s1"}]], + ["g", {"id": "vmz-2"}, + ["path", {"d": "M 0,0 1,0 C 3,6 7,10 10,10 7,10 3,14 1,20 L 0,20", "class": "s7"}], ["path", + { + "d": "m 0,0 1,0 c 2,6 6,10 9,10", + "class": "s1"}], + ["path", {"d": "m 0,20 1,0 C 3,14 7,10 10,10", "class": "s1"}]], + ["g", {"id": "0mv-2"}, ["path", {"d": "m 7,0 3,0 0,20 -9,0 z", "class": "s7"}], + ["path", {"d": "M 1,20 7,0 10,0", "class": "s1"}], + ["path", {"d": "m 0,20 10,0", "class": "s1"}]], + ["g", {"id": "1mv-2"}, ["path", {"d": "m 1,0 9,0 0,20 -3,0 z", "class": "s7"}], + ["path", {"d": "m 1,0 6,20 3,0", "class": "s1"}], ["path", {"d": "M 0,0 10,0", "class": "s1"}]], + ["g", {"id": "xmv-2"}, ["path", {"d": "M 7,0 10,0 10,20 7,20 4,10 z", "class": "s7"}], + ["path", {"d": "M 0,20 1,20 7,0 10,0", "class": "s1"}], + ["path", {"d": "m 0,0 1,0 6,20 3,0", "class": "s1"}], + ["path", {"d": "M 0,5 2,3", "class": "s2"}], ["path", {"d": "M 0,10 3,7", "class": "s2"}], + ["path", {"d": "M 0,15 4,11", "class": "s2"}], ["path", {"d": "M 0,20 1,19", "class": "s2"}]], + ["g", {"id": "dmv-2"}, ["path", {"d": "m 7,0 3,0 0,20 -9,0 z", "class": "s7"}], + ["path", {"d": "M 1,20 7,0 10,0", "class": "s1"}], + ["path", {"d": "m 0,20 10,0", "class": "s1"}]], + ["g", {"id": "umv-2"}, ["path", {"d": "m 1,0 9,0 0,20 -3,0 z", "class": "s7"}], + ["path", {"d": "m 1,0 6,20 3,0", "class": "s1"}], ["path", {"d": "M 0,0 10,0", "class": "s1"}]], + ["g", {"id": "zmv-2"}, ["path", {"d": "M 5,0 10,0 10,20 5,20 1,10 z", "class": "s7"}], + ["path", {"d": "m 1,10 4,10 5,0", "class": "s1"}], + ["path", {"d": "M 0,10 1,10 5,0 10,0", "class": "s1"}]], + ["g", {"id": "vmv-3-2"}, ["path", {"d": "M 7,0 10,0 10,20 7,20 4,10 z", "class": "s7"}], + ["path", {"d": "M 1,0 0,0 0,20 1,20 4,10 z", + "class": "s8"}], ["path", {"d": "m 0,0 1,0 6,20 3,0", "class": "s1"}], + ["path", {"d": "M 0,20 1,20 7,0 10,0", "class": "s1"}]], + ["g", {"id": "vmv-4-2"}, ["path", {"d": "M 7,0 10,0 10,20 7,20 4,10 z", "class": "s7"}], + ["path", {"d": "M 1,0 0,0 0,20 1,20 4,10 z", + "class": "s9"}], ["path", {"d": "m 0,0 1,0 6,20 3,0", "class": "s1"}], + ["path", {"d": "M 0,20 1,20 7,0 10,0", "class": "s1"}]], + ["g", {"id": "vmv-5-2"}, ["path", {"d": "M 7,0 10,0 10,20 7,20 4,10 z", "class": "s7"}], + ["path", {"d": "M 1,0 0,0 0,20 1,20 4,10 z", + "class": "s10"}], ["path", {"d": "m 0,0 1,0 6,20 3,0", "class": "s1"}], + ["path", {"d": "M 0,20 1,20 7,0 10,0", "class": "s1"}]], + ["g", {"id": "vmv-2-3"}, ["path", {"d": "M 7,0 10,0 10,20 7,20 4,10 z", "class": "s8"}], + ["path", {"d": "M 1,0 0,0 0,20 1,20 4,10 z", + "class": "s7"}], ["path", {"d": "m 0,0 1,0 6,20 3,0", "class": "s1"}], + ["path", {"d": "M 0,20 1,20 7,0 10,0", "class": "s1"}]], + ["g", {"id": "vmv-2-4"}, ["path", {"d": "M 7,0 10,0 10,20 7,20 4,10 z", "class": "s9"}], + ["path", {"d": "M 1,0 0,0 0,20 1,20 4,10 z", + "class": "s7"}], ["path", {"d": "m 0,0 1,0 6,20 3,0", "class": "s1"}], + ["path", {"d": "M 0,20 1,20 7,0 10,0", "class": "s1"}]], + ["g", {"id": "vmv-2-5"}, ["path", {"d": "M 7,0 10,0 10,20 7,20 4,10 z", "class": "s10"}], + ["path", {"d": "M 1,0 0,0 0,20 1,20 4,10 z", + "class": "s7"}], ["path", {"d": "m 0,0 1,0 6,20 3,0", "class": "s1"}], + ["path", {"d": "M 0,20 1,20 7,0 10,0", "class": "s1"}]], + ["g", {"id": "vmv-2-2"}, ["path", {"d": "M 7,0 10,0 10,20 7,20 4,10 z", "class": "s7"}], + ["path", {"d": "M 1,0 0,0 0,20 1,20 4,10 z", + "class": "s7"}], ["path", {"d": "m 0,0 1,0 6,20 3,0", "class": "s1"}], + ["path", {"d": "M 0,20 1,20 7,0 10,0", "class": "s1"}]], + ["marker", {"id": "arrowhead", "style": "fill:#0041c4", "markerHeight": "7", "markerWidth": "10", + "markerUnits": "strokeWidth", + "viewBox": "0 -4 11 8", "refX": "15", "refY": "0", "orient": "auto"}, + ["path", {"d": "M0 -4 11 0 0 4z"}]], + ["marker", {"id": "arrowtail", "style": "fill:#0041c4", "markerHeight": "7", "markerWidth": "10", + "markerUnits": "strokeWidth", "viewBox": "-11 -4 11 8", "refX": "-15", "refY": "0", + "orient": "auto"}, ["path", {"d": "M0 -4 -11 0 0 4z"}]]], + ["g", {"id": "waves"}, ["g", {"id": "lanes"}], ["g", {"id": "groups"}]]] + +WaveSkin['lowkey'] = ["svg", {"id": "svg", "xmlns": "http://www.w3.org/2000/svg", + "xmlns:xlink": "http://www.w3.org/1999/xlink", "height": "0"}, + ["style", {"type": "text/css"}, css.css.lowkey], + ["defs", ["g", {"id": "socket"}, ["rect", {"y": "15", "x": "6", "height": "20", "width": "20", + "style": "fill:#606060;stroke:#606060;stroke-width:0.5"}]], + ["g", {"id": "pclk"}, ["path", {"d": "M0,20 0,0 20,0", "class": "s1"}]], + ["g", {"id": "nclk"}, ["path", {"d": "m0,0 0,20 20,0", "class": "s1"}]], + ["g", {"id": "000"}, ["path", {"d": "m0,20 20,0", "class": "s1"}]], + ["g", {"id": "0m0"}, ["path", {"d": "m0,20 3,0 3,-10 3,10 11,0", "class": "s1"}]], + ["g", {"id": "0m1"}, ["path", {"d": "M0,20 3,20 9,0 20,0", "class": "s1"}]], + ["g", {"id": "0mx"}, ["path", {"d": "M3,20 9,0 20,0", "class": "s1"}], + ["path", {"d": "m20,15 -5,5", "class": "s2"}], ["path", {"d": "M20,10 10,20", "class": "s2"}], + ["path", {"d": "M20,5 5,20", "class": "s2"}], ["path", {"d": "M20,0 4,16", "class": "s2"}], + ["path", {"d": "M15,0 6,9", "class": "s2"}], ["path", {"d": "M10,0 9,1", "class": "s2"}], + ["path", {"d": "m0,20 20,0", "class": "s1"}]], + ["g", {"id": "0md"}, ["path", {"d": "m8,20 10,0", "class": "s3"}], + ["path", {"d": "m0,20 5,0", "class": "s1"}]], + ["g", {"id": "0mu"}, ["path", {"d": "m0,20 3,0 C 7,10 10.107603,0 20,0", "class": "s1"}]], + ["g", {"id": "0mz"}, ["path", {"d": "m0,20 3,0 C 10,10 15,10 20,10", "class": "s1"}]], + ["g", {"id": "111"}, ["path", {"d": "M0,0 20,0", "class": "s1"}]], + ["g", {"id": "1m0"}, ["path", {"d": "m0,0 3,0 6,20 11,0", "class": "s1"}]], + ["g", {"id": "1m1"}, ["path", {"d": "M0,0 3,0 6,10 9,0 20,0", "class": "s1"}]], + ["g", {"id": "1mx"}, ["path", {"d": "m3,0 6,20 11,0", "class": "s1"}], + ["path", {"d": "M0,0 20,0", "class": "s1"}], ["path", {"d": "m20,15 -5,5", "class": "s2"}], + ["path", {"d": "M20,10 10,20", "class": "s2"}], ["path", {"d": "M20,5 8,17", "class": "s2"}], + ["path", {"d": "M20,0 7,13", "class": "s2"}], ["path", {"d": "M15,0 6,9", "class": "s2"}], + ["path", {"d": "M10,0 5,5", "class": "s2"}], ["path", {"d": "M3.5,1.5 5,0", "class": "s2"}]], + ["g", {"id": "1md"}, ["path", {"d": "m0,0 3,0 c 4,10 7,20 17,20", "class": "s1"}]], + ["g", {"id": "1mu"}, ["path", {"d": "M0,0 5,0", "class": "s1"}], + ["path", {"d": "M8,0 18,0", "class": "s3"}]], + ["g", {"id": "1mz"}, ["path", {"d": "m0,0 3,0 c 7,10 12,10 17,10", "class": "s1"}]], + ["g", {"id": "xxx"}, ["path", {"d": "m0,20 20,0", "class": "s1"}], + ["path", {"d": "M0,0 20,0", "class": "s1"}], ["path", {"d": "M0,5 5,0", "class": "s2"}], + ["path", {"d": "M0,10 10,0", "class": "s2"}], ["path", {"d": "M0,15 15,0", "class": "s2"}], + ["path", {"d": "M0,20 20,0", "class": "s2"}], ["path", {"d": "M5,20 20,5", "class": "s2"}], + ["path", {"d": "M10,20 20,10", "class": "s2"}], ["path", {"d": "m15,20 5,-5", "class": "s2"}]], + ["g", {"id": "xm0"}, ["path", {"d": "M0,0 4,0 9,20", "class": "s1"}], + ["path", {"d": "m0,20 20,0", "class": "s1"}], ["path", {"d": "M0,5 4,1", "class": "s2"}], + ["path", {"d": "M0,10 5,5", "class": "s2"}], ["path", {"d": "M0,15 6,9", "class": "s2"}], + ["path", {"d": "M0,20 7,13", "class": "s2"}], ["path", {"d": "M5,20 8,17", "class": "s2"}]], + ["g", {"id": "xm1"}, ["path", {"d": "M0,0 20,0", "class": "s1"}], + ["path", {"d": "M0,20 4,20 9,0", "class": "s1"}], ["path", {"d": "M0,5 5,0", "class": "s2"}], + ["path", {"d": "M0,10 9,1", "class": "s2"}], ["path", {"d": "M0,15 7,8", "class": "s2"}], + ["path", {"d": "M0,20 5,15", "class": "s2"}]], + ["g", {"id": "xmx"}, ["path", {"d": "m0,20 20,0", "class": "s1"}], + ["path", {"d": "M0,0 20,0", "class": "s1"}], ["path", {"d": "M0,5 5,0", "class": "s2"}], + ["path", {"d": "M0,10 10,0", "class": "s2"}], ["path", {"d": "M0,15 15,0", "class": "s2"}], + ["path", {"d": "M0,20 20,0", "class": "s2"}], ["path", {"d": "M5,20 20,5", "class": "s2"}], + ["path", {"d": "M10,20 20,10", "class": "s2"}], ["path", {"d": "m15,20 5,-5", "class": "s2"}]], + ["g", {"id": "xmd"}, ["path", {"d": "m0,0 4,0 c 3,10 6,20 16,20", "class": "s1"}], + ["path", {"d": "m0,20 20,0", "class": "s1"}], ["path", {"d": "M0,5 4,1", "class": "s2"}], + ["path", {"d": "M0,10 5.5,4.5", "class": "s2"}], + ["path", {"d": "M0,15 6.5,8.5", "class": "s2"}], ["path", {"d": "M0,20 8,12", "class": "s2"}], + ["path", {"d": "m5,20 5,-5", "class": "s2"}], + ["path", {"d": "m10,20 2.5,-2.5", "class": "s2"}]], + ["g", {"id": "xmu"}, ["path", {"d": "M0,0 20,0", "class": "s1"}], + ["path", {"d": "m0,20 4,0 C 7,10 10,0 20,0", "class": "s1"}], + ["path", {"d": "M0,5 5,0", "class": "s2"}], ["path", {"d": "M0,10 10,0", "class": "s2"}], + ["path", {"d": "M0,15 10,5", "class": "s2"}], ["path", {"d": "M0,20 6,14", "class": "s2"}]], + ["g", {"id": "xmz"}, ["path", {"d": "m0,0 4,0 c 6,10 11,10 16,10", "class": "s1"}], + ["path", {"d": "m0,20 4,0 C 10,10 15,10 20,10", "class": "s1"}], + ["path", {"d": "M0,5 4.5,0.5", "class": "s2"}], ["path", {"d": "M0,10 6.5,3.5", "class": "s2"}], + ["path", {"d": "M0,15 8.5,6.5", "class": "s2"}], + ["path", {"d": "M0,20 11.5,8.5", "class": "s2"}]], + ["g", {"id": "ddd"}, ["path", {"d": "m0,20 20,0", "class": "s3"}]], + ["g", {"id": "dm0"}, ["path", {"d": "m0,20 10,0", "class": "s3"}], + ["path", {"d": "m12,20 8,0", "class": "s1"}]], + ["g", {"id": "dm1"}, ["path", {"d": "M0,20 3,20 9,0 20,0", "class": "s1"}]], + ["g", {"id": "dmx"}, ["path", {"d": "M3,20 9,0 20,0", "class": "s1"}], + ["path", {"d": "m20,15 -5,5", "class": "s2"}], ["path", {"d": "M20,10 10,20", "class": "s2"}], + ["path", {"d": "M20,5 5,20", "class": "s2"}], ["path", {"d": "M20,0 4,16", "class": "s2"}], + ["path", {"d": "M15,0 6,9", "class": "s2"}], ["path", {"d": "M10,0 9,1", "class": "s2"}], + ["path", {"d": "m0,20 20,0", "class": "s1"}]], + ["g", {"id": "dmd"}, ["path", {"d": "m0,20 20,0", "class": "s3"}]], + ["g", {"id": "dmu"}, ["path", {"d": "m0,20 3,0 C 7,10 10.107603,0 20,0", "class": "s1"}]], + ["g", {"id": "dmz"}, ["path", {"d": "m0,20 3,0 C 10,10 15,10 20,10", "class": "s1"}]], + ["g", {"id": "uuu"}, ["path", {"d": "M0,0 20,0", "class": "s3"}]], + ["g", {"id": "um0"}, ["path", {"d": "m0,0 3,0 6,20 11,0", "class": "s1"}]], + ["g", {"id": "um1"}, ["path", {"d": "M0,0 10,0", "class": "s3"}], + ["path", {"d": "m12,0 8,0", "class": "s1"}]], + ["g", {"id": "umx"}, ["path", {"d": "m3,0 6,20 11,0", "class": "s1"}], + ["path", {"d": "M0,0 20,0", "class": "s1"}], ["path", {"d": "m20,15 -5,5", "class": "s2"}], + ["path", {"d": "M20,10 10,20", "class": "s2"}], ["path", {"d": "M20,5 8,17", "class": "s2"}], + ["path", {"d": "M20,0 7,13", "class": "s2"}], ["path", {"d": "M15,0 6,9", "class": "s2"}], + ["path", {"d": "M10,0 5,5", "class": "s2"}], ["path", {"d": "M3.5,1.5 5,0", "class": "s2"}]], + ["g", {"id": "umd"}, ["path", {"d": "m0,0 3,0 c 4,10 7,20 17,20", "class": "s1"}]], + ["g", {"id": "umu"}, ["path", {"d": "M0,0 20,0", "class": "s3"}]], + ["g", {"id": "umz"}, ["path", {"d": "m0,0 3,0 c 7,10 12,10 17,10", "class": "s4"}]], + ["g", {"id": "zzz"}, ["path", {"d": "m0,10 20,0", "class": "s1"}]], + ["g", {"id": "zm0"}, ["path", {"d": "m0,10 6,0 3,10 11,0", "class": "s1"}]], + ["g", {"id": "zm1"}, ["path", {"d": "M0,10 6,10 9,0 20,0", "class": "s1"}]], + ["g", {"id": "zmx"}, ["path", {"d": "m6,10 3,10 11,0", "class": "s1"}], + ["path", {"d": "M0,10 6,10 9,0 20,0", "class": "s1"}], + ["path", {"d": "m20,15 -5,5", "class": "s2"}], ["path", {"d": "M20,10 10,20", "class": "s2"}], + ["path", {"d": "M20,5 8,17", "class": "s2"}], ["path", {"d": "M20,0 7,13", "class": "s2"}], + ["path", {"d": "M15,0 6.5,8.5", "class": "s2"}], ["path", {"d": "M10,0 9,1", "class": "s2"}]], + ["g", {"id": "zmd"}, ["path", {"d": "m0,10 7,0 c 3,5 8,10 13,10", "class": "s1"}]], + ["g", {"id": "zmu"}, ["path", {"d": "m0,10 7,0 C 10,5 15,0 20,0", "class": "s1"}]], + ["g", {"id": "zmz"}, ["path", {"d": "m0,10 20,0", "class": "s1"}]], ["g", {"id": "gap"}, ["path", + { + "d": "m7,-2 -4,0 c -5,0 -5,24 -10,24 l 4,0 C 2,22 2,-2 7,-2 z", + "class": "s5"}], + ["path", { + "d": "M-7,22 C -2,22 -2,-2 3,-2", + "class": "s1"}], + ["path", { + "d": "M-3,22 C 2,22 2,-2 7,-2", + "class": "s1"}]], + ["g", {"id": "0mv-3"}, ["path", {"d": "M9,0 20,0 20,20 3,20 z", "class": "s8"}], + ["path", {"d": "M3,20 9,0 20,0", "class": "s1"}], ["path", {"d": "m0,20 20,0", "class": "s1"}]], + ["g", {"id": "1mv-3"}, ["path", {"d": "M2.875,0 20,0 20,20 9,20 z", "class": "s8"}], + ["path", {"d": "m3,0 6,20 11,0", "class": "s1"}], ["path", {"d": "M0,0 20,0", "class": "s1"}]], + ["g", {"id": "xmv-3"}, ["path", {"d": "M9,0 20,0 20,20 9,20 6,10 z", "class": "s8"}], + ["path", {"d": "M0,20 3,20 9,0 20,0", "class": "s1"}], + ["path", {"d": "m0,0 3,0 6,20 11,0", "class": "s1"}], + ["path", {"d": "M0,5 3.5,1.5", "class": "s2"}], ["path", {"d": "M0,10 4.5,5.5", "class": "s2"}], + ["path", {"d": "M0,15 6,9", "class": "s2"}], ["path", {"d": "M0,20 4,16", "class": "s2"}]], + ["g", {"id": "dmv-3"}, ["path", {"d": "M9,0 20,0 20,20 3,20 z", "class": "s8"}], + ["path", {"d": "M3,20 9,0 20,0", "class": "s1"}], ["path", {"d": "m0,20 20,0", "class": "s1"}]], + ["g", {"id": "umv-3"}, ["path", {"d": "M3,0 20,0 20,20 9,20 z", "class": "s8"}], + ["path", {"d": "m3,0 6,20 11,0", "class": "s1"}], ["path", {"d": "M0,0 20,0", "class": "s1"}]], + ["g", {"id": "zmv-3"}, ["path", {"d": "M9,0 20,0 20,20 9,20 6,10 z", "class": "s8"}], + ["path", {"d": "m6,10 3,10 11,0", "class": "s1"}], + ["path", {"d": "M0,10 6,10 9,0 20,0", "class": "s1"}]], + ["g", {"id": "vvv-3"}, ["path", {"d": "M20,20 0,20 0,0 20,0", "class": "s8"}], + ["path", {"d": "m0,20 20,0", "class": "s1"}], ["path", {"d": "M0,0 20,0", "class": "s1"}]], + ["g", {"id": "vm0-3"}, ["path", {"d": "M0,20 0,0 3,0 9,20", "class": "s8"}], + ["path", {"d": "M0,0 3,0 9,20", "class": "s1"}], ["path", {"d": "m0,20 20,0", "class": "s1"}]], + ["g", {"id": "vm1-3"}, ["path", {"d": "M0,0 0,20 3,20 9,0", "class": "s8"}], + ["path", {"d": "M0,0 20,0", "class": "s1"}], ["path", {"d": "M0,20 3,20 9,0", "class": "s1"}]], + ["g", {"id": "vmx-3"}, ["path", {"d": "M0,0 0,20 3,20 6,10 3,0", "class": "s8"}], + ["path", {"d": "m0,0 3,0 6,20 11,0", "class": "s1"}], + ["path", {"d": "M0,20 3,20 9,0 20,0", "class": "s1"}], + ["path", {"d": "m20,15 -5,5", "class": "s2"}], ["path", {"d": "M20,10 10,20", "class": "s2"}], + ["path", {"d": "M20,5 8,17", "class": "s2"}], ["path", {"d": "M20,0 7,13", "class": "s2"}], + ["path", {"d": "M15,0 7,8", "class": "s2"}], ["path", {"d": "M10,0 9,1", "class": "s2"}]], + ["g", {"id": "vmd-3"}, ["path", {"d": "m0,0 0,20 20,0 C 10,20 7,10 3,0", "class": "s8"}], + ["path", {"d": "m0,0 3,0 c 4,10 7,20 17,20", "class": "s1"}], + ["path", {"d": "m0,20 20,0", "class": "s1"}]], + ["g", {"id": "vmu-3"}, ["path", {"d": "m0,0 0,20 3,0 C 7,10 10,0 20,0", "class": "s8"}], + ["path", {"d": "m0,20 3,0 C 7,10 10,0 20,0", "class": "s1"}], + ["path", {"d": "M0,0 20,0", "class": "s1"}]], ["g", {"id": "vmz-3"}, ["path", { + "d": "M0,0 3,0 C 10,10 15,10 20,10 15,10 10,10 3,20 L 0,20", "class": "s8"}], ["path", { + "d": "m0,0 3,0 c 7,10 12,10 17,10", "class": "s1"}], ["path", + {"d": "m0,20 3,0 C 10,10 15,10 20,10", + "class": "s1"}]], + ["g", {"id": "vmv-3-3"}, ["path", {"d": "M9,0 20,0 20,20 9,20 6,10 z", "class": "s8"}], + ["path", {"d": "M3,0 0,0 0,20 3,20 6,10 z", "class": "s8"}], + ["path", {"d": "m0,0 3,0 6,20 11,0", "class": "s1"}], + ["path", {"d": "M0,20 3,20 9,0 20,0", "class": "s1"}]], + ["g", {"id": "vmv-3-4"}, ["path", {"d": "M9,0 20,0 20,20 9,20 6,10 z", "class": "s9"}], + ["path", {"d": "M3,0 0,0 0,20 3,20 6,10 z", "class": "s8"}], + ["path", {"d": "m0,0 3,0 6,20 11,0", "class": "s1"}], + ["path", {"d": "M0,20 3,20 9,0 20,0", "class": "s1"}]], + ["g", {"id": "vmv-3-5"}, ["path", {"d": "M9,0 20,0 20,20 9,20 6,10 z", "class": "s10"}], + ["path", {"d": "M3,0 0,0 0,20 3,20 6,10 z", "class": "s8"}], + ["path", {"d": "m0,0 3,0 6,20 11,0", "class": "s1"}], + ["path", {"d": "M0,20 3,20 9,0 20,0", "class": "s1"}]], + ["g", {"id": "vmv-4-3"}, ["path", {"d": "M9,0 20,0 20,20 9,20 6,10 z", "class": "s8"}], + ["path", {"d": "M3,0 0,0 0,20 3,20 6,10 z", "class": "s9"}], + ["path", {"d": "m0,0 3,0 6,20 11,0", "class": "s1"}], + ["path", {"d": "M0,20 3,20 9,0 20,0", "class": "s1"}]], + ["g", {"id": "vmv-4-4"}, ["path", {"d": "M9,0 20,0 20,20 9,20 6,10 z", "class": "s9"}], + ["path", {"d": "M3,0 0,0 0,20 3,20 6,10 z", "class": "s9"}], + ["path", {"d": "m0,0 3,0 6,20 11,0", "class": "s1"}], + ["path", {"d": "M0,20 3,20 9,0 20,0", "class": "s1"}]], + ["g", {"id": "vmv-4-5"}, ["path", {"d": "M9,0 20,0 20,20 9,20 6,10 z", "class": "s10"}], + ["path", {"d": "M3,0 0,0 0,20 3,20 6,10 z", "class": "s9"}], + ["path", {"d": "m0,0 3,0 6,20 11,0", "class": "s1"}], + ["path", {"d": "M0,20 3,20 9,0 20,0", "class": "s1"}]], + ["g", {"id": "vmv-5-3"}, ["path", {"d": "M9,0 20,0 20,20 9,20 6,10 z", "class": "s8"}], + ["path", {"d": "M3,0 0,0 0,20 3,20 6,10 z", "class": "s10"}], + ["path", {"d": "m0,0 3,0 6,20 11,0", "class": "s1"}], + ["path", {"d": "M0,20 3,20 9,0 20,0", "class": "s1"}]], + ["g", {"id": "vmv-5-4"}, ["path", {"d": "M9,0 20,0 20,20 9,20 6,10 z", "class": "s9"}], + ["path", {"d": "M3,0 0,0 0,20 3,20 6,10 z", "class": "s10"}], + ["path", {"d": "m0,0 3,0 6,20 11,0", "class": "s1"}], + ["path", {"d": "M0,20 3,20 9,0 20,0", "class": "s1"}]], + ["g", {"id": "vmv-5-5"}, ["path", {"d": "M9,0 20,0 20,20 9,20 6,10 z", "class": "s10"}], + ["path", {"d": "M3,0 0,0 0,20 3,20 6,10 z", "class": "s10"}], + ["path", {"d": "m0,0 3,0 6,20 11,0", "class": "s1"}], + ["path", {"d": "M0,20 3,20 9,0 20,0", "class": "s1"}]], + ["g", {"id": "0mv-4"}, ["path", {"d": "M9,0 20,0 20,20 3,20 z", "class": "s9"}], + ["path", {"d": "M3,20 9,0 20,0", "class": "s1"}], ["path", {"d": "m0,20 20,0", "class": "s1"}]], + ["g", {"id": "1mv-4"}, ["path", {"d": "M2.875,0 20,0 20,20 9,20 z", "class": "s9"}], + ["path", {"d": "m3,0 6,20 11,0", "class": "s1"}], ["path", {"d": "M0,0 20,0", "class": "s1"}]], + ["g", {"id": "xmv-4"}, ["path", {"d": "M9,0 20,0 20,20 9,20 6,10 z", "class": "s9"}], + ["path", {"d": "M0,20 3,20 9,0 20,0", "class": "s1"}], + ["path", {"d": "m0,0 3,0 6,20 11,0", "class": "s1"}], + ["path", {"d": "M0,5 3.5,1.5", "class": "s2"}], ["path", {"d": "M0,10 4.5,5.5", "class": "s2"}], + ["path", {"d": "M0,15 6,9", "class": "s2"}], ["path", {"d": "M0,20 4,16", "class": "s2"}]], + ["g", {"id": "dmv-4"}, ["path", {"d": "M9,0 20,0 20,20 3,20 z", "class": "s9"}], + ["path", {"d": "M3,20 9,0 20,0", "class": "s1"}], ["path", {"d": "m0,20 20,0", "class": "s1"}]], + ["g", {"id": "umv-4"}, ["path", {"d": "M3,0 20,0 20,20 9,20 z", "class": "s9"}], + ["path", {"d": "m3,0 6,20 11,0", "class": "s1"}], ["path", {"d": "M0,0 20,0", "class": "s1"}]], + ["g", {"id": "zmv-4"}, ["path", {"d": "M9,0 20,0 20,20 9,20 6,10 z", "class": "s9"}], + ["path", {"d": "m6,10 3,10 11,0", "class": "s1"}], + ["path", {"d": "M0,10 6,10 9,0 20,0", "class": "s1"}]], + ["g", {"id": "0mv-5"}, ["path", {"d": "M9,0 20,0 20,20 3,20 z", "class": "s10"}], + ["path", {"d": "M3,20 9,0 20,0", "class": "s1"}], ["path", {"d": "m0,20 20,0", "class": "s1"}]], + ["g", {"id": "1mv-5"}, ["path", {"d": "M2.875,0 20,0 20,20 9,20 z", "class": "s10"}], + ["path", {"d": "m3,0 6,20 11,0", "class": "s1"}], ["path", {"d": "M0,0 20,0", "class": "s1"}]], + ["g", {"id": "xmv-5"}, ["path", {"d": "M9,0 20,0 20,20 9,20 6,10 z", "class": "s10"}], + ["path", {"d": "M0,20 3,20 9,0 20,0", "class": "s1"}], + ["path", {"d": "m0,0 3,0 6,20 11,0", "class": "s1"}], + ["path", {"d": "M0,5 3.5,1.5", "class": "s2"}], ["path", {"d": "M0,10 4.5,5.5", "class": "s2"}], + ["path", {"d": "M0,15 6,9", "class": "s2"}], ["path", {"d": "M0,20 4,16", "class": "s2"}]], + ["g", {"id": "dmv-5"}, ["path", {"d": "M9,0 20,0 20,20 3,20 z", "class": "s10"}], + ["path", {"d": "M3,20 9,0 20,0", "class": "s1"}], ["path", {"d": "m0,20 20,0", "class": "s1"}]], + ["g", {"id": "umv-5"}, ["path", {"d": "M3,0 20,0 20,20 9,20 z", "class": "s10"}], + ["path", {"d": "m3,0 6,20 11,0", "class": "s1"}], ["path", {"d": "M0,0 20,0", "class": "s1"}]], + ["g", {"id": "zmv-5"}, ["path", {"d": "M9,0 20,0 20,20 9,20 6,10 z", "class": "s10"}], + ["path", {"d": "m6,10 3,10 11,0", "class": "s1"}], + ["path", {"d": "M0,10 6,10 9,0 20,0", "class": "s1"}]], + ["g", {"id": "vvv-4"}, ["path", {"d": "M20,20 0,20 0,0 20,0", "class": "s9"}], + ["path", {"d": "m0,20 20,0", "class": "s1"}], ["path", {"d": "M0,0 20,0", "class": "s1"}]], + ["g", {"id": "vm0-4"}, ["path", {"d": "M0,20 0,0 3,0 9,20", "class": "s9"}], + ["path", {"d": "M0,0 3,0 9,20", "class": "s1"}], ["path", {"d": "m0,20 20,0", "class": "s1"}]], + ["g", {"id": "vm1-4"}, ["path", {"d": "M0,0 0,20 3,20 9,0", "class": "s9"}], + ["path", {"d": "M0,0 20,0", "class": "s1"}], ["path", {"d": "M0,20 3,20 9,0", "class": "s1"}]], + ["g", {"id": "vmx-4"}, ["path", {"d": "M0,0 0,20 3,20 6,10 3,0", "class": "s9"}], + ["path", {"d": "m0,0 3,0 6,20 11,0", "class": "s1"}], + ["path", {"d": "M0,20 3,20 9,0 20,0", "class": "s1"}], + ["path", {"d": "m20,15 -5,5", "class": "s2"}], ["path", {"d": "M20,10 10,20", "class": "s2"}], + ["path", {"d": "M20,5 8,17", "class": "s2"}], ["path", {"d": "M20,0 7,13", "class": "s2"}], + ["path", {"d": "M15,0 7,8", "class": "s2"}], ["path", {"d": "M10,0 9,1", "class": "s2"}]], + ["g", {"id": "vmd-4"}, ["path", {"d": "m0,0 0,20 20,0 C 10,20 7,10 3,0", "class": "s9"}], + ["path", {"d": "m0,0 3,0 c 4,10 7,20 17,20", "class": "s1"}], + ["path", {"d": "m0,20 20,0", "class": "s1"}]], + ["g", {"id": "vmu-4"}, ["path", {"d": "m0,0 0,20 3,0 C 7,10 10,0 20,0", "class": "s9"}], + ["path", {"d": "m0,20 3,0 C 7,10 10,0 20,0", "class": "s1"}], + ["path", {"d": "M0,0 20,0", "class": "s1"}]], ["g", {"id": "vmz-4"}, ["path", { + "d": "M0,0 3,0 C 10,10 15,10 20,10 15,10 10,10 3,20 L 0,20", "class": "s9"}], ["path", { + "d": "m0,0 3,0 c 7,10 12,10 17,10", "class": "s1"}], ["path", + {"d": "m0,20 3,0 C 10,10 15,10 20,10", + "class": "s1"}]], + ["g", {"id": "vvv-5"}, ["path", {"d": "M20,20 0,20 0,0 20,0", "class": "s10"}], + ["path", {"d": "m0,20 20,0", "class": "s1"}], ["path", {"d": "M0,0 20,0", "class": "s1"}]], + ["g", {"id": "vm0-5"}, ["path", {"d": "M0,20 0,0 3,0 9,20", "class": "s10"}], + ["path", {"d": "M0,0 3,0 9,20", "class": "s1"}], ["path", {"d": "m0,20 20,0", "class": "s1"}]], + ["g", {"id": "vm1-5"}, ["path", {"d": "M0,0 0,20 3,20 9,0", "class": "s10"}], + ["path", {"d": "M0,0 20,0", "class": "s1"}], ["path", {"d": "M0,20 3,20 9,0", "class": "s1"}]], + ["g", {"id": "vmx-5"}, ["path", {"d": "M0,0 0,20 3,20 6,10 3,0", "class": "s10"}], + ["path", {"d": "m0,0 3,0 6,20 11,0", "class": "s1"}], + ["path", {"d": "M0,20 3,20 9,0 20,0", "class": "s1"}], + ["path", {"d": "m20,15 -5,5", "class": "s2"}], ["path", {"d": "M20,10 10,20", "class": "s2"}], + ["path", {"d": "M20,5 8,17", "class": "s2"}], ["path", {"d": "M20,0 7,13", "class": "s2"}], + ["path", {"d": "M15,0 7,8", "class": "s2"}], ["path", {"d": "M10,0 9,1", "class": "s2"}]], + ["g", {"id": "vmd-5"}, ["path", {"d": "m0,0 0,20 20,0 C 10,20 7,10 3,0", "class": "s10"}], + ["path", {"d": "m0,0 3,0 c 4,10 7,20 17,20", "class": "s1"}], + ["path", {"d": "m0,20 20,0", "class": "s1"}]], + ["g", {"id": "vmu-5"}, ["path", {"d": "m0,0 0,20 3,0 C 7,10 10,0 20,0", "class": "s10"}], + ["path", {"d": "m0,20 3,0 C 7,10 10,0 20,0", "class": "s1"}], + ["path", {"d": "M0,0 20,0", "class": "s1"}]], ["g", {"id": "vmz-5"}, ["path", { + "d": "M0,0 3,0 C 10,10 15,10 20,10 15,10 10,10 3,20 L 0,20", "class": "s10"}], ["path", { + "d": "m0,0 3,0 c 7,10 12,10 17,10", "class": "s1"}], ["path", + {"d": "m0,20 3,0 C 10,10 15,10 20,10", + "class": "s1"}]], + ["g", {"id": "Pclk"}, ["path", {"d": "M-3,12 0,3 3,12 C 1,11 -1,11 -3,12 z", "class": "s99"}], + ["path", {"d": "M0,20 0,0 20,0", "class": "s1"}]], + ["g", {"id": "Nclk"}, ["path", {"d": "M-3,8 0,17 3,8 C 1,9 -1,9 -3,8 z", "class": "s99"}], + ["path", {"d": "m0,0 0,20 20,0", "class": "s1"}]], + ["g", {"id": "vvv-2"}, ["path", {"d": "M20,20 0,20 0,0 20,0", "class": "s7"}], + ["path", {"d": "m0,20 20,0", "class": "s1"}], ["path", {"d": "M0,0 20,0", "class": "s1"}]], + ["g", {"id": "vm0-2"}, ["path", {"d": "M0,20 0,0 3,0 9,20", "class": "s7"}], + ["path", {"d": "M0,0 3,0 9,20", "class": "s1"}], ["path", {"d": "m0,20 20,0", "class": "s1"}]], + ["g", {"id": "vm1-2"}, ["path", {"d": "M0,0 0,20 3,20 9,0", "class": "s7"}], + ["path", {"d": "M0,0 20,0", "class": "s1"}], ["path", {"d": "M0,20 3,20 9,0", "class": "s1"}]], + ["g", {"id": "vmx-2"}, ["path", {"d": "M0,0 0,20 3,20 6,10 3,0", "class": "s7"}], + ["path", {"d": "m0,0 3,0 6,20 11,0", "class": "s1"}], + ["path", {"d": "M0,20 3,20 9,0 20,0", "class": "s1"}], + ["path", {"d": "m20,15 -5,5", "class": "s2"}], ["path", {"d": "M20,10 10,20", "class": "s2"}], + ["path", {"d": "M20,5 8,17", "class": "s2"}], ["path", {"d": "M20,0 7,13", "class": "s2"}], + ["path", {"d": "M15,0 7,8", "class": "s2"}], ["path", {"d": "M10,0 9,1", "class": "s2"}]], + ["g", {"id": "vmd-2"}, ["path", {"d": "m0,0 0,20 20,0 C 10,20 7,10 3,0", "class": "s7"}], + ["path", {"d": "m0,0 3,0 c 4,10 7,20 17,20", "class": "s1"}], + ["path", {"d": "m0,20 20,0", "class": "s1"}]], + ["g", {"id": "vmu-2"}, ["path", {"d": "m0,0 0,20 3,0 C 7,10 10,0 20,0", "class": "s7"}], + ["path", {"d": "m0,20 3,0 C 7,10 10,0 20,0", "class": "s1"}], + ["path", {"d": "M0,0 20,0", "class": "s1"}]], ["g", {"id": "vmz-2"}, ["path", { + "d": "M0,0 3,0 C 10,10 15,10 20,10 15,10 10,10 3,20 L 0,20", "class": "s7"}], ["path", { + "d": "m0,0 3,0 c 7,10 12,10 17,10", "class": "s1"}], ["path", + {"d": "m0,20 3,0 C 10,10 15,10 20,10", + "class": "s1"}]], + ["g", {"id": "0mv-2"}, ["path", {"d": "M9,0 20,0 20,20 3,20 z", "class": "s7"}], + ["path", {"d": "M3,20 9,0 20,0", "class": "s1"}], ["path", {"d": "m0,20 20,0", "class": "s1"}]], + ["g", {"id": "1mv-2"}, ["path", {"d": "M2.875,0 20,0 20,20 9,20 z", "class": "s7"}], + ["path", {"d": "m3,0 6,20 11,0", "class": "s1"}], ["path", {"d": "M0,0 20,0", "class": "s1"}]], + ["g", {"id": "xmv-2"}, ["path", {"d": "M9,0 20,0 20,20 9,20 6,10 z", "class": "s7"}], + ["path", {"d": "M0,20 3,20 9,0 20,0", "class": "s1"}], + ["path", {"d": "m0,0 3,0 6,20 11,0", "class": "s1"}], + ["path", {"d": "M0,5 3.5,1.5", "class": "s2"}], ["path", {"d": "M0,10 4.5,5.5", "class": "s2"}], + ["path", {"d": "M0,15 6,9", "class": "s2"}], ["path", {"d": "M0,20 4,16", "class": "s2"}]], + ["g", {"id": "dmv-2"}, ["path", {"d": "M9,0 20,0 20,20 3,20 z", "class": "s7"}], + ["path", {"d": "M3,20 9,0 20,0", "class": "s1"}], ["path", {"d": "m0,20 20,0", "class": "s1"}]], + ["g", {"id": "umv-2"}, ["path", {"d": "M3,0 20,0 20,20 9,20 z", "class": "s7"}], + ["path", {"d": "m3,0 6,20 11,0", "class": "s1"}], ["path", {"d": "M0,0 20,0", "class": "s1"}]], + ["g", {"id": "zmv-2"}, ["path", {"d": "M9,0 20,0 20,20 9,20 6,10 z", "class": "s7"}], + ["path", {"d": "m6,10 3,10 11,0", "class": "s1"}], + ["path", {"d": "M0,10 6,10 9,0 20,0", "class": "s1"}]], + ["g", {"id": "vmv-3-2"}, ["path", {"d": "M9,0 20,0 20,20 9,20 6,10 z", "class": "s7"}], + ["path", {"d": "M3,0 0,0 0,20 3,20 6,10 z", "class": "s8"}], + ["path", {"d": "m0,0 3,0 6,20 11,0", "class": "s1"}], + ["path", {"d": "M0,20 3,20 9,0 20,0", "class": "s1"}]], + ["g", {"id": "vmv-4-2"}, ["path", {"d": "M9,0 20,0 20,20 9,20 6,10 z", "class": "s7"}], + ["path", {"d": "M3,0 0,0 0,20 3,20 6,10 z", "class": "s9"}], + ["path", {"d": "m0,0 3,0 6,20 11,0", "class": "s1"}], + ["path", {"d": "M0,20 3,20 9,0 20,0", "class": "s1"}]], + ["g", {"id": "vmv-5-2"}, ["path", {"d": "M9,0 20,0 20,20 9,20 6,10 z", "class": "s7"}], + ["path", {"d": "M3,0 0,0 0,20 3,20 6,10 z", "class": "s10"}], + ["path", {"d": "m0,0 3,0 6,20 11,0", "class": "s1"}], + ["path", {"d": "M0,20 3,20 9,0 20,0", "class": "s1"}]], + ["g", {"id": "vmv-2-3"}, ["path", {"d": "M9,0 20,0 20,20 9,20 6,10 z", "class": "s8"}], + ["path", {"d": "M3,0 0,0 0,20 3,20 6,10 z", "class": "s7"}], + ["path", {"d": "m0,0 3,0 6,20 11,0", "class": "s1"}], + ["path", {"d": "M0,20 3,20 9,0 20,0", "class": "s1"}]], + ["g", {"id": "vmv-2-4"}, ["path", {"d": "M9,0 20,0 20,20 9,20 6,10 z", "class": "s9"}], + ["path", {"d": "M3,0 0,0 0,20 3,20 6,10 z", "class": "s7"}], + ["path", {"d": "m0,0 3,0 6,20 11,0", "class": "s1"}], + ["path", {"d": "M0,20 3,20 9,0 20,0", "class": "s1"}]], + ["g", {"id": "vmv-2-5"}, ["path", {"d": "M9,0 20,0 20,20 9,20 6,10 z", "class": "s10"}], + ["path", {"d": "M3,0 0,0 0,20 3,20 6,10 z", "class": "s7"}], + ["path", {"d": "m0,0 3,0 6,20 11,0", "class": "s1"}], + ["path", {"d": "M0,20 3,20 9,0 20,0", "class": "s1"}]], + ["g", {"id": "vmv-2-2"}, ["path", {"d": "M9,0 20,0 20,20 9,20 6,10 z", "class": "s7"}], + ["path", {"d": "M3,0 0,0 0,20 3,20 6,10 z", "class": "s7"}], + ["path", {"d": "m0,0 3,0 6,20 11,0", "class": "s1"}], + ["path", {"d": "M0,20 3,20 9,0 20,0", "class": "s1"}]], + ["g", {"id": "arrow0"}, ["path", {"d": "m-12,-3 9,3 -9,3 c 1,-2 1,-4 0,-6 z", "class": "s11"}], + ["path", {"d": "M0,0 -15,0", "class": "s12"}]], ["marker", + {"id": "arrowhead", "style": "fill:#0041c4", + "markerHeight": "7", "markerWidth": "10", + "markerUnits": "strokeWidth", + "viewBox": "0 -4 11 8", "refX": "15", + "refY": "0", "orient": "auto"}, + ["path", {"d": "M0 -4 11 0 0 4z"}]], ["marker", + { + "id": "arrowtail", + "style": "fill:#0041c4", + "markerHeight": "7", + "markerWidth": "10", + "markerUnits": "strokeWidth", + "viewBox": "-11 -4 11 8", + "refX": "-15", + "refY": "0", + "orient": "auto"}, + ["path", + { + "d": "M0 -4 -11 0 0 4z"}]]], + ["g", {"id": "waves"}, ["g", {"id": "lanes"}], ["g", {"id": "groups"}]]]