Swaps time and batch axis (the first two axis).
19232
def swap_time_and_batch_axes(inputs):
  """"""
  transposed_axes = tf.concat([[1, 0], tf.range(2, tf.rank(inputs))], axis=0)
  return tf.transpose(inputs, transposed_axes)
444663
private void swap(int i, int j) {
        int t = pq[i];
        pq[i] = pq[j];
        pq[j] = t;
        qp[pq[i]] = i;
        qp[pq[j]] = j;
    }
769691
def shift_down(self, times=1):
        
        try:
            return Location(self._rank - times, self._file)
        except IndexError as e:
            raise IndexError(e)
1088944
private static <T> void swapReferences( T[] arr, int idx1, int idx2 )
    {
        T tmp = arr[idx1];
        arr[idx1] = arr[idx2];
        arr[idx2] = tmp;
    }
458481
def change_axis(self, axis_num, channel_name):
        
        current_channels = list(self.current_channels)
        if len(current_channels) == 1:
            if axis_num == 0:
                new_channels = channel_name,
            else:
                new_channels = current_channels[0], channel_name
        else:
            new_channels = list(current_channels)
            new_channels[axis_num] = channel_name

        self.set_axes(new_channels, self.ax)
593852
void switchTwoRows(int rowIndex, int rowToIndex) {
        checkForInit();
        int cellData = mRowHeights[rowToIndex];
        mRowHeights[rowToIndex] = mRowHeights[rowIndex];
        mRowHeights[rowIndex] = cellData;
    }
358650
def swapaxes(self, axis1, axis2, copy=True):
        
        i = self._get_axis_number(axis1)
        j = self._get_axis_number(axis2)

        if i == j:
            if copy:
                return self.copy()
            return self

        mapping = {i: j, j: i}

        new_axes = (self._get_axis(mapping.get(k, k))
                    for k in range(self._AXIS_LEN))
        new_values = self.values.swapaxes(i, j)
        if copy:
            new_values = new_values.copy()

        return self._constructor(new_values, *new_axes).__finalize__(self)
386445
function(){
      if (this._cellset) this._cellset.reset();
      if (this._axes) {
        var i, n, axis;
        for (i = 0, n = this.axisCount(); i < n; i++){
            this.getAxis(i).reset();
        }
      }
    }
76315
function _swapWorkingSetListIndexes(paneId, index1, index2) {
        var pane = _getPane(paneId);

        pane.swapViewListIndexes(index1, index2);
        exports.trigger("workingSetSort", pane.id);
        exports.trigger("_workingSetDisableAutoSort", pane.id);
    }
262135
def swap_across(idx, idy, mat_a, mat_r, perm):
    """"""
    # Temporary permutation matrix for swaping 2 rows or columns.
    size = mat_a.shape[0]
    perm_new = numpy.eye(size, dtype=int)

    # Modify the permutation matrix perm by swaping columns.
    perm_row = 1.0*perm[:, idx]
    perm[:, idx] = perm[:, idy]
    perm[:, idy] = perm_row

    # Modify the permutation matrix p by swaping rows (same as
    # columns because p = pT).
    row_p = 1.0 * perm_new[idx]
    perm_new[idx] = perm_new[idy]
    perm_new[idy] = row_p

    # Permute mat_a and r (p = pT).
    mat_a = numpy.dot(perm_new, numpy.dot(mat_a, perm_new))
    mat_r = numpy.dot(mat_r, perm_new)
    return mat_a, mat_r, perm
1042319
def swap(a, b)
      temp = at(a)
      put a, at(b)
      put b, temp
    end
347546
def swapaxes(vari, ax1, ax2):
    """"""
    if isinstance(vari, Poly):
        core = vari.A.copy()
        for key in vari.keys:
            core[key] = swapaxes(core[key], ax1, ax2)

        return Poly(core, vari.dim, None, vari.dtype)

    return numpy.swapaxes(vari, ax1, ax2)
437442
def ipix_swap_axes(self, ipix, colwise=False):
        
        xy = self.ipix_to_xypix(ipix, colwise)
        return self.xypix_to_ipix(xy, not colwise)
1034671
public static void swap(long[] longArray, int index1, int index2) {
        XORSwap.swap(longArray, index1, longArray, index2);
    }
412977
void switchTwoColumns(int columnIndex, int columnToIndex) {
        for (int i = 0; i < getRowCount() - 1; i++) {
            Object cellData = getItems()[i][columnToIndex];
            getItems()[i][columnToIndex] = getItems()[i][columnIndex];
            getItems()[i][columnIndex] = cellData;
        }
    }
301981
def pt_change_axis(pt=(0.0, 0.0), flip=[False, False], offset=[0.0, 0.0]):
    '''
    '''
    assert isinstance(pt, tuple)
    l_pt = len(pt)
    assert l_pt > 1
    for i in pt:
        assert isinstance(i, float)
    assert isinstance(flip, list)
    l_fl = len(flip)
    assert l_fl == l_pt
    for i in flip:
        assert isinstance(i, bool)
    assert isinstance(offset, list)
    l_of = len(offset)
    assert l_of == l_pt
    for i in offset:
        assert isinstance(i, float)

    # Convert True/False to -1/1
    flip_mul = [-2 * int(f) + 1 for f in flip]

    return tuple([offset[i] + pt[i]*flip_mul[i] for i in range(l_pt)])
1038427
public static void swap(byte[] byteArray, int index1, int index2) {
        TrivialSwap.swap(byteArray, index1, byteArray, index2);
    }