def get_network(network_arg, task_idx):
    """ Get network file from list of arguments.

    Parameters
    ----------
    network_arg: list of space-separated network filenames
        as parsed by argparse (--networks)

    task_idx: int
        index of the task/network

    Returns
    ------
    Path to the network for task task_idx.    
    """
    if (task_idx == 0 or len(network_arg) == 1):
        return network_arg[0]
    else:
        return network_arg[task_idx]