docstr: Exports samples in a format compatible with Label Studio.
  
  The format is documented here:
  https://labelstud.io/guide/tasks.html#Basic-Label-Studio-JSON-format
  
  Args:
      tag_id:
          Id of the tag which should exported.
  
  Returns:
      A list of dictionaries in a format compatible with Label Studio.
  
  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.export_label_studio_tasks_by_tag_id(tag_id="646f34608a5613b57d8b73cc")
      [{'id': 0, 'data': {'image': '...', ...}}]
docstr_tok: ["Exports","samples","in","a","format","compatible","with","Label","Studio",".","The","format","is","documented","here",":","https",":","\/\/labelstud.io\/guide\/tasks.html","#","Basic-Label-Studio-JSON-format","Args",":","tag_id",":","Id","of","the","tag","which","should","exported",".","Returns",":","A","list","of","dictionaries","in","a","format","compatible","with","Label","Studio",".","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.export_label_studio_tasks_by_tag_id","(","tag_id=","''","646f34608a5613b57d8b73cc","''",")","[","{","'id","'",":","0",",","'data","'",":","{","'image","'",":","'","...","'",",","...","}","}","]"]
code: def export_label_studio_tasks_by_tag_id(
      self,
      tag_id: str,
  ) -> List[Dict]:
      """Exports samples in a format compatible with Label Studio.
  
      The format is documented here:
      https://labelstud.io/guide/tasks.html#Basic-Label-Studio-JSON-format
  
      Args:
          tag_id:
              Id of the tag which should exported.
  
      Returns:
          A list of dictionaries in a format compatible with Label Studio.
  
      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.export_label_studio_tasks_by_tag_id(tag_id="646f34608a5613b57d8b73cc")
          [{'id': 0, 'data': {'image': '...', ...}}]
      """
      label_studio_tasks = list(
          utils.paginate_endpoint(
              self._tags_api.export_tag_to_label_studio_tasks,
              page_size=20000,
              dataset_id=self.dataset_id,
              tag_id=tag_id,
          )
      )
      return label_studio_tasks
  
imports: import io
  import os
  import urllib.request
  import warnings
  from concurrent.futures.thread import ThreadPoolExecutor
  from typing import Dict, List, Optional
  from urllib.request import Request
  import tqdm
  from PIL import Image
  from lightly.api import download, utils
  from lightly.api.bitmask import BitMask
  from lightly.openapi_generated.swagger_client.models import DatasetEmbeddingData, ImageType
  from lightly.utils.hipify import bcolors
label_desc: Use image node_id 6 for calling the _DownloadDatasetMixin obj's underlying member method code with example usage: obj.export_label_studio_tasks_by_tag_id(tag_id) and returns: label_studio_tasks