import tarfile


def untar(fname, dirs):
    """
    extract the tar.gz file
    :param fname: the name of tar.gz file
    :param dirs: the path of decompressed file 
    :return: bool
    """
    try:
        t = tarfile.open(name=fname, mode='r:gz')
        t.extractall(path=dirs)
        return True
    except Exception as e:
        print(e)
        return False