Perform the pad operation itself and returns the result
420394
private String performPadOperation(String source, Integer length, Character padChar, String direction) {
        if (direction.equals("Start")) {
            return Strings.padStart(source, length, padChar);
        } else {
            return Strings.padEnd(source, length, padChar);
        }
    }
1197159
function(array, n, pad) {
      var p = function(array) {
        if (array == null) return [];

        var part = _.take(array, n);

        if (n === _.size(part)) {
          return _.cons(part, p(_.drop(array, n)));
        }
        else {
          return pad ? [_.take(_.cat(part, pad), n)] : [];
        }
      };

      return p(array);
    }
299045
def find_pad_index(self, array):
        
        try:
            return list(array).index(self.pad_value)
        except ValueError:
            return len(array)
1106271
def _pad(X):
    
    p_above = int(np.floor(np.log2(X.shape[1])))
    M = 2 ** (p_above + 1) - X.shape[1]
    X = np.hstack((np.zeros((X.shape[0], M)), X))

    return X, M
1241340
def setPadding(self, pad):
		""""""
		_baseDes.setPadding(self, pad)
		for key in (self.__key1, self.__key2, self.__key3):
			key.setPadding(pad)
705772
def mkpad(items):
    '''
    
    '''
    pad = 0
    stritems = [str(e) for e in items]  # cast list to strings
    for e in stritems:
        index = stritems.index(e)
        if len(stritems[index]) > pad:
            pad = len(stritems[index])
    pad += 2
    return pad
1263590
def run(self):
        
        # Set a stream to replace stdout, and get results in it
        stdoutBak = sys.stdout
        streamResult = StringIO()
        sys.stdout = streamResult
        try:
            pycodestyle.Checker.check_all(self)
        finally:
            sys.stdout = stdoutBak
867186
def _pad_series(ts, pad, start, end):
    
    span = ts.span
    pada = max(int((span[0] - start) * ts.sample_rate.value), 0)
    padb = max(int((end - span[1]) * ts.sample_rate.value), 0)
    if pada or padb:
        return ts.pad((pada, padb), mode='constant', constant_values=(pad,))
    return ts
1117381
def padRect(rect, padTop, padBottom, padLeft, padRight, bounds, clipExcess = True):
	
	
	# Unpack the rectangle
	x, y, w, h = rect
	
	# Pad by the specified value
	x -= padLeft
	y -= padTop
	w += (padLeft + padRight)
	h += (padTop + padBottom)
	
	# Determine if we are clipping overflows/underflows or
	# shifting the centre of the rectangle to compensate
	if clipExcess == True:
		
		# Clip any underflows
		x = max(0, x)
		y = max(0, y)
		
		# Clip any overflows
		overflowY = max(0, (y + h) - bounds[0])
		overflowX = max(0, (x + w) - bounds[1])
		h -= overflowY
		w -= overflowX
		
	else:
		
		# Compensate for any underflows
		underflowX = max(0, 0 - x)
		underflowY = max(0, 0 - y)
		x += underflowX
		y += underflowY
		
		# Compensate for any overflows
		overflowY = max(0, (y + h) - bounds[0])
		overflowX = max(0, (x + w) - bounds[1])
		x -= overflowX
		w += overflowX
		y -= overflowY
		h += overflowY
		
		# If there are still overflows or underflows after our
		# modifications, we have no choice but to clip them
		x, y, w, h = padRect((x,y,w,h), 0, 0, 0, 0, bounds, True)
	
	# Re-pack the padded rect
	return (x,y,w,h)
869645
function(str, len, padChar) {
    str = stringIt(str);
    if (str.length >= len) {
      return str;
    }
    var padStr = getPadding(padChar, len);
    return str + padStr.substr(str.length - len);
  }
351429
def _pad(string, size):
    
    strlen = len(string)
    if strlen == size:
        return string
    if strlen < size:
        return _padding[0:size-strlen] + string
    return string[-size:]
51679
def record_result(self, res, prg=''):
        
        self._log(self.logFileResult , force_to_string(res), prg)
472000
def Pad(self, n):
        """"""
        for i in range_func(n):
            self.Place(0, N.Uint8Flags)
1358566
public static function padFilter($input, $pad_length, $pad_string = ' ', $pad_type = STR_PAD_RIGHT)
    {
        return str_pad($input, (int)$pad_length, $pad_string, $pad_type);
    }
1131158
function pad(str, width) {
  var len = Math.max(0, width - str.length);
  return str + Array(len + 1).join(' ');
}
969313
function pad(text, length, align = 'left') {
  let pad = ' '.repeat(length - stringWidth(text));
  if (align === 'right') {
    return pad + text;
  }

  return text + pad;
}
746221
function pad(number, size) {
        var stringNum = String(number);

        while (stringNum.length < (size || 2)) {
            stringNum = '0' + stringNum;
        }

        return stringNum;
    }