(filename, vfs_or_none)
return model_ptr
Invokes `mj_loadXML` with logging/error handling.
Invokes `mj_loadXML` with logging/error handling.
Invokes mj_loadXML with logging / error handling .
def _load_xml(filename, vfs_or_none):
  """Invokes `mj_loadXML` with logging/error handling."""
  error_buf = ctypes.create_string_buffer(_ERROR_BUFSIZE)
  model_ptr = mjlib.mj_loadXML(
      util.to_binary_string(filename),
      vfs_or_none,
      error_buf,
      _ERROR_BUFSIZE)
  if not model_ptr:
    raise Error(util.to_native_string(error_buf.value))
  elif error_buf.value:
    logging.warning(util.to_native_string(error_buf.value))

  # Free resources when the ctypes pointer is garbage collected.
  _create_finalizer(model_ptr, mjlib.mj_deleteModel)

  return model_ptr
def _load_xml ( filename , vfs_or_none ) : error_buf = ctypes . create_string_buffer ( _ERROR_BUFSIZE ) model_ptr = mjlib . mj_loadXML ( util . to_binary_string ( filename ) , vfs_or_none , error_buf , _ERROR_BUFSIZE ) if not model_ptr : raise Error ( util . to_native_string ( error_buf . value ) ) elif error_buf . value : logging . warning ( util . to_native_string ( error_buf . value ) ) # Free resources when the ctypes pointer is garbage collected. _create_finalizer ( model_ptr , mjlib . mj_deleteModel ) return model_ptr