�
<��g�( � �b � d dl mZ d dlZd dlZd dlZd dlZd dlZd dlZd dlZd dl m
Z
d dlmZ d dl
mZ d dlmZmZ ddlmZ dd lmZmZ dd
lmZ ddlmZ ddlmZmZmZmZm Z m!Z!m"Z" ej# d
� � Z$d� Z% G d� de&� � Z' G d� de'�� � Z( G d� dej) � � Z*d� Z+dS )� )�annotationsN)�ESPIPE)� has_magic)�sha256)�Any�ClassVar� )�DEFAULT_CALLBACK)�apply_config�conf)�DirCache)�Transaction)�_unstrip_protocol�glob_translate�
isfilelike�other_paths�
read_block�stringify_path�tokenize�fsspecc � � | |i |��S �N� )�cls�args�kwargss �[/home/asafur/pinokio/api/open-webui.git/app/env/lib/python3.11/site-packages/fsspec/spec.py�
make_instancer s � ��3������� c �, � � e Zd ZdZ� fd�Z� fd�Z� xZS )�_Cacheda
Metaclass for caching file system instances.
Notes
-----
Instances are cached according to
* The values of the class attributes listed in `_extra_tokenize_attributes`
* The arguments passed to ``__init__``.
This creates an additional reference to the filesystem, which prevents the
filesystem from being garbage collected when all *user* references go away.
A call to the :meth:`AbstractFileSystem.clear_instance_cache` must *also*
be made for a filesystem instance to be garbage collected.
c �� �� t � � j |i |�� t j d� � rt j � � | _ ni | _ t j � � | _ d S )N�weakref_instance_cache)
�super�__init__r �get�weakref�WeakValueDictionary�_cache�os�getpid�_pid)r r r � __class__s �r r% z_Cached.__init__5 s^ �� ������$�)�&�)�)�)� �8�,�-�-� � �4�6�6�C�J�J��C�J��9�;�;����r c � �� � t � |� � }t � fd�� j D � � � � }t � � j t j � � g|�|�R i |��}|� dd� � }t j � � � j k r1� j
� � � t j � � � _ |s$� j r|� j
v r|� _
� j
| S t � � j |i |��}||_ ||_ ||_ |j r|j rddlm} ||� � � j r|s|� _
|� j
|<