code: function prepare_command(input_args) {
  
    let command = null;
    const args = Array.prototype.slice.call(input_args);
    const funcOrCommand = args.shift();
  
    if (is(funcOrCommand, Command))
      command = funcOrCommand;
  
    if (is(funcOrCommand, Function))
      command = new Command(funcOrCommand);
  
    if (!command)
      throw new Error(Errors.BadExecuteArgument);
  
    command.arguments = args;
    command.result_file = null;
  
    return command;
  
  }
docs: **************************************************************** HELPER ****************************************************************