ok
Direktori : /opt/cloudlinux/venv/lib/python3.11/site-packages/pyfakefs/__pycache__/ |
Current File : //opt/cloudlinux/venv/lib/python3.11/site-packages/pyfakefs/__pycache__/helpers.cpython-311.pyc |
� �܋fy3 � � � d Z ddlZddlZddlZddlZddlZddlZddlZddlmZ ddlm Z ddl mZmZm Z mZmZmZ eeef Zeeej f Z ej � � dk Zej dk Zej � d� � Zd Zd ZdZdZd Z dZ!ej dk rda"da#n ej$ � � a" ej% � � a#de&fd�Z'de&ddfd�Z(de&fd�Z)de&ddfd�Z*d6d�Z+de,fd�Z-de de,fd�Z.de de,fd�Z/de de,fd�Z0ededefd�� � Z1edej defd�� � Z1dedefd �Z1d!eeeeef f defd"�Z2d!eeeeef f defd#�Z3d$ed%edefd&�Z4d'ee dee fd(�Z5d)� Z6ed*ed+edefd,�� � Z7ed*ed+edefd-�� � Z7ed*ed+dddfd.�� � Z7d*ed+ee dee fd/�Z7 G d0� d1� � Z8 G d2� d3ej9 � � Z: G d4� d5ej; � � Z<dS )7z7Helper classes use for fake file system implementation.� N��copy)�S_IFLNK)�Union�Optional�Any�AnyStr�overload�cast�PyPy�win32z/.dockerenv� � �@ i� i� i� � �returnc � � t S )z/Get the global user id. Same as ``os.getuid()``��USER_ID� � �a/builddir/build/BUILD/cloudlinux-venv-1.0.6/venv/lib/python3.11/site-packages/pyfakefs/helpers.py�get_uidr / s � ��Nr �uidc � � | a dS )a% Set the global user id. This is used as st_uid for new files and to differentiate between a normal user and the root user (uid 0). For the root user, some permission restrictions are ignored. Args: uid: (int) the user ID of the user calling the file system functions. Nr )r s r �set_uidr 4 s � � �G�G�Gr c � � t S )z0Get the global group id. Same as ``os.getgid()``��GROUP_IDr r r �get_gidr @ s � ��Or �gidc � � | a dS )z�Set the global group id. This is only used to set st_gid for new files, no permission checks are performed. Args: gid: (int) the group ID of the user calling the file system functions. Nr )r! s r �set_gidr# E s � � �H�H�Hr c �� � t j dk r t d� � t d� � dS t t j � � � � t t j � � � � dS )z;Set the global user ID and group ID back to default values.r r N)�sys�platformr r# �os�getuid�getgidr r r � reset_idsr* P sW � � �|�w����� � � ��� � � � � ��� �������� �������r c � � t dk S )z1Return True if the current user is the root user.r r r r r �is_rootr, Z s � ��a�<�r �valc �, � t | t � � S )z(Return True if `val` is of integer type.)� isinstance�int�r- s r �is_int_typer2 _ s � ��c�3���r c �$ � t | d� � S )zLReturn True if `val` is a bytes-like object, False for a unicode string.�encode��hasattrr1 s r �is_byte_stringr7 d s � � �s�H�%�%�%�%r c �"