reverse the k:v pairs
778140
def inverse(d):
    
    output = {}
    for k, v in unwrap(d).items():
        output[v] = output.get(v, [])
        output[v].append(k)
    return output
67915
def rotate_down(C_in, p):
    """"""
    C = C_in.copy()
    V = ckmutil.ckm.ckm_tree(p["Vus"], p["Vub"], p["Vcb"], p["delta"])
    UdL = V
    ## B conserving operators
    # type dL dL dL dL
    for k in ['VddLL']:
        C[k] = np.einsum('ia,jb,kc,ld,ijkl->abcd',
                         UdL.conj(), UdL, UdL.conj(), UdL,
                         C_in[k])
    # type X X dL dL
    for k in ['V1udLL', 'V8udLL', 'VedLL', 'VnudLL']:
        C[k] = np.einsum('kc,ld,ijkl->ijcd',
                         UdL.conj(), UdL,
                         C_in[k])
    # type dL dL X X
    for k in ['V1ddLR', 'V1duLR', 'V8ddLR', 'V8duLR', 'VdeLR']:
        C[k] = np.einsum('ia,jb,ijkl->abkl',
                         UdL.conj(), UdL,
                         C_in[k])
    # type dL X dL X
    for k in ['S1ddRR', 'S8ddRR']:
        C[k] = np.einsum('ia,kc,ijkl->ajcl',
                         UdL.conj(), UdL.conj(),
                         C_in[k])
    # type X dL X X
    for k in ['V1udduLR', 'V8udduLR']:
        C[k] = np.einsum('jb,ijkl->ibkl',
                         UdL,
                         C_in[k])
    # type X X dL X
    for k in ['VnueduLL', 'SedRR', 'TedRR', 'SnueduRR', 'TnueduRR',
              'S1udRR',  'S8udRR', 'S1udduRR',  'S8udduRR', ]:
        C[k] = np.einsum('kc,ijkl->ijcl',
                         UdL.conj(),
                         C_in[k])
    # type X X X dL
    for k in ['SedRL', ]:
        C[k] = np.einsum('ld,ijkl->ijkd',
                         UdL,
                         C_in[k])
    ## DeltaB=DeltaL=1 operators
    # type dL X X X
    for k in ['SduuLL',  'SduuLR']:
        C[k] = np.einsum('ia,ijkl->ajkl',
                         UdL,
                         C_in[k])
    # type X X dL X
    for k in ['SuudRL', 'SdudRL']:
        C[k] = np.einsum('kc,ijkl->ijcl',
                         UdL,
                         C_in[k])
    # type X dL dL X
    for k in ['SuddLL']:
        C[k] = np.einsum('jb,kc,ijkl->ibcl',
                         UdL, UdL,
                         C_in[k])
    return C
409218
function reverse (arrayLike) {
    var len = _toArrayLength(arrayLike.length);
    var result = Array(len);

    for (var i = 0, ofs = len - 1; i < len; i++) {
        result[i] = arrayLike[ofs - i];
    }

    return result;
}
668030
@Override
    public void backward() {
        Tensor depAdj = depIn.getOutputAdj();
        int n = depAdj.getDims()[1];
        for (int v=0; v<yAdj.varBeliefs.length; v++) {
            if (yAdj.varBeliefs[v] != null) {
                Var var = y.varBeliefs[v].getVars().get(0);
                if (var instanceof LinkVar) {
                    LinkVar link = (LinkVar) var;
                    int p = link.getParent();
                    int c = link.getChild();
                    int pp = EdgeScores.getTensorParent(p, c);
                    assert p < n && c < n;
                    
                    // Add the adjoint of b(e_{p,c} = True).
                    depAdj.add(yAdj.varBeliefs[v].getValue(LinkVar.TRUE), pp, c);
                    // Add the adjoint of b(e_{p,c} = False)
                    depAdj.subtract(yAdj.varBeliefs[v].getValue(LinkVar.FALSE), pp, c);
                }
            }
        }
    }
968974
def _K(self, R):
        """"""
        return self._ns * self._N / R / self._sin_alpha
714420
function normalizeValues(matrix, vals) {
  reverseUnits.reduce((previous, current) => {
    if (!isUndefined(vals[current])) {
      if (previous) {
        convert(matrix, vals, previous, vals, current);
      }
      return current;
    } else {
      return previous;
    }
  }, null);
}
982436
def reverse(array):
    
    l = list(array)
    l.reverse()
    return _n.array(l)
10513
function reverseData(data) {
		data.labels = data.labels.reverse();
		for (var i = 0; i < data.datasets.length; i++) {
			for (var key in data.datasets[i]) {
				if (Array.isArray(data.datasets[i][key])) {
					data.datasets[i][key] = data.datasets[i][key].reverse();
				}
			}
		}
		return data;
	}
821002
def reverseDict(d):
    
    retD = {}
    for k in d:
        retD[d[k]] = k
    return retD
758596
def reversed(self):
        """"""
        newpath = [seg.reversed() for seg in self]
        newpath.reverse()
        return Path(*newpath)
1250338
def rotate_v1(array, k):
    
    array = array[:]
    n = len(array)
    for i in range(k):      # unused variable is not a problem
        temp = array[n - 1]
        for j in range(n-1, 0, -1):
            array[j] = array[j - 1]
        array[0] = temp
    return array
1288571
def cross(v1, v2):
    '''
    '''
    return (
        v1[1] * v2[2] - v1[2] * v2[1],
        v1[2] * v2[0] - v1[0] * v2[2],
        v1[0] * v2[1] - v1[1] * v2[0],
    )
1253547
def _flip_lr(x):
    ""
    #return x.flip(2)
    if isinstance(x, ImagePoints):
        x.flow.flow[...,0] *= -1
        return x
    return tensor(np.ascontiguousarray(np.array(x)[...,::-1]))
1331765
public void inverse(float data[], int rowspan) {
    backtransform(data, rowspan); 
    float norm = normalization();
    for(int i=0; i<nrows; i++){
      for(int j=0; j<ncols; j++){
	data[i*rowspan + 2*j]   *= norm; 
	data[i*rowspan + 2*j+1] *= norm; }}}
499478
def reversed(self):
        """"""
        n_rows = len(self)
        reversed = DirectedAdjacencyMatrix(n_rows, self.dtype)
        for r, row in enumerate(py.prog_iter(self)):
            for c in row:
                reversed[c].append(r)
                
        return reversed
893472
private int reverseIndex(int k) {
    if (reverseIndexMap == null) {
      reverseIndexMap = new int[attributes.getLength()];
      for (int i = 0, len = indexSet.size(); i < len; i++)
        reverseIndexMap[indexSet.get(i)] = i + 1;
    }
    return reverseIndexMap[k] - 1;
  }
35332
public void reverse() {
		for (int i = 0; i < size / 2; i++) {
			T tmp = data[i];
			data[i] = data[size - i - 1];
			data[size - i - 1] = tmp;
		}
	}