from typing import Any
from typing import Iterable


def get_config_name_for_args(*args) -> str:
    """
    Get a name string by concatenating the given args.

    Usage::

    >>> get_config_name_for_args("123456", None, "+remindme")
    '123456__None__+remindme'
    >>> get_config_name_for_args("123456", None, ("a_tag",))
    '123456__None__a_tag'
    >>> get_config_name_for_args("123456", None, ("a_tag", "b_tag"))
    '123456__None__a_tag,b_tag'
    >>> get_config_name_for_args("123456")
    Traceback (most recent call last):
    RuntimeError: ...
    """

    # sanity check
    if len(args) == 1:
        raise RuntimeError("get_config_name_for_args requires more > 1 arguments")

    def format_(obj: Any) -> str:
        if isinstance(obj, str):
            return obj
        elif isinstance(obj, Iterable):
            return ",".join(map(str, obj))
        return str(obj)

    return "__".join(map(format_, args))