def parent_template_name(parent_arg):
    """
    Given the argument of an {% extends %} tag, return the name of the template to which it links

    If the argument is a variable, return "__unknown__".  This is a static analyser of the template
    hierarchy, and cannot know all possible values that might be provided.
    """
    parent = parent_arg.strip('"\'')
    if parent == parent_arg:
        parent = '__unknown__'
    return parent
