@transformation<EOL>def random_by_nodes(graph: BELGraph, percentage: Optional[float] = None) -> BELGraph:
percentage = percentage or <NUM_LIT><EOL>assert <NUM_LIT:0> < percentage <= <NUM_LIT:1><EOL>nodes = graph.nodes()<EOL>n = int(len(nodes) * percentage)<EOL>subnodes = random.sample(nodes, n)<EOL>result = graph.subgraph(subnodes)<EOL>update_node_helper(graph, result)<EOL>return result<EOL>
Get a random graph by inducing over a percentage of the original nodes.

    :param graph: A BEL graph
    :param percentage: The percentage of edges to keep