code: def export(self, image_path, tmptar=None):
      '''export will export an image, sudo must be used.
  
         Parameters
         ==========
     
         image_path: full path to image
         tmptar: if defined, use custom temporary path for tar export
  
      '''
      from spython.utils import check_install
      check_install()
  
      if tmptar is None:
          tmptar = "/%s/tmptar.tar" %(tempfile.mkdtemp())
      cmd = ['singularity', 'image.export', '-f', tmptar, image_path]
  
      output = self.run_command(cmd, sudo=False)
      return tmptaf export(self, image_path, tmptar=None):
      '''export will export an image, sudo must be used.
  
         Parameters
         ==========
     
         image_path: full path to image
         tmptar: if defined, use custom temporary path for tar export
  
      '''
      from spython.utils import check_install
      check_install()
  
      if tmptar is None:
          tmptar = "/%s/tmptar.tar" %(tempfile.mkdtemp())
      cmd = ['singularity', 'image.export', '-f', tmptar, image_path]
  
      output = self.run_command(cmd, sudo=False)
      return tmptar
docs: export will export an image, sudo must be used.
  
         Parameters
         ==========
     
         image_path: full path to image
         tmptar: if defined, use custom temporary path for tar export