@Override
  @Nullable
  public String check(String name, PsiElement psiElement) {
    if (isDefinedInScope(name, psiElement)) {
      return PyPsiBundle.message("refactoring.introduce.variable.scope.error");
    }
    return null;
  }
@Override
  @Nullable
  public String check(String name, PsiElement psiElement)