code: def _carto_tiles(tileset, cdn):
      def build_carto_tiles_config(hi_res=""):
          if cdn == "carto":
              base_url = "https://{{s}}.basemaps.cartocdn.com/rastertiles/{tileset}/{{z}}/{{x}}/{{y}}{hi_res}.png"
          elif cdn == "fastly":
              base_url = "https://cartocdn_{{s}}.global.ssl.fastly.net/{tileset}/{{z}}/{{x}}/{{y}}{hi_res}.png"
          else:
              raise ValueError(
                  "Unknown carto cdn: {}. Expected 'carto' or 'fastly'.".format(
                      cdn
                  )
              )
  
          return _maptiles_zxy(
              base_url.format(tileset=tileset, hi_res=hi_res),
              '<a href="https://www.openstreetmap.org/copyright">© OpenStreetMap contributors</a> <a href="https://carto.com/attributions#basemaps">© CARTO</a>, <a href="https://carto.com/attributions">© CARTO</a>',
              min_zoom=1,
              max_zoom=20,
              subdomains="abc",
          )
  
      return build_carto_tiles_config(), build_carto_tiles_config(
          hi_res="@2x"
      )
  
imports: from lets_plot import maptiles_lets_plot
  from lets_plot import maptiles_solid
  from lets_plot import maptiles_zxy
label_desc: Use image node_id 1 for calling a global function with example usage: _carto_tiles(tileset, cdn) and returns: build_carto_tiles_config,  build_carto_tiles_config, _maptiles_zxy