code: def test_fetch_af2():
      """Test fetch_pdb"""
      # Check latest release
      try:
          ppdb = PandasPdb()
          url, txt = ppdb._fetch_af2("Q5VSL9", af2_version=4)
      except HTTPError:
          url, txt = None, None
      except ConnectionResetError:
          url, txt = None, None
  
      if txt:  # skip if AF2 DB down
          txt[:100] == af_test_struct_v4[:100]
          ppdb.fetch_pdb(uniprot_id="Q5VSL9", source="alphafold2-v4")
          assert ppdb.pdb_text == txt
          assert (
              ppdb.pdb_path
              == "https://alphafold.ebi.ac.uk/files/AF-Q5VSL9-F1-model_v4.pdb"
          )
  
      # Check legacy release
      try:
          ppdb = PandasPdb()
          url, txt = ppdb._fetch_af2("Q5VSL9", af2_version=3)
      except HTTPError:
          url, txt = None, None
      except ConnectionResetError:
          url, txt = None, None
  
      if txt:  # skip if AF2 DB down
          txt[:100] == af_test_struct_v3[:100]
          ppdb.fetch_pdb(uniprot_id="Q5VSL9", source="alphafold2-v3")
          assert ppdb.pdb_text == txt
          assert (
              ppdb.pdb_path
              == "https://alphafold.ebi.ac.uk/files/AF-Q5VSL9-F1-model_v3.pdb"
          )
  
file_path: biopandas/biopandas/pdb/tests/test_read_pdb.py
imports: import os
  from urllib.error import HTTPError, URLError
  from urllib.request import urlopen
  import numpy
  import pandas
  from biopandas.pdb import PandasPdb
  from biopandas.testutils import assert_raises
  from nose.tools import raises
label_desc: Use image node_id 4 for calling a global function with example usage: test_fetch_af2() without return types