class_docstr: Resolve shub:// URLs before handing them off to HTTPDownloader.
      
class_docstr_tok: ["Resolve","shub",":","\/\/","URLs","before","handing","them","off","to","HTTPDownloader","."]
code: def _resolve_url(self, url):
      if not url.startswith("shub://"):
          return url
  
      info_url = self.api_url + url[7:]
      content = self.fetch(info_url)
      try:
          shub_info = json.loads(content)
      except json.decoder.JSONDecodeError as e:
          raise DownloadError(
              "Failed to get information from {}".format(info_url)
          ) from e
      return shub_info["image"]
  
file_path: datalad/datalad/downloaders/shub.py
imports: import json
  from logging import getLogger
  from datalad.dochelpers import borrowkwargs
  from datalad.downloaders.http import HTTPDownloader
  from datalad.support.exceptions import DownloadError
  from datalad.utils import auto_repr
label_desc: Use image node_id 2 for calling the SHubDownloader obj's underlying member method code with example usage: obj._resolve_url(url) and returns: shub_info, url