private List<String> createInterpreterParametersToPreventPycGenerationInHelpersDir(@NotNull List<String>
                                                                                         existingInterpreterParameters) {
      var sdk = myPyState.getSdk();

      if (sdk == null || PythonSdkUtil.isRemote(sdk)) {
        return Collections.emptyList();
      }

      var pythonVersion = sdk.getVersionString();

      if (pythonVersion == null) {
        return Collections.emptyList();
      }

      var pythonSdkFlavor = PySdkExtKt.getOrCreateAdditionalData(sdk).getFlavor();

      if (!(pythonSdkFlavor instanceof CPythonSdkFlavor)) {
        return Collections.emptyList();
      }

      // Note, that we don't modify the parameters if the options are already set by the user.

      if (existingInterpreterParameters.contains(PYTHON_DONT_WRITE_PYC_FLAG)) {
        return Collections.emptyList();
      }

      if (pythonSdkFlavor.getLanguageLevel(sdk).isOlderThan(LanguageLevel.PYTHON38)) {
        // There is no option for defining a custom directory for .pyc files in Python 3.7 and older, thus disable cache generation entirely.
        return List.of(PYTHON_DONT_WRITE_PYC_FLAG);
      }
      else {
        for (int i = 0; i < existingInterpreterParameters.size(); i++) {
          if (existingInterpreterParameters.get(i).startsWith(PYTHON3_PYCACHE_PREFIX_OPTION)
              && i > 0 && existingInterpreterParameters.get(i - 1).equals("-X")) {
            return Collections.emptyList();
          }
        }
        try {
          return List.of( "-X", PYTHON3_PYCACHE_PREFIX_OPTION + prepareAndGetPycacheDirectory());
        }
        catch (IOException e) {
          return List.of(PYTHON_DONT_WRITE_PYC_FLAG);
        }
      }
    }
private List<String> createInterpreterParametersToPreventPycGenerationInHelpersDir(@NotNull List<String>
                                                                                         existingInterpreterParameters)