code: def _encode_mapping(mapping, f):
  	
  	f.write(_TYPE_DICT)
  	for key, value in sorted(mapping.items()):
  		_encode_buffer(key, f)
  		bencode(value, f)
  	f.write(_TYPE_END)
docs: Encodes the mapping items in lexical order (spec)