
    ]j=                    P   d dl Z d dlmZ ddlm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/m0Z0  G d d      Z1 G d d      Z2y)    N)JSONDecodeError   )ApiError)AsyncClientWrapperSyncClientWrapper)AsyncHttpResponseHttpResponse)jsonable_encoder)RequestOptions)construct_type   )AgreementAnnotatorStatsResponse) AgreementAnnotatorsStatsResponse)DataFiltersStatsResponse)FinishedTasksStatsResponse)IaaStatsResponse)LeadTimeStatsResponse)+ModelVersionAnnotatorAgreementStatsResponse)-ModelVersionGroundTruthAgreementStatsResponse),ModelVersionPredictionAgreementStatsResponse)TotalAgreementStatsResponse)%UserGroundTruthAgreementStatsResponse)$UserPredictionAgreementStatsResponse)UserReviewScoreStatsResponse)&UsersGroundTruthAgreementStatsResponse)%UsersPredictionAgreementStatsResponse)UsersReviewScoreStatsResponsec                   0   e Zd ZdefdZdddededej                  e	   de
e   fd	Zddd
dededej                  e   dej                  e	   de
e   f
dZddd
dededej                  e   dej                  e	   de
e   f
dZdddddddedej                  e   dej                  e   dej                  e   dej                  e   dej                  e	   de
e   fdZddd
dededej                  e   dej                  e	   de
e   f
dZdddededej                  e	   de
e   fdZdddededej                  e	   de
e   fdZdddedej                  e	   de
e   fdZddddedej                  e   dej                  e	   de
e   fdZdddedej                  e	   de
e   fdZddd
dedej                  e   dej                  e	   de
e    fdZ!ddddedej                  e   dej                  e	   de
ejD                  eejF                  f      fd Z$ddd
dededej                  e   dej                  e	   de
e%   f
d!Z&ddd
dededej                  e   dej                  e	   de
e'   f
d"Z(ddd
dededej                  e   dej                  e	   de
e)   f
d#Z*ddd
dededej                  e   dej                  e	   de
e+   f
d$Z,ddd
dededej                  e   dej                  e	   de
e-   f
d%Z.y)&RawStatsClientclient_wrapperc                    || _         y N_client_wrapperselfr    s     T/root/env/lib/python3.12/site-packages/label_studio_sdk/projects/stats/raw_client.py__init__zRawStatsClient.__init__   
    -    Nrequest_optionsidmodel_versionr,   returnc                8   | j                   j                  j                  dt        |       dt        |       dd|      }	 d|j                  cxk  rdk  rGn nDt        j                  t        t        t        |j                                     }t        ||	      S |j                         }t        |j                  t        |j                        |
      # t        $ r6 t        |j                  t        |j                        |j                  
      w xY w)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>
        Get agreement between a given model version and all annotators in the project for overlapping tasks.

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

        model_version : str

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

        Returns
        -------
        HttpResponse[ModelVersionAnnotatorAgreementStatsResponse]
            Model-version overall agreement vs annotators
        api/projects//model-stats/
/agreementGETmethodr,      ,  type_object_responsedatastatus_codeheadersbody)r$   httpx_clientrequestr
   r@   typingcastr   r   jsonr	   r   r   dictrA   textr&   r-   r.   r,   	_response_data_response_jsons          r'   !model_version_annotator_agreementz0RawStatsClient.model_version_annotator_agreement"   s   4 ((55==,R01?OP]?^>__ij+ > 
	
	ti++1c1?"I ) 0 $YUCC&^^-N 9#8#8$yGXGXBY`noo  	ty'<'<d9K\K\F]dmdrdrss	ts   AC C ?D	per_labelr,   rP   c                >   | j                   j                  j                  dt        |       dt        |       ddd|i|      }	 d|j                  cxk  rdk  rGn nDt        j                  t        t        t        |j                         	            }t        ||
      S |j                         }t        |j                  t        |j                        |      # t        $ r6 t        |j                  t        |j                        |j                        w xY w)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>
        Get agreement between a given model version and ground truth annotations in the project for overlapping tasks.

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

        model_version : str

        per_label : typing.Optional[bool]
            Calculate agreement per label

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

        Returns
        -------
        HttpResponse[ModelVersionGroundTruthAgreementStatsResponse]
            Model-version ground truth agreement
        r1   r2   /agreement-groundtruthr4   rP   r6   paramsr,   r7   r8   r9   r<   r?   )r$   rC   rD   r
   r@   rE   rF   r   r   rG   r	   r   r   rH   rA   rI   r&   r-   r.   rP   r,   rK   rL   rM   s           r'   $model_version_ground_truth_agreementz3RawStatsClient.model_version_ground_truth_agreementP   s   D ((55==,R01?OP]?^>__uvY , > 
		ti++1c1A"K ) 0 $YUCC&^^-N 9#8#8$yGXGXBY`noo  	ty'<'<d9K\K\F]dmdrdrss	t   AC "C ?Dc                >   | j                   j                  j                  dt        |       dt        |       ddd|i|      }	 d|j                  cxk  rdk  rGn nDt        j                  t        t        t        |j                         	            }t        ||
      S |j                         }t        |j                  t        |j                        |      # t        $ r6 t        |j                  t        |j                        |j                        w xY w)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>
        Get agreement between a given model version and all other model versions in the project for overlapping tasks.

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

        model_version : str

        per_label : typing.Optional[bool]
            Calculate agreement per label

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

        Returns
        -------
        HttpResponse[ModelVersionPredictionAgreementStatsResponse]
            Model-version prediction agreement
        r1   r2   /predictionr4   rP   rS   r7   r8   r9   r<   r?   )r$   rC   rD   r
   r@   rE   rF   r   r   rG   r	   r   r   rH   rA   rI   rU   s           r'   "model_version_prediction_agreementz1RawStatsClient.model_version_prediction_agreement   s   D ((55==,R01?OP]?^>__jkY , > 
		ti++1c1@"J ) 0 $YUCC&^^-N 9#8#8$yGXGXBY`noo  	ty'<'<d9K\K\F]dmdrdrss	trW   expandrP   stdtaskr,   r\   r]   r^   c          	      ,   | j                   j                  j                  dt        |       dd||||d|      }	 d|j                  cxk  rdk  rGn nDt        j                  t        t        t        |j                                     }t        ||	      S |j                         }	t        |j                  t        |j                        |	
      # t        $ r6 t        |j                  t        |j                        |j                  
      w xY w)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>
        Get Inter-Annotator Agreement (IAA) matrix for a project, showing agreement between all annotators.

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

        expand : typing.Optional[str]
            Comma-separated list of fields to expand

        per_label : typing.Optional[bool]
            Calculate IAA per label

        std : typing.Optional[bool]
            Include standard deviation in results

        task : typing.Optional[str]
            Comma-separated list of task IDs to filter by

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

        Returns
        -------
        HttpResponse[IaaStatsResponse]
            Inter-Annotator Agreement matrix
        r1   
/stats/IAAr4   r\   rP   r]   r^   rS   r7   r8   r9   r<   r?   )r$   rC   rD   r
   r@   rE   rF   r   r   rG   r	   r   r   rH   rA   rI   
r&   r-   r\   rP   r]   r^   r,   rK   rL   rM   s
             r'   iaazRawStatsClient.iaa   s	   V ((55==,R01< &	 , > 

		ti++1c1$". ) 0 $YUCC&^^-N 9#8#8$yGXGXBY`noo  	ty'<'<d9K\K\F]dmdrdrss	ts   AC C ?Didsc                (   | j                   j                  j                  dt        |       dd||d|      }	 d|j                  cxk  rdk  rGn nDt        j                  t        t        t        |j                                     }t        ||	      S |j                         }t        |j                  t        |j                        |
      # t        $ r6 t        |j                  t        |j                        |j                  
      w xY w)a9  
        <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>
        Get ground truth agreement statistics for multiple users within a project.

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

        ids : str
            Comma separated list of user IDs to get ground truth agreement for

        per_label : typing.Optional[bool]
            Per label

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

        Returns
        -------
        HttpResponse[UsersGroundTruthAgreementStatsResponse]
            Ground truth agreement statistics for multiple users
        r1   /stats/agreement-groundtruthr4   rd   rP   rS   r7   r8   r9   r<   r?   )r$   rC   rD   r
   r@   rE   rF   r   r   rG   r	   r   r   rH   rA   rI   r&   r-   rd   rP   r,   rK   rL   rM   s           r'   users_ground_truth_agreementz+RawStatsClient.users_ground_truth_agreement  s   F ((55==,R011MN& , > 
		ti++1c1:"D ) 0 $YUCC&^^-N 9#8#8$yGXGXBY`noo  	ty'<'<d9K\K\F]dmdrdrss	t   AC C ?Duser_idc                6   | j                   j                  j                  dt        |       dt        |       d|      }	 d|j                  cxk  rdk  rGn nDt        j                  t        t        t        |j                                     }t        ||      S |j                         }t        |j                  t        |j                        |	      # t        $ r6 t        |j                  t        |j                        |j                  	      w xY w)
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>
        Get agreement statistics for a specific annotator within a project.

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

        user_id : int

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

        Returns
        -------
        HttpResponse[AgreementAnnotatorStatsResponse]
            Individual annotator agreement statistics
        r1   /stats/agreement_annotator/r4   r5   r7   r8   r9   r<   r?   )r$   rC   rD   r
   r@   rE   rF   r   r   rG   r	   r   r   rH   rA   rI   r&   r-   rk   r,   rK   rL   rM   s          r'   agreement_annotatorz"RawStatsClient.agreement_annotatorB  s   4 ((55==,R011LM]^eMfLgh+ > 
	
	ti++1c13"= ) 0 $YUCC&^^-N 9#8#8$yGXGXBY`noo  	ty'<'<d9K\K\F]dmdrdrss	ts   AC C ?Dc                &   | j                   j                  j                  dt        |       ddd|i|      }	 d|j                  cxk  rdk  rGn nDt        j                  t        t        t        |j                                     }t        ||	      S |j                         }t        |j                  t        |j                        |
      # t        $ r6 t        |j                  t        |j                        |j                  
      w xY w)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>
        Get agreement statistics for multiple annotators within a project.

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

        ids : str
            Comma separated list of annotator user IDs to get agreement scores for

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

        Returns
        -------
        HttpResponse[AgreementAnnotatorsStatsResponse]
            Multiple annotator agreement statistics
        r1   /stats/agreement_annotatorsr4   rd   rS   r7   r8   r9   r<   r?   )r$   rC   rD   r
   r@   rE   rF   r   r   rG   r	   r   r   rH   rA   rI   r&   r-   rd   r,   rK   rL   rM   s          r'   agreement_annotatorsz#RawStatsClient.agreement_annotatorsp  s   6 ((55==,R011LMs , > 
		ti++1c14"> ) 0 $YUCC&^^-N 9#8#8$yGXGXBY`noo  	ty'<'<d9K\K\F]dmdrdrss	t   AC C ?Dc                    | j                   j                  j                  dt        |       dd|      }	 d|j                  cxk  rdk  rGn nDt        j                  t        t        t        |j                                     }t        ||      S |j                         }t        |j                  t        |j                        |	      # t        $ r6 t        |j                  t        |j                        |j                  	      w xY w)
am  
        <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>
        Get statistics about user data filters and their usage within a project.

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

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

        Returns
        -------
        HttpResponse[DataFiltersStatsResponse]
            User data filter statistics
        r1   /stats/data_filterr4   r5   r7   r8   r9   r<   r?   )r$   rC   rD   r
   r@   rE   rF   r   r   rG   r	   r   r   rH   rA   rI   r&   r-   r,   rK   rL   rM   s         r'   data_filterszRawStatsClient.data_filters  s    0 ((55==,R011CD+ > 
	
	ti++1c1,"6 ) 0 $YUCC&^^-N 9#8#8$yGXGXBY`noo  	ty'<'<d9K\K\F]dmdrdrss	t   AC C ?Duser_pkr,   r{   c                &   | j                   j                  j                  dt        |       ddd|i|      }	 d|j                  cxk  rdk  rGn nDt        j                  t        t        t        |j                                     }t        ||	      S |j                         }t        |j                  t        |j                        |
      # t        $ r6 t        |j                  t        |j                        |j                  
      w xY w)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>
        Get statistics about finished tasks for a project.

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

        user_pk : typing.Optional[int]
            User ID to filter statistics by (optional)

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

        Returns
        -------
        HttpResponse[FinishedTasksStatsResponse]
            Finished tasks statistics
        r1   /stats/finishedr4   r{   rS   r7   r8   r9   r<   r?   )r$   rC   rD   r
   r@   rE   rF   r   r   rG   r	   r   r   rH   rA   rI   r&   r-   r{   r,   rK   rL   rM   s          r'   finished_taskszRawStatsClient.finished_tasks  s   6 ((55==,R01A7 , > 
		ti++1c1."8 ) 0 $YUCC&^^-N 9#8#8$yGXGXBY`noo  	ty'<'<d9K\K\F]dmdrdrss	trt   c                    | j                   j                  j                  dt        |       dd|      }	 d|j                  cxk  rdk  rGn nDt        j                  t        t        t        |j                                     }t        ||      S |j                         }t        |j                  t        |j                        |	      # t        $ r6 t        |j                  t        |j                        |j                  	      w xY w)
aj  
        <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>
        Get lead time statistics across the project, including average annotation time.

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

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

        Returns
        -------
        HttpResponse[LeadTimeStatsResponse]
            Lead time statistics
        r1   /stats/lead_timer4   r5   r7   r8   r9   r<   r?   )r$   rC   rD   r
   r@   rE   rF   r   r   rG   r	   r   r   rH   rA   rI   rw   s         r'   	lead_timezRawStatsClient.lead_time   s    0 ((55==,R011AB+ > 
	
	ti++1c1)"3 ) 0 $YUCC&^^-N 9#8#8$yGXGXBY`noo  	ty'<'<d9K\K\F]dmdrdrss	try   c                &   | j                   j                  j                  dt        |       ddd|i|      }	 d|j                  cxk  rdk  rGn nDt        j                  t        t        t        |j                                     }t        ||	      S |j                         }t        |j                  t        |j                        |
      # t        $ r6 t        |j                  t        |j                        |j                  
      w xY w)aT  
        <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>
        Overall or per-label total agreement across the project.

        NOTE: due to an open issue in Fern, SDK clients will raise ApiError upon handling a 204 response. As a workaround, wrap call to this function in a try-except block.

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

        per_label : typing.Optional[bool]
            Return agreement per label

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

        Returns
        -------
        HttpResponse[TotalAgreementStatsResponse]
            Total agreement
        r1   /stats/total_agreementr4   rP   rS   r7   r8   r9   r<   r?   )r$   rC   rD   r
   r@   rE   rF   r   r   rG   r	   r   r   rH   rA   rI   r&   r-   rP   r,   rK   rL   rM   s          r'   total_agreementzRawStatsClient.total_agreement,  s   B ((55==,R011GHY , > 
		ti++1c1/"9 ) 0 $YUCC&^^-N 9#8#8$yGXGXBY`noo  	ty'<'<d9K\K\F]dmdrdrss	trt   	stat_typer,   r   c                   | j                   j                  j                  dt        |       ddd|i|      }	 d|j                  cxk  rdk  rn nt        j                  t
        j                  t        t
        j                  f   t        t
        j                  t        t
        j                  f   |j                                     }t        ||	      S |j                         }t        |j                  t        |j                         |
      # t        $ r6 t        |j                  t        |j                         |j"                  
      w xY w)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>
        Start stats recalculation for given project

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

        stat_type : typing.Optional[str]
            Stat type to recalculate. Possible values: label, stats

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

        Returns
        -------
        HttpResponse[typing.Dict[str, typing.Any]]
            Successful response returns job id
        r1   /update-statsr4   r   rS   r7   r8   r9   r<   r?   )r$   rC   rD   r
   r@   rE   rF   DictstrAnyr   rG   r	   r   r   rH   rA   rI   r&   r-   r   r,   rK   rL   rM   s          r'   update_statszRawStatsClient.update_statsd  s#   > ((55==,R01?Y , > 
		ti++1c1KKVZZ0"$kk#vzz/: ) 0 $YUCC&^^-N 9#8#8$yGXGXBY`noo  	ty'<'<d9K\K\F]dmdrdrss	ts   BD D ?Ec                (   | j                   j                  j                  dt        |       dd||d|      }	 d|j                  cxk  rdk  rGn nDt        j                  t        t        t        |j                                     }t        ||	      S |j                         }t        |j                  t        |j                        |
      # t        $ r6 t        |j                  t        |j                        |j                  
      w xY w)aB  
        <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>
        Get prediction agreement statistics for multiple annotators within a project.

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

        ids : str
            Comma separated list of annotator user IDs to get agreement scores for

        per_label : typing.Optional[bool]
            Per label

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

        Returns
        -------
        HttpResponse[UsersPredictionAgreementStatsResponse]
            Prediction agreement statistics for multiple annotators
        r1   /user-stats/predictionr4   rg   rS   r7   r8   r9   r<   r?   )r$   rC   rD   r
   r@   rE   rF   r   r   rG   r	   r   r   rH   rA   rI   rh   s           r'   users_prediction_agreementz)RawStatsClient.users_prediction_agreement  s   F ((55==,R011GH& , > 
		ti++1c19"C ) 0 $YUCC&^^-N 9#8#8$yGXGXBY`noo  	ty'<'<d9K\K\F]dmdrdrss	trj   c                (   | j                   j                  j                  dt        |       dd||d|      }	 d|j                  cxk  rdk  rGn nDt        j                  t        t        t        |j                                     }t        ||	      S |j                         }t        |j                  t        |j                        |
      # t        $ r6 t        |j                  t        |j                        |j                  
      w xY w)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>
        Get review score and performance score statistics for multiple annotators within a project. Only allowed for accounts with reviewing features enabled.

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

        ids : str
            Comma separated list of annotator user IDs to get review scores for

        per_label : typing.Optional[bool]
            Per label

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

        Returns
        -------
        HttpResponse[UsersReviewScoreStatsResponse]
            Review scores and performance scores for multiple annotators
        r1   /user-stats/review_scorer4   rg   rS   r7   r8   r9   r<   r?   )r$   rC   rD   r
   r@   rE   rF   r   r   rG   r	   r   r   rH   rA   rI   rh   s           r'   users_review_scorez!RawStatsClient.users_review_score  s   F ((55==,R011IJ& , > 
		ti++1c11"; ) 0 $YUCC&^^-N 9#8#8$yGXGXBY`noo  	ty'<'<d9K\K\F]dmdrdrss	trj   c                >   | j                   j                  j                  dt        |       dt        |       ddd|i|      }	 d|j                  cxk  rdk  rGn nDt        j                  t        t        t        |j                         	            }t        ||
      S |j                         }t        |j                  t        |j                        |      # t        $ r6 t        |j                  t        |j                        |j                        w xY w)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>
        Get prediction agreement statistics for a specific user within a project.

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

        user_pk : int

        per_label : typing.Optional[bool]
            Calculate agreement per label

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

        Returns
        -------
        HttpResponse[UserPredictionAgreementStatsResponse]
            Individual user prediction agreement statistics
        r1   /user-stats/rY   r4   rP   rS   r7   r8   r9   r<   r?   )r$   rC   rD   r
   r@   rE   rF   r   r   rG   r	   r   r   rH   rA   rI   r&   r-   r{   rP   r,   rK   rL   rM   s           r'   user_prediction_agreementz(RawStatsClient.user_prediction_agreement  s   D ((55==,R01>Nw>W=XXcdY , > 
		ti++1c18"B ) 0 $YUCC&^^-N 9#8#8$yGXGXBY`noo  	ty'<'<d9K\K\F]dmdrdrss	trW   c                >   | j                   j                  j                  dt        |       dt        |       ddd|i|      }	 d|j                  cxk  rdk  rGn nDt        j                  t        t        t        |j                         	            }t        ||
      S |j                         }t        |j                  t        |j                        |      # t        $ r6 t        |j                  t        |j                        |j                        w xY w)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>
        Get review score statistics for a specific user within a project. Only allowed for accounts with reviewing features enabled.

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

        user_pk : int

        per_label : typing.Optional[bool]
            Calculate agreement per label

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

        Returns
        -------
        HttpResponse[UserReviewScoreStatsResponse]
            Individual user review score statistics
        r1   r   /review_scorer4   rP   rS   r7   r8   r9   r<   r?   )r$   rC   rD   r
   r@   rE   rF   r   r   rG   r	   r   r   rH   rA   rI   r   s           r'   user_review_scorez RawStatsClient.user_review_scoreI  s   D ((55==,R01>Nw>W=XXefY , > 
		ti++1c10": ) 0 $YUCC&^^-N 9#8#8$yGXGXBY`noo  	ty'<'<d9K\K\F]dmdrdrss	trW   c                >   | j                   j                  j                  dt        |       dt        |       ddd|i|      }	 d|j                  cxk  rdk  rGn nDt        j                  t        t        t        |j                         	            }t        ||
      S |j                         }t        |j                  t        |j                        |      # t        $ r6 t        |j                  t        |j                        |j                        w xY w)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>
        Get ground truth agreement statistics for a specific user within a project.

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

        user_pk : int

        per_label : typing.Optional[bool]
            Calculate agreement per label

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

        Returns
        -------
        HttpResponse[UserGroundTruthAgreementStatsResponse]
            Individual user ground truth agreement statistics
        r1   /users/rf   r4   rP   rS   r7   r8   r9   r<   r?   )r$   rC   rD   r
   r@   rE   rF   r   r   rG   r	   r   r   rH   rA   rI   r   s           r'   user_ground_truth_agreementz*RawStatsClient.user_ground_truth_agreement  s   D ((55==,R019I'9R8SSopY , > 
		ti++1c19"C ) 0 $YUCC&^^-N 9#8#8$yGXGXBY`noo  	ty'<'<d9K\K\F]dmdrdrss	trW   )/__name__
__module____qualname__r   r(   intr   rE   Optionalr   r	   r   rN   boolr   rV   r   rZ   r   rc   r   ri   r   ro   r   rs   r   rx   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r    r*   r'   r   r      s   .*; . bf,p,p&),p?E~?^,p	A	B,pf ,0;?7p7p 7p
 ??4(7p  87p 
C	D7p| ,0;?7p7p 7p
 ??4(7p  87p 
B	C7pz (,+/%)%);?CpCp $	Cp
 ??4(Cp __T"Cp ooc"Cp  8Cp 
&	'CpT ,0;?9p9p 	9p
 ??4(9p  89p 
<	=9px \`,p,p #,p9?9X,p	5	6,p^ X\0p0p"0p5;__^5T0p	6	70pf NR*p*p+1??>+J*p	.	/*pZ ;?sw0p0p#)??3#70pQWQ`Q`aoQp0p	0	10pf NR*p*p+1??>+J*p	+	,*p` ,0;?6p6p ??4(	6p
  86p 
1	26px +/;?4p4p ??3'	4p
  84p 
fkk#vzz/2	34pv ,0;?9p9p 	9p
 ??4(9p  89p 
;	<9p@ ,0;?9p9p 	9p
 ??4(9p  89p 
3	49p@ ,0;?7p7p 7p
 ??4(7p  87p 
:	;7p| ,0;?7p7p 7p
 ??4(7p  87p 
2	37p| ,0;?7p7p 7p
 ??4(7p  87p 
;	<7pr*   r   c                   0   e Zd ZdefdZdddededej                  e	   de
e   fd	Zddd
dededej                  e   dej                  e	   de
e   f
dZddd
dededej                  e   dej                  e	   de
e   f
dZdddddddedej                  e   dej                  e   dej                  e   dej                  e   dej                  e	   de
e   fdZddd
dededej                  e   dej                  e	   de
e   f
dZdddededej                  e	   de
e   fdZdddededej                  e	   de
e   fdZdddedej                  e	   de
e   fdZddddedej                  e   dej                  e	   de
e   fdZdddedej                  e	   de
e   fdZddd
dedej                  e   dej                  e	   de
e    fdZ!ddddedej                  e   dej                  e	   de
ejD                  eejF                  f      fd Z$ddd
dededej                  e   dej                  e	   de
e%   f
d!Z&ddd
dededej                  e   dej                  e	   de
e'   f
d"Z(ddd
dededej                  e   dej                  e	   de
e)   f
d#Z*ddd
dededej                  e   dej                  e	   de
e+   f
d$Z,ddd
dededej                  e   dej                  e	   de
e-   f
d%Z.y)&AsyncRawStatsClientr    c                    || _         y r"   r#   r%   s     r'   r(   zAsyncRawStatsClient.__init__  r)   r*   Nr+   r-   r.   r,   r/   c                T  K   | j                   j                  j                  dt        |       dt        |       dd|       d{   }	 d|j                  cxk  rdk  rGn nDt        j                  t        t        t        |j                         	            }t        ||
      S |j                         }t        |j                  t        |j                        |      7 # t        $ r6 t        |j                  t        |j                        |j                        w xY ww)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>
        Get agreement between a given model version and all annotators in the project for overlapping tasks.

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

        model_version : str

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

        Returns
        -------
        AsyncHttpResponse[ModelVersionAnnotatorAgreementStatsResponse]
            Model-version overall agreement vs annotators
        r1   r2   r3   r4   r5   Nr7   r8   r9   r<   r?   )r$   rC   rD   r
   r@   rE   rF   r   r   rG   r   r   r   rH   rA   rI   rJ   s          r'   rN   z5AsyncRawStatsClient.model_version_annotator_agreement  s    4 ..;;CC,R01?OP]?^>__ij+ D 
 
	
	ti++1c1?"I ) 0 ))%HH&^^-N 9#8#8$yGXGXBY`noo%
   	ty'<'<d9K\K\F]dmdrdrss	ts7   AD(C$D(AC& (D()C& 9,D(&?D%%D(rO   rP   c                Z  K   | j                   j                  j                  dt        |       dt        |       ddd|i|       d{   }	 d|j                  cxk  rd	k  rGn nDt        j                  t        t        t        |j                         
            }t        ||      S |j                         }t        |j                  t        |j                        |      7 # t        $ r6 t        |j                  t        |j                        |j                        w xY ww)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>
        Get agreement between a given model version and ground truth annotations in the project for overlapping tasks.

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

        model_version : str

        per_label : typing.Optional[bool]
            Calculate agreement per label

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

        Returns
        -------
        AsyncHttpResponse[ModelVersionGroundTruthAgreementStatsResponse]
            Model-version ground truth agreement
        r1   r2   rR   r4   rP   rS   Nr7   r8   r9   r<   r?   )r$   rC   rD   r
   r@   rE   rF   r   r   rG   r   r   r   rH   rA   rI   rU   s           r'   rV   z8AsyncRawStatsClient.model_version_ground_truth_agreement  s    D ..;;CC,R01?OP]?^>__uvY , D 
 
		ti++1c1A"K ) 0 ))%HH&^^-N 9#8#8$yGXGXBY`noo+
&  	ty'<'<d9K\K\F]dmdrdrss	t7   AD+
C'D+AC) +D+,C) <,D+)?D((D+c                Z  K   | j                   j                  j                  dt        |       dt        |       ddd|i|       d{   }	 d|j                  cxk  rd	k  rGn nDt        j                  t        t        t        |j                         
            }t        ||      S |j                         }t        |j                  t        |j                        |      7 # t        $ r6 t        |j                  t        |j                        |j                        w xY ww)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>
        Get agreement between a given model version and all other model versions in the project for overlapping tasks.

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

        model_version : str

        per_label : typing.Optional[bool]
            Calculate agreement per label

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

        Returns
        -------
        AsyncHttpResponse[ModelVersionPredictionAgreementStatsResponse]
            Model-version prediction agreement
        r1   r2   rY   r4   rP   rS   Nr7   r8   r9   r<   r?   )r$   rC   rD   r
   r@   rE   rF   r   r   rG   r   r   r   rH   rA   rI   rU   s           r'   rZ   z6AsyncRawStatsClient.model_version_prediction_agreement'  s    D ..;;CC,R01?OP]?^>__jkY , D 
 
		ti++1c1@"J ) 0 ))%HH&^^-N 9#8#8$yGXGXBY`noo+
&  	ty'<'<d9K\K\F]dmdrdrss	tr   r[   r\   r]   r^   c          	      H  K   | j                   j                  j                  dt        |       dd||||d|       d{   }	 d|j                  cxk  rdk  rGn nDt        j                  t        t        t        |j                         	            }t        ||
      S |j                         }	t        |j                  t        |j                        |	      7 # t        $ r6 t        |j                  t        |j                        |j                        w xY ww)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>
        Get Inter-Annotator Agreement (IAA) matrix for a project, showing agreement between all annotators.

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

        expand : typing.Optional[str]
            Comma-separated list of fields to expand

        per_label : typing.Optional[bool]
            Calculate IAA per label

        std : typing.Optional[bool]
            Include standard deviation in results

        task : typing.Optional[str]
            Comma-separated list of task IDs to filter by

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

        Returns
        -------
        AsyncHttpResponse[IaaStatsResponse]
            Inter-Annotator Agreement matrix
        r1   r`   r4   ra   rS   Nr7   r8   r9   r<   r?   )r$   rC   rD   r
   r@   rE   rF   r   r   rG   r   r   r   rH   rA   rI   rb   s
             r'   rc   zAsyncRawStatsClient.iaa`  s    V ..;;CC,R01< &	 , D 

 

		ti++1c1$". ) 0 ))%HH&^^-N 9#8#8$yGXGXBY`noo1

,  	ty'<'<d9K\K\F]dmdrdrss	ts6   ?D"CD"AC  "D"#C  3,D" ?DD"rd   c                D  K   | j                   j                  j                  dt        |       dd||d|       d{   }	 d|j                  cxk  rdk  rGn nDt        j                  t        t        t        |j                         	            }t        ||
      S |j                         }t        |j                  t        |j                        |      7 # t        $ r6 t        |j                  t        |j                        |j                        w xY ww)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>
        Get ground truth agreement statistics for multiple users within a project.

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

        ids : str
            Comma separated list of user IDs to get ground truth agreement for

        per_label : typing.Optional[bool]
            Per label

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

        Returns
        -------
        AsyncHttpResponse[UsersGroundTruthAgreementStatsResponse]
            Ground truth agreement statistics for multiple users
        r1   rf   r4   rg   rS   Nr7   r8   r9   r<   r?   )r$   rC   rD   r
   r@   rE   rF   r   r   rG   r   r   r   rH   rA   rI   rh   s           r'   ri   z0AsyncRawStatsClient.users_ground_truth_agreement  s    F ..;;CC,R011MN& , D 
 
		ti++1c1:"D ) 0 ))%HH&^^-N 9#8#8$yGXGXBY`noo-
(  	ty'<'<d9K\K\F]dmdrdrss	t5   =D C D AC  D !C 1,D ?DD rk   c                R  K   | j                   j                  j                  dt        |       dt        |       d|       d{   }	 d|j                  cxk  rdk  rGn nDt        j                  t        t        t        |j                                     }t        ||	      S |j                         }t        |j                  t        |j                        |
      7 # t        $ r6 t        |j                  t        |j                        |j                  
      w xY ww)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>
        Get agreement statistics for a specific annotator within a project.

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

        user_id : int

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

        Returns
        -------
        AsyncHttpResponse[AgreementAnnotatorStatsResponse]
            Individual annotator agreement statistics
        r1   rm   r4   r5   Nr7   r8   r9   r<   r?   )r$   rC   rD   r
   r@   rE   rF   r   r   rG   r   r   r   rH   rA   rI   rn   s          r'   ro   z'AsyncRawStatsClient.agreement_annotator  s    4 ..;;CC,R011LM]^eMfLgh+ D 
 
	
	ti++1c13"= ) 0 ))%HH&^^-N 9#8#8$yGXGXBY`noo%
   	ty'<'<d9K\K\F]dmdrdrss	ts7   AD'C#D'AC% 'D'(C% 8,D'%?D$$D'c                B  K   | j                   j                  j                  dt        |       ddd|i|       d{   }	 d|j                  cxk  rdk  rGn nDt        j                  t        t        t        |j                         	            }t        ||
      S |j                         }t        |j                  t        |j                        |      7 # t        $ r6 t        |j                  t        |j                        |j                        w xY ww)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>
        Get agreement statistics for multiple annotators within a project.

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

        ids : str
            Comma separated list of annotator user IDs to get agreement scores for

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

        Returns
        -------
        AsyncHttpResponse[AgreementAnnotatorsStatsResponse]
            Multiple annotator agreement statistics
        r1   rq   r4   rd   rS   Nr7   r8   r9   r<   r?   )r$   rC   rD   r
   r@   rE   rF   r   r   rG   r   r   r   rH   rA   rI   rr   s          r'   rs   z(AsyncRawStatsClient.agreement_annotators  s    6 ..;;CC,R011LMs , D 
 
		ti++1c14"> ) 0 ))%HH&^^-N 9#8#8$yGXGXBY`noo+
&  	ty'<'<d9K\K\F]dmdrdrss	t4   <DCDAC D C 0,D?DDc                <  K   | j                   j                  j                  dt        |       dd|       d{   }	 d|j                  cxk  rdk  rGn nDt        j                  t        t        t        |j                                     }t        ||	      S |j                         }t        |j                  t        |j                        |
      7 # t        $ r6 t        |j                  t        |j                        |j                  
      w xY ww)ar  
        <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>
        Get statistics about user data filters and their usage within a project.

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

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

        Returns
        -------
        AsyncHttpResponse[DataFiltersStatsResponse]
            User data filter statistics
        r1   rv   r4   r5   Nr7   r8   r9   r<   r?   )r$   rC   rD   r
   r@   rE   rF   r   r   rG   r   r   r   rH   rA   rI   rw   s         r'   rx   z AsyncRawStatsClient.data_filters@  s    0 ..;;CC,R011CD+ D 
 
	
	ti++1c1,"6 ) 0 ))%HH&^^-N 9#8#8$yGXGXBY`noo%
   	ty'<'<d9K\K\F]dmdrdrss	t4   9DCDAC DC -,D?DDrz   r{   c                B  K   | j                   j                  j                  dt        |       ddd|i|       d{   }	 d|j                  cxk  rdk  rGn nDt        j                  t        t        t        |j                         	            }t        ||
      S |j                         }t        |j                  t        |j                        |      7 # t        $ r6 t        |j                  t        |j                        |j                        w xY ww)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>
        Get statistics about finished tasks for a project.

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

        user_pk : typing.Optional[int]
            User ID to filter statistics by (optional)

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

        Returns
        -------
        AsyncHttpResponse[FinishedTasksStatsResponse]
            Finished tasks statistics
        r1   r}   r4   r{   rS   Nr7   r8   r9   r<   r?   )r$   rC   rD   r
   r@   rE   rF   r   r   rG   r   r   r   rH   rA   rI   r~   s          r'   r   z"AsyncRawStatsClient.finished_tasksl  s    6 ..;;CC,R01A7 , D 
 
		ti++1c1."8 ) 0 ))%HH&^^-N 9#8#8$yGXGXBY`noo+
&  	ty'<'<d9K\K\F]dmdrdrss	tr   c                <  K   | j                   j                  j                  dt        |       dd|       d{   }	 d|j                  cxk  rdk  rGn nDt        j                  t        t        t        |j                                     }t        ||	      S |j                         }t        |j                  t        |j                        |
      7 # t        $ r6 t        |j                  t        |j                        |j                  
      w xY ww)ao  
        <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>
        Get lead time statistics across the project, including average annotation time.

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

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

        Returns
        -------
        AsyncHttpResponse[LeadTimeStatsResponse]
            Lead time statistics
        r1   r   r4   r5   Nr7   r8   r9   r<   r?   )r$   rC   rD   r
   r@   rE   rF   r   r   rG   r   r   r   rH   rA   rI   rw   s         r'   r   zAsyncRawStatsClient.lead_time  s    0 ..;;CC,R011AB+ D 
 
	
	ti++1c1)"3 ) 0 ))%HH&^^-N 9#8#8$yGXGXBY`noo%
   	ty'<'<d9K\K\F]dmdrdrss	tr   c                B  K   | j                   j                  j                  dt        |       ddd|i|       d{   }	 d|j                  cxk  rdk  rGn nDt        j                  t        t        t        |j                         	            }t        ||
      S |j                         }t        |j                  t        |j                        |      7 # t        $ r6 t        |j                  t        |j                        |j                        w xY ww)aY  
        <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>
        Overall or per-label total agreement across the project.

        NOTE: due to an open issue in Fern, SDK clients will raise ApiError upon handling a 204 response. As a workaround, wrap call to this function in a try-except block.

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

        per_label : typing.Optional[bool]
            Return agreement per label

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

        Returns
        -------
        AsyncHttpResponse[TotalAgreementStatsResponse]
            Total agreement
        r1   r   r4   rP   rS   Nr7   r8   r9   r<   r?   )r$   rC   rD   r
   r@   rE   rF   r   r   rG   r   r   r   rH   rA   rI   r   s          r'   r   z#AsyncRawStatsClient.total_agreement  s    B ..;;CC,R011GHY , D 
 
		ti++1c1/"9 ) 0 ))%HH&^^-N 9#8#8$yGXGXBY`noo+
&  	ty'<'<d9K\K\F]dmdrdrss	tr   r   r   c                  K   | j                   j                  j                  dt        |       ddd|i|       d{   }	 d|j                  cxk  rdk  rn nt        j                  t
        j                  t        t
        j                  f   t        t
        j                  t        t
        j                  f   |j                         	            }t        ||
      S |j                         }t        |j                  t        |j                         |      7 # t        $ r6 t        |j                  t        |j                         |j"                        w xY ww)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>
        Start stats recalculation for given project

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

        stat_type : typing.Optional[str]
            Stat type to recalculate. Possible values: label, stats

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

        Returns
        -------
        AsyncHttpResponse[typing.Dict[str, typing.Any]]
            Successful response returns job id
        r1   r   r4   r   rS   Nr7   r8   r9   r<   r?   )r$   rC   rD   r
   r@   rE   rF   r   r   r   r   rG   r   r   r   rH   rA   rI   r   s          r'   r   z AsyncRawStatsClient.update_stats  s1    > ..;;CC,R01?Y , D 
 
		ti++1c1KKVZZ0"$kk#vzz/: ) 0 ))%HH&^^-N 9#8#8$yGXGXBY`noo+
&  	ty'<'<d9K\K\F]dmdrdrss	ts4   <E!DE!BD !E!"D 2,E!?EE!c                D  K   | j                   j                  j                  dt        |       dd||d|       d{   }	 d|j                  cxk  rdk  rGn nDt        j                  t        t        t        |j                         	            }t        ||
      S |j                         }t        |j                  t        |j                        |      7 # t        $ r6 t        |j                  t        |j                        |j                        w xY ww)aG  
        <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>
        Get prediction agreement statistics for multiple annotators within a project.

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

        ids : str
            Comma separated list of annotator user IDs to get agreement scores for

        per_label : typing.Optional[bool]
            Per label

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

        Returns
        -------
        AsyncHttpResponse[UsersPredictionAgreementStatsResponse]
            Prediction agreement statistics for multiple annotators
        r1   r   r4   rg   rS   Nr7   r8   r9   r<   r?   )r$   rC   rD   r
   r@   rE   rF   r   r   rG   r   r   r   rH   rA   rI   rh   s           r'   r   z.AsyncRawStatsClient.users_prediction_agreement8  s    F ..;;CC,R011GH& , D 
 
		ti++1c19"C ) 0 ))%HH&^^-N 9#8#8$yGXGXBY`noo-
(  	ty'<'<d9K\K\F]dmdrdrss	tr   c                D  K   | j                   j                  j                  dt        |       dd||d|       d{   }	 d|j                  cxk  rdk  rGn nDt        j                  t        t        t        |j                         	            }t        ||
      S |j                         }t        |j                  t        |j                        |      7 # t        $ r6 t        |j                  t        |j                        |j                        w xY ww)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>
        Get review score and performance score statistics for multiple annotators within a project. Only allowed for accounts with reviewing features enabled.

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

        ids : str
            Comma separated list of annotator user IDs to get review scores for

        per_label : typing.Optional[bool]
            Per label

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

        Returns
        -------
        AsyncHttpResponse[UsersReviewScoreStatsResponse]
            Review scores and performance scores for multiple annotators
        r1   r   r4   rg   rS   Nr7   r8   r9   r<   r?   )r$   rC   rD   r
   r@   rE   rF   r   r   rG   r   r   r   rH   rA   rI   rh   s           r'   r   z&AsyncRawStatsClient.users_review_scores  s    F ..;;CC,R011IJ& , D 
 
		ti++1c11"; ) 0 ))%HH&^^-N 9#8#8$yGXGXBY`noo-
(  	ty'<'<d9K\K\F]dmdrdrss	tr   c                Z  K   | j                   j                  j                  dt        |       dt        |       ddd|i|       d{   }	 d|j                  cxk  rd	k  rGn nDt        j                  t        t        t        |j                         
            }t        ||      S |j                         }t        |j                  t        |j                        |      7 # t        $ r6 t        |j                  t        |j                        |j                        w xY ww)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>
        Get prediction agreement statistics for a specific user within a project.

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

        user_pk : int

        per_label : typing.Optional[bool]
            Calculate agreement per label

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

        Returns
        -------
        AsyncHttpResponse[UserPredictionAgreementStatsResponse]
            Individual user prediction agreement statistics
        r1   r   rY   r4   rP   rS   Nr7   r8   r9   r<   r?   )r$   rC   rD   r
   r@   rE   rF   r   r   rG   r   r   r   rH   rA   rI   r   s           r'   r   z-AsyncRawStatsClient.user_prediction_agreement  s    D ..;;CC,R01>Nw>W=XXcdY , D 
 
		ti++1c18"B ) 0 ))%HH&^^-N 9#8#8$yGXGXBY`noo+
&  	ty'<'<d9K\K\F]dmdrdrss	tr   c                Z  K   | j                   j                  j                  dt        |       dt        |       ddd|i|       d{   }	 d|j                  cxk  rd	k  rGn nDt        j                  t        t        t        |j                         
            }t        ||      S |j                         }t        |j                  t        |j                        |      7 # t        $ r6 t        |j                  t        |j                        |j                        w xY ww)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>
        Get review score statistics for a specific user within a project. Only allowed for accounts with reviewing features enabled.

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

        user_pk : int

        per_label : typing.Optional[bool]
            Calculate agreement per label

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

        Returns
        -------
        AsyncHttpResponse[UserReviewScoreStatsResponse]
            Individual user review score statistics
        r1   r   r   r4   rP   rS   Nr7   r8   r9   r<   r?   )r$   rC   rD   r
   r@   rE   rF   r   r   rG   r   r   r   rH   rA   rI   r   s           r'   r   z%AsyncRawStatsClient.user_review_score  s    D ..;;CC,R01>Nw>W=XXefY , D 
 
		ti++1c10": ) 0 ))%HH&^^-N 9#8#8$yGXGXBY`noo+
&  	ty'<'<d9K\K\F]dmdrdrss	tr   c                Z  K   | j                   j                  j                  dt        |       dt        |       ddd|i|       d{   }	 d|j                  cxk  rd	k  rGn nDt        j                  t        t        t        |j                         
            }t        ||      S |j                         }t        |j                  t        |j                        |      7 # t        $ r6 t        |j                  t        |j                        |j                        w xY ww)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>
        Get ground truth agreement statistics for a specific user within a project.

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

        user_pk : int

        per_label : typing.Optional[bool]
            Calculate agreement per label

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

        Returns
        -------
        AsyncHttpResponse[UserGroundTruthAgreementStatsResponse]
            Individual user ground truth agreement statistics
        r1   r   rf   r4   rP   rS   Nr7   r8   r9   r<   r?   )r$   rC   rD   r
   r@   rE   rF   r   r   rG   r   r   r   rH   rA   rI   r   s           r'   r   z/AsyncRawStatsClient.user_ground_truth_agreement   s    D ..;;CC,R019I'9R8SSopY , D 
 
		ti++1c19"C ) 0 ))%HH&^^-N 9#8#8$yGXGXBY`noo+
&  	ty'<'<d9K\K\F]dmdrdrss	tr   )/r   r   r   r   r(   r   r   rE   r   r   r   r   rN   r   r   rV   r   rZ   r   rc   r   ri   r   ro   r   rs   r   rx   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r*   r'   r   r     s   .*< . bf,p,p&),p?E~?^,p	F	G,pf ,0;?7p7p 7p
 ??4(7p  87p 
H	I7p| ,0;?7p7p 7p
 ??4(7p  87p 
G	H7pz (,+/%)%);?CpCp $	Cp
 ??4(Cp __T"Cp ooc"Cp  8Cp 
+	,CpT ,0;?9p9p 	9p
 ??4(9p  89p 
A	B9px \`,p,p #,p9?9X,p	:	;,p^ X\0p0p"0p5;__^5T0p	;	<0pf NR*p*p+1??>+J*p	3	4*pZ ;?sw0p0p#)??3#70pQWQ`Q`aoQp0p	5	60pf NR*p*p+1??>+J*p	0	1*p` ,0;?6p6p ??4(	6p
  86p 
6	76px +/;?4p4p ??3'	4p
  84p 
6;;sFJJ7	84pv ,0;?9p9p 	9p
 ??4(9p  89p 
@	A9p@ ,0;?9p9p 	9p
 ??4(9p  89p 
8	99p@ ,0;?7p7p 7p
 ??4(7p  87p 
?	@7p| ,0;?7p7p 7p
 ??4(7p  87p 
7	87p| ,0;?7p7p 7p
 ??4(7p  87p 
@	A7pr*   r   )3rE   json.decoderr   core.api_errorr   core.client_wrapperr   r   core.http_responser   r	   core.jsonable_encoderr
   core.request_optionsr   core.unchecked_base_modelr   (types.agreement_annotator_stats_responser   )types.agreement_annotators_stats_responser   !types.data_filters_stats_responser   #types.finished_tasks_stats_responser   types.iaa_stats_responser   types.lead_time_stats_responser   6types.model_version_annotator_agreement_stats_responser   9types.model_version_ground_truth_agreement_stats_responser   7types.model_version_prediction_agreement_stats_responser   $types.total_agreement_stats_responser   0types.user_ground_truth_agreement_stats_responser   .types.user_prediction_agreement_stats_responser   &types.user_review_score_stats_responser   1types.users_ground_truth_agreement_stats_responser   /types.users_prediction_agreement_stats_responser   'types.users_review_score_stats_responser   r   r   r   r*   r'   <module>r      sl     ( & H A 5 2 7 U W G K 6 A o t q M c ` P e b R[p [p|[p [pr*   