def get_opts(options):
    """
    Args:
        options: options object.
    Returns:
        args (tuple): positional options.
        kwargs (map): keyword arguments.
    """

    if isinstance(options, tuple):
        if len(options) == 2 and isinstance(options[-1], dict):
            args, kwargs = options
        else:
            args = options
            kwargs = {}
    elif isinstance(options, dict):
        args, kwargs = (), options
    else:
        raise ValueError("Options object expected to be either pair of (args, kwargs) or only args/kwargs")

    return args, kwargs