def _get_code_w_scope(data, position, obj_end, opts, element_name):
 code_end = (position + _UNPACK_INT(data[position:(position + 4)])[0])
 (code, position) = _get_string(data, (position + 4), code_end, opts, element_name)
 (scope, position) = _get_object(data, position, code_end, opts, element_name)
 if (position != code_end):
  raise InvalidBSON('scope outside of javascript code boundaries')
 return (Code(code, scope), position)

def _get_code_w_scope ( data , position , obj_end , opts , element_name ) : code_end = ( position + _UNPACK_INT ( data [ position : ( position + 4 ) ] ) [ 0 ] ) ( code , position ) = _get_string ( data , ( position + 4 ) , code_end , opts , element_name ) ( scope , position ) = _get_object ( data , position , code_end , opts , element_name ) if ( position != code_end ) : raise InvalidBSON ( 'scope outside of javascript code boundaries' ) return ( Code ( code , scope ) , position )
decode a bson code_w_scope to bson .