From 42afd72c654318e9fb1f2a204198221e797c2485 Mon Sep 17 00:00:00 2001
From: Zheng RuiFeng <ruifengz@foxmail.com>
Date: Fri, 11 Mar 2016 13:49:37 -0800
Subject: [PATCH] [SPARK-13814] [PYSPARK] Delete unnecessary imports in python
 examples files

JIRA:  https://issues.apache.org/jira/browse/SPARK-13814

## What changes were proposed in this pull request?

delete unnecessary imports in python examples files

## How was this patch tested?

manual tests

Author: Zheng RuiFeng <ruifengz@foxmail.com>

Closes #11651 from zhengruifeng/del_import_pe.
---
 examples/src/main/python/ml/als_example.py                      | 2 --
 .../src/main/python/ml/decision_tree_classification_example.py  | 2 --
 examples/src/main/python/ml/decision_tree_regression_example.py | 2 --
 .../main/python/ml/gradient_boosted_tree_classifier_example.py  | 2 --
 .../main/python/ml/gradient_boosted_tree_regressor_example.py   | 2 --
 examples/src/main/python/ml/kmeans_example.py                   | 1 -
 examples/src/main/python/ml/random_forest_classifier_example.py | 2 --
 examples/src/main/python/ml/random_forest_regressor_example.py  | 2 --
 .../main/python/mllib/binary_classification_metrics_example.py  | 1 -
 .../python/mllib/gradient_boosting_classification_example.py    | 2 --
 .../main/python/mllib/gradient_boosting_regression_example.py   | 2 --
 .../main/python/mllib/random_forest_classification_example.py   | 2 --
 .../src/main/python/mllib/random_forest_regression_example.py   | 2 --
 examples/src/main/python/mllib/recommendation_example.py        | 2 --
 examples/src/main/python/streaming/sql_network_wordcount.py     | 1 -
 15 files changed, 27 deletions(-)

diff --git a/examples/src/main/python/ml/als_example.py b/examples/src/main/python/ml/als_example.py
index f61c8ab5d6..922173308c 100644
--- a/examples/src/main/python/ml/als_example.py
+++ b/examples/src/main/python/ml/als_example.py
@@ -21,8 +21,6 @@ from pyspark import SparkContext
 from pyspark.sql import SQLContext
 
 # $example on$
-import math
-
 from pyspark.ml.evaluation import RegressionEvaluator
 from pyspark.ml.recommendation import ALS
 from pyspark.sql import Row
diff --git a/examples/src/main/python/ml/decision_tree_classification_example.py b/examples/src/main/python/ml/decision_tree_classification_example.py
index 8cda56dbb9..86bdc65392 100644
--- a/examples/src/main/python/ml/decision_tree_classification_example.py
+++ b/examples/src/main/python/ml/decision_tree_classification_example.py
@@ -20,8 +20,6 @@ Decision Tree Classification Example.
 """
 from __future__ import print_function
 
-import sys
-
 # $example on$
 from pyspark import SparkContext, SQLContext
 from pyspark.ml import Pipeline
diff --git a/examples/src/main/python/ml/decision_tree_regression_example.py b/examples/src/main/python/ml/decision_tree_regression_example.py
index 439e398947..8e20d5d857 100644
--- a/examples/src/main/python/ml/decision_tree_regression_example.py
+++ b/examples/src/main/python/ml/decision_tree_regression_example.py
@@ -20,8 +20,6 @@ Decision Tree Regression Example.
 """
 from __future__ import print_function
 
-import sys
-
 from pyspark import SparkContext, SQLContext
 # $example on$
 from pyspark.ml import Pipeline
diff --git a/examples/src/main/python/ml/gradient_boosted_tree_classifier_example.py b/examples/src/main/python/ml/gradient_boosted_tree_classifier_example.py
index 028497651f..f7e842f4b3 100644
--- a/examples/src/main/python/ml/gradient_boosted_tree_classifier_example.py
+++ b/examples/src/main/python/ml/gradient_boosted_tree_classifier_example.py
@@ -20,8 +20,6 @@ Gradient Boosted Tree Classifier Example.
 """
 from __future__ import print_function
 
-import sys
-
 from pyspark import SparkContext, SQLContext
 # $example on$
 from pyspark.ml import Pipeline
diff --git a/examples/src/main/python/ml/gradient_boosted_tree_regressor_example.py b/examples/src/main/python/ml/gradient_boosted_tree_regressor_example.py
index 4246e133a9..f8b4de651c 100644
--- a/examples/src/main/python/ml/gradient_boosted_tree_regressor_example.py
+++ b/examples/src/main/python/ml/gradient_boosted_tree_regressor_example.py
@@ -20,8 +20,6 @@ Gradient Boosted Tree Regressor Example.
 """
 from __future__ import print_function
 
-import sys
-
 from pyspark import SparkContext, SQLContext
 # $example on$
 from pyspark.ml import Pipeline
diff --git a/examples/src/main/python/ml/kmeans_example.py b/examples/src/main/python/ml/kmeans_example.py
index 150dadd42f..fa57a4d3ad 100644
--- a/examples/src/main/python/ml/kmeans_example.py
+++ b/examples/src/main/python/ml/kmeans_example.py
@@ -18,7 +18,6 @@
 from __future__ import print_function
 
 import sys
-import re
 
 import numpy as np
 from pyspark import SparkContext
diff --git a/examples/src/main/python/ml/random_forest_classifier_example.py b/examples/src/main/python/ml/random_forest_classifier_example.py
index b3530d4f41..c3570438c5 100644
--- a/examples/src/main/python/ml/random_forest_classifier_example.py
+++ b/examples/src/main/python/ml/random_forest_classifier_example.py
@@ -20,8 +20,6 @@ Random Forest Classifier Example.
 """
 from __future__ import print_function
 
-import sys
-
 from pyspark import SparkContext, SQLContext
 # $example on$
 from pyspark.ml import Pipeline
diff --git a/examples/src/main/python/ml/random_forest_regressor_example.py b/examples/src/main/python/ml/random_forest_regressor_example.py
index b59c7c9414..b77014f379 100644
--- a/examples/src/main/python/ml/random_forest_regressor_example.py
+++ b/examples/src/main/python/ml/random_forest_regressor_example.py
@@ -20,8 +20,6 @@ Random Forest Regressor Example.
 """
 from __future__ import print_function
 
-import sys
-
 from pyspark import SparkContext, SQLContext
 # $example on$
 from pyspark.ml import Pipeline
diff --git a/examples/src/main/python/mllib/binary_classification_metrics_example.py b/examples/src/main/python/mllib/binary_classification_metrics_example.py
index 437acb998a..4e7ea289b2 100644
--- a/examples/src/main/python/mllib/binary_classification_metrics_example.py
+++ b/examples/src/main/python/mllib/binary_classification_metrics_example.py
@@ -18,7 +18,6 @@
 Binary Classification Metrics Example.
 """
 from __future__ import print_function
-import sys
 from pyspark import SparkContext, SQLContext
 # $example on$
 from pyspark.mllib.classification import LogisticRegressionWithLBFGS
diff --git a/examples/src/main/python/mllib/gradient_boosting_classification_example.py b/examples/src/main/python/mllib/gradient_boosting_classification_example.py
index a94ea0d582..b204cd1b31 100644
--- a/examples/src/main/python/mllib/gradient_boosting_classification_example.py
+++ b/examples/src/main/python/mllib/gradient_boosting_classification_example.py
@@ -20,8 +20,6 @@ Gradient Boosted Trees Classification Example.
 """
 from __future__ import print_function
 
-import sys
-
 from pyspark import SparkContext
 # $example on$
 from pyspark.mllib.tree import GradientBoostedTrees, GradientBoostedTreesModel
diff --git a/examples/src/main/python/mllib/gradient_boosting_regression_example.py b/examples/src/main/python/mllib/gradient_boosting_regression_example.py
index 86040799dc..758e224a9e 100644
--- a/examples/src/main/python/mllib/gradient_boosting_regression_example.py
+++ b/examples/src/main/python/mllib/gradient_boosting_regression_example.py
@@ -20,8 +20,6 @@ Gradient Boosted Trees Regression Example.
 """
 from __future__ import print_function
 
-import sys
-
 from pyspark import SparkContext
 # $example on$
 from pyspark.mllib.tree import GradientBoostedTrees, GradientBoostedTreesModel
diff --git a/examples/src/main/python/mllib/random_forest_classification_example.py b/examples/src/main/python/mllib/random_forest_classification_example.py
index 324ba50625..9e5a8dcaab 100644
--- a/examples/src/main/python/mllib/random_forest_classification_example.py
+++ b/examples/src/main/python/mllib/random_forest_classification_example.py
@@ -20,8 +20,6 @@ Random Forest Classification Example.
 """
 from __future__ import print_function
 
-import sys
-
 from pyspark import SparkContext
 # $example on$
 from pyspark.mllib.tree import RandomForest, RandomForestModel
diff --git a/examples/src/main/python/mllib/random_forest_regression_example.py b/examples/src/main/python/mllib/random_forest_regression_example.py
index f7aa6114ec..2e1be34c1a 100644
--- a/examples/src/main/python/mllib/random_forest_regression_example.py
+++ b/examples/src/main/python/mllib/random_forest_regression_example.py
@@ -20,8 +20,6 @@ Random Forest Regression Example.
 """
 from __future__ import print_function
 
-import sys
-
 from pyspark import SparkContext
 # $example on$
 from pyspark.mllib.tree import RandomForest, RandomForestModel
diff --git a/examples/src/main/python/mllib/recommendation_example.py b/examples/src/main/python/mllib/recommendation_example.py
index 615db0749b..00e683c3ae 100644
--- a/examples/src/main/python/mllib/recommendation_example.py
+++ b/examples/src/main/python/mllib/recommendation_example.py
@@ -20,8 +20,6 @@ Collaborative Filtering Classification Example.
 """
 from __future__ import print_function
 
-import sys
-
 from pyspark import SparkContext
 
 # $example on$
diff --git a/examples/src/main/python/streaming/sql_network_wordcount.py b/examples/src/main/python/streaming/sql_network_wordcount.py
index da90c07dbd..1ba5e9fb78 100644
--- a/examples/src/main/python/streaming/sql_network_wordcount.py
+++ b/examples/src/main/python/streaming/sql_network_wordcount.py
@@ -29,7 +29,6 @@
 """
 from __future__ import print_function
 
-import os
 import sys
 
 from pyspark import SparkContext
-- 
GitLab