code: def get_rdataset(dataname, package="datasets", cache=False):
      """download and return R dataset
  
      Parameters
      ----------
      dataname : str
          The name of the dataset you want to download
      package : str
          The package in which the dataset is found. The default is the core
          'datasets' package.
      cache : bool or str
          If True, will download this data into the STATSMODELS_DATA folder.
          The default location is a folder called statsmodels_data in the
          user home folder. Otherwise, you can specify a path to a folder to
          use for caching the data. If False, the data will not be cached.
  
      Returns
      -------
      dataset : Dataset
          A `statsmodels.data.utils.Dataset` instance. This objects has
          attributes:
  
          * data - A pandas DataFrame containing the data
          * title - The dataset title
          * package - The package from which the data came
          * from_cache - Whether not cached data was retrieved
          * __doc__ - The verbatim R documentation.
  
      Notes
      -----
      If the R dataset has an integer index. This is reset to be zero-based.
      Otherwise the index is preserved. The caching facilities are dumb. That
      is, no download dates, e-tags, or otherwise identifying information
      is checked to see if the data should be downloaded again or not. If the
      dataset is in the cache, it's used.
      """
      # NOTE: use raw github bc html site might not be most up to date
      data_base_url = (
          "https://raw.githubusercontent.com/vincentarelbundock/Rdatasets/"
          "master/csv/" + package + "/"
      )
      docs_base_url = (
          "https://raw.githubusercontent.com/vincentarelbundock/Rdatasets/"
          "master/doc/" + package + "/rst/"
      )
      cache = _get_cache(cache)
      data, from_cache = _get_data(data_base_url, dataname, cache)
      data = read_csv(data, index_col=0)
      data = _maybe_reset_index(data)
  
      title = _get_dataset_meta(dataname, package, cache)
      doc, _ = _get_data(docs_base_url, dataname, cache, "rst")
  
      return Dataset(
          data=data,
          __doc__=doc.read(),
          package=package,
          title=title,
          from_cache=from_cache,
      )
  
imports: from statsmodels.compat.python import lrange
  from io import StringIO
  from os import environ, makedirs
  from os.path import abspath, dirname, exists, expanduser, join
  import shutil
  from urllib.error import HTTPError, URLError
  from urllib.parse import urljoin
  from urllib.request import urlopen
  import numpy
  from pandas import Index, read_csv, read_stata
label_desc: Use image node_id 10 for calling a global function with example usage: get_rdataset(dataname, package, cache) and returns: Dataset