def def_plotly_date_range_widgets(my_rangeselector=None, as_layout=True,
    as_dict=False):
    """old name; def_my_plotly_stock_layout,
    REPLACES DEF_RANGE_SELECTOR"""
    if as_dict:
        as_layout = False
    from plotly import graph_objs as go
    if my_rangeselector is None:
        my_rangeselector = {'bgcolor': 'lightgray', 'buttons': [{'count': 1,
            'label': '1m', 'step': 'month', 'stepmode': 'backward'}, {
            'count': 3, 'label': '3m', 'step': 'month', 'stepmode':
            'backward'}, {'count': 6, 'label': '6m', 'step': 'month',
            'stepmode': 'backward'}, {'count': 1, 'label': '1y', 'step':
            'year', 'stepmode': 'backward'}, {'step': 'all'}, {'count': 1,
            'step': 'year', 'stepmode': 'todate'}], 'visible': True}
    my_layout = {'xaxis': {'rangeselector': my_rangeselector, 'rangeslider':
        {'visible': True}, 'type': 'date'}}
    if as_layout:
        return go.Layout(my_layout)
    else:
        return my_layout
