def select_node(nodes):
 if nodes:
  return random.choice(nodes)
 else:
  raise EmptyClusterError('Cluster contains no nodes.')

def select_node ( nodes ) : if nodes : return random . choice ( nodes ) else : raise EmptyClusterError ( 'Cluster contains no nodes.' )
select a node from a list of nodes .