code: def load_solar(
      start="2021-05-01",
      end="2021-09-01",
      normalise=True,
      return_full_df=False,
      api_version="v4",
  ):
      """Get national solar estimates for GB from Sheffield Solar PV_Live API.
  
      This function calls the Sheffield Solar PV_Live API to extract national solar data
      for the GB electricity network. Note that these are estimates of the true solar
      generation, since the true values are "behind the meter" and essentially
      unknown.
  
      The returned time series is half hourly. For more information please refer
      to [1, 2]_.
  
      Parameters
      ----------
      start : string, default="2021-05-01"
          The start date of the time-series in "YYYY-MM-DD" format
      end : string, default="2021-09-01"
          The end date of the time-series in "YYYY-MM-DD" format
      normalise : boolean, default=True
          Normalise the returned time-series by installed capacity?
      return_full_df : boolean, default=False
          Return a pd.DataFrame with power, capacity, and normalised estimates?
      api_version : string or None, default="v4"
          API version to call. If None then a stored sample of the data is loaded.
  
      Returns
      -------
      y : pd.Series
          The solar generation time-series, as requested by parameters, see above
  
      References
      ----------
      .. [1] https://www.solar.sheffield.ac.uk/pvlive/
      .. [2] https://www.solar.sheffield.ac.uk/pvlive/api/
  
      Examples
      --------
      >>> from sktime.datasets import load_solar  # doctest: +SKIP
      >>> y = load_solar()  # doctest: +SKIP
      """
      name = "solar"
      fname = name + ".csv"
      path = os.path.join(MODULE, DIRNAME, name, fname)
      y = pd.read_csv(
          path,
          index_col=0,
          parse_dates=["datetime_gmt"],
          dtype={1: float},
      )
      y = y.asfreq("30T")
      y = y.squeeze("columns")
      if api_version is None:
          return y
  
      def _load_solar(
          start="2021-05-01",
          end="2021-09-01",
          normalise=True,
          return_full_df=False,
          api_version="v4",
      ):
          """Private loader, for decoration with backoff."""
          url = "https://api0.solar.sheffield.ac.uk/pvlive/api/"
          url = url + api_version + "/gsp/0?"
          url = url + "start=" + start + "T00:00:00&"
          url = url + "end=" + end + "T00:00:00&"
          url = url + "extra_fields=capacity_mwp&"
          url = url + "data_format=csv"
  
          df = (
              pd.read_csv(
                  url,
                  index_col=["gsp_id", "datetime_gmt"],
                  parse_dates=["datetime_gmt"],
              )
              .droplevel(0)
              .sort_index()
          )
          df = df.asfreq("30T")
          df["generation_pu"] = df["generation_mw"] / df["capacity_mwp"]
  
          if return_full_df:
              df["generation_pu"] = (
                  df["generation_mw"] / df["capacity_mwp"]
              )
              return df
          else:
              if normalise:
                  return df["generation_pu"].rename("solar_gen")
              else:
                  return df["generation_mw"].rename("solar_gen")
  
      tries = 5
      for i in range(tries):
          try:
              return _load_solar(
                  start=start,
                  end=end,
                  normalise=normalise,
                  return_full_df=return_full_df,
                  api_version=api_version,
              )
          except (URLError, HTTPError):
              if i < tries - 1:
                  continue
              else:
                  warn(
                      """
                      Error detected using API. Check connection, input arguments, and
                      API status here https://www.solar.sheffield.ac.uk/pvlive/api/.
                      Loading stored sample data instead.
                      """
                  )
                  return y
  
imports: import os
  import zipfile
  from urllib.error import HTTPError, URLError
  from warnings import warn
  import numpy
  import pandas
  from sktime.datasets._data_io import _download_and_extract, _list_available_datasets, _load_dataset, _load_provided_dataset
  from sktime.datasets._readers_writers.tsf import load_tsf_to_dataframe
  from sktime.datasets.tsf_dataset_names import tsf_all, tsf_all_datasets
  from sktime.utils.validation._dependencies import _check_soft_dependencies
label_desc: Use image node_id 22 for calling a global function with example usage: load_solar(start, end, normalise, return_full_df, api_version) and returns: y, df, _load_solar, df, df, y