code: def srtm_login_or_skip(monkeypatch):
      import os
  
      try:
          srtm_username = os.environ["SRTM_USERNAME"]
      except KeyError:
          pytest.skip("SRTM_USERNAME environment variable is unset.")
      try:
          srtm_password = os.environ["SRTM_PASSWORD"]
      except KeyError:
          pytest.skip("SRTM_PASSWORD environment variable is unset.")
  
      from http.cookiejar import CookieJar
      from urllib.request import (
          HTTPBasicAuthHandler,
          HTTPCookieProcessor,
          HTTPPasswordMgrWithDefaultRealm,
          build_opener,
      )
  
      password_manager = HTTPPasswordMgrWithDefaultRealm()
      password_manager.add_password(
          None,
          "https://urs.earthdata.nasa.gov",
          srtm_username,
          srtm_password,
      )
      cookie_jar = CookieJar()
      opener = build_opener(
          HTTPBasicAuthHandler(password_manager),
          HTTPCookieProcessor(cookie_jar),
      )
  
      monkeypatch.setattr(cartopy.io, "urlopen", opener.open)
  
file_path: cartopy/lib/cartopy/tests/io/test_srtm.py
imports: import numpy
  from numpy.testing import assert_array_equal
  import pytest
  import cartopy.crs
  import cartopy.io.srtm
  from .test_downloaders import download_to_temp
label_desc: Use image node_id 1 for calling a global function with example usage: srtm_login_or_skip(monkeypatch) without return types