original_docstring: Download zip file and extract to temp directory
docstring: Download zip file and extract to temp directory
docstring_tokens: Download zip file and extract to temp directory
code: def download(self):
          """Download zip file and extract to temp directory"""
          if exists(self.csv) or exists(self.csv_cleaned):
              print(f"NAIS file for month {self.month} has been downloaded")
              return
  
          print(f"Downloading NAIS file for month {self.month}...")
          zfile = src.download_url(self.url, self.root, ".zip")
          src.extract_zip(zfile, self.root)
  
          # Move to top level directory
          self.extracted_file = src.find_file(self.root, self.name)
          shutil.copy(self.extracted_file, self.root)
          os.remove(zfile)
          print(f"NAIS file for month {self.month} has been downloaded")
code_tokens: def download ( self ) : if exists ( self . csv ) or exists ( self . csv_cleaned ) : print ( f"NAIS file for month {self.month} has been downloaded" ) return print ( f"Downloading NAIS file for month {self.month}..." ) zfile = src . download_url ( self . url , self . root , ".zip" ) src . extract_zip ( zfile , self . root ) self . extracted_file = src . find_file ( self . root , self . name ) shutil . copy ( self . extracted_file , self . root ) os . remove ( zfile ) print ( f"NAIS file for month {self.month} has been downloaded" )
short_docstring: Download zip file and extract to temp directory
short_docstring_tokens: Download zip file and extract to temp directory
comment: """Download zip file and extract to temp directory"""$SEP$# Move to top level directory