src/main/java/org/folio/rest/service/ScriptEngineService.java
private String preprocessScript(String script, String extension) {

    if (extension.equals(ScriptType.PYTHON.getExtension())) {
      // Ensure that 2 leading spaces exist before newlines and that
      // there are no trailing white spaces.
      String processed = script.replace("\r\n", "\n");
      processed = script.replace("\r", "\n");
      processed = script.replace("\n", "\n  ");
      processed.trim();
      return processed;
    }

    return script;
  }
/**
   * Pre-process a script to ensure that it is more friendly for any exceptional
   * language.
   *
   * For example, Python is space/tab conscious, so make the tabs consistent with
   * the two spaces used in the engine.py.
   *
   * @param script    The script to potentially pre-process.
   * @param extension The extension representing the language of the script.
   *
   * @return The pre-processed script.
   */
Pre-process a script to ensure that it is more friendly for any exceptional
language.

For example, Python is space/tab conscious, so make the tabs consistent with
the two spaces used in the engine.py.

@param script    The script to potentially pre-process.
@param extension The extension representing the language of the script.

@return The pre-processed script.
Pre - process a script to ensure that it is more friendly for any exceptional language . For example Python is space / tab conscious so make the tabs consistent with the two spaces used in the engine . py . @param script The script to potentially pre - process . @param extension The extension representing the language of the script . @return The pre - processed script .
private String preprocessScript(String script, String extension) {
    if (extension.equals(ScriptType.PYTHON.getExtension())) {
      String processed = script.replace("\r\n", "\n");
      processed = script.replace("\r", "\n");
      processed = script.replace("\n", "\n  ");
      processed.trim();
      return processed;
    }
    return script;
  }
private String preprocessScript ( String script , String extension ) { if ( extension . equals ( ScriptType . PYTHON . getExtension ( ) ) ) { String processed = script . replace ( "\r\n" , "\n" ) ; processed = script . replace ( "\r" , "\n" ) ; processed = script . replace ( "\n" , "\n  " ) ; processed . trim ( ) ; return processed ; } return script ; }
Pre-process a script to ensure that it is more friendly for any exceptional
 language.
Pre - process a script to ensure that it is more friendly for any exceptional language .
// Ensure that 2 leading spaces exist before newlines and that // there are no trailing white spaces.