def graph_degree(A):
    '\n    Returns the degree for the nodes (rows) of a symmetric \n    graph in sparse CSR or CSC format, or a qobj.\n    \n    Parameters\n    ----------\n    A : qobj, csr_matrix, csc_matrix\n        Input quantum object or csr_matrix.\n    \n    Returns\n    -------\n    degree : array\n        Array of integers giving the degree for each node (row).\n    \n    '
    if (A.__class__.__name__ == 'Qobj'):
        return _node_degrees(A.data.indices, A.data.indptr, A.shape[0])
    else:
        return _node_degrees(A.indices, A.indptr, A.shape[0])
Returns the degree for the nodes (rows) of a symmetric 
graph in sparse CSR or CSC format, or a qobj.

Parameters
----------
A : qobj, csr_matrix, csc_matrix
    Input quantum object or csr_matrix.

Returns
-------
degree : array
    Array of integers giving the degree for each node (row).
def graph_degree(A):
    '\n    Returns the degree for the nodes (rows) of a symmetric \n    graph in sparse CSR or CSC format, or a qobj.\n    \n    Parameters\n    ----------\n    A : qobj, csr_matrix, csc_matrix\n        Input quantum object or csr_matrix.\n    \n    Returns\n    -------\n    degree : array\n        Array of integers giving the degree for each node (row).\n    \n    '
    if (A.__class__.__name__ == 'Qobj'):
        return _node_degrees(A.data.indices, A.data.indptr, A.shape[0])
    else:
        return _node_degrees(A.indices, A.indptr, A.shape[0])