Swap the values at indices i & j.

		.. versionadded:: 1.1
515128
def swap(self, i, j):
		
		i = self._fix_neg_index(i)
		j = self._fix_neg_index(j)
		self._list[i], self._list[j] = self._list[j], self._list[i]
		self._dict[self._list[i]] = i
		self._dict[self._list[j]] = j
318685
public static void swapPivot(double[][] source, int diag, double[][] s, double[][] t) {
		// get swap row and col
		int swapRow = diag;
		int swapCol = diag;
		double maxValue = Math.abs(source[diag][diag]);
		int rows = source.length;
		int cols = source[0].length;
		double abs = 0;
		double[] r = null;
		for (int row = diag; row < rows; row++) {
			r = source[row];
			for (int col = diag; col < cols; col++) {
				abs = Math.abs(r[col]);
				if (abs > maxValue) {
					maxValue = abs;
					swapRow = row;
					swapCol = col;
				}
			}
		}

		// swap rows and columns
		if (swapRow != diag) {
			swapRows(source, swapRow, diag);
			swapRows(t, swapRow, diag);
		}
		if (swapCol != diag) {
			swapCols(source, swapCol, diag);
			swapCols(s, swapCol, diag);
		}
	}
301788
def swap(self):
        """"""
        self.xmin, self.ymin = self.ymin, self.xmin
        self.xmax, self.ymax = self.ymax, self.xmax
1315942
private static void swap(byte[] array, int i, int j) {
        if (i != j) { 
            byte valAtI = array[i];
            array[i] = array[j];
            array[j] = valAtI;
            numSwaps++;
        }
    }
669288
public static void swap(int[] x, int i, int j) {
        int s = x[i];
        x[i] = x[j];
        x[j] = s;
    }
970269
public void swapRows(int i, int j) {
        if (i != j) {
            Vector ii = getRow(i);
            Vector jj = getRow(j);

            setRow(i, jj);
            setRow(j, ii);
        }
    }
163202
function swap(sArray, location) {
	location = location % sArray.length;
	var ref = [ sArray[location] , sArray[0] ];
	sArray[0] = ref[0];
	sArray[location] = ref[1];
	return sArray;
}
718046
function swapValuesInArray (A, i, j) {
  if (i !== j) {
    const tmp = A[i];
    A[i] = A[j];
    A[j] = tmp;
  }
  return A;
}
466824
def swapWH(self):
        
        width = self.width
        self.width = self.height
        self.height = width
1365270
private void permutePivot(IntIntPair pos1, IntIntPair pos2) {
    int r1 = pos1.first;
    int c1 = pos1.second;
    int r2 = pos2.first;
    int c2 = pos2.second;
    int index;
    index = row[r2];
    row[r2] = row[r1];
    row[r1] = index;
    index = col[c2];
    col[c2] = col[c1];
    col[c1] = index;
  }
749833
function swapVariables (configFile) {
  function readAndSwap (obj) {
    let altered = false
    do {
      let temp = transform(obj, obj)
      obj = temp.result
      altered = temp.changed
    } while (altered)
    return obj
  }
  function substitute (file, p) {
    let success = false
    let replaced = p.replace(/\${([\w.-]+)}/g, function (match, term) {
      if (!success) {
        success = _.has(file, term)
      }
      return _.get(file, term) || match
    })
    return {
      success: success,
      replace: replaced
    }
  }
  function transform (file, obj) {
    let changed = false
    let resultant = _.mapValues(obj, function (p) {
      if (_.isPlainObject(p)) {
        let transformed = transform(file, p)
        if (!changed && transformed.changed) {
          changed = true
        }
        return transformed.result
      }
      if (_.isString(p)) {
        let subbed = substitute(file, p)
        if (!changed && subbed.success) {
          changed = true
        }
        return subbed.replace
      }
      if (_.isArray(p)) {
        for (let i = 0; i < p.length; i++) {
          if (_.isString(p[i])) {
            p[i] = substitute(file, p[i]).replace
          }
        }
      }
      return p
    })
    return {
      changed: changed,
      result: resultant
    }
  }
  let file = options.multiFile ? _.mapValues(configFile, readAndSwap) : configFile
  file = _.merge({},
    file || {},
    file[environments.environmentType] || {}, {
      envId: environments.envId,
      ENVID: environments.ENVID,
      timestamp: timestamp,
      args
    })
  file = readAndSwap(file)
  return file
}
264280
function swap(bytes, offset, index) {
  offset--;
  for(let x = 0; x < offset; x++) {
    /** @type {*} */
    let theByte = bytes[index + x];
    bytes[index + x] = bytes[index + offset];
    bytes[index + offset] = theByte;
    offset--;
  }
}
334025
private static void swap(Object[] w, int a, int b) {

        Object t = w[a];

        w[a] = w[b];
        w[b] = t;
    }
504745
private static void swap(final int[] arr, final int a, final int b) {
        final int c = arr[a];
        arr[a] = arr[b];
        arr[b] = c;
    }
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
1122971
def _swaplch(LCH):
    ""
    try: # Numpy array
        L,C,H = np.dsplit(LCH,3)
        return np.dstack((H,C,L))
    except: # Tuple
        L,C,H = LCH
        return H,C,L
619565
public static void swapCol(Matrix A, int j, int k)
    {
        swapCol(A, j, k, 0, A.rows());
    }