@Override
  public boolean isAvailable(@NotNull Project project, Editor editor, PsiFile file) {
    if (!(file instanceof PyFile)) {
      return false;
    }

    IntentionState state = IntentionState.fromContext(editor, file);
    setText(state.getText());
    return state.isAvailable();
  }
@Override
  public boolean isAvailable(@NotNull Project project, Editor editor, PsiFile file)