'Extracts the lambda package into a given path. Assumes the package exists in lambda packages.'

def extract_lambda_package(self, package_name, path):

    lambda_package = lambda_packages[package_name][self.runtime]
    shutil.rmtree(os.path.join(path, package_name), ignore_errors=True)
    tar = tarfile.open(lambda_package['path'], mode='r:gz')
    for member in tar.getmembers():
        tar.extract(member, path)
