docstr: Returns an iterator over all datasets owned by the current user.
  
  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 returned.
  
  Args:
      shared:
          * If False (default), returns only datasets owned by the user. In this
          case at most one dataset will be returned.
          * If True, returns datasets which have been shared with the user,
          including team datasets. Excludes user's own datasets. Can return
          multiple datasets.
          * If None, returns all datasets the users has access to. Can return
          multiple datasets.
  
  Returns:
      An iterator over datasets owned by the current user.
docstr_tok: ["Returns","an","iterator","over","all","datasets","owned","by","the","current","user",".","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","returned",".","Args",":","shared",":","*","If","False","(","default",")",",","returns","only","datasets","owned","by","the","user",".","In","this","case","at","most","one","dataset","will","be","returned",".","*","If","True",",","returns","datasets","which","have","been","shared","with","the","user",",","including","team","datasets",".","Excludes","user","'s","own","datasets",".","Can","return","multiple","datasets",".","*","If","None",",","returns","all","datasets","the","users","has","access","to",".","Can","return","multiple","datasets",".","Returns",":","An","iterator","over","datasets","owned","by","the","current","user","."]
code: def get_datasets_iter(
      self, shared: Optional[bool] = False
  ) -> Iterator[DatasetData]:
      """Returns an iterator over all datasets owned by the current user.
  
      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 returned.
  
      Args:
          shared:
              * If False (default), returns only datasets owned by the user. In this
              case at most one dataset will be returned.
              * If True, returns datasets which have been shared with the user,
              including team datasets. Excludes user's own datasets. Can return
              multiple datasets.
              * If None, returns all datasets the users has access to. Can return
              multiple datasets.
  
      Returns:
          An iterator over datasets owned by the current user.
      """
      dataset_iterable: Iterator[DatasetData] = (_ for _ in ())
      if not shared or shared is None:
          dataset_iterable = utils.paginate_endpoint(
              self._datasets_api.get_datasets,
              shared=False,
          )
      if shared or shared is None:
          dataset_iterable = chain(
              dataset_iterable,
              utils.paginate_endpoint(
                  self._datasets_api.get_datasets,
                  shared=True,
              ),
          )
          dataset_iterable = chain(
              dataset_iterable,
              utils.paginate_endpoint(
                  self._datasets_api.get_datasets,
                  get_assets_of_team=True,
              ),
          )
  
      # De-duplicate datasets because results from shared=True and
      # those from get_assets_of_team=True might overlap
      dataset_ids: Set[str] = set()
      for dataset in dataset_iterable:
          if dataset.id not in dataset_ids:
              dataset_ids.add(dataset.id)
              yield dataset
  
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 7 for calling the _DatasetsMixin obj's underlying member method code with example usage: obj.get_datasets_iter(shared) without return types