<commit_before>package com.jetbrains.python.sdk;

import com.intellij.execution.configurations.GeneralCommandLine;

import java.io.File;
import java.util.Collection;
import java.util.Collections;

/**
 * @author yole
 */
public class IronPythonSdkFlavor extends PythonSdkFlavor {
  private IronPythonSdkFlavor() {
  }

  public static IronPythonSdkFlavor INSTANCE = new IronPythonSdkFlavor();

  @Override
  public boolean isValidSdkHome(String path) {
    final String name = new File(path).getName();
    return name.equals("ipy.exe") || name.equals("ipy64.exe");
  }

  @Override
  public String getVersionString(String sdkHome) {
    return "IronPython " + getVersionFromOutput(sdkHome, "-V", "\\w+ ([0-9\\.]+).*", true);
  }

  @Override
  public Collection<String> getExtraDebugOptions() {
    return Collections.singletonList("-X:Frames");
  }

  @Override
  public void addToPythonPath(GeneralCommandLine cmd, String path) {
    addToEnv(cmd, path, "IRONPYTHONPATH");
  }
}<commit_msg>suggest interpreter home paths for IronPython<commit_after>package com.jetbrains.python.sdk;

import com.intellij.execution.configurations.GeneralCommandLine;

import java.io.File;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;

/**
 * @author yole
 */
public class IronPythonSdkFlavor extends PythonSdkFlavor {
  private IronPythonSdkFlavor() {
  }

  public static IronPythonSdkFlavor INSTANCE = new IronPythonSdkFlavor();

  @Override
  public List<String> suggestHomePaths() {
    List<String> result = new ArrayList<String>();
    String root = System.getenv("ProgramFiles(x86)");
    if (root == null) {
      root = System.getenv("ProgramFiles");
    }
    if (root != null) {
      final File[] dirs = new File(root).listFiles();
      for (File dir : dirs) {
        if (dir.getName().startsWith("IronPython")) {
          File ipy = new File(dir, "ipy.exe");
          if (ipy.exists()) {
            result.add(ipy.getPath());
          }
        }
      }
    }
    return result;
  }

  @Override
  public boolean isValidSdkHome(String path) {
    final String name = new File(path).getName();
    return name.equals("ipy.exe") || name.equals("ipy64.exe");
  }

  @Override
  public String getVersionString(String sdkHome) {
    return "IronPython " + getVersionFromOutput(sdkHome, "-V", "\\w+ ([0-9\\.]+).*", true);
  }

  @Override
  public Collection<String> getExtraDebugOptions() {
    return Collections.singletonList("-X:Frames");
  }

  @Override
  public void addToPythonPath(GeneralCommandLine cmd, String path) {
    addToEnv(cmd, path, "IRONPYTHONPATH");
  }
}
{'fraction_non_alphanumeric': 0.13252555850056796, 'fraction_numerical': 0.003786444528587656, 'mean_word_length': 3.8036363636363637, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 8, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7658378', 'n_tokens_mistral': 878, 'n_tokens_neox': 832, 'n_words': 181}