
    ]jL                   6   d dl mZ d dlZd dlZddlmZmZ ddlm	Z	m
Z
 ddlmZ ddlmZ ddlmZ dd	lmZ dd
lmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlm Z  ddl!m"Z" ddl#m$Z$ ddl%m&Z& ddl'm(Z( ddl)m*Z* ddl+m,Z, ddl-m.Z. ddl/m0Z0m1Z1 ddl2m3Z3 ddl4m5Z5 ddl6m7Z7 ejp                  r8ddl9m:Z:m;Z; ddl<m=Z=m>Z> ddl?m@Z@mAZA dd lBmCZCmDZD dd!lEmFZFmGZG dd"lHmIZImJZJ dd#lKmLZLmMZM  ej                  ej                  d$      ZP G d% d&      ZQ G d' d(      ZRy))    )annotationsN   )AsyncClientWrapperSyncClientWrapper)
AsyncPager	SyncPager)RequestOptions)AgreementMethodologyEnum)AllRolesProjectList)AssignmentSettingsRequest)ImportApiRequest)LseProjectCreate)LseProjectResponse)LseProjectUpdate)ModeEnum) PaginatedAllRolesProjectListList)PaginatedLseProjectCountsList)PredictionRequest)ProjectLabelConfig)ReviewSettingsRequest)SamplingDe5Enum)SkipQueueEnum)
UserSimple)UserSimpleRequest   )AsyncRawProjectsClientRawProjectsClient)DuplicateProjectsResponse)!ImportPredictionsProjectsResponse)ImportTasksProjectsResponse)AssignmentsClientAsyncAssignmentsClient)AsyncExportsClientExportsClient)AsyncMembersClientMembersClient)AsyncMetricsClientMetricsClient)AsyncPausesClientPausesClient)AsyncRolesClientRolesClient)AsyncStatsClientStatsClient.c            3         e Zd ZddZedd       Zddddddddddddd	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 d dZeeeeeeeeeeeeeeeeeeeeeeeeeeeeeedd	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 d!dZdddddddddddd	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 d"d	Z	ddd
	 	 	 	 	 	 	 d#dZ
ddd$dZdeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeedd2	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 d%dZdd	 	 	 	 	 d&dZedd	 	 	 	 	 	 	 	 	 	 	 	 	 d'dZddddd	 	 	 	 	 	 	 	 	 	 	 	 	 d(dZdd	 	 	 	 	 	 	 d)dZdd	 	 	 	 	 	 	 d*dZed        Zed        Zed        Zed        Zed        Zed        Zed        Zy)+ProjectsClientc                   t        |      | _        || _        d | _        d | _        d | _        d | _        d | _        d | _        d | _	        y Nclient_wrapper)
r   _raw_client_client_wrapper_roles_exports_members_metrics_stats_assignments_pausesselfr4   s     J/root/env/lib/python3.12/site-packages/label_studio_sdk/projects/client.py__init__zProjectsClient.__init__.   sI    ,NK-488<8<8<48@D6:    c                    | j                   S )z
        Retrieves a raw implementation of this client that returns raw responses.

        Returns
        -------
        RawProjectsClient
        r5   r?   s    r@   with_raw_responsez ProjectsClient.with_raw_response9        rB   Nfilteridsincludemembers_limitorderingpage	page_sizesearchstatetitle
workspacesrequest_optionsc               P    | j                   j                  |||||||||	|
||      S )a;  
        Retrieve a list of projects.

        Parameters
        ----------
        filter : typing.Optional[str]
            Filter projects by pinned status. Use 'pinned_only' to return only pinned projects, 'exclude_pinned' to return only non-pinned projects, or 'all' to return all projects.

        ids : typing.Optional[str]
            Filter id by in list

        include : typing.Optional[str]
            Comma-separated list of count fields to include in the response to optimize performance. Available fields: task_number, finished_task_number, total_predictions_number, total_annotations_number, num_tasks_with_annotations, useful_annotation_number, ground_truth_number, skipped_annotations_number. If not specified, all count fields are included.

        members_limit : typing.Optional[int]
            Maximum number of members to return

        ordering : typing.Optional[str]
            Which field to use when ordering the results.

        page : typing.Optional[int]
            A page number within the paginated result set.

        page_size : typing.Optional[int]
            Number of results to return per page.

        search : typing.Optional[str]
            Search term for project title and description

        state : typing.Optional[str]
            Filter current_state by exact match

        title : typing.Optional[str]
            Filter title by contains (case-insensitive)

        workspaces : typing.Optional[float]
            Filter workspaces by exact match

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        SyncPager[AllRolesProjectList, PaginatedAllRolesProjectListList]


        Examples
        --------
        from label_studio_sdk import LabelStudio

        client = LabelStudio(
            api_key="YOUR_API_KEY",
        )
        response = client.projects.list()
        for item in response:
            yield item
        # alternatively, you can paginate page-by-page
        for page in response.iter_pages():
            yield page
        rH   r5   listr?   rI   rJ   rK   rL   rM   rN   rO   rP   rQ   rR   rS   rT   s                r@   rW   zProjectsClient.listD   sG    X $$'!+ % 
 	
rB   annotator_evaluation_enabledcolorcontrol_weights
created_bydescriptionenable_empty_annotation"evaluate_predictions_automaticallyexpert_instructionis_draftis_publishedlabel_configmaximum_annotations!min_annotations_to_start_trainingmodel_versionorganizationoverlap_cohort_percentage	pinned_at#reveal_preannotations_interactivelysamplingshow_annotation_historyshow_collab_predictionsshow_ground_truth_firstshow_instructionshow_overlap_firstshow_skip_button
skip_queuetask_data_logintask_data_passwordrR   	workspacerT   c                   | j                   j                  d i d|d|d|d|d|d|d|d|d	|	d
|
d|d|d|d|d|d|d|d|d|d|d|d|d|d|d|d|d|d|d|d|d|} | j                  S )!a  
        Create a project for a specific organization.

        Parameters
        ----------
        annotator_evaluation_enabled : typing.Optional[bool]
            Enable annotator evaluation for the project

        color : typing.Optional[str]

        control_weights : typing.Optional[typing.Dict[str, typing.Any]]
            Dict of weights for each control tag in metric calculation.

        created_by : typing.Optional[UserSimpleRequest]
            Project owner

        description : typing.Optional[str]
            Project Description

        enable_empty_annotation : typing.Optional[bool]
            Allow annotators to submit empty annotations

        evaluate_predictions_automatically : typing.Optional[bool]
            Retrieve and display predictions when loading a task

        expert_instruction : typing.Optional[str]
            Labeling instructions in HTML format

        is_draft : typing.Optional[bool]
            Whether or not the project is in the middle of being created

        is_published : typing.Optional[bool]
            Whether or not the project is published to annotators

        label_config : typing.Optional[str]
            Label config in XML format. See more about it in documentation

        maximum_annotations : typing.Optional[int]
            Maximum number of annotations for one task. If the number of annotations per task is equal or greater to this value, the task is completed (is_labeled=True)

        min_annotations_to_start_training : typing.Optional[int]
            Minimum number of completed tasks after which model training is started

        model_version : typing.Optional[str]
            Machine learning model version

        organization : typing.Optional[int]

        overlap_cohort_percentage : typing.Optional[int]

        pinned_at : typing.Optional[dt.datetime]
            Pinned date and time

        reveal_preannotations_interactively : typing.Optional[bool]
            Reveal pre-annotations interactively

        sampling : typing.Optional[SamplingDe5Enum]

        show_annotation_history : typing.Optional[bool]
            Show annotation history to annotator

        show_collab_predictions : typing.Optional[bool]
            If set, the annotator can view model predictions

        show_ground_truth_first : typing.Optional[bool]
            Onboarding mode (true): show ground truth tasks first in the labeling stream

        show_instruction : typing.Optional[bool]
            Show instructions to the annotator before they start

        show_overlap_first : typing.Optional[bool]

        show_skip_button : typing.Optional[bool]
            Show a skip button in interface and allow annotators to skip the task

        skip_queue : typing.Optional[SkipQueueEnum]

        task_data_login : typing.Optional[str]
            Task data credentials: login

        task_data_password : typing.Optional[str]
            Task data credentials: password

        title : typing.Optional[str]
            Project Title

        workspace : typing.Optional[int]
            In Workspace

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        LseProjectCreate


        Examples
        --------
        from label_studio_sdk import LabelStudio

        client = LabelStudio(
            api_key="YOUR_API_KEY",
        )
        client.projects.create()
        rZ   r[   r\   r]   r^   r_   r`   ra   rb   rc   rd   re   rf   rg   rh   ri   rj   rk   rl   rm   rn   ro   rp   rq   rr   rs   rt   ru   rR   rv   rT    r5   createdata!r?   rZ   r[   r\   r]   r^   r_   r`   ra   rb   rc   rd   re   rf   rg   rh   ri   rj   rk   rl   rm   rn   ro   rp   rq   rr   rs   rt   ru   rR   rv   rT   	_responses!                                    r@   rz   zProjectsClient.create   s`   Z ,D$$++  
)E 
 
 , 
 "	 

 $ 
 %< 
 0R 
  2 
  
 & 
 & 
 !4 
 /P 
 ( 
 & 
  '@! 
"  # 
$ 1T% 
& ' 
( %<) 
* %<+ 
, %<- 
. ./ 
0  21 
2 .3 
4 "5 
6 ,7 
8  29 
: ; 
<  = 
> ,? 
	B ~~rB   rI   rJ   rK   rM   rN   rO   rP   rQ   rR   rS   rT   c               f    | j                   j                  |||||||||	|
|      }|j                  S )a\  
        Returns a list of projects with their counts. For example, task_number which is the total task number in project

        Parameters
        ----------
        filter : typing.Optional[str]
            Filter projects by pinned status. Use 'pinned_only' to return only pinned projects, 'exclude_pinned' to return only non-pinned projects, or 'all' to return all projects.

        ids : typing.Optional[str]
            Filter id by in list

        include : typing.Optional[str]
            Comma-separated list of count fields to include in the response to optimize performance. Available fields: task_number, finished_task_number, total_predictions_number, total_annotations_number, num_tasks_with_annotations, useful_annotation_number, ground_truth_number, skipped_annotations_number. If not specified, all count fields are included.

        ordering : typing.Optional[str]
            Which field to use when ordering the results.

        page : typing.Optional[int]
            A page number within the paginated result set.

        page_size : typing.Optional[int]
            Number of results to return per page.

        search : typing.Optional[str]
            Search term for project title and description

        state : typing.Optional[str]
            Filter current_state by exact match

        title : typing.Optional[str]
            Filter title by contains (case-insensitive)

        workspaces : typing.Optional[float]
            Filter workspaces by exact match

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        PaginatedLseProjectCountsList


        Examples
        --------
        from label_studio_sdk import LabelStudio

        client = LabelStudio(
            api_key="YOUR_API_KEY",
        )
        client.projects.list_counts()
        r~   r5   list_countsr{   r?   rI   rJ   rK   rM   rN   rO   rP   rQ   rR   rS   rT   r}   s                r@   r   zProjectsClient.list_countsO  sM    F $$00!+ 1 
	 ~~rB   rL   rT   c               V    | j                   j                  |||      }|j                  S )a  
        Retrieve information about a project by project ID.

        Parameters
        ----------
        id : int

        members_limit : typing.Optional[int]
            Maximum number of members to return

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        LseProjectResponse
            Project information. Not all fields are available for all roles.

        Examples
        --------
        from label_studio_sdk import LabelStudio

        client = LabelStudio(
            api_key="YOUR_API_KEY",
        )
        client.projects.get(
            id=1,
        )
        r   r5   getr{   r?   idrL   rT   r}   s        r@   r   zProjectsClient.get  s-    H $$((=Zi(j	~~rB   rT   c               T    | j                   j                  ||      }|j                  S )a  
        Delete a project by specified project ID.

        Parameters
        ----------
        id : int

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        None

        Examples
        --------
        from label_studio_sdk import LabelStudio

        client = LabelStudio(
            api_key="YOUR_API_KEY",
        )
        client.projects.delete(
            id=1,
        )
        r   r5   deleter{   r?   r   rT   r}   s       r@   r   zProjectsClient.delete  s)    4 $$++B+P	~~rB   2rL   agreement_methodologyagreement_thresholdannotation_limit_countannotation_limit_percent%annotator_evaluation_continuous_tasksrZ   "annotator_evaluation_minimum_score"annotator_evaluation_minimum_tasks%annotator_evaluation_onboarding_tasksassignment_settingsr[   comment_classification_configr\   r]   custom_scriptcustom_task_lock_ttlr^   r_   r`   ra   rb   rc   rd   $max_additional_annotators_assignablere   rf   rg   rh   ri   $pause_on_failed_annotator_evaluationrj   require_comment_on_skiprk   review_settingsrl   rm   rn   ro   rp   rq   rr   &show_unused_data_columns_to_annotatorsrs   strict_task_overlaprt   ru   rR   rv   rT   c       2        |    | j                   j                  |fi d|d|d|d|d|d|d|d|	d	|
d
|d|d|d|d|d|d|d|d|d|d|d|d|d|d|d|d|d|d|d|d|d| d |!d!|"d"|#d#|$d$|%d%|&d&|'d'|(d(|)d)|*d*|+d+|,d,|-d-|.d.|/d/|0d0|1d1|2d2|3}4|4j                  S )3a  
        Update the details of a specific project.

        Parameters
        ----------
        id : int

        members_limit : typing.Optional[int]
            Maximum number of members to return

        agreement_methodology : typing.Optional[AgreementMethodologyEnum]
            Methodology (Consensus / Pairwise Averaging)

            * `consensus` - Consensus
            * `pairwise` - Pairwise Averaging

        agreement_threshold : typing.Optional[str]
            Agreement threshold

        annotation_limit_count : typing.Optional[int]
            Limit by number of tasks

        annotation_limit_percent : typing.Optional[str]
            Limit by percentage of tasks

        annotator_evaluation_continuous_tasks : typing.Optional[int]
            Continuous Evaluation: Required tasks

        annotator_evaluation_enabled : typing.Optional[bool]
            Evaluate all annotators against ground truth

        annotator_evaluation_minimum_score : typing.Optional[str]
            Score required to pass evaluation

        annotator_evaluation_minimum_tasks : typing.Optional[int]
            Number of tasks for evaluation

        annotator_evaluation_onboarding_tasks : typing.Optional[int]
            Onboarding Evaluation: Required tasks

        assignment_settings : typing.Optional[AssignmentSettingsRequest]

        color : typing.Optional[str]
            Color

        comment_classification_config : typing.Optional[str]

        control_weights : typing.Optional[typing.Dict[str, typing.Any]]
            Dict of weights for each control tag in metric calculation.

        created_by : typing.Optional[UserSimpleRequest]
            Project owner

        custom_script : typing.Optional[str]
            Plugins

        custom_task_lock_ttl : typing.Optional[int]
            Task reservation time. TTL in seconds (UI displays and edits this value in minutes).

        description : typing.Optional[str]
            Description

        enable_empty_annotation : typing.Optional[bool]
            Allow empty annotations

        evaluate_predictions_automatically : typing.Optional[bool]
            Retrieve and display predictions when loading a task

        expert_instruction : typing.Optional[str]
            Instructions

        is_draft : typing.Optional[bool]
            Whether or not the project is in the middle of being created

        is_published : typing.Optional[bool]
            Whether or not the project is published to annotators

        label_config : typing.Optional[str]
            Labeling Configuration

        max_additional_annotators_assignable : typing.Optional[int]
            Maximum additional annotators

        maximum_annotations : typing.Optional[int]
            Annotations per task

        min_annotations_to_start_training : typing.Optional[int]
            Minimum number of completed tasks after which model training is started

        model_version : typing.Optional[str]
            Machine learning model version

        organization : typing.Optional[int]

        overlap_cohort_percentage : typing.Optional[int]
            Annotations per task coverage

        pause_on_failed_annotator_evaluation : typing.Optional[bool]
            Pause annotator on failed evaluation

        pinned_at : typing.Optional[dt.datetime]
            Pinned date and time

        require_comment_on_skip : typing.Optional[bool]
            Require comment to skip

        reveal_preannotations_interactively : typing.Optional[bool]
            Reveal pre-annotations interactively

        review_settings : typing.Optional[ReviewSettingsRequest]

        sampling : typing.Optional[SamplingDe5Enum]

        show_annotation_history : typing.Optional[bool]
            Show Data Manager to Annotators

        show_collab_predictions : typing.Optional[bool]
            Use predictions to pre-label Tasks

        show_ground_truth_first : typing.Optional[bool]
            Onboarding mode (true): show ground truth tasks first in the labeling stream

        show_instruction : typing.Optional[bool]
            Show instructions before labeling

        show_overlap_first : typing.Optional[bool]
            Show tasks with overlap first

        show_skip_button : typing.Optional[bool]
            Allow skipping tasks

        show_unused_data_columns_to_annotators : typing.Optional[bool]
            Show only columns used in labeling configuration to Annotators. API uses inverse field semantics here: set false to show only used columns, set true to show all task.data columns.

        skip_queue : typing.Optional[SkipQueueEnum]

        strict_task_overlap : typing.Optional[bool]
            Enforce strict overlap limit

        task_data_login : typing.Optional[str]
            Login

        task_data_password : typing.Optional[str]
            Password

        title : typing.Optional[str]
            Project Name

        workspace : typing.Optional[int]
            Workspace

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        LseProjectUpdate


        Examples
        --------
        from label_studio_sdk import LabelStudio

        client = LabelStudio(
            api_key="YOUR_API_KEY",
        )
        client.projects.update(
            id=1,
        )
        rL   r   r   r   r   r   rZ   r   r   r   r   r[   r   r\   r]   r   r   r^   r_   r`   ra   rb   rc   rd   r   re   rf   rg   rh   ri   r   rj   r   rk   r   rl   rm   rn   ro   rp   rq   rr   r   rs   r   rt   ru   rR   rv   rT   r5   updater{   5r?   r   rL   r   r   r   r   r   rZ   r   r   r   r   r[   r   r\   r]   r   r   r^   r_   r`   ra   rb   rc   rd   r   re   rf   rg   rh   ri   r   rj   r   rk   r   rl   rm   rn   ro   rp   rq   rr   r   rs   r   rt   ru   rR   rv   rT   r}   s5                                                        r@   r   zProjectsClient.update  sT   B ,D$$++4
'4
 #84
 !4	4

 $:4
 &>4
 3X4
 *F4
 0R4
 0R4
 3X4
 !44
 4
 +H4
 ,4
  "!4
" (#4
$ "6%4
& $'4
( %<)4
* 0R+4
,  2-4
. /4
0 &14
2 &34
4 2V54
6 !474
8 /P94
: (;4
< &=4
> '@?4
@ 2VA4
B  C4
D %<E4
F 1TG4
H ,I4
J K4
L %<M4
N %<O4
P %<Q4
R .S4
T  2U4
V .W4
X 4ZY4
Z "[4
\ !4]4
^ ,_4
`  2a4
b c4
d  e4
f ,g4
	j ~~rB   c               T    | j                   j                  ||      }|j                  S )aO  
        Return unique users who have submitted annotations in the specified project.

        Parameters
        ----------
        id : int

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        typing.List[UserSimple]
            List of annotator users

        Examples
        --------
        from label_studio_sdk import LabelStudio

        client = LabelStudio(
            api_key="YOUR_API_KEY",
        )
        client.projects.list_unique_annotators(
            id=1,
        )
        r   r5   list_unique_annotatorsr{   r   s       r@   r   z%ProjectsClient.list_unique_annotators  s*    : $$;;BP_;`	~~rB   r^   rT   c               \    | j                   j                  ||||||      }|j                  S )a  
        <Card href="https://humansignal.com/goenterprise">
                <img style="pointer-events: none; margin-left: 0px; margin-right: 0px;" src="https://docs.humansignal.com/images/badge.svg" alt="Label Studio Enterprise badge"/>
                <p style="margin-top: 10px; font-size: 14px;">
                    This endpoint is not available in Label Studio Community Edition. [Learn more about Label Studio Enterprise](https://humansignal.com/goenterprise)
                </p>
            </Card>
        Make a copy of project.

        Parameters
        ----------
        id : int

        mode : ModeEnum
            What to Duplicate (Project configuration only / Project configuration and tasks)

            * `settings` - Only settings
            * `settings,data` - Settings and tasks

        title : str
            Project Name

        workspace : int
            Destination Workspace

        description : typing.Optional[str]
            Project Description

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        DuplicateProjectsResponse
            Project duplicated

        Examples
        --------
        from label_studio_sdk import LabelStudio

        client = LabelStudio(
            api_key="YOUR_API_KEY",
        )
        client.projects.duplicate(
            id=1,
            mode="settings",
            title="title",
            workspace=1,
        )
        moderR   rv   r^   rT   r5   	duplicater{   r?   r   r   rR   rv   r^   rT   r}   s           r@   r   zProjectsClient.duplicate  s:    x $$..T)fu / 
	 ~~rB   commit_to_projectpreannotated_from_fieldsreturn_task_idsrT   c               \    | j                   j                  ||||||      }|j                  S )a  
        
                    Import data as labeling tasks in bulk using this API endpoint. You can use this API endpoint to import multiple tasks.
                    One POST request is limited at 250K tasks and 200 MB.
        
                    **Note:** Imported data is verified against a project *label_config* and must
                    include all variables that were used in the *label_config*. For example,
                    if the label configuration has a *$text* variable, then each item in a data object
                    must include a "text" field.
                    <br>
        
                    ## Async Import Behavior
                    <hr style="opacity:0.3">
        
                    **For non-Community editions, this endpoint processes imports asynchronously.**
                    
                    - The POST request **can fail** for invalid parameters, malformed request body, or other request-level validation errors.
                    - However, **data validation errors** that occur during import processing are handled asynchronously and will not cause the POST request to fail.
                    - Upon successful request validation, a response is returned: `{"import": <import_id>}`
                    - Use the returned `import_id` to poll the GET `/api/projects/{project_id}/imports/{import_id}` endpoint to check the import status and see any data validation errors.
                    - Data-level errors and import failures will only be visible in the GET request response.
        
                    For Community edition, imports are processed synchronously and return task counts immediately.
                    <br>
        
                    ## POST requests
                    <hr style="opacity:0.3">
        
                    There are three possible ways to import tasks with this endpoint:
        
                    ### 1. **POST with data**
                    Send JSON tasks as POST data. Only JSON is supported for POSTing files directly.
                    Update this example to specify your authorization token and Label Studio instance host, then run the following from
                    the command line.
        
                    ```bash
                    curl -H 'Content-Type: application/json' -H 'Authorization: Token abc123' \
                    -X POST 'http://localhost:8000/api/projects/1/import' --data '[{"text": "Some text 1"}, {"text": "Some text 2"}]'
                    ```
        
                    ### 2. **POST with files**
                    Send tasks as files. You can attach multiple files with different names.
        
                    - **JSON**: text files in JavaScript object notation format
                    - **CSV**: text files with tables in Comma Separated Values format
                    - **TSV**: text files with tables in Tab Separated Value format
                    - **TXT**: simple text files are similar to CSV with one column and no header, supported for projects with one source only
        
                    Update this example to specify your authorization token, Label Studio instance host, and file name and path,
                    then run the following from the command line:
        
                    ```bash
                    curl -H 'Authorization: Token abc123' \
                    -X POST 'http://localhost:8000/api/projects/1/import' -F 'file=@path/to/my_file.csv'
                    ```
        
                    ### 3. **POST with URL**
                    You can also provide a URL to a file with labeling tasks. Supported file formats are the same as in option 2.
        
                    ```bash
                    curl -H 'Content-Type: application/json' -H 'Authorization: Token abc123' \
                    -X POST 'http://localhost:8000/api/projects/1/import' \
                    --data '[{"url": "http://example.com/test1.csv"}, {"url": "http://example.com/test2.csv"}]'
                    ```
        
                    <br>
                
        
        Parameters
        ----------
        id : int
            A unique integer value identifying this project.
        
        request : typing.Sequence[ImportApiRequest]
        
        commit_to_project : typing.Optional[bool]
            Set to "true" to immediately commit tasks to the project.
        
        preannotated_from_fields : typing.Optional[typing.Union[str, typing.Sequence[str]]]
            List of fields to preannotate from the task data. For example, if you provide a list of `{"text": "text", "prediction": "label"}` items in the request, the system will create a task with the `text` field and a prediction with the `label` field when `preannoted_from_fields=["prediction"]`.
        
        return_task_ids : typing.Optional[bool]
            Set to "true" to return task IDs in the response.
        
        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.
        
        Returns
        -------
        ImportTasksProjectsResponse
            Tasks successfully imported or import queued. **For non-Community editions**, the response will be `{"import": <import_id>}` which you can use to poll the import status. **For Community edition**, the response contains task counts and is processed synchronously.
        
        Examples
        --------
        from label_studio_sdk import LabelStudio
        
        client = LabelStudio(
            api_key="YOUR_API_KEY",
        )
        client.projects.import_tasks(
            id=1,
            request=[],
        )
        requestr   r   r   rT   r5   import_tasksr{   r?   r   r   r   r   r   rT   r}   s           r@   r   zProjectsClient.import_tasks^  s>    d $$11/%=++ 2 
	 ~~rB   c               V    | j                   j                  |||      }|j                  S )az  
        Import model predictions for tasks in the specified project.

        Parameters
        ----------
        id : int
            A unique integer value identifying this project.

        request : typing.Sequence[PredictionRequest]

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        ImportPredictionsProjectsResponse
            Predictions successfully imported

        Examples
        --------
        from label_studio_sdk import LabelStudio, PredictionRequest

        client = LabelStudio(
            api_key="YOUR_API_KEY",
        )
        client.projects.import_predictions(
            id=1,
            request=[
                PredictionRequest(
                    result=[{"key": "value"}],
                    task=1,
                )
            ],
        )
        r   rT   r5   import_predictionsr{   r?   r   r   rT   r}   s        r@   r   z!ProjectsClient.import_predictions  s-    T $$77G]l7m	~~rB   c               V    | j                   j                  |||      }|j                  S )a  
        Determine whether the label configuration for a specific project is valid.

        Parameters
        ----------
        id : int
            A unique integer value identifying this project.

        label_config : str
            Label config in XML format. See more about it in documentation

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        ProjectLabelConfig


        Examples
        --------
        from label_studio_sdk import LabelStudio

        client = LabelStudio(
            api_key="YOUR_API_KEY",
        )
        client.projects.validate_label_config(
            id=1,
            label_config="label_config",
        )
        rd   rT   r5   validate_label_configr{   r?   r   rd   rT   r}   s        r@   r   z$ProjectsClient.validate_label_config  s3    D $$::\? ; 
	 ~~rB   c                n    | j                   ddlm}  || j                        | _         | j                   S )Nr   )r,   r3   )r7   roles.clientr,   r6   )r?   r,   s     r@   roleszProjectsClient.roles.  +    ;;1%T5I5IJDK{{rB   c                n    | j                   ddlm}  || j                        | _         | j                   S )Nr   )r$   r3   )r8   exports.clientr$   r6   )r?   r$   s     r@   exportszProjectsClient.exports6  +    == 5)9M9MNDM}}rB   c                n    | j                   ddlm}  || j                        | _         | j                   S )Nr   )r&   r3   )r9   members.clientr&   r6   )r?   r&   s     r@   memberszProjectsClient.members>  r   rB   c                n    | j                   ddlm}  || j                        | _         | j                   S )Nr   )r(   r3   )r:   metrics.clientr(   r6   )r?   r(   s     r@   metricszProjectsClient.metricsF  r   rB   c                n    | j                   ddlm}  || j                        | _         | j                   S )Nr   )r.   r3   )r;   stats.clientr.   r6   )r?   r.   s     r@   statszProjectsClient.statsN  r   rB   c                n    | j                   ddlm}  || j                        | _         | j                   S )Nr   )r!   r3   )r<   assignments.clientr!   r6   )r?   r!   s     r@   assignmentszProjectsClient.assignmentsV  s0    $= 1AUAU VD   rB   c                n    | j                   ddlm}  || j                        | _         | j                   S )Nr   )r*   r3   )r=   pauses.clientr*   r6   )r?   r*   s     r@   pauseszProjectsClient.pauses^  s+    <<3't7K7KLDL||rB   )r4   r   )returnr   )rI   typing.Optional[str]rJ   r   rK   r   rL   typing.Optional[int]rM   r   rN   r   rO   r   rP   r   rQ   r   rR   r   rS   typing.Optional[float]rT   typing.Optional[RequestOptions]r   z@SyncPager[AllRolesProjectList, PaginatedAllRolesProjectListList]@rZ   typing.Optional[bool]r[   r   r\   -typing.Optional[typing.Dict[str, typing.Any]]r]   "typing.Optional[UserSimpleRequest]r^   r   r_   r   r`   r   ra   r   rb   r   rc   r   rd   r   re   r   rf   r   rg   r   rh   r   ri   r   rj   typing.Optional[dt.datetime]rk   r   rl    typing.Optional[SamplingDe5Enum]rm   r   rn   r   ro   r   rp   r   rq   r   rr   r   rs   typing.Optional[SkipQueueEnum]rt   r   ru   r   rR   r   rv   r   rT   r   r   r   rI   r   rJ   r   rK   r   rM   r   rN   r   rO   r   rP   r   rQ   r   rR   r   rS   r   rT   r   r   r   r   intrL   r   rT   r   r   r   r   r   rT   r   r   Nonehr   r   rL   r   r   z)typing.Optional[AgreementMethodologyEnum]r   r   r   r   r   r   r   r   rZ   r   r   r   r   r   r   r   r   z*typing.Optional[AssignmentSettingsRequest]r[   r   r   r   r\   r   r]   r   r   r   r   r   r^   r   r_   r   r`   r   ra   r   rb   r   rc   r   rd   r   r   r   re   r   rf   r   rg   r   rh   r   ri   r   r   r   rj   r   r   r   rk   r   r   z&typing.Optional[ReviewSettingsRequest]rl   r   rm   r   rn   r   ro   r   rp   r   rq   r   rr   r   r   r   rs   r   r   r   rt   r   ru   r   rR   r   rv   r   rT   r   r   r   r   r   rT   r   r   ztyping.List[UserSimple]r   r   r   r   rR   strrv   r   r^   r   rT   r   r   r   r   r   r   z!typing.Sequence[ImportApiRequest]r   r   r   z8typing.Optional[typing.Union[str, typing.Sequence[str]]]r   r   rT   r   r   r    r   r   r   z"typing.Sequence[PredictionRequest]rT   r   r   r   r   r   rd   r   rT   r   r   r   __name__
__module____qualname__rA   propertyrF   rW   OMITrz   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   rx   rB   r@   r0   r0   -   sr   	;     (,$((,.2)-%)*.'+&*&*-1;?Y
 %Y
 "	Y

 &Y
 ,Y
 'Y
 #Y
 (Y
 %Y
 $Y
 $Y
 +Y
 9Y
 
JY
| ?C&*IM9=,09=DH37*..2-148BF.2-1:>26EI599=9=9=264826590437&**.;?Cn '<n $	n
 Gn 7n *n "7n -Bn 1n (n ,n +n 2n ,@n  ,!n" +#n$ $8%n& 0'n( .C)n* 3+n, "7-n. "7/n0 "71n2 03n4 25n6 07n8 39n: .;n< 1=n> $?n@ (AnB 9CnD 
Enf (,$((,)-%)*.'+&*&*-1;?P %P "	P
 &P 'P #P (P %P $P $P +P 9P 
'Pl /3;?%% ,	%
 9% 
%N UY B /3KO487;9=FJ>BCGCGFJJN&*>BIM9=.259,09=DH37*..2-1EI48BF.2-1:>FJ269=EIBF599=9=9=264826HL59590437&**.;?kVV ,	V
  IV 2V !5V #7V 0DV '<V -AV -AV 0DV HV $V  (<!V" G#V$ 7%V& ,'V( 3)V* *+V, "7-V. -B/V0 11V2 (3V4 ,5V6 +7V8 /C9V: 2;V< ,@=V> ,?V@ +AVB $8CVD /DEVF 0GVH "7IVJ .CKVL @MVN 3OVP "7QVR "7SVT "7UVV 0WVX 2YVZ 0[V\ 1F]V^ 3_V` 3aVb .cVd 1eVf $gVh (iVj 9kVl 
mVr NR+J	 N -1;??? 	?
 ? ? *? 9? 
#?L 48]a15;?zz 3	z
 1z #[z /z 9z 
%zB <@++ 4	+
 9+ 
++\ ae%%(+%>]%	%N           ! !  rB   r0   c            3         e Zd ZddZedd       Zddddddddddddd	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 d dZeeeeeeeeeeeeeeeeeeeeeeeeeeeeeedd	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 d!dZdddddddddddd	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 d"d	Z	ddd
	 	 	 	 	 	 	 d#dZ
ddd$dZdeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeedd2	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 d%dZdd	 	 	 	 	 d&dZedd	 	 	 	 	 	 	 	 	 	 	 	 	 d'dZddddd	 	 	 	 	 	 	 	 	 	 	 	 	 d(dZdd	 	 	 	 	 	 	 d)dZdd	 	 	 	 	 	 	 d*dZed        Zed        Zed        Zed        Zed        Zed        Zed        Zy)+AsyncProjectsClientc                   t        |      | _        || _        d | _        d | _        d | _        d | _        d | _        d | _        d | _	        y r2   )
r   r5   r6   r7   r8   r9   r:   r;   r<   r=   r>   s     r@   rA   zAsyncProjectsClient.__init__h  sI    1P-9==A=A=A9=EI;?rB   c                    | j                   S )z
        Retrieves a raw implementation of this client that returns raw responses.

        Returns
        -------
        AsyncRawProjectsClient
        rD   rE   s    r@   rF   z%AsyncProjectsClient.with_raw_responses  rG   rB   NrH   c               l   K   | j                   j                  |||||||||	|
||       d{   S 7 w)a  
        Retrieve a list of projects.

        Parameters
        ----------
        filter : typing.Optional[str]
            Filter projects by pinned status. Use 'pinned_only' to return only pinned projects, 'exclude_pinned' to return only non-pinned projects, or 'all' to return all projects.

        ids : typing.Optional[str]
            Filter id by in list

        include : typing.Optional[str]
            Comma-separated list of count fields to include in the response to optimize performance. Available fields: task_number, finished_task_number, total_predictions_number, total_annotations_number, num_tasks_with_annotations, useful_annotation_number, ground_truth_number, skipped_annotations_number. If not specified, all count fields are included.

        members_limit : typing.Optional[int]
            Maximum number of members to return

        ordering : typing.Optional[str]
            Which field to use when ordering the results.

        page : typing.Optional[int]
            A page number within the paginated result set.

        page_size : typing.Optional[int]
            Number of results to return per page.

        search : typing.Optional[str]
            Search term for project title and description

        state : typing.Optional[str]
            Filter current_state by exact match

        title : typing.Optional[str]
            Filter title by contains (case-insensitive)

        workspaces : typing.Optional[float]
            Filter workspaces by exact match

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        AsyncPager[AllRolesProjectList, PaginatedAllRolesProjectListList]


        Examples
        --------
        import asyncio

        from label_studio_sdk import AsyncLabelStudio

        client = AsyncLabelStudio(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            response = await client.projects.list()
            async for item in response:
                yield item

            # alternatively, you can paginate page-by-page
            async for page in response.iter_pages():
                yield page


        asyncio.run(main())
        rH   NrV   rX   s                r@   rW   zAsyncProjectsClient.list~  sU     j %%**'!+ + 
 
 	
 
s   +424rY   c               $  K    | j                   j                  d!i d|d|d|d|d|d|d|d|d	|	d
|
d|d|d|d|d|d|d|d|d|d|d|d|d|d|d|d|d|d|d|d|d| d {   } | j                  S 7 w)"a  
        Create a project for a specific organization.

        Parameters
        ----------
        annotator_evaluation_enabled : typing.Optional[bool]
            Enable annotator evaluation for the project

        color : typing.Optional[str]

        control_weights : typing.Optional[typing.Dict[str, typing.Any]]
            Dict of weights for each control tag in metric calculation.

        created_by : typing.Optional[UserSimpleRequest]
            Project owner

        description : typing.Optional[str]
            Project Description

        enable_empty_annotation : typing.Optional[bool]
            Allow annotators to submit empty annotations

        evaluate_predictions_automatically : typing.Optional[bool]
            Retrieve and display predictions when loading a task

        expert_instruction : typing.Optional[str]
            Labeling instructions in HTML format

        is_draft : typing.Optional[bool]
            Whether or not the project is in the middle of being created

        is_published : typing.Optional[bool]
            Whether or not the project is published to annotators

        label_config : typing.Optional[str]
            Label config in XML format. See more about it in documentation

        maximum_annotations : typing.Optional[int]
            Maximum number of annotations for one task. If the number of annotations per task is equal or greater to this value, the task is completed (is_labeled=True)

        min_annotations_to_start_training : typing.Optional[int]
            Minimum number of completed tasks after which model training is started

        model_version : typing.Optional[str]
            Machine learning model version

        organization : typing.Optional[int]

        overlap_cohort_percentage : typing.Optional[int]

        pinned_at : typing.Optional[dt.datetime]
            Pinned date and time

        reveal_preannotations_interactively : typing.Optional[bool]
            Reveal pre-annotations interactively

        sampling : typing.Optional[SamplingDe5Enum]

        show_annotation_history : typing.Optional[bool]
            Show annotation history to annotator

        show_collab_predictions : typing.Optional[bool]
            If set, the annotator can view model predictions

        show_ground_truth_first : typing.Optional[bool]
            Onboarding mode (true): show ground truth tasks first in the labeling stream

        show_instruction : typing.Optional[bool]
            Show instructions to the annotator before they start

        show_overlap_first : typing.Optional[bool]

        show_skip_button : typing.Optional[bool]
            Show a skip button in interface and allow annotators to skip the task

        skip_queue : typing.Optional[SkipQueueEnum]

        task_data_login : typing.Optional[str]
            Task data credentials: login

        task_data_password : typing.Optional[str]
            Task data credentials: password

        title : typing.Optional[str]
            Project Title

        workspace : typing.Optional[int]
            In Workspace

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        LseProjectCreate


        Examples
        --------
        import asyncio

        from label_studio_sdk import AsyncLabelStudio

        client = AsyncLabelStudio(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.projects.create()


        asyncio.run(main())
        rZ   r[   r\   r]   r^   r_   r`   ra   rb   rc   rd   re   rf   rg   rh   ri   rj   rk   rl   rm   rn   ro   rp   rq   rr   rs   rt   ru   rR   rv   rT   Nrx   ry   r|   s!                                    r@   rz   zAsyncProjectsClient.create  so    j 2$**11  
)E 
 
 , 
 "	 

 $ 
 %< 
 0R 
  2 
  
 & 
 & 
 !4 
 /P 
 ( 
 & 
  '@! 
"  # 
$ 1T% 
& ' 
( %<) 
* %<+ 
, %<- 
. ./ 
0  21 
2 .3 
4 "5 
6 ,7 
8  29 
: ; 
<  = 
> ,? 
  
	B ~~C 
s   A;B=B>Br~   c                  K   | j                   j                  |||||||||	|
|       d{   }|j                  S 7 w)a  
        Returns a list of projects with their counts. For example, task_number which is the total task number in project

        Parameters
        ----------
        filter : typing.Optional[str]
            Filter projects by pinned status. Use 'pinned_only' to return only pinned projects, 'exclude_pinned' to return only non-pinned projects, or 'all' to return all projects.

        ids : typing.Optional[str]
            Filter id by in list

        include : typing.Optional[str]
            Comma-separated list of count fields to include in the response to optimize performance. Available fields: task_number, finished_task_number, total_predictions_number, total_annotations_number, num_tasks_with_annotations, useful_annotation_number, ground_truth_number, skipped_annotations_number. If not specified, all count fields are included.

        ordering : typing.Optional[str]
            Which field to use when ordering the results.

        page : typing.Optional[int]
            A page number within the paginated result set.

        page_size : typing.Optional[int]
            Number of results to return per page.

        search : typing.Optional[str]
            Search term for project title and description

        state : typing.Optional[str]
            Filter current_state by exact match

        title : typing.Optional[str]
            Filter title by contains (case-insensitive)

        workspaces : typing.Optional[float]
            Filter workspaces by exact match

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        PaginatedLseProjectCountsList


        Examples
        --------
        import asyncio

        from label_studio_sdk import AsyncLabelStudio

        client = AsyncLabelStudio(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.projects.list_counts()


        asyncio.run(main())
        r~   Nr   r   s                r@   r   zAsyncProjectsClient.list_counts  s[     V **66!+ 7 
 
	 ~~
s   *?=?r   c               r   K   | j                   j                  |||       d{   }|j                  S 7 w)a  
        Retrieve information about a project by project ID.

        Parameters
        ----------
        id : int

        members_limit : typing.Optional[int]
            Maximum number of members to return

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        LseProjectResponse
            Project information. Not all fields are available for all roles.

        Examples
        --------
        import asyncio

        from label_studio_sdk import AsyncLabelStudio

        client = AsyncLabelStudio(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.projects.get(
                id=1,
            )


        asyncio.run(main())
        r   Nr   r   s        r@   r   zAsyncProjectsClient.get  s:     X **..r`o.pp	~~ q   "757r   c               p   K   | j                   j                  ||       d{   }|j                  S 7 w)a[  
        Delete a project by specified project ID.

        Parameters
        ----------
        id : int

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        None

        Examples
        --------
        import asyncio

        from label_studio_sdk import AsyncLabelStudio

        client = AsyncLabelStudio(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.projects.delete(
                id=1,
            )


        asyncio.run(main())
        r   Nr   r   s       r@   r   zAsyncProjectsClient.delete#  s7     D **11"o1VV	~~ W   !646r   c       2          K    | j                   j                  |fi d|d|d|d|d|d|d|d|	d	|
d
|d|d|d|d|d|d|d|d|d|d|d|d|d|d|d|d|d|d|d|d|d| d |!d!|"d"|#d#|$d$|%d%|&d&|'d'|(d(|)d)|*d*|+d+|,d,|-d-|.d.|/d/|0d0|1d1|2d2|3 d3{   }4|4j                  S 7 w)4a  
        Update the details of a specific project.

        Parameters
        ----------
        id : int

        members_limit : typing.Optional[int]
            Maximum number of members to return

        agreement_methodology : typing.Optional[AgreementMethodologyEnum]
            Methodology (Consensus / Pairwise Averaging)

            * `consensus` - Consensus
            * `pairwise` - Pairwise Averaging

        agreement_threshold : typing.Optional[str]
            Agreement threshold

        annotation_limit_count : typing.Optional[int]
            Limit by number of tasks

        annotation_limit_percent : typing.Optional[str]
            Limit by percentage of tasks

        annotator_evaluation_continuous_tasks : typing.Optional[int]
            Continuous Evaluation: Required tasks

        annotator_evaluation_enabled : typing.Optional[bool]
            Evaluate all annotators against ground truth

        annotator_evaluation_minimum_score : typing.Optional[str]
            Score required to pass evaluation

        annotator_evaluation_minimum_tasks : typing.Optional[int]
            Number of tasks for evaluation

        annotator_evaluation_onboarding_tasks : typing.Optional[int]
            Onboarding Evaluation: Required tasks

        assignment_settings : typing.Optional[AssignmentSettingsRequest]

        color : typing.Optional[str]
            Color

        comment_classification_config : typing.Optional[str]

        control_weights : typing.Optional[typing.Dict[str, typing.Any]]
            Dict of weights for each control tag in metric calculation.

        created_by : typing.Optional[UserSimpleRequest]
            Project owner

        custom_script : typing.Optional[str]
            Plugins

        custom_task_lock_ttl : typing.Optional[int]
            Task reservation time. TTL in seconds (UI displays and edits this value in minutes).

        description : typing.Optional[str]
            Description

        enable_empty_annotation : typing.Optional[bool]
            Allow empty annotations

        evaluate_predictions_automatically : typing.Optional[bool]
            Retrieve and display predictions when loading a task

        expert_instruction : typing.Optional[str]
            Instructions

        is_draft : typing.Optional[bool]
            Whether or not the project is in the middle of being created

        is_published : typing.Optional[bool]
            Whether or not the project is published to annotators

        label_config : typing.Optional[str]
            Labeling Configuration

        max_additional_annotators_assignable : typing.Optional[int]
            Maximum additional annotators

        maximum_annotations : typing.Optional[int]
            Annotations per task

        min_annotations_to_start_training : typing.Optional[int]
            Minimum number of completed tasks after which model training is started

        model_version : typing.Optional[str]
            Machine learning model version

        organization : typing.Optional[int]

        overlap_cohort_percentage : typing.Optional[int]
            Annotations per task coverage

        pause_on_failed_annotator_evaluation : typing.Optional[bool]
            Pause annotator on failed evaluation

        pinned_at : typing.Optional[dt.datetime]
            Pinned date and time

        require_comment_on_skip : typing.Optional[bool]
            Require comment to skip

        reveal_preannotations_interactively : typing.Optional[bool]
            Reveal pre-annotations interactively

        review_settings : typing.Optional[ReviewSettingsRequest]

        sampling : typing.Optional[SamplingDe5Enum]

        show_annotation_history : typing.Optional[bool]
            Show Data Manager to Annotators

        show_collab_predictions : typing.Optional[bool]
            Use predictions to pre-label Tasks

        show_ground_truth_first : typing.Optional[bool]
            Onboarding mode (true): show ground truth tasks first in the labeling stream

        show_instruction : typing.Optional[bool]
            Show instructions before labeling

        show_overlap_first : typing.Optional[bool]
            Show tasks with overlap first

        show_skip_button : typing.Optional[bool]
            Allow skipping tasks

        show_unused_data_columns_to_annotators : typing.Optional[bool]
            Show only columns used in labeling configuration to Annotators. API uses inverse field semantics here: set false to show only used columns, set true to show all task.data columns.

        skip_queue : typing.Optional[SkipQueueEnum]

        strict_task_overlap : typing.Optional[bool]
            Enforce strict overlap limit

        task_data_login : typing.Optional[str]
            Login

        task_data_password : typing.Optional[str]
            Password

        title : typing.Optional[str]
            Project Name

        workspace : typing.Optional[int]
            Workspace

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        LseProjectUpdate


        Examples
        --------
        import asyncio

        from label_studio_sdk import AsyncLabelStudio

        client = AsyncLabelStudio(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.projects.update(
                id=1,
            )


        asyncio.run(main())
        rL   r   r   r   r   r   rZ   r   r   r   r   r[   r   r\   r]   r   r   r^   r_   r`   ra   rb   rc   rd   r   re   rf   rg   rh   ri   r   rj   r   rk   r   rl   rm   rn   ro   rp   rq   rr   r   rs   r   rt   ru   rR   rv   rT   Nr   r   s5                                                        r@   r   zAsyncProjectsClient.updateH  sc    R 2$**114
'4
 #84
 !4	4

 $:4
 &>4
 3X4
 *F4
 0R4
 0R4
 3X4
 !44
 4
 +H4
 ,4
  "!4
" (#4
$ "6%4
& $'4
( %<)4
* 0R+4
,  2-4
. /4
0 &14
2 &34
4 2V54
6 !474
8 /P94
: (;4
< &=4
> '@?4
@ 2VA4
B  C4
D %<E4
F 1TG4
H ,I4
J K4
L %<M4
N %<O4
P %<Q4
R .S4
T  2U4
V .W4
X 4ZY4
Z "[4
\ !4]4
^ ,_4
`  2a4
b c4
d  e4
f ,g4
 4
	j ~~k4
s   B5C
7C8C
c               p   K   | j                   j                  ||       d{   }|j                  S 7 w)a  
        Return unique users who have submitted annotations in the specified project.

        Parameters
        ----------
        id : int

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        typing.List[UserSimple]
            List of annotator users

        Examples
        --------
        import asyncio

        from label_studio_sdk import AsyncLabelStudio

        client = AsyncLabelStudio(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.projects.list_unique_annotators(
                id=1,
            )


        asyncio.run(main())
        r   Nr   r   s       r@   r   z*AsyncProjectsClient.list_unique_annotatorsh  s8     J **AA"VeAff	~~ gr  r   c               x   K   | j                   j                  ||||||       d{   }|j                  S 7 w)aa  
        <Card href="https://humansignal.com/goenterprise">
                <img style="pointer-events: none; margin-left: 0px; margin-right: 0px;" src="https://docs.humansignal.com/images/badge.svg" alt="Label Studio Enterprise badge"/>
                <p style="margin-top: 10px; font-size: 14px;">
                    This endpoint is not available in Label Studio Community Edition. [Learn more about Label Studio Enterprise](https://humansignal.com/goenterprise)
                </p>
            </Card>
        Make a copy of project.

        Parameters
        ----------
        id : int

        mode : ModeEnum
            What to Duplicate (Project configuration only / Project configuration and tasks)

            * `settings` - Only settings
            * `settings,data` - Settings and tasks

        title : str
            Project Name

        workspace : int
            Destination Workspace

        description : typing.Optional[str]
            Project Description

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        DuplicateProjectsResponse
            Project duplicated

        Examples
        --------
        import asyncio

        from label_studio_sdk import AsyncLabelStudio

        client = AsyncLabelStudio(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.projects.duplicate(
                id=1,
                mode="settings",
                title="title",
                workspace=1,
            )


        asyncio.run(main())
        r   Nr   r   s           r@   r   zAsyncProjectsClient.duplicate  sH     H **44T)fu 5 
 
	 ~~
   %:8:r   c               x   K   | j                   j                  ||||||       d{   }|j                  S 7 w)a  
        
                    Import data as labeling tasks in bulk using this API endpoint. You can use this API endpoint to import multiple tasks.
                    One POST request is limited at 250K tasks and 200 MB.
        
                    **Note:** Imported data is verified against a project *label_config* and must
                    include all variables that were used in the *label_config*. For example,
                    if the label configuration has a *$text* variable, then each item in a data object
                    must include a "text" field.
                    <br>
        
                    ## Async Import Behavior
                    <hr style="opacity:0.3">
        
                    **For non-Community editions, this endpoint processes imports asynchronously.**
                    
                    - The POST request **can fail** for invalid parameters, malformed request body, or other request-level validation errors.
                    - However, **data validation errors** that occur during import processing are handled asynchronously and will not cause the POST request to fail.
                    - Upon successful request validation, a response is returned: `{"import": <import_id>}`
                    - Use the returned `import_id` to poll the GET `/api/projects/{project_id}/imports/{import_id}` endpoint to check the import status and see any data validation errors.
                    - Data-level errors and import failures will only be visible in the GET request response.
        
                    For Community edition, imports are processed synchronously and return task counts immediately.
                    <br>
        
                    ## POST requests
                    <hr style="opacity:0.3">
        
                    There are three possible ways to import tasks with this endpoint:
        
                    ### 1. **POST with data**
                    Send JSON tasks as POST data. Only JSON is supported for POSTing files directly.
                    Update this example to specify your authorization token and Label Studio instance host, then run the following from
                    the command line.
        
                    ```bash
                    curl -H 'Content-Type: application/json' -H 'Authorization: Token abc123' \
                    -X POST 'http://localhost:8000/api/projects/1/import' --data '[{"text": "Some text 1"}, {"text": "Some text 2"}]'
                    ```
        
                    ### 2. **POST with files**
                    Send tasks as files. You can attach multiple files with different names.
        
                    - **JSON**: text files in JavaScript object notation format
                    - **CSV**: text files with tables in Comma Separated Values format
                    - **TSV**: text files with tables in Tab Separated Value format
                    - **TXT**: simple text files are similar to CSV with one column and no header, supported for projects with one source only
        
                    Update this example to specify your authorization token, Label Studio instance host, and file name and path,
                    then run the following from the command line:
        
                    ```bash
                    curl -H 'Authorization: Token abc123' \
                    -X POST 'http://localhost:8000/api/projects/1/import' -F 'file=@path/to/my_file.csv'
                    ```
        
                    ### 3. **POST with URL**
                    You can also provide a URL to a file with labeling tasks. Supported file formats are the same as in option 2.
        
                    ```bash
                    curl -H 'Content-Type: application/json' -H 'Authorization: Token abc123' \
                    -X POST 'http://localhost:8000/api/projects/1/import' \
                    --data '[{"url": "http://example.com/test1.csv"}, {"url": "http://example.com/test2.csv"}]'
                    ```
        
                    <br>
                
        
        Parameters
        ----------
        id : int
            A unique integer value identifying this project.
        
        request : typing.Sequence[ImportApiRequest]
        
        commit_to_project : typing.Optional[bool]
            Set to "true" to immediately commit tasks to the project.
        
        preannotated_from_fields : typing.Optional[typing.Union[str, typing.Sequence[str]]]
            List of fields to preannotate from the task data. For example, if you provide a list of `{"text": "text", "prediction": "label"}` items in the request, the system will create a task with the `text` field and a prediction with the `label` field when `preannoted_from_fields=["prediction"]`.
        
        return_task_ids : typing.Optional[bool]
            Set to "true" to return task IDs in the response.
        
        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.
        
        Returns
        -------
        ImportTasksProjectsResponse
            Tasks successfully imported or import queued. **For non-Community editions**, the response will be `{"import": <import_id>}` which you can use to poll the import status. **For Community edition**, the response contains task counts and is processed synchronously.
        
        Examples
        --------
        import asyncio
        
        from label_studio_sdk import AsyncLabelStudio
        
        client = AsyncLabelStudio(
            api_key="YOUR_API_KEY",
        )
        
        
        async def main() -> None:
            await client.projects.import_tasks(
                id=1,
                request=[],
            )
        
        
        asyncio.run(main())
        r   Nr   r   s           r@   r   z AsyncProjectsClient.import_tasks  sL     t **77/%=++ 8 
 
	 ~~
r  c               r   K   | j                   j                  |||       d{   }|j                  S 7 w)a  
        Import model predictions for tasks in the specified project.

        Parameters
        ----------
        id : int
            A unique integer value identifying this project.

        request : typing.Sequence[PredictionRequest]

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        ImportPredictionsProjectsResponse
            Predictions successfully imported

        Examples
        --------
        import asyncio

        from label_studio_sdk import AsyncLabelStudio, PredictionRequest

        client = AsyncLabelStudio(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.projects.import_predictions(
                id=1,
                request=[
                    PredictionRequest(
                        result=[{"key": "value"}],
                        task=1,
                    )
                ],
            )


        asyncio.run(main())
        r   Nr   r   s        r@   r   z&AsyncProjectsClient.import_predictions]  s:     d **==b'cr=ss	~~ tr   c               r   K   | j                   j                  |||       d{   }|j                  S 7 w)ak  
        Determine whether the label configuration for a specific project is valid.

        Parameters
        ----------
        id : int
            A unique integer value identifying this project.

        label_config : str
            Label config in XML format. See more about it in documentation

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        ProjectLabelConfig


        Examples
        --------
        import asyncio

        from label_studio_sdk import AsyncLabelStudio

        client = AsyncLabelStudio(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.projects.validate_label_config(
                id=1,
                label_config="label_config",
            )


        asyncio.run(main())
        r   Nr   r   s        r@   r   z)AsyncProjectsClient.validate_label_config  sB     T **@@\? A 
 
	 ~~
r   c                n    | j                   ddlm}  || j                        | _         | j                   S )Nr   )r+   r3   )r7   r   r+   r6   )r?   r+   s     r@   r   zAsyncProjectsClient.roles  +    ;;6*$:N:NODK{{rB   c                n    | j                   ddlm}  || j                        | _         | j                   S )Nr   )r#   r3   )r8   r   r#   r6   )r?   r#   s     r@   r   zAsyncProjectsClient.exports  +    == :.d>R>RSDM}}rB   c                n    | j                   ddlm}  || j                        | _         | j                   S )Nr   )r%   r3   )r9   r   r%   r6   )r?   r%   s     r@   r   zAsyncProjectsClient.members  r  rB   c                n    | j                   ddlm}  || j                        | _         | j                   S )Nr   )r'   r3   )r:   r   r'   r6   )r?   r'   s     r@   r   zAsyncProjectsClient.metrics  r  rB   c                n    | j                   ddlm}  || j                        | _         | j                   S )Nr   )r-   r3   )r;   r   r-   r6   )r?   r-   s     r@   r   zAsyncProjectsClient.stats  r  rB   c                n    | j                   ddlm}  || j                        | _         | j                   S )Nr   )r"   r3   )r<   r   r"   r6   )r?   r"   s     r@   r   zAsyncProjectsClient.assignments  s0    $B 6dFZFZ [D   rB   c                n    | j                   ddlm}  || j                        | _         | j                   S )Nr   )r)   r3   )r=   r   r)   r6   )r?   r)   s     r@   r   zAsyncProjectsClient.pauses  s+    <<8,D<P<PQDL||rB   )r4   r   )r   r   )rI   r   rJ   r   rK   r   rL   r   rM   r   rN   r   rO   r   rP   r   rQ   r   rR   r   rS   r   rT   r   r   zAAsyncPager[AllRolesProjectList, PaginatedAllRolesProjectListList]r   r   r   r   r   r   r   r   r   r   r   rx   rB   r@   r   r   g  s{   	@     (,$((,.2)-%)*.'+&*&*-1;?b
 %b
 "	b

 &b
 ,b
 'b
 #b
 (b
 %b
 $b
 $b
 +b
 9b
 
Kb
N ?C&*IM9=,09=DH37*..2-148BF.2-1:>26EI599=9=9=264826590437&**.;?Cv '<v $	v
 Gv 7v *v "7v -Bv 1v (v ,v +v 2v ,@v  ,!v" +#v$ $8%v& 0'v( .C)v* 3+v, "7-v. "7/v0 "71v2 03v4 25v6 07v8 39v: .;v< 1=v> $?v@ (AvB 9CvD 
Evv (,$((,)-%)*.'+&*&*-1;?X %X "	X
 &X 'X #X (X %X $X $X +X 9X 
'X| /3;?-- ,	-
 9- 
-^ [_ #R /3KO487;9=FJ>BCGCGFJJN&*>BIM9=.259,09=DH37*..2-1EI48BF.2-1:>FJ269=EIBF599=9=9=264826HL59590437&**.;?k^^ ,	^
  I^ 2^ !5^ #7^ 0D^ '<^ -A^ -A^ 0D^ H^ $^  (<!^" G#^$ 7%^& ,'^( 3)^* *+^, "7-^. -B/^0 11^2 (3^4 ,5^6 +7^8 /C9^: 2;^< ,@=^> ,?^@ +A^B $8C^D /DE^F 0G^H "7I^J .CK^L @M^N 3O^P "7Q^R "7S^T "7U^V 0W^X 2Y^Z 0[^\ 1F]^^ 3_^` 3a^b .c^d 1e^f $g^h (i^j 9k^l 
m^B	 NR&&+J&	 &^ -1;?GG 	G
 G G *G 9G 
#G\ 48]a15;?BB 3	B
 1B #[B /B 9B 
%BR <@33 4	3
 93 
+3l ae--(+->]-	-^           ! !  rB   r   )S
__future__r   datetimedttypingcore.client_wrapperr   r   core.paginationr   r   core.request_optionsr	    types.agreement_methodology_enumr
   types.all_roles_project_listr   !types.assignment_settings_requestr   types.import_api_requestr   types.lse_project_creater   types.lse_project_responser   types.lse_project_updater   types.mode_enumr   +types.paginated_all_roles_project_list_listr   'types.paginated_lse_project_counts_listr   types.prediction_requestr   types.project_label_configr   types.review_settings_requestr   types.sampling_de5enumr   types.skip_queue_enumr   types.user_simpler   types.user_simple_requestr   
raw_clientr   r   !types.duplicate_projects_responser   *types.import_predictions_projects_responser   $types.import_tasks_projects_responser    TYPE_CHECKINGr   r!   r"   r   r#   r$   r   r%   r&   r   r'   r(   r   r)   r*   r   r+   r,   r   r-   r.   castAnyr   r0   r   rx   rB   r@   <module>r2     s    #   G 3 1 G > I 7 7 ; 7 & Z S 8 ; A 4 1 * 9 A H Y M	MAAA>;;v{{6::s#w wt!P PrB   