code: def urlopen_stub(url, data=None):
      """Stub to replace urlopen for testing."""
      if url == valid_httpurl():
          tmpfile = NamedTemporaryFile(prefix="urltmp_")
          return tmpfile
      else:
          raise URLError("Name or service not known")
  
imports: import os
  import pytest
  from tempfile import mkdtemp, mkstemp, NamedTemporaryFile
  from shutil import rmtree
  import numpy.lib._datasource
  from numpy.testing import assert_, assert_equal, assert_raises
  import urllib.request
  from urllib.parse import urlparse
  from urllib.error import URLError
label_desc: Use image node_id 1 for calling a global function with example usage: urlopen_stub(url, data) and returns: tmpfile