def extract_file(self, filename, cwd):
        if not filename:
            return
        print("Extract {} into {}".format(filename, cwd))
        if filename.endswith(".tgz") or filename.endswith(".tar.gz"):
            shprint(sh.tar, "-C", cwd, "-xvzf", filename)

        elif filename.endswith(".tbz2") or filename.endswith(".tar.bz2"):
            shprint(sh.tar, "-C", cwd, "-xvjf", filename)

        elif filename.endswith(".zip"):
            shprint(sh.unzip, "-d", cwd, filename)

        else:
            print("Error: cannot extract, unreconized extension for {}".format(
                filename))
            raise Exception()
Extract the `filename` into the directory `cwd`.
dataset/ETHPy150Open kivy/kivy-ios/toolchain.py/Recipe.extract_file