code: def _setup_packages(self, sc):
          
          packages = self.py_packages
          if not packages:
              return
          for package in packages:
              mod = importlib.import_module(package)
              try:
                  mod_path = mod.__path__[0]
              except AttributeError:
                  mod_path = mod.__file__
              tar_path = os.path.join(self.run_path, package + '.tar.gz')
              tar = tarfile.open(tar_path, "w:gz")
              tar.add(mod_path, os.path.basename(mod_path))
              tar.close()
              sc.addPyFile(tar_path)
docs: This method compresses and uploads packages to the cluster