def _encode_mapping(name, value, check_keys, opts):
 if _raw_document_class(value):
  return (('\x03' + name) + value.raw)
 data = ''.join([_element_to_bson(key, val, check_keys, opts) for (key, val) in iteritems(value)])
 return (((('\x03' + name) + _PACK_INT((len(data) + 5))) + data) + '\x00')

def _encode_mapping ( name , value , check_keys , opts ) : if _raw_document_class ( value ) : return ( ( '\x03' + name ) + value . raw ) data = '' . join ( [ _element_to_bson ( key , val , check_keys , opts ) for ( key , val ) in iteritems ( value ) ] ) return ( ( ( ( '\x03' + name ) + _PACK_INT ( ( len ( data ) + 5 ) ) ) + data ) + '\x00' )
encode a mapping type .