def create_metadata_tar(self, destination=None, metadata_folder="<STR_LIT>"):
tar_file = None<EOL>files = []<EOL>environ = self._extract_env()<EOL>if environ not in [None, "<STR_LIT>"]:<EOL><INDENT>bot.verbose3('<STR_LIT>')<EOL>template = get_template('<STR_LIT>')<EOL>template['<STR_LIT:name>'] = '<STR_LIT>' % (metadata_folder)<EOL>template['<STR_LIT:content>'] = environ<EOL>files.append(template)<EOL><DEDENT>labels = self._extract_labels()<EOL>if labels is not None:<EOL><INDENT>labels = print_json(labels)<EOL>bot.verbose3('<STR_LIT>')<EOL>template = get_template('<STR_LIT>')<EOL>template['<STR_LIT:name>'] = "<STR_LIT>" % metadata_folder<EOL>template['<STR_LIT:content>'] = labels<EOL>files.append(template)<EOL><DEDENT>runscript = self._extract_runscript()<EOL>if runscript is not None:<EOL><INDENT>bot.verbose3('<STR_LIT>')<EOL>template = get_template('<STR_LIT>')<EOL>template['<STR_LIT:name>'] = "<STR_LIT>" % metadata_folder<EOL>template['<STR_LIT:content>'] = runscript<EOL>files.append(template)<EOL><DEDENT>if len(files) > <NUM_LIT:0>:<EOL><INDENT>dest = self._get_download_cache(destination, subfolder='<STR_LIT>')<EOL>tar_file = create_tar(files, dest)<EOL><DEDENT>else:<EOL><INDENT>bot.warning("<STR_LIT>")<EOL><DEDENT>return tar_file<EOL>
create a metadata tar (runscript and environment) to add to the
       downloaded image. This function uses all functions in this section
       to obtain key--> values from the manifest config, and write
       to a .tar.gz

       Parameters
       ==========
       metadata_folder: the metadata folder in the singularity image.
                        default is .singularity.d