import importlib


def get_member(member_path: str):
    """
    Import a module and retrieve a member from a module dot notation path
    separated by an ``:`` with the instance name.

    (eg: ``package.module:instance``)

    :param member_path: A string path with pattern
        ``package.module:member``
    :return:
    """
    split = member_path.split(':')
    if len(split) != 2:
        raise ImportError(
            'Invalid instance path syntax '
            '(eg: `package.module:instance`)'
        )
    module_name, instance_name = split
    module = importlib.import_module(module_name)
    return getattr(module, instance_name, None)