docstr: Downloads filenames and read urls of unprocessed samples from the datasource.
  
  All samples after the timestamp of `ApiWorkflowClient.get_processed_until_timestamp()` are
  fetched. After downloading the samples, the timestamp is updated to the current time.
  This function can be repeatedly called to retrieve new samples from the datasource.
  
  Args:
      use_redirected_read_url:
          Flag for redirected read urls. When this flag is true,
          RedirectedReadUrls are returned instead of ReadUrls, meaning that the
          returned URLs have unlimited access to the file.
          Defaults to False. When S3DelegatedAccess is configured, this flag has
          no effect because RedirectedReadUrls are always returned.
  
  Returns:
      A list of (filename, url) tuples where each tuple represents a sample.
  
  Examples:
      >>> client = ApiWorkflowClient(token="MY_AWESOME_TOKEN")
      >>>
      >>> # Already created some Lightly Worker runs with this dataset
      >>> client.set_dataset_id_by_name("my-dataset")
      >>> client.download_new_raw_samples()
      [('image-3.png', 'https://......'), ('image-4.png', 'https://......')]
docstr_tok: ["Downloads","filenames","and","read","urls","of","unprocessed","samples","from","the","datasource",".","All","samples","after","the","timestamp","of","`","ApiWorkflowClient.get_processed_until_timestamp","(",")","`","are","fetched",".","After","downloading","the","samples",",","the","timestamp","is","updated","to","the","current","time",".","This","function","can","be","repeatedly","called","to","retrieve","new","samples","from","the","datasource",".","Args",":","use_redirected_read_url",":","Flag","for","redirected","read","urls",".","When","this","flag","is","true",",","RedirectedReadUrls","are","returned","instead","of","ReadUrls",",","meaning","that","the","returned","URLs","have","unlimited","access","to","the","file",".","Defaults","to","False",".","When","S3DelegatedAccess","is","configured",",","this","flag","has","no","effect","because","RedirectedReadUrls","are","always","returned",".","Returns",":","A","list","of","(","filename",",","url",")","tuples","where","each","tuple","represents","a","sample",".","Examples",":",">",">",">","client","=","ApiWorkflowClient","(","token=","''","MY_AWESOME_TOKEN","''",")",">",">",">",">",">",">","#","Already","created","some","Lightly","Worker","runs","with","this","dataset",">",">",">","client.set_dataset_id_by_name","(","``","my-dataset","''",")",">",">",">","client.download_new_raw_samples","(",")","[","(","'image-3.png","'",",","'https",":","\/\/","......","'",")",",","(","'image-4.png","'",",","'https",":","\/\/","......","'",")","]"]
code: def download_new_raw_samples(
      self,
      use_redirected_read_url: bool = False,
  ) -> List[Tuple[str, str]]:
      """Downloads filenames and read urls of unprocessed samples from the datasource.
  
      All samples after the timestamp of `ApiWorkflowClient.get_processed_until_timestamp()` are
      fetched. After downloading the samples, the timestamp is updated to the current time.
      This function can be repeatedly called to retrieve new samples from the datasource.
  
      Args:
          use_redirected_read_url:
              Flag for redirected read urls. When this flag is true,
              RedirectedReadUrls are returned instead of ReadUrls, meaning that the
              returned URLs have unlimited access to the file.
              Defaults to False. When S3DelegatedAccess is configured, this flag has
              no effect because RedirectedReadUrls are always returned.
  
      Returns:
          A list of (filename, url) tuples where each tuple represents a sample.
  
      Examples:
          >>> client = ApiWorkflowClient(token="MY_AWESOME_TOKEN")
          >>>
          >>> # Already created some Lightly Worker runs with this dataset
          >>> client.set_dataset_id_by_name("my-dataset")
          >>> client.download_new_raw_samples()
          [('image-3.png', 'https://......'), ('image-4.png', 'https://......')]
      """
      from_ = self.get_processed_until_timestamp()
  
      if from_ != 0:
          # We already processed samples at some point.
          # Add 1 because the samples with timestamp == from_
          # have already been processed
          from_ += 1
  
      to = int(time.time())
      data = self.download_raw_samples(
          from_=from_,
          to=to,
          relevant_filenames_file_name=None,
          use_redirected_read_url=use_redirected_read_url,
      )
      self.update_processed_until_timestamp(timestamp=to)
      return data
  
imports: import time
  import warnings
  from typing import Dict, Iterator, List, Optional, Set, Tuple, Union
  import tqdm
  from lightly.openapi_generated.swagger_client.models import DatasourceConfig, DatasourceProcessedUntilTimestampRequest, DatasourceProcessedUntilTimestampResponse, DatasourcePurpose, DatasourceRawSamplesData
  from lightly.openapi_generated.swagger_client.models.datasource_raw_samples_data_row import DatasourceRawSamplesDataRow
label_desc: Use image node_id 6 for calling the _DatasourcesMixin obj's underlying member method code with example usage: obj.download_new_raw_samples(use_redirected_read_url) and returns: data