code: def _copy_attachment(self, name, data, mimetype, mfg_event):
      
      attachment = mfg_event.attachment.add()
      attachment.name = name
      if isinstance(data, unicode):
        data = data.encode('utf8')
      attachment.value_binary = data
      if mimetype in test_runs_converter.MIMETYPE_MAP:
        attachment.type = test_runs_converter.MIMETYPE_MAP[mimetype]
      elif mimetype == test_runs_pb2.MULTIDIM_JSON:
        attachment.type = mimetype
      else:
        attachment.type = test_runs_pb2.BINARY
docs: Copies an attachment to mfg_event.