parameters: (self, fp, headersonly=False)
docstring: Create a message structure from the data in a binary file.
  
          Reads all the data from the file and returns the root of the message
          structure.  Optional headersonly is a flag specifying whether to stop
          parsing after reading the headers or not.  The default is False,
          meaning it parses the entire contents of the file.
docstring_summary: Create a message structure from the data in a binary file.
docstring_tokens: Create a message structure from the data in a binary file .
function: def parse(self, fp, headersonly=False):
          """Create a message structure from the data in a binary file.
  
          Reads all the data from the file and returns the root of the message
          structure.  Optional headersonly is a flag specifying whether to stop
          parsing after reading the headers or not.  The default is False,
          meaning it parses the entire contents of the file.
          """
          fp = TextIOWrapper(fp, encoding='ascii', errors='surrogateescape')
          try:
              return self.parser.parse(fp, headersonly)
          finally:
              fp.detach()
function_tokens: def parse ( self , fp , headersonly = False ) : fp = TextIOWrapper ( fp , encoding = 'ascii' , errors = 'surrogateescape' ) try : return self . parser . parse ( fp , headersonly ) finally : fp . detach ( )