Check if the data set is available on the local machine already.
185782
def data_available(dataset_name=None):
    """"""
    dr = data_resources[dataset_name]
    if 'dirs' in dr:
        for dirs, files in zip(dr['dirs'], dr['files']):
            for dir, file in zip(dirs, files):
                if not os.path.exists(os.path.join(data_path, dataset_name, dir, file)):
                    return False
    else:
        for file_list in dr['files']:
            for file in file_list:
                if not os.path.exists(os.path.join(data_path, dataset_name, file)):
                    return False
    return True
1140427
def _check(self): # TODO: fix?
        """"""
        if self._returncode:
            rarfile.check_returncode(self, '')
        if self._remain != 0:
            raise rarfile.BadRarFile("Failed the read enough data")
729222
def is_unprocessed_local_replica(pid):
    """"""
    return d1_gmn.app.models.LocalReplica.objects.filter(
        pid__did=pid, info__status__status='queued'
    ).exists()
194809
@Override
	public boolean hasMoreData(final String dataSetKey) {
		List<? extends DataSource> dataSources = dataSourcesProvider.get();
		for (DataSource ds : dataSources) {
			if (ds.hasMoreData(dataSetKey)) {
				return true;
			}
		}
		return false;
	}
1191037
def check_if_ready(self):
        """"""
        try:
            results = self.manager.check(self.results_id)
        except exceptions.ResultsNotReady as e:
            self._is_ready = False
            self._not_ready_exception = e
        except exceptions.ResultsExpired as e:
            self._is_ready = True
            self._expired_exception = e
        else:
            failures = self.get_failed_requests(results)
            members = self.get_new_members(results)
            self.results = self.__class__.Results(list(members), list(failures))
            self._is_ready = True
            self._not_ready_exception = None
1080387
def available():
    """"""
    proc = popen_multiple(
        COMMANDS,
        ['-version'],
        stdout=subprocess.PIPE,
        stderr=subprocess.PIPE,
        creationflags=PROC_FLAGS,
    )
    proc.wait()
    return (proc.returncode == 0)
12718
def exists(self):
    
    try:
      info = self._api.tables_get(self._name_parts)
    except google.datalab.utils.RequestException as e:
      if e.status == 404:
        return False
      raise e
    except Exception as e:
      raise e
    self._info = info
    return True
422590
def db_exists():
    """"""
    logger.info("Checking to see if %s already exists", repr(DB["NAME"]))
    try:
        # Hide stderr since it is confusing here
        psql("", stderr=subprocess.STDOUT)
    except subprocess.CalledProcessError:
        return False
    return True
808871
def _CheckData(yaml_data):
  """"""
  legal_keys = set(('blacklist', 'whitelist'))
  unknown_keys = set(yaml_data) - legal_keys
  if unknown_keys:
    raise UnknownConfigKeyError(
        'Unknown keys in configuration: %s' % unknown_keys)

  for key, data in six.iteritems(yaml_data):
    _AssertDataIsList(key, data)
705324
def check_pool(self, name):
        '''
        
        '''
        pools = self.bigIP.LocalLB.Pool
        for pool in pools.get_list():
            if pool.split('/')[-1] == name:
                return True
        return False
1037170
def is_available(self):
        
        # if the availability flag is raised, return True immediately.
        # NOTE: subsequent API failures will lower this flag. we do this here
        # to ensure we don't keep hitting Joe with requests while availability
        # is there.
        if self.server_available:
            return True

        # otherwise, we have to check with the cloud.
        else:

            try:
                self.server_available = self.jbx.server_online()
                return self.server_available
            except jbxapi.JoeException:
                pass

        self.server_available = False
        return False
356449
def verify_space_available(self, search_pattern=r"(\d+) \w+ free"):
        """"""
        if self.direction == "put":
            space_avail = self.remote_space_available(search_pattern=search_pattern)
        elif self.direction == "get":
            space_avail = self.local_space_available()
        if space_avail > self.file_size:
            return True
        return False
206958
def exists(self):
        """"""

        try:
            self.blob.reload()
            return True
        except google.cloud.exceptions.NotFound: return False
1007460
def has_data(self, datatype, mode, disp):
        

        # Imports
        from ..error import RepoError

        # Just try to get the data. Simply pass up all exceptions except for
        #  those if the group or data doesn't exist. DO re-raise a non-bound
        #  repo. Initialize value to DATA PRESENT (True) for case where data
        #  is present and the 'try' succeeds.
        retval = True
        try:
            self.get_data(datatype, mode, disp)
        except RepoError as RErr:
            if RErr.tc in (RErr.DATA, RErr.GROUP):
                retval = False
            ## end if
        ## end try

        # Should be good to return
        return retval
233275
@Override
	public boolean hasMoreData(final String dataSetKey) {
		if (getCsvFiles().containsKey(dataSetKey)) {
			CsvFile csvFile = getCsvFiles().get(dataSetKey);
			if (csvFile.lines == null) {
				try {
					csvFile.load();
				} catch (IOException e) {
					throw new IllegalArgumentException("Could not load CSV file " + csvFile.fileName, e);
				}
			}
			return csvFile.hasNextLine();
		}
		return false;
	}
583827
def verify(dataset, publication_date, source, refernce_url):
    """"""

    config = ApiConfig()
    client = ApiClient(config.host, config.app_id, config.app_secret)
    client.check_correct_host()
    client.verify(dataset, publication_date, source, refernce_url)
663476
def download_data(dataset_name=None, prompt=prompt_stdin):
    """"""
        
    dr = data_resources[dataset_name]
    if not authorize_download(dataset_name, prompt=prompt):
        raise Exception("Permission to download data set denied.")
    
    if 'suffices' in dr:
        for url, files, suffices in zip(dr['urls'], dr['files'], dr['suffices']):
            for file, suffix in zip(files, suffices):
                download_url(url=os.path.join(url,file),
                             dir_name = data_path,
                             store_directory=dataset_name,
                             suffix=suffix)
    elif 'dirs' in dr:
        for url, dirs, files in zip(dr['urls'], dr['dirs'], dr['files']):
            for file, dir in zip(files, dirs):
                print(file, dir)
                download_url(
                    url=os.path.join(url,dir,file),
                    dir_name = data_path,
                    store_directory=os.path.join(dataset_name,dir)
                    )
    else:
        for url, files in zip(dr['urls'], dr['files']):
            for file in files:
                download_url(
                    url=os.path.join(url,file),
                    dir_name = data_path,
                    store_directory=dataset_name
                    )
    return True