def parse_base64(base64_string):
if not isinstance(base64_string, six.string_types):<EOL><INDENT>message = '<STR_LIT>'+repr(base64_string)<EOL>raise securesystemslib.exceptions.FormatError(message)<EOL><DEDENT>extra = len(base64_string) % <NUM_LIT:4><EOL>if extra:<EOL><INDENT>padding = '<STR_LIT:=>' * (<NUM_LIT:4> - extra)<EOL>base64_string = base64_string + padding<EOL><DEDENT>try:<EOL><INDENT>return binascii.a2b_base64(base64_string.encode('<STR_LIT:utf-8>'))<EOL><DEDENT>except (TypeError, binascii.Error) as e:<EOL><INDENT>raise securesystemslib.exceptions.FormatError('<STR_LIT>'<EOL>'<STR_LIT>' + str(e))<EOL><DEDENT>
<Purpose>
  Parse a base64 encoding with whitespace and '=' signs omitted.

<Arguments>
  base64_string:
    A string holding a base64 value.

<Exceptions>
  securesystemslib.exceptions.FormatError, if 'base64_string' cannot be parsed
  due to an invalid base64 encoding.

<Side Effects>
  None.

<Returns>
  A byte string representing the parsed based64 encoding of
  'base64_string'.