def __init__(self, header=None, payload=None,  headers={}, defaults=True):
if header is None and defaults is True:<EOL><INDENT>headers.setdefault("<STR_LIT>", "<STR_LIT>")<EOL><DEDENT>self.header = header or WARCHeader(headers, defaults=True)<EOL>self.payload = payload<EOL>if defaults is True and '<STR_LIT>' not in self.header:<EOL><INDENT>if payload:<EOL><INDENT>self.header['<STR_LIT>'] = str(len(payload))<EOL><DEDENT>else:<EOL><INDENT>self.header['<STR_LIT>'] = "<STR_LIT:0>"<EOL><DEDENT><DEDENT>if defaults is True and '<STR_LIT>' not in self.header:<EOL><INDENT>self.header['<STR_LIT>'] = self._compute_digest(payload)<EOL><DEDENT>
Creates a new WARC record.