Make sure the space is properly set between long command options and short command options
@param  {Integer}       the longest length of the command's options
@param  {Integer}       the character length of the given option
506965
public static function getSpacer($lengthLong,$itemLongLength) {
		$i            = 0;
		$spacer       = " ";
		$spacerLength = $lengthLong - $itemLongLength;
		while ($i < $spacerLength) {
			$spacer .= " ";
			$i++;
		}
		return $spacer;
	}
1035549
function disableBackspaceIntoATable() {
        editor.on('keydown', function (e) {
          if (!isDefaultPrevented(e) && e.keyCode === BACKSPACE) {
            if (selection.isCollapsed() && selection.getRng(true).startOffset === 0) {
              var previousSibling = selection.getNode().previousSibling;
              if (previousSibling && previousSibling.nodeName && previousSibling.nodeName.toLowerCase() === "table") {
                e.preventDefault();
                return false;
              }
            }
          }
        });
      }
760758
function() {
					var ch = exprICode(index);
					// space or tab
					while(ch === 32 || ch === 9 || ch === 10 || ch === 13) {
						ch = exprICode(++index);
					}
				}
761054
function truncate(str, len) {
        // Truncate text to specified length
        if (str.length > len) {
            str = str.substr(0, len);

            // To prevent awkwardly truncating in the middle of a word,
            // attempt to truncate at the end of the last whole word
            var lastSpaceChar = str.lastIndexOf(" ");
            if (lastSpaceChar < len && lastSpaceChar > -1) {
                str = str.substr(0, lastSpaceChar);
            }
            return str;
        }
    }
1073792
function determineKeyValueSpaces(obj, tabSize) {

  let lastDepth = 0;
  let spacesIndex = 0;

  let spaces = [];

    //iterate over all lines
  obj.forEach((line) => {

    if (lastDepth !== line.depth) {
      spacesIndex++;
    }

    //key found
    if (line.key) {

      //value found
      if (line.value) {

        //block line found
        if (line.isBlockLine) {
          line.keyValueSpaces = ' ';
        } else {

          if (!spaces[spacesIndex]) {
            spaces[spacesIndex] = {
              maxKeyLength: 1
            };
          }

          //determine maxKeyLength
          if (spaces[spacesIndex].maxKeyLength < line.key.length) {
            if (spaces[spacesIndex].maxKeyLength < line.key.length) {
              spaces[spacesIndex].maxKeyLength = line.key.length;
            }
          }
        }
      }
    }

    lastDepth = line.depth;
  });

  // reset the counters
  lastDepth = 0;
  spacesIndex = 0;

  //iterate over all lines
  obj.forEach((line) => {
    
    if (lastDepth !== line.depth) {
      spacesIndex++;
    }

    //key found
    if (line.key) {

      //value found
      if (line.value) {

        //block line found
        if (!line.isBlockLine) {
          if(spaces[spacesIndex]){
            let numSpaces = spaces[spacesIndex].maxKeyLength - line.key.length + tabSize;
            line.keyValueSpaces = '';
            for (let i = 0; i < numSpaces; i++) {
              line.keyValueSpaces += ' ';
            }
          }
        }
      }
    }

    lastDepth = line.depth;

  });

  console.log(obj);

  return obj;
}
636574
function (argument) {
                    var it = toPrimitive(argument, false);
                    if (typeof it == 'string' && it.length > 2) {
                        it = TRIM ? it.trim() : $trim(it, 3);
                        var first = it.charCodeAt(0)
                            , third, radix, maxCode;
                        if (first === 43 || first === 45) {
                            third = it.charCodeAt(2);
                            if (third === 88 || third === 120) return NaN; // Number('+0x1') should be NaN, old V8 fix
                        } else if (first === 48) {
                            switch (it.charCodeAt(1)) {
                                case 66: case 98: radix = 2; maxCode = 49; break; // fast equal /^0b[01]+$/i
                                case 79: case 111: radix = 8; maxCode = 55; break; // fast equal /^0o[0-7]+$/i
                                default: return +it;
                            }
                            for (var digits = it.slice(2), i = 0, l = digits.length, code; i < l; i++) {
                                code = digits.charCodeAt(i);
                                // parseInt parses a string to a first unavailable symbol
                                // but ToNumber should return NaN if a string contains unavailable symbols
                                if (code < 48 || code > maxCode) return NaN;
                            } return parseInt(digits, radix);
                        }
                    } return +it;
                }
1372985
function padding (string, span = 2) {
  const spaces = ' '.repeat(span)
  return spaces + string.replace(/\n/g, `\n${spaces}`)
}
592153
function setOptions(command, query) {
  var count, opts;

  command = commands[command];
  if (!command) {
    return;
  }

  opts = {};
  count = Object.keys(query).length;

  [options.common].concat(command.options).some(function someTypes(options) {
    if (!options) {
      return;
    }
    Object.keys(options).some(function someOptions(key) {
      var valid = options[key].valid;

      if (key in query) {
        if (options[key].bool) {
          opts[options[key].name] = !reBool.test(query[key]);
        } else if (!valid || (valid && valid.test(query[key]))) {
          opts[options[key].name] = decodeURIComponent(query[key]);
        }
        count -= 1;
      }

      return count === 0;
    });

    return count === 0;
  });

  return opts;
}
1028794
def change_length(self, parameter, value):
        
        """

        self.preamble.append(UnsafeCommand('setlength',
                                           arguments=[parameter, value]))
50824
function (text, options) {
    "use strict";

    var marginX     = options.marginX !== undefined ? options.marginX : 2;
    var marginY     = options.marginY !== undefined ? options.marginY : 1;
    var margin      = new Array(marginX+1).join(" ");
    var indent      = options.indent !== undefined ? options.indent :  "  ";
    var maxLength   = 0;
    var linesOfText = text.split('\n');

    var pattern = options.pattern || {
      T: "/", B: "/", TR: "//", BR: "//", TL: "//", BL: "//", R: "//", L: "//"
    };

    linesOfText.forEach(function (line) {
      maxLength = Math.max(maxLength, line.length);
    });

    var top    = pattern.TL + new Array(2 * marginX + maxLength + 1).join(pattern.T) + pattern.TR;
    var empty  = pattern.L  + new Array(2 * marginX + maxLength + 1).join(" ")       + pattern.R;
    var bottom = pattern.BL + new Array(2 * marginX + maxLength + 1).join(pattern.B) + pattern.BR;

    linesOfText = linesOfText.map(function (line) {
      while (line.length < maxLength) {
        line += " ";
      }
      return pattern.L + margin + line + margin + pattern.R;
    });

    // vertical margin
    for (var i=0; i<marginY; i++) {
      linesOfText.unshift(empty);
      linesOfText.push(empty);
    }

    // top and bottom lines
    linesOfText.unshift(top);
    linesOfText.push(bottom);

    return linesOfText.map(function (line) {
      return indent + line;
    }).join('\n');
  }
390942
def CheckCommandSpaces(filename, linenumber, clean_lines, errors):
    
    line = clean_lines.lines[linenumber]
    match = ContainsCommand(line)
    if match and len(match.group(2)):
        errors(filename, linenumber, 'whitespace/extra',
                "Extra spaces between '%s' and its ()"%(match.group(1)))
    if match:
        spaces_after_open = len(_RE_COMMAND_START_SPACES.match(line).group(1))
        initial_spaces = GetInitialSpaces(line)
        initial_linenumber = linenumber
        end = None
        while True:
            line = clean_lines.lines[linenumber]
            end = _RE_COMMAND_END_SPACES.search(line)
            if end:
                break
            linenumber += 1
            if linenumber >= len(clean_lines.lines):
                break
        if linenumber == len(clean_lines.lines) and not end:
            errors(filename, initial_linenumber, 'syntax',
                    'Unable to find the end of this command')
        if end:
            spaces_before_end = len(end.group(1))
            initial_spaces = GetInitialSpaces(line)
            if initial_linenumber != linenumber and spaces_before_end >= initial_spaces:
                spaces_before_end -= initial_spaces

            if spaces_after_open != spaces_before_end:
                errors(filename, initial_linenumber, 'whitespace/mismatch',
                        'Mismatching spaces inside () after command')
1044853
def _space_in_headerblock(relative_path, contents, linter_options):
    
    del relative_path
    del linter_options

    check_index = 1

    if len(contents) > 0:
        if _line_is_shebang(contents[0]):
            check_index = 2

    if len(contents) < check_index + 1:
        description = ("""Document cannot have less than {0} lines""").format(check_index + 1)
        return LinterFailure(description, 1, replacement=None)

    candidate = contents[check_index]

    if not _match_space_at_line(candidate):
        description = """The second line must be an empty comment"""
        return LinterFailure(description, check_index + 1,
                             _comment_type_from_line(candidate)[:-1] + "\n" +
                             candidate)
1372089
function CommandArgLength(cmd) {
  this.name = CommandArgLength.name;
  if(arguments.length > 1) {
    cmd = slice.call(arguments, 0).join(' ');
  }
  StoreError.apply(
    this, [null, 'wrong number of arguments for \'%s\' command', cmd]);
}
110102
function Command(args) {
  if (false === (this instanceof Command)) throw new Error('new operator required');
  if (typeof args == 'function') { // shorthand for function command
    args = {type: 'Function', contents: args};
  }
  if (args instanceof Procedure) { // shorthand for Procedure command
    args = {type: 'Procedure', contents: args};
  }
  args = args || {};
  var i;
  var unusedProperties = getInvalidProperties(args,
    ['name', 'description', 'type', 'contents', 'scope', 'timeout', 'theme', 'icon', 'bucket', 'presentationMode','location','images']);
  var errorList = [];
  for (i = 0; i < unusedProperties.length; i++) errorList.push('invalid property: ' + unusedProperties[i]);
  if (errorList.length > 1) throw new Error('error creating Command: multiple errors');
  if (errorList.length) throw new Error('error creating Command: ' + errorList[0]);
  for (i in args) this[i] = args[i];
  this.name = this.name || "a command"; // name is optional
  if ('string' != typeof this.name) throw new Error('name must be string');
  if ('undefined' == typeof this.description) this.description = this.name + ' Command';
  if ('undefined' == typeof this.type) this.type = 'Stub';
  if (!contains(Command.getTypes(), this.type)) throw new Error('Invalid command type: ' + this.type);
  switch (this.type) {
    case 'Stub':
      break;
    case 'Menu':
      if (!(this.contents instanceof Array)) throw new Error('contents must be array of menu items');
      if (!this.contents.length) throw new Error('contents must be array of menu items');
      for (i in this.contents) {
        if (this.contents.hasOwnProperty(i))
          if (typeof this.contents[i] != 'string' && !(this.contents[i] instanceof Command))
            throw new Error('contents must be array of menu items');
      }
      break;
    case 'Presentation':
      if (!(this.contents instanceof Presentation)) throw new Error('contents must be a Presentation');
      this.presentationMode = this.presentationMode || 'View';
      if (!contains(Command.getPresentationModes(), this.presentationMode)) throw new Error('Invalid presentationMode: ' + this.presentationMode);
      //['View', 'Edit', 'List']
      break;
    case 'Function':
      if (typeof this.contents != 'function') throw new Error('contents must be a Function');
      break;
    case 'Procedure':
      if (!(this.contents instanceof Procedure)) throw new Error('contents must be a Procedure');
      break;
    default:
      throw new TypeError();
  }
  if ('undefined' != typeof this.scope)
    if (!((this.scope instanceof Model) || (this.scope instanceof List)))
      throw new Error('optional scope property must be Model or List');
  if ('undefined' != typeof this.timeout)
    if (typeof this.timeout != 'number') throw new Error('timeout must be a Number');
  if ('undefined' != typeof this.timeout)
    if (typeof this.timeout != 'number') throw new Error('timeout must be a Number');
  if ('undefined' != typeof this.theme) {
    if ('string' != typeof this.theme) throw new Error('invalid theme');
    if (!contains(['default', 'primary', 'success', 'info', 'warning', 'danger', 'link'], this.theme))
      throw new Error('invalid theme');
  }
  if ('undefined' != typeof this.icon) {
    if ('string' != typeof this.icon) throw new Error('invalid icon');
    if (!contains(['fa', 'glyphicon'], this.icon.split('-')[0]) || !this.icon.split('-')[1])
      throw new Error('invalid icon');
  }

  // Validations done
  this._eventListeners = [];
}
489962
function truncate(str, maxLength) {
	maxLength = maxLength || 300;

	if (str.length > maxLength) {
		var index = str.indexOf('>');
		str = str.substring(0, index + 1);
	}

	return str;
}
823597
function calculateMaxLength(value) {
                var length = 16;
                if (!angular.isUndefined(value)) {
                    length = Math.floor(value).toString().length;
                }
                if (decimals > 0) {
                    // Add extra length for the decimals plus one for the decimal separator.
                    length += decimals + 1; 
                }
                if (min < 0) {
                    // Add extra length for the - sign.
                    length++;
                }
                return length;
            }
728553
public CommandOption<T> longCommand(String longName) {

		Assert.notNullOrEmptyTrimmed(longName, "Missing long name!");

		longName = StringUtils.trim(longName);
		Assert.isTrue(command.length() <= longName.length(), "Long name can't be shorter than command name!");

		String compare = StringUtils.sanitizeWhitespace(longName);
		Assert.isTrue(longName.equals(compare), "Option long name can not contain whitespace characters!");

		longCommand = longName;
		return this;
	}