def check_builtin_matches_remote(download_url=True):
 builtin_registry = EarthLocation._get_site_registry(force_builtin=True)
 dl_registry = EarthLocation._get_site_registry(force_download=download_url)
 in_dl = {}
 matches = {}
 for name in builtin_registry.names:
  in_dl[name] = (name in dl_registry)
  if in_dl[name]:
   matches[name] = quantity_allclose(builtin_registry[name], dl_registry[name])
  else:
   matches[name] = False
 if (not all(matches.values())):
  print(u'In builtin registry but not in download:')
  for name in in_dl:
   if (not in_dl[name]):
    print(u'    ', name)
  print(u'In both but not the same value:')
  for name in matches:
   if ((not matches[name]) and in_dl[name]):
    print(u'    ', name, u'builtin:', builtin_registry[name], u'download:', dl_registry[name])
  assert False, u"Builtin and download registry aren't consistent - failures printed to stdout"

def check_builtin_matches_remote ( download_url = True ) : builtin_registry = EarthLocation . _get_site_registry ( force_builtin = True ) dl_registry = EarthLocation . _get_site_registry ( force_download = download_url ) in_dl = { } matches = { } for name in builtin_registry . names : in_dl [ name ] = ( name in dl_registry ) if in_dl [ name ] : matches [ name ] = quantity_allclose ( builtin_registry [ name ] , dl_registry [ name ] ) else : matches [ name ] = False if ( not all ( matches . values ( ) ) ) : print ( u'In builtin registry but not in download:' ) for name in in_dl : if ( not in_dl [ name ] ) : print ( u'    ' , name ) print ( u'In both but not the same value:' ) for name in matches : if ( ( not matches [ name ] ) and in_dl [ name ] ) : print ( u'    ' , name , u'builtin:' , builtin_registry [ name ] , u'download:' , dl_registry [ name ] ) assert False , u"Builtin and download registry aren't consistent - failures printed to stdout"
this function checks that the builtin sites registry is consistent with the remote registry .