parameters: (data, as_class=dict,
                 tz_aware=True, uuid_subtype=OLD_UUID_SUBTYPE, compile_re=True)
docstring: Decode BSON data to multiple documents.
  
      `data` must be a string of concatenated, valid, BSON-encoded
      documents.
  
      :Parameters:
        - `data`: BSON data
        - `as_class` (optional): the class to use for the resulting
          documents
        - `tz_aware` (optional): if ``True``, return timezone-aware
          :class:`~datetime.datetime` instances
        - `compile_re` (optional): if ``False``, don't attempt to compile
          BSON regular expressions into Python regular expressions. Return
          instances of :class:`~bson.regex.Regex` instead. Can avoid
          :exc:`~bson.errors.InvalidBSON` errors when receiving
          Python-incompatible regular expressions, for example from ``currentOp``
  
      .. versionchanged:: 2.7
         Added `compile_re` option.
      .. versionadded:: 1.9
docstring_summary: Decode BSON data to multiple documents.
docstring_tokens: Decode BSON data to multiple documents .
function: def decode_all(data, as_class=dict,
                 tz_aware=True, uuid_subtype=OLD_UUID_SUBTYPE, compile_re=True):
      """Decode BSON data to multiple documents.
  
      `data` must be a string of concatenated, valid, BSON-encoded
      documents.
  
      :Parameters:
        - `data`: BSON data
        - `as_class` (optional): the class to use for the resulting
          documents
        - `tz_aware` (optional): if ``True``, return timezone-aware
          :class:`~datetime.datetime` instances
        - `compile_re` (optional): if ``False``, don't attempt to compile
          BSON regular expressions into Python regular expressions. Return
          instances of :class:`~bson.regex.Regex` instead. Can avoid
          :exc:`~bson.errors.InvalidBSON` errors when receiving
          Python-incompatible regular expressions, for example from ``currentOp``
  
      .. versionchanged:: 2.7
         Added `compile_re` option.
      .. versionadded:: 1.9
      """
      docs = []
      position = 0
      end = len(data) - 1
      try:
          while position < end:
              obj_size = struct.unpack("i", data[position:position + 4])[0]
              if len(data) - position < obj_size:
                  raise InvalidBSON("objsize too large")
              if data[position + obj_size - 1:position + obj_size] != ZERO:
                  raise InvalidBSON("bad eoo")
              elements = data[position + 4:position + obj_size - 1]
              position += obj_size
              docs.append(_elements_to_dict(elements, as_class,
                                            tz_aware, uuid_subtype, compile_re))
          return docs
      except InvalidBSON:
          raise
      except Exception as e:
          reraise(InvalidBSON, InvalidBSON(e), sys.exc_info()[2])
function_tokens: def decode_all ( data , as_class = dict , tz_aware = True , uuid_subtype = OLD_UUID_SUBTYPE , compile_re = True ) : docs = [ ] position = 0 end = len ( data ) - 1 try : while position < end : obj_size = struct . unpack ( "i" , data [ position : position + 4 ] ) [ 0 ] if len ( data ) - position < obj_size : raise InvalidBSON ( "objsize too large" ) if data [ position + obj_size - 1 : position + obj_size ] != ZERO : raise InvalidBSON ( "bad eoo" ) elements = data [ position + 4 : position + obj_size - 1 ] position += obj_size docs . append ( _elements_to_dict ( elements , as_class , tz_aware , uuid_subtype , compile_re ) ) return docs except InvalidBSON : raise except Exception as e : reraise ( InvalidBSON , InvalidBSON ( e ) , sys . exc_info ( ) [ 2 ] )