def gzip_file(source_path, archive_path):
 with gzip_open(archive_path, 'wb') as archive:
  if os.path.isfile(source_path):
   with open(source_path, 'rb') as source:
    copyfileobj(source, archive)

def gzip_file ( source_path , archive_path ) : with gzip_open ( archive_path , 'wb' ) as archive : if os . path . isfile ( source_path ) : with open ( source_path , 'rb' ) as source : copyfileobj ( source , archive )
create a gzip compressed archive of source_path at archive_path .