parameters: (self, unixfrom=False, policy=None)
return_statement: return fp.getvalue()
docstring: Return the entire formatted message as a bytes object.
  
          Optional 'unixfrom', when true, means include the Unix From_ envelope
          header.  'policy' is passed to the BytesGenerator instance used to
          serialize the message; if not specified the policy associated with
          the message instance is used.
docstring_summary: Return the entire formatted message as a bytes object.
docstring_tokens: Return the entire formatted message as a bytes object .
function: def as_bytes(self, unixfrom=False, policy=None):
          """Return the entire formatted message as a bytes object.
  
          Optional 'unixfrom', when true, means include the Unix From_ envelope
          header.  'policy' is passed to the BytesGenerator instance used to
          serialize the message; if not specified the policy associated with
          the message instance is used.
          """
          from email.generator import BytesGenerator
          policy = self.policy if policy is None else policy
          fp = BytesIO()
          g = BytesGenerator(fp, mangle_from_=False, policy=policy)
          g.flatten(self, unixfrom=unixfrom)
          return fp.getvalue()
function_tokens: def as_bytes ( self , unixfrom = False , policy = None ) : from email . generator import BytesGenerator policy = self . policy if policy is None else policy fp = BytesIO ( ) g = BytesGenerator ( fp , mangle_from_ = False , policy = policy ) g . flatten ( self , unixfrom = unixfrom ) return fp . getvalue ( )