def get_upload_key_metadata(self):
key = self.get_upload_key()<EOL>metadata = key.metadata.copy()<EOL>headers = {<EOL>'<STR_LIT>': '<STR_LIT>',<EOL>'<STR_LIT:Content-Type>': '<STR_LIT>',<EOL>'<STR_LIT>': '<STR_LIT>',<EOL>'<STR_LIT>': '<STR_LIT>',<EOL>}<EOL>for header_name, attribute_name in headers.items():<EOL><INDENT>attribute_value = getattr(key, attribute_name, False)<EOL>if attribute_value:<EOL><INDENT>metadata.update({b'<STR_LIT>'.format(header_name):<EOL>b'<STR_LIT>'.format(attribute_value)})<EOL><DEDENT><DEDENT>return metadata<EOL>
Generate metadata dictionary from a bucket key.