def _build_task_dependency(tasks):
    """
    Fill the task list with all the needed modules.

    Parameters
    ----------
    tasks : list
        list of strings, containing initially only the last module required.
        For instance, to recover all the modules, the input should be ``['fourier']``.

    Returns
    -------
    tasks : list
        Complete task list.
    """
    if not isinstance(tasks, (tuple, list)):
        tasks = [tasks]
    tasks = set(tasks)
    if 'thermodynamics' in tasks:
        tasks.discard('background')
    # if 'lensing' in tasks:
    #    tasks.add('harmonic')
    if 'harmonic' in tasks:
        tasks.add('fourier')
    if 'fourier' in tasks:
        tasks.add('transfer')
    return list(tasks)