docstr: Checks if a dataset with the given name exists.
  
  There can be multiple datasets with the same name accessible to the current
  user. This can happen if either:
  * A dataset has been explicitly shared with the user
  * The user has access to team datasets
  The `shared` flag controls whether these datasets are checked.
  
  Args:
      dataset_name:
          Name of the dataset.
      shared:
          * If False (default), checks only datasets owned by the user.
          * If True, checks datasets which have been shared with the user,
          including team datasets. Excludes user's own datasets.
          * If None, checks all datasets the users has access to.
  
  Returns:
      A boolean value indicating whether any dataset with the given name exists.
  
  Examples:
      >>> client = ApiWorkflowClient(token="MY_AWESOME_TOKEN")
      >>> client.create_dataset("your-dataset-name", dataset_type=DatasetType.IMAGES)
      >>> client.dataset_name_exists(dataset_name="your-dataset-name")
      True
docstr_tok: ["Checks","if","a","dataset","with","the","given","name","exists",".","There","can","be","multiple","datasets","with","the","same","name","accessible","to","the","current","user",".","This","can","happen","if","either",":","*","A","dataset","has","been","explicitly","shared","with","the","user","*","The","user","has","access","to","team","datasets","The","`","shared","`","flag","controls","whether","these","datasets","are","checked",".","Args",":","dataset_name",":","Name","of","the","dataset",".","shared",":","*","If","False","(","default",")",",","checks","only","datasets","owned","by","the","user",".","*","If","True",",","checks","datasets","which","have","been","shared","with","the","user",",","including","team","datasets",".","Excludes","user","'s","own","datasets",".","*","If","None",",","checks","all","datasets","the","users","has","access","to",".","Returns",":","A","boolean","value","indicating","whether","any","dataset","with","the","given","name","exists",".","Examples",":",">",">",">","client","=","ApiWorkflowClient","(","token=","''","MY_AWESOME_TOKEN","''",")",">",">",">","client.create_dataset","(","``","your-dataset-name","''",",","dataset_type=DatasetType.IMAGES",")",">",">",">","client.dataset_name_exists","(","dataset_name=","''","your-dataset-name","''",")","True"]
code: def dataset_name_exists(
      self, dataset_name: str, shared: Optional[bool] = False
  ) -> bool:
      """Checks if a dataset with the given name exists.
  
      There can be multiple datasets with the same name accessible to the current
      user. This can happen if either:
      * A dataset has been explicitly shared with the user
      * The user has access to team datasets
      The `shared` flag controls whether these datasets are checked.
  
      Args:
          dataset_name:
              Name of the dataset.
          shared:
              * If False (default), checks only datasets owned by the user.
              * If True, checks datasets which have been shared with the user,
              including team datasets. Excludes user's own datasets.
              * If None, checks all datasets the users has access to.
  
      Returns:
          A boolean value indicating whether any dataset with the given name exists.
  
      Examples:
          >>> client = ApiWorkflowClient(token="MY_AWESOME_TOKEN")
          >>> client.create_dataset("your-dataset-name", dataset_type=DatasetType.IMAGES)
          >>> client.dataset_name_exists(dataset_name="your-dataset-name")
          True
      """
      return bool(
          self.get_datasets_by_name(
              dataset_name=dataset_name, shared=shared
          )
      )
  
imports: import warnings
  from itertools import chain
  from typing import Iterator, List, Optional, Set
  from lightly.api import utils
  from lightly.openapi_generated.swagger_client.models import CreateEntityResponse, DatasetCreateRequest, DatasetData, DatasetType
  from lightly.openapi_generated.swagger_client.rest import ApiException
label_desc: Use image node_id 4 for calling the _DatasetsMixin obj's underlying member method code with example usage: obj.dataset_name_exists(dataset_name, shared) and returns: bool