def get_pkg_data_filename(data_name, package=None, show_progress=True, remote_timeout=None):
 data_name = os.path.normpath(data_name)
 if (remote_timeout is None):
  remote_timeout = conf.remote_timeout
 if data_name.startswith(u'hash/'):
  hashfn = _find_hash_fn(data_name[5:])
  if (hashfn is None):
   return download_file((conf.dataurl + data_name), cache=True, show_progress=show_progress, timeout=remote_timeout)
  else:
   return hashfn
 else:
  datafn = _find_pkg_data_path(data_name, package=package)
  if os.path.isdir(datafn):
   raise IOError(u"Tried to access a data file that's actually a package data directory")
  elif os.path.isfile(datafn):
   return datafn
  else:
   return download_file((conf.dataurl + data_name), cache=True, show_progress=show_progress, timeout=remote_timeout)

def get_pkg_data_filename ( data_name , package = None , show_progress = True , remote_timeout = None ) : data_name = os . path . normpath ( data_name ) if ( remote_timeout is None ) : remote_timeout = conf . remote_timeout if data_name . startswith ( u'hash/' ) : hashfn = _find_hash_fn ( data_name [ 5 : ] ) if ( hashfn is None ) : return download_file ( ( conf . dataurl + data_name ) , cache = True , show_progress = show_progress , timeout = remote_timeout ) else : return hashfn else : datafn = _find_pkg_data_path ( data_name , package = package ) if os . path . isdir ( datafn ) : raise IOError ( u"Tried to access a data file that's actually a package data directory" ) elif os . path . isfile ( datafn ) : return datafn else : return download_file ( ( conf . dataurl + data_name ) , cache = True , show_progress = show_progress , timeout = remote_timeout )
retrieves a data file from the standard locations for the package and provides a local filename for the data .