Shift path fragments from PATH_INFO to SCRIPT_NAME and vice versa.

           :param shift: The number of path fragments to shift. May be negative
                         to change the shift direction. (default: 1)
970103
def path_shift(self, shift=1):
        ''' 
        '''
        script_name = self.environ.get('SCRIPT_NAME','/')
        self['SCRIPT_NAME'], self.path = path_shift(script_name, self.path, shift)
        self['PATH_INFO'] = self.path
1374934
def CopyToPath(self):
    
    number_of_path_segments = len(self._path_segments)
    if number_of_path_segments == 0:
      return None

    strings = [self._path_segments[0]]
    number_of_path_segments -= 1
    for path_segment in self._path_segments[1:]:
      # Remove a trailing \ except for the last path segment.
      if path_segment.endswith('\\') and number_of_path_segments > 1:
        path_segment = path_segment[:-1]

      if ((path_segment.startswith('<') and path_segment.endswith('>')) or
          len(strings) == 1):
        strings.append(' {0:s}'.format(path_segment))
      elif path_segment.startswith('\\'):
        strings.append('{0:s}'.format(path_segment))
      else:
        strings.append('\\{0:s}'.format(path_segment))
      number_of_path_segments -= 1

    return ''.join(strings)
929837
def shift_up_left(self, times=1):
        
        try:
            return Location(self._rank + times, self._file - times)
        except IndexError as e:
            raise IndexError(e)
467068
def safe_lshift(a, b):
    """"""
    if b > MAX_SHIFT:
        raise RuntimeError("Invalid left shift, max left shift is {}".format(MAX_SHIFT))
    return a << b
1261533
def shift_click(self, locator, params=None, timeout=None):
        
        self._click(locator, params, timeout, Keys.SHIFT)
982759
def shift_down_left(self, times=1):
        
        try:
            return Location(self._rank - times, self._file - times)
        except IndexError as e:
            raise IndexError(e)
760630
def pathstrip(path, n):
  
  pathlist = [path]
  while os.path.dirname(pathlist[0]) != b'':
    pathlist[0:1] = os.path.split(pathlist[0])
  return b'/'.join(pathlist[n:])
1047947
protected void shiftRight(int start, int end)
  {
    float prevVal = positions[start];
    long prevCnt = bins[start];

    for (int i = start + 1; i <= end; ++i) {
      float tmpVal = positions[i];
      long tmpCnt = bins[i];

      positions[i] = prevVal;
      bins[i] = prevCnt;

      prevVal = tmpVal;
      prevCnt = tmpCnt;
    }
  }
627728
function (path) {
            var foundPath = self.PathTool.findLibScript(path);
            if (foundPath) {
                self.scriptList.push(foundPath);
            } else {
                self.logger.warn('script:%s not found!', path);
            }
        }
1302174
def tell(self):
        
        if self._shifts:
            t = self._file.tell()
            if t == self._shifts[0]:
                return 0
            elif t == self._shifts[-1]:
                return len(self._shifts) - 1
            elif t in self._shifts:
                return bisect_left(self._shifts, t)
            else:
                return bisect_left(self._shifts, t) - 1
        raise self._implement_error
939594
public static Path leftShift(Path path, InputStream data) throws IOException {
        append(path, data);
        return path;
    }
1075884
protected void shiftDown(int shift) {

        int max = getMaximumVerticalScrollPosition();
        if ((m_currentValue + shift) < max) {
            setVerticalScrollPosition(m_currentValue + shift);
        } else {
            setVerticalScrollPosition(max);
        }
    }
843790
def shift(self, direction):
        
        try:
            if direction == Direction.UP:
                return self.shift_up()
            elif direction == Direction.DOWN:
                return self.shift_down()
            elif direction == Direction.RIGHT:
                return self.shift_right()
            elif direction == Direction.LEFT:
                return self.shift_left()
            else:
                raise IndexError("Invalid direction {}".format(direction))
        except IndexError as e:
            raise IndexError(e)
398631
def writeShiftFile(self, filename="shifts.txt"):
        
        lines = ['# frame: ', self['frame'], '\n',
                 '# refimage: ', self['refimage'], '\n',
                 '# form: ', self['form'], '\n',
                 '# units: ', self['units'], '\n']

        for o in self['order']:
            ss = " "
            for shift in self[o]:
                ss += str(shift) + " "
            line = str(o) + ss + "\n"
            lines.append(line)

        fshifts= open(filename, 'w')
        fshifts.writelines(lines)
        fshifts.close()
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]
649726
protected void shiftLeft(int start, int end)
  {
    for (int i = start; i < end; ++i) {
      positions[i] = positions[i + 1];
      bins[i] = bins[i + 1];
    }
  }
1117810
def move(self, path, destination):
        
        args = {
            'path': path,
            'destination': destination,
        }

        return self._client.json('filesystem.move', args)