def get_function_and_class_name(func, *args):
    """
    Given a function and its unamed arguments, returns class_name.function_name. It assumes the first argument
    is `self`. If there are no arguments then it only returns the function name.

    :param func: the function passed in
    :type func: callable
    :param args: List of arguments passed into the function
    """
    try:
        return func.__qualname__
    except AttributeError:
        if args:
            return '{}.{}'.format(args[0].__class__.__name__, func.__name__)
        return func.__name__
