code: def _sample_unseen_and_valid(
      sample: DatasourceRawSamplesDataRow,
      relevant_filenames_file_name: Optional[str],
      listed_filenames: Set[str],
  ) -> bool:
      # Note: We want to remove these checks eventually. Absolute paths and relative paths
      # with dot notation should be handled either in the API or the Worker. Duplicate
      # filenames should be handled in the Worker as handling it in the API would require
      # too much memory.
      if sample.file_name.startswith("/"):
          warnings.warn(
              UserWarning(
                  f"Absolute file paths like {sample.file_name} are not supported"
                  f" in relevant filenames file {relevant_filenames_file_name} due to blob storage"
              )
          )
          return False
      elif sample.file_name.startswith(("./", "../")):
          warnings.warn(
              UserWarning(
                  f"Using dot notation ('./', '../') like in {sample.file_name} is not supported"
                  f" in relevant filenames file {relevant_filenames_file_name} due to blob storage"
              )
          )
          return False
      elif sample.file_name in listed_filenames:
          warnings.warn(
              UserWarning(
                  f"Duplicate filename {sample.file_name} in relevant"
                  f" filenames file {relevant_filenames_file_name}"
              )
          )
          return False
      else:
          return True
  
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 1 for calling a global function with example usage: _sample_unseen_and_valid(sample, relevant_filenames_file_name, listed_filenames) and returns: False, False, False, True