403Webshell
Server IP : 217.160.0.135  /  Your IP : 216.73.217.85
Web Server : Apache
System : Linux www 6.18.52-i1-ampere #1203 SMP Mon Sep 14 18:29:59 CEST 2026 aarch64
User : sws1074145052 ( 1074145052)
PHP Version : 8.3.32
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /lib/python3/dist-packages/django/db/migrations/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /lib/python3/dist-packages/django/db/migrations/__pycache__/optimizer.cpython-311.pyc
�

�|�e��� �Gd�d��ZdS)c��eZdZdZd�Zd�ZdS)�MigrationOptimizera]
    Power the optimization process, where you provide a list of Operations
    and you are returned a list of equal or shorter length - operations
    are merged into one if possible.

    For example, a CreateModel and an AddField can be optimized into a
    new CreateModel, and CreateModel and DeleteModel can be optimized into
    nothing.
    c��|�td���d|_	|�||��}|xjdz
c_||kr|S|}�1)a�
        Main optimization entry point. Pass in a list of Operation instances,
        get out a new list of Operation instances.

        Unfortunately, due to the scope of the optimization (two combinable
        operations might be separated by several hundred others), this can't be
        done as a peephole optimization with checks/output implemented on
        the Operations themselves; instead, the optimizer looks at each
        individual operation and scans forwards in the list to see if there
        are any matches, stopping at boundaries - operations which can't
        be optimized over (RunSQL, operations on the same field/model, etc.)

        The inner loop is run until the starting list is the same as the result
        list, and then the result is returned. This means that operation
        optimization must be stable and always return an equal or shorter list.
        Nzapp_label must be a str.�T�)�	TypeError�_iterations�optimize_inner)�self�
operations�	app_label�results    �@/usr/lib/python3/dist-packages/django/db/migrations/optimizer.py�optimizezMigrationOptimizer.optimizesi��$���6�7�7�7����	 ��(�(��Y�?�?�F�����!�����#�#��
��J�	 �c���
�g}t|��D�]3\}}d}t||dzd���D]�\}�
|��
���}t|t��r�||dz||zdz�}	|r+|�|	��|�|��n^t��
fd�|	D����r+|�|��|�|	��n|�|��nC|�|||zdzd���|ccS|sd}��|�|����5|S)zInner optimization loop.TrNc3�H�K�|]}|�����duV��dS)TN)�reduce)�.0�opr�others  ��r�	<genexpr>z4MigrationOptimizer.optimize_inner.<locals>.<genexpr>5s6�����V�V�R�R�Y�Y�u�i�8�8�D�@�V�V�V�V�V�Vr�F)�	enumerater�
isinstance�list�extend�all�append)r
rr�new_operations�i�	operation�right�jr
�
in_betweenrs  `       @rr	z!MigrationOptimizer.optimize_inner(s�������%�j�1�1�	1�	1�L�A�y��E�%�j��Q����&8�9�9�
1�
1���5�"�)�)�%��;�;���f�d�+�+�"�!+�A��E�!�a�%�!�)�O�!<�J���&�-�-�j�9�9�9�&�-�-�f�5�5�5�5��V�V�V�V�V�:�V�V�V�V�V��'�-�-�f�5�5�5�&�-�-�j�9�9�9�9�'�-�-�i�8�8�8���"�)�)�*�Q��U�Q�Y�Z�Z�*@�A�A�A�)�)�)�)�)�)��"�!�E���%�%�i�0�0�0���rN)�__name__�
__module__�__qualname__�__doc__rr	�rrrrs<�������� � � �8����rrN)rr)rr�<module>r*sA��D�D�D�D�D�D�D�D�D�Dr

Youez - 2016 - github.com/yon3zu
LinuXploit