code: def test_errors(dir_server):
      f = open_files("http://localhost:8999/doesnotexist")[0]
      with pytest.raises(errs):
          with f as f:
              f.read()
      f = open_files("http://nohost/")[0]
  
      expected = FileNotFoundError
  
      with pytest.raises(expected):
          with f as f:
              f.read()
      root = "http://localhost:8999/"
      fn = files[0]
      f = open_files(root + fn, mode="wb")[0]
      with pytest.raises(NotImplementedError):
          with f:
              pass
      f = open_files(root + fn)[0]
      with f as f:
          with pytest.raises(ValueError):
              f.seek(-1)
  
imports: from __future__ import annotations
  import os
  import subprocess
  import sys
  import time
  import fsspec
  import pytest
  from fsspec.core import open_files
  from packaging.version import parse
  import dask.bag
  from dask.utils import tmpdir
label_desc: Use image node_id 7 for calling a global function with example usage: test_errors(dir_server) without return types