@Contract("null -> null; !null -> !null")
  @Nullable
  private static List<PyImportStatementBase> getImportsAllowedToReuse(@Nullable PsiElement importBlockStart) {
    if (importBlockStart == null) return null;

    final List<PyImportStatementBase> importsAllowedToReuse = new ArrayList<>();
    PsiElement candidate = importBlockStart;
    while (candidate instanceof PyImportStatementBase) {
      importsAllowedToReuse.add((PyImportStatementBase)candidate);
      candidate = PyPsiUtils.getNextNonWhitespaceSibling(candidate);
    }
    return importsAllowedToReuse;
  }
@Contract("null -> null; !null -> !null")
  @Nullable
  private static List<PyImportStatementBase> getImportsAllowedToReuse(@Nullable PsiElement importBlockStart)