import ast


def get_call_starargs(node):
    """
    Get the stararg name from Call node.

    Only supports the pre 3.5 semantic of a single *args at the end.
    """
    args = node.args
    if not args:
        return None
    last = args[-1]
    star_count = sum(map(lambda obj: isinstance(obj, ast.Starred), args))
    if star_count > 1:
        raise NotImplementedError("Currently only supports one stararg")

    if not isinstance(last, ast.Starred):
        return

    if not isinstance(last.value, ast.Name):
        raise ValueError("Only support starargs that unpack a variable")
    return last.value.id