def norm_diff(A, norm=2, msg=True):

    if msg:
        print("... computing %s norm ..." % norm)
    if norm == 2:
        # s = sp.linalg.norm(A, ord=2)  # slow
        value = sp.sparse.linalg.svds(A, k=1, return_singular_vectors=False)
    else:
        if sp.sparse.issparse(A):
            value = sp.sparse.linalg.norm(A, ord=norm)
        else:
            value = sp.linalg.norm(A, ord=norm)
    return value
Close the Connection's socket.
dataset/ETHPy150Open scikit-learn/scikit-learn/benchmarks/bench_plot_randomized_svd.py/norm_diff--crossover with--dataset/ETHPy150Open kdart/pycopia/core/pycopia/inet/fcgi.py/Connection._cleanupSocket