'Convert a Content-ID header value to an id.
Presumes the Content-ID header conforms to the format that _id_to_header()
returns.
Args:
header: string, Content-ID header value.
Returns:
The extracted id value.
Raises:
BatchError if the header is not in the expected format.'

def _header_to_id(self, header):

    if ((header[0] != '<') or (header[(-1)] != '>')):
        raise BatchError(('Invalid    value    for    Content-ID:    %s' % header))
    if ('+' not in header):
        raise BatchError(('Invalid    value    for    Content-ID:    %s' % header))
    (base, id_) = header[1:(-1)].rsplit('+', 1)
    return unquote(id_)
