Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def get_karateclub(graph_name):
"""
Gets formatted dataset from KarateClub library
https://karateclub.readthedocs.io
"""
try:
from karateclub import GraphReader
except:
raise Exception(
"get_karateclub requires the karateclub library!\n"
+ "Try 'pip install karateclub'\n"
+ "see https://github.com/benedekrozemberczki/KarateClub")
G = GraphReader(graph_name).get_graph()
y = GraphReader(graph_name).get_target()
return G, pd.DataFrame({'node': list(G), 'label': pd.Series(y)})
def get_karateclub(graph_name):
"""
Gets formatted dataset from KarateClub library
https://karateclub.readthedocs.io
"""
try:
from karateclub import GraphReader
except:
raise Exception(
"get_karateclub requires the karateclub library!\n"
+ "Try 'pip install karateclub'\n"
+ "see https://github.com/benedekrozemberczki/KarateClub")
G = GraphReader(graph_name).get_graph()
y = GraphReader(graph_name).get_target()
return G, pd.DataFrame({'node': list(G), 'label': pd.Series(y)})