summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Lamb <jaylamb20@gmail.com>2017-10-01 16:56:08 -0500
committerDan Schult <dschult@colgate.edu>2017-10-01 17:56:08 -0400
commit86e81edd5dc3ea4f2b37e7b8fc4409a87625b58f (patch)
treecc8aebb9c809ef7d91bbadd9841e6642c080e2bc
parentc3b0761f96cb85d2c4d4b8c7bf6fe451c17fb961 (diff)
downloadnetworkx-86e81edd5dc3ea4f2b37e7b8fc4409a87625b58f.tar.gz
Removed unused imports (#2653)
-rw-r--r--networkx/algorithms/approximation/kcomponents.py2
-rw-r--r--networkx/algorithms/assortativity/pairs.py1
-rw-r--r--networkx/algorithms/assortativity/tests/test_connectivity.py1
-rw-r--r--networkx/algorithms/bipartite/covering.py3
-rw-r--r--networkx/algorithms/chains.py1
-rw-r--r--networkx/algorithms/cluster.py1
-rw-r--r--networkx/algorithms/coloring/greedy_coloring_with_interchange.py1
-rw-r--r--networkx/algorithms/community/tests/test_asyn_fluidc.py2
-rw-r--r--networkx/algorithms/components/tests/test_connected.py2
-rw-r--r--networkx/algorithms/connectivity/cuts.py2
-rw-r--r--networkx/algorithms/connectivity/tests/test_connectivity.py2
-rw-r--r--networkx/algorithms/connectivity/tests/test_kcutsets.py1
-rw-r--r--networkx/algorithms/graphical.py1
-rw-r--r--networkx/algorithms/isomorphism/tests/test_temporalisomorphvf2.py3
-rw-r--r--networkx/algorithms/isomorphism/vf2userfunc.py1
-rw-r--r--networkx/algorithms/link_analysis/hits_alg.py1
-rw-r--r--networkx/algorithms/link_analysis/pagerank_alg.py1
-rw-r--r--networkx/algorithms/link_analysis/tests/test_pagerank.py1
-rw-r--r--networkx/algorithms/operators/tests/test_product.py2
-rw-r--r--networkx/algorithms/shortest_paths/tests/test_dense.py1
-rw-r--r--networkx/algorithms/tests/test_efficiency.py1
-rw-r--r--networkx/classes/tests/historical_tests.py1
-rw-r--r--networkx/classes/tests/test_filters.py2
-rw-r--r--networkx/classes/tests/test_graph.py1
-rw-r--r--networkx/classes/tests/test_subgraphviews.py2
-rw-r--r--networkx/drawing/layout.py1
-rw-r--r--networkx/drawing/nx_agraph.py1
-rw-r--r--networkx/generators/classic.py2
-rw-r--r--networkx/generators/stochastic.py2
-rw-r--r--networkx/generators/tests/test_ego.py2
-rw-r--r--networkx/generators/tests/test_lattice.py1
-rw-r--r--networkx/linalg/algebraicconnectivity.py4
-rw-r--r--networkx/readwrite/json_graph/adjacency.py2
-rw-r--r--networkx/readwrite/json_graph/cytoscape.py3
-rw-r--r--networkx/readwrite/json_graph/node_link.py2
-rw-r--r--networkx/readwrite/json_graph/tests/test_adjacency.py2
-rw-r--r--networkx/readwrite/json_graph/tests/test_cytoscape.py2
-rw-r--r--networkx/readwrite/json_graph/tests/test_node_link.py2
-rw-r--r--networkx/readwrite/json_graph/tests/test_tree.py2
-rw-r--r--networkx/readwrite/json_graph/tree.py2
-rw-r--r--networkx/tests/test_convert_pandas.py2
-rw-r--r--networkx/tests/test_convert_scipy.py3
-rw-r--r--networkx/utils/union_find.py1
43 files changed, 21 insertions, 52 deletions
diff --git a/networkx/algorithms/approximation/kcomponents.py b/networkx/algorithms/approximation/kcomponents.py
index 2fbcd271..88c65e94 100644
--- a/networkx/algorithms/approximation/kcomponents.py
+++ b/networkx/algorithms/approximation/kcomponents.py
@@ -14,8 +14,6 @@ from networkx.utils import not_implemented_for
from networkx.algorithms.approximation import local_node_connectivity
from networkx.algorithms.connectivity import \
local_node_connectivity as exact_local_node_connectivity
-from networkx.algorithms.connectivity import build_auxiliary_node_connectivity
-from networkx.algorithms.flow import build_residual_network
__author__ = """\n""".join(['Jordi Torrents <jtorrents@milnou.net>'])
diff --git a/networkx/algorithms/assortativity/pairs.py b/networkx/algorithms/assortativity/pairs.py
index f25ba3b4..9a31222e 100644
--- a/networkx/algorithms/assortativity/pairs.py
+++ b/networkx/algorithms/assortativity/pairs.py
@@ -1,7 +1,6 @@
#-*- coding: utf-8 -*-
"""Generators of x-y pairs of node data."""
import networkx as nx
-from networkx.utils import dict_to_numpy_array
__author__ = ' '.join(['Aric Hagberg <aric.hagberg@gmail.com>'])
__all__ = ['node_attribute_xy',
'node_degree_xy']
diff --git a/networkx/algorithms/assortativity/tests/test_connectivity.py b/networkx/algorithms/assortativity/tests/test_connectivity.py
index 19abfcd5..0700b396 100644
--- a/networkx/algorithms/assortativity/tests/test_connectivity.py
+++ b/networkx/algorithms/assortativity/tests/test_connectivity.py
@@ -2,7 +2,6 @@ from itertools import permutations
from nose.tools import assert_almost_equal
from nose.tools import assert_equal
-from nose.tools import assert_true
from nose.tools import raises
import networkx as nx
diff --git a/networkx/algorithms/bipartite/covering.py b/networkx/algorithms/bipartite/covering.py
index b1730522..8496a85e 100644
--- a/networkx/algorithms/bipartite/covering.py
+++ b/networkx/algorithms/bipartite/covering.py
@@ -6,8 +6,7 @@
""" Functions related to graph covers."""
-import networkx as nx
-from networkx.utils import not_implemented_for, arbitrary_element
+from networkx.utils import not_implemented_for
from networkx.algorithms.bipartite.matching import hopcroft_karp_matching
from networkx.algorithms.covering import min_edge_cover as _min_edge_cover
diff --git a/networkx/algorithms/chains.py b/networkx/algorithms/chains.py
index 827b2d2f..702c3170 100644
--- a/networkx/algorithms/chains.py
+++ b/networkx/algorithms/chains.py
@@ -8,7 +8,6 @@
# NetworkX is distributed under a BSD license; see LICENSE.txt for more
# information.
"""Functions for finding chains in a graph."""
-from itertools import islice
import networkx as nx
from networkx.utils import not_implemented_for
diff --git a/networkx/algorithms/cluster.py b/networkx/algorithms/cluster.py
index f446dc2c..c851caaf 100644
--- a/networkx/algorithms/cluster.py
+++ b/networkx/algorithms/cluster.py
@@ -13,7 +13,6 @@ from itertools import combinations
from collections import Counter
import networkx as nx
-from networkx import NetworkXError
from networkx.utils import not_implemented_for
__author__ = """\n""".join(['Aric Hagberg <aric.hagberg@gmail.com>',
diff --git a/networkx/algorithms/coloring/greedy_coloring_with_interchange.py b/networkx/algorithms/coloring/greedy_coloring_with_interchange.py
index 8c671332..2d8e197d 100644
--- a/networkx/algorithms/coloring/greedy_coloring_with_interchange.py
+++ b/networkx/algorithms/coloring/greedy_coloring_with_interchange.py
@@ -1,4 +1,3 @@
-import networkx as nx
import itertools
__all__ = ['greedy_coloring_with_interchange']
diff --git a/networkx/algorithms/community/tests/test_asyn_fluidc.py b/networkx/algorithms/community/tests/test_asyn_fluidc.py
index 64828569..514014af 100644
--- a/networkx/algorithms/community/tests/test_asyn_fluidc.py
+++ b/networkx/algorithms/community/tests/test_asyn_fluidc.py
@@ -1,4 +1,4 @@
-from nose.tools import assert_equal, assert_in
+from nose.tools import assert_equal
from networkx import Graph
from networkx.algorithms.community.asyn_fluidc import *
import random
diff --git a/networkx/algorithms/components/tests/test_connected.py b/networkx/algorithms/components/tests/test_connected.py
index 0cf4379e..168f561a 100644
--- a/networkx/algorithms/components/tests/test_connected.py
+++ b/networkx/algorithms/components/tests/test_connected.py
@@ -2,7 +2,7 @@
from nose.tools import *
import networkx as nx
from networkx import convert_node_labels_to_integers as cnlti
-from networkx import NetworkXError,NetworkXNotImplemented
+from networkx import NetworkXNotImplemented
class TestConnected:
diff --git a/networkx/algorithms/connectivity/cuts.py b/networkx/algorithms/connectivity/cuts.py
index cde55d31..bbcd7422 100644
--- a/networkx/algorithms/connectivity/cuts.py
+++ b/networkx/algorithms/connectivity/cuts.py
@@ -7,7 +7,7 @@ import networkx as nx
# Define the default maximum flow function to use in all flow based
# cut algorithms.
-from networkx.algorithms.flow import edmonds_karp, shortest_augmenting_path
+from networkx.algorithms.flow import edmonds_karp
from networkx.algorithms.flow import build_residual_network
default_flow_func = edmonds_karp
diff --git a/networkx/algorithms/connectivity/tests/test_connectivity.py b/networkx/algorithms/connectivity/tests/test_connectivity.py
index 88f73b51..254d3572 100644
--- a/networkx/algorithms/connectivity/tests/test_connectivity.py
+++ b/networkx/algorithms/connectivity/tests/test_connectivity.py
@@ -1,5 +1,5 @@
import itertools
-from nose.tools import assert_equal, assert_true, assert_false, assert_raises
+from nose.tools import assert_equal, assert_true, assert_raises
import networkx as nx
from networkx.algorithms import flow
diff --git a/networkx/algorithms/connectivity/tests/test_kcutsets.py b/networkx/algorithms/connectivity/tests/test_kcutsets.py
index 18178afa..81c9fcd0 100644
--- a/networkx/algorithms/connectivity/tests/test_kcutsets.py
+++ b/networkx/algorithms/connectivity/tests/test_kcutsets.py
@@ -1,6 +1,5 @@
# Jordi Torrents
# Test for k-cutsets
-from operator import itemgetter
from nose.tools import assert_equal, assert_false, assert_true, assert_raises
import networkx as nx
diff --git a/networkx/algorithms/graphical.py b/networkx/algorithms/graphical.py
index 1759fdc2..672be201 100644
--- a/networkx/algorithms/graphical.py
+++ b/networkx/algorithms/graphical.py
@@ -7,7 +7,6 @@
# Pieter Swart <swart@lanl.gov>
# All rights reserved.
# BSD license.
-from collections import defaultdict
import heapq
import networkx as nx
__author__ = "\n".join(['Aric Hagberg (hagberg@lanl.gov)',
diff --git a/networkx/algorithms/isomorphism/tests/test_temporalisomorphvf2.py b/networkx/algorithms/isomorphism/tests/test_temporalisomorphvf2.py
index 9c68e72c..67a1bb19 100644
--- a/networkx/algorithms/isomorphism/tests/test_temporalisomorphvf2.py
+++ b/networkx/algorithms/isomorphism/tests/test_temporalisomorphvf2.py
@@ -1,8 +1,7 @@
"""
Tests for the temporal aspect of the Temporal VF2 isomorphism algorithm.
"""
-from nose.tools import assert_true, assert_false, assert_equal
-from nose import SkipTest
+from nose.tools import assert_true, assert_false
import networkx as nx
from networkx.algorithms import isomorphism as iso
from datetime import date, datetime, timedelta
diff --git a/networkx/algorithms/isomorphism/vf2userfunc.py b/networkx/algorithms/isomorphism/vf2userfunc.py
index c352cf44..ce75402d 100644
--- a/networkx/algorithms/isomorphism/vf2userfunc.py
+++ b/networkx/algorithms/isomorphism/vf2userfunc.py
@@ -32,7 +32,6 @@
"""
import networkx as nx
-
from . import isomorphvf2 as vf2
__all__ = ['GraphMatcher',
diff --git a/networkx/algorithms/link_analysis/hits_alg.py b/networkx/algorithms/link_analysis/hits_alg.py
index ea837234..7463939e 100644
--- a/networkx/algorithms/link_analysis/hits_alg.py
+++ b/networkx/algorithms/link_analysis/hits_alg.py
@@ -8,7 +8,6 @@
# BSD license.
# NetworkX:http://networkx.github.io/
import networkx as nx
-from networkx.exception import NetworkXError
__author__ = """Aric Hagberg (hagberg@lanl.gov)"""
__all__ = ['hits', 'hits_numpy', 'hits_scipy', 'authority_matrix', 'hub_matrix']
diff --git a/networkx/algorithms/link_analysis/pagerank_alg.py b/networkx/algorithms/link_analysis/pagerank_alg.py
index a46d4ddf..b924bc53 100644
--- a/networkx/algorithms/link_analysis/pagerank_alg.py
+++ b/networkx/algorithms/link_analysis/pagerank_alg.py
@@ -7,7 +7,6 @@
# BSD license.
# NetworkX:http://networkx.github.io/
import networkx as nx
-from networkx.exception import NetworkXError
from networkx.utils import not_implemented_for
__author__ = """\n""".join(["Aric Hagberg <aric.hagberg@gmail.com>",
"Brandon Liu <brandon.k.liu@gmail.com"])
diff --git a/networkx/algorithms/link_analysis/tests/test_pagerank.py b/networkx/algorithms/link_analysis/tests/test_pagerank.py
index d8f59c35..01b815c9 100644
--- a/networkx/algorithms/link_analysis/tests/test_pagerank.py
+++ b/networkx/algorithms/link_analysis/tests/test_pagerank.py
@@ -4,7 +4,6 @@ import random
import networkx
from nose.tools import *
from nose import SkipTest
-from nose.plugins.attrib import attr
# Example from
# A. Langville and C. Meyer, "A survey of eigenvector methods of web
diff --git a/networkx/algorithms/operators/tests/test_product.py b/networkx/algorithms/operators/tests/test_product.py
index 6e35952e..a1bea7cb 100644
--- a/networkx/algorithms/operators/tests/test_product.py
+++ b/networkx/algorithms/operators/tests/test_product.py
@@ -1,6 +1,6 @@
import networkx as nx
from networkx import tensor_product, cartesian_product, lexicographic_product, strong_product
-from nose.tools import assert_raises, assert_true, assert_equal, raises
+from nose.tools import assert_true, assert_equal, raises
from networkx.testing import assert_edges_equal
@raises(nx.NetworkXError)
diff --git a/networkx/algorithms/shortest_paths/tests/test_dense.py b/networkx/algorithms/shortest_paths/tests/test_dense.py
index bbd38651..97eb2561 100644
--- a/networkx/algorithms/shortest_paths/tests/test_dense.py
+++ b/networkx/algorithms/shortest_paths/tests/test_dense.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
from nose.tools import *
-from nose import SkipTest
import networkx as nx
class TestFloyd:
diff --git a/networkx/algorithms/tests/test_efficiency.py b/networkx/algorithms/tests/test_efficiency.py
index ba501d1b..bc5bf4d9 100644
--- a/networkx/algorithms/tests/test_efficiency.py
+++ b/networkx/algorithms/tests/test_efficiency.py
@@ -9,7 +9,6 @@
"""Unit tests for the :mod:`networkx.algorithms.efficiency` module."""
from __future__ import division
-from unittest import TestCase
from nose.tools import assert_equal
import networkx as nx
diff --git a/networkx/classes/tests/historical_tests.py b/networkx/classes/tests/historical_tests.py
index 5926c4d5..7c171ad0 100644
--- a/networkx/classes/tests/historical_tests.py
+++ b/networkx/classes/tests/historical_tests.py
@@ -1,7 +1,6 @@
#!/usr/bin/env python
"""Original NetworkX graph tests"""
from nose.tools import *
-import networkx
import networkx as nx
from networkx import convert_node_labels_to_integers as cnlti
from networkx.testing import *
diff --git a/networkx/classes/tests/test_filters.py b/networkx/classes/tests/test_filters.py
index 91eeb7bf..d4a3ee31 100644
--- a/networkx/classes/tests/test_filters.py
+++ b/networkx/classes/tests/test_filters.py
@@ -1,4 +1,4 @@
-from nose.tools import assert_equals, assert_true, assert_false, assert_raises
+from nose.tools import assert_true, assert_false, assert_raises
import networkx as nx
diff --git a/networkx/classes/tests/test_graph.py b/networkx/classes/tests/test_graph.py
index 918bd277..7b27dc05 100644
--- a/networkx/classes/tests/test_graph.py
+++ b/networkx/classes/tests/test_graph.py
@@ -2,7 +2,6 @@ from nose.tools import assert_equal
from nose.tools import assert_is
from nose.tools import assert_not_equal
from nose.tools import assert_raises
-from nose.tools import assert_true
from nose.tools import raises
import networkx as nx
diff --git a/networkx/classes/tests/test_subgraphviews.py b/networkx/classes/tests/test_subgraphviews.py
index 6da6a98a..a469ccdf 100644
--- a/networkx/classes/tests/test_subgraphviews.py
+++ b/networkx/classes/tests/test_subgraphviews.py
@@ -1,5 +1,5 @@
from nose.tools import assert_equal, assert_not_equal, \
- assert_is, assert_true, assert_false, assert_raises
+ assert_is, assert_true, assert_raises
import networkx as nx
diff --git a/networkx/drawing/layout.py b/networkx/drawing/layout.py
index ce467374..71d7df3b 100644
--- a/networkx/drawing/layout.py
+++ b/networkx/drawing/layout.py
@@ -26,7 +26,6 @@ Warning: Most layout routines have only been tested in 2-dimensions.
"""
from __future__ import division
-import collections
import networkx as nx
__all__ = ['circular_layout',
diff --git a/networkx/drawing/nx_agraph.py b/networkx/drawing/nx_agraph.py
index 2dfbdc47..535c2e55 100644
--- a/networkx/drawing/nx_agraph.py
+++ b/networkx/drawing/nx_agraph.py
@@ -24,7 +24,6 @@ See Also
Pygraphviz: http://pygraphviz.github.io/
"""
import os
-import sys
import tempfile
import networkx as nx
diff --git a/networkx/generators/classic.py b/networkx/generators/classic.py
index 957b8309..5cbddba1 100644
--- a/networkx/generators/classic.py
+++ b/networkx/generators/classic.py
@@ -23,11 +23,9 @@ from __future__ import division
import itertools
import networkx as nx
-from networkx.algorithms.bipartite.generators import complete_bipartite_graph
from networkx.classes import Graph
from networkx.exception import NetworkXError
from networkx.utils import accumulate
-from networkx.utils import flatten
from networkx.utils import nodes_or_number
from networkx.utils import pairwise
diff --git a/networkx/generators/stochastic.py b/networkx/generators/stochastic.py
index 0c260692..d0a743ac 100644
--- a/networkx/generators/stochastic.py
+++ b/networkx/generators/stochastic.py
@@ -10,8 +10,6 @@ graph.
"""
from __future__ import division
-from functools import partial
-
from networkx.classes import DiGraph
from networkx.classes import MultiDiGraph
from networkx.utils import not_implemented_for
diff --git a/networkx/generators/tests/test_ego.py b/networkx/generators/tests/test_ego.py
index fcc6b30c..97e5b198 100644
--- a/networkx/generators/tests/test_ego.py
+++ b/networkx/generators/tests/test_ego.py
@@ -4,7 +4,7 @@ ego graph
---------
"""
-from nose.tools import assert_true, assert_equal
+from nose.tools import assert_true
import networkx as nx
from networkx.testing.utils import *
diff --git a/networkx/generators/tests/test_lattice.py b/networkx/generators/tests/test_lattice.py
index dab3cc4e..4291956a 100644
--- a/networkx/generators/tests/test_lattice.py
+++ b/networkx/generators/tests/test_lattice.py
@@ -1,5 +1,4 @@
"""Unit tests for the :mod:`networkx.generators.lattice` module."""
-import itertools
from nose.tools import assert_equal
from nose.tools import assert_true
diff --git a/networkx/linalg/algebraicconnectivity.py b/networkx/linalg/algebraicconnectivity.py
index 5d7c21c3..f27f6eaf 100644
--- a/networkx/linalg/algebraicconnectivity.py
+++ b/networkx/linalg/algebraicconnectivity.py
@@ -15,8 +15,8 @@ from networkx.utils import reverse_cuthill_mckee_ordering
from re import compile
try:
- from numpy import (array, asmatrix, asarray, dot, matrix, ndarray, ones,
- reshape, sqrt, zeros)
+ from numpy import (array, asmatrix, asarray, dot, ndarray, ones,
+ sqrt, zeros)
from numpy.linalg import norm, qr
from numpy.random import normal
from scipy.linalg import eigh, inv
diff --git a/networkx/readwrite/json_graph/adjacency.py b/networkx/readwrite/json_graph/adjacency.py
index 403bebf8..71f64dde 100644
--- a/networkx/readwrite/json_graph/adjacency.py
+++ b/networkx/readwrite/json_graph/adjacency.py
@@ -4,7 +4,7 @@
# Pieter Swart <swart@lanl.gov>
# All rights reserved.
# BSD license.
-from itertools import chain, count
+from itertools import chain
import networkx as nx
__author__ = """Aric Hagberg <aric.hagberg@gmail.com>"""
__all__ = ['adjacency_data', 'adjacency_graph']
diff --git a/networkx/readwrite/json_graph/cytoscape.py b/networkx/readwrite/json_graph/cytoscape.py
index a2e85225..b5da2452 100644
--- a/networkx/readwrite/json_graph/cytoscape.py
+++ b/networkx/readwrite/json_graph/cytoscape.py
@@ -1,6 +1,5 @@
# BSD license.
-from itertools import chain, count
-import json
+
import networkx as nx
__all__ = ['cytoscape_data', 'cytoscape_graph']
diff --git a/networkx/readwrite/json_graph/node_link.py b/networkx/readwrite/json_graph/node_link.py
index 80280edd..583c8689 100644
--- a/networkx/readwrite/json_graph/node_link.py
+++ b/networkx/readwrite/json_graph/node_link.py
@@ -8,10 +8,8 @@
# All rights reserved.
# BSD license.
from itertools import chain, count
-import json
import networkx as nx
from networkx.utils import make_str, to_tuple
-from tempfile import NamedTemporaryFile
__all__ = ['node_link_data', 'node_link_graph']
diff --git a/networkx/readwrite/json_graph/tests/test_adjacency.py b/networkx/readwrite/json_graph/tests/test_adjacency.py
index ca19423b..f60afcc1 100644
--- a/networkx/readwrite/json_graph/tests/test_adjacency.py
+++ b/networkx/readwrite/json_graph/tests/test_adjacency.py
@@ -1,5 +1,5 @@
import json
-from nose.tools import assert_equal, assert_raises, assert_not_equal, assert_true, raises
+from nose.tools import assert_equal, assert_true, raises
import networkx as nx
from networkx.readwrite.json_graph import *
diff --git a/networkx/readwrite/json_graph/tests/test_cytoscape.py b/networkx/readwrite/json_graph/tests/test_cytoscape.py
index 639f87e1..3c2155fa 100644
--- a/networkx/readwrite/json_graph/tests/test_cytoscape.py
+++ b/networkx/readwrite/json_graph/tests/test_cytoscape.py
@@ -1,5 +1,5 @@
import json
-from nose.tools import assert_equal, assert_raises, assert_not_equal, assert_true, raises
+from nose.tools import assert_equal, assert_true, raises
import networkx as nx
from networkx.readwrite.json_graph import *
diff --git a/networkx/readwrite/json_graph/tests/test_node_link.py b/networkx/readwrite/json_graph/tests/test_node_link.py
index 870b7e8d..d222b420 100644
--- a/networkx/readwrite/json_graph/tests/test_node_link.py
+++ b/networkx/readwrite/json_graph/tests/test_node_link.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
import json
-from nose.tools import assert_equal, assert_raises, assert_not_equal, assert_true, raises
+from nose.tools import assert_equal, assert_true, raises
import networkx as nx
from networkx.readwrite.json_graph import *
diff --git a/networkx/readwrite/json_graph/tests/test_tree.py b/networkx/readwrite/json_graph/tests/test_tree.py
index c69a3143..2ea95f49 100644
--- a/networkx/readwrite/json_graph/tests/test_tree.py
+++ b/networkx/readwrite/json_graph/tests/test_tree.py
@@ -1,5 +1,5 @@
import json
-from nose.tools import assert_equal, assert_raises, assert_not_equal, assert_true, raises
+from nose.tools import assert_equal, assert_true, raises
import networkx as nx
from networkx.readwrite.json_graph import *
diff --git a/networkx/readwrite/json_graph/tree.py b/networkx/readwrite/json_graph/tree.py
index b9dac607..af49c9ae 100644
--- a/networkx/readwrite/json_graph/tree.py
+++ b/networkx/readwrite/json_graph/tree.py
@@ -4,7 +4,7 @@
# Pieter Swart <swart@lanl.gov>
# All rights reserved.
# BSD license.
-from itertools import chain, count
+from itertools import chain
import networkx as nx
from networkx.utils import make_str
__author__ = """Aric Hagberg (hagberg@lanl.gov))"""
diff --git a/networkx/tests/test_convert_pandas.py b/networkx/tests/test_convert_pandas.py
index 2ffb7267..de298131 100644
--- a/networkx/tests/test_convert_pandas.py
+++ b/networkx/tests/test_convert_pandas.py
@@ -1,5 +1,5 @@
from nose import SkipTest
-from nose.tools import assert_true, assert_raises
+from nose.tools import assert_raises
import networkx as nx
from networkx.testing import assert_nodes_equal, assert_edges_equal, assert_graphs_equal
diff --git a/networkx/tests/test_convert_scipy.py b/networkx/tests/test_convert_scipy.py
index 1f298d26..c423bed5 100644
--- a/networkx/tests/test_convert_scipy.py
+++ b/networkx/tests/test_convert_scipy.py
@@ -1,10 +1,9 @@
from nose import SkipTest
-from nose.tools import assert_raises, assert_true, assert_equal, raises
+from nose.tools import assert_raises, assert_true, raises
import networkx as nx
from networkx.testing import assert_graphs_equal
from networkx.generators.classic import barbell_graph, cycle_graph, path_graph
-from networkx.testing.utils import assert_graphs_equal
class TestConvertNumpy(object):
diff --git a/networkx/utils/union_find.py b/networkx/utils/union_find.py
index ef6b95db..21381545 100644
--- a/networkx/utils/union_find.py
+++ b/networkx/utils/union_find.py
@@ -8,7 +8,6 @@
"""
Union-find data structure.
"""
-from itertools import groupby
from networkx.utils import groups