def get_dropdown_menu(fig, options_dict, add_button=True, equal_traces=True, number_traces=2):
    """
    Builds a list for the dropdown menu, based on a plotly figure traces and a dictionary with \
    the options to be used in the dropdown.

    :param fig: plotly graph object figure.
    :param options_dict: dictionary where keys are used as dropdown options and values data points.
    :param bool add_button: add option to display all dropdown options simultaneously.
    :param bool equal_traces: defines if all dropdown options have the same number of traces each. \
                                If True, define 'number_traces' as well. If False, number of traces \
                                will be the same as the number of values for each 'options_dict' key.
    :param int number_traces: number of traces created for each 'options_dict' key.
    :return: List of nested structures. Each dictionary within *updatemenus[0]['buttons'][0]* corresponds \
            to one dropdown menu options and contains information on which traces are visible, label and method.
    """

    list_updatemenus = []
    updatemenus = []
    start = 0
    if options_dict is not None:
        for n, i in enumerate(options_dict.keys()):
            if equal_traces:
                visible = [False] * len(fig['data'])
                end = start + number_traces
                visible[start:end] = [True] * number_traces
                start += number_traces
            else:
                number_traces = len([element for tupl in options_dict[i] for element in tupl])*2
                visible = [False] * len(fig['data'])
                end = start + number_traces
                visible[start:end] = [True] * number_traces
                start += number_traces
            temp_dict = dict(label=str(i),
                            method='update',
                            args=[{'visible': visible},
                                    {'title': 'Date: '+i}])
            list_updatemenus.append(temp_dict)

        if add_button:
            button = [dict(label='All',
                            method='update',
                            args=[{'visible': [True] * len(fig['data'])}, {'title': 'All'}])]
            list_updatemenus = list_updatemenus + button
        else:
            pass

        updatemenus = list([dict(active=len(list_updatemenus)-1,
                                buttons=list_updatemenus,
                                direction='down',
                                showactive=True, x=-0.17, xanchor='left', y=1.1, yanchor='top'), ])

    return updatemenus