
    	]j                         d Z ddlZddlZddlZddlmZ ddlmZ ddlm	Z	 ddl
mZ ej                  j                  d        Zy)zThis file and its contents are licensed under the Apache License 2.0. Please see the included NOTICE for copyright information and LICENSE for a copy of the license.
    N)settings)Project)User)	gen_tasksc                    t         j                  j                  |j                        }|j                  }t        j                  j                  d      }|j
                  j                  j                  |       |j                  |       t        |j                         t        j                  j                         }d}t        j                  j                  t        j                   |      }|t#        |d      |fi}	dj%                  |      }
| j'                  |
|	d      }|j(                  d	k(  sJ |j*                         t        j                  j                         }||z
  j,                  d
k  sJ y)a  
        this test loads tasks_and_annotations.json
        with 1000 tasks and 5000 annotations and recalc accuracy
        with bulk_update
        goal is to be under time limit to ensure operations
        are fast enough

        this project has p.data_types_json() as
        {text: '', meta_info:''}
        json should be generated as item = {data:{}}

        one could check results with
        tasks = Task.objects.all()
        print('annotations', [(t.id, t.annotations.count()) for t in tasks])
        print('accuracy', [(t.id, t.accuracy) for t in tasks])

    :param annotator_client:
    :param configured_project:
    :return:
    )idzannotator@pytest.net)emailztasks_and_annotations.jsonrbz/api/projects/{}/tasks/bulk/	multipart)dataformat      N)r   objectsgetr   r   
created_byactive_organizationadd_useradd_collaboratorr   datetimenowospathjoinr   TEST_DATA_ROOTopenr   poststatus_codecontentseconds)business_clientannotator_clientconfigured_projectp
project_iduserdt1filenamefilepathr   urlrdt2s                Q/root/env/lib/python3.12/site-packages/label_studio/tests/test_bulk_operations.pytest_load_tasks_and_annotationsr.      s0   , 	1445A#&&J<<"89DLL$$--d3tdgg





!C+Hww||H33X>HtHd+X67D
(
/
/

;CStK@A==C**





!C #I$$$    )__doc__r   r   pytestdjango.confr   projects.modelsr   users.modelsr   6label_studio.tests.test_data.gen_tasks_and_annotationsr   mark	django_dbr.    r/   r-   <module>r9      s=     	    #  L *% *%r/   