Import MicroDrop plugin.

    Parameters
    ----------
    package_name : str
        Name of MicroDrop plugin Conda package.
    include_available : bool, optional
        If ``True``, import from all available plugins (not just **enabled**
        ones).

        By default, only the ``<conda>/etc/microdrop/plugins/enabled``
        directory is added to the Python import paths (if necessary).

        If ``True``, also add the ``<conda>/share/microdrop/plugins/available``
        directory to the Python import paths.

    Returns
    -------
    module
        Imported plugin module.

def import_plugin(package_name, include_available=False):
    '''
    Import MicroDrop plugin.

    Parameters
    ----------
    package_name : str
        Name of MicroDrop plugin Conda package.
    include_available : bool, optional
        If ``True``, import from all available plugins (not just **enabled**
        ones).

        By default, only the ``<conda>/etc/microdrop/plugins/enabled``
        directory is added to the Python import paths (if necessary).

        If ``True``, also add the ``<conda>/share/microdrop/plugins/available``
        directory to the Python import paths.

    Returns
    -------
    module
        Imported plugin module.
    '''
    available_plugins_dir = MICRODROP_CONDA_SHARE.joinpath('plugins',
                                                           'available')
    enabled_plugins_dir = MICRODROP_CONDA_ETC.joinpath('plugins', 'enabled')
    search_paths = [enabled_plugins_dir]
    if include_available:
        search_paths += [available_plugins_dir]
    for dir_i in search_paths:
        if dir_i not in sys.path:
            sys.path.insert(0, dir_i)
    module_name = package_name.split('.')[-1].replace('-', '_')
    return importlib.import_module(module_name)