def _encode_code(name, value, dummy, opts):
 cstring = _make_c_string(value)
 cstrlen = len(cstring)
 if (value.scope is None):
  return ((('\r' + name) + _PACK_INT(cstrlen)) + cstring)
 scope = _dict_to_bson(value.scope, False, opts, False)
 full_length = _PACK_INT(((8 + cstrlen) + len(scope)))
 return ((((('\x0f' + name) + full_length) + _PACK_INT(cstrlen)) + cstring) + scope)

def _encode_code ( name , value , dummy , opts ) : cstring = _make_c_string ( value ) cstrlen = len ( cstring ) if ( value . scope is None ) : return ( ( ( '\r' + name ) + _PACK_INT ( cstrlen ) ) + cstring ) scope = _dict_to_bson ( value . scope , False , opts , False ) full_length = _PACK_INT ( ( ( 8 + cstrlen ) + len ( scope ) ) ) return ( ( ( ( ( '\x0f' + name ) + full_length ) + _PACK_INT ( cstrlen ) ) + cstring ) + scope )
encode bson .