def __get_node_groups(spike_trains, node_groups, population):
    "Helper function for parsing the 'node_groups' params"
    if (node_groups is None):
        selected_nodes = spike_trains.node_ids(population=population)
        return ([{'node_ids': selected_nodes, 'c': 'b'}], selected_nodes)
    else:
        node_groups = copy.deepcopy(node_groups)
        selected_nodes = np.array(node_groups[0]['node_ids'])
        for grp in node_groups[1:]:
            if ('node_ids' not in grp):
                raise AttributeError('Could not find "node_ids" key in node_groups parameter.')
            selected_nodes = np.concatenate((selected_nodes, np.array(grp['node_ids'])))
        return (node_groups, selected_nodes)
Helper function for parsing the 'node_groups' params
def __get_node_groups(spike_trains, node_groups, population):
    
    if (node_groups is None):
        selected_nodes = spike_trains.node_ids(population=population)
        return ([{'node_ids': selected_nodes, 'c': 'b'}], selected_nodes)
    else:
        node_groups = copy.deepcopy(node_groups)
        selected_nodes = np.array(node_groups[0]['node_ids'])
        for grp in node_groups[1:]:
            if ('node_ids' not in grp):
                raise AttributeError('Could not find "node_ids" key in node_groups parameter.')
            selected_nodes = np.concatenate((selected_nodes, np.array(grp['node_ids'])))
        return (node_groups, selected_nodes)