code: def compile(self, codepath, destpath=None, package=False, run=False, force=False, show_unchanged=True):
          
          with openfile(codepath, "r") as opened:
              code = readfile(opened)
  
          if destpath is not None:
              destdir = os.path.dirname(destpath)
              if not os.path.exists(destdir):
                  os.makedirs(destdir)
              if package is True:
                  self.create_package(destdir)
  
          foundhash = None if force else self.has_hash_of(destpath, code, package)
          if foundhash:
              if show_unchanged:
                  logger.show_tabulated("Left unchanged", showpath(destpath), "(pass --force to override).")
              if self.show:
                  print(foundhash)
              if run:
                  self.execute_file(destpath)
  
          else:
              logger.show_tabulated("Compiling", showpath(codepath), "...")
  
              if package is True:
                  compile_method = "parse_package"
              elif package is False:
                  compile_method = "parse_file"
              else:
                  raise CoconutInternalException("invalid value for package", package)
  
              def callback(compiled):
                  if destpath is None:
                      logger.show_tabulated("Compiled", showpath(codepath), "without writing to file.")
                  else:
                      with openfile(destpath, "w") as opened:
                          writefile(opened, compiled)
                      logger.show_tabulated("Compiled to", showpath(destpath), ".")
                  if self.show:
                      print(compiled)
                  if run:
                      if destpath is None:
                          self.execute(compiled, path=codepath, allow_show=False)
                      else:
                          self.execute_file(destpath)
  
              self.submit_comp_job(codepath, callback, compile_method, code)
docs: Compile a source Coconut file to a destination Python file.