def get_canon_name(file: str, allow_no_source: bool=False) ->str:
    """ Gets the canonical path of a game file taken from an extracted graphic pack """
    name = str(file).replace('\\', '/').replace('.s', '.').replace('Content',
        'content').replace('Aoc', 'aoc')
    if 'aoc/' in name:
        return name.replace('aoc/content', 'aoc').replace('aoc', 'Aoc')
    elif 'content/' in name and '/aoc' not in name:
        return name.replace('content/', '')
    elif allow_no_source:
        return name
