Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def get_iterator(self):
"""Get iterator of models so it can be used as "for model in Models().get_iterator()".
"""
return iter(datalab.utils.Iterator(self._retrieve_models))
def get_iterator(self):
"""Get iterator of versions so it can be used as
"for v in ModelVersions(model_name).get_iterator()".
"""
return iter(datalab.utils.Iterator(self._retrieve_versions))
def __iter__(self):
""" Returns an iterator for iterating through the Datasets in the project.
"""
return iter(datalab.utils.Iterator(self._retrieve_projects))
def views(self):
""" Returns an iterator for iterating through the Views in the dataset. """
return iter(datalab.utils.Iterator(self._retrieve_views))
def get_iterator(self):
"""Get iterator of jobs so it can be used as "for model in Jobs().get_iterator()".
"""
return iter(datalab.utils.Iterator(self._retrieve_jobs))
def range(self, start_row=0, max_rows=None):
""" Get an iterator to iterate through a set of table rows.
Args:
start_row: the row of the table at which to start the iteration (default 0)
max_rows: an upper limit on the number of rows to iterate through (default None)
Returns:
A row iterator.
"""
fetcher = self._get_row_fetcher(start_row=start_row, max_rows=max_rows)
return iter(datalab.utils.Iterator(fetcher))