>>> invert_shift("a")
    'A'
    >>> invert_shift("A")
    'a'

    >>> invert_shift("123 foo 456 BAR #!")
    '123 FOO 456 bar #!'
16093
def invert_shift(chars):
    
    result = ""
    for char in chars:
        if char in string.ascii_lowercase:
#             log.critical("auto shift lowercase char %s to UPPERCASE", repr(char))
            char = char.upper()
        elif char in string.ascii_uppercase:
#             log.critical("auto shift UPPERCASE char %s to lowercase", repr(char))
            char = char.lower()
        result += char
    return result
1047469
function bs__translate(number, withoutSuffix, key) {
        var result = number + ' ';
        switch (key) {
        case 'm':
            return withoutSuffix ? 'jedna minuta' : 'jedne minute';
        case 'mm':
            if (number === 1) {
                result += 'minuta';
            } else if (number === 2 || number === 3 || number === 4) {
                result += 'minute';
            } else {
                result += 'minuta';
            }
            return result;
        case 'h':
            return withoutSuffix ? 'jedan sat' : 'jednog sata';
        case 'hh':
            if (number === 1) {
                result += 'sat';
            } else if (number === 2 || number === 3 || number === 4) {
                result += 'sata';
            } else {
                result += 'sati';
            }
            return result;
        case 'dd':
            if (number === 1) {
                result += 'dan';
            } else {
                result += 'dana';
            }
            return result;
        case 'MM':
            if (number === 1) {
                result += 'mjesec';
            } else if (number === 2 || number === 3 || number === 4) {
                result += 'mjeseca';
            } else {
                result += 'mjeseci';
            }
            return result;
        case 'yy':
            if (number === 1) {
                result += 'godina';
            } else if (number === 2 || number === 3 || number === 4) {
                result += 'godine';
            } else {
                result += 'godina';
            }
            return result;
        }
    }
544775
def _shift(tokens):
    """"""
    after = tokens.peek(n=1, skip=_is_comment, drop=True)
    tok = tokens._buffer.popleft()
    return tok[0], tok[1], tok[2], after[0]
1191034
def shift_output_offsets(delta)
      return if delta == 0
      @data.each do |m|
        break if m.output.start_pos.line > 1
        m.output.start_pos.offset += delta
        m.output.end_pos.offset += delta if m.output.end_pos.line > 1
      end
    end
724998
def invert
      build(precision: precision, deg: (deg + 180) % 360, suffix: SUFFIX_INVERSIONS.fetch(suffix, suffix))
    end
632092
function _rshift($shift)
    {
        if ($shift == 0) {
            return;
        }

        $num_digits = (int) ($shift / MATH_BIGINTEGER_BASE);
        $shift %= MATH_BIGINTEGER_BASE;
        $carry_shift = MATH_BIGINTEGER_BASE - $shift;
        $carry_mask = (1 << $shift) - 1;

        if ($num_digits) {
            $this->value = array_slice($this->value, $num_digits);
        }

        $carry = 0;

        for ($i = count($this->value) - 1; $i >= 0; --$i) {
            $temp = $this->value[$i] >> $shift | $carry;
            $carry = ($this->value[$i] & $carry_mask) << $carry_shift;
            $this->value[$i] = $temp;
        }

        $this->value = $this->_trim($this->value);
    }
329874
def encode_int(self, n):
        
        str = []
        while True:
            n, r = divmod(n, self.BASE)
            str.append(self.ALPHABET[r])
            if n == 0: break
        return ''.join(reversed(str))
302468
def base26int(s, _start=1 - ord('A')):
    
    return sum((_start + ord(c)) * 26**i for i, c in enumerate(reversed(s)))
1176351
def invert(self, src=None):
        
        if src is None:
            dst = TOOLS._invert_matrix(self)
        else:
            dst = TOOLS._invert_matrix(src)
        if dst[0] == 1:
            return 1
        self.a, self.b, self.c, self.d, self.e, self.f = dst[1]
        return 0
410770
public static function shift(string &$str, string $encoding = null)
    {
        $encoding = $encoding ?: mb_internal_encoding();

        $first = mb_substr($str, 0, 1, $encoding);
        $str = mb_substr($str, 1, null, $encoding);

        return $first;
    }
671127
def _shift_or_mirror_into_invertible_i(self, x, i):
        
        assert x is not None
        lb = self._lb[self._index(i)]
        ub = self._ub[self._index(i)]
        al = self._al[self._index(i)]
        au = self._au[self._index(i)]
        # x is far from the boundary, compared to ub - lb
        if x < lb - 2 * al - (ub - lb) / 2.0 or x > ub + 2 * au + (ub - lb) / 2.0:
            r = 2 * (ub - lb + al + au)  # period
            s = lb - 2 * al - (ub - lb) / 2.0  # start
            x -= r * ((x - s) // r)  # shift
        if x > ub + au:
            x -= 2 * (x - ub - au)
        if x < lb - al:
            x += 2 * (lb - al - x)
        return x
960581
protected function shift($char, $shift)
    {
        $shift = $shift % 25;
        $ascii = ord($char);
        $shifted = $ascii + $shift;

        if ($ascii >= 65 && $ascii <= 90) {
            return chr($this->wrapUppercase($shifted));
        }

        if ($ascii >= 97 && $ascii <= 122) {
            return chr($this->wrapLowercase($shifted));
        }

        return chr($ascii);
    }
841957
function shift(unshifted) {
    var i, length, shifted = [];
    for (i = 1, length = unshifted.length; i < length; i += 1) {
        shifted[i - 1] = unshifted[i];
    }
    return shifted;
}
521441
function(a,b) {
		var tA, tB, i;
		for (i=0; i<a.length; ++i) {
			tA = typeof a[i]; tB = typeof b[i];
			if (tA === tB) {
				if ((tA === 'number') || (tA === 'string') || (tA === 'boolean')) {
					if (a[i] < b[i]) return -1;
					if (a[i] > b[i]) return 1;
					if (a[i] !== b[i]) return 1;
				  /*if (a[i] == b[i]) continue;*/
				} else {
					if (a[i] === b[i]) continue;
					return 1;
				}
			} else {
				return 1;
			}
		}
		return 0;
	}
718018
def ucharenc(a, i, u)
    if u <= Uchar1max
      a[i] = (u & 0xff).chr
      1
    elsif u <= Uchar2max
      a[i+0] = (Utag2 | ((u>>6)&0xff)).chr
      a[i+1] = (Utagx | (u&Umaskx)).chr
      2
    elsif u <= Uchar3max
      a[i+0] = (Utag3 | ((u>>12)&0xff)).chr
      a[i+1] = (Utagx | ((u>>6)&Umaskx)).chr
      a[i+2] = (Utagx | (u&Umaskx)).chr
      3
    else
      a[i+0] = (Utag4 | ((u>>18)&0xff)).chr
      a[i+1] = (Utagx | ((u>>12)&Umaskx)).chr
      a[i+2] = (Utagx | ((u>>6)&Umaskx)).chr
      a[i+3] = (Utagx | (u&Umaskx)).chr
      4
    end
  end
672720
def invert(self):
        
        libfn = utils.get_lib_fn('inverseTransform%s' % (self._libsuffix))
        inv_tx_ptr = libfn(self.pointer)

        new_tx = ANTsTransform(precision=self.precision, dimension=self.dimension,
                                transform_type=self.transform_type, pointer=inv_tx_ptr)

        return new_tx
206651
function (a, shift, carry, out) {
    var i, last2=0, shift2;
    if (out === undefined) { out = []; }

    for (; shift >= 32; shift -= 32) {
      out.push(carry);
      carry = 0;
    }
    if (shift === 0) {
      return out.concat(a);
    }

    for (i=0; i<a.length; i++) {
      out.push(carry | a[i]>>>shift);
      carry = a[i] << (32-shift);
    }
    last2 = a.length ? a[a.length-1] : 0;
    shift2 = sjcl.bitArray.getPartial(last2);
    out.push(sjcl.bitArray.partial(shift+shift2 & 31, (shift + shift2 > 32) ? carry : out.pop(),1));
    return out;
  }