def __init__(self, package, version):
        """Construct a new requirement.

        :param package: the package name.
        :param version: a semver compatible version specification.
        """
        self.package = package
        self.version = version
        if self.version and not re.match(r"[<=>~]", version[:2]):
            self.version = "=={}".format(self.version)
def dec_r(self, ind):
        r, c = self.row_col(ind)
        r -= 1
        if r < 0:
            r = self.nr - 1
        if r == (self.nr - 1) and c == (self.nc - 1):
            r = self.nr - 2
        return self.indx(r, c)