관리-도구
편집 파일: __init__.cpython-311.pyc
� P�Dg� � �� � d dl Z d dlmZmZmZmZ ddlmZmZm Z m Z mZmZ ddl mZ ddlmZ ddlmZ n # e$ r dZY nw xY wg d�Zefd eeee j ef d edefd�Zd ZdZdZdZdZdS )� N)�IO�AnyStr�Union�cast� )� MODE_AUTO�MODE_FD� MODE_FILE�MODE_MEMORY� MODE_MMAP� MODE_MMAP_EXT)�InvalidDatabaseError)�Reader)� extension) r r r r r r r r � open_database�database�mode�returnc �t � |t t t t t t fvrt d|� �� � �t ot t d� � }|t k r|n |t k }|st | |� � S |st d� � �t t t j | |� � � � S )a Open a MaxMind DB database Arguments: database -- A path to a valid MaxMind DB file such as a GeoIP2 database file, or a file descriptor in the case of MODE_FD. mode -- mode to open the database with. Valid mode are: * MODE_MMAP_EXT - use the C extension with memory map. * MODE_MMAP - read from memory map. Pure Python. * MODE_FILE - read database as standard file. Pure Python. * MODE_MEMORY - load database into memory. Pure Python. * MODE_FD - the param passed via database is a file descriptor, not a path. This mode implies MODE_MEMORY. * MODE_AUTO - tries MODE_MMAP_EXT, MODE_MMAP, MODE_FILE in that order. Default mode. zUnsupported open mode: r zEMODE_MMAP_EXT requires the maxminddb.extension module to be available)r r r r r r � ValueError� _extension�hasattrr r )r r � has_extension� use_extensions �r/builddir/build/BUILD/imunify360-venv-2.4.0/opt/imunify360/venv/lib/python3.11/site-packages/maxminddb/__init__.pyr r $ s� � �&