Returns the inverse bijection.
166792
def inverse(self):
        """"""
        result = self.__class__()
        result.forward = copy.copy(self.reverse)
        result.reverse = copy.copy(self.forward)
        return result
881830
def fast_inverse(M):
    
    diags = M.diagonal()
    new_diag = []
    for value in diags:
        new_diag.append(1.0/value)

    return sparse.diags([new_diag], [0])
778140
def inverse(d):
    
    output = {}
    for k, v in unwrap(d).items():
        output[v] = output.get(v, [])
        output[v].append(k)
    return output
1018201
def inverse(self):
        """"""
        sign = '+' if self.sign == '-' else '-'
        return DiscreteFourierTransformInverse(
            domain=self.range, range=self.domain, axes=self.axes,
            halfcomplex=self.halfcomplex, sign=sign)
1253562
def invert(self):
        
        keys = self._clean.keys()
        inverted = {}
        for key in keys:
            inverted[self.obj[key]] = key

        return self._wrap(inverted)
643290
def retrieve(cls, *args, **kwargs):
        """"""
        return super(Reversal, cls).retrieve(*args, **kwargs)
840801
def invertDictMapping(d):
    
    inv_map = {}
    for k, v in d.items():
        inv_map[v] = inv_map.get(v, [])
        inv_map[v].append(k)
    return inv_map
1008022
def inverse(x, operator)
      if x.num?
        x = x.to_numeric
        if operator == :+
          _(- x)
        else
          _(Rational(1, x))
        end
      elsif x.is_a?(Inverse) && x.operator == operator
        x.x
      else
        Inverse.new(x, operator)
      end
    end
173541
def invert_dict(invertible_dict):
    """"""
    inverted = {}
    for k, v in six.iteritems(invertible_dict):
        if not isinstance(v, Hashable):
            raise TypeError(u'Expected an invertible dict, but value at key {} has type {}'.format(
                k, type(v).__name__))
        if v in inverted:
            raise TypeError(u'Expected an invertible dict, but keys '
                            u'{} and {} map to the same value'.format(
                                inverted[v], k))
        inverted[v] = k
    return inverted
1076755
def inverse(self):
        
        inverses = []
        for segment in self:
            if len(segment) < 2:
                inverses.append([])
            else:
                inverses.append(segment.inverse())
        return inverses
393543
def inverse(self):
        """"""
        sign = '-' if self.sign == '+' else '+'
        return DiscreteFourierTransform(
            domain=self.range, range=self.domain, axes=self.axes,
            halfcomplex=self.halfcomplex, sign=sign)
1162301
public InvertibleMatrix inverse() throws MatrixException
    {
        InvertibleMatrix inverse  = new InvertibleMatrix(nRows);
        IdentityMatrix   identity = new IdentityMatrix(nRows);

        // Compute each column of the inverse matrix
        // using columns of the identity matrix.
        for (int c = 0; c < nCols; ++c) {
            ColumnVector col = solve(identity.getColumn(c), true);
            inverse.setColumn(col, c);
        }

        return inverse;
    }
1251297
def inverse(self, N):
        
        if N == 0:
            return 0
        lm, hm = 1, 0
        low, high = N % self.P, self.P
        while low > 1:
            r = high//low
            nm, new = hm - lm * r, high - low * r
            lm, low, hm, high = nm, new, lm, low

        return lm % self.P
324352
function inverseMod_(x, n) {
  var k=1+2*Math.max(x.length, n.length);

  if (!(x[0]&1)  && !(n[0]&1)) {  //if both inputs are even, then inverse doesn't exist
    copyInt_(x, 0);
    return 0;
  }

  if (eg_u.length!=k) {
    eg_u=new Array(k);
    eg_v=new Array(k);
    eg_A=new Array(k);
    eg_B=new Array(k);
    eg_C=new Array(k);
    eg_D=new Array(k);
  }

  copy_(eg_u, x);
  copy_(eg_v, n);
  copyInt_(eg_A, 1);
  copyInt_(eg_B, 0);
  copyInt_(eg_C, 0);
  copyInt_(eg_D, 1);
  for (;;) {
    while (!(eg_u[0]&1)) {  //while eg_u is even
      halve_(eg_u);
      if (!(eg_A[0]&1) && !(eg_B[0]&1)) { //if eg_A==eg_B==0 mod 2
        halve_(eg_A);
        halve_(eg_B);
      } else {
        add_(eg_A, n);  halve_(eg_A);
        sub_(eg_B, x);  halve_(eg_B);
      }
    }

    while (!(eg_v[0]&1)) {  //while eg_v is even
      halve_(eg_v);
      if (!(eg_C[0]&1) && !(eg_D[0]&1)) { //if eg_C==eg_D==0 mod 2
        halve_(eg_C);
        halve_(eg_D);
      } else {
        add_(eg_C, n);  halve_(eg_C);
        sub_(eg_D, x);  halve_(eg_D);
      }
    }

    if (!greater(eg_v, eg_u)) { //eg_v <= eg_u
      sub_(eg_u, eg_v);
      sub_(eg_A, eg_C);
      sub_(eg_B, eg_D);
    } else {                   //eg_v > eg_u
      sub_(eg_v, eg_u);
      sub_(eg_C, eg_A);
      sub_(eg_D, eg_B);
    }

    if (equalsInt(eg_u, 0)) {
      while (negative(eg_C)) //make sure answer is nonnegative
        add_(eg_C, n);
      copy_(x, eg_C);

      if (!equalsInt(eg_v, 1)) { //if GCD_(x,n)!=1, then there is no inverse
        copyInt_(x, 0);
        return 0;
      }
      return 1;
    }
  }
}
530378
def inverse_transform(self, y, lengths=None):
        
        y = np.argmax(y, -1)
        inverse_y = [self._label_vocab.id2doc(ids) for ids in y]
        if lengths is not None:
            inverse_y = [iy[:l] for iy, l in zip(inverse_y, lengths)]

        return inverse_y
834516
def MatrixInverse(a, adj):
    
    return np.linalg.inv(a if not adj else _adjoint(a)),
1017934
public function inverse() {
        $determinant = $this->determinant();
        if ($determinant == 0) { // If 0, there is no inverse.
            return;
        }

        $adj = $this->getAdjoinMatrix();
        for ($i=0; $i<static::ROWS; $i++) {
            $sign = ($i%2 === 1) ? -1 : 1;
            for ($j=0; $j<static::COLUMNS; $j++) {
                $adj[$i][$j] = $sign * $adj[$i][$j];
                $sign        = -$sign;
            }
        }

        $this->copy($adj);
        $this->transpose();
        $div = 1 / $determinant;
        $this->mul($div);
    }