'Gets the site registry.  The first time this either downloads or loads
from the data file packaged with astropy.  Subsequent calls will use the
cached version unless explicitly overridden.
Parameters
force_download : bool or str
If not False, force replacement of the cached registry with a
downloaded version. If a str, that will be used as the URL to
download from (if just True, the default URL will be used).
force_builtin : bool
If True, load from the data file bundled with astropy and set the
cache to that.
returns
reg : astropy.coordinates.sites.SiteRegistry'

@classmethod
def _get_site_registry(cls, force_download=False, force_builtin=False):

    if (force_builtin and force_download):
        raise ValueError('Cannot    have    both    force_builtin    and    force_download    True')
    if force_builtin:
        reg = cls._site_registry = get_builtin_sites()
    else:
        reg = getattr(cls, '_site_registry', None)
        if (force_download or (not reg)):
            try:
                if isinstance(force_download, six.string_types):
                    reg = get_downloaded_sites(force_download)
                else:
                    reg = get_downloaded_sites()
            except (six.moves.urllib.error.URLError, IOError):
                if force_download:
                    raise
                msg = 'Could    not    access    the    online    site    list.    Falling    back    on    the    built-in    version,    which    is    rather    limited.    If    you    want    to    retry    the    download,    do    {0}._get_site_registry(force_download=True)'
                warn(AstropyUserWarning(msg.format(cls.__name__)))
                reg = get_builtin_sites()
            cls._site_registry = reg
    return reg
