def _create_widget(widget_type, **kwargs):
    """
    Creates a widget of the given type with the given parameters.
    Widget can be with/without units dropdown.

    Parameters
    ----------
    widget_type: `any`
        Type of the widget to be created

    **kwargs: `dict`
        Parameters specific to the widget

    Returns
    -------
    `~ipywidgets.widgets.Widget or [~ipywidgets.widgets.Widget, ~ipywidgets.widgets.Widget]`
        widget or [widget, units_dropdown]
    """
    unit = None
    placeholder = None
    opts = None
    if "unit" in kwargs:
        unit = kwargs["unit"]
        del kwargs["unit"]
    if "placeholder" in kwargs:
        placeholder = kwargs["placeholder"]
        del kwargs["placeholder"]
    if "opts" in kwargs:
        opts = kwargs["opts"]
        del kwargs["opts"]
    widget_element = widget_type(**kwargs)
    widget_element.create_widget()
    if unit:
        widget_element.set_unit(unit)
    if placeholder:
        widget_element.set_place_holder(placeholder)

    if opts:
        widget_element.attach_units_dropdown(opts)
        return [widget_element.get_widget(), widget_element.get_dropdown_widget()]
    else:
        return widget_element.get_widget()