�
���hp � �l � d Z ddlZddlmZ ddlmZ ej �
d� � Zdedfd �ZdS )
zR
Useful for:
* users learning xarray
* building tutorials in the documentation.
� N� )�open_dataset)�urlretrieve)�~z.xarray_tutorial_dataTz%https://github.com/pydata/xarray-datac �� � t j � |� � }| dz }t j � ||f� � }t j � |� � s\t j � |� � st j |� � d� |dd|f� � }t ||� � t |fi |���
� � } |st j |� � | S )ak
Load a dataset from the online repository (requires internet).
If a local copy is found then always use that to avoid network traffic.
Parameters
----------
name : str
Name of the netcdf file containing the dataset
ie. 'air_temperature'
cache_dir : string, optional
The directory in which to search for and write cached data.
cache : boolean, optional
If True, then cache data locally for use on subsequent calls
github_url : string
Github repository where the data is stored
kws : dict, optional
Passed to xarray.open_dataset
z.nc�/�raw�master)�_os�path�
expanduser�sep�join�exists�isdir�mkdir�_urlretrieve�
_open_dataset�load�remove)
�name�cache� cache_dir�
github_url�kws�longdir�fullname� localfile�url�dss
�D/opt/cloudlinux/venv/lib/python3.11/site-packages/xarray/tutorial.py�load_datasetr" |