def format_base64(data):
try:<EOL><INDENT>return binascii.b2a_base64(data).decode('<STR_LIT:utf-8>').rstrip('<STR_LIT>')<EOL><DEDENT>except (TypeError, binascii.Error) as e:<EOL><INDENT>raise securesystemslib.exceptions.FormatError('<STR_LIT>'<EOL>'<STR_LIT>' + str(e))<EOL><DEDENT>
<Purpose>
  Return the base64 encoding of 'data' with whitespace and '=' signs omitted.

<Arguments>
  data:
    Binary or buffer of data to convert.

<Exceptions>
  securesystemslib.exceptions.FormatError, if the base64 encoding fails or the
  argument is invalid.

<Side Effects>
  None.

<Returns>
  A base64-encoded string.