diff --git a/.gitattributes b/.gitattributes index 8ed13ff553f4b6bb68e7ee80946f1de4f05d3e78..4db3926d36ff5c4dccac5f7015fc25e439a80811 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1203,3 +1203,108 @@ platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-pack platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pandas/tests/tools/__pycache__/test_to_datetime.cpython-312.pyc filter=lfs diff=lfs merge=lfs -text platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/paramiko/__pycache__/transport.cpython-312.pyc filter=lfs diff=lfs merge=lfs -text platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/__pycache__/phonenumberutil.cpython-312.pyc filter=lfs diff=lfs merge=lfs -text +platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/carrierdata/__pycache__/data0.cpython-312.pyc filter=lfs diff=lfs merge=lfs -text +platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/carrierdata/__pycache__/data1.cpython-312.pyc filter=lfs diff=lfs merge=lfs -text +platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/carrierdata/__pycache__/data2.cpython-312.pyc filter=lfs diff=lfs merge=lfs -text +platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/geodata/__pycache__/data0.cpython-312.pyc filter=lfs diff=lfs merge=lfs -text +platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/geodata/__pycache__/data1.cpython-312.pyc filter=lfs diff=lfs merge=lfs -text +platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/geodata/__pycache__/data10.cpython-312.pyc filter=lfs diff=lfs merge=lfs -text +platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/geodata/__pycache__/data11.cpython-312.pyc filter=lfs diff=lfs merge=lfs -text +platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/geodata/__pycache__/data12.cpython-312.pyc filter=lfs diff=lfs merge=lfs -text +platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/geodata/__pycache__/data13.cpython-312.pyc filter=lfs diff=lfs merge=lfs -text +platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/geodata/__pycache__/data14.cpython-312.pyc filter=lfs diff=lfs merge=lfs -text +platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/geodata/__pycache__/data15.cpython-312.pyc filter=lfs diff=lfs merge=lfs -text +platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/geodata/__pycache__/data16.cpython-312.pyc filter=lfs diff=lfs merge=lfs -text +platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/geodata/__pycache__/data17.cpython-312.pyc filter=lfs diff=lfs merge=lfs -text +platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/geodata/__pycache__/data18.cpython-312.pyc filter=lfs diff=lfs merge=lfs -text +platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/geodata/__pycache__/data19.cpython-312.pyc filter=lfs diff=lfs merge=lfs -text +platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/geodata/__pycache__/data2.cpython-312.pyc filter=lfs diff=lfs merge=lfs -text +platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/geodata/__pycache__/data20.cpython-312.pyc filter=lfs diff=lfs merge=lfs -text +platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/geodata/__pycache__/data21.cpython-312.pyc filter=lfs diff=lfs merge=lfs -text +platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/geodata/__pycache__/data22.cpython-312.pyc filter=lfs diff=lfs merge=lfs -text +platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/geodata/__pycache__/data23.cpython-312.pyc filter=lfs diff=lfs merge=lfs -text +platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/geodata/__pycache__/data24.cpython-312.pyc filter=lfs diff=lfs merge=lfs -text +platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/geodata/__pycache__/data25.cpython-312.pyc filter=lfs diff=lfs merge=lfs -text +platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/geodata/__pycache__/data26.cpython-312.pyc filter=lfs diff=lfs merge=lfs -text +platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/geodata/__pycache__/data27.cpython-312.pyc filter=lfs diff=lfs merge=lfs -text +platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/geodata/__pycache__/data28.cpython-312.pyc filter=lfs diff=lfs merge=lfs -text +platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/geodata/__pycache__/data3.cpython-312.pyc filter=lfs diff=lfs merge=lfs -text +platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/geodata/__pycache__/data4.cpython-312.pyc filter=lfs diff=lfs merge=lfs -text +platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/geodata/__pycache__/data5.cpython-312.pyc filter=lfs diff=lfs merge=lfs -text +platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/geodata/__pycache__/data6.cpython-312.pyc filter=lfs diff=lfs merge=lfs -text +platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/geodata/__pycache__/data7.cpython-312.pyc filter=lfs diff=lfs merge=lfs -text +platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/geodata/__pycache__/data8.cpython-312.pyc filter=lfs diff=lfs merge=lfs -text +platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/geodata/__pycache__/data9.cpython-312.pyc filter=lfs diff=lfs merge=lfs -text +platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/geodata/__pycache__/locale.cpython-312.pyc filter=lfs diff=lfs merge=lfs -text +platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/tzdata/__pycache__/data0.cpython-312.pyc filter=lfs diff=lfs merge=lfs -text +platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_vendor/distlib/t64-arm.exe filter=lfs diff=lfs merge=lfs -text +platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_vendor/distlib/t64.exe filter=lfs diff=lfs merge=lfs -text +platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_vendor/distlib/w64-arm.exe filter=lfs diff=lfs merge=lfs -text +platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_vendor/distlib/w64.exe filter=lfs diff=lfs merge=lfs -text +platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_vendor/idna/__pycache__/uts46data.cpython-312.pyc filter=lfs diff=lfs merge=lfs -text +platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_vendor/pkg_resources/__pycache__/__init__.cpython-312.pyc filter=lfs diff=lfs merge=lfs -text +platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_vendor/rich/__pycache__/_emoji_codes.cpython-312.pyc filter=lfs diff=lfs merge=lfs -text +platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_vendor/rich/__pycache__/console.cpython-312.pyc filter=lfs diff=lfs merge=lfs -text +platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pkg_resources/__pycache__/__init__.cpython-312.pyc filter=lfs diff=lfs merge=lfs -text +platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/posthog/test/__pycache__/test_feature_flags.cpython-312.pyc filter=lfs diff=lfs merge=lfs -text +platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pyarrow/tests/__pycache__/test_pandas.cpython-312.pyc filter=lfs diff=lfs merge=lfs -text +platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pyarrow/tests/__pycache__/test_array.cpython-312.pyc filter=lfs diff=lfs merge=lfs -text +platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pyarrow/tests/__pycache__/test_compute.cpython-312.pyc filter=lfs diff=lfs merge=lfs -text +platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pyarrow/tests/__pycache__/test_convert_builtin.cpython-312.pyc filter=lfs diff=lfs merge=lfs -text +platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pyarrow/tests/__pycache__/test_csv.cpython-312.pyc filter=lfs diff=lfs merge=lfs -text +platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pyarrow/tests/__pycache__/test_dataset.cpython-312.pyc filter=lfs diff=lfs merge=lfs -text +platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pyarrow/tests/__pycache__/test_extension_type.cpython-312.pyc filter=lfs diff=lfs merge=lfs -text +platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pyarrow/tests/__pycache__/test_flight.cpython-312.pyc filter=lfs diff=lfs merge=lfs -text +platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pyarrow/tests/__pycache__/test_fs.cpython-312.pyc filter=lfs diff=lfs merge=lfs -text +platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pyarrow/tests/__pycache__/test_io.cpython-312.pyc filter=lfs diff=lfs merge=lfs -text +platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pyarrow/tests/__pycache__/test_table.cpython-312.pyc filter=lfs diff=lfs merge=lfs -text +platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pyasn1/type/__pycache__/univ.cpython-312.pyc filter=lfs diff=lfs merge=lfs -text +platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pycountry/locales/ast/LC_MESSAGES/iso639-3.mo filter=lfs diff=lfs merge=lfs -text +platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pycountry/locales/be/LC_MESSAGES/iso3166-2.mo filter=lfs diff=lfs merge=lfs -text +platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pycountry/locales/crh/LC_MESSAGES/iso639-3.mo filter=lfs diff=lfs merge=lfs -text +platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pycountry/locales/da/LC_MESSAGES/iso3166-2.mo filter=lfs diff=lfs merge=lfs -text +platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pycountry/locales/de/LC_MESSAGES/iso3166-2.mo filter=lfs diff=lfs merge=lfs -text +platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pycountry/locales/de/LC_MESSAGES/iso639-3.mo filter=lfs diff=lfs merge=lfs -text +platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pycountry/locales/fr/LC_MESSAGES/iso3166-2.mo filter=lfs diff=lfs merge=lfs -text +platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pycountry/locales/fr/LC_MESSAGES/iso639-3.mo filter=lfs diff=lfs merge=lfs -text +platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pycountry/locales/gl/LC_MESSAGES/iso639-3.mo filter=lfs diff=lfs merge=lfs -text +platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pycountry/locales/id/LC_MESSAGES/iso3166-2.mo filter=lfs diff=lfs merge=lfs -text +platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pycountry/locales/id/LC_MESSAGES/iso639-3.mo filter=lfs diff=lfs merge=lfs -text +platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pycountry/locales/is/LC_MESSAGES/iso639-3.mo filter=lfs diff=lfs merge=lfs -text +platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pycountry/locales/it/LC_MESSAGES/iso3166-2.mo filter=lfs diff=lfs merge=lfs -text +platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pycountry/locales/it/LC_MESSAGES/iso639-3.mo filter=lfs diff=lfs merge=lfs -text +platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pycountry/locales/ka/LC_MESSAGES/iso3166-2.mo filter=lfs diff=lfs merge=lfs -text +platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pycountry/locales/kn/LC_MESSAGES/iso639-3.mo filter=lfs diff=lfs merge=lfs -text +platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pycountry/locales/mr/LC_MESSAGES/iso639-3.mo filter=lfs diff=lfs merge=lfs -text +platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pycountry/locales/nl/LC_MESSAGES/iso3166-2.mo filter=lfs diff=lfs merge=lfs -text +platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pycountry/locales/or/LC_MESSAGES/iso639-3.mo filter=lfs diff=lfs merge=lfs -text +platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pycountry/locales/pa/LC_MESSAGES/iso639-3.mo filter=lfs diff=lfs merge=lfs -text +platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pycountry/locales/pl/LC_MESSAGES/iso3166-2.mo filter=lfs diff=lfs merge=lfs -text +platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pycountry/locales/pl/LC_MESSAGES/iso639-3.mo filter=lfs diff=lfs merge=lfs -text +platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pycountry/locales/ro/LC_MESSAGES/iso3166-2.mo filter=lfs diff=lfs merge=lfs -text +platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pycountry/locales/ru/LC_MESSAGES/iso3166-2.mo filter=lfs diff=lfs merge=lfs -text +platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pycountry/locales/sr/LC_MESSAGES/iso3166-2.mo filter=lfs diff=lfs merge=lfs -text +platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pycountry/locales/sr@latin/LC_MESSAGES/iso3166-2.mo filter=lfs diff=lfs merge=lfs -text +platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pycountry/locales/sv/LC_MESSAGES/iso3166-2.mo filter=lfs diff=lfs merge=lfs -text +platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pycountry/locales/sv/LC_MESSAGES/iso639-3.mo filter=lfs diff=lfs merge=lfs -text +platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pycountry/locales/ta/LC_MESSAGES/iso639-3.mo filter=lfs diff=lfs merge=lfs -text +platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pycountry/locales/tr/LC_MESSAGES/iso639-3.mo filter=lfs diff=lfs merge=lfs -text +platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pycountry/locales/uk/LC_MESSAGES/iso3166-2.mo filter=lfs diff=lfs merge=lfs -text +platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pycountry/locales/uk/LC_MESSAGES/iso639-3.mo filter=lfs diff=lfs merge=lfs -text +platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pycountry/locales/vi/LC_MESSAGES/iso3166-2.mo filter=lfs diff=lfs merge=lfs -text +platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pycountry/locales/zh_CN/LC_MESSAGES/iso3166-2.mo filter=lfs diff=lfs merge=lfs -text +platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pydantic/__pycache__/json_schema.cpython-312.pyc filter=lfs diff=lfs merge=lfs -text +platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pydantic/_internal/__pycache__/_generate_schema.cpython-312.pyc filter=lfs diff=lfs merge=lfs -text +platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pydantic_core/__pycache__/core_schema.cpython-312.pyc filter=lfs diff=lfs merge=lfs -text +platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pymongo/asynchronous/__pycache__/collection.cpython-312.pyc filter=lfs diff=lfs merge=lfs -text +platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pymongo/asynchronous/__pycache__/mongo_client.cpython-312.pyc filter=lfs diff=lfs merge=lfs -text +platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pymongo/synchronous/__pycache__/collection.cpython-312.pyc filter=lfs diff=lfs merge=lfs -text +platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pymongo/synchronous/__pycache__/mongo_client.cpython-312.pyc filter=lfs diff=lfs merge=lfs -text +platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pynvml_utils/__pycache__/smi.cpython-312.pyc filter=lfs diff=lfs merge=lfs -text +platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pypika/__pycache__/queries.cpython-312.pyc filter=lfs diff=lfs merge=lfs -text +platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/__pycache__/async_qdrant_client.cpython-312.pyc filter=lfs diff=lfs merge=lfs -text +platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/__pycache__/async_qdrant_remote.cpython-312.pyc filter=lfs diff=lfs merge=lfs -text +platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/__pycache__/qdrant_client.cpython-312.pyc filter=lfs diff=lfs merge=lfs -text +platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/__pycache__/qdrant_remote.cpython-312.pyc filter=lfs diff=lfs merge=lfs -text +platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/conversions/__pycache__/conversion.cpython-312.pyc filter=lfs diff=lfs merge=lfs -text +platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/http/models/__pycache__/models.cpython-312.pyc filter=lfs diff=lfs merge=lfs -text diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/carrierdata/__pycache__/__init__.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/carrierdata/__pycache__/__init__.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..549e58da82be10b0d9ebf3c08d5aa998b56cbf23 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/carrierdata/__pycache__/__init__.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/carrierdata/__pycache__/data0.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/carrierdata/__pycache__/data0.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..99268b55d72e9da89dea3a050aaf7ceba06ae36d --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/carrierdata/__pycache__/data0.cpython-312.pyc @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:739d27501eb474d9c2891a9246242656474b384a9a35c63df1d9025a4edd31f9 +size 465968 diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/carrierdata/__pycache__/data1.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/carrierdata/__pycache__/data1.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d96a7632b6129061ea39a8f1915ffb25a44dbe7b --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/carrierdata/__pycache__/data1.cpython-312.pyc @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bd4a34108c34d66000b70d79e4167a94f8a0205a6f4892faf953fb5233fbcad6 +size 461373 diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/carrierdata/__pycache__/data2.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/carrierdata/__pycache__/data2.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a25121d061ec7138a20b261d4501f97c7cd95ce0 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/carrierdata/__pycache__/data2.cpython-312.pyc @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a5bc4851774b83b0a9df1020597836380ab80500ded0b32bc6fed9528ab42ed7 +size 437660 diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/__init__.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/__init__.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..0336c73efbcdd99874d7f61c174c0017e76eb298 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/__init__.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/alt_format_255.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/alt_format_255.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..63fa167436cac3a249f28336d1f318608b225e93 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/alt_format_255.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/alt_format_27.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/alt_format_27.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e886fecdba96167d87ea3a436f80b66846357d00 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/alt_format_27.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/alt_format_30.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/alt_format_30.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a5afdd6845787dcf72471ddaf19a159c7abc0502 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/alt_format_30.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/alt_format_31.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/alt_format_31.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..6e5cb18d12cca8fc37a4d9ab12c68f9987244d28 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/alt_format_31.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/alt_format_34.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/alt_format_34.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..5dc1344188e2988bee0aa0f1d3cec025097b838e Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/alt_format_34.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/alt_format_350.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/alt_format_350.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..4ba6b855e91f0ef944b0ae486ffe152d36ec3b93 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/alt_format_350.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/alt_format_351.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/alt_format_351.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..6b3a2c1c308b91c40f801eccc340b9da9cdb06cf Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/alt_format_351.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/alt_format_352.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/alt_format_352.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2b71ece7d18fbfaa349ebb1c80c80a17fcc9abe7 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/alt_format_352.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/alt_format_358.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/alt_format_358.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..fe2007e49895b174b37dfba768d827c2378ae676 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/alt_format_358.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/alt_format_359.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/alt_format_359.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..17c7dfc7ad94b1fbc60c39969ea972e8d8ffde7c Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/alt_format_359.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/alt_format_36.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/alt_format_36.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..31e0e8114fd63a891eced945fc4ea8396948650a Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/alt_format_36.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/alt_format_372.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/alt_format_372.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..411fc7853933df7e8203a4525202770198cdc675 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/alt_format_372.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/alt_format_373.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/alt_format_373.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..317d1fe6af382ca6ce17713621ab69ce01f93982 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/alt_format_373.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/alt_format_380.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/alt_format_380.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..4175a25a21df6003720edecabe788c07359aec9c Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/alt_format_380.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/alt_format_381.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/alt_format_381.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..df023a24cf1e9f8b2ef367292843d25fb2f41576 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/alt_format_381.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/alt_format_385.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/alt_format_385.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..dab04d68c71dc83469adf08048314ed407549fd6 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/alt_format_385.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/alt_format_39.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/alt_format_39.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..49d77d2f68f91a4b5d4ca58dd1ade472bfcad8fb Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/alt_format_39.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/alt_format_43.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/alt_format_43.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..bcf16aded0cdb5d603394f4fef9841360b03c65e Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/alt_format_43.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/alt_format_44.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/alt_format_44.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d8e300acbca02c7e74374ad4191b9ee7bc9896c4 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/alt_format_44.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/alt_format_49.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/alt_format_49.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..8d14552dc996e5e224970130418407e61f48c44e Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/alt_format_49.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/alt_format_505.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/alt_format_505.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..3e360aadad38425f8db59f72649b2576d85d89d0 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/alt_format_505.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/alt_format_506.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/alt_format_506.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e7e9e75ae5c0bf1481a7ff4880e51569f9ece6e7 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/alt_format_506.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/alt_format_52.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/alt_format_52.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..6bc06795ad50db4196e8f8d5e7cecd8caef3915f Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/alt_format_52.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/alt_format_54.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/alt_format_54.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2270e215b645b7a5a77f466960247375ab20ab5f Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/alt_format_54.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/alt_format_55.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/alt_format_55.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..33f854a9f14d334e687af7560b4b9e8fecf3ad32 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/alt_format_55.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/alt_format_58.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/alt_format_58.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..bae84d32069e627dc75cc4f893c5cda1ddd32d9a Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/alt_format_58.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/alt_format_595.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/alt_format_595.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f84164087990ee8b8fddbd07632d730be693a77c Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/alt_format_595.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/alt_format_61.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/alt_format_61.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..051d30d0839c581bdc105b41b0bc406fcc03378b Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/alt_format_61.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/alt_format_62.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/alt_format_62.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a4b750748e8b8872a8f51756b582bdc520b4d6b5 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/alt_format_62.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/alt_format_64.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/alt_format_64.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..3d1d24e6aa71b8898d8c44ec5b93fee718bb0b0a Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/alt_format_64.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/alt_format_66.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/alt_format_66.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..742dbc9d6fcfcf52bdfec2c4370e96c37d386fd3 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/alt_format_66.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/alt_format_675.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/alt_format_675.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..b2e35f14665e309e389651708f136b13a4d17c5a Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/alt_format_675.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/alt_format_676.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/alt_format_676.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..afe8de6616e7256a96fa435c1150745802c58a15 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/alt_format_676.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/alt_format_679.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/alt_format_679.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..3878ee0400c4efb47c1d732a10bab4e5f47e049b Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/alt_format_679.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/alt_format_7.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/alt_format_7.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..69984c5fc447c0a192d9ec001273cea7812ce043 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/alt_format_7.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/alt_format_81.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/alt_format_81.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..70801e72d2b455a9f6574cfbdac525707a91a109 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/alt_format_81.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/alt_format_84.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/alt_format_84.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..8a218034157958a4560e665073b32e1508783006 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/alt_format_84.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/alt_format_855.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/alt_format_855.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..ebb2c50404bc84649c1ea25b9b9466be11e143b1 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/alt_format_855.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/alt_format_856.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/alt_format_856.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..1496ab6240eb22561612a4f2e1d3c5ba838deeea Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/alt_format_856.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/alt_format_90.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/alt_format_90.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..677cc8dc07775743cd2fa417a45f7968340e0d21 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/alt_format_90.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/alt_format_91.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/alt_format_91.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..7ce728b837789dfb1e99157f8f4d334532136448 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/alt_format_91.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/alt_format_94.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/alt_format_94.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..147fcbdecf684dbab7f2a1a235535b6d297dd82e Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/alt_format_94.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/alt_format_95.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/alt_format_95.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..839d82915526cb246b7c0b3c4d4683ba524eec98 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/alt_format_95.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/alt_format_971.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/alt_format_971.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..724669a46eb58c02c2814546e1d202c8bf1f4d67 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/alt_format_971.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/alt_format_972.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/alt_format_972.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..262ab35f3dfb263450019e3eb7d52a669107154a Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/alt_format_972.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/alt_format_995.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/alt_format_995.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d2808384537af0dc9d5d6574c377d73441c2be76 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/alt_format_995.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_800.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_800.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..4be00feeaf857cf9e3a93f0cf2c0a9d617f60df9 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_800.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_808.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_808.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..3d33427b3df968cda3af0e41982aaeb239afee40 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_808.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_870.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_870.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..51222e8cc87462b6832a4df2334818c49aa13866 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_870.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_878.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_878.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e3816e20aefe8741ff0ee9408153bca12c190b16 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_878.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_881.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_881.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..63521fea419495936e6dd7ff23dc5cfa9764c864 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_881.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_882.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_882.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c6f274692d2366da92aeed892346779f83ccd916 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_882.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_883.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_883.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..af7b901f076dce092652c3674d0d2ec35c5f0361 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_883.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_888.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_888.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2154dc61ecb0e03e5a01b27aea664fe9b84d5444 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_888.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_979.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_979.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..8cd5988478afab5e17e14ad5b9359aa6212d6254 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_979.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_AC.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_AC.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2106436d6d121e83bf63b71ac8e3a44c2642fe46 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_AC.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_AD.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_AD.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..bf4726694c59e66b1b1573316428aff72834c600 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_AD.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_AE.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_AE.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..0b8352076458aaeea1fe9daabab34a315eb5b584 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_AE.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_AF.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_AF.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..abb660e0a9f0bdfbace9e76fe38396e1f07d8af5 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_AF.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_AG.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_AG.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..8c9f576a5651bb5bb0b849eb7c6fd1eca71ec221 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_AG.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_AI.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_AI.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..90ee338b09735a56797a7fa825231889e6684456 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_AI.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_AL.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_AL.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f9363182f8938f22f9d1dffa666ee6717ec9ec21 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_AL.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_AM.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_AM.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2b7665f1a4901edeeb94d4de4011b67eb43837d3 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_AM.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_AO.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_AO.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f1fa90b3d1ddbd9bcbd7bb2a6ed61755a9553aff Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_AO.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_AR.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_AR.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..b87314585f39999c6202210f866a93642a145c1b Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_AR.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_AS.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_AS.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..4f6e1226c0ba6bedefb02aacf3a8bb7e93031cd5 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_AS.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_AT.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_AT.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e33a8e3f5d70dcfece0afce7787e3455832cd313 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_AT.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_AU.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_AU.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e86e94eb25232511dec3afe38aa21ae06c94e3a7 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_AU.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_AW.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_AW.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..9b6e84aac80b8ae9306b14cc59938ad40257e5a5 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_AW.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_AX.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_AX.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..4926aa7ebda113e72d6304799f10df498e63d213 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_AX.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_AZ.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_AZ.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a2905f7f03c629afe84c1c81f01123e2fd1b710a Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_AZ.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_BA.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_BA.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f8f3089f3463b4118404e42c1e2bf242c8051bfd Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_BA.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_BB.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_BB.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..3e03f86ad770cc5be5492a34f8bf33db6cbdd0e9 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_BB.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_BD.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_BD.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..59f125d18242267f8040ea38a9d0e9e0a345116e Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_BD.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_BE.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_BE.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..abbd1df854729490fc335f60d40d8ca28d16d5f0 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_BE.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_BF.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_BF.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..af0f3c2c583bd2a6b218d23f9517f87077580771 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_BF.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_BG.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_BG.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..67e6b76921f7343238536de7e4afa8ce387ac662 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_BG.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_BH.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_BH.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f2e40e3c3eb47ffe9ed88759bc7b656ba5235567 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_BH.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_BI.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_BI.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..9058ec5a4e90235f12e40d258946ed49809c40d4 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_BI.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_BJ.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_BJ.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..04fa2af0435f41a173b469ad1b4caaa5aa6b58b2 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_BJ.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_BL.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_BL.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..58df0404d3ae98c2318ea3770fa3c2652f83d96a Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_BL.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_BM.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_BM.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..6414514b48c72fddca73c1fb90dc459af6ee9450 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_BM.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_BN.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_BN.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..9276152fbd98a0b608b5d63fb71c17a6959c77bc Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_BN.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_BO.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_BO.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c193cbd121b8f7cc859a190a74d9be5561c41b67 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_BO.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_BQ.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_BQ.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..ae05c09b8c1a8843546fe16eea5299992838a91e Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_BQ.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_BR.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_BR.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..ba63e048176e99ed13e5433a8dbf5cbb12c38ab2 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_BR.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_BS.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_BS.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c97c7bc06db9d80c226f5c5b39ac11fa7dabbb62 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_BS.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_BT.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_BT.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..4ecc54f380ce948c6e2bebacf2564180c532c23d Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_BT.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_BW.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_BW.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c5694afd1fa86947fa672ed7c7feb06e4da49e98 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_BW.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_BY.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_BY.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..5fd29760f0691b0685ce7cdcf51997521acbb85c Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_BY.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_BZ.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_BZ.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..4f474e90c0dd5fe8f40b175c2a0c218fb559a028 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_BZ.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_CA.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_CA.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..ed51cd2ea9ed22c1910c2fb64247ea81a8d2ae40 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_CA.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_CC.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_CC.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..61671b0cbb57a17cc53a9da8b8fae4b62299a9f9 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_CC.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_CD.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_CD.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..5be5bc1b3d3b65d5a1ab2fb05b164ff057c50a7e Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_CD.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_CF.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_CF.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c17cd5b2a1e6b9bb4a202cd8d3ab9fd99bc3fc25 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_CF.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_CG.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_CG.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..b3e4daef25bf114756ef4657d94b2c73a20a7737 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_CG.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_CH.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_CH.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..cc897236ce93b3d3477bdcf491699aff44248c47 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_CH.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_CI.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_CI.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..3d284c424086f69f5f1452e1e6c03df059830a86 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_CI.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_CK.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_CK.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..1110d4cf0183fcea0d6f25b8f7d81d01a6c25195 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_CK.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_CL.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_CL.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e780f22d942dd39f8933d3b877a3ed58e3484963 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_CL.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_CM.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_CM.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..8b49ae3b7d1c7a8d2b53ffcdc38d6b872374ff2a Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_CM.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_CN.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_CN.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..92c2878c952616d81868f39c011921e95dcb5bd8 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_CN.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_CO.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_CO.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..29df9b29c8a780b4189c9b3911d7a3b1d16aba85 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_CO.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_CR.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_CR.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..68c6df825f9a13b91b4536c4ec7bb4672761ca4c Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_CR.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_CU.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_CU.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..5789b1a2ca5d548ba7b21ab544dfbd7b9cdfe018 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_CU.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_CV.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_CV.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..ba12187372acae03cd144f3310f46b857d93b202 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_CV.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_CW.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_CW.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2e77c7198415d6395ebaa4707d8ca441575a0b0e Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_CW.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_CX.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_CX.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..8dfc83dd820de615be762fe45d9267e36f42bbb5 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_CX.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_CY.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_CY.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..7b154048ac30a4f5fe9705b658f72717337a5335 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_CY.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_CZ.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_CZ.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..7029782f70312c88d93a060356bbd3103e929f76 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_CZ.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_DE.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_DE.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..3c4c74933564861e03b4c5afe6fcf004abfd3ee8 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_DE.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_DJ.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_DJ.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..fd1b9e4260b1c5bf7441d5b32237dd8f9f0505f5 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_DJ.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_DK.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_DK.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a972fc37c4068223c316de449987367c319be5ea Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_DK.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_DM.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_DM.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c170dcc1b1da5d40f97cdc1984b9d3de8f99d4ed Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_DM.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_DO.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_DO.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..725e4245fc3e28ea44ec1b034b8e46778fbbc7be Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_DO.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_DZ.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_DZ.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2a7f9cd7294960d656d8ad0b5bbb5bfa0cafdf92 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_DZ.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_EC.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_EC.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..dbda568338cf046e009e0c1efc86283ceb5cafce Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_EC.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_EE.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_EE.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f6f6f2b95b24da903b9b6659d3cd877bd6b15e65 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_EE.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_EG.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_EG.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e2f29608f267054163a82d6e3444780665eb67e5 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_EG.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_EH.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_EH.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..b2a7c9c384cbb4d7c514e5e22af483b7ec4561dc Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_EH.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_ER.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_ER.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..1a12bc515f7d3422cb3426494feb3c7a0f24c413 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_ER.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_ES.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_ES.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2afaf4d30b34dc9ce4a7fc10752deb5f8658c4c8 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_ES.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_ET.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_ET.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..8dcda48e9e7eaa018208bbfcdaaf7ea481920fe2 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_ET.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_FI.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_FI.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..4bd9f1ec56b2cec86cd829ef67388d5c64a20027 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_FI.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_FJ.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_FJ.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..92549d059c13eb07181fc2e8fb6a059732672859 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_FJ.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_FK.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_FK.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..5e261c08d2051c74d600dc62e2f4df0d9ef6113d Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_FK.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_FM.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_FM.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..9f9ed1f5bd73605b5ef786644dfa04090a1eb745 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_FM.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_FO.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_FO.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..9f40f456527392f2f385497200e4575f662a259b Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_FO.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_FR.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_FR.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..5f84b8f348d344e644d34352fd593bbc3f504604 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_FR.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_GA.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_GA.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c87a2b2e11c7da600aaba232b5e45ac0884b2ad8 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_GA.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_GB.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_GB.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..b825533b2626a8ab219f48710722cd3e40f9ad4d Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_GB.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_GD.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_GD.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..329a85a37cc31730b83f601ca6112fae81a28082 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_GD.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_GE.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_GE.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..030392cc168ea877e277c7302ece75d8ee12d1e6 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_GE.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_GF.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_GF.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..68bee4c1b8d6ba8ee977d4bb543fd6d574d4a1f3 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_GF.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_GG.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_GG.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..4314a03ed6696cd655f117bbb033140518a8876a Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_GG.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_GH.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_GH.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..39f7603078483c55a3957370d465862d9620a993 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_GH.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_GI.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_GI.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..39c43318bba55be0ba4adab3f3cfff9d3c199f8b Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_GI.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_GL.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_GL.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..6cbbfe08fbd9db4314aaf8f6e5df3a8cc6125c40 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_GL.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_GM.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_GM.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a4d598324f37e61c63f0d9bea492690752e09e67 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_GM.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_GN.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_GN.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..aed5d59acef0be2ce379b3d41d1f5c662f646ab9 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_GN.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_GP.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_GP.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..434d4a57f011e1d9fe87b34b54d4c6266622018e Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_GP.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_GQ.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_GQ.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..3814363ac584b5217d2c15e85a23b4b86a585be0 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_GQ.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_GR.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_GR.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d1ea413aa84fafbc852bc4a897cee1ece1da2f61 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_GR.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_GT.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_GT.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..df5a08d679b2dfcac001d9724ac915c2defafc57 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_GT.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_GU.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_GU.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f08ea827bec7f7285a68f4e931d6ca54dc7d02b7 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_GU.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_GW.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_GW.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..bda7512230811f25b4d898c03802f653410ce662 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_GW.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_GY.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_GY.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..b5d00d7f4fbed260ddf18d89cc625a8c24a16aea Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_GY.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_HK.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_HK.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..5f2c31a2d009f1b58c0bf7e2abd65ffe49e0c495 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_HK.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_HN.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_HN.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..941c5a75180abc2c88e0f3766be79a2f4c0b978e Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_HN.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_HR.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_HR.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..54892904d045d5d7b13a4a76277878f46b2b8a1b Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_HR.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_HT.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_HT.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f69c8b3e6a6419f9bd30dcce6722df6e9c38834b Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_HT.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_HU.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_HU.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..6d925fff895b2bdef51c7b16a1009ae1eb50cfe2 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_HU.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_ID.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_ID.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..24fd22037964e800dd649ff5a6c24b882697172a Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_ID.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_IE.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_IE.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..8e9147027be6d44b28d340810faa35a99ef0b27b Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_IE.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_IL.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_IL.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..296d7435bc5f56ef74e5201bb9308c3d3e2099f2 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_IL.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_IM.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_IM.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..1f72372bbc9e70ce7c2178c22851a30aa7480c8f Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_IM.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_IN.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_IN.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..521af9aa5e92604fe2ca9e6ce457f0f7a3b3aa08 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_IN.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_IO.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_IO.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..17d08a6e26ba37de41e8f5775596e38925bb9671 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_IO.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_IQ.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_IQ.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..060f0eec74c52ebab7abbcd874995afa7500a24a Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_IQ.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_IR.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_IR.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..360024618d236416bc174df4e650c7698b2366d1 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_IR.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_IS.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_IS.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..cb6662355ae983bed6631fd3d964d6eebb1ce590 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_IS.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_IT.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_IT.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..9ffd1b87e9652377ef80b07f1c52a5f80f8c34f5 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_IT.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_JE.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_JE.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..3c0dbe3fd70bfcca332797f2772eda0179319c02 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_JE.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_JM.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_JM.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..9d74876aa61723f5f089d20b90cedcd5d13314cf Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_JM.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_JO.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_JO.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..b085d12e7583081f374f6ddbfa9180ec74cd7e11 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_JO.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_JP.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_JP.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..85d315649f24f12a9fe90894fa0a4f3ce993156f Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_JP.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_KE.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_KE.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..7c352821938c83bf9f2931cd9666dc2862340443 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_KE.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_KG.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_KG.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..8625e3ac8f6064bc85540bdf2f3acf71585d4804 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_KG.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_KH.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_KH.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f5b505475457ff45b58207727c4c897d717d3bf7 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_KH.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_KI.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_KI.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..7e7ad970cbb262dfec82c077564c6f8435d6b43d Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_KI.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_KM.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_KM.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..4620c38c63f343283fd30b148f5920936dfa1988 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_KM.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_KN.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_KN.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..1ad7fd207326f3c44c004012dd3cf7cb6dc100b7 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_KN.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_KP.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_KP.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..8e224528354ed0909560997733a980f64eed2fc1 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_KP.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_KR.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_KR.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..dee9915c08336b18e02ea19deae1ee75d3f50b28 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_KR.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_KW.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_KW.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e9c54be1000eeb7f7882a8d5aaf5011c6ccff2ee Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_KW.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_KY.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_KY.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..cda40149bc62e00dd3d39b3a93494f548817f267 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_KY.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_KZ.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_KZ.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..43d47cc5f93e1e6c8b2802b707e324d1f6e403d7 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_KZ.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_LA.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_LA.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..252c57fb44a0a1700c0f395a7ab4b6ad05c7c5a7 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_LA.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_LB.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_LB.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a8a5a56e7b73e4ca4cf9563bb64afa270184ced5 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_LB.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_LC.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_LC.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..99ac43040697031cd44cd4222de198996c9e4e5f Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_LC.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_LI.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_LI.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..51fdb22607fa1e09dc5e6ebb1a88e8efb119eb31 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_LI.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_LK.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_LK.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..7802c49200bd68ccc2eed96066b92ef90b58ad56 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_LK.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_LR.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_LR.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2bfa97f21ba9f1db739cf4ef89f9ff31d3de8e46 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_LR.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_LS.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_LS.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..3c4eac85d7a776e439a6da875637be7ed73ef3a0 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_LS.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_LT.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_LT.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..eeb52dc6056599353f95b9f54b901bcccaf462a5 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_LT.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_LU.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_LU.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..644d4d55cdc49729800167c30d097dcb34a0d570 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_LU.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_LV.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_LV.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..16f8ea235db079caee2ba3367a909d635f4d766a Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_LV.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_LY.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_LY.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..409ab82510f0e02962e610abc267935f39551d51 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_LY.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_MA.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_MA.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f7bd29ce2d9778f28db979c9a9dcbbc928866d7b Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_MA.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_MC.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_MC.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e27b864c1f9aca14277ff807bbb18bb5e753e627 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_MC.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_MD.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_MD.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..fed46b33922a485d257e2d278baecac7b2ae93ef Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_MD.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_ME.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_ME.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..9d7d2b0c6a144ed920e72d528f42895f3c2609ab Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_ME.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_MF.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_MF.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..826c2cf0c538a3868327210615f3205ad968a2c5 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_MF.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_MG.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_MG.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..4500490132eb6703e4ec99fcc6602d0716b6dde1 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_MG.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_MH.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_MH.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..554dbcf6aac1b3b05ab70dda7b902db3f5989f91 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_MH.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_MK.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_MK.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..8a108c5458127550cafe7d717895dcc5087d6bd8 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_MK.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_ML.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_ML.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a46dc18585c3e0a994a41f96ed188ae0b766a1fe Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_ML.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_MM.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_MM.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..4c7152ea13503def9bc765513ef2d06f82612236 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_MM.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_MN.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_MN.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..06917a00b545f8d966c7223ba00b41c64ab3cc75 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_MN.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_MO.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_MO.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a5c3368e95703853b4272c2f971fc0f86b9ef276 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_MO.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_MP.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_MP.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..fd36ecadd37953b4050a1c94368c0e180a5efa1a Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_MP.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_MQ.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_MQ.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..ab04a11c1d1d19dc574e762471fb893d77a4186f Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_MQ.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_MR.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_MR.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c92e78284c91a769befe9930a11ead987c79099e Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_MR.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_MS.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_MS.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..548ecd585031cd84dae05dcc10934869b42ff534 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_MS.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_MT.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_MT.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..96033b1fb8e5098021e7e00372cabcf517b35b71 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_MT.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_MU.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_MU.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..88ad37cba1db23c1df366cd58a7c394cb90effc9 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_MU.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_MV.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_MV.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..20f5e8d46911111d673e3314e2d8730edbd98b97 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_MV.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_MW.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_MW.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..260c8ae862b5362fb9348b14b1ba150fb17c630d Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_MW.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_MX.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_MX.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a53c619222a3cca77ac55757f511fd7aa55be905 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_MX.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_MY.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_MY.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..1f700271f0029b53c1716c0d064981557bedb6f5 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_MY.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_MZ.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_MZ.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..7b37a33749bc47a0c01faeac6a6e7cfaa83098d3 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_MZ.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_NA.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_NA.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..aab52544daaa9521f7080fb4a0f985f275d74ea7 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_NA.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_NC.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_NC.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..3548c0b56b48fe5e71f0a50f93b396249b1a936a Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_NC.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_NE.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_NE.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..3250b178a601e492352530a3be7836c6a980ef4b Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_NE.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_NF.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_NF.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..fa647287bc6d6725f3250b814c959199948dbdf7 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_NF.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_NG.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_NG.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2e4edab486938af26763b30bb7b09271eace5ebe Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_NG.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_NI.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_NI.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..de52f7c67b7efcab38ef952be3024d589c3cc19d Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_NI.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_NL.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_NL.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a36643f22b8bdfbbeb49f9ec4f7acd60f31e5f2d Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_NL.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_NO.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_NO.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..dc614f32ca1345ad1728511d7f092330ae88acf9 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_NO.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_NP.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_NP.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f97586562e8d61a0b3b3ac04578984df1905b29d Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_NP.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_NR.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_NR.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c8d2a9652d4502984b7464c62bda48ddde141a53 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_NR.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_NU.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_NU.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..858f71b14d87ad5feab5416f59b036d170c0d3d9 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_NU.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_NZ.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_NZ.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..6115863f2c6886639029dd994109210fcf633291 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_NZ.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_OM.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_OM.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2b9187379f7b59f75696f8fe797bfbe83907f456 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_OM.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_PA.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_PA.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..9351cda34b90968e76b85a983caeb85d435d9d58 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_PA.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_PE.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_PE.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..b616d7a247c6f600b212b8a3ac4bd19176a07ccc Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_PE.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_PF.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_PF.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f3731a5c22d82647ccc7d61aed1e247aff9f3d7c Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_PF.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_PG.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_PG.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..ef599fe805424407de174ac1740d6d493efc78d3 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_PG.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_PH.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_PH.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..46113d4bbf05ded407c5bbe0d8f1e049ea624841 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_PH.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_PK.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_PK.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..7295c02de9892255beb1c1ad6ab16856c942bfe1 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_PK.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_PL.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_PL.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..73145f7d0648b617db143c7161cd5fe8a29c3a43 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_PL.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_PM.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_PM.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..0326d8d9e99d48e86a61b76ba679f5d87df12809 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_PM.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_PR.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_PR.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c6729c472054efbaf1cb9da7525398cf728d7a23 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_PR.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_PS.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_PS.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..df88de99fcf1b8e81184f1625503572f11f51d02 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_PS.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_PT.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_PT.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..8ca1cbc0ae0d8cc3980a927e50d4885a39b878ca Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_PT.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_PW.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_PW.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c5b7bed220ccb5e52c009165081b1ed1fa92a86e Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_PW.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_PY.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_PY.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..ab3668ab74af03fbcf4938289311ad0af70a866b Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_PY.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_QA.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_QA.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..979ff593e181ce90daaddf1e13d1a99d4c86d42e Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_QA.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_RE.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_RE.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..6db239e905269321743449c70d0b9c58483ea621 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_RE.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_RO.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_RO.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..20f05a0a6d526c5a1f90b89a25faf56f30fb2a90 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_RO.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_RS.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_RS.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..35bf185008a295271c6fcecf36af228e1df50deb Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_RS.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_RU.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_RU.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..6a5bf407eb2a26c44c48e5684a92990c08524fa8 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_RU.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_RW.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_RW.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f79161db0ae43a53d721826b8bc7d56b58da1581 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_RW.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_SA.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_SA.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f11e5cd3d440837b935d6932a0d0b91c1a9ccb0c Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_SA.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_SB.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_SB.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a00c91a064ff293dc6cb10d233af09af757ea0f2 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_SB.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_SC.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_SC.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..1b3105b9981bcfc6d64439e31adc33af8a52b182 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_SC.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_SD.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_SD.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..3f191e23e6047d5c748dad2f608416fe89e374fa Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_SD.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_SE.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_SE.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a134bb8c9a5d780675e279a36dc16d7346a29a91 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_SE.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_SG.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_SG.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..02f7279507365590bfabe0766145b445ddf26fe2 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_SG.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_SH.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_SH.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..8a9bc04952e6a797515fa2be63ede4c6f1c75846 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_SH.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_SI.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_SI.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..8c9b1067aa37bba0e40c9b6f7b9b911566e0774e Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_SI.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_SJ.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_SJ.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..96bc10c5418b3bcb13fe8dd177b49703d81d9f11 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_SJ.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_SK.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_SK.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..442c93430d4b597fc847255dadd915014a33fe6f Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_SK.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_SL.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_SL.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..9c0d8762317ad450eb638b59b0d8338e329b33b3 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_SL.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_SM.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_SM.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..be3d3bddd7dd401e9b19a0cd991e74fc607515b1 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_SM.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_SN.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_SN.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e892a002c073dd82ba1a656a5b6a9a439641ab5e Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_SN.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_SO.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_SO.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..257aef59361984a3cfcc85b8bff674c772d18ac4 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_SO.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_SR.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_SR.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..1b1554f562d6ddc4cccbc1c0813c6694388ddc28 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_SR.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_SS.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_SS.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..cc49b9312151f6c5081cb6caa9516bf7a816d246 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_SS.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_ST.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_ST.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..1370ce3721d507cfba98bc9fb143536b3be91919 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_ST.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_SV.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_SV.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..3605d774d91b43ffd14cb1da90d992991b6e6460 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_SV.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_SX.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_SX.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..38ecb8b8d74cd9145b5d78538f64080ac051c2b0 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_SX.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_SY.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_SY.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..64f0c05fd533e6e2f67458a6957ea48c392241f3 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_SY.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_SZ.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_SZ.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..08dc9c7b8d23a01064df96032191f198ece335c2 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_SZ.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_TA.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_TA.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..160359132137ac3c0ad43f537410e614da2f059a Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_TA.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_TC.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_TC.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a169898376e49ef80b42d2bf51221eace9958ea0 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_TC.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_TD.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_TD.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..9c6cf7882e0ab29c234f25487ed2987011629d1c Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_TD.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_TG.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_TG.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c0d73620722f494838e6764adb01b97484e55020 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_TG.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_TH.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_TH.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..516b3bf2587f0a6ca8812982bc15659aaeeedd88 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_TH.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_TJ.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_TJ.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..0e8dbf18ae94e1bc4261302ddc368ab7b884ad80 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_TJ.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_TK.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_TK.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a59dc2c09ccacdce8381766b869fe2de2522bf69 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_TK.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_TL.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_TL.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2950a4944d04d8fb49cd9f544c3edbf057692530 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_TL.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_TM.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_TM.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..63363e40e3b396b53f28058638ece88e4dd19651 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_TM.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_TN.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_TN.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..5b2c6af2b4c2ca54e932734dc56a3a55fcc5a644 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_TN.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_TO.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_TO.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e6fd0387511800d3ba42d7e2569736d3ebc9881e Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_TO.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_TR.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_TR.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..67b0d15e0dfb7544e910e2fb0226f81691cd273f Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_TR.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_TT.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_TT.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f26ecaf429fe045001b417a536110f3753de2f62 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_TT.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_TV.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_TV.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..31b6769eb48c435e370ee4d629b72efb07f48869 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_TV.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_TW.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_TW.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..72ccdca8a158b3c8ea95467a5bbba0000233ae7c Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_TW.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_TZ.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_TZ.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..45a779728560733056fd2537487bdbb07cc5a8e3 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_TZ.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_UA.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_UA.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..b10ed7851b5969a7f95a6b8b684717edf0f03aa7 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_UA.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_UG.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_UG.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..38223963adf0c55b145580643e0a9ea1533cb709 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_UG.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_US.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_US.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f5b7695860db653de28a480e9445b385f285de22 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_US.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_UY.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_UY.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..21bd42e7cb6d24d1c39613ba13d70ec31f43d1b2 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_UY.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_UZ.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_UZ.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2a55a91f13c7dfa0b1c1b2243c462768229b77c0 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_UZ.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_VA.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_VA.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..7c5cee6b0b7c2576e3f617c088e8fa10573dc6ac Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_VA.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_VC.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_VC.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..45daf02adaa49b4e6247d845de16748071cf2408 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_VC.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_VE.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_VE.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..0d8704c46f93143c8fda43902a62727cbbdae33e Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_VE.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_VG.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_VG.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f484ac75dad024a4c75faa8aa024f592acfb2321 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_VG.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_VI.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_VI.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a7ea226741366d7dba745832b8790e421b3b7d82 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_VI.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_VN.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_VN.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..ea1613e5406ab5b32c3828fb22e836efc483d5b9 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_VN.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_VU.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_VU.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..eb5ad798f74b636667874e80bb11d007dd9bb5fb Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_VU.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_WF.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_WF.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..981529c02cbe2f3aae4e737cf19d6a3c0d66db5f Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_WF.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_WS.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_WS.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..5eafe8c20e16958e571f127f715261d1720431d5 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_WS.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_XK.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_XK.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e141e879ad32c39a34147c24a08c937940e0bc2d Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_XK.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_YE.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_YE.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..5451d92824f203673bd2797a1ea54cbb74c6b2bb Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_YE.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_YT.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_YT.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..06bb3c4dfa6811a8f1c900392a42c736f1c1ec10 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_YT.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_ZA.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_ZA.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..8769c92126a0bf779bbbcb1ae1a1790738fc0920 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_ZA.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_ZM.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_ZM.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..cd876313e9716e235a2184e6f90071ab3cf87f1d Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_ZM.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_ZW.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_ZW.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..863c3d7aded2b93179a4d5b21773993b598826e3 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/data/__pycache__/region_ZW.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/geodata/__pycache__/__init__.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/geodata/__pycache__/__init__.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..6f87a5ca6297a548d4d67de6ec0c6c52a42f70f9 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/geodata/__pycache__/__init__.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/geodata/__pycache__/data0.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/geodata/__pycache__/data0.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..908c186a26973a3d04fc0d42194ff7f3f0d33ad0 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/geodata/__pycache__/data0.cpython-312.pyc @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:31a8931846333b66d4336e76ae028357134c18a8647a8385418a32f5e265774c +size 503615 diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/geodata/__pycache__/data1.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/geodata/__pycache__/data1.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..254bc845895a398a514b3b8393a6d247e1030989 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/geodata/__pycache__/data1.cpython-312.pyc @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:78f3d281bb59d8c412c3f720aac3be2e5c2e7e387658c1311920f29f8fc4b8a9 +size 512034 diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/geodata/__pycache__/data10.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/geodata/__pycache__/data10.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..8cb6fbf27c3e65b8c0e6b8f9987ce85c9500099b --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/geodata/__pycache__/data10.cpython-312.pyc @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:75a412ceed70574d097d8308293b8b1a2a405a009ae3751857e4a5dfbf628545 +size 472300 diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/geodata/__pycache__/data11.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/geodata/__pycache__/data11.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..b85f80d9816c6222f5a5a2bfc47692494753d7bc --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/geodata/__pycache__/data11.cpython-312.pyc @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:524c16addfae34ebd6e9af11a899c2edb385a1f0a5829b42d446848be23ea705 +size 472320 diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/geodata/__pycache__/data12.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/geodata/__pycache__/data12.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..74aba654eba3fc65d13d8a80f0ea56e54d25f953 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/geodata/__pycache__/data12.cpython-312.pyc @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e1a848b2dee4e0663b08a3abc8c2ed06ef29fb6efb5a7eda90bce2260eb8fddf +size 477532 diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/geodata/__pycache__/data13.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/geodata/__pycache__/data13.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..672d51a579a59f3e86511cd77f43b24771934a3d --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/geodata/__pycache__/data13.cpython-312.pyc @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:65ff7ab41c8cc135498c967876ba5bdf653969d0a0b06720060d427ae6b88db8 +size 476825 diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/geodata/__pycache__/data14.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/geodata/__pycache__/data14.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..1abc1c231c246c5f2290eba5351ff05aaf5bd4b1 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/geodata/__pycache__/data14.cpython-312.pyc @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:178cc480fbba8f1e68e2805d1b3cac4c4b4c0fb2517ef3851e388b69a844ac34 +size 690843 diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/geodata/__pycache__/data15.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/geodata/__pycache__/data15.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..668754d69fc4cc12c3527b67fba7a84fc113fcf9 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/geodata/__pycache__/data15.cpython-312.pyc @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:13630786a187162249d4f89769a3850d8a2f53b3cdfc2cc26d1eec4d07ec84dd +size 713159 diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/geodata/__pycache__/data16.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/geodata/__pycache__/data16.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..4f916208433d52c329226da7f5df4a5a6e19e560 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/geodata/__pycache__/data16.cpython-312.pyc @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2dbe2ceb6cab391c6e166d56eb34a92db973206aeb229b766d1aa7d9b28cb309 +size 712429 diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/geodata/__pycache__/data17.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/geodata/__pycache__/data17.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c7673748bceb5675a3e52b597c47c928badc6f1f --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/geodata/__pycache__/data17.cpython-312.pyc @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f5dede0703e55c18a184a8d8fa0eeb5cc1cc52b714b74b5c673835946e397864 +size 712791 diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/geodata/__pycache__/data18.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/geodata/__pycache__/data18.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..edc11970afd1acfcd7678691e361f72f13857ed5 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/geodata/__pycache__/data18.cpython-312.pyc @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2c10d848f34073305b9f0b557c33612ef8914b0b1142c96d98380ac2634bbe7f +size 710018 diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/geodata/__pycache__/data19.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/geodata/__pycache__/data19.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..5b968c79d0247eaa113ca1ad6424a0aaf2c0c358 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/geodata/__pycache__/data19.cpython-312.pyc @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a04412851c7493e0f47c0b1b8384be52dae5620232763eb445f4a2c404f717e6 +size 714622 diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/geodata/__pycache__/data2.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/geodata/__pycache__/data2.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..5dbe6d8ba83847a773600cf35c58bcf3fc5801ce --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/geodata/__pycache__/data2.cpython-312.pyc @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cba90be91dd95a5503b223573a4695983a997c3c2f4f67686650aafce1ab77de +size 510525 diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/geodata/__pycache__/data20.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/geodata/__pycache__/data20.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..3e1c03d516b435e18423dd60f116be83d266da0c --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/geodata/__pycache__/data20.cpython-312.pyc @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5a877bc19698a1915a80633a3f247649967d2458997fb73dee3a8f879fd8dc49 +size 715085 diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/geodata/__pycache__/data21.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/geodata/__pycache__/data21.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..dd5b6aab12fff724ff17d7dc05ffaa12ca901618 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/geodata/__pycache__/data21.cpython-312.pyc @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a5890ef896795e37d93518ac88aba0b88039ae5ae25afbf5bf62cbaa8c24ec49 +size 710123 diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/geodata/__pycache__/data22.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/geodata/__pycache__/data22.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..488db4150f9fc34a82d4b3e742db60e1f0d0cd03 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/geodata/__pycache__/data22.cpython-312.pyc @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3f456ce3f7270c410059878a0188a4f3168c1b949f6f31c652d8d4fee4be85b8 +size 714771 diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/geodata/__pycache__/data23.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/geodata/__pycache__/data23.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..82ca65929a4057d268ccf92aa769d199e3b62a03 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/geodata/__pycache__/data23.cpython-312.pyc @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:91b22921257c0ec78388371b2939c568edb6228816e8be2eea5e66ed83669a11 +size 714948 diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/geodata/__pycache__/data24.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/geodata/__pycache__/data24.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..7e52f8b4528f0f85cde6dc751d1a9c5731b06112 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/geodata/__pycache__/data24.cpython-312.pyc @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f73b508709a018031b8148c7144059433617c41ab22e357227d7b432d3ce446d +size 711684 diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/geodata/__pycache__/data25.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/geodata/__pycache__/data25.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..9b4a2e95f10e5ce0d22d691c65dd97f20ee2789d --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/geodata/__pycache__/data25.cpython-312.pyc @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:649dbd49ae9ab9b469d0f74c260f7243ded15e1bd7406b6ffab920d9cfeb1b04 +size 711701 diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/geodata/__pycache__/data26.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/geodata/__pycache__/data26.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f7990031908e341d9b8660517a69a645a81ded0f --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/geodata/__pycache__/data26.cpython-312.pyc @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1227e4d55a3dc0c90802023c015bc606aacb16360f6c74e055fd9de15cba6f42 +size 715369 diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/geodata/__pycache__/data27.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/geodata/__pycache__/data27.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..49b55ce7eb04a2b02114c5c827d731ffff89dcbe --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/geodata/__pycache__/data27.cpython-312.pyc @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2cb4fa8aed2f3126f7318dafbde26b66b9e42a6446916eccdee3e672bde4305f +size 675131 diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/geodata/__pycache__/data28.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/geodata/__pycache__/data28.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..3517d60bff963cb253bd37a204dad2ee421cb1a6 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/geodata/__pycache__/data28.cpython-312.pyc @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fe5eb5fbfac03517856ad0d7cc80d329609bdd7476a81abae82bf7772d8fdc03 +size 235235 diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/geodata/__pycache__/data3.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/geodata/__pycache__/data3.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..51428312900fdab1dd94bd14bdfbe07b15580f5e --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/geodata/__pycache__/data3.cpython-312.pyc @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:10b471558b4d2a5011834043a9f67d496607a08df45a6d8d273afda7ac03adc2 +size 571467 diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/geodata/__pycache__/data4.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/geodata/__pycache__/data4.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..5fcdf1e8c24500f4bd829f878fbc67ca344ac8ed --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/geodata/__pycache__/data4.cpython-312.pyc @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2523fbd5fa5379d32754871bc241eefe147ff4a4f413d68d0520f0c9ea5c7cee +size 553998 diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/geodata/__pycache__/data5.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/geodata/__pycache__/data5.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..18ae15847cd6388ae7cf61ef36cf8374dbe1fc6a --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/geodata/__pycache__/data5.cpython-312.pyc @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d1a6d0055c0029954c2c1a46e25cf9a05d2c87b13621bc58083fba3d3706a3c8 +size 891872 diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/geodata/__pycache__/data6.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/geodata/__pycache__/data6.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..fbccef1d438b2c4dd254307a9348b2e6cae33683 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/geodata/__pycache__/data6.cpython-312.pyc @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b48ed88265fef8c730ac44654cd82a2225e19e2db47bb08b3177ce1d23f0d405 +size 747136 diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/geodata/__pycache__/data7.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/geodata/__pycache__/data7.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2f79fcbfd0c27f27af0fe037120664268e78e859 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/geodata/__pycache__/data7.cpython-312.pyc @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5dc3d23cf3248549a10f4bd962f7b39aa029330adc114ae9a7f0152c8aedf769 +size 657560 diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/geodata/__pycache__/data8.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/geodata/__pycache__/data8.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..60c5361b71617da6d12ddfd5efe29054072de51d --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/geodata/__pycache__/data8.cpython-312.pyc @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1660dbec57d9793cb4790857fc304b4cd97705267b0602c10a3c32fe703cad62 +size 482857 diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/geodata/__pycache__/data9.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/geodata/__pycache__/data9.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..658e970e692c08f7159dd836b6ff6001ab02b4b3 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/geodata/__pycache__/data9.cpython-312.pyc @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4bbb0d3553caec844002a2f9e7b782b5a57b94ea389fff672b1456bd065b80d9 +size 478662 diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/geodata/__pycache__/locale.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/geodata/__pycache__/locale.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..48090e63e7208e20bc859189512f127207a1caed --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/geodata/__pycache__/locale.cpython-312.pyc @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6c21ee1192426158e3ec698f77c1f2c48eb60a3d32632e94f98c48fb78dcd5ce +size 1354464 diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/__init__.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/__init__.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..09807c74c28cf573c190c7adfe88b5d21657d9fb Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/__init__.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_AC.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_AC.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..12efe416c938061461775357acf9577e395602fa Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_AC.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_AD.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_AD.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..807a2aebbb56151b7c74963f74ba1e96cb3fc4c1 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_AD.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_AE.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_AE.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..1b2e6034e17fba15627eba66b1e55d975c2dcb4e Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_AE.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_AF.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_AF.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..56e41d710f883e145316b902127069bfbf9895ac Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_AF.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_AG.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_AG.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2140d5b90058b0ea24dbaef38c5b4a10cd52977a Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_AG.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_AI.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_AI.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..1a392652adb25c962ed99070e7f33cc760ce44d4 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_AI.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_AL.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_AL.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..befa118b4250959a4d6589310fe7b5a724ae23c1 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_AL.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_AM.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_AM.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..db45ac389d147601e728d0e7316d7f5539e06a24 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_AM.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_AO.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_AO.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..b9d6fd6734452907b95e996b3b7172e022686be6 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_AO.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_AR.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_AR.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..8ad95fe4f76ce490b3c1b5c74999b6b50215d53b Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_AR.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_AS.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_AS.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..1d892bc666670f4cfe2e892ef0839ceb89fafca0 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_AS.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_AT.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_AT.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..3179de7734f59f6e52f166e566df6c14dcedea5d Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_AT.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_AU.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_AU.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..dee0f2beb3c3f69dc16642cad28131698229b0ec Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_AU.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_AW.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_AW.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..b1017f099760661011ba8a1f00b926a781d85e31 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_AW.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_AX.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_AX.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2b00a1c37de8b48c7689ac9b891f52a620f4cdd7 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_AX.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_AZ.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_AZ.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d41c96a57932df50c199a93ea1ff3d838dbeab58 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_AZ.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_BA.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_BA.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c904981efd7980cb3863ecdb84c25d46c4e2d4e7 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_BA.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_BB.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_BB.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2fad9cab9a40f0d1116de56a4ec79a991a73fd98 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_BB.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_BD.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_BD.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..69c2be62d419b119a1a9ae52e7c795c7f9385d09 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_BD.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_BE.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_BE.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..217c0a1a20f92c2fbcc585ccb1ab75fddc8eb119 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_BE.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_BF.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_BF.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2bef50f48214ee39fa75938ef93672e47e2f10b0 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_BF.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_BG.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_BG.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a6652f79b55c85a93756448f7daccb28e0760449 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_BG.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_BH.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_BH.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..9c8536e34c4099087eba75c18720682fee999413 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_BH.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_BI.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_BI.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..888d976acf65947c6a50b117ae340693b0c19885 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_BI.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_BJ.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_BJ.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..0fef943b13a40e611f3693aac78100b86fcbbea9 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_BJ.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_BL.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_BL.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..3fb8774499a7f49b344d11b4c9ababbd0ae777eb Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_BL.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_BM.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_BM.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..12718ec1ce3afc6eba0c38508a96cf4c7cac06bd Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_BM.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_BN.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_BN.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..4108ac03cba1f7d25865f04155d0917d3fd8477c Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_BN.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_BO.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_BO.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e0070848a1b6488aa5d01072054d993179c0de6d Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_BO.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_BQ.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_BQ.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..0dfcc0c39b3c5304cf8ba1be268676dd6298b8fa Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_BQ.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_BR.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_BR.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..75bd63961dfdc7f5db432692e5d9afb76cee825a Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_BR.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_BS.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_BS.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2cacd648756ca40f17949ac2c186bca76af5364f Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_BS.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_BT.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_BT.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..dbbca8bdd192253660189d46a9321acdb29ece23 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_BT.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_BW.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_BW.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..9715af15bad2767b580ac098a5cf7bf8cfdd9108 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_BW.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_BY.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_BY.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..587a635b0eeb182ad021733bd06e92b6c146f4b3 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_BY.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_BZ.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_BZ.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..9a4c0cca8805276e1cd6fcd2f75fea5a22fab7c4 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_BZ.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_CA.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_CA.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..edfdd74d06deb913b51ac0ebbcffec624c6bc8d8 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_CA.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_CC.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_CC.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..fb26a76589f82b30b709ee53a0809434261f99af Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_CC.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_CD.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_CD.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..4046b5314bd50e3d591bb48ed8721f553415b63a Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_CD.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_CF.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_CF.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..b8184608a74f9be51abb4428f5f14c806ed2b420 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_CF.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_CG.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_CG.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f306deb16d7c8cea2316416dfed8eb253b32c4fd Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_CG.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_CH.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_CH.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f3e9070d3be45f452d24f97b8a30a1040f59e5b2 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_CH.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_CI.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_CI.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..3f2fe6ad71cb30b4a4eac8f377f7ac86f69d2ddd Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_CI.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_CK.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_CK.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c952b79a42312d99f8ea45ed9ee535e009e36912 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_CK.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_CL.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_CL.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..8d63af89dbd28e31971ee83300632146d75c9012 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_CL.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_CM.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_CM.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c4108c232da9840b40e0dfb1b9ab7fb77fae25a0 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_CM.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_CN.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_CN.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..181124ca0323c141f560e0f21de1f11129c5325e Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_CN.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_CO.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_CO.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e81f19b998941db7ca6a383ac54deb913f09d1e4 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_CO.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_CR.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_CR.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..81109cc7b2ece5dea6bdc4f7a389862a469a8128 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_CR.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_CU.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_CU.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..ea27e700ca7b98420401703c13d0db5f18a440c7 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_CU.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_CV.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_CV.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..091e938cb891f518bc4c43d2e591d02c8abdc3cb Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_CV.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_CW.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_CW.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d9436cf9a529defc0bb551acad1a42137d5fb9b9 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_CW.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_CX.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_CX.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..57fa795d8222583757163c56735f82db905c69d8 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_CX.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_CY.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_CY.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..0e1c19a48814fe90255c44bfc4de59d30594d822 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_CY.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_CZ.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_CZ.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..55f54dc0bf4c49a8ad6be0eb10792b97d8c27d30 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_CZ.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_DE.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_DE.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2ef3733d059ce89f7dc0f6133c7cb6651e6716d0 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_DE.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_DJ.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_DJ.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..448f6f806441d4040f7ab8548c2ba2fafc78687c Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_DJ.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_DK.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_DK.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d937eeb9ee18689612c4ebe0ef883f44c0141a1d Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_DK.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_DM.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_DM.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..07fedbcfdbbc590559e8977ec97cb0b38febca05 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_DM.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_DO.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_DO.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..81def1609cf9ab2fc53ee7f6ef62ae325297d79a Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_DO.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_DZ.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_DZ.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..84982de591cfd759bb46a186a50c63f6f9736c7c Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_DZ.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_EC.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_EC.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..3f06727ba3caeb6974049f217350ccdd21e21e3e Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_EC.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_EE.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_EE.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c66aade877d3904a95e898bf6254e0b9d8e0f1f0 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_EE.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_EG.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_EG.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..9fbc47c6528bf84877393b2bc8688b93c5a90cb4 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_EG.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_EH.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_EH.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..4b0f1e66062e18dbb5b52dadb14551f87efb588c Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_EH.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_ER.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_ER.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..541c43fc1b03172685e06f0a32474842923e45af Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_ER.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_ES.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_ES.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..5d7ca26f346d16f8d6736a21e09b998f0b24ab13 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_ES.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_ET.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_ET.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..af2b19180aad6786ee5bfcd73dad0f3ddfacd6cd Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_ET.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_FI.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_FI.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..b082175951dab9301b0c3623dc1fc24afac2e43d Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_FI.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_FJ.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_FJ.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..7775e4a38b9de14024d2de0737856035ab687e75 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_FJ.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_FK.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_FK.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..70de685982bfcd127b8501622cec22c5e2f7b2d1 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_FK.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_FM.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_FM.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..4d1039fafb9fe7f45ced7e377711ef3334bb722f Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_FM.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_FO.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_FO.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..0507c76cdb2ae351bcd0c22cd4f9d50753014df4 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_FO.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_FR.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_FR.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..065827f4692f80736f984fe40aa695d4a21b815c Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_FR.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_GA.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_GA.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c85a6cea6f87062cc2c46b6b7f7c2fb46e679217 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_GA.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_GB.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_GB.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..66030b154ee8403152ea6bf09bfb6490e2d6ceac Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_GB.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_GD.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_GD.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..65e31df509be80c3c01acfc9018680e8db027c41 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_GD.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_GE.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_GE.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..db914bad63f0cb0cbba965efe8fe30c70c3c5c2a Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_GE.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_GF.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_GF.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c714c4af314d1e43e336f66414a02525a91f2a62 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_GF.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_GG.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_GG.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..5270d846e4e4c6cf733a3476bbb762051de833a8 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_GG.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_GH.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_GH.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..0c80e47e1761dd19ff81bc4104815eae8737a0c9 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_GH.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_GI.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_GI.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..cbedd6574269eba96d52e3b2dbbd7a7257edcf84 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_GI.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_GL.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_GL.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..5ec36ef46bcb35e46c8e81b722e989a32080c135 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_GL.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_GM.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_GM.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..620ea18e8f8bc5569d549485ccb845ea64c3b1bb Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_GM.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_GN.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_GN.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..00e7015e06037c33879bba262bc2bb133e344ab5 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_GN.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_GP.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_GP.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..30282243e5496bbd9db59952e1d5a3f456aedb86 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_GP.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_GR.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_GR.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..176afe4cbe97dbf28c077f4800696002fc7febd2 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_GR.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_GT.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_GT.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..90af8fc508856e848528a439e9bb247ffeed959d Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_GT.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_GU.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_GU.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a71f8d7b8519e7c04a31fc1bd9462dcfa1a1cfae Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_GU.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_GW.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_GW.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..598a65e54d5a959dc6ceb0b100170211d20471b5 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_GW.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_GY.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_GY.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..ba2eb01303dce1cd7f48ca76e4be279140462798 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_GY.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_HK.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_HK.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e2b10554dae293ec212fbb8455af7198313a3cae Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_HK.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_HN.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_HN.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..72c1fc778049302345555fc18846867ef3974e18 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_HN.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_HR.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_HR.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..3ff290612f07112a8ac6cc3cf5be69e981566b97 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_HR.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_HT.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_HT.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..9b4ba78575ad7cbf39aff66cb114bf0b7e537483 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_HT.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_HU.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_HU.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..ddc7278152f62495a23f9bd71e2d9f0482b644dd Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_HU.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_ID.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_ID.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..20fdcd67111d2d7294f8a989956a37d36c20ff91 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_ID.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_IE.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_IE.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..334574c09392ad244a51897f0ed09a7b9c416cb6 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_IE.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_IL.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_IL.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f34f82bb193d92ac1055d0f67712811e163d631a Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_IL.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_IM.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_IM.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..627bd97dba2cfd932031d6b7d5cefdaa8cb51b78 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_IM.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_IN.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_IN.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..57120103abe06565c77b90ea8ec03878aee19dcb Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_IN.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_IQ.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_IQ.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..1b134589c121420c0285337224842e209405b336 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_IQ.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_IR.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_IR.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..df3354db4df847f5a3c787f4a4a6ee458c21fd48 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_IR.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_IS.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_IS.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..513ad846339601815e01907923ff0b74bb9ab9e6 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_IS.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_IT.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_IT.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..47f5e107c299fafb9bd775fecd9dbdb356ce7dcc Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_IT.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_JE.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_JE.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..496f44a7bfe54f35294a8d78b0d5100a4b410782 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_JE.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_JM.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_JM.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..833181a8a896d26e951bb24014e0935ec72a4223 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_JM.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_JO.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_JO.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..42e6fb6b5f280efbddbf02567372f086c1444ad2 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_JO.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_JP.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_JP.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d74610b0ef1e3c824e0b252ee2f79deed25693be Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_JP.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_KE.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_KE.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..fdd6279bdee1d731927527e33277f9b6fe2b20ca Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_KE.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_KG.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_KG.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..bfc0d4bceb33189159492eae1122da9def3cbd6b Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_KG.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_KH.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_KH.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..acd3ab0641bd22ac66bc9df5052c4e0b25898589 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_KH.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_KI.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_KI.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..4739e7f63b858f45317d9de33d4193c640bb016a Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_KI.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_KM.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_KM.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..3307ff6c1b46f9393f91dd7f544f1eb2caea16a2 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_KM.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_KN.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_KN.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f3fc0c8f28d77b716e51e38336270d32eac8ac14 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_KN.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_KP.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_KP.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c669726f6380d1ef37c644b8f3fa3f1f32cbf650 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_KP.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_KR.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_KR.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..b5512395a8f06f93dcc8af683ee615d1b4d84ea2 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_KR.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_KW.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_KW.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c715d63946d5e3e08f19ff1301edfa5b8d483520 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_KW.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_KY.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_KY.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..87ce6e118382e952169467c0dbba5bd7fbd07447 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_KY.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_KZ.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_KZ.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2a5f709b5303ff1ab0267082adc115d62e896e05 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_KZ.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_LA.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_LA.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c10d7d872e718ffa25a2b9dcd5c8c11b99d27387 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_LA.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_LB.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_LB.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..897030b1e7ac8239a9e1e0fbd1a6476feecf0e8f Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_LB.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_LC.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_LC.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..056d5df411b4ab0443e38b738acb509131fcc968 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_LC.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_LI.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_LI.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..251003178c314b82e58922d08912ef21fe3dcedf Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_LI.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_LK.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_LK.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..8216227988052d6d26fb44777b5402dbc4c7a721 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_LK.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_LR.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_LR.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e55ca6c3d749ed93ebe81ac023f962940613dd06 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_LR.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_LS.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_LS.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..4696edf77f075a0920f4ac6ab7291852803783e6 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_LS.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_LT.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_LT.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..51038bfa15d8e4a87949a009fccdf2d3a83e6b5b Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_LT.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_LU.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_LU.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..1b134108cb6a534731d5c132178f2a686bf8fb16 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_LU.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_LV.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_LV.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..06b2f1b3883a03fc1167e0e2f534a56ffb238240 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_LV.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_LY.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_LY.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..75ec6ae60c8a2b320c2a5c6da0dcf576372dbc38 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_LY.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_MA.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_MA.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..58970cbbefc1507772915cfd07c268de929ae864 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_MA.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_MC.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_MC.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..883dcb9f17e7875365bc56c84cf481c0ebb0682b Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_MC.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_MD.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_MD.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c8d13adf74243e21c94bbdf30df7f6a280edd831 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_MD.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_ME.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_ME.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..ed869c929b2f7f2a28bd7fa7bafc68426966596a Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_ME.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_MF.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_MF.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..0dee31225fe5881ea25b78c9b4de2785738a7217 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_MF.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_MG.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_MG.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c7d33649b2db3d7e361325aea37b654b28096a9b Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_MG.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_MH.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_MH.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f3a7f84b23f7d2ffeab025f7f3f82e102600ce54 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_MH.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_MK.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_MK.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f5f8c24ea7976149d3cc1b027a2865f63685e27e Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_MK.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_ML.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_ML.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..3eac73c57d8f105afdeec2c8ad0945a4809f317d Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_ML.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_MM.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_MM.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..28206fa1af033440d74eb8fcc198b0649a9a8a0d Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_MM.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_MN.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_MN.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..94689904a29390e3e849acd060bcff3f11c381d6 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_MN.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_MO.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_MO.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..1eecf166ed3e9cfb897877e8f58c29760746e40e Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_MO.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_MP.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_MP.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..b165eca2a5d5436327874b32371fc07fb56ac517 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_MP.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_MQ.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_MQ.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..8c3937a38596a85b6628d61902b01b916423b4b7 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_MQ.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_MR.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_MR.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..ca053242ea9a61327ce822bb86db5b8db003999c Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_MR.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_MS.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_MS.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..dc36039638ca153a19c77de1da46abf97b3d9fb5 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_MS.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_MT.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_MT.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..29d0d2b898f8988063705c267201fe7f1194dbdd Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_MT.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_MU.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_MU.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..5f4aff2515069db3820e6d4aad2041ebe190585d Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_MU.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_MV.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_MV.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..49d5e7d7a1b38abd3ba9a351b50196d39511ebde Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_MV.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_MW.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_MW.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d25fdfdebde1bdaeb46afbfaf372f957984008ab Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_MW.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_MX.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_MX.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..62765a30669348eeb31f2be00ace5a4bb83cac03 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_MX.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_MY.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_MY.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..cafa4bdde78f6682198ce90e25254950b9b74050 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_MY.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_MZ.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_MZ.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..5c488014ee57186b1000c105f1a21983f12ea36b Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_MZ.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_NA.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_NA.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e1fbd78c03b1c670b6f38b920f341869827cd603 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_NA.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_NC.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_NC.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..6fc2ea93a32968f9d706c02f977d8ffd990dc937 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_NC.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_NE.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_NE.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..9e4de192fae035362d7a13b7e83c50d83f18b828 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_NE.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_NF.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_NF.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..6ba62248c5363fb9ab6cba08159d6835178c8ea3 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_NF.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_NG.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_NG.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..39b09cf87af78ac620056b16280af3b0bcb84bd2 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_NG.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_NI.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_NI.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..541198b57f4793b370a45ade39af9c2f90adbd8e Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_NI.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_NL.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_NL.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..70a127f3362a43fddfad7bd59cabfc922d550ebd Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_NL.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_NO.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_NO.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..9eb7c99dcdefe79610d6a661c4e230bf91d22c9c Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_NO.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_NP.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_NP.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d9fab140b8c8becb8b4f9e615e4fa2338dbca15f Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_NP.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_NR.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_NR.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..8b34e0ef9e91375ed506f88bcd7d9bda86da5b14 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_NR.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_NU.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_NU.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..56449b12900ec8d6da682ae2ba55acbf49b8d97b Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_NU.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_NZ.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_NZ.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..221e8f5645c2fd02153026f79c5804c449a26a77 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_NZ.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_OM.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_OM.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e948cb25fb9ee2c1fb3b0cfcf861083dcb970278 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_OM.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_PA.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_PA.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..48573f4fff4967f947fcf54f524cb3d65a2ead84 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_PA.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_PE.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_PE.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..27d93f00de6444baec04cef670c1e931b03a8210 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_PE.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_PF.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_PF.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e284e368c90e6b56d902f8780f9bb9919b09bce9 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_PF.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_PG.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_PG.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..0e8937fa879fcaa841c3a8f05fbcbfde5c6dc846 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_PG.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_PH.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_PH.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..8a02c2df620d0fc213b66f09f84e8f472b73585a Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_PH.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_PK.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_PK.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f9441fb0144e7973d8e05deae9139d56be704cbf Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_PK.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_PL.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_PL.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..54e9d36412a8054be973e336496117e02d5d92a1 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_PL.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_PM.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_PM.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..b3ecc482003e6e06d3a1eaab84039d6461f261d2 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_PM.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_PR.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_PR.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..26e5fef83edac73a1a6b3ac04116c1fafd04a164 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_PR.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_PS.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_PS.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..31e5c70a440132b479e345011f9036a64ce3f554 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_PS.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_PT.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_PT.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..26b29fb98291d4bf9b4c53462555e3feb97cf99a Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_PT.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_PW.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_PW.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..6ee428c3850dc6142ff624edb5093f154c20d0b9 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_PW.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_PY.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_PY.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e464e5f5ddaf14fa137f08bd55f5992c95235d2c Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_PY.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_QA.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_QA.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..8c40adf3e45aafba15e81dbcdf994d85b9f8c21c Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_QA.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_RE.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_RE.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2bf7f40ae707176fb12f637083a6004d0516fe79 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_RE.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_RO.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_RO.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..666a6cfcec6d233ddac64a5ff7cb86c630e055b0 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_RO.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_RS.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_RS.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..44014cbccb3334d954f295f23a2a7993dc5ec29d Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_RS.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_RU.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_RU.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..25729f4f0e0541bb463f637fd67501e4b4ffb53f Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_RU.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_RW.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_RW.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..03989af7351e15fc3946c3115d21821a26d42634 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_RW.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_SA.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_SA.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..8bedecbeb5a14a2a706e185e9d0d91618df12bcb Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_SA.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_SB.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_SB.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..9c5eaf54bf872abe347fa07ab31d1fcf32e02c3d Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_SB.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_SC.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_SC.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..ce0474776f455a75718b96b407ae16d8c269626c Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_SC.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_SD.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_SD.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..eedd2500837351c70c5b2abd9b0b4330bae9c18b Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_SD.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_SE.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_SE.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..1fbd1d9b5de46768b601543230daffb07350a3b6 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_SE.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_SG.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_SG.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..1d34b0d3b4786dced847fdc19a2760e2ac14a359 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_SG.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_SH.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_SH.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..360553a43f807e1af0a521881c4eb746fb957898 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_SH.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_SI.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_SI.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..9ba42461baa1d20d357c662bd8e799b3a7a3c53e Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_SI.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_SJ.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_SJ.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..144d105444163704cd8bce137d13f83e9b8cae37 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_SJ.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_SK.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_SK.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..bf889be6a49cd9d9dafd44d72d5e680616edee10 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_SK.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_SL.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_SL.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..1c9d77a2895efe7c94c0dd9381327489c02bfe61 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_SL.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_SM.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_SM.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..82fb58af704ea4b030d4c1ccfd80ecc67e18dcae Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_SM.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_SN.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_SN.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..19563db2c7f46daddba89a4f87de49b2443e2d20 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_SN.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_SO.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_SO.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..1d9d5a0cca4c461446cf2bdeab412d2f425d5679 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_SO.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_SR.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_SR.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..9006ffbb4213fad4ef1b3b9242e9b405b357e78d Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_SR.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_SS.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_SS.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..b8a4c57ef458a27faca7e3ac93c9028020e557e5 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_SS.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_ST.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_ST.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..93998229f94621880f2cd26e50667f6a7bd332e7 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_ST.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_SV.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_SV.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a55daf51a93b718a4d38498f05653900fceb9e91 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_SV.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_SX.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_SX.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..6f11b0bffa2c9193bd02bdab95a0a214977614dc Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_SX.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_SY.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_SY.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..4447ce51ea0476449ddc18c22c0e39c6611680a6 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_SY.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_SZ.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_SZ.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..fa52e8f6595cedf5520982e575f8268d188b9dbf Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_SZ.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_TC.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_TC.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..7a749b580612659b448af21d0bee5fa764c2cf98 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_TC.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_TD.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_TD.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..6a614e86ce05849aca1cb9dfdc0b7306655ba3bf Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_TD.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_TG.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_TG.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..047888b682a12f37b018c392fd32fff6c813f5aa Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_TG.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_TH.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_TH.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..cdcde44fd4c5f0df8a04a267358871c81ddbac12 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_TH.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_TL.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_TL.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..297b66fcd597ab8900d816a0d9eacf056171be89 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_TL.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_TM.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_TM.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..5f85a857e029c7e73250cce5b5bd4568aec93f86 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_TM.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_TN.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_TN.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c652cb84e28b1e7f671fb09acc36913c2b808dec Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_TN.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_TO.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_TO.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..553a4e97d1ee7b41d46187afd05cc125edf4c0fd Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_TO.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_TR.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_TR.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..72fedccee8c6f790faa00a08dca4f9d01bb701c7 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_TR.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_TT.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_TT.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..ea1608ad25dad89d55db44bc782133ed729cad27 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_TT.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_TV.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_TV.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..cb214b21a24c8471147270c7050a53c429cf6e53 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/__pycache__/region_TV.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/region_TV.py b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/region_TV.py new file mode 100644 index 0000000000000000000000000000000000000000..656d68cebebf556cf685e44539e3fbfd4772105c --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/region_TV.py @@ -0,0 +1,9 @@ +"""Auto-generated file, do not edit by hand. TV metadata""" +from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata + +PHONE_METADATA_TV = PhoneMetadata(id='TV', country_code=None, international_prefix=None, + general_desc=PhoneNumberDesc(national_number_pattern='[19]\\d\\d', possible_length=(3,)), + toll_free=PhoneNumberDesc(national_number_pattern='911', example_number='911', possible_length=(3,)), + emergency=PhoneNumberDesc(national_number_pattern='911', example_number='911', possible_length=(3,)), + short_code=PhoneNumberDesc(national_number_pattern='1\\d\\d|911', example_number='100', possible_length=(3,)), + short_data=True) diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/region_TW.py b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/region_TW.py new file mode 100644 index 0000000000000000000000000000000000000000..acec927890c0004adcb654abf03e4409ad8c5333 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/region_TW.py @@ -0,0 +1,11 @@ +"""Auto-generated file, do not edit by hand. TW metadata""" +from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata + +PHONE_METADATA_TW = PhoneMetadata(id='TW', country_code=None, international_prefix=None, + general_desc=PhoneNumberDesc(national_number_pattern='1\\d{2,3}', possible_length=(3, 4)), + toll_free=PhoneNumberDesc(national_number_pattern='11[0289]|1(?:81|92)\\d', example_number='110', possible_length=(3, 4)), + premium_rate=PhoneNumberDesc(national_number_pattern='10[56]', example_number='105', possible_length=(3,)), + emergency=PhoneNumberDesc(national_number_pattern='11[029]', example_number='110', possible_length=(3,)), + short_code=PhoneNumberDesc(national_number_pattern='1(?:0[04-6]|1[0237-9]|3[389]|6[05-8]|7[07]|8(?:0|11)|9(?:19|22|5[057]|68|8[05]|9[15689]))', example_number='100', possible_length=(3, 4)), + standard_rate=PhoneNumberDesc(national_number_pattern='1(?:65|9(?:1\\d|50|85|98))', example_number='165', possible_length=(3, 4)), + short_data=True) diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/region_TZ.py b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/region_TZ.py new file mode 100644 index 0000000000000000000000000000000000000000..87212ca2a3ccba682e03bf626c69e62858230ac1 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/region_TZ.py @@ -0,0 +1,11 @@ +"""Auto-generated file, do not edit by hand. TZ metadata""" +from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata + +PHONE_METADATA_TZ = PhoneMetadata(id='TZ', country_code=None, international_prefix=None, + general_desc=PhoneNumberDesc(national_number_pattern='[149]\\d\\d(?:\\d{2})?', possible_length=(3, 5)), + toll_free=PhoneNumberDesc(national_number_pattern='1(?:1[0-79]|9[09])|999', example_number='110', possible_length=(3,)), + emergency=PhoneNumberDesc(national_number_pattern='11[0-245]|999', example_number='110', possible_length=(3,)), + short_code=PhoneNumberDesc(national_number_pattern='1(?:1\\d|9[09])|46400|999', example_number='110', possible_length=(3, 5)), + carrier_specific=PhoneNumberDesc(national_number_pattern='464\\d\\d', example_number='46400', possible_length=(5,)), + sms_services=PhoneNumberDesc(national_number_pattern='464\\d\\d', example_number='46400', possible_length=(5,)), + short_data=True) diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/region_UA.py b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/region_UA.py new file mode 100644 index 0000000000000000000000000000000000000000..038f1355dec530ae967ddd22f83a29690a0bb6e8 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/region_UA.py @@ -0,0 +1,10 @@ +"""Auto-generated file, do not edit by hand. UA metadata""" +from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata + +PHONE_METADATA_UA = PhoneMetadata(id='UA', country_code=None, international_prefix=None, + general_desc=PhoneNumberDesc(national_number_pattern='[189]\\d{2,5}', possible_length=(3, 4, 5, 6)), + toll_free=PhoneNumberDesc(national_number_pattern='1(?:0[1-3]|1(?:2|6\\d{3}))', example_number='101', possible_length=(3, 6)), + emergency=PhoneNumberDesc(national_number_pattern='1(?:0[1-3]|12)', example_number='101', possible_length=(3,)), + short_code=PhoneNumberDesc(national_number_pattern='1(?:0[1-49]|1(?:2|6(?:000|1(?:11|23))|8\\d\\d?)|(?:[278]|5\\d)\\d)|[89]00\\d\\d?|151|1(?:06|4\\d|6)\\d\\d', example_number='101', possible_length=(3, 4, 5, 6)), + carrier_specific=PhoneNumberDesc(national_number_pattern='(?:118|[89]00)\\d\\d?', example_number='1180', possible_length=(4, 5)), + short_data=True) diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/region_UG.py b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/region_UG.py new file mode 100644 index 0000000000000000000000000000000000000000..b4cdac01df051c5b6beca8f723c732a0ae3b47ac --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/region_UG.py @@ -0,0 +1,9 @@ +"""Auto-generated file, do not edit by hand. UG metadata""" +from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata + +PHONE_METADATA_UG = PhoneMetadata(id='UG', country_code=None, international_prefix=None, + general_desc=PhoneNumberDesc(national_number_pattern='9\\d\\d', possible_length=(3,)), + toll_free=PhoneNumberDesc(national_number_pattern='999', example_number='999', possible_length=(3,)), + emergency=PhoneNumberDesc(national_number_pattern='999', example_number='999', possible_length=(3,)), + short_code=PhoneNumberDesc(national_number_pattern='999', example_number='999', possible_length=(3,)), + short_data=True) diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/region_US.py b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/region_US.py new file mode 100644 index 0000000000000000000000000000000000000000..3e70a5194bccdb9aaad66996646297f34577fee9 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/region_US.py @@ -0,0 +1,13 @@ +"""Auto-generated file, do not edit by hand. US metadata""" +from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata + +PHONE_METADATA_US = PhoneMetadata(id='US', country_code=None, international_prefix=None, + general_desc=PhoneNumberDesc(national_number_pattern='[1-9]\\d{2,5}', possible_length=(3, 4, 5, 6)), + toll_free=PhoneNumberDesc(national_number_pattern='112|611|9(?:11|33|88)', example_number='112', possible_length=(3,)), + premium_rate=PhoneNumberDesc(national_number_pattern='24280|(?:381|968)35|4(?:3355|7553|8221)|5(?:(?:489|934)2|5928)|72078|(?:323|960)40|(?:276|414)63|(?:2(?:520|744)|7390|9968)9|(?:693|732|976)88|(?:3(?:556|825)|5294|8623|9729)4|(?:3378|4136|7642|8961|9979)6|(?:4(?:6(?:15|32)|827)|(?:591|720)8|9529)7', example_number='24280', possible_length=(5,)), + emergency=PhoneNumberDesc(national_number_pattern='112|911', example_number='112', possible_length=(3,)), + short_code=PhoneNumberDesc(national_number_pattern='11(?:2|5[1-47]|[68]\\d|7[0-57]|98)|[2-9]\\d{3,5}|[2-8]11|9(?:11|33|88)', example_number='112', possible_length=(3, 4, 5, 6)), + standard_rate=PhoneNumberDesc(national_number_pattern='2(?:3333|(?:4224|7562|900)2|56447|6688)|3(?:1010|2665|7404)|40404|560560|6(?:0060|22639|5246|7622)|7(?:0701|3822|4666)|8(?:(?:3825|7226)5|4816)|99099', example_number='23333', possible_length=(5, 6)), + carrier_specific=PhoneNumberDesc(national_number_pattern='336\\d\\d|[2-9]\\d{3}|[2356]11', example_number='211', possible_length=(3, 4, 5)), + sms_services=PhoneNumberDesc(national_number_pattern='[2-9]\\d{4,5}', example_number='20000', possible_length=(5, 6)), + short_data=True) diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/region_UY.py b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/region_UY.py new file mode 100644 index 0000000000000000000000000000000000000000..d1aa6cebb62761da407b3007583f7d455a363a2b --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/region_UY.py @@ -0,0 +1,10 @@ +"""Auto-generated file, do not edit by hand. UY metadata""" +from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata + +PHONE_METADATA_UY = PhoneMetadata(id='UY', country_code=None, international_prefix=None, + general_desc=PhoneNumberDesc(national_number_pattern='[129]\\d{2,4}', possible_length=(3, 4, 5)), + toll_free=PhoneNumberDesc(national_number_pattern='128|911', example_number='128', possible_length=(3,)), + emergency=PhoneNumberDesc(national_number_pattern='128|911', example_number='128', possible_length=(3,)), + short_code=PhoneNumberDesc(national_number_pattern='1(?:0[4-9]|1[2368]|2[0-3568]|787|997\\d?)|21997|911', example_number='104', possible_length=(3, 4, 5)), + standard_rate=PhoneNumberDesc(national_number_pattern='178\\d', example_number='1780', possible_length=(4,)), + short_data=True) diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/region_UZ.py b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/region_UZ.py new file mode 100644 index 0000000000000000000000000000000000000000..a603121894469f98be0fe539156448334f4f54c6 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/region_UZ.py @@ -0,0 +1,11 @@ +"""Auto-generated file, do not edit by hand. UZ metadata""" +from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata + +PHONE_METADATA_UZ = PhoneMetadata(id='UZ', country_code=None, international_prefix=None, + general_desc=PhoneNumberDesc(national_number_pattern='[04]\\d(?:\\d(?:\\d{2})?)?', possible_length=(2, 3, 5)), + toll_free=PhoneNumberDesc(national_number_pattern='0(?:0[1-3]|[1-3]|50)', example_number='01', possible_length=(2, 3)), + emergency=PhoneNumberDesc(national_number_pattern='0(?:0[1-3]|[1-3]|50)', example_number='01', possible_length=(2, 3)), + short_code=PhoneNumberDesc(national_number_pattern='0(?:0[1-3]|[1-3]|50)|45400', example_number='01', possible_length=(2, 3, 5)), + carrier_specific=PhoneNumberDesc(national_number_pattern='454\\d\\d', example_number='45400', possible_length=(5,)), + sms_services=PhoneNumberDesc(national_number_pattern='454\\d\\d', example_number='45400', possible_length=(5,)), + short_data=True) diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/region_VA.py b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/region_VA.py new file mode 100644 index 0000000000000000000000000000000000000000..7d2a94cd54245c3638b8e57ec521204c67d755ec --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/region_VA.py @@ -0,0 +1,9 @@ +"""Auto-generated file, do not edit by hand. VA metadata""" +from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata + +PHONE_METADATA_VA = PhoneMetadata(id='VA', country_code=None, international_prefix=None, + general_desc=PhoneNumberDesc(national_number_pattern='1\\d\\d', possible_length=(3,)), + toll_free=PhoneNumberDesc(national_number_pattern='11[2358]', example_number='112', possible_length=(3,)), + emergency=PhoneNumberDesc(national_number_pattern='11[2358]', example_number='112', possible_length=(3,)), + short_code=PhoneNumberDesc(national_number_pattern='11[2358]', example_number='112', possible_length=(3,)), + short_data=True) diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/region_VC.py b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/region_VC.py new file mode 100644 index 0000000000000000000000000000000000000000..8af991b223e97f4b7d6af21d24446f76ae752e0b --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/region_VC.py @@ -0,0 +1,9 @@ +"""Auto-generated file, do not edit by hand. VC metadata""" +from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata + +PHONE_METADATA_VC = PhoneMetadata(id='VC', country_code=None, international_prefix=None, + general_desc=PhoneNumberDesc(national_number_pattern='9\\d\\d', possible_length=(3,)), + toll_free=PhoneNumberDesc(national_number_pattern='9(?:11|88|99)', example_number='911', possible_length=(3,)), + emergency=PhoneNumberDesc(national_number_pattern='9(?:11|99)', example_number='911', possible_length=(3,)), + short_code=PhoneNumberDesc(national_number_pattern='9(?:11|88|99)', example_number='911', possible_length=(3,)), + short_data=True) diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/region_VE.py b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/region_VE.py new file mode 100644 index 0000000000000000000000000000000000000000..62cc8ba47668fa06dcd8676eb92bf2d4f464245e --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/region_VE.py @@ -0,0 +1,9 @@ +"""Auto-generated file, do not edit by hand. VE metadata""" +from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata + +PHONE_METADATA_VE = PhoneMetadata(id='VE', country_code=None, international_prefix=None, + general_desc=PhoneNumberDesc(national_number_pattern='[19]\\d\\d', possible_length=(3,)), + toll_free=PhoneNumberDesc(national_number_pattern='1(?:12|71)|911', example_number='112', possible_length=(3,)), + emergency=PhoneNumberDesc(national_number_pattern='1(?:12|71)|911', example_number='112', possible_length=(3,)), + short_code=PhoneNumberDesc(national_number_pattern='1(?:12|71)|911', example_number='112', possible_length=(3,)), + short_data=True) diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/region_VG.py b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/region_VG.py new file mode 100644 index 0000000000000000000000000000000000000000..7b4ced500e6ecd9c178bf7d0a368bf44dbf4237d --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/region_VG.py @@ -0,0 +1,9 @@ +"""Auto-generated file, do not edit by hand. VG metadata""" +from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata + +PHONE_METADATA_VG = PhoneMetadata(id='VG', country_code=None, international_prefix=None, + general_desc=PhoneNumberDesc(national_number_pattern='9\\d\\d', possible_length=(3,)), + toll_free=PhoneNumberDesc(national_number_pattern='9(?:11|88|99)', example_number='911', possible_length=(3,)), + emergency=PhoneNumberDesc(national_number_pattern='9(?:11|99)', example_number='911', possible_length=(3,)), + short_code=PhoneNumberDesc(national_number_pattern='9(?:11|88|99)', example_number='911', possible_length=(3,)), + short_data=True) diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/region_VI.py b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/region_VI.py new file mode 100644 index 0000000000000000000000000000000000000000..bf630017ba7abeda9e0ea5ef8693444f854d2c3c --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/region_VI.py @@ -0,0 +1,9 @@ +"""Auto-generated file, do not edit by hand. VI metadata""" +from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata + +PHONE_METADATA_VI = PhoneMetadata(id='VI', country_code=None, international_prefix=None, + general_desc=PhoneNumberDesc(national_number_pattern='9\\d\\d', possible_length=(3,)), + toll_free=PhoneNumberDesc(national_number_pattern='9(?:11|88)', example_number='911', possible_length=(3,)), + emergency=PhoneNumberDesc(national_number_pattern='911', example_number='911', possible_length=(3,)), + short_code=PhoneNumberDesc(national_number_pattern='9(?:11|88)', example_number='911', possible_length=(3,)), + short_data=True) diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/region_VN.py b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/region_VN.py new file mode 100644 index 0000000000000000000000000000000000000000..83966a550a543d02c5d178579c516f61e2a1bf08 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/region_VN.py @@ -0,0 +1,9 @@ +"""Auto-generated file, do not edit by hand. VN metadata""" +from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata + +PHONE_METADATA_VN = PhoneMetadata(id='VN', country_code=None, international_prefix=None, + general_desc=PhoneNumberDesc(national_number_pattern='1\\d\\d', possible_length=(3,)), + toll_free=PhoneNumberDesc(national_number_pattern='11[3-5]', example_number='113', possible_length=(3,)), + emergency=PhoneNumberDesc(national_number_pattern='11[3-5]', example_number='113', possible_length=(3,)), + short_code=PhoneNumberDesc(national_number_pattern='11[3-5]', example_number='113', possible_length=(3,)), + short_data=True) diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/region_VU.py b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/region_VU.py new file mode 100644 index 0000000000000000000000000000000000000000..3667c951436f11a0bbff523480eb94a0246812a5 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/region_VU.py @@ -0,0 +1,9 @@ +"""Auto-generated file, do not edit by hand. VU metadata""" +from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata + +PHONE_METADATA_VU = PhoneMetadata(id='VU', country_code=None, international_prefix=None, + general_desc=PhoneNumberDesc(national_number_pattern='1\\d\\d', possible_length=(3,)), + toll_free=PhoneNumberDesc(national_number_pattern='112', example_number='112', possible_length=(3,)), + emergency=PhoneNumberDesc(national_number_pattern='112', example_number='112', possible_length=(3,)), + short_code=PhoneNumberDesc(national_number_pattern='112', example_number='112', possible_length=(3,)), + short_data=True) diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/region_WF.py b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/region_WF.py new file mode 100644 index 0000000000000000000000000000000000000000..7b530bbbe175d5f51d830892ac55d7c21c62734d --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/region_WF.py @@ -0,0 +1,9 @@ +"""Auto-generated file, do not edit by hand. WF metadata""" +from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata + +PHONE_METADATA_WF = PhoneMetadata(id='WF', country_code=None, international_prefix=None, + general_desc=PhoneNumberDesc(national_number_pattern='1\\d', possible_length=(2,)), + toll_free=PhoneNumberDesc(national_number_pattern='1[578]', example_number='15', possible_length=(2,)), + emergency=PhoneNumberDesc(national_number_pattern='1[578]', example_number='15', possible_length=(2,)), + short_code=PhoneNumberDesc(national_number_pattern='1[578]', example_number='15', possible_length=(2,)), + short_data=True) diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/region_WS.py b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/region_WS.py new file mode 100644 index 0000000000000000000000000000000000000000..3412e61d4eef55940ce234becfa3cbc142ababc5 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/region_WS.py @@ -0,0 +1,10 @@ +"""Auto-generated file, do not edit by hand. WS metadata""" +from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata + +PHONE_METADATA_WS = PhoneMetadata(id='WS', country_code=None, international_prefix=None, + general_desc=PhoneNumberDesc(national_number_pattern='[19]\\d\\d', possible_length=(3,)), + toll_free=PhoneNumberDesc(national_number_pattern='9(?:11|9[4-69])', example_number='911', possible_length=(3,)), + emergency=PhoneNumberDesc(national_number_pattern='9(?:11|9[4-69])', example_number='911', possible_length=(3,)), + short_code=PhoneNumberDesc(national_number_pattern='1(?:1[12]|2[0-6]|[39]0)|9(?:11|9[4-79])', example_number='111', possible_length=(3,)), + carrier_specific=PhoneNumberDesc(national_number_pattern='12[0-6]', example_number='120', possible_length=(3,)), + short_data=True) diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/region_XK.py b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/region_XK.py new file mode 100644 index 0000000000000000000000000000000000000000..e442cb81d2891e6c49f13e2b47da10db4042176a --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/region_XK.py @@ -0,0 +1,9 @@ +"""Auto-generated file, do not edit by hand. XK metadata""" +from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata + +PHONE_METADATA_XK = PhoneMetadata(id='XK', country_code=None, international_prefix=None, + general_desc=PhoneNumberDesc(national_number_pattern='1\\d\\d', possible_length=(3,)), + toll_free=PhoneNumberDesc(national_number_pattern='1(?:12|9[2-4])', example_number='112', possible_length=(3,)), + emergency=PhoneNumberDesc(national_number_pattern='1(?:12|9[2-4])', example_number='112', possible_length=(3,)), + short_code=PhoneNumberDesc(national_number_pattern='1(?:12|9[2-4])', example_number='112', possible_length=(3,)), + short_data=True) diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/region_YE.py b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/region_YE.py new file mode 100644 index 0000000000000000000000000000000000000000..18bb9d8dd4c0b0d4a7d2a03c4877ed64d9379ed2 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/region_YE.py @@ -0,0 +1,9 @@ +"""Auto-generated file, do not edit by hand. YE metadata""" +from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata + +PHONE_METADATA_YE = PhoneMetadata(id='YE', country_code=None, international_prefix=None, + general_desc=PhoneNumberDesc(national_number_pattern='1\\d\\d', possible_length=(3,)), + toll_free=PhoneNumberDesc(national_number_pattern='19[1459]', example_number='191', possible_length=(3,)), + emergency=PhoneNumberDesc(national_number_pattern='19[1459]', example_number='191', possible_length=(3,)), + short_code=PhoneNumberDesc(national_number_pattern='19[1459]', example_number='191', possible_length=(3,)), + short_data=True) diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/region_YT.py b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/region_YT.py new file mode 100644 index 0000000000000000000000000000000000000000..abd080bf209f4d5b6dd8f37ca31da6ccd207b480 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/region_YT.py @@ -0,0 +1,9 @@ +"""Auto-generated file, do not edit by hand. YT metadata""" +from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata + +PHONE_METADATA_YT = PhoneMetadata(id='YT', country_code=None, international_prefix=None, + general_desc=PhoneNumberDesc(national_number_pattern='1\\d\\d?', possible_length=(2, 3)), + toll_free=PhoneNumberDesc(national_number_pattern='1(?:12|5)', example_number='15', possible_length=(2, 3)), + emergency=PhoneNumberDesc(national_number_pattern='1(?:12|5)', example_number='15', possible_length=(2, 3)), + short_code=PhoneNumberDesc(national_number_pattern='1(?:12|5)', example_number='15', possible_length=(2, 3)), + short_data=True) diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/region_ZA.py b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/region_ZA.py new file mode 100644 index 0000000000000000000000000000000000000000..07829488d1fe135095d36b14b92048919678a0b6 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/region_ZA.py @@ -0,0 +1,13 @@ +"""Auto-generated file, do not edit by hand. ZA metadata""" +from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata + +PHONE_METADATA_ZA = PhoneMetadata(id='ZA', country_code=None, international_prefix=None, + general_desc=PhoneNumberDesc(national_number_pattern='[134]\\d{2,4}', possible_length=(3, 4, 5)), + toll_free=PhoneNumberDesc(national_number_pattern='1(?:01\\d\\d|12)', example_number='112', possible_length=(3, 5)), + premium_rate=PhoneNumberDesc(national_number_pattern='41(?:348|851)', example_number='41348', possible_length=(5,)), + emergency=PhoneNumberDesc(national_number_pattern='1(?:01(?:11|77)|12)', example_number='112', possible_length=(3, 5)), + short_code=PhoneNumberDesc(national_number_pattern='1(?:0(?:1(?:11|77)|20|7)|1[12]|77(?:3[237]|[45]7|6[279]|9[26]))|[34]\\d{4}', example_number='107', possible_length=(3, 4, 5)), + standard_rate=PhoneNumberDesc(national_number_pattern='3(?:078[23]|7(?:064|567)|8126)|4(?:394[16]|7751|8837)|4[23]699', example_number='30782', possible_length=(5,)), + carrier_specific=PhoneNumberDesc(national_number_pattern='111', example_number='111', possible_length=(3,)), + sms_services=PhoneNumberDesc(national_number_pattern='[34]\\d{4}', example_number='30000', possible_length=(5,)), + short_data=True) diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/region_ZM.py b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/region_ZM.py new file mode 100644 index 0000000000000000000000000000000000000000..d4bdc498effc8e93506c2b2fca02ebdb4c781ed0 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/region_ZM.py @@ -0,0 +1,9 @@ +"""Auto-generated file, do not edit by hand. ZM metadata""" +from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata + +PHONE_METADATA_ZM = PhoneMetadata(id='ZM', country_code=None, international_prefix=None, + general_desc=PhoneNumberDesc(national_number_pattern='[19]\\d\\d', possible_length=(3,)), + toll_free=PhoneNumberDesc(national_number_pattern='112|99[139]', example_number='112', possible_length=(3,)), + emergency=PhoneNumberDesc(national_number_pattern='112|99[139]', example_number='112', possible_length=(3,)), + short_code=PhoneNumberDesc(national_number_pattern='112|99[139]', example_number='112', possible_length=(3,)), + short_data=True) diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/region_ZW.py b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/region_ZW.py new file mode 100644 index 0000000000000000000000000000000000000000..9f94e16b287e4da21100542de2dfc8289ffdf50e --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/shortdata/region_ZW.py @@ -0,0 +1,11 @@ +"""Auto-generated file, do not edit by hand. ZW metadata""" +from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata + +PHONE_METADATA_ZW = PhoneMetadata(id='ZW', country_code=None, international_prefix=None, + general_desc=PhoneNumberDesc(national_number_pattern='[139]\\d\\d(?:\\d{2})?', possible_length=(3, 5)), + toll_free=PhoneNumberDesc(national_number_pattern='112|9(?:5[023]|61|9[3-59])', example_number='112', possible_length=(3,)), + premium_rate=PhoneNumberDesc(national_number_pattern='3[013-57-9]\\d{3}', example_number='30000', possible_length=(5,)), + emergency=PhoneNumberDesc(national_number_pattern='112|99[3-59]', example_number='112', possible_length=(3,)), + short_code=PhoneNumberDesc(national_number_pattern='11[2469]|3[013-57-9]\\d{3}|9(?:5[023]|6[0-25]|9[3-59])', example_number='112', possible_length=(3, 5)), + carrier_specific=PhoneNumberDesc(national_number_pattern='114|9(?:5[023]|6[0-25])', example_number='114', possible_length=(3,)), + short_data=True) diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/tzdata/__init__.py b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/tzdata/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..3e151006aa95f4f7f1065bebe32f24cd2efacb72 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/tzdata/__init__.py @@ -0,0 +1,25 @@ +"""Per-prefix data, mapping each prefix to a name. + +Auto-generated file, do not edit by hand. +""" +from ..util import u + +# Copyright (C) 2011-2025 The Libphonenumber Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +TIMEZONE_DATA = {} +from .data0 import data +TIMEZONE_DATA.update(data) +del data +TIMEZONE_LONGEST_PREFIX = 9 diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/tzdata/__init__.pyi b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/tzdata/__init__.pyi new file mode 100644 index 0000000000000000000000000000000000000000..45d621a7a24a410812cd07df423335ff5514a507 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/tzdata/__init__.pyi @@ -0,0 +1,2 @@ +TIMEZONE_DATA: dict[str, tuple[str, ...]] +TIMEZONE_LONGEST_PREFIX: int diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/tzdata/__pycache__/data0.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/tzdata/__pycache__/data0.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..8cd0f60695d62867307f2deed7705900e2ac5a4e --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/tzdata/__pycache__/data0.cpython-312.pyc @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:02c52d9a629377b69cd23cdd1ee7c3e5f909f7b22701a08b6e54fe6f34bc8d8a +size 117436 diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/tzdata/data0.py b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/tzdata/data0.py new file mode 100644 index 0000000000000000000000000000000000000000..b178423df8ec3d0fe2c40b6f8f77fc3a157ea7f1 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/phonenumbers/tzdata/data0.py @@ -0,0 +1,3304 @@ +"""Per-prefix data, mapping each prefix to a name. + +Auto-generated file, do not edit by hand. +""" +from ..util import u + +# Copyright (C) 2011-2025 The Libphonenumber Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +data = { + '1':('America/Adak', 'America/Anchorage', 'America/Anguilla', 'America/Antigua', 'America/Barbados', 'America/Boise', 'America/Cayman', 'America/Chicago', 'America/Denver', 'America/Dominica', 'America/Edmonton', 'America/Fort_Nelson', 'America/Grand_Turk', 'America/Grenada', 'America/Halifax', 'America/Jamaica', 'America/Juneau', 'America/Los_Angeles', 'America/Lower_Princes', 'America/Montserrat', 'America/Nassau', 'America/New_York', 'America/North_Dakota/Center', 'America/Phoenix', 'America/Port_of_Spain', 'America/Puerto_Rico', 'America/Regina', 'America/Santo_Domingo', 'America/St_Johns', 'America/St_Kitts', 'America/St_Lucia', 'America/St_Thomas', 'America/St_Vincent', 'America/Toronto', 'America/Tortola', 'America/Vancouver', 'America/Winnipeg', 'Atlantic/Bermuda', 'Pacific/Guam', 'Pacific/Honolulu', 'Pacific/Pago_Pago', 'Pacific/Saipan'), + '1201':('America/New_York',), + '1202':('America/New_York',), + '1203':('America/New_York',), + '1204':('America/Winnipeg',), + '1205':('America/Chicago',), + '1206':('America/Los_Angeles',), + '1207':('America/New_York',), + '12082':('America/Boise', 'America/Los_Angeles'), + '1208201':('America/Denver',), + '1208215':('America/Los_Angeles',), + '1208221':('America/Denver',), + '1208226':('America/Denver',), + '1208227':('America/Denver',), + '1208228':('America/Denver',), + '120823':('America/Denver',), + '1208241':('America/Denver',), + '1208242':('America/Denver',), + '1208245':('America/Los_Angeles',), + '1208249':('America/Denver',), + '1208250':('America/Denver',), + '1208251':('America/Denver',), + '1208253':('America/Denver',), + '1208254':('America/Denver',), + '1208255':('America/Los_Angeles',), + '1208258':('America/Denver',), + '1208262':('America/Los_Angeles',), + '1208263':('America/Los_Angeles',), + '1208265':('America/Los_Angeles',), + '1208267':('America/Los_Angeles',), + '1208278':('America/Denver',), + '120828':('America/Denver',), + '1208290':('America/Los_Angeles',), + '1208292':('America/Los_Angeles',), + '1208297':('America/Denver',), + '12083':('America/Denver',), + '120830':('America/Boise', 'America/Los_Angeles'), + '1208304':('America/Los_Angeles',), + '1208305':('America/Los_Angeles',), + '120831':('America/Boise', 'America/Los_Angeles'), + '1208320':('America/Boise', 'America/Los_Angeles'), + '1208325':('America/Boise', 'America/Los_Angeles'), + '1208328':('America/Boise', 'America/Los_Angeles'), + '1208329':('America/Boise', 'America/Los_Angeles'), + '1208330':('America/Boise', 'America/Los_Angeles'), + '1208332':('America/Boise', 'America/Los_Angeles'), + '1208335':('America/Boise', 'America/Los_Angeles'), + '1208341':('America/Boise', 'America/Los_Angeles'), + '1208347':('America/Boise', 'America/Los_Angeles'), + '1208348':('America/Boise', 'America/Los_Angeles'), + '1208349':('America/Boise', 'America/Los_Angeles'), + '1208355':('America/Boise', 'America/Los_Angeles'), + '1208358':('America/Boise', 'America/Los_Angeles'), + '1208361':('America/Boise', 'America/Los_Angeles'), + '1208363':('America/Boise', 'America/Los_Angeles'), + '1208364':('America/Boise', 'America/Los_Angeles'), + '1208368':('America/Boise', 'America/Los_Angeles'), + '1208369':('America/Boise', 'America/Los_Angeles'), + '1208370':('America/Boise', 'America/Los_Angeles'), + '1208372':('America/Boise', 'America/Los_Angeles'), + '1208374':('America/Boise', 'America/Los_Angeles'), + '1208379':('America/Boise', 'America/Los_Angeles'), + '1208380':('America/Boise', 'America/Los_Angeles'), + '1208386':('America/Boise', 'America/Los_Angeles'), + '1208387':('America/Boise', 'America/Los_Angeles'), + '1208393':('America/Boise', 'America/Los_Angeles'), + '1208394':('America/Boise', 'America/Los_Angeles'), + '1208395':('America/Boise', 'America/Los_Angeles'), + '1208396':('America/Boise', 'America/Los_Angeles'), + '1208399':('America/Boise', 'America/Los_Angeles'), + '1208400':('America/Boise', 'America/Los_Angeles'), + '1208401':('America/Denver',), + '1208402':('America/Denver',), + '1208403':('America/Denver',), + '1208404':('America/Boise', 'America/Los_Angeles'), + '1208405':('America/Boise', 'America/Los_Angeles'), + '1208406':('America/Boise', 'America/Los_Angeles'), + '1208407':('America/Denver',), + '1208408':('America/Boise', 'America/Los_Angeles'), + '1208409':('America/Denver',), + '120841':('America/Boise', 'America/Los_Angeles'), + '1208412':('America/Denver',), + '1208414':('America/Denver',), + '1208419':('America/Denver',), + '120842':('America/Denver',), + '1208421':('America/Boise', 'America/Los_Angeles'), + '1208427':('America/Boise', 'America/Los_Angeles'), + '1208428':('America/Boise', 'America/Los_Angeles'), + '1208430':('America/Boise', 'America/Los_Angeles'), + '1208431':('America/Denver',), + '1208432':('America/Boise', 'America/Los_Angeles'), + '1208433':('America/Denver',), + '1208434':('America/Boise', 'America/Los_Angeles'), + '1208435':('America/Boise', 'America/Los_Angeles'), + '1208436':('America/Denver',), + '1208437':('America/Los_Angeles',), + '1208438':('America/Denver',), + '1208439':('America/Boise', 'America/Los_Angeles'), + '1208440':('America/Denver',), + '1208441':('America/Boise', 'America/Los_Angeles'), + '1208442':('America/Denver',), + '1208443':('America/Los_Angeles',), + '1208444':('America/Boise', 'America/Los_Angeles'), + '1208445':('America/Boise', 'America/Los_Angeles'), + '1208446':('America/Los_Angeles',), + '1208447':('America/Boise', 'America/Los_Angeles'), + '1208448':('America/Los_Angeles',), + '1208449':('America/Boise', 'America/Los_Angeles'), + '1208450':('America/Boise', 'America/Los_Angeles'), + '1208451':('America/Boise', 'America/Los_Angeles'), + '1208452':('America/Denver',), + '1208453':('America/Denver',), + '1208454':('America/Denver',), + '1208455':('America/Denver',), + '1208456':('America/Boise', 'America/Los_Angeles'), + '1208457':('America/Los_Angeles',), + '1208458':('America/Boise', 'America/Los_Angeles'), + '1208459':('America/Denver',), + '120846':('America/Denver',), + '1208460':('America/Boise', 'America/Los_Angeles'), + '1208464':('America/Boise', 'America/Los_Angeles'), + '1208469':('America/Boise', 'America/Los_Angeles'), + '1208470':('America/Boise', 'America/Los_Angeles'), + '1208471':('America/Boise', 'America/Los_Angeles'), + '1208472':('America/Denver',), + '1208473':('America/Denver',), + '1208474':('America/Boise', 'America/Los_Angeles'), + '1208475':('America/Denver',), + '1208476':('America/Los_Angeles',), + '1208477':('America/Boise', 'America/Los_Angeles'), + '1208478':('America/Denver',), + '1208479':('America/Boise', 'America/Los_Angeles'), + '120848':('America/Boise', 'America/Los_Angeles'), + '1208484':('America/Denver',), + '1208489':('America/Denver',), + '120849':('America/Boise', 'America/Los_Angeles'), + '1208495':('America/Denver',), + '12085':('America/Boise', 'America/Los_Angeles'), + '1208505':('America/Denver',), + '1208514':('America/Denver',), + '1208515':('America/Denver',), + '120852':('America/Denver',), + '1208535':('America/Denver',), + '1208536':('America/Denver',), + '1208538':('America/Denver',), + '1208539':('America/Denver',), + '1208542':('America/Denver',), + '1208543':('America/Denver',), + '1208546':('America/Denver',), + '1208547':('America/Denver',), + '1208549':('America/Denver',), + '1208552':('America/Denver',), + '1208556':('America/Los_Angeles',), + '1208557':('America/Denver',), + '1208558':('America/Denver',), + '1208559':('America/Denver',), + '1208562':('America/Denver',), + '1208569':('America/Denver',), + '1208570':('America/Denver',), + '1208571':('America/Denver',), + '1208573':('America/Denver',), + '1208577':('America/Denver',), + '1208578':('America/Denver',), + '1208585':('America/Denver',), + '1208587':('America/Denver',), + '1208588':('America/Denver',), + '1208589':('America/Denver',), + '1208595':('America/Denver',), + '1208596':('America/Los_Angeles',), + '12086':('America/Boise', 'America/Los_Angeles'), + '1208602':('America/Denver',), + '1208608':('America/Denver',), + '1208610':('America/Los_Angeles',), + '1208622':('America/Denver',), + '1208623':('America/Los_Angeles',), + '1208624':('America/Denver',), + '1208625':('America/Los_Angeles',), + '1208628':('America/Denver',), + '1208629':('America/Denver',), + '1208631':('America/Denver',), + '1208634':('America/Denver',), + '1208637':('America/Denver',), + '1208639':('America/Denver',), + '1208640':('America/Los_Angeles',), + '1208642':('America/Denver',), + '1208651':('America/Los_Angeles',), + '1208652':('America/Denver',), + '1208656':('America/Denver',), + '1208658':('America/Denver',), + '1208659':('America/Los_Angeles',), + '120866':('America/Los_Angeles',), + '1208672':('America/Denver',), + '1208676':('America/Los_Angeles',), + '1208677':('America/Denver',), + '1208678':('America/Denver',), + '1208681':('America/Denver',), + '1208682':('America/Los_Angeles',), + '1208683':('America/Los_Angeles',), + '1208684':('America/Denver',), + '1208686':('America/Los_Angeles',), + '1208687':('America/Los_Angeles',), + '1208691':('America/Los_Angeles',), + '1208695':('America/Denver',), + '1208697':('America/Denver',), + '1208699':('America/Los_Angeles',), + '1208700':('America/Boise', 'America/Los_Angeles'), + '1208701':('America/Boise', 'America/Los_Angeles'), + '1208702':('America/Boise', 'America/Los_Angeles'), + '1208703':('America/Denver',), + '1208704':('America/Los_Angeles',), + '1208705':('America/Denver',), + '1208706':('America/Denver',), + '1208707':('America/Boise', 'America/Los_Angeles'), + '1208708':('America/Boise', 'America/Los_Angeles'), + '1208709':('America/Denver',), + '120871':('America/Boise', 'America/Los_Angeles'), + '1208713':('America/Denver',), + '1208716':('America/Denver',), + '120872':('America/Denver',), + '1208721':('America/Boise', 'America/Los_Angeles'), + '1208723':('America/Boise', 'America/Los_Angeles'), + '1208728':('America/Boise', 'America/Los_Angeles'), + '1208729':('America/Boise', 'America/Los_Angeles'), + '120873':('America/Denver',), + '1208730':('America/Boise', 'America/Los_Angeles'), + '1208738':('America/Boise', 'America/Los_Angeles'), + '1208739':('America/Boise', 'America/Los_Angeles'), + '120874':('America/Boise', 'America/Los_Angeles'), + '1208743':('America/Los_Angeles',), + '1208745':('America/Denver',), + '1208746':('America/Los_Angeles',), + '120875':('America/Boise', 'America/Los_Angeles'), + '1208755':('America/Los_Angeles',), + '1208756':('America/Denver',), + '1208760':('America/Boise', 'America/Los_Angeles'), + '1208761':('America/Denver',), + '1208762':('America/Los_Angeles',), + '1208763':('America/Boise', 'America/Los_Angeles'), + '1208764':('America/Boise', 'America/Los_Angeles'), + '1208765':('America/Los_Angeles',), + '1208766':('America/Denver',), + '1208767':('America/Boise', 'America/Los_Angeles'), + '1208768':('America/Boise', 'America/Los_Angeles'), + '1208769':('America/Los_Angeles',), + '120877':('America/Boise', 'America/Los_Angeles'), + '1208772':('America/Los_Angeles',), + '1208773':('America/Los_Angeles',), + '1208777':('America/Los_Angeles',), + '1208780':('America/Boise', 'America/Los_Angeles'), + '1208781':('America/Boise', 'America/Los_Angeles'), + '1208782':('America/Denver',), + '1208783':('America/Los_Angeles',), + '1208784':('America/Los_Angeles',), + '1208785':('America/Denver',), + '1208786':('America/Boise', 'America/Los_Angeles'), + '1208787':('America/Denver',), + '1208788':('America/Denver',), + '1208789':('America/Denver',), + '120879':('America/Boise', 'America/Los_Angeles'), + '1208791':('America/Los_Angeles',), + '1208794':('America/Denver',), + '1208798':('America/Los_Angeles',), + '1208799':('America/Los_Angeles',), + '120880':('America/Boise', 'America/Los_Angeles'), + '120881':('America/Boise', 'America/Los_Angeles'), + '1208814':('America/Denver',), + '1208818':('America/Los_Angeles',), + '1208819':('America/Los_Angeles',), + '120882':('America/Boise', 'America/Los_Angeles'), + '120883':('America/Boise', 'America/Los_Angeles'), + '1208830':('America/Denver',), + '1208835':('America/Los_Angeles',), + '1208837':('America/Denver',), + '120884':('America/Boise', 'America/Los_Angeles'), + '1208841':('America/Denver',), + '1208843':('America/Los_Angeles',), + '1208846':('America/Denver',), + '1208847':('America/Denver',), + '120885':('America/Denver',), + '1208851':('America/Boise', 'America/Los_Angeles'), + '1208856':('America/Boise', 'America/Los_Angeles'), + '1208857':('America/Boise', 'America/Los_Angeles'), + '1208858':('America/Boise', 'America/Los_Angeles'), + '120886':('America/Denver',), + '1208862':('America/Boise', 'America/Los_Angeles'), + '1208864':('America/Boise', 'America/Los_Angeles'), + '1208865':('America/Boise', 'America/Los_Angeles'), + '1208868':('America/Boise', 'America/Los_Angeles'), + '1208870':('America/Denver',), + '1208871':('America/Denver',), + '1208872':('America/Boise', 'America/Los_Angeles'), + '1208873':('America/Boise', 'America/Los_Angeles'), + '1208874':('America/Boise', 'America/Los_Angeles'), + '1208875':('America/Los_Angeles',), + '1208876':('America/Boise', 'America/Los_Angeles'), + '1208877':('America/Boise', 'America/Los_Angeles'), + '1208878':('America/Denver',), + '1208879':('America/Denver',), + '120888':('America/Denver',), + '1208882':('America/Los_Angeles',), + '1208883':('America/Los_Angeles',), + '1208885':('America/Los_Angeles',), + '1208889':('America/Boise', 'America/Los_Angeles'), + '120889':('America/Denver',), + '1208892':('America/Boise', 'America/Los_Angeles'), + '1208893':('America/Boise', 'America/Los_Angeles'), + '1208894':('America/Boise', 'America/Los_Angeles'), + '1208897':('America/Boise', 'America/Los_Angeles'), + '12089':('America/Boise', 'America/Los_Angeles'), + '1208901':('America/Denver',), + '1208904':('America/Denver',), + '1208906':('America/Denver',), + '1208908':('America/Denver',), + '1208917':('America/Denver',), + '1208918':('America/Denver',), + '1208921':('America/Denver',), + '1208922':('America/Denver',), + '1208926':('America/Los_Angeles',), + '1208928':('America/Denver',), + '1208934':('America/Denver',), + '1208935':('America/Los_Angeles',), + '1208936':('America/Denver',), + '1208938':('America/Denver',), + '1208939':('America/Denver',), + '1208941':('America/Denver',), + '1208944':('America/Denver',), + '1208946':('America/Los_Angeles',), + '1208947':('America/Denver',), + '1208949':('America/Denver',), + '1208954':('America/Denver',), + '1208955':('America/Denver',), + '1208962':('America/Los_Angeles',), + '1208964':('America/Los_Angeles',), + '1208983':('America/Los_Angeles',), + '1208989':('America/Denver',), + '1208991':('America/Denver',), + '1208994':('America/Denver',), + '1208995':('America/Denver',), + '1208996':('America/Denver',), + '1209':('America/Los_Angeles',), + '1210':('America/Chicago',), + '1212':('America/New_York',), + '1213':('America/Los_Angeles',), + '1214':('America/Chicago',), + '1215':('America/New_York',), + '1216':('America/New_York',), + '1217':('America/Chicago',), + '1218':('America/Chicago',), + '1219':('America/New_York',), + '1219226':('America/Chicago',), + '1219227':('America/Chicago',), + '1219242':('America/Chicago',), + '1219261':('America/Chicago',), + '1219263':('America/Chicago',), + '1219285':('America/Chicago',), + '1219286':('America/Chicago',), + '1219299':('America/Chicago',), + '1219322':('America/Chicago',), + '1219324':('America/Chicago',), + '1219325':('America/Chicago',), + '1219326':('America/Chicago',), + '1219345':('America/Chicago',), + '1219362':('America/Chicago',), + '1219365':('America/Chicago',), + '1219369':('America/Chicago',), + '1219374':('America/Chicago',), + '1219392':('America/Chicago',), + '1219393':('America/Chicago',), + '1219395':('America/Chicago',), + '1219397':('America/Chicago',), + '1219398':('America/Chicago',), + '1219427':('America/Chicago',), + '1219440':('America/Chicago',), + '1219462':('America/Chicago',), + '1219464':('America/Chicago',), + '1219465':('America/Chicago',), + '1219472':('America/Chicago',), + '1219473':('America/Chicago',), + '1219474':('America/Chicago',), + '1219476':('America/Chicago',), + '1219477':('America/Chicago',), + '1219513':('America/Chicago',), + '1219531':('America/Chicago',), + '1219548':('America/Chicago',), + '1219558':('America/Chicago',), + '1219595':('America/Chicago',), + '1219659':('America/Chicago',), + '1219661':('America/Chicago',), + '1219662':('America/Chicago',), + '1219663':('America/Chicago',), + '1219690':('America/Chicago',), + '1219696':('America/Chicago',), + '1219707':('America/Chicago',), + '1219728':('America/Chicago',), + '1219733':('America/Chicago',), + '1219736':('America/Chicago',), + '1219738':('America/Chicago',), + '1219755':('America/Chicago',), + '1219756':('America/Chicago',), + '1219757':('America/Chicago',), + '1219759':('America/Chicago',), + '1219762':('America/Chicago',), + '1219763':('America/Chicago',), + '1219764':('America/Chicago',), + '1219766':('America/Chicago',), + '1219769':('America/Chicago',), + '1219778':('America/Chicago',), + '1219779':('America/Chicago',), + '1219785':('America/Chicago',), + '1219787':('America/Chicago',), + '1219791':('America/Chicago',), + '1219803':('America/Chicago',), + '1219836':('America/Chicago',), + '1219838':('America/Chicago',), + '1219844':('America/Chicago',), + '1219845':('America/Chicago',), + '1219852':('America/Chicago',), + '1219853':('America/Chicago',), + '1219864':('America/Chicago',), + '1219865':('America/Chicago',), + '1219866':('America/Chicago',), + '1219872':('America/Chicago',), + '1219873':('America/Chicago',), + '1219874':('America/Chicago',), + '1219878':('America/Chicago',), + '1219879':('America/Chicago',), + '121988':('America/Chicago',), + '121992':('America/Chicago',), + '121993':('America/Chicago',), + '121994':('America/Chicago',), + '1219956':('America/Chicago',), + '1219962':('America/Chicago',), + '1219963':('America/Chicago',), + '1219972':('America/Chicago',), + '1219977':('America/Chicago',), + '1219980':('America/Chicago',), + '1219983':('America/Chicago',), + '1219987':('America/Chicago',), + '1219989':('America/Chicago',), + '1219996':('America/Chicago',), + '1220':('America/New_York',), + '1223':('America/New_York',), + '1224':('America/Chicago',), + '1225':('America/Chicago',), + '1226':('America/Toronto',), + '1227':('America/New_York',), + '1228':('America/Chicago',), + '1229':('America/New_York',), + '1231':('America/New_York',), + '1234':('America/New_York',), + '1235':('America/Chicago',), + '1236':('America/Vancouver',), + '1239':('America/New_York',), + '1240':('America/New_York',), + '1242':('America/Nassau',), + '1246':('America/Barbados',), + '1248':('America/New_York',), + '1249':('America/Toronto',), + '1250':('America/Vancouver',), + '1250242':('America/Edmonton',), + '1250261':('America/Edmonton',), + '1250262':('America/Edmonton',), + '1250263':('America/Edmonton',), + '1250341':('America/Edmonton',), + '1250342':('America/Edmonton',), + '1250344':('America/Edmonton',), + '1250347':('America/Edmonton',), + '1250417':('America/Edmonton',), + '1250423':('America/Edmonton',), + '1250425':('America/Edmonton',), + '1250426':('America/Edmonton',), + '1250427':('America/Edmonton',), + '1250428':('America/Edmonton',), + '1250489':('America/Edmonton',), + '1250719':('America/Edmonton',), + '1250774':('America/Edmonton',), + '1250782':('America/Edmonton',), + '1250784':('America/Edmonton',), + '1250785':('America/Edmonton',), + '1250787':('America/Edmonton',), + '1250788':('America/Edmonton',), + '1251':('America/Chicago',), + '1252':('America/New_York',), + '1253':('America/Los_Angeles',), + '1254':('America/Chicago',), + '1256':('America/Chicago',), + '1257':('America/Vancouver',), + '1260':('America/New_York',), + '1262':('America/Chicago',), + '1263':('America/Toronto',), + '1264':('America/Anguilla',), + '1267':('America/New_York',), + '1268':('America/Antigua',), + '1269':('America/New_York',), + '1270':('America/New_York',), + '1270202':('America/Chicago',), + '1270230':('America/Chicago',), + '1270236':('America/Chicago',), + '1270237':('America/Chicago',), + '1270240':('America/Chicago',), + '1270242':('America/Chicago',), + '1270247':('America/Chicago',), + '1270251':('America/Chicago',), + '1270259':('America/Chicago',), + '1270265':('America/Chicago',), + '1270273':('America/Chicago',), + '1270274':('America/Chicago',), + '1270282':('America/Chicago',), + '1270298':('America/Chicago',), + '1270333':('America/Chicago',), + '1270335':('America/Chicago',), + '1270338':('America/Chicago',), + '1270343':('America/Chicago',), + '1270354':('America/Chicago',), + '1270362':('America/Chicago',), + '1270365':('America/Chicago',), + '1270384':('America/Chicago',), + '1270388':('America/Chicago',), + '1270389':('America/Chicago',), + '1270393':('America/Chicago',), + '1270395':('America/Chicago',), + '1270415':('America/Chicago',), + '1270432':('America/Chicago',), + '1270439':('America/Chicago',), + '1270441':('America/Chicago',), + '1270442':('America/Chicago',), + '1270443':('America/Chicago',), + '1270444':('America/Chicago',), + '1270462':('America/Chicago',), + '1270472':('America/Chicago',), + '1270483':('America/Chicago',), + '1270487':('America/Chicago',), + '1270495':('America/Chicago',), + '1270522':('America/Chicago',), + '1270524':('America/Chicago',), + '1270526':('America/Chicago',), + '1270527':('America/Chicago',), + '1270528':('America/Chicago',), + '1270534':('America/Chicago',), + '1270535':('America/Chicago',), + '1270538':('America/Chicago',), + '1270542':('America/Chicago',), + '1270547':('America/Chicago',), + '1270554':('America/Chicago',), + '1270563':('America/Chicago',), + '1270575':('America/Chicago',), + '1270586':('America/Chicago',), + '1270597':('America/Chicago',), + '1270598':('America/Chicago',), + '1270618':('America/Chicago',), + '1270622':('America/Chicago',), + '1270628':('America/Chicago',), + '1270629':('America/Chicago',), + '1270639':('America/Chicago',), + '1270640':('America/Chicago',), + '1270646':('America/Chicago',), + '1270651':('America/Chicago',), + '1270653':('America/Chicago',), + '1270659':('America/Chicago',), + '1270665':('America/Chicago',), + '1270667':('America/Chicago',), + '1270678':('America/Chicago',), + '127068':('America/Chicago',), + '1270691':('America/Chicago',), + '1270707':('America/Chicago',), + '1270725':('America/Chicago',), + '1270726':('America/Chicago',), + '1270745':('America/Chicago',), + '1270746':('America/Chicago',), + '1270753':('America/Chicago',), + '1270754':('America/Chicago',), + '1270755':('America/Chicago',), + '1270756':('America/Chicago',), + '1270759':('America/Chicago',), + '1270761':('America/Chicago',), + '1270762':('America/Chicago',), + '1270767':('America/Chicago',), + '1270773':('America/Chicago',), + '1270780':('America/Chicago',), + '1270781':('America/Chicago',), + '1270782':('America/Chicago',), + '1270783':('America/Chicago',), + '1270786':('America/Chicago',), + '1270792':('America/Chicago',), + '1270793':('America/Chicago',), + '1270796':('America/Chicago',), + '1270797':('America/Chicago',), + '1270798':('America/Chicago',), + '1270821':('America/Chicago',), + '1270824':('America/Chicago',), + '1270825':('America/Chicago',), + '1270826':('America/Chicago',), + '1270827':('America/Chicago',), + '1270830':('America/Chicago',), + '1270831':('America/Chicago',), + '1270842':('America/Chicago',), + '1270843':('America/Chicago',), + '1270846':('America/Chicago',), + '1270852':('America/Chicago',), + '1270864':('America/Chicago',), + '1270866':('America/Chicago',), + '1270879':('America/Chicago',), + '1270881':('America/Chicago',), + '1270885':('America/Chicago',), + '1270886':('America/Chicago',), + '1270887':('America/Chicago',), + '1270889':('America/Chicago',), + '1270898':('America/Chicago',), + '1270901':('America/Chicago',), + '1270904':('America/Chicago',), + '1270924':('America/Chicago',), + '1270926':('America/Chicago',), + '1270927':('America/Chicago',), + '1270928':('America/Chicago',), + '1270929':('America/Chicago',), + '1270932':('America/Chicago',), + '1270965':('America/Chicago',), + '1270988':('America/Chicago',), + '1272':('America/New_York',), + '1274':('America/Chicago',), + '1276':('America/New_York',), + '1279':('America/Los_Angeles',), + '1281':('America/Chicago',), + '1283':('America/New_York',), + '1284':('America/Tortola',), + '1289':('America/Toronto',), + '1301':('America/New_York',), + '1302':('America/New_York',), + '1303':('America/Denver',), + '1304':('America/New_York',), + '1305':('America/New_York',), + '1306':('America/Regina',), + '1307':('America/Denver',), + '1308':('America/Chicago',), + '1308235':('America/Denver',), + '130824':('America/Denver',), + '1308254':('America/Denver',), + '1308262':('America/Denver',), + '1308282':('America/Denver',), + '1308284':('America/Denver',), + '1308327':('America/Denver',), + '1308352':('America/Denver',), + '1308394':('America/Denver',), + '1308423':('America/Denver',), + '1308432':('America/Denver',), + '1308436':('America/Denver',), + '1308546':('America/Denver',), + '1308623':('America/Denver',), + '1308630':('America/Denver',), + '1308632':('America/Denver',), + '1308633':('America/Denver',), + '1308635':('America/Denver',), + '1308665':('America/Denver',), + '1308762':('America/Denver',), + '1308772':('America/Denver',), + '1308874':('America/Denver',), + '1308882':('America/Denver',), + '1309':('America/Chicago',), + '13102':('America/Los_Angeles',), + '13103':('America/Los_Angeles',), + '13104':('America/Los_Angeles',), + '13105':('America/Los_Angeles',), + '13106':('America/Los_Angeles',), + '13107':('America/Los_Angeles',), + '13108':('America/Los_Angeles',), + '13109':('America/Los_Angeles',), + '1312':('America/Chicago',), + '1313':('America/New_York',), + '1314':('America/Chicago',), + '1315':('America/New_York',), + '1316':('America/Chicago',), + '1317':('America/New_York',), + '1318':('America/Chicago',), + '1319':('America/Chicago',), + '1320':('America/Chicago',), + '1321':('America/New_York',), + '1323':('America/Los_Angeles',), + '1325':('America/Chicago',), + '1326':('America/New_York',), + '1327':('America/Chicago',), + '1329':('America/New_York',), + '1330':('America/New_York',), + '1331':('America/Chicago',), + '1332':('America/New_York',), + '1334':('America/Chicago',), + '1336':('America/New_York',), + '1337':('America/Chicago',), + '1339':('America/New_York',), + '1340':('America/St_Thomas',), + '1341':('America/Los_Angeles',), + '1343':('America/Toronto',), + '1345':('America/Cayman',), + '1346':('America/Chicago',), + '1347':('America/New_York',), + '1350':('America/Los_Angeles',), + '1351':('America/New_York',), + '1352':('America/New_York',), + '1354':('America/Toronto',), + '1360':('America/Los_Angeles',), + '1361':('America/Chicago',), + '1363':('America/New_York',), + '1364':('America/New_York',), + '1365':('America/Toronto',), + '1367':('America/Toronto',), + '1368':('America/Edmonton',), + '1369':('America/Los_Angeles',), + '1380':('America/New_York',), + '1382':('America/Toronto',), + '1385':('America/Denver',), + '1386':('America/New_York',), + '1401':('America/New_York',), + '1402':('America/Chicago',), + '1403':('America/Edmonton',), + '1404':('America/New_York',), + '1405':('America/Chicago',), + '1406':('America/Denver',), + '1407':('America/New_York',), + '1408':('America/Los_Angeles',), + '1409':('America/Chicago',), + '1410':('America/New_York',), + '1412':('America/New_York',), + '1413':('America/New_York',), + '1414':('America/Chicago',), + '1415':('America/Los_Angeles',), + '1416':('America/Toronto',), + '1417':('America/Chicago',), + '1418':('America/Toronto',), + '1418937':('America/Halifax',), + '1418986':('America/Halifax',), + '1419':('America/New_York',), + '1423':('America/Chicago',), + '1423202':('America/New_York',), + '1423209':('America/New_York',), + '1423217':('America/New_York',), + '1423218':('America/New_York',), + '1423224':('America/New_York',), + '142323':('America/New_York',), + '1423245':('America/New_York',), + '1423246':('America/New_York',), + '1423247':('America/New_York',), + '1423253':('America/New_York',), + '1423254':('America/New_York',), + '1423257':('America/New_York',), + '1423262':('America/New_York',), + '1423263':('America/New_York',), + '1423265':('America/New_York',), + '1423266':('America/New_York',), + '1423267':('America/New_York',), + '1423272':('America/New_York',), + '1423278':('America/New_York',), + '1423279':('America/New_York',), + '1423282':('America/New_York',), + '1423283':('America/New_York',), + '1423286':('America/New_York',), + '1423288':('America/New_York',), + '1423296':('America/New_York',), + '1423305':('America/New_York',), + '1423307':('America/New_York',), + '1423317':('America/New_York',), + '1423318':('America/New_York',), + '1423323':('America/New_York',), + '1423328':('America/New_York',), + '142333':('America/New_York',), + '1423343':('America/New_York',), + '1423344':('America/New_York',), + '1423345':('America/New_York',), + '1423346':('America/New_York',), + '1423349':('America/New_York',), + '1423357':('America/New_York',), + '1423365':('America/New_York',), + '1423378':('America/New_York',), + '1423391':('America/New_York',), + '1423392':('America/New_York',), + '1423396':('America/New_York',), + '1423402':('America/New_York',), + '1423421':('America/New_York',), + '1423422':('America/New_York',), + '1423424':('America/New_York',), + '1423425':('America/New_York',), + '1423431':('America/New_York',), + '1423434':('America/New_York',), + '1423439':('America/New_York',), + '1423442':('America/New_York',), + '1423443':('America/New_York',), + '1423451':('America/New_York',), + '1423453':('America/New_York',), + '1423467':('America/New_York',), + '1423468':('America/New_York',), + '142347':('America/New_York',), + '1423485':('America/New_York',), + '1423487':('America/New_York',), + '142349':('America/New_York',), + '1423503':('America/New_York',), + '1423507':('America/New_York',), + '1423508':('America/New_York',), + '1423510':('America/New_York',), + '1423521':('America/New_York',), + '1423525':('America/New_York',), + '1423531':('America/New_York',), + '1423538':('America/New_York',), + '1423542':('America/New_York',), + '1423543':('America/New_York',), + '1423547':('America/New_York',), + '1423553':('America/New_York',), + '1423559':('America/New_York',), + '1423562':('America/New_York',), + '1423566':('America/New_York',), + '1423569':('America/New_York',), + '1423570':('America/New_York',), + '1423573':('America/New_York',), + '1423578':('America/New_York',), + '1423581':('America/New_York',), + '1423585':('America/New_York',), + '1423586':('America/New_York',), + '1423587':('America/New_York',), + '1423595':('America/New_York',), + '1423602':('America/New_York',), + '1423610':('America/New_York',), + '1423613':('America/New_York',), + '1423614':('America/New_York',), + '142362':('America/New_York',), + '1423631':('America/New_York',), + '1423634':('America/New_York',), + '1423636':('America/New_York',), + '1423638':('America/New_York',), + '1423639':('America/New_York',), + '1423643':('America/New_York',), + '1423648':('America/New_York',), + '1423652':('America/New_York',), + '1423663':('America/New_York',), + '1423664':('America/New_York',), + '1423667':('America/New_York',), + '1423697':('America/New_York',), + '1423698':('America/New_York',), + '1423702':('America/New_York',), + '1423708':('America/New_York',), + '1423710':('America/New_York',), + '1423722':('America/New_York',), + '1423725':('America/New_York',), + '1423727':('America/New_York',), + '1423728':('America/New_York',), + '1423733':('America/New_York',), + '1423735':('America/New_York',), + '1423743':('America/New_York',), + '1423744':('America/New_York',), + '1423745':('America/New_York',), + '1423746':('America/New_York',), + '1423752':('America/New_York',), + '1423753':('America/New_York',), + '1423756':('America/New_York',), + '1423757':('America/New_York',), + '1423760':('America/New_York',), + '1423764':('America/New_York',), + '1423765':('America/New_York',), + '1423768':('America/New_York',), + '1423772':('America/New_York',), + '1423775':('America/New_York',), + '1423778':('America/New_York',), + '1423784':('America/New_York',), + '1423787':('America/New_York',), + '1423788':('America/New_York',), + '1423790':('America/New_York',), + '1423794':('America/New_York',), + '1423798':('America/New_York',), + '1423800':('America/New_York',), + '1423802':('America/New_York',), + '1423803':('America/New_York',), + '1423805':('America/New_York',), + '1423821':('America/New_York',), + '1423822':('America/New_York',), + '1423825':('America/New_York',), + '1423826':('America/New_York',), + '1423839':('America/New_York',), + '1423842':('America/New_York',), + '1423843':('America/New_York',), + '1423844':('America/New_York',), + '1423847':('America/New_York',), + '1423854':('America/New_York',), + '1423855':('America/New_York',), + '1423857':('America/New_York',), + '1423867':('America/New_York',), + '1423869':('America/New_York',), + '1423870':('America/New_York',), + '1423875':('America/New_York',), + '1423876':('America/New_York',), + '1423877':('America/New_York',), + '1423878':('America/New_York',), + '1423884':('America/New_York',), + '1423886':('America/New_York',), + '1423892':('America/New_York',), + '1423893':('America/New_York',), + '1423894':('America/New_York',), + '1423899':('America/New_York',), + '1423907':('America/New_York',), + '1423913':('America/New_York',), + '1423915':('America/New_York',), + '1423921':('America/New_York',), + '1423926':('America/New_York',), + '1423928':('America/New_York',), + '1423929':('America/New_York',), + '1423933':('America/New_York',), + '1423952':('America/New_York',), + '1423954':('America/New_York',), + '1423968':('America/New_York',), + '1423975':('America/New_York',), + '1423979':('America/New_York',), + '1423989':('America/New_York',), + '1424':('America/Los_Angeles',), + '1425':('America/Los_Angeles',), + '1428':('America/Halifax',), + '1430':('America/Chicago',), + '1431':('America/Winnipeg',), + '1432':('America/Chicago',), + '1434':('America/New_York',), + '1435':('America/Denver',), + '1437':('America/Winnipeg',), + '1438':('America/Toronto',), + '1440':('America/New_York',), + '1441':('Atlantic/Bermuda',), + '1442':('America/Los_Angeles',), + '1443':('America/New_York',), + '1445':('America/New_York',), + '1447':('America/Chicago',), + '1448':('America/New_York',), + '1450':('America/Toronto',), + '1458':('America/Los_Angeles',), + '1463':('America/New_York',), + '1464':('America/Chicago',), + '1468':('America/Toronto',), + '1469':('America/Chicago',), + '1470':('America/New_York',), + '1472':('America/New_York',), + '1473':('America/Grenada',), + '1474':('America/Winnipeg',), + '1475':('America/New_York',), + '1478':('America/New_York',), + '1479':('America/Chicago',), + '1480':('America/Phoenix',), + '1484':('America/New_York',), + '1501':('America/Chicago',), + '1502':('America/New_York',), + '1503':('America/Los_Angeles',), + '1504':('America/Chicago',), + '1505':('America/Denver',), + '1506':('America/Halifax',), + '1507':('America/Chicago',), + '1508':('America/New_York',), + '1509':('America/Los_Angeles',), + '1510':('America/Los_Angeles',), + '1512':('America/Chicago',), + '1513':('America/New_York',), + '1514':('America/Toronto',), + '1515':('America/Chicago',), + '1516':('America/New_York',), + '1517':('America/New_York',), + '1518':('America/New_York',), + '1519':('America/Toronto',), + '1520':('America/Phoenix',), + '1530':('America/Los_Angeles',), + '1531':('America/Chicago',), + '1534':('America/Chicago',), + '1539':('America/Chicago',), + '1540':('America/New_York',), + '1541':('America/Los_Angeles',), + '1541372':('America/Denver',), + '1541473':('America/Denver',), + '1541881':('America/Denver',), + '1541889':('America/Denver',), + '1548':('America/Toronto',), + '1551':('America/New_York',), + '1557':('America/Chicago',), + '1559':('America/Los_Angeles',), + '1561':('America/New_York',), + '1562':('America/Los_Angeles',), + '1563':('America/Chicago',), + '1564':('America/Los_Angeles',), + '1567':('America/New_York',), + '1570':('America/New_York',), + '1571':('America/New_York',), + '1572':('America/Chicago',), + '1573':('America/Chicago',), + '1574':('America/New_York',), + '1574772':('America/Chicago',), + '1574896':('America/Chicago',), + '1575':('America/Denver',), + '1579':('America/Toronto',), + '1580':('America/Chicago',), + '1581':('America/Toronto',), + '1582':('America/New_York',), + '1584':('America/Winnipeg',), + '1585':('America/New_York',), + '1586':('America/New_York',), + '1587':('America/Edmonton',), + '1601':('America/Chicago',), + '1602':('America/Phoenix',), + '1603':('America/New_York',), + '1604':('America/Vancouver',), + '1605':('America/Denver', 'America/North_Dakota/Center'), + '1605201':('America/Chicago',), + '1605209':('America/Denver',), + '1605217':('America/Chicago',), + '1605221':('America/Chicago',), + '1605223':('America/Denver',), + '1605224':('America/Chicago',), + '1605225':('America/Chicago',), + '1605226':('America/Chicago',), + '1605229':('America/Chicago',), + '1605232':('America/Chicago',), + '1605234':('America/Chicago',), + '1605255':('America/Denver',), + '1605256':('America/Chicago',), + '1605260':('America/Chicago',), + '1605261':('America/Chicago',), + '1605262':('America/Chicago',), + '1605271':('America/Chicago',), + '1605274':('America/Chicago',), + '1605275':('America/Chicago',), + '1605279':('America/Denver',), + '1605284':('America/Chicago',), + '1605297':('America/Chicago',), + '1605310':('America/Chicago',), + '1605312':('America/Chicago',), + '1605321':('America/Chicago',), + '1605322':('America/Chicago',), + '1605323':('America/Chicago',), + '1605328':('America/Chicago',), + '160533':('America/Chicago',), + '1605341':('America/Denver',), + '1605342':('America/Denver',), + '1605343':('America/Denver',), + '1605345':('America/Chicago',), + '1605347':('America/Denver',), + '1605348':('America/Denver',), + '160535':('America/Chicago',), + '1605355':('America/Denver',), + '160536':('America/Chicago',), + '1605370':('America/Chicago',), + '1605371':('America/Chicago',), + '1605373':('America/Chicago',), + '1605374':('America/Denver',), + '1605376':('America/Chicago',), + '1605381':('America/Denver',), + '1605384':('America/Chicago',), + '1605387':('America/Chicago',), + '1605388':('America/Denver',), + '1605390':('America/Denver',), + '1605391':('America/Denver',), + '1605393':('America/Denver',), + '1605394':('America/Denver',), + '1605397':('America/Chicago',), + '1605399':('America/Denver',), + '1605415':('America/Denver',), + '1605425':('America/Chicago',), + '1605426':('America/Chicago',), + '1605428':('America/Chicago',), + '1605430':('America/Denver',), + '1605431':('America/Denver',), + '1605432':('America/Chicago',), + '1605448':('America/Chicago',), + '1605455':('America/Denver',), + '1605472':('America/Chicago',), + '1605484':('America/Denver',), + '1605487':('America/Chicago',), + '1605498':('America/Chicago',), + '1605528':('America/Chicago',), + '1605532':('America/Chicago',), + '1605539':('America/Chicago',), + '1605543':('America/Chicago',), + '1605553':('America/Chicago',), + '1605574':('America/Denver',), + '1605578':('America/Denver',), + '1605582':('America/Chicago',), + '1605584':('America/Denver',), + '1605589':('America/Chicago',), + '1605593':('America/Denver',), + '1605594':('America/Chicago',), + '1605598':('America/Chicago',), + '1605610':('America/Chicago',), + '1605622':('America/Chicago',), + '1605624':('America/Chicago',), + '1605626':('America/Chicago',), + '1605627':('America/Chicago',), + '1605641':('America/Denver',), + '1605642':('America/Denver',), + '1605644':('America/Denver',), + '1605647':('America/Chicago',), + '1605649':('America/Chicago',), + '1605665':('America/Chicago',), + '1605666':('America/Denver',), + '1605668':('America/Chicago',), + '1605669':('America/Chicago',), + '1605673':('America/Denver',), + '1605677':('America/Chicago',), + '1605685':('America/Denver',), + '160569':('America/Chicago',), + '1605716':('America/Denver',), + '1605717':('America/Denver',), + '1605718':('America/Denver',), + '1605719':('America/Denver',), + '1605720':('America/Denver',), + '1605721':('America/Denver',), + '1605722':('America/Denver',), + '1605723':('America/Denver',), + '1605724':('America/Chicago',), + '1605725':('America/Chicago',), + '1605728':('America/Chicago',), + '1605734':('America/Chicago',), + '1605743':('America/Chicago',), + '1605745':('America/Denver',), + '1605747':('America/Chicago',), + '1605753':('America/Chicago',), + '1605755':('America/Denver',), + '1605759':('America/Chicago',), + '1605763':('America/Chicago',), + '1605765':('America/Chicago',), + '1605772':('America/Chicago',), + '1605773':('America/Chicago',), + '1605775':('America/Chicago',), + '1605778':('America/Chicago',), + '1605787':('America/Denver',), + '1605791':('America/Denver',), + '1605796':('America/Chicago',), + '1605823':('America/Denver',), + '1605835':('America/Chicago',), + '1605837':('America/Denver',), + '1605842':('America/Chicago',), + '1605845':('America/Chicago',), + '1605852':('America/Chicago',), + '1605853':('America/Chicago',), + '1605854':('America/Chicago',), + '1605856':('America/Chicago',), + '1605859':('America/Denver',), + '1605867':('America/Denver',), + '1605874':('America/Chicago',), + '1605878':('America/Chicago',), + '1605881':('America/Chicago',), + '1605882':('America/Chicago',), + '1605886':('America/Chicago',), + '1605892':('America/Denver',), + '1605923':('America/Denver',), + '1605925':('America/Chicago',), + '1605928':('America/Chicago',), + '1605929':('America/Chicago',), + '1605940':('America/Chicago',), + '1605941':('America/Chicago',), + '1605945':('America/Chicago',), + '1605946':('America/Chicago',), + '1605951':('America/Chicago',), + '1605964':('America/Denver',), + '1605977':('America/Chicago',), + '1605983':('America/Chicago',), + '1605987':('America/Chicago',), + '1605988':('America/Chicago',), + '1605990':('America/Chicago',), + '1605995':('America/Chicago',), + '1605996':('America/Chicago',), + '1605997':('America/Chicago',), + '1606':('America/New_York',), + '1606387':('America/Chicago',), + '1607':('America/New_York',), + '1608':('America/Chicago',), + '1609':('America/New_York',), + '1610':('America/New_York',), + '1612':('America/Chicago',), + '1613':('America/Toronto',), + '1614':('America/New_York',), + '1615':('America/Chicago',), + '1616':('America/New_York',), + '1617':('America/New_York',), + '1618':('America/Chicago',), + '1619':('America/Los_Angeles',), + '1620':('America/Chicago',), + '1620376':('America/Denver',), + '1620384':('America/Denver',), + '1623':('America/Phoenix',), + '1626':('America/Los_Angeles',), + '1628':('America/Los_Angeles',), + '1629':('America/Chicago',), + '1630':('America/Chicago',), + '1631':('America/New_York',), + '1636':('America/Chicago',), + '1639':('America/Regina',), + '1640':('America/New_York',), + '1641':('America/Chicago',), + '1645':('America/New_York',), + '1646':('America/New_York',), + '1647':('America/Toronto',), + '1649':('America/Grand_Turk',), + '1650':('America/Los_Angeles',), + '1651':('America/Chicago',), + '1656':('America/New_York',), + '1657':('America/Los_Angeles',), + '1658':('America/Jamaica',), + '1659':('America/Chicago',), + '1660':('America/Chicago',), + '1661':('America/Los_Angeles',), + '1662':('America/Chicago',), + '1664':('America/Montserrat',), + '1667':('America/New_York',), + '1669':('America/Los_Angeles',), + '1670':('Pacific/Saipan',), + '1671':('Pacific/Guam',), + '1672':('America/Vancouver',), + '1678':('America/New_York',), + '1680':('America/New_York',), + '1681':('America/New_York',), + '1682':('America/Chicago',), + '1683':('America/Toronto',), + '1684':('Pacific/Pago_Pago',), + '1689':('America/Chicago',), + '1701':('America/Denver', 'America/North_Dakota/Center'), + '1701200':('America/Chicago',), + '1701205':('America/Chicago',), + '1701212':('America/Chicago',), + '1701214':('America/Chicago',), + '170122':('America/Chicago',), + '1701225':('America/Denver',), + '1701227':('America/Denver',), + '170123':('America/Chicago',), + '1701241':('America/Chicago',), + '1701242':('America/Chicago',), + '170125':('America/Chicago',), + '1701261':('America/Chicago',), + '1701265':('America/Chicago',), + '1701271':('America/Chicago',), + '1701277':('America/Chicago',), + '1701280':('America/Chicago',), + '1701281':('America/Chicago',), + '1701282':('America/Chicago',), + '1701284':('America/Chicago',), + '1701288':('America/Chicago',), + '1701290':('America/Denver',), + '1701293':('America/Chicago',), + '1701297':('America/Chicago',), + '1701298':('America/Chicago',), + '1701306':('America/Chicago',), + '1701323':('America/Chicago',), + '1701324':('America/Chicago',), + '1701328':('America/Chicago',), + '1701343':('America/Chicago',), + '1701347':('America/Chicago',), + '1701349':('America/Chicago',), + '1701352':('America/Chicago',), + '1701355':('America/Chicago',), + '1701356':('America/Chicago',), + '1701361':('America/Chicago',), + '1701364':('America/Chicago',), + '1701365':('America/Chicago',), + '1701367':('America/Chicago',), + '1701371':('America/Chicago',), + '1701373':('America/Chicago',), + '1701385':('America/Chicago',), + '1701388':('America/Chicago',), + '1701390':('America/Chicago',), + '1701391':('America/Chicago',), + '1701400':('America/Chicago',), + '1701425':('America/Chicago',), + '1701426':('America/Chicago',), + '1701428':('America/Chicago',), + '1701437':('America/Chicago',), + '1701444':('America/Chicago',), + '1701446':('America/Chicago',), + '1701448':('America/Chicago',), + '1701452':('America/Chicago',), + '1701454':('America/Chicago',), + '1701456':('America/Denver',), + '1701462':('America/Chicago',), + '1701463':('America/Chicago',), + '1701471':('America/Chicago',), + '1701476':('America/Chicago',), + '1701477':('America/Chicago',), + '1701478':('America/Chicago',), + '1701483':('America/Denver',), + '1701492':('America/Chicago',), + '1701499':('America/Chicago',), + '1701523':('America/Denver',), + '1701527':('America/Chicago',), + '1701530':('America/Chicago',), + '1701532':('America/Chicago',), + '1701540':('America/Chicago',), + '1701549':('America/Chicago',), + '1701566':('America/Chicago',), + '1701567':('America/Denver',), + '1701572':('America/Chicago',), + '1701575':('America/Denver',), + '1701577':('America/Chicago',), + '1701584':('America/Denver',), + '1701595':('America/Chicago',), + '1701609':('America/Chicago',), + '1701623':('America/Denver',), + '1701627':('America/Chicago',), + '1701628':('America/Chicago',), + '1701636':('America/Chicago',), + '1701642':('America/Chicago',), + '1701652':('America/Chicago',), + '1701662':('America/Chicago',), + '1701663':('America/Chicago',), + '1701664':('America/Chicago',), + '1701667':('America/Chicago',), + '1701683':('America/Chicago',), + '1701724':('America/Chicago',), + '1701730':('America/Chicago',), + '1701738':('America/Chicago',), + '1701739':('America/Chicago',), + '1701742':('America/Chicago',), + '1701746':('America/Chicago',), + '1701748':('America/Chicago',), + '1701751':('America/Chicago',), + '1701754':('America/Chicago',), + '1701756':('America/Chicago',), + '1701757':('America/Chicago',), + '1701764':('America/Denver',), + '1701766':('America/Chicago',), + '1701772':('America/Chicago',), + '1701774':('America/Chicago',), + '1701775':('America/Chicago',), + '1701776':('America/Chicago',), + '1701777':('America/Chicago',), + '1701780':('America/Chicago',), + '1701786':('America/Chicago',), + '1701787':('America/Chicago',), + '1701788':('America/Chicago',), + '1701793':('America/Chicago',), + '1701795':('America/Chicago',), + '1701797':('America/Chicago',), + '1701799':('America/Chicago',), + '1701824':('America/Denver',), + '1701833':('America/Chicago',), + '1701837':('America/Chicago',), + '1701838':('America/Chicago',), + '1701839':('America/Chicago',), + '1701842':('America/Chicago',), + '1701843':('America/Chicago',), + '1701845':('America/Chicago',), + '1701852':('America/Chicago',), + '1701854':('America/Chicago',), + '1701857':('America/Chicago',), + '1701858':('America/Chicago',), + '1701866':('America/Chicago',), + '1701872':('America/Denver',), + '1701873':('America/Chicago',), + '1701883':('America/Chicago',), + '1701893':('America/Chicago',), + '1701947':('America/Chicago',), + '1701952':('America/Chicago',), + '1701965':('America/Chicago',), + '1701968':('America/Chicago',), + '1702':('America/Los_Angeles',), + '1703':('America/New_York',), + '1704':('America/New_York',), + '1705':('America/Toronto',), + '1706':('America/New_York',), + '1707':('America/Los_Angeles',), + '1708':('America/Chicago',), + '1709':('America/Puerto_Rico', 'America/St_Johns'), + '1709227':('America/St_Johns',), + '1709229':('America/St_Johns',), + '1709237':('America/St_Johns',), + '1709256':('America/St_Johns',), + '1709257':('America/St_Johns',), + '1709279':('America/St_Johns',), + '1709282':('America/Halifax',), + '1709364':('America/St_Johns',), + '1709368':('America/St_Johns',), + '1709437':('America/St_Johns',), + '1709454':('America/St_Johns',), + '1709458':('America/St_Johns',), + '1709466':('America/St_Johns',), + '1709468':('America/St_Johns',), + '1709489':('America/St_Johns',), + '1709533':('America/St_Johns',), + '1709535':('America/St_Johns',), + '1709576':('America/St_Johns',), + '1709579':('America/St_Johns',), + '1709596':('America/St_Johns',), + '1709634':('America/St_Johns',), + '1709635':('America/St_Johns',), + '1709637':('America/St_Johns',), + '1709639':('America/St_Johns',), + '1709643':('America/St_Johns',), + '1709651':('America/St_Johns',), + '1709673':('America/St_Johns',), + '1709682':('America/St_Johns',), + '1709685':('America/St_Johns',), + '1709687':('America/St_Johns',), + '1709695':('America/St_Johns',), + '1709722':('America/St_Johns',), + '1709726':('America/St_Johns',), + '1709729':('America/St_Johns',), + '1709738':('America/St_Johns',), + '1709739':('America/St_Johns',), + '1709745':('America/St_Johns',), + '1709747':('America/St_Johns',), + '1709753':('America/St_Johns',), + '1709754':('America/St_Johns',), + '1709757':('America/St_Johns',), + '1709758':('America/St_Johns',), + '1709759':('America/St_Johns',), + '1709782':('America/St_Johns',), + '1709786':('America/St_Johns',), + '1709832':('America/St_Johns',), + '1709834':('America/St_Johns',), + '1709884':('America/St_Johns',), + '1709895':('America/St_Johns',), + '1709896':('America/Halifax',), + '1709944':('America/Halifax',), + '1712':('America/Chicago',), + '1713':('America/Chicago',), + '1714':('America/Los_Angeles',), + '1715':('America/Chicago',), + '1716':('America/New_York',), + '1717':('America/New_York',), + '1718':('America/New_York',), + '1719':('America/Denver',), + '1720':('America/Denver',), + '1721':('America/Lower_Princes',), + '1724':('America/New_York',), + '1725':('America/Los_Angeles',), + '1726':('America/Chicago',), + '1727':('America/New_York',), + '1728':('America/New_York',), + '1730':('America/Chicago',), + '1731':('America/Chicago',), + '1732':('America/New_York',), + '1734':('America/New_York',), + '1737':('America/Chicago',), + '1740':('America/New_York',), + '1742':('America/Toronto',), + '1743':('America/New_York',), + '1747':('America/Los_Angeles',), + '1748':('America/Denver',), + '1753':('America/Toronto',), + '1754':('America/New_York',), + '1757':('America/New_York',), + '1758':('America/St_Lucia',), + '1760':('America/Los_Angeles',), + '1762':('America/New_York',), + '1763':('America/Chicago',), + '1765':('America/New_York',), + '1767':('America/Dominica',), + '1769':('America/Chicago',), + '1770':('America/New_York',), + '1771':('America/New_York',), + '1772':('America/New_York',), + '1773':('America/Chicago',), + '1774':('America/New_York',), + '1775':('America/Boise', 'America/Los_Angeles'), + '1775200':('America/Los_Angeles',), + '1775230':('America/Los_Angeles',), + '1775232':('America/Los_Angeles',), + '1775233':('America/Los_Angeles',), + '1775237':('America/Los_Angeles',), + '1775240':('America/Los_Angeles',), + '1775246':('America/Los_Angeles',), + '1775250':('America/Los_Angeles',), + '1775265':('America/Los_Angeles',), + '1775267':('America/Los_Angeles',), + '1775273':('America/Los_Angeles',), + '1775284':('America/Los_Angeles',), + '1775287':('America/Los_Angeles',), + '1775289':('America/Los_Angeles',), + '1775298':('America/Los_Angeles',), + '1775313':('America/Los_Angeles',), + '177532':('America/Los_Angeles',), + '177533':('America/Los_Angeles',), + '1775345':('America/Los_Angeles',), + '1775348':('America/Los_Angeles',), + '177535':('America/Los_Angeles',), + '1775360':('America/Los_Angeles',), + '1775376':('America/Los_Angeles',), + '1775384':('America/Los_Angeles',), + '1775391':('America/Los_Angeles',), + '1775392':('America/Los_Angeles',), + '1775423':('America/Los_Angeles',), + '1775424':('America/Los_Angeles',), + '1775425':('America/Los_Angeles',), + '1775428':('America/Los_Angeles',), + '1775432':('America/Los_Angeles',), + '1775445':('America/Los_Angeles',), + '1775450':('America/Los_Angeles',), + '1775453':('America/Los_Angeles',), + '1775461':('America/Los_Angeles',), + '1775463':('America/Los_Angeles',), + '1775470':('America/Los_Angeles',), + '1775473':('America/Los_Angeles',), + '1775482':('America/Los_Angeles',), + '1775525':('America/Los_Angeles',), + '1775537':('America/Los_Angeles',), + '1775544':('America/Los_Angeles',), + '1775575':('America/Los_Angeles',), + '1775577':('America/Los_Angeles',), + '1775586':('America/Los_Angeles',), + '1775588':('America/Los_Angeles',), + '1775622':('America/Los_Angeles',), + '1775623':('America/Los_Angeles',), + '1775624':('America/Los_Angeles',), + '1775625':('America/Los_Angeles',), + '1775626':('America/Los_Angeles',), + '1775635':('America/Los_Angeles',), + '1775636':('America/Los_Angeles',), + '1775657':('America/Los_Angeles',), + '1775664':('America/Denver',), + '1775673':('America/Los_Angeles',), + '1775674':('America/Los_Angeles',), + '1775677':('America/Los_Angeles',), + '1775684':('America/Los_Angeles',), + '1775686':('America/Los_Angeles',), + '1775687':('America/Los_Angeles',), + '1775688':('America/Los_Angeles',), + '1775689':('America/Los_Angeles',), + '1775720':('America/Los_Angeles',), + '1775721':('America/Los_Angeles',), + '1775722':('America/Los_Angeles',), + '1775726':('America/Los_Angeles',), + '1775727':('America/Los_Angeles',), + '1775737':('America/Los_Angeles',), + '1775738':('America/Los_Angeles',), + '1775742':('America/Los_Angeles',), + '1775746':('America/Los_Angeles',), + '1775747':('America/Los_Angeles',), + '1775750':('America/Los_Angeles',), + '1775751':('America/Los_Angeles',), + '1775752':('America/Los_Angeles',), + '1775753':('America/Los_Angeles',), + '1775762':('America/Los_Angeles',), + '1775770':('America/Los_Angeles',), + '1775771':('America/Los_Angeles',), + '1775772':('America/Los_Angeles',), + '1775777':('America/Los_Angeles',), + '1775778':('America/Los_Angeles',), + '1775782':('America/Los_Angeles',), + '1775783':('America/Los_Angeles',), + '1775784':('America/Los_Angeles',), + '1775786':('America/Los_Angeles',), + '1775787':('America/Los_Angeles',), + '1775800':('America/Los_Angeles',), + '177582':('America/Los_Angeles',), + '1775830':('America/Los_Angeles',), + '1775831':('America/Los_Angeles',), + '1775832':('America/Los_Angeles',), + '1775833':('America/Los_Angeles',), + '1775835':('America/Los_Angeles',), + '1775841':('America/Los_Angeles',), + '1775843':('America/Los_Angeles',), + '1775847':('America/Los_Angeles',), + '1775849':('America/Los_Angeles',), + '177585':('America/Los_Angeles',), + '1775867':('America/Los_Angeles',), + '1775870':('America/Los_Angeles',), + '177588':('America/Los_Angeles',), + '1775945':('America/Los_Angeles',), + '1775971':('America/Los_Angeles',), + '1775972':('America/Los_Angeles',), + '1775982':('America/Los_Angeles',), + '1778':('America/Vancouver',), + '1779':('America/Chicago',), + '1780':('America/Edmonton',), + '1781':('America/New_York',), + '1782':('America/Halifax',), + '1784':('America/St_Vincent',), + '1785':('America/Chicago',), + '1785852':('America/Denver',), + '1785890':('America/Denver',), + '1785899':('America/Denver',), + '1786':('America/New_York',), + '1787':('America/Puerto_Rico',), + '1801':('America/Denver',), + '1802':('America/New_York',), + '1803':('America/New_York',), + '1804':('America/New_York',), + '1805':('America/Los_Angeles',), + '1806':('America/Chicago',), + '1807':('America/Toronto',), + '1807223':('America/Winnipeg',), + '1807274':('America/Winnipeg',), + '1807467':('America/Winnipeg',), + '1807468':('America/Winnipeg',), + '1807482':('America/Winnipeg',), + '1807548':('America/Winnipeg',), + '1807727':('America/Winnipeg',), + '1807737':('America/Winnipeg',), + '1807934':('America/Winnipeg',), + '1808':('Pacific/Honolulu',), + '1809':('America/Santo_Domingo',), + '1810':('America/New_York',), + '1812':('America/New_York',), + '1812385':('America/Chicago',), + '1812386':('America/Chicago',), + '1812401':('America/Chicago',), + '1812402':('America/Chicago',), + '181242':('America/Chicago',), + '1812435':('America/Chicago',), + '1812437':('America/Chicago',), + '1812450':('America/Chicago',), + '1812464':('America/Chicago',), + '181247':('America/Chicago',), + '1812485':('America/Chicago',), + '1812490':('America/Chicago',), + '1812491':('America/Chicago',), + '1812547':('America/Chicago',), + '1812618':('America/Chicago',), + '1812649':('America/Chicago',), + '1812682':('America/Chicago',), + '1812749':('America/Chicago',), + '1812753':('America/Chicago',), + '1812768':('America/Chicago',), + '1812838':('America/Chicago',), + '1812842':('America/Chicago',), + '1812853':('America/Chicago',), + '1812858':('America/Chicago',), + '1812867':('America/Chicago',), + '1812874':('America/Chicago',), + '1812897':('America/Chicago',), + '1812925':('America/Chicago',), + '1812937':('America/Chicago',), + '1812962':('America/Chicago',), + '1812963':('America/Chicago',), + '1812985':('America/Chicago',), + '1813':('America/New_York',), + '1814':('America/New_York',), + '1815':('America/Chicago',), + '1816':('America/Chicago',), + '1817':('America/Chicago',), + '1818':('America/Los_Angeles',), + '1819':('America/Toronto',), + '1820':('America/Los_Angeles',), + '1821':('America/New_York',), + '1825':('America/Edmonton',), + '1826':('America/New_York',), + '1828':('America/New_York',), + '1829':('America/Santo_Domingo',), + '1830':('America/Chicago',), + '1831':('America/Los_Angeles',), + '1832':('America/Chicago',), + '1835':('America/New_York',), + '1838':('America/New_York',), + '1839':('America/New_York',), + '1840':('America/Los_Angeles',), + '1843':('America/New_York',), + '1845':('America/New_York',), + '1847':('America/Chicago',), + '1848':('America/New_York',), + '1849':('America/Santo_Domingo',), + '1850':('America/New_York',), + '1850200':('America/Chicago',), + '1850206':('America/Chicago',), + '1850208':('America/Chicago',), + '1850213':('America/Chicago',), + '1850215':('America/Chicago',), + '1850217':('America/Chicago',), + '1850218':('America/Chicago',), + '1850221':('America/Chicago',), + '1850225':('America/Chicago',), + '1850226':('America/Chicago',), + '1850227':('America/Chicago',), + '1850229':('America/Chicago',), + '185023':('America/Chicago',), + '1850240':('America/Chicago',), + '1850243':('America/Chicago',), + '1850244':('America/Chicago',), + '1850248':('America/Chicago',), + '1850249':('America/Chicago',), + '1850250':('America/Chicago',), + '1850256':('America/Chicago',), + '1850258':('America/Chicago',), + '1850259':('America/Chicago',), + '1850261':('America/Chicago',), + '1850263':('America/Chicago',), + '1850265':('America/Chicago',), + '1850267':('America/Chicago',), + '1850269':('America/Chicago',), + '1850271':('America/Chicago',), + '1850276':('America/Chicago',), + '1850279':('America/Chicago',), + '1850291':('America/Chicago',), + '1850292':('America/Chicago',), + '1850301':('America/Chicago',), + '1850306':('America/Chicago',), + '1850314':('America/Chicago',), + '1850315':('America/Chicago',), + '1850319':('America/Chicago',), + '1850324':('America/Chicago',), + '1850327':('America/Chicago',), + '1850332':('America/Chicago',), + '1850341':('America/Chicago',), + '1850361':('America/Chicago',), + '1850362':('America/Chicago',), + '1850368':('America/Chicago',), + '1850376':('America/Chicago',), + '1850377':('America/Chicago',), + '1850380':('America/Chicago',), + '1850384':('America/Chicago',), + '1850387':('America/Chicago',), + '1850393':('America/Chicago',), + '1850396':('America/Chicago',), + '1850398':('America/Chicago',), + '1850416':('America/Chicago',), + '1850417':('America/Chicago',), + '1850420':('America/Chicago',), + '1850423':('America/Chicago',), + '1850424':('America/Chicago',), + '1850429':('America/Chicago',), + '185043':('America/Chicago',), + '1850444':('America/Chicago',), + '185045':('America/Chicago',), + '1850460':('America/Chicago',), + '1850462':('America/Chicago',), + '1850466':('America/Chicago',), + '1850469':('America/Chicago',), + '185047':('America/Chicago',), + '1850481':('America/Chicago',), + '1850482':('America/Chicago',), + '1850484':('America/Chicago',), + '1850492':('America/Chicago',), + '1850494':('America/Chicago',), + '1850496':('America/Chicago',), + '1850497':('America/Chicago',), + '1850499':('America/Chicago',), + '1850501':('America/Chicago',), + '1850502':('America/Chicago',), + '1850505':('America/Chicago',), + '1850516':('America/Chicago',), + '1850522':('America/Chicago',), + '1850525':('America/Chicago',), + '1850526':('America/Chicago',), + '1850527':('America/Chicago',), + '1850529':('America/Chicago',), + '1850535':('America/Chicago',), + '1850537':('America/Chicago',), + '1850543':('America/Chicago',), + '1850547':('America/Chicago',), + '1850572':('America/Chicago',), + '1850581':('America/Chicago',), + '1850585':('America/Chicago',), + '1850586':('America/Chicago',), + '1850587':('America/Chicago',), + '1850588':('America/Chicago',), + '1850592':('America/Chicago',), + '1850593':('America/Chicago',), + '1850595':('America/Chicago',), + '1850596':('America/Chicago',), + '1850607':('America/Chicago',), + '1850622':('America/Chicago',), + '1850623':('America/Chicago',), + '1850624':('America/Chicago',), + '1850626':('America/Chicago',), + '1850637':('America/Chicago',), + '1850638':('America/Chicago',), + '1850639':('America/Chicago',), + '1850640':('America/Chicago',), + '1850650':('America/Chicago',), + '1850651':('America/Chicago',), + '1850654':('America/Chicago',), + '1850659':('America/Chicago',), + '1850664':('America/Chicago',), + '1850674':('America/Chicago',), + '1850675':('America/Chicago',), + '1850677':('America/Chicago',), + '1850678':('America/Chicago',), + '185068':('America/Chicago',), + '1850696':('America/Chicago',), + '1850699':('America/Chicago',), + '1850708':('America/Chicago',), + '1850712':('America/Chicago',), + '1850722':('America/Chicago',), + '1850723':('America/Chicago',), + '1850729':('America/Chicago',), + '1850733':('America/Chicago',), + '1850747':('America/Chicago',), + '1850748':('America/Chicago',), + '1850763':('America/Chicago',), + '1850769':('America/Chicago',), + '1850784':('America/Chicago',), + '1850785':('America/Chicago',), + '1850791':('America/Chicago',), + '1850796':('America/Chicago',), + '1850797':('America/Chicago',), + '1850814':('America/Chicago',), + '1850819':('America/Chicago',), + '1850830':('America/Chicago',), + '1850832':('America/Chicago',), + '1850833':('America/Chicago',), + '1850835':('America/Chicago',), + '1850837':('America/Chicago',), + '1850855':('America/Chicago',), + '1850857':('America/Chicago',), + '185086':('America/Chicago',), + '1850871':('America/Chicago',), + '1850872':('America/Chicago',), + '1850874':('America/Chicago',), + '1850883':('America/Chicago',), + '1850890':('America/Chicago',), + '1850892':('America/Chicago',), + '1850897':('America/Chicago',), + '1850898':('America/Chicago',), + '1850912':('America/Chicago',), + '1850913':('America/Chicago',), + '1850914':('America/Chicago',), + '1850916':('America/Chicago',), + '1850932':('America/Chicago',), + '1850934':('America/Chicago',), + '1850936':('America/Chicago',), + '1850937':('America/Chicago',), + '1850939':('America/Chicago',), + '1850941':('America/Chicago',), + '1850944':('America/Chicago',), + '1850951':('America/Chicago',), + '1850968':('America/Chicago',), + '1850969':('America/Chicago',), + '1850972':('America/Chicago',), + '1850974':('America/Chicago',), + '1850981':('America/Chicago',), + '1850982':('America/Chicago',), + '1850983':('America/Chicago',), + '1850994':('America/Chicago',), + '1850995':('America/Chicago',), + '1854':('America/New_York',), + '1856':('America/New_York',), + '1857':('America/New_York',), + '1858':('America/Los_Angeles',), + '1859':('America/New_York',), + '1860':('America/New_York',), + '1862':('America/New_York',), + '1863':('America/New_York',), + '1864':('America/New_York',), + '1865':('America/New_York',), + '1867':('America/Fort_Nelson',), + '1867334':('America/Vancouver',), + '1867393':('America/Vancouver',), + '1867456':('America/Vancouver',), + '1867536':('America/Vancouver',), + '1867587':('America/Edmonton',), + '1867633':('America/Vancouver',), + '1867645':('America/Winnipeg',), + '1867667':('America/Vancouver',), + '1867668':('America/Vancouver',), + '1867669':('America/Edmonton',), + '1867695':('America/Edmonton',), + '1867777':('America/Edmonton',), + '1867872':('America/Edmonton',), + '1867873':('America/Edmonton',), + '1867874':('America/Edmonton',), + '1867920':('America/Edmonton',), + '1867979':('America/Toronto',), + '1867983':('America/Edmonton',), + '1867993':('America/Vancouver',), + '1868':('America/Port_of_Spain',), + '1869':('America/St_Kitts',), + '1870':('America/Chicago',), + '1872':('America/Chicago',), + '1873':('America/Toronto',), + '1876':('America/Jamaica',), + '1878':('America/New_York',), + '1879':('America/Puerto_Rico', 'America/St_Johns'), + '1901':('America/Chicago',), + '1902':('America/Halifax',), + '1903':('America/Chicago',), + '1904':('America/New_York',), + '1905':('America/Toronto',), + '1906':('America/New_York',), + '1906265':('America/Chicago',), + '1906563':('America/Chicago',), + '1906663':('America/Chicago',), + '1906753':('America/Chicago',), + '1906774':('America/Chicago',), + '1906776':('America/Chicago',), + '1906779':('America/Chicago',), + '1906828':('America/Chicago',), + '1906863':('America/Chicago',), + '1906864':('America/Chicago',), + '1906875':('America/Chicago',), + '1906932':('America/Chicago',), + '1907':('America/Adak', 'America/Anchorage'), + '1907209':('America/Juneau',), + '1907212':('America/Juneau',), + '190722':('America/Juneau',), + '1907230':('America/Juneau',), + '1907232':('America/Juneau',), + '1907235':('America/Juneau',), + '190724':('America/Juneau',), + '1907250':('America/Juneau',), + '1907252':('America/Juneau',), + '1907257':('America/Juneau',), + '1907258':('America/Juneau',), + '1907260':('America/Juneau',), + '1907262':('America/Juneau',), + '1907264':('America/Juneau',), + '1907269':('America/Juneau',), + '190727':('America/Juneau',), + '1907283':('America/Juneau',), + '1907299':('America/Juneau',), + '1907301':('America/Juneau',), + '1907306':('America/Juneau',), + '1907317':('America/Juneau',), + '190733':('America/Juneau',), + '1907343':('America/Juneau',), + '1907344':('America/Juneau',), + '1907345':('America/Juneau',), + '1907346':('America/Juneau',), + '1907349':('America/Juneau',), + '1907350':('America/Juneau',), + '1907351':('America/Juneau',), + '1907352':('America/Juneau',), + '1907357':('America/Juneau',), + '1907360':('America/Juneau',), + '1907373':('America/Juneau',), + '1907374':('America/Juneau',), + '1907375':('America/Juneau',), + '1907376':('America/Juneau',), + '1907378':('America/Juneau',), + '1907388':('America/Juneau',), + '1907424':('America/Juneau',), + '1907442':('America/Juneau',), + '1907443':('America/Juneau',), + '190745':('America/Juneau',), + '1907463':('America/Juneau',), + '1907465':('America/Juneau',), + '1907474':('America/Juneau',), + '1907479':('America/Juneau',), + '1907486':('America/Juneau',), + '1907487':('America/Juneau',), + '1907488':('America/Juneau',), + '1907490':('America/Juneau',), + '1907495':('America/Juneau',), + '1907522':('America/Juneau',), + '1907523':('America/Juneau',), + '1907543':('America/Juneau',), + '1907561':('America/Juneau',), + '1907562':('America/Juneau',), + '1907563':('America/Juneau',), + '1907567':('America/Juneau',), + '1907569':('America/Juneau',), + '1907580':('America/Juneau',), + '1907581':('Pacific/Honolulu',), + '1907586':('America/Juneau',), + '1907622':('America/Juneau',), + '1907631':('America/Juneau',), + '1907644':('America/Juneau',), + '1907646':('America/Juneau',), + '1907677':('America/Juneau',), + '1907683':('America/Juneau',), + '1907688':('America/Juneau',), + '1907694':('America/Juneau',), + '1907696':('America/Juneau',), + '1907714':('America/Juneau',), + '1907723':('America/Juneau',), + '1907727':('America/Juneau',), + '1907729':('America/Juneau',), + '1907733':('America/Juneau',), + '1907742':('America/Juneau',), + '1907743':('America/Juneau',), + '1907745':('America/Juneau',), + '1907746':('America/Juneau',), + '1907747':('America/Juneau',), + '1907766':('America/Juneau',), + '1907770':('America/Juneau',), + '1907772':('America/Juneau',), + '1907776':('America/Juneau',), + '1907780':('America/Juneau',), + '1907783':('America/Juneau',), + '1907786':('America/Juneau',), + '1907789':('America/Juneau',), + '1907790':('America/Juneau',), + '1907822':('America/Juneau',), + '1907826':('America/Juneau',), + '1907830':('America/Juneau',), + '1907835':('America/Juneau',), + '1907841':('America/Juneau',), + '1907842':('America/Juneau',), + '1907852':('America/Juneau',), + '1907868':('America/Juneau',), + '1907874':('America/Juneau',), + '1907883':('America/Juneau',), + '1907892':('America/Juneau',), + '1907895':('America/Juneau',), + '1907929':('America/Juneau',), + '1907966':('America/Juneau',), + '1907983':('America/Juneau',), + '1908':('America/New_York',), + '1909':('America/Los_Angeles',), + '1910':('America/New_York',), + '1912':('America/New_York',), + '1913':('America/Chicago',), + '1914':('America/New_York',), + '1915':('America/Denver',), + '1916':('America/Los_Angeles',), + '1917':('America/New_York',), + '1918':('America/Chicago',), + '1919':('America/New_York',), + '1920':('America/Chicago',), + '1925':('America/Los_Angeles',), + '1928':('America/Phoenix',), + '1928283':('America/Denver', 'America/Phoenix'), + '1928672':('America/Denver', 'America/Phoenix'), + '1928673':('America/Denver', 'America/Phoenix'), + '1928674':('America/Denver', 'America/Phoenix'), + '1928677':('America/Denver', 'America/Phoenix'), + '1928686':('America/Denver', 'America/Phoenix'), + '1928697':('America/Denver', 'America/Phoenix'), + '1928698':('America/Denver', 'America/Phoenix'), + '1928724':('America/Denver', 'America/Phoenix'), + '1928725':('America/Denver', 'America/Phoenix'), + '1928728':('America/Denver', 'America/Phoenix'), + '1928729':('America/Denver', 'America/Phoenix'), + '1928755':('America/Denver', 'America/Phoenix'), + '1928781':('America/Denver', 'America/Phoenix'), + '1928787':('America/Denver', 'America/Phoenix'), + '1928871':('America/Denver', 'America/Phoenix'), + '1929':('America/New_York',), + '1930':('America/New_York',), + '1931':('America/Chicago',), + '1934':('America/New_York',), + '1936':('America/Chicago',), + '1937':('America/New_York',), + '1938':('America/Chicago',), + '1939':('America/Puerto_Rico',), + '1940':('America/Chicago',), + '1941':('America/New_York',), + '1942':('America/Toronto',), + '1943':('America/New_York',), + '1945':('America/Chicago',), + '1947':('America/New_York',), + '1948':('America/New_York',), + '1949':('America/Los_Angeles',), + '1951':('America/Los_Angeles',), + '1952':('America/Chicago',), + '1954':('America/New_York',), + '1956':('America/Chicago',), + '1959':('America/New_York',), + '1970':('America/Denver',), + '1971':('America/Los_Angeles',), + '1972':('America/Chicago',), + '1973':('America/New_York',), + '1975':('America/Chicago',), + '1978':('America/New_York',), + '1979':('America/Chicago',), + '1980':('America/New_York',), + '1983':('America/Denver',), + '1984':('America/New_York',), + '1985':('America/Chicago',), + '1986':('America/Boise', 'America/Los_Angeles'), + '1989':('America/New_York',), + '20':('Africa/Cairo',), + '211':('Africa/Nairobi',), + '212':('Atlantic/Canary',), + '213':('Europe/Paris',), + '216':('Africa/Tunis',), + '218':('Europe/Bucharest',), + '220':('Africa/Banjul',), + '221':('Africa/Dakar',), + '222':('Africa/Nouakchott',), + '223':('Africa/Bamako',), + '224':('Africa/Conakry',), + '225':('Africa/Abidjan',), + '226':('Africa/Ouagadougou',), + '227':('Africa/Niamey',), + '228':('Africa/Lome',), + '229':('Africa/Porto-Novo',), + '230':('Indian/Mauritius',), + '231':('Atlantic/Reykjavik',), + '232':('Africa/Freetown',), + '233':('Africa/Accra',), + '234':('Africa/Lagos',), + '235':('Africa/Ndjamena',), + '236':('Africa/Bangui',), + '237':('Africa/Douala',), + '238':('Atlantic/Cape_Verde',), + '239':('Africa/Sao_Tome',), + '240':('Africa/Malabo',), + '241':('Africa/Libreville',), + '242':('Africa/Brazzaville',), + '243':('Africa/Kinshasa', 'Africa/Lubumbashi'), + '2431':('Africa/Kinshasa',), + '2432':('Africa/Lubumbashi',), + '2433':('Africa/Kinshasa',), + '2434':('Africa/Kinshasa',), + '2435':('Africa/Kinshasa',), + '2436':('Africa/Kinshasa',), + '2438':('Africa/Kinshasa', 'Africa/Lubumbashi'), + '2439':('Africa/Kinshasa', 'Africa/Lubumbashi'), + '244':('Africa/Luanda',), + '245':('Atlantic/Reykjavik',), + '246':('Indian/Chagos',), + '247':('Atlantic/St_Helena',), + '248':('Indian/Mahe',), + '249':('Africa/Khartoum',), + '250':('Africa/Kigali',), + '251':('Africa/Addis_Ababa',), + '252':('Africa/Mogadishu',), + '253':('Africa/Djibouti',), + '254':('Africa/Nairobi',), + '255':('Africa/Dar_es_Salaam',), + '256':('Africa/Kampala',), + '257':('Africa/Bujumbura',), + '258':('Africa/Maputo',), + '260':('Africa/Lusaka',), + '261':('Indian/Antananarivo',), + '262':('Indian/Mayotte', 'Indian/Reunion'), + '262262':('Indian/Reunion',), + '262263':('Indian/Reunion',), + '262269':('Indian/Mayotte',), + '26263':('Indian/Mayotte',), + '26269':('Indian/Reunion',), + '2627092':('Indian/Reunion',), + '2627093':('Indian/Mayotte',), + '26280':('Indian/Mayotte', 'Indian/Reunion'), + '26281':('Indian/Reunion',), + '26282':('Indian/Reunion',), + '26288':('Indian/Reunion',), + '26289':('Indian/Reunion',), + '2629398':('Indian/Mayotte',), + '2629399':('Indian/Reunion',), + '2629478':('Indian/Mayotte',), + '2629479':('Indian/Reunion',), + '2629762':('Indian/Reunion',), + '2629763':('Indian/Reunion',), + '2629769':('Indian/Mayotte',), + '263':('Africa/Harare',), + '264':('Africa/Windhoek',), + '265':('Africa/Blantyre',), + '266':('Africa/Maseru',), + '267':('Africa/Gaborone',), + '268':('Africa/Mbabane',), + '269':('Indian/Comoro',), + '27':('Africa/Johannesburg',), + '290':('Atlantic/St_Helena',), + '291':('Africa/Asmera',), + '297':('America/Aruba',), + '298':('Atlantic/Faeroe',), + '299':('America/Godthab', 'America/Scoresbysund', 'America/Thule'), + '2991':('America/Godthab',), + '2992':('America/Godthab',), + '2993':('America/Godthab',), + '2994':('America/Godthab',), + '2995':('America/Godthab',), + '2996':('America/Godthab',), + '2998':('America/Godthab',), + '2999':('America/Godthab',), + '29997':('America/Thule',), + '29999':('America/Scoresbysund',), + '30':('Europe/Athens',), + '31':('Europe/Amsterdam',), + '32':('Europe/Brussels',), + '33':('Europe/Paris',), + '34':('Atlantic/Canary', 'Europe/Madrid'), + '345':('Europe/Madrid',), + '346':('Europe/Madrid',), + '347':('Europe/Madrid',), + '348':('Europe/Madrid',), + '34822':('Atlantic/Canary',), + '34827':('Atlantic/Canary',), + '34828':('Atlantic/Canary',), + '349':('Europe/Madrid',), + '34922':('Atlantic/Canary',), + '34928':('Atlantic/Canary',), + '350':('Europe/Gibraltar',), + '351':('Atlantic/Azores', 'Europe/Lisbon'), + '3511':('Atlantic/Azores', 'Europe/Lisbon'), + '3512':('Europe/Lisbon',), + '351292':('Atlantic/Azores',), + '351295':('Atlantic/Azores',), + '351296':('Atlantic/Azores',), + '3513':('Atlantic/Azores', 'Europe/Lisbon'), + '3516':('Atlantic/Azores', 'Europe/Lisbon'), + '3517':('Atlantic/Azores', 'Europe/Lisbon'), + '3518':('Atlantic/Azores', 'Europe/Lisbon'), + '3519':('Atlantic/Azores', 'Europe/Lisbon'), + '352':('Europe/Luxembourg',), + '353':('Europe/Guernsey', 'Europe/Isle_of_Man', 'Europe/London'), + '353539253':('Europe/Guernsey', 'Europe/Isle_of_Man', 'Europe/London'), + '354':('Atlantic/Reykjavik',), + '355':('Europe/Tirane',), + '356':('Europe/Malta',), + '357':('Asia/Nicosia',), + '358':('Europe/Helsinki', 'Europe/Mariehamn'), + '3581':('Europe/Helsinki',), + '35810':('Europe/Helsinki', 'Europe/Mariehamn'), + '35818':('Europe/Mariehamn',), + '3582':('Europe/Helsinki',), + '35820':('Europe/Helsinki', 'Europe/Mariehamn'), + '35829':('Europe/Helsinki', 'Europe/Mariehamn'), + '3583':('Europe/Helsinki',), + '35830':('Europe/Helsinki', 'Europe/Mariehamn'), + '35839':('Europe/Helsinki', 'Europe/Mariehamn'), + '3584':('Europe/Helsinki', 'Europe/Mariehamn'), + '3585':('Europe/Helsinki',), + '35850':('Europe/Helsinki', 'Europe/Mariehamn'), + '3586':('Europe/Helsinki',), + '35860':('Europe/Helsinki', 'Europe/Mariehamn'), + '3587':('Europe/Helsinki', 'Europe/Mariehamn'), + '3588':('Europe/Helsinki',), + '35880':('Europe/Helsinki', 'Europe/Mariehamn'), + '3589':('Europe/Helsinki',), + '359':('Europe/Sofia',), + '36':('Europe/Budapest',), + '370':('Europe/Bucharest',), + '371':('Europe/Bucharest',), + '372':('Europe/Bucharest',), + '373':('Europe/Chisinau',), + '374':('Asia/Yerevan',), + '375':('Europe/Moscow',), + '376':('Europe/Andorra',), + '377':('Europe/Monaco',), + '378':('Europe/San_Marino',), + '380':('Europe/Kyiv',), + '381':('Europe/Belgrade',), + '382':('Europe/Podgorica',), + '383':('Europe/Belgrade',), + '385':('Europe/Zagreb',), + '386':('Europe/Ljubljana',), + '387':('Europe/Sarajevo',), + '389':('Europe/Skopje',), + '39':('Europe/Rome', 'Europe/Vatican'), + '390':('Europe/Rome',), + '3906698':('Europe/Vatican',), + '390878':('Europe/Rome', 'Europe/Vatican'), + '391':('Europe/Rome', 'Europe/Vatican'), + '393':('Europe/Rome', 'Europe/Vatican'), + '394':('Europe/Rome',), + '395':('Europe/Rome', 'Europe/Vatican'), + '397':('Europe/Rome',), + '398':('Europe/Rome', 'Europe/Vatican'), + '40':('Europe/Bucharest',), + '41':('Europe/Zurich',), + '420':('Europe/Prague',), + '421':('Europe/Bratislava',), + '423':('Europe/Vaduz',), + '43':('Europe/Vienna',), + '44':('Europe/Guernsey', 'Europe/Isle_of_Man', 'Europe/Jersey', 'Europe/London'), + '441':('Europe/London',), + '441481':('Europe/Guernsey',), + '441534':('Europe/Jersey',), + '441624':('Europe/Isle_of_Man',), + '442':('Europe/London',), + '443':('Europe/Guernsey', 'Europe/Isle_of_Man', 'Europe/London'), + '445':('Europe/Guernsey', 'Europe/Isle_of_Man', 'Europe/London'), + '4470':('Europe/Guernsey', 'Europe/Isle_of_Man', 'Europe/London'), + '4471':('Europe/Guernsey', 'Europe/Isle_of_Man', 'Europe/London'), + '4472':('Europe/Guernsey', 'Europe/Isle_of_Man', 'Europe/London'), + '4473':('Europe/Guernsey', 'Europe/Isle_of_Man', 'Europe/London'), + '4474':('Europe/Guernsey', 'Europe/Isle_of_Man', 'Europe/London'), + '4475':('Europe/Guernsey', 'Europe/Isle_of_Man', 'Europe/London'), + '44760':('Europe/Guernsey', 'Europe/Isle_of_Man', 'Europe/London'), + '44762':('Europe/Guernsey', 'Europe/Isle_of_Man', 'Europe/London'), + '44763':('Europe/Guernsey', 'Europe/Isle_of_Man', 'Europe/London'), + '447640':('Europe/Guernsey', 'Europe/Isle_of_Man', 'Europe/London'), + '447641':('Europe/Guernsey', 'Europe/Isle_of_Man', 'Europe/London'), + '447643':('Europe/Guernsey', 'Europe/Isle_of_Man', 'Europe/London'), + '447644':('Europe/Guernsey', 'Europe/Isle_of_Man', 'Europe/London'), + '447646':('Europe/Guernsey', 'Europe/Isle_of_Man', 'Europe/London'), + '44765':('Europe/Guernsey', 'Europe/Isle_of_Man', 'Europe/London'), + '44766':('Europe/Guernsey', 'Europe/Isle_of_Man', 'Europe/London'), + '44767':('Europe/Guernsey', 'Europe/Isle_of_Man', 'Europe/London'), + '44768':('Europe/Guernsey', 'Europe/Isle_of_Man', 'Europe/London'), + '447693':('Europe/Guernsey', 'Europe/Isle_of_Man', 'Europe/London'), + '447699':('Europe/Guernsey', 'Europe/Isle_of_Man', 'Europe/London'), + '4477':('Europe/Guernsey', 'Europe/Isle_of_Man', 'Europe/London'), + '4478':('Europe/Guernsey', 'Europe/Isle_of_Man', 'Europe/London'), + '4479':('Europe/Guernsey', 'Europe/Isle_of_Man', 'Europe/London'), + '448':('Europe/Guernsey', 'Europe/Isle_of_Man', 'Europe/London'), + '449':('Europe/Guernsey', 'Europe/Isle_of_Man', 'Europe/London'), + '45':('Europe/Copenhagen',), + '46':('Europe/Stockholm',), + '47':('Arctic/Longyearbyen', 'Europe/Oslo'), + '470':('Europe/Oslo',), + '472':('Europe/Oslo',), + '473':('Europe/Oslo',), + '474':('Europe/Oslo',), + '475':('Europe/Oslo',), + '476':('Europe/Oslo',), + '477':('Europe/Oslo',), + '4779':('Arctic/Longyearbyen',), + '478':('Europe/Oslo',), + '479':('Europe/Oslo',), + '48':('Europe/Warsaw',), + '49':('Europe/Berlin',), + '500':('Atlantic/Stanley',), + '501':('America/Belize',), + '502':('America/Guatemala',), + '503':('America/El_Salvador',), + '504':('America/Tegucigalpa',), + '505':('America/Chicago',), + '506':('America/Costa_Rica',), + '507':('America/Panama',), + '508':('America/Miquelon',), + '509':('America/Port-au-Prince',), + '51':('America/Lima',), + '52':('America/Hermosillo', 'America/Mazatlan', 'America/Mexico_City', 'America/New_York', 'America/Tijuana'), + '522':('America/Mexico_City',), + '52200':('America/Mexico_City', 'America/Tijuana'), + '52201':('America/Mexico_City', 'America/New_York'), + '523':('America/Mexico_City',), + '52311':('America/Mazatlan',), + '52319':('America/Mazatlan',), + '52323':('America/Mazatlan',), + '52324':('America/Mazatlan',), + '52325':('America/Mazatlan',), + '52327':('America/Mazatlan',), + '52389':('America/Mazatlan',), + '524':('America/Mexico_City',), + '525':('America/Mexico_City',), + '52612':('America/Mazatlan',), + '52613':('America/Mazatlan',), + '52614':('America/Mazatlan',), + '52615':('America/Mazatlan',), + '52616':('America/Tijuana',), + '52618':('America/Mexico_City',), + '5262':('America/Mazatlan',), + '52626':('America/Hermosillo',), + '5263':('America/Mazatlan',), + '5264':('America/Mazatlan',), + '52646':('America/Tijuana',), + '52649':('America/Mazatlan', 'America/Mexico_City'), + '52651':('America/Mazatlan',), + '52652':('America/Mazatlan',), + '52653':('America/Mazatlan',), + '52656':('America/Hermosillo',), + '52657':('America/Mazatlan',), + '52658':('America/Tijuana',), + '52659':('America/Mazatlan',), + '52660':('America/Mazatlan',), + '52661':('America/Tijuana',), + '52662':('America/Mazatlan',), + '52663':('America/Mexico_City',), + '52664':('America/Tijuana',), + '52665':('America/Tijuana',), + '52667':('America/Mazatlan',), + '52668':('America/Mazatlan',), + '52669':('America/Mazatlan',), + '52671':('America/Mexico_City',), + '52672':('America/Mazatlan',), + '52673':('America/Mazatlan',), + '52674':('America/Mexico_City',), + '52675':('America/Mexico_City',), + '52676':('America/Mexico_City',), + '52677':('America/Mexico_City',), + '52686':('America/Tijuana',), + '52687':('America/Mazatlan',), + '5269':('America/Mazatlan',), + '527':('America/Mexico_City',), + '528':('America/Mexico_City',), + '529':('America/Mexico_City',), + '52983':('America/New_York',), + '52984':('America/New_York',), + '52987':('America/New_York',), + '52998':('America/New_York',), + '53':('America/Havana',), + '54':('America/Buenos_Aires',), + '55':('America/Manaus', 'America/Noronha', 'America/Rio_Branco', 'America/Sao_Paulo'), + '551':('America/Sao_Paulo',), + '552':('America/Sao_Paulo',), + '553':('America/Sao_Paulo',), + '554':('America/Sao_Paulo',), + '5550':('America/Sao_Paulo',), + '5551':('America/Sao_Paulo',), + '5553':('America/Sao_Paulo',), + '5554':('America/Sao_Paulo',), + '5555':('America/Sao_Paulo',), + '55553682':('America/Manaus',), + '5561':('America/Sao_Paulo',), + '5562':('America/Sao_Paulo',), + '5563':('America/Sao_Paulo',), + '5564':('America/Sao_Paulo',), + '5565':('America/Manaus',), + '5566':('America/Manaus',), + '5567':('America/Manaus',), + '55673480':('America/Sao_Paulo',), + '5568':('America/Rio_Branco',), + '5569':('America/Manaus',), + '55693527':('America/Sao_Paulo',), + '557':('America/Sao_Paulo',), + '558':('America/Sao_Paulo',), + '55812':('America/Noronha',), + '5581300':('America/Noronha',), + '55813013':('America/Noronha',), + '55813016':('America/Noronha',), + '55813017':('America/Noronha',), + '55813018':('America/Noronha',), + '55813022':('America/Noronha',), + '55813024':('America/Noronha',), + '55813027':('America/Noronha',), + '55813029':('America/Noronha',), + '55813042':('America/Noronha',), + '55813043':('America/Noronha',), + '55813044':('America/Noronha',), + '55813047':('America/Noronha',), + '55813054':('America/Noronha',), + '55813056':('America/Noronha',), + '55813057':('America/Noronha',), + '55813058':('America/Noronha',), + '5581306':('America/Noronha',), + '55813070':('America/Noronha',), + '55813085':('America/Noronha',), + '55813098':('America/Noronha',), + '558131':('America/Noronha',), + '55813200':('America/Noronha',), + '55813206':('America/Noronha',), + '55813208':('America/Noronha',), + '55813209':('America/Noronha',), + '55813210':('America/Noronha',), + '55813211':('America/Noronha',), + '55813215':('America/Noronha',), + '55813218':('America/Noronha',), + '55813219':('America/Noronha',), + '55813220':('America/Noronha',), + '5581323':('America/Noronha',), + '55813240':('America/Noronha',), + '55813245':('America/Noronha',), + '55813246':('America/Noronha',), + '55813247':('America/Noronha',), + '55813248':('America/Noronha',), + '55813250':('America/Noronha',), + '55813258':('America/Noronha',), + '55813259':('America/Noronha',), + '55813260':('America/Noronha',), + '55813261':('America/Noronha',), + '55813262':('America/Noronha',), + '55813263':('America/Noronha',), + '5581327':('America/Noronha',), + '5581328':('America/Noronha',), + '5581329':('America/Noronha',), + '55813300':('America/Noronha',), + '55813306':('America/Noronha',), + '55813307':('America/Noronha',), + '55813308':('America/Noronha',), + '55813309':('America/Noronha',), + '55813310':('America/Noronha',), + '55813313':('America/Noronha',), + '55813315':('America/Noronha',), + '55813321':('America/Noronha',), + '55813324':('America/Noronha',), + '55813329':('America/Noronha',), + '5581333':('America/Noronha',), + '55813340':('America/Noronha',), + '55813346':('America/Noronha',), + '55813347':('America/Noronha',), + '55813348':('America/Noronha',), + '55813349':('America/Noronha',), + '5581335':('America/Noronha',), + '5581336':('America/Noronha',), + '55813370':('America/Noronha',), + '55813373':('America/Noronha',), + '55813374':('America/Noronha',), + '5581338':('America/Noronha',), + '5581339':('America/Noronha',), + '5581340':('America/Noronha',), + '55813410':('America/Noronha',), + '55813415':('America/Noronha',), + '55813417':('America/Noronha',), + '55813418':('America/Noronha',), + '55813420':('America/Noronha',), + '55813430':('America/Noronha',), + '55813440':('America/Noronha',), + '55813450':('America/Noronha',), + '55813460':('America/Noronha',), + '55813470':('America/Noronha',), + '55813480':('America/Noronha',), + '55813485':('America/Noronha',), + '55813488':('America/Noronha',), + '55813489':('America/Noronha',), + '55813490':('America/Noronha',), + '55813496':('America/Noronha',), + '558135':('America/Noronha',), + '5581360':('America/Noronha',), + '5581361':('America/Noronha',), + '55813620':('America/Noronha',), + '55813623':('America/Noronha',), + '55813630':('America/Noronha',), + '55813632':('America/Noronha',), + '55813640':('America/Noronha',), + '55813650':('America/Noronha',), + '55813659':('America/Noronha',), + '5581366':('America/Noronha',), + '55813670':('America/Noronha',), + '55813672':('America/Noronha',), + '55813674':('America/Noronha',), + '55813677':('America/Noronha',), + '55813680':('America/Noronha',), + '55813690':('America/Noronha',), + '55813696':('America/Noronha',), + '55813697':('America/Noronha',), + '55813698':('America/Noronha',), + '558137':('America/Noronha',), + '558138':('America/Noronha',), + '558139':('America/Noronha',), + '55814':('America/Noronha',), + '55815':('America/Noronha',), + '55817':('America/Noronha',), + '55819':('America/Noronha',), + '559':('America/Manaus',), + '5590':('America/Sao_Paulo',), + '55912121':('America/Sao_Paulo',), + '55912122':('America/Sao_Paulo',), + '55912123':('America/Sao_Paulo',), + '55912992':('America/Sao_Paulo',), + '55913004':('America/Sao_Paulo',), + '5591301':('America/Sao_Paulo',), + '55913028':('America/Sao_Paulo',), + '55913031':('America/Sao_Paulo',), + '55913032':('America/Sao_Paulo',), + '55913033':('America/Sao_Paulo',), + '55913038':('America/Sao_Paulo',), + '55913039':('America/Sao_Paulo',), + '55913072':('America/Sao_Paulo',), + '55913073':('America/Sao_Paulo',), + '55913075':('America/Sao_Paulo',), + '5591308':('America/Sao_Paulo',), + '5591311':('America/Sao_Paulo',), + '55913120':('America/Sao_Paulo',), + '55913121':('America/Sao_Paulo',), + '55913131':('America/Sao_Paulo',), + '55913181':('America/Sao_Paulo',), + '55913182':('America/Sao_Paulo',), + '55913184':('America/Sao_Paulo',), + '55913194':('America/Sao_Paulo',), + '55913199':('America/Sao_Paulo',), + '559132':('America/Sao_Paulo',), + '55913311':('America/Sao_Paulo',), + '55913321':('America/Sao_Paulo',), + '55913322':('America/Sao_Paulo',), + '55913323':('America/Sao_Paulo',), + '5591334':('America/Sao_Paulo',), + '55913351':('America/Sao_Paulo',), + '55913352':('America/Sao_Paulo',), + '55913353':('America/Sao_Paulo',), + '55913355':('America/Sao_Paulo',), + '55913366':('America/Sao_Paulo',), + '55913397':('America/Sao_Paulo',), + '55913411':('America/Sao_Paulo',), + '55913412':('America/Sao_Paulo',), + '55913423':('America/Sao_Paulo',), + '55913425':('America/Sao_Paulo',), + '55913429':('America/Sao_Paulo',), + '55913434':('America/Sao_Paulo',), + '5591344':('America/Sao_Paulo',), + '55913456':('America/Sao_Paulo',), + '5591346':('America/Sao_Paulo',), + '55913481':('America/Sao_Paulo',), + '55913482':('America/Sao_Paulo',), + '55913483':('America/Sao_Paulo',), + '55913484':('America/Sao_Paulo',), + '55913485':('America/Sao_Paulo',), + '55913494':('America/Sao_Paulo',), + '55913521':('America/Sao_Paulo',), + '55913556':('America/Sao_Paulo',), + '55913605':('America/Sao_Paulo',), + '55913606':('America/Sao_Paulo',), + '55913617':('America/Sao_Paulo',), + '55913621':('America/Sao_Paulo',), + '55913633':('America/Sao_Paulo',), + '55913636':('America/Sao_Paulo',), + '55913637':('America/Sao_Paulo',), + '55913658':('America/Sao_Paulo',), + '55913661':('America/Sao_Paulo',), + '55913662':('America/Sao_Paulo',), + '55913665':('America/Sao_Paulo',), + '55913692':('America/Sao_Paulo',), + '55913694':('America/Sao_Paulo',), + '55913711':('America/Sao_Paulo',), + '55913712':('America/Sao_Paulo',), + '5591372':('America/Sao_Paulo',), + '5591373':('America/Sao_Paulo',), + '55913741':('America/Sao_Paulo',), + '55913744':('America/Sao_Paulo',), + '55913746':('America/Sao_Paulo',), + '5591375':('America/Sao_Paulo',), + '55913764':('America/Sao_Paulo',), + '55913765':('America/Sao_Paulo',), + '55913767':('America/Sao_Paulo',), + '5591377':('America/Sao_Paulo',), + '55913781':('America/Sao_Paulo',), + '55913783':('America/Sao_Paulo',), + '55913784':('America/Sao_Paulo',), + '55913795':('America/Sao_Paulo',), + '55913796':('America/Sao_Paulo',), + '55913798':('America/Sao_Paulo',), + '55913802':('America/Sao_Paulo',), + '55913803':('America/Sao_Paulo',), + '55913809':('America/Sao_Paulo',), + '55913811':('America/Sao_Paulo',), + '55913812':('America/Sao_Paulo',), + '55913817':('America/Sao_Paulo',), + '55913821':('America/Sao_Paulo',), + '55913822':('America/Sao_Paulo',), + '55913823':('America/Sao_Paulo',), + '55913829':('America/Sao_Paulo',), + '5591400':('America/Sao_Paulo',), + '55914040':('America/Sao_Paulo',), + '55914042':('America/Sao_Paulo',), + '55914103':('America/Sao_Paulo',), + '55914104':('America/Sao_Paulo',), + '55914107':('America/Sao_Paulo',), + '55914141':('America/Sao_Paulo',), + '559198':('America/Sao_Paulo',), + '5591991':('America/Sao_Paulo',), + '5591992':('America/Sao_Paulo',), + '5591993':('America/Sao_Paulo',), + '55919960':('America/Sao_Paulo',), + '55919961':('America/Sao_Paulo',), + '55919962':('America/Sao_Paulo',), + '55919963':('America/Sao_Paulo',), + '55919964':('America/Sao_Paulo',), + '5591998':('America/Sao_Paulo',), + '5591999':('America/Sao_Paulo',), + '55925009':('America/Sao_Paulo',), + '55932101':('America/Sao_Paulo',), + '55932122':('America/Sao_Paulo',), + '55933016':('America/Sao_Paulo',), + '55933017':('America/Sao_Paulo',), + '55933062':('America/Sao_Paulo',), + '55933063':('America/Sao_Paulo',), + '55933064':('America/Sao_Paulo',), + '55933067':('America/Sao_Paulo',), + '55933222':('America/Sao_Paulo',), + '55933502':('America/Sao_Paulo',), + '55933505':('America/Sao_Paulo',), + '55933512':('America/Sao_Paulo',), + '55933514':('America/Sao_Paulo',), + '55933515':('America/Sao_Paulo',), + '55933517':('America/Sao_Paulo',), + '55933518':('America/Sao_Paulo',), + '5593352':('America/Sao_Paulo',), + '5593353':('America/Sao_Paulo',), + '5593354':('America/Sao_Paulo',), + '55933552':('America/Sao_Paulo',), + '55933557':('America/Sao_Paulo',), + '55933558':('America/Sao_Paulo',), + '55933559':('America/Sao_Paulo',), + '55933563':('America/Sao_Paulo',), + '55933574':('America/Sao_Paulo',), + '55933582':('America/Sao_Paulo',), + '55933589':('America/Sao_Paulo',), + '55933593':('America/Sao_Paulo',), + '55933596':('America/Sao_Paulo',), + '55933597':('America/Sao_Paulo',), + '55933598':('America/Sao_Paulo',), + '55933735':('America/Sao_Paulo',), + '55933736':('America/Sao_Paulo',), + '55933737':('America/Sao_Paulo',), + '55933793':('America/Sao_Paulo',), + '55939810':('America/Sao_Paulo',), + '55939811':('America/Sao_Paulo',), + '55939812':('America/Sao_Paulo',), + '55939813':('America/Sao_Paulo',), + '55939840':('America/Sao_Paulo',), + '55939841':('America/Sao_Paulo',), + '55939880':('America/Sao_Paulo',), + '55939881':('America/Sao_Paulo',), + '5593991':('America/Sao_Paulo',), + '55939920':('America/Sao_Paulo',), + '55939921':('America/Sao_Paulo',), + '55939922':('America/Sao_Paulo',), + '55939923':('America/Sao_Paulo',), + '55939924':('America/Sao_Paulo',), + '55939965':('America/Sao_Paulo',), + '55939990':('America/Sao_Paulo',), + '55939991':('America/Sao_Paulo',), + '55939995':('America/Sao_Paulo',), + '55939997':('America/Sao_Paulo',), + '55942101':('America/Sao_Paulo',), + '55942103':('America/Sao_Paulo',), + '55943012':('America/Sao_Paulo',), + '55943013':('America/Sao_Paulo',), + '55943016':('America/Sao_Paulo',), + '55943018':('America/Sao_Paulo',), + '55943222':('America/Sao_Paulo',), + '55943301':('America/Sao_Paulo',), + '55943309':('America/Sao_Paulo',), + '55943311':('America/Sao_Paulo',), + '55943312':('America/Sao_Paulo',), + '55943315':('America/Sao_Paulo',), + '55943319':('America/Sao_Paulo',), + '5594332':('America/Sao_Paulo',), + '55943331':('America/Sao_Paulo',), + '55943332':('America/Sao_Paulo',), + '55943333':('America/Sao_Paulo',), + '55943335':('America/Sao_Paulo',), + '55943337':('America/Sao_Paulo',), + '5594334':('America/Sao_Paulo',), + '5594335':('America/Sao_Paulo',), + '55943364':('America/Sao_Paulo',), + '55943365':('America/Sao_Paulo',), + '55943366':('America/Sao_Paulo',), + '55943379':('America/Sao_Paulo',), + '55943382':('America/Sao_Paulo',), + '55943385':('America/Sao_Paulo',), + '55943386':('America/Sao_Paulo',), + '55943392':('America/Sao_Paulo',), + '5594342':('America/Sao_Paulo',), + '55943431':('America/Sao_Paulo',), + '55943432':('America/Sao_Paulo',), + '55943433':('America/Sao_Paulo',), + '55943434':('America/Sao_Paulo',), + '55943435':('America/Sao_Paulo',), + '55943491':('America/Sao_Paulo',), + '55943778':('America/Sao_Paulo',), + '55943779':('America/Sao_Paulo',), + '55943785':('America/Sao_Paulo',), + '55943786':('America/Sao_Paulo',), + '55943787':('America/Sao_Paulo',), + '5594981':('America/Sao_Paulo',), + '55949840':('America/Sao_Paulo',), + '55949841':('America/Sao_Paulo',), + '55949842':('America/Sao_Paulo',), + '55949880':('America/Sao_Paulo',), + '55949881':('America/Sao_Paulo',), + '5594991':('America/Sao_Paulo',), + '5594992':('America/Sao_Paulo',), + '55949930':('America/Sao_Paulo',), + '55949966':('America/Sao_Paulo',), + '55949990':('America/Sao_Paulo',), + '55949991':('America/Sao_Paulo',), + '55949992':('America/Sao_Paulo',), + '55949995':('America/Sao_Paulo',), + '55949997':('America/Sao_Paulo',), + '5596':('America/Sao_Paulo',), + '5598':('America/Sao_Paulo',), + '5599':('America/Sao_Paulo',), + '56':('America/Santiago', 'Pacific/Easter'), + '561':('America/Santiago',), + '562':('America/Santiago',), + '5632':('Pacific/Easter',), + '56322':('America/Santiago',), + '56323':('America/Santiago',), + '5633':('America/Santiago',), + '5634':('America/Santiago',), + '5635':('America/Santiago',), + '564':('America/Santiago',), + '565':('America/Santiago',), + '566':('America/Santiago',), + '567':('America/Santiago',), + '568':('America/Santiago',), + '569':('America/Santiago',), + '57':('America/Bogota',), + '58':('America/Caracas',), + '590':('America/Guadeloupe',), + '591':('America/La_Paz',), + '592':('America/Guyana',), + '593':('America/Guayaquil', 'Pacific/Galapagos'), + '5931':('America/Guayaquil', 'Pacific/Galapagos'), + '5932':('America/Guayaquil',), + '5933':('America/Guayaquil',), + '5934':('America/Guayaquil',), + '5935':('America/Guayaquil',), + '59352':('America/Guayaquil', 'Pacific/Galapagos'), + '5936':('America/Guayaquil',), + '5937':('America/Guayaquil',), + '5939':('America/Guayaquil',), + '594':('America/Cayenne',), + '595':('America/Asuncion',), + '596':('America/Martinique',), + '597':('America/Paramaribo',), + '598':('America/Montevideo',), + '599':('America/Curacao', 'America/Kralendijk'), + '5993':('America/Kralendijk',), + '5994':('America/Kralendijk',), + '5996':('America/Curacao',), + '5997':('America/Kralendijk',), + '5999':('America/Curacao',), + '60':('Asia/Kuching',), + '61':('Australia/Adelaide', 'Australia/Brisbane', 'Australia/Eucla', 'Australia/Lord_Howe', 'Australia/Perth', 'Australia/Sydney', 'Indian/Christmas', 'Indian/Cocos'), + '611':('Australia/Sydney',), + '612':('Australia/Sydney',), + '61255053':('Australia/Lord_Howe',), + '61255143':('Australia/Lord_Howe',), + '61255213':('Australia/Lord_Howe',), + '61255280':('Australia/Lord_Howe',), + '61255307':('Australia/Lord_Howe',), + '61255369':('Australia/Lord_Howe',), + '61255413':('Australia/Lord_Howe',), + '61255568':('Australia/Lord_Howe',), + '61255936':('Australia/Lord_Howe',), + '61255937':('Australia/Lord_Howe',), + '61265080':('Australia/Lord_Howe',), + '61265081':('Australia/Lord_Howe',), + '61265082':('Australia/Lord_Howe',), + '61265099':('Australia/Lord_Howe',), + '61265164':('Australia/Lord_Howe',), + '61265251':('Australia/Lord_Howe',), + '61265296':('Australia/Lord_Howe',), + '61265341':('Australia/Lord_Howe',), + '61265606':('Australia/Lord_Howe',), + '61265632':('Australia/Lord_Howe',), + '61265998':('Australia/Lord_Howe',), + '613':('Australia/Sydney',), + '614':('Australia/Sydney',), + '617':('Australia/Sydney',), + '61721000':('Australia/Brisbane',), + '61721001':('Australia/Brisbane',), + '61721002':('Australia/Brisbane',), + '61721003':('Australia/Brisbane',), + '6172101':('Australia/Brisbane',), + '6172102':('Australia/Brisbane',), + '6172103':('Australia/Brisbane',), + '6172104':('Australia/Brisbane',), + '6173018':('Australia/Brisbane',), + '6173019':('Australia/Brisbane',), + '617303':('Australia/Brisbane',), + '6173040':('Australia/Brisbane',), + '6173041':('Australia/Brisbane',), + '6173046':('Australia/Brisbane',), + '617305':('Australia/Brisbane',), + '61730600':('Australia/Brisbane',), + '6173061':('Australia/Brisbane',), + '61730640':('Australia/Brisbane',), + '61730641':('Australia/Brisbane',), + '61730643':('Australia/Brisbane',), + '61730651':('Australia/Brisbane',), + '61730659':('Australia/Brisbane',), + '6173066':('Australia/Brisbane',), + '6173067':('Australia/Brisbane',), + '6173068':('Australia/Brisbane',), + '6173069':('Australia/Brisbane',), + '617307':('Australia/Brisbane',), + '617308':('Australia/Brisbane',), + '61730923':('Australia/Brisbane',), + '61730938':('Australia/Brisbane',), + '6173096':('Australia/Brisbane',), + '6173097':('Australia/Brisbane',), + '61730992':('Australia/Brisbane',), + '61731':('Australia/Brisbane',), + '617322':('Australia/Brisbane',), + '617323':('Australia/Brisbane',), + '617326':('Australia/Brisbane',), + '6173291':('Australia/Brisbane',), + '6173292':('Australia/Brisbane',), + '6173295':('Australia/Brisbane',), + '6173296':('Australia/Brisbane',), + '6173300':('Australia/Brisbane',), + '61733095':('Australia/Brisbane',), + '61733099':('Australia/Brisbane',), + '6173316':('Australia/Brisbane',), + '6173319':('Australia/Brisbane',), + '6173322':('Australia/Brisbane',), + '6173330':('Australia/Brisbane',), + '6173333':('Australia/Brisbane',), + '6173342':('Australia/Brisbane',), + '617335':('Australia/Brisbane',), + '617336':('Australia/Brisbane',), + '6173403':('Australia/Brisbane',), + '6173404':('Australia/Brisbane',), + '6173405':('Australia/Brisbane',), + '6173406':('Australia/Brisbane',), + '6173407':('Australia/Brisbane',), + '6173411':('Australia/Brisbane',), + '6173414':('Australia/Brisbane',), + '617342':('Australia/Brisbane',), + '6173434':('Australia/Brisbane',), + '6173435':('Australia/Brisbane',), + '6173443':('Australia/Brisbane',), + '6173452':('Australia/Brisbane',), + '6173455':('Australia/Brisbane',), + '6173456':('Australia/Brisbane',), + '6173457':('Australia/Brisbane',), + '6173460':('Australia/Brisbane',), + '6173493':('Australia/Brisbane',), + '61734973':('Australia/Brisbane',), + '61734974':('Australia/Brisbane',), + '61734975':('Australia/Brisbane',), + '61734976':('Australia/Brisbane',), + '617350':('Australia/Brisbane',), + '617353':('Australia/Brisbane',), + '6173540':('Australia/Brisbane',), + '6173546':('Australia/Brisbane',), + '6173547':('Australia/Brisbane',), + '6173548':('Australia/Brisbane',), + '617355':('Australia/Brisbane',), + '61735678':('Australia/Brisbane',), + '617360':('Australia/Brisbane',), + '6173613':('Australia/Brisbane',), + '617362':('Australia/Brisbane',), + '617363':('Australia/Brisbane',), + '61736404':('Australia/Brisbane',), + '61736405':('Australia/Brisbane',), + '61736406':('Australia/Brisbane',), + '61736409':('Australia/Brisbane',), + '6173646':('Australia/Brisbane',), + '6173647':('Australia/Brisbane',), + '6173648':('Australia/Brisbane',), + '6173666':('Australia/Brisbane',), + '61736677':('Australia/Brisbane',), + '61736678':('Australia/Brisbane',), + '61736679':('Australia/Brisbane',), + '61736680':('Australia/Brisbane',), + '617370':('Australia/Brisbane',), + '617371':('Australia/Brisbane',), + '617372':('Australia/Brisbane',), + '617373':('Australia/Brisbane',), + '6173748':('Australia/Brisbane',), + '6173777':('Australia/Brisbane',), + '61737788':('Australia/Brisbane',), + '6173811':('Australia/Brisbane',), + '6173815':('Australia/Brisbane',), + '6173823':('Australia/Brisbane',), + '6173828':('Australia/Brisbane',), + '61738348':('Australia/Brisbane',), + '61738359':('Australia/Brisbane',), + '6173887':('Australia/Brisbane',), + '617389':('Australia/Brisbane',), + '6173900':('Australia/Brisbane',), + '6173901':('Australia/Brisbane',), + '6173904':('Australia/Brisbane',), + '6173905':('Australia/Brisbane',), + '6173910':('Australia/Brisbane',), + '61739110':('Australia/Brisbane',), + '61739111':('Australia/Brisbane',), + '61739112':('Australia/Brisbane',), + '6173914':('Australia/Brisbane',), + '6173915':('Australia/Brisbane',), + '61739160':('Australia/Brisbane',), + '61739161':('Australia/Brisbane',), + '6173917':('Australia/Brisbane',), + '6173918':('Australia/Brisbane',), + '6173922':('Australia/Brisbane',), + '6173924':('Australia/Brisbane',), + '61739475':('Australia/Brisbane',), + '6173999':('Australia/Brisbane',), + '618510':('Australia/Adelaide', 'Australia/Perth'), + '61851001':('Indian/Christmas',), + '61851002':('Indian/Cocos',), + '61851030':('Indian/Christmas',), + '61851031':('Indian/Cocos',), + '61851059':('Indian/Christmas',), + '61851060':('Indian/Cocos',), + '61851087':('Australia/Perth',), + '61851088':('Indian/Christmas',), + '61851089':('Indian/Cocos',), + '6185109':('Australia/Perth',), + '618511':('Australia/Perth',), + '61851100':('Australia/Adelaide', 'Australia/Perth'), + '61851116':('Australia/Adelaide', 'Australia/Perth'), + '61851117':('Indian/Christmas',), + '61851118':('Indian/Cocos',), + '61851119':('Australia/Adelaide', 'Australia/Perth'), + '6185112':('Australia/Adelaide', 'Australia/Perth'), + '6185113':('Australia/Adelaide', 'Australia/Perth'), + '61851140':('Australia/Adelaide', 'Australia/Perth'), + '61851141':('Australia/Adelaide', 'Australia/Perth'), + '61851142':('Australia/Adelaide', 'Australia/Perth'), + '61851143':('Australia/Adelaide', 'Australia/Perth'), + '61851144':('Australia/Adelaide', 'Australia/Perth'), + '61851146':('Indian/Christmas',), + '61851156':('Australia/Adelaide', 'Australia/Perth'), + '61851158':('Australia/Adelaide', 'Australia/Perth'), + '61851175':('Indian/Christmas',), + '61851176':('Indian/Cocos',), + '61851185':('Australia/Adelaide', 'Australia/Perth'), + '61851187':('Australia/Adelaide', 'Australia/Perth'), + '6185120':('Australia/Perth',), + '61851204':('Indian/Christmas',), + '61851205':('Australia/Sydney',), + '61851209':('Australia/Adelaide', 'Australia/Perth'), + '6185121':('Australia/Adelaide', 'Australia/Perth'), + '61851221':('Australia/Adelaide', 'Australia/Perth'), + '61851222':('Indian/Christmas',), + '61851223':('Indian/Cocos',), + '61851224':('Australia/Perth',), + '61851225':('Australia/Perth',), + '61851226':('Australia/Perth',), + '61851227':('Australia/Adelaide', 'Australia/Perth'), + '61851228':('Australia/Adelaide', 'Australia/Perth'), + '61851229':('Australia/Adelaide', 'Australia/Perth'), + '61851230':('Australia/Sydney',), + '61851231':('Australia/Adelaide', 'Australia/Perth'), + '61851232':('Australia/Sydney',), + '61851233':('Australia/Sydney',), + '61851234':('Australia/Sydney',), + '61851235':('Indian/Christmas',), + '61851236':('Australia/Adelaide', 'Australia/Perth'), + '61851237':('Australia/Adelaide', 'Australia/Perth'), + '61851238':('Australia/Adelaide', 'Australia/Perth'), + '61851239':('Australia/Adelaide', 'Australia/Perth'), + '6185124':('Australia/Sydney',), + '6185125':('Australia/Sydney',), + '6185126':('Australia/Sydney',), + '6185127':('Australia/Adelaide', 'Australia/Perth'), + '6185128':('Australia/Adelaide', 'Australia/Perth'), + '6185129':('Australia/Adelaide', 'Australia/Perth'), + '618513':('Australia/Sydney',), + '618514':('Australia/Sydney',), + '6186':('Australia/Adelaide', 'Australia/Perth'), + '6187':('Australia/Adelaide', 'Australia/Perth'), + '6188':('Australia/Adelaide', 'Australia/Perth'), + '6189':('Australia/Adelaide', 'Australia/Perth'), + '61890393':('Australia/Adelaide', 'Australia/Eucla', 'Australia/Perth'), + '61890395':('Australia/Adelaide', 'Australia/Eucla', 'Australia/Perth'), + '61891006':('Australia/Adelaide', 'Australia/Perth', 'Indian/Christmas'), + '61891007':('Australia/Adelaide', 'Australia/Perth', 'Indian/Christmas'), + '61891008':('Australia/Adelaide', 'Australia/Perth', 'Indian/Christmas'), + '61891009':('Australia/Adelaide', 'Australia/Perth', 'Indian/Christmas'), + '61891010':('Australia/Adelaide', 'Australia/Perth', 'Indian/Cocos'), + '61891011':('Australia/Adelaide', 'Australia/Perth', 'Indian/Cocos'), + '61891012':('Australia/Adelaide', 'Australia/Perth', 'Indian/Cocos'), + '61891029':('Australia/Adelaide', 'Australia/Perth', 'Indian/Cocos'), + '61891122':('Australia/Adelaide', 'Australia/Perth', 'Indian/Cocos'), + '61891149':('Australia/Adelaide', 'Australia/Perth', 'Indian/Christmas'), + '61891150':('Australia/Adelaide', 'Australia/Perth', 'Indian/Cocos'), + '61891178':('Australia/Adelaide', 'Australia/Perth', 'Indian/Christmas'), + '61891179':('Australia/Adelaide', 'Australia/Perth', 'Indian/Cocos'), + '61891181':('Australia/Adelaide', 'Australia/Perth', 'Indian/Christmas'), + '61891182':('Australia/Adelaide', 'Australia/Perth', 'Indian/Cocos'), + '61891209':('Australia/Adelaide', 'Australia/Perth', 'Indian/Christmas'), + '61891210':('Australia/Adelaide', 'Australia/Perth', 'Indian/Cocos'), + '61891263':('Australia/Adelaide', 'Australia/Perth', 'Indian/Christmas'), + '61891264':('Australia/Adelaide', 'Australia/Perth', 'Indian/Cocos'), + '61891308':('Australia/Adelaide', 'Australia/Perth', 'Indian/Cocos'), + '61891312':('Australia/Adelaide', 'Australia/Perth', 'Indian/Christmas'), + '61891322':('Australia/Adelaide', 'Australia/Perth', 'Indian/Cocos'), + '61891326':('Australia/Adelaide', 'Australia/Perth', 'Indian/Christmas'), + '61891368':('Australia/Adelaide', 'Australia/Perth', 'Indian/Cocos'), + '61891375':('Australia/Adelaide', 'Australia/Perth', 'Indian/Christmas'), + '61891428':('Australia/Adelaide', 'Australia/Perth', 'Indian/Cocos'), + '61891456':('Australia/Adelaide', 'Australia/Perth', 'Indian/Christmas'), + '61891497':('Australia/Adelaide', 'Australia/Perth', 'Indian/Christmas'), + '61891498':('Australia/Adelaide', 'Australia/Perth', 'Indian/Cocos'), + '6189162':('Indian/Cocos',), + '6189164':('Indian/Christmas',), + '61891700':('Australia/Adelaide', 'Australia/Perth', 'Indian/Christmas'), + '61891701':('Australia/Adelaide', 'Australia/Perth', 'Indian/Christmas'), + '61891702':('Australia/Adelaide', 'Australia/Perth', 'Indian/Cocos'), + '61891703':('Indian/Cocos',), + '61891710':('Australia/Adelaide', 'Australia/Perth', 'Indian/Christmas'), + '61891711':('Australia/Adelaide', 'Australia/Perth', 'Indian/Christmas'), + '61891712':('Australia/Adelaide', 'Australia/Perth', 'Indian/Christmas'), + '61891958':('Indian/Christmas',), + '61891959':('Australia/Adelaide', 'Australia/Perth', 'Indian/Cocos'), + '62':('Asia/Jakarta', 'Asia/Jayapura', 'Asia/Makassar'), + '62007':('Asia/Jakarta', 'Asia/Makassar'), + '621':('Asia/Jakarta', 'Asia/Makassar'), + '622':('Asia/Jakarta',), + '6231':('Asia/Jakarta',), + '6232':('Asia/Jakarta',), + '6233':('Asia/Jakarta',), + '6234':('Asia/Jakarta',), + '6235':('Asia/Jakarta',), + '6236':('Asia/Makassar',), + '6237':('Asia/Makassar',), + '62379':('Asia/Jakarta', 'Asia/Makassar'), + '6238':('Asia/Makassar',), + '624':('Asia/Makassar',), + '62403':('Asia/Jayapura', 'Asia/Makassar'), + '62458':('Asia/Jakarta', 'Asia/Makassar'), + '62511':('Asia/Makassar',), + '62512':('Asia/Makassar',), + '62513':('Asia/Jakarta',), + '62515':('Asia/Jakarta',), + '62516':('Asia/Jakarta', 'Asia/Makassar'), + '62517':('Asia/Makassar',), + '62518':('Asia/Makassar',), + '62519':('Asia/Jakarta',), + '62522':('Asia/Jakarta',), + '62525':('Asia/Jakarta',), + '62526':('Asia/Makassar',), + '62527':('Asia/Makassar',), + '62528':('Asia/Jakarta',), + '6253':('Asia/Jakarta',), + '62539':('Asia/Jakarta', 'Asia/Makassar'), + '6254':('Asia/Makassar',), + '6255':('Asia/Makassar',), + '6256':('Asia/Jakarta',), + '626':('Asia/Jakarta',), + '627':('Asia/Jakarta',), + '628':('Asia/Jakarta',), + '6280':('Asia/Jakarta', 'Asia/Makassar'), + '62811':('Asia/Jakarta', 'Asia/Makassar'), + '62818':('Asia/Jakarta', 'Asia/Makassar'), + '62819':('Asia/Jakarta', 'Asia/Makassar'), + '62824':('Asia/Jakarta', 'Asia/Makassar'), + '62829':('Asia/Jakarta', 'Asia/Makassar'), + '62831':('Asia/Jakarta', 'Asia/Makassar'), + '62833':('Asia/Jakarta', 'Asia/Makassar'), + '62834':('Asia/Jakarta', 'Asia/Makassar'), + '62839':('Asia/Jakarta', 'Asia/Makassar'), + '62853':('Asia/Jakarta', 'Asia/Makassar'), + '62868':('Asia/Jakarta', 'Asia/Makassar'), + '62876':('Asia/Jakarta', 'Asia/Makassar'), + '62887':('Asia/Jakarta', 'Asia/Makassar'), + '6290':('Asia/Jayapura',), + '6291':('Asia/Jayapura',), + '62915':('Asia/Jakarta', 'Asia/Jayapura'), + '6292':('Asia/Jayapura',), + '62920':('Asia/Jakarta',), + '62951':('Asia/Jayapura',), + '62952':('Asia/Jakarta', 'Asia/Jayapura'), + '62955':('Asia/Jayapura',), + '62956':('Asia/Jayapura',), + '62957':('Asia/Jayapura',), + '62958':('Asia/Jakarta',), + '62962':('Asia/Jayapura',), + '62963':('Asia/Jakarta',), + '62966':('Asia/Jayapura',), + '62967':('Asia/Jayapura',), + '62969':('Asia/Jayapura',), + '62971':('Asia/Jayapura',), + '62975':('Asia/Jayapura',), + '62979':('Asia/Jakarta',), + '6298':('Asia/Jayapura',), + '63':('Asia/Manila',), + '64':('Pacific/Auckland', 'Pacific/Chatham'), + '641':('Pacific/Auckland',), + '642':('Pacific/Auckland',), + '643':('Pacific/Auckland',), + '64330':('Pacific/Chatham',), + '644':('Pacific/Auckland',), + '645':('Pacific/Auckland',), + '646':('Pacific/Auckland',), + '647':('Pacific/Auckland',), + '648':('Pacific/Auckland',), + '649':('Pacific/Auckland',), + '65':('Asia/Singapore',), + '66':('Asia/Bangkok',), + '670':('Asia/Dili',), + '672':('Pacific/Norfolk',), + '673':('Asia/Brunei',), + '674':('Pacific/Nauru',), + '675':('Pacific/Port_Moresby',), + '676':('Pacific/Tongatapu',), + '677':('Pacific/Guadalcanal',), + '678':('Pacific/Efate',), + '679':('Pacific/Fiji',), + '680':('Pacific/Palau',), + '681':('Pacific/Wallis',), + '682':('Pacific/Rarotonga',), + '683':('Pacific/Niue',), + '685':('Pacific/Apia',), + '686':('Pacific/Enderbury', 'Pacific/Kiritimati', 'Pacific/Tarawa'), + '687':('Pacific/Noumea',), + '688':('Pacific/Funafuti',), + '689':('Pacific/Gambier', 'Pacific/Marquesas', 'Pacific/Tahiti'), + '6894':('Pacific/Tahiti',), + '68980':('Pacific/Gambier', 'Pacific/Marquesas', 'Pacific/Tahiti'), + '68987':('Pacific/Gambier', 'Pacific/Marquesas', 'Pacific/Tahiti'), + '68988':('Pacific/Tahiti',), + '68989':('Pacific/Tahiti',), + '690':('Pacific/Fakaofo',), + '691':('Pacific/Kosrae', 'Pacific/Ponape', 'Pacific/Truk'), + '6913':('Pacific/Truk',), + '69132':('Pacific/Ponape',), + '69137':('Pacific/Kosrae',), + '6918':('Pacific/Kosrae', 'Pacific/Ponape', 'Pacific/Truk'), + '6919':('Pacific/Kosrae', 'Pacific/Ponape', 'Pacific/Truk'), + '691920':('Pacific/Ponape',), + '691921':('Pacific/Ponape',), + '691924':('Pacific/Ponape',), + '691926':('Pacific/Ponape',), + '691933':('Pacific/Truk',), + '692':('Pacific/Majuro',), + '7':('Asia/Almaty', 'Asia/Anadyr', 'Asia/Aqtobe', 'Asia/Irkutsk', 'Asia/Kamchatka', 'Asia/Krasnoyarsk', 'Asia/Magadan', 'Asia/Novosibirsk', 'Asia/Omsk', 'Asia/Sakhalin', 'Asia/Vladivostok', 'Asia/Yakutsk', 'Asia/Yekaterinburg', 'Europe/Bucharest', 'Europe/Moscow', 'Europe/Samara'), + '7301':('Asia/Irkutsk',), + '7302':('Asia/Yakutsk',), + '7336':('Asia/Yekaterinburg',), + '733622':('Asia/Almaty',), + '734':('Asia/Yekaterinburg',), + '7341':('Europe/Samara',), + '735':('Asia/Yekaterinburg',), + '736':('Europe/Moscow',), + '7381':('Asia/Omsk',), + '7382':('Asia/Novosibirsk',), + '7383':('Asia/Novosibirsk',), + '7384':('Asia/Krasnoyarsk',), + '7385':('Asia/Krasnoyarsk',), + '7388':('Asia/Krasnoyarsk',), + '7390':('Asia/Krasnoyarsk',), + '7391':('Asia/Krasnoyarsk',), + '7394':('Asia/Krasnoyarsk',), + '7395':('Asia/Irkutsk',), + '740':('Europe/Bucharest',), + '7411':('Asia/Yakutsk',), + '7413':('Asia/Magadan',), + '7415':('Asia/Kamchatka',), + '7416':('Asia/Yakutsk',), + '7421':('Asia/Vladivostok',), + '7423':('Asia/Vladivostok',), + '7424':('Asia/Sakhalin',), + '7426':('Asia/Vladivostok',), + '7427':('Asia/Anadyr',), + '747':('Europe/Moscow',), + '748':('Europe/Moscow',), + '749':('Europe/Moscow',), + '77':('Asia/Almaty', 'Asia/Aqtobe'), + '771':('Asia/Almaty',), + '7711':('Asia/Aqtobe',), + '7712':('Asia/Aqtobe',), + '7713':('Asia/Aqtobe',), + '772':('Asia/Almaty',), + '7729':('Asia/Aqtobe',), + '779':('Asia/Almaty',), + '7800':('Asia/Almaty', 'Asia/Aqtobe', 'Europe/Moscow'), + '7803':('Europe/Moscow',), + '7804':('Europe/Moscow',), + '7808':('Asia/Almaty', 'Asia/Aqtobe', 'Europe/Moscow'), + '7809':('Asia/Almaty', 'Asia/Aqtobe', 'Europe/Moscow'), + '781':('Europe/Moscow',), + '7810':('Asia/Almaty', 'Asia/Aqtobe', 'Europe/Moscow'), + '782':('Europe/Moscow',), + '783':('Europe/Moscow',), + '7840':('Europe/Bucharest', 'Europe/Moscow'), + '7841':('Europe/Moscow',), + '7842':('Europe/Samara',), + '7843':('Europe/Moscow',), + '7844':('Europe/Moscow',), + '7845':('Europe/Moscow',), + '7846':('Europe/Samara',), + '7847':('Europe/Moscow',), + '7848':('Europe/Samara',), + '7851':('Europe/Samara',), + '7855':('Europe/Moscow',), + '7856':('Europe/Moscow',), + '7857':('Europe/Moscow',), + '786':('Europe/Moscow',), + '787':('Europe/Moscow',), + '79':('Europe/Moscow',), + '81':('Asia/Tokyo',), + '8170859':('Asia/Tokyo',), + '82':('Asia/Seoul',), + '84':('Asia/Ho_Chi_Minh',), + '850':('Asia/Seoul',), + '852':('Asia/Hong_Kong',), + '853':('Asia/Shanghai',), + '855':('Asia/Phnom_Penh',), + '856':('Asia/Vientiane',), + '86':('Asia/Shanghai',), + '861':('Asia/Shanghai',), + '862':('Asia/Shanghai',), + '863':('Asia/Shanghai',), + '864':('Asia/Shanghai',), + '865':('Asia/Shanghai',), + '866':('Asia/Shanghai',), + '867':('Asia/Shanghai',), + '868':('Asia/Shanghai',), + '869':('Asia/Shanghai',), + '880':('Asia/Dhaka',), + '886':('Asia/Taipei',), + '90':('Europe/Istanbul',), + '91':('Asia/Calcutta',), + '92':('Asia/Karachi',), + '93':('Asia/Kabul',), + '94':('Asia/Colombo',), + '95':('Asia/Rangoon',), + '960':('Indian/Maldives',), + '961':('Asia/Beirut',), + '962':('Asia/Amman',), + '963':('Asia/Damascus',), + '964':('Asia/Baghdad',), + '965':('Asia/Kuwait',), + '966':('Asia/Riyadh',), + '967':('Asia/Aden',), + '968':('Asia/Muscat',), + '970':('Europe/Bucharest',), + '971':('Asia/Dubai',), + '972':('Asia/Jerusalem',), + '973':('Asia/Bahrain',), + '974':('Asia/Qatar',), + '975':('Asia/Thimphu',), + '976':('Asia/Choibalsan', 'Asia/Hovd', 'Asia/Ulaanbaatar'), + '97611':('Asia/Ulaanbaatar',), + '97612':('Asia/Ulaanbaatar',), + '97613':('Asia/Ulaanbaatar',), + '9761362':('Asia/Choibalsan', 'Asia/Ulaanbaatar'), + '97614':('Asia/Hovd',), + '97615':('Asia/Ulaanbaatar',), + '976158':('Asia/Choibalsan',), + '97621':('Asia/Ulaanbaatar',), + '97622':('Asia/Ulaanbaatar',), + '97623':('Asia/Ulaanbaatar',), + '9762362':('Asia/Choibalsan', 'Asia/Ulaanbaatar'), + '97624':('Asia/Hovd',), + '97625':('Asia/Ulaanbaatar',), + '976258':('Asia/Choibalsan',), + '9765':('Asia/Ulaanbaatar',), + '9766':('Asia/Ulaanbaatar',), + '9767':('Asia/Ulaanbaatar',), + '9768':('Asia/Ulaanbaatar',), + '9769':('Asia/Ulaanbaatar',), + '977':('Asia/Katmandu',), + '98':('Asia/Tehran',), + '992':('Asia/Dushanbe',), + '993':('Asia/Ashgabat',), + '994':('Asia/Baku',), + '995':('Asia/Tbilisi',), + '996':('Asia/Bishkek',), + '998':('Asia/Tashkent',), +} diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/cli/__pycache__/__init__.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/cli/__pycache__/__init__.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..6b84a04f56ebf511a51fc4d3e944d578ab865c60 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/cli/__pycache__/__init__.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/cli/__pycache__/autocompletion.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/cli/__pycache__/autocompletion.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a2cc918652a759dad2f319ab53ccce1772ff1c45 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/cli/__pycache__/autocompletion.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/cli/__pycache__/base_command.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/cli/__pycache__/base_command.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2016f82da09214be4429a88fce9b9c49c87a98ae Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/cli/__pycache__/base_command.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/cli/__pycache__/cmdoptions.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/cli/__pycache__/cmdoptions.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..12ab6ec7d1b13d95629f756180e28c716cecd0eb Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/cli/__pycache__/cmdoptions.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/cli/__pycache__/command_context.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/cli/__pycache__/command_context.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..6d3d8d60c25ab6b294774c53b04e991ed52d9020 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/cli/__pycache__/command_context.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/cli/__pycache__/index_command.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/cli/__pycache__/index_command.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..28ffd0515dfa04ec55dd7210e151bcdc7a0ddd6b Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/cli/__pycache__/index_command.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/cli/__pycache__/main.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/cli/__pycache__/main.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..536b20e9890cfd254605c8af2a049ef11b94d51a Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/cli/__pycache__/main.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/cli/__pycache__/main_parser.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/cli/__pycache__/main_parser.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..23969350640a7ae09ea7d5ebafc820226cf14063 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/cli/__pycache__/main_parser.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/cli/__pycache__/parser.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/cli/__pycache__/parser.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..8340cd9be70294f03e8101ca530e6777acb8057c Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/cli/__pycache__/parser.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/cli/__pycache__/progress_bars.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/cli/__pycache__/progress_bars.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..422478a4726bb0bb481e4415ddc55b814fe29cfb Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/cli/__pycache__/progress_bars.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/cli/__pycache__/req_command.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/cli/__pycache__/req_command.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..55ca4e8300ee521c48a7e44bdbc8026441f390f7 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/cli/__pycache__/req_command.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/cli/__pycache__/spinners.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/cli/__pycache__/spinners.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..6afcd4744a99a5ba0be628f14f966979a2533361 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/cli/__pycache__/spinners.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/cli/__pycache__/status_codes.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/cli/__pycache__/status_codes.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..fdc003d11d07c159b3f54a89c3e1a3e5dff25774 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/cli/__pycache__/status_codes.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/commands/__pycache__/__init__.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/commands/__pycache__/__init__.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..90fa1f1d8e20e9055e86c23b6b4a0f77e95ae86b Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/commands/__pycache__/__init__.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/commands/__pycache__/cache.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/commands/__pycache__/cache.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..063022b007747907a3a0a5f44000ebcdda5afc7a Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/commands/__pycache__/cache.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/commands/__pycache__/check.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/commands/__pycache__/check.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..4a2479bf9fcf40545310c3316b2b0fe96cbe2c1c Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/commands/__pycache__/check.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/commands/__pycache__/completion.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/commands/__pycache__/completion.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..7ebb3b84aa075c5f16736a3db62f0464401b5a26 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/commands/__pycache__/completion.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/commands/__pycache__/configuration.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/commands/__pycache__/configuration.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..216328330cf92faf16514863cadc4b7fd900e699 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/commands/__pycache__/configuration.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/commands/__pycache__/debug.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/commands/__pycache__/debug.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e42015f8cfe8f15e397da6beb8010dfcdc1764c7 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/commands/__pycache__/debug.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/commands/__pycache__/download.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/commands/__pycache__/download.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a0125f99d8c89848f53b3354353fec3e4ea054cc Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/commands/__pycache__/download.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/commands/__pycache__/freeze.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/commands/__pycache__/freeze.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..425337c883bb69cc79a6989f85e7199de7bf93bb Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/commands/__pycache__/freeze.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/commands/__pycache__/hash.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/commands/__pycache__/hash.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..02db3ebf6299273dd3b987c114fe69822ed095ac Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/commands/__pycache__/hash.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/commands/__pycache__/help.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/commands/__pycache__/help.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..5950672c140b5e837921774e5513338779842839 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/commands/__pycache__/help.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/commands/__pycache__/index.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/commands/__pycache__/index.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..aea6ddadcfbb7890a2f8359d231ec4abb5ca8249 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/commands/__pycache__/index.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/commands/__pycache__/inspect.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/commands/__pycache__/inspect.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..39ffe84e3a1334788554000a04e8e3ee6cb47186 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/commands/__pycache__/inspect.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/commands/__pycache__/install.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/commands/__pycache__/install.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..ee3f9226e8d54917a4d286a0612279c42f5cd2b4 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/commands/__pycache__/install.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/commands/__pycache__/list.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/commands/__pycache__/list.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e9a0525d21d161b8e6474816af8912c80933d766 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/commands/__pycache__/list.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/commands/__pycache__/lock.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/commands/__pycache__/lock.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..fa29b24dc76660d383dbaf59d68b7323ce383ae5 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/commands/__pycache__/lock.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/commands/__pycache__/search.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/commands/__pycache__/search.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..8239175e96c4abad40cea416506191d2909b4c15 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/commands/__pycache__/search.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/commands/__pycache__/show.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/commands/__pycache__/show.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..7ae49cf4a1017441f2d7f8b051c36e469e457166 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/commands/__pycache__/show.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/commands/__pycache__/uninstall.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/commands/__pycache__/uninstall.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..cf8f159f2273b43f743653bb9ecd775ac3fa3b50 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/commands/__pycache__/uninstall.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/commands/__pycache__/wheel.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/commands/__pycache__/wheel.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2669513f6650866d96474e1a768fe7628d43fa9b Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/commands/__pycache__/wheel.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/commands/debug.py b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/commands/debug.py new file mode 100644 index 0000000000000000000000000000000000000000..0e187e79c283bed9de3aaaa3f9e1275735f75cf1 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/commands/debug.py @@ -0,0 +1,203 @@ +from __future__ import annotations + +import locale +import logging +import os +import sys +from optparse import Values +from types import ModuleType +from typing import Any + +import pip._vendor +from pip._vendor.certifi import where +from pip._vendor.packaging.version import parse as parse_version + +from pip._internal.cli import cmdoptions +from pip._internal.cli.base_command import Command +from pip._internal.cli.cmdoptions import make_target_python +from pip._internal.cli.status_codes import SUCCESS +from pip._internal.configuration import Configuration +from pip._internal.metadata import get_environment +from pip._internal.utils.compat import open_text_resource +from pip._internal.utils.logging import indent_log +from pip._internal.utils.misc import get_pip_version + +logger = logging.getLogger(__name__) + + +def show_value(name: str, value: Any) -> None: + logger.info("%s: %s", name, value) + + +def show_sys_implementation() -> None: + logger.info("sys.implementation:") + implementation_name = sys.implementation.name + with indent_log(): + show_value("name", implementation_name) + + +def create_vendor_txt_map() -> dict[str, str]: + with open_text_resource("pip._vendor", "vendor.txt") as f: + # Purge non version specifying lines. + # Also, remove any space prefix or suffixes (including comments). + lines = [ + line.strip().split(" ", 1)[0] for line in f.readlines() if "==" in line + ] + + # Transform into "module" -> version dict. + return dict(line.split("==", 1) for line in lines) + + +def get_module_from_module_name(module_name: str) -> ModuleType | None: + # Module name can be uppercase in vendor.txt for some reason... + module_name = module_name.lower().replace("-", "_") + # PATCH: setuptools is actually only pkg_resources. + if module_name == "setuptools": + module_name = "pkg_resources" + + try: + __import__(f"pip._vendor.{module_name}", globals(), locals(), level=0) + return getattr(pip._vendor, module_name) + except ImportError: + # We allow 'truststore' to fail to import due + # to being unavailable on Python 3.9 and earlier. + if module_name == "truststore" and sys.version_info < (3, 10): + return None + raise + + +def get_vendor_version_from_module(module_name: str) -> str | None: + module = get_module_from_module_name(module_name) + version = getattr(module, "__version__", None) + + if module and not version: + # Try to find version in debundled module info. + assert module.__file__ is not None + env = get_environment([os.path.dirname(module.__file__)]) + dist = env.get_distribution(module_name) + if dist: + version = str(dist.version) + + return version + + +def show_actual_vendor_versions(vendor_txt_versions: dict[str, str]) -> None: + """Log the actual version and print extra info if there is + a conflict or if the actual version could not be imported. + """ + for module_name, expected_version in vendor_txt_versions.items(): + extra_message = "" + actual_version = get_vendor_version_from_module(module_name) + if not actual_version: + extra_message = ( + " (Unable to locate actual module version, using" + " vendor.txt specified version)" + ) + actual_version = expected_version + elif parse_version(actual_version) != parse_version(expected_version): + extra_message = ( + " (CONFLICT: vendor.txt suggests version should" + f" be {expected_version})" + ) + logger.info("%s==%s%s", module_name, actual_version, extra_message) + + +def show_vendor_versions() -> None: + logger.info("vendored library versions:") + + vendor_txt_versions = create_vendor_txt_map() + with indent_log(): + show_actual_vendor_versions(vendor_txt_versions) + + +def show_tags(options: Values) -> None: + tag_limit = 10 + + target_python = make_target_python(options) + tags = target_python.get_sorted_tags() + + # Display the target options that were explicitly provided. + formatted_target = target_python.format_given() + suffix = "" + if formatted_target: + suffix = f" (target: {formatted_target})" + + msg = f"Compatible tags: {len(tags)}{suffix}" + logger.info(msg) + + if options.verbose < 1 and len(tags) > tag_limit: + tags_limited = True + tags = tags[:tag_limit] + else: + tags_limited = False + + with indent_log(): + for tag in tags: + logger.info(str(tag)) + + if tags_limited: + msg = f"...\n[First {tag_limit} tags shown. Pass --verbose to show all.]" + logger.info(msg) + + +def ca_bundle_info(config: Configuration) -> str: + levels = {key.split(".", 1)[0] for key, _ in config.items()} + if not levels: + return "Not specified" + + levels_that_override_global = ["install", "wheel", "download"] + global_overriding_level = [ + level for level in levels if level in levels_that_override_global + ] + if not global_overriding_level: + return "global" + + if "global" in levels: + levels.remove("global") + return ", ".join(levels) + + +class DebugCommand(Command): + """ + Display debug information. + """ + + usage = """ + %prog """ + ignore_require_venv = True + + def add_options(self) -> None: + cmdoptions.add_target_python_options(self.cmd_opts) + self.parser.insert_option_group(0, self.cmd_opts) + self.parser.config.load() + + def run(self, options: Values, args: list[str]) -> int: + logger.warning( + "This command is only meant for debugging. " + "Do not use this with automation for parsing and getting these " + "details, since the output and options of this command may " + "change without notice." + ) + show_value("pip version", get_pip_version()) + show_value("sys.version", sys.version) + show_value("sys.executable", sys.executable) + show_value("sys.getdefaultencoding", sys.getdefaultencoding()) + show_value("sys.getfilesystemencoding", sys.getfilesystemencoding()) + show_value( + "locale.getpreferredencoding", + locale.getpreferredencoding(), + ) + show_value("sys.platform", sys.platform) + show_sys_implementation() + + show_value("'cert' config value", ca_bundle_info(self.parser.config)) + show_value("REQUESTS_CA_BUNDLE", os.environ.get("REQUESTS_CA_BUNDLE")) + show_value("CURL_CA_BUNDLE", os.environ.get("CURL_CA_BUNDLE")) + show_value("pip._vendor.certifi.where()", where()) + show_value("pip._vendor.DEBUNDLED", pip._vendor.DEBUNDLED) + + show_vendor_versions() + + show_tags(options) + + return SUCCESS diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/commands/download.py b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/commands/download.py new file mode 100644 index 0000000000000000000000000000000000000000..900fb403d6fa5827081ee9eca90698e71990aca4 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/commands/download.py @@ -0,0 +1,145 @@ +import logging +import os +from optparse import Values + +from pip._internal.cli import cmdoptions +from pip._internal.cli.cmdoptions import make_target_python +from pip._internal.cli.req_command import RequirementCommand, with_cleanup +from pip._internal.cli.status_codes import SUCCESS +from pip._internal.operations.build.build_tracker import get_build_tracker +from pip._internal.req.req_install import check_legacy_setup_py_options +from pip._internal.utils.misc import ensure_dir, normalize_path, write_output +from pip._internal.utils.temp_dir import TempDirectory + +logger = logging.getLogger(__name__) + + +class DownloadCommand(RequirementCommand): + """ + Download packages from: + + - PyPI (and other indexes) using requirement specifiers. + - VCS project urls. + - Local project directories. + - Local or remote source archives. + + pip also supports downloading from "requirements files", which provide + an easy way to specify a whole environment to be downloaded. + """ + + usage = """ + %prog [options] [package-index-options] ... + %prog [options] -r [package-index-options] ... + %prog [options] ... + %prog [options] ... + %prog [options] ...""" + + def add_options(self) -> None: + self.cmd_opts.add_option(cmdoptions.constraints()) + self.cmd_opts.add_option(cmdoptions.requirements()) + self.cmd_opts.add_option(cmdoptions.no_deps()) + self.cmd_opts.add_option(cmdoptions.global_options()) + self.cmd_opts.add_option(cmdoptions.no_binary()) + self.cmd_opts.add_option(cmdoptions.only_binary()) + self.cmd_opts.add_option(cmdoptions.prefer_binary()) + self.cmd_opts.add_option(cmdoptions.src()) + self.cmd_opts.add_option(cmdoptions.pre()) + self.cmd_opts.add_option(cmdoptions.require_hashes()) + self.cmd_opts.add_option(cmdoptions.progress_bar()) + self.cmd_opts.add_option(cmdoptions.no_build_isolation()) + self.cmd_opts.add_option(cmdoptions.use_pep517()) + self.cmd_opts.add_option(cmdoptions.no_use_pep517()) + self.cmd_opts.add_option(cmdoptions.check_build_deps()) + self.cmd_opts.add_option(cmdoptions.ignore_requires_python()) + + self.cmd_opts.add_option( + "-d", + "--dest", + "--destination-dir", + "--destination-directory", + dest="download_dir", + metavar="dir", + default=os.curdir, + help="Download packages into .", + ) + + cmdoptions.add_target_python_options(self.cmd_opts) + + index_opts = cmdoptions.make_option_group( + cmdoptions.index_group, + self.parser, + ) + + self.parser.insert_option_group(0, index_opts) + self.parser.insert_option_group(0, self.cmd_opts) + + @with_cleanup + def run(self, options: Values, args: list[str]) -> int: + options.ignore_installed = True + # editable doesn't really make sense for `pip download`, but the bowels + # of the RequirementSet code require that property. + options.editables = [] + + cmdoptions.check_dist_restriction(options) + + options.download_dir = normalize_path(options.download_dir) + ensure_dir(options.download_dir) + + session = self.get_default_session(options) + + target_python = make_target_python(options) + finder = self._build_package_finder( + options=options, + session=session, + target_python=target_python, + ignore_requires_python=options.ignore_requires_python, + ) + + build_tracker = self.enter_context(get_build_tracker()) + + directory = TempDirectory( + delete=not options.no_clean, + kind="download", + globally_managed=True, + ) + + reqs = self.get_requirements(args, options, finder, session) + check_legacy_setup_py_options(options, reqs) + + preparer = self.make_requirement_preparer( + temp_build_dir=directory, + options=options, + build_tracker=build_tracker, + session=session, + finder=finder, + download_dir=options.download_dir, + use_user_site=False, + verbosity=self.verbosity, + ) + + resolver = self.make_resolver( + preparer=preparer, + finder=finder, + options=options, + ignore_requires_python=options.ignore_requires_python, + use_pep517=options.use_pep517, + py_version_info=options.python_version, + ) + + self.trace_basic_info(finder) + + requirement_set = resolver.resolve(reqs, check_supported_wheels=True) + + downloaded: list[str] = [] + for req in requirement_set.requirements.values(): + if req.satisfied_by is None: + assert req.name is not None + preparer.save_linked_requirement(req) + downloaded.append(req.name) + + preparer.prepare_linked_requirements_more(requirement_set.requirements.values()) + + if downloaded: + write_output("Successfully downloaded %s", " ".join(downloaded)) + + return SUCCESS diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/commands/help.py b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/commands/help.py new file mode 100644 index 0000000000000000000000000000000000000000..2ae658ff5eb6951ea30948ab425e6125dc41fa34 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/commands/help.py @@ -0,0 +1,40 @@ +from optparse import Values + +from pip._internal.cli.base_command import Command +from pip._internal.cli.status_codes import SUCCESS +from pip._internal.exceptions import CommandError + + +class HelpCommand(Command): + """Show help for commands""" + + usage = """ + %prog """ + ignore_require_venv = True + + def run(self, options: Values, args: list[str]) -> int: + from pip._internal.commands import ( + commands_dict, + create_command, + get_similar_commands, + ) + + try: + # 'pip help' with no args is handled by pip.__init__.parseopt() + cmd_name = args[0] # the command we need help for + except IndexError: + return SUCCESS + + if cmd_name not in commands_dict: + guess = get_similar_commands(cmd_name) + + msg = [f'unknown command "{cmd_name}"'] + if guess: + msg.append(f'maybe you meant "{guess}"') + + raise CommandError(" - ".join(msg)) + + command = create_command(cmd_name) + command.parser.print_help() + + return SUCCESS diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/commands/list.py b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/commands/list.py new file mode 100644 index 0000000000000000000000000000000000000000..ad27e45ce938f1556321b411c093309b3deac77f --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/commands/list.py @@ -0,0 +1,400 @@ +from __future__ import annotations + +import json +import logging +from collections.abc import Generator, Sequence +from email.parser import Parser +from optparse import Values +from typing import TYPE_CHECKING, cast + +from pip._vendor.packaging.utils import canonicalize_name +from pip._vendor.packaging.version import InvalidVersion, Version + +from pip._internal.cli import cmdoptions +from pip._internal.cli.index_command import IndexGroupCommand +from pip._internal.cli.status_codes import SUCCESS +from pip._internal.exceptions import CommandError +from pip._internal.metadata import BaseDistribution, get_environment +from pip._internal.models.selection_prefs import SelectionPreferences +from pip._internal.utils.compat import stdlib_pkgs +from pip._internal.utils.misc import tabulate, write_output + +if TYPE_CHECKING: + from pip._internal.index.package_finder import PackageFinder + from pip._internal.network.session import PipSession + + class _DistWithLatestInfo(BaseDistribution): + """Give the distribution object a couple of extra fields. + + These will be populated during ``get_outdated()``. This is dirty but + makes the rest of the code much cleaner. + """ + + latest_version: Version + latest_filetype: str + + _ProcessedDists = Sequence[_DistWithLatestInfo] + + +logger = logging.getLogger(__name__) + + +class ListCommand(IndexGroupCommand): + """ + List installed packages, including editables. + + Packages are listed in a case-insensitive sorted order. + """ + + ignore_require_venv = True + usage = """ + %prog [options]""" + + def add_options(self) -> None: + self.cmd_opts.add_option( + "-o", + "--outdated", + action="store_true", + default=False, + help="List outdated packages", + ) + self.cmd_opts.add_option( + "-u", + "--uptodate", + action="store_true", + default=False, + help="List uptodate packages", + ) + self.cmd_opts.add_option( + "-e", + "--editable", + action="store_true", + default=False, + help="List editable projects.", + ) + self.cmd_opts.add_option( + "-l", + "--local", + action="store_true", + default=False, + help=( + "If in a virtualenv that has global access, do not list " + "globally-installed packages." + ), + ) + self.cmd_opts.add_option( + "--user", + dest="user", + action="store_true", + default=False, + help="Only output packages installed in user-site.", + ) + self.cmd_opts.add_option(cmdoptions.list_path()) + self.cmd_opts.add_option( + "--pre", + action="store_true", + default=False, + help=( + "Include pre-release and development versions. By default, " + "pip only finds stable versions." + ), + ) + + self.cmd_opts.add_option( + "--format", + action="store", + dest="list_format", + default="columns", + choices=("columns", "freeze", "json"), + help=( + "Select the output format among: columns (default), freeze, or json. " + "The 'freeze' format cannot be used with the --outdated option." + ), + ) + + self.cmd_opts.add_option( + "--not-required", + action="store_true", + dest="not_required", + help="List packages that are not dependencies of installed packages.", + ) + + self.cmd_opts.add_option( + "--exclude-editable", + action="store_false", + dest="include_editable", + help="Exclude editable package from output.", + ) + self.cmd_opts.add_option( + "--include-editable", + action="store_true", + dest="include_editable", + help="Include editable package in output.", + default=True, + ) + self.cmd_opts.add_option(cmdoptions.list_exclude()) + index_opts = cmdoptions.make_option_group(cmdoptions.index_group, self.parser) + + self.parser.insert_option_group(0, index_opts) + self.parser.insert_option_group(0, self.cmd_opts) + + def handle_pip_version_check(self, options: Values) -> None: + if options.outdated or options.uptodate: + super().handle_pip_version_check(options) + + def _build_package_finder( + self, options: Values, session: PipSession + ) -> PackageFinder: + """ + Create a package finder appropriate to this list command. + """ + # Lazy import the heavy index modules as most list invocations won't need 'em. + from pip._internal.index.collector import LinkCollector + from pip._internal.index.package_finder import PackageFinder + + link_collector = LinkCollector.create(session, options=options) + + # Pass allow_yanked=False to ignore yanked versions. + selection_prefs = SelectionPreferences( + allow_yanked=False, + allow_all_prereleases=options.pre, + ) + + return PackageFinder.create( + link_collector=link_collector, + selection_prefs=selection_prefs, + ) + + def run(self, options: Values, args: list[str]) -> int: + if options.outdated and options.uptodate: + raise CommandError("Options --outdated and --uptodate cannot be combined.") + + if options.outdated and options.list_format == "freeze": + raise CommandError( + "List format 'freeze' cannot be used with the --outdated option." + ) + + cmdoptions.check_list_path_option(options) + + skip = set(stdlib_pkgs) + if options.excludes: + skip.update(canonicalize_name(n) for n in options.excludes) + + packages: _ProcessedDists = [ + cast("_DistWithLatestInfo", d) + for d in get_environment(options.path).iter_installed_distributions( + local_only=options.local, + user_only=options.user, + editables_only=options.editable, + include_editables=options.include_editable, + skip=skip, + ) + ] + + # get_not_required must be called firstly in order to find and + # filter out all dependencies correctly. Otherwise a package + # can't be identified as requirement because some parent packages + # could be filtered out before. + if options.not_required: + packages = self.get_not_required(packages, options) + + if options.outdated: + packages = self.get_outdated(packages, options) + elif options.uptodate: + packages = self.get_uptodate(packages, options) + + self.output_package_listing(packages, options) + return SUCCESS + + def get_outdated( + self, packages: _ProcessedDists, options: Values + ) -> _ProcessedDists: + return [ + dist + for dist in self.iter_packages_latest_infos(packages, options) + if dist.latest_version > dist.version + ] + + def get_uptodate( + self, packages: _ProcessedDists, options: Values + ) -> _ProcessedDists: + return [ + dist + for dist in self.iter_packages_latest_infos(packages, options) + if dist.latest_version == dist.version + ] + + def get_not_required( + self, packages: _ProcessedDists, options: Values + ) -> _ProcessedDists: + dep_keys = { + canonicalize_name(dep.name) + for dist in packages + for dep in (dist.iter_dependencies() or ()) + } + + # Create a set to remove duplicate packages, and cast it to a list + # to keep the return type consistent with get_outdated and + # get_uptodate + return list({pkg for pkg in packages if pkg.canonical_name not in dep_keys}) + + def iter_packages_latest_infos( + self, packages: _ProcessedDists, options: Values + ) -> Generator[_DistWithLatestInfo, None, None]: + with self._build_session(options) as session: + finder = self._build_package_finder(options, session) + + def latest_info( + dist: _DistWithLatestInfo, + ) -> _DistWithLatestInfo | None: + all_candidates = finder.find_all_candidates(dist.canonical_name) + if not options.pre: + # Remove prereleases + all_candidates = [ + candidate + for candidate in all_candidates + if not candidate.version.is_prerelease + ] + + evaluator = finder.make_candidate_evaluator( + project_name=dist.canonical_name, + ) + best_candidate = evaluator.sort_best_candidate(all_candidates) + if best_candidate is None: + return None + + remote_version = best_candidate.version + if best_candidate.link.is_wheel: + typ = "wheel" + else: + typ = "sdist" + dist.latest_version = remote_version + dist.latest_filetype = typ + return dist + + for dist in map(latest_info, packages): + if dist is not None: + yield dist + + def output_package_listing( + self, packages: _ProcessedDists, options: Values + ) -> None: + packages = sorted( + packages, + key=lambda dist: dist.canonical_name, + ) + if options.list_format == "columns" and packages: + data, header = format_for_columns(packages, options) + self.output_package_listing_columns(data, header) + elif options.list_format == "freeze": + for dist in packages: + try: + req_string = f"{dist.raw_name}=={dist.version}" + except InvalidVersion: + req_string = f"{dist.raw_name}==={dist.raw_version}" + if options.verbose >= 1: + write_output("%s (%s)", req_string, dist.location) + else: + write_output(req_string) + elif options.list_format == "json": + write_output(format_for_json(packages, options)) + + def output_package_listing_columns( + self, data: list[list[str]], header: list[str] + ) -> None: + # insert the header first: we need to know the size of column names + if len(data) > 0: + data.insert(0, header) + + pkg_strings, sizes = tabulate(data) + + # Create and add a separator. + if len(data) > 0: + pkg_strings.insert(1, " ".join("-" * x for x in sizes)) + + for val in pkg_strings: + write_output(val) + + +def format_for_columns( + pkgs: _ProcessedDists, options: Values +) -> tuple[list[list[str]], list[str]]: + """ + Convert the package data into something usable + by output_package_listing_columns. + """ + header = ["Package", "Version"] + + running_outdated = options.outdated + if running_outdated: + header.extend(["Latest", "Type"]) + + def wheel_build_tag(dist: BaseDistribution) -> str | None: + try: + wheel_file = dist.read_text("WHEEL") + except FileNotFoundError: + return None + return Parser().parsestr(wheel_file).get("Build") + + build_tags = [wheel_build_tag(p) for p in pkgs] + has_build_tags = any(build_tags) + if has_build_tags: + header.append("Build") + + if options.verbose >= 1: + header.append("Location") + if options.verbose >= 1: + header.append("Installer") + + has_editables = any(x.editable for x in pkgs) + if has_editables: + header.append("Editable project location") + + data = [] + for i, proj in enumerate(pkgs): + # if we're working on the 'outdated' list, separate out the + # latest_version and type + row = [proj.raw_name, proj.raw_version] + + if running_outdated: + row.append(str(proj.latest_version)) + row.append(proj.latest_filetype) + + if has_build_tags: + row.append(build_tags[i] or "") + + if has_editables: + row.append(proj.editable_project_location or "") + + if options.verbose >= 1: + row.append(proj.location or "") + if options.verbose >= 1: + row.append(proj.installer) + + data.append(row) + + return data, header + + +def format_for_json(packages: _ProcessedDists, options: Values) -> str: + data = [] + for dist in packages: + try: + version = str(dist.version) + except InvalidVersion: + version = dist.raw_version + info = { + "name": dist.raw_name, + "version": version, + } + if options.verbose >= 1: + info["location"] = dist.location or "" + info["installer"] = dist.installer + if options.outdated: + info["latest_version"] = str(dist.latest_version) + info["latest_filetype"] = dist.latest_filetype + editable_project_location = dist.editable_project_location + if editable_project_location: + info["editable_project_location"] = editable_project_location + data.append(info) + return json.dumps(data) diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/commands/show.py b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/commands/show.py new file mode 100644 index 0000000000000000000000000000000000000000..f9fcfa60bcb761a68b9d638c88357c2842ca6746 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/commands/show.py @@ -0,0 +1,231 @@ +from __future__ import annotations + +import logging +import string +from collections.abc import Generator, Iterable, Iterator +from optparse import Values +from typing import NamedTuple + +from pip._vendor.packaging.requirements import InvalidRequirement +from pip._vendor.packaging.utils import canonicalize_name + +from pip._internal.cli.base_command import Command +from pip._internal.cli.status_codes import ERROR, SUCCESS +from pip._internal.metadata import BaseDistribution, get_default_environment +from pip._internal.utils.misc import write_output + +logger = logging.getLogger(__name__) + + +def normalize_project_url_label(label: str) -> str: + # This logic is from PEP 753 (Well-known Project URLs in Metadata). + chars_to_remove = string.punctuation + string.whitespace + removal_map = str.maketrans("", "", chars_to_remove) + return label.translate(removal_map).lower() + + +class ShowCommand(Command): + """ + Show information about one or more installed packages. + + The output is in RFC-compliant mail header format. + """ + + usage = """ + %prog [options] ...""" + ignore_require_venv = True + + def add_options(self) -> None: + self.cmd_opts.add_option( + "-f", + "--files", + dest="files", + action="store_true", + default=False, + help="Show the full list of installed files for each package.", + ) + + self.parser.insert_option_group(0, self.cmd_opts) + + def run(self, options: Values, args: list[str]) -> int: + if not args: + logger.warning("ERROR: Please provide a package name or names.") + return ERROR + query = args + + results = search_packages_info(query) + if not print_results( + results, list_files=options.files, verbose=options.verbose + ): + return ERROR + return SUCCESS + + +class _PackageInfo(NamedTuple): + name: str + version: str + location: str + editable_project_location: str | None + requires: list[str] + required_by: list[str] + installer: str + metadata_version: str + classifiers: list[str] + summary: str + homepage: str + project_urls: list[str] + author: str + author_email: str + license: str + license_expression: str + entry_points: list[str] + files: list[str] | None + + +def search_packages_info(query: list[str]) -> Generator[_PackageInfo, None, None]: + """ + Gather details from installed distributions. Print distribution name, + version, location, and installed files. Installed files requires a + pip generated 'installed-files.txt' in the distributions '.egg-info' + directory. + """ + env = get_default_environment() + + installed = {dist.canonical_name: dist for dist in env.iter_all_distributions()} + query_names = [canonicalize_name(name) for name in query] + missing = sorted( + [name for name, pkg in zip(query, query_names) if pkg not in installed] + ) + if missing: + logger.warning("Package(s) not found: %s", ", ".join(missing)) + + def _get_requiring_packages(current_dist: BaseDistribution) -> Iterator[str]: + return ( + dist.metadata["Name"] or "UNKNOWN" + for dist in installed.values() + if current_dist.canonical_name + in {canonicalize_name(d.name) for d in dist.iter_dependencies()} + ) + + for query_name in query_names: + try: + dist = installed[query_name] + except KeyError: + continue + + try: + requires = sorted( + # Avoid duplicates in requirements (e.g. due to environment markers). + {req.name for req in dist.iter_dependencies()}, + key=str.lower, + ) + except InvalidRequirement: + requires = sorted(dist.iter_raw_dependencies(), key=str.lower) + + try: + required_by = sorted(_get_requiring_packages(dist), key=str.lower) + except InvalidRequirement: + required_by = ["#N/A"] + + try: + entry_points_text = dist.read_text("entry_points.txt") + entry_points = entry_points_text.splitlines(keepends=False) + except FileNotFoundError: + entry_points = [] + + files_iter = dist.iter_declared_entries() + if files_iter is None: + files: list[str] | None = None + else: + files = sorted(files_iter) + + metadata = dist.metadata + + project_urls = metadata.get_all("Project-URL", []) + homepage = metadata.get("Home-page", "") + if not homepage: + # It's common that there is a "homepage" Project-URL, but Home-page + # remains unset (especially as PEP 621 doesn't surface the field). + for url in project_urls: + url_label, url = url.split(",", maxsplit=1) + normalized_label = normalize_project_url_label(url_label) + if normalized_label == "homepage": + homepage = url.strip() + break + + yield _PackageInfo( + name=dist.raw_name, + version=dist.raw_version, + location=dist.location or "", + editable_project_location=dist.editable_project_location, + requires=requires, + required_by=required_by, + installer=dist.installer, + metadata_version=dist.metadata_version or "", + classifiers=metadata.get_all("Classifier", []), + summary=metadata.get("Summary", ""), + homepage=homepage, + project_urls=project_urls, + author=metadata.get("Author", ""), + author_email=metadata.get("Author-email", ""), + license=metadata.get("License", ""), + license_expression=metadata.get("License-Expression", ""), + entry_points=entry_points, + files=files, + ) + + +def print_results( + distributions: Iterable[_PackageInfo], + list_files: bool, + verbose: bool, +) -> bool: + """ + Print the information from installed distributions found. + """ + results_printed = False + for i, dist in enumerate(distributions): + results_printed = True + if i > 0: + write_output("---") + + metadata_version_tuple = tuple(map(int, dist.metadata_version.split("."))) + + write_output("Name: %s", dist.name) + write_output("Version: %s", dist.version) + write_output("Summary: %s", dist.summary) + write_output("Home-page: %s", dist.homepage) + write_output("Author: %s", dist.author) + write_output("Author-email: %s", dist.author_email) + if metadata_version_tuple >= (2, 4) and dist.license_expression: + write_output("License-Expression: %s", dist.license_expression) + else: + write_output("License: %s", dist.license) + write_output("Location: %s", dist.location) + if dist.editable_project_location is not None: + write_output( + "Editable project location: %s", dist.editable_project_location + ) + write_output("Requires: %s", ", ".join(dist.requires)) + write_output("Required-by: %s", ", ".join(dist.required_by)) + + if verbose: + write_output("Metadata-Version: %s", dist.metadata_version) + write_output("Installer: %s", dist.installer) + write_output("Classifiers:") + for classifier in dist.classifiers: + write_output(" %s", classifier) + write_output("Entry-points:") + for entry in dist.entry_points: + write_output(" %s", entry.strip()) + write_output("Project-URLs:") + for project_url in dist.project_urls: + write_output(" %s", project_url) + if list_files: + write_output("Files:") + if dist.files is None: + write_output("Cannot locate RECORD or installed-files.txt") + else: + for line in dist.files: + write_output(" %s", line.strip()) + return results_printed diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/commands/uninstall.py b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/commands/uninstall.py new file mode 100644 index 0000000000000000000000000000000000000000..9c4f031f934fd4aae78349e1c01eb4b765711357 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/commands/uninstall.py @@ -0,0 +1,113 @@ +import logging +from optparse import Values + +from pip._vendor.packaging.utils import canonicalize_name + +from pip._internal.cli import cmdoptions +from pip._internal.cli.base_command import Command +from pip._internal.cli.index_command import SessionCommandMixin +from pip._internal.cli.status_codes import SUCCESS +from pip._internal.exceptions import InstallationError +from pip._internal.req import parse_requirements +from pip._internal.req.constructors import ( + install_req_from_line, + install_req_from_parsed_requirement, +) +from pip._internal.utils.misc import ( + check_externally_managed, + protect_pip_from_modification_on_windows, + warn_if_run_as_root, +) + +logger = logging.getLogger(__name__) + + +class UninstallCommand(Command, SessionCommandMixin): + """ + Uninstall packages. + + pip is able to uninstall most installed packages. Known exceptions are: + + - Pure distutils packages installed with ``python setup.py install``, which + leave behind no metadata to determine what files were installed. + - Script wrappers installed by ``python setup.py develop``. + """ + + usage = """ + %prog [options] ... + %prog [options] -r ...""" + + def add_options(self) -> None: + self.cmd_opts.add_option( + "-r", + "--requirement", + dest="requirements", + action="append", + default=[], + metavar="file", + help=( + "Uninstall all the packages listed in the given requirements " + "file. This option can be used multiple times." + ), + ) + self.cmd_opts.add_option( + "-y", + "--yes", + dest="yes", + action="store_true", + help="Don't ask for confirmation of uninstall deletions.", + ) + self.cmd_opts.add_option(cmdoptions.root_user_action()) + self.cmd_opts.add_option(cmdoptions.override_externally_managed()) + self.parser.insert_option_group(0, self.cmd_opts) + + def run(self, options: Values, args: list[str]) -> int: + session = self.get_default_session(options) + + reqs_to_uninstall = {} + for name in args: + req = install_req_from_line( + name, + isolated=options.isolated_mode, + ) + if req.name: + reqs_to_uninstall[canonicalize_name(req.name)] = req + else: + logger.warning( + "Invalid requirement: %r ignored -" + " the uninstall command expects named" + " requirements.", + name, + ) + for filename in options.requirements: + for parsed_req in parse_requirements( + filename, options=options, session=session + ): + req = install_req_from_parsed_requirement( + parsed_req, isolated=options.isolated_mode + ) + if req.name: + reqs_to_uninstall[canonicalize_name(req.name)] = req + if not reqs_to_uninstall: + raise InstallationError( + f"You must give at least one requirement to {self.name} (see " + f'"pip help {self.name}")' + ) + + if not options.override_externally_managed: + check_externally_managed() + + protect_pip_from_modification_on_windows( + modifying_pip="pip" in reqs_to_uninstall + ) + + for req in reqs_to_uninstall.values(): + uninstall_pathset = req.uninstall( + auto_confirm=options.yes, + verbose=self.verbosity > 0, + ) + if uninstall_pathset: + uninstall_pathset.commit() + if options.root_user_action == "warn": + warn_if_run_as_root() + return SUCCESS diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/distributions/__init__.py b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/distributions/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..9a89a838b9a5cb264e9ae9d269fbedca6e2d6333 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/distributions/__init__.py @@ -0,0 +1,21 @@ +from pip._internal.distributions.base import AbstractDistribution +from pip._internal.distributions.sdist import SourceDistribution +from pip._internal.distributions.wheel import WheelDistribution +from pip._internal.req.req_install import InstallRequirement + + +def make_distribution_for_install_requirement( + install_req: InstallRequirement, +) -> AbstractDistribution: + """Returns a Distribution for the given InstallRequirement""" + # Editable requirements will always be source distributions. They use the + # legacy logic until we create a modern standard for them. + if install_req.editable: + return SourceDistribution(install_req) + + # If it's a wheel, it's a WheelDistribution + if install_req.is_wheel: + return WheelDistribution(install_req) + + # Otherwise, a SourceDistribution + return SourceDistribution(install_req) diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/distributions/__pycache__/__init__.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/distributions/__pycache__/__init__.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..ad8b1a15ffe5f9d07198a53adf25bc1a4cc50f5a Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/distributions/__pycache__/__init__.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/distributions/__pycache__/base.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/distributions/__pycache__/base.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..cc54f881762c29794d51654fe76fc0e50483f2cf Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/distributions/__pycache__/base.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/distributions/__pycache__/installed.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/distributions/__pycache__/installed.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..8da3eb574274fe157222e1d2fa12d8f420f42656 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/distributions/__pycache__/installed.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/distributions/__pycache__/sdist.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/distributions/__pycache__/sdist.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..baf12071f5179fc4afb61aa811910ab8fad0fd57 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/distributions/__pycache__/sdist.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/distributions/__pycache__/wheel.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/distributions/__pycache__/wheel.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..cb00e2192b93d64af086885992f4442e8cda60dd Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/distributions/__pycache__/wheel.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/distributions/base.py b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/distributions/base.py new file mode 100644 index 0000000000000000000000000000000000000000..ea61f3501e7ff8f16575ad00b54fc48a8595580f --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/distributions/base.py @@ -0,0 +1,55 @@ +from __future__ import annotations + +import abc +from typing import TYPE_CHECKING + +from pip._internal.metadata.base import BaseDistribution +from pip._internal.req import InstallRequirement + +if TYPE_CHECKING: + from pip._internal.build_env import BuildEnvironmentInstaller + + +class AbstractDistribution(metaclass=abc.ABCMeta): + """A base class for handling installable artifacts. + + The requirements for anything installable are as follows: + + - we must be able to determine the requirement name + (or we can't correctly handle the non-upgrade case). + + - for packages with setup requirements, we must also be able + to determine their requirements without installing additional + packages (for the same reason as run-time dependencies) + + - we must be able to create a Distribution object exposing the + above metadata. + + - if we need to do work in the build tracker, we must be able to generate a unique + string to identify the requirement in the build tracker. + """ + + def __init__(self, req: InstallRequirement) -> None: + super().__init__() + self.req = req + + @abc.abstractproperty + def build_tracker_id(self) -> str | None: + """A string that uniquely identifies this requirement to the build tracker. + + If None, then this dist has no work to do in the build tracker, and + ``.prepare_distribution_metadata()`` will not be called.""" + raise NotImplementedError() + + @abc.abstractmethod + def get_metadata_distribution(self) -> BaseDistribution: + raise NotImplementedError() + + @abc.abstractmethod + def prepare_distribution_metadata( + self, + build_env_installer: BuildEnvironmentInstaller, + build_isolation: bool, + check_build_deps: bool, + ) -> None: + raise NotImplementedError() diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/distributions/sdist.py b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/distributions/sdist.py new file mode 100644 index 0000000000000000000000000000000000000000..e2821f89e0052f2b9c05c17cde87cc97e57bd474 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/distributions/sdist.py @@ -0,0 +1,165 @@ +from __future__ import annotations + +import logging +from collections.abc import Iterable +from typing import TYPE_CHECKING + +from pip._internal.build_env import BuildEnvironment +from pip._internal.distributions.base import AbstractDistribution +from pip._internal.exceptions import InstallationError +from pip._internal.metadata import BaseDistribution +from pip._internal.utils.subprocess import runner_with_spinner_message + +if TYPE_CHECKING: + from pip._internal.build_env import BuildEnvironmentInstaller + +logger = logging.getLogger(__name__) + + +class SourceDistribution(AbstractDistribution): + """Represents a source distribution. + + The preparation step for these needs metadata for the packages to be + generated, either using PEP 517 or using the legacy `setup.py egg_info`. + """ + + @property + def build_tracker_id(self) -> str | None: + """Identify this requirement uniquely by its link.""" + assert self.req.link + return self.req.link.url_without_fragment + + def get_metadata_distribution(self) -> BaseDistribution: + return self.req.get_dist() + + def prepare_distribution_metadata( + self, + build_env_installer: BuildEnvironmentInstaller, + build_isolation: bool, + check_build_deps: bool, + ) -> None: + # Load pyproject.toml, to determine whether PEP 517 is to be used + self.req.load_pyproject_toml() + + # Set up the build isolation, if this requirement should be isolated + should_isolate = self.req.use_pep517 and build_isolation + if should_isolate: + # Setup an isolated environment and install the build backend static + # requirements in it. + self._prepare_build_backend(build_env_installer) + # Check that if the requirement is editable, it either supports PEP 660 or + # has a setup.py or a setup.cfg. This cannot be done earlier because we need + # to setup the build backend to verify it supports build_editable, nor can + # it be done later, because we want to avoid installing build requirements + # needlessly. Doing it here also works around setuptools generating + # UNKNOWN.egg-info when running get_requires_for_build_wheel on a directory + # without setup.py nor setup.cfg. + self.req.isolated_editable_sanity_check() + # Install the dynamic build requirements. + self._install_build_reqs(build_env_installer) + # Check if the current environment provides build dependencies + should_check_deps = self.req.use_pep517 and check_build_deps + if should_check_deps: + pyproject_requires = self.req.pyproject_requires + assert pyproject_requires is not None + conflicting, missing = self.req.build_env.check_requirements( + pyproject_requires + ) + if conflicting: + self._raise_conflicts("the backend dependencies", conflicting) + if missing: + self._raise_missing_reqs(missing) + self.req.prepare_metadata() + + def _prepare_build_backend( + self, build_env_installer: BuildEnvironmentInstaller + ) -> None: + # Isolate in a BuildEnvironment and install the build-time + # requirements. + pyproject_requires = self.req.pyproject_requires + assert pyproject_requires is not None + + self.req.build_env = BuildEnvironment(build_env_installer) + self.req.build_env.install_requirements( + pyproject_requires, "overlay", kind="build dependencies", for_req=self.req + ) + conflicting, missing = self.req.build_env.check_requirements( + self.req.requirements_to_check + ) + if conflicting: + self._raise_conflicts("PEP 517/518 supported requirements", conflicting) + if missing: + logger.warning( + "Missing build requirements in pyproject.toml for %s.", + self.req, + ) + logger.warning( + "The project does not specify a build backend, and " + "pip cannot fall back to setuptools without %s.", + " and ".join(map(repr, sorted(missing))), + ) + + def _get_build_requires_wheel(self) -> Iterable[str]: + with self.req.build_env: + runner = runner_with_spinner_message("Getting requirements to build wheel") + backend = self.req.pep517_backend + assert backend is not None + with backend.subprocess_runner(runner): + return backend.get_requires_for_build_wheel() + + def _get_build_requires_editable(self) -> Iterable[str]: + with self.req.build_env: + runner = runner_with_spinner_message( + "Getting requirements to build editable" + ) + backend = self.req.pep517_backend + assert backend is not None + with backend.subprocess_runner(runner): + return backend.get_requires_for_build_editable() + + def _install_build_reqs( + self, build_env_installer: BuildEnvironmentInstaller + ) -> None: + # Install any extra build dependencies that the backend requests. + # This must be done in a second pass, as the pyproject.toml + # dependencies must be installed before we can call the backend. + if ( + self.req.editable + and self.req.permit_editable_wheels + and self.req.supports_pyproject_editable + ): + build_reqs = self._get_build_requires_editable() + else: + build_reqs = self._get_build_requires_wheel() + conflicting, missing = self.req.build_env.check_requirements(build_reqs) + if conflicting: + self._raise_conflicts("the backend dependencies", conflicting) + self.req.build_env.install_requirements( + missing, "normal", kind="backend dependencies", for_req=self.req + ) + + def _raise_conflicts( + self, conflicting_with: str, conflicting_reqs: set[tuple[str, str]] + ) -> None: + format_string = ( + "Some build dependencies for {requirement} " + "conflict with {conflicting_with}: {description}." + ) + error_message = format_string.format( + requirement=self.req, + conflicting_with=conflicting_with, + description=", ".join( + f"{installed} is incompatible with {wanted}" + for installed, wanted in sorted(conflicting_reqs) + ), + ) + raise InstallationError(error_message) + + def _raise_missing_reqs(self, missing: set[str]) -> None: + format_string = ( + "Some build dependencies for {requirement} are missing: {missing}." + ) + error_message = format_string.format( + requirement=self.req, missing=", ".join(map(repr, sorted(missing))) + ) + raise InstallationError(error_message) diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/distributions/wheel.py b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/distributions/wheel.py new file mode 100644 index 0000000000000000000000000000000000000000..ee12bfadc2e9ed04a9e7e4e597d2a95ab8980c82 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/distributions/wheel.py @@ -0,0 +1,44 @@ +from __future__ import annotations + +from typing import TYPE_CHECKING + +from pip._vendor.packaging.utils import canonicalize_name + +from pip._internal.distributions.base import AbstractDistribution +from pip._internal.metadata import ( + BaseDistribution, + FilesystemWheel, + get_wheel_distribution, +) + +if TYPE_CHECKING: + from pip._internal.build_env import BuildEnvironmentInstaller + + +class WheelDistribution(AbstractDistribution): + """Represents a wheel distribution. + + This does not need any preparation as wheels can be directly unpacked. + """ + + @property + def build_tracker_id(self) -> str | None: + return None + + def get_metadata_distribution(self) -> BaseDistribution: + """Loads the metadata from the wheel file into memory and returns a + Distribution that uses it, not relying on the wheel file or + requirement. + """ + assert self.req.local_file_path, "Set as part of preparation during download" + assert self.req.name, "Wheels are never unnamed" + wheel = FilesystemWheel(self.req.local_file_path) + return get_wheel_distribution(wheel, canonicalize_name(self.req.name)) + + def prepare_distribution_metadata( + self, + build_env_installer: BuildEnvironmentInstaller, + build_isolation: bool, + check_build_deps: bool, + ) -> None: + pass diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/index/__init__.py b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/index/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..197dd757de979bf116810a678a9c07baeaa7dba1 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/index/__init__.py @@ -0,0 +1 @@ +"""Index interaction code""" diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/index/__pycache__/__init__.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/index/__pycache__/__init__.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..6b2a115be136fa8ada24c17de32cf97931ab86d8 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/index/__pycache__/__init__.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/index/__pycache__/collector.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/index/__pycache__/collector.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..28fc139577b267c2450f5a2bea3161d63a6def09 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/index/__pycache__/collector.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/index/__pycache__/package_finder.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/index/__pycache__/package_finder.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..acc8835781eb86076c347eb1459fdd485022a8d1 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/index/__pycache__/package_finder.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/index/__pycache__/sources.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/index/__pycache__/sources.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e5ae4df498c11a7570f1aa9cb9e483b19ae92e3e Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/index/__pycache__/sources.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/index/collector.py b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/index/collector.py new file mode 100644 index 0000000000000000000000000000000000000000..00d66daa3bf2a3246a07815984394b0b8103a6db --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/index/collector.py @@ -0,0 +1,489 @@ +""" +The main purpose of this module is to expose LinkCollector.collect_sources(). +""" + +from __future__ import annotations + +import collections +import email.message +import functools +import itertools +import json +import logging +import os +import urllib.parse +import urllib.request +from collections.abc import Iterable, MutableMapping, Sequence +from dataclasses import dataclass +from html.parser import HTMLParser +from optparse import Values +from typing import ( + Callable, + NamedTuple, + Protocol, +) + +from pip._vendor import requests +from pip._vendor.requests import Response +from pip._vendor.requests.exceptions import RetryError, SSLError + +from pip._internal.exceptions import NetworkConnectionError +from pip._internal.models.link import Link +from pip._internal.models.search_scope import SearchScope +from pip._internal.network.session import PipSession +from pip._internal.network.utils import raise_for_status +from pip._internal.utils.filetypes import is_archive_file +from pip._internal.utils.misc import redact_auth_from_url +from pip._internal.vcs import vcs + +from .sources import CandidatesFromPage, LinkSource, build_source + +logger = logging.getLogger(__name__) + +ResponseHeaders = MutableMapping[str, str] + + +def _match_vcs_scheme(url: str) -> str | None: + """Look for VCS schemes in the URL. + + Returns the matched VCS scheme, or None if there's no match. + """ + for scheme in vcs.schemes: + if url.lower().startswith(scheme) and url[len(scheme)] in "+:": + return scheme + return None + + +class _NotAPIContent(Exception): + def __init__(self, content_type: str, request_desc: str) -> None: + super().__init__(content_type, request_desc) + self.content_type = content_type + self.request_desc = request_desc + + +def _ensure_api_header(response: Response) -> None: + """ + Check the Content-Type header to ensure the response contains a Simple + API Response. + + Raises `_NotAPIContent` if the content type is not a valid content-type. + """ + content_type = response.headers.get("Content-Type", "Unknown") + + content_type_l = content_type.lower() + if content_type_l.startswith( + ( + "text/html", + "application/vnd.pypi.simple.v1+html", + "application/vnd.pypi.simple.v1+json", + ) + ): + return + + raise _NotAPIContent(content_type, response.request.method) + + +class _NotHTTP(Exception): + pass + + +def _ensure_api_response(url: str, session: PipSession) -> None: + """ + Send a HEAD request to the URL, and ensure the response contains a simple + API Response. + + Raises `_NotHTTP` if the URL is not available for a HEAD request, or + `_NotAPIContent` if the content type is not a valid content type. + """ + scheme, netloc, path, query, fragment = urllib.parse.urlsplit(url) + if scheme not in {"http", "https"}: + raise _NotHTTP() + + resp = session.head(url, allow_redirects=True) + raise_for_status(resp) + + _ensure_api_header(resp) + + +def _get_simple_response(url: str, session: PipSession) -> Response: + """Access an Simple API response with GET, and return the response. + + This consists of three parts: + + 1. If the URL looks suspiciously like an archive, send a HEAD first to + check the Content-Type is HTML or Simple API, to avoid downloading a + large file. Raise `_NotHTTP` if the content type cannot be determined, or + `_NotAPIContent` if it is not HTML or a Simple API. + 2. Actually perform the request. Raise HTTP exceptions on network failures. + 3. Check the Content-Type header to make sure we got a Simple API response, + and raise `_NotAPIContent` otherwise. + """ + if is_archive_file(Link(url).filename): + _ensure_api_response(url, session=session) + + logger.debug("Getting page %s", redact_auth_from_url(url)) + + resp = session.get( + url, + headers={ + "Accept": ", ".join( + [ + "application/vnd.pypi.simple.v1+json", + "application/vnd.pypi.simple.v1+html; q=0.1", + "text/html; q=0.01", + ] + ), + # We don't want to blindly returned cached data for + # /simple/, because authors generally expecting that + # twine upload && pip install will function, but if + # they've done a pip install in the last ~10 minutes + # it won't. Thus by setting this to zero we will not + # blindly use any cached data, however the benefit of + # using max-age=0 instead of no-cache, is that we will + # still support conditional requests, so we will still + # minimize traffic sent in cases where the page hasn't + # changed at all, we will just always incur the round + # trip for the conditional GET now instead of only + # once per 10 minutes. + # For more information, please see pypa/pip#5670. + "Cache-Control": "max-age=0", + }, + ) + raise_for_status(resp) + + # The check for archives above only works if the url ends with + # something that looks like an archive. However that is not a + # requirement of an url. Unless we issue a HEAD request on every + # url we cannot know ahead of time for sure if something is a + # Simple API response or not. However we can check after we've + # downloaded it. + _ensure_api_header(resp) + + logger.debug( + "Fetched page %s as %s", + redact_auth_from_url(url), + resp.headers.get("Content-Type", "Unknown"), + ) + + return resp + + +def _get_encoding_from_headers(headers: ResponseHeaders) -> str | None: + """Determine if we have any encoding information in our headers.""" + if headers and "Content-Type" in headers: + m = email.message.Message() + m["content-type"] = headers["Content-Type"] + charset = m.get_param("charset") + if charset: + return str(charset) + return None + + +class CacheablePageContent: + def __init__(self, page: IndexContent) -> None: + assert page.cache_link_parsing + self.page = page + + def __eq__(self, other: object) -> bool: + return isinstance(other, type(self)) and self.page.url == other.page.url + + def __hash__(self) -> int: + return hash(self.page.url) + + +class ParseLinks(Protocol): + def __call__(self, page: IndexContent) -> Iterable[Link]: ... + + +def with_cached_index_content(fn: ParseLinks) -> ParseLinks: + """ + Given a function that parses an Iterable[Link] from an IndexContent, cache the + function's result (keyed by CacheablePageContent), unless the IndexContent + `page` has `page.cache_link_parsing == False`. + """ + + @functools.cache + def wrapper(cacheable_page: CacheablePageContent) -> list[Link]: + return list(fn(cacheable_page.page)) + + @functools.wraps(fn) + def wrapper_wrapper(page: IndexContent) -> list[Link]: + if page.cache_link_parsing: + return wrapper(CacheablePageContent(page)) + return list(fn(page)) + + return wrapper_wrapper + + +@with_cached_index_content +def parse_links(page: IndexContent) -> Iterable[Link]: + """ + Parse a Simple API's Index Content, and yield its anchor elements as Link objects. + """ + + content_type_l = page.content_type.lower() + if content_type_l.startswith("application/vnd.pypi.simple.v1+json"): + data = json.loads(page.content) + for file in data.get("files", []): + link = Link.from_json(file, page.url) + if link is None: + continue + yield link + return + + parser = HTMLLinkParser(page.url) + encoding = page.encoding or "utf-8" + parser.feed(page.content.decode(encoding)) + + url = page.url + base_url = parser.base_url or url + for anchor in parser.anchors: + link = Link.from_element(anchor, page_url=url, base_url=base_url) + if link is None: + continue + yield link + + +@dataclass(frozen=True) +class IndexContent: + """Represents one response (or page), along with its URL. + + :param encoding: the encoding to decode the given content. + :param url: the URL from which the HTML was downloaded. + :param cache_link_parsing: whether links parsed from this page's url + should be cached. PyPI index urls should + have this set to False, for example. + """ + + content: bytes + content_type: str + encoding: str | None + url: str + cache_link_parsing: bool = True + + def __str__(self) -> str: + return redact_auth_from_url(self.url) + + +class HTMLLinkParser(HTMLParser): + """ + HTMLParser that keeps the first base HREF and a list of all anchor + elements' attributes. + """ + + def __init__(self, url: str) -> None: + super().__init__(convert_charrefs=True) + + self.url: str = url + self.base_url: str | None = None + self.anchors: list[dict[str, str | None]] = [] + + def handle_starttag(self, tag: str, attrs: list[tuple[str, str | None]]) -> None: + if tag == "base" and self.base_url is None: + href = self.get_href(attrs) + if href is not None: + self.base_url = href + elif tag == "a": + self.anchors.append(dict(attrs)) + + def get_href(self, attrs: list[tuple[str, str | None]]) -> str | None: + for name, value in attrs: + if name == "href": + return value + return None + + +def _handle_get_simple_fail( + link: Link, + reason: str | Exception, + meth: Callable[..., None] | None = None, +) -> None: + if meth is None: + meth = logger.debug + meth("Could not fetch URL %s: %s - skipping", link, reason) + + +def _make_index_content( + response: Response, cache_link_parsing: bool = True +) -> IndexContent: + encoding = _get_encoding_from_headers(response.headers) + return IndexContent( + response.content, + response.headers["Content-Type"], + encoding=encoding, + url=response.url, + cache_link_parsing=cache_link_parsing, + ) + + +def _get_index_content(link: Link, *, session: PipSession) -> IndexContent | None: + url = link.url.split("#", 1)[0] + + # Check for VCS schemes that do not support lookup as web pages. + vcs_scheme = _match_vcs_scheme(url) + if vcs_scheme: + logger.warning( + "Cannot look at %s URL %s because it does not support lookup as web pages.", + vcs_scheme, + link, + ) + return None + + # Tack index.html onto file:// URLs that point to directories + scheme, _, path, _, _, _ = urllib.parse.urlparse(url) + if scheme == "file" and os.path.isdir(urllib.request.url2pathname(path)): + # add trailing slash if not present so urljoin doesn't trim + # final segment + if not url.endswith("/"): + url += "/" + # TODO: In the future, it would be nice if pip supported PEP 691 + # style responses in the file:// URLs, however there's no + # standard file extension for application/vnd.pypi.simple.v1+json + # so we'll need to come up with something on our own. + url = urllib.parse.urljoin(url, "index.html") + logger.debug(" file: URL is directory, getting %s", url) + + try: + resp = _get_simple_response(url, session=session) + except _NotHTTP: + logger.warning( + "Skipping page %s because it looks like an archive, and cannot " + "be checked by a HTTP HEAD request.", + link, + ) + except _NotAPIContent as exc: + logger.warning( + "Skipping page %s because the %s request got Content-Type: %s. " + "The only supported Content-Types are application/vnd.pypi.simple.v1+json, " + "application/vnd.pypi.simple.v1+html, and text/html", + link, + exc.request_desc, + exc.content_type, + ) + except NetworkConnectionError as exc: + _handle_get_simple_fail(link, exc) + except RetryError as exc: + _handle_get_simple_fail(link, exc) + except SSLError as exc: + reason = "There was a problem confirming the ssl certificate: " + reason += str(exc) + _handle_get_simple_fail(link, reason, meth=logger.info) + except requests.ConnectionError as exc: + _handle_get_simple_fail(link, f"connection error: {exc}") + except requests.Timeout: + _handle_get_simple_fail(link, "timed out") + else: + return _make_index_content(resp, cache_link_parsing=link.cache_link_parsing) + return None + + +class CollectedSources(NamedTuple): + find_links: Sequence[LinkSource | None] + index_urls: Sequence[LinkSource | None] + + +class LinkCollector: + """ + Responsible for collecting Link objects from all configured locations, + making network requests as needed. + + The class's main method is its collect_sources() method. + """ + + def __init__( + self, + session: PipSession, + search_scope: SearchScope, + ) -> None: + self.search_scope = search_scope + self.session = session + + @classmethod + def create( + cls, + session: PipSession, + options: Values, + suppress_no_index: bool = False, + ) -> LinkCollector: + """ + :param session: The Session to use to make requests. + :param suppress_no_index: Whether to ignore the --no-index option + when constructing the SearchScope object. + """ + index_urls = [options.index_url] + options.extra_index_urls + if options.no_index and not suppress_no_index: + logger.debug( + "Ignoring indexes: %s", + ",".join(redact_auth_from_url(url) for url in index_urls), + ) + index_urls = [] + + # Make sure find_links is a list before passing to create(). + find_links = options.find_links or [] + + search_scope = SearchScope.create( + find_links=find_links, + index_urls=index_urls, + no_index=options.no_index, + ) + link_collector = LinkCollector( + session=session, + search_scope=search_scope, + ) + return link_collector + + @property + def find_links(self) -> list[str]: + return self.search_scope.find_links + + def fetch_response(self, location: Link) -> IndexContent | None: + """ + Fetch an HTML page containing package links. + """ + return _get_index_content(location, session=self.session) + + def collect_sources( + self, + project_name: str, + candidates_from_page: CandidatesFromPage, + ) -> CollectedSources: + # The OrderedDict calls deduplicate sources by URL. + index_url_sources = collections.OrderedDict( + build_source( + loc, + candidates_from_page=candidates_from_page, + page_validator=self.session.is_secure_origin, + expand_dir=False, + cache_link_parsing=False, + project_name=project_name, + ) + for loc in self.search_scope.get_index_urls_locations(project_name) + ).values() + find_links_sources = collections.OrderedDict( + build_source( + loc, + candidates_from_page=candidates_from_page, + page_validator=self.session.is_secure_origin, + expand_dir=True, + cache_link_parsing=True, + project_name=project_name, + ) + for loc in self.find_links + ).values() + + if logger.isEnabledFor(logging.DEBUG): + lines = [ + f"* {s.link}" + for s in itertools.chain(find_links_sources, index_url_sources) + if s is not None and s.link is not None + ] + lines = [ + f"{len(lines)} location(s) to search " + f"for versions of {project_name}:" + ] + lines + logger.debug("\n".join(lines)) + + return CollectedSources( + find_links=list(find_links_sources), + index_urls=list(index_url_sources), + ) diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/index/package_finder.py b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/index/package_finder.py new file mode 100644 index 0000000000000000000000000000000000000000..bc523cd42d830679f4e467632fda3fc57ecca071 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/index/package_finder.py @@ -0,0 +1,1059 @@ +"""Routines related to PyPI, indexes""" + +from __future__ import annotations + +import enum +import functools +import itertools +import logging +import re +from collections.abc import Iterable +from dataclasses import dataclass +from typing import ( + TYPE_CHECKING, + Optional, + Union, +) + +from pip._vendor.packaging import specifiers +from pip._vendor.packaging.tags import Tag +from pip._vendor.packaging.utils import canonicalize_name +from pip._vendor.packaging.version import InvalidVersion, _BaseVersion +from pip._vendor.packaging.version import parse as parse_version + +from pip._internal.exceptions import ( + BestVersionAlreadyInstalled, + DistributionNotFound, + InvalidWheelFilename, + UnsupportedWheel, +) +from pip._internal.index.collector import LinkCollector, parse_links +from pip._internal.models.candidate import InstallationCandidate +from pip._internal.models.format_control import FormatControl +from pip._internal.models.link import Link +from pip._internal.models.search_scope import SearchScope +from pip._internal.models.selection_prefs import SelectionPreferences +from pip._internal.models.target_python import TargetPython +from pip._internal.models.wheel import Wheel +from pip._internal.req import InstallRequirement +from pip._internal.utils._log import getLogger +from pip._internal.utils.filetypes import WHEEL_EXTENSION +from pip._internal.utils.hashes import Hashes +from pip._internal.utils.logging import indent_log +from pip._internal.utils.misc import build_netloc +from pip._internal.utils.packaging import check_requires_python +from pip._internal.utils.unpacking import SUPPORTED_EXTENSIONS + +if TYPE_CHECKING: + from typing_extensions import TypeGuard + +__all__ = ["FormatControl", "BestCandidateResult", "PackageFinder"] + + +logger = getLogger(__name__) + +BuildTag = Union[tuple[()], tuple[int, str]] +CandidateSortingKey = tuple[int, int, int, _BaseVersion, Optional[int], BuildTag] + + +def _check_link_requires_python( + link: Link, + version_info: tuple[int, int, int], + ignore_requires_python: bool = False, +) -> bool: + """ + Return whether the given Python version is compatible with a link's + "Requires-Python" value. + + :param version_info: A 3-tuple of ints representing the Python + major-minor-micro version to check. + :param ignore_requires_python: Whether to ignore the "Requires-Python" + value if the given Python version isn't compatible. + """ + try: + is_compatible = check_requires_python( + link.requires_python, + version_info=version_info, + ) + except specifiers.InvalidSpecifier: + logger.debug( + "Ignoring invalid Requires-Python (%r) for link: %s", + link.requires_python, + link, + ) + else: + if not is_compatible: + version = ".".join(map(str, version_info)) + if not ignore_requires_python: + logger.verbose( + "Link requires a different Python (%s not in: %r): %s", + version, + link.requires_python, + link, + ) + return False + + logger.debug( + "Ignoring failed Requires-Python check (%s not in: %r) for link: %s", + version, + link.requires_python, + link, + ) + + return True + + +class LinkType(enum.Enum): + candidate = enum.auto() + different_project = enum.auto() + yanked = enum.auto() + format_unsupported = enum.auto() + format_invalid = enum.auto() + platform_mismatch = enum.auto() + requires_python_mismatch = enum.auto() + + +class LinkEvaluator: + """ + Responsible for evaluating links for a particular project. + """ + + _py_version_re = re.compile(r"-py([123]\.?[0-9]?)$") + + # Don't include an allow_yanked default value to make sure each call + # site considers whether yanked releases are allowed. This also causes + # that decision to be made explicit in the calling code, which helps + # people when reading the code. + def __init__( + self, + project_name: str, + canonical_name: str, + formats: frozenset[str], + target_python: TargetPython, + allow_yanked: bool, + ignore_requires_python: bool | None = None, + ) -> None: + """ + :param project_name: The user supplied package name. + :param canonical_name: The canonical package name. + :param formats: The formats allowed for this package. Should be a set + with 'binary' or 'source' or both in it. + :param target_python: The target Python interpreter to use when + evaluating link compatibility. This is used, for example, to + check wheel compatibility, as well as when checking the Python + version, e.g. the Python version embedded in a link filename + (or egg fragment) and against an HTML link's optional PEP 503 + "data-requires-python" attribute. + :param allow_yanked: Whether files marked as yanked (in the sense + of PEP 592) are permitted to be candidates for install. + :param ignore_requires_python: Whether to ignore incompatible + PEP 503 "data-requires-python" values in HTML links. Defaults + to False. + """ + if ignore_requires_python is None: + ignore_requires_python = False + + self._allow_yanked = allow_yanked + self._canonical_name = canonical_name + self._ignore_requires_python = ignore_requires_python + self._formats = formats + self._target_python = target_python + + self.project_name = project_name + + def evaluate_link(self, link: Link) -> tuple[LinkType, str]: + """ + Determine whether a link is a candidate for installation. + + :return: A tuple (result, detail), where *result* is an enum + representing whether the evaluation found a candidate, or the reason + why one is not found. If a candidate is found, *detail* will be the + candidate's version string; if one is not found, it contains the + reason the link fails to qualify. + """ + version = None + if link.is_yanked and not self._allow_yanked: + reason = link.yanked_reason or "" + return (LinkType.yanked, f"yanked for reason: {reason}") + + if link.egg_fragment: + egg_info = link.egg_fragment + ext = link.ext + else: + egg_info, ext = link.splitext() + if not ext: + return (LinkType.format_unsupported, "not a file") + if ext not in SUPPORTED_EXTENSIONS: + return ( + LinkType.format_unsupported, + f"unsupported archive format: {ext}", + ) + if "binary" not in self._formats and ext == WHEEL_EXTENSION: + reason = f"No binaries permitted for {self.project_name}" + return (LinkType.format_unsupported, reason) + if "macosx10" in link.path and ext == ".zip": + return (LinkType.format_unsupported, "macosx10 one") + if ext == WHEEL_EXTENSION: + try: + wheel = Wheel(link.filename) + except InvalidWheelFilename: + return ( + LinkType.format_invalid, + "invalid wheel filename", + ) + if canonicalize_name(wheel.name) != self._canonical_name: + reason = f"wrong project name (not {self.project_name})" + return (LinkType.different_project, reason) + + supported_tags = self._target_python.get_unsorted_tags() + if not wheel.supported(supported_tags): + # Include the wheel's tags in the reason string to + # simplify troubleshooting compatibility issues. + file_tags = ", ".join(wheel.get_formatted_file_tags()) + reason = ( + f"none of the wheel's tags ({file_tags}) are compatible " + f"(run pip debug --verbose to show compatible tags)" + ) + return (LinkType.platform_mismatch, reason) + + version = wheel.version + + # This should be up by the self.ok_binary check, but see issue 2700. + if "source" not in self._formats and ext != WHEEL_EXTENSION: + reason = f"No sources permitted for {self.project_name}" + return (LinkType.format_unsupported, reason) + + if not version: + version = _extract_version_from_fragment( + egg_info, + self._canonical_name, + ) + if not version: + reason = f"Missing project version for {self.project_name}" + return (LinkType.format_invalid, reason) + + match = self._py_version_re.search(version) + if match: + version = version[: match.start()] + py_version = match.group(1) + if py_version != self._target_python.py_version: + return ( + LinkType.platform_mismatch, + "Python version is incorrect", + ) + + supports_python = _check_link_requires_python( + link, + version_info=self._target_python.py_version_info, + ignore_requires_python=self._ignore_requires_python, + ) + if not supports_python: + requires_python = link.requires_python + if requires_python: + + def get_version_sort_key(v: str) -> tuple[int, ...]: + return tuple(int(s) for s in v.split(".") if s.isdigit()) + + requires_python = ",".join( + sorted( + (str(s) for s in specifiers.SpecifierSet(requires_python)), + key=get_version_sort_key, + ) + ) + reason = f"{version} Requires-Python {requires_python}" + return (LinkType.requires_python_mismatch, reason) + + logger.debug("Found link %s, version: %s", link, version) + + return (LinkType.candidate, version) + + +def filter_unallowed_hashes( + candidates: list[InstallationCandidate], + hashes: Hashes | None, + project_name: str, +) -> list[InstallationCandidate]: + """ + Filter out candidates whose hashes aren't allowed, and return a new + list of candidates. + + If at least one candidate has an allowed hash, then all candidates with + either an allowed hash or no hash specified are returned. Otherwise, + the given candidates are returned. + + Including the candidates with no hash specified when there is a match + allows a warning to be logged if there is a more preferred candidate + with no hash specified. Returning all candidates in the case of no + matches lets pip report the hash of the candidate that would otherwise + have been installed (e.g. permitting the user to more easily update + their requirements file with the desired hash). + """ + if not hashes: + logger.debug( + "Given no hashes to check %s links for project %r: " + "discarding no candidates", + len(candidates), + project_name, + ) + # Make sure we're not returning back the given value. + return list(candidates) + + matches_or_no_digest = [] + # Collect the non-matches for logging purposes. + non_matches = [] + match_count = 0 + for candidate in candidates: + link = candidate.link + if not link.has_hash: + pass + elif link.is_hash_allowed(hashes=hashes): + match_count += 1 + else: + non_matches.append(candidate) + continue + + matches_or_no_digest.append(candidate) + + if match_count: + filtered = matches_or_no_digest + else: + # Make sure we're not returning back the given value. + filtered = list(candidates) + + if len(filtered) == len(candidates): + discard_message = "discarding no candidates" + else: + discard_message = "discarding {} non-matches:\n {}".format( + len(non_matches), + "\n ".join(str(candidate.link) for candidate in non_matches), + ) + + logger.debug( + "Checked %s links for project %r against %s hashes " + "(%s matches, %s no digest): %s", + len(candidates), + project_name, + hashes.digest_count, + match_count, + len(matches_or_no_digest) - match_count, + discard_message, + ) + + return filtered + + +@dataclass +class CandidatePreferences: + """ + Encapsulates some of the preferences for filtering and sorting + InstallationCandidate objects. + """ + + prefer_binary: bool = False + allow_all_prereleases: bool = False + + +@dataclass(frozen=True) +class BestCandidateResult: + """A collection of candidates, returned by `PackageFinder.find_best_candidate`. + + This class is only intended to be instantiated by CandidateEvaluator's + `compute_best_candidate()` method. + + :param all_candidates: A sequence of all available candidates found. + :param applicable_candidates: The applicable candidates. + :param best_candidate: The most preferred candidate found, or None + if no applicable candidates were found. + """ + + all_candidates: list[InstallationCandidate] + applicable_candidates: list[InstallationCandidate] + best_candidate: InstallationCandidate | None + + def __post_init__(self) -> None: + assert set(self.applicable_candidates) <= set(self.all_candidates) + + if self.best_candidate is None: + assert not self.applicable_candidates + else: + assert self.best_candidate in self.applicable_candidates + + +class CandidateEvaluator: + """ + Responsible for filtering and sorting candidates for installation based + on what tags are valid. + """ + + @classmethod + def create( + cls, + project_name: str, + target_python: TargetPython | None = None, + prefer_binary: bool = False, + allow_all_prereleases: bool = False, + specifier: specifiers.BaseSpecifier | None = None, + hashes: Hashes | None = None, + ) -> CandidateEvaluator: + """Create a CandidateEvaluator object. + + :param target_python: The target Python interpreter to use when + checking compatibility. If None (the default), a TargetPython + object will be constructed from the running Python. + :param specifier: An optional object implementing `filter` + (e.g. `packaging.specifiers.SpecifierSet`) to filter applicable + versions. + :param hashes: An optional collection of allowed hashes. + """ + if target_python is None: + target_python = TargetPython() + if specifier is None: + specifier = specifiers.SpecifierSet() + + supported_tags = target_python.get_sorted_tags() + + return cls( + project_name=project_name, + supported_tags=supported_tags, + specifier=specifier, + prefer_binary=prefer_binary, + allow_all_prereleases=allow_all_prereleases, + hashes=hashes, + ) + + def __init__( + self, + project_name: str, + supported_tags: list[Tag], + specifier: specifiers.BaseSpecifier, + prefer_binary: bool = False, + allow_all_prereleases: bool = False, + hashes: Hashes | None = None, + ) -> None: + """ + :param supported_tags: The PEP 425 tags supported by the target + Python in order of preference (most preferred first). + """ + self._allow_all_prereleases = allow_all_prereleases + self._hashes = hashes + self._prefer_binary = prefer_binary + self._project_name = project_name + self._specifier = specifier + self._supported_tags = supported_tags + # Since the index of the tag in the _supported_tags list is used + # as a priority, precompute a map from tag to index/priority to be + # used in wheel.find_most_preferred_tag. + self._wheel_tag_preferences = { + tag: idx for idx, tag in enumerate(supported_tags) + } + + def get_applicable_candidates( + self, + candidates: list[InstallationCandidate], + ) -> list[InstallationCandidate]: + """ + Return the applicable candidates from a list of candidates. + """ + # Using None infers from the specifier instead. + allow_prereleases = self._allow_all_prereleases or None + specifier = self._specifier + + # We turn the version object into a str here because otherwise + # when we're debundled but setuptools isn't, Python will see + # packaging.version.Version and + # pkg_resources._vendor.packaging.version.Version as different + # types. This way we'll use a str as a common data interchange + # format. If we stop using the pkg_resources provided specifier + # and start using our own, we can drop the cast to str(). + candidates_and_versions = [(c, str(c.version)) for c in candidates] + versions = set( + specifier.filter( + (v for _, v in candidates_and_versions), + prereleases=allow_prereleases, + ) + ) + + applicable_candidates = [c for c, v in candidates_and_versions if v in versions] + filtered_applicable_candidates = filter_unallowed_hashes( + candidates=applicable_candidates, + hashes=self._hashes, + project_name=self._project_name, + ) + + return sorted(filtered_applicable_candidates, key=self._sort_key) + + def _sort_key(self, candidate: InstallationCandidate) -> CandidateSortingKey: + """ + Function to pass as the `key` argument to a call to sorted() to sort + InstallationCandidates by preference. + + Returns a tuple such that tuples sorting as greater using Python's + default comparison operator are more preferred. + + The preference is as follows: + + First and foremost, candidates with allowed (matching) hashes are + always preferred over candidates without matching hashes. This is + because e.g. if the only candidate with an allowed hash is yanked, + we still want to use that candidate. + + Second, excepting hash considerations, candidates that have been + yanked (in the sense of PEP 592) are always less preferred than + candidates that haven't been yanked. Then: + + If not finding wheels, they are sorted by version only. + If finding wheels, then the sort order is by version, then: + 1. existing installs + 2. wheels ordered via Wheel.support_index_min(self._supported_tags) + 3. source archives + If prefer_binary was set, then all wheels are sorted above sources. + + Note: it was considered to embed this logic into the Link + comparison operators, but then different sdist links + with the same version, would have to be considered equal + """ + valid_tags = self._supported_tags + support_num = len(valid_tags) + build_tag: BuildTag = () + binary_preference = 0 + link = candidate.link + if link.is_wheel: + # can raise InvalidWheelFilename + wheel = Wheel(link.filename) + try: + pri = -( + wheel.find_most_preferred_tag( + valid_tags, self._wheel_tag_preferences + ) + ) + except ValueError: + raise UnsupportedWheel( + f"{wheel.filename} is not a supported wheel for this platform. It " + "can't be sorted." + ) + if self._prefer_binary: + binary_preference = 1 + build_tag = wheel.build_tag + else: # sdist + pri = -(support_num) + has_allowed_hash = int(link.is_hash_allowed(self._hashes)) + yank_value = -1 * int(link.is_yanked) # -1 for yanked. + return ( + has_allowed_hash, + yank_value, + binary_preference, + candidate.version, + pri, + build_tag, + ) + + def sort_best_candidate( + self, + candidates: list[InstallationCandidate], + ) -> InstallationCandidate | None: + """ + Return the best candidate per the instance's sort order, or None if + no candidate is acceptable. + """ + if not candidates: + return None + best_candidate = max(candidates, key=self._sort_key) + return best_candidate + + def compute_best_candidate( + self, + candidates: list[InstallationCandidate], + ) -> BestCandidateResult: + """ + Compute and return a `BestCandidateResult` instance. + """ + applicable_candidates = self.get_applicable_candidates(candidates) + + best_candidate = self.sort_best_candidate(applicable_candidates) + + return BestCandidateResult( + candidates, + applicable_candidates=applicable_candidates, + best_candidate=best_candidate, + ) + + +class PackageFinder: + """This finds packages. + + This is meant to match easy_install's technique for looking for + packages, by reading pages and looking for appropriate links. + """ + + def __init__( + self, + link_collector: LinkCollector, + target_python: TargetPython, + allow_yanked: bool, + format_control: FormatControl | None = None, + candidate_prefs: CandidatePreferences | None = None, + ignore_requires_python: bool | None = None, + ) -> None: + """ + This constructor is primarily meant to be used by the create() class + method and from tests. + + :param format_control: A FormatControl object, used to control + the selection of source packages / binary packages when consulting + the index and links. + :param candidate_prefs: Options to use when creating a + CandidateEvaluator object. + """ + if candidate_prefs is None: + candidate_prefs = CandidatePreferences() + + format_control = format_control or FormatControl(set(), set()) + + self._allow_yanked = allow_yanked + self._candidate_prefs = candidate_prefs + self._ignore_requires_python = ignore_requires_python + self._link_collector = link_collector + self._target_python = target_python + + self.format_control = format_control + + # These are boring links that have already been logged somehow. + self._logged_links: set[tuple[Link, LinkType, str]] = set() + + # Cache of the result of finding candidates + self._all_candidates: dict[str, list[InstallationCandidate]] = {} + self._best_candidates: dict[ + tuple[str, specifiers.BaseSpecifier | None, Hashes | None], + BestCandidateResult, + ] = {} + + # Don't include an allow_yanked default value to make sure each call + # site considers whether yanked releases are allowed. This also causes + # that decision to be made explicit in the calling code, which helps + # people when reading the code. + @classmethod + def create( + cls, + link_collector: LinkCollector, + selection_prefs: SelectionPreferences, + target_python: TargetPython | None = None, + ) -> PackageFinder: + """Create a PackageFinder. + + :param selection_prefs: The candidate selection preferences, as a + SelectionPreferences object. + :param target_python: The target Python interpreter to use when + checking compatibility. If None (the default), a TargetPython + object will be constructed from the running Python. + """ + if target_python is None: + target_python = TargetPython() + + candidate_prefs = CandidatePreferences( + prefer_binary=selection_prefs.prefer_binary, + allow_all_prereleases=selection_prefs.allow_all_prereleases, + ) + + return cls( + candidate_prefs=candidate_prefs, + link_collector=link_collector, + target_python=target_python, + allow_yanked=selection_prefs.allow_yanked, + format_control=selection_prefs.format_control, + ignore_requires_python=selection_prefs.ignore_requires_python, + ) + + @property + def target_python(self) -> TargetPython: + return self._target_python + + @property + def search_scope(self) -> SearchScope: + return self._link_collector.search_scope + + @search_scope.setter + def search_scope(self, search_scope: SearchScope) -> None: + self._link_collector.search_scope = search_scope + + @property + def find_links(self) -> list[str]: + return self._link_collector.find_links + + @property + def index_urls(self) -> list[str]: + return self.search_scope.index_urls + + @property + def proxy(self) -> str | None: + return self._link_collector.session.pip_proxy + + @property + def trusted_hosts(self) -> Iterable[str]: + for host_port in self._link_collector.session.pip_trusted_origins: + yield build_netloc(*host_port) + + @property + def custom_cert(self) -> str | None: + # session.verify is either a boolean (use default bundle/no SSL + # verification) or a string path to a custom CA bundle to use. We only + # care about the latter. + verify = self._link_collector.session.verify + return verify if isinstance(verify, str) else None + + @property + def client_cert(self) -> str | None: + cert = self._link_collector.session.cert + assert not isinstance(cert, tuple), "pip only supports PEM client certs" + return cert + + @property + def allow_all_prereleases(self) -> bool: + return self._candidate_prefs.allow_all_prereleases + + def set_allow_all_prereleases(self) -> None: + self._candidate_prefs.allow_all_prereleases = True + + @property + def prefer_binary(self) -> bool: + return self._candidate_prefs.prefer_binary + + def set_prefer_binary(self) -> None: + self._candidate_prefs.prefer_binary = True + + def requires_python_skipped_reasons(self) -> list[str]: + reasons = { + detail + for _, result, detail in self._logged_links + if result == LinkType.requires_python_mismatch + } + return sorted(reasons) + + def make_link_evaluator(self, project_name: str) -> LinkEvaluator: + canonical_name = canonicalize_name(project_name) + formats = self.format_control.get_allowed_formats(canonical_name) + + return LinkEvaluator( + project_name=project_name, + canonical_name=canonical_name, + formats=formats, + target_python=self._target_python, + allow_yanked=self._allow_yanked, + ignore_requires_python=self._ignore_requires_python, + ) + + def _sort_links(self, links: Iterable[Link]) -> list[Link]: + """ + Returns elements of links in order, non-egg links first, egg links + second, while eliminating duplicates + """ + eggs, no_eggs = [], [] + seen: set[Link] = set() + for link in links: + if link not in seen: + seen.add(link) + if link.egg_fragment: + eggs.append(link) + else: + no_eggs.append(link) + return no_eggs + eggs + + def _log_skipped_link(self, link: Link, result: LinkType, detail: str) -> None: + entry = (link, result, detail) + if entry not in self._logged_links: + # Put the link at the end so the reason is more visible and because + # the link string is usually very long. + logger.debug("Skipping link: %s: %s", detail, link) + self._logged_links.add(entry) + + def get_install_candidate( + self, link_evaluator: LinkEvaluator, link: Link + ) -> InstallationCandidate | None: + """ + If the link is a candidate for install, convert it to an + InstallationCandidate and return it. Otherwise, return None. + """ + result, detail = link_evaluator.evaluate_link(link) + if result != LinkType.candidate: + self._log_skipped_link(link, result, detail) + return None + + try: + return InstallationCandidate( + name=link_evaluator.project_name, + link=link, + version=detail, + ) + except InvalidVersion: + return None + + def evaluate_links( + self, link_evaluator: LinkEvaluator, links: Iterable[Link] + ) -> list[InstallationCandidate]: + """ + Convert links that are candidates to InstallationCandidate objects. + """ + candidates = [] + for link in self._sort_links(links): + candidate = self.get_install_candidate(link_evaluator, link) + if candidate is not None: + candidates.append(candidate) + + return candidates + + def process_project_url( + self, project_url: Link, link_evaluator: LinkEvaluator + ) -> list[InstallationCandidate]: + logger.debug( + "Fetching project page and analyzing links: %s", + project_url, + ) + index_response = self._link_collector.fetch_response(project_url) + if index_response is None: + return [] + + page_links = list(parse_links(index_response)) + + with indent_log(): + package_links = self.evaluate_links( + link_evaluator, + links=page_links, + ) + + return package_links + + def find_all_candidates(self, project_name: str) -> list[InstallationCandidate]: + """Find all available InstallationCandidate for project_name + + This checks index_urls and find_links. + All versions found are returned as an InstallationCandidate list. + + See LinkEvaluator.evaluate_link() for details on which files + are accepted. + """ + if project_name in self._all_candidates: + return self._all_candidates[project_name] + + link_evaluator = self.make_link_evaluator(project_name) + + collected_sources = self._link_collector.collect_sources( + project_name=project_name, + candidates_from_page=functools.partial( + self.process_project_url, + link_evaluator=link_evaluator, + ), + ) + + page_candidates_it = itertools.chain.from_iterable( + source.page_candidates() + for sources in collected_sources + for source in sources + if source is not None + ) + page_candidates = list(page_candidates_it) + + file_links_it = itertools.chain.from_iterable( + source.file_links() + for sources in collected_sources + for source in sources + if source is not None + ) + file_candidates = self.evaluate_links( + link_evaluator, + sorted(file_links_it, reverse=True), + ) + + if logger.isEnabledFor(logging.DEBUG) and file_candidates: + paths = [] + for candidate in file_candidates: + assert candidate.link.url # we need to have a URL + try: + paths.append(candidate.link.file_path) + except Exception: + paths.append(candidate.link.url) # it's not a local file + + logger.debug("Local files found: %s", ", ".join(paths)) + + # This is an intentional priority ordering + self._all_candidates[project_name] = file_candidates + page_candidates + + return self._all_candidates[project_name] + + def make_candidate_evaluator( + self, + project_name: str, + specifier: specifiers.BaseSpecifier | None = None, + hashes: Hashes | None = None, + ) -> CandidateEvaluator: + """Create a CandidateEvaluator object to use.""" + candidate_prefs = self._candidate_prefs + return CandidateEvaluator.create( + project_name=project_name, + target_python=self._target_python, + prefer_binary=candidate_prefs.prefer_binary, + allow_all_prereleases=candidate_prefs.allow_all_prereleases, + specifier=specifier, + hashes=hashes, + ) + + def find_best_candidate( + self, + project_name: str, + specifier: specifiers.BaseSpecifier | None = None, + hashes: Hashes | None = None, + ) -> BestCandidateResult: + """Find matches for the given project and specifier. + + :param specifier: An optional object implementing `filter` + (e.g. `packaging.specifiers.SpecifierSet`) to filter applicable + versions. + + :return: A `BestCandidateResult` instance. + """ + if (project_name, specifier, hashes) in self._best_candidates: + return self._best_candidates[project_name, specifier, hashes] + + candidates = self.find_all_candidates(project_name) + candidate_evaluator = self.make_candidate_evaluator( + project_name=project_name, + specifier=specifier, + hashes=hashes, + ) + self._best_candidates[project_name, specifier, hashes] = ( + candidate_evaluator.compute_best_candidate(candidates) + ) + + return self._best_candidates[project_name, specifier, hashes] + + def find_requirement( + self, req: InstallRequirement, upgrade: bool + ) -> InstallationCandidate | None: + """Try to find a Link matching req + + Expects req, an InstallRequirement and upgrade, a boolean + Returns a InstallationCandidate if found, + Raises DistributionNotFound or BestVersionAlreadyInstalled otherwise + """ + name = req.name + assert name is not None, "find_requirement() called with no name" + + hashes = req.hashes(trust_internet=False) + best_candidate_result = self.find_best_candidate( + name, + specifier=req.specifier, + hashes=hashes, + ) + best_candidate = best_candidate_result.best_candidate + + installed_version: _BaseVersion | None = None + if req.satisfied_by is not None: + installed_version = req.satisfied_by.version + + def _format_versions(cand_iter: Iterable[InstallationCandidate]) -> str: + # This repeated parse_version and str() conversion is needed to + # handle different vendoring sources from pip and pkg_resources. + # If we stop using the pkg_resources provided specifier and start + # using our own, we can drop the cast to str(). + return ( + ", ".join( + sorted( + {str(c.version) for c in cand_iter}, + key=parse_version, + ) + ) + or "none" + ) + + if installed_version is None and best_candidate is None: + logger.critical( + "Could not find a version that satisfies the requirement %s " + "(from versions: %s)", + req, + _format_versions(best_candidate_result.all_candidates), + ) + + raise DistributionNotFound(f"No matching distribution found for {req}") + + def _should_install_candidate( + candidate: InstallationCandidate | None, + ) -> TypeGuard[InstallationCandidate]: + if installed_version is None: + return True + if best_candidate is None: + return False + return best_candidate.version > installed_version + + if not upgrade and installed_version is not None: + if _should_install_candidate(best_candidate): + logger.debug( + "Existing installed version (%s) satisfies requirement " + "(most up-to-date version is %s)", + installed_version, + best_candidate.version, + ) + else: + logger.debug( + "Existing installed version (%s) is most up-to-date and " + "satisfies requirement", + installed_version, + ) + return None + + if _should_install_candidate(best_candidate): + logger.debug( + "Using version %s (newest of versions: %s)", + best_candidate.version, + _format_versions(best_candidate_result.applicable_candidates), + ) + return best_candidate + + # We have an existing version, and its the best version + logger.debug( + "Installed version (%s) is most up-to-date (past versions: %s)", + installed_version, + _format_versions(best_candidate_result.applicable_candidates), + ) + raise BestVersionAlreadyInstalled + + +def _find_name_version_sep(fragment: str, canonical_name: str) -> int: + """Find the separator's index based on the package's canonical name. + + :param fragment: A + filename "fragment" (stem) or + egg fragment. + :param canonical_name: The package's canonical name. + + This function is needed since the canonicalized name does not necessarily + have the same length as the egg info's name part. An example:: + + >>> fragment = 'foo__bar-1.0' + >>> canonical_name = 'foo-bar' + >>> _find_name_version_sep(fragment, canonical_name) + 8 + """ + # Project name and version must be separated by one single dash. Find all + # occurrences of dashes; if the string in front of it matches the canonical + # name, this is the one separating the name and version parts. + for i, c in enumerate(fragment): + if c != "-": + continue + if canonicalize_name(fragment[:i]) == canonical_name: + return i + raise ValueError(f"{fragment} does not match {canonical_name}") + + +def _extract_version_from_fragment(fragment: str, canonical_name: str) -> str | None: + """Parse the version string from a + filename + "fragment" (stem) or egg fragment. + + :param fragment: The string to parse. E.g. foo-2.1 + :param canonical_name: The canonicalized name of the package this + belongs to. + """ + try: + version_start = _find_name_version_sep(fragment, canonical_name) + 1 + except ValueError: + return None + version = fragment[version_start:] + if not version: + return None + return version diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/index/sources.py b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/index/sources.py new file mode 100644 index 0000000000000000000000000000000000000000..c67c4d73668b1dbb335818012d9d67fa0ab571b4 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/index/sources.py @@ -0,0 +1,287 @@ +from __future__ import annotations + +import logging +import mimetypes +import os +from collections import defaultdict +from collections.abc import Iterable +from typing import Callable + +from pip._vendor.packaging.utils import ( + InvalidSdistFilename, + InvalidWheelFilename, + canonicalize_name, + parse_sdist_filename, + parse_wheel_filename, +) + +from pip._internal.models.candidate import InstallationCandidate +from pip._internal.models.link import Link +from pip._internal.utils.urls import path_to_url, url_to_path +from pip._internal.vcs import is_url + +logger = logging.getLogger(__name__) + +FoundCandidates = Iterable[InstallationCandidate] +FoundLinks = Iterable[Link] +CandidatesFromPage = Callable[[Link], Iterable[InstallationCandidate]] +PageValidator = Callable[[Link], bool] + + +class LinkSource: + @property + def link(self) -> Link | None: + """Returns the underlying link, if there's one.""" + raise NotImplementedError() + + def page_candidates(self) -> FoundCandidates: + """Candidates found by parsing an archive listing HTML file.""" + raise NotImplementedError() + + def file_links(self) -> FoundLinks: + """Links found by specifying archives directly.""" + raise NotImplementedError() + + +def _is_html_file(file_url: str) -> bool: + return mimetypes.guess_type(file_url, strict=False)[0] == "text/html" + + +class _FlatDirectoryToUrls: + """Scans directory and caches results""" + + def __init__(self, path: str) -> None: + self._path = path + self._page_candidates: list[str] = [] + self._project_name_to_urls: dict[str, list[str]] = defaultdict(list) + self._scanned_directory = False + + def _scan_directory(self) -> None: + """Scans directory once and populates both page_candidates + and project_name_to_urls at the same time + """ + for entry in os.scandir(self._path): + url = path_to_url(entry.path) + if _is_html_file(url): + self._page_candidates.append(url) + continue + + # File must have a valid wheel or sdist name, + # otherwise not worth considering as a package + try: + project_filename = parse_wheel_filename(entry.name)[0] + except InvalidWheelFilename: + try: + project_filename = parse_sdist_filename(entry.name)[0] + except InvalidSdistFilename: + continue + + self._project_name_to_urls[project_filename].append(url) + self._scanned_directory = True + + @property + def page_candidates(self) -> list[str]: + if not self._scanned_directory: + self._scan_directory() + + return self._page_candidates + + @property + def project_name_to_urls(self) -> dict[str, list[str]]: + if not self._scanned_directory: + self._scan_directory() + + return self._project_name_to_urls + + +class _FlatDirectorySource(LinkSource): + """Link source specified by ``--find-links=``. + + This looks the content of the directory, and returns: + + * ``page_candidates``: Links listed on each HTML file in the directory. + * ``file_candidates``: Archives in the directory. + """ + + _paths_to_urls: dict[str, _FlatDirectoryToUrls] = {} + + def __init__( + self, + candidates_from_page: CandidatesFromPage, + path: str, + project_name: str, + ) -> None: + self._candidates_from_page = candidates_from_page + self._project_name = canonicalize_name(project_name) + + # Get existing instance of _FlatDirectoryToUrls if it exists + if path in self._paths_to_urls: + self._path_to_urls = self._paths_to_urls[path] + else: + self._path_to_urls = _FlatDirectoryToUrls(path=path) + self._paths_to_urls[path] = self._path_to_urls + + @property + def link(self) -> Link | None: + return None + + def page_candidates(self) -> FoundCandidates: + for url in self._path_to_urls.page_candidates: + yield from self._candidates_from_page(Link(url)) + + def file_links(self) -> FoundLinks: + for url in self._path_to_urls.project_name_to_urls[self._project_name]: + yield Link(url) + + +class _LocalFileSource(LinkSource): + """``--find-links=`` or ``--[extra-]index-url=``. + + If a URL is supplied, it must be a ``file:`` URL. If a path is supplied to + the option, it is converted to a URL first. This returns: + + * ``page_candidates``: Links listed on an HTML file. + * ``file_candidates``: The non-HTML file. + """ + + def __init__( + self, + candidates_from_page: CandidatesFromPage, + link: Link, + ) -> None: + self._candidates_from_page = candidates_from_page + self._link = link + + @property + def link(self) -> Link | None: + return self._link + + def page_candidates(self) -> FoundCandidates: + if not _is_html_file(self._link.url): + return + yield from self._candidates_from_page(self._link) + + def file_links(self) -> FoundLinks: + if _is_html_file(self._link.url): + return + yield self._link + + +class _RemoteFileSource(LinkSource): + """``--find-links=`` or ``--[extra-]index-url=``. + + This returns: + + * ``page_candidates``: Links listed on an HTML file. + * ``file_candidates``: The non-HTML file. + """ + + def __init__( + self, + candidates_from_page: CandidatesFromPage, + page_validator: PageValidator, + link: Link, + ) -> None: + self._candidates_from_page = candidates_from_page + self._page_validator = page_validator + self._link = link + + @property + def link(self) -> Link | None: + return self._link + + def page_candidates(self) -> FoundCandidates: + if not self._page_validator(self._link): + return + yield from self._candidates_from_page(self._link) + + def file_links(self) -> FoundLinks: + yield self._link + + +class _IndexDirectorySource(LinkSource): + """``--[extra-]index-url=``. + + This is treated like a remote URL; ``candidates_from_page`` contains logic + for this by appending ``index.html`` to the link. + """ + + def __init__( + self, + candidates_from_page: CandidatesFromPage, + link: Link, + ) -> None: + self._candidates_from_page = candidates_from_page + self._link = link + + @property + def link(self) -> Link | None: + return self._link + + def page_candidates(self) -> FoundCandidates: + yield from self._candidates_from_page(self._link) + + def file_links(self) -> FoundLinks: + return () + + +def build_source( + location: str, + *, + candidates_from_page: CandidatesFromPage, + page_validator: PageValidator, + expand_dir: bool, + cache_link_parsing: bool, + project_name: str, +) -> tuple[str | None, LinkSource | None]: + path: str | None = None + url: str | None = None + if os.path.exists(location): # Is a local path. + url = path_to_url(location) + path = location + elif location.startswith("file:"): # A file: URL. + url = location + path = url_to_path(location) + elif is_url(location): + url = location + + if url is None: + msg = ( + "Location '%s' is ignored: " + "it is either a non-existing path or lacks a specific scheme." + ) + logger.warning(msg, location) + return (None, None) + + if path is None: + source: LinkSource = _RemoteFileSource( + candidates_from_page=candidates_from_page, + page_validator=page_validator, + link=Link(url, cache_link_parsing=cache_link_parsing), + ) + return (url, source) + + if os.path.isdir(path): + if expand_dir: + source = _FlatDirectorySource( + candidates_from_page=candidates_from_page, + path=path, + project_name=project_name, + ) + else: + source = _IndexDirectorySource( + candidates_from_page=candidates_from_page, + link=Link(url, cache_link_parsing=cache_link_parsing), + ) + return (url, source) + elif os.path.isfile(path): + source = _LocalFileSource( + candidates_from_page=candidates_from_page, + link=Link(url, cache_link_parsing=cache_link_parsing), + ) + return (url, source) + logger.warning( + "Location '%s' is ignored: it is neither a file nor a directory.", + location, + ) + return (url, None) diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/locations/__init__.py b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/locations/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..9f2c4fe316c1d4f9f96ef3a02b9396c61bc64ccf --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/locations/__init__.py @@ -0,0 +1,441 @@ +from __future__ import annotations + +import functools +import logging +import os +import pathlib +import sys +import sysconfig +from typing import Any + +from pip._internal.models.scheme import SCHEME_KEYS, Scheme +from pip._internal.utils.compat import WINDOWS +from pip._internal.utils.deprecation import deprecated +from pip._internal.utils.virtualenv import running_under_virtualenv + +from . import _sysconfig +from .base import ( + USER_CACHE_DIR, + get_major_minor_version, + get_src_prefix, + is_osx_framework, + site_packages, + user_site, +) + +__all__ = [ + "USER_CACHE_DIR", + "get_bin_prefix", + "get_bin_user", + "get_major_minor_version", + "get_platlib", + "get_purelib", + "get_scheme", + "get_src_prefix", + "site_packages", + "user_site", +] + + +logger = logging.getLogger(__name__) + + +_PLATLIBDIR: str = getattr(sys, "platlibdir", "lib") + +_USE_SYSCONFIG_DEFAULT = sys.version_info >= (3, 10) + + +def _should_use_sysconfig() -> bool: + """This function determines the value of _USE_SYSCONFIG. + + By default, pip uses sysconfig on Python 3.10+. + But Python distributors can override this decision by setting: + sysconfig._PIP_USE_SYSCONFIG = True / False + Rationale in https://github.com/pypa/pip/issues/10647 + + This is a function for testability, but should be constant during any one + run. + """ + return bool(getattr(sysconfig, "_PIP_USE_SYSCONFIG", _USE_SYSCONFIG_DEFAULT)) + + +_USE_SYSCONFIG = _should_use_sysconfig() + +if not _USE_SYSCONFIG: + # Import distutils lazily to avoid deprecation warnings, + # but import it soon enough that it is in memory and available during + # a pip reinstall. + from . import _distutils + +# Be noisy about incompatibilities if this platforms "should" be using +# sysconfig, but is explicitly opting out and using distutils instead. +if _USE_SYSCONFIG_DEFAULT and not _USE_SYSCONFIG: + _MISMATCH_LEVEL = logging.WARNING +else: + _MISMATCH_LEVEL = logging.DEBUG + + +def _looks_like_bpo_44860() -> bool: + """The resolution to bpo-44860 will change this incorrect platlib. + + See . + """ + from distutils.command.install import INSTALL_SCHEMES + + try: + unix_user_platlib = INSTALL_SCHEMES["unix_user"]["platlib"] + except KeyError: + return False + return unix_user_platlib == "$usersite" + + +def _looks_like_red_hat_patched_platlib_purelib(scheme: dict[str, str]) -> bool: + platlib = scheme["platlib"] + if "/$platlibdir/" in platlib: + platlib = platlib.replace("/$platlibdir/", f"/{_PLATLIBDIR}/") + if "/lib64/" not in platlib: + return False + unpatched = platlib.replace("/lib64/", "/lib/") + return unpatched.replace("$platbase/", "$base/") == scheme["purelib"] + + +@functools.cache +def _looks_like_red_hat_lib() -> bool: + """Red Hat patches platlib in unix_prefix and unix_home, but not purelib. + + This is the only way I can see to tell a Red Hat-patched Python. + """ + from distutils.command.install import INSTALL_SCHEMES + + return all( + k in INSTALL_SCHEMES + and _looks_like_red_hat_patched_platlib_purelib(INSTALL_SCHEMES[k]) + for k in ("unix_prefix", "unix_home") + ) + + +@functools.cache +def _looks_like_debian_scheme() -> bool: + """Debian adds two additional schemes.""" + from distutils.command.install import INSTALL_SCHEMES + + return "deb_system" in INSTALL_SCHEMES and "unix_local" in INSTALL_SCHEMES + + +@functools.cache +def _looks_like_red_hat_scheme() -> bool: + """Red Hat patches ``sys.prefix`` and ``sys.exec_prefix``. + + Red Hat's ``00251-change-user-install-location.patch`` changes the install + command's ``prefix`` and ``exec_prefix`` to append ``"/local"``. This is + (fortunately?) done quite unconditionally, so we create a default command + object without any configuration to detect this. + """ + from distutils.command.install import install + from distutils.dist import Distribution + + cmd: Any = install(Distribution()) + cmd.finalize_options() + return ( + cmd.exec_prefix == f"{os.path.normpath(sys.exec_prefix)}/local" + and cmd.prefix == f"{os.path.normpath(sys.prefix)}/local" + ) + + +@functools.cache +def _looks_like_slackware_scheme() -> bool: + """Slackware patches sysconfig but fails to patch distutils and site. + + Slackware changes sysconfig's user scheme to use ``"lib64"`` for the lib + path, but does not do the same to the site module. + """ + if user_site is None: # User-site not available. + return False + try: + paths = sysconfig.get_paths(scheme="posix_user", expand=False) + except KeyError: # User-site not available. + return False + return "/lib64/" in paths["purelib"] and "/lib64/" not in user_site + + +@functools.cache +def _looks_like_msys2_mingw_scheme() -> bool: + """MSYS2 patches distutils and sysconfig to use a UNIX-like scheme. + + However, MSYS2 incorrectly patches sysconfig ``nt`` scheme. The fix is + likely going to be included in their 3.10 release, so we ignore the warning. + See msys2/MINGW-packages#9319. + + MSYS2 MINGW's patch uses lowercase ``"lib"`` instead of the usual uppercase, + and is missing the final ``"site-packages"``. + """ + paths = sysconfig.get_paths("nt", expand=False) + return all( + "Lib" not in p and "lib" in p and not p.endswith("site-packages") + for p in (paths[key] for key in ("platlib", "purelib")) + ) + + +@functools.cache +def _warn_mismatched(old: pathlib.Path, new: pathlib.Path, *, key: str) -> None: + issue_url = "https://github.com/pypa/pip/issues/10151" + message = ( + "Value for %s does not match. Please report this to <%s>" + "\ndistutils: %s" + "\nsysconfig: %s" + ) + logger.log(_MISMATCH_LEVEL, message, key, issue_url, old, new) + + +def _warn_if_mismatch(old: pathlib.Path, new: pathlib.Path, *, key: str) -> bool: + if old == new: + return False + _warn_mismatched(old, new, key=key) + return True + + +@functools.cache +def _log_context( + *, + user: bool = False, + home: str | None = None, + root: str | None = None, + prefix: str | None = None, +) -> None: + parts = [ + "Additional context:", + "user = %r", + "home = %r", + "root = %r", + "prefix = %r", + ] + + logger.log(_MISMATCH_LEVEL, "\n".join(parts), user, home, root, prefix) + + +def get_scheme( + dist_name: str, + user: bool = False, + home: str | None = None, + root: str | None = None, + isolated: bool = False, + prefix: str | None = None, +) -> Scheme: + new = _sysconfig.get_scheme( + dist_name, + user=user, + home=home, + root=root, + isolated=isolated, + prefix=prefix, + ) + if _USE_SYSCONFIG: + return new + + old = _distutils.get_scheme( + dist_name, + user=user, + home=home, + root=root, + isolated=isolated, + prefix=prefix, + ) + + warning_contexts = [] + for k in SCHEME_KEYS: + old_v = pathlib.Path(getattr(old, k)) + new_v = pathlib.Path(getattr(new, k)) + + if old_v == new_v: + continue + + # distutils incorrectly put PyPy packages under ``site-packages/python`` + # in the ``posix_home`` scheme, but PyPy devs said they expect the + # directory name to be ``pypy`` instead. So we treat this as a bug fix + # and not warn about it. See bpo-43307 and python/cpython#24628. + skip_pypy_special_case = ( + sys.implementation.name == "pypy" + and home is not None + and k in ("platlib", "purelib") + and old_v.parent == new_v.parent + and old_v.name.startswith("python") + and new_v.name.startswith("pypy") + ) + if skip_pypy_special_case: + continue + + # sysconfig's ``osx_framework_user`` does not include ``pythonX.Y`` in + # the ``include`` value, but distutils's ``headers`` does. We'll let + # CPython decide whether this is a bug or feature. See bpo-43948. + skip_osx_framework_user_special_case = ( + user + and is_osx_framework() + and k == "headers" + and old_v.parent.parent == new_v.parent + and old_v.parent.name.startswith("python") + ) + if skip_osx_framework_user_special_case: + continue + + # On Red Hat and derived Linux distributions, distutils is patched to + # use "lib64" instead of "lib" for platlib. + if k == "platlib" and _looks_like_red_hat_lib(): + continue + + # On Python 3.9+, sysconfig's posix_user scheme sets platlib against + # sys.platlibdir, but distutils's unix_user incorrectly continues + # using the same $usersite for both platlib and purelib. This creates a + # mismatch when sys.platlibdir is not "lib". + skip_bpo_44860 = ( + user + and k == "platlib" + and not WINDOWS + and _PLATLIBDIR != "lib" + and _looks_like_bpo_44860() + ) + if skip_bpo_44860: + continue + + # Slackware incorrectly patches posix_user to use lib64 instead of lib, + # but not usersite to match the location. + skip_slackware_user_scheme = ( + user + and k in ("platlib", "purelib") + and not WINDOWS + and _looks_like_slackware_scheme() + ) + if skip_slackware_user_scheme: + continue + + # Both Debian and Red Hat patch Python to place the system site under + # /usr/local instead of /usr. Debian also places lib in dist-packages + # instead of site-packages, but the /usr/local check should cover it. + skip_linux_system_special_case = ( + not (user or home or prefix or running_under_virtualenv()) + and old_v.parts[1:3] == ("usr", "local") + and len(new_v.parts) > 1 + and new_v.parts[1] == "usr" + and (len(new_v.parts) < 3 or new_v.parts[2] != "local") + and (_looks_like_red_hat_scheme() or _looks_like_debian_scheme()) + ) + if skip_linux_system_special_case: + continue + + # MSYS2 MINGW's sysconfig patch does not include the "site-packages" + # part of the path. This is incorrect and will be fixed in MSYS. + skip_msys2_mingw_bug = ( + WINDOWS and k in ("platlib", "purelib") and _looks_like_msys2_mingw_scheme() + ) + if skip_msys2_mingw_bug: + continue + + # CPython's POSIX install script invokes pip (via ensurepip) against the + # interpreter located in the source tree, not the install site. This + # triggers special logic in sysconfig that's not present in distutils. + # https://github.com/python/cpython/blob/8c21941ddaf/Lib/sysconfig.py#L178-L194 + skip_cpython_build = ( + sysconfig.is_python_build(check_home=True) + and not WINDOWS + and k in ("headers", "include", "platinclude") + ) + if skip_cpython_build: + continue + + warning_contexts.append((old_v, new_v, f"scheme.{k}")) + + if not warning_contexts: + return old + + # Check if this path mismatch is caused by distutils config files. Those + # files will no longer work once we switch to sysconfig, so this raises a + # deprecation message for them. + default_old = _distutils.distutils_scheme( + dist_name, + user, + home, + root, + isolated, + prefix, + ignore_config_files=True, + ) + if any(default_old[k] != getattr(old, k) for k in SCHEME_KEYS): + deprecated( + reason=( + "Configuring installation scheme with distutils config files " + "is deprecated and will no longer work in the near future. If you " + "are using a Homebrew or Linuxbrew Python, please see discussion " + "at https://github.com/Homebrew/homebrew-core/issues/76621" + ), + replacement=None, + gone_in=None, + ) + return old + + # Post warnings about this mismatch so user can report them back. + for old_v, new_v, key in warning_contexts: + _warn_mismatched(old_v, new_v, key=key) + _log_context(user=user, home=home, root=root, prefix=prefix) + + return old + + +def get_bin_prefix() -> str: + new = _sysconfig.get_bin_prefix() + if _USE_SYSCONFIG: + return new + + old = _distutils.get_bin_prefix() + if _warn_if_mismatch(pathlib.Path(old), pathlib.Path(new), key="bin_prefix"): + _log_context() + return old + + +def get_bin_user() -> str: + return _sysconfig.get_scheme("", user=True).scripts + + +def _looks_like_deb_system_dist_packages(value: str) -> bool: + """Check if the value is Debian's APT-controlled dist-packages. + + Debian's ``distutils.sysconfig.get_python_lib()`` implementation returns the + default package path controlled by APT, but does not patch ``sysconfig`` to + do the same. This is similar to the bug worked around in ``get_scheme()``, + but here the default is ``deb_system`` instead of ``unix_local``. Ultimately + we can't do anything about this Debian bug, and this detection allows us to + skip the warning when needed. + """ + if not _looks_like_debian_scheme(): + return False + if value == "/usr/lib/python3/dist-packages": + return True + return False + + +def get_purelib() -> str: + """Return the default pure-Python lib location.""" + new = _sysconfig.get_purelib() + if _USE_SYSCONFIG: + return new + + old = _distutils.get_purelib() + if _looks_like_deb_system_dist_packages(old): + return old + if _warn_if_mismatch(pathlib.Path(old), pathlib.Path(new), key="purelib"): + _log_context() + return old + + +def get_platlib() -> str: + """Return the default platform-shared lib location.""" + new = _sysconfig.get_platlib() + if _USE_SYSCONFIG: + return new + + from . import _distutils + + old = _distutils.get_platlib() + if _looks_like_deb_system_dist_packages(old): + return old + if _warn_if_mismatch(pathlib.Path(old), pathlib.Path(new), key="platlib"): + _log_context() + return old diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/locations/__pycache__/__init__.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/locations/__pycache__/__init__.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2a312f5768068df3185d9190f304cdd965697865 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/locations/__pycache__/__init__.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/locations/__pycache__/_distutils.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/locations/__pycache__/_distutils.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..1e8fdb667948606eb9d0da4954323f3c536d03d2 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/locations/__pycache__/_distutils.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/locations/__pycache__/_sysconfig.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/locations/__pycache__/_sysconfig.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..ead0819089659c0e043d41975b7a0cae4ef6517b Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/locations/__pycache__/_sysconfig.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/locations/__pycache__/base.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/locations/__pycache__/base.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..8af3f56822d192cbeb121081b98af732127ceb94 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/locations/__pycache__/base.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/locations/_distutils.py b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/locations/_distutils.py new file mode 100644 index 0000000000000000000000000000000000000000..28c066bcee64e9965d52a72092a144a5225456f6 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/locations/_distutils.py @@ -0,0 +1,173 @@ +"""Locations where we look for configs, install stuff, etc""" + +# The following comment should be removed at some point in the future. +# mypy: strict-optional=False + +# If pip's going to use distutils, it should not be using the copy that setuptools +# might have injected into the environment. This is done by removing the injected +# shim, if it's injected. +# +# See https://github.com/pypa/pip/issues/8761 for the original discussion and +# rationale for why this is done within pip. +from __future__ import annotations + +try: + __import__("_distutils_hack").remove_shim() +except (ImportError, AttributeError): + pass + +import logging +import os +import sys +from distutils.cmd import Command as DistutilsCommand +from distutils.command.install import SCHEME_KEYS +from distutils.command.install import install as distutils_install_command +from distutils.sysconfig import get_python_lib + +from pip._internal.models.scheme import Scheme +from pip._internal.utils.compat import WINDOWS +from pip._internal.utils.virtualenv import running_under_virtualenv + +from .base import get_major_minor_version + +logger = logging.getLogger(__name__) + + +def distutils_scheme( + dist_name: str, + user: bool = False, + home: str | None = None, + root: str | None = None, + isolated: bool = False, + prefix: str | None = None, + *, + ignore_config_files: bool = False, +) -> dict[str, str]: + """ + Return a distutils install scheme + """ + from distutils.dist import Distribution + + dist_args: dict[str, str | list[str]] = {"name": dist_name} + if isolated: + dist_args["script_args"] = ["--no-user-cfg"] + + d = Distribution(dist_args) + if not ignore_config_files: + try: + d.parse_config_files() + except UnicodeDecodeError: + paths = d.find_config_files() + logger.warning( + "Ignore distutils configs in %s due to encoding errors.", + ", ".join(os.path.basename(p) for p in paths), + ) + obj: DistutilsCommand | None = None + obj = d.get_command_obj("install", create=True) + assert obj is not None + i: distutils_install_command = obj + # NOTE: setting user or home has the side-effect of creating the home dir + # or user base for installations during finalize_options() + # ideally, we'd prefer a scheme class that has no side-effects. + assert not (user and prefix), f"user={user} prefix={prefix}" + assert not (home and prefix), f"home={home} prefix={prefix}" + i.user = user or i.user + if user or home: + i.prefix = "" + i.prefix = prefix or i.prefix + i.home = home or i.home + i.root = root or i.root + i.finalize_options() + + scheme: dict[str, str] = {} + for key in SCHEME_KEYS: + scheme[key] = getattr(i, "install_" + key) + + # install_lib specified in setup.cfg should install *everything* + # into there (i.e. it takes precedence over both purelib and + # platlib). Note, i.install_lib is *always* set after + # finalize_options(); we only want to override here if the user + # has explicitly requested it hence going back to the config + if "install_lib" in d.get_option_dict("install"): + scheme.update({"purelib": i.install_lib, "platlib": i.install_lib}) + + if running_under_virtualenv(): + if home: + prefix = home + elif user: + prefix = i.install_userbase + else: + prefix = i.prefix + scheme["headers"] = os.path.join( + prefix, + "include", + "site", + f"python{get_major_minor_version()}", + dist_name, + ) + + if root is not None: + path_no_drive = os.path.splitdrive(os.path.abspath(scheme["headers"]))[1] + scheme["headers"] = os.path.join(root, path_no_drive[1:]) + + return scheme + + +def get_scheme( + dist_name: str, + user: bool = False, + home: str | None = None, + root: str | None = None, + isolated: bool = False, + prefix: str | None = None, +) -> Scheme: + """ + Get the "scheme" corresponding to the input parameters. The distutils + documentation provides the context for the available schemes: + https://docs.python.org/3/install/index.html#alternate-installation + + :param dist_name: the name of the package to retrieve the scheme for, used + in the headers scheme path + :param user: indicates to use the "user" scheme + :param home: indicates to use the "home" scheme and provides the base + directory for the same + :param root: root under which other directories are re-based + :param isolated: equivalent to --no-user-cfg, i.e. do not consider + ~/.pydistutils.cfg (posix) or ~/pydistutils.cfg (non-posix) for + scheme paths + :param prefix: indicates to use the "prefix" scheme and provides the + base directory for the same + """ + scheme = distutils_scheme(dist_name, user, home, root, isolated, prefix) + return Scheme( + platlib=scheme["platlib"], + purelib=scheme["purelib"], + headers=scheme["headers"], + scripts=scheme["scripts"], + data=scheme["data"], + ) + + +def get_bin_prefix() -> str: + # XXX: In old virtualenv versions, sys.prefix can contain '..' components, + # so we need to call normpath to eliminate them. + prefix = os.path.normpath(sys.prefix) + if WINDOWS: + bin_py = os.path.join(prefix, "Scripts") + # buildout uses 'bin' on Windows too? + if not os.path.exists(bin_py): + bin_py = os.path.join(prefix, "bin") + return bin_py + # Forcing to use /usr/local/bin for standard macOS framework installs + # Also log to ~/Library/Logs/ for use with the Console.app log viewer + if sys.platform[:6] == "darwin" and prefix[:16] == "/System/Library/": + return "/usr/local/bin" + return os.path.join(prefix, "bin") + + +def get_purelib() -> str: + return get_python_lib(plat_specific=False) + + +def get_platlib() -> str: + return get_python_lib(plat_specific=True) diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/locations/_sysconfig.py b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/locations/_sysconfig.py new file mode 100644 index 0000000000000000000000000000000000000000..d4a448ece5253a06a853ad12a902a3edc50398f6 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/locations/_sysconfig.py @@ -0,0 +1,215 @@ +from __future__ import annotations + +import logging +import os +import sys +import sysconfig + +from pip._internal.exceptions import InvalidSchemeCombination, UserInstallationInvalid +from pip._internal.models.scheme import SCHEME_KEYS, Scheme +from pip._internal.utils.virtualenv import running_under_virtualenv + +from .base import change_root, get_major_minor_version, is_osx_framework + +logger = logging.getLogger(__name__) + + +# Notes on _infer_* functions. +# Unfortunately ``get_default_scheme()`` didn't exist before 3.10, so there's no +# way to ask things like "what is the '_prefix' scheme on this platform". These +# functions try to answer that with some heuristics while accounting for ad-hoc +# platforms not covered by CPython's default sysconfig implementation. If the +# ad-hoc implementation does not fully implement sysconfig, we'll fall back to +# a POSIX scheme. + +_AVAILABLE_SCHEMES = set(sysconfig.get_scheme_names()) + +_PREFERRED_SCHEME_API = getattr(sysconfig, "get_preferred_scheme", None) + + +def _should_use_osx_framework_prefix() -> bool: + """Check for Apple's ``osx_framework_library`` scheme. + + Python distributed by Apple's Command Line Tools has this special scheme + that's used when: + + * This is a framework build. + * We are installing into the system prefix. + + This does not account for ``pip install --prefix`` (also means we're not + installing to the system prefix), which should use ``posix_prefix``, but + logic here means ``_infer_prefix()`` outputs ``osx_framework_library``. But + since ``prefix`` is not available for ``sysconfig.get_default_scheme()``, + which is the stdlib replacement for ``_infer_prefix()``, presumably Apple + wouldn't be able to magically switch between ``osx_framework_library`` and + ``posix_prefix``. ``_infer_prefix()`` returning ``osx_framework_library`` + means its behavior is consistent whether we use the stdlib implementation + or our own, and we deal with this special case in ``get_scheme()`` instead. + """ + return ( + "osx_framework_library" in _AVAILABLE_SCHEMES + and not running_under_virtualenv() + and is_osx_framework() + ) + + +def _infer_prefix() -> str: + """Try to find a prefix scheme for the current platform. + + This tries: + + * A special ``osx_framework_library`` for Python distributed by Apple's + Command Line Tools, when not running in a virtual environment. + * Implementation + OS, used by PyPy on Windows (``pypy_nt``). + * Implementation without OS, used by PyPy on POSIX (``pypy``). + * OS + "prefix", used by CPython on POSIX (``posix_prefix``). + * Just the OS name, used by CPython on Windows (``nt``). + + If none of the above works, fall back to ``posix_prefix``. + """ + if _PREFERRED_SCHEME_API: + return _PREFERRED_SCHEME_API("prefix") + if _should_use_osx_framework_prefix(): + return "osx_framework_library" + implementation_suffixed = f"{sys.implementation.name}_{os.name}" + if implementation_suffixed in _AVAILABLE_SCHEMES: + return implementation_suffixed + if sys.implementation.name in _AVAILABLE_SCHEMES: + return sys.implementation.name + suffixed = f"{os.name}_prefix" + if suffixed in _AVAILABLE_SCHEMES: + return suffixed + if os.name in _AVAILABLE_SCHEMES: # On Windows, prefx is just called "nt". + return os.name + return "posix_prefix" + + +def _infer_user() -> str: + """Try to find a user scheme for the current platform.""" + if _PREFERRED_SCHEME_API: + return _PREFERRED_SCHEME_API("user") + if is_osx_framework() and not running_under_virtualenv(): + suffixed = "osx_framework_user" + else: + suffixed = f"{os.name}_user" + if suffixed in _AVAILABLE_SCHEMES: + return suffixed + if "posix_user" not in _AVAILABLE_SCHEMES: # User scheme unavailable. + raise UserInstallationInvalid() + return "posix_user" + + +def _infer_home() -> str: + """Try to find a home for the current platform.""" + if _PREFERRED_SCHEME_API: + return _PREFERRED_SCHEME_API("home") + suffixed = f"{os.name}_home" + if suffixed in _AVAILABLE_SCHEMES: + return suffixed + return "posix_home" + + +# Update these keys if the user sets a custom home. +_HOME_KEYS = [ + "installed_base", + "base", + "installed_platbase", + "platbase", + "prefix", + "exec_prefix", +] +if sysconfig.get_config_var("userbase") is not None: + _HOME_KEYS.append("userbase") + + +def get_scheme( + dist_name: str, + user: bool = False, + home: str | None = None, + root: str | None = None, + isolated: bool = False, + prefix: str | None = None, +) -> Scheme: + """ + Get the "scheme" corresponding to the input parameters. + + :param dist_name: the name of the package to retrieve the scheme for, used + in the headers scheme path + :param user: indicates to use the "user" scheme + :param home: indicates to use the "home" scheme + :param root: root under which other directories are re-based + :param isolated: ignored, but kept for distutils compatibility (where + this controls whether the user-site pydistutils.cfg is honored) + :param prefix: indicates to use the "prefix" scheme and provides the + base directory for the same + """ + if user and prefix: + raise InvalidSchemeCombination("--user", "--prefix") + if home and prefix: + raise InvalidSchemeCombination("--home", "--prefix") + + if home is not None: + scheme_name = _infer_home() + elif user: + scheme_name = _infer_user() + else: + scheme_name = _infer_prefix() + + # Special case: When installing into a custom prefix, use posix_prefix + # instead of osx_framework_library. See _should_use_osx_framework_prefix() + # docstring for details. + if prefix is not None and scheme_name == "osx_framework_library": + scheme_name = "posix_prefix" + + if home is not None: + variables = {k: home for k in _HOME_KEYS} + elif prefix is not None: + variables = {k: prefix for k in _HOME_KEYS} + else: + variables = {} + + paths = sysconfig.get_paths(scheme=scheme_name, vars=variables) + + # Logic here is very arbitrary, we're doing it for compatibility, don't ask. + # 1. Pip historically uses a special header path in virtual environments. + # 2. If the distribution name is not known, distutils uses 'UNKNOWN'. We + # only do the same when not running in a virtual environment because + # pip's historical header path logic (see point 1) did not do this. + if running_under_virtualenv(): + if user: + base = variables.get("userbase", sys.prefix) + else: + base = variables.get("base", sys.prefix) + python_xy = f"python{get_major_minor_version()}" + paths["include"] = os.path.join(base, "include", "site", python_xy) + elif not dist_name: + dist_name = "UNKNOWN" + + scheme = Scheme( + platlib=paths["platlib"], + purelib=paths["purelib"], + headers=os.path.join(paths["include"], dist_name), + scripts=paths["scripts"], + data=paths["data"], + ) + if root is not None: + converted_keys = {} + for key in SCHEME_KEYS: + converted_keys[key] = change_root(root, getattr(scheme, key)) + scheme = Scheme(**converted_keys) + return scheme + + +def get_bin_prefix() -> str: + # Forcing to use /usr/local/bin for standard macOS framework installs. + if sys.platform[:6] == "darwin" and sys.prefix[:16] == "/System/Library/": + return "/usr/local/bin" + return sysconfig.get_paths()["scripts"] + + +def get_purelib() -> str: + return sysconfig.get_paths()["purelib"] + + +def get_platlib() -> str: + return sysconfig.get_paths()["platlib"] diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/locations/base.py b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/locations/base.py new file mode 100644 index 0000000000000000000000000000000000000000..17cd0e8759105f691662b4b6ebbe5a6b3676289c --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/locations/base.py @@ -0,0 +1,82 @@ +from __future__ import annotations + +import functools +import os +import site +import sys +import sysconfig + +from pip._internal.exceptions import InstallationError +from pip._internal.utils import appdirs +from pip._internal.utils.virtualenv import running_under_virtualenv + +# Application Directories +USER_CACHE_DIR = appdirs.user_cache_dir("pip") + +# FIXME doesn't account for venv linked to global site-packages +site_packages: str = sysconfig.get_path("purelib") + + +def get_major_minor_version() -> str: + """ + Return the major-minor version of the current Python as a string, e.g. + "3.7" or "3.10". + """ + return "{}.{}".format(*sys.version_info) + + +def change_root(new_root: str, pathname: str) -> str: + """Return 'pathname' with 'new_root' prepended. + + If 'pathname' is relative, this is equivalent to os.path.join(new_root, pathname). + Otherwise, it requires making 'pathname' relative and then joining the + two, which is tricky on DOS/Windows and Mac OS. + + This is borrowed from Python's standard library's distutils module. + """ + if os.name == "posix": + if not os.path.isabs(pathname): + return os.path.join(new_root, pathname) + else: + return os.path.join(new_root, pathname[1:]) + + elif os.name == "nt": + (drive, path) = os.path.splitdrive(pathname) + if path[0] == "\\": + path = path[1:] + return os.path.join(new_root, path) + + else: + raise InstallationError( + f"Unknown platform: {os.name}\n" + "Can not change root path prefix on unknown platform." + ) + + +def get_src_prefix() -> str: + if running_under_virtualenv(): + src_prefix = os.path.join(sys.prefix, "src") + else: + # FIXME: keep src in cwd for now (it is not a temporary folder) + try: + src_prefix = os.path.join(os.getcwd(), "src") + except OSError: + # In case the current working directory has been renamed or deleted + sys.exit("The folder you are executing pip from can no longer be found.") + + # under macOS + virtualenv sys.prefix is not properly resolved + # it is something like /path/to/python/bin/.. + return os.path.abspath(src_prefix) + + +try: + # Use getusersitepackages if this is present, as it ensures that the + # value is initialised properly. + user_site: str | None = site.getusersitepackages() +except AttributeError: + user_site = site.USER_SITE + + +@functools.cache +def is_osx_framework() -> bool: + return bool(sysconfig.get_config_var("PYTHONFRAMEWORK")) diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/metadata/__init__.py b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/metadata/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..927e375cad0db7a96cd519f378ce7fff0213ad7a --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/metadata/__init__.py @@ -0,0 +1,164 @@ +from __future__ import annotations + +import contextlib +import functools +import os +import sys +from typing import Literal, Protocol, cast + +from pip._internal.utils.deprecation import deprecated +from pip._internal.utils.misc import strtobool + +from .base import BaseDistribution, BaseEnvironment, FilesystemWheel, MemoryWheel, Wheel + +__all__ = [ + "BaseDistribution", + "BaseEnvironment", + "FilesystemWheel", + "MemoryWheel", + "Wheel", + "get_default_environment", + "get_environment", + "get_wheel_distribution", + "select_backend", +] + + +def _should_use_importlib_metadata() -> bool: + """Whether to use the ``importlib.metadata`` or ``pkg_resources`` backend. + + By default, pip uses ``importlib.metadata`` on Python 3.11+, and + ``pkg_resources`` otherwise. Up to Python 3.13, This can be + overridden by a couple of ways: + + * If environment variable ``_PIP_USE_IMPORTLIB_METADATA`` is set, it + dictates whether ``importlib.metadata`` is used, for Python <3.14. + * On Python 3.11, 3.12 and 3.13, Python distributors can patch + ``importlib.metadata`` to add a global constant + ``_PIP_USE_IMPORTLIB_METADATA = False``. This makes pip use + ``pkg_resources`` (unless the user set the aforementioned environment + variable to *True*). + + On Python 3.14+, the ``pkg_resources`` backend cannot be used. + """ + if sys.version_info >= (3, 14): + # On Python >=3.14 we only support importlib.metadata. + return True + with contextlib.suppress(KeyError, ValueError): + # On Python <3.14, if the environment variable is set, we obey what it says. + return bool(strtobool(os.environ["_PIP_USE_IMPORTLIB_METADATA"])) + if sys.version_info < (3, 11): + # On Python <3.11, we always use pkg_resources, unless the environment + # variable was set. + return False + # On Python 3.11, 3.12 and 3.13, we check if the global constant is set. + import importlib.metadata + + return bool(getattr(importlib.metadata, "_PIP_USE_IMPORTLIB_METADATA", True)) + + +def _emit_pkg_resources_deprecation_if_needed() -> None: + if sys.version_info < (3, 11): + # All pip versions supporting Python<=3.11 will support pkg_resources, + # and pkg_resources is the default for these, so let's not bother users. + return + + import importlib.metadata + + if hasattr(importlib.metadata, "_PIP_USE_IMPORTLIB_METADATA"): + # The Python distributor has set the global constant, so we don't + # warn, since it is not a user decision. + return + + # The user has decided to use pkg_resources, so we warn. + deprecated( + reason="Using the pkg_resources metadata backend is deprecated.", + replacement=( + "to use the default importlib.metadata backend, " + "by unsetting the _PIP_USE_IMPORTLIB_METADATA environment variable" + ), + gone_in="26.3", + issue=13317, + ) + + +class Backend(Protocol): + NAME: Literal["importlib", "pkg_resources"] + Distribution: type[BaseDistribution] + Environment: type[BaseEnvironment] + + +@functools.cache +def select_backend() -> Backend: + if _should_use_importlib_metadata(): + from . import importlib + + return cast(Backend, importlib) + + _emit_pkg_resources_deprecation_if_needed() + + from . import pkg_resources + + return cast(Backend, pkg_resources) + + +def get_default_environment() -> BaseEnvironment: + """Get the default representation for the current environment. + + This returns an Environment instance from the chosen backend. The default + Environment instance should be built from ``sys.path`` and may use caching + to share instance state across calls. + """ + return select_backend().Environment.default() + + +def get_environment(paths: list[str] | None) -> BaseEnvironment: + """Get a representation of the environment specified by ``paths``. + + This returns an Environment instance from the chosen backend based on the + given import paths. The backend must build a fresh instance representing + the state of installed distributions when this function is called. + """ + return select_backend().Environment.from_paths(paths) + + +def get_directory_distribution(directory: str) -> BaseDistribution: + """Get the distribution metadata representation in the specified directory. + + This returns a Distribution instance from the chosen backend based on + the given on-disk ``.dist-info`` directory. + """ + return select_backend().Distribution.from_directory(directory) + + +def get_wheel_distribution(wheel: Wheel, canonical_name: str) -> BaseDistribution: + """Get the representation of the specified wheel's distribution metadata. + + This returns a Distribution instance from the chosen backend based on + the given wheel's ``.dist-info`` directory. + + :param canonical_name: Normalized project name of the given wheel. + """ + return select_backend().Distribution.from_wheel(wheel, canonical_name) + + +def get_metadata_distribution( + metadata_contents: bytes, + filename: str, + canonical_name: str, +) -> BaseDistribution: + """Get the dist representation of the specified METADATA file contents. + + This returns a Distribution instance from the chosen backend sourced from the data + in `metadata_contents`. + + :param metadata_contents: Contents of a METADATA file within a dist, or one served + via PEP 658. + :param filename: Filename for the dist this metadata represents. + :param canonical_name: Normalized project name of the given dist. + """ + return select_backend().Distribution.from_metadata_file_contents( + metadata_contents, + filename, + canonical_name, + ) diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/metadata/__pycache__/__init__.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/metadata/__pycache__/__init__.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..eab236e6e3def29669c33680f35453cb76055db7 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/metadata/__pycache__/__init__.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/metadata/__pycache__/_json.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/metadata/__pycache__/_json.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..cd89cc8a454d2da79893617ecf3f627ae050535a Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/metadata/__pycache__/_json.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/metadata/__pycache__/base.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/metadata/__pycache__/base.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..0eb0ef515c4162d18a8e3bd733722f4c0203d28f Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/metadata/__pycache__/base.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/metadata/__pycache__/pkg_resources.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/metadata/__pycache__/pkg_resources.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..00586f40343312d16059e54401aa25650a121bd2 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/metadata/__pycache__/pkg_resources.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/metadata/_json.py b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/metadata/_json.py new file mode 100644 index 0000000000000000000000000000000000000000..b39ac0545787df310b1e0a27f2f169cc346df2d5 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/metadata/_json.py @@ -0,0 +1,87 @@ +# Extracted from https://github.com/pfmoore/pkg_metadata +from __future__ import annotations + +from email.header import Header, decode_header, make_header +from email.message import Message +from typing import Any, cast + +METADATA_FIELDS = [ + # Name, Multiple-Use + ("Metadata-Version", False), + ("Name", False), + ("Version", False), + ("Dynamic", True), + ("Platform", True), + ("Supported-Platform", True), + ("Summary", False), + ("Description", False), + ("Description-Content-Type", False), + ("Keywords", False), + ("Home-page", False), + ("Download-URL", False), + ("Author", False), + ("Author-email", False), + ("Maintainer", False), + ("Maintainer-email", False), + ("License", False), + ("License-Expression", False), + ("License-File", True), + ("Classifier", True), + ("Requires-Dist", True), + ("Requires-Python", False), + ("Requires-External", True), + ("Project-URL", True), + ("Provides-Extra", True), + ("Provides-Dist", True), + ("Obsoletes-Dist", True), +] + + +def json_name(field: str) -> str: + return field.lower().replace("-", "_") + + +def msg_to_json(msg: Message) -> dict[str, Any]: + """Convert a Message object into a JSON-compatible dictionary.""" + + def sanitise_header(h: Header | str) -> str: + if isinstance(h, Header): + chunks = [] + for bytes, encoding in decode_header(h): + if encoding == "unknown-8bit": + try: + # See if UTF-8 works + bytes.decode("utf-8") + encoding = "utf-8" + except UnicodeDecodeError: + # If not, latin1 at least won't fail + encoding = "latin1" + chunks.append((bytes, encoding)) + return str(make_header(chunks)) + return str(h) + + result = {} + for field, multi in METADATA_FIELDS: + if field not in msg: + continue + key = json_name(field) + if multi: + value: str | list[str] = [ + sanitise_header(v) for v in msg.get_all(field) # type: ignore + ] + else: + value = sanitise_header(msg.get(field)) # type: ignore + if key == "keywords": + # Accept both comma-separated and space-separated + # forms, for better compatibility with old data. + if "," in value: + value = [v.strip() for v in value.split(",")] + else: + value = value.split() + result[key] = value + + payload = cast(str, msg.get_payload()) + if payload: + result["description"] = payload + + return result diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/metadata/base.py b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/metadata/base.py new file mode 100644 index 0000000000000000000000000000000000000000..230e11473c6219b2c8490bc897feb85a4185dc12 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/metadata/base.py @@ -0,0 +1,685 @@ +from __future__ import annotations + +import csv +import email.message +import functools +import json +import logging +import pathlib +import re +import zipfile +from collections.abc import Collection, Container, Iterable, Iterator +from typing import ( + IO, + Any, + NamedTuple, + Protocol, + Union, +) + +from pip._vendor.packaging.requirements import Requirement +from pip._vendor.packaging.specifiers import InvalidSpecifier, SpecifierSet +from pip._vendor.packaging.utils import NormalizedName, canonicalize_name +from pip._vendor.packaging.version import Version + +from pip._internal.exceptions import NoneMetadataError +from pip._internal.locations import site_packages, user_site +from pip._internal.models.direct_url import ( + DIRECT_URL_METADATA_NAME, + DirectUrl, + DirectUrlValidationError, +) +from pip._internal.utils.compat import stdlib_pkgs # TODO: Move definition here. +from pip._internal.utils.egg_link import egg_link_path_from_sys_path +from pip._internal.utils.misc import is_local, normalize_path +from pip._internal.utils.urls import url_to_path + +from ._json import msg_to_json + +InfoPath = Union[str, pathlib.PurePath] + +logger = logging.getLogger(__name__) + + +class BaseEntryPoint(Protocol): + @property + def name(self) -> str: + raise NotImplementedError() + + @property + def value(self) -> str: + raise NotImplementedError() + + @property + def group(self) -> str: + raise NotImplementedError() + + +def _convert_installed_files_path( + entry: tuple[str, ...], + info: tuple[str, ...], +) -> str: + """Convert a legacy installed-files.txt path into modern RECORD path. + + The legacy format stores paths relative to the info directory, while the + modern format stores paths relative to the package root, e.g. the + site-packages directory. + + :param entry: Path parts of the installed-files.txt entry. + :param info: Path parts of the egg-info directory relative to package root. + :returns: The converted entry. + + For best compatibility with symlinks, this does not use ``abspath()`` or + ``Path.resolve()``, but tries to work with path parts: + + 1. While ``entry`` starts with ``..``, remove the equal amounts of parts + from ``info``; if ``info`` is empty, start appending ``..`` instead. + 2. Join the two directly. + """ + while entry and entry[0] == "..": + if not info or info[-1] == "..": + info += ("..",) + else: + info = info[:-1] + entry = entry[1:] + return str(pathlib.Path(*info, *entry)) + + +class RequiresEntry(NamedTuple): + requirement: str + extra: str + marker: str + + +class BaseDistribution(Protocol): + @classmethod + def from_directory(cls, directory: str) -> BaseDistribution: + """Load the distribution from a metadata directory. + + :param directory: Path to a metadata directory, e.g. ``.dist-info``. + """ + raise NotImplementedError() + + @classmethod + def from_metadata_file_contents( + cls, + metadata_contents: bytes, + filename: str, + project_name: str, + ) -> BaseDistribution: + """Load the distribution from the contents of a METADATA file. + + This is used to implement PEP 658 by generating a "shallow" dist object that can + be used for resolution without downloading or building the actual dist yet. + + :param metadata_contents: The contents of a METADATA file. + :param filename: File name for the dist with this metadata. + :param project_name: Name of the project this dist represents. + """ + raise NotImplementedError() + + @classmethod + def from_wheel(cls, wheel: Wheel, name: str) -> BaseDistribution: + """Load the distribution from a given wheel. + + :param wheel: A concrete wheel definition. + :param name: File name of the wheel. + + :raises InvalidWheel: Whenever loading of the wheel causes a + :py:exc:`zipfile.BadZipFile` exception to be thrown. + :raises UnsupportedWheel: If the wheel is a valid zip, but malformed + internally. + """ + raise NotImplementedError() + + def __repr__(self) -> str: + return f"{self.raw_name} {self.raw_version} ({self.location})" + + def __str__(self) -> str: + return f"{self.raw_name} {self.raw_version}" + + @property + def location(self) -> str | None: + """Where the distribution is loaded from. + + A string value is not necessarily a filesystem path, since distributions + can be loaded from other sources, e.g. arbitrary zip archives. ``None`` + means the distribution is created in-memory. + + Do not canonicalize this value with e.g. ``pathlib.Path.resolve()``. If + this is a symbolic link, we want to preserve the relative path between + it and files in the distribution. + """ + raise NotImplementedError() + + @property + def editable_project_location(self) -> str | None: + """The project location for editable distributions. + + This is the directory where pyproject.toml or setup.py is located. + None if the distribution is not installed in editable mode. + """ + # TODO: this property is relatively costly to compute, memoize it ? + direct_url = self.direct_url + if direct_url: + if direct_url.is_local_editable(): + return url_to_path(direct_url.url) + else: + # Search for an .egg-link file by walking sys.path, as it was + # done before by dist_is_editable(). + egg_link_path = egg_link_path_from_sys_path(self.raw_name) + if egg_link_path: + # TODO: get project location from second line of egg_link file + # (https://github.com/pypa/pip/issues/10243) + return self.location + return None + + @property + def installed_location(self) -> str | None: + """The distribution's "installed" location. + + This should generally be a ``site-packages`` directory. This is + usually ``dist.location``, except for legacy develop-installed packages, + where ``dist.location`` is the source code location, and this is where + the ``.egg-link`` file is. + + The returned location is normalized (in particular, with symlinks removed). + """ + raise NotImplementedError() + + @property + def info_location(self) -> str | None: + """Location of the .[egg|dist]-info directory or file. + + Similarly to ``location``, a string value is not necessarily a + filesystem path. ``None`` means the distribution is created in-memory. + + For a modern .dist-info installation on disk, this should be something + like ``{location}/{raw_name}-{version}.dist-info``. + + Do not canonicalize this value with e.g. ``pathlib.Path.resolve()``. If + this is a symbolic link, we want to preserve the relative path between + it and other files in the distribution. + """ + raise NotImplementedError() + + @property + def installed_by_distutils(self) -> bool: + """Whether this distribution is installed with legacy distutils format. + + A distribution installed with "raw" distutils not patched by setuptools + uses one single file at ``info_location`` to store metadata. We need to + treat this specially on uninstallation. + """ + info_location = self.info_location + if not info_location: + return False + return pathlib.Path(info_location).is_file() + + @property + def installed_as_egg(self) -> bool: + """Whether this distribution is installed as an egg. + + This usually indicates the distribution was installed by (older versions + of) easy_install. + """ + location = self.location + if not location: + return False + # XXX if the distribution is a zipped egg, location has a trailing / + # so we resort to pathlib.Path to check the suffix in a reliable way. + return pathlib.Path(location).suffix == ".egg" + + @property + def installed_with_setuptools_egg_info(self) -> bool: + """Whether this distribution is installed with the ``.egg-info`` format. + + This usually indicates the distribution was installed with setuptools + with an old pip version or with ``single-version-externally-managed``. + + Note that this ensure the metadata store is a directory. distutils can + also installs an ``.egg-info``, but as a file, not a directory. This + property is *False* for that case. Also see ``installed_by_distutils``. + """ + info_location = self.info_location + if not info_location: + return False + if not info_location.endswith(".egg-info"): + return False + return pathlib.Path(info_location).is_dir() + + @property + def installed_with_dist_info(self) -> bool: + """Whether this distribution is installed with the "modern format". + + This indicates a "modern" installation, e.g. storing metadata in the + ``.dist-info`` directory. This applies to installations made by + setuptools (but through pip, not directly), or anything using the + standardized build backend interface (PEP 517). + """ + info_location = self.info_location + if not info_location: + return False + if not info_location.endswith(".dist-info"): + return False + return pathlib.Path(info_location).is_dir() + + @property + def canonical_name(self) -> NormalizedName: + raise NotImplementedError() + + @property + def version(self) -> Version: + raise NotImplementedError() + + @property + def raw_version(self) -> str: + raise NotImplementedError() + + @property + def setuptools_filename(self) -> str: + """Convert a project name to its setuptools-compatible filename. + + This is a copy of ``pkg_resources.to_filename()`` for compatibility. + """ + return self.raw_name.replace("-", "_") + + @property + def direct_url(self) -> DirectUrl | None: + """Obtain a DirectUrl from this distribution. + + Returns None if the distribution has no `direct_url.json` metadata, + or if `direct_url.json` is invalid. + """ + try: + content = self.read_text(DIRECT_URL_METADATA_NAME) + except FileNotFoundError: + return None + try: + return DirectUrl.from_json(content) + except ( + UnicodeDecodeError, + json.JSONDecodeError, + DirectUrlValidationError, + ) as e: + logger.warning( + "Error parsing %s for %s: %s", + DIRECT_URL_METADATA_NAME, + self.canonical_name, + e, + ) + return None + + @property + def installer(self) -> str: + try: + installer_text = self.read_text("INSTALLER") + except (OSError, ValueError, NoneMetadataError): + return "" # Fail silently if the installer file cannot be read. + for line in installer_text.splitlines(): + cleaned_line = line.strip() + if cleaned_line: + return cleaned_line + return "" + + @property + def requested(self) -> bool: + return self.is_file("REQUESTED") + + @property + def editable(self) -> bool: + return bool(self.editable_project_location) + + @property + def local(self) -> bool: + """If distribution is installed in the current virtual environment. + + Always True if we're not in a virtualenv. + """ + if self.installed_location is None: + return False + return is_local(self.installed_location) + + @property + def in_usersite(self) -> bool: + if self.installed_location is None or user_site is None: + return False + return self.installed_location.startswith(normalize_path(user_site)) + + @property + def in_site_packages(self) -> bool: + if self.installed_location is None or site_packages is None: + return False + return self.installed_location.startswith(normalize_path(site_packages)) + + def is_file(self, path: InfoPath) -> bool: + """Check whether an entry in the info directory is a file.""" + raise NotImplementedError() + + def iter_distutils_script_names(self) -> Iterator[str]: + """Find distutils 'scripts' entries metadata. + + If 'scripts' is supplied in ``setup.py``, distutils records those in the + installed distribution's ``scripts`` directory, a file for each script. + """ + raise NotImplementedError() + + def read_text(self, path: InfoPath) -> str: + """Read a file in the info directory. + + :raise FileNotFoundError: If ``path`` does not exist in the directory. + :raise NoneMetadataError: If ``path`` exists in the info directory, but + cannot be read. + """ + raise NotImplementedError() + + def iter_entry_points(self) -> Iterable[BaseEntryPoint]: + raise NotImplementedError() + + def _metadata_impl(self) -> email.message.Message: + raise NotImplementedError() + + @functools.cached_property + def metadata(self) -> email.message.Message: + """Metadata of distribution parsed from e.g. METADATA or PKG-INFO. + + This should return an empty message if the metadata file is unavailable. + + :raises NoneMetadataError: If the metadata file is available, but does + not contain valid metadata. + """ + metadata = self._metadata_impl() + self._add_egg_info_requires(metadata) + return metadata + + @property + def metadata_dict(self) -> dict[str, Any]: + """PEP 566 compliant JSON-serializable representation of METADATA or PKG-INFO. + + This should return an empty dict if the metadata file is unavailable. + + :raises NoneMetadataError: If the metadata file is available, but does + not contain valid metadata. + """ + return msg_to_json(self.metadata) + + @property + def metadata_version(self) -> str | None: + """Value of "Metadata-Version:" in distribution metadata, if available.""" + return self.metadata.get("Metadata-Version") + + @property + def raw_name(self) -> str: + """Value of "Name:" in distribution metadata.""" + # The metadata should NEVER be missing the Name: key, but if it somehow + # does, fall back to the known canonical name. + return self.metadata.get("Name", self.canonical_name) + + @property + def requires_python(self) -> SpecifierSet: + """Value of "Requires-Python:" in distribution metadata. + + If the key does not exist or contains an invalid value, an empty + SpecifierSet should be returned. + """ + value = self.metadata.get("Requires-Python") + if value is None: + return SpecifierSet() + try: + # Convert to str to satisfy the type checker; this can be a Header object. + spec = SpecifierSet(str(value)) + except InvalidSpecifier as e: + message = "Package %r has an invalid Requires-Python: %s" + logger.warning(message, self.raw_name, e) + return SpecifierSet() + return spec + + def iter_dependencies(self, extras: Collection[str] = ()) -> Iterable[Requirement]: + """Dependencies of this distribution. + + For modern .dist-info distributions, this is the collection of + "Requires-Dist:" entries in distribution metadata. + """ + raise NotImplementedError() + + def iter_raw_dependencies(self) -> Iterable[str]: + """Raw Requires-Dist metadata.""" + return self.metadata.get_all("Requires-Dist", []) + + def iter_provided_extras(self) -> Iterable[NormalizedName]: + """Extras provided by this distribution. + + For modern .dist-info distributions, this is the collection of + "Provides-Extra:" entries in distribution metadata. + + The return value of this function is expected to be normalised names, + per PEP 685, with the returned value being handled appropriately by + `iter_dependencies`. + """ + raise NotImplementedError() + + def _iter_declared_entries_from_record(self) -> Iterator[str] | None: + try: + text = self.read_text("RECORD") + except FileNotFoundError: + return None + # This extra Path-str cast normalizes entries. + return (str(pathlib.Path(row[0])) for row in csv.reader(text.splitlines())) + + def _iter_declared_entries_from_legacy(self) -> Iterator[str] | None: + try: + text = self.read_text("installed-files.txt") + except FileNotFoundError: + return None + paths = (p for p in text.splitlines(keepends=False) if p) + root = self.location + info = self.info_location + if root is None or info is None: + return paths + try: + info_rel = pathlib.Path(info).relative_to(root) + except ValueError: # info is not relative to root. + return paths + if not info_rel.parts: # info *is* root. + return paths + return ( + _convert_installed_files_path(pathlib.Path(p).parts, info_rel.parts) + for p in paths + ) + + def iter_declared_entries(self) -> Iterator[str] | None: + """Iterate through file entries declared in this distribution. + + For modern .dist-info distributions, this is the files listed in the + ``RECORD`` metadata file. For legacy setuptools distributions, this + comes from ``installed-files.txt``, with entries normalized to be + compatible with the format used by ``RECORD``. + + :return: An iterator for listed entries, or None if the distribution + contains neither ``RECORD`` nor ``installed-files.txt``. + """ + return ( + self._iter_declared_entries_from_record() + or self._iter_declared_entries_from_legacy() + ) + + def _iter_requires_txt_entries(self) -> Iterator[RequiresEntry]: + """Parse a ``requires.txt`` in an egg-info directory. + + This is an INI-ish format where an egg-info stores dependencies. A + section name describes extra other environment markers, while each entry + is an arbitrary string (not a key-value pair) representing a dependency + as a requirement string (no markers). + + There is a construct in ``importlib.metadata`` called ``Sectioned`` that + does mostly the same, but the format is currently considered private. + """ + try: + content = self.read_text("requires.txt") + except FileNotFoundError: + return + extra = marker = "" # Section-less entries don't have markers. + for line in content.splitlines(): + line = line.strip() + if not line or line.startswith("#"): # Comment; ignored. + continue + if line.startswith("[") and line.endswith("]"): # A section header. + extra, _, marker = line.strip("[]").partition(":") + continue + yield RequiresEntry(requirement=line, extra=extra, marker=marker) + + def _iter_egg_info_extras(self) -> Iterable[str]: + """Get extras from the egg-info directory.""" + known_extras = {""} + for entry in self._iter_requires_txt_entries(): + extra = canonicalize_name(entry.extra) + if extra in known_extras: + continue + known_extras.add(extra) + yield extra + + def _iter_egg_info_dependencies(self) -> Iterable[str]: + """Get distribution dependencies from the egg-info directory. + + To ease parsing, this converts a legacy dependency entry into a PEP 508 + requirement string. Like ``_iter_requires_txt_entries()``, there is code + in ``importlib.metadata`` that does mostly the same, but not do exactly + what we need. + + Namely, ``importlib.metadata`` does not normalize the extra name before + putting it into the requirement string, which causes marker comparison + to fail because the dist-info format do normalize. This is consistent in + all currently available PEP 517 backends, although not standardized. + """ + for entry in self._iter_requires_txt_entries(): + extra = canonicalize_name(entry.extra) + if extra and entry.marker: + marker = f'({entry.marker}) and extra == "{extra}"' + elif extra: + marker = f'extra == "{extra}"' + elif entry.marker: + marker = entry.marker + else: + marker = "" + if marker: + yield f"{entry.requirement} ; {marker}" + else: + yield entry.requirement + + def _add_egg_info_requires(self, metadata: email.message.Message) -> None: + """Add egg-info requires.txt information to the metadata.""" + if not metadata.get_all("Requires-Dist"): + for dep in self._iter_egg_info_dependencies(): + metadata["Requires-Dist"] = dep + if not metadata.get_all("Provides-Extra"): + for extra in self._iter_egg_info_extras(): + metadata["Provides-Extra"] = extra + + +class BaseEnvironment: + """An environment containing distributions to introspect.""" + + @classmethod + def default(cls) -> BaseEnvironment: + raise NotImplementedError() + + @classmethod + def from_paths(cls, paths: list[str] | None) -> BaseEnvironment: + raise NotImplementedError() + + def get_distribution(self, name: str) -> BaseDistribution | None: + """Given a requirement name, return the installed distributions. + + The name may not be normalized. The implementation must canonicalize + it for lookup. + """ + raise NotImplementedError() + + def _iter_distributions(self) -> Iterator[BaseDistribution]: + """Iterate through installed distributions. + + This function should be implemented by subclass, but never called + directly. Use the public ``iter_distribution()`` instead, which + implements additional logic to make sure the distributions are valid. + """ + raise NotImplementedError() + + def iter_all_distributions(self) -> Iterator[BaseDistribution]: + """Iterate through all installed distributions without any filtering.""" + for dist in self._iter_distributions(): + # Make sure the distribution actually comes from a valid Python + # packaging distribution. Pip's AdjacentTempDirectory leaves folders + # e.g. ``~atplotlib.dist-info`` if cleanup was interrupted. The + # valid project name pattern is taken from PEP 508. + project_name_valid = re.match( + r"^([A-Z0-9]|[A-Z0-9][A-Z0-9._-]*[A-Z0-9])$", + dist.canonical_name, + flags=re.IGNORECASE, + ) + if not project_name_valid: + logger.warning( + "Ignoring invalid distribution %s (%s)", + dist.canonical_name, + dist.location, + ) + continue + yield dist + + def iter_installed_distributions( + self, + local_only: bool = True, + skip: Container[str] = stdlib_pkgs, + include_editables: bool = True, + editables_only: bool = False, + user_only: bool = False, + ) -> Iterator[BaseDistribution]: + """Return a list of installed distributions. + + This is based on ``iter_all_distributions()`` with additional filtering + options. Note that ``iter_installed_distributions()`` without arguments + is *not* equal to ``iter_all_distributions()``, since some of the + configurations exclude packages by default. + + :param local_only: If True (default), only return installations + local to the current virtualenv, if in a virtualenv. + :param skip: An iterable of canonicalized project names to ignore; + defaults to ``stdlib_pkgs``. + :param include_editables: If False, don't report editables. + :param editables_only: If True, only report editables. + :param user_only: If True, only report installations in the user + site directory. + """ + it = self.iter_all_distributions() + if local_only: + it = (d for d in it if d.local) + if not include_editables: + it = (d for d in it if not d.editable) + if editables_only: + it = (d for d in it if d.editable) + if user_only: + it = (d for d in it if d.in_usersite) + return (d for d in it if d.canonical_name not in skip) + + +class Wheel(Protocol): + location: str + + def as_zipfile(self) -> zipfile.ZipFile: + raise NotImplementedError() + + +class FilesystemWheel(Wheel): + def __init__(self, location: str) -> None: + self.location = location + + def as_zipfile(self) -> zipfile.ZipFile: + return zipfile.ZipFile(self.location, allowZip64=True) + + +class MemoryWheel(Wheel): + def __init__(self, location: str, stream: IO[bytes]) -> None: + self.location = location + self.stream = stream + + def as_zipfile(self) -> zipfile.ZipFile: + return zipfile.ZipFile(self.stream, allowZip64=True) diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/metadata/importlib/__init__.py b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/metadata/importlib/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..a779138db1040d3903c2bb66ecb2f52a46879dae --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/metadata/importlib/__init__.py @@ -0,0 +1,6 @@ +from ._dists import Distribution +from ._envs import Environment + +__all__ = ["NAME", "Distribution", "Environment"] + +NAME = "importlib" diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/metadata/importlib/__pycache__/__init__.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/metadata/importlib/__pycache__/__init__.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d7883d688df0d3814c46996400ea891e5cd7e690 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/metadata/importlib/__pycache__/__init__.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/metadata/importlib/__pycache__/_compat.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/metadata/importlib/__pycache__/_compat.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..dc0302c62dd4eaae90e4915688cdbbae93c36a1d Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/metadata/importlib/__pycache__/_compat.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/metadata/importlib/__pycache__/_dists.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/metadata/importlib/__pycache__/_dists.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..ea44863c1f5796df19c6658e2fc686e059911a47 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/metadata/importlib/__pycache__/_dists.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/metadata/importlib/__pycache__/_envs.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/metadata/importlib/__pycache__/_envs.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..ae9128170b71f142df241655074748b987336b4e Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/metadata/importlib/__pycache__/_envs.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/metadata/importlib/_compat.py b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/metadata/importlib/_compat.py new file mode 100644 index 0000000000000000000000000000000000000000..7de614d7f64ef463ede0066afd053b06a70f2d43 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/metadata/importlib/_compat.py @@ -0,0 +1,87 @@ +from __future__ import annotations + +import importlib.metadata +import os +from typing import Any, Protocol, cast + +from pip._vendor.packaging.utils import NormalizedName, canonicalize_name + + +class BadMetadata(ValueError): + def __init__(self, dist: importlib.metadata.Distribution, *, reason: str) -> None: + self.dist = dist + self.reason = reason + + def __str__(self) -> str: + return f"Bad metadata in {self.dist} ({self.reason})" + + +class BasePath(Protocol): + """A protocol that various path objects conform. + + This exists because importlib.metadata uses both ``pathlib.Path`` and + ``zipfile.Path``, and we need a common base for type hints (Union does not + work well since ``zipfile.Path`` is too new for our linter setup). + + This does not mean to be exhaustive, but only contains things that present + in both classes *that we need*. + """ + + @property + def name(self) -> str: + raise NotImplementedError() + + @property + def parent(self) -> BasePath: + raise NotImplementedError() + + +def get_info_location(d: importlib.metadata.Distribution) -> BasePath | None: + """Find the path to the distribution's metadata directory. + + HACK: This relies on importlib.metadata's private ``_path`` attribute. Not + all distributions exist on disk, so importlib.metadata is correct to not + expose the attribute as public. But pip's code base is old and not as clean, + so we do this to avoid having to rewrite too many things. Hopefully we can + eliminate this some day. + """ + return getattr(d, "_path", None) + + +def parse_name_and_version_from_info_directory( + dist: importlib.metadata.Distribution, +) -> tuple[str | None, str | None]: + """Get a name and version from the metadata directory name. + + This is much faster than reading distribution metadata. + """ + info_location = get_info_location(dist) + if info_location is None: + return None, None + + stem, suffix = os.path.splitext(info_location.name) + if suffix == ".dist-info": + name, sep, version = stem.partition("-") + if sep: + return name, version + + if suffix == ".egg-info": + name = stem.split("-", 1)[0] + return name, None + + return None, None + + +def get_dist_canonical_name(dist: importlib.metadata.Distribution) -> NormalizedName: + """Get the distribution's normalized name. + + The ``name`` attribute is only available in Python 3.10 or later. We are + targeting exactly that, but Mypy does not know this. + """ + if name := parse_name_and_version_from_info_directory(dist)[0]: + return canonicalize_name(name) + + name = cast(Any, dist).name + if not isinstance(name, str): + raise BadMetadata(dist, reason="invalid metadata entry 'name'") + return canonicalize_name(name) diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/metadata/importlib/_dists.py b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/metadata/importlib/_dists.py new file mode 100644 index 0000000000000000000000000000000000000000..97363af9a5513f0958b8f91ab67d16b0a978b133 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/metadata/importlib/_dists.py @@ -0,0 +1,223 @@ +from __future__ import annotations + +import email.message +import importlib.metadata +import pathlib +import zipfile +from collections.abc import Collection, Iterable, Iterator, Mapping, Sequence +from os import PathLike +from typing import ( + cast, +) + +from pip._vendor.packaging.requirements import Requirement +from pip._vendor.packaging.utils import NormalizedName, canonicalize_name +from pip._vendor.packaging.version import Version +from pip._vendor.packaging.version import parse as parse_version + +from pip._internal.exceptions import InvalidWheel, UnsupportedWheel +from pip._internal.metadata.base import ( + BaseDistribution, + BaseEntryPoint, + InfoPath, + Wheel, +) +from pip._internal.utils.misc import normalize_path +from pip._internal.utils.packaging import get_requirement +from pip._internal.utils.temp_dir import TempDirectory +from pip._internal.utils.wheel import parse_wheel, read_wheel_metadata_file + +from ._compat import ( + BasePath, + get_dist_canonical_name, + parse_name_and_version_from_info_directory, +) + + +class WheelDistribution(importlib.metadata.Distribution): + """An ``importlib.metadata.Distribution`` read from a wheel. + + Although ``importlib.metadata.PathDistribution`` accepts ``zipfile.Path``, + its implementation is too "lazy" for pip's needs (we can't keep the ZipFile + handle open for the entire lifetime of the distribution object). + + This implementation eagerly reads the entire metadata directory into the + memory instead, and operates from that. + """ + + def __init__( + self, + files: Mapping[pathlib.PurePosixPath, bytes], + info_location: pathlib.PurePosixPath, + ) -> None: + self._files = files + self.info_location = info_location + + @classmethod + def from_zipfile( + cls, + zf: zipfile.ZipFile, + name: str, + location: str, + ) -> WheelDistribution: + info_dir, _ = parse_wheel(zf, name) + paths = ( + (name, pathlib.PurePosixPath(name.split("/", 1)[-1])) + for name in zf.namelist() + if name.startswith(f"{info_dir}/") + ) + files = { + relpath: read_wheel_metadata_file(zf, fullpath) + for fullpath, relpath in paths + } + info_location = pathlib.PurePosixPath(location, info_dir) + return cls(files, info_location) + + def iterdir(self, path: InfoPath) -> Iterator[pathlib.PurePosixPath]: + # Only allow iterating through the metadata directory. + if pathlib.PurePosixPath(str(path)) in self._files: + return iter(self._files) + raise FileNotFoundError(path) + + def read_text(self, filename: str) -> str | None: + try: + data = self._files[pathlib.PurePosixPath(filename)] + except KeyError: + return None + try: + text = data.decode("utf-8") + except UnicodeDecodeError as e: + wheel = self.info_location.parent + error = f"Error decoding metadata for {wheel}: {e} in {filename} file" + raise UnsupportedWheel(error) + return text + + def locate_file(self, path: str | PathLike[str]) -> pathlib.Path: + # This method doesn't make sense for our in-memory wheel, but the API + # requires us to define it. + raise NotImplementedError + + +class Distribution(BaseDistribution): + def __init__( + self, + dist: importlib.metadata.Distribution, + info_location: BasePath | None, + installed_location: BasePath | None, + ) -> None: + self._dist = dist + self._info_location = info_location + self._installed_location = installed_location + + @classmethod + def from_directory(cls, directory: str) -> BaseDistribution: + info_location = pathlib.Path(directory) + dist = importlib.metadata.Distribution.at(info_location) + return cls(dist, info_location, info_location.parent) + + @classmethod + def from_metadata_file_contents( + cls, + metadata_contents: bytes, + filename: str, + project_name: str, + ) -> BaseDistribution: + # Generate temp dir to contain the metadata file, and write the file contents. + temp_dir = pathlib.Path( + TempDirectory(kind="metadata", globally_managed=True).path + ) + metadata_path = temp_dir / "METADATA" + metadata_path.write_bytes(metadata_contents) + # Construct dist pointing to the newly created directory. + dist = importlib.metadata.Distribution.at(metadata_path.parent) + return cls(dist, metadata_path.parent, None) + + @classmethod + def from_wheel(cls, wheel: Wheel, name: str) -> BaseDistribution: + try: + with wheel.as_zipfile() as zf: + dist = WheelDistribution.from_zipfile(zf, name, wheel.location) + except zipfile.BadZipFile as e: + raise InvalidWheel(wheel.location, name) from e + return cls(dist, dist.info_location, pathlib.PurePosixPath(wheel.location)) + + @property + def location(self) -> str | None: + if self._info_location is None: + return None + return str(self._info_location.parent) + + @property + def info_location(self) -> str | None: + if self._info_location is None: + return None + return str(self._info_location) + + @property + def installed_location(self) -> str | None: + if self._installed_location is None: + return None + return normalize_path(str(self._installed_location)) + + @property + def canonical_name(self) -> NormalizedName: + return get_dist_canonical_name(self._dist) + + @property + def version(self) -> Version: + if version := parse_name_and_version_from_info_directory(self._dist)[1]: + return parse_version(version) + return parse_version(self._dist.version) + + @property + def raw_version(self) -> str: + return self._dist.version + + def is_file(self, path: InfoPath) -> bool: + return self._dist.read_text(str(path)) is not None + + def iter_distutils_script_names(self) -> Iterator[str]: + # A distutils installation is always "flat" (not in e.g. egg form), so + # if this distribution's info location is NOT a pathlib.Path (but e.g. + # zipfile.Path), it can never contain any distutils scripts. + if not isinstance(self._info_location, pathlib.Path): + return + for child in self._info_location.joinpath("scripts").iterdir(): + yield child.name + + def read_text(self, path: InfoPath) -> str: + content = self._dist.read_text(str(path)) + if content is None: + raise FileNotFoundError(path) + return content + + def iter_entry_points(self) -> Iterable[BaseEntryPoint]: + # importlib.metadata's EntryPoint structure satisfies BaseEntryPoint. + return self._dist.entry_points + + def _metadata_impl(self) -> email.message.Message: + # From Python 3.10+, importlib.metadata declares PackageMetadata as the + # return type. This protocol is unfortunately a disaster now and misses + # a ton of fields that we need, including get() and get_payload(). We + # rely on the implementation that the object is actually a Message now, + # until upstream can improve the protocol. (python/cpython#94952) + return cast(email.message.Message, self._dist.metadata) + + def iter_provided_extras(self) -> Iterable[NormalizedName]: + return [ + canonicalize_name(extra) + for extra in self.metadata.get_all("Provides-Extra", []) + ] + + def iter_dependencies(self, extras: Collection[str] = ()) -> Iterable[Requirement]: + contexts: Sequence[dict[str, str]] = [{"extra": e} for e in extras] + for req_string in self.metadata.get_all("Requires-Dist", []): + # strip() because email.message.Message.get_all() may return a leading \n + # in case a long header was wrapped. + req = get_requirement(req_string.strip()) + if not req.marker: + yield req + elif not extras and req.marker.evaluate({"extra": ""}): + yield req + elif any(req.marker.evaluate(context) for context in contexts): + yield req diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/metadata/importlib/_envs.py b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/metadata/importlib/_envs.py new file mode 100644 index 0000000000000000000000000000000000000000..71a73b7311faaab31a2a0bc67171d4fbe5a11642 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/metadata/importlib/_envs.py @@ -0,0 +1,143 @@ +from __future__ import annotations + +import importlib.metadata +import logging +import os +import pathlib +import sys +import zipfile +from collections.abc import Iterator, Sequence +from typing import Optional + +from pip._vendor.packaging.utils import ( + InvalidWheelFilename, + NormalizedName, + canonicalize_name, + parse_wheel_filename, +) + +from pip._internal.metadata.base import BaseDistribution, BaseEnvironment +from pip._internal.utils.filetypes import WHEEL_EXTENSION + +from ._compat import BadMetadata, BasePath, get_dist_canonical_name, get_info_location +from ._dists import Distribution + +logger = logging.getLogger(__name__) + + +def _looks_like_wheel(location: str) -> bool: + if not location.endswith(WHEEL_EXTENSION): + return False + if not os.path.isfile(location): + return False + try: + parse_wheel_filename(os.path.basename(location)) + except InvalidWheelFilename: + return False + return zipfile.is_zipfile(location) + + +class _DistributionFinder: + """Finder to locate distributions. + + The main purpose of this class is to memoize found distributions' names, so + only one distribution is returned for each package name. At lot of pip code + assumes this (because it is setuptools's behavior), and not doing the same + can potentially cause a distribution in lower precedence path to override a + higher precedence one if the caller is not careful. + + Eventually we probably want to make it possible to see lower precedence + installations as well. It's useful feature, after all. + """ + + FoundResult = tuple[importlib.metadata.Distribution, Optional[BasePath]] + + def __init__(self) -> None: + self._found_names: set[NormalizedName] = set() + + def _find_impl(self, location: str) -> Iterator[FoundResult]: + """Find distributions in a location.""" + # Skip looking inside a wheel. Since a package inside a wheel is not + # always valid (due to .data directories etc.), its .dist-info entry + # should not be considered an installed distribution. + if _looks_like_wheel(location): + return + # To know exactly where we find a distribution, we have to feed in the + # paths one by one, instead of dumping the list to importlib.metadata. + for dist in importlib.metadata.distributions(path=[location]): + info_location = get_info_location(dist) + try: + name = get_dist_canonical_name(dist) + except BadMetadata as e: + logger.warning("Skipping %s due to %s", info_location, e.reason) + continue + if name in self._found_names: + continue + self._found_names.add(name) + yield dist, info_location + + def find(self, location: str) -> Iterator[BaseDistribution]: + """Find distributions in a location. + + The path can be either a directory, or a ZIP archive. + """ + for dist, info_location in self._find_impl(location): + if info_location is None: + installed_location: BasePath | None = None + else: + installed_location = info_location.parent + yield Distribution(dist, info_location, installed_location) + + def find_legacy_editables(self, location: str) -> Iterator[BaseDistribution]: + """Read location in egg-link files and return distributions in there. + + The path should be a directory; otherwise this returns nothing. This + follows how setuptools does this for compatibility. The first non-empty + line in the egg-link is read as a path (resolved against the egg-link's + containing directory if relative). Distributions found at that linked + location are returned. + """ + path = pathlib.Path(location) + if not path.is_dir(): + return + for child in path.iterdir(): + if child.suffix != ".egg-link": + continue + with child.open() as f: + lines = (line.strip() for line in f) + target_rel = next((line for line in lines if line), "") + if not target_rel: + continue + target_location = str(path.joinpath(target_rel)) + for dist, info_location in self._find_impl(target_location): + yield Distribution(dist, info_location, path) + + +class Environment(BaseEnvironment): + def __init__(self, paths: Sequence[str]) -> None: + self._paths = paths + + @classmethod + def default(cls) -> BaseEnvironment: + return cls(sys.path) + + @classmethod + def from_paths(cls, paths: list[str] | None) -> BaseEnvironment: + if paths is None: + return cls(sys.path) + return cls(paths) + + def _iter_distributions(self) -> Iterator[BaseDistribution]: + finder = _DistributionFinder() + for location in self._paths: + yield from finder.find(location) + yield from finder.find_legacy_editables(location) + + def get_distribution(self, name: str) -> BaseDistribution | None: + canonical_name = canonicalize_name(name) + matches = ( + distribution + for distribution in self.iter_all_distributions() + if distribution.canonical_name == canonical_name + ) + return next(matches, None) diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/metadata/pkg_resources.py b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/metadata/pkg_resources.py new file mode 100644 index 0000000000000000000000000000000000000000..89fce8b6e5ddeceb77b2f155221ee3f153dbca31 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/metadata/pkg_resources.py @@ -0,0 +1,298 @@ +from __future__ import annotations + +import email.message +import email.parser +import logging +import os +import zipfile +from collections.abc import Collection, Iterable, Iterator, Mapping +from typing import ( + NamedTuple, +) + +from pip._vendor import pkg_resources +from pip._vendor.packaging.requirements import Requirement +from pip._vendor.packaging.utils import NormalizedName, canonicalize_name +from pip._vendor.packaging.version import Version +from pip._vendor.packaging.version import parse as parse_version + +from pip._internal.exceptions import InvalidWheel, NoneMetadataError, UnsupportedWheel +from pip._internal.utils.egg_link import egg_link_path_from_location +from pip._internal.utils.misc import display_path, normalize_path +from pip._internal.utils.wheel import parse_wheel, read_wheel_metadata_file + +from .base import ( + BaseDistribution, + BaseEntryPoint, + BaseEnvironment, + InfoPath, + Wheel, +) + +__all__ = ["NAME", "Distribution", "Environment"] + +logger = logging.getLogger(__name__) + +NAME = "pkg_resources" + + +class EntryPoint(NamedTuple): + name: str + value: str + group: str + + +class InMemoryMetadata: + """IMetadataProvider that reads metadata files from a dictionary. + + This also maps metadata decoding exceptions to our internal exception type. + """ + + def __init__(self, metadata: Mapping[str, bytes], wheel_name: str) -> None: + self._metadata = metadata + self._wheel_name = wheel_name + + def has_metadata(self, name: str) -> bool: + return name in self._metadata + + def get_metadata(self, name: str) -> str: + try: + return self._metadata[name].decode() + except UnicodeDecodeError as e: + # Augment the default error with the origin of the file. + raise UnsupportedWheel( + f"Error decoding metadata for {self._wheel_name}: {e} in {name} file" + ) + + def get_metadata_lines(self, name: str) -> Iterable[str]: + return pkg_resources.yield_lines(self.get_metadata(name)) + + def metadata_isdir(self, name: str) -> bool: + return False + + def metadata_listdir(self, name: str) -> list[str]: + return [] + + def run_script(self, script_name: str, namespace: str) -> None: + pass + + +class Distribution(BaseDistribution): + def __init__(self, dist: pkg_resources.Distribution) -> None: + self._dist = dist + # This is populated lazily, to avoid loading metadata for all possible + # distributions eagerly. + self.__extra_mapping: Mapping[NormalizedName, str] | None = None + + @property + def _extra_mapping(self) -> Mapping[NormalizedName, str]: + if self.__extra_mapping is None: + self.__extra_mapping = { + canonicalize_name(extra): extra for extra in self._dist.extras + } + + return self.__extra_mapping + + @classmethod + def from_directory(cls, directory: str) -> BaseDistribution: + dist_dir = directory.rstrip(os.sep) + + # Build a PathMetadata object, from path to metadata. :wink: + base_dir, dist_dir_name = os.path.split(dist_dir) + metadata = pkg_resources.PathMetadata(base_dir, dist_dir) + + # Determine the correct Distribution object type. + if dist_dir.endswith(".egg-info"): + dist_cls = pkg_resources.Distribution + dist_name = os.path.splitext(dist_dir_name)[0] + else: + assert dist_dir.endswith(".dist-info") + dist_cls = pkg_resources.DistInfoDistribution + dist_name = os.path.splitext(dist_dir_name)[0].split("-")[0] + + dist = dist_cls(base_dir, project_name=dist_name, metadata=metadata) + return cls(dist) + + @classmethod + def from_metadata_file_contents( + cls, + metadata_contents: bytes, + filename: str, + project_name: str, + ) -> BaseDistribution: + metadata_dict = { + "METADATA": metadata_contents, + } + dist = pkg_resources.DistInfoDistribution( + location=filename, + metadata=InMemoryMetadata(metadata_dict, filename), + project_name=project_name, + ) + return cls(dist) + + @classmethod + def from_wheel(cls, wheel: Wheel, name: str) -> BaseDistribution: + try: + with wheel.as_zipfile() as zf: + info_dir, _ = parse_wheel(zf, name) + metadata_dict = { + path.split("/", 1)[-1]: read_wheel_metadata_file(zf, path) + for path in zf.namelist() + if path.startswith(f"{info_dir}/") + } + except zipfile.BadZipFile as e: + raise InvalidWheel(wheel.location, name) from e + except UnsupportedWheel as e: + raise UnsupportedWheel(f"{name} has an invalid wheel, {e}") + dist = pkg_resources.DistInfoDistribution( + location=wheel.location, + metadata=InMemoryMetadata(metadata_dict, wheel.location), + project_name=name, + ) + return cls(dist) + + @property + def location(self) -> str | None: + return self._dist.location + + @property + def installed_location(self) -> str | None: + egg_link = egg_link_path_from_location(self.raw_name) + if egg_link: + location = egg_link + elif self.location: + location = self.location + else: + return None + return normalize_path(location) + + @property + def info_location(self) -> str | None: + return self._dist.egg_info + + @property + def installed_by_distutils(self) -> bool: + # A distutils-installed distribution is provided by FileMetadata. This + # provider has a "path" attribute not present anywhere else. Not the + # best introspection logic, but pip has been doing this for a long time. + try: + return bool(self._dist._provider.path) + except AttributeError: + return False + + @property + def canonical_name(self) -> NormalizedName: + return canonicalize_name(self._dist.project_name) + + @property + def version(self) -> Version: + return parse_version(self._dist.version) + + @property + def raw_version(self) -> str: + return self._dist.version + + def is_file(self, path: InfoPath) -> bool: + return self._dist.has_metadata(str(path)) + + def iter_distutils_script_names(self) -> Iterator[str]: + yield from self._dist.metadata_listdir("scripts") + + def read_text(self, path: InfoPath) -> str: + name = str(path) + if not self._dist.has_metadata(name): + raise FileNotFoundError(name) + content = self._dist.get_metadata(name) + if content is None: + raise NoneMetadataError(self, name) + return content + + def iter_entry_points(self) -> Iterable[BaseEntryPoint]: + for group, entries in self._dist.get_entry_map().items(): + for name, entry_point in entries.items(): + name, _, value = str(entry_point).partition("=") + yield EntryPoint(name=name.strip(), value=value.strip(), group=group) + + def _metadata_impl(self) -> email.message.Message: + """ + :raises NoneMetadataError: if the distribution reports `has_metadata()` + True but `get_metadata()` returns None. + """ + if isinstance(self._dist, pkg_resources.DistInfoDistribution): + metadata_name = "METADATA" + else: + metadata_name = "PKG-INFO" + try: + metadata = self.read_text(metadata_name) + except FileNotFoundError: + if self.location: + displaying_path = display_path(self.location) + else: + displaying_path = repr(self.location) + logger.warning("No metadata found in %s", displaying_path) + metadata = "" + feed_parser = email.parser.FeedParser() + feed_parser.feed(metadata) + return feed_parser.close() + + def iter_dependencies(self, extras: Collection[str] = ()) -> Iterable[Requirement]: + if extras: + relevant_extras = set(self._extra_mapping) & set( + map(canonicalize_name, extras) + ) + extras = [self._extra_mapping[extra] for extra in relevant_extras] + return self._dist.requires(extras) + + def iter_provided_extras(self) -> Iterable[NormalizedName]: + return self._extra_mapping.keys() + + +class Environment(BaseEnvironment): + def __init__(self, ws: pkg_resources.WorkingSet) -> None: + self._ws = ws + + @classmethod + def default(cls) -> BaseEnvironment: + return cls(pkg_resources.working_set) + + @classmethod + def from_paths(cls, paths: list[str] | None) -> BaseEnvironment: + return cls(pkg_resources.WorkingSet(paths)) + + def _iter_distributions(self) -> Iterator[BaseDistribution]: + for dist in self._ws: + yield Distribution(dist) + + def _search_distribution(self, name: str) -> BaseDistribution | None: + """Find a distribution matching the ``name`` in the environment. + + This searches from *all* distributions available in the environment, to + match the behavior of ``pkg_resources.get_distribution()``. + """ + canonical_name = canonicalize_name(name) + for dist in self.iter_all_distributions(): + if dist.canonical_name == canonical_name: + return dist + return None + + def get_distribution(self, name: str) -> BaseDistribution | None: + # Search the distribution by looking through the working set. + dist = self._search_distribution(name) + if dist: + return dist + + # If distribution could not be found, call working_set.require to + # update the working set, and try to find the distribution again. + # This might happen for e.g. when you install a package twice, once + # using setup.py develop and again using setup.py install. Now when + # running pip uninstall twice, the package gets removed from the + # working set in the first uninstall, so we have to populate the + # working set again so that pip knows about it and the packages gets + # picked up and is successfully uninstalled the second time too. + try: + # We didn't pass in any version specifiers, so this can never + # raise pkg_resources.VersionConflict. + self._ws.require(name) + except pkg_resources.DistributionNotFound: + return None + return self._search_distribution(name) diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/models/__init__.py b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/models/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..7b1fc2950326463fb5bf1cc460e5ca0ac3de3e9a --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/models/__init__.py @@ -0,0 +1 @@ +"""A package that contains models that represent entities.""" diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/models/__pycache__/__init__.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/models/__pycache__/__init__.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2ca55737e6641bbb8d05f49a0203e8a66a42daa1 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/models/__pycache__/__init__.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/models/__pycache__/candidate.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/models/__pycache__/candidate.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..59a4e827c172f8e32b5fe2a302b4537dc12643f9 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/models/__pycache__/candidate.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/models/__pycache__/direct_url.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/models/__pycache__/direct_url.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..27f3729036024d8f3907edd48880090711d64347 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/models/__pycache__/direct_url.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/models/__pycache__/format_control.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/models/__pycache__/format_control.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..573646c2000f7a8563bc30592d7cbf7c4d39f21b Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/models/__pycache__/format_control.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/models/__pycache__/index.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/models/__pycache__/index.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..4e711ea100f818fc09439365acd5fc309c91600d Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/models/__pycache__/index.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/models/__pycache__/installation_report.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/models/__pycache__/installation_report.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..18d72cbc5a7c762c020b8adbf01f8c8a36a7f2f1 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/models/__pycache__/installation_report.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/models/__pycache__/link.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/models/__pycache__/link.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..5a0fb33b4f2fa7f6be99fa1d76d6b454eb506057 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/models/__pycache__/link.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/models/__pycache__/pylock.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/models/__pycache__/pylock.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..93898206aebff77072016827907a21c69b0fe383 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/models/__pycache__/pylock.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/models/__pycache__/scheme.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/models/__pycache__/scheme.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..7d07cf3027a8350d2cf2b596d2408bf7efc4b407 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/models/__pycache__/scheme.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/models/__pycache__/search_scope.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/models/__pycache__/search_scope.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a438ea0fa28e0ff6b22f568443b4589e50249e9d Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/models/__pycache__/search_scope.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/models/__pycache__/selection_prefs.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/models/__pycache__/selection_prefs.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..ea4e24c41208a828fcc29f8b4e5535068acaa1d8 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/models/__pycache__/selection_prefs.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/models/__pycache__/target_python.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/models/__pycache__/target_python.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d18e721f9cf8e151d4fa668fbac64fc6a75f264d Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/models/__pycache__/target_python.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/models/__pycache__/wheel.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/models/__pycache__/wheel.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..029b44463dc406124a17f65dd1bb371c8dcace34 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/models/__pycache__/wheel.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/models/candidate.py b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/models/candidate.py new file mode 100644 index 0000000000000000000000000000000000000000..f27f283154ac5aa55d52ccac754138b36341ff6b --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/models/candidate.py @@ -0,0 +1,25 @@ +from dataclasses import dataclass + +from pip._vendor.packaging.version import Version +from pip._vendor.packaging.version import parse as parse_version + +from pip._internal.models.link import Link + + +@dataclass(frozen=True) +class InstallationCandidate: + """Represents a potential "candidate" for installation.""" + + __slots__ = ["name", "version", "link"] + + name: str + version: Version + link: Link + + def __init__(self, name: str, version: str, link: Link) -> None: + object.__setattr__(self, "name", name) + object.__setattr__(self, "version", parse_version(version)) + object.__setattr__(self, "link", link) + + def __str__(self) -> str: + return f"{self.name!r} candidate (version {self.version} at {self.link})" diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/models/direct_url.py b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/models/direct_url.py new file mode 100644 index 0000000000000000000000000000000000000000..aefc670cd511c02e8b784a75d6062d0d4c9b9e9b --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/models/direct_url.py @@ -0,0 +1,227 @@ +"""PEP 610""" + +from __future__ import annotations + +import json +import re +import urllib.parse +from collections.abc import Iterable +from dataclasses import dataclass +from typing import Any, ClassVar, TypeVar, Union + +__all__ = [ + "DirectUrl", + "DirectUrlValidationError", + "DirInfo", + "ArchiveInfo", + "VcsInfo", +] + +T = TypeVar("T") + +DIRECT_URL_METADATA_NAME = "direct_url.json" +ENV_VAR_RE = re.compile(r"^\$\{[A-Za-z0-9-_]+\}(:\$\{[A-Za-z0-9-_]+\})?$") + + +class DirectUrlValidationError(Exception): + pass + + +def _get( + d: dict[str, Any], expected_type: type[T], key: str, default: T | None = None +) -> T | None: + """Get value from dictionary and verify expected type.""" + if key not in d: + return default + value = d[key] + if not isinstance(value, expected_type): + raise DirectUrlValidationError( + f"{value!r} has unexpected type for {key} (expected {expected_type})" + ) + return value + + +def _get_required( + d: dict[str, Any], expected_type: type[T], key: str, default: T | None = None +) -> T: + value = _get(d, expected_type, key, default) + if value is None: + raise DirectUrlValidationError(f"{key} must have a value") + return value + + +def _exactly_one_of(infos: Iterable[InfoType | None]) -> InfoType: + infos = [info for info in infos if info is not None] + if not infos: + raise DirectUrlValidationError( + "missing one of archive_info, dir_info, vcs_info" + ) + if len(infos) > 1: + raise DirectUrlValidationError( + "more than one of archive_info, dir_info, vcs_info" + ) + assert infos[0] is not None + return infos[0] + + +def _filter_none(**kwargs: Any) -> dict[str, Any]: + """Make dict excluding None values.""" + return {k: v for k, v in kwargs.items() if v is not None} + + +@dataclass +class VcsInfo: + name: ClassVar = "vcs_info" + + vcs: str + commit_id: str + requested_revision: str | None = None + + @classmethod + def _from_dict(cls, d: dict[str, Any] | None) -> VcsInfo | None: + if d is None: + return None + return cls( + vcs=_get_required(d, str, "vcs"), + commit_id=_get_required(d, str, "commit_id"), + requested_revision=_get(d, str, "requested_revision"), + ) + + def _to_dict(self) -> dict[str, Any]: + return _filter_none( + vcs=self.vcs, + requested_revision=self.requested_revision, + commit_id=self.commit_id, + ) + + +class ArchiveInfo: + name = "archive_info" + + def __init__( + self, + hash: str | None = None, + hashes: dict[str, str] | None = None, + ) -> None: + # set hashes before hash, since the hash setter will further populate hashes + self.hashes = hashes + self.hash = hash + + @property + def hash(self) -> str | None: + return self._hash + + @hash.setter + def hash(self, value: str | None) -> None: + if value is not None: + # Auto-populate the hashes key to upgrade to the new format automatically. + # We don't back-populate the legacy hash key from hashes. + try: + hash_name, hash_value = value.split("=", 1) + except ValueError: + raise DirectUrlValidationError( + f"invalid archive_info.hash format: {value!r}" + ) + if self.hashes is None: + self.hashes = {hash_name: hash_value} + elif hash_name not in self.hashes: + self.hashes = self.hashes.copy() + self.hashes[hash_name] = hash_value + self._hash = value + + @classmethod + def _from_dict(cls, d: dict[str, Any] | None) -> ArchiveInfo | None: + if d is None: + return None + return cls(hash=_get(d, str, "hash"), hashes=_get(d, dict, "hashes")) + + def _to_dict(self) -> dict[str, Any]: + return _filter_none(hash=self.hash, hashes=self.hashes) + + +@dataclass +class DirInfo: + name: ClassVar = "dir_info" + + editable: bool = False + + @classmethod + def _from_dict(cls, d: dict[str, Any] | None) -> DirInfo | None: + if d is None: + return None + return cls(editable=_get_required(d, bool, "editable", default=False)) + + def _to_dict(self) -> dict[str, Any]: + return _filter_none(editable=self.editable or None) + + +InfoType = Union[ArchiveInfo, DirInfo, VcsInfo] + + +@dataclass +class DirectUrl: + url: str + info: InfoType + subdirectory: str | None = None + + def _remove_auth_from_netloc(self, netloc: str) -> str: + if "@" not in netloc: + return netloc + user_pass, netloc_no_user_pass = netloc.split("@", 1) + if ( + isinstance(self.info, VcsInfo) + and self.info.vcs == "git" + and user_pass == "git" + ): + return netloc + if ENV_VAR_RE.match(user_pass): + return netloc + return netloc_no_user_pass + + @property + def redacted_url(self) -> str: + """url with user:password part removed unless it is formed with + environment variables as specified in PEP 610, or it is ``git`` + in the case of a git URL. + """ + purl = urllib.parse.urlsplit(self.url) + netloc = self._remove_auth_from_netloc(purl.netloc) + surl = urllib.parse.urlunsplit( + (purl.scheme, netloc, purl.path, purl.query, purl.fragment) + ) + return surl + + def validate(self) -> None: + self.from_dict(self.to_dict()) + + @classmethod + def from_dict(cls, d: dict[str, Any]) -> DirectUrl: + return DirectUrl( + url=_get_required(d, str, "url"), + subdirectory=_get(d, str, "subdirectory"), + info=_exactly_one_of( + [ + ArchiveInfo._from_dict(_get(d, dict, "archive_info")), + DirInfo._from_dict(_get(d, dict, "dir_info")), + VcsInfo._from_dict(_get(d, dict, "vcs_info")), + ] + ), + ) + + def to_dict(self) -> dict[str, Any]: + res = _filter_none( + url=self.redacted_url, + subdirectory=self.subdirectory, + ) + res[self.info.name] = self.info._to_dict() + return res + + @classmethod + def from_json(cls, s: str) -> DirectUrl: + return cls.from_dict(json.loads(s)) + + def to_json(self) -> str: + return json.dumps(self.to_dict(), sort_keys=True) + + def is_local_editable(self) -> bool: + return isinstance(self.info, DirInfo) and self.info.editable diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/models/format_control.py b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/models/format_control.py new file mode 100644 index 0000000000000000000000000000000000000000..9f07e3f34993379fb06378442a82438e057ebe30 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/models/format_control.py @@ -0,0 +1,78 @@ +from __future__ import annotations + +from pip._vendor.packaging.utils import canonicalize_name + +from pip._internal.exceptions import CommandError + + +class FormatControl: + """Helper for managing formats from which a package can be installed.""" + + __slots__ = ["no_binary", "only_binary"] + + def __init__( + self, + no_binary: set[str] | None = None, + only_binary: set[str] | None = None, + ) -> None: + if no_binary is None: + no_binary = set() + if only_binary is None: + only_binary = set() + + self.no_binary = no_binary + self.only_binary = only_binary + + def __eq__(self, other: object) -> bool: + if not isinstance(other, self.__class__): + return NotImplemented + + if self.__slots__ != other.__slots__: + return False + + return all(getattr(self, k) == getattr(other, k) for k in self.__slots__) + + def __repr__(self) -> str: + return f"{self.__class__.__name__}({self.no_binary}, {self.only_binary})" + + @staticmethod + def handle_mutual_excludes(value: str, target: set[str], other: set[str]) -> None: + if value.startswith("-"): + raise CommandError( + "--no-binary / --only-binary option requires 1 argument." + ) + new = value.split(",") + while ":all:" in new: + other.clear() + target.clear() + target.add(":all:") + del new[: new.index(":all:") + 1] + # Without a none, we want to discard everything as :all: covers it + if ":none:" not in new: + return + for name in new: + if name == ":none:": + target.clear() + continue + name = canonicalize_name(name) + other.discard(name) + target.add(name) + + def get_allowed_formats(self, canonical_name: str) -> frozenset[str]: + result = {"binary", "source"} + if canonical_name in self.only_binary: + result.discard("source") + elif canonical_name in self.no_binary: + result.discard("binary") + elif ":all:" in self.only_binary: + result.discard("source") + elif ":all:" in self.no_binary: + result.discard("binary") + return frozenset(result) + + def disallow_binaries(self) -> None: + self.handle_mutual_excludes( + ":all:", + self.no_binary, + self.only_binary, + ) diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/models/index.py b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/models/index.py new file mode 100644 index 0000000000000000000000000000000000000000..b94c32511f0cda2363bfc4f29c9c8bfcc7101f9b --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/models/index.py @@ -0,0 +1,28 @@ +import urllib.parse + + +class PackageIndex: + """Represents a Package Index and provides easier access to endpoints""" + + __slots__ = ["url", "netloc", "simple_url", "pypi_url", "file_storage_domain"] + + def __init__(self, url: str, file_storage_domain: str) -> None: + super().__init__() + self.url = url + self.netloc = urllib.parse.urlsplit(url).netloc + self.simple_url = self._url_for_path("simple") + self.pypi_url = self._url_for_path("pypi") + + # This is part of a temporary hack used to block installs of PyPI + # packages which depend on external urls only necessary until PyPI can + # block such packages themselves + self.file_storage_domain = file_storage_domain + + def _url_for_path(self, path: str) -> str: + return urllib.parse.urljoin(self.url, path) + + +PyPI = PackageIndex("https://pypi.org/", file_storage_domain="files.pythonhosted.org") +TestPyPI = PackageIndex( + "https://test.pypi.org/", file_storage_domain="test-files.pythonhosted.org" +) diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/models/installation_report.py b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/models/installation_report.py new file mode 100644 index 0000000000000000000000000000000000000000..3e8e9683bedc3dfb0071767c7cb6215fa49d92e5 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/models/installation_report.py @@ -0,0 +1,57 @@ +from collections.abc import Sequence +from typing import Any + +from pip._vendor.packaging.markers import default_environment + +from pip import __version__ +from pip._internal.req.req_install import InstallRequirement + + +class InstallationReport: + def __init__(self, install_requirements: Sequence[InstallRequirement]): + self._install_requirements = install_requirements + + @classmethod + def _install_req_to_dict(cls, ireq: InstallRequirement) -> dict[str, Any]: + assert ireq.download_info, f"No download_info for {ireq}" + res = { + # PEP 610 json for the download URL. download_info.archive_info.hashes may + # be absent when the requirement was installed from the wheel cache + # and the cache entry was populated by an older pip version that did not + # record origin.json. + "download_info": ireq.download_info.to_dict(), + # is_direct is true if the requirement was a direct URL reference (which + # includes editable requirements), and false if the requirement was + # downloaded from a PEP 503 index or --find-links. + "is_direct": ireq.is_direct, + # is_yanked is true if the requirement was yanked from the index, but + # was still selected by pip to conform to PEP 592. + "is_yanked": ireq.link.is_yanked if ireq.link else False, + # requested is true if the requirement was specified by the user (aka + # top level requirement), and false if it was installed as a dependency of a + # requirement. https://peps.python.org/pep-0376/#requested + "requested": ireq.user_supplied, + # PEP 566 json encoding for metadata + # https://www.python.org/dev/peps/pep-0566/#json-compatible-metadata + "metadata": ireq.get_dist().metadata_dict, + } + if ireq.user_supplied and ireq.extras: + # For top level requirements, the list of requested extras, if any. + res["requested_extras"] = sorted(ireq.extras) + return res + + def to_dict(self) -> dict[str, Any]: + return { + "version": "1", + "pip_version": __version__, + "install": [ + self._install_req_to_dict(ireq) for ireq in self._install_requirements + ], + # https://peps.python.org/pep-0508/#environment-markers + # TODO: currently, the resolver uses the default environment to evaluate + # environment markers, so that is what we report here. In the future, it + # should also take into account options such as --python-version or + # --platform, perhaps under the form of an environment_override field? + # https://github.com/pypa/pip/issues/11198 + "environment": default_environment(), + } diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/models/link.py b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/models/link.py new file mode 100644 index 0000000000000000000000000000000000000000..2e2c0f836acc5646d0257845f28ae20f5d85851a --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/models/link.py @@ -0,0 +1,613 @@ +from __future__ import annotations + +import functools +import itertools +import logging +import os +import posixpath +import re +import urllib.parse +from collections.abc import Mapping +from dataclasses import dataclass +from typing import ( + TYPE_CHECKING, + Any, + NamedTuple, +) + +from pip._internal.utils.deprecation import deprecated +from pip._internal.utils.filetypes import WHEEL_EXTENSION +from pip._internal.utils.hashes import Hashes +from pip._internal.utils.misc import ( + pairwise, + redact_auth_from_url, + split_auth_from_netloc, + splitext, +) +from pip._internal.utils.urls import path_to_url, url_to_path + +if TYPE_CHECKING: + from pip._internal.index.collector import IndexContent + +logger = logging.getLogger(__name__) + + +# Order matters, earlier hashes have a precedence over later hashes for what +# we will pick to use. +_SUPPORTED_HASHES = ("sha512", "sha384", "sha256", "sha224", "sha1", "md5") + + +@dataclass(frozen=True) +class LinkHash: + """Links to content may have embedded hash values. This class parses those. + + `name` must be any member of `_SUPPORTED_HASHES`. + + This class can be converted to and from `ArchiveInfo`. While ArchiveInfo intends to + be JSON-serializable to conform to PEP 610, this class contains the logic for + parsing a hash name and value for correctness, and then checking whether that hash + conforms to a schema with `.is_hash_allowed()`.""" + + name: str + value: str + + _hash_url_fragment_re = re.compile( + # NB: we do not validate that the second group (.*) is a valid hex + # digest. Instead, we simply keep that string in this class, and then check it + # against Hashes when hash-checking is needed. This is easier to debug than + # proactively discarding an invalid hex digest, as we handle incorrect hashes + # and malformed hashes in the same place. + r"[#&]({choices})=([^&]*)".format( + choices="|".join(re.escape(hash_name) for hash_name in _SUPPORTED_HASHES) + ), + ) + + def __post_init__(self) -> None: + assert self.name in _SUPPORTED_HASHES + + @classmethod + @functools.cache + def find_hash_url_fragment(cls, url: str) -> LinkHash | None: + """Search a string for a checksum algorithm name and encoded output value.""" + match = cls._hash_url_fragment_re.search(url) + if match is None: + return None + name, value = match.groups() + return cls(name=name, value=value) + + def as_dict(self) -> dict[str, str]: + return {self.name: self.value} + + def as_hashes(self) -> Hashes: + """Return a Hashes instance which checks only for the current hash.""" + return Hashes({self.name: [self.value]}) + + def is_hash_allowed(self, hashes: Hashes | None) -> bool: + """ + Return True if the current hash is allowed by `hashes`. + """ + if hashes is None: + return False + return hashes.is_hash_allowed(self.name, hex_digest=self.value) + + +@dataclass(frozen=True) +class MetadataFile: + """Information about a core metadata file associated with a distribution.""" + + hashes: dict[str, str] | None + + def __post_init__(self) -> None: + if self.hashes is not None: + assert all(name in _SUPPORTED_HASHES for name in self.hashes) + + +def supported_hashes(hashes: dict[str, str] | None) -> dict[str, str] | None: + # Remove any unsupported hash types from the mapping. If this leaves no + # supported hashes, return None + if hashes is None: + return None + hashes = {n: v for n, v in hashes.items() if n in _SUPPORTED_HASHES} + if not hashes: + return None + return hashes + + +def _clean_url_path_part(part: str) -> str: + """ + Clean a "part" of a URL path (i.e. after splitting on "@" characters). + """ + # We unquote prior to quoting to make sure nothing is double quoted. + return urllib.parse.quote(urllib.parse.unquote(part)) + + +def _clean_file_url_path(part: str) -> str: + """ + Clean the first part of a URL path that corresponds to a local + filesystem path (i.e. the first part after splitting on "@" characters). + """ + # We unquote prior to quoting to make sure nothing is double quoted. + # Also, on Windows the path part might contain a drive letter which + # should not be quoted. On Linux where drive letters do not + # exist, the colon should be quoted. We rely on urllib.request + # to do the right thing here. + ret = urllib.request.pathname2url(urllib.request.url2pathname(part)) + if ret.startswith("///"): + # Remove any URL authority section, leaving only the URL path. + ret = ret.removeprefix("//") + return ret + + +# percent-encoded: / +_reserved_chars_re = re.compile("(@|%2F)", re.IGNORECASE) + + +def _clean_url_path(path: str, is_local_path: bool) -> str: + """ + Clean the path portion of a URL. + """ + if is_local_path: + clean_func = _clean_file_url_path + else: + clean_func = _clean_url_path_part + + # Split on the reserved characters prior to cleaning so that + # revision strings in VCS URLs are properly preserved. + parts = _reserved_chars_re.split(path) + + cleaned_parts = [] + for to_clean, reserved in pairwise(itertools.chain(parts, [""])): + cleaned_parts.append(clean_func(to_clean)) + # Normalize %xx escapes (e.g. %2f -> %2F) + cleaned_parts.append(reserved.upper()) + + return "".join(cleaned_parts) + + +def _ensure_quoted_url(url: str) -> str: + """ + Make sure a link is fully quoted. + For example, if ' ' occurs in the URL, it will be replaced with "%20", + and without double-quoting other characters. + """ + # Split the URL into parts according to the general structure + # `scheme://netloc/path?query#fragment`. + result = urllib.parse.urlsplit(url) + # If the netloc is empty, then the URL refers to a local filesystem path. + is_local_path = not result.netloc + path = _clean_url_path(result.path, is_local_path=is_local_path) + # Temporarily replace scheme with file to ensure the URL generated by + # urlunsplit() contains an empty netloc (file://) as per RFC 1738. + ret = urllib.parse.urlunsplit(result._replace(scheme="file", path=path)) + ret = result.scheme + ret[4:] # Restore original scheme. + return ret + + +def _absolute_link_url(base_url: str, url: str) -> str: + """ + A faster implementation of urllib.parse.urljoin with a shortcut + for absolute http/https URLs. + """ + if url.startswith(("https://", "http://")): + return url + else: + return urllib.parse.urljoin(base_url, url) + + +@functools.total_ordering +class Link: + """Represents a parsed link from a Package Index's simple URL""" + + __slots__ = [ + "_parsed_url", + "_url", + "_path", + "_hashes", + "comes_from", + "requires_python", + "yanked_reason", + "metadata_file_data", + "cache_link_parsing", + "egg_fragment", + ] + + def __init__( + self, + url: str, + comes_from: str | IndexContent | None = None, + requires_python: str | None = None, + yanked_reason: str | None = None, + metadata_file_data: MetadataFile | None = None, + cache_link_parsing: bool = True, + hashes: Mapping[str, str] | None = None, + ) -> None: + """ + :param url: url of the resource pointed to (href of the link) + :param comes_from: instance of IndexContent where the link was found, + or string. + :param requires_python: String containing the `Requires-Python` + metadata field, specified in PEP 345. This may be specified by + a data-requires-python attribute in the HTML link tag, as + described in PEP 503. + :param yanked_reason: the reason the file has been yanked, if the + file has been yanked, or None if the file hasn't been yanked. + This is the value of the "data-yanked" attribute, if present, in + a simple repository HTML link. If the file has been yanked but + no reason was provided, this should be the empty string. See + PEP 592 for more information and the specification. + :param metadata_file_data: the metadata attached to the file, or None if + no such metadata is provided. This argument, if not None, indicates + that a separate metadata file exists, and also optionally supplies + hashes for that file. + :param cache_link_parsing: A flag that is used elsewhere to determine + whether resources retrieved from this link should be cached. PyPI + URLs should generally have this set to False, for example. + :param hashes: A mapping of hash names to digests to allow us to + determine the validity of a download. + """ + + # The comes_from, requires_python, and metadata_file_data arguments are + # only used by classmethods of this class, and are not used in client + # code directly. + + # url can be a UNC windows share + if url.startswith("\\\\"): + url = path_to_url(url) + + self._parsed_url = urllib.parse.urlsplit(url) + # Store the url as a private attribute to prevent accidentally + # trying to set a new value. + self._url = url + # The .path property is hot, so calculate its value ahead of time. + self._path = urllib.parse.unquote(self._parsed_url.path) + + link_hash = LinkHash.find_hash_url_fragment(url) + hashes_from_link = {} if link_hash is None else link_hash.as_dict() + if hashes is None: + self._hashes = hashes_from_link + else: + self._hashes = {**hashes, **hashes_from_link} + + self.comes_from = comes_from + self.requires_python = requires_python if requires_python else None + self.yanked_reason = yanked_reason + self.metadata_file_data = metadata_file_data + + self.cache_link_parsing = cache_link_parsing + self.egg_fragment = self._egg_fragment() + + @classmethod + def from_json( + cls, + file_data: dict[str, Any], + page_url: str, + ) -> Link | None: + """ + Convert an pypi json document from a simple repository page into a Link. + """ + file_url = file_data.get("url") + if file_url is None: + return None + + url = _ensure_quoted_url(_absolute_link_url(page_url, file_url)) + pyrequire = file_data.get("requires-python") + yanked_reason = file_data.get("yanked") + hashes = file_data.get("hashes", {}) + + # PEP 714: Indexes must use the name core-metadata, but + # clients should support the old name as a fallback for compatibility. + metadata_info = file_data.get("core-metadata") + if metadata_info is None: + metadata_info = file_data.get("dist-info-metadata") + + # The metadata info value may be a boolean, or a dict of hashes. + if isinstance(metadata_info, dict): + # The file exists, and hashes have been supplied + metadata_file_data = MetadataFile(supported_hashes(metadata_info)) + elif metadata_info: + # The file exists, but there are no hashes + metadata_file_data = MetadataFile(None) + else: + # False or not present: the file does not exist + metadata_file_data = None + + # The Link.yanked_reason expects an empty string instead of a boolean. + if yanked_reason and not isinstance(yanked_reason, str): + yanked_reason = "" + # The Link.yanked_reason expects None instead of False. + elif not yanked_reason: + yanked_reason = None + + return cls( + url, + comes_from=page_url, + requires_python=pyrequire, + yanked_reason=yanked_reason, + hashes=hashes, + metadata_file_data=metadata_file_data, + ) + + @classmethod + def from_element( + cls, + anchor_attribs: dict[str, str | None], + page_url: str, + base_url: str, + ) -> Link | None: + """ + Convert an anchor element's attributes in a simple repository page to a Link. + """ + href = anchor_attribs.get("href") + if not href: + return None + + url = _ensure_quoted_url(_absolute_link_url(base_url, href)) + pyrequire = anchor_attribs.get("data-requires-python") + yanked_reason = anchor_attribs.get("data-yanked") + + # PEP 714: Indexes must use the name data-core-metadata, but + # clients should support the old name as a fallback for compatibility. + metadata_info = anchor_attribs.get("data-core-metadata") + if metadata_info is None: + metadata_info = anchor_attribs.get("data-dist-info-metadata") + # The metadata info value may be the string "true", or a string of + # the form "hashname=hashval" + if metadata_info == "true": + # The file exists, but there are no hashes + metadata_file_data = MetadataFile(None) + elif metadata_info is None: + # The file does not exist + metadata_file_data = None + else: + # The file exists, and hashes have been supplied + hashname, sep, hashval = metadata_info.partition("=") + if sep == "=": + metadata_file_data = MetadataFile(supported_hashes({hashname: hashval})) + else: + # Error - data is wrong. Treat as no hashes supplied. + logger.debug( + "Index returned invalid data-dist-info-metadata value: %s", + metadata_info, + ) + metadata_file_data = MetadataFile(None) + + return cls( + url, + comes_from=page_url, + requires_python=pyrequire, + yanked_reason=yanked_reason, + metadata_file_data=metadata_file_data, + ) + + def __str__(self) -> str: + if self.requires_python: + rp = f" (requires-python:{self.requires_python})" + else: + rp = "" + if self.comes_from: + return f"{self.redacted_url} (from {self.comes_from}){rp}" + else: + return self.redacted_url + + def __repr__(self) -> str: + return f"" + + def __hash__(self) -> int: + return hash(self.url) + + def __eq__(self, other: Any) -> bool: + if not isinstance(other, Link): + return NotImplemented + return self.url == other.url + + def __lt__(self, other: Any) -> bool: + if not isinstance(other, Link): + return NotImplemented + return self.url < other.url + + @property + def url(self) -> str: + return self._url + + @property + def redacted_url(self) -> str: + return redact_auth_from_url(self.url) + + @property + def filename(self) -> str: + path = self.path.rstrip("/") + name = posixpath.basename(path) + if not name: + # Make sure we don't leak auth information if the netloc + # includes a username and password. + netloc, user_pass = split_auth_from_netloc(self.netloc) + return netloc + + name = urllib.parse.unquote(name) + assert name, f"URL {self._url!r} produced no filename" + return name + + @property + def file_path(self) -> str: + return url_to_path(self.url) + + @property + def scheme(self) -> str: + return self._parsed_url.scheme + + @property + def netloc(self) -> str: + """ + This can contain auth information. + """ + return self._parsed_url.netloc + + @property + def path(self) -> str: + return self._path + + def splitext(self) -> tuple[str, str]: + return splitext(posixpath.basename(self.path.rstrip("/"))) + + @property + def ext(self) -> str: + return self.splitext()[1] + + @property + def url_without_fragment(self) -> str: + scheme, netloc, path, query, fragment = self._parsed_url + return urllib.parse.urlunsplit((scheme, netloc, path, query, "")) + + _egg_fragment_re = re.compile(r"[#&]egg=([^&]*)") + + # Per PEP 508. + _project_name_re = re.compile( + r"^([A-Z0-9]|[A-Z0-9][A-Z0-9._-]*[A-Z0-9])$", re.IGNORECASE + ) + + def _egg_fragment(self) -> str | None: + match = self._egg_fragment_re.search(self._url) + if not match: + return None + + # An egg fragment looks like a PEP 508 project name, along with + # an optional extras specifier. Anything else is invalid. + project_name = match.group(1) + if not self._project_name_re.match(project_name): + deprecated( + reason=f"{self} contains an egg fragment with a non-PEP 508 name.", + replacement="to use the req @ url syntax, and remove the egg fragment", + gone_in="25.3", + issue=13157, + ) + + return project_name + + _subdirectory_fragment_re = re.compile(r"[#&]subdirectory=([^&]*)") + + @property + def subdirectory_fragment(self) -> str | None: + match = self._subdirectory_fragment_re.search(self._url) + if not match: + return None + return match.group(1) + + def metadata_link(self) -> Link | None: + """Return a link to the associated core metadata file (if any).""" + if self.metadata_file_data is None: + return None + metadata_url = f"{self.url_without_fragment}.metadata" + if self.metadata_file_data.hashes is None: + return Link(metadata_url) + return Link(metadata_url, hashes=self.metadata_file_data.hashes) + + def as_hashes(self) -> Hashes: + return Hashes({k: [v] for k, v in self._hashes.items()}) + + @property + def hash(self) -> str | None: + return next(iter(self._hashes.values()), None) + + @property + def hash_name(self) -> str | None: + return next(iter(self._hashes), None) + + @property + def show_url(self) -> str: + return posixpath.basename(self._url.split("#", 1)[0].split("?", 1)[0]) + + @property + def is_file(self) -> bool: + return self.scheme == "file" + + def is_existing_dir(self) -> bool: + return self.is_file and os.path.isdir(self.file_path) + + @property + def is_wheel(self) -> bool: + return self.ext == WHEEL_EXTENSION + + @property + def is_vcs(self) -> bool: + from pip._internal.vcs import vcs + + return self.scheme in vcs.all_schemes + + @property + def is_yanked(self) -> bool: + return self.yanked_reason is not None + + @property + def has_hash(self) -> bool: + return bool(self._hashes) + + def is_hash_allowed(self, hashes: Hashes | None) -> bool: + """ + Return True if the link has a hash and it is allowed by `hashes`. + """ + if hashes is None: + return False + return any(hashes.is_hash_allowed(k, v) for k, v in self._hashes.items()) + + +class _CleanResult(NamedTuple): + """Convert link for equivalency check. + + This is used in the resolver to check whether two URL-specified requirements + likely point to the same distribution and can be considered equivalent. This + equivalency logic avoids comparing URLs literally, which can be too strict + (e.g. "a=1&b=2" vs "b=2&a=1") and produce conflicts unexpecting to users. + + Currently this does three things: + + 1. Drop the basic auth part. This is technically wrong since a server can + serve different content based on auth, but if it does that, it is even + impossible to guarantee two URLs without auth are equivalent, since + the user can input different auth information when prompted. So the + practical solution is to assume the auth doesn't affect the response. + 2. Parse the query to avoid the ordering issue. Note that ordering under the + same key in the query are NOT cleaned; i.e. "a=1&a=2" and "a=2&a=1" are + still considered different. + 3. Explicitly drop most of the fragment part, except ``subdirectory=`` and + hash values, since it should have no impact the downloaded content. Note + that this drops the "egg=" part historically used to denote the requested + project (and extras), which is wrong in the strictest sense, but too many + people are supplying it inconsistently to cause superfluous resolution + conflicts, so we choose to also ignore them. + """ + + parsed: urllib.parse.SplitResult + query: dict[str, list[str]] + subdirectory: str + hashes: dict[str, str] + + +def _clean_link(link: Link) -> _CleanResult: + parsed = link._parsed_url + netloc = parsed.netloc.rsplit("@", 1)[-1] + # According to RFC 8089, an empty host in file: means localhost. + if parsed.scheme == "file" and not netloc: + netloc = "localhost" + fragment = urllib.parse.parse_qs(parsed.fragment) + if "egg" in fragment: + logger.debug("Ignoring egg= fragment in %s", link) + try: + # If there are multiple subdirectory values, use the first one. + # This matches the behavior of Link.subdirectory_fragment. + subdirectory = fragment["subdirectory"][0] + except (IndexError, KeyError): + subdirectory = "" + # If there are multiple hash values under the same algorithm, use the + # first one. This matches the behavior of Link.hash_value. + hashes = {k: fragment[k][0] for k in _SUPPORTED_HASHES if k in fragment} + return _CleanResult( + parsed=parsed._replace(netloc=netloc, query="", fragment=""), + query=urllib.parse.parse_qs(parsed.query), + subdirectory=subdirectory, + hashes=hashes, + ) + + +@functools.cache +def links_equivalent(link1: Link, link2: Link) -> bool: + return _clean_link(link1) == _clean_link(link2) diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/models/pylock.py b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/models/pylock.py new file mode 100644 index 0000000000000000000000000000000000000000..1b6b8c1270bf8c3d704a825e701d37a4dc6f3102 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/models/pylock.py @@ -0,0 +1,188 @@ +from __future__ import annotations + +import dataclasses +import re +from collections.abc import Iterable +from dataclasses import dataclass +from pathlib import Path +from typing import TYPE_CHECKING, Any + +from pip._vendor import tomli_w + +from pip._internal.models.direct_url import ArchiveInfo, DirInfo, VcsInfo +from pip._internal.models.link import Link +from pip._internal.req.req_install import InstallRequirement +from pip._internal.utils.urls import url_to_path + +if TYPE_CHECKING: + from typing_extensions import Self + +PYLOCK_FILE_NAME_RE = re.compile(r"^pylock\.([^.]+)\.toml$") + + +def is_valid_pylock_file_name(path: Path) -> bool: + return path.name == "pylock.toml" or bool(re.match(PYLOCK_FILE_NAME_RE, path.name)) + + +def _toml_dict_factory(data: list[tuple[str, Any]]) -> dict[str, Any]: + return {key.replace("_", "-"): value for key, value in data if value is not None} + + +@dataclass +class PackageVcs: + type: str + url: str | None + # (not supported) path: Optional[str] + requested_revision: str | None + commit_id: str + subdirectory: str | None + + +@dataclass +class PackageDirectory: + path: str + editable: bool | None + subdirectory: str | None + + +@dataclass +class PackageArchive: + url: str | None + # (not supported) path: Optional[str] + # (not supported) size: Optional[int] + # (not supported) upload_time: Optional[datetime] + hashes: dict[str, str] + subdirectory: str | None + + +@dataclass +class PackageSdist: + name: str + # (not supported) upload_time: Optional[datetime] + url: str | None + # (not supported) path: Optional[str] + # (not supported) size: Optional[int] + hashes: dict[str, str] + + +@dataclass +class PackageWheel: + name: str + # (not supported) upload_time: Optional[datetime] + url: str | None + # (not supported) path: Optional[str] + # (not supported) size: Optional[int] + hashes: dict[str, str] + + +@dataclass +class Package: + name: str + version: str | None = None + # (not supported) marker: Optional[str] + # (not supported) requires_python: Optional[str] + # (not supported) dependencies + vcs: PackageVcs | None = None + directory: PackageDirectory | None = None + archive: PackageArchive | None = None + # (not supported) index: Optional[str] + sdist: PackageSdist | None = None + wheels: list[PackageWheel] | None = None + # (not supported) attestation_identities: Optional[List[Dict[str, Any]]] + # (not supported) tool: Optional[Dict[str, Any]] + + @classmethod + def from_install_requirement(cls, ireq: InstallRequirement, base_dir: Path) -> Self: + base_dir = base_dir.resolve() + dist = ireq.get_dist() + download_info = ireq.download_info + assert download_info + package = cls(name=dist.canonical_name) + if ireq.is_direct: + if isinstance(download_info.info, VcsInfo): + package.vcs = PackageVcs( + type=download_info.info.vcs, + url=download_info.url, + requested_revision=download_info.info.requested_revision, + commit_id=download_info.info.commit_id, + subdirectory=download_info.subdirectory, + ) + elif isinstance(download_info.info, DirInfo): + package.directory = PackageDirectory( + path=( + Path(url_to_path(download_info.url)) + .resolve() + .relative_to(base_dir) + .as_posix() + ), + editable=( + download_info.info.editable + if download_info.info.editable + else None + ), + subdirectory=download_info.subdirectory, + ) + elif isinstance(download_info.info, ArchiveInfo): + if not download_info.info.hashes: + raise NotImplementedError() + package.archive = PackageArchive( + url=download_info.url, + hashes=download_info.info.hashes, + subdirectory=download_info.subdirectory, + ) + else: + # should never happen + raise NotImplementedError() + else: + package.version = str(dist.version) + if isinstance(download_info.info, ArchiveInfo): + if not download_info.info.hashes: + raise NotImplementedError() + link = Link(download_info.url) + if link.is_wheel: + package.wheels = [ + PackageWheel( + name=link.filename, + url=download_info.url, + hashes=download_info.info.hashes, + ) + ] + else: + package.sdist = PackageSdist( + name=link.filename, + url=download_info.url, + hashes=download_info.info.hashes, + ) + else: + # should never happen + raise NotImplementedError() + return package + + +@dataclass +class Pylock: + lock_version: str = "1.0" + # (not supported) environments: Optional[List[str]] + # (not supported) requires_python: Optional[str] + # (not supported) extras: List[str] = [] + # (not supported) dependency_groups: List[str] = [] + created_by: str = "pip" + packages: list[Package] = dataclasses.field(default_factory=list) + # (not supported) tool: Optional[Dict[str, Any]] + + def as_toml(self) -> str: + return tomli_w.dumps(dataclasses.asdict(self, dict_factory=_toml_dict_factory)) + + @classmethod + def from_install_requirements( + cls, install_requirements: Iterable[InstallRequirement], base_dir: Path + ) -> Self: + return cls( + packages=sorted( + ( + Package.from_install_requirement(ireq, base_dir) + for ireq in install_requirements + ), + key=lambda p: p.name, + ) + ) diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/models/scheme.py b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/models/scheme.py new file mode 100644 index 0000000000000000000000000000000000000000..06a9a550e34389c27ad3ee0bcef73d581cd4b448 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/models/scheme.py @@ -0,0 +1,25 @@ +""" +For types associated with installation schemes. + +For a general overview of available schemes and their context, see +https://docs.python.org/3/install/index.html#alternate-installation. +""" + +from dataclasses import dataclass + +SCHEME_KEYS = ["platlib", "purelib", "headers", "scripts", "data"] + + +@dataclass(frozen=True) +class Scheme: + """A Scheme holds paths which are used as the base directories for + artifacts associated with a Python package. + """ + + __slots__ = SCHEME_KEYS + + platlib: str + purelib: str + headers: str + scripts: str + data: str diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/models/search_scope.py b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/models/search_scope.py new file mode 100644 index 0000000000000000000000000000000000000000..136163ca096b6d532d7462ddb989aae23ed7f2f5 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/models/search_scope.py @@ -0,0 +1,126 @@ +import itertools +import logging +import os +import posixpath +import urllib.parse +from dataclasses import dataclass + +from pip._vendor.packaging.utils import canonicalize_name + +from pip._internal.models.index import PyPI +from pip._internal.utils.compat import has_tls +from pip._internal.utils.misc import normalize_path, redact_auth_from_url + +logger = logging.getLogger(__name__) + + +@dataclass(frozen=True) +class SearchScope: + """ + Encapsulates the locations that pip is configured to search. + """ + + __slots__ = ["find_links", "index_urls", "no_index"] + + find_links: list[str] + index_urls: list[str] + no_index: bool + + @classmethod + def create( + cls, + find_links: list[str], + index_urls: list[str], + no_index: bool, + ) -> "SearchScope": + """ + Create a SearchScope object after normalizing the `find_links`. + """ + # Build find_links. If an argument starts with ~, it may be + # a local file relative to a home directory. So try normalizing + # it and if it exists, use the normalized version. + # This is deliberately conservative - it might be fine just to + # blindly normalize anything starting with a ~... + built_find_links: list[str] = [] + for link in find_links: + if link.startswith("~"): + new_link = normalize_path(link) + if os.path.exists(new_link): + link = new_link + built_find_links.append(link) + + # If we don't have TLS enabled, then WARN if anyplace we're looking + # relies on TLS. + if not has_tls(): + for link in itertools.chain(index_urls, built_find_links): + parsed = urllib.parse.urlparse(link) + if parsed.scheme == "https": + logger.warning( + "pip is configured with locations that require " + "TLS/SSL, however the ssl module in Python is not " + "available." + ) + break + + return cls( + find_links=built_find_links, + index_urls=index_urls, + no_index=no_index, + ) + + def get_formatted_locations(self) -> str: + lines = [] + redacted_index_urls = [] + if self.index_urls and self.index_urls != [PyPI.simple_url]: + for url in self.index_urls: + redacted_index_url = redact_auth_from_url(url) + + # Parse the URL + purl = urllib.parse.urlsplit(redacted_index_url) + + # URL is generally invalid if scheme and netloc is missing + # there are issues with Python and URL parsing, so this test + # is a bit crude. See bpo-20271, bpo-23505. Python doesn't + # always parse invalid URLs correctly - it should raise + # exceptions for malformed URLs + if not purl.scheme and not purl.netloc: + logger.warning( + 'The index url "%s" seems invalid, please provide a scheme.', + redacted_index_url, + ) + + redacted_index_urls.append(redacted_index_url) + + lines.append( + "Looking in indexes: {}".format(", ".join(redacted_index_urls)) + ) + + if self.find_links: + lines.append( + "Looking in links: {}".format( + ", ".join(redact_auth_from_url(url) for url in self.find_links) + ) + ) + return "\n".join(lines) + + def get_index_urls_locations(self, project_name: str) -> list[str]: + """Returns the locations found via self.index_urls + + Checks the url_name on the main (first in the list) index and + use this url_name to produce all locations + """ + + def mkurl_pypi_url(url: str) -> str: + loc = posixpath.join( + url, urllib.parse.quote(canonicalize_name(project_name)) + ) + # For maximum compatibility with easy_install, ensure the path + # ends in a trailing slash. Although this isn't in the spec + # (and PyPI can handle it without the slash) some other index + # implementations might break if they relied on easy_install's + # behavior. + if not loc.endswith("/"): + loc = loc + "/" + return loc + + return [mkurl_pypi_url(url) for url in self.index_urls] diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/models/selection_prefs.py b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/models/selection_prefs.py new file mode 100644 index 0000000000000000000000000000000000000000..8d5b42dfa318dd495493993239ad67aee93ca563 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/models/selection_prefs.py @@ -0,0 +1,53 @@ +from __future__ import annotations + +from pip._internal.models.format_control import FormatControl + + +# TODO: This needs Python 3.10's improved slots support for dataclasses +# to be converted into a dataclass. +class SelectionPreferences: + """ + Encapsulates the candidate selection preferences for downloading + and installing files. + """ + + __slots__ = [ + "allow_yanked", + "allow_all_prereleases", + "format_control", + "prefer_binary", + "ignore_requires_python", + ] + + # Don't include an allow_yanked default value to make sure each call + # site considers whether yanked releases are allowed. This also causes + # that decision to be made explicit in the calling code, which helps + # people when reading the code. + def __init__( + self, + allow_yanked: bool, + allow_all_prereleases: bool = False, + format_control: FormatControl | None = None, + prefer_binary: bool = False, + ignore_requires_python: bool | None = None, + ) -> None: + """Create a SelectionPreferences object. + + :param allow_yanked: Whether files marked as yanked (in the sense + of PEP 592) are permitted to be candidates for install. + :param format_control: A FormatControl object or None. Used to control + the selection of source packages / binary packages when consulting + the index and links. + :param prefer_binary: Whether to prefer an old, but valid, binary + dist over a new source dist. + :param ignore_requires_python: Whether to ignore incompatible + "Requires-Python" values in links. Defaults to False. + """ + if ignore_requires_python is None: + ignore_requires_python = False + + self.allow_yanked = allow_yanked + self.allow_all_prereleases = allow_all_prereleases + self.format_control = format_control + self.prefer_binary = prefer_binary + self.ignore_requires_python = ignore_requires_python diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/models/target_python.py b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/models/target_python.py new file mode 100644 index 0000000000000000000000000000000000000000..8c38392d8bbf21b2102123b87d67df86b94ddc5f --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/models/target_python.py @@ -0,0 +1,122 @@ +from __future__ import annotations + +import sys + +from pip._vendor.packaging.tags import Tag + +from pip._internal.utils.compatibility_tags import get_supported, version_info_to_nodot +from pip._internal.utils.misc import normalize_version_info + + +class TargetPython: + """ + Encapsulates the properties of a Python interpreter one is targeting + for a package install, download, etc. + """ + + __slots__ = [ + "_given_py_version_info", + "abis", + "implementation", + "platforms", + "py_version", + "py_version_info", + "_valid_tags", + "_valid_tags_set", + ] + + def __init__( + self, + platforms: list[str] | None = None, + py_version_info: tuple[int, ...] | None = None, + abis: list[str] | None = None, + implementation: str | None = None, + ) -> None: + """ + :param platforms: A list of strings or None. If None, searches for + packages that are supported by the current system. Otherwise, will + find packages that can be built on the platforms passed in. These + packages will only be downloaded for distribution: they will + not be built locally. + :param py_version_info: An optional tuple of ints representing the + Python version information to use (e.g. `sys.version_info[:3]`). + This can have length 1, 2, or 3 when provided. + :param abis: A list of strings or None. This is passed to + compatibility_tags.py's get_supported() function as is. + :param implementation: A string or None. This is passed to + compatibility_tags.py's get_supported() function as is. + """ + # Store the given py_version_info for when we call get_supported(). + self._given_py_version_info = py_version_info + + if py_version_info is None: + py_version_info = sys.version_info[:3] + else: + py_version_info = normalize_version_info(py_version_info) + + py_version = ".".join(map(str, py_version_info[:2])) + + self.abis = abis + self.implementation = implementation + self.platforms = platforms + self.py_version = py_version + self.py_version_info = py_version_info + + # This is used to cache the return value of get_(un)sorted_tags. + self._valid_tags: list[Tag] | None = None + self._valid_tags_set: set[Tag] | None = None + + def format_given(self) -> str: + """ + Format the given, non-None attributes for display. + """ + display_version = None + if self._given_py_version_info is not None: + display_version = ".".join( + str(part) for part in self._given_py_version_info + ) + + key_values = [ + ("platforms", self.platforms), + ("version_info", display_version), + ("abis", self.abis), + ("implementation", self.implementation), + ] + return " ".join( + f"{key}={value!r}" for key, value in key_values if value is not None + ) + + def get_sorted_tags(self) -> list[Tag]: + """ + Return the supported PEP 425 tags to check wheel candidates against. + + The tags are returned in order of preference (most preferred first). + """ + if self._valid_tags is None: + # Pass versions=None if no py_version_info was given since + # versions=None uses special default logic. + py_version_info = self._given_py_version_info + if py_version_info is None: + version = None + else: + version = version_info_to_nodot(py_version_info) + + tags = get_supported( + version=version, + platforms=self.platforms, + abis=self.abis, + impl=self.implementation, + ) + self._valid_tags = tags + + return self._valid_tags + + def get_unsorted_tags(self) -> set[Tag]: + """Exactly the same as get_sorted_tags, but returns a set. + + This is important for performance. + """ + if self._valid_tags_set is None: + self._valid_tags_set = set(self.get_sorted_tags()) + + return self._valid_tags_set diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/models/wheel.py b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/models/wheel.py new file mode 100644 index 0000000000000000000000000000000000000000..60e97cb762b3a18fd4f2fe667da8c4ce6d6692f1 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/models/wheel.py @@ -0,0 +1,141 @@ +"""Represents a wheel file and provides access to the various parts of the +name that have meaning. +""" + +from __future__ import annotations + +import re +from collections.abc import Iterable + +from pip._vendor.packaging.tags import Tag +from pip._vendor.packaging.utils import BuildTag, parse_wheel_filename +from pip._vendor.packaging.utils import ( + InvalidWheelFilename as _PackagingInvalidWheelFilename, +) + +from pip._internal.exceptions import InvalidWheelFilename +from pip._internal.utils.deprecation import deprecated + + +class Wheel: + """A wheel file""" + + legacy_wheel_file_re = re.compile( + r"""^(?P(?P[^\s-]+?)-(?P[^\s-]*?)) + ((-(?P\d[^-]*?))?-(?P[^\s-]+?)-(?P[^\s-]+?)-(?P[^\s-]+?) + \.whl|\.dist-info)$""", + re.VERBOSE, + ) + + def __init__(self, filename: str) -> None: + self.filename = filename + + # To make mypy happy specify type hints that can come from either + # parse_wheel_filename or the legacy_wheel_file_re match. + self.name: str + self._build_tag: BuildTag | None = None + + try: + wheel_info = parse_wheel_filename(filename) + self.name, _version, self._build_tag, self.file_tags = wheel_info + self.version = str(_version) + except _PackagingInvalidWheelFilename as e: + # Check if the wheel filename is in the legacy format + legacy_wheel_info = self.legacy_wheel_file_re.match(filename) + if not legacy_wheel_info: + raise InvalidWheelFilename(e.args[0]) from None + + deprecated( + reason=( + f"Wheel filename {filename!r} is not correctly normalised. " + "Future versions of pip will raise the following error:\n" + f"{e.args[0]}\n\n" + ), + replacement=( + "to rename the wheel to use a correctly normalised " + "name (this may require updating the version in " + "the project metadata)" + ), + gone_in="25.3", + issue=12938, + ) + + self.name = legacy_wheel_info.group("name").replace("_", "-") + self.version = legacy_wheel_info.group("ver").replace("_", "-") + + # Generate the file tags from the legacy wheel filename + pyversions = legacy_wheel_info.group("pyver").split(".") + abis = legacy_wheel_info.group("abi").split(".") + plats = legacy_wheel_info.group("plat").split(".") + self.file_tags = frozenset( + Tag(interpreter=py, abi=abi, platform=plat) + for py in pyversions + for abi in abis + for plat in plats + ) + + @property + def build_tag(self) -> BuildTag: + if self._build_tag is not None: + return self._build_tag + + # Parse the build tag from the legacy wheel filename + legacy_wheel_info = self.legacy_wheel_file_re.match(self.filename) + assert legacy_wheel_info is not None, "guaranteed by filename validation" + build_tag = legacy_wheel_info.group("build") + match = re.match(r"^(\d+)(.*)$", build_tag) + assert match is not None, "guaranteed by filename validation" + build_tag_groups = match.groups() + self._build_tag = (int(build_tag_groups[0]), build_tag_groups[1]) + + return self._build_tag + + def get_formatted_file_tags(self) -> list[str]: + """Return the wheel's tags as a sorted list of strings.""" + return sorted(str(tag) for tag in self.file_tags) + + def support_index_min(self, tags: list[Tag]) -> int: + """Return the lowest index that one of the wheel's file_tag combinations + achieves in the given list of supported tags. + + For example, if there are 8 supported tags and one of the file tags + is first in the list, then return 0. + + :param tags: the PEP 425 tags to check the wheel against, in order + with most preferred first. + + :raises ValueError: If none of the wheel's file tags match one of + the supported tags. + """ + try: + return next(i for i, t in enumerate(tags) if t in self.file_tags) + except StopIteration: + raise ValueError() + + def find_most_preferred_tag( + self, tags: list[Tag], tag_to_priority: dict[Tag, int] + ) -> int: + """Return the priority of the most preferred tag that one of the wheel's file + tag combinations achieves in the given list of supported tags using the given + tag_to_priority mapping, where lower priorities are more-preferred. + + This is used in place of support_index_min in some cases in order to avoid + an expensive linear scan of a large list of tags. + + :param tags: the PEP 425 tags to check the wheel against. + :param tag_to_priority: a mapping from tag to priority of that tag, where + lower is more preferred. + + :raises ValueError: If none of the wheel's file tags match one of + the supported tags. + """ + return min( + tag_to_priority[tag] for tag in self.file_tags if tag in tag_to_priority + ) + + def supported(self, tags: Iterable[Tag]) -> bool: + """Return whether the wheel is compatible with one of the given tags. + + :param tags: the PEP 425 tags to check the wheel against. + """ + return not self.file_tags.isdisjoint(tags) diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/network/__init__.py b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/network/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..0ae1f5626bca4f0a8cc6532b0d20b2e43039b1c6 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/network/__init__.py @@ -0,0 +1 @@ +"""Contains purely network-related utilities.""" diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/network/__pycache__/__init__.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/network/__pycache__/__init__.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..5318d357284fdff39ec8c4ff192923fb5e400eba Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/network/__pycache__/__init__.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/network/__pycache__/auth.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/network/__pycache__/auth.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..116b477c72d827a56c84b2617da38667eee4498a Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/network/__pycache__/auth.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/network/__pycache__/cache.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/network/__pycache__/cache.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..1260d5bdd1c8a9111478a063d9b654d9abbef8a8 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/network/__pycache__/cache.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/network/__pycache__/download.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/network/__pycache__/download.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..326547da9fe185a7dc10ebed58d72b5fa4f9dabe Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/network/__pycache__/download.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/network/__pycache__/lazy_wheel.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/network/__pycache__/lazy_wheel.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..0b613313eef9847d16420f07ffb5dd0d47737d23 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/network/__pycache__/lazy_wheel.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/network/__pycache__/session.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/network/__pycache__/session.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..72e402cd0ed77b3a68041f8bf83b18476597efa5 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/network/__pycache__/session.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/network/__pycache__/utils.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/network/__pycache__/utils.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c615ac5b3d98fcee7e8945b6b54ec4839d63804a Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/network/__pycache__/utils.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/network/auth.py b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/network/auth.py new file mode 100644 index 0000000000000000000000000000000000000000..a42f7024c4c3effc0e7c4bb30b3deaee3f01eea6 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/network/auth.py @@ -0,0 +1,564 @@ +"""Network Authentication Helpers + +Contains interface (MultiDomainBasicAuth) and associated glue code for +providing credentials in the context of network requests. +""" + +from __future__ import annotations + +import logging +import os +import shutil +import subprocess +import sysconfig +import typing +import urllib.parse +from abc import ABC, abstractmethod +from functools import cache +from os.path import commonprefix +from pathlib import Path +from typing import Any, NamedTuple + +from pip._vendor.requests.auth import AuthBase, HTTPBasicAuth +from pip._vendor.requests.models import Request, Response +from pip._vendor.requests.utils import get_netrc_auth + +from pip._internal.utils.logging import getLogger +from pip._internal.utils.misc import ( + ask, + ask_input, + ask_password, + remove_auth_from_url, + split_auth_netloc_from_url, +) +from pip._internal.vcs.versioncontrol import AuthInfo + +logger = getLogger(__name__) + +KEYRING_DISABLED = False + + +class Credentials(NamedTuple): + url: str + username: str + password: str + + +class KeyRingBaseProvider(ABC): + """Keyring base provider interface""" + + has_keyring: bool + + @abstractmethod + def get_auth_info(self, url: str, username: str | None) -> AuthInfo | None: ... + + @abstractmethod + def save_auth_info(self, url: str, username: str, password: str) -> None: ... + + +class KeyRingNullProvider(KeyRingBaseProvider): + """Keyring null provider""" + + has_keyring = False + + def get_auth_info(self, url: str, username: str | None) -> AuthInfo | None: + return None + + def save_auth_info(self, url: str, username: str, password: str) -> None: + return None + + +class KeyRingPythonProvider(KeyRingBaseProvider): + """Keyring interface which uses locally imported `keyring`""" + + has_keyring = True + + def __init__(self) -> None: + import keyring + + self.keyring = keyring + + def get_auth_info(self, url: str, username: str | None) -> AuthInfo | None: + # Support keyring's get_credential interface which supports getting + # credentials without a username. This is only available for + # keyring>=15.2.0. + if hasattr(self.keyring, "get_credential"): + logger.debug("Getting credentials from keyring for %s", url) + cred = self.keyring.get_credential(url, username) + if cred is not None: + return cred.username, cred.password + return None + + if username is not None: + logger.debug("Getting password from keyring for %s", url) + password = self.keyring.get_password(url, username) + if password: + return username, password + return None + + def save_auth_info(self, url: str, username: str, password: str) -> None: + self.keyring.set_password(url, username, password) + + +class KeyRingCliProvider(KeyRingBaseProvider): + """Provider which uses `keyring` cli + + Instead of calling the keyring package installed alongside pip + we call keyring on the command line which will enable pip to + use which ever installation of keyring is available first in + PATH. + """ + + has_keyring = True + + def __init__(self, cmd: str) -> None: + self.keyring = cmd + + def get_auth_info(self, url: str, username: str | None) -> AuthInfo | None: + # This is the default implementation of keyring.get_credential + # https://github.com/jaraco/keyring/blob/97689324abcf01bd1793d49063e7ca01e03d7d07/keyring/backend.py#L134-L139 + if username is not None: + password = self._get_password(url, username) + if password is not None: + return username, password + return None + + def save_auth_info(self, url: str, username: str, password: str) -> None: + return self._set_password(url, username, password) + + def _get_password(self, service_name: str, username: str) -> str | None: + """Mirror the implementation of keyring.get_password using cli""" + if self.keyring is None: + return None + + cmd = [self.keyring, "get", service_name, username] + env = os.environ.copy() + env["PYTHONIOENCODING"] = "utf-8" + res = subprocess.run( + cmd, + stdin=subprocess.DEVNULL, + stdout=subprocess.PIPE, + env=env, + ) + if res.returncode: + return None + return res.stdout.decode("utf-8").strip(os.linesep) + + def _set_password(self, service_name: str, username: str, password: str) -> None: + """Mirror the implementation of keyring.set_password using cli""" + if self.keyring is None: + return None + env = os.environ.copy() + env["PYTHONIOENCODING"] = "utf-8" + subprocess.run( + [self.keyring, "set", service_name, username], + input=f"{password}{os.linesep}".encode(), + env=env, + check=True, + ) + return None + + +@cache +def get_keyring_provider(provider: str) -> KeyRingBaseProvider: + logger.verbose("Keyring provider requested: %s", provider) + + # keyring has previously failed and been disabled + if KEYRING_DISABLED: + provider = "disabled" + if provider in ["import", "auto"]: + try: + impl = KeyRingPythonProvider() + logger.verbose("Keyring provider set: import") + return impl + except ImportError: + pass + except Exception as exc: + # In the event of an unexpected exception + # we should warn the user + msg = "Installed copy of keyring fails with exception %s" + if provider == "auto": + msg = msg + ", trying to find a keyring executable as a fallback" + logger.warning(msg, exc, exc_info=logger.isEnabledFor(logging.DEBUG)) + if provider in ["subprocess", "auto"]: + cli = shutil.which("keyring") + if cli and cli.startswith(sysconfig.get_path("scripts")): + # all code within this function is stolen from shutil.which implementation + @typing.no_type_check + def PATH_as_shutil_which_determines_it() -> str: + path = os.environ.get("PATH", None) + if path is None: + try: + path = os.confstr("CS_PATH") + except (AttributeError, ValueError): + # os.confstr() or CS_PATH is not available + path = os.defpath + # bpo-35755: Don't use os.defpath if the PATH environment variable is + # set to an empty string + + return path + + scripts = Path(sysconfig.get_path("scripts")) + + paths = [] + for path in PATH_as_shutil_which_determines_it().split(os.pathsep): + p = Path(path) + try: + if not p.samefile(scripts): + paths.append(path) + except FileNotFoundError: + pass + + path = os.pathsep.join(paths) + + cli = shutil.which("keyring", path=path) + + if cli: + logger.verbose("Keyring provider set: subprocess with executable %s", cli) + return KeyRingCliProvider(cli) + + logger.verbose("Keyring provider set: disabled") + return KeyRingNullProvider() + + +class MultiDomainBasicAuth(AuthBase): + def __init__( + self, + prompting: bool = True, + index_urls: list[str] | None = None, + keyring_provider: str = "auto", + ) -> None: + self.prompting = prompting + self.index_urls = index_urls + self.keyring_provider = keyring_provider + self.passwords: dict[str, AuthInfo] = {} + # When the user is prompted to enter credentials and keyring is + # available, we will offer to save them. If the user accepts, + # this value is set to the credentials they entered. After the + # request authenticates, the caller should call + # ``save_credentials`` to save these. + self._credentials_to_save: Credentials | None = None + + @property + def keyring_provider(self) -> KeyRingBaseProvider: + return get_keyring_provider(self._keyring_provider) + + @keyring_provider.setter + def keyring_provider(self, provider: str) -> None: + # The free function get_keyring_provider has been decorated with + # functools.cache. If an exception occurs in get_keyring_auth that + # cache will be cleared and keyring disabled, take that into account + # if you want to remove this indirection. + self._keyring_provider = provider + + @property + def use_keyring(self) -> bool: + # We won't use keyring when --no-input is passed unless + # a specific provider is requested because it might require + # user interaction + return self.prompting or self._keyring_provider not in ["auto", "disabled"] + + def _get_keyring_auth( + self, + url: str | None, + username: str | None, + ) -> AuthInfo | None: + """Return the tuple auth for a given url from keyring.""" + # Do nothing if no url was provided + if not url: + return None + + try: + return self.keyring_provider.get_auth_info(url, username) + except Exception as exc: + # Log the full exception (with stacktrace) at debug, so it'll only + # show up when running in verbose mode. + logger.debug("Keyring is skipped due to an exception", exc_info=True) + # Always log a shortened version of the exception. + logger.warning( + "Keyring is skipped due to an exception: %s", + str(exc), + ) + global KEYRING_DISABLED + KEYRING_DISABLED = True + get_keyring_provider.cache_clear() + return None + + def _get_index_url(self, url: str) -> str | None: + """Return the original index URL matching the requested URL. + + Cached or dynamically generated credentials may work against + the original index URL rather than just the netloc. + + The provided url should have had its username and password + removed already. If the original index url had credentials then + they will be included in the return value. + + Returns None if no matching index was found, or if --no-index + was specified by the user. + """ + if not url or not self.index_urls: + return None + + url = remove_auth_from_url(url).rstrip("/") + "/" + parsed_url = urllib.parse.urlsplit(url) + + candidates = [] + + for index in self.index_urls: + index = index.rstrip("/") + "/" + parsed_index = urllib.parse.urlsplit(remove_auth_from_url(index)) + if parsed_url == parsed_index: + return index + + if parsed_url.netloc != parsed_index.netloc: + continue + + candidate = urllib.parse.urlsplit(index) + candidates.append(candidate) + + if not candidates: + return None + + candidates.sort( + reverse=True, + key=lambda candidate: commonprefix( + [ + parsed_url.path, + candidate.path, + ] + ).rfind("/"), + ) + + return urllib.parse.urlunsplit(candidates[0]) + + def _get_new_credentials( + self, + original_url: str, + *, + allow_netrc: bool = True, + allow_keyring: bool = False, + ) -> AuthInfo: + """Find and return credentials for the specified URL.""" + # Split the credentials and netloc from the url. + url, netloc, url_user_password = split_auth_netloc_from_url( + original_url, + ) + + # Start with the credentials embedded in the url + username, password = url_user_password + if username is not None and password is not None: + logger.debug("Found credentials in url for %s", netloc) + return url_user_password + + # Find a matching index url for this request + index_url = self._get_index_url(url) + if index_url: + # Split the credentials from the url. + index_info = split_auth_netloc_from_url(index_url) + if index_info: + index_url, _, index_url_user_password = index_info + logger.debug("Found index url %s", index_url) + + # If an index URL was found, try its embedded credentials + if index_url and index_url_user_password[0] is not None: + username, password = index_url_user_password + if username is not None and password is not None: + logger.debug("Found credentials in index url for %s", netloc) + return index_url_user_password + + # Get creds from netrc if we still don't have them + if allow_netrc: + netrc_auth = get_netrc_auth(original_url) + if netrc_auth: + logger.debug("Found credentials in netrc for %s", netloc) + return netrc_auth + + # If we don't have a password and keyring is available, use it. + if allow_keyring: + # The index url is more specific than the netloc, so try it first + # fmt: off + kr_auth = ( + self._get_keyring_auth(index_url, username) or + self._get_keyring_auth(netloc, username) + ) + # fmt: on + if kr_auth: + logger.debug("Found credentials in keyring for %s", netloc) + return kr_auth + + return username, password + + def _get_url_and_credentials( + self, original_url: str + ) -> tuple[str, str | None, str | None]: + """Return the credentials to use for the provided URL. + + If allowed, netrc and keyring may be used to obtain the + correct credentials. + + Returns (url_without_credentials, username, password). Note + that even if the original URL contains credentials, this + function may return a different username and password. + """ + url, netloc, _ = split_auth_netloc_from_url(original_url) + + # Try to get credentials from original url + username, password = self._get_new_credentials(original_url) + + # If credentials not found, use any stored credentials for this netloc. + # Do this if either the username or the password is missing. + # This accounts for the situation in which the user has specified + # the username in the index url, but the password comes from keyring. + if (username is None or password is None) and netloc in self.passwords: + un, pw = self.passwords[netloc] + # It is possible that the cached credentials are for a different username, + # in which case the cache should be ignored. + if username is None or username == un: + username, password = un, pw + + if username is not None or password is not None: + # Convert the username and password if they're None, so that + # this netloc will show up as "cached" in the conditional above. + # Further, HTTPBasicAuth doesn't accept None, so it makes sense to + # cache the value that is going to be used. + username = username or "" + password = password or "" + + # Store any acquired credentials. + self.passwords[netloc] = (username, password) + + assert ( + # Credentials were found + (username is not None and password is not None) + # Credentials were not found + or (username is None and password is None) + ), f"Could not load credentials from url: {original_url}" + + return url, username, password + + def __call__(self, req: Request) -> Request: + # Get credentials for this request + url, username, password = self._get_url_and_credentials(req.url) + + # Set the url of the request to the url without any credentials + req.url = url + + if username is not None and password is not None: + # Send the basic auth with this request + req = HTTPBasicAuth(username, password)(req) + + # Attach a hook to handle 401 responses + req.register_hook("response", self.handle_401) + + return req + + # Factored out to allow for easy patching in tests + def _prompt_for_password(self, netloc: str) -> tuple[str | None, str | None, bool]: + username = ask_input(f"User for {netloc}: ") if self.prompting else None + if not username: + return None, None, False + if self.use_keyring: + auth = self._get_keyring_auth(netloc, username) + if auth and auth[0] is not None and auth[1] is not None: + return auth[0], auth[1], False + password = ask_password("Password: ") + return username, password, True + + # Factored out to allow for easy patching in tests + def _should_save_password_to_keyring(self) -> bool: + if ( + not self.prompting + or not self.use_keyring + or not self.keyring_provider.has_keyring + ): + return False + return ask("Save credentials to keyring [y/N]: ", ["y", "n"]) == "y" + + def handle_401(self, resp: Response, **kwargs: Any) -> Response: + # We only care about 401 responses, anything else we want to just + # pass through the actual response + if resp.status_code != 401: + return resp + + username, password = None, None + + # Query the keyring for credentials: + if self.use_keyring: + username, password = self._get_new_credentials( + resp.url, + allow_netrc=False, + allow_keyring=True, + ) + + # We are not able to prompt the user so simply return the response + if not self.prompting and not username and not password: + return resp + + parsed = urllib.parse.urlparse(resp.url) + + # Prompt the user for a new username and password + save = False + if not username and not password: + username, password, save = self._prompt_for_password(parsed.netloc) + + # Store the new username and password to use for future requests + self._credentials_to_save = None + if username is not None and password is not None: + self.passwords[parsed.netloc] = (username, password) + + # Prompt to save the password to keyring + if save and self._should_save_password_to_keyring(): + self._credentials_to_save = Credentials( + url=parsed.netloc, + username=username, + password=password, + ) + + # Consume content and release the original connection to allow our new + # request to reuse the same one. + # The result of the assignment isn't used, it's just needed to consume + # the content. + _ = resp.content + resp.raw.release_conn() + + # Add our new username and password to the request + req = HTTPBasicAuth(username or "", password or "")(resp.request) + req.register_hook("response", self.warn_on_401) + + # On successful request, save the credentials that were used to + # keyring. (Note that if the user responded "no" above, this member + # is not set and nothing will be saved.) + if self._credentials_to_save: + req.register_hook("response", self.save_credentials) + + # Send our new request + new_resp = resp.connection.send(req, **kwargs) + new_resp.history.append(resp) + + return new_resp + + def warn_on_401(self, resp: Response, **kwargs: Any) -> None: + """Response callback to warn about incorrect credentials.""" + if resp.status_code == 401: + logger.warning( + "401 Error, Credentials not correct for %s", + resp.request.url, + ) + + def save_credentials(self, resp: Response, **kwargs: Any) -> None: + """Response callback to save credentials on success.""" + assert ( + self.keyring_provider.has_keyring + ), "should never reach here without keyring" + + creds = self._credentials_to_save + self._credentials_to_save = None + if creds and resp.status_code < 400: + try: + logger.info("Saving credentials to keyring") + self.keyring_provider.save_auth_info( + creds.url, creds.username, creds.password + ) + except Exception: + logger.exception("Failed to save credentials") diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/network/cache.py b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/network/cache.py new file mode 100644 index 0000000000000000000000000000000000000000..0c5961c45b40c38fcc2b0c87360a015ac5298274 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/network/cache.py @@ -0,0 +1,133 @@ +"""HTTP cache implementation.""" + +from __future__ import annotations + +import os +import shutil +from collections.abc import Generator +from contextlib import contextmanager +from datetime import datetime +from typing import Any, BinaryIO, Callable + +from pip._vendor.cachecontrol.cache import SeparateBodyBaseCache +from pip._vendor.cachecontrol.caches import SeparateBodyFileCache +from pip._vendor.requests.models import Response + +from pip._internal.utils.filesystem import adjacent_tmp_file, replace +from pip._internal.utils.misc import ensure_dir + + +def is_from_cache(response: Response) -> bool: + return getattr(response, "from_cache", False) + + +@contextmanager +def suppressed_cache_errors() -> Generator[None, None, None]: + """If we can't access the cache then we can just skip caching and process + requests as if caching wasn't enabled. + """ + try: + yield + except OSError: + pass + + +class SafeFileCache(SeparateBodyBaseCache): + """ + A file based cache which is safe to use even when the target directory may + not be accessible or writable. + + There is a race condition when two processes try to write and/or read the + same entry at the same time, since each entry consists of two separate + files (https://github.com/psf/cachecontrol/issues/324). We therefore have + additional logic that makes sure that both files to be present before + returning an entry; this fixes the read side of the race condition. + + For the write side, we assume that the server will only ever return the + same data for the same URL, which ought to be the case for files pip is + downloading. PyPI does not have a mechanism to swap out a wheel for + another wheel, for example. If this assumption is not true, the + CacheControl issue will need to be fixed. + """ + + def __init__(self, directory: str) -> None: + assert directory is not None, "Cache directory must not be None." + super().__init__() + self.directory = directory + + def _get_cache_path(self, name: str) -> str: + # From cachecontrol.caches.file_cache.FileCache._fn, brought into our + # class for backwards-compatibility and to avoid using a non-public + # method. + hashed = SeparateBodyFileCache.encode(name) + parts = list(hashed[:5]) + [hashed] + return os.path.join(self.directory, *parts) + + def get(self, key: str) -> bytes | None: + # The cache entry is only valid if both metadata and body exist. + metadata_path = self._get_cache_path(key) + body_path = metadata_path + ".body" + if not (os.path.exists(metadata_path) and os.path.exists(body_path)): + return None + with suppressed_cache_errors(): + with open(metadata_path, "rb") as f: + return f.read() + + def _write_to_file(self, path: str, writer_func: Callable[[BinaryIO], Any]) -> None: + """Common file writing logic with proper permissions and atomic replacement.""" + with suppressed_cache_errors(): + ensure_dir(os.path.dirname(path)) + + with adjacent_tmp_file(path) as f: + writer_func(f) + # Inherit the read/write permissions of the cache directory + # to enable multi-user cache use-cases. + mode = ( + os.stat(self.directory).st_mode + & 0o666 # select read/write permissions of cache directory + | 0o600 # set owner read/write permissions + ) + # Change permissions only if there is no risk of following a symlink. + if os.chmod in os.supports_fd: + os.chmod(f.fileno(), mode) + elif os.chmod in os.supports_follow_symlinks: + os.chmod(f.name, mode, follow_symlinks=False) + + replace(f.name, path) + + def _write(self, path: str, data: bytes) -> None: + self._write_to_file(path, lambda f: f.write(data)) + + def _write_from_io(self, path: str, source_file: BinaryIO) -> None: + self._write_to_file(path, lambda f: shutil.copyfileobj(source_file, f)) + + def set( + self, key: str, value: bytes, expires: int | datetime | None = None + ) -> None: + path = self._get_cache_path(key) + self._write(path, value) + + def delete(self, key: str) -> None: + path = self._get_cache_path(key) + with suppressed_cache_errors(): + os.remove(path) + with suppressed_cache_errors(): + os.remove(path + ".body") + + def get_body(self, key: str) -> BinaryIO | None: + # The cache entry is only valid if both metadata and body exist. + metadata_path = self._get_cache_path(key) + body_path = metadata_path + ".body" + if not (os.path.exists(metadata_path) and os.path.exists(body_path)): + return None + with suppressed_cache_errors(): + return open(body_path, "rb") + + def set_body(self, key: str, body: bytes) -> None: + path = self._get_cache_path(key) + ".body" + self._write(path, body) + + def set_body_from_io(self, key: str, body_file: BinaryIO) -> None: + """Set the body of the cache entry from a file object.""" + path = self._get_cache_path(key) + ".body" + self._write_from_io(path, body_file) diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/network/download.py b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/network/download.py new file mode 100644 index 0000000000000000000000000000000000000000..9881cc285fafe2c0049ce4086274d71c099816f5 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/network/download.py @@ -0,0 +1,342 @@ +"""Download files with progress indicators.""" + +from __future__ import annotations + +import email.message +import logging +import mimetypes +import os +from collections.abc import Iterable, Mapping +from dataclasses import dataclass +from http import HTTPStatus +from typing import BinaryIO + +from pip._vendor.requests import PreparedRequest +from pip._vendor.requests.models import Response +from pip._vendor.urllib3 import HTTPResponse as URLlib3Response +from pip._vendor.urllib3._collections import HTTPHeaderDict +from pip._vendor.urllib3.exceptions import ReadTimeoutError + +from pip._internal.cli.progress_bars import BarType, get_download_progress_renderer +from pip._internal.exceptions import IncompleteDownloadError, NetworkConnectionError +from pip._internal.models.index import PyPI +from pip._internal.models.link import Link +from pip._internal.network.cache import SafeFileCache, is_from_cache +from pip._internal.network.session import CacheControlAdapter, PipSession +from pip._internal.network.utils import HEADERS, raise_for_status, response_chunks +from pip._internal.utils.misc import format_size, redact_auth_from_url, splitext + +logger = logging.getLogger(__name__) + + +def _get_http_response_size(resp: Response) -> int | None: + try: + return int(resp.headers["content-length"]) + except (ValueError, KeyError, TypeError): + return None + + +def _get_http_response_etag_or_last_modified(resp: Response) -> str | None: + """ + Return either the ETag or Last-Modified header (or None if neither exists). + The return value can be used in an If-Range header. + """ + return resp.headers.get("etag", resp.headers.get("last-modified")) + + +def _log_download( + resp: Response, + link: Link, + progress_bar: BarType, + total_length: int | None, + range_start: int | None = 0, +) -> Iterable[bytes]: + if link.netloc == PyPI.file_storage_domain: + url = link.show_url + else: + url = link.url_without_fragment + + logged_url = redact_auth_from_url(url) + + if total_length: + if range_start: + logged_url = ( + f"{logged_url} ({format_size(range_start)}/{format_size(total_length)})" + ) + else: + logged_url = f"{logged_url} ({format_size(total_length)})" + + if is_from_cache(resp): + logger.info("Using cached %s", logged_url) + elif range_start: + logger.info("Resuming download %s", logged_url) + else: + logger.info("Downloading %s", logged_url) + + if logger.getEffectiveLevel() > logging.INFO: + show_progress = False + elif is_from_cache(resp): + show_progress = False + elif not total_length: + show_progress = True + elif total_length > (512 * 1024): + show_progress = True + else: + show_progress = False + + chunks = response_chunks(resp) + + if not show_progress: + return chunks + + renderer = get_download_progress_renderer( + bar_type=progress_bar, size=total_length, initial_progress=range_start + ) + return renderer(chunks) + + +def sanitize_content_filename(filename: str) -> str: + """ + Sanitize the "filename" value from a Content-Disposition header. + """ + return os.path.basename(filename) + + +def parse_content_disposition(content_disposition: str, default_filename: str) -> str: + """ + Parse the "filename" value from a Content-Disposition header, and + return the default filename if the result is empty. + """ + m = email.message.Message() + m["content-type"] = content_disposition + filename = m.get_param("filename") + if filename: + # We need to sanitize the filename to prevent directory traversal + # in case the filename contains ".." path parts. + filename = sanitize_content_filename(str(filename)) + return filename or default_filename + + +def _get_http_response_filename(resp: Response, link: Link) -> str: + """Get an ideal filename from the given HTTP response, falling back to + the link filename if not provided. + """ + filename = link.filename # fallback + # Have a look at the Content-Disposition header for a better guess + content_disposition = resp.headers.get("content-disposition") + if content_disposition: + filename = parse_content_disposition(content_disposition, filename) + ext: str | None = splitext(filename)[1] + if not ext: + ext = mimetypes.guess_extension(resp.headers.get("content-type", "")) + if ext: + filename += ext + if not ext and link.url != resp.url: + ext = os.path.splitext(resp.url)[1] + if ext: + filename += ext + return filename + + +@dataclass +class _FileDownload: + """Stores the state of a single link download.""" + + link: Link + output_file: BinaryIO + size: int | None + bytes_received: int = 0 + reattempts: int = 0 + + def is_incomplete(self) -> bool: + return bool(self.size is not None and self.bytes_received < self.size) + + def write_chunk(self, data: bytes) -> None: + self.bytes_received += len(data) + self.output_file.write(data) + + def reset_file(self) -> None: + """Delete any saved data and reset progress to zero.""" + self.output_file.seek(0) + self.output_file.truncate() + self.bytes_received = 0 + + +class Downloader: + def __init__( + self, + session: PipSession, + progress_bar: BarType, + resume_retries: int, + ) -> None: + assert ( + resume_retries >= 0 + ), "Number of max resume retries must be bigger or equal to zero" + self._session = session + self._progress_bar = progress_bar + self._resume_retries = resume_retries + + def batch( + self, links: Iterable[Link], location: str + ) -> Iterable[tuple[Link, tuple[str, str]]]: + """Convenience method to download multiple links.""" + for link in links: + filepath, content_type = self(link, location) + yield link, (filepath, content_type) + + def __call__(self, link: Link, location: str) -> tuple[str, str]: + """Download a link and save it under location.""" + resp = self._http_get(link) + download_size = _get_http_response_size(resp) + + filepath = os.path.join(location, _get_http_response_filename(resp, link)) + with open(filepath, "wb") as content_file: + download = _FileDownload(link, content_file, download_size) + self._process_response(download, resp) + if download.is_incomplete(): + self._attempt_resumes_or_redownloads(download, resp) + + content_type = resp.headers.get("Content-Type", "") + return filepath, content_type + + def _process_response(self, download: _FileDownload, resp: Response) -> None: + """Download and save chunks from a response.""" + chunks = _log_download( + resp, + download.link, + self._progress_bar, + download.size, + range_start=download.bytes_received, + ) + try: + for chunk in chunks: + download.write_chunk(chunk) + except ReadTimeoutError as e: + # If the download size is not known, then give up downloading the file. + if download.size is None: + raise e + + logger.warning("Connection timed out while downloading.") + + def _attempt_resumes_or_redownloads( + self, download: _FileDownload, first_resp: Response + ) -> None: + """Attempt to resume/restart the download if connection was dropped.""" + + while download.reattempts < self._resume_retries and download.is_incomplete(): + assert download.size is not None + download.reattempts += 1 + logger.warning( + "Attempting to resume incomplete download (%s/%s, attempt %d)", + format_size(download.bytes_received), + format_size(download.size), + download.reattempts, + ) + + try: + resume_resp = self._http_get_resume(download, should_match=first_resp) + # Fallback: if the server responded with 200 (i.e., the file has + # since been modified or range requests are unsupported) or any + # other unexpected status, restart the download from the beginning. + must_restart = resume_resp.status_code != HTTPStatus.PARTIAL_CONTENT + if must_restart: + download.reset_file() + download.size = _get_http_response_size(resume_resp) + first_resp = resume_resp + + self._process_response(download, resume_resp) + except (ConnectionError, ReadTimeoutError, OSError): + continue + + # No more resume attempts. Raise an error if the download is still incomplete. + if download.is_incomplete(): + os.remove(download.output_file.name) + raise IncompleteDownloadError(download) + + # If we successfully completed the download via resume, manually cache it + # as a complete response to enable future caching + if download.reattempts > 0: + self._cache_resumed_download(download, first_resp) + + def _cache_resumed_download( + self, download: _FileDownload, original_response: Response + ) -> None: + """ + Manually cache a file that was successfully downloaded via resume retries. + + cachecontrol doesn't cache 206 (Partial Content) responses, since they + are not complete files. This method manually adds the final file to the + cache as though it was downloaded in a single request, so that future + requests can use the cache. + """ + url = download.link.url_without_fragment + adapter = self._session.get_adapter(url) + + # Check if the adapter is the CacheControlAdapter (i.e. caching is enabled) + if not isinstance(adapter, CacheControlAdapter): + logger.debug( + "Skipping resume download caching: no cache controller for %s", url + ) + return + + # Check SafeFileCache is being used + assert isinstance( + adapter.cache, SafeFileCache + ), "separate body cache not in use!" + + synthetic_request = PreparedRequest() + synthetic_request.prepare(method="GET", url=url, headers={}) + + synthetic_response_headers = HTTPHeaderDict() + for key, value in original_response.headers.items(): + if key.lower() not in ["content-range", "content-length"]: + synthetic_response_headers[key] = value + synthetic_response_headers["content-length"] = str(download.size) + + synthetic_response = URLlib3Response( + body="", + headers=synthetic_response_headers, + status=200, + preload_content=False, + ) + + # Save metadata and then stream the file contents to cache. + cache_url = adapter.controller.cache_url(url) + metadata_blob = adapter.controller.serializer.dumps( + synthetic_request, synthetic_response, b"" + ) + adapter.cache.set(cache_url, metadata_blob) + download.output_file.flush() + with open(download.output_file.name, "rb") as f: + adapter.cache.set_body_from_io(cache_url, f) + + logger.debug( + "Cached resumed download as complete response for future use: %s", url + ) + + def _http_get_resume( + self, download: _FileDownload, should_match: Response + ) -> Response: + """Issue a HTTP range request to resume the download.""" + # To better understand the download resumption logic, see the mdn web docs: + # https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/Range_requests + headers = HEADERS.copy() + headers["Range"] = f"bytes={download.bytes_received}-" + # If possible, use a conditional range request to avoid corrupted + # downloads caused by the remote file changing in-between. + if identifier := _get_http_response_etag_or_last_modified(should_match): + headers["If-Range"] = identifier + return self._http_get(download.link, headers) + + def _http_get(self, link: Link, headers: Mapping[str, str] = HEADERS) -> Response: + target_url = link.url_without_fragment + try: + resp = self._session.get(target_url, headers=headers, stream=True) + raise_for_status(resp) + except NetworkConnectionError as e: + assert e.response is not None + logger.critical( + "HTTP error %s while getting %s", e.response.status_code, link + ) + raise + return resp diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/network/lazy_wheel.py b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/network/lazy_wheel.py new file mode 100644 index 0000000000000000000000000000000000000000..ac3ebe63c9b9c5446bb053a6d25e9de6641d980d --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/network/lazy_wheel.py @@ -0,0 +1,213 @@ +"""Lazy ZIP over HTTP""" + +from __future__ import annotations + +__all__ = ["HTTPRangeRequestUnsupported", "dist_from_wheel_url"] + +from bisect import bisect_left, bisect_right +from collections.abc import Generator +from contextlib import contextmanager +from tempfile import NamedTemporaryFile +from typing import Any +from zipfile import BadZipFile, ZipFile + +from pip._vendor.packaging.utils import canonicalize_name +from pip._vendor.requests.models import CONTENT_CHUNK_SIZE, Response + +from pip._internal.metadata import BaseDistribution, MemoryWheel, get_wheel_distribution +from pip._internal.network.session import PipSession +from pip._internal.network.utils import HEADERS, raise_for_status, response_chunks + + +class HTTPRangeRequestUnsupported(Exception): + pass + + +def dist_from_wheel_url(name: str, url: str, session: PipSession) -> BaseDistribution: + """Return a distribution object from the given wheel URL. + + This uses HTTP range requests to only fetch the portion of the wheel + containing metadata, just enough for the object to be constructed. + If such requests are not supported, HTTPRangeRequestUnsupported + is raised. + """ + with LazyZipOverHTTP(url, session) as zf: + # For read-only ZIP files, ZipFile only needs methods read, + # seek, seekable and tell, not the whole IO protocol. + wheel = MemoryWheel(zf.name, zf) # type: ignore + # After context manager exit, wheel.name + # is an invalid file by intention. + return get_wheel_distribution(wheel, canonicalize_name(name)) + + +class LazyZipOverHTTP: + """File-like object mapped to a ZIP file over HTTP. + + This uses HTTP range requests to lazily fetch the file's content, + which is supposed to be fed to ZipFile. If such requests are not + supported by the server, raise HTTPRangeRequestUnsupported + during initialization. + """ + + def __init__( + self, url: str, session: PipSession, chunk_size: int = CONTENT_CHUNK_SIZE + ) -> None: + head = session.head(url, headers=HEADERS) + raise_for_status(head) + assert head.status_code == 200 + self._session, self._url, self._chunk_size = session, url, chunk_size + self._length = int(head.headers["Content-Length"]) + self._file = NamedTemporaryFile() + self.truncate(self._length) + self._left: list[int] = [] + self._right: list[int] = [] + if "bytes" not in head.headers.get("Accept-Ranges", "none"): + raise HTTPRangeRequestUnsupported("range request is not supported") + self._check_zip() + + @property + def mode(self) -> str: + """Opening mode, which is always rb.""" + return "rb" + + @property + def name(self) -> str: + """Path to the underlying file.""" + return self._file.name + + def seekable(self) -> bool: + """Return whether random access is supported, which is True.""" + return True + + def close(self) -> None: + """Close the file.""" + self._file.close() + + @property + def closed(self) -> bool: + """Whether the file is closed.""" + return self._file.closed + + def read(self, size: int = -1) -> bytes: + """Read up to size bytes from the object and return them. + + As a convenience, if size is unspecified or -1, + all bytes until EOF are returned. Fewer than + size bytes may be returned if EOF is reached. + """ + download_size = max(size, self._chunk_size) + start, length = self.tell(), self._length + stop = length if size < 0 else min(start + download_size, length) + start = max(0, stop - download_size) + self._download(start, stop - 1) + return self._file.read(size) + + def readable(self) -> bool: + """Return whether the file is readable, which is True.""" + return True + + def seek(self, offset: int, whence: int = 0) -> int: + """Change stream position and return the new absolute position. + + Seek to offset relative position indicated by whence: + * 0: Start of stream (the default). pos should be >= 0; + * 1: Current position - pos may be negative; + * 2: End of stream - pos usually negative. + """ + return self._file.seek(offset, whence) + + def tell(self) -> int: + """Return the current position.""" + return self._file.tell() + + def truncate(self, size: int | None = None) -> int: + """Resize the stream to the given size in bytes. + + If size is unspecified resize to the current position. + The current stream position isn't changed. + + Return the new file size. + """ + return self._file.truncate(size) + + def writable(self) -> bool: + """Return False.""" + return False + + def __enter__(self) -> LazyZipOverHTTP: + self._file.__enter__() + return self + + def __exit__(self, *exc: Any) -> None: + self._file.__exit__(*exc) + + @contextmanager + def _stay(self) -> Generator[None, None, None]: + """Return a context manager keeping the position. + + At the end of the block, seek back to original position. + """ + pos = self.tell() + try: + yield + finally: + self.seek(pos) + + def _check_zip(self) -> None: + """Check and download until the file is a valid ZIP.""" + end = self._length - 1 + for start in reversed(range(0, end, self._chunk_size)): + self._download(start, end) + with self._stay(): + try: + # For read-only ZIP files, ZipFile only needs + # methods read, seek, seekable and tell. + ZipFile(self) + except BadZipFile: + pass + else: + break + + def _stream_response( + self, start: int, end: int, base_headers: dict[str, str] = HEADERS + ) -> Response: + """Return HTTP response to a range request from start to end.""" + headers = base_headers.copy() + headers["Range"] = f"bytes={start}-{end}" + # TODO: Get range requests to be correctly cached + headers["Cache-Control"] = "no-cache" + return self._session.get(self._url, headers=headers, stream=True) + + def _merge( + self, start: int, end: int, left: int, right: int + ) -> Generator[tuple[int, int], None, None]: + """Return a generator of intervals to be fetched. + + Args: + start (int): Start of needed interval + end (int): End of needed interval + left (int): Index of first overlapping downloaded data + right (int): Index after last overlapping downloaded data + """ + lslice, rslice = self._left[left:right], self._right[left:right] + i = start = min([start] + lslice[:1]) + end = max([end] + rslice[-1:]) + for j, k in zip(lslice, rslice): + if j > i: + yield i, j - 1 + i = k + 1 + if i <= end: + yield i, end + self._left[left:right], self._right[left:right] = [start], [end] + + def _download(self, start: int, end: int) -> None: + """Download bytes from start to end inclusively.""" + with self._stay(): + left = bisect_left(self._right, start) + right = bisect_right(self._left, end) + for start, end in self._merge(start, end, left, right): + response = self._stream_response(start, end) + response.raise_for_status() + self.seek(start) + for chunk in response_chunks(response, self._chunk_size): + self._file.write(chunk) diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/network/session.py b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/network/session.py new file mode 100644 index 0000000000000000000000000000000000000000..a1f9444e37b4a8445f6c780b200705615a2b6de3 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/network/session.py @@ -0,0 +1,528 @@ +"""PipSession and supporting code, containing all pip-specific +network request configuration and behavior. +""" + +from __future__ import annotations + +import email.utils +import functools +import io +import ipaddress +import json +import logging +import mimetypes +import os +import platform +import shutil +import subprocess +import sys +import urllib.parse +import warnings +from collections.abc import Generator, Mapping, Sequence +from typing import ( + TYPE_CHECKING, + Any, + Optional, + Union, +) + +from pip._vendor import requests, urllib3 +from pip._vendor.cachecontrol import CacheControlAdapter as _BaseCacheControlAdapter +from pip._vendor.requests.adapters import DEFAULT_POOLBLOCK, BaseAdapter +from pip._vendor.requests.adapters import HTTPAdapter as _BaseHTTPAdapter +from pip._vendor.requests.models import PreparedRequest, Response +from pip._vendor.requests.structures import CaseInsensitiveDict +from pip._vendor.urllib3.connectionpool import ConnectionPool +from pip._vendor.urllib3.exceptions import InsecureRequestWarning + +from pip import __version__ +from pip._internal.metadata import get_default_environment +from pip._internal.models.link import Link +from pip._internal.network.auth import MultiDomainBasicAuth +from pip._internal.network.cache import SafeFileCache + +# Import ssl from compat so the initial import occurs in only one place. +from pip._internal.utils.compat import has_tls +from pip._internal.utils.glibc import libc_ver +from pip._internal.utils.misc import build_url_from_netloc, parse_netloc +from pip._internal.utils.urls import url_to_path + +if TYPE_CHECKING: + from ssl import SSLContext + + from pip._vendor.urllib3.poolmanager import PoolManager + from pip._vendor.urllib3.proxymanager import ProxyManager + + +logger = logging.getLogger(__name__) + +SecureOrigin = tuple[str, str, Optional[Union[int, str]]] + + +# Ignore warning raised when using --trusted-host. +warnings.filterwarnings("ignore", category=InsecureRequestWarning) + + +SECURE_ORIGINS: list[SecureOrigin] = [ + # protocol, hostname, port + # Taken from Chrome's list of secure origins (See: http://bit.ly/1qrySKC) + ("https", "*", "*"), + ("*", "localhost", "*"), + ("*", "127.0.0.0/8", "*"), + ("*", "::1/128", "*"), + ("file", "*", None), + # ssh is always secure. + ("ssh", "*", "*"), +] + + +# These are environment variables present when running under various +# CI systems. For each variable, some CI systems that use the variable +# are indicated. The collection was chosen so that for each of a number +# of popular systems, at least one of the environment variables is used. +# This list is used to provide some indication of and lower bound for +# CI traffic to PyPI. Thus, it is okay if the list is not comprehensive. +# For more background, see: https://github.com/pypa/pip/issues/5499 +CI_ENVIRONMENT_VARIABLES = ( + # Azure Pipelines + "BUILD_BUILDID", + # Jenkins + "BUILD_ID", + # AppVeyor, CircleCI, Codeship, Gitlab CI, Shippable, Travis CI + "CI", + # Explicit environment variable. + "PIP_IS_CI", +) + + +def looks_like_ci() -> bool: + """ + Return whether it looks like pip is running under CI. + """ + # We don't use the method of checking for a tty (e.g. using isatty()) + # because some CI systems mimic a tty (e.g. Travis CI). Thus that + # method doesn't provide definitive information in either direction. + return any(name in os.environ for name in CI_ENVIRONMENT_VARIABLES) + + +@functools.lru_cache(maxsize=1) +def user_agent() -> str: + """ + Return a string representing the user agent. + """ + data: dict[str, Any] = { + "installer": {"name": "pip", "version": __version__}, + "python": platform.python_version(), + "implementation": { + "name": platform.python_implementation(), + }, + } + + if data["implementation"]["name"] == "CPython": + data["implementation"]["version"] = platform.python_version() + elif data["implementation"]["name"] == "PyPy": + pypy_version_info = sys.pypy_version_info # type: ignore + if pypy_version_info.releaselevel == "final": + pypy_version_info = pypy_version_info[:3] + data["implementation"]["version"] = ".".join( + [str(x) for x in pypy_version_info] + ) + elif data["implementation"]["name"] == "Jython": + # Complete Guess + data["implementation"]["version"] = platform.python_version() + elif data["implementation"]["name"] == "IronPython": + # Complete Guess + data["implementation"]["version"] = platform.python_version() + + if sys.platform.startswith("linux"): + from pip._vendor import distro + + linux_distribution = distro.name(), distro.version(), distro.codename() + distro_infos: dict[str, Any] = dict( + filter( + lambda x: x[1], + zip(["name", "version", "id"], linux_distribution), + ) + ) + libc = dict( + filter( + lambda x: x[1], + zip(["lib", "version"], libc_ver()), + ) + ) + if libc: + distro_infos["libc"] = libc + if distro_infos: + data["distro"] = distro_infos + + if sys.platform.startswith("darwin") and platform.mac_ver()[0]: + data["distro"] = {"name": "macOS", "version": platform.mac_ver()[0]} + + if platform.system(): + data.setdefault("system", {})["name"] = platform.system() + + if platform.release(): + data.setdefault("system", {})["release"] = platform.release() + + if platform.machine(): + data["cpu"] = platform.machine() + + if has_tls(): + import _ssl as ssl + + data["openssl_version"] = ssl.OPENSSL_VERSION + + setuptools_dist = get_default_environment().get_distribution("setuptools") + if setuptools_dist is not None: + data["setuptools_version"] = str(setuptools_dist.version) + + if shutil.which("rustc") is not None: + # If for any reason `rustc --version` fails, silently ignore it + try: + rustc_output = subprocess.check_output( + ["rustc", "--version"], stderr=subprocess.STDOUT, timeout=0.5 + ) + except Exception: + pass + else: + if rustc_output.startswith(b"rustc "): + # The format of `rustc --version` is: + # `b'rustc 1.52.1 (9bc8c42bb 2021-05-09)\n'` + # We extract just the middle (1.52.1) part + data["rustc_version"] = rustc_output.split(b" ")[1].decode() + + # Use None rather than False so as not to give the impression that + # pip knows it is not being run under CI. Rather, it is a null or + # inconclusive result. Also, we include some value rather than no + # value to make it easier to know that the check has been run. + data["ci"] = True if looks_like_ci() else None + + user_data = os.environ.get("PIP_USER_AGENT_USER_DATA") + if user_data is not None: + data["user_data"] = user_data + + return "{data[installer][name]}/{data[installer][version]} {json}".format( + data=data, + json=json.dumps(data, separators=(",", ":"), sort_keys=True), + ) + + +class LocalFSAdapter(BaseAdapter): + def send( + self, + request: PreparedRequest, + stream: bool = False, + timeout: float | tuple[float, float] | None = None, + verify: bool | str = True, + cert: str | tuple[str, str] | None = None, + proxies: Mapping[str, str] | None = None, + ) -> Response: + pathname = url_to_path(request.url) + + resp = Response() + resp.status_code = 200 + resp.url = request.url + + try: + stats = os.stat(pathname) + except OSError as exc: + # format the exception raised as a io.BytesIO object, + # to return a better error message: + resp.status_code = 404 + resp.reason = type(exc).__name__ + resp.raw = io.BytesIO(f"{resp.reason}: {exc}".encode()) + else: + modified = email.utils.formatdate(stats.st_mtime, usegmt=True) + content_type = mimetypes.guess_type(pathname)[0] or "text/plain" + resp.headers = CaseInsensitiveDict( + { + "Content-Type": content_type, + "Content-Length": stats.st_size, + "Last-Modified": modified, + } + ) + + resp.raw = open(pathname, "rb") + resp.close = resp.raw.close + + return resp + + def close(self) -> None: + pass + + +class _SSLContextAdapterMixin: + """Mixin to add the ``ssl_context`` constructor argument to HTTP adapters. + + The additional argument is forwarded directly to the pool manager. This allows us + to dynamically decide what SSL store to use at runtime, which is used to implement + the optional ``truststore`` backend. + """ + + def __init__( + self, + *, + ssl_context: SSLContext | None = None, + **kwargs: Any, + ) -> None: + self._ssl_context = ssl_context + super().__init__(**kwargs) + + def init_poolmanager( + self, + connections: int, + maxsize: int, + block: bool = DEFAULT_POOLBLOCK, + **pool_kwargs: Any, + ) -> PoolManager: + if self._ssl_context is not None: + pool_kwargs.setdefault("ssl_context", self._ssl_context) + return super().init_poolmanager( # type: ignore[misc] + connections=connections, + maxsize=maxsize, + block=block, + **pool_kwargs, + ) + + def proxy_manager_for(self, proxy: str, **proxy_kwargs: Any) -> ProxyManager: + # Proxy manager replaces the pool manager, so inject our SSL + # context here too. https://github.com/pypa/pip/issues/13288 + if self._ssl_context is not None: + proxy_kwargs.setdefault("ssl_context", self._ssl_context) + return super().proxy_manager_for(proxy, **proxy_kwargs) # type: ignore[misc] + + +class HTTPAdapter(_SSLContextAdapterMixin, _BaseHTTPAdapter): + pass + + +class CacheControlAdapter(_SSLContextAdapterMixin, _BaseCacheControlAdapter): + pass + + +class InsecureHTTPAdapter(HTTPAdapter): + def cert_verify( + self, + conn: ConnectionPool, + url: str, + verify: bool | str, + cert: str | tuple[str, str] | None, + ) -> None: + super().cert_verify(conn=conn, url=url, verify=False, cert=cert) + + +class InsecureCacheControlAdapter(CacheControlAdapter): + def cert_verify( + self, + conn: ConnectionPool, + url: str, + verify: bool | str, + cert: str | tuple[str, str] | None, + ) -> None: + super().cert_verify(conn=conn, url=url, verify=False, cert=cert) + + +class PipSession(requests.Session): + timeout: int | None = None + + def __init__( + self, + *args: Any, + retries: int = 0, + cache: str | None = None, + trusted_hosts: Sequence[str] = (), + index_urls: list[str] | None = None, + ssl_context: SSLContext | None = None, + **kwargs: Any, + ) -> None: + """ + :param trusted_hosts: Domains not to emit warnings for when not using + HTTPS. + """ + super().__init__(*args, **kwargs) + + # Namespace the attribute with "pip_" just in case to prevent + # possible conflicts with the base class. + self.pip_trusted_origins: list[tuple[str, int | None]] = [] + self.pip_proxy = None + + # Attach our User Agent to the request + self.headers["User-Agent"] = user_agent() + + # Attach our Authentication handler to the session + self.auth = MultiDomainBasicAuth(index_urls=index_urls) + + # Create our urllib3.Retry instance which will allow us to customize + # how we handle retries. + retries = urllib3.Retry( + # Set the total number of retries that a particular request can + # have. + total=retries, + # A 503 error from PyPI typically means that the Fastly -> Origin + # connection got interrupted in some way. A 503 error in general + # is typically considered a transient error so we'll go ahead and + # retry it. + # A 500 may indicate transient error in Amazon S3 + # A 502 may be a transient error from a CDN like CloudFlare or CloudFront + # A 520 or 527 - may indicate transient error in CloudFlare + status_forcelist=[500, 502, 503, 520, 527], + # Add a small amount of back off between failed requests in + # order to prevent hammering the service. + backoff_factor=0.25, + ) # type: ignore + + # Our Insecure HTTPAdapter disables HTTPS validation. It does not + # support caching so we'll use it for all http:// URLs. + # If caching is disabled, we will also use it for + # https:// hosts that we've marked as ignoring + # TLS errors for (trusted-hosts). + insecure_adapter = InsecureHTTPAdapter(max_retries=retries) + + # We want to _only_ cache responses on securely fetched origins or when + # the host is specified as trusted. We do this because + # we can't validate the response of an insecurely/untrusted fetched + # origin, and we don't want someone to be able to poison the cache and + # require manual eviction from the cache to fix it. + if cache: + secure_adapter = CacheControlAdapter( + cache=SafeFileCache(cache), + max_retries=retries, + ssl_context=ssl_context, + ) + self._trusted_host_adapter = InsecureCacheControlAdapter( + cache=SafeFileCache(cache), + max_retries=retries, + ) + else: + secure_adapter = HTTPAdapter(max_retries=retries, ssl_context=ssl_context) + self._trusted_host_adapter = insecure_adapter + + self.mount("https://", secure_adapter) + self.mount("http://", insecure_adapter) + + # Enable file:// urls + self.mount("file://", LocalFSAdapter()) + + for host in trusted_hosts: + self.add_trusted_host(host, suppress_logging=True) + + def update_index_urls(self, new_index_urls: list[str]) -> None: + """ + :param new_index_urls: New index urls to update the authentication + handler with. + """ + self.auth.index_urls = new_index_urls + + def add_trusted_host( + self, host: str, source: str | None = None, suppress_logging: bool = False + ) -> None: + """ + :param host: It is okay to provide a host that has previously been + added. + :param source: An optional source string, for logging where the host + string came from. + """ + if not suppress_logging: + msg = f"adding trusted host: {host!r}" + if source is not None: + msg += f" (from {source})" + logger.info(msg) + + parsed_host, parsed_port = parse_netloc(host) + if parsed_host is None: + raise ValueError(f"Trusted host URL must include a host part: {host!r}") + if (parsed_host, parsed_port) not in self.pip_trusted_origins: + self.pip_trusted_origins.append((parsed_host, parsed_port)) + + self.mount( + build_url_from_netloc(host, scheme="http") + "/", self._trusted_host_adapter + ) + self.mount(build_url_from_netloc(host) + "/", self._trusted_host_adapter) + if not parsed_port: + self.mount( + build_url_from_netloc(host, scheme="http") + ":", + self._trusted_host_adapter, + ) + # Mount wildcard ports for the same host. + self.mount(build_url_from_netloc(host) + ":", self._trusted_host_adapter) + + def iter_secure_origins(self) -> Generator[SecureOrigin, None, None]: + yield from SECURE_ORIGINS + for host, port in self.pip_trusted_origins: + yield ("*", host, "*" if port is None else port) + + def is_secure_origin(self, location: Link) -> bool: + # Determine if this url used a secure transport mechanism + parsed = urllib.parse.urlparse(str(location)) + origin_protocol, origin_host, origin_port = ( + parsed.scheme, + parsed.hostname, + parsed.port, + ) + + # The protocol to use to see if the protocol matches. + # Don't count the repository type as part of the protocol: in + # cases such as "git+ssh", only use "ssh". (I.e., Only verify against + # the last scheme.) + origin_protocol = origin_protocol.rsplit("+", 1)[-1] + + # Determine if our origin is a secure origin by looking through our + # hardcoded list of secure origins, as well as any additional ones + # configured on this PackageFinder instance. + for secure_origin in self.iter_secure_origins(): + secure_protocol, secure_host, secure_port = secure_origin + if origin_protocol != secure_protocol and secure_protocol != "*": + continue + + try: + addr = ipaddress.ip_address(origin_host or "") + network = ipaddress.ip_network(secure_host) + except ValueError: + # We don't have both a valid address or a valid network, so + # we'll check this origin against hostnames. + if ( + origin_host + and origin_host.lower() != secure_host.lower() + and secure_host != "*" + ): + continue + else: + # We have a valid address and network, so see if the address + # is contained within the network. + if addr not in network: + continue + + # Check to see if the port matches. + if ( + origin_port != secure_port + and secure_port != "*" + and secure_port is not None + ): + continue + + # If we've gotten here, then this origin matches the current + # secure origin and we should return True + return True + + # If we've gotten to this point, then the origin isn't secure and we + # will not accept it as a valid location to search. We will however + # log a warning that we are ignoring it. + logger.warning( + "The repository located at %s is not a trusted or secure host and " + "is being ignored. If this repository is available via HTTPS we " + "recommend you use HTTPS instead, otherwise you may silence " + "this warning and allow it anyway with '--trusted-host %s'.", + origin_host, + origin_host, + ) + + return False + + def request(self, method: str, url: str, *args: Any, **kwargs: Any) -> Response: + # Allow setting a default timeout on a session + kwargs.setdefault("timeout", self.timeout) + # Allow setting a default proxies on a session + kwargs.setdefault("proxies", self.proxies) + + # Dispatch the actual request + return super().request(method, url, *args, **kwargs) diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/network/utils.py b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/network/utils.py new file mode 100644 index 0000000000000000000000000000000000000000..74d3111cff0dc00b33ca15d1aae5c9d73d12dfed --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/network/utils.py @@ -0,0 +1,98 @@ +from collections.abc import Generator + +from pip._vendor.requests.models import Response + +from pip._internal.exceptions import NetworkConnectionError + +# The following comments and HTTP headers were originally added by +# Donald Stufft in git commit 22c562429a61bb77172039e480873fb239dd8c03. +# +# We use Accept-Encoding: identity here because requests defaults to +# accepting compressed responses. This breaks in a variety of ways +# depending on how the server is configured. +# - Some servers will notice that the file isn't a compressible file +# and will leave the file alone and with an empty Content-Encoding +# - Some servers will notice that the file is already compressed and +# will leave the file alone, adding a Content-Encoding: gzip header +# - Some servers won't notice anything at all and will take a file +# that's already been compressed and compress it again, and set +# the Content-Encoding: gzip header +# By setting this to request only the identity encoding we're hoping +# to eliminate the third case. Hopefully there does not exist a server +# which when given a file will notice it is already compressed and that +# you're not asking for a compressed file and will then decompress it +# before sending because if that's the case I don't think it'll ever be +# possible to make this work. +HEADERS: dict[str, str] = {"Accept-Encoding": "identity"} + +DOWNLOAD_CHUNK_SIZE = 256 * 1024 + + +def raise_for_status(resp: Response) -> None: + http_error_msg = "" + if isinstance(resp.reason, bytes): + # We attempt to decode utf-8 first because some servers + # choose to localize their reason strings. If the string + # isn't utf-8, we fall back to iso-8859-1 for all other + # encodings. + try: + reason = resp.reason.decode("utf-8") + except UnicodeDecodeError: + reason = resp.reason.decode("iso-8859-1") + else: + reason = resp.reason + + if 400 <= resp.status_code < 500: + http_error_msg = ( + f"{resp.status_code} Client Error: {reason} for url: {resp.url}" + ) + + elif 500 <= resp.status_code < 600: + http_error_msg = ( + f"{resp.status_code} Server Error: {reason} for url: {resp.url}" + ) + + if http_error_msg: + raise NetworkConnectionError(http_error_msg, response=resp) + + +def response_chunks( + response: Response, chunk_size: int = DOWNLOAD_CHUNK_SIZE +) -> Generator[bytes, None, None]: + """Given a requests Response, provide the data chunks.""" + try: + # Special case for urllib3. + for chunk in response.raw.stream( + chunk_size, + # We use decode_content=False here because we don't + # want urllib3 to mess with the raw bytes we get + # from the server. If we decompress inside of + # urllib3 then we cannot verify the checksum + # because the checksum will be of the compressed + # file. This breakage will only occur if the + # server adds a Content-Encoding header, which + # depends on how the server was configured: + # - Some servers will notice that the file isn't a + # compressible file and will leave the file alone + # and with an empty Content-Encoding + # - Some servers will notice that the file is + # already compressed and will leave the file + # alone and will add a Content-Encoding: gzip + # header + # - Some servers won't notice anything at all and + # will take a file that's already been compressed + # and compress it again and set the + # Content-Encoding: gzip header + # + # By setting this not to decode automatically we + # hope to eliminate problems with the second case. + decode_content=False, + ): + yield chunk + except AttributeError: + # Standard file-like object. + while True: + chunk = response.raw.read(chunk_size) + if not chunk: + break + yield chunk diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/network/xmlrpc.py b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/network/xmlrpc.py new file mode 100644 index 0000000000000000000000000000000000000000..f4bddb48a1d46e60628c655edb0b7412dd19c639 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/network/xmlrpc.py @@ -0,0 +1,61 @@ +"""xmlrpclib.Transport implementation""" + +import logging +import urllib.parse +import xmlrpc.client +from typing import TYPE_CHECKING + +from pip._internal.exceptions import NetworkConnectionError +from pip._internal.network.session import PipSession +from pip._internal.network.utils import raise_for_status + +if TYPE_CHECKING: + from xmlrpc.client import _HostType, _Marshallable + + from _typeshed import SizedBuffer + +logger = logging.getLogger(__name__) + + +class PipXmlrpcTransport(xmlrpc.client.Transport): + """Provide a `xmlrpclib.Transport` implementation via a `PipSession` + object. + """ + + def __init__( + self, index_url: str, session: PipSession, use_datetime: bool = False + ) -> None: + super().__init__(use_datetime) + index_parts = urllib.parse.urlparse(index_url) + self._scheme = index_parts.scheme + self._session = session + + def request( + self, + host: "_HostType", + handler: str, + request_body: "SizedBuffer", + verbose: bool = False, + ) -> tuple["_Marshallable", ...]: + assert isinstance(host, str) + parts = (self._scheme, host, handler, None, None, None) + url = urllib.parse.urlunparse(parts) + try: + headers = {"Content-Type": "text/xml"} + response = self._session.post( + url, + data=request_body, + headers=headers, + stream=True, + ) + raise_for_status(response) + self.verbose = verbose + return self.parse_response(response.raw) + except NetworkConnectionError as exc: + assert exc.response + logger.critical( + "HTTP error %s while getting %s", + exc.response.status_code, + url, + ) + raise diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/operations/__init__.py b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/operations/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/operations/__pycache__/__init__.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/operations/__pycache__/__init__.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..4afe35f66a0d282a6658c0312bd0373e44a62078 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/operations/__pycache__/__init__.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/operations/__pycache__/check.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/operations/__pycache__/check.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..959dfff8d020267524ba507411405b60f43ee8bc Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/operations/__pycache__/check.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/operations/__pycache__/freeze.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/operations/__pycache__/freeze.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..dcfc05f7f0bba8a57b05c95a620efd20501fca72 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/operations/__pycache__/freeze.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/operations/build/metadata.py b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/operations/build/metadata.py new file mode 100644 index 0000000000000000000000000000000000000000..a546809ecd5aaebe791fffef6f0bb114fcec49c6 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/operations/build/metadata.py @@ -0,0 +1,38 @@ +"""Metadata generation logic for source distributions.""" + +import os + +from pip._vendor.pyproject_hooks import BuildBackendHookCaller + +from pip._internal.build_env import BuildEnvironment +from pip._internal.exceptions import ( + InstallationSubprocessError, + MetadataGenerationFailed, +) +from pip._internal.utils.subprocess import runner_with_spinner_message +from pip._internal.utils.temp_dir import TempDirectory + + +def generate_metadata( + build_env: BuildEnvironment, backend: BuildBackendHookCaller, details: str +) -> str: + """Generate metadata using mechanisms described in PEP 517. + + Returns the generated metadata directory. + """ + metadata_tmpdir = TempDirectory(kind="modern-metadata", globally_managed=True) + + metadata_dir = metadata_tmpdir.path + + with build_env: + # Note that BuildBackendHookCaller implements a fallback for + # prepare_metadata_for_build_wheel, so we don't have to + # consider the possibility that this hook doesn't exist. + runner = runner_with_spinner_message("Preparing metadata (pyproject.toml)") + with backend.subprocess_runner(runner): + try: + distinfo_dir = backend.prepare_metadata_for_build_wheel(metadata_dir) + except InstallationSubprocessError as error: + raise MetadataGenerationFailed(package_details=details) from error + + return os.path.join(metadata_dir, distinfo_dir) diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/operations/build/wheel.py b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/operations/build/wheel.py new file mode 100644 index 0000000000000000000000000000000000000000..5e404c6102c7a37d5f6991b08457e58c6705ffa0 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/operations/build/wheel.py @@ -0,0 +1,38 @@ +from __future__ import annotations + +import logging +import os + +from pip._vendor.pyproject_hooks import BuildBackendHookCaller + +from pip._internal.utils.subprocess import runner_with_spinner_message + +logger = logging.getLogger(__name__) + + +def build_wheel_pep517( + name: str, + backend: BuildBackendHookCaller, + metadata_directory: str, + tempd: str, +) -> str | None: + """Build one InstallRequirement using the PEP 517 build process. + + Returns path to wheel if successfully built. Otherwise, returns None. + """ + assert metadata_directory is not None + try: + logger.debug("Destination directory: %s", tempd) + + runner = runner_with_spinner_message( + f"Building wheel for {name} (pyproject.toml)" + ) + with backend.subprocess_runner(runner): + wheel_name = backend.build_wheel( + tempd, + metadata_directory=metadata_directory, + ) + except Exception: + logger.error("Failed building wheel for %s", name) + return None + return os.path.join(tempd, wheel_name) diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/operations/check.py b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/operations/check.py new file mode 100644 index 0000000000000000000000000000000000000000..2d71fa5fff5426aa9b6f51ebe2ec23c0b616c549 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/operations/check.py @@ -0,0 +1,175 @@ +"""Validation of dependencies of packages""" + +from __future__ import annotations + +import logging +from collections.abc import Generator, Iterable +from contextlib import suppress +from email.parser import Parser +from functools import reduce +from typing import ( + Callable, + NamedTuple, +) + +from pip._vendor.packaging.requirements import Requirement +from pip._vendor.packaging.tags import Tag, parse_tag +from pip._vendor.packaging.utils import NormalizedName, canonicalize_name +from pip._vendor.packaging.version import Version + +from pip._internal.distributions import make_distribution_for_install_requirement +from pip._internal.metadata import get_default_environment +from pip._internal.metadata.base import BaseDistribution +from pip._internal.req.req_install import InstallRequirement + +logger = logging.getLogger(__name__) + + +class PackageDetails(NamedTuple): + version: Version + dependencies: list[Requirement] + + +# Shorthands +PackageSet = dict[NormalizedName, PackageDetails] +Missing = tuple[NormalizedName, Requirement] +Conflicting = tuple[NormalizedName, Version, Requirement] + +MissingDict = dict[NormalizedName, list[Missing]] +ConflictingDict = dict[NormalizedName, list[Conflicting]] +CheckResult = tuple[MissingDict, ConflictingDict] +ConflictDetails = tuple[PackageSet, CheckResult] + + +def create_package_set_from_installed() -> tuple[PackageSet, bool]: + """Converts a list of distributions into a PackageSet.""" + package_set = {} + problems = False + env = get_default_environment() + for dist in env.iter_installed_distributions(local_only=False, skip=()): + name = dist.canonical_name + try: + dependencies = list(dist.iter_dependencies()) + package_set[name] = PackageDetails(dist.version, dependencies) + except (OSError, ValueError) as e: + # Don't crash on unreadable or broken metadata. + logger.warning("Error parsing dependencies of %s: %s", name, e) + problems = True + return package_set, problems + + +def check_package_set( + package_set: PackageSet, should_ignore: Callable[[str], bool] | None = None +) -> CheckResult: + """Check if a package set is consistent + + If should_ignore is passed, it should be a callable that takes a + package name and returns a boolean. + """ + + missing = {} + conflicting = {} + + for package_name, package_detail in package_set.items(): + # Info about dependencies of package_name + missing_deps: set[Missing] = set() + conflicting_deps: set[Conflicting] = set() + + if should_ignore and should_ignore(package_name): + continue + + for req in package_detail.dependencies: + name = canonicalize_name(req.name) + + # Check if it's missing + if name not in package_set: + missed = True + if req.marker is not None: + missed = req.marker.evaluate({"extra": ""}) + if missed: + missing_deps.add((name, req)) + continue + + # Check if there's a conflict + version = package_set[name].version + if not req.specifier.contains(version, prereleases=True): + conflicting_deps.add((name, version, req)) + + if missing_deps: + missing[package_name] = sorted(missing_deps, key=str) + if conflicting_deps: + conflicting[package_name] = sorted(conflicting_deps, key=str) + + return missing, conflicting + + +def check_install_conflicts(to_install: list[InstallRequirement]) -> ConflictDetails: + """For checking if the dependency graph would be consistent after \ + installing given requirements + """ + # Start from the current state + package_set, _ = create_package_set_from_installed() + # Install packages + would_be_installed = _simulate_installation_of(to_install, package_set) + + # Only warn about directly-dependent packages; create a whitelist of them + whitelist = _create_whitelist(would_be_installed, package_set) + + return ( + package_set, + check_package_set( + package_set, should_ignore=lambda name: name not in whitelist + ), + ) + + +def check_unsupported( + packages: Iterable[BaseDistribution], + supported_tags: Iterable[Tag], +) -> Generator[BaseDistribution, None, None]: + for p in packages: + with suppress(FileNotFoundError): + wheel_file = p.read_text("WHEEL") + wheel_tags: frozenset[Tag] = reduce( + frozenset.union, + map(parse_tag, Parser().parsestr(wheel_file).get_all("Tag", [])), + frozenset(), + ) + if wheel_tags.isdisjoint(supported_tags): + yield p + + +def _simulate_installation_of( + to_install: list[InstallRequirement], package_set: PackageSet +) -> set[NormalizedName]: + """Computes the version of packages after installing to_install.""" + # Keep track of packages that were installed + installed = set() + + # Modify it as installing requirement_set would (assuming no errors) + for inst_req in to_install: + abstract_dist = make_distribution_for_install_requirement(inst_req) + dist = abstract_dist.get_metadata_distribution() + name = dist.canonical_name + package_set[name] = PackageDetails(dist.version, list(dist.iter_dependencies())) + + installed.add(name) + + return installed + + +def _create_whitelist( + would_be_installed: set[NormalizedName], package_set: PackageSet +) -> set[NormalizedName]: + packages_affected = set(would_be_installed) + + for package_name in package_set: + if package_name in packages_affected: + continue + + for req in package_set[package_name].dependencies: + if canonicalize_name(req.name) in packages_affected: + packages_affected.add(package_name) + break + + return packages_affected diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/operations/freeze.py b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/operations/freeze.py new file mode 100644 index 0000000000000000000000000000000000000000..486a833212f2cf220b6c9e0a918c05f913509750 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/operations/freeze.py @@ -0,0 +1,259 @@ +from __future__ import annotations + +import collections +import logging +import os +from collections.abc import Container, Generator, Iterable +from dataclasses import dataclass, field +from typing import NamedTuple + +from pip._vendor.packaging.utils import NormalizedName, canonicalize_name +from pip._vendor.packaging.version import InvalidVersion + +from pip._internal.exceptions import BadCommand, InstallationError +from pip._internal.metadata import BaseDistribution, get_environment +from pip._internal.req.constructors import ( + install_req_from_editable, + install_req_from_line, +) +from pip._internal.req.req_file import COMMENT_RE +from pip._internal.utils.direct_url_helpers import direct_url_as_pep440_direct_reference + +logger = logging.getLogger(__name__) + + +class _EditableInfo(NamedTuple): + requirement: str + comments: list[str] + + +def freeze( + requirement: list[str] | None = None, + local_only: bool = False, + user_only: bool = False, + paths: list[str] | None = None, + isolated: bool = False, + exclude_editable: bool = False, + skip: Container[str] = (), +) -> Generator[str, None, None]: + installations: dict[str, FrozenRequirement] = {} + + dists = get_environment(paths).iter_installed_distributions( + local_only=local_only, + skip=(), + user_only=user_only, + ) + for dist in dists: + req = FrozenRequirement.from_dist(dist) + if exclude_editable and req.editable: + continue + installations[req.canonical_name] = req + + if requirement: + # the options that don't get turned into an InstallRequirement + # should only be emitted once, even if the same option is in multiple + # requirements files, so we need to keep track of what has been emitted + # so that we don't emit it again if it's seen again + emitted_options: set[str] = set() + # keep track of which files a requirement is in so that we can + # give an accurate warning if a requirement appears multiple times. + req_files: dict[str, list[str]] = collections.defaultdict(list) + for req_file_path in requirement: + with open(req_file_path) as req_file: + for line in req_file: + if ( + not line.strip() + or line.strip().startswith("#") + or line.startswith( + ( + "-r", + "--requirement", + "-f", + "--find-links", + "-i", + "--index-url", + "--pre", + "--trusted-host", + "--process-dependency-links", + "--extra-index-url", + "--use-feature", + ) + ) + ): + line = line.rstrip() + if line not in emitted_options: + emitted_options.add(line) + yield line + continue + + if line.startswith(("-e", "--editable")): + if line.startswith("-e"): + line = line[2:].strip() + else: + line = line[len("--editable") :].strip().lstrip("=") + line_req = install_req_from_editable( + line, + isolated=isolated, + ) + else: + line_req = install_req_from_line( + COMMENT_RE.sub("", line).strip(), + isolated=isolated, + ) + + if not line_req.name: + logger.info( + "Skipping line in requirement file [%s] because " + "it's not clear what it would install: %s", + req_file_path, + line.strip(), + ) + logger.info( + " (add #egg=PackageName to the URL to avoid" + " this warning)" + ) + else: + line_req_canonical_name = canonicalize_name(line_req.name) + if line_req_canonical_name not in installations: + # either it's not installed, or it is installed + # but has been processed already + if not req_files[line_req.name]: + logger.warning( + "Requirement file [%s] contains %s, but " + "package %r is not installed", + req_file_path, + COMMENT_RE.sub("", line).strip(), + line_req.name, + ) + else: + req_files[line_req.name].append(req_file_path) + else: + yield str(installations[line_req_canonical_name]).rstrip() + del installations[line_req_canonical_name] + req_files[line_req.name].append(req_file_path) + + # Warn about requirements that were included multiple times (in a + # single requirements file or in different requirements files). + for name, files in req_files.items(): + if len(files) > 1: + logger.warning( + "Requirement %s included multiple times [%s]", + name, + ", ".join(sorted(set(files))), + ) + + yield ("## The following requirements were added by pip freeze:") + for installation in sorted(installations.values(), key=lambda x: x.name.lower()): + if installation.canonical_name not in skip: + yield str(installation).rstrip() + + +def _format_as_name_version(dist: BaseDistribution) -> str: + try: + dist_version = dist.version + except InvalidVersion: + # legacy version + return f"{dist.raw_name}==={dist.raw_version}" + else: + return f"{dist.raw_name}=={dist_version}" + + +def _get_editable_info(dist: BaseDistribution) -> _EditableInfo: + """ + Compute and return values (req, comments) for use in + FrozenRequirement.from_dist(). + """ + editable_project_location = dist.editable_project_location + assert editable_project_location + location = os.path.normcase(os.path.abspath(editable_project_location)) + + from pip._internal.vcs import RemoteNotFoundError, RemoteNotValidError, vcs + + vcs_backend = vcs.get_backend_for_dir(location) + + if vcs_backend is None: + display = _format_as_name_version(dist) + logger.debug( + 'No VCS found for editable requirement "%s" in: %r', + display, + location, + ) + return _EditableInfo( + requirement=location, + comments=[f"# Editable install with no version control ({display})"], + ) + + vcs_name = type(vcs_backend).__name__ + + try: + req = vcs_backend.get_src_requirement(location, dist.raw_name) + except RemoteNotFoundError: + display = _format_as_name_version(dist) + return _EditableInfo( + requirement=location, + comments=[f"# Editable {vcs_name} install with no remote ({display})"], + ) + except RemoteNotValidError as ex: + display = _format_as_name_version(dist) + return _EditableInfo( + requirement=location, + comments=[ + f"# Editable {vcs_name} install ({display}) with either a deleted " + f"local remote or invalid URI:", + f"# '{ex.url}'", + ], + ) + except BadCommand: + logger.warning( + "cannot determine version of editable source in %s " + "(%s command not found in path)", + location, + vcs_backend.name, + ) + return _EditableInfo(requirement=location, comments=[]) + except InstallationError as exc: + logger.warning("Error when trying to get requirement for VCS system %s", exc) + else: + return _EditableInfo(requirement=req, comments=[]) + + logger.warning("Could not determine repository location of %s", location) + + return _EditableInfo( + requirement=location, + comments=["## !! Could not determine repository location"], + ) + + +@dataclass(frozen=True) +class FrozenRequirement: + name: str + req: str + editable: bool + comments: Iterable[str] = field(default_factory=tuple) + + @property + def canonical_name(self) -> NormalizedName: + return canonicalize_name(self.name) + + @classmethod + def from_dist(cls, dist: BaseDistribution) -> FrozenRequirement: + editable = dist.editable + if editable: + req, comments = _get_editable_info(dist) + else: + comments = [] + direct_url = dist.direct_url + if direct_url: + # if PEP 610 metadata is present, use it + req = direct_url_as_pep440_direct_reference(direct_url, dist.raw_name) + else: + # name==version requirement + req = _format_as_name_version(dist) + + return cls(dist.raw_name, req, editable, comments=comments) + + def __str__(self) -> str: + req = self.req + if self.editable: + req = f"-e {req}" + return "\n".join(list(self.comments) + [str(req)]) + "\n" diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/operations/install/editable_legacy.py b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/operations/install/editable_legacy.py new file mode 100644 index 0000000000000000000000000000000000000000..0603d3d88199695989802632d0a543b06285af3c --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/operations/install/editable_legacy.py @@ -0,0 +1,48 @@ +"""Legacy editable installation process, i.e. `setup.py develop`.""" + +from __future__ import annotations + +import logging +from collections.abc import Sequence + +from pip._internal.build_env import BuildEnvironment +from pip._internal.utils.logging import indent_log +from pip._internal.utils.setuptools_build import make_setuptools_develop_args +from pip._internal.utils.subprocess import call_subprocess + +logger = logging.getLogger(__name__) + + +def install_editable( + *, + global_options: Sequence[str], + prefix: str | None, + home: str | None, + use_user_site: bool, + name: str, + setup_py_path: str, + isolated: bool, + build_env: BuildEnvironment, + unpacked_source_directory: str, +) -> None: + """Install a package in editable mode. Most arguments are pass-through + to setuptools. + """ + logger.info("Running setup.py develop for %s", name) + + args = make_setuptools_develop_args( + setup_py_path, + global_options=global_options, + no_user_config=isolated, + prefix=prefix, + home=home, + use_user_site=use_user_site, + ) + + with indent_log(): + with build_env: + call_subprocess( + args, + command_desc="python setup.py develop", + cwd=unpacked_source_directory, + ) diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/operations/prepare.py b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/operations/prepare.py new file mode 100644 index 0000000000000000000000000000000000000000..00b1a33a0309dcb5927d42d34b40a8e0727af991 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/operations/prepare.py @@ -0,0 +1,742 @@ +"""Prepares a distribution for installation""" + +# The following comment should be removed at some point in the future. +# mypy: strict-optional=False +from __future__ import annotations + +import mimetypes +import os +import shutil +from collections.abc import Iterable +from dataclasses import dataclass +from pathlib import Path +from typing import TYPE_CHECKING + +from pip._vendor.packaging.utils import canonicalize_name + +from pip._internal.build_env import BuildEnvironmentInstaller +from pip._internal.distributions import make_distribution_for_install_requirement +from pip._internal.distributions.installed import InstalledDistribution +from pip._internal.exceptions import ( + DirectoryUrlHashUnsupported, + HashMismatch, + HashUnpinned, + InstallationError, + MetadataInconsistent, + NetworkConnectionError, + VcsHashUnsupported, +) +from pip._internal.index.package_finder import PackageFinder +from pip._internal.metadata import BaseDistribution, get_metadata_distribution +from pip._internal.models.direct_url import ArchiveInfo +from pip._internal.models.link import Link +from pip._internal.models.wheel import Wheel +from pip._internal.network.download import Downloader +from pip._internal.network.lazy_wheel import ( + HTTPRangeRequestUnsupported, + dist_from_wheel_url, +) +from pip._internal.network.session import PipSession +from pip._internal.operations.build.build_tracker import BuildTracker +from pip._internal.req.req_install import InstallRequirement +from pip._internal.utils._log import getLogger +from pip._internal.utils.direct_url_helpers import ( + direct_url_for_editable, + direct_url_from_link, +) +from pip._internal.utils.hashes import Hashes, MissingHashes +from pip._internal.utils.logging import indent_log +from pip._internal.utils.misc import ( + display_path, + hash_file, + hide_url, + redact_auth_from_requirement, +) +from pip._internal.utils.temp_dir import TempDirectory +from pip._internal.utils.unpacking import unpack_file +from pip._internal.vcs import vcs + +if TYPE_CHECKING: + from pip._internal.cli.progress_bars import BarType + +logger = getLogger(__name__) + + +def _get_prepared_distribution( + req: InstallRequirement, + build_tracker: BuildTracker, + build_env_installer: BuildEnvironmentInstaller, + build_isolation: bool, + check_build_deps: bool, +) -> BaseDistribution: + """Prepare a distribution for installation.""" + abstract_dist = make_distribution_for_install_requirement(req) + tracker_id = abstract_dist.build_tracker_id + if tracker_id is not None: + with build_tracker.track(req, tracker_id): + abstract_dist.prepare_distribution_metadata( + build_env_installer, build_isolation, check_build_deps + ) + return abstract_dist.get_metadata_distribution() + + +def unpack_vcs_link(link: Link, location: str, verbosity: int) -> None: + vcs_backend = vcs.get_backend_for_scheme(link.scheme) + assert vcs_backend is not None + vcs_backend.unpack(location, url=hide_url(link.url), verbosity=verbosity) + + +@dataclass +class File: + path: str + content_type: str | None = None + + def __post_init__(self) -> None: + if self.content_type is None: + # Try to guess the file's MIME type. If the system MIME tables + # can't be loaded, give up. + try: + self.content_type = mimetypes.guess_type(self.path)[0] + except OSError: + pass + + +def get_http_url( + link: Link, + download: Downloader, + download_dir: str | None = None, + hashes: Hashes | None = None, +) -> File: + temp_dir = TempDirectory(kind="unpack", globally_managed=True) + # If a download dir is specified, is the file already downloaded there? + already_downloaded_path = None + if download_dir: + already_downloaded_path = _check_download_dir(link, download_dir, hashes) + + if already_downloaded_path: + from_path = already_downloaded_path + content_type = None + else: + # let's download to a tmp dir + from_path, content_type = download(link, temp_dir.path) + if hashes: + hashes.check_against_path(from_path) + + return File(from_path, content_type) + + +def get_file_url( + link: Link, download_dir: str | None = None, hashes: Hashes | None = None +) -> File: + """Get file and optionally check its hash.""" + # If a download dir is specified, is the file already there and valid? + already_downloaded_path = None + if download_dir: + already_downloaded_path = _check_download_dir(link, download_dir, hashes) + + if already_downloaded_path: + from_path = already_downloaded_path + else: + from_path = link.file_path + + # If --require-hashes is off, `hashes` is either empty, the + # link's embedded hash, or MissingHashes; it is required to + # match. If --require-hashes is on, we are satisfied by any + # hash in `hashes` matching: a URL-based or an option-based + # one; no internet-sourced hash will be in `hashes`. + if hashes: + hashes.check_against_path(from_path) + return File(from_path, None) + + +def unpack_url( + link: Link, + location: str, + download: Downloader, + verbosity: int, + download_dir: str | None = None, + hashes: Hashes | None = None, +) -> File | None: + """Unpack link into location, downloading if required. + + :param hashes: A Hashes object, one of whose embedded hashes must match, + or HashMismatch will be raised. If the Hashes is empty, no matches are + required, and unhashable types of requirements (like VCS ones, which + would ordinarily raise HashUnsupported) are allowed. + """ + # non-editable vcs urls + if link.is_vcs: + unpack_vcs_link(link, location, verbosity=verbosity) + return None + + assert not link.is_existing_dir() + + # file urls + if link.is_file: + file = get_file_url(link, download_dir, hashes=hashes) + + # http urls + else: + file = get_http_url( + link, + download, + download_dir, + hashes=hashes, + ) + + # unpack the archive to the build dir location. even when only downloading + # archives, they have to be unpacked to parse dependencies, except wheels + if not link.is_wheel: + unpack_file(file.path, location, file.content_type) + + return file + + +def _check_download_dir( + link: Link, + download_dir: str, + hashes: Hashes | None, + warn_on_hash_mismatch: bool = True, +) -> str | None: + """Check download_dir for previously downloaded file with correct hash + If a correct file is found return its path else None + """ + download_path = os.path.join(download_dir, link.filename) + + if not os.path.exists(download_path): + return None + + # If already downloaded, does its hash match? + logger.info("File was already downloaded %s", download_path) + if hashes: + try: + hashes.check_against_path(download_path) + except HashMismatch: + if warn_on_hash_mismatch: + logger.warning( + "Previously-downloaded file %s has bad hash. Re-downloading.", + download_path, + ) + os.unlink(download_path) + return None + return download_path + + +class RequirementPreparer: + """Prepares a Requirement""" + + def __init__( # noqa: PLR0913 (too many parameters) + self, + *, + build_dir: str, + download_dir: str | None, + src_dir: str, + build_isolation: bool, + build_isolation_installer: BuildEnvironmentInstaller, + check_build_deps: bool, + build_tracker: BuildTracker, + session: PipSession, + progress_bar: BarType, + finder: PackageFinder, + require_hashes: bool, + use_user_site: bool, + lazy_wheel: bool, + verbosity: int, + legacy_resolver: bool, + resume_retries: int, + ) -> None: + super().__init__() + + self.src_dir = src_dir + self.build_dir = build_dir + self.build_tracker = build_tracker + self._session = session + self._download = Downloader(session, progress_bar, resume_retries) + self.finder = finder + + # Where still-packed archives should be written to. If None, they are + # not saved, and are deleted immediately after unpacking. + self.download_dir = download_dir + + # Is build isolation allowed? + self.build_isolation = build_isolation + self.build_env_installer = build_isolation_installer + + # Should check build dependencies? + self.check_build_deps = check_build_deps + + # Should hash-checking be required? + self.require_hashes = require_hashes + + # Should install in user site-packages? + self.use_user_site = use_user_site + + # Should wheels be downloaded lazily? + self.use_lazy_wheel = lazy_wheel + + # How verbose should underlying tooling be? + self.verbosity = verbosity + + # Are we using the legacy resolver? + self.legacy_resolver = legacy_resolver + + # Memoized downloaded files, as mapping of url: path. + self._downloaded: dict[str, str] = {} + + # Previous "header" printed for a link-based InstallRequirement + self._previous_requirement_header = ("", "") + + def _log_preparing_link(self, req: InstallRequirement) -> None: + """Provide context for the requirement being prepared.""" + if req.link.is_file and not req.is_wheel_from_cache: + message = "Processing %s" + information = str(display_path(req.link.file_path)) + else: + message = "Collecting %s" + information = redact_auth_from_requirement(req.req) if req.req else str(req) + + # If we used req.req, inject requirement source if available (this + # would already be included if we used req directly) + if req.req and req.comes_from: + if isinstance(req.comes_from, str): + comes_from: str | None = req.comes_from + else: + comes_from = req.comes_from.from_path() + if comes_from: + information += f" (from {comes_from})" + + if (message, information) != self._previous_requirement_header: + self._previous_requirement_header = (message, information) + logger.info(message, information) + + if req.is_wheel_from_cache: + with indent_log(): + logger.info("Using cached %s", req.link.filename) + + def _ensure_link_req_src_dir( + self, req: InstallRequirement, parallel_builds: bool + ) -> None: + """Ensure source_dir of a linked InstallRequirement.""" + # Since source_dir is only set for editable requirements. + if req.link.is_wheel: + # We don't need to unpack wheels, so no need for a source + # directory. + return + assert req.source_dir is None + if req.link.is_existing_dir(): + # build local directories in-tree + req.source_dir = req.link.file_path + return + + # We always delete unpacked sdists after pip runs. + req.ensure_has_source_dir( + self.build_dir, + autodelete=True, + parallel_builds=parallel_builds, + ) + req.ensure_pristine_source_checkout() + + def _get_linked_req_hashes(self, req: InstallRequirement) -> Hashes: + # By the time this is called, the requirement's link should have + # been checked so we can tell what kind of requirements req is + # and raise some more informative errors than otherwise. + # (For example, we can raise VcsHashUnsupported for a VCS URL + # rather than HashMissing.) + if not self.require_hashes: + return req.hashes(trust_internet=True) + + # We could check these first 2 conditions inside unpack_url + # and save repetition of conditions, but then we would + # report less-useful error messages for unhashable + # requirements, complaining that there's no hash provided. + if req.link.is_vcs: + raise VcsHashUnsupported() + if req.link.is_existing_dir(): + raise DirectoryUrlHashUnsupported() + + # Unpinned packages are asking for trouble when a new version + # is uploaded. This isn't a security check, but it saves users + # a surprising hash mismatch in the future. + # file:/// URLs aren't pinnable, so don't complain about them + # not being pinned. + if not req.is_direct and not req.is_pinned: + raise HashUnpinned() + + # If known-good hashes are missing for this requirement, + # shim it with a facade object that will provoke hash + # computation and then raise a HashMissing exception + # showing the user what the hash should be. + return req.hashes(trust_internet=False) or MissingHashes() + + def _fetch_metadata_only( + self, + req: InstallRequirement, + ) -> BaseDistribution | None: + if self.legacy_resolver: + logger.debug( + "Metadata-only fetching is not used in the legacy resolver", + ) + return None + if self.require_hashes: + logger.debug( + "Metadata-only fetching is not used as hash checking is required", + ) + return None + # Try PEP 658 metadata first, then fall back to lazy wheel if unavailable. + return self._fetch_metadata_using_link_data_attr( + req + ) or self._fetch_metadata_using_lazy_wheel(req.link) + + def _fetch_metadata_using_link_data_attr( + self, + req: InstallRequirement, + ) -> BaseDistribution | None: + """Fetch metadata from the data-dist-info-metadata attribute, if possible.""" + # (1) Get the link to the metadata file, if provided by the backend. + metadata_link = req.link.metadata_link() + if metadata_link is None: + return None + assert req.req is not None + logger.verbose( + "Obtaining dependency information for %s from %s", + req.req, + metadata_link, + ) + # (2) Download the contents of the METADATA file, separate from the dist itself. + metadata_file = get_http_url( + metadata_link, + self._download, + hashes=metadata_link.as_hashes(), + ) + with open(metadata_file.path, "rb") as f: + metadata_contents = f.read() + # (3) Generate a dist just from those file contents. + metadata_dist = get_metadata_distribution( + metadata_contents, + req.link.filename, + req.req.name, + ) + # (4) Ensure the Name: field from the METADATA file matches the name from the + # install requirement. + # + # NB: raw_name will fall back to the name from the install requirement if + # the Name: field is not present, but it's noted in the raw_name docstring + # that that should NEVER happen anyway. + if canonicalize_name(metadata_dist.raw_name) != canonicalize_name(req.req.name): + raise MetadataInconsistent( + req, "Name", req.req.name, metadata_dist.raw_name + ) + return metadata_dist + + def _fetch_metadata_using_lazy_wheel( + self, + link: Link, + ) -> BaseDistribution | None: + """Fetch metadata using lazy wheel, if possible.""" + # --use-feature=fast-deps must be provided. + if not self.use_lazy_wheel: + return None + if link.is_file or not link.is_wheel: + logger.debug( + "Lazy wheel is not used as %r does not point to a remote wheel", + link, + ) + return None + + wheel = Wheel(link.filename) + name = canonicalize_name(wheel.name) + logger.info( + "Obtaining dependency information from %s %s", + name, + wheel.version, + ) + url = link.url.split("#", 1)[0] + try: + return dist_from_wheel_url(name, url, self._session) + except HTTPRangeRequestUnsupported: + logger.debug("%s does not support range requests", url) + return None + + def _complete_partial_requirements( + self, + partially_downloaded_reqs: Iterable[InstallRequirement], + parallel_builds: bool = False, + ) -> None: + """Download any requirements which were only fetched by metadata.""" + # Download to a temporary directory. These will be copied over as + # needed for downstream 'download', 'wheel', and 'install' commands. + temp_dir = TempDirectory(kind="unpack", globally_managed=True).path + + # Map each link to the requirement that owns it. This allows us to set + # `req.local_file_path` on the appropriate requirement after passing + # all the links at once into BatchDownloader. + links_to_fully_download: dict[Link, InstallRequirement] = {} + for req in partially_downloaded_reqs: + assert req.link + links_to_fully_download[req.link] = req + + batch_download = self._download.batch(links_to_fully_download.keys(), temp_dir) + for link, (filepath, _) in batch_download: + logger.debug("Downloading link %s to %s", link, filepath) + req = links_to_fully_download[link] + # Record the downloaded file path so wheel reqs can extract a Distribution + # in .get_dist(). + req.local_file_path = filepath + # Record that the file is downloaded so we don't do it again in + # _prepare_linked_requirement(). + self._downloaded[req.link.url] = filepath + + # If this is an sdist, we need to unpack it after downloading, but the + # .source_dir won't be set up until we are in _prepare_linked_requirement(). + # Add the downloaded archive to the install requirement to unpack after + # preparing the source dir. + if not req.is_wheel: + req.needs_unpacked_archive(Path(filepath)) + + # This step is necessary to ensure all lazy wheels are processed + # successfully by the 'download', 'wheel', and 'install' commands. + for req in partially_downloaded_reqs: + self._prepare_linked_requirement(req, parallel_builds) + + def prepare_linked_requirement( + self, req: InstallRequirement, parallel_builds: bool = False + ) -> BaseDistribution: + """Prepare a requirement to be obtained from req.link.""" + assert req.link + self._log_preparing_link(req) + with indent_log(): + # Check if the relevant file is already available + # in the download directory + file_path = None + if self.download_dir is not None and req.link.is_wheel: + hashes = self._get_linked_req_hashes(req) + file_path = _check_download_dir( + req.link, + self.download_dir, + hashes, + # When a locally built wheel has been found in cache, we don't warn + # about re-downloading when the already downloaded wheel hash does + # not match. This is because the hash must be checked against the + # original link, not the cached link. It that case the already + # downloaded file will be removed and re-fetched from cache (which + # implies a hash check against the cache entry's origin.json). + warn_on_hash_mismatch=not req.is_wheel_from_cache, + ) + + if file_path is not None: + # The file is already available, so mark it as downloaded + self._downloaded[req.link.url] = file_path + else: + # The file is not available, attempt to fetch only metadata + metadata_dist = self._fetch_metadata_only(req) + if metadata_dist is not None: + req.needs_more_preparation = True + return metadata_dist + + # None of the optimizations worked, fully prepare the requirement + return self._prepare_linked_requirement(req, parallel_builds) + + def prepare_linked_requirements_more( + self, reqs: Iterable[InstallRequirement], parallel_builds: bool = False + ) -> None: + """Prepare linked requirements more, if needed.""" + reqs = [req for req in reqs if req.needs_more_preparation] + for req in reqs: + # Determine if any of these requirements were already downloaded. + if self.download_dir is not None and req.link.is_wheel: + hashes = self._get_linked_req_hashes(req) + file_path = _check_download_dir(req.link, self.download_dir, hashes) + if file_path is not None: + self._downloaded[req.link.url] = file_path + req.needs_more_preparation = False + + # Prepare requirements we found were already downloaded for some + # reason. The other downloads will be completed separately. + partially_downloaded_reqs: list[InstallRequirement] = [] + for req in reqs: + if req.needs_more_preparation: + partially_downloaded_reqs.append(req) + else: + self._prepare_linked_requirement(req, parallel_builds) + + # TODO: separate this part out from RequirementPreparer when the v1 + # resolver can be removed! + self._complete_partial_requirements( + partially_downloaded_reqs, + parallel_builds=parallel_builds, + ) + + def _prepare_linked_requirement( + self, req: InstallRequirement, parallel_builds: bool + ) -> BaseDistribution: + assert req.link + link = req.link + + hashes = self._get_linked_req_hashes(req) + + if hashes and req.is_wheel_from_cache: + assert req.download_info is not None + assert link.is_wheel + assert link.is_file + # We need to verify hashes, and we have found the requirement in the cache + # of locally built wheels. + if ( + isinstance(req.download_info.info, ArchiveInfo) + and req.download_info.info.hashes + and hashes.has_one_of(req.download_info.info.hashes) + ): + # At this point we know the requirement was built from a hashable source + # artifact, and we verified that the cache entry's hash of the original + # artifact matches one of the hashes we expect. We don't verify hashes + # against the cached wheel, because the wheel is not the original. + hashes = None + else: + logger.warning( + "The hashes of the source archive found in cache entry " + "don't match, ignoring cached built wheel " + "and re-downloading source." + ) + req.link = req.cached_wheel_source_link + link = req.link + + self._ensure_link_req_src_dir(req, parallel_builds) + + if link.is_existing_dir(): + local_file = None + elif link.url not in self._downloaded: + try: + local_file = unpack_url( + link, + req.source_dir, + self._download, + self.verbosity, + self.download_dir, + hashes, + ) + except NetworkConnectionError as exc: + raise InstallationError( + f"Could not install requirement {req} because of HTTP " + f"error {exc} for URL {link}" + ) + else: + file_path = self._downloaded[link.url] + if hashes: + hashes.check_against_path(file_path) + local_file = File(file_path, content_type=None) + + # If download_info is set, we got it from the wheel cache. + if req.download_info is None: + # Editables don't go through this function (see + # prepare_editable_requirement). + assert not req.editable + req.download_info = direct_url_from_link(link, req.source_dir) + # Make sure we have a hash in download_info. If we got it as part of the + # URL, it will have been verified and we can rely on it. Otherwise we + # compute it from the downloaded file. + # FIXME: https://github.com/pypa/pip/issues/11943 + if ( + isinstance(req.download_info.info, ArchiveInfo) + and not req.download_info.info.hashes + and local_file + ): + hash = hash_file(local_file.path)[0].hexdigest() + # We populate info.hash for backward compatibility. + # This will automatically populate info.hashes. + req.download_info.info.hash = f"sha256={hash}" + + # For use in later processing, + # preserve the file path on the requirement. + if local_file: + req.local_file_path = local_file.path + + dist = _get_prepared_distribution( + req, + self.build_tracker, + self.build_env_installer, + self.build_isolation, + self.check_build_deps, + ) + return dist + + def save_linked_requirement(self, req: InstallRequirement) -> None: + assert self.download_dir is not None + assert req.link is not None + link = req.link + if link.is_vcs or (link.is_existing_dir() and req.editable): + # Make a .zip of the source_dir we already created. + req.archive(self.download_dir) + return + + if link.is_existing_dir(): + logger.debug( + "Not copying link to destination directory " + "since it is a directory: %s", + link, + ) + return + if req.local_file_path is None: + # No distribution was downloaded for this requirement. + return + + download_location = os.path.join(self.download_dir, link.filename) + if not os.path.exists(download_location): + shutil.copy(req.local_file_path, download_location) + download_path = display_path(download_location) + logger.info("Saved %s", download_path) + + def prepare_editable_requirement( + self, + req: InstallRequirement, + ) -> BaseDistribution: + """Prepare an editable requirement.""" + assert req.editable, "cannot prepare a non-editable req as editable" + + logger.info("Obtaining %s", req) + + with indent_log(): + if self.require_hashes: + raise InstallationError( + f"The editable requirement {req} cannot be installed when " + "requiring hashes, because there is no single file to " + "hash." + ) + req.ensure_has_source_dir(self.src_dir) + req.update_editable() + assert req.source_dir + req.download_info = direct_url_for_editable(req.unpacked_source_directory) + + dist = _get_prepared_distribution( + req, + self.build_tracker, + self.build_env_installer, + self.build_isolation, + self.check_build_deps, + ) + + req.check_if_exists(self.use_user_site) + + return dist + + def prepare_installed_requirement( + self, + req: InstallRequirement, + skip_reason: str, + ) -> BaseDistribution: + """Prepare an already-installed requirement.""" + assert req.satisfied_by, "req should have been satisfied but isn't" + assert skip_reason is not None, ( + "did not get skip reason skipped but req.satisfied_by " + f"is set to {req.satisfied_by}" + ) + logger.info( + "Requirement %s: %s (%s)", skip_reason, req, req.satisfied_by.version + ) + with indent_log(): + if self.require_hashes: + logger.debug( + "Since it is already installed, we are trusting this " + "package without checking its hash. To ensure a " + "completely repeatable environment, install into an " + "empty virtualenv." + ) + return InstalledDistribution(req).get_metadata_distribution() diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/req/__init__.py b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/req/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e5050ee588bcc55189447154406fb6dcdc65c886 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/req/__init__.py @@ -0,0 +1,105 @@ +from __future__ import annotations + +import collections +import logging +from collections.abc import Generator, Sequence +from dataclasses import dataclass + +from pip._internal.cli.progress_bars import BarType, get_install_progress_renderer +from pip._internal.utils.logging import indent_log + +from .req_file import parse_requirements +from .req_install import InstallRequirement +from .req_set import RequirementSet + +__all__ = [ + "RequirementSet", + "InstallRequirement", + "parse_requirements", + "install_given_reqs", +] + +logger = logging.getLogger(__name__) + + +@dataclass(frozen=True) +class InstallationResult: + name: str + + +def _validate_requirements( + requirements: list[InstallRequirement], +) -> Generator[tuple[str, InstallRequirement], None, None]: + for req in requirements: + assert req.name, f"invalid to-be-installed requirement: {req}" + yield req.name, req + + +def install_given_reqs( + requirements: list[InstallRequirement], + global_options: Sequence[str], + root: str | None, + home: str | None, + prefix: str | None, + warn_script_location: bool, + use_user_site: bool, + pycompile: bool, + progress_bar: BarType, +) -> list[InstallationResult]: + """ + Install everything in the given list. + + (to be called after having downloaded and unpacked the packages) + """ + to_install = collections.OrderedDict(_validate_requirements(requirements)) + + if to_install: + logger.info( + "Installing collected packages: %s", + ", ".join(to_install.keys()), + ) + + installed = [] + + show_progress = logger.isEnabledFor(logging.INFO) and len(to_install) > 1 + + items = iter(to_install.values()) + if show_progress: + renderer = get_install_progress_renderer( + bar_type=progress_bar, total=len(to_install) + ) + items = renderer(items) + + with indent_log(): + for requirement in items: + req_name = requirement.name + assert req_name is not None + if requirement.should_reinstall: + logger.info("Attempting uninstall: %s", req_name) + with indent_log(): + uninstalled_pathset = requirement.uninstall(auto_confirm=True) + else: + uninstalled_pathset = None + + try: + requirement.install( + global_options, + root=root, + home=home, + prefix=prefix, + warn_script_location=warn_script_location, + use_user_site=use_user_site, + pycompile=pycompile, + ) + except Exception: + # if install did not succeed, rollback previous uninstall + if uninstalled_pathset and not requirement.install_succeeded: + uninstalled_pathset.rollback() + raise + else: + if uninstalled_pathset and requirement.install_succeeded: + uninstalled_pathset.commit() + + installed.append(InstallationResult(req_name)) + + return installed diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/req/constructors.py b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/req/constructors.py new file mode 100644 index 0000000000000000000000000000000000000000..056e7e3a7f1162f5d7e67bde53eb3a12e105a83c --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/req/constructors.py @@ -0,0 +1,562 @@ +"""Backing implementation for InstallRequirement's various constructors + +The idea here is that these formed a major chunk of InstallRequirement's size +so, moving them and support code dedicated to them outside of that class +helps creates for better understandability for the rest of the code. + +These are meant to be used elsewhere within pip to create instances of +InstallRequirement. +""" + +from __future__ import annotations + +import copy +import logging +import os +import re +from collections.abc import Collection +from dataclasses import dataclass + +from pip._vendor.packaging.markers import Marker +from pip._vendor.packaging.requirements import InvalidRequirement, Requirement +from pip._vendor.packaging.specifiers import Specifier + +from pip._internal.exceptions import InstallationError +from pip._internal.models.index import PyPI, TestPyPI +from pip._internal.models.link import Link +from pip._internal.models.wheel import Wheel +from pip._internal.req.req_file import ParsedRequirement +from pip._internal.req.req_install import InstallRequirement +from pip._internal.utils.filetypes import is_archive_file +from pip._internal.utils.misc import is_installable_dir +from pip._internal.utils.packaging import get_requirement +from pip._internal.utils.urls import path_to_url +from pip._internal.vcs import is_url, vcs + +__all__ = [ + "install_req_from_editable", + "install_req_from_line", + "parse_editable", +] + +logger = logging.getLogger(__name__) +operators = Specifier._operators.keys() + + +def _strip_extras(path: str) -> tuple[str, str | None]: + m = re.match(r"^(.+)(\[[^\]]+\])$", path) + extras = None + if m: + path_no_extras = m.group(1) + extras = m.group(2) + else: + path_no_extras = path + + return path_no_extras, extras + + +def convert_extras(extras: str | None) -> set[str]: + if not extras: + return set() + return get_requirement("placeholder" + extras.lower()).extras + + +def _set_requirement_extras(req: Requirement, new_extras: set[str]) -> Requirement: + """ + Returns a new requirement based on the given one, with the supplied extras. If the + given requirement already has extras those are replaced (or dropped if no new extras + are given). + """ + match: re.Match[str] | None = re.fullmatch( + # see https://peps.python.org/pep-0508/#complete-grammar + r"([\w\t .-]+)(\[[^\]]*\])?(.*)", + str(req), + flags=re.ASCII, + ) + # ireq.req is a valid requirement so the regex should always match + assert ( + match is not None + ), f"regex match on requirement {req} failed, this should never happen" + pre: str | None = match.group(1) + post: str | None = match.group(3) + assert ( + pre is not None and post is not None + ), f"regex group selection for requirement {req} failed, this should never happen" + extras: str = "[{}]".format(",".join(sorted(new_extras)) if new_extras else "") + return get_requirement(f"{pre}{extras}{post}") + + +def parse_editable(editable_req: str) -> tuple[str | None, str, set[str]]: + """Parses an editable requirement into: + - a requirement name + - an URL + - extras + - editable options + Accepted requirements: + svn+http://blahblah@rev#egg=Foobar[baz]&subdirectory=version_subdir + .[some_extra] + """ + + url = editable_req + + # If a file path is specified with extras, strip off the extras. + url_no_extras, extras = _strip_extras(url) + + if os.path.isdir(url_no_extras): + # Treating it as code that has already been checked out + url_no_extras = path_to_url(url_no_extras) + + if url_no_extras.lower().startswith("file:"): + package_name = Link(url_no_extras).egg_fragment + if extras: + return ( + package_name, + url_no_extras, + get_requirement("placeholder" + extras.lower()).extras, + ) + else: + return package_name, url_no_extras, set() + + for version_control in vcs: + if url.lower().startswith(f"{version_control}:"): + url = f"{version_control}+{url}" + break + + link = Link(url) + + if not link.is_vcs: + backends = ", ".join(vcs.all_schemes) + raise InstallationError( + f"{editable_req} is not a valid editable requirement. " + f"It should either be a path to a local project or a VCS URL " + f"(beginning with {backends})." + ) + + package_name = link.egg_fragment + if not package_name: + raise InstallationError( + f"Could not detect requirement name for '{editable_req}', " + "please specify one with #egg=your_package_name" + ) + return package_name, url, set() + + +def check_first_requirement_in_file(filename: str) -> None: + """Check if file is parsable as a requirements file. + + This is heavily based on ``pkg_resources.parse_requirements``, but + simplified to just check the first meaningful line. + + :raises InvalidRequirement: If the first meaningful line cannot be parsed + as an requirement. + """ + with open(filename, encoding="utf-8", errors="ignore") as f: + # Create a steppable iterator, so we can handle \-continuations. + lines = ( + line + for line in (line.strip() for line in f) + if line and not line.startswith("#") # Skip blank lines/comments. + ) + + for line in lines: + # Drop comments -- a hash without a space may be in a URL. + if " #" in line: + line = line[: line.find(" #")] + # If there is a line continuation, drop it, and append the next line. + if line.endswith("\\"): + line = line[:-2].strip() + next(lines, "") + get_requirement(line) + return + + +def deduce_helpful_msg(req: str) -> str: + """Returns helpful msg in case requirements file does not exist, + or cannot be parsed. + + :params req: Requirements file path + """ + if not os.path.exists(req): + return f" File '{req}' does not exist." + msg = " The path does exist. " + # Try to parse and check if it is a requirements file. + try: + check_first_requirement_in_file(req) + except InvalidRequirement: + logger.debug("Cannot parse '%s' as requirements file", req) + else: + msg += ( + f"The argument you provided " + f"({req}) appears to be a" + f" requirements file. If that is the" + f" case, use the '-r' flag to install" + f" the packages specified within it." + ) + return msg + + +@dataclass(frozen=True) +class RequirementParts: + requirement: Requirement | None + link: Link | None + markers: Marker | None + extras: set[str] + + +def parse_req_from_editable(editable_req: str) -> RequirementParts: + name, url, extras_override = parse_editable(editable_req) + + if name is not None: + try: + req: Requirement | None = get_requirement(name) + except InvalidRequirement as exc: + raise InstallationError(f"Invalid requirement: {name!r}: {exc}") + else: + req = None + + link = Link(url) + + return RequirementParts(req, link, None, extras_override) + + +# ---- The actual constructors follow ---- + + +def install_req_from_editable( + editable_req: str, + comes_from: InstallRequirement | str | None = None, + *, + use_pep517: bool | None = None, + isolated: bool = False, + global_options: list[str] | None = None, + hash_options: dict[str, list[str]] | None = None, + constraint: bool = False, + user_supplied: bool = False, + permit_editable_wheels: bool = False, + config_settings: dict[str, str | list[str]] | None = None, +) -> InstallRequirement: + parts = parse_req_from_editable(editable_req) + + return InstallRequirement( + parts.requirement, + comes_from=comes_from, + user_supplied=user_supplied, + editable=True, + permit_editable_wheels=permit_editable_wheels, + link=parts.link, + constraint=constraint, + use_pep517=use_pep517, + isolated=isolated, + global_options=global_options, + hash_options=hash_options, + config_settings=config_settings, + extras=parts.extras, + ) + + +def _looks_like_path(name: str) -> bool: + """Checks whether the string "looks like" a path on the filesystem. + + This does not check whether the target actually exists, only judge from the + appearance. + + Returns true if any of the following conditions is true: + * a path separator is found (either os.path.sep or os.path.altsep); + * a dot is found (which represents the current directory). + """ + if os.path.sep in name: + return True + if os.path.altsep is not None and os.path.altsep in name: + return True + if name.startswith("."): + return True + return False + + +def _get_url_from_path(path: str, name: str) -> str | None: + """ + First, it checks whether a provided path is an installable directory. If it + is, returns the path. + + If false, check if the path is an archive file (such as a .whl). + The function checks if the path is a file. If false, if the path has + an @, it will treat it as a PEP 440 URL requirement and return the path. + """ + if _looks_like_path(name) and os.path.isdir(path): + if is_installable_dir(path): + return path_to_url(path) + # TODO: The is_installable_dir test here might not be necessary + # now that it is done in load_pyproject_toml too. + raise InstallationError( + f"Directory {name!r} is not installable. Neither 'setup.py' " + "nor 'pyproject.toml' found." + ) + if not is_archive_file(path): + return None + if os.path.isfile(path): + return path_to_url(path) + urlreq_parts = name.split("@", 1) + if len(urlreq_parts) >= 2 and not _looks_like_path(urlreq_parts[0]): + # If the path contains '@' and the part before it does not look + # like a path, try to treat it as a PEP 440 URL req instead. + return None + logger.warning( + "Requirement %r looks like a filename, but the file does not exist", + name, + ) + return path_to_url(path) + + +def parse_req_from_line(name: str, line_source: str | None) -> RequirementParts: + if is_url(name): + marker_sep = "; " + else: + marker_sep = ";" + if marker_sep in name: + name, markers_as_string = name.split(marker_sep, 1) + markers_as_string = markers_as_string.strip() + if not markers_as_string: + markers = None + else: + markers = Marker(markers_as_string) + else: + markers = None + name = name.strip() + req_as_string = None + path = os.path.normpath(os.path.abspath(name)) + link = None + extras_as_string = None + + if is_url(name): + link = Link(name) + else: + p, extras_as_string = _strip_extras(path) + url = _get_url_from_path(p, name) + if url is not None: + link = Link(url) + + # it's a local file, dir, or url + if link: + # Handle relative file URLs + if link.scheme == "file" and re.search(r"\.\./", link.url): + link = Link(path_to_url(os.path.normpath(os.path.abspath(link.path)))) + # wheel file + if link.is_wheel: + wheel = Wheel(link.filename) # can raise InvalidWheelFilename + req_as_string = f"{wheel.name}=={wheel.version}" + else: + # set the req to the egg fragment. when it's not there, this + # will become an 'unnamed' requirement + req_as_string = link.egg_fragment + + # a requirement specifier + else: + req_as_string = name + + extras = convert_extras(extras_as_string) + + def with_source(text: str) -> str: + if not line_source: + return text + return f"{text} (from {line_source})" + + def _parse_req_string(req_as_string: str) -> Requirement: + try: + return get_requirement(req_as_string) + except InvalidRequirement as exc: + if os.path.sep in req_as_string: + add_msg = "It looks like a path." + add_msg += deduce_helpful_msg(req_as_string) + elif "=" in req_as_string and not any( + op in req_as_string for op in operators + ): + add_msg = "= is not a valid operator. Did you mean == ?" + else: + add_msg = "" + msg = with_source(f"Invalid requirement: {req_as_string!r}: {exc}") + if add_msg: + msg += f"\nHint: {add_msg}" + raise InstallationError(msg) + + if req_as_string is not None: + req: Requirement | None = _parse_req_string(req_as_string) + else: + req = None + + return RequirementParts(req, link, markers, extras) + + +def install_req_from_line( + name: str, + comes_from: str | InstallRequirement | None = None, + *, + use_pep517: bool | None = None, + isolated: bool = False, + global_options: list[str] | None = None, + hash_options: dict[str, list[str]] | None = None, + constraint: bool = False, + line_source: str | None = None, + user_supplied: bool = False, + config_settings: dict[str, str | list[str]] | None = None, +) -> InstallRequirement: + """Creates an InstallRequirement from a name, which might be a + requirement, directory containing 'setup.py', filename, or URL. + + :param line_source: An optional string describing where the line is from, + for logging purposes in case of an error. + """ + parts = parse_req_from_line(name, line_source) + + return InstallRequirement( + parts.requirement, + comes_from, + link=parts.link, + markers=parts.markers, + use_pep517=use_pep517, + isolated=isolated, + global_options=global_options, + hash_options=hash_options, + config_settings=config_settings, + constraint=constraint, + extras=parts.extras, + user_supplied=user_supplied, + ) + + +def install_req_from_req_string( + req_string: str, + comes_from: InstallRequirement | None = None, + isolated: bool = False, + use_pep517: bool | None = None, + user_supplied: bool = False, +) -> InstallRequirement: + try: + req = get_requirement(req_string) + except InvalidRequirement as exc: + raise InstallationError(f"Invalid requirement: {req_string!r}: {exc}") + + domains_not_allowed = [ + PyPI.file_storage_domain, + TestPyPI.file_storage_domain, + ] + if ( + req.url + and comes_from + and comes_from.link + and comes_from.link.netloc in domains_not_allowed + ): + # Explicitly disallow pypi packages that depend on external urls + raise InstallationError( + "Packages installed from PyPI cannot depend on packages " + "which are not also hosted on PyPI.\n" + f"{comes_from.name} depends on {req} " + ) + + return InstallRequirement( + req, + comes_from, + isolated=isolated, + use_pep517=use_pep517, + user_supplied=user_supplied, + ) + + +def install_req_from_parsed_requirement( + parsed_req: ParsedRequirement, + isolated: bool = False, + use_pep517: bool | None = None, + user_supplied: bool = False, + config_settings: dict[str, str | list[str]] | None = None, +) -> InstallRequirement: + if parsed_req.is_editable: + req = install_req_from_editable( + parsed_req.requirement, + comes_from=parsed_req.comes_from, + use_pep517=use_pep517, + constraint=parsed_req.constraint, + isolated=isolated, + user_supplied=user_supplied, + config_settings=config_settings, + ) + + else: + req = install_req_from_line( + parsed_req.requirement, + comes_from=parsed_req.comes_from, + use_pep517=use_pep517, + isolated=isolated, + global_options=( + parsed_req.options.get("global_options", []) + if parsed_req.options + else [] + ), + hash_options=( + parsed_req.options.get("hashes", {}) if parsed_req.options else {} + ), + constraint=parsed_req.constraint, + line_source=parsed_req.line_source, + user_supplied=user_supplied, + config_settings=config_settings, + ) + return req + + +def install_req_from_link_and_ireq( + link: Link, ireq: InstallRequirement +) -> InstallRequirement: + return InstallRequirement( + req=ireq.req, + comes_from=ireq.comes_from, + editable=ireq.editable, + link=link, + markers=ireq.markers, + use_pep517=ireq.use_pep517, + isolated=ireq.isolated, + global_options=ireq.global_options, + hash_options=ireq.hash_options, + config_settings=ireq.config_settings, + user_supplied=ireq.user_supplied, + ) + + +def install_req_drop_extras(ireq: InstallRequirement) -> InstallRequirement: + """ + Creates a new InstallationRequirement using the given template but without + any extras. Sets the original requirement as the new one's parent + (comes_from). + """ + return InstallRequirement( + req=( + _set_requirement_extras(ireq.req, set()) if ireq.req is not None else None + ), + comes_from=ireq, + editable=ireq.editable, + link=ireq.link, + markers=ireq.markers, + use_pep517=ireq.use_pep517, + isolated=ireq.isolated, + global_options=ireq.global_options, + hash_options=ireq.hash_options, + constraint=ireq.constraint, + extras=[], + config_settings=ireq.config_settings, + user_supplied=ireq.user_supplied, + permit_editable_wheels=ireq.permit_editable_wheels, + ) + + +def install_req_extend_extras( + ireq: InstallRequirement, + extras: Collection[str], +) -> InstallRequirement: + """ + Returns a copy of an installation requirement with some additional extras. + Makes a shallow copy of the ireq object. + """ + result = copy.copy(ireq) + result.extras = {*ireq.extras, *extras} + result.req = ( + _set_requirement_extras(ireq.req, result.extras) + if ireq.req is not None + else None + ) + return result diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/req/req_dependency_group.py b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/req/req_dependency_group.py new file mode 100644 index 0000000000000000000000000000000000000000..396ac1bb63587dff8f60ee1aed071e1f6b86dff4 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/req/req_dependency_group.py @@ -0,0 +1,75 @@ +from collections.abc import Iterable, Iterator +from typing import Any + +from pip._vendor.dependency_groups import DependencyGroupResolver + +from pip._internal.exceptions import InstallationError +from pip._internal.utils.compat import tomllib + + +def parse_dependency_groups(groups: list[tuple[str, str]]) -> list[str]: + """ + Parse dependency groups data as provided via the CLI, in a `[path:]group` syntax. + + Raises InstallationErrors if anything goes wrong. + """ + resolvers = _build_resolvers(path for (path, _) in groups) + return list(_resolve_all_groups(resolvers, groups)) + + +def _resolve_all_groups( + resolvers: dict[str, DependencyGroupResolver], groups: list[tuple[str, str]] +) -> Iterator[str]: + """ + Run all resolution, converting any error from `DependencyGroupResolver` into + an InstallationError. + """ + for path, groupname in groups: + resolver = resolvers[path] + try: + yield from (str(req) for req in resolver.resolve(groupname)) + except (ValueError, TypeError, LookupError) as e: + raise InstallationError( + f"[dependency-groups] resolution failed for '{groupname}' " + f"from '{path}': {e}" + ) from e + + +def _build_resolvers(paths: Iterable[str]) -> dict[str, Any]: + resolvers = {} + for path in paths: + if path in resolvers: + continue + + pyproject = _load_pyproject(path) + if "dependency-groups" not in pyproject: + raise InstallationError( + f"[dependency-groups] table was missing from '{path}'. " + "Cannot resolve '--group' option." + ) + raw_dependency_groups = pyproject["dependency-groups"] + if not isinstance(raw_dependency_groups, dict): + raise InstallationError( + f"[dependency-groups] table was malformed in {path}. " + "Cannot resolve '--group' option." + ) + + resolvers[path] = DependencyGroupResolver(raw_dependency_groups) + return resolvers + + +def _load_pyproject(path: str) -> dict[str, Any]: + """ + This helper loads a pyproject.toml as TOML. + + It raises an InstallationError if the operation fails. + """ + try: + with open(path, "rb") as fp: + return tomllib.load(fp) + except FileNotFoundError: + raise InstallationError(f"{path} not found. Cannot resolve '--group' option.") + except tomllib.TOMLDecodeError as e: + raise InstallationError(f"Error parsing {path}: {e}") from e + except OSError as e: + raise InstallationError(f"Error reading {path}: {e}") from e diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/req/req_file.py b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/req/req_file.py new file mode 100644 index 0000000000000000000000000000000000000000..0aad0a366026d12a341175203a3df1aa712f1fc0 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/req/req_file.py @@ -0,0 +1,620 @@ +""" +Requirements file parsing +""" + +from __future__ import annotations + +import codecs +import locale +import logging +import optparse +import os +import re +import shlex +import sys +import urllib.parse +from collections.abc import Generator, Iterable +from dataclasses import dataclass +from optparse import Values +from typing import ( + TYPE_CHECKING, + Any, + Callable, + NoReturn, +) + +from pip._internal.cli import cmdoptions +from pip._internal.exceptions import InstallationError, RequirementsFileParseError +from pip._internal.models.search_scope import SearchScope + +if TYPE_CHECKING: + from pip._internal.index.package_finder import PackageFinder + from pip._internal.network.session import PipSession + +__all__ = ["parse_requirements"] + +ReqFileLines = Iterable[tuple[int, str]] + +LineParser = Callable[[str], tuple[str, Values]] + +SCHEME_RE = re.compile(r"^(http|https|file):", re.I) +COMMENT_RE = re.compile(r"(^|\s+)#.*$") + +# Matches environment variable-style values in '${MY_VARIABLE_1}' with the +# variable name consisting of only uppercase letters, digits or the '_' +# (underscore). This follows the POSIX standard defined in IEEE Std 1003.1, +# 2013 Edition. +ENV_VAR_RE = re.compile(r"(?P\$\{(?P[A-Z0-9_]+)\})") + +SUPPORTED_OPTIONS: list[Callable[..., optparse.Option]] = [ + cmdoptions.index_url, + cmdoptions.extra_index_url, + cmdoptions.no_index, + cmdoptions.constraints, + cmdoptions.requirements, + cmdoptions.editable, + cmdoptions.find_links, + cmdoptions.no_binary, + cmdoptions.only_binary, + cmdoptions.prefer_binary, + cmdoptions.require_hashes, + cmdoptions.pre, + cmdoptions.trusted_host, + cmdoptions.use_new_feature, +] + +# options to be passed to requirements +SUPPORTED_OPTIONS_REQ: list[Callable[..., optparse.Option]] = [ + cmdoptions.global_options, + cmdoptions.hash, + cmdoptions.config_settings, +] + +SUPPORTED_OPTIONS_EDITABLE_REQ: list[Callable[..., optparse.Option]] = [ + cmdoptions.config_settings, +] + + +# the 'dest' string values +SUPPORTED_OPTIONS_REQ_DEST = [str(o().dest) for o in SUPPORTED_OPTIONS_REQ] +SUPPORTED_OPTIONS_EDITABLE_REQ_DEST = [ + str(o().dest) for o in SUPPORTED_OPTIONS_EDITABLE_REQ +] + +# order of BOMS is important: codecs.BOM_UTF16_LE is a prefix of codecs.BOM_UTF32_LE +# so data.startswith(BOM_UTF16_LE) would be true for UTF32_LE data +BOMS: list[tuple[bytes, str]] = [ + (codecs.BOM_UTF8, "utf-8"), + (codecs.BOM_UTF32, "utf-32"), + (codecs.BOM_UTF32_BE, "utf-32-be"), + (codecs.BOM_UTF32_LE, "utf-32-le"), + (codecs.BOM_UTF16, "utf-16"), + (codecs.BOM_UTF16_BE, "utf-16-be"), + (codecs.BOM_UTF16_LE, "utf-16-le"), +] + +PEP263_ENCODING_RE = re.compile(rb"coding[:=]\s*([-\w.]+)") +DEFAULT_ENCODING = "utf-8" + +logger = logging.getLogger(__name__) + + +@dataclass(frozen=True) +class ParsedRequirement: + # TODO: replace this with slots=True when dropping Python 3.9 support. + __slots__ = ( + "requirement", + "is_editable", + "comes_from", + "constraint", + "options", + "line_source", + ) + + requirement: str + is_editable: bool + comes_from: str + constraint: bool + options: dict[str, Any] | None + line_source: str | None + + +@dataclass(frozen=True) +class ParsedLine: + __slots__ = ("filename", "lineno", "args", "opts", "constraint") + + filename: str + lineno: int + args: str + opts: Values + constraint: bool + + @property + def is_editable(self) -> bool: + return bool(self.opts.editables) + + @property + def requirement(self) -> str | None: + if self.args: + return self.args + elif self.is_editable: + # We don't support multiple -e on one line + return self.opts.editables[0] + return None + + +def parse_requirements( + filename: str, + session: PipSession, + finder: PackageFinder | None = None, + options: optparse.Values | None = None, + constraint: bool = False, +) -> Generator[ParsedRequirement, None, None]: + """Parse a requirements file and yield ParsedRequirement instances. + + :param filename: Path or url of requirements file. + :param session: PipSession instance. + :param finder: Instance of pip.index.PackageFinder. + :param options: cli options. + :param constraint: If true, parsing a constraint file rather than + requirements file. + """ + line_parser = get_line_parser(finder) + parser = RequirementsFileParser(session, line_parser) + + for parsed_line in parser.parse(filename, constraint): + parsed_req = handle_line( + parsed_line, options=options, finder=finder, session=session + ) + if parsed_req is not None: + yield parsed_req + + +def preprocess(content: str) -> ReqFileLines: + """Split, filter, and join lines, and return a line iterator + + :param content: the content of the requirements file + """ + lines_enum: ReqFileLines = enumerate(content.splitlines(), start=1) + lines_enum = join_lines(lines_enum) + lines_enum = ignore_comments(lines_enum) + lines_enum = expand_env_variables(lines_enum) + return lines_enum + + +def handle_requirement_line( + line: ParsedLine, + options: optparse.Values | None = None, +) -> ParsedRequirement: + # preserve for the nested code path + line_comes_from = "{} {} (line {})".format( + "-c" if line.constraint else "-r", + line.filename, + line.lineno, + ) + + assert line.requirement is not None + + # get the options that apply to requirements + if line.is_editable: + supported_dest = SUPPORTED_OPTIONS_EDITABLE_REQ_DEST + else: + supported_dest = SUPPORTED_OPTIONS_REQ_DEST + req_options = {} + for dest in supported_dest: + if dest in line.opts.__dict__ and line.opts.__dict__[dest]: + req_options[dest] = line.opts.__dict__[dest] + + line_source = f"line {line.lineno} of {line.filename}" + return ParsedRequirement( + requirement=line.requirement, + is_editable=line.is_editable, + comes_from=line_comes_from, + constraint=line.constraint, + options=req_options, + line_source=line_source, + ) + + +def handle_option_line( + opts: Values, + filename: str, + lineno: int, + finder: PackageFinder | None = None, + options: optparse.Values | None = None, + session: PipSession | None = None, +) -> None: + if opts.hashes: + logger.warning( + "%s line %s has --hash but no requirement, and will be ignored.", + filename, + lineno, + ) + + if options: + # percolate options upward + if opts.require_hashes: + options.require_hashes = opts.require_hashes + if opts.features_enabled: + options.features_enabled.extend( + f for f in opts.features_enabled if f not in options.features_enabled + ) + + # set finder options + if finder: + find_links = finder.find_links + index_urls = finder.index_urls + no_index = finder.search_scope.no_index + if opts.no_index is True: + no_index = True + index_urls = [] + if opts.index_url and not no_index: + index_urls = [opts.index_url] + if opts.extra_index_urls and not no_index: + index_urls.extend(opts.extra_index_urls) + if opts.find_links: + # FIXME: it would be nice to keep track of the source + # of the find_links: support a find-links local path + # relative to a requirements file. + value = opts.find_links[0] + req_dir = os.path.dirname(os.path.abspath(filename)) + relative_to_reqs_file = os.path.join(req_dir, value) + if os.path.exists(relative_to_reqs_file): + value = relative_to_reqs_file + find_links.append(value) + + if session: + # We need to update the auth urls in session + session.update_index_urls(index_urls) + + search_scope = SearchScope( + find_links=find_links, + index_urls=index_urls, + no_index=no_index, + ) + finder.search_scope = search_scope + + if opts.pre: + finder.set_allow_all_prereleases() + + if opts.prefer_binary: + finder.set_prefer_binary() + + if session: + for host in opts.trusted_hosts or []: + source = f"line {lineno} of {filename}" + session.add_trusted_host(host, source=source) + + +def handle_line( + line: ParsedLine, + options: optparse.Values | None = None, + finder: PackageFinder | None = None, + session: PipSession | None = None, +) -> ParsedRequirement | None: + """Handle a single parsed requirements line; This can result in + creating/yielding requirements, or updating the finder. + + :param line: The parsed line to be processed. + :param options: CLI options. + :param finder: The finder - updated by non-requirement lines. + :param session: The session - updated by non-requirement lines. + + Returns a ParsedRequirement object if the line is a requirement line, + otherwise returns None. + + For lines that contain requirements, the only options that have an effect + are from SUPPORTED_OPTIONS_REQ, and they are scoped to the + requirement. Other options from SUPPORTED_OPTIONS may be present, but are + ignored. + + For lines that do not contain requirements, the only options that have an + effect are from SUPPORTED_OPTIONS. Options from SUPPORTED_OPTIONS_REQ may + be present, but are ignored. These lines may contain multiple options + (although our docs imply only one is supported), and all our parsed and + affect the finder. + """ + + if line.requirement is not None: + parsed_req = handle_requirement_line(line, options) + return parsed_req + else: + handle_option_line( + line.opts, + line.filename, + line.lineno, + finder, + options, + session, + ) + return None + + +class RequirementsFileParser: + def __init__( + self, + session: PipSession, + line_parser: LineParser, + ) -> None: + self._session = session + self._line_parser = line_parser + + def parse( + self, filename: str, constraint: bool + ) -> Generator[ParsedLine, None, None]: + """Parse a given file, yielding parsed lines.""" + yield from self._parse_and_recurse( + filename, constraint, [{os.path.abspath(filename): None}] + ) + + def _parse_and_recurse( + self, + filename: str, + constraint: bool, + parsed_files_stack: list[dict[str, str | None]], + ) -> Generator[ParsedLine, None, None]: + for line in self._parse_file(filename, constraint): + if line.requirement is None and ( + line.opts.requirements or line.opts.constraints + ): + # parse a nested requirements file + if line.opts.requirements: + req_path = line.opts.requirements[0] + nested_constraint = False + else: + req_path = line.opts.constraints[0] + nested_constraint = True + + # original file is over http + if SCHEME_RE.search(filename): + # do a url join so relative paths work + req_path = urllib.parse.urljoin(filename, req_path) + # original file and nested file are paths + elif not SCHEME_RE.search(req_path): + # do a join so relative paths work + # and then abspath so that we can identify recursive references + req_path = os.path.abspath( + os.path.join( + os.path.dirname(filename), + req_path, + ) + ) + parsed_files = parsed_files_stack[0] + if req_path in parsed_files: + initial_file = parsed_files[req_path] + tail = ( + f" and again in {initial_file}" + if initial_file is not None + else "" + ) + raise RequirementsFileParseError( + f"{req_path} recursively references itself in {filename}{tail}" + ) + # Keeping a track where was each file first included in + new_parsed_files = parsed_files.copy() + new_parsed_files[req_path] = filename + yield from self._parse_and_recurse( + req_path, nested_constraint, [new_parsed_files, *parsed_files_stack] + ) + else: + yield line + + def _parse_file( + self, filename: str, constraint: bool + ) -> Generator[ParsedLine, None, None]: + _, content = get_file_content(filename, self._session) + + lines_enum = preprocess(content) + + for line_number, line in lines_enum: + try: + args_str, opts = self._line_parser(line) + except OptionParsingError as e: + # add offending line + msg = f"Invalid requirement: {line}\n{e.msg}" + raise RequirementsFileParseError(msg) + + yield ParsedLine( + filename, + line_number, + args_str, + opts, + constraint, + ) + + +def get_line_parser(finder: PackageFinder | None) -> LineParser: + def parse_line(line: str) -> tuple[str, Values]: + # Build new parser for each line since it accumulates appendable + # options. + parser = build_parser() + defaults = parser.get_default_values() + defaults.index_url = None + if finder: + defaults.format_control = finder.format_control + + args_str, options_str = break_args_options(line) + + try: + options = shlex.split(options_str) + except ValueError as e: + raise OptionParsingError(f"Could not split options: {options_str}") from e + + opts, _ = parser.parse_args(options, defaults) + + return args_str, opts + + return parse_line + + +def break_args_options(line: str) -> tuple[str, str]: + """Break up the line into an args and options string. We only want to shlex + (and then optparse) the options, not the args. args can contain markers + which are corrupted by shlex. + """ + tokens = line.split(" ") + args = [] + options = tokens[:] + for token in tokens: + if token.startswith(("-", "--")): + break + else: + args.append(token) + options.pop(0) + return " ".join(args), " ".join(options) + + +class OptionParsingError(Exception): + def __init__(self, msg: str) -> None: + self.msg = msg + + +def build_parser() -> optparse.OptionParser: + """ + Return a parser for parsing requirement lines + """ + parser = optparse.OptionParser(add_help_option=False) + + option_factories = SUPPORTED_OPTIONS + SUPPORTED_OPTIONS_REQ + for option_factory in option_factories: + option = option_factory() + parser.add_option(option) + + # By default optparse sys.exits on parsing errors. We want to wrap + # that in our own exception. + def parser_exit(self: Any, msg: str) -> NoReturn: + raise OptionParsingError(msg) + + # NOTE: mypy disallows assigning to a method + # https://github.com/python/mypy/issues/2427 + parser.exit = parser_exit # type: ignore + + return parser + + +def join_lines(lines_enum: ReqFileLines) -> ReqFileLines: + """Joins a line ending in '\' with the previous line (except when following + comments). The joined line takes on the index of the first line. + """ + primary_line_number = None + new_line: list[str] = [] + for line_number, line in lines_enum: + if not line.endswith("\\") or COMMENT_RE.match(line): + if COMMENT_RE.match(line): + # this ensures comments are always matched later + line = " " + line + if new_line: + new_line.append(line) + assert primary_line_number is not None + yield primary_line_number, "".join(new_line) + new_line = [] + else: + yield line_number, line + else: + if not new_line: + primary_line_number = line_number + new_line.append(line.strip("\\")) + + # last line contains \ + if new_line: + assert primary_line_number is not None + yield primary_line_number, "".join(new_line) + + # TODO: handle space after '\'. + + +def ignore_comments(lines_enum: ReqFileLines) -> ReqFileLines: + """ + Strips comments and filter empty lines. + """ + for line_number, line in lines_enum: + line = COMMENT_RE.sub("", line) + line = line.strip() + if line: + yield line_number, line + + +def expand_env_variables(lines_enum: ReqFileLines) -> ReqFileLines: + """Replace all environment variables that can be retrieved via `os.getenv`. + + The only allowed format for environment variables defined in the + requirement file is `${MY_VARIABLE_1}` to ensure two things: + + 1. Strings that contain a `$` aren't accidentally (partially) expanded. + 2. Ensure consistency across platforms for requirement files. + + These points are the result of a discussion on the `github pull + request #3514 `_. + + Valid characters in variable names follow the `POSIX standard + `_ and are limited + to uppercase letter, digits and the `_` (underscore). + """ + for line_number, line in lines_enum: + for env_var, var_name in ENV_VAR_RE.findall(line): + value = os.getenv(var_name) + if not value: + continue + + line = line.replace(env_var, value) + + yield line_number, line + + +def get_file_content(url: str, session: PipSession) -> tuple[str, str]: + """Gets the content of a file; it may be a filename, file: URL, or + http: URL. Returns (location, content). Content is unicode. + Respects # -*- coding: declarations on the retrieved files. + + :param url: File path or url. + :param session: PipSession instance. + """ + scheme = urllib.parse.urlsplit(url).scheme + # Pip has special support for file:// URLs (LocalFSAdapter). + if scheme in ["http", "https", "file"]: + # Delay importing heavy network modules until absolutely necessary. + from pip._internal.network.utils import raise_for_status + + resp = session.get(url) + raise_for_status(resp) + return resp.url, resp.text + + # Assume this is a bare path. + try: + with open(url, "rb") as f: + raw_content = f.read() + except OSError as exc: + raise InstallationError(f"Could not open requirements file: {exc}") + + content = _decode_req_file(raw_content, url) + + return url, content + + +def _decode_req_file(data: bytes, url: str) -> str: + for bom, encoding in BOMS: + if data.startswith(bom): + return data[len(bom) :].decode(encoding) + + for line in data.split(b"\n")[:2]: + if line[0:1] == b"#": + result = PEP263_ENCODING_RE.search(line) + if result is not None: + encoding = result.groups()[0].decode("ascii") + return data.decode(encoding) + + try: + return data.decode(DEFAULT_ENCODING) + except UnicodeDecodeError: + locale_encoding = locale.getpreferredencoding(False) or sys.getdefaultencoding() + logging.warning( + "unable to decode data from %s with default encoding %s, " + "falling back to encoding from locale: %s. " + "If this is intentional you should specify the encoding with a " + "PEP-263 style comment, e.g. '# -*- coding: %s -*-'", + url, + DEFAULT_ENCODING, + locale_encoding, + locale_encoding, + ) + return data.decode(locale_encoding) diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/req/req_install.py b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/req/req_install.py new file mode 100644 index 0000000000000000000000000000000000000000..c9f6bff17e86bc8f0b78f14141309fb36e40c603 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/req/req_install.py @@ -0,0 +1,937 @@ +from __future__ import annotations + +import functools +import logging +import os +import shutil +import sys +import uuid +import zipfile +from collections.abc import Collection, Iterable, Sequence +from optparse import Values +from pathlib import Path +from typing import Any + +from pip._vendor.packaging.markers import Marker +from pip._vendor.packaging.requirements import Requirement +from pip._vendor.packaging.specifiers import SpecifierSet +from pip._vendor.packaging.utils import canonicalize_name +from pip._vendor.packaging.version import Version +from pip._vendor.packaging.version import parse as parse_version +from pip._vendor.pyproject_hooks import BuildBackendHookCaller + +from pip._internal.build_env import BuildEnvironment, NoOpBuildEnvironment +from pip._internal.exceptions import InstallationError, PreviousBuildDirError +from pip._internal.locations import get_scheme +from pip._internal.metadata import ( + BaseDistribution, + get_default_environment, + get_directory_distribution, + get_wheel_distribution, +) +from pip._internal.metadata.base import FilesystemWheel +from pip._internal.models.direct_url import DirectUrl +from pip._internal.models.link import Link +from pip._internal.operations.build.metadata import generate_metadata +from pip._internal.operations.build.metadata_editable import generate_editable_metadata +from pip._internal.operations.build.metadata_legacy import ( + generate_metadata as generate_metadata_legacy, +) +from pip._internal.operations.install.editable_legacy import ( + install_editable as install_editable_legacy, +) +from pip._internal.operations.install.wheel import install_wheel +from pip._internal.pyproject import load_pyproject_toml, make_pyproject_path +from pip._internal.req.req_uninstall import UninstallPathSet +from pip._internal.utils.deprecation import deprecated +from pip._internal.utils.hashes import Hashes +from pip._internal.utils.misc import ( + ConfiguredBuildBackendHookCaller, + ask_path_exists, + backup_dir, + display_path, + hide_url, + is_installable_dir, + redact_auth_from_requirement, + redact_auth_from_url, +) +from pip._internal.utils.packaging import get_requirement +from pip._internal.utils.subprocess import runner_with_spinner_message +from pip._internal.utils.temp_dir import TempDirectory, tempdir_kinds +from pip._internal.utils.unpacking import unpack_file +from pip._internal.utils.virtualenv import running_under_virtualenv +from pip._internal.vcs import vcs + +logger = logging.getLogger(__name__) + + +class InstallRequirement: + """ + Represents something that may be installed later on, may have information + about where to fetch the relevant requirement and also contains logic for + installing the said requirement. + """ + + def __init__( + self, + req: Requirement | None, + comes_from: str | InstallRequirement | None, + editable: bool = False, + link: Link | None = None, + markers: Marker | None = None, + use_pep517: bool | None = None, + isolated: bool = False, + *, + global_options: list[str] | None = None, + hash_options: dict[str, list[str]] | None = None, + config_settings: dict[str, str | list[str]] | None = None, + constraint: bool = False, + extras: Collection[str] = (), + user_supplied: bool = False, + permit_editable_wheels: bool = False, + ) -> None: + assert req is None or isinstance(req, Requirement), req + self.req = req + self.comes_from = comes_from + self.constraint = constraint + self.editable = editable + self.permit_editable_wheels = permit_editable_wheels + + # source_dir is the local directory where the linked requirement is + # located, or unpacked. In case unpacking is needed, creating and + # populating source_dir is done by the RequirementPreparer. Note this + # is not necessarily the directory where pyproject.toml or setup.py is + # located - that one is obtained via unpacked_source_directory. + self.source_dir: str | None = None + if self.editable: + assert link + if link.is_file: + self.source_dir = os.path.normpath(os.path.abspath(link.file_path)) + + # original_link is the direct URL that was provided by the user for the + # requirement, either directly or via a constraints file. + if link is None and req and req.url: + # PEP 508 URL requirement + link = Link(req.url) + self.link = self.original_link = link + + # When this InstallRequirement is a wheel obtained from the cache of locally + # built wheels, this is the source link corresponding to the cache entry, which + # was used to download and build the cached wheel. + self.cached_wheel_source_link: Link | None = None + + # Information about the location of the artifact that was downloaded . This + # property is guaranteed to be set in resolver results. + self.download_info: DirectUrl | None = None + + # Path to any downloaded or already-existing package. + self.local_file_path: str | None = None + if self.link and self.link.is_file: + self.local_file_path = self.link.file_path + + if extras: + self.extras = extras + elif req: + self.extras = req.extras + else: + self.extras = set() + if markers is None and req: + markers = req.marker + self.markers = markers + + # This holds the Distribution object if this requirement is already installed. + self.satisfied_by: BaseDistribution | None = None + # Whether the installation process should try to uninstall an existing + # distribution before installing this requirement. + self.should_reinstall = False + # Temporary build location + self._temp_build_dir: TempDirectory | None = None + # Set to True after successful installation + self.install_succeeded: bool | None = None + # Supplied options + self.global_options = global_options if global_options else [] + self.hash_options = hash_options if hash_options else {} + self.config_settings = config_settings + # Set to True after successful preparation of this requirement + self.prepared = False + # User supplied requirement are explicitly requested for installation + # by the user via CLI arguments or requirements files, as opposed to, + # e.g. dependencies, extras or constraints. + self.user_supplied = user_supplied + + self.isolated = isolated + self.build_env: BuildEnvironment = NoOpBuildEnvironment() + + # For PEP 517, the directory where we request the project metadata + # gets stored. We need this to pass to build_wheel, so the backend + # can ensure that the wheel matches the metadata (see the PEP for + # details). + self.metadata_directory: str | None = None + + # The static build requirements (from pyproject.toml) + self.pyproject_requires: list[str] | None = None + + # Build requirements that we will check are available + self.requirements_to_check: list[str] = [] + + # The PEP 517 backend we should use to build the project + self.pep517_backend: BuildBackendHookCaller | None = None + + # Are we using PEP 517 for this requirement? + # After pyproject.toml has been loaded, the only valid values are True + # and False. Before loading, None is valid (meaning "use the default"). + # Setting an explicit value before loading pyproject.toml is supported, + # but after loading this flag should be treated as read only. + self.use_pep517 = use_pep517 + + # If config settings are provided, enforce PEP 517. + if self.config_settings: + if self.use_pep517 is False: + logger.warning( + "--no-use-pep517 ignored for %s " + "because --config-settings are specified.", + self, + ) + self.use_pep517 = True + + # This requirement needs more preparation before it can be built + self.needs_more_preparation = False + + # This requirement needs to be unpacked before it can be installed. + self._archive_source: Path | None = None + + def __str__(self) -> str: + if self.req: + s = redact_auth_from_requirement(self.req) + if self.link: + s += f" from {redact_auth_from_url(self.link.url)}" + elif self.link: + s = redact_auth_from_url(self.link.url) + else: + s = "" + if self.satisfied_by is not None: + if self.satisfied_by.location is not None: + location = display_path(self.satisfied_by.location) + else: + location = "" + s += f" in {location}" + if self.comes_from: + if isinstance(self.comes_from, str): + comes_from: str | None = self.comes_from + else: + comes_from = self.comes_from.from_path() + if comes_from: + s += f" (from {comes_from})" + return s + + def __repr__(self) -> str: + return ( + f"<{self.__class__.__name__} object: " + f"{str(self)} editable={self.editable!r}>" + ) + + def format_debug(self) -> str: + """An un-tested helper for getting state, for debugging.""" + attributes = vars(self) + names = sorted(attributes) + + state = (f"{attr}={attributes[attr]!r}" for attr in sorted(names)) + return "<{name} object: {{{state}}}>".format( + name=self.__class__.__name__, + state=", ".join(state), + ) + + # Things that are valid for all kinds of requirements? + @property + def name(self) -> str | None: + if self.req is None: + return None + return self.req.name + + @functools.cached_property + def supports_pyproject_editable(self) -> bool: + if not self.use_pep517: + return False + assert self.pep517_backend + with self.build_env: + runner = runner_with_spinner_message( + "Checking if build backend supports build_editable" + ) + with self.pep517_backend.subprocess_runner(runner): + return "build_editable" in self.pep517_backend._supported_features() + + @property + def specifier(self) -> SpecifierSet: + assert self.req is not None + return self.req.specifier + + @property + def is_direct(self) -> bool: + """Whether this requirement was specified as a direct URL.""" + return self.original_link is not None + + @property + def is_pinned(self) -> bool: + """Return whether I am pinned to an exact version. + + For example, some-package==1.2 is pinned; some-package>1.2 is not. + """ + assert self.req is not None + specifiers = self.req.specifier + return len(specifiers) == 1 and next(iter(specifiers)).operator in {"==", "==="} + + def match_markers(self, extras_requested: Iterable[str] | None = None) -> bool: + if not extras_requested: + # Provide an extra to safely evaluate the markers + # without matching any extra + extras_requested = ("",) + if self.markers is not None: + return any( + self.markers.evaluate({"extra": extra}) for extra in extras_requested + ) + else: + return True + + @property + def has_hash_options(self) -> bool: + """Return whether any known-good hashes are specified as options. + + These activate --require-hashes mode; hashes specified as part of a + URL do not. + + """ + return bool(self.hash_options) + + def hashes(self, trust_internet: bool = True) -> Hashes: + """Return a hash-comparer that considers my option- and URL-based + hashes to be known-good. + + Hashes in URLs--ones embedded in the requirements file, not ones + downloaded from an index server--are almost peers with ones from + flags. They satisfy --require-hashes (whether it was implicitly or + explicitly activated) but do not activate it. md5 and sha224 are not + allowed in flags, which should nudge people toward good algos. We + always OR all hashes together, even ones from URLs. + + :param trust_internet: Whether to trust URL-based (#md5=...) hashes + downloaded from the internet, as by populate_link() + + """ + good_hashes = self.hash_options.copy() + if trust_internet: + link = self.link + elif self.is_direct and self.user_supplied: + link = self.original_link + else: + link = None + if link and link.hash: + assert link.hash_name is not None + good_hashes.setdefault(link.hash_name, []).append(link.hash) + return Hashes(good_hashes) + + def from_path(self) -> str | None: + """Format a nice indicator to show where this "comes from" """ + if self.req is None: + return None + s = str(self.req) + if self.comes_from: + comes_from: str | None + if isinstance(self.comes_from, str): + comes_from = self.comes_from + else: + comes_from = self.comes_from.from_path() + if comes_from: + s += "->" + comes_from + return s + + def ensure_build_location( + self, build_dir: str, autodelete: bool, parallel_builds: bool + ) -> str: + assert build_dir is not None + if self._temp_build_dir is not None: + assert self._temp_build_dir.path + return self._temp_build_dir.path + if self.req is None: + # Some systems have /tmp as a symlink which confuses custom + # builds (such as numpy). Thus, we ensure that the real path + # is returned. + self._temp_build_dir = TempDirectory( + kind=tempdir_kinds.REQ_BUILD, globally_managed=True + ) + + return self._temp_build_dir.path + + # This is the only remaining place where we manually determine the path + # for the temporary directory. It is only needed for editables where + # it is the value of the --src option. + + # When parallel builds are enabled, add a UUID to the build directory + # name so multiple builds do not interfere with each other. + dir_name: str = canonicalize_name(self.req.name) + if parallel_builds: + dir_name = f"{dir_name}_{uuid.uuid4().hex}" + + # FIXME: Is there a better place to create the build_dir? (hg and bzr + # need this) + if not os.path.exists(build_dir): + logger.debug("Creating directory %s", build_dir) + os.makedirs(build_dir) + actual_build_dir = os.path.join(build_dir, dir_name) + # `None` indicates that we respect the globally-configured deletion + # settings, which is what we actually want when auto-deleting. + delete_arg = None if autodelete else False + return TempDirectory( + path=actual_build_dir, + delete=delete_arg, + kind=tempdir_kinds.REQ_BUILD, + globally_managed=True, + ).path + + def _set_requirement(self) -> None: + """Set requirement after generating metadata.""" + assert self.req is None + assert self.metadata is not None + assert self.source_dir is not None + + # Construct a Requirement object from the generated metadata + if isinstance(parse_version(self.metadata["Version"]), Version): + op = "==" + else: + op = "===" + + self.req = get_requirement( + "".join( + [ + self.metadata["Name"], + op, + self.metadata["Version"], + ] + ) + ) + + def warn_on_mismatching_name(self) -> None: + assert self.req is not None + metadata_name = canonicalize_name(self.metadata["Name"]) + if canonicalize_name(self.req.name) == metadata_name: + # Everything is fine. + return + + # If we're here, there's a mismatch. Log a warning about it. + logger.warning( + "Generating metadata for package %s " + "produced metadata for project name %s. Fix your " + "#egg=%s fragments.", + self.name, + metadata_name, + self.name, + ) + self.req = get_requirement(metadata_name) + + def check_if_exists(self, use_user_site: bool) -> None: + """Find an installed distribution that satisfies or conflicts + with this requirement, and set self.satisfied_by or + self.should_reinstall appropriately. + """ + if self.req is None: + return + existing_dist = get_default_environment().get_distribution(self.req.name) + if not existing_dist: + return + + version_compatible = self.req.specifier.contains( + existing_dist.version, + prereleases=True, + ) + if not version_compatible: + self.satisfied_by = None + if use_user_site: + if existing_dist.in_usersite: + self.should_reinstall = True + elif running_under_virtualenv() and existing_dist.in_site_packages: + raise InstallationError( + f"Will not install to the user site because it will " + f"lack sys.path precedence to {existing_dist.raw_name} " + f"in {existing_dist.location}" + ) + else: + self.should_reinstall = True + else: + if self.editable: + self.should_reinstall = True + # when installing editables, nothing pre-existing should ever + # satisfy + self.satisfied_by = None + else: + self.satisfied_by = existing_dist + + # Things valid for wheels + @property + def is_wheel(self) -> bool: + if not self.link: + return False + return self.link.is_wheel + + @property + def is_wheel_from_cache(self) -> bool: + # When True, it means that this InstallRequirement is a local wheel file in the + # cache of locally built wheels. + return self.cached_wheel_source_link is not None + + # Things valid for sdists + @property + def unpacked_source_directory(self) -> str: + assert self.source_dir, f"No source dir for {self}" + return os.path.join( + self.source_dir, self.link and self.link.subdirectory_fragment or "" + ) + + @property + def setup_py_path(self) -> str: + assert self.source_dir, f"No source dir for {self}" + setup_py = os.path.join(self.unpacked_source_directory, "setup.py") + + return setup_py + + @property + def setup_cfg_path(self) -> str: + assert self.source_dir, f"No source dir for {self}" + setup_cfg = os.path.join(self.unpacked_source_directory, "setup.cfg") + + return setup_cfg + + @property + def pyproject_toml_path(self) -> str: + assert self.source_dir, f"No source dir for {self}" + return make_pyproject_path(self.unpacked_source_directory) + + def load_pyproject_toml(self) -> None: + """Load the pyproject.toml file. + + After calling this routine, all of the attributes related to PEP 517 + processing for this requirement have been set. In particular, the + use_pep517 attribute can be used to determine whether we should + follow the PEP 517 or legacy (setup.py) code path. + """ + pyproject_toml_data = load_pyproject_toml( + self.use_pep517, self.pyproject_toml_path, self.setup_py_path, str(self) + ) + + if pyproject_toml_data is None: + assert not self.config_settings + self.use_pep517 = False + return + + self.use_pep517 = True + requires, backend, check, backend_path = pyproject_toml_data + self.requirements_to_check = check + self.pyproject_requires = requires + self.pep517_backend = ConfiguredBuildBackendHookCaller( + self, + self.unpacked_source_directory, + backend, + backend_path=backend_path, + ) + + def isolated_editable_sanity_check(self) -> None: + """Check that an editable requirement if valid for use with PEP 517/518. + + This verifies that an editable that has a pyproject.toml either supports PEP 660 + or as a setup.py or a setup.cfg + """ + if ( + self.editable + and self.use_pep517 + and not self.supports_pyproject_editable + and not os.path.isfile(self.setup_py_path) + and not os.path.isfile(self.setup_cfg_path) + ): + raise InstallationError( + f"Project {self} has a 'pyproject.toml' and its build " + f"backend is missing the 'build_editable' hook. Since it does not " + f"have a 'setup.py' nor a 'setup.cfg', " + f"it cannot be installed in editable mode. " + f"Consider using a build backend that supports PEP 660." + ) + + def prepare_metadata(self) -> None: + """Ensure that project metadata is available. + + Under PEP 517 and PEP 660, call the backend hook to prepare the metadata. + Under legacy processing, call setup.py egg-info. + """ + assert self.source_dir, f"No source dir for {self}" + details = self.name or f"from {self.link}" + + if self.use_pep517: + assert self.pep517_backend is not None + if ( + self.editable + and self.permit_editable_wheels + and self.supports_pyproject_editable + ): + self.metadata_directory = generate_editable_metadata( + build_env=self.build_env, + backend=self.pep517_backend, + details=details, + ) + else: + self.metadata_directory = generate_metadata( + build_env=self.build_env, + backend=self.pep517_backend, + details=details, + ) + else: + self.metadata_directory = generate_metadata_legacy( + build_env=self.build_env, + setup_py_path=self.setup_py_path, + source_dir=self.unpacked_source_directory, + isolated=self.isolated, + details=details, + ) + + # Act on the newly generated metadata, based on the name and version. + if not self.name: + self._set_requirement() + else: + self.warn_on_mismatching_name() + + self.assert_source_matches_version() + + @property + def metadata(self) -> Any: + if not hasattr(self, "_metadata"): + self._metadata = self.get_dist().metadata + + return self._metadata + + def get_dist(self) -> BaseDistribution: + if self.metadata_directory: + return get_directory_distribution(self.metadata_directory) + elif self.local_file_path and self.is_wheel: + assert self.req is not None + return get_wheel_distribution( + FilesystemWheel(self.local_file_path), + canonicalize_name(self.req.name), + ) + raise AssertionError( + f"InstallRequirement {self} has no metadata directory and no wheel: " + f"can't make a distribution." + ) + + def assert_source_matches_version(self) -> None: + assert self.source_dir, f"No source dir for {self}" + version = self.metadata["version"] + if self.req and self.req.specifier and version not in self.req.specifier: + logger.warning( + "Requested %s, but installing version %s", + self, + version, + ) + else: + logger.debug( + "Source in %s has version %s, which satisfies requirement %s", + display_path(self.source_dir), + version, + self, + ) + + # For both source distributions and editables + def ensure_has_source_dir( + self, + parent_dir: str, + autodelete: bool = False, + parallel_builds: bool = False, + ) -> None: + """Ensure that a source_dir is set. + + This will create a temporary build dir if the name of the requirement + isn't known yet. + + :param parent_dir: The ideal pip parent_dir for the source_dir. + Generally src_dir for editables and build_dir for sdists. + :return: self.source_dir + """ + if self.source_dir is None: + self.source_dir = self.ensure_build_location( + parent_dir, + autodelete=autodelete, + parallel_builds=parallel_builds, + ) + + def needs_unpacked_archive(self, archive_source: Path) -> None: + assert self._archive_source is None + self._archive_source = archive_source + + def ensure_pristine_source_checkout(self) -> None: + """Ensure the source directory has not yet been built in.""" + assert self.source_dir is not None + if self._archive_source is not None: + unpack_file(str(self._archive_source), self.source_dir) + elif is_installable_dir(self.source_dir): + # If a checkout exists, it's unwise to keep going. + # version inconsistencies are logged later, but do not fail + # the installation. + raise PreviousBuildDirError( + f"pip can't proceed with requirements '{self}' due to a " + f"pre-existing build directory ({self.source_dir}). This is likely " + "due to a previous installation that failed . pip is " + "being responsible and not assuming it can delete this. " + "Please delete it and try again." + ) + + # For editable installations + def update_editable(self) -> None: + if not self.link: + logger.debug( + "Cannot update repository at %s; repository location is unknown", + self.source_dir, + ) + return + assert self.editable + assert self.source_dir + if self.link.scheme == "file": + # Static paths don't get updated + return + vcs_backend = vcs.get_backend_for_scheme(self.link.scheme) + # Editable requirements are validated in Requirement constructors. + # So here, if it's neither a path nor a valid VCS URL, it's a bug. + assert vcs_backend, f"Unsupported VCS URL {self.link.url}" + hidden_url = hide_url(self.link.url) + vcs_backend.obtain(self.source_dir, url=hidden_url, verbosity=0) + + # Top-level Actions + def uninstall( + self, auto_confirm: bool = False, verbose: bool = False + ) -> UninstallPathSet | None: + """ + Uninstall the distribution currently satisfying this requirement. + + Prompts before removing or modifying files unless + ``auto_confirm`` is True. + + Refuses to delete or modify files outside of ``sys.prefix`` - + thus uninstallation within a virtual environment can only + modify that virtual environment, even if the virtualenv is + linked to global site-packages. + + """ + assert self.req + dist = get_default_environment().get_distribution(self.req.name) + if not dist: + logger.warning("Skipping %s as it is not installed.", self.name) + return None + logger.info("Found existing installation: %s", dist) + + uninstalled_pathset = UninstallPathSet.from_dist(dist) + uninstalled_pathset.remove(auto_confirm, verbose) + return uninstalled_pathset + + def _get_archive_name(self, path: str, parentdir: str, rootdir: str) -> str: + def _clean_zip_name(name: str, prefix: str) -> str: + assert name.startswith( + prefix + os.path.sep + ), f"name {name!r} doesn't start with prefix {prefix!r}" + name = name[len(prefix) + 1 :] + name = name.replace(os.path.sep, "/") + return name + + assert self.req is not None + path = os.path.join(parentdir, path) + name = _clean_zip_name(path, rootdir) + return self.req.name + "/" + name + + def archive(self, build_dir: str | None) -> None: + """Saves archive to provided build_dir. + + Used for saving downloaded VCS requirements as part of `pip download`. + """ + assert self.source_dir + if build_dir is None: + return + + create_archive = True + archive_name = "{}-{}.zip".format(self.name, self.metadata["version"]) + archive_path = os.path.join(build_dir, archive_name) + + if os.path.exists(archive_path): + response = ask_path_exists( + f"The file {display_path(archive_path)} exists. (i)gnore, (w)ipe, " + "(b)ackup, (a)bort ", + ("i", "w", "b", "a"), + ) + if response == "i": + create_archive = False + elif response == "w": + logger.warning("Deleting %s", display_path(archive_path)) + os.remove(archive_path) + elif response == "b": + dest_file = backup_dir(archive_path) + logger.warning( + "Backing up %s to %s", + display_path(archive_path), + display_path(dest_file), + ) + shutil.move(archive_path, dest_file) + elif response == "a": + sys.exit(-1) + + if not create_archive: + return + + zip_output = zipfile.ZipFile( + archive_path, + "w", + zipfile.ZIP_DEFLATED, + allowZip64=True, + ) + with zip_output: + dir = os.path.normcase(os.path.abspath(self.unpacked_source_directory)) + for dirpath, dirnames, filenames in os.walk(dir): + for dirname in dirnames: + dir_arcname = self._get_archive_name( + dirname, + parentdir=dirpath, + rootdir=dir, + ) + zipdir = zipfile.ZipInfo(dir_arcname + "/") + zipdir.external_attr = 0x1ED << 16 # 0o755 + zip_output.writestr(zipdir, "") + for filename in filenames: + file_arcname = self._get_archive_name( + filename, + parentdir=dirpath, + rootdir=dir, + ) + filename = os.path.join(dirpath, filename) + zip_output.write(filename, file_arcname) + + logger.info("Saved %s", display_path(archive_path)) + + def install( + self, + global_options: Sequence[str] | None = None, + root: str | None = None, + home: str | None = None, + prefix: str | None = None, + warn_script_location: bool = True, + use_user_site: bool = False, + pycompile: bool = True, + ) -> None: + assert self.req is not None + scheme = get_scheme( + self.req.name, + user=use_user_site, + home=home, + root=root, + isolated=self.isolated, + prefix=prefix, + ) + + if self.editable and not self.is_wheel: + deprecated( + reason=( + f"Legacy editable install of {self} (setup.py develop) " + "is deprecated." + ), + replacement=( + "to add a pyproject.toml or enable --use-pep517, " + "and use setuptools >= 64. " + "If the resulting installation is not behaving as expected, " + "try using --config-settings editable_mode=compat. " + "Please consult the setuptools documentation for more information" + ), + gone_in="25.3", + issue=11457, + ) + if self.config_settings: + logger.warning( + "--config-settings ignored for legacy editable install of %s. " + "Consider upgrading to a version of setuptools " + "that supports PEP 660 (>= 64).", + self, + ) + install_editable_legacy( + global_options=global_options if global_options is not None else [], + prefix=prefix, + home=home, + use_user_site=use_user_site, + name=self.req.name, + setup_py_path=self.setup_py_path, + isolated=self.isolated, + build_env=self.build_env, + unpacked_source_directory=self.unpacked_source_directory, + ) + self.install_succeeded = True + return + + assert self.is_wheel + assert self.local_file_path + + install_wheel( + self.req.name, + self.local_file_path, + scheme=scheme, + req_description=str(self.req), + pycompile=pycompile, + warn_script_location=warn_script_location, + direct_url=self.download_info if self.is_direct else None, + requested=self.user_supplied, + ) + self.install_succeeded = True + + +def check_invalid_constraint_type(req: InstallRequirement) -> str: + # Check for unsupported forms + problem = "" + if not req.name: + problem = "Unnamed requirements are not allowed as constraints" + elif req.editable: + problem = "Editable requirements are not allowed as constraints" + elif req.extras: + problem = "Constraints cannot have extras" + + if problem: + deprecated( + reason=( + "Constraints are only allowed to take the form of a package " + "name and a version specifier. Other forms were originally " + "permitted as an accident of the implementation, but were " + "undocumented. The new implementation of the resolver no " + "longer supports these forms." + ), + replacement="replacing the constraint with a requirement", + # No plan yet for when the new resolver becomes default + gone_in=None, + issue=8210, + ) + + return problem + + +def _has_option(options: Values, reqs: list[InstallRequirement], option: str) -> bool: + if getattr(options, option, None): + return True + for req in reqs: + if getattr(req, option, None): + return True + return False + + +def check_legacy_setup_py_options( + options: Values, + reqs: list[InstallRequirement], +) -> None: + has_build_options = _has_option(options, reqs, "build_options") + has_global_options = _has_option(options, reqs, "global_options") + if has_build_options or has_global_options: + deprecated( + reason="--build-option and --global-option are deprecated.", + issue=11859, + replacement="to use --config-settings", + gone_in="25.3", + ) + logger.warning( + "Implying --no-binary=:all: due to the presence of " + "--build-option / --global-option. " + ) + options.format_control.disallow_binaries() diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/req/req_set.py b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/req/req_set.py new file mode 100644 index 0000000000000000000000000000000000000000..3451b24f27bb32da69c178dc8a36723d7de0fa93 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/req/req_set.py @@ -0,0 +1,81 @@ +import logging +from collections import OrderedDict + +from pip._vendor.packaging.utils import canonicalize_name + +from pip._internal.req.req_install import InstallRequirement + +logger = logging.getLogger(__name__) + + +class RequirementSet: + def __init__(self, check_supported_wheels: bool = True) -> None: + """Create a RequirementSet.""" + + self.requirements: dict[str, InstallRequirement] = OrderedDict() + self.check_supported_wheels = check_supported_wheels + + self.unnamed_requirements: list[InstallRequirement] = [] + + def __str__(self) -> str: + requirements = sorted( + (req for req in self.requirements.values() if not req.comes_from), + key=lambda req: canonicalize_name(req.name or ""), + ) + return " ".join(str(req.req) for req in requirements) + + def __repr__(self) -> str: + requirements = sorted( + self.requirements.values(), + key=lambda req: canonicalize_name(req.name or ""), + ) + + format_string = "<{classname} object; {count} requirement(s): {reqs}>" + return format_string.format( + classname=self.__class__.__name__, + count=len(requirements), + reqs=", ".join(str(req.req) for req in requirements), + ) + + def add_unnamed_requirement(self, install_req: InstallRequirement) -> None: + assert not install_req.name + self.unnamed_requirements.append(install_req) + + def add_named_requirement(self, install_req: InstallRequirement) -> None: + assert install_req.name + + project_name = canonicalize_name(install_req.name) + self.requirements[project_name] = install_req + + def has_requirement(self, name: str) -> bool: + project_name = canonicalize_name(name) + + return ( + project_name in self.requirements + and not self.requirements[project_name].constraint + ) + + def get_requirement(self, name: str) -> InstallRequirement: + project_name = canonicalize_name(name) + + if project_name in self.requirements: + return self.requirements[project_name] + + raise KeyError(f"No project with the name {name!r}") + + @property + def all_requirements(self) -> list[InstallRequirement]: + return self.unnamed_requirements + list(self.requirements.values()) + + @property + def requirements_to_install(self) -> list[InstallRequirement]: + """Return the list of requirements that need to be installed. + + TODO remove this property together with the legacy resolver, since the new + resolver only returns requirements that need to be installed. + """ + return [ + install_req + for install_req in self.all_requirements + if not install_req.constraint and not install_req.satisfied_by + ] diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/req/req_uninstall.py b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/req/req_uninstall.py new file mode 100644 index 0000000000000000000000000000000000000000..3f3dde2fdd943549642edf5d2e935b369023397c --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/req/req_uninstall.py @@ -0,0 +1,639 @@ +from __future__ import annotations + +import functools +import os +import sys +import sysconfig +from collections.abc import Generator, Iterable +from importlib.util import cache_from_source +from typing import Any, Callable + +from pip._internal.exceptions import LegacyDistutilsInstall, UninstallMissingRecord +from pip._internal.locations import get_bin_prefix, get_bin_user +from pip._internal.metadata import BaseDistribution +from pip._internal.utils.compat import WINDOWS +from pip._internal.utils.egg_link import egg_link_path_from_location +from pip._internal.utils.logging import getLogger, indent_log +from pip._internal.utils.misc import ask, normalize_path, renames, rmtree +from pip._internal.utils.temp_dir import AdjacentTempDirectory, TempDirectory +from pip._internal.utils.virtualenv import running_under_virtualenv + +logger = getLogger(__name__) + + +def _script_names( + bin_dir: str, script_name: str, is_gui: bool +) -> Generator[str, None, None]: + """Create the fully qualified name of the files created by + {console,gui}_scripts for the given ``dist``. + Returns the list of file names + """ + exe_name = os.path.join(bin_dir, script_name) + yield exe_name + if not WINDOWS: + return + yield f"{exe_name}.exe" + yield f"{exe_name}.exe.manifest" + if is_gui: + yield f"{exe_name}-script.pyw" + else: + yield f"{exe_name}-script.py" + + +def _unique( + fn: Callable[..., Generator[Any, None, None]], +) -> Callable[..., Generator[Any, None, None]]: + @functools.wraps(fn) + def unique(*args: Any, **kw: Any) -> Generator[Any, None, None]: + seen: set[Any] = set() + for item in fn(*args, **kw): + if item not in seen: + seen.add(item) + yield item + + return unique + + +@_unique +def uninstallation_paths(dist: BaseDistribution) -> Generator[str, None, None]: + """ + Yield all the uninstallation paths for dist based on RECORD-without-.py[co] + + Yield paths to all the files in RECORD. For each .py file in RECORD, add + the .pyc and .pyo in the same directory. + + UninstallPathSet.add() takes care of the __pycache__ .py[co]. + + If RECORD is not found, raises an error, + with possible information from the INSTALLER file. + + https://packaging.python.org/specifications/recording-installed-packages/ + """ + location = dist.location + assert location is not None, "not installed" + + entries = dist.iter_declared_entries() + if entries is None: + raise UninstallMissingRecord(distribution=dist) + + for entry in entries: + path = os.path.join(location, entry) + yield path + if path.endswith(".py"): + dn, fn = os.path.split(path) + base = fn[:-3] + path = os.path.join(dn, base + ".pyc") + yield path + path = os.path.join(dn, base + ".pyo") + yield path + + +def compact(paths: Iterable[str]) -> set[str]: + """Compact a path set to contain the minimal number of paths + necessary to contain all paths in the set. If /a/path/ and + /a/path/to/a/file.txt are both in the set, leave only the + shorter path.""" + + sep = os.path.sep + short_paths: set[str] = set() + for path in sorted(paths, key=len): + should_skip = any( + path.startswith(shortpath.rstrip("*")) + and path[len(shortpath.rstrip("*").rstrip(sep))] == sep + for shortpath in short_paths + ) + if not should_skip: + short_paths.add(path) + return short_paths + + +def compress_for_rename(paths: Iterable[str]) -> set[str]: + """Returns a set containing the paths that need to be renamed. + + This set may include directories when the original sequence of paths + included every file on disk. + """ + case_map = {os.path.normcase(p): p for p in paths} + remaining = set(case_map) + unchecked = sorted({os.path.split(p)[0] for p in case_map.values()}, key=len) + wildcards: set[str] = set() + + def norm_join(*a: str) -> str: + return os.path.normcase(os.path.join(*a)) + + for root in unchecked: + if any(os.path.normcase(root).startswith(w) for w in wildcards): + # This directory has already been handled. + continue + + all_files: set[str] = set() + all_subdirs: set[str] = set() + for dirname, subdirs, files in os.walk(root): + all_subdirs.update(norm_join(root, dirname, d) for d in subdirs) + all_files.update(norm_join(root, dirname, f) for f in files) + # If all the files we found are in our remaining set of files to + # remove, then remove them from the latter set and add a wildcard + # for the directory. + if not (all_files - remaining): + remaining.difference_update(all_files) + wildcards.add(root + os.sep) + + return set(map(case_map.__getitem__, remaining)) | wildcards + + +def compress_for_output_listing(paths: Iterable[str]) -> tuple[set[str], set[str]]: + """Returns a tuple of 2 sets of which paths to display to user + + The first set contains paths that would be deleted. Files of a package + are not added and the top-level directory of the package has a '*' added + at the end - to signify that all it's contents are removed. + + The second set contains files that would have been skipped in the above + folders. + """ + + will_remove = set(paths) + will_skip = set() + + # Determine folders and files + folders = set() + files = set() + for path in will_remove: + if path.endswith(".pyc"): + continue + if path.endswith("__init__.py") or ".dist-info" in path: + folders.add(os.path.dirname(path)) + files.add(path) + + _normcased_files = set(map(os.path.normcase, files)) + + folders = compact(folders) + + # This walks the tree using os.walk to not miss extra folders + # that might get added. + for folder in folders: + for dirpath, _, dirfiles in os.walk(folder): + for fname in dirfiles: + if fname.endswith(".pyc"): + continue + + file_ = os.path.join(dirpath, fname) + if ( + os.path.isfile(file_) + and os.path.normcase(file_) not in _normcased_files + ): + # We are skipping this file. Add it to the set. + will_skip.add(file_) + + will_remove = files | {os.path.join(folder, "*") for folder in folders} + + return will_remove, will_skip + + +class StashedUninstallPathSet: + """A set of file rename operations to stash files while + tentatively uninstalling them.""" + + def __init__(self) -> None: + # Mapping from source file root to [Adjacent]TempDirectory + # for files under that directory. + self._save_dirs: dict[str, TempDirectory] = {} + # (old path, new path) tuples for each move that may need + # to be undone. + self._moves: list[tuple[str, str]] = [] + + def _get_directory_stash(self, path: str) -> str: + """Stashes a directory. + + Directories are stashed adjacent to their original location if + possible, or else moved/copied into the user's temp dir.""" + + try: + save_dir: TempDirectory = AdjacentTempDirectory(path) + except OSError: + save_dir = TempDirectory(kind="uninstall") + self._save_dirs[os.path.normcase(path)] = save_dir + + return save_dir.path + + def _get_file_stash(self, path: str) -> str: + """Stashes a file. + + If no root has been provided, one will be created for the directory + in the user's temp directory.""" + path = os.path.normcase(path) + head, old_head = os.path.dirname(path), None + save_dir = None + + while head != old_head: + try: + save_dir = self._save_dirs[head] + break + except KeyError: + pass + head, old_head = os.path.dirname(head), head + else: + # Did not find any suitable root + head = os.path.dirname(path) + save_dir = TempDirectory(kind="uninstall") + self._save_dirs[head] = save_dir + + relpath = os.path.relpath(path, head) + if relpath and relpath != os.path.curdir: + return os.path.join(save_dir.path, relpath) + return save_dir.path + + def stash(self, path: str) -> str: + """Stashes the directory or file and returns its new location. + Handle symlinks as files to avoid modifying the symlink targets. + """ + path_is_dir = os.path.isdir(path) and not os.path.islink(path) + if path_is_dir: + new_path = self._get_directory_stash(path) + else: + new_path = self._get_file_stash(path) + + self._moves.append((path, new_path)) + if path_is_dir and os.path.isdir(new_path): + # If we're moving a directory, we need to + # remove the destination first or else it will be + # moved to inside the existing directory. + # We just created new_path ourselves, so it will + # be removable. + os.rmdir(new_path) + renames(path, new_path) + return new_path + + def commit(self) -> None: + """Commits the uninstall by removing stashed files.""" + for save_dir in self._save_dirs.values(): + save_dir.cleanup() + self._moves = [] + self._save_dirs = {} + + def rollback(self) -> None: + """Undoes the uninstall by moving stashed files back.""" + for p in self._moves: + logger.info("Moving to %s\n from %s", *p) + + for new_path, path in self._moves: + try: + logger.debug("Replacing %s from %s", new_path, path) + if os.path.isfile(new_path) or os.path.islink(new_path): + os.unlink(new_path) + elif os.path.isdir(new_path): + rmtree(new_path) + renames(path, new_path) + except OSError as ex: + logger.error("Failed to restore %s", new_path) + logger.debug("Exception: %s", ex) + + self.commit() + + @property + def can_rollback(self) -> bool: + return bool(self._moves) + + +class UninstallPathSet: + """A set of file paths to be removed in the uninstallation of a + requirement.""" + + def __init__(self, dist: BaseDistribution) -> None: + self._paths: set[str] = set() + self._refuse: set[str] = set() + self._pth: dict[str, UninstallPthEntries] = {} + self._dist = dist + self._moved_paths = StashedUninstallPathSet() + # Create local cache of normalize_path results. Creating an UninstallPathSet + # can result in hundreds/thousands of redundant calls to normalize_path with + # the same args, which hurts performance. + self._normalize_path_cached = functools.lru_cache(normalize_path) + + def _permitted(self, path: str) -> bool: + """ + Return True if the given path is one we are permitted to + remove/modify, False otherwise. + + """ + # aka is_local, but caching normalized sys.prefix + if not running_under_virtualenv(): + return True + return path.startswith(self._normalize_path_cached(sys.prefix)) + + def add(self, path: str) -> None: + head, tail = os.path.split(path) + + # we normalize the head to resolve parent directory symlinks, but not + # the tail, since we only want to uninstall symlinks, not their targets + path = os.path.join(self._normalize_path_cached(head), os.path.normcase(tail)) + + if not os.path.exists(path): + return + if self._permitted(path): + self._paths.add(path) + else: + self._refuse.add(path) + + # __pycache__ files can show up after 'installed-files.txt' is created, + # due to imports + if os.path.splitext(path)[1] == ".py": + self.add(cache_from_source(path)) + + def add_pth(self, pth_file: str, entry: str) -> None: + pth_file = self._normalize_path_cached(pth_file) + if self._permitted(pth_file): + if pth_file not in self._pth: + self._pth[pth_file] = UninstallPthEntries(pth_file) + self._pth[pth_file].add(entry) + else: + self._refuse.add(pth_file) + + def remove(self, auto_confirm: bool = False, verbose: bool = False) -> None: + """Remove paths in ``self._paths`` with confirmation (unless + ``auto_confirm`` is True).""" + + if not self._paths: + logger.info( + "Can't uninstall '%s'. No files were found to uninstall.", + self._dist.raw_name, + ) + return + + dist_name_version = f"{self._dist.raw_name}-{self._dist.raw_version}" + logger.info("Uninstalling %s:", dist_name_version) + + with indent_log(): + if auto_confirm or self._allowed_to_proceed(verbose): + moved = self._moved_paths + + for_rename = compress_for_rename(self._paths) + + for path in sorted(compact(for_rename)): + moved.stash(path) + logger.verbose("Removing file or directory %s", path) + + for pth in self._pth.values(): + pth.remove() + + logger.info("Successfully uninstalled %s", dist_name_version) + + def _allowed_to_proceed(self, verbose: bool) -> bool: + """Display which files would be deleted and prompt for confirmation""" + + def _display(msg: str, paths: Iterable[str]) -> None: + if not paths: + return + + logger.info(msg) + with indent_log(): + for path in sorted(compact(paths)): + logger.info(path) + + if not verbose: + will_remove, will_skip = compress_for_output_listing(self._paths) + else: + # In verbose mode, display all the files that are going to be + # deleted. + will_remove = set(self._paths) + will_skip = set() + + _display("Would remove:", will_remove) + _display("Would not remove (might be manually added):", will_skip) + _display("Would not remove (outside of prefix):", self._refuse) + if verbose: + _display("Will actually move:", compress_for_rename(self._paths)) + + return ask("Proceed (Y/n)? ", ("y", "n", "")) != "n" + + def rollback(self) -> None: + """Rollback the changes previously made by remove().""" + if not self._moved_paths.can_rollback: + logger.error( + "Can't roll back %s; was not uninstalled", + self._dist.raw_name, + ) + return + logger.info("Rolling back uninstall of %s", self._dist.raw_name) + self._moved_paths.rollback() + for pth in self._pth.values(): + pth.rollback() + + def commit(self) -> None: + """Remove temporary save dir: rollback will no longer be possible.""" + self._moved_paths.commit() + + @classmethod + def from_dist(cls, dist: BaseDistribution) -> UninstallPathSet: + dist_location = dist.location + info_location = dist.info_location + if dist_location is None: + logger.info( + "Not uninstalling %s since it is not installed", + dist.canonical_name, + ) + return cls(dist) + + normalized_dist_location = normalize_path(dist_location) + if not dist.local: + logger.info( + "Not uninstalling %s at %s, outside environment %s", + dist.canonical_name, + normalized_dist_location, + sys.prefix, + ) + return cls(dist) + + if normalized_dist_location in { + p + for p in {sysconfig.get_path("stdlib"), sysconfig.get_path("platstdlib")} + if p + }: + logger.info( + "Not uninstalling %s at %s, as it is in the standard library.", + dist.canonical_name, + normalized_dist_location, + ) + return cls(dist) + + paths_to_remove = cls(dist) + develop_egg_link = egg_link_path_from_location(dist.raw_name) + + # Distribution is installed with metadata in a "flat" .egg-info + # directory. This means it is not a modern .dist-info installation, an + # egg, or legacy editable. + setuptools_flat_installation = ( + dist.installed_with_setuptools_egg_info + and info_location is not None + and os.path.exists(info_location) + # If dist is editable and the location points to a ``.egg-info``, + # we are in fact in the legacy editable case. + and not info_location.endswith(f"{dist.setuptools_filename}.egg-info") + ) + + # Uninstall cases order do matter as in the case of 2 installs of the + # same package, pip needs to uninstall the currently detected version + if setuptools_flat_installation: + if info_location is not None: + paths_to_remove.add(info_location) + installed_files = dist.iter_declared_entries() + if installed_files is not None: + for installed_file in installed_files: + paths_to_remove.add(os.path.join(dist_location, installed_file)) + # FIXME: need a test for this elif block + # occurs with --single-version-externally-managed/--record outside + # of pip + elif dist.is_file("top_level.txt"): + try: + namespace_packages = dist.read_text("namespace_packages.txt") + except FileNotFoundError: + namespaces = [] + else: + namespaces = namespace_packages.splitlines(keepends=False) + for top_level_pkg in [ + p + for p in dist.read_text("top_level.txt").splitlines() + if p and p not in namespaces + ]: + path = os.path.join(dist_location, top_level_pkg) + paths_to_remove.add(path) + paths_to_remove.add(f"{path}.py") + paths_to_remove.add(f"{path}.pyc") + paths_to_remove.add(f"{path}.pyo") + + elif dist.installed_by_distutils: + raise LegacyDistutilsInstall(distribution=dist) + + elif dist.installed_as_egg: + # package installed by easy_install + # We cannot match on dist.egg_name because it can slightly vary + # i.e. setuptools-0.6c11-py2.6.egg vs setuptools-0.6rc11-py2.6.egg + # XXX We use normalized_dist_location because dist_location my contain + # a trailing / if the distribution is a zipped egg + # (which is not a directory). + paths_to_remove.add(normalized_dist_location) + easy_install_egg = os.path.split(normalized_dist_location)[1] + easy_install_pth = os.path.join( + os.path.dirname(normalized_dist_location), + "easy-install.pth", + ) + paths_to_remove.add_pth(easy_install_pth, "./" + easy_install_egg) + + elif dist.installed_with_dist_info: + for path in uninstallation_paths(dist): + paths_to_remove.add(path) + + elif develop_egg_link: + # PEP 660 modern editable is handled in the ``.dist-info`` case + # above, so this only covers the setuptools-style editable. + with open(develop_egg_link) as fh: + link_pointer = os.path.normcase(fh.readline().strip()) + normalized_link_pointer = paths_to_remove._normalize_path_cached( + link_pointer + ) + assert os.path.samefile( + normalized_link_pointer, normalized_dist_location + ), ( + f"Egg-link {develop_egg_link} (to {link_pointer}) does not match " + f"installed location of {dist.raw_name} (at {dist_location})" + ) + paths_to_remove.add(develop_egg_link) + easy_install_pth = os.path.join( + os.path.dirname(develop_egg_link), "easy-install.pth" + ) + paths_to_remove.add_pth(easy_install_pth, dist_location) + + else: + logger.debug( + "Not sure how to uninstall: %s - Check: %s", + dist, + dist_location, + ) + + if dist.in_usersite: + bin_dir = get_bin_user() + else: + bin_dir = get_bin_prefix() + + # find distutils scripts= scripts + try: + for script in dist.iter_distutils_script_names(): + paths_to_remove.add(os.path.join(bin_dir, script)) + if WINDOWS: + paths_to_remove.add(os.path.join(bin_dir, f"{script}.bat")) + except (FileNotFoundError, NotADirectoryError): + pass + + # find console_scripts and gui_scripts + def iter_scripts_to_remove( + dist: BaseDistribution, + bin_dir: str, + ) -> Generator[str, None, None]: + for entry_point in dist.iter_entry_points(): + if entry_point.group == "console_scripts": + yield from _script_names(bin_dir, entry_point.name, False) + elif entry_point.group == "gui_scripts": + yield from _script_names(bin_dir, entry_point.name, True) + + for s in iter_scripts_to_remove(dist, bin_dir): + paths_to_remove.add(s) + + return paths_to_remove + + +class UninstallPthEntries: + def __init__(self, pth_file: str) -> None: + self.file = pth_file + self.entries: set[str] = set() + self._saved_lines: list[bytes] | None = None + + def add(self, entry: str) -> None: + entry = os.path.normcase(entry) + # On Windows, os.path.normcase converts the entry to use + # backslashes. This is correct for entries that describe absolute + # paths outside of site-packages, but all the others use forward + # slashes. + # os.path.splitdrive is used instead of os.path.isabs because isabs + # treats non-absolute paths with drive letter markings like c:foo\bar + # as absolute paths. It also does not recognize UNC paths if they don't + # have more than "\\sever\share". Valid examples: "\\server\share\" or + # "\\server\share\folder". + if WINDOWS and not os.path.splitdrive(entry)[0]: + entry = entry.replace("\\", "/") + self.entries.add(entry) + + def remove(self) -> None: + logger.verbose("Removing pth entries from %s:", self.file) + + # If the file doesn't exist, log a warning and return + if not os.path.isfile(self.file): + logger.warning("Cannot remove entries from nonexistent file %s", self.file) + return + with open(self.file, "rb") as fh: + # windows uses '\r\n' with py3k, but uses '\n' with py2.x + lines = fh.readlines() + self._saved_lines = lines + if any(b"\r\n" in line for line in lines): + endline = "\r\n" + else: + endline = "\n" + # handle missing trailing newline + if lines and not lines[-1].endswith(endline.encode("utf-8")): + lines[-1] = lines[-1] + endline.encode("utf-8") + for entry in self.entries: + try: + logger.verbose("Removing entry: %s", entry) + lines.remove((entry + endline).encode("utf-8")) + except ValueError: + pass + with open(self.file, "wb") as fh: + fh.writelines(lines) + + def rollback(self) -> bool: + if self._saved_lines is None: + logger.error("Cannot roll back changes to %s, none were made", self.file) + return False + logger.debug("Rolling %s back to previous state", self.file) + with open(self.file, "wb") as fh: + fh.writelines(self._saved_lines) + return True diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/resolution/__init__.py b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/resolution/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/resolution/base.py b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/resolution/base.py new file mode 100644 index 0000000000000000000000000000000000000000..5ec4d96aa78d2327364fe97efcbe391bcd71bffc --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/resolution/base.py @@ -0,0 +1,20 @@ +from typing import Callable, Optional + +from pip._internal.req.req_install import InstallRequirement +from pip._internal.req.req_set import RequirementSet + +InstallRequirementProvider = Callable[ + [str, Optional[InstallRequirement]], InstallRequirement +] + + +class BaseResolver: + def resolve( + self, root_reqs: list[InstallRequirement], check_supported_wheels: bool + ) -> RequirementSet: + raise NotImplementedError() + + def get_installation_order( + self, req_set: RequirementSet + ) -> list[InstallRequirement]: + raise NotImplementedError() diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/utils/__init__.py b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/utils/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/utils/_jaraco_text.py b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/utils/_jaraco_text.py new file mode 100644 index 0000000000000000000000000000000000000000..6ccf53b7ac5d415b8526e75ccabe31cf994ac7da --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/utils/_jaraco_text.py @@ -0,0 +1,109 @@ +"""Functions brought over from jaraco.text. + +These functions are not supposed to be used within `pip._internal`. These are +helper functions brought over from `jaraco.text` to enable vendoring newer +copies of `pkg_resources` without having to vendor `jaraco.text` and its entire +dependency cone; something that our vendoring setup is not currently capable of +handling. + +License reproduced from original source below: + +Copyright Jason R. Coombs + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to +deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +IN THE SOFTWARE. +""" + +import functools +import itertools + + +def _nonblank(str): + return str and not str.startswith("#") + + +@functools.singledispatch +def yield_lines(iterable): + r""" + Yield valid lines of a string or iterable. + + >>> list(yield_lines('')) + [] + >>> list(yield_lines(['foo', 'bar'])) + ['foo', 'bar'] + >>> list(yield_lines('foo\nbar')) + ['foo', 'bar'] + >>> list(yield_lines('\nfoo\n#bar\nbaz #comment')) + ['foo', 'baz #comment'] + >>> list(yield_lines(['foo\nbar', 'baz', 'bing\n\n\n'])) + ['foo', 'bar', 'baz', 'bing'] + """ + return itertools.chain.from_iterable(map(yield_lines, iterable)) + + +@yield_lines.register(str) +def _(text): + return filter(_nonblank, map(str.strip, text.splitlines())) + + +def drop_comment(line): + """ + Drop comments. + + >>> drop_comment('foo # bar') + 'foo' + + A hash without a space may be in a URL. + + >>> drop_comment('http://example.com/foo#bar') + 'http://example.com/foo#bar' + """ + return line.partition(" #")[0] + + +def join_continuation(lines): + r""" + Join lines continued by a trailing backslash. + + >>> list(join_continuation(['foo \\', 'bar', 'baz'])) + ['foobar', 'baz'] + >>> list(join_continuation(['foo \\', 'bar', 'baz'])) + ['foobar', 'baz'] + >>> list(join_continuation(['foo \\', 'bar \\', 'baz'])) + ['foobarbaz'] + + Not sure why, but... + The character preceding the backslash is also elided. + + >>> list(join_continuation(['goo\\', 'dly'])) + ['godly'] + + A terrible idea, but... + If no line is available to continue, suppress the lines. + + >>> list(join_continuation(['foo', 'bar\\', 'baz\\'])) + ['foo'] + """ + lines = iter(lines) + for item in lines: + while item.endswith("\\"): + try: + item = item[:-2].strip() + next(lines) + except StopIteration: + return + yield item diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/utils/_log.py b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/utils/_log.py new file mode 100644 index 0000000000000000000000000000000000000000..92c4c6a193873ce09629f6cfaa2dabc4f14ecb03 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/utils/_log.py @@ -0,0 +1,38 @@ +"""Customize logging + +Defines custom logger class for the `logger.verbose(...)` method. + +init_logging() must be called before any other modules that call logging.getLogger. +""" + +import logging +from typing import Any, cast + +# custom log level for `--verbose` output +# between DEBUG and INFO +VERBOSE = 15 + + +class VerboseLogger(logging.Logger): + """Custom Logger, defining a verbose log-level + + VERBOSE is between INFO and DEBUG. + """ + + def verbose(self, msg: str, *args: Any, **kwargs: Any) -> None: + return self.log(VERBOSE, msg, *args, **kwargs) + + +def getLogger(name: str) -> VerboseLogger: + """logging.getLogger, but ensures our VerboseLogger class is returned""" + return cast(VerboseLogger, logging.getLogger(name)) + + +def init_logging() -> None: + """Register our VerboseLogger and VERBOSE log level. + + Should be called before any calls to getLogger(), + i.e. in pip._internal.__init__ + """ + logging.setLoggerClass(VerboseLogger) + logging.addLevelName(VERBOSE, "VERBOSE") diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/utils/appdirs.py b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/utils/appdirs.py new file mode 100644 index 0000000000000000000000000000000000000000..4152528f68c6c2e3e26d866a66832f1ac6c544cd --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/utils/appdirs.py @@ -0,0 +1,52 @@ +""" +This code wraps the vendored appdirs module to so the return values are +compatible for the current pip code base. + +The intention is to rewrite current usages gradually, keeping the tests pass, +and eventually drop this after all usages are changed. +""" + +import os +import sys + +from pip._vendor import platformdirs as _appdirs + + +def user_cache_dir(appname: str) -> str: + return _appdirs.user_cache_dir(appname, appauthor=False) + + +def _macos_user_config_dir(appname: str, roaming: bool = True) -> str: + # Use ~/Application Support/pip, if the directory exists. + path = _appdirs.user_data_dir(appname, appauthor=False, roaming=roaming) + if os.path.isdir(path): + return path + + # Use a Linux-like ~/.config/pip, by default. + linux_like_path = "~/.config/" + if appname: + linux_like_path = os.path.join(linux_like_path, appname) + + return os.path.expanduser(linux_like_path) + + +def user_config_dir(appname: str, roaming: bool = True) -> str: + if sys.platform == "darwin": + return _macos_user_config_dir(appname, roaming) + + return _appdirs.user_config_dir(appname, appauthor=False, roaming=roaming) + + +# for the discussion regarding site_config_dir locations +# see +def site_config_dirs(appname: str) -> list[str]: + if sys.platform == "darwin": + dirval = _appdirs.site_data_dir(appname, appauthor=False, multipath=True) + return dirval.split(os.pathsep) + + dirval = _appdirs.site_config_dir(appname, appauthor=False, multipath=True) + if sys.platform == "win32": + return [dirval] + + # Unix-y system. Look in /etc as well. + return dirval.split(os.pathsep) + ["/etc"] diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/utils/compat.py b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/utils/compat.py new file mode 100644 index 0000000000000000000000000000000000000000..324789f1d2e303230ea257de4df243c736262b1b --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/utils/compat.py @@ -0,0 +1,85 @@ +"""Stuff that differs in different Python versions and platform +distributions.""" + +import importlib.resources +import logging +import os +import sys +from typing import IO + +__all__ = ["get_path_uid", "stdlib_pkgs", "tomllib", "WINDOWS"] + + +logger = logging.getLogger(__name__) + + +def has_tls() -> bool: + try: + import _ssl # noqa: F401 # ignore unused + + return True + except ImportError: + pass + + from pip._vendor.urllib3.util import IS_PYOPENSSL + + return IS_PYOPENSSL + + +def get_path_uid(path: str) -> int: + """ + Return path's uid. + + Does not follow symlinks: + https://github.com/pypa/pip/pull/935#discussion_r5307003 + + Placed this function in compat due to differences on AIX and + Jython, that should eventually go away. + + :raises OSError: When path is a symlink or can't be read. + """ + if hasattr(os, "O_NOFOLLOW"): + fd = os.open(path, os.O_RDONLY | os.O_NOFOLLOW) + file_uid = os.fstat(fd).st_uid + os.close(fd) + else: # AIX and Jython + # WARNING: time of check vulnerability, but best we can do w/o NOFOLLOW + if not os.path.islink(path): + # older versions of Jython don't have `os.fstat` + file_uid = os.stat(path).st_uid + else: + # raise OSError for parity with os.O_NOFOLLOW above + raise OSError(f"{path} is a symlink; Will not return uid for symlinks") + return file_uid + + +# The importlib.resources.open_text function was deprecated in 3.11 with suggested +# replacement we use below. +if sys.version_info < (3, 11): + open_text_resource = importlib.resources.open_text +else: + + def open_text_resource( + package: str, resource: str, encoding: str = "utf-8", errors: str = "strict" + ) -> IO[str]: + return (importlib.resources.files(package) / resource).open( + "r", encoding=encoding, errors=errors + ) + + +if sys.version_info >= (3, 11): + import tomllib +else: + from pip._vendor import tomli as tomllib + + +# packages in the stdlib that may have installation metadata, but should not be +# considered 'installed'. this theoretically could be determined based on +# dist.location (py27:`sysconfig.get_paths()['stdlib']`, +# py26:sysconfig.get_config_vars('LIBDEST')), but fear platform variation may +# make this ineffective, so hard-coding +stdlib_pkgs = {"python", "wsgiref", "argparse"} + + +# windows detection, covers cpython and ironpython +WINDOWS = sys.platform.startswith("win") or (sys.platform == "cli" and os.name == "nt") diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/utils/compatibility_tags.py b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/utils/compatibility_tags.py new file mode 100644 index 0000000000000000000000000000000000000000..6d98171daf9e3a05a542a56e8439c24ff4746cf5 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/utils/compatibility_tags.py @@ -0,0 +1,201 @@ +"""Generate and work with PEP 425 Compatibility Tags.""" + +from __future__ import annotations + +import re + +from pip._vendor.packaging.tags import ( + PythonVersion, + Tag, + android_platforms, + compatible_tags, + cpython_tags, + generic_tags, + interpreter_name, + interpreter_version, + ios_platforms, + mac_platforms, +) + +_apple_arch_pat = re.compile(r"(.+)_(\d+)_(\d+)_(.+)") + + +def version_info_to_nodot(version_info: tuple[int, ...]) -> str: + # Only use up to the first two numbers. + return "".join(map(str, version_info[:2])) + + +def _mac_platforms(arch: str) -> list[str]: + match = _apple_arch_pat.match(arch) + if match: + name, major, minor, actual_arch = match.groups() + mac_version = (int(major), int(minor)) + arches = [ + # Since we have always only checked that the platform starts + # with "macosx", for backwards-compatibility we extract the + # actual prefix provided by the user in case they provided + # something like "macosxcustom_". It may be good to remove + # this as undocumented or deprecate it in the future. + "{}_{}".format(name, arch[len("macosx_") :]) + for arch in mac_platforms(mac_version, actual_arch) + ] + else: + # arch pattern didn't match (?!) + arches = [arch] + return arches + + +def _ios_platforms(arch: str) -> list[str]: + match = _apple_arch_pat.match(arch) + if match: + name, major, minor, actual_multiarch = match.groups() + ios_version = (int(major), int(minor)) + arches = [ + # Since we have always only checked that the platform starts + # with "ios", for backwards-compatibility we extract the + # actual prefix provided by the user in case they provided + # something like "ioscustom_". It may be good to remove + # this as undocumented or deprecate it in the future. + "{}_{}".format(name, arch[len("ios_") :]) + for arch in ios_platforms(ios_version, actual_multiarch) + ] + else: + # arch pattern didn't match (?!) + arches = [arch] + return arches + + +def _android_platforms(arch: str) -> list[str]: + match = re.fullmatch(r"android_(\d+)_(.+)", arch) + if match: + api_level, abi = match.groups() + return list(android_platforms(int(api_level), abi)) + else: + # arch pattern didn't match (?!) + return [arch] + + +def _custom_manylinux_platforms(arch: str) -> list[str]: + arches = [arch] + arch_prefix, arch_sep, arch_suffix = arch.partition("_") + if arch_prefix == "manylinux2014": + # manylinux1/manylinux2010 wheels run on most manylinux2014 systems + # with the exception of wheels depending on ncurses. PEP 599 states + # manylinux1/manylinux2010 wheels should be considered + # manylinux2014 wheels: + # https://www.python.org/dev/peps/pep-0599/#backwards-compatibility-with-manylinux2010-wheels + if arch_suffix in {"i686", "x86_64"}: + arches.append("manylinux2010" + arch_sep + arch_suffix) + arches.append("manylinux1" + arch_sep + arch_suffix) + elif arch_prefix == "manylinux2010": + # manylinux1 wheels run on most manylinux2010 systems with the + # exception of wheels depending on ncurses. PEP 571 states + # manylinux1 wheels should be considered manylinux2010 wheels: + # https://www.python.org/dev/peps/pep-0571/#backwards-compatibility-with-manylinux1-wheels + arches.append("manylinux1" + arch_sep + arch_suffix) + return arches + + +def _get_custom_platforms(arch: str) -> list[str]: + arch_prefix, arch_sep, arch_suffix = arch.partition("_") + if arch.startswith("macosx"): + arches = _mac_platforms(arch) + elif arch.startswith("ios"): + arches = _ios_platforms(arch) + elif arch_prefix == "android": + arches = _android_platforms(arch) + elif arch_prefix in ["manylinux2014", "manylinux2010"]: + arches = _custom_manylinux_platforms(arch) + else: + arches = [arch] + return arches + + +def _expand_allowed_platforms(platforms: list[str] | None) -> list[str] | None: + if not platforms: + return None + + seen = set() + result = [] + + for p in platforms: + if p in seen: + continue + additions = [c for c in _get_custom_platforms(p) if c not in seen] + seen.update(additions) + result.extend(additions) + + return result + + +def _get_python_version(version: str) -> PythonVersion: + if len(version) > 1: + return int(version[0]), int(version[1:]) + else: + return (int(version[0]),) + + +def _get_custom_interpreter( + implementation: str | None = None, version: str | None = None +) -> str: + if implementation is None: + implementation = interpreter_name() + if version is None: + version = interpreter_version() + return f"{implementation}{version}" + + +def get_supported( + version: str | None = None, + platforms: list[str] | None = None, + impl: str | None = None, + abis: list[str] | None = None, +) -> list[Tag]: + """Return a list of supported tags for each version specified in + `versions`. + + :param version: a string version, of the form "33" or "32", + or None. The version will be assumed to support our ABI. + :param platform: specify a list of platforms you want valid + tags for, or None. If None, use the local system platform. + :param impl: specify the exact implementation you want valid + tags for, or None. If None, use the local interpreter impl. + :param abis: specify a list of abis you want valid + tags for, or None. If None, use the local interpreter abi. + """ + supported: list[Tag] = [] + + python_version: PythonVersion | None = None + if version is not None: + python_version = _get_python_version(version) + + interpreter = _get_custom_interpreter(impl, version) + + platforms = _expand_allowed_platforms(platforms) + + is_cpython = (impl or interpreter_name()) == "cp" + if is_cpython: + supported.extend( + cpython_tags( + python_version=python_version, + abis=abis, + platforms=platforms, + ) + ) + else: + supported.extend( + generic_tags( + interpreter=interpreter, + abis=abis, + platforms=platforms, + ) + ) + supported.extend( + compatible_tags( + python_version=python_version, + interpreter=interpreter, + platforms=platforms, + ) + ) + + return supported diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/utils/datetime.py b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/utils/datetime.py new file mode 100644 index 0000000000000000000000000000000000000000..776e49898f72c38eebfe48a17681f87930d4fcbd --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/utils/datetime.py @@ -0,0 +1,10 @@ +"""For when pip wants to check the date or time.""" + +import datetime + + +def today_is_later_than(year: int, month: int, day: int) -> bool: + today = datetime.date.today() + given = datetime.date(year, month, day) + + return today > given diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/utils/deprecation.py b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/utils/deprecation.py new file mode 100644 index 0000000000000000000000000000000000000000..96e7783feb3f52a1371b22f327ce3309bfa8a13e --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/utils/deprecation.py @@ -0,0 +1,126 @@ +""" +A module that implements tooling to enable easy warnings about deprecations. +""" + +from __future__ import annotations + +import logging +import warnings +from typing import Any, TextIO + +from pip._vendor.packaging.version import parse + +from pip import __version__ as current_version # NOTE: tests patch this name. + +DEPRECATION_MSG_PREFIX = "DEPRECATION: " + + +class PipDeprecationWarning(Warning): + pass + + +_original_showwarning: Any = None + + +# Warnings <-> Logging Integration +def _showwarning( + message: Warning | str, + category: type[Warning], + filename: str, + lineno: int, + file: TextIO | None = None, + line: str | None = None, +) -> None: + if file is not None: + if _original_showwarning is not None: + _original_showwarning(message, category, filename, lineno, file, line) + elif issubclass(category, PipDeprecationWarning): + # We use a specially named logger which will handle all of the + # deprecation messages for pip. + logger = logging.getLogger("pip._internal.deprecations") + logger.warning(message) + else: + _original_showwarning(message, category, filename, lineno, file, line) + + +def install_warning_logger() -> None: + # Enable our Deprecation Warnings + warnings.simplefilter("default", PipDeprecationWarning, append=True) + + global _original_showwarning + + if _original_showwarning is None: + _original_showwarning = warnings.showwarning + warnings.showwarning = _showwarning + + +def deprecated( + *, + reason: str, + replacement: str | None, + gone_in: str | None, + feature_flag: str | None = None, + issue: int | None = None, +) -> None: + """Helper to deprecate existing functionality. + + reason: + Textual reason shown to the user about why this functionality has + been deprecated. Should be a complete sentence. + replacement: + Textual suggestion shown to the user about what alternative + functionality they can use. + gone_in: + The version of pip does this functionality should get removed in. + Raises an error if pip's current version is greater than or equal to + this. + feature_flag: + Command-line flag of the form --use-feature={feature_flag} for testing + upcoming functionality. + issue: + Issue number on the tracker that would serve as a useful place for + users to find related discussion and provide feedback. + """ + + # Determine whether or not the feature is already gone in this version. + is_gone = gone_in is not None and parse(current_version) >= parse(gone_in) + + message_parts = [ + (reason, f"{DEPRECATION_MSG_PREFIX}{{}}"), + ( + gone_in, + ( + "pip {} will enforce this behaviour change." + if not is_gone + else "Since pip {}, this is no longer supported." + ), + ), + ( + replacement, + "A possible replacement is {}.", + ), + ( + feature_flag, + ( + "You can use the flag --use-feature={} to test the upcoming behaviour." + if not is_gone + else None + ), + ), + ( + issue, + "Discussion can be found at https://github.com/pypa/pip/issues/{}", + ), + ] + + message = " ".join( + format_str.format(value) + for value, format_str in message_parts + if format_str is not None and value is not None + ) + + # Raise as an error if this behaviour is deprecated. + if is_gone: + raise PipDeprecationWarning(message) + + warnings.warn(message, category=PipDeprecationWarning, stacklevel=2) diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/utils/direct_url_helpers.py b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/utils/direct_url_helpers.py new file mode 100644 index 0000000000000000000000000000000000000000..3cbc1e76344e02a9c20edc0415430706a428df62 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/utils/direct_url_helpers.py @@ -0,0 +1,87 @@ +from __future__ import annotations + +from pip._internal.models.direct_url import ArchiveInfo, DirectUrl, DirInfo, VcsInfo +from pip._internal.models.link import Link +from pip._internal.utils.urls import path_to_url +from pip._internal.vcs import vcs + + +def direct_url_as_pep440_direct_reference(direct_url: DirectUrl, name: str) -> str: + """Convert a DirectUrl to a pip requirement string.""" + direct_url.validate() # if invalid, this is a pip bug + requirement = name + " @ " + fragments = [] + if isinstance(direct_url.info, VcsInfo): + requirement += ( + f"{direct_url.info.vcs}+{direct_url.url}@{direct_url.info.commit_id}" + ) + elif isinstance(direct_url.info, ArchiveInfo): + requirement += direct_url.url + if direct_url.info.hash: + fragments.append(direct_url.info.hash) + else: + assert isinstance(direct_url.info, DirInfo) + requirement += direct_url.url + if direct_url.subdirectory: + fragments.append("subdirectory=" + direct_url.subdirectory) + if fragments: + requirement += "#" + "&".join(fragments) + return requirement + + +def direct_url_for_editable(source_dir: str) -> DirectUrl: + return DirectUrl( + url=path_to_url(source_dir), + info=DirInfo(editable=True), + ) + + +def direct_url_from_link( + link: Link, source_dir: str | None = None, link_is_in_wheel_cache: bool = False +) -> DirectUrl: + if link.is_vcs: + vcs_backend = vcs.get_backend_for_scheme(link.scheme) + assert vcs_backend + url, requested_revision, _ = vcs_backend.get_url_rev_and_auth( + link.url_without_fragment + ) + # For VCS links, we need to find out and add commit_id. + if link_is_in_wheel_cache: + # If the requested VCS link corresponds to a cached + # wheel, it means the requested revision was an + # immutable commit hash, otherwise it would not have + # been cached. In that case we don't have a source_dir + # with the VCS checkout. + assert requested_revision + commit_id = requested_revision + else: + # If the wheel was not in cache, it means we have + # had to checkout from VCS to build and we have a source_dir + # which we can inspect to find out the commit id. + assert source_dir + commit_id = vcs_backend.get_revision(source_dir) + return DirectUrl( + url=url, + info=VcsInfo( + vcs=vcs_backend.name, + commit_id=commit_id, + requested_revision=requested_revision, + ), + subdirectory=link.subdirectory_fragment, + ) + elif link.is_existing_dir(): + return DirectUrl( + url=link.url_without_fragment, + info=DirInfo(), + subdirectory=link.subdirectory_fragment, + ) + else: + hash = None + hash_name = link.hash_name + if hash_name: + hash = f"{hash_name}={link.hash}" + return DirectUrl( + url=link.url_without_fragment, + info=ArchiveInfo(hash=hash), + subdirectory=link.subdirectory_fragment, + ) diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/utils/egg_link.py b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/utils/egg_link.py new file mode 100644 index 0000000000000000000000000000000000000000..dc85a58b32c5ae30cb432bfa0df58f5f9f5ae22d --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/utils/egg_link.py @@ -0,0 +1,81 @@ +from __future__ import annotations + +import os +import re +import sys + +from pip._internal.locations import site_packages, user_site +from pip._internal.utils.virtualenv import ( + running_under_virtualenv, + virtualenv_no_global, +) + +__all__ = [ + "egg_link_path_from_sys_path", + "egg_link_path_from_location", +] + + +def _egg_link_names(raw_name: str) -> list[str]: + """ + Convert a Name metadata value to a .egg-link name, by applying + the same substitution as pkg_resources's safe_name function. + Note: we cannot use canonicalize_name because it has a different logic. + + We also look for the raw name (without normalization) as setuptools 69 changed + the way it names .egg-link files (https://github.com/pypa/setuptools/issues/4167). + """ + return [ + re.sub("[^A-Za-z0-9.]+", "-", raw_name) + ".egg-link", + f"{raw_name}.egg-link", + ] + + +def egg_link_path_from_sys_path(raw_name: str) -> str | None: + """ + Look for a .egg-link file for project name, by walking sys.path. + """ + egg_link_names = _egg_link_names(raw_name) + for path_item in sys.path: + for egg_link_name in egg_link_names: + egg_link = os.path.join(path_item, egg_link_name) + if os.path.isfile(egg_link): + return egg_link + return None + + +def egg_link_path_from_location(raw_name: str) -> str | None: + """ + Return the path for the .egg-link file if it exists, otherwise, None. + + There's 3 scenarios: + 1) not in a virtualenv + try to find in site.USER_SITE, then site_packages + 2) in a no-global virtualenv + try to find in site_packages + 3) in a yes-global virtualenv + try to find in site_packages, then site.USER_SITE + (don't look in global location) + + For #1 and #3, there could be odd cases, where there's an egg-link in 2 + locations. + + This method will just return the first one found. + """ + sites: list[str] = [] + if running_under_virtualenv(): + sites.append(site_packages) + if not virtualenv_no_global() and user_site: + sites.append(user_site) + else: + if user_site: + sites.append(user_site) + sites.append(site_packages) + + egg_link_names = _egg_link_names(raw_name) + for site in sites: + for egg_link_name in egg_link_names: + egglink = os.path.join(site, egg_link_name) + if os.path.isfile(egglink): + return egglink + return None diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/utils/entrypoints.py b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/utils/entrypoints.py new file mode 100644 index 0000000000000000000000000000000000000000..e3a150eeba061f533a3f3f5be792a82ee853f569 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/utils/entrypoints.py @@ -0,0 +1,88 @@ +from __future__ import annotations + +import itertools +import os +import shutil +import sys + +from pip._internal.cli.main import main +from pip._internal.utils.compat import WINDOWS + +_EXECUTABLE_NAMES = [ + "pip", + f"pip{sys.version_info.major}", + f"pip{sys.version_info.major}.{sys.version_info.minor}", +] +if WINDOWS: + _allowed_extensions = {"", ".exe"} + _EXECUTABLE_NAMES = [ + "".join(parts) + for parts in itertools.product(_EXECUTABLE_NAMES, _allowed_extensions) + ] + + +def _wrapper(args: list[str] | None = None) -> int: + """Central wrapper for all old entrypoints. + + Historically pip has had several entrypoints defined. Because of issues + arising from PATH, sys.path, multiple Pythons, their interactions, and most + of them having a pip installed, users suffer every time an entrypoint gets + moved. + + To alleviate this pain, and provide a mechanism for warning users and + directing them to an appropriate place for help, we now define all of + our old entrypoints as wrappers for the current one. + """ + sys.stderr.write( + "WARNING: pip is being invoked by an old script wrapper. This will " + "fail in a future version of pip.\n" + "Please see https://github.com/pypa/pip/issues/5599 for advice on " + "fixing the underlying issue.\n" + "To avoid this problem you can invoke Python with '-m pip' instead of " + "running pip directly.\n" + ) + return main(args) + + +def get_best_invocation_for_this_pip() -> str: + """Try to figure out the best way to invoke pip in the current environment.""" + binary_directory = "Scripts" if WINDOWS else "bin" + binary_prefix = os.path.join(sys.prefix, binary_directory) + + # Try to use pip[X[.Y]] names, if those executables for this environment are + # the first on PATH with that name. + path_parts = os.path.normcase(os.environ.get("PATH", "")).split(os.pathsep) + exe_are_in_PATH = os.path.normcase(binary_prefix) in path_parts + if exe_are_in_PATH: + for exe_name in _EXECUTABLE_NAMES: + found_executable = shutil.which(exe_name) + binary_executable = os.path.join(binary_prefix, exe_name) + if ( + found_executable + and os.path.exists(binary_executable) + and os.path.samefile( + found_executable, + binary_executable, + ) + ): + return exe_name + + # Use the `-m` invocation, if there's no "nice" invocation. + return f"{get_best_invocation_for_this_python()} -m pip" + + +def get_best_invocation_for_this_python() -> str: + """Try to figure out the best way to invoke the current Python.""" + exe = sys.executable + exe_name = os.path.basename(exe) + + # Try to use the basename, if it's the first executable. + found_executable = shutil.which(exe_name) + # Virtual environments often symlink to their parent Python binaries, but we don't + # want to treat the Python binaries as equivalent when the environment's Python is + # not on PATH (not activated). Thus, we don't follow symlinks. + if found_executable and os.path.samestat(os.lstat(found_executable), os.lstat(exe)): + return exe_name + + # Use the full executable name, because we couldn't find something simpler. + return exe diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/utils/filesystem.py b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/utils/filesystem.py new file mode 100644 index 0000000000000000000000000000000000000000..d7c052438766181dddf438b2a2d1f22ad3c9cad2 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/utils/filesystem.py @@ -0,0 +1,152 @@ +from __future__ import annotations + +import fnmatch +import os +import os.path +import random +import sys +from collections.abc import Generator +from contextlib import contextmanager +from tempfile import NamedTemporaryFile +from typing import Any, BinaryIO, cast + +from pip._internal.utils.compat import get_path_uid +from pip._internal.utils.misc import format_size +from pip._internal.utils.retry import retry + + +def check_path_owner(path: str) -> bool: + # If we don't have a way to check the effective uid of this process, then + # we'll just assume that we own the directory. + if sys.platform == "win32" or not hasattr(os, "geteuid"): + return True + + assert os.path.isabs(path) + + previous = None + while path != previous: + if os.path.lexists(path): + # Check if path is writable by current user. + if os.geteuid() == 0: + # Special handling for root user in order to handle properly + # cases where users use sudo without -H flag. + try: + path_uid = get_path_uid(path) + except OSError: + return False + return path_uid == 0 + else: + return os.access(path, os.W_OK) + else: + previous, path = path, os.path.dirname(path) + return False # assume we don't own the path + + +@contextmanager +def adjacent_tmp_file(path: str, **kwargs: Any) -> Generator[BinaryIO, None, None]: + """Return a file-like object pointing to a tmp file next to path. + + The file is created securely and is ensured to be written to disk + after the context reaches its end. + + kwargs will be passed to tempfile.NamedTemporaryFile to control + the way the temporary file will be opened. + """ + with NamedTemporaryFile( + delete=False, + dir=os.path.dirname(path), + prefix=os.path.basename(path), + suffix=".tmp", + **kwargs, + ) as f: + result = cast(BinaryIO, f) + try: + yield result + finally: + result.flush() + os.fsync(result.fileno()) + + +replace = retry(stop_after_delay=1, wait=0.25)(os.replace) + + +# test_writable_dir and _test_writable_dir_win are copied from Flit, +# with the author's agreement to also place them under pip's license. +def test_writable_dir(path: str) -> bool: + """Check if a directory is writable. + + Uses os.access() on POSIX, tries creating files on Windows. + """ + # If the directory doesn't exist, find the closest parent that does. + while not os.path.isdir(path): + parent = os.path.dirname(path) + if parent == path: + break # Should never get here, but infinite loops are bad + path = parent + + if os.name == "posix": + return os.access(path, os.W_OK) + + return _test_writable_dir_win(path) + + +def _test_writable_dir_win(path: str) -> bool: + # os.access doesn't work on Windows: http://bugs.python.org/issue2528 + # and we can't use tempfile: http://bugs.python.org/issue22107 + basename = "accesstest_deleteme_fishfingers_custard_" + alphabet = "abcdefghijklmnopqrstuvwxyz0123456789" + for _ in range(10): + name = basename + "".join(random.choice(alphabet) for _ in range(6)) + file = os.path.join(path, name) + try: + fd = os.open(file, os.O_RDWR | os.O_CREAT | os.O_EXCL) + except FileExistsError: + pass + except PermissionError: + # This could be because there's a directory with the same name. + # But it's highly unlikely there's a directory called that, + # so we'll assume it's because the parent dir is not writable. + # This could as well be because the parent dir is not readable, + # due to non-privileged user access. + return False + else: + os.close(fd) + os.unlink(file) + return True + + # This should never be reached + raise OSError("Unexpected condition testing for writable directory") + + +def find_files(path: str, pattern: str) -> list[str]: + """Returns a list of absolute paths of files beneath path, recursively, + with filenames which match the UNIX-style shell glob pattern.""" + result: list[str] = [] + for root, _, files in os.walk(path): + matches = fnmatch.filter(files, pattern) + result.extend(os.path.join(root, f) for f in matches) + return result + + +def file_size(path: str) -> int | float: + # If it's a symlink, return 0. + if os.path.islink(path): + return 0 + return os.path.getsize(path) + + +def format_file_size(path: str) -> str: + return format_size(file_size(path)) + + +def directory_size(path: str) -> int | float: + size = 0.0 + for root, _dirs, files in os.walk(path): + for filename in files: + file_path = os.path.join(root, filename) + size += file_size(file_path) + return size + + +def format_directory_size(path: str) -> str: + return format_size(directory_size(path)) diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/utils/filetypes.py b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/utils/filetypes.py new file mode 100644 index 0000000000000000000000000000000000000000..2b8baad7cd61cb508087ef4e16202ea54dad1601 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/utils/filetypes.py @@ -0,0 +1,24 @@ +"""Filetype information.""" + +from pip._internal.utils.misc import splitext + +WHEEL_EXTENSION = ".whl" +BZ2_EXTENSIONS: tuple[str, ...] = (".tar.bz2", ".tbz") +XZ_EXTENSIONS: tuple[str, ...] = ( + ".tar.xz", + ".txz", + ".tlz", + ".tar.lz", + ".tar.lzma", +) +ZIP_EXTENSIONS: tuple[str, ...] = (".zip", WHEEL_EXTENSION) +TAR_EXTENSIONS: tuple[str, ...] = (".tar.gz", ".tgz", ".tar") +ARCHIVE_EXTENSIONS = ZIP_EXTENSIONS + BZ2_EXTENSIONS + TAR_EXTENSIONS + XZ_EXTENSIONS + + +def is_archive_file(name: str) -> bool: + """Return True if `name` is a considered as an archive file.""" + ext = splitext(name)[1].lower() + if ext in ARCHIVE_EXTENSIONS: + return True + return False diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/utils/glibc.py b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/utils/glibc.py new file mode 100644 index 0000000000000000000000000000000000000000..2cb3013c7d9e364beb99fb2c9b461e697dbf20f3 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/utils/glibc.py @@ -0,0 +1,102 @@ +from __future__ import annotations + +import os +import sys + + +def glibc_version_string() -> str | None: + "Returns glibc version string, or None if not using glibc." + return glibc_version_string_confstr() or glibc_version_string_ctypes() + + +def glibc_version_string_confstr() -> str | None: + "Primary implementation of glibc_version_string using os.confstr." + # os.confstr is quite a bit faster than ctypes.DLL. It's also less likely + # to be broken or missing. This strategy is used in the standard library + # platform module: + # https://github.com/python/cpython/blob/fcf1d003bf4f0100c9d0921ff3d70e1127ca1b71/Lib/platform.py#L175-L183 + if sys.platform == "win32": + return None + try: + gnu_libc_version = os.confstr("CS_GNU_LIBC_VERSION") + if gnu_libc_version is None: + return None + # os.confstr("CS_GNU_LIBC_VERSION") returns a string like "glibc 2.17": + _, version = gnu_libc_version.split() + except (AttributeError, OSError, ValueError): + # os.confstr() or CS_GNU_LIBC_VERSION not available (or a bad value)... + return None + return version + + +def glibc_version_string_ctypes() -> str | None: + "Fallback implementation of glibc_version_string using ctypes." + + try: + import ctypes + except ImportError: + return None + + # ctypes.CDLL(None) internally calls dlopen(NULL), and as the dlopen + # manpage says, "If filename is NULL, then the returned handle is for the + # main program". This way we can let the linker do the work to figure out + # which libc our process is actually using. + # + # We must also handle the special case where the executable is not a + # dynamically linked executable. This can occur when using musl libc, + # for example. In this situation, dlopen() will error, leading to an + # OSError. Interestingly, at least in the case of musl, there is no + # errno set on the OSError. The single string argument used to construct + # OSError comes from libc itself and is therefore not portable to + # hard code here. In any case, failure to call dlopen() means we + # can't proceed, so we bail on our attempt. + try: + process_namespace = ctypes.CDLL(None) + except OSError: + return None + + try: + gnu_get_libc_version = process_namespace.gnu_get_libc_version + except AttributeError: + # Symbol doesn't exist -> therefore, we are not linked to + # glibc. + return None + + # Call gnu_get_libc_version, which returns a string like "2.5" + gnu_get_libc_version.restype = ctypes.c_char_p + version_str: str = gnu_get_libc_version() + # py2 / py3 compatibility: + if not isinstance(version_str, str): + version_str = version_str.decode("ascii") + + return version_str + + +# platform.libc_ver regularly returns completely nonsensical glibc +# versions. E.g. on my computer, platform says: +# +# ~$ python2.7 -c 'import platform; print(platform.libc_ver())' +# ('glibc', '2.7') +# ~$ python3.5 -c 'import platform; print(platform.libc_ver())' +# ('glibc', '2.9') +# +# But the truth is: +# +# ~$ ldd --version +# ldd (Debian GLIBC 2.22-11) 2.22 +# +# This is unfortunate, because it means that the linehaul data on libc +# versions that was generated by pip 8.1.2 and earlier is useless and +# misleading. Solution: instead of using platform, use our code that actually +# works. +def libc_ver() -> tuple[str, str]: + """Try to determine the glibc version + + Returns a tuple of strings (lib, version) which default to empty strings + in case the lookup fails. + """ + glibc_version = glibc_version_string() + if glibc_version is None: + return ("", "") + else: + return ("glibc", glibc_version) diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/utils/hashes.py b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/utils/hashes.py new file mode 100644 index 0000000000000000000000000000000000000000..3d8c125ada3a41309131b36c4523742ce41f0205 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/utils/hashes.py @@ -0,0 +1,150 @@ +from __future__ import annotations + +import hashlib +from collections.abc import Iterable +from typing import TYPE_CHECKING, BinaryIO, NoReturn + +from pip._internal.exceptions import HashMismatch, HashMissing, InstallationError +from pip._internal.utils.misc import read_chunks + +if TYPE_CHECKING: + from hashlib import _Hash + + +# The recommended hash algo of the moment. Change this whenever the state of +# the art changes; it won't hurt backward compatibility. +FAVORITE_HASH = "sha256" + + +# Names of hashlib algorithms allowed by the --hash option and ``pip hash`` +# Currently, those are the ones at least as collision-resistant as sha256. +STRONG_HASHES = ["sha256", "sha384", "sha512"] + + +class Hashes: + """A wrapper that builds multiple hashes at once and checks them against + known-good values + + """ + + def __init__(self, hashes: dict[str, list[str]] | None = None) -> None: + """ + :param hashes: A dict of algorithm names pointing to lists of allowed + hex digests + """ + allowed = {} + if hashes is not None: + for alg, keys in hashes.items(): + # Make sure values are always sorted (to ease equality checks) + allowed[alg] = [k.lower() for k in sorted(keys)] + self._allowed = allowed + + def __and__(self, other: Hashes) -> Hashes: + if not isinstance(other, Hashes): + return NotImplemented + + # If either of the Hashes object is entirely empty (i.e. no hash + # specified at all), all hashes from the other object are allowed. + if not other: + return self + if not self: + return other + + # Otherwise only hashes that present in both objects are allowed. + new = {} + for alg, values in other._allowed.items(): + if alg not in self._allowed: + continue + new[alg] = [v for v in values if v in self._allowed[alg]] + return Hashes(new) + + @property + def digest_count(self) -> int: + return sum(len(digests) for digests in self._allowed.values()) + + def is_hash_allowed(self, hash_name: str, hex_digest: str) -> bool: + """Return whether the given hex digest is allowed.""" + return hex_digest in self._allowed.get(hash_name, []) + + def check_against_chunks(self, chunks: Iterable[bytes]) -> None: + """Check good hashes against ones built from iterable of chunks of + data. + + Raise HashMismatch if none match. + + """ + gots = {} + for hash_name in self._allowed.keys(): + try: + gots[hash_name] = hashlib.new(hash_name) + except (ValueError, TypeError): + raise InstallationError(f"Unknown hash name: {hash_name}") + + for chunk in chunks: + for hash in gots.values(): + hash.update(chunk) + + for hash_name, got in gots.items(): + if got.hexdigest() in self._allowed[hash_name]: + return + self._raise(gots) + + def _raise(self, gots: dict[str, _Hash]) -> NoReturn: + raise HashMismatch(self._allowed, gots) + + def check_against_file(self, file: BinaryIO) -> None: + """Check good hashes against a file-like object + + Raise HashMismatch if none match. + + """ + return self.check_against_chunks(read_chunks(file)) + + def check_against_path(self, path: str) -> None: + with open(path, "rb") as file: + return self.check_against_file(file) + + def has_one_of(self, hashes: dict[str, str]) -> bool: + """Return whether any of the given hashes are allowed.""" + for hash_name, hex_digest in hashes.items(): + if self.is_hash_allowed(hash_name, hex_digest): + return True + return False + + def __bool__(self) -> bool: + """Return whether I know any known-good hashes.""" + return bool(self._allowed) + + def __eq__(self, other: object) -> bool: + if not isinstance(other, Hashes): + return NotImplemented + return self._allowed == other._allowed + + def __hash__(self) -> int: + return hash( + ",".join( + sorted( + ":".join((alg, digest)) + for alg, digest_list in self._allowed.items() + for digest in digest_list + ) + ) + ) + + +class MissingHashes(Hashes): + """A workalike for Hashes used when we're missing a hash for a requirement + + It computes the actual hash of the requirement and raises a HashMissing + exception showing it to the user. + + """ + + def __init__(self) -> None: + """Don't offer the ``hashes`` kwarg.""" + # Pass our favorite hash in to generate a "gotten hash". With the + # empty list, it will never match, so an error will always raise. + super().__init__(hashes={FAVORITE_HASH: []}) + + def _raise(self, gots: dict[str, _Hash]) -> NoReturn: + raise HashMissing(gots[FAVORITE_HASH].hexdigest()) diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/utils/logging.py b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/utils/logging.py new file mode 100644 index 0000000000000000000000000000000000000000..5cdbeb7f753a4f9ba710d716acc5ad99f8851ce1 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/utils/logging.py @@ -0,0 +1,364 @@ +from __future__ import annotations + +import contextlib +import errno +import logging +import logging.handlers +import os +import sys +import threading +from collections.abc import Generator +from dataclasses import dataclass +from io import TextIOWrapper +from logging import Filter +from typing import Any, ClassVar + +from pip._vendor.rich.console import ( + Console, + ConsoleOptions, + ConsoleRenderable, + RenderableType, + RenderResult, + RichCast, +) +from pip._vendor.rich.highlighter import NullHighlighter +from pip._vendor.rich.logging import RichHandler +from pip._vendor.rich.segment import Segment +from pip._vendor.rich.style import Style + +from pip._internal.utils._log import VERBOSE, getLogger +from pip._internal.utils.compat import WINDOWS +from pip._internal.utils.deprecation import DEPRECATION_MSG_PREFIX +from pip._internal.utils.misc import ensure_dir + +_log_state = threading.local() +_stdout_console = None +_stderr_console = None +subprocess_logger = getLogger("pip.subprocessor") + + +class BrokenStdoutLoggingError(Exception): + """ + Raised if BrokenPipeError occurs for the stdout stream while logging. + """ + + +def _is_broken_pipe_error(exc_class: type[BaseException], exc: BaseException) -> bool: + if exc_class is BrokenPipeError: + return True + + # On Windows, a broken pipe can show up as EINVAL rather than EPIPE: + # https://bugs.python.org/issue19612 + # https://bugs.python.org/issue30418 + if not WINDOWS: + return False + + return isinstance(exc, OSError) and exc.errno in (errno.EINVAL, errno.EPIPE) + + +@contextlib.contextmanager +def indent_log(num: int = 2) -> Generator[None, None, None]: + """ + A context manager which will cause the log output to be indented for any + log messages emitted inside it. + """ + # For thread-safety + _log_state.indentation = get_indentation() + _log_state.indentation += num + try: + yield + finally: + _log_state.indentation -= num + + +def get_indentation() -> int: + return getattr(_log_state, "indentation", 0) + + +class IndentingFormatter(logging.Formatter): + default_time_format = "%Y-%m-%dT%H:%M:%S" + + def __init__( + self, + *args: Any, + add_timestamp: bool = False, + **kwargs: Any, + ) -> None: + """ + A logging.Formatter that obeys the indent_log() context manager. + + :param add_timestamp: A bool indicating output lines should be prefixed + with their record's timestamp. + """ + self.add_timestamp = add_timestamp + super().__init__(*args, **kwargs) + + def get_message_start(self, formatted: str, levelno: int) -> str: + """ + Return the start of the formatted log message (not counting the + prefix to add to each line). + """ + if levelno < logging.WARNING: + return "" + if formatted.startswith(DEPRECATION_MSG_PREFIX): + # Then the message already has a prefix. We don't want it to + # look like "WARNING: DEPRECATION: ...." + return "" + if levelno < logging.ERROR: + return "WARNING: " + + return "ERROR: " + + def format(self, record: logging.LogRecord) -> str: + """ + Calls the standard formatter, but will indent all of the log message + lines by our current indentation level. + """ + formatted = super().format(record) + message_start = self.get_message_start(formatted, record.levelno) + formatted = message_start + formatted + + prefix = "" + if self.add_timestamp: + prefix = f"{self.formatTime(record)} " + prefix += " " * get_indentation() + formatted = "".join([prefix + line for line in formatted.splitlines(True)]) + return formatted + + +@dataclass +class IndentedRenderable: + renderable: RenderableType + indent: int + + def __rich_console__( + self, console: Console, options: ConsoleOptions + ) -> RenderResult: + segments = console.render(self.renderable, options) + lines = Segment.split_lines(segments) + for line in lines: + yield Segment(" " * self.indent) + yield from line + yield Segment("\n") + + +class PipConsole(Console): + def on_broken_pipe(self) -> None: + # Reraise the original exception, rich 13.8.0+ exits by default + # instead, preventing our handler from firing. + raise BrokenPipeError() from None + + +def get_console(*, stderr: bool = False) -> Console: + if stderr: + assert _stderr_console is not None, "stderr rich console is missing!" + return _stderr_console + else: + assert _stdout_console is not None, "stdout rich console is missing!" + return _stdout_console + + +class RichPipStreamHandler(RichHandler): + KEYWORDS: ClassVar[list[str] | None] = [] + + def __init__(self, console: Console) -> None: + super().__init__( + console=console, + show_time=False, + show_level=False, + show_path=False, + highlighter=NullHighlighter(), + ) + + # Our custom override on Rich's logger, to make things work as we need them to. + def emit(self, record: logging.LogRecord) -> None: + style: Style | None = None + + # If we are given a diagnostic error to present, present it with indentation. + if getattr(record, "rich", False): + assert isinstance(record.args, tuple) + (rich_renderable,) = record.args + assert isinstance( + rich_renderable, (ConsoleRenderable, RichCast, str) + ), f"{rich_renderable} is not rich-console-renderable" + + renderable: RenderableType = IndentedRenderable( + rich_renderable, indent=get_indentation() + ) + else: + message = self.format(record) + renderable = self.render_message(record, message) + if record.levelno is not None: + if record.levelno >= logging.ERROR: + style = Style(color="red") + elif record.levelno >= logging.WARNING: + style = Style(color="yellow") + + try: + self.console.print(renderable, overflow="ignore", crop=False, style=style) + except Exception: + self.handleError(record) + + def handleError(self, record: logging.LogRecord) -> None: + """Called when logging is unable to log some output.""" + + exc_class, exc = sys.exc_info()[:2] + # If a broken pipe occurred while calling write() or flush() on the + # stdout stream in logging's Handler.emit(), then raise our special + # exception so we can handle it in main() instead of logging the + # broken pipe error and continuing. + if ( + exc_class + and exc + and self.console.file is sys.stdout + and _is_broken_pipe_error(exc_class, exc) + ): + raise BrokenStdoutLoggingError() + + return super().handleError(record) + + +class BetterRotatingFileHandler(logging.handlers.RotatingFileHandler): + def _open(self) -> TextIOWrapper: + ensure_dir(os.path.dirname(self.baseFilename)) + return super()._open() + + +class MaxLevelFilter(Filter): + def __init__(self, level: int) -> None: + self.level = level + + def filter(self, record: logging.LogRecord) -> bool: + return record.levelno < self.level + + +class ExcludeLoggerFilter(Filter): + """ + A logging Filter that excludes records from a logger (or its children). + """ + + def filter(self, record: logging.LogRecord) -> bool: + # The base Filter class allows only records from a logger (or its + # children). + return not super().filter(record) + + +def setup_logging(verbosity: int, no_color: bool, user_log_file: str | None) -> int: + """Configures and sets up all of the logging + + Returns the requested logging level, as its integer value. + """ + + # Determine the level to be logging at. + if verbosity >= 2: + level_number = logging.DEBUG + elif verbosity == 1: + level_number = VERBOSE + elif verbosity == -1: + level_number = logging.WARNING + elif verbosity == -2: + level_number = logging.ERROR + elif verbosity <= -3: + level_number = logging.CRITICAL + else: + level_number = logging.INFO + + level = logging.getLevelName(level_number) + + # The "root" logger should match the "console" level *unless* we also need + # to log to a user log file. + include_user_log = user_log_file is not None + if include_user_log: + additional_log_file = user_log_file + root_level = "DEBUG" + else: + additional_log_file = "/dev/null" + root_level = level + + # Disable any logging besides WARNING unless we have DEBUG level logging + # enabled for vendored libraries. + vendored_log_level = "WARNING" if level in ["INFO", "ERROR"] else "DEBUG" + + # Shorthands for clarity + handler_classes = { + "stream": "pip._internal.utils.logging.RichPipStreamHandler", + "file": "pip._internal.utils.logging.BetterRotatingFileHandler", + } + handlers = ["console", "console_errors", "console_subprocess"] + ( + ["user_log"] if include_user_log else [] + ) + global _stdout_console, stderr_console + _stdout_console = PipConsole(file=sys.stdout, no_color=no_color, soft_wrap=True) + _stderr_console = PipConsole(file=sys.stderr, no_color=no_color, soft_wrap=True) + + logging.config.dictConfig( + { + "version": 1, + "disable_existing_loggers": False, + "filters": { + "exclude_warnings": { + "()": "pip._internal.utils.logging.MaxLevelFilter", + "level": logging.WARNING, + }, + "restrict_to_subprocess": { + "()": "logging.Filter", + "name": subprocess_logger.name, + }, + "exclude_subprocess": { + "()": "pip._internal.utils.logging.ExcludeLoggerFilter", + "name": subprocess_logger.name, + }, + }, + "formatters": { + "indent": { + "()": IndentingFormatter, + "format": "%(message)s", + }, + "indent_with_timestamp": { + "()": IndentingFormatter, + "format": "%(message)s", + "add_timestamp": True, + }, + }, + "handlers": { + "console": { + "level": level, + "class": handler_classes["stream"], + "console": _stdout_console, + "filters": ["exclude_subprocess", "exclude_warnings"], + "formatter": "indent", + }, + "console_errors": { + "level": "WARNING", + "class": handler_classes["stream"], + "console": _stderr_console, + "filters": ["exclude_subprocess"], + "formatter": "indent", + }, + # A handler responsible for logging to the console messages + # from the "subprocessor" logger. + "console_subprocess": { + "level": level, + "class": handler_classes["stream"], + "console": _stderr_console, + "filters": ["restrict_to_subprocess"], + "formatter": "indent", + }, + "user_log": { + "level": "DEBUG", + "class": handler_classes["file"], + "filename": additional_log_file, + "encoding": "utf-8", + "delay": True, + "formatter": "indent_with_timestamp", + }, + }, + "root": { + "level": root_level, + "handlers": handlers, + }, + "loggers": {"pip._vendor": {"level": vendored_log_level}}, + } + ) + + return level_number diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/utils/misc.py b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/utils/misc.py new file mode 100644 index 0000000000000000000000000000000000000000..3a28e8449de59a24a43094d52a70c18ace99e86e --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/utils/misc.py @@ -0,0 +1,765 @@ +from __future__ import annotations + +import errno +import getpass +import hashlib +import logging +import os +import posixpath +import shutil +import stat +import sys +import sysconfig +import urllib.parse +from collections.abc import Generator, Iterable, Iterator, Mapping, Sequence +from dataclasses import dataclass +from functools import partial +from io import StringIO +from itertools import filterfalse, tee, zip_longest +from pathlib import Path +from types import FunctionType, TracebackType +from typing import ( + Any, + BinaryIO, + Callable, + Optional, + TextIO, + TypeVar, + cast, +) + +from pip._vendor.packaging.requirements import Requirement +from pip._vendor.pyproject_hooks import BuildBackendHookCaller + +from pip import __version__ +from pip._internal.exceptions import CommandError, ExternallyManagedEnvironment +from pip._internal.locations import get_major_minor_version +from pip._internal.utils.compat import WINDOWS +from pip._internal.utils.retry import retry +from pip._internal.utils.virtualenv import running_under_virtualenv + +__all__ = [ + "rmtree", + "display_path", + "backup_dir", + "ask", + "splitext", + "format_size", + "is_installable_dir", + "normalize_path", + "renames", + "get_prog", + "ensure_dir", + "remove_auth_from_url", + "check_externally_managed", + "ConfiguredBuildBackendHookCaller", +] + +logger = logging.getLogger(__name__) + +T = TypeVar("T") +ExcInfo = tuple[type[BaseException], BaseException, TracebackType] +VersionInfo = tuple[int, int, int] +NetlocTuple = tuple[str, tuple[Optional[str], Optional[str]]] +OnExc = Callable[[FunctionType, Path, BaseException], Any] +OnErr = Callable[[FunctionType, Path, ExcInfo], Any] + +FILE_CHUNK_SIZE = 1024 * 1024 + + +def get_pip_version() -> str: + pip_pkg_dir = os.path.join(os.path.dirname(__file__), "..", "..") + pip_pkg_dir = os.path.abspath(pip_pkg_dir) + + return f"pip {__version__} from {pip_pkg_dir} (python {get_major_minor_version()})" + + +def normalize_version_info(py_version_info: tuple[int, ...]) -> tuple[int, int, int]: + """ + Convert a tuple of ints representing a Python version to one of length + three. + + :param py_version_info: a tuple of ints representing a Python version, + or None to specify no version. The tuple can have any length. + + :return: a tuple of length three if `py_version_info` is non-None. + Otherwise, return `py_version_info` unchanged (i.e. None). + """ + if len(py_version_info) < 3: + py_version_info += (3 - len(py_version_info)) * (0,) + elif len(py_version_info) > 3: + py_version_info = py_version_info[:3] + + return cast("VersionInfo", py_version_info) + + +def ensure_dir(path: str) -> None: + """os.path.makedirs without EEXIST.""" + try: + os.makedirs(path) + except OSError as e: + # Windows can raise spurious ENOTEMPTY errors. See #6426. + if e.errno != errno.EEXIST and e.errno != errno.ENOTEMPTY: + raise + + +def get_prog() -> str: + try: + prog = os.path.basename(sys.argv[0]) + if prog in ("__main__.py", "-c"): + return f"{sys.executable} -m pip" + else: + return prog + except (AttributeError, TypeError, IndexError): + pass + return "pip" + + +# Retry every half second for up to 3 seconds +@retry(stop_after_delay=3, wait=0.5) +def rmtree(dir: str, ignore_errors: bool = False, onexc: OnExc | None = None) -> None: + if ignore_errors: + onexc = _onerror_ignore + if onexc is None: + onexc = _onerror_reraise + handler: OnErr = partial(rmtree_errorhandler, onexc=onexc) + if sys.version_info >= (3, 12): + # See https://docs.python.org/3.12/whatsnew/3.12.html#shutil. + shutil.rmtree(dir, onexc=handler) # type: ignore + else: + shutil.rmtree(dir, onerror=handler) # type: ignore + + +def _onerror_ignore(*_args: Any) -> None: + pass + + +def _onerror_reraise(*_args: Any) -> None: + raise # noqa: PLE0704 - Bare exception used to reraise existing exception + + +def rmtree_errorhandler( + func: FunctionType, + path: Path, + exc_info: ExcInfo | BaseException, + *, + onexc: OnExc = _onerror_reraise, +) -> None: + """ + `rmtree` error handler to 'force' a file remove (i.e. like `rm -f`). + + * If a file is readonly then it's write flag is set and operation is + retried. + + * `onerror` is the original callback from `rmtree(... onerror=onerror)` + that is chained at the end if the "rm -f" still fails. + """ + try: + st_mode = os.stat(path).st_mode + except OSError: + # it's equivalent to os.path.exists + return + + if not st_mode & stat.S_IWRITE: + # convert to read/write + try: + os.chmod(path, st_mode | stat.S_IWRITE) + except OSError: + pass + else: + # use the original function to repeat the operation + try: + func(path) + return + except OSError: + pass + + if not isinstance(exc_info, BaseException): + _, exc_info, _ = exc_info + onexc(func, path, exc_info) + + +def display_path(path: str) -> str: + """Gives the display value for a given path, making it relative to cwd + if possible.""" + path = os.path.normcase(os.path.abspath(path)) + if path.startswith(os.getcwd() + os.path.sep): + path = "." + path[len(os.getcwd()) :] + return path + + +def backup_dir(dir: str, ext: str = ".bak") -> str: + """Figure out the name of a directory to back up the given dir to + (adding .bak, .bak2, etc)""" + n = 1 + extension = ext + while os.path.exists(dir + extension): + n += 1 + extension = ext + str(n) + return dir + extension + + +def ask_path_exists(message: str, options: Iterable[str]) -> str: + for action in os.environ.get("PIP_EXISTS_ACTION", "").split(): + if action in options: + return action + return ask(message, options) + + +def _check_no_input(message: str) -> None: + """Raise an error if no input is allowed.""" + if os.environ.get("PIP_NO_INPUT"): + raise Exception( + f"No input was expected ($PIP_NO_INPUT set); question: {message}" + ) + + +def ask(message: str, options: Iterable[str]) -> str: + """Ask the message interactively, with the given possible responses""" + while 1: + _check_no_input(message) + response = input(message) + response = response.strip().lower() + if response not in options: + print( + "Your response ({!r}) was not one of the expected responses: " + "{}".format(response, ", ".join(options)) + ) + else: + return response + + +def ask_input(message: str) -> str: + """Ask for input interactively.""" + _check_no_input(message) + return input(message) + + +def ask_password(message: str) -> str: + """Ask for a password interactively.""" + _check_no_input(message) + return getpass.getpass(message) + + +def strtobool(val: str) -> int: + """Convert a string representation of truth to true (1) or false (0). + + True values are 'y', 'yes', 't', 'true', 'on', and '1'; false values + are 'n', 'no', 'f', 'false', 'off', and '0'. Raises ValueError if + 'val' is anything else. + """ + val = val.lower() + if val in ("y", "yes", "t", "true", "on", "1"): + return 1 + elif val in ("n", "no", "f", "false", "off", "0"): + return 0 + else: + raise ValueError(f"invalid truth value {val!r}") + + +def format_size(bytes: float) -> str: + if bytes > 1000 * 1000: + return f"{bytes / 1000.0 / 1000:.1f} MB" + elif bytes > 10 * 1000: + return f"{int(bytes / 1000)} kB" + elif bytes > 1000: + return f"{bytes / 1000.0:.1f} kB" + else: + return f"{int(bytes)} bytes" + + +def tabulate(rows: Iterable[Iterable[Any]]) -> tuple[list[str], list[int]]: + """Return a list of formatted rows and a list of column sizes. + + For example:: + + >>> tabulate([['foobar', 2000], [0xdeadbeef]]) + (['foobar 2000', '3735928559'], [10, 4]) + """ + rows = [tuple(map(str, row)) for row in rows] + sizes = [max(map(len, col)) for col in zip_longest(*rows, fillvalue="")] + table = [" ".join(map(str.ljust, row, sizes)).rstrip() for row in rows] + return table, sizes + + +def is_installable_dir(path: str) -> bool: + """Is path is a directory containing pyproject.toml or setup.py? + + If pyproject.toml exists, this is a PEP 517 project. Otherwise we look for + a legacy setuptools layout by identifying setup.py. We don't check for the + setup.cfg because using it without setup.py is only available for PEP 517 + projects, which are already covered by the pyproject.toml check. + """ + if not os.path.isdir(path): + return False + if os.path.isfile(os.path.join(path, "pyproject.toml")): + return True + if os.path.isfile(os.path.join(path, "setup.py")): + return True + return False + + +def read_chunks( + file: BinaryIO, size: int = FILE_CHUNK_SIZE +) -> Generator[bytes, None, None]: + """Yield pieces of data from a file-like object until EOF.""" + while True: + chunk = file.read(size) + if not chunk: + break + yield chunk + + +def normalize_path(path: str, resolve_symlinks: bool = True) -> str: + """ + Convert a path to its canonical, case-normalized, absolute version. + + """ + path = os.path.expanduser(path) + if resolve_symlinks: + path = os.path.realpath(path) + else: + path = os.path.abspath(path) + return os.path.normcase(path) + + +def splitext(path: str) -> tuple[str, str]: + """Like os.path.splitext, but take off .tar too""" + base, ext = posixpath.splitext(path) + if base.lower().endswith(".tar"): + ext = base[-4:] + ext + base = base[:-4] + return base, ext + + +def renames(old: str, new: str) -> None: + """Like os.renames(), but handles renaming across devices.""" + # Implementation borrowed from os.renames(). + head, tail = os.path.split(new) + if head and tail and not os.path.exists(head): + os.makedirs(head) + + shutil.move(old, new) + + head, tail = os.path.split(old) + if head and tail: + try: + os.removedirs(head) + except OSError: + pass + + +def is_local(path: str) -> bool: + """ + Return True if path is within sys.prefix, if we're running in a virtualenv. + + If we're not in a virtualenv, all paths are considered "local." + + Caution: this function assumes the head of path has been normalized + with normalize_path. + """ + if not running_under_virtualenv(): + return True + return path.startswith(normalize_path(sys.prefix)) + + +def write_output(msg: Any, *args: Any) -> None: + logger.info(msg, *args) + + +class StreamWrapper(StringIO): + orig_stream: TextIO + + @classmethod + def from_stream(cls, orig_stream: TextIO) -> StreamWrapper: + ret = cls() + ret.orig_stream = orig_stream + return ret + + # compileall.compile_dir() needs stdout.encoding to print to stdout + # type ignore is because TextIOBase.encoding is writeable + @property + def encoding(self) -> str: # type: ignore + return self.orig_stream.encoding + + +# Simulates an enum +def enum(*sequential: Any, **named: Any) -> type[Any]: + enums = dict(zip(sequential, range(len(sequential))), **named) + reverse = {value: key for key, value in enums.items()} + enums["reverse_mapping"] = reverse + return type("Enum", (), enums) + + +def build_netloc(host: str, port: int | None) -> str: + """ + Build a netloc from a host-port pair + """ + if port is None: + return host + if ":" in host: + # Only wrap host with square brackets when it is IPv6 + host = f"[{host}]" + return f"{host}:{port}" + + +def build_url_from_netloc(netloc: str, scheme: str = "https") -> str: + """ + Build a full URL from a netloc. + """ + if netloc.count(":") >= 2 and "@" not in netloc and "[" not in netloc: + # It must be a bare IPv6 address, so wrap it with brackets. + netloc = f"[{netloc}]" + return f"{scheme}://{netloc}" + + +def parse_netloc(netloc: str) -> tuple[str | None, int | None]: + """ + Return the host-port pair from a netloc. + """ + url = build_url_from_netloc(netloc) + parsed = urllib.parse.urlparse(url) + return parsed.hostname, parsed.port + + +def split_auth_from_netloc(netloc: str) -> NetlocTuple: + """ + Parse out and remove the auth information from a netloc. + + Returns: (netloc, (username, password)). + """ + if "@" not in netloc: + return netloc, (None, None) + + # Split from the right because that's how urllib.parse.urlsplit() + # behaves if more than one @ is present (which can be checked using + # the password attribute of urlsplit()'s return value). + auth, netloc = netloc.rsplit("@", 1) + pw: str | None = None + if ":" in auth: + # Split from the left because that's how urllib.parse.urlsplit() + # behaves if more than one : is present (which again can be checked + # using the password attribute of the return value) + user, pw = auth.split(":", 1) + else: + user, pw = auth, None + + user = urllib.parse.unquote(user) + if pw is not None: + pw = urllib.parse.unquote(pw) + + return netloc, (user, pw) + + +def redact_netloc(netloc: str) -> str: + """ + Replace the sensitive data in a netloc with "****", if it exists. + + For example: + - "user:pass@example.com" returns "user:****@example.com" + - "accesstoken@example.com" returns "****@example.com" + """ + netloc, (user, password) = split_auth_from_netloc(netloc) + if user is None: + return netloc + if password is None: + user = "****" + password = "" + else: + user = urllib.parse.quote(user) + password = ":****" + return f"{user}{password}@{netloc}" + + +def _transform_url( + url: str, transform_netloc: Callable[[str], tuple[Any, ...]] +) -> tuple[str, NetlocTuple]: + """Transform and replace netloc in a url. + + transform_netloc is a function taking the netloc and returning a + tuple. The first element of this tuple is the new netloc. The + entire tuple is returned. + + Returns a tuple containing the transformed url as item 0 and the + original tuple returned by transform_netloc as item 1. + """ + purl = urllib.parse.urlsplit(url) + netloc_tuple = transform_netloc(purl.netloc) + # stripped url + url_pieces = (purl.scheme, netloc_tuple[0], purl.path, purl.query, purl.fragment) + surl = urllib.parse.urlunsplit(url_pieces) + return surl, cast("NetlocTuple", netloc_tuple) + + +def _get_netloc(netloc: str) -> NetlocTuple: + return split_auth_from_netloc(netloc) + + +def _redact_netloc(netloc: str) -> tuple[str]: + return (redact_netloc(netloc),) + + +def split_auth_netloc_from_url( + url: str, +) -> tuple[str, str, tuple[str | None, str | None]]: + """ + Parse a url into separate netloc, auth, and url with no auth. + + Returns: (url_without_auth, netloc, (username, password)) + """ + url_without_auth, (netloc, auth) = _transform_url(url, _get_netloc) + return url_without_auth, netloc, auth + + +def remove_auth_from_url(url: str) -> str: + """Return a copy of url with 'username:password@' removed.""" + # username/pass params are passed to subversion through flags + # and are not recognized in the url. + return _transform_url(url, _get_netloc)[0] + + +def redact_auth_from_url(url: str) -> str: + """Replace the password in a given url with ****.""" + return _transform_url(url, _redact_netloc)[0] + + +def redact_auth_from_requirement(req: Requirement) -> str: + """Replace the password in a given requirement url with ****.""" + if not req.url: + return str(req) + return str(req).replace(req.url, redact_auth_from_url(req.url)) + + +@dataclass(frozen=True) +class HiddenText: + secret: str + redacted: str + + def __repr__(self) -> str: + return f"" + + def __str__(self) -> str: + return self.redacted + + # This is useful for testing. + def __eq__(self, other: Any) -> bool: + if type(self) is not type(other): + return False + + # The string being used for redaction doesn't also have to match, + # just the raw, original string. + return self.secret == other.secret + + +def hide_value(value: str) -> HiddenText: + return HiddenText(value, redacted="****") + + +def hide_url(url: str) -> HiddenText: + redacted = redact_auth_from_url(url) + return HiddenText(url, redacted=redacted) + + +def protect_pip_from_modification_on_windows(modifying_pip: bool) -> None: + """Protection of pip.exe from modification on Windows + + On Windows, any operation modifying pip should be run as: + python -m pip ... + """ + pip_names = [ + "pip", + f"pip{sys.version_info.major}", + f"pip{sys.version_info.major}.{sys.version_info.minor}", + ] + + # See https://github.com/pypa/pip/issues/1299 for more discussion + should_show_use_python_msg = ( + modifying_pip and WINDOWS and os.path.basename(sys.argv[0]) in pip_names + ) + + if should_show_use_python_msg: + new_command = [sys.executable, "-m", "pip"] + sys.argv[1:] + raise CommandError( + "To modify pip, please run the following command:\n{}".format( + " ".join(new_command) + ) + ) + + +def check_externally_managed() -> None: + """Check whether the current environment is externally managed. + + If the ``EXTERNALLY-MANAGED`` config file is found, the current environment + is considered externally managed, and an ExternallyManagedEnvironment is + raised. + """ + if running_under_virtualenv(): + return + marker = os.path.join(sysconfig.get_path("stdlib"), "EXTERNALLY-MANAGED") + if not os.path.isfile(marker): + return + raise ExternallyManagedEnvironment.from_config(marker) + + +def is_console_interactive() -> bool: + """Is this console interactive?""" + return sys.stdin is not None and sys.stdin.isatty() + + +def hash_file(path: str, blocksize: int = 1 << 20) -> tuple[Any, int]: + """Return (hash, length) for path using hashlib.sha256()""" + + h = hashlib.sha256() + length = 0 + with open(path, "rb") as f: + for block in read_chunks(f, size=blocksize): + length += len(block) + h.update(block) + return h, length + + +def pairwise(iterable: Iterable[Any]) -> Iterator[tuple[Any, Any]]: + """ + Return paired elements. + + For example: + s -> (s0, s1), (s2, s3), (s4, s5), ... + """ + iterable = iter(iterable) + return zip_longest(iterable, iterable) + + +def partition( + pred: Callable[[T], bool], iterable: Iterable[T] +) -> tuple[Iterable[T], Iterable[T]]: + """ + Use a predicate to partition entries into false entries and true entries, + like + + partition(is_odd, range(10)) --> 0 2 4 6 8 and 1 3 5 7 9 + """ + t1, t2 = tee(iterable) + return filterfalse(pred, t1), filter(pred, t2) + + +class ConfiguredBuildBackendHookCaller(BuildBackendHookCaller): + def __init__( + self, + config_holder: Any, + source_dir: str, + build_backend: str, + backend_path: str | None = None, + runner: Callable[..., None] | None = None, + python_executable: str | None = None, + ): + super().__init__( + source_dir, build_backend, backend_path, runner, python_executable + ) + self.config_holder = config_holder + + def build_wheel( + self, + wheel_directory: str, + config_settings: Mapping[str, Any] | None = None, + metadata_directory: str | None = None, + ) -> str: + cs = self.config_holder.config_settings + return super().build_wheel( + wheel_directory, config_settings=cs, metadata_directory=metadata_directory + ) + + def build_sdist( + self, + sdist_directory: str, + config_settings: Mapping[str, Any] | None = None, + ) -> str: + cs = self.config_holder.config_settings + return super().build_sdist(sdist_directory, config_settings=cs) + + def build_editable( + self, + wheel_directory: str, + config_settings: Mapping[str, Any] | None = None, + metadata_directory: str | None = None, + ) -> str: + cs = self.config_holder.config_settings + return super().build_editable( + wheel_directory, config_settings=cs, metadata_directory=metadata_directory + ) + + def get_requires_for_build_wheel( + self, config_settings: Mapping[str, Any] | None = None + ) -> Sequence[str]: + cs = self.config_holder.config_settings + return super().get_requires_for_build_wheel(config_settings=cs) + + def get_requires_for_build_sdist( + self, config_settings: Mapping[str, Any] | None = None + ) -> Sequence[str]: + cs = self.config_holder.config_settings + return super().get_requires_for_build_sdist(config_settings=cs) + + def get_requires_for_build_editable( + self, config_settings: Mapping[str, Any] | None = None + ) -> Sequence[str]: + cs = self.config_holder.config_settings + return super().get_requires_for_build_editable(config_settings=cs) + + def prepare_metadata_for_build_wheel( + self, + metadata_directory: str, + config_settings: Mapping[str, Any] | None = None, + _allow_fallback: bool = True, + ) -> str: + cs = self.config_holder.config_settings + return super().prepare_metadata_for_build_wheel( + metadata_directory=metadata_directory, + config_settings=cs, + _allow_fallback=_allow_fallback, + ) + + def prepare_metadata_for_build_editable( + self, + metadata_directory: str, + config_settings: Mapping[str, Any] | None = None, + _allow_fallback: bool = True, + ) -> str | None: + cs = self.config_holder.config_settings + return super().prepare_metadata_for_build_editable( + metadata_directory=metadata_directory, + config_settings=cs, + _allow_fallback=_allow_fallback, + ) + + +def warn_if_run_as_root() -> None: + """Output a warning for sudo users on Unix. + + In a virtual environment, sudo pip still writes to virtualenv. + On Windows, users may run pip as Administrator without issues. + This warning only applies to Unix root users outside of virtualenv. + """ + if running_under_virtualenv(): + return + if not hasattr(os, "getuid"): + return + # On Windows, there are no "system managed" Python packages. Installing as + # Administrator via pip is the correct way of updating system environments. + # + # We choose sys.platform over utils.compat.WINDOWS here to enable Mypy platform + # checks: https://mypy.readthedocs.io/en/stable/common_issues.html + if sys.platform == "win32" or sys.platform == "cygwin": + return + + if os.getuid() != 0: + return + + logger.warning( + "Running pip as the 'root' user can result in broken permissions and " + "conflicting behaviour with the system package manager, possibly " + "rendering your system unusable. " + "It is recommended to use a virtual environment instead: " + "https://pip.pypa.io/warnings/venv. " + "Use the --root-user-action option if you know what you are doing and " + "want to suppress this warning." + ) diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/utils/packaging.py b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/utils/packaging.py new file mode 100644 index 0000000000000000000000000000000000000000..3cbc0490aa1febe2dab8069a115ca13f0ad21c38 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/utils/packaging.py @@ -0,0 +1,44 @@ +from __future__ import annotations + +import functools +import logging + +from pip._vendor.packaging import specifiers, version +from pip._vendor.packaging.requirements import Requirement + +logger = logging.getLogger(__name__) + + +@functools.lru_cache(maxsize=32) +def check_requires_python( + requires_python: str | None, version_info: tuple[int, ...] +) -> bool: + """ + Check if the given Python version matches a "Requires-Python" specifier. + + :param version_info: A 3-tuple of ints representing a Python + major-minor-micro version to check (e.g. `sys.version_info[:3]`). + + :return: `True` if the given Python version satisfies the requirement. + Otherwise, return `False`. + + :raises InvalidSpecifier: If `requires_python` has an invalid format. + """ + if requires_python is None: + # The package provides no information + return True + requires_python_specifier = specifiers.SpecifierSet(requires_python) + + python_version = version.parse(".".join(map(str, version_info))) + return python_version in requires_python_specifier + + +@functools.lru_cache(maxsize=10000) +def get_requirement(req_string: str) -> Requirement: + """Construct a packaging.Requirement object with caching""" + # Parsing requirement strings is expensive, and is also expected to happen + # with a low diversity of different arguments (at least relative the number + # constructed). This method adds a cache to requirement object creation to + # minimize repeated parsing of the same string to construct equivalent + # Requirement objects. + return Requirement(req_string) diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/utils/retry.py b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/utils/retry.py new file mode 100644 index 0000000000000000000000000000000000000000..27d3b6e78030948d01f4663d241fe615517a1a65 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/utils/retry.py @@ -0,0 +1,45 @@ +from __future__ import annotations + +import functools +from time import perf_counter, sleep +from typing import TYPE_CHECKING, Callable, TypeVar + +if TYPE_CHECKING: + from typing_extensions import ParamSpec + + T = TypeVar("T") + P = ParamSpec("P") + + +def retry( + wait: float, stop_after_delay: float +) -> Callable[[Callable[P, T]], Callable[P, T]]: + """Decorator to automatically retry a function on error. + + If the function raises, the function is recalled with the same arguments + until it returns or the time limit is reached. When the time limit is + surpassed, the last exception raised is reraised. + + :param wait: The time to wait after an error before retrying, in seconds. + :param stop_after_delay: The time limit after which retries will cease, + in seconds. + """ + + def wrapper(func: Callable[P, T]) -> Callable[P, T]: + + @functools.wraps(func) + def retry_wrapped(*args: P.args, **kwargs: P.kwargs) -> T: + # The performance counter is monotonic on all platforms we care + # about and has much better resolution than time.monotonic(). + start_time = perf_counter() + while True: + try: + return func(*args, **kwargs) + except Exception: + if perf_counter() - start_time > stop_after_delay: + raise + sleep(wait) + + return retry_wrapped + + return wrapper diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/utils/setuptools_build.py b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/utils/setuptools_build.py new file mode 100644 index 0000000000000000000000000000000000000000..1b8c7a1c21ffb823b5528cf016f76e1622cd8181 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/utils/setuptools_build.py @@ -0,0 +1,149 @@ +from __future__ import annotations + +import sys +import textwrap +from collections.abc import Sequence + +# Shim to wrap setup.py invocation with setuptools +# Note that __file__ is handled via two {!r} *and* %r, to ensure that paths on +# Windows are correctly handled (it should be "C:\\Users" not "C:\Users"). +_SETUPTOOLS_SHIM = textwrap.dedent( + """ + exec(compile(''' + # This is -- a caller that pip uses to run setup.py + # + # - It imports setuptools before invoking setup.py, to enable projects that directly + # import from `distutils.core` to work with newer packaging standards. + # - It provides a clear error message when setuptools is not installed. + # - It sets `sys.argv[0]` to the underlying `setup.py`, when invoking `setup.py` so + # setuptools doesn't think the script is `-c`. This avoids the following warning: + # manifest_maker: standard file '-c' not found". + # - It generates a shim setup.py, for handling setup.cfg-only projects. + import os, sys, tokenize, traceback + + try: + import setuptools + except ImportError: + print( + "ERROR: Can not execute `setup.py` since setuptools failed to import in " + "the build environment with exception:", + file=sys.stderr, + ) + traceback.print_exc() + sys.exit(1) + + __file__ = %r + sys.argv[0] = __file__ + + if os.path.exists(__file__): + filename = __file__ + with tokenize.open(__file__) as f: + setup_py_code = f.read() + else: + filename = "" + setup_py_code = "from setuptools import setup; setup()" + + exec(compile(setup_py_code, filename, "exec")) + ''' % ({!r},), "", "exec")) + """ +).rstrip() + + +def make_setuptools_shim_args( + setup_py_path: str, + global_options: Sequence[str] | None = None, + no_user_config: bool = False, + unbuffered_output: bool = False, +) -> list[str]: + """ + Get setuptools command arguments with shim wrapped setup file invocation. + + :param setup_py_path: The path to setup.py to be wrapped. + :param global_options: Additional global options. + :param no_user_config: If True, disables personal user configuration. + :param unbuffered_output: If True, adds the unbuffered switch to the + argument list. + """ + args = [sys.executable] + if unbuffered_output: + args += ["-u"] + args += ["-c", _SETUPTOOLS_SHIM.format(setup_py_path)] + if global_options: + args += global_options + if no_user_config: + args += ["--no-user-cfg"] + return args + + +def make_setuptools_bdist_wheel_args( + setup_py_path: str, + global_options: Sequence[str], + build_options: Sequence[str], + destination_dir: str, +) -> list[str]: + # NOTE: Eventually, we'd want to also -S to the flags here, when we're + # isolating. Currently, it breaks Python in virtualenvs, because it + # relies on site.py to find parts of the standard library outside the + # virtualenv. + args = make_setuptools_shim_args( + setup_py_path, global_options=global_options, unbuffered_output=True + ) + args += ["bdist_wheel", "-d", destination_dir] + args += build_options + return args + + +def make_setuptools_clean_args( + setup_py_path: str, + global_options: Sequence[str], +) -> list[str]: + args = make_setuptools_shim_args( + setup_py_path, global_options=global_options, unbuffered_output=True + ) + args += ["clean", "--all"] + return args + + +def make_setuptools_develop_args( + setup_py_path: str, + *, + global_options: Sequence[str], + no_user_config: bool, + prefix: str | None, + home: str | None, + use_user_site: bool, +) -> list[str]: + assert not (use_user_site and prefix) + + args = make_setuptools_shim_args( + setup_py_path, + global_options=global_options, + no_user_config=no_user_config, + ) + + args += ["develop", "--no-deps"] + + if prefix: + args += ["--prefix", prefix] + if home is not None: + args += ["--install-dir", home] + + if use_user_site: + args += ["--user", "--prefix="] + + return args + + +def make_setuptools_egg_info_args( + setup_py_path: str, + egg_info_dir: str | None, + no_user_config: bool, +) -> list[str]: + args = make_setuptools_shim_args(setup_py_path, no_user_config=no_user_config) + + args += ["egg_info"] + + if egg_info_dir: + args += ["--egg-base", egg_info_dir] + + return args diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/utils/subprocess.py b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/utils/subprocess.py new file mode 100644 index 0000000000000000000000000000000000000000..3e7b83f308cd2fe370247be10d2a3e3dbd6f12a8 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/utils/subprocess.py @@ -0,0 +1,248 @@ +from __future__ import annotations + +import logging +import os +import shlex +import subprocess +from collections.abc import Iterable, Mapping +from typing import Any, Callable, Literal, Union + +from pip._vendor.rich.markup import escape + +from pip._internal.cli.spinners import SpinnerInterface, open_spinner +from pip._internal.exceptions import InstallationSubprocessError +from pip._internal.utils.logging import VERBOSE, subprocess_logger +from pip._internal.utils.misc import HiddenText + +CommandArgs = list[Union[str, HiddenText]] + + +def make_command(*args: str | HiddenText | CommandArgs) -> CommandArgs: + """ + Create a CommandArgs object. + """ + command_args: CommandArgs = [] + for arg in args: + # Check for list instead of CommandArgs since CommandArgs is + # only known during type-checking. + if isinstance(arg, list): + command_args.extend(arg) + else: + # Otherwise, arg is str or HiddenText. + command_args.append(arg) + + return command_args + + +def format_command_args(args: list[str] | CommandArgs) -> str: + """ + Format command arguments for display. + """ + # For HiddenText arguments, display the redacted form by calling str(). + # Also, we don't apply str() to arguments that aren't HiddenText since + # this can trigger a UnicodeDecodeError in Python 2 if the argument + # has type unicode and includes a non-ascii character. (The type + # checker doesn't ensure the annotations are correct in all cases.) + return " ".join( + shlex.quote(str(arg)) if isinstance(arg, HiddenText) else shlex.quote(arg) + for arg in args + ) + + +def reveal_command_args(args: list[str] | CommandArgs) -> list[str]: + """ + Return the arguments in their raw, unredacted form. + """ + return [arg.secret if isinstance(arg, HiddenText) else arg for arg in args] + + +def call_subprocess( + cmd: list[str] | CommandArgs, + show_stdout: bool = False, + cwd: str | None = None, + on_returncode: Literal["raise", "warn", "ignore"] = "raise", + extra_ok_returncodes: Iterable[int] | None = None, + extra_environ: Mapping[str, Any] | None = None, + unset_environ: Iterable[str] | None = None, + spinner: SpinnerInterface | None = None, + log_failed_cmd: bool | None = True, + stdout_only: bool | None = False, + *, + command_desc: str, +) -> str: + """ + Args: + show_stdout: if true, use INFO to log the subprocess's stderr and + stdout streams. Otherwise, use DEBUG. Defaults to False. + extra_ok_returncodes: an iterable of integer return codes that are + acceptable, in addition to 0. Defaults to None, which means []. + unset_environ: an iterable of environment variable names to unset + prior to calling subprocess.Popen(). + log_failed_cmd: if false, failed commands are not logged, only raised. + stdout_only: if true, return only stdout, else return both. When true, + logging of both stdout and stderr occurs when the subprocess has + terminated, else logging occurs as subprocess output is produced. + """ + if extra_ok_returncodes is None: + extra_ok_returncodes = [] + if unset_environ is None: + unset_environ = [] + # Most places in pip use show_stdout=False. What this means is-- + # + # - We connect the child's output (combined stderr and stdout) to a + # single pipe, which we read. + # - We log this output to stderr at DEBUG level as it is received. + # - If DEBUG logging isn't enabled (e.g. if --verbose logging wasn't + # requested), then we show a spinner so the user can still see the + # subprocess is in progress. + # - If the subprocess exits with an error, we log the output to stderr + # at ERROR level if it hasn't already been displayed to the console + # (e.g. if --verbose logging wasn't enabled). This way we don't log + # the output to the console twice. + # + # If show_stdout=True, then the above is still done, but with DEBUG + # replaced by INFO. + if show_stdout: + # Then log the subprocess output at INFO level. + log_subprocess: Callable[..., None] = subprocess_logger.info + used_level = logging.INFO + else: + # Then log the subprocess output using VERBOSE. This also ensures + # it will be logged to the log file (aka user_log), if enabled. + log_subprocess = subprocess_logger.verbose + used_level = VERBOSE + + # Whether the subprocess will be visible in the console. + showing_subprocess = subprocess_logger.getEffectiveLevel() <= used_level + + # Only use the spinner if we're not showing the subprocess output + # and we have a spinner. + use_spinner = not showing_subprocess and spinner is not None + + log_subprocess("Running command %s", command_desc) + env = os.environ.copy() + if extra_environ: + env.update(extra_environ) + for name in unset_environ: + env.pop(name, None) + try: + proc = subprocess.Popen( + # Convert HiddenText objects to the underlying str. + reveal_command_args(cmd), + stdin=subprocess.PIPE, + stdout=subprocess.PIPE, + stderr=subprocess.STDOUT if not stdout_only else subprocess.PIPE, + cwd=cwd, + env=env, + errors="backslashreplace", + ) + except Exception as exc: + if log_failed_cmd: + subprocess_logger.critical( + "Error %s while executing command %s", + exc, + command_desc, + ) + raise + all_output = [] + if not stdout_only: + assert proc.stdout + assert proc.stdin + proc.stdin.close() + # In this mode, stdout and stderr are in the same pipe. + while True: + line: str = proc.stdout.readline() + if not line: + break + line = line.rstrip() + all_output.append(line + "\n") + + # Show the line immediately. + log_subprocess(line) + # Update the spinner. + if use_spinner: + assert spinner + spinner.spin() + try: + proc.wait() + finally: + if proc.stdout: + proc.stdout.close() + output = "".join(all_output) + else: + # In this mode, stdout and stderr are in different pipes. + # We must use communicate() which is the only safe way to read both. + out, err = proc.communicate() + # log line by line to preserve pip log indenting + for out_line in out.splitlines(): + log_subprocess(out_line) + all_output.append(out) + for err_line in err.splitlines(): + log_subprocess(err_line) + all_output.append(err) + output = out + + proc_had_error = proc.returncode and proc.returncode not in extra_ok_returncodes + if use_spinner: + assert spinner + if proc_had_error: + spinner.finish("error") + else: + spinner.finish("done") + if proc_had_error: + if on_returncode == "raise": + error = InstallationSubprocessError( + command_description=command_desc, + exit_code=proc.returncode, + output_lines=all_output if not showing_subprocess else None, + ) + if log_failed_cmd: + subprocess_logger.error("%s", error, extra={"rich": True}) + subprocess_logger.verbose( + "[bold magenta]full command[/]: [blue]%s[/]", + escape(format_command_args(cmd)), + extra={"markup": True}, + ) + subprocess_logger.verbose( + "[bold magenta]cwd[/]: %s", + escape(cwd or "[inherit]"), + extra={"markup": True}, + ) + + raise error + elif on_returncode == "warn": + subprocess_logger.warning( + 'Command "%s" had error code %s in %s', + command_desc, + proc.returncode, + cwd, + ) + elif on_returncode == "ignore": + pass + else: + raise ValueError(f"Invalid value: on_returncode={on_returncode!r}") + return output + + +def runner_with_spinner_message(message: str) -> Callable[..., None]: + """Provide a subprocess_runner that shows a spinner message. + + Intended for use with for BuildBackendHookCaller. Thus, the runner has + an API that matches what's expected by BuildBackendHookCaller.subprocess_runner. + """ + + def runner( + cmd: list[str], + cwd: str | None = None, + extra_environ: Mapping[str, Any] | None = None, + ) -> None: + with open_spinner(message) as spinner: + call_subprocess( + cmd, + command_desc=message, + cwd=cwd, + extra_environ=extra_environ, + spinner=spinner, + ) + + return runner diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/utils/temp_dir.py b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/utils/temp_dir.py new file mode 100644 index 0000000000000000000000000000000000000000..a9afa76c8480fcec19b52e6ded3bc7201da18c5f --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/utils/temp_dir.py @@ -0,0 +1,294 @@ +from __future__ import annotations + +import errno +import itertools +import logging +import os.path +import tempfile +import traceback +from collections.abc import Generator +from contextlib import ExitStack, contextmanager +from pathlib import Path +from typing import ( + Any, + Callable, + TypeVar, +) + +from pip._internal.utils.misc import enum, rmtree + +logger = logging.getLogger(__name__) + +_T = TypeVar("_T", bound="TempDirectory") + + +# Kinds of temporary directories. Only needed for ones that are +# globally-managed. +tempdir_kinds = enum( + BUILD_ENV="build-env", + EPHEM_WHEEL_CACHE="ephem-wheel-cache", + REQ_BUILD="req-build", +) + + +_tempdir_manager: ExitStack | None = None + + +@contextmanager +def global_tempdir_manager() -> Generator[None, None, None]: + global _tempdir_manager + with ExitStack() as stack: + old_tempdir_manager, _tempdir_manager = _tempdir_manager, stack + try: + yield + finally: + _tempdir_manager = old_tempdir_manager + + +class TempDirectoryTypeRegistry: + """Manages temp directory behavior""" + + def __init__(self) -> None: + self._should_delete: dict[str, bool] = {} + + def set_delete(self, kind: str, value: bool) -> None: + """Indicate whether a TempDirectory of the given kind should be + auto-deleted. + """ + self._should_delete[kind] = value + + def get_delete(self, kind: str) -> bool: + """Get configured auto-delete flag for a given TempDirectory type, + default True. + """ + return self._should_delete.get(kind, True) + + +_tempdir_registry: TempDirectoryTypeRegistry | None = None + + +@contextmanager +def tempdir_registry() -> Generator[TempDirectoryTypeRegistry, None, None]: + """Provides a scoped global tempdir registry that can be used to dictate + whether directories should be deleted. + """ + global _tempdir_registry + old_tempdir_registry = _tempdir_registry + _tempdir_registry = TempDirectoryTypeRegistry() + try: + yield _tempdir_registry + finally: + _tempdir_registry = old_tempdir_registry + + +class _Default: + pass + + +_default = _Default() + + +class TempDirectory: + """Helper class that owns and cleans up a temporary directory. + + This class can be used as a context manager or as an OO representation of a + temporary directory. + + Attributes: + path + Location to the created temporary directory + delete + Whether the directory should be deleted when exiting + (when used as a contextmanager) + + Methods: + cleanup() + Deletes the temporary directory + + When used as a context manager, if the delete attribute is True, on + exiting the context the temporary directory is deleted. + """ + + def __init__( + self, + path: str | None = None, + delete: bool | None | _Default = _default, + kind: str = "temp", + globally_managed: bool = False, + ignore_cleanup_errors: bool = True, + ): + super().__init__() + + if delete is _default: + if path is not None: + # If we were given an explicit directory, resolve delete option + # now. + delete = False + else: + # Otherwise, we wait until cleanup and see what + # tempdir_registry says. + delete = None + + # The only time we specify path is in for editables where it + # is the value of the --src option. + if path is None: + path = self._create(kind) + + self._path = path + self._deleted = False + self.delete = delete + self.kind = kind + self.ignore_cleanup_errors = ignore_cleanup_errors + + if globally_managed: + assert _tempdir_manager is not None + _tempdir_manager.enter_context(self) + + @property + def path(self) -> str: + assert not self._deleted, f"Attempted to access deleted path: {self._path}" + return self._path + + def __repr__(self) -> str: + return f"<{self.__class__.__name__} {self.path!r}>" + + def __enter__(self: _T) -> _T: + return self + + def __exit__(self, exc: Any, value: Any, tb: Any) -> None: + if self.delete is not None: + delete = self.delete + elif _tempdir_registry: + delete = _tempdir_registry.get_delete(self.kind) + else: + delete = True + + if delete: + self.cleanup() + + def _create(self, kind: str) -> str: + """Create a temporary directory and store its path in self.path""" + # We realpath here because some systems have their default tmpdir + # symlinked to another directory. This tends to confuse build + # scripts, so we canonicalize the path by traversing potential + # symlinks here. + path = os.path.realpath(tempfile.mkdtemp(prefix=f"pip-{kind}-")) + logger.debug("Created temporary directory: %s", path) + return path + + def cleanup(self) -> None: + """Remove the temporary directory created and reset state""" + self._deleted = True + if not os.path.exists(self._path): + return + + errors: list[BaseException] = [] + + def onerror( + func: Callable[..., Any], + path: Path, + exc_val: BaseException, + ) -> None: + """Log a warning for a `rmtree` error and continue""" + formatted_exc = "\n".join( + traceback.format_exception_only(type(exc_val), exc_val) + ) + formatted_exc = formatted_exc.rstrip() # remove trailing new line + if func in (os.unlink, os.remove, os.rmdir): + logger.debug( + "Failed to remove a temporary file '%s' due to %s.\n", + path, + formatted_exc, + ) + else: + logger.debug("%s failed with %s.", func.__qualname__, formatted_exc) + errors.append(exc_val) + + if self.ignore_cleanup_errors: + try: + # first try with @retry; retrying to handle ephemeral errors + rmtree(self._path, ignore_errors=False) + except OSError: + # last pass ignore/log all errors + rmtree(self._path, onexc=onerror) + if errors: + logger.warning( + "Failed to remove contents in a temporary directory '%s'.\n" + "You can safely remove it manually.", + self._path, + ) + else: + rmtree(self._path) + + +class AdjacentTempDirectory(TempDirectory): + """Helper class that creates a temporary directory adjacent to a real one. + + Attributes: + original + The original directory to create a temp directory for. + path + After calling create() or entering, contains the full + path to the temporary directory. + delete + Whether the directory should be deleted when exiting + (when used as a contextmanager) + + """ + + # The characters that may be used to name the temp directory + # We always prepend a ~ and then rotate through these until + # a usable name is found. + # pkg_resources raises a different error for .dist-info folder + # with leading '-' and invalid metadata + LEADING_CHARS = "-~.=%0123456789" + + def __init__(self, original: str, delete: bool | None = None) -> None: + self.original = original.rstrip("/\\") + super().__init__(delete=delete) + + @classmethod + def _generate_names(cls, name: str) -> Generator[str, None, None]: + """Generates a series of temporary names. + + The algorithm replaces the leading characters in the name + with ones that are valid filesystem characters, but are not + valid package names (for both Python and pip definitions of + package). + """ + for i in range(1, len(name)): + for candidate in itertools.combinations_with_replacement( + cls.LEADING_CHARS, i - 1 + ): + new_name = "~" + "".join(candidate) + name[i:] + if new_name != name: + yield new_name + + # If we make it this far, we will have to make a longer name + for i in range(len(cls.LEADING_CHARS)): + for candidate in itertools.combinations_with_replacement( + cls.LEADING_CHARS, i + ): + new_name = "~" + "".join(candidate) + name + if new_name != name: + yield new_name + + def _create(self, kind: str) -> str: + root, name = os.path.split(self.original) + for candidate in self._generate_names(name): + path = os.path.join(root, candidate) + try: + os.mkdir(path) + except OSError as ex: + # Continue if the name exists already + if ex.errno != errno.EEXIST: + raise + else: + path = os.path.realpath(path) + break + else: + # Final fallback on the default behavior. + path = os.path.realpath(tempfile.mkdtemp(prefix=f"pip-{kind}-")) + + logger.debug("Created temporary directory: %s", path) + return path diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/utils/unpacking.py b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/utils/unpacking.py new file mode 100644 index 0000000000000000000000000000000000000000..0ad3129acf4602e5ed209bf6b52ba795303af33d --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/utils/unpacking.py @@ -0,0 +1,337 @@ +"""Utilities related archives.""" + +from __future__ import annotations + +import logging +import os +import shutil +import stat +import sys +import tarfile +import zipfile +from collections.abc import Iterable +from zipfile import ZipInfo + +from pip._internal.exceptions import InstallationError +from pip._internal.utils.filetypes import ( + BZ2_EXTENSIONS, + TAR_EXTENSIONS, + XZ_EXTENSIONS, + ZIP_EXTENSIONS, +) +from pip._internal.utils.misc import ensure_dir + +logger = logging.getLogger(__name__) + + +SUPPORTED_EXTENSIONS = ZIP_EXTENSIONS + TAR_EXTENSIONS + +try: + import bz2 # noqa + + SUPPORTED_EXTENSIONS += BZ2_EXTENSIONS +except ImportError: + logger.debug("bz2 module is not available") + +try: + # Only for Python 3.3+ + import lzma # noqa + + SUPPORTED_EXTENSIONS += XZ_EXTENSIONS +except ImportError: + logger.debug("lzma module is not available") + + +def current_umask() -> int: + """Get the current umask which involves having to set it temporarily.""" + mask = os.umask(0) + os.umask(mask) + return mask + + +def split_leading_dir(path: str) -> list[str]: + path = path.lstrip("/").lstrip("\\") + if "/" in path and ( + ("\\" in path and path.find("/") < path.find("\\")) or "\\" not in path + ): + return path.split("/", 1) + elif "\\" in path: + return path.split("\\", 1) + else: + return [path, ""] + + +def has_leading_dir(paths: Iterable[str]) -> bool: + """Returns true if all the paths have the same leading path name + (i.e., everything is in one subdirectory in an archive)""" + common_prefix = None + for path in paths: + prefix, rest = split_leading_dir(path) + if not prefix: + return False + elif common_prefix is None: + common_prefix = prefix + elif prefix != common_prefix: + return False + return True + + +def is_within_directory(directory: str, target: str) -> bool: + """ + Return true if the absolute path of target is within the directory + """ + abs_directory = os.path.abspath(directory) + abs_target = os.path.abspath(target) + + prefix = os.path.commonprefix([abs_directory, abs_target]) + return prefix == abs_directory + + +def _get_default_mode_plus_executable() -> int: + return 0o777 & ~current_umask() | 0o111 + + +def set_extracted_file_to_default_mode_plus_executable(path: str) -> None: + """ + Make file present at path have execute for user/group/world + (chmod +x) is no-op on windows per python docs + """ + os.chmod(path, _get_default_mode_plus_executable()) + + +def zip_item_is_executable(info: ZipInfo) -> bool: + mode = info.external_attr >> 16 + # if mode and regular file and any execute permissions for + # user/group/world? + return bool(mode and stat.S_ISREG(mode) and mode & 0o111) + + +def unzip_file(filename: str, location: str, flatten: bool = True) -> None: + """ + Unzip the file (with path `filename`) to the destination `location`. All + files are written based on system defaults and umask (i.e. permissions are + not preserved), except that regular file members with any execute + permissions (user, group, or world) have "chmod +x" applied after being + written. Note that for windows, any execute changes using os.chmod are + no-ops per the python docs. + """ + ensure_dir(location) + zipfp = open(filename, "rb") + try: + zip = zipfile.ZipFile(zipfp, allowZip64=True) + leading = has_leading_dir(zip.namelist()) and flatten + for info in zip.infolist(): + name = info.filename + fn = name + if leading: + fn = split_leading_dir(name)[1] + fn = os.path.join(location, fn) + dir = os.path.dirname(fn) + if not is_within_directory(location, fn): + message = ( + "The zip file ({}) has a file ({}) trying to install " + "outside target directory ({})" + ) + raise InstallationError(message.format(filename, fn, location)) + if fn.endswith(("/", "\\")): + # A directory + ensure_dir(fn) + else: + ensure_dir(dir) + # Don't use read() to avoid allocating an arbitrarily large + # chunk of memory for the file's content + fp = zip.open(name) + try: + with open(fn, "wb") as destfp: + shutil.copyfileobj(fp, destfp) + finally: + fp.close() + if zip_item_is_executable(info): + set_extracted_file_to_default_mode_plus_executable(fn) + finally: + zipfp.close() + + +def untar_file(filename: str, location: str) -> None: + """ + Untar the file (with path `filename`) to the destination `location`. + All files are written based on system defaults and umask (i.e. permissions + are not preserved), except that regular file members with any execute + permissions (user, group, or world) have "chmod +x" applied on top of the + default. Note that for windows, any execute changes using os.chmod are + no-ops per the python docs. + """ + ensure_dir(location) + if filename.lower().endswith(".gz") or filename.lower().endswith(".tgz"): + mode = "r:gz" + elif filename.lower().endswith(BZ2_EXTENSIONS): + mode = "r:bz2" + elif filename.lower().endswith(XZ_EXTENSIONS): + mode = "r:xz" + elif filename.lower().endswith(".tar"): + mode = "r" + else: + logger.warning( + "Cannot determine compression type for file %s", + filename, + ) + mode = "r:*" + + tar = tarfile.open(filename, mode, encoding="utf-8") # type: ignore + try: + leading = has_leading_dir([member.name for member in tar.getmembers()]) + + # PEP 706 added `tarfile.data_filter`, and made some other changes to + # Python's tarfile module (see below). The features were backported to + # security releases. + try: + data_filter = tarfile.data_filter + except AttributeError: + _untar_without_filter(filename, location, tar, leading) + else: + default_mode_plus_executable = _get_default_mode_plus_executable() + + if leading: + # Strip the leading directory from all files in the archive, + # including hardlink targets (which are relative to the + # unpack location). + for member in tar.getmembers(): + name_lead, name_rest = split_leading_dir(member.name) + member.name = name_rest + if member.islnk(): + lnk_lead, lnk_rest = split_leading_dir(member.linkname) + if lnk_lead == name_lead: + member.linkname = lnk_rest + + def pip_filter(member: tarfile.TarInfo, path: str) -> tarfile.TarInfo: + orig_mode = member.mode + try: + try: + member = data_filter(member, location) + except tarfile.LinkOutsideDestinationError: + if sys.version_info[:3] in { + (3, 9, 17), + (3, 10, 12), + (3, 11, 4), + }: + # The tarfile filter in specific Python versions + # raises LinkOutsideDestinationError on valid input + # (https://github.com/python/cpython/issues/107845) + # Ignore the error there, but do use the + # more lax `tar_filter` + member = tarfile.tar_filter(member, location) + else: + raise + except tarfile.TarError as exc: + message = "Invalid member in the tar file {}: {}" + # Filter error messages mention the member name. + # No need to add it here. + raise InstallationError( + message.format( + filename, + exc, + ) + ) + if member.isfile() and orig_mode & 0o111: + member.mode = default_mode_plus_executable + else: + # See PEP 706 note above. + # The PEP changed this from `int` to `Optional[int]`, + # where None means "use the default". Mypy doesn't + # know this yet. + member.mode = None # type: ignore [assignment] + return member + + tar.extractall(location, filter=pip_filter) + + finally: + tar.close() + + +def _untar_without_filter( + filename: str, + location: str, + tar: tarfile.TarFile, + leading: bool, +) -> None: + """Fallback for Python without tarfile.data_filter""" + for member in tar.getmembers(): + fn = member.name + if leading: + fn = split_leading_dir(fn)[1] + path = os.path.join(location, fn) + if not is_within_directory(location, path): + message = ( + "The tar file ({}) has a file ({}) trying to install " + "outside target directory ({})" + ) + raise InstallationError(message.format(filename, path, location)) + if member.isdir(): + ensure_dir(path) + elif member.issym(): + try: + tar._extract_member(member, path) + except Exception as exc: + # Some corrupt tar files seem to produce this + # (specifically bad symlinks) + logger.warning( + "In the tar file %s the member %s is invalid: %s", + filename, + member.name, + exc, + ) + continue + else: + try: + fp = tar.extractfile(member) + except (KeyError, AttributeError) as exc: + # Some corrupt tar files seem to produce this + # (specifically bad symlinks) + logger.warning( + "In the tar file %s the member %s is invalid: %s", + filename, + member.name, + exc, + ) + continue + ensure_dir(os.path.dirname(path)) + assert fp is not None + with open(path, "wb") as destfp: + shutil.copyfileobj(fp, destfp) + fp.close() + # Update the timestamp (useful for cython compiled files) + tar.utime(member, path) + # member have any execute permissions for user/group/world? + if member.mode & 0o111: + set_extracted_file_to_default_mode_plus_executable(path) + + +def unpack_file( + filename: str, + location: str, + content_type: str | None = None, +) -> None: + filename = os.path.realpath(filename) + if ( + content_type == "application/zip" + or filename.lower().endswith(ZIP_EXTENSIONS) + or zipfile.is_zipfile(filename) + ): + unzip_file(filename, location, flatten=not filename.endswith(".whl")) + elif ( + content_type == "application/x-gzip" + or tarfile.is_tarfile(filename) + or filename.lower().endswith(TAR_EXTENSIONS + BZ2_EXTENSIONS + XZ_EXTENSIONS) + ): + untar_file(filename, location) + else: + # FIXME: handle? + # FIXME: magic signatures? + logger.critical( + "Cannot unpack file %s (downloaded from %s, content-type: %s); " + "cannot detect archive format", + filename, + location, + content_type, + ) + raise InstallationError(f"Cannot determine archive format of {location}") diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/utils/urls.py b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/utils/urls.py new file mode 100644 index 0000000000000000000000000000000000000000..e951a5e4e47df1b487b4c8efa5f3162e08404249 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/utils/urls.py @@ -0,0 +1,55 @@ +import os +import string +import urllib.parse +import urllib.request + +from .compat import WINDOWS + + +def path_to_url(path: str) -> str: + """ + Convert a path to a file: URL. The path will be made absolute and have + quoted path parts. + """ + path = os.path.normpath(os.path.abspath(path)) + url = urllib.parse.urljoin("file://", urllib.request.pathname2url(path)) + return url + + +def url_to_path(url: str) -> str: + """ + Convert a file: URL to a path. + """ + assert url.startswith( + "file:" + ), f"You can only turn file: urls into filenames (not {url!r})" + + _, netloc, path, _, _ = urllib.parse.urlsplit(url) + + if not netloc or netloc == "localhost": + # According to RFC 8089, same as empty authority. + netloc = "" + elif WINDOWS: + # If we have a UNC path, prepend UNC share notation. + netloc = "\\\\" + netloc + else: + raise ValueError( + f"non-local file URIs are not supported on this platform: {url!r}" + ) + + path = urllib.request.url2pathname(netloc + path) + + # On Windows, urlsplit parses the path as something like "/C:/Users/foo". + # This creates issues for path-related functions like io.open(), so we try + # to detect and strip the leading slash. + if ( + WINDOWS + and not netloc # Not UNC. + and len(path) >= 3 + and path[0] == "/" # Leading slash to strip. + and path[1] in string.ascii_letters # Drive letter. + and path[2:4] in (":", ":/") # Colon + end of string, or colon + absolute path. + ): + path = path[1:] + + return path diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/utils/virtualenv.py b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/utils/virtualenv.py new file mode 100644 index 0000000000000000000000000000000000000000..b1742a3e9b19392184bab1d561939308f3305d04 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/utils/virtualenv.py @@ -0,0 +1,105 @@ +from __future__ import annotations + +import logging +import os +import re +import site +import sys + +logger = logging.getLogger(__name__) +_INCLUDE_SYSTEM_SITE_PACKAGES_REGEX = re.compile( + r"include-system-site-packages\s*=\s*(?Ptrue|false)" +) + + +def _running_under_venv() -> bool: + """Checks if sys.base_prefix and sys.prefix match. + + This handles PEP 405 compliant virtual environments. + """ + return sys.prefix != getattr(sys, "base_prefix", sys.prefix) + + +def _running_under_legacy_virtualenv() -> bool: + """Checks if sys.real_prefix is set. + + This handles virtual environments created with pypa's virtualenv. + """ + # pypa/virtualenv case + return hasattr(sys, "real_prefix") + + +def running_under_virtualenv() -> bool: + """True if we're running inside a virtual environment, False otherwise.""" + return _running_under_venv() or _running_under_legacy_virtualenv() + + +def _get_pyvenv_cfg_lines() -> list[str] | None: + """Reads {sys.prefix}/pyvenv.cfg and returns its contents as list of lines + + Returns None, if it could not read/access the file. + """ + pyvenv_cfg_file = os.path.join(sys.prefix, "pyvenv.cfg") + try: + # Although PEP 405 does not specify, the built-in venv module always + # writes with UTF-8. (pypa/pip#8717) + with open(pyvenv_cfg_file, encoding="utf-8") as f: + return f.read().splitlines() # avoids trailing newlines + except OSError: + return None + + +def _no_global_under_venv() -> bool: + """Check `{sys.prefix}/pyvenv.cfg` for system site-packages inclusion + + PEP 405 specifies that when system site-packages are not supposed to be + visible from a virtual environment, `pyvenv.cfg` must contain the following + line: + + include-system-site-packages = false + + Additionally, log a warning if accessing the file fails. + """ + cfg_lines = _get_pyvenv_cfg_lines() + if cfg_lines is None: + # We're not in a "sane" venv, so assume there is no system + # site-packages access (since that's PEP 405's default state). + logger.warning( + "Could not access 'pyvenv.cfg' despite a virtual environment " + "being active. Assuming global site-packages is not accessible " + "in this environment." + ) + return True + + for line in cfg_lines: + match = _INCLUDE_SYSTEM_SITE_PACKAGES_REGEX.match(line) + if match is not None and match.group("value") == "false": + return True + return False + + +def _no_global_under_legacy_virtualenv() -> bool: + """Check if "no-global-site-packages.txt" exists beside site.py + + This mirrors logic in pypa/virtualenv for determining whether system + site-packages are visible in the virtual environment. + """ + site_mod_dir = os.path.dirname(os.path.abspath(site.__file__)) + no_global_site_packages_file = os.path.join( + site_mod_dir, + "no-global-site-packages.txt", + ) + return os.path.exists(no_global_site_packages_file) + + +def virtualenv_no_global() -> bool: + """Returns a boolean, whether running in venv with no system site-packages.""" + # PEP 405 compliance needs to be checked first since virtualenv >=20 would + # return True for both checks, but is only able to use the PEP 405 config. + if _running_under_venv(): + return _no_global_under_venv() + + if _running_under_legacy_virtualenv(): + return _no_global_under_legacy_virtualenv() + + return False diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/utils/wheel.py b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/utils/wheel.py new file mode 100644 index 0000000000000000000000000000000000000000..789e73629afb7f0984a2fe04f7b98d5395e48a11 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/utils/wheel.py @@ -0,0 +1,132 @@ +"""Support functions for working with wheel files.""" + +import logging +from email.message import Message +from email.parser import Parser +from zipfile import BadZipFile, ZipFile + +from pip._vendor.packaging.utils import canonicalize_name + +from pip._internal.exceptions import UnsupportedWheel + +VERSION_COMPATIBLE = (1, 0) + + +logger = logging.getLogger(__name__) + + +def parse_wheel(wheel_zip: ZipFile, name: str) -> tuple[str, Message]: + """Extract information from the provided wheel, ensuring it meets basic + standards. + + Returns the name of the .dist-info directory and the parsed WHEEL metadata. + """ + try: + info_dir = wheel_dist_info_dir(wheel_zip, name) + metadata = wheel_metadata(wheel_zip, info_dir) + version = wheel_version(metadata) + except UnsupportedWheel as e: + raise UnsupportedWheel(f"{name} has an invalid wheel, {e}") + + check_compatibility(version, name) + + return info_dir, metadata + + +def wheel_dist_info_dir(source: ZipFile, name: str) -> str: + """Returns the name of the contained .dist-info directory. + + Raises AssertionError or UnsupportedWheel if not found, >1 found, or + it doesn't match the provided name. + """ + # Zip file path separators must be / + subdirs = {p.split("/", 1)[0] for p in source.namelist()} + + info_dirs = [s for s in subdirs if s.endswith(".dist-info")] + + if not info_dirs: + raise UnsupportedWheel(".dist-info directory not found") + + if len(info_dirs) > 1: + raise UnsupportedWheel( + "multiple .dist-info directories found: {}".format(", ".join(info_dirs)) + ) + + info_dir = info_dirs[0] + + info_dir_name = canonicalize_name(info_dir) + canonical_name = canonicalize_name(name) + if not info_dir_name.startswith(canonical_name): + raise UnsupportedWheel( + f".dist-info directory {info_dir!r} does not start with {canonical_name!r}" + ) + + return info_dir + + +def read_wheel_metadata_file(source: ZipFile, path: str) -> bytes: + try: + return source.read(path) + # BadZipFile for general corruption, KeyError for missing entry, + # and RuntimeError for password-protected files + except (BadZipFile, KeyError, RuntimeError) as e: + raise UnsupportedWheel(f"could not read {path!r} file: {e!r}") + + +def wheel_metadata(source: ZipFile, dist_info_dir: str) -> Message: + """Return the WHEEL metadata of an extracted wheel, if possible. + Otherwise, raise UnsupportedWheel. + """ + path = f"{dist_info_dir}/WHEEL" + # Zip file path separators must be / + wheel_contents = read_wheel_metadata_file(source, path) + + try: + wheel_text = wheel_contents.decode() + except UnicodeDecodeError as e: + raise UnsupportedWheel(f"error decoding {path!r}: {e!r}") + + # FeedParser (used by Parser) does not raise any exceptions. The returned + # message may have .defects populated, but for backwards-compatibility we + # currently ignore them. + return Parser().parsestr(wheel_text) + + +def wheel_version(wheel_data: Message) -> tuple[int, ...]: + """Given WHEEL metadata, return the parsed Wheel-Version. + Otherwise, raise UnsupportedWheel. + """ + version_text = wheel_data["Wheel-Version"] + if version_text is None: + raise UnsupportedWheel("WHEEL is missing Wheel-Version") + + version = version_text.strip() + + try: + return tuple(map(int, version.split("."))) + except ValueError: + raise UnsupportedWheel(f"invalid Wheel-Version: {version!r}") + + +def check_compatibility(version: tuple[int, ...], name: str) -> None: + """Raises errors or warns if called with an incompatible Wheel-Version. + + pip should refuse to install a Wheel-Version that's a major series + ahead of what it's compatible with (e.g 2.0 > 1.1); and warn when + installing a version only minor version ahead (e.g 1.2 > 1.1). + + version: a 2-tuple representing a Wheel-Version (Major, Minor) + name: name of wheel or package to raise exception about + + :raises UnsupportedWheel: when an incompatible Wheel-Version is given + """ + if version[0] > VERSION_COMPATIBLE[0]: + raise UnsupportedWheel( + "{}'s Wheel-Version ({}) is not compatible with this version " + "of pip".format(name, ".".join(map(str, version))) + ) + elif version > VERSION_COMPATIBLE: + logger.warning( + "Installing from a newer Wheel-Version (%s)", + ".".join(map(str, version)), + ) diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/vcs/__init__.py b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/vcs/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..b6beddbe6d24d2949dc89ed07abfebd59d8b63b9 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/vcs/__init__.py @@ -0,0 +1,15 @@ +# Expose a limited set of classes and functions so callers outside of +# the vcs package don't need to import deeper than `pip._internal.vcs`. +# (The test directory may still need to import from a vcs sub-package.) +# Import all vcs modules to register each VCS in the VcsSupport object. +import pip._internal.vcs.bazaar +import pip._internal.vcs.git +import pip._internal.vcs.mercurial +import pip._internal.vcs.subversion # noqa: F401 +from pip._internal.vcs.versioncontrol import ( # noqa: F401 + RemoteNotFoundError, + RemoteNotValidError, + is_url, + make_vcs_requirement_url, + vcs, +) diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/vcs/bazaar.py b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/vcs/bazaar.py new file mode 100644 index 0000000000000000000000000000000000000000..3a8a21e62518768e3476452c554a8f9d2546f43c --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/vcs/bazaar.py @@ -0,0 +1,130 @@ +from __future__ import annotations + +import logging + +from pip._internal.utils.misc import HiddenText, display_path +from pip._internal.utils.subprocess import make_command +from pip._internal.utils.urls import path_to_url +from pip._internal.vcs.versioncontrol import ( + AuthInfo, + RemoteNotFoundError, + RevOptions, + VersionControl, + vcs, +) + +logger = logging.getLogger(__name__) + + +class Bazaar(VersionControl): + name = "bzr" + dirname = ".bzr" + repo_name = "branch" + schemes = ( + "bzr+http", + "bzr+https", + "bzr+ssh", + "bzr+sftp", + "bzr+ftp", + "bzr+lp", + "bzr+file", + ) + + @staticmethod + def get_base_rev_args(rev: str) -> list[str]: + return ["-r", rev] + + def fetch_new( + self, dest: str, url: HiddenText, rev_options: RevOptions, verbosity: int + ) -> None: + rev_display = rev_options.to_display() + logger.info( + "Checking out %s%s to %s", + url, + rev_display, + display_path(dest), + ) + if verbosity <= 0: + flags = ["--quiet"] + elif verbosity == 1: + flags = [] + else: + flags = [f"-{'v'*verbosity}"] + cmd_args = make_command( + "checkout", "--lightweight", *flags, rev_options.to_args(), url, dest + ) + self.run_command(cmd_args) + + def switch( + self, + dest: str, + url: HiddenText, + rev_options: RevOptions, + verbosity: int = 0, + ) -> None: + self.run_command(make_command("switch", url), cwd=dest) + + def update( + self, + dest: str, + url: HiddenText, + rev_options: RevOptions, + verbosity: int = 0, + ) -> None: + flags = [] + + if verbosity <= 0: + flags.append("-q") + + output = self.run_command( + make_command("info"), show_stdout=False, stdout_only=True, cwd=dest + ) + if output.startswith("Standalone "): + # Older versions of pip used to create standalone branches. + # Convert the standalone branch to a checkout by calling "bzr bind". + cmd_args = make_command("bind", *flags, url) + self.run_command(cmd_args, cwd=dest) + + cmd_args = make_command("update", *flags, rev_options.to_args()) + self.run_command(cmd_args, cwd=dest) + + @classmethod + def get_url_rev_and_auth(cls, url: str) -> tuple[str, str | None, AuthInfo]: + # hotfix the URL scheme after removing bzr+ from bzr+ssh:// re-add it + url, rev, user_pass = super().get_url_rev_and_auth(url) + if url.startswith("ssh://"): + url = "bzr+" + url + return url, rev, user_pass + + @classmethod + def get_remote_url(cls, location: str) -> str: + urls = cls.run_command( + ["info"], show_stdout=False, stdout_only=True, cwd=location + ) + for line in urls.splitlines(): + line = line.strip() + for x in ("checkout of branch: ", "parent branch: "): + if line.startswith(x): + repo = line.split(x)[1] + if cls._is_local_repository(repo): + return path_to_url(repo) + return repo + raise RemoteNotFoundError + + @classmethod + def get_revision(cls, location: str) -> str: + revision = cls.run_command( + ["revno"], + show_stdout=False, + stdout_only=True, + cwd=location, + ) + return revision.splitlines()[-1] + + @classmethod + def is_commit_id_equal(cls, dest: str, name: str | None) -> bool: + """Always assume the versions don't match""" + return False + + +vcs.register(Bazaar) diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/vcs/git.py b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/vcs/git.py new file mode 100644 index 0000000000000000000000000000000000000000..1769da791cb6c70eefb841e81df7482823cb21d0 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/vcs/git.py @@ -0,0 +1,571 @@ +from __future__ import annotations + +import logging +import os.path +import pathlib +import re +import urllib.parse +import urllib.request +from dataclasses import replace +from typing import Any + +from pip._internal.exceptions import BadCommand, InstallationError +from pip._internal.utils.misc import HiddenText, display_path, hide_url +from pip._internal.utils.subprocess import make_command +from pip._internal.vcs.versioncontrol import ( + AuthInfo, + RemoteNotFoundError, + RemoteNotValidError, + RevOptions, + VersionControl, + find_path_to_project_root_from_repo_root, + vcs, +) + +urlsplit = urllib.parse.urlsplit +urlunsplit = urllib.parse.urlunsplit + + +logger = logging.getLogger(__name__) + + +GIT_VERSION_REGEX = re.compile( + r"^git version " # Prefix. + r"(\d+)" # Major. + r"\.(\d+)" # Dot, minor. + r"(?:\.(\d+))?" # Optional dot, patch. + r".*$" # Suffix, including any pre- and post-release segments we don't care about. +) + +HASH_REGEX = re.compile("^[a-fA-F0-9]{40}$") + +# SCP (Secure copy protocol) shorthand. e.g. 'git@example.com:foo/bar.git' +SCP_REGEX = re.compile( + r"""^ + # Optional user, e.g. 'git@' + (\w+@)? + # Server, e.g. 'github.com'. + ([^/:]+): + # The server-side path. e.g. 'user/project.git'. Must start with an + # alphanumeric character so as not to be confusable with a Windows paths + # like 'C:/foo/bar' or 'C:\foo\bar'. + (\w[^:]*) + $""", + re.VERBOSE, +) + + +def looks_like_hash(sha: str) -> bool: + return bool(HASH_REGEX.match(sha)) + + +class Git(VersionControl): + name = "git" + dirname = ".git" + repo_name = "clone" + schemes = ( + "git+http", + "git+https", + "git+ssh", + "git+git", + "git+file", + ) + # Prevent the user's environment variables from interfering with pip: + # https://github.com/pypa/pip/issues/1130 + unset_environ = ("GIT_DIR", "GIT_WORK_TREE") + default_arg_rev = "HEAD" + + @staticmethod + def get_base_rev_args(rev: str) -> list[str]: + return [rev] + + @classmethod + def run_command(cls, *args: Any, **kwargs: Any) -> str: + if os.environ.get("PIP_NO_INPUT"): + extra_environ = kwargs.get("extra_environ", {}) + extra_environ["GIT_TERMINAL_PROMPT"] = "0" + extra_environ["GIT_SSH_COMMAND"] = "ssh -oBatchMode=yes" + kwargs["extra_environ"] = extra_environ + return super().run_command(*args, **kwargs) + + def is_immutable_rev_checkout(self, url: str, dest: str) -> bool: + _, rev_options = self.get_url_rev_options(hide_url(url)) + if not rev_options.rev: + return False + if not self.is_commit_id_equal(dest, rev_options.rev): + # the current commit is different from rev, + # which means rev was something else than a commit hash + return False + # return False in the rare case rev is both a commit hash + # and a tag or a branch; we don't want to cache in that case + # because that branch/tag could point to something else in the future + is_tag_or_branch = bool(self.get_revision_sha(dest, rev_options.rev)[0]) + return not is_tag_or_branch + + def get_git_version(self) -> tuple[int, ...]: + version = self.run_command( + ["version"], + command_desc="git version", + show_stdout=False, + stdout_only=True, + ) + match = GIT_VERSION_REGEX.match(version) + if not match: + logger.warning("Can't parse git version: %s", version) + return () + return (int(match.group(1)), int(match.group(2))) + + @classmethod + def get_current_branch(cls, location: str) -> str | None: + """ + Return the current branch, or None if HEAD isn't at a branch + (e.g. detached HEAD). + """ + # git-symbolic-ref exits with empty stdout if "HEAD" is a detached + # HEAD rather than a symbolic ref. In addition, the -q causes the + # command to exit with status code 1 instead of 128 in this case + # and to suppress the message to stderr. + args = ["symbolic-ref", "-q", "HEAD"] + output = cls.run_command( + args, + extra_ok_returncodes=(1,), + show_stdout=False, + stdout_only=True, + cwd=location, + ) + ref = output.strip() + + if ref.startswith("refs/heads/"): + return ref[len("refs/heads/") :] + + return None + + @classmethod + def get_revision_sha(cls, dest: str, rev: str) -> tuple[str | None, bool]: + """ + Return (sha_or_none, is_branch), where sha_or_none is a commit hash + if the revision names a remote branch or tag, otherwise None. + + Args: + dest: the repository directory. + rev: the revision name. + """ + # Pass rev to pre-filter the list. + output = cls.run_command( + ["show-ref", rev], + cwd=dest, + show_stdout=False, + stdout_only=True, + on_returncode="ignore", + ) + refs = {} + # NOTE: We do not use splitlines here since that would split on other + # unicode separators, which can be maliciously used to install a + # different revision. + for line in output.strip().split("\n"): + line = line.rstrip("\r") + if not line: + continue + try: + ref_sha, ref_name = line.split(" ", maxsplit=2) + except ValueError: + # Include the offending line to simplify troubleshooting if + # this error ever occurs. + raise ValueError(f"unexpected show-ref line: {line!r}") + + refs[ref_name] = ref_sha + + branch_ref = f"refs/remotes/origin/{rev}" + tag_ref = f"refs/tags/{rev}" + + sha = refs.get(branch_ref) + if sha is not None: + return (sha, True) + + sha = refs.get(tag_ref) + + return (sha, False) + + @classmethod + def _should_fetch(cls, dest: str, rev: str) -> bool: + """ + Return true if rev is a ref or is a commit that we don't have locally. + + Branches and tags are not considered in this method because they are + assumed to be always available locally (which is a normal outcome of + ``git clone`` and ``git fetch --tags``). + """ + if rev.startswith("refs/"): + # Always fetch remote refs. + return True + + if not looks_like_hash(rev): + # Git fetch would fail with abbreviated commits. + return False + + if cls.has_commit(dest, rev): + # Don't fetch if we have the commit locally. + return False + + return True + + @classmethod + def resolve_revision( + cls, dest: str, url: HiddenText, rev_options: RevOptions + ) -> RevOptions: + """ + Resolve a revision to a new RevOptions object with the SHA1 of the + branch, tag, or ref if found. + + Args: + rev_options: a RevOptions object. + """ + rev = rev_options.arg_rev + # The arg_rev property's implementation for Git ensures that the + # rev return value is always non-None. + assert rev is not None + + sha, is_branch = cls.get_revision_sha(dest, rev) + + if sha is not None: + rev_options = rev_options.make_new(sha) + rev_options = replace(rev_options, branch_name=(rev if is_branch else None)) + + return rev_options + + # Do not show a warning for the common case of something that has + # the form of a Git commit hash. + if not looks_like_hash(rev): + logger.info( + "Did not find branch or tag '%s', assuming revision or ref.", + rev, + ) + + if not cls._should_fetch(dest, rev): + return rev_options + + # fetch the requested revision + cls.run_command( + make_command("fetch", "-q", url, rev_options.to_args()), + cwd=dest, + ) + # Change the revision to the SHA of the ref we fetched + sha = cls.get_revision(dest, rev="FETCH_HEAD") + rev_options = rev_options.make_new(sha) + + return rev_options + + @classmethod + def is_commit_id_equal(cls, dest: str, name: str | None) -> bool: + """ + Return whether the current commit hash equals the given name. + + Args: + dest: the repository directory. + name: a string name. + """ + if not name: + # Then avoid an unnecessary subprocess call. + return False + + return cls.get_revision(dest) == name + + def fetch_new( + self, dest: str, url: HiddenText, rev_options: RevOptions, verbosity: int + ) -> None: + rev_display = rev_options.to_display() + logger.info("Cloning %s%s to %s", url, rev_display, display_path(dest)) + if verbosity <= 0: + flags: tuple[str, ...] = ("--quiet",) + elif verbosity == 1: + flags = () + else: + flags = ("--verbose", "--progress") + if self.get_git_version() >= (2, 17): + # Git added support for partial clone in 2.17 + # https://git-scm.com/docs/partial-clone + # Speeds up cloning by functioning without a complete copy of repository + self.run_command( + make_command( + "clone", + "--filter=blob:none", + *flags, + url, + dest, + ) + ) + else: + self.run_command(make_command("clone", *flags, url, dest)) + + if rev_options.rev: + # Then a specific revision was requested. + rev_options = self.resolve_revision(dest, url, rev_options) + branch_name = getattr(rev_options, "branch_name", None) + logger.debug("Rev options %s, branch_name %s", rev_options, branch_name) + if branch_name is None: + # Only do a checkout if the current commit id doesn't match + # the requested revision. + if not self.is_commit_id_equal(dest, rev_options.rev): + cmd_args = make_command( + "checkout", + "-q", + rev_options.to_args(), + ) + self.run_command(cmd_args, cwd=dest) + elif self.get_current_branch(dest) != branch_name: + # Then a specific branch was requested, and that branch + # is not yet checked out. + track_branch = f"origin/{branch_name}" + cmd_args = [ + "checkout", + "-b", + branch_name, + "--track", + track_branch, + ] + self.run_command(cmd_args, cwd=dest) + else: + sha = self.get_revision(dest) + rev_options = rev_options.make_new(sha) + + logger.info("Resolved %s to commit %s", url, rev_options.rev) + + #: repo may contain submodules + self.update_submodules(dest, verbosity=verbosity) + + def switch( + self, + dest: str, + url: HiddenText, + rev_options: RevOptions, + verbosity: int = 0, + ) -> None: + self.run_command( + make_command("config", "remote.origin.url", url), + cwd=dest, + ) + + extra_flags = [] + + if verbosity <= 0: + extra_flags.append("-q") + + cmd_args = make_command("checkout", *extra_flags, rev_options.to_args()) + self.run_command(cmd_args, cwd=dest) + + self.update_submodules(dest, verbosity=verbosity) + + def update( + self, + dest: str, + url: HiddenText, + rev_options: RevOptions, + verbosity: int = 0, + ) -> None: + extra_flags = [] + + if verbosity <= 0: + extra_flags.append("-q") + + # First fetch changes from the default remote + if self.get_git_version() >= (1, 9): + # fetch tags in addition to everything else + self.run_command(["fetch", "--tags", *extra_flags], cwd=dest) + else: + self.run_command(["fetch", *extra_flags], cwd=dest) + # Then reset to wanted revision (maybe even origin/master) + rev_options = self.resolve_revision(dest, url, rev_options) + cmd_args = make_command( + "reset", + "--hard", + *extra_flags, + rev_options.to_args(), + ) + self.run_command(cmd_args, cwd=dest) + #: update submodules + self.update_submodules(dest, verbosity=verbosity) + + @classmethod + def get_remote_url(cls, location: str) -> str: + """ + Return URL of the first remote encountered. + + Raises RemoteNotFoundError if the repository does not have a remote + url configured. + """ + # We need to pass 1 for extra_ok_returncodes since the command + # exits with return code 1 if there are no matching lines. + stdout = cls.run_command( + ["config", "--get-regexp", r"remote\..*\.url"], + extra_ok_returncodes=(1,), + show_stdout=False, + stdout_only=True, + cwd=location, + ) + remotes = stdout.splitlines() + try: + found_remote = remotes[0] + except IndexError: + raise RemoteNotFoundError + + for remote in remotes: + if remote.startswith("remote.origin.url "): + found_remote = remote + break + url = found_remote.split(" ")[1] + return cls._git_remote_to_pip_url(url.strip()) + + @staticmethod + def _git_remote_to_pip_url(url: str) -> str: + """ + Convert a remote url from what git uses to what pip accepts. + + There are 3 legal forms **url** may take: + + 1. A fully qualified url: ssh://git@example.com/foo/bar.git + 2. A local project.git folder: /path/to/bare/repository.git + 3. SCP shorthand for form 1: git@example.com:foo/bar.git + + Form 1 is output as-is. Form 2 must be converted to URI and form 3 must + be converted to form 1. + + See the corresponding test test_git_remote_url_to_pip() for examples of + sample inputs/outputs. + """ + if re.match(r"\w+://", url): + # This is already valid. Pass it though as-is. + return url + if os.path.exists(url): + # A local bare remote (git clone --mirror). + # Needs a file:// prefix. + return pathlib.PurePath(url).as_uri() + scp_match = SCP_REGEX.match(url) + if scp_match: + # Add an ssh:// prefix and replace the ':' with a '/'. + return scp_match.expand(r"ssh://\1\2/\3") + # Otherwise, bail out. + raise RemoteNotValidError(url) + + @classmethod + def has_commit(cls, location: str, rev: str) -> bool: + """ + Check if rev is a commit that is available in the local repository. + """ + try: + cls.run_command( + ["rev-parse", "-q", "--verify", "sha^" + rev], + cwd=location, + log_failed_cmd=False, + ) + except InstallationError: + return False + else: + return True + + @classmethod + def get_revision(cls, location: str, rev: str | None = None) -> str: + if rev is None: + rev = "HEAD" + current_rev = cls.run_command( + ["rev-parse", rev], + show_stdout=False, + stdout_only=True, + cwd=location, + ) + return current_rev.strip() + + @classmethod + def get_subdirectory(cls, location: str) -> str | None: + """ + Return the path to Python project root, relative to the repo root. + Return None if the project root is in the repo root. + """ + # find the repo root + git_dir = cls.run_command( + ["rev-parse", "--git-dir"], + show_stdout=False, + stdout_only=True, + cwd=location, + ).strip() + if not os.path.isabs(git_dir): + git_dir = os.path.join(location, git_dir) + repo_root = os.path.abspath(os.path.join(git_dir, "..")) + return find_path_to_project_root_from_repo_root(location, repo_root) + + @classmethod + def get_url_rev_and_auth(cls, url: str) -> tuple[str, str | None, AuthInfo]: + """ + Prefixes stub URLs like 'user@hostname:user/repo.git' with 'ssh://'. + That's required because although they use SSH they sometimes don't + work with a ssh:// scheme (e.g. GitHub). But we need a scheme for + parsing. Hence we remove it again afterwards and return it as a stub. + """ + # Works around an apparent Git bug + # (see https://article.gmane.org/gmane.comp.version-control.git/146500) + scheme, netloc, path, query, fragment = urlsplit(url) + if scheme.endswith("file"): + initial_slashes = path[: -len(path.lstrip("/"))] + newpath = initial_slashes + urllib.request.url2pathname(path).replace( + "\\", "/" + ).lstrip("/") + after_plus = scheme.find("+") + 1 + url = scheme[:after_plus] + urlunsplit( + (scheme[after_plus:], netloc, newpath, query, fragment), + ) + + if "://" not in url: + assert "file:" not in url + url = url.replace("git+", "git+ssh://") + url, rev, user_pass = super().get_url_rev_and_auth(url) + url = url.replace("ssh://", "") + else: + url, rev, user_pass = super().get_url_rev_and_auth(url) + + return url, rev, user_pass + + @classmethod + def update_submodules(cls, location: str, verbosity: int = 0) -> None: + argv = ["submodule", "update", "--init", "--recursive"] + + if verbosity <= 0: + argv.append("-q") + + if not os.path.exists(os.path.join(location, ".gitmodules")): + return + cls.run_command( + argv, + cwd=location, + ) + + @classmethod + def get_repository_root(cls, location: str) -> str | None: + loc = super().get_repository_root(location) + if loc: + return loc + try: + r = cls.run_command( + ["rev-parse", "--show-toplevel"], + cwd=location, + show_stdout=False, + stdout_only=True, + on_returncode="raise", + log_failed_cmd=False, + ) + except BadCommand: + logger.debug( + "could not determine if %s is under git control " + "because git is not available", + location, + ) + return None + except InstallationError: + return None + return os.path.normpath(r.rstrip("\r\n")) + + @staticmethod + def should_add_vcs_url_prefix(repo_url: str) -> bool: + """In either https or ssh form, requirements must be prefixed with git+.""" + return True + + +vcs.register(Git) diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/vcs/mercurial.py b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/vcs/mercurial.py new file mode 100644 index 0000000000000000000000000000000000000000..c875803164ee5fe220be7ab4486ef1c66427cebd --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/vcs/mercurial.py @@ -0,0 +1,186 @@ +from __future__ import annotations + +import configparser +import logging +import os + +from pip._internal.exceptions import BadCommand, InstallationError +from pip._internal.utils.misc import HiddenText, display_path +from pip._internal.utils.subprocess import make_command +from pip._internal.utils.urls import path_to_url +from pip._internal.vcs.versioncontrol import ( + RevOptions, + VersionControl, + find_path_to_project_root_from_repo_root, + vcs, +) + +logger = logging.getLogger(__name__) + + +class Mercurial(VersionControl): + name = "hg" + dirname = ".hg" + repo_name = "clone" + schemes = ( + "hg+file", + "hg+http", + "hg+https", + "hg+ssh", + "hg+static-http", + ) + + @staticmethod + def get_base_rev_args(rev: str) -> list[str]: + return [f"--rev={rev}"] + + def fetch_new( + self, dest: str, url: HiddenText, rev_options: RevOptions, verbosity: int + ) -> None: + rev_display = rev_options.to_display() + logger.info( + "Cloning hg %s%s to %s", + url, + rev_display, + display_path(dest), + ) + if verbosity <= 0: + flags: tuple[str, ...] = ("--quiet",) + elif verbosity == 1: + flags = () + elif verbosity == 2: + flags = ("--verbose",) + else: + flags = ("--verbose", "--debug") + self.run_command(make_command("clone", "--noupdate", *flags, url, dest)) + self.run_command( + make_command("update", *flags, rev_options.to_args()), + cwd=dest, + ) + + def switch( + self, + dest: str, + url: HiddenText, + rev_options: RevOptions, + verbosity: int = 0, + ) -> None: + extra_flags = [] + repo_config = os.path.join(dest, self.dirname, "hgrc") + config = configparser.RawConfigParser() + + if verbosity <= 0: + extra_flags.append("-q") + + try: + config.read(repo_config) + config.set("paths", "default", url.secret) + with open(repo_config, "w") as config_file: + config.write(config_file) + except (OSError, configparser.NoSectionError) as exc: + logger.warning("Could not switch Mercurial repository to %s: %s", url, exc) + else: + cmd_args = make_command("update", *extra_flags, rev_options.to_args()) + self.run_command(cmd_args, cwd=dest) + + def update( + self, + dest: str, + url: HiddenText, + rev_options: RevOptions, + verbosity: int = 0, + ) -> None: + extra_flags = [] + + if verbosity <= 0: + extra_flags.append("-q") + + self.run_command(["pull", *extra_flags], cwd=dest) + cmd_args = make_command("update", *extra_flags, rev_options.to_args()) + self.run_command(cmd_args, cwd=dest) + + @classmethod + def get_remote_url(cls, location: str) -> str: + url = cls.run_command( + ["showconfig", "paths.default"], + show_stdout=False, + stdout_only=True, + cwd=location, + ).strip() + if cls._is_local_repository(url): + url = path_to_url(url) + return url.strip() + + @classmethod + def get_revision(cls, location: str) -> str: + """ + Return the repository-local changeset revision number, as an integer. + """ + current_revision = cls.run_command( + ["parents", "--template={rev}"], + show_stdout=False, + stdout_only=True, + cwd=location, + ).strip() + return current_revision + + @classmethod + def get_requirement_revision(cls, location: str) -> str: + """ + Return the changeset identification hash, as a 40-character + hexadecimal string + """ + current_rev_hash = cls.run_command( + ["parents", "--template={node}"], + show_stdout=False, + stdout_only=True, + cwd=location, + ).strip() + return current_rev_hash + + @classmethod + def is_commit_id_equal(cls, dest: str, name: str | None) -> bool: + """Always assume the versions don't match""" + return False + + @classmethod + def get_subdirectory(cls, location: str) -> str | None: + """ + Return the path to Python project root, relative to the repo root. + Return None if the project root is in the repo root. + """ + # find the repo root + repo_root = cls.run_command( + ["root"], show_stdout=False, stdout_only=True, cwd=location + ).strip() + if not os.path.isabs(repo_root): + repo_root = os.path.abspath(os.path.join(location, repo_root)) + return find_path_to_project_root_from_repo_root(location, repo_root) + + @classmethod + def get_repository_root(cls, location: str) -> str | None: + loc = super().get_repository_root(location) + if loc: + return loc + try: + r = cls.run_command( + ["root"], + cwd=location, + show_stdout=False, + stdout_only=True, + on_returncode="raise", + log_failed_cmd=False, + ) + except BadCommand: + logger.debug( + "could not determine if %s is under hg control " + "because hg is not available", + location, + ) + return None + except InstallationError: + return None + return os.path.normpath(r.rstrip("\r\n")) + + +vcs.register(Mercurial) diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/vcs/subversion.py b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/vcs/subversion.py new file mode 100644 index 0000000000000000000000000000000000000000..579f428c8ca63a99949f659ceb664dda4b881f32 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/vcs/subversion.py @@ -0,0 +1,335 @@ +from __future__ import annotations + +import logging +import os +import re + +from pip._internal.utils.misc import ( + HiddenText, + display_path, + is_console_interactive, + is_installable_dir, + split_auth_from_netloc, +) +from pip._internal.utils.subprocess import CommandArgs, make_command +from pip._internal.vcs.versioncontrol import ( + AuthInfo, + RemoteNotFoundError, + RevOptions, + VersionControl, + vcs, +) + +logger = logging.getLogger(__name__) + +_svn_xml_url_re = re.compile('url="([^"]+)"') +_svn_rev_re = re.compile(r'committed-rev="(\d+)"') +_svn_info_xml_rev_re = re.compile(r'\s*revision="(\d+)"') +_svn_info_xml_url_re = re.compile(r"(.*)") + + +class Subversion(VersionControl): + name = "svn" + dirname = ".svn" + repo_name = "checkout" + schemes = ("svn+ssh", "svn+http", "svn+https", "svn+svn", "svn+file") + + @classmethod + def should_add_vcs_url_prefix(cls, remote_url: str) -> bool: + return True + + @staticmethod + def get_base_rev_args(rev: str) -> list[str]: + return ["-r", rev] + + @classmethod + def get_revision(cls, location: str) -> str: + """ + Return the maximum revision for all files under a given location + """ + # Note: taken from setuptools.command.egg_info + revision = 0 + + for base, dirs, _ in os.walk(location): + if cls.dirname not in dirs: + dirs[:] = [] + continue # no sense walking uncontrolled subdirs + dirs.remove(cls.dirname) + entries_fn = os.path.join(base, cls.dirname, "entries") + if not os.path.exists(entries_fn): + # FIXME: should we warn? + continue + + dirurl, localrev = cls._get_svn_url_rev(base) + + if base == location: + assert dirurl is not None + base = dirurl + "/" # save the root url + elif not dirurl or not dirurl.startswith(base): + dirs[:] = [] + continue # not part of the same svn tree, skip it + revision = max(revision, localrev) + return str(revision) + + @classmethod + def get_netloc_and_auth( + cls, netloc: str, scheme: str + ) -> tuple[str, tuple[str | None, str | None]]: + """ + This override allows the auth information to be passed to svn via the + --username and --password options instead of via the URL. + """ + if scheme == "ssh": + # The --username and --password options can't be used for + # svn+ssh URLs, so keep the auth information in the URL. + return super().get_netloc_and_auth(netloc, scheme) + + return split_auth_from_netloc(netloc) + + @classmethod + def get_url_rev_and_auth(cls, url: str) -> tuple[str, str | None, AuthInfo]: + # hotfix the URL scheme after removing svn+ from svn+ssh:// re-add it + url, rev, user_pass = super().get_url_rev_and_auth(url) + if url.startswith("ssh://"): + url = "svn+" + url + return url, rev, user_pass + + @staticmethod + def make_rev_args(username: str | None, password: HiddenText | None) -> CommandArgs: + extra_args: CommandArgs = [] + if username: + extra_args += ["--username", username] + if password: + extra_args += ["--password", password] + + return extra_args + + @classmethod + def get_remote_url(cls, location: str) -> str: + # In cases where the source is in a subdirectory, we have to look up in + # the location until we find a valid project root. + orig_location = location + while not is_installable_dir(location): + last_location = location + location = os.path.dirname(location) + if location == last_location: + # We've traversed up to the root of the filesystem without + # finding a Python project. + logger.warning( + "Could not find Python project for directory %s (tried all " + "parent directories)", + orig_location, + ) + raise RemoteNotFoundError + + url, _rev = cls._get_svn_url_rev(location) + if url is None: + raise RemoteNotFoundError + + return url + + @classmethod + def _get_svn_url_rev(cls, location: str) -> tuple[str | None, int]: + from pip._internal.exceptions import InstallationError + + entries_path = os.path.join(location, cls.dirname, "entries") + if os.path.exists(entries_path): + with open(entries_path) as f: + data = f.read() + else: # subversion >= 1.7 does not have the 'entries' file + data = "" + + url = None + if data.startswith(("8", "9", "10")): + entries = list(map(str.splitlines, data.split("\n\x0c\n"))) + del entries[0][0] # get rid of the '8' + url = entries[0][3] + revs = [int(d[9]) for d in entries if len(d) > 9 and d[9]] + [0] + elif data.startswith("= 1.7 + # Note that using get_remote_call_options is not necessary here + # because `svn info` is being run against a local directory. + # We don't need to worry about making sure interactive mode + # is being used to prompt for passwords, because passwords + # are only potentially needed for remote server requests. + xml = cls.run_command( + ["info", "--xml", location], + show_stdout=False, + stdout_only=True, + ) + match = _svn_info_xml_url_re.search(xml) + assert match is not None + url = match.group(1) + revs = [int(m.group(1)) for m in _svn_info_xml_rev_re.finditer(xml)] + except InstallationError: + url, revs = None, [] + + if revs: + rev = max(revs) + else: + rev = 0 + + return url, rev + + @classmethod + def is_commit_id_equal(cls, dest: str, name: str | None) -> bool: + """Always assume the versions don't match""" + return False + + def __init__(self, use_interactive: bool | None = None) -> None: + if use_interactive is None: + use_interactive = is_console_interactive() + self.use_interactive = use_interactive + + # This member is used to cache the fetched version of the current + # ``svn`` client. + # Special value definitions: + # None: Not evaluated yet. + # Empty tuple: Could not parse version. + self._vcs_version: tuple[int, ...] | None = None + + super().__init__() + + def call_vcs_version(self) -> tuple[int, ...]: + """Query the version of the currently installed Subversion client. + + :return: A tuple containing the parts of the version information or + ``()`` if the version returned from ``svn`` could not be parsed. + :raises: BadCommand: If ``svn`` is not installed. + """ + # Example versions: + # svn, version 1.10.3 (r1842928) + # compiled Feb 25 2019, 14:20:39 on x86_64-apple-darwin17.0.0 + # svn, version 1.7.14 (r1542130) + # compiled Mar 28 2018, 08:49:13 on x86_64-pc-linux-gnu + # svn, version 1.12.0-SlikSvn (SlikSvn/1.12.0) + # compiled May 28 2019, 13:44:56 on x86_64-microsoft-windows6.2 + version_prefix = "svn, version " + version = self.run_command(["--version"], show_stdout=False, stdout_only=True) + if not version.startswith(version_prefix): + return () + + version = version[len(version_prefix) :].split()[0] + version_list = version.partition("-")[0].split(".") + try: + parsed_version = tuple(map(int, version_list)) + except ValueError: + return () + + return parsed_version + + def get_vcs_version(self) -> tuple[int, ...]: + """Return the version of the currently installed Subversion client. + + If the version of the Subversion client has already been queried, + a cached value will be used. + + :return: A tuple containing the parts of the version information or + ``()`` if the version returned from ``svn`` could not be parsed. + :raises: BadCommand: If ``svn`` is not installed. + """ + if self._vcs_version is not None: + # Use cached version, if available. + # If parsing the version failed previously (empty tuple), + # do not attempt to parse it again. + return self._vcs_version + + vcs_version = self.call_vcs_version() + self._vcs_version = vcs_version + return vcs_version + + def get_remote_call_options(self) -> CommandArgs: + """Return options to be used on calls to Subversion that contact the server. + + These options are applicable for the following ``svn`` subcommands used + in this class. + + - checkout + - switch + - update + + :return: A list of command line arguments to pass to ``svn``. + """ + if not self.use_interactive: + # --non-interactive switch is available since Subversion 0.14.4. + # Subversion < 1.8 runs in interactive mode by default. + return ["--non-interactive"] + + svn_version = self.get_vcs_version() + # By default, Subversion >= 1.8 runs in non-interactive mode if + # stdin is not a TTY. Since that is how pip invokes SVN, in + # call_subprocess(), pip must pass --force-interactive to ensure + # the user can be prompted for a password, if required. + # SVN added the --force-interactive option in SVN 1.8. Since + # e.g. RHEL/CentOS 7, which is supported until 2024, ships with + # SVN 1.7, pip should continue to support SVN 1.7. Therefore, pip + # can't safely add the option if the SVN version is < 1.8 (or unknown). + if svn_version >= (1, 8): + return ["--force-interactive"] + + return [] + + def fetch_new( + self, dest: str, url: HiddenText, rev_options: RevOptions, verbosity: int + ) -> None: + rev_display = rev_options.to_display() + logger.info( + "Checking out %s%s to %s", + url, + rev_display, + display_path(dest), + ) + if verbosity <= 0: + flags = ["--quiet"] + else: + flags = [] + cmd_args = make_command( + "checkout", + *flags, + self.get_remote_call_options(), + rev_options.to_args(), + url, + dest, + ) + self.run_command(cmd_args) + + def switch( + self, + dest: str, + url: HiddenText, + rev_options: RevOptions, + verbosity: int = 0, + ) -> None: + cmd_args = make_command( + "switch", + self.get_remote_call_options(), + rev_options.to_args(), + url, + dest, + ) + self.run_command(cmd_args) + + def update( + self, + dest: str, + url: HiddenText, + rev_options: RevOptions, + verbosity: int = 0, + ) -> None: + cmd_args = make_command( + "update", + self.get_remote_call_options(), + rev_options.to_args(), + dest, + ) + self.run_command(cmd_args) + + +vcs.register(Subversion) diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/vcs/versioncontrol.py b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/vcs/versioncontrol.py new file mode 100644 index 0000000000000000000000000000000000000000..4e91ccd4c4cb93d968ff7b05c20680a4cc0d4434 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_internal/vcs/versioncontrol.py @@ -0,0 +1,693 @@ +"""Handles all VCS (version control) support""" + +from __future__ import annotations + +import logging +import os +import shutil +import sys +import urllib.parse +from collections.abc import Iterable, Iterator, Mapping +from dataclasses import dataclass, field +from typing import ( + Any, + Literal, + Optional, +) + +from pip._internal.cli.spinners import SpinnerInterface +from pip._internal.exceptions import BadCommand, InstallationError +from pip._internal.utils.misc import ( + HiddenText, + ask_path_exists, + backup_dir, + display_path, + hide_url, + hide_value, + is_installable_dir, + rmtree, +) +from pip._internal.utils.subprocess import ( + CommandArgs, + call_subprocess, + format_command_args, + make_command, +) + +__all__ = ["vcs"] + + +logger = logging.getLogger(__name__) + +AuthInfo = tuple[Optional[str], Optional[str]] + + +def is_url(name: str) -> bool: + """ + Return true if the name looks like a URL. + """ + scheme = urllib.parse.urlsplit(name).scheme + if not scheme: + return False + return scheme in ["http", "https", "file", "ftp"] + vcs.all_schemes + + +def make_vcs_requirement_url( + repo_url: str, rev: str, project_name: str, subdir: str | None = None +) -> str: + """ + Return the URL for a VCS requirement. + + Args: + repo_url: the remote VCS url, with any needed VCS prefix (e.g. "git+"). + project_name: the (unescaped) project name. + """ + egg_project_name = project_name.replace("-", "_") + req = f"{repo_url}@{rev}#egg={egg_project_name}" + if subdir: + req += f"&subdirectory={subdir}" + + return req + + +def find_path_to_project_root_from_repo_root( + location: str, repo_root: str +) -> str | None: + """ + Find the the Python project's root by searching up the filesystem from + `location`. Return the path to project root relative to `repo_root`. + Return None if the project root is `repo_root`, or cannot be found. + """ + # find project root. + orig_location = location + while not is_installable_dir(location): + last_location = location + location = os.path.dirname(location) + if location == last_location: + # We've traversed up to the root of the filesystem without + # finding a Python project. + logger.warning( + "Could not find a Python project for directory %s (tried all " + "parent directories)", + orig_location, + ) + return None + + if os.path.samefile(repo_root, location): + return None + + return os.path.relpath(location, repo_root) + + +class RemoteNotFoundError(Exception): + pass + + +class RemoteNotValidError(Exception): + def __init__(self, url: str): + super().__init__(url) + self.url = url + + +@dataclass(frozen=True) +class RevOptions: + """ + Encapsulates a VCS-specific revision to install, along with any VCS + install options. + + Args: + vc_class: a VersionControl subclass. + rev: the name of the revision to install. + extra_args: a list of extra options. + """ + + vc_class: type[VersionControl] + rev: str | None = None + extra_args: CommandArgs = field(default_factory=list) + branch_name: str | None = None + + def __repr__(self) -> str: + return f"" + + @property + def arg_rev(self) -> str | None: + if self.rev is None: + return self.vc_class.default_arg_rev + + return self.rev + + def to_args(self) -> CommandArgs: + """ + Return the VCS-specific command arguments. + """ + args: CommandArgs = [] + rev = self.arg_rev + if rev is not None: + args += self.vc_class.get_base_rev_args(rev) + args += self.extra_args + + return args + + def to_display(self) -> str: + if not self.rev: + return "" + + return f" (to revision {self.rev})" + + def make_new(self, rev: str) -> RevOptions: + """ + Make a copy of the current instance, but with a new rev. + + Args: + rev: the name of the revision for the new object. + """ + return self.vc_class.make_rev_options(rev, extra_args=self.extra_args) + + +class VcsSupport: + _registry: dict[str, VersionControl] = {} + schemes = ["ssh", "git", "hg", "bzr", "sftp", "svn"] + + def __init__(self) -> None: + # Register more schemes with urlparse for various version control + # systems + urllib.parse.uses_netloc.extend(self.schemes) + super().__init__() + + def __iter__(self) -> Iterator[str]: + return self._registry.__iter__() + + @property + def backends(self) -> list[VersionControl]: + return list(self._registry.values()) + + @property + def dirnames(self) -> list[str]: + return [backend.dirname for backend in self.backends] + + @property + def all_schemes(self) -> list[str]: + schemes: list[str] = [] + for backend in self.backends: + schemes.extend(backend.schemes) + return schemes + + def register(self, cls: type[VersionControl]) -> None: + if not hasattr(cls, "name"): + logger.warning("Cannot register VCS %s", cls.__name__) + return + if cls.name not in self._registry: + self._registry[cls.name] = cls() + logger.debug("Registered VCS backend: %s", cls.name) + + def unregister(self, name: str) -> None: + if name in self._registry: + del self._registry[name] + + def get_backend_for_dir(self, location: str) -> VersionControl | None: + """ + Return a VersionControl object if a repository of that type is found + at the given directory. + """ + vcs_backends = {} + for vcs_backend in self._registry.values(): + repo_path = vcs_backend.get_repository_root(location) + if not repo_path: + continue + logger.debug("Determine that %s uses VCS: %s", location, vcs_backend.name) + vcs_backends[repo_path] = vcs_backend + + if not vcs_backends: + return None + + # Choose the VCS in the inner-most directory. Since all repository + # roots found here would be either `location` or one of its + # parents, the longest path should have the most path components, + # i.e. the backend representing the inner-most repository. + inner_most_repo_path = max(vcs_backends, key=len) + return vcs_backends[inner_most_repo_path] + + def get_backend_for_scheme(self, scheme: str) -> VersionControl | None: + """ + Return a VersionControl object or None. + """ + for vcs_backend in self._registry.values(): + if scheme in vcs_backend.schemes: + return vcs_backend + return None + + def get_backend(self, name: str) -> VersionControl | None: + """ + Return a VersionControl object or None. + """ + name = name.lower() + return self._registry.get(name) + + +vcs = VcsSupport() + + +class VersionControl: + name = "" + dirname = "" + repo_name = "" + # List of supported schemes for this Version Control + schemes: tuple[str, ...] = () + # Iterable of environment variable names to pass to call_subprocess(). + unset_environ: tuple[str, ...] = () + default_arg_rev: str | None = None + + @classmethod + def should_add_vcs_url_prefix(cls, remote_url: str) -> bool: + """ + Return whether the vcs prefix (e.g. "git+") should be added to a + repository's remote url when used in a requirement. + """ + return not remote_url.lower().startswith(f"{cls.name}:") + + @classmethod + def get_subdirectory(cls, location: str) -> str | None: + """ + Return the path to Python project root, relative to the repo root. + Return None if the project root is in the repo root. + """ + return None + + @classmethod + def get_requirement_revision(cls, repo_dir: str) -> str: + """ + Return the revision string that should be used in a requirement. + """ + return cls.get_revision(repo_dir) + + @classmethod + def get_src_requirement(cls, repo_dir: str, project_name: str) -> str: + """ + Return the requirement string to use to redownload the files + currently at the given repository directory. + + Args: + project_name: the (unescaped) project name. + + The return value has a form similar to the following: + + {repository_url}@{revision}#egg={project_name} + """ + repo_url = cls.get_remote_url(repo_dir) + + if cls.should_add_vcs_url_prefix(repo_url): + repo_url = f"{cls.name}+{repo_url}" + + revision = cls.get_requirement_revision(repo_dir) + subdir = cls.get_subdirectory(repo_dir) + req = make_vcs_requirement_url(repo_url, revision, project_name, subdir=subdir) + + return req + + @staticmethod + def get_base_rev_args(rev: str) -> list[str]: + """ + Return the base revision arguments for a vcs command. + + Args: + rev: the name of a revision to install. Cannot be None. + """ + raise NotImplementedError + + def is_immutable_rev_checkout(self, url: str, dest: str) -> bool: + """ + Return true if the commit hash checked out at dest matches + the revision in url. + + Always return False, if the VCS does not support immutable commit + hashes. + + This method does not check if there are local uncommitted changes + in dest after checkout, as pip currently has no use case for that. + """ + return False + + @classmethod + def make_rev_options( + cls, rev: str | None = None, extra_args: CommandArgs | None = None + ) -> RevOptions: + """ + Return a RevOptions object. + + Args: + rev: the name of a revision to install. + extra_args: a list of extra options. + """ + return RevOptions(cls, rev, extra_args=extra_args or []) + + @classmethod + def _is_local_repository(cls, repo: str) -> bool: + """ + posix absolute paths start with os.path.sep, + win32 ones start with drive (like c:\\folder) + """ + drive, tail = os.path.splitdrive(repo) + return repo.startswith(os.path.sep) or bool(drive) + + @classmethod + def get_netloc_and_auth( + cls, netloc: str, scheme: str + ) -> tuple[str, tuple[str | None, str | None]]: + """ + Parse the repository URL's netloc, and return the new netloc to use + along with auth information. + + Args: + netloc: the original repository URL netloc. + scheme: the repository URL's scheme without the vcs prefix. + + This is mainly for the Subversion class to override, so that auth + information can be provided via the --username and --password options + instead of through the URL. For other subclasses like Git without + such an option, auth information must stay in the URL. + + Returns: (netloc, (username, password)). + """ + return netloc, (None, None) + + @classmethod + def get_url_rev_and_auth(cls, url: str) -> tuple[str, str | None, AuthInfo]: + """ + Parse the repository URL to use, and return the URL, revision, + and auth info to use. + + Returns: (url, rev, (username, password)). + """ + scheme, netloc, path, query, frag = urllib.parse.urlsplit(url) + if "+" not in scheme: + raise ValueError( + f"Sorry, {url!r} is a malformed VCS url. " + "The format is +://, " + "e.g. svn+http://myrepo/svn/MyApp#egg=MyApp" + ) + # Remove the vcs prefix. + scheme = scheme.split("+", 1)[1] + netloc, user_pass = cls.get_netloc_and_auth(netloc, scheme) + rev = None + if "@" in path: + path, rev = path.rsplit("@", 1) + if not rev: + raise InstallationError( + f"The URL {url!r} has an empty revision (after @) " + "which is not supported. Include a revision after @ " + "or remove @ from the URL." + ) + url = urllib.parse.urlunsplit((scheme, netloc, path, query, "")) + return url, rev, user_pass + + @staticmethod + def make_rev_args(username: str | None, password: HiddenText | None) -> CommandArgs: + """ + Return the RevOptions "extra arguments" to use in obtain(). + """ + return [] + + def get_url_rev_options(self, url: HiddenText) -> tuple[HiddenText, RevOptions]: + """ + Return the URL and RevOptions object to use in obtain(), + as a tuple (url, rev_options). + """ + secret_url, rev, user_pass = self.get_url_rev_and_auth(url.secret) + username, secret_password = user_pass + password: HiddenText | None = None + if secret_password is not None: + password = hide_value(secret_password) + extra_args = self.make_rev_args(username, password) + rev_options = self.make_rev_options(rev, extra_args=extra_args) + + return hide_url(secret_url), rev_options + + @staticmethod + def normalize_url(url: str) -> str: + """ + Normalize a URL for comparison by unquoting it and removing any + trailing slash. + """ + return urllib.parse.unquote(url).rstrip("/") + + @classmethod + def compare_urls(cls, url1: str, url2: str) -> bool: + """ + Compare two repo URLs for identity, ignoring incidental differences. + """ + return cls.normalize_url(url1) == cls.normalize_url(url2) + + def fetch_new( + self, dest: str, url: HiddenText, rev_options: RevOptions, verbosity: int + ) -> None: + """ + Fetch a revision from a repository, in the case that this is the + first fetch from the repository. + + Args: + dest: the directory to fetch the repository to. + rev_options: a RevOptions object. + verbosity: verbosity level. + """ + raise NotImplementedError + + def switch( + self, + dest: str, + url: HiddenText, + rev_options: RevOptions, + verbosity: int = 0, + ) -> None: + """ + Switch the repo at ``dest`` to point to ``URL``. + + Args: + rev_options: a RevOptions object. + """ + raise NotImplementedError + + def update( + self, + dest: str, + url: HiddenText, + rev_options: RevOptions, + verbosity: int = 0, + ) -> None: + """ + Update an already-existing repo to the given ``rev_options``. + + Args: + rev_options: a RevOptions object. + """ + raise NotImplementedError + + @classmethod + def is_commit_id_equal(cls, dest: str, name: str | None) -> bool: + """ + Return whether the id of the current commit equals the given name. + + Args: + dest: the repository directory. + name: a string name. + """ + raise NotImplementedError + + def obtain(self, dest: str, url: HiddenText, verbosity: int) -> None: + """ + Install or update in editable mode the package represented by this + VersionControl object. + + :param dest: the repository directory in which to install or update. + :param url: the repository URL starting with a vcs prefix. + :param verbosity: verbosity level. + """ + url, rev_options = self.get_url_rev_options(url) + + if not os.path.exists(dest): + self.fetch_new(dest, url, rev_options, verbosity=verbosity) + return + + rev_display = rev_options.to_display() + if self.is_repository_directory(dest): + existing_url = self.get_remote_url(dest) + if self.compare_urls(existing_url, url.secret): + logger.debug( + "%s in %s exists, and has correct URL (%s)", + self.repo_name.title(), + display_path(dest), + url, + ) + if not self.is_commit_id_equal(dest, rev_options.rev): + logger.info( + "Updating %s %s%s", + display_path(dest), + self.repo_name, + rev_display, + ) + self.update(dest, url, rev_options, verbosity=verbosity) + else: + logger.info("Skipping because already up-to-date.") + return + + logger.warning( + "%s %s in %s exists with URL %s", + self.name, + self.repo_name, + display_path(dest), + existing_url, + ) + prompt = ("(s)witch, (i)gnore, (w)ipe, (b)ackup ", ("s", "i", "w", "b")) + else: + logger.warning( + "Directory %s already exists, and is not a %s %s.", + dest, + self.name, + self.repo_name, + ) + # https://github.com/python/mypy/issues/1174 + prompt = ("(i)gnore, (w)ipe, (b)ackup ", ("i", "w", "b")) # type: ignore + + logger.warning( + "The plan is to install the %s repository %s", + self.name, + url, + ) + response = ask_path_exists(f"What to do? {prompt[0]}", prompt[1]) + + if response == "a": + sys.exit(-1) + + if response == "w": + logger.warning("Deleting %s", display_path(dest)) + rmtree(dest) + self.fetch_new(dest, url, rev_options, verbosity=verbosity) + return + + if response == "b": + dest_dir = backup_dir(dest) + logger.warning("Backing up %s to %s", display_path(dest), dest_dir) + shutil.move(dest, dest_dir) + self.fetch_new(dest, url, rev_options, verbosity=verbosity) + return + + # Do nothing if the response is "i". + if response == "s": + logger.info( + "Switching %s %s to %s%s", + self.repo_name, + display_path(dest), + url, + rev_display, + ) + self.switch(dest, url, rev_options, verbosity=verbosity) + + def unpack(self, location: str, url: HiddenText, verbosity: int) -> None: + """ + Clean up current location and download the url repository + (and vcs infos) into location + + :param url: the repository URL starting with a vcs prefix. + :param verbosity: verbosity level. + """ + if os.path.exists(location): + rmtree(location) + self.obtain(location, url=url, verbosity=verbosity) + + @classmethod + def get_remote_url(cls, location: str) -> str: + """ + Return the url used at location + + Raises RemoteNotFoundError if the repository does not have a remote + url configured. + """ + raise NotImplementedError + + @classmethod + def get_revision(cls, location: str) -> str: + """ + Return the current commit id of the files at the given location. + """ + raise NotImplementedError + + @classmethod + def run_command( + cls, + cmd: list[str] | CommandArgs, + show_stdout: bool = True, + cwd: str | None = None, + on_returncode: Literal["raise", "warn", "ignore"] = "raise", + extra_ok_returncodes: Iterable[int] | None = None, + command_desc: str | None = None, + extra_environ: Mapping[str, Any] | None = None, + spinner: SpinnerInterface | None = None, + log_failed_cmd: bool = True, + stdout_only: bool = False, + ) -> str: + """ + Run a VCS subcommand + This is simply a wrapper around call_subprocess that adds the VCS + command name, and checks that the VCS is available + """ + cmd = make_command(cls.name, *cmd) + if command_desc is None: + command_desc = format_command_args(cmd) + try: + return call_subprocess( + cmd, + show_stdout, + cwd, + on_returncode=on_returncode, + extra_ok_returncodes=extra_ok_returncodes, + command_desc=command_desc, + extra_environ=extra_environ, + unset_environ=cls.unset_environ, + spinner=spinner, + log_failed_cmd=log_failed_cmd, + stdout_only=stdout_only, + ) + except NotADirectoryError: + raise BadCommand(f"Cannot find command {cls.name!r} - invalid PATH") + except FileNotFoundError: + # errno.ENOENT = no such file or directory + # In other words, the VCS executable isn't available + raise BadCommand( + f"Cannot find command {cls.name!r} - do you have " + f"{cls.name!r} installed and in your PATH?" + ) + except PermissionError: + # errno.EACCES = Permission denied + # This error occurs, for instance, when the command is installed + # only for another user. So, the current user don't have + # permission to call the other user command. + raise BadCommand( + f"No permission to execute {cls.name!r} - install it " + f"locally, globally (ask admin), or check your PATH. " + f"See possible solutions at " + f"https://pip.pypa.io/en/latest/reference/pip_freeze/" + f"#fixing-permission-denied." + ) + + @classmethod + def is_repository_directory(cls, path: str) -> bool: + """ + Return whether a directory path is a repository directory. + """ + logger.debug("Checking in %s for %s (%s)...", path, cls.dirname, cls.name) + return os.path.exists(os.path.join(path, cls.dirname)) + + @classmethod + def get_repository_root(cls, location: str) -> str | None: + """ + Return the "root" (top-level) directory controlled by the vcs, + or `None` if the directory is not in any. + + It is meant to be overridden to implement smarter detection + mechanisms for specific vcs. + + This can do more than is_repository_directory() alone. For + example, the Git override checks that Git is actually available. + """ + if cls.is_repository_directory(location): + return location + return None diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_vendor/distlib/t64-arm.exe b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_vendor/distlib/t64-arm.exe new file mode 100644 index 0000000000000000000000000000000000000000..4c236ed0ab8253ceee9276ddc3cf5ed9a7ea6a4c --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_vendor/distlib/t64-arm.exe @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ebc4c06b7d95e74e315419ee7e88e1d0f71e9e9477538c00a93a9ff8c66a6cfc +size 182784 diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_vendor/distlib/t64.exe b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_vendor/distlib/t64.exe new file mode 100644 index 0000000000000000000000000000000000000000..3fd3d2df6541617229f21bdbb49fbbfc880b7f50 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_vendor/distlib/t64.exe @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:81a618f21cb87db9076134e70388b6e9cb7c2106739011b6a51772d22cae06b7 +size 108032 diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_vendor/distlib/w64-arm.exe b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_vendor/distlib/w64-arm.exe new file mode 100644 index 0000000000000000000000000000000000000000..bc02472528a32bd70ebfa2b0eca26e34a83fa264 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_vendor/distlib/w64-arm.exe @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c5dc9884a8f458371550e09bd396e5418bf375820a31b9899f6499bf391c7b2e +size 168448 diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_vendor/distlib/w64.exe b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_vendor/distlib/w64.exe new file mode 100644 index 0000000000000000000000000000000000000000..daebd1c30353b2d9b016069da83ad5b4c8ee86bd --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_vendor/distlib/w64.exe @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7a319ffaba23a017d7b1e18ba726ba6c54c53d6446db55f92af53c279894f8ad +size 101888 diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_vendor/idna/__pycache__/uts46data.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_vendor/idna/__pycache__/uts46data.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..588e3e5b96780c5a07a24ed52490b9c8c7e56d73 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_vendor/idna/__pycache__/uts46data.cpython-312.pyc @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:807e4a94a5b661e5b63c06282f397e87be53193d44f0fbff835a12af86d94c28 +size 158827 diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_vendor/pkg_resources/__pycache__/__init__.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_vendor/pkg_resources/__pycache__/__init__.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..1e422e66d7823c32cb037857f5d0ce52de768eb6 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_vendor/pkg_resources/__pycache__/__init__.cpython-312.pyc @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:550fd4753c4df8e6b93aeb5fb5f9cb4cc2e250084d661c88ff84f5cab36631eb +size 161494 diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_vendor/rich/__pycache__/_emoji_codes.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_vendor/rich/__pycache__/_emoji_codes.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..42970ad23fe34edb20fd4618249751a527c2318a --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_vendor/rich/__pycache__/_emoji_codes.cpython-312.pyc @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2e1f79366810e4bc99a77a9bde9232179d902d4cb8b6cdf6d65aead92300e1ad +size 205958 diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_vendor/rich/__pycache__/console.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_vendor/rich/__pycache__/console.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..1dc53e9d952058d4edf7d2c06e620ebca6594dd1 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pip/_vendor/rich/__pycache__/console.cpython-312.pyc @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4571929e48da55d9634770e58a93a1a9ba51fccc6edc1241c7fcbe531b54ad65 +size 115282 diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pkg_resources/__pycache__/__init__.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pkg_resources/__pycache__/__init__.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..78c6f0bfeee9a76af132847cdcdea3210459072b --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pkg_resources/__pycache__/__init__.cpython-312.pyc @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5d26d53a69ff666cd8447e42465084ffff79386da42c429f8de52643fb117ce1 +size 164680 diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pkg_resources/tests/data/my-test-package-zip/my-test-package.zip b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pkg_resources/tests/data/my-test-package-zip/my-test-package.zip new file mode 100644 index 0000000000000000000000000000000000000000..400905eecf0385de4d3b8e50b9892e1302b2b894 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pkg_resources/tests/data/my-test-package-zip/my-test-package.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:01845c437f4655e3cf9cc4fc4e49cfd607431f22675e1b611129a90239f34822 +size 1809 diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/posthog/test/__pycache__/test_feature_flags.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/posthog/test/__pycache__/test_feature_flags.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..88fbc31073e475512cc6ce1d09b5ff99227ccdae --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/posthog/test/__pycache__/test_feature_flags.cpython-312.pyc @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:42775d71ca8891a9782f3785715a71bc050be1c3236b38a6bdc27964b338d181 +size 101582 diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pyarrow/tests/__pycache__/test_array.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pyarrow/tests/__pycache__/test_array.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..7d1a0003d85801723f4847f91f1f36b1b8f2af39 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pyarrow/tests/__pycache__/test_array.cpython-312.pyc @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f7e2d305e142a2c5d03746a28a94a9521fbe86bea954c6ce47c6bb92df7dadba +size 255280 diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pyarrow/tests/__pycache__/test_compute.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pyarrow/tests/__pycache__/test_compute.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..fb88f0726c65d0bcb355337c1e058f800a721ca1 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pyarrow/tests/__pycache__/test_compute.cpython-312.pyc @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:140d07ea4d15659b6efb71a2560922de28f49f18e86a59aad645978c718d59a1 +size 240958 diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pyarrow/tests/__pycache__/test_convert_builtin.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pyarrow/tests/__pycache__/test_convert_builtin.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2e05d744af6cb7b0ae6b508776be382f6c065ef6 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pyarrow/tests/__pycache__/test_convert_builtin.cpython-312.pyc @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2498c6a26f1cbaaa4336700f78918df3b70ca26698650a3b377eef496e4bc6a1 +size 158047 diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pyarrow/tests/__pycache__/test_csv.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pyarrow/tests/__pycache__/test_csv.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2e01247e630fb60ddcb2d652983f178f705e25d6 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pyarrow/tests/__pycache__/test_csv.cpython-312.pyc @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:81e670759f3ad1dbc3dffba3224bf69d31af0eed93764afcf13f3be73c1b0cb6 +size 100556 diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pyarrow/tests/__pycache__/test_dataset.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pyarrow/tests/__pycache__/test_dataset.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2d60b6ee1edc5e0b7ad552ac35a29719ab69fe2e --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pyarrow/tests/__pycache__/test_dataset.cpython-312.pyc @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bcb31cb7fe7d65792a6bafe3b145dce86a50b8986e11810a104751b068e42260 +size 319364 diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pyarrow/tests/__pycache__/test_extension_type.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pyarrow/tests/__pycache__/test_extension_type.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f73389562843c7fd1bade6e0dfcbd027272ed87b --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pyarrow/tests/__pycache__/test_extension_type.cpython-312.pyc @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a62086905bdb67035790b7f6609c27fc772983efe557eaf522c7d443a9c9a9a0 +size 115931 diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pyarrow/tests/__pycache__/test_flight.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pyarrow/tests/__pycache__/test_flight.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..6607d7416a5f6fa10527fc701c62c111914b4a59 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pyarrow/tests/__pycache__/test_flight.cpython-312.pyc @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:277aaa170f18eb5a13ab498af6e854cfc55e85b0e8c3e55422c669c0fff88b0f +size 161355 diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pyarrow/tests/__pycache__/test_fs.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pyarrow/tests/__pycache__/test_fs.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..bce3a1be0386f15c2262520e91d129fa0c7a1a77 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pyarrow/tests/__pycache__/test_fs.cpython-312.pyc @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ec17232ab0caa333765dacd62d403abb06a087b6e7b64884a37b038f227b2b58 +size 100956 diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pyarrow/tests/__pycache__/test_io.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pyarrow/tests/__pycache__/test_io.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..508a97094cb6f069b20dcf704f33587c55578529 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pyarrow/tests/__pycache__/test_io.cpython-312.pyc @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:75232c84be6036287bb96b8dddbf116a8c74bff973cc1c359f4cf97cc70e4317 +size 118909 diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pyarrow/tests/__pycache__/test_pandas.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pyarrow/tests/__pycache__/test_pandas.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f189d0690575eeacf6ec8b2d001edc3f19de0b88 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pyarrow/tests/__pycache__/test_pandas.cpython-312.pyc @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b1e96f01782b02971c8fc404ffe9b8e856aca138b7eddea4ad6ba8df186142d8 +size 304880 diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pyarrow/tests/__pycache__/test_table.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pyarrow/tests/__pycache__/test_table.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e1a5a55804ae160347664d85281dda0a5128a28a --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pyarrow/tests/__pycache__/test_table.cpython-312.pyc @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bb16a7ddb8cd4530e93b55df5232d7d460d4951f97bacf488ff38609179d94b8 +size 221590 diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pyarrow/tests/data/orc/TestOrcFile.emptyFile.jsn.gz b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pyarrow/tests/data/orc/TestOrcFile.emptyFile.jsn.gz new file mode 100644 index 0000000000000000000000000000000000000000..6bfec839e4d42402efb1845ad1ee9d23be951177 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pyarrow/tests/data/orc/TestOrcFile.emptyFile.jsn.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c4b8c05ddfb7b1cc770c2c9e02c9b14cedddbf5723f4a46f628a4a7b9ad03622 +size 50 diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pyarrow/tests/data/orc/TestOrcFile.test1.jsn.gz b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pyarrow/tests/data/orc/TestOrcFile.test1.jsn.gz new file mode 100644 index 0000000000000000000000000000000000000000..14b961bd7fd75717fe055182f368148e2b327f39 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pyarrow/tests/data/orc/TestOrcFile.test1.jsn.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:90bc66c0c547b5fce91ea073b458df63f3d30a5a1a5e97c7abd0c30eccdbf169 +size 323 diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pyarrow/tests/data/orc/TestOrcFile.testDate1900.jsn.gz b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pyarrow/tests/data/orc/TestOrcFile.testDate1900.jsn.gz new file mode 100644 index 0000000000000000000000000000000000000000..d743adc079ea1c06583e20e8e1dba371af4d260a --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pyarrow/tests/data/orc/TestOrcFile.testDate1900.jsn.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a167fb78147766d380f75393bdd790258a2cd5a9f9ea6b06b09c2118e6a7de5a +size 182453 diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pyarrow/tests/data/orc/decimal.jsn.gz b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pyarrow/tests/data/orc/decimal.jsn.gz new file mode 100644 index 0000000000000000000000000000000000000000..4614e5bc91ea893674d4217c686f3783a019cd53 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pyarrow/tests/data/orc/decimal.jsn.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:91313261d3c3000485517f0d8b2af2e6644317e63e2ecae14808dbbb8e779af0 +size 19313 diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pyarrow/tests/data/parquet/v0.7.1.all-named-index.parquet b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pyarrow/tests/data/parquet/v0.7.1.all-named-index.parquet new file mode 100644 index 0000000000000000000000000000000000000000..9ac3cea6476f0799521059c755ca806751ded8ab --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pyarrow/tests/data/parquet/v0.7.1.all-named-index.parquet @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:60f1945edc3e4ec38f6e234389e647a1b369de8afb9c7840c491a39880c0caa1 +size 3948 diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pyarrow/tests/data/parquet/v0.7.1.column-metadata-handling.parquet b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pyarrow/tests/data/parquet/v0.7.1.column-metadata-handling.parquet new file mode 100644 index 0000000000000000000000000000000000000000..9ff4f6d37d08035af5855b426e905cdb9d95e12e --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pyarrow/tests/data/parquet/v0.7.1.column-metadata-handling.parquet @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:eec79b660a5f75c3f7ed092c4f71610cbeaf380f6047a1816aae3834256d398c +size 2012 diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pyarrow/tests/data/parquet/v0.7.1.parquet b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pyarrow/tests/data/parquet/v0.7.1.parquet new file mode 100644 index 0000000000000000000000000000000000000000..2b5ab612e8045f7cc6e4b7052f3a1af84a9400a9 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pyarrow/tests/data/parquet/v0.7.1.parquet @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:be6773848ce905b99192adc68f0c3b2aabab7d214db50b92a52203790566ab2b +size 4372 diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pyarrow/tests/data/parquet/v0.7.1.some-named-index.parquet b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pyarrow/tests/data/parquet/v0.7.1.some-named-index.parquet new file mode 100644 index 0000000000000000000000000000000000000000..cc4ac04df23cf058f505abd4c6ffd75464b81d6c --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pyarrow/tests/data/parquet/v0.7.1.some-named-index.parquet @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5468128ea8a1091b5d07195471f3f9b3705247b69440aba45be6c68092dffc76 +size 4008 diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pyasn1/type/__pycache__/univ.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pyasn1/type/__pycache__/univ.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..8123f03dd7fd6ba41197712890c1738f86014619 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pyasn1/type/__pycache__/univ.cpython-312.pyc @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:301e220ec03d6d1da23aa4abd5e5833c7138e0564f0243557988f1beb14309aa +size 132621 diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pycountry/locales/ast/LC_MESSAGES/iso639-3.mo b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pycountry/locales/ast/LC_MESSAGES/iso639-3.mo new file mode 100644 index 0000000000000000000000000000000000000000..3750a2e249b0c1fb0fcf17ec2fe7281079a3001f --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pycountry/locales/ast/LC_MESSAGES/iso639-3.mo @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:60c010fb619678a2ea319cfc181d2536d6b64f3eab69b930408e2fd6a83ddfed +size 311331 diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pycountry/locales/be/LC_MESSAGES/iso3166-2.mo b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pycountry/locales/be/LC_MESSAGES/iso3166-2.mo new file mode 100644 index 0000000000000000000000000000000000000000..e8ab90f991de16801c83e3b3d1eed56a3d9f2b71 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pycountry/locales/be/LC_MESSAGES/iso3166-2.mo @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:eddbd36f1d975f36860ccefb799b8e1ae9c6821aa5585fd0af573047506c4367 +size 194548 diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pycountry/locales/crh/LC_MESSAGES/iso639-3.mo b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pycountry/locales/crh/LC_MESSAGES/iso639-3.mo new file mode 100644 index 0000000000000000000000000000000000000000..85a98b7c45044e1f652aca0a07e92585475778fc --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pycountry/locales/crh/LC_MESSAGES/iso639-3.mo @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:837e802d1856cc8e4f33ef50839d1c338e0e640c4a05dd254d4e47bdb14ab086 +size 256161 diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pycountry/locales/da/LC_MESSAGES/iso3166-2.mo b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pycountry/locales/da/LC_MESSAGES/iso3166-2.mo new file mode 100644 index 0000000000000000000000000000000000000000..e590247843fcb72dca073d0f869359435f8753a4 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pycountry/locales/da/LC_MESSAGES/iso3166-2.mo @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:798eb4b9439ddf59ab8d0e32c6a894455e65509f70ede06a7eb5a35c94ca590b +size 134479 diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pycountry/locales/de/LC_MESSAGES/iso3166-2.mo b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pycountry/locales/de/LC_MESSAGES/iso3166-2.mo new file mode 100644 index 0000000000000000000000000000000000000000..93f81ef3da7913ddc2acecebe69a30b0203622bf --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pycountry/locales/de/LC_MESSAGES/iso3166-2.mo @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:466aab6a14a6aabfee4ce464f34b404c3252d0f6f28336f1dda972658ed7aa19 +size 212230 diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pycountry/locales/de/LC_MESSAGES/iso639-3.mo b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pycountry/locales/de/LC_MESSAGES/iso639-3.mo new file mode 100644 index 0000000000000000000000000000000000000000..ff37695b3a9b272281e097c1e08a3689c60ddcbe --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pycountry/locales/de/LC_MESSAGES/iso639-3.mo @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:60264f64cdddb98ac5883bede6ebe9da6632f7be49760914f6e6f4b278130f4b +size 395660 diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pycountry/locales/fr/LC_MESSAGES/iso3166-2.mo b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pycountry/locales/fr/LC_MESSAGES/iso3166-2.mo new file mode 100644 index 0000000000000000000000000000000000000000..bf276298ea9d42c0dc4614b6d31ab92315cd3621 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pycountry/locales/fr/LC_MESSAGES/iso3166-2.mo @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:48ebf8d099bf30b1425107af5bb2eb5c2cf474b6f824bf420465e3af936d01de +size 160680 diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pycountry/locales/fr/LC_MESSAGES/iso639-3.mo b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pycountry/locales/fr/LC_MESSAGES/iso639-3.mo new file mode 100644 index 0000000000000000000000000000000000000000..1c777e23867f84233cb961c97baeffce5b53fe13 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pycountry/locales/fr/LC_MESSAGES/iso639-3.mo @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c28273b7da4ca5af1cfbabdd9070219a37afa2cb88bd859aa96ba71271a7dcee +size 418827 diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pycountry/locales/gl/LC_MESSAGES/iso639-3.mo b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pycountry/locales/gl/LC_MESSAGES/iso639-3.mo new file mode 100644 index 0000000000000000000000000000000000000000..f875743b9f415ca54d2dbfd21f1c341dd192406e --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pycountry/locales/gl/LC_MESSAGES/iso639-3.mo @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:275a79ecc9dd21d78885bd92264d2ab4c104b0327fdd7b3e4d5870a7c3018a91 +size 306888 diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pycountry/locales/id/LC_MESSAGES/iso3166-2.mo b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pycountry/locales/id/LC_MESSAGES/iso3166-2.mo new file mode 100644 index 0000000000000000000000000000000000000000..d58916ef6a2517bf6bc49c37329ff6122e330800 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pycountry/locales/id/LC_MESSAGES/iso3166-2.mo @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f0accf230b8604a9f4593ea5ac2785f33f06ef266eedd0c06705cfc261bf2596 +size 159848 diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pycountry/locales/id/LC_MESSAGES/iso639-3.mo b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pycountry/locales/id/LC_MESSAGES/iso639-3.mo new file mode 100644 index 0000000000000000000000000000000000000000..6581c31a31e5cdfe11a17b03921289b2ac7ecd39 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pycountry/locales/id/LC_MESSAGES/iso639-3.mo @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:900a737e501d59de2df5e1d4ab5e6225703e1621e227628174bdd56d21b4c8b1 +size 292415 diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pycountry/locales/is/LC_MESSAGES/iso639-3.mo b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pycountry/locales/is/LC_MESSAGES/iso639-3.mo new file mode 100644 index 0000000000000000000000000000000000000000..e0836a03407cc95dcbfec54095fb57450a92411d --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pycountry/locales/is/LC_MESSAGES/iso639-3.mo @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3283039e071cb3a882b70057b72d469e369a8cac95f4cf0f5d3a04613c11ef67 +size 149997 diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pycountry/locales/it/LC_MESSAGES/iso3166-2.mo b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pycountry/locales/it/LC_MESSAGES/iso3166-2.mo new file mode 100644 index 0000000000000000000000000000000000000000..f1f612143ea4a6ad39187b050648fcd800087c76 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pycountry/locales/it/LC_MESSAGES/iso3166-2.mo @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:81aeefd1120375c7616d04c0b981ac324753d0d60b1fbbd814df266ef0542707 +size 157445 diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pycountry/locales/it/LC_MESSAGES/iso639-3.mo b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pycountry/locales/it/LC_MESSAGES/iso639-3.mo new file mode 100644 index 0000000000000000000000000000000000000000..d93956a426dee0b264e4ac31999d92ac6d925a21 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pycountry/locales/it/LC_MESSAGES/iso639-3.mo @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:68fb0fd4e64079b6b570c793c06367469fa3152b402de5f4a273e7b2c2123564 +size 369645 diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pycountry/locales/ka/LC_MESSAGES/iso3166-2.mo b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pycountry/locales/ka/LC_MESSAGES/iso3166-2.mo new file mode 100644 index 0000000000000000000000000000000000000000..dd9c119579ee5554d36274f6fe13cc942e3ee6cf --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pycountry/locales/ka/LC_MESSAGES/iso3166-2.mo @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:48358f6d36510f2e9cc48e181067068827254e91b815c3547d918638b99040f3 +size 111221 diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pycountry/locales/kn/LC_MESSAGES/iso639-3.mo b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pycountry/locales/kn/LC_MESSAGES/iso639-3.mo new file mode 100644 index 0000000000000000000000000000000000000000..5facaaf324dde14a16a79f596ca42af727a7dc9d --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pycountry/locales/kn/LC_MESSAGES/iso639-3.mo @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:01808c761f0d8dd6a9530552183cd40999ab2b8c15faedf8d6aa36f4d2e98d24 +size 390349 diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pycountry/locales/mr/LC_MESSAGES/iso639-3.mo b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pycountry/locales/mr/LC_MESSAGES/iso639-3.mo new file mode 100644 index 0000000000000000000000000000000000000000..53250a6aebb11148abd25399d938b62dba9fb5d9 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pycountry/locales/mr/LC_MESSAGES/iso639-3.mo @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0240a3a797690612d4beb061048cbf98f042c601c8411b32886ee371095d5e40 +size 425099 diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pycountry/locales/nl/LC_MESSAGES/iso3166-2.mo b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pycountry/locales/nl/LC_MESSAGES/iso3166-2.mo new file mode 100644 index 0000000000000000000000000000000000000000..3664998fdf141264d12a8fcfec2634895a456846 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pycountry/locales/nl/LC_MESSAGES/iso3166-2.mo @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:467abcb4c1dbf08b0851cc6b2be9da1fd8c8cae45b2855389264263963b21ed1 +size 215191 diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pycountry/locales/or/LC_MESSAGES/iso639-3.mo b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pycountry/locales/or/LC_MESSAGES/iso639-3.mo new file mode 100644 index 0000000000000000000000000000000000000000..88523ba3d33e8dd5028deaeb721a81c1d913e458 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pycountry/locales/or/LC_MESSAGES/iso639-3.mo @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c9916c77a48226501c314465d3a4a8c5b00657f8d0d9b41ba5ab6350bde743b3 +size 217560 diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pycountry/locales/pa/LC_MESSAGES/iso639-3.mo b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pycountry/locales/pa/LC_MESSAGES/iso639-3.mo new file mode 100644 index 0000000000000000000000000000000000000000..fdc2576a16a2ea689eb3bf3d3e8a63ca6a4d8a40 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pycountry/locales/pa/LC_MESSAGES/iso639-3.mo @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4f9e282949333a7bd2d3a7df213cb8203359e8dd1b893c9440c7703ab54139f0 +size 410401 diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pycountry/locales/pl/LC_MESSAGES/iso3166-2.mo b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pycountry/locales/pl/LC_MESSAGES/iso3166-2.mo new file mode 100644 index 0000000000000000000000000000000000000000..24b385c152c02ad7bcb247dbdfd6058070f63b53 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pycountry/locales/pl/LC_MESSAGES/iso3166-2.mo @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:74378bf7284fecc26753098703fa995978cc727c55b68f5ddc521ee34b52f2df +size 203350 diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pycountry/locales/pl/LC_MESSAGES/iso639-3.mo b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pycountry/locales/pl/LC_MESSAGES/iso639-3.mo new file mode 100644 index 0000000000000000000000000000000000000000..0e33574d2bd50a8976927670e9b85c3d5a5cd6c3 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pycountry/locales/pl/LC_MESSAGES/iso639-3.mo @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d78ebb39896773d9df3731ce585eb28a36993f4603d9a96c9da00ce6c470c3a6 +size 121821 diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pycountry/locales/ro/LC_MESSAGES/iso3166-2.mo b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pycountry/locales/ro/LC_MESSAGES/iso3166-2.mo new file mode 100644 index 0000000000000000000000000000000000000000..ffe41d29f813a63b7bc9afd092103a867a2178b5 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pycountry/locales/ro/LC_MESSAGES/iso3166-2.mo @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d802481530eb80a37865f3a4ea97d298c62ed717ad879dfa98d381db909ec191 +size 229998 diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pycountry/locales/ru/LC_MESSAGES/iso3166-2.mo b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pycountry/locales/ru/LC_MESSAGES/iso3166-2.mo new file mode 100644 index 0000000000000000000000000000000000000000..3dd18e36c2cd51db79e8854cd767d368470b2ae4 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pycountry/locales/ru/LC_MESSAGES/iso3166-2.mo @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:23e47100b308766946a6655034ea20f2426b27e82e1af16a0fe3618b9478e38e +size 105964 diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pycountry/locales/sr/LC_MESSAGES/iso3166-2.mo b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pycountry/locales/sr/LC_MESSAGES/iso3166-2.mo new file mode 100644 index 0000000000000000000000000000000000000000..1b580addadc30f5a629640e59b5618bd069ee1bc --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pycountry/locales/sr/LC_MESSAGES/iso3166-2.mo @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4db2a2ac77da6105acce116e1fe46d1542c7a0281f3a1347d888558ec1b3d48d +size 144341 diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pycountry/locales/sr@latin/LC_MESSAGES/iso3166-2.mo b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pycountry/locales/sr@latin/LC_MESSAGES/iso3166-2.mo new file mode 100644 index 0000000000000000000000000000000000000000..fb60ac08426b85050f15cfb68b528aa66e929ba8 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pycountry/locales/sr@latin/LC_MESSAGES/iso3166-2.mo @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8e85ae3da5e61a4b629ae3d2ac47898c361664ca1c4c01cd0617afe07c723a4d +size 121630 diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pycountry/locales/sv/LC_MESSAGES/iso3166-2.mo b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pycountry/locales/sv/LC_MESSAGES/iso3166-2.mo new file mode 100644 index 0000000000000000000000000000000000000000..31a0eb2c787036538be28d2f91ce13fe714a6ced --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pycountry/locales/sv/LC_MESSAGES/iso3166-2.mo @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:59cf516c043388bdc1444472da34c644fed3a48551a0d142e9f29c1284452285 +size 158999 diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pycountry/locales/sv/LC_MESSAGES/iso639-3.mo b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pycountry/locales/sv/LC_MESSAGES/iso639-3.mo new file mode 100644 index 0000000000000000000000000000000000000000..263dd83b1a6d5c09b4ee96d98057a7105bff8ed3 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pycountry/locales/sv/LC_MESSAGES/iso639-3.mo @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:80d8de04e5e3419c2e86fb18710d25d1829d25d74fe8519c532f1fd7ed7f3bae +size 398696 diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pycountry/locales/ta/LC_MESSAGES/iso639-3.mo b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pycountry/locales/ta/LC_MESSAGES/iso639-3.mo new file mode 100644 index 0000000000000000000000000000000000000000..3ce9fc7a1c59d0cb809661f65d8d240603bee591 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pycountry/locales/ta/LC_MESSAGES/iso639-3.mo @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:48a85cad01bba40fae79905f87d5009afbf21b8d0aa4b840894b5801eea02f1a +size 438885 diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pycountry/locales/tr/LC_MESSAGES/iso639-3.mo b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pycountry/locales/tr/LC_MESSAGES/iso639-3.mo new file mode 100644 index 0000000000000000000000000000000000000000..5eee3573b8de59e062276b2fae65624befc900ce --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pycountry/locales/tr/LC_MESSAGES/iso639-3.mo @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f58453cbae686e0de4f81241b5a5892a0a28320d3f3d9e60d82cedb369a3fc2a +size 343245 diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pycountry/locales/uk/LC_MESSAGES/iso3166-2.mo b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pycountry/locales/uk/LC_MESSAGES/iso3166-2.mo new file mode 100644 index 0000000000000000000000000000000000000000..b2bb52a206bf052e8337afa8396b48a1871f5c48 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pycountry/locales/uk/LC_MESSAGES/iso3166-2.mo @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c7704825c54b17f990c2815909d32a2c51b23ca381225213e262ecfb6f1555c3 +size 255945 diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pycountry/locales/uk/LC_MESSAGES/iso639-3.mo b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pycountry/locales/uk/LC_MESSAGES/iso639-3.mo new file mode 100644 index 0000000000000000000000000000000000000000..f318d41af2081d081e410aca924b4d9a2fa980e4 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pycountry/locales/uk/LC_MESSAGES/iso639-3.mo @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c24aa12f81e6b5135c725e5df8e746a116c48d9b1641f820e95c946614963d7e +size 511201 diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pycountry/locales/vi/LC_MESSAGES/iso3166-2.mo b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pycountry/locales/vi/LC_MESSAGES/iso3166-2.mo new file mode 100644 index 0000000000000000000000000000000000000000..66b02dd361fe8700d44297cf2fdf64fc4b8ff35e --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pycountry/locales/vi/LC_MESSAGES/iso3166-2.mo @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e87438fe425e9195943be14e2b27e14b2671ee18a6c75e57a9015716f283c060 +size 135199 diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pycountry/locales/zh_CN/LC_MESSAGES/iso3166-2.mo b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pycountry/locales/zh_CN/LC_MESSAGES/iso3166-2.mo new file mode 100644 index 0000000000000000000000000000000000000000..6635b78ee7ca53fd5f0274ae557980482048215a --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pycountry/locales/zh_CN/LC_MESSAGES/iso3166-2.mo @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e465cc5648ef218a4b4450970fac9eee7c8abea8a776cfb8381e6df853847d29 +size 116542 diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pydantic/__pycache__/json_schema.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pydantic/__pycache__/json_schema.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..dd054a5c590de658313855d9ba0e5a1619e7d294 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pydantic/__pycache__/json_schema.cpython-312.pyc @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:05886779d0c6e8a0e2d3b57bed465b48fe9b1b92acdc7fcc5f1c8189f6728f24 +size 113856 diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pydantic/_internal/__pycache__/_generate_schema.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pydantic/_internal/__pycache__/_generate_schema.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..fb8ad703828e1cc482abfedf8c7c0d16e3a2da03 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pydantic/_internal/__pycache__/_generate_schema.cpython-312.pyc @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:159b1be074e92eaec4df296f30963f60d716a27697c7f30c9657f70b954113c8 +size 133356 diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pydantic_core/__pycache__/core_schema.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pydantic_core/__pycache__/core_schema.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f8b9550d8c7bddc5151e7dfbb5c989328a518749 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pydantic_core/__pycache__/core_schema.cpython-312.pyc @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ea5383c345bf7369d624444fe39efeb064a665703b8f779f67d2c82766f2f5b6 +size 150542 diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pymongo/asynchronous/__pycache__/collection.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pymongo/asynchronous/__pycache__/collection.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..6139cfb2e588a388220ff47137cac5ae6d61a3ae --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pymongo/asynchronous/__pycache__/collection.cpython-312.pyc @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9a81acf9d5b2e1322e4e019d72585a155639d836d1eb65daf42aa6fc68d0bb68 +size 157123 diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pymongo/asynchronous/__pycache__/mongo_client.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pymongo/asynchronous/__pycache__/mongo_client.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..7b716b98ffa0854abc1b7017e2a1ad84022d81e5 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pymongo/asynchronous/__pycache__/mongo_client.cpython-312.pyc @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:995d4cb8d819011c045db09a9f9cc1e1556914b688aee353657d9fae1fd66fe2 +size 140607 diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pymongo/synchronous/__pycache__/collection.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pymongo/synchronous/__pycache__/collection.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..87f6577208c4e7d57a0098dc60be45da5266356a --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pymongo/synchronous/__pycache__/collection.cpython-312.pyc @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4668f92f962c6b95b625b48c8d411f554a314c66906c8af517c9f5eda7b21362 +size 148735 diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pymongo/synchronous/__pycache__/mongo_client.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pymongo/synchronous/__pycache__/mongo_client.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..50c4c3fd81a14f8f1afd0d616843fd0e0851c6ed --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pymongo/synchronous/__pycache__/mongo_client.cpython-312.pyc @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2475744334a45a965cfc04fa7bf9c6e1588832b635a4d92e8c06d9643c454911 +size 132365 diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pynvml_utils/__pycache__/smi.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pynvml_utils/__pycache__/smi.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c995ff3dd96f124ac08abd38c911bb80614ce880 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pynvml_utils/__pycache__/smi.cpython-312.pyc @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3eff47a52774fd49c2a16da42223287b5355e20243285838d7e50c61e898d844 +size 113943 diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pypika/__pycache__/queries.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pypika/__pycache__/queries.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..78cd31f2e5cbf3076bec4d099851a6da70ab0b0d --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pypika/__pycache__/queries.cpython-312.pyc @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cdba0164186a41b0b85dcef004522fa30ebb9199174c8f888ecd916c5714243c +size 111143 diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pytz/zoneinfo/America/Argentina/Mendoza b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pytz/zoneinfo/America/Argentina/Mendoza new file mode 100644 index 0000000000000000000000000000000000000000..3232c80e2003489921578f7acbabc73fb9148205 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pytz/zoneinfo/America/Argentina/Mendoza differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pytz/zoneinfo/America/Argentina/Tucuman b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pytz/zoneinfo/America/Argentina/Tucuman new file mode 100644 index 0000000000000000000000000000000000000000..c6449f582a7804ecf66858a7fceda207c5d979be Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pytz/zoneinfo/America/Argentina/Tucuman differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pytz/zoneinfo/America/Argentina/Ushuaia b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pytz/zoneinfo/America/Argentina/Ushuaia new file mode 100644 index 0000000000000000000000000000000000000000..e74ce049c793c96e855ebb15779887a48622bf26 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pytz/zoneinfo/America/Argentina/Ushuaia differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pytz/zoneinfo/America/Indiana/Knox b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pytz/zoneinfo/America/Indiana/Knox new file mode 100644 index 0000000000000000000000000000000000000000..025d132dd48ba978c6fedf86d70173127be49d49 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pytz/zoneinfo/America/Indiana/Knox differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pytz/zoneinfo/America/Indiana/Petersburg b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pytz/zoneinfo/America/Indiana/Petersburg new file mode 100644 index 0000000000000000000000000000000000000000..3082de00c2e0bfe89d4ac5e093d9e5921aa63610 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pytz/zoneinfo/America/Indiana/Petersburg differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pytz/zoneinfo/America/Indiana/Tell_City b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pytz/zoneinfo/America/Indiana/Tell_City new file mode 100644 index 0000000000000000000000000000000000000000..103c5cb31795edc15d548ef4ca71f1e04e2996b5 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pytz/zoneinfo/America/Indiana/Tell_City differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pytz/zoneinfo/America/Indiana/Vevay b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pytz/zoneinfo/America/Indiana/Vevay new file mode 100644 index 0000000000000000000000000000000000000000..315b4c45aef1f241d025900544133c085fe4f69d Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pytz/zoneinfo/America/Indiana/Vevay differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pytz/zoneinfo/America/Indiana/Vincennes b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pytz/zoneinfo/America/Indiana/Vincennes new file mode 100644 index 0000000000000000000000000000000000000000..35a24133446b9ee1e8f8a7931519d93517130315 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pytz/zoneinfo/America/Indiana/Vincennes differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pytz/zoneinfo/America/Indiana/Winamac b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pytz/zoneinfo/America/Indiana/Winamac new file mode 100644 index 0000000000000000000000000000000000000000..6d4e19377e9f70c3782daa223753c640c60ab1eb Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pytz/zoneinfo/America/Indiana/Winamac differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pytz/zoneinfo/America/Kentucky/Louisville b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pytz/zoneinfo/America/Kentucky/Louisville new file mode 100644 index 0000000000000000000000000000000000000000..3a335b37165d2b3d6a09a1716cb158e272087c9f Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pytz/zoneinfo/America/Kentucky/Louisville differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pytz/zoneinfo/America/Kentucky/Monticello b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pytz/zoneinfo/America/Kentucky/Monticello new file mode 100644 index 0000000000000000000000000000000000000000..576f16bb2b21a7e0871a7222241ad65e533bb93a Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pytz/zoneinfo/America/Kentucky/Monticello differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pytz/zoneinfo/America/North_Dakota/Beulah b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pytz/zoneinfo/America/North_Dakota/Beulah new file mode 100644 index 0000000000000000000000000000000000000000..33e317e25b127335de68052f57d33ceed620524e Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pytz/zoneinfo/America/North_Dakota/Beulah differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pytz/zoneinfo/America/North_Dakota/Center b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pytz/zoneinfo/America/North_Dakota/Center new file mode 100644 index 0000000000000000000000000000000000000000..17fe13bcc1c73ecbc6738499667816f54c164e39 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pytz/zoneinfo/America/North_Dakota/Center differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pytz/zoneinfo/America/North_Dakota/New_Salem b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pytz/zoneinfo/America/North_Dakota/New_Salem new file mode 100644 index 0000000000000000000000000000000000000000..12dbe801aeb06823483525727f6f6695dec1bc24 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pytz/zoneinfo/America/North_Dakota/New_Salem differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pyzmq-27.0.1.dist-info/licenses/LICENSE.md b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pyzmq-27.0.1.dist-info/licenses/LICENSE.md new file mode 100644 index 0000000000000000000000000000000000000000..f7072d1c994fbb6eb8a48365be0d583cb02a03e9 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pyzmq-27.0.1.dist-info/licenses/LICENSE.md @@ -0,0 +1,30 @@ +BSD 3-Clause License + +Copyright (c) 2009-2012, Brian Granger, Min Ragan-Kelley + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +3. Neither the name of the copyright holder nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pyzmq-27.0.1.dist-info/licenses/licenses/LICENSE.libsodium.txt b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pyzmq-27.0.1.dist-info/licenses/licenses/LICENSE.libsodium.txt new file mode 100644 index 0000000000000000000000000000000000000000..6bce7f0581c80aa6d05d33dd5267e1e047c738a9 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pyzmq-27.0.1.dist-info/licenses/licenses/LICENSE.libsodium.txt @@ -0,0 +1,18 @@ +/* + * ISC License + * + * Copyright (c) 2013-2024 + * Frank Denis + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pyzmq-27.0.1.dist-info/licenses/licenses/LICENSE.tornado.txt b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pyzmq-27.0.1.dist-info/licenses/licenses/LICENSE.tornado.txt new file mode 100644 index 0000000000000000000000000000000000000000..d645695673349e3947e8e5ae42332d0ac3164cd7 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pyzmq-27.0.1.dist-info/licenses/licenses/LICENSE.tornado.txt @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pyzmq-27.0.1.dist-info/licenses/licenses/LICENSE.zeromq.txt b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pyzmq-27.0.1.dist-info/licenses/licenses/LICENSE.zeromq.txt new file mode 100644 index 0000000000000000000000000000000000000000..a612ad9813b006ce81d1ee438dd784da99a54007 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/pyzmq-27.0.1.dist-info/licenses/licenses/LICENSE.zeromq.txt @@ -0,0 +1,373 @@ +Mozilla Public License Version 2.0 +================================== + +1. Definitions +-------------- + +1.1. "Contributor" + means each individual or legal entity that creates, contributes to + the creation of, or owns Covered Software. + +1.2. "Contributor Version" + means the combination of the Contributions of others (if any) used + by a Contributor and that particular Contributor's Contribution. + +1.3. "Contribution" + means Covered Software of a particular Contributor. + +1.4. "Covered Software" + means Source Code Form to which the initial Contributor has attached + the notice in Exhibit A, the Executable Form of such Source Code + Form, and Modifications of such Source Code Form, in each case + including portions thereof. + +1.5. "Incompatible With Secondary Licenses" + means + + (a) that the initial Contributor has attached the notice described + in Exhibit B to the Covered Software; or + + (b) that the Covered Software was made available under the terms of + version 1.1 or earlier of the License, but not also under the + terms of a Secondary License. + +1.6. "Executable Form" + means any form of the work other than Source Code Form. + +1.7. "Larger Work" + means a work that combines Covered Software with other material, in + a separate file or files, that is not Covered Software. + +1.8. "License" + means this document. + +1.9. "Licensable" + means having the right to grant, to the maximum extent possible, + whether at the time of the initial grant or subsequently, any and + all of the rights conveyed by this License. + +1.10. "Modifications" + means any of the following: + + (a) any file in Source Code Form that results from an addition to, + deletion from, or modification of the contents of Covered + Software; or + + (b) any new file in Source Code Form that contains any Covered + Software. + +1.11. "Patent Claims" of a Contributor + means any patent claim(s), including without limitation, method, + process, and apparatus claims, in any patent Licensable by such + Contributor that would be infringed, but for the grant of the + License, by the making, using, selling, offering for sale, having + made, import, or transfer of either its Contributions or its + Contributor Version. + +1.12. "Secondary License" + means either the GNU General Public License, Version 2.0, the GNU + Lesser General Public License, Version 2.1, the GNU Affero General + Public License, Version 3.0, or any later versions of those + licenses. + +1.13. "Source Code Form" + means the form of the work preferred for making modifications. + +1.14. "You" (or "Your") + means an individual or a legal entity exercising rights under this + License. For legal entities, "You" includes any entity that + controls, is controlled by, or is under common control with You. For + purposes of this definition, "control" means (a) the power, direct + or indirect, to cause the direction or management of such entity, + whether by contract or otherwise, or (b) ownership of more than + fifty percent (50%) of the outstanding shares or beneficial + ownership of such entity. + +2. License Grants and Conditions +-------------------------------- + +2.1. Grants + +Each Contributor hereby grants You a world-wide, royalty-free, +non-exclusive license: + +(a) under intellectual property rights (other than patent or trademark) + Licensable by such Contributor to use, reproduce, make available, + modify, display, perform, distribute, and otherwise exploit its + Contributions, either on an unmodified basis, with Modifications, or + as part of a Larger Work; and + +(b) under Patent Claims of such Contributor to make, use, sell, offer + for sale, have made, import, and otherwise transfer either its + Contributions or its Contributor Version. + +2.2. Effective Date + +The licenses granted in Section 2.1 with respect to any Contribution +become effective for each Contribution on the date the Contributor first +distributes such Contribution. + +2.3. Limitations on Grant Scope + +The licenses granted in this Section 2 are the only rights granted under +this License. No additional rights or licenses will be implied from the +distribution or licensing of Covered Software under this License. +Notwithstanding Section 2.1(b) above, no patent license is granted by a +Contributor: + +(a) for any code that a Contributor has removed from Covered Software; + or + +(b) for infringements caused by: (i) Your and any other third party's + modifications of Covered Software, or (ii) the combination of its + Contributions with other software (except as part of its Contributor + Version); or + +(c) under Patent Claims infringed by Covered Software in the absence of + its Contributions. + +This License does not grant any rights in the trademarks, service marks, +or logos of any Contributor (except as may be necessary to comply with +the notice requirements in Section 3.4). + +2.4. Subsequent Licenses + +No Contributor makes additional grants as a result of Your choice to +distribute the Covered Software under a subsequent version of this +License (see Section 10.2) or under the terms of a Secondary License (if +permitted under the terms of Section 3.3). + +2.5. Representation + +Each Contributor represents that the Contributor believes its +Contributions are its original creation(s) or it has sufficient rights +to grant the rights to its Contributions conveyed by this License. + +2.6. Fair Use + +This License is not intended to limit any rights You have under +applicable copyright doctrines of fair use, fair dealing, or other +equivalents. + +2.7. Conditions + +Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted +in Section 2.1. + +3. Responsibilities +------------------- + +3.1. Distribution of Source Form + +All distribution of Covered Software in Source Code Form, including any +Modifications that You create or to which You contribute, must be under +the terms of this License. You must inform recipients that the Source +Code Form of the Covered Software is governed by the terms of this +License, and how they can obtain a copy of this License. You may not +attempt to alter or restrict the recipients' rights in the Source Code +Form. + +3.2. Distribution of Executable Form + +If You distribute Covered Software in Executable Form then: + +(a) such Covered Software must also be made available in Source Code + Form, as described in Section 3.1, and You must inform recipients of + the Executable Form how they can obtain a copy of such Source Code + Form by reasonable means in a timely manner, at a charge no more + than the cost of distribution to the recipient; and + +(b) You may distribute such Executable Form under the terms of this + License, or sublicense it under different terms, provided that the + license for the Executable Form does not attempt to limit or alter + the recipients' rights in the Source Code Form under this License. + +3.3. Distribution of a Larger Work + +You may create and distribute a Larger Work under terms of Your choice, +provided that You also comply with the requirements of this License for +the Covered Software. If the Larger Work is a combination of Covered +Software with a work governed by one or more Secondary Licenses, and the +Covered Software is not Incompatible With Secondary Licenses, this +License permits You to additionally distribute such Covered Software +under the terms of such Secondary License(s), so that the recipient of +the Larger Work may, at their option, further distribute the Covered +Software under the terms of either this License or such Secondary +License(s). + +3.4. Notices + +You may not remove or alter the substance of any license notices +(including copyright notices, patent notices, disclaimers of warranty, +or limitations of liability) contained within the Source Code Form of +the Covered Software, except that You may alter any license notices to +the extent required to remedy known factual inaccuracies. + +3.5. Application of Additional Terms + +You may choose to offer, and to charge a fee for, warranty, support, +indemnity or liability obligations to one or more recipients of Covered +Software. However, You may do so only on Your own behalf, and not on +behalf of any Contributor. You must make it absolutely clear that any +such warranty, support, indemnity, or liability obligation is offered by +You alone, and You hereby agree to indemnify every Contributor for any +liability incurred by such Contributor as a result of warranty, support, +indemnity or liability terms You offer. You may include additional +disclaimers of warranty and limitations of liability specific to any +jurisdiction. + +4. Inability to Comply Due to Statute or Regulation +--------------------------------------------------- + +If it is impossible for You to comply with any of the terms of this +License with respect to some or all of the Covered Software due to +statute, judicial order, or regulation then You must: (a) comply with +the terms of this License to the maximum extent possible; and (b) +describe the limitations and the code they affect. Such description must +be placed in a text file included with all distributions of the Covered +Software under this License. Except to the extent prohibited by statute +or regulation, such description must be sufficiently detailed for a +recipient of ordinary skill to be able to understand it. + +5. Termination +-------------- + +5.1. The rights granted under this License will terminate automatically +if You fail to comply with any of its terms. However, if You become +compliant, then the rights granted under this License from a particular +Contributor are reinstated (a) provisionally, unless and until such +Contributor explicitly and finally terminates Your grants, and (b) on an +ongoing basis, if such Contributor fails to notify You of the +non-compliance by some reasonable means prior to 60 days after You have +come back into compliance. Moreover, Your grants from a particular +Contributor are reinstated on an ongoing basis if such Contributor +notifies You of the non-compliance by some reasonable means, this is the +first time You have received notice of non-compliance with this License +from such Contributor, and You become compliant prior to 30 days after +Your receipt of the notice. + +5.2. If You initiate litigation against any entity by asserting a patent +infringement claim (excluding declaratory judgment actions, +counter-claims, and cross-claims) alleging that a Contributor Version +directly or indirectly infringes any patent, then the rights granted to +You by any and all Contributors for the Covered Software under Section +2.1 of this License shall terminate. + +5.3. In the event of termination under Sections 5.1 or 5.2 above, all +end user license agreements (excluding distributors and resellers) which +have been validly granted by You or Your distributors under this License +prior to termination shall survive termination. + +************************************************************************ +* * +* 6. Disclaimer of Warranty * +* ------------------------- * +* * +* Covered Software is provided under this License on an "as is" * +* basis, without warranty of any kind, either expressed, implied, or * +* statutory, including, without limitation, warranties that the * +* Covered Software is free of defects, merchantable, fit for a * +* particular purpose or non-infringing. The entire risk as to the * +* quality and performance of the Covered Software is with You. * +* Should any Covered Software prove defective in any respect, You * +* (not any Contributor) assume the cost of any necessary servicing, * +* repair, or correction. This disclaimer of warranty constitutes an * +* essential part of this License. No use of any Covered Software is * +* authorized under this License except under this disclaimer. * +* * +************************************************************************ + +************************************************************************ +* * +* 7. Limitation of Liability * +* -------------------------- * +* * +* Under no circumstances and under no legal theory, whether tort * +* (including negligence), contract, or otherwise, shall any * +* Contributor, or anyone who distributes Covered Software as * +* permitted above, be liable to You for any direct, indirect, * +* special, incidental, or consequential damages of any character * +* including, without limitation, damages for lost profits, loss of * +* goodwill, work stoppage, computer failure or malfunction, or any * +* and all other commercial damages or losses, even if such party * +* shall have been informed of the possibility of such damages. This * +* limitation of liability shall not apply to liability for death or * +* personal injury resulting from such party's negligence to the * +* extent applicable law prohibits such limitation. Some * +* jurisdictions do not allow the exclusion or limitation of * +* incidental or consequential damages, so this exclusion and * +* limitation may not apply to You. * +* * +************************************************************************ + +8. Litigation +------------- + +Any litigation relating to this License may be brought only in the +courts of a jurisdiction where the defendant maintains its principal +place of business and such litigation shall be governed by laws of that +jurisdiction, without reference to its conflict-of-law provisions. +Nothing in this Section shall prevent a party's ability to bring +cross-claims or counter-claims. + +9. Miscellaneous +---------------- + +This License represents the complete agreement concerning the subject +matter hereof. If any provision of this License is held to be +unenforceable, such provision shall be reformed only to the extent +necessary to make it enforceable. Any law or regulation which provides +that the language of a contract shall be construed against the drafter +shall not be used to construe this License against a Contributor. + +10. Versions of the License +--------------------------- + +10.1. New Versions + +Mozilla Foundation is the license steward. Except as provided in Section +10.3, no one other than the license steward has the right to modify or +publish new versions of this License. Each version will be given a +distinguishing version number. + +10.2. Effect of New Versions + +You may distribute the Covered Software under the terms of the version +of the License under which You originally received the Covered Software, +or under the terms of any subsequent version published by the license +steward. + +10.3. Modified Versions + +If you create software not governed by this License, and you want to +create a new license for such software, you may create and use a +modified version of this License if you rename the license and remove +any references to the name of the license steward (except to note that +such modified license differs from this License). + +10.4. Distributing Source Code Form that is Incompatible With Secondary +Licenses + +If You choose to distribute Source Code Form that is Incompatible With +Secondary Licenses under the terms of this version of the License, the +notice described in Exhibit B of this License must be attached. + +Exhibit A - Source Code Form License Notice +------------------------------------------- + + This Source Code Form is subject to the terms of the Mozilla Public + License, v. 2.0. If a copy of the MPL was not distributed with this + file, You can obtain one at http://mozilla.org/MPL/2.0/. + +If it is not possible or desirable to put the notice in a particular +file, then You may include the notice in a location (such as a LICENSE +file in a relevant directory) where a recipient would be likely to look +for such a notice. + +You may add additional accurate notices of copyright ownership. + +Exhibit B - "Incompatible With Secondary Licenses" Notice +--------------------------------------------------------- + + This Source Code Form is "Incompatible With Secondary Licenses", as + defined by the Mozilla Public License, v. 2.0. diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/__pycache__/__init__.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/__pycache__/__init__.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..fa46bfe667488bfeed873f8922e5392be0a15602 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/__pycache__/__init__.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/__pycache__/_pydantic_compat.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/__pycache__/_pydantic_compat.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..8de18ec476fcc2d3d15cbd0198b23f72f513c30d Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/__pycache__/_pydantic_compat.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/__pycache__/async_client_base.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/__pycache__/async_client_base.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d8a6ecbb485911091f63798660aacf1420727bc1 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/__pycache__/async_client_base.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/__pycache__/async_qdrant_client.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/__pycache__/async_qdrant_client.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2bea93435956e979682a9de1164c6ef0ea7b99be --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/__pycache__/async_qdrant_client.cpython-312.pyc @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:037f9c4154ce75dd5fe5ea565388fae5964996d54959db543ed07c10c66792e5 +size 145405 diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/__pycache__/async_qdrant_fastembed.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/__pycache__/async_qdrant_fastembed.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..092c2fca86af8b7e517cb41d2d0e24c4b39ca971 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/__pycache__/async_qdrant_fastembed.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/__pycache__/async_qdrant_remote.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/__pycache__/async_qdrant_remote.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..0c0fc1d64494a856f4ee2b1fdfdcbe7d0fb2ca9b --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/__pycache__/async_qdrant_remote.cpython-312.pyc @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f8ab36b18d8aad9efbb66b788b748af382f4ea725415564c2bbe7805117f7ca1 +size 140607 diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/__pycache__/client_base.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/__pycache__/client_base.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..52097296349cea2d727b125ad23eaf49874b84f4 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/__pycache__/client_base.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/__pycache__/connection.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/__pycache__/connection.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c35d4b431c6fb2c0c32ac246b17bd30ad8f5c6c4 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/__pycache__/connection.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/__pycache__/fastembed_common.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/__pycache__/fastembed_common.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2dfeddde755781129e5e6bbd101faf512a4a26ea Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/__pycache__/fastembed_common.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/__pycache__/parallel_processor.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/__pycache__/parallel_processor.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e48c9a792d1c82b52ef4773dfcdc502645571262 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/__pycache__/parallel_processor.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/__pycache__/qdrant_client.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/__pycache__/qdrant_client.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..88ef34a88c73580238d98373e92f0fc9a3a18fc9 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/__pycache__/qdrant_client.cpython-312.pyc @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:84f2e3ba548f645729eca95232e2891f7c81dc77a066f0fab62a925feeedc8ee +size 143345 diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/__pycache__/qdrant_fastembed.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/__pycache__/qdrant_fastembed.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..dd1a7fe49cdc6736d6ffc05e3f411372c738e3bf Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/__pycache__/qdrant_fastembed.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/__pycache__/qdrant_remote.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/__pycache__/qdrant_remote.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c86041b252320d67bdabd919a3909f616f2f1f01 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/__pycache__/qdrant_remote.cpython-312.pyc @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bc0c0b5163c9d25554db5d6a70d21060dcff61002114e6bbdecb8ba03b06219e +size 134754 diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/auth/__init__.py b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/auth/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..f5e1c98d0a0822501b7f879813e1540c4458680a --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/auth/__init__.py @@ -0,0 +1 @@ +from qdrant_client.auth.bearer_auth import BearerAuth diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/auth/__pycache__/__init__.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/auth/__pycache__/__init__.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..7ded1fae8301f270a421e933a2d245c9c5cf75a6 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/auth/__pycache__/__init__.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/auth/__pycache__/bearer_auth.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/auth/__pycache__/bearer_auth.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..7a6dce4d79a2f66440af67181e92204976252a05 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/auth/__pycache__/bearer_auth.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/auth/bearer_auth.py b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/auth/bearer_auth.py new file mode 100644 index 0000000000000000000000000000000000000000..effaacccb0442768148d89e2e7a5151f28c034e8 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/auth/bearer_auth.py @@ -0,0 +1,42 @@ +import asyncio +from typing import Awaitable, Callable, Optional, Union + +import httpx + + +class BearerAuth(httpx.Auth): + def __init__( + self, + auth_token_provider: Union[Callable[[], str], Callable[[], Awaitable[str]]], + ): + self.async_token: Optional[Callable[[], Awaitable[str]]] = None + self.sync_token: Optional[Callable[[], str]] = None + + if asyncio.iscoroutinefunction(auth_token_provider): + self.async_token = auth_token_provider + else: + if callable(auth_token_provider): + self.sync_token = auth_token_provider # type: ignore + else: + raise ValueError("auth_token_provider must be a callable or awaitable") + + def _sync_get_token(self) -> str: + if self.sync_token is None: + raise ValueError("Synchronous token provider is not set.") + return self.sync_token() + + def sync_auth_flow(self, request: httpx.Request) -> httpx.Request: + token = self._sync_get_token() + request.headers["Authorization"] = f"Bearer {token}" + yield request + + async def _async_get_token(self) -> str: + if self.async_token is not None: + return await self.async_token() # type: ignore + # Fallback to synchronous token if asynchronous token is not available + return self._sync_get_token() + + async def async_auth_flow(self, request: httpx.Request) -> httpx.Request: + token = await self._async_get_token() + request.headers["Authorization"] = f"Bearer {token}" + yield request diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/common/__init__.py b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/common/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/common/__pycache__/__init__.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/common/__pycache__/__init__.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..908dcb0f8bd7b842f7bf613d37db07ba3e6cfab4 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/common/__pycache__/__init__.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/common/__pycache__/client_exceptions.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/common/__pycache__/client_exceptions.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..4586ecaa9c4de3bed1b64fb4f78239077626f572 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/common/__pycache__/client_exceptions.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/common/__pycache__/client_warnings.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/common/__pycache__/client_warnings.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..b69a2fea3887a06970b25242178c402596ea9096 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/common/__pycache__/client_warnings.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/common/__pycache__/version_check.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/common/__pycache__/version_check.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a70c8751c4d22e7dcfff76a8a9ac40c813956230 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/common/__pycache__/version_check.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/common/client_exceptions.py b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/common/client_exceptions.py new file mode 100644 index 0000000000000000000000000000000000000000..b4e1b5da34b7767ecec24ce03fc320141eaa14af --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/common/client_exceptions.py @@ -0,0 +1,16 @@ +class QdrantException(Exception): + """Base class""" + + +class ResourceExhaustedResponse(QdrantException): + def __init__(self, message: str, retry_after_s: int) -> None: + self.message = message if message else "Resource Exhausted Response" + try: + self.retry_after_s = int(retry_after_s) + except Exception as ex: + raise QdrantException( + f"Retry-After header value is not a valid integer: {retry_after_s}" + ) from ex + + def __str__(self) -> str: + return self.message.strip() diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/common/client_warnings.py b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/common/client_warnings.py new file mode 100644 index 0000000000000000000000000000000000000000..319cc7b6ae7179673b82e214d9623c0242e86415 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/common/client_warnings.py @@ -0,0 +1,24 @@ +import warnings +from typing import Optional + +SEEN_MESSAGES = set() + + +def show_warning(message: str, category: type[Warning] = UserWarning, stacklevel: int = 2) -> None: + warnings.warn(message, category, stacklevel=stacklevel) + + +def show_warning_once( + message: str, + category: type[Warning] = UserWarning, + idx: Optional[str] = None, + stacklevel: int = 1, +) -> None: + """ + Show a warning of the specified category only once per program run. + """ + key = idx if idx is not None else message + + if key not in SEEN_MESSAGES: + SEEN_MESSAGES.add(key) + show_warning(message, category, stacklevel) diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/common/version_check.py b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/common/version_check.py new file mode 100644 index 0000000000000000000000000000000000000000..5734f48b80c0d25540cd0ec13aa0f2dd7337f7c0 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/common/version_check.py @@ -0,0 +1,65 @@ +import logging +from typing import Any, Optional +from collections import namedtuple + +import httpx + +from qdrant_client.auth import BearerAuth + +Version = namedtuple("Version", ["major", "minor", "rest"]) + + +def get_server_version( + rest_uri: str, rest_headers: dict[str, Any], auth_provider: Optional[BearerAuth] +) -> Optional[str]: + response = httpx.get(rest_uri, headers=rest_headers, auth=auth_provider) + + if response.status_code == 200: + version_info = response.json().get("version", None) + if not version_info: + logging.debug( + f"Unable to parse response from server: {response}, server version defaults to None" + ) + return version_info + else: + logging.debug( + f"Unexpected response from server: {response}, server version defaults to None" + ) + return None + + +def parse_version(version: str) -> Version: + if not version: + raise ValueError("Version is None") + try: + major, minor, *rest = version.split(".") + return Version(int(major), int(minor), rest) + except ValueError as er: + raise ValueError( + f"Unable to parse version, expected format: x.y.z, found: {version}" + ) from er + + +def is_compatible(client_version: Optional[str], server_version: Optional[str]) -> bool: + if not client_version: + logging.debug(f"Unable to compare with client version {client_version}") + return False + + if not server_version: + logging.debug(f"Unable to compare with server version {server_version}") + return False + + if client_version == server_version: + return True + + try: + parsed_server_version = parse_version(server_version) + parsed_client_version = parse_version(client_version) + except ValueError as er: + logging.debug(f"Unable to compare versions: {er}") + return False + + major_dif = abs(parsed_server_version.major - parsed_client_version.major) + if major_dif >= 1: + return False + return abs(parsed_server_version.minor - parsed_client_version.minor) <= 1 diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/conversions/__init__.py b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/conversions/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/conversions/__pycache__/__init__.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/conversions/__pycache__/__init__.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..ea59444f51171068b4b9c1c5219c68824981ffe9 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/conversions/__pycache__/__init__.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/conversions/__pycache__/common_types.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/conversions/__pycache__/common_types.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e51b8a26dd591b4c6d6a3cdc49177294debff877 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/conversions/__pycache__/common_types.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/conversions/__pycache__/conversion.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/conversions/__pycache__/conversion.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..73e131fa48566afd9de6055458fe01c16ece2e69 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/conversions/__pycache__/conversion.cpython-312.pyc @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b18d1ec6c439abf8a1c2e5ecb9c31d12bfac59b4730eabf3081e12b112b21ef2 +size 277236 diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/conversions/common_types.py b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/conversions/common_types.py new file mode 100644 index 0000000000000000000000000000000000000000..e251d2399b5e72783cc1377b3189f816366d3f9a --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/conversions/common_types.py @@ -0,0 +1,165 @@ +import sys + +import numpy as np +import numpy.typing as npt + +if sys.version_info >= (3, 10): + from typing import TypeAlias +else: + from typing_extensions import TypeAlias + +from typing import Union, get_args, Sequence + +from qdrant_client import grpc +from qdrant_client.http import models as rest + +typing_remap = { + rest.StrictStr: str, + rest.StrictInt: int, + rest.StrictFloat: float, + rest.StrictBool: bool, +} + + +def remap_type(tp: type) -> type: + """Remap type to a type that can be used in type annotations + + Pydantic uses custom types for strict types, so we need to remap them to standard types + so that they can be used in type annotations and isinstance checks + """ + return typing_remap.get(tp, tp) + + +def get_args_subscribed(tp): # type: ignore + """Get type arguments with all substitutions performed. Supports subscripted generics having __origin__ + + Args: + tp: type to get arguments from. Can be either a type or a subscripted generic + + Returns: + tuple of type arguments + """ + return tuple( + remap_type(arg if not hasattr(arg, "__origin__") else arg.__origin__) + for arg in get_args(tp) + ) + + +Filter = Union[rest.Filter, grpc.Filter] +SearchParams = Union[rest.SearchParams, grpc.SearchParams] +PayloadSelector = Union[rest.PayloadSelector, grpc.WithPayloadSelector] +Distance = Union[rest.Distance, int] # type(grpc.Distance) == int +HnswConfigDiff = Union[rest.HnswConfigDiff, grpc.HnswConfigDiff] +VectorsConfigDiff = Union[rest.VectorsConfigDiff, grpc.VectorsConfigDiff] +QuantizationConfigDiff = Union[rest.QuantizationConfigDiff, grpc.QuantizationConfigDiff] +OptimizersConfigDiff = Union[rest.OptimizersConfigDiff, grpc.OptimizersConfigDiff] +CollectionParamsDiff = Union[rest.CollectionParamsDiff, grpc.CollectionParamsDiff] +WalConfigDiff = Union[rest.WalConfigDiff, grpc.WalConfigDiff] +QuantizationConfig = Union[rest.QuantizationConfig, grpc.QuantizationConfig] +PointId = Union[int, str, grpc.PointId] +PayloadSchemaType = Union[ + rest.PayloadSchemaType, + rest.PayloadSchemaParams, + int, + grpc.PayloadIndexParams, +] # type(grpc.PayloadSchemaType) == int +PointStruct: TypeAlias = rest.PointStruct +Batch: TypeAlias = rest.Batch +Points = Union[Batch, Sequence[Union[rest.PointStruct, grpc.PointStruct]]] +PointsSelector = Union[ + list[PointId], + rest.Filter, + grpc.Filter, + rest.PointsSelector, + grpc.PointsSelector, +] +LookupLocation = Union[rest.LookupLocation, grpc.LookupLocation] +RecommendStrategy: TypeAlias = rest.RecommendStrategy +RecommendExample: TypeAlias = rest.RecommendExample +TargetVector = Union[rest.RecommendExample, grpc.TargetVector] +ContextExamplePair = Union[rest.ContextExamplePair, grpc.ContextExamplePair] +OrderBy = Union[rest.OrderByInterface, grpc.OrderBy] +ShardingMethod: TypeAlias = rest.ShardingMethod +ShardKey: TypeAlias = rest.ShardKey +ShardKeySelector: TypeAlias = rest.ShardKeySelector + +AliasOperations = Union[ + rest.CreateAliasOperation, + rest.RenameAliasOperation, + rest.DeleteAliasOperation, + grpc.AliasOperations, +] +Payload: TypeAlias = rest.Payload + +ScoredPoint: TypeAlias = rest.ScoredPoint +UpdateResult: TypeAlias = rest.UpdateResult +Record: TypeAlias = rest.Record +CollectionsResponse: TypeAlias = rest.CollectionsResponse +CollectionInfo: TypeAlias = rest.CollectionInfo +CountResult: TypeAlias = rest.CountResult +SnapshotDescription: TypeAlias = rest.SnapshotDescription +NamedVector: TypeAlias = rest.NamedVector +NamedSparseVector: TypeAlias = rest.NamedSparseVector +SparseVector: TypeAlias = rest.SparseVector +PointVectors: TypeAlias = rest.PointVectors +Vector: TypeAlias = rest.Vector +VectorInput: TypeAlias = rest.VectorInput +VectorStruct: TypeAlias = rest.VectorStruct +VectorParams: TypeAlias = rest.VectorParams +SparseVectorParams: TypeAlias = rest.SparseVectorParams +LocksOption: TypeAlias = rest.LocksOption +SnapshotPriority: TypeAlias = rest.SnapshotPriority +CollectionsAliasesResponse: TypeAlias = rest.CollectionsAliasesResponse +InitFrom: TypeAlias = Union[rest.InitFrom, str] +UpdateOperation: TypeAlias = rest.UpdateOperation +Query: TypeAlias = rest.Query +Prefetch: TypeAlias = rest.Prefetch +Document: TypeAlias = rest.Document +Image: TypeAlias = rest.Image +InferenceObject: TypeAlias = rest.InferenceObject +StrictModeConfig: TypeAlias = rest.StrictModeConfig + +SearchRequest = Union[rest.SearchRequest, grpc.SearchPoints] +RecommendRequest = Union[rest.RecommendRequest, grpc.RecommendPoints] +DiscoverRequest = Union[rest.DiscoverRequest, grpc.DiscoverPoints] +QueryRequest = Union[rest.QueryRequest, grpc.QueryPoints] + +Mmr: TypeAlias = rest.Mmr + +ReadConsistency: TypeAlias = rest.ReadConsistency +WriteOrdering: TypeAlias = rest.WriteOrdering +WithLookupInterface: TypeAlias = rest.WithLookupInterface + +GroupsResult: TypeAlias = rest.GroupsResult +QueryResponse: TypeAlias = rest.QueryResponse + +FacetValue: TypeAlias = rest.FacetValue +FacetResponse: TypeAlias = rest.FacetResponse +SearchMatrixRequest = Union[rest.SearchMatrixRequest, grpc.SearchMatrixPoints] +SearchMatrixOffsetsResponse: TypeAlias = rest.SearchMatrixOffsetsResponse +SearchMatrixPairsResponse: TypeAlias = rest.SearchMatrixPairsResponse +SearchMatrixPair: TypeAlias = rest.SearchMatrixPair + +VersionInfo: TypeAlias = rest.VersionInfo + +# we can't use `nptyping` package due to numpy/python-version incompatibilities +# thus we need to define precise type annotations while we support python3.7 +_np_numeric = Union[ + np.bool_, # pylance can't handle np.bool8 alias + np.int8, + np.int16, + np.int32, + np.int64, + np.uint8, + np.uint16, + np.uint32, + np.uint64, + np.intp, + np.uintp, + np.float16, + np.float32, + np.float64, + np.longdouble, # np.float96 and np.float128 are platform dependant aliases for longdouble +] + +NumpyArray: TypeAlias = npt.NDArray[_np_numeric] diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/conversions/conversion.py b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/conversions/conversion.py new file mode 100644 index 0000000000000000000000000000000000000000..3638526cb32c5edaf463b1e70e4ef98d67c924d5 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/conversions/conversion.py @@ -0,0 +1,4761 @@ +from datetime import date, datetime, timezone +from typing import Any, Mapping, Optional, Sequence, Union, get_args + +from google.protobuf.internal.containers import MessageMap +from google.protobuf.json_format import MessageToDict +from google.protobuf.timestamp_pb2 import Timestamp + +try: + from google.protobuf.pyext._message import MessageMapContainer # type: ignore +except ImportError: + pass + +from qdrant_client import grpc +from qdrant_client.grpc import ListValue, NullValue, Struct, Value +from qdrant_client.http.models import models as rest +from qdrant_client._pydantic_compat import construct, to_jsonable_python +from qdrant_client.conversions.common_types import get_args_subscribed + + +def has_field(message: Any, field: str) -> bool: + """ + Same as protobuf HasField, but also works for primitive values + (https://stackoverflow.com/questions/51918871/check-if-a-field-has-been-set-in-protocol-buffer-3) + + Args: + message (Any): protobuf message + field (str): name of the field + """ + try: + return message.HasField(field) + except ValueError: + all_fields = set([descriptor.name for descriptor, _value in message.ListFields()]) + return field in all_fields + + +def json_to_value(payload: Any) -> Value: + if payload is None: + return Value(null_value=NullValue.NULL_VALUE) + if isinstance(payload, bool): + return Value(bool_value=payload) + if isinstance(payload, int): + return Value(integer_value=payload) + if isinstance(payload, float): + return Value(double_value=payload) + if isinstance(payload, str): + return Value(string_value=payload) + if isinstance(payload, (list, tuple)): + return Value(list_value=ListValue(values=[json_to_value(v) for v in payload])) + if isinstance(payload, dict): + return Value( + struct_value=Struct(fields=dict((k, json_to_value(v)) for k, v in payload.items())) + ) + if isinstance(payload, datetime) or isinstance(payload, date): + return Value(string_value=to_jsonable_python(payload)) + raise ValueError(f"Not supported json value: {payload}") # pragma: no cover + + +def value_to_json(value: Value) -> Any: + if isinstance(value, Value): + value_ = MessageToDict(value, preserving_proto_field_name=False) + else: + value_ = value + + if "integerValue" in value_: + # by default int are represented as string for precision + # But in python it is OK to just use `int` + return int(value_["integerValue"]) + if "doubleValue" in value_: + return value_["doubleValue"] + if "stringValue" in value_: + return value_["stringValue"] + if "boolValue" in value_: + return value_["boolValue"] + if "structValue" in value_: + if "fields" not in value_["structValue"]: + return {} + return dict( + (key, value_to_json(val)) for key, val in value_["structValue"]["fields"].items() + ) + if "listValue" in value_: + if "values" in value_["listValue"]: + return list(value_to_json(val) for val in value_["listValue"]["values"]) + else: + return [] + if "nullValue" in value_: + return None + raise ValueError(f"Not supported value: {value_}") # pragma: no cover + + +def payload_to_grpc(payload: dict[str, Any]) -> dict[str, Value]: + return dict((key, json_to_value(val)) for key, val in payload.items()) + + +def grpc_to_payload(grpc_: MessageMap[str, Value]) -> dict[str, Any]: + return dict((key, value_to_json(val)) for key, val in grpc_.items()) + + +def grpc_payload_schema_to_field_type(model: grpc.PayloadSchemaType) -> grpc.FieldType: + if model == grpc.PayloadSchemaType.Keyword: + return grpc.FieldType.FieldTypeKeyword + if model == grpc.PayloadSchemaType.Integer: + return grpc.FieldType.FieldTypeInteger + if model == grpc.PayloadSchemaType.Float: + return grpc.FieldType.FieldTypeFloat + if model == grpc.PayloadSchemaType.Bool: + return grpc.FieldType.FieldTypeBool + if model == grpc.PayloadSchemaType.Geo: + return grpc.FieldType.FieldTypeGeo + if model == grpc.PayloadSchemaType.Text: + return grpc.FieldType.FieldTypeText + if model == grpc.PayloadSchemaType.Datetime: + return grpc.FieldType.FieldTypeDatetime + if model == grpc.PayloadSchemaType.Uuid: + return grpc.FieldType.FieldTypeUuid + + raise ValueError(f"invalid PayloadSchemaType model: {model}") # pragma: no cover + + +def grpc_field_type_to_payload_schema(model: grpc.FieldType) -> grpc.PayloadSchemaType: + if model == grpc.FieldType.FieldTypeKeyword: + return grpc.PayloadSchemaType.Keyword + if model == grpc.FieldType.FieldTypeInteger: + return grpc.PayloadSchemaType.Integer + if model == grpc.FieldType.FieldTypeFloat: + return grpc.PayloadSchemaType.Float + if model == grpc.FieldType.FieldTypeBool: + return grpc.PayloadSchemaType.Bool + if model == grpc.FieldType.FieldTypeGeo: + return grpc.PayloadSchemaType.Geo + if model == grpc.FieldType.FieldTypeText: + return grpc.PayloadSchemaType.Text + if model == grpc.FieldType.FieldTypeDatetime: + return grpc.PayloadSchemaType.Datetime + if model == grpc.FieldType.FieldTypeUuid: + return grpc.PayloadSchemaType.Uuid + + raise ValueError(f"invalid FieldType model: {model}") # pragma: no cover + + +class GrpcToRest: + @classmethod + def convert_condition(cls, model: grpc.Condition) -> rest.Condition: + name = model.WhichOneof("condition_one_of") + if name is None: + raise ValueError(f"invalid Condition model: {model}") # pragma: no cover + val = getattr(model, name) + + if name == "field": + return cls.convert_field_condition(val) + if name == "filter": + return cls.convert_filter(val) + if name == "has_id": + return cls.convert_has_id_condition(val) + if name == "has_vector": + return cls.convert_has_vector_condition(val) + if name == "is_empty": + return cls.convert_is_empty_condition(val) + if name == "is_null": + return cls.convert_is_null_condition(val) + if name == "nested": + return cls.convert_nested_condition(val) + + raise ValueError(f"invalid Condition model: {model}") # pragma: no cover + + @classmethod + def convert_filter(cls, model: grpc.Filter) -> rest.Filter: + return rest.Filter( + must=[cls.convert_condition(condition) for condition in model.must], + should=[cls.convert_condition(condition) for condition in model.should], + must_not=[cls.convert_condition(condition) for condition in model.must_not], + min_should=( + rest.MinShould( + conditions=[ + cls.convert_condition(condition) + for condition in model.min_should.conditions + ], + min_count=model.min_should.min_count, + ) + if model.HasField("min_should") + else None + ), + ) + + @classmethod + def convert_range(cls, model: grpc.Range) -> rest.Range: + return rest.Range( + gt=model.gt if model.HasField("gt") else None, + gte=model.gte if model.HasField("gte") else None, + lt=model.lt if model.HasField("lt") else None, + lte=model.lte if model.HasField("lte") else None, + ) + + @classmethod + def convert_timestamp(cls, model: Timestamp) -> datetime: + return model.ToDatetime(tzinfo=timezone.utc) + + @classmethod + def convert_datetime_range(cls, model: grpc.DatetimeRange) -> rest.DatetimeRange: + return rest.DatetimeRange( + gt=cls.convert_timestamp(model.gt) if model.HasField("gt") else None, + gte=cls.convert_timestamp(model.gte) if model.HasField("gte") else None, + lt=cls.convert_timestamp(model.lt) if model.HasField("lt") else None, + lte=cls.convert_timestamp(model.lte) if model.HasField("lte") else None, + ) + + @classmethod + def convert_geo_radius(cls, model: grpc.GeoRadius) -> rest.GeoRadius: + return rest.GeoRadius(center=cls.convert_geo_point(model.center), radius=model.radius) + + @classmethod + def convert_geo_line_string(cls, model: grpc.GeoLineString) -> rest.GeoLineString: + return rest.GeoLineString(points=[cls.convert_geo_point(point) for point in model.points]) + + @classmethod + def convert_geo_polygon(cls, model: grpc.GeoPolygon) -> rest.GeoPolygon: + return rest.GeoPolygon( + exterior=cls.convert_geo_line_string(model.exterior), + interiors=( + [cls.convert_geo_line_string(interior) for interior in model.interiors] + if model.interiors + else None + ), + ) + + @classmethod + def convert_collection_description( + cls, model: grpc.CollectionDescription + ) -> rest.CollectionDescription: + return rest.CollectionDescription(name=model.name) + + @classmethod + def convert_collection_info(cls, model: grpc.CollectionInfo) -> rest.CollectionInfo: + return rest.CollectionInfo( + config=cls.convert_collection_config(model.config), + optimizer_status=cls.convert_optimizer_status(model.optimizer_status), + payload_schema=cls.convert_payload_schema(model.payload_schema), + segments_count=model.segments_count, + status=cls.convert_collection_status(model.status), + vectors_count=model.vectors_count if model.HasField("vectors_count") else None, + points_count=model.points_count, + indexed_vectors_count=model.indexed_vectors_count or 0, + ) + + @classmethod + def convert_optimizer_status(cls, model: grpc.OptimizerStatus) -> rest.OptimizersStatus: + if model.ok: + return rest.OptimizersStatusOneOf.OK + else: + return rest.OptimizersStatusOneOf1(error=model.error) + + @classmethod + def convert_collection_config(cls, model: grpc.CollectionConfig) -> rest.CollectionConfig: + return rest.CollectionConfig( + hnsw_config=cls.convert_hnsw_config(model.hnsw_config), + optimizer_config=cls.convert_optimizer_config(model.optimizer_config), + params=cls.convert_collection_params(model.params), + wal_config=cls.convert_wal_config(model.wal_config), + quantization_config=( + cls.convert_quantization_config(model.quantization_config) + if model.HasField("quantization_config") + else None + ), + strict_mode_config=( + cls.convert_strict_mode_config_output(model.strict_mode_config) + if model.HasField("strict_mode_config") + else None + ), + ) + + @classmethod + def convert_hnsw_config_diff(cls, model: grpc.HnswConfigDiff) -> rest.HnswConfigDiff: + return rest.HnswConfigDiff( + ef_construct=model.ef_construct if model.HasField("ef_construct") else None, + m=model.m if model.HasField("m") else None, + full_scan_threshold=( + model.full_scan_threshold if model.HasField("full_scan_threshold") else None + ), + max_indexing_threads=( + model.max_indexing_threads if model.HasField("max_indexing_threads") else None + ), + on_disk=model.on_disk if model.HasField("on_disk") else None, + payload_m=model.payload_m if model.HasField("payload_m") else None, + ) + + @classmethod + def convert_hnsw_config(cls, model: grpc.HnswConfigDiff) -> rest.HnswConfig: + return rest.HnswConfig( + ef_construct=model.ef_construct if model.HasField("ef_construct") else None, + m=model.m if model.HasField("m") else None, + full_scan_threshold=( + model.full_scan_threshold if model.HasField("full_scan_threshold") else None + ), + max_indexing_threads=( + model.max_indexing_threads if model.HasField("max_indexing_threads") else None + ), + on_disk=model.on_disk if model.HasField("on_disk") else None, + payload_m=model.payload_m if model.HasField("payload_m") else None, + ) + + @classmethod + def convert_max_optimization_threads( + cls, model: grpc.MaxOptimizationThreads + ) -> rest.MaxOptimizationThreads: + name = model.WhichOneof("variant") + if name is None: + raise ValueError(f"invalid MaxOptimizationThreads model: {model}") # pragma: no cover + + if name == "setting": + if model.setting == grpc.MaxOptimizationThreads.Setting.Auto: + return rest.MaxOptimizationThreadsSetting.AUTO + else: + raise ValueError( + f"invalid MaxOptimizationThreads model: {model}" + ) # pragma: no cover + elif name == "value": + return model.value + else: + raise ValueError(f"invalid MaxOptimizationThreads model: {model}") # pragma: no cover + + @classmethod + def convert_optimizer_config(cls, model: grpc.OptimizersConfigDiff) -> rest.OptimizersConfig: + max_optimization_threads = None + if model.HasField("deprecated_max_optimization_threads"): + max_optimization_threads = model.deprecated_max_optimization_threads + elif model.HasField("max_optimization_threads"): + max_optimization_threads = cls.convert_max_optimization_threads( + model.max_optimization_threads + ) + if max_optimization_threads == rest.MaxOptimizationThreadsSetting.AUTO: + max_optimization_threads = None + + return rest.OptimizersConfig( + default_segment_number=( + model.default_segment_number if model.HasField("default_segment_number") else None + ), + deleted_threshold=( + model.deleted_threshold if model.HasField("deleted_threshold") else None + ), + flush_interval_sec=( + model.flush_interval_sec if model.HasField("flush_interval_sec") else None + ), + indexing_threshold=( + model.indexing_threshold if model.HasField("indexing_threshold") else None + ), + max_optimization_threads=max_optimization_threads, + max_segment_size=( + model.max_segment_size if model.HasField("max_segment_size") else None + ), + memmap_threshold=( + model.memmap_threshold if model.HasField("memmap_threshold") else None + ), + vacuum_min_vector_number=( + model.vacuum_min_vector_number + if model.HasField("vacuum_min_vector_number") + else None + ), + ) + + @classmethod + def convert_distance(cls, model: grpc.Distance) -> rest.Distance: + if model == grpc.Distance.Cosine: + return rest.Distance.COSINE + elif model == grpc.Distance.Euclid: + return rest.Distance.EUCLID + elif model == grpc.Distance.Manhattan: + return rest.Distance.MANHATTAN + elif model == grpc.Distance.Dot: + return rest.Distance.DOT + else: + raise ValueError(f"invalid Distance model: {model}") # pragma: no cover + + @classmethod + def convert_wal_config(cls, model: grpc.WalConfigDiff) -> rest.WalConfig: + return rest.WalConfig( + wal_capacity_mb=model.wal_capacity_mb if model.HasField("wal_capacity_mb") else None, + wal_segments_ahead=( + model.wal_segments_ahead if model.HasField("wal_segments_ahead") else None + ), + ) + + @classmethod + def convert_payload_schema( + cls, model: dict[str, grpc.PayloadSchemaInfo] + ) -> dict[str, rest.PayloadIndexInfo]: + return {key: cls.convert_payload_schema_info(info) for key, info in model.items()} + + @classmethod + def convert_payload_schema_info(cls, model: grpc.PayloadSchemaInfo) -> rest.PayloadIndexInfo: + return rest.PayloadIndexInfo( + data_type=cls.convert_payload_schema_type(model.data_type), + params=( + cls.convert_payload_schema_params(model.params) + if model.HasField("params") + else None + ), + points=model.points, + ) + + @classmethod + def convert_payload_schema_params( + cls, model: grpc.PayloadIndexParams + ) -> rest.PayloadSchemaParams: + if model.HasField("text_index_params"): + text_index_params = model.text_index_params + return cls.convert_text_index_params(text_index_params) + if model.HasField("integer_index_params"): + integer_index_params = model.integer_index_params + return cls.convert_integer_index_params(integer_index_params) + if model.HasField("keyword_index_params"): + keyword_index_params = model.keyword_index_params + return cls.convert_keyword_index_params(keyword_index_params) + if model.HasField("float_index_params"): + float_index_params = model.float_index_params + return cls.convert_float_index_params(float_index_params) + if model.HasField("geo_index_params"): + geo_index_params = model.geo_index_params + return cls.convert_geo_index_params(geo_index_params) + if model.HasField("bool_index_params"): + bool_index_params = model.bool_index_params + return cls.convert_bool_index_params(bool_index_params) + if model.HasField("datetime_index_params"): + datetime_index_params = model.datetime_index_params + return cls.convert_datetime_index_params(datetime_index_params) + if model.HasField("uuid_index_params"): + uuid_index_params = model.uuid_index_params + return cls.convert_uuid_index_params(uuid_index_params) + + raise ValueError(f"invalid PayloadIndexParams model: {model}") # pragma: no cover + + @classmethod + def convert_payload_schema_type(cls, model: grpc.PayloadSchemaType) -> rest.PayloadSchemaType: + if model == grpc.PayloadSchemaType.Float: + return rest.PayloadSchemaType.FLOAT + elif model == grpc.PayloadSchemaType.Geo: + return rest.PayloadSchemaType.GEO + elif model == grpc.PayloadSchemaType.Integer: + return rest.PayloadSchemaType.INTEGER + elif model == grpc.PayloadSchemaType.Keyword: + return rest.PayloadSchemaType.KEYWORD + elif model == grpc.PayloadSchemaType.Bool: + return rest.PayloadSchemaType.BOOL + elif model == grpc.PayloadSchemaType.Text: + return rest.PayloadSchemaType.TEXT + elif model == grpc.PayloadSchemaType.Datetime: + return rest.PayloadSchemaType.DATETIME + elif model == grpc.PayloadSchemaType.Uuid: + return rest.PayloadSchemaType.UUID + else: + raise ValueError(f"invalid PayloadSchemaType model: {model}") # pragma: no cover + + @classmethod + def convert_collection_status(cls, model: grpc.CollectionStatus) -> rest.CollectionStatus: + if model == grpc.CollectionStatus.Green: + return rest.CollectionStatus.GREEN + elif model == grpc.CollectionStatus.Yellow: + return rest.CollectionStatus.YELLOW + elif model == grpc.CollectionStatus.Red: + return rest.CollectionStatus.RED + elif model == grpc.CollectionStatus.Grey: + return rest.CollectionStatus.GREY + + raise ValueError(f"invalid CollectionStatus model: {model}") # pragma: no cover + + @classmethod + def convert_update_result(cls, model: grpc.UpdateResult) -> rest.UpdateResult: + return rest.UpdateResult( + operation_id=model.operation_id, + status=cls.convert_update_status(model.status), + ) + + @classmethod + def convert_update_status(cls, model: grpc.UpdateStatus) -> rest.UpdateStatus: + if model == grpc.UpdateStatus.Acknowledged: + return rest.UpdateStatus.ACKNOWLEDGED + elif model == grpc.UpdateStatus.Completed: + return rest.UpdateStatus.COMPLETED + else: + raise ValueError(f"invalid UpdateStatus model: {model}") # pragma: no cover + + @classmethod + def convert_has_id_condition(cls, model: grpc.HasIdCondition) -> rest.HasIdCondition: + return rest.HasIdCondition(has_id=[cls.convert_point_id(idx) for idx in model.has_id]) + + @classmethod + def convert_has_vector_condition( + cls, model: grpc.HasVectorCondition + ) -> rest.HasVectorCondition: + return rest.HasVectorCondition(has_vector=model.has_vector) + + @classmethod + def convert_point_id(cls, model: grpc.PointId) -> rest.ExtendedPointId: + name = model.WhichOneof("point_id_options") + + if name == "num": + return model.num + if name == "uuid": + return model.uuid + raise ValueError(f"invalid PointId model: {model}") # pragma: no cover + + @classmethod + def convert_delete_alias(cls, model: grpc.DeleteAlias) -> rest.DeleteAlias: + return rest.DeleteAlias(alias_name=model.alias_name) + + @classmethod + def convert_rename_alias(cls, model: grpc.RenameAlias) -> rest.RenameAlias: + return rest.RenameAlias( + old_alias_name=model.old_alias_name, new_alias_name=model.new_alias_name + ) + + @classmethod + def convert_is_empty_condition(cls, model: grpc.IsEmptyCondition) -> rest.IsEmptyCondition: + return rest.IsEmptyCondition(is_empty=rest.PayloadField(key=model.key)) + + @classmethod + def convert_is_null_condition(cls, model: grpc.IsNullCondition) -> rest.IsNullCondition: + return rest.IsNullCondition(is_null=rest.PayloadField(key=model.key)) + + @classmethod + def convert_nested_condition(cls, model: grpc.NestedCondition) -> rest.NestedCondition: + return rest.NestedCondition( + nested=rest.Nested( + key=model.key, + filter=cls.convert_filter(model.filter), + ) + ) + + @classmethod + def convert_search_params(cls, model: grpc.SearchParams) -> rest.SearchParams: + return rest.SearchParams( + hnsw_ef=model.hnsw_ef if model.HasField("hnsw_ef") else None, + exact=model.exact if model.HasField("exact") else None, + quantization=( + cls.convert_quantization_search_params(model.quantization) + if model.HasField("quantization") + else None + ), + indexed_only=model.indexed_only if model.HasField("indexed_only") else None, + ) + + @classmethod + def convert_create_alias(cls, model: grpc.CreateAlias) -> rest.CreateAlias: + return rest.CreateAlias(collection_name=model.collection_name, alias_name=model.alias_name) + + @classmethod + def convert_order_value(cls, model: grpc.OrderValue) -> rest.OrderValue: + name = model.WhichOneof("variant") + if name is None: + raise ValueError(f"invalid OrderValue model: {model}") # pragma: no cover + val = getattr(model, name) + + if name == "int": + return val + + if name == "float": + return val + + raise ValueError(f"invalid OrderValue model: {model}") # pragma: no cover + + @classmethod + def convert_scored_point(cls, model: grpc.ScoredPoint) -> rest.ScoredPoint: + return construct( + rest.ScoredPoint, + id=cls.convert_point_id(model.id), + payload=cls.convert_payload(model.payload) if has_field(model, "payload") else None, + score=model.score, + vector=( + cls.convert_vectors_output(model.vectors) if model.HasField("vectors") else None + ), + version=model.version, + shard_key=( + cls.convert_shard_key(model.shard_key) if model.HasField("shard_key") else None + ), + order_value=( + cls.convert_order_value(model.order_value) + if model.HasField("order_value") + else None + ), + ) + + @classmethod + def convert_payload(cls, model: "MessageMapContainer") -> rest.Payload: + return dict((key, value_to_json(model[key])) for key in model) + + @classmethod + def convert_values_count(cls, model: grpc.ValuesCount) -> rest.ValuesCount: + return rest.ValuesCount( + gt=model.gt if model.HasField("gt") else None, + gte=model.gte if model.HasField("gte") else None, + lt=model.lt if model.HasField("lt") else None, + lte=model.lte if model.HasField("lte") else None, + ) + + @classmethod + def convert_geo_bounding_box(cls, model: grpc.GeoBoundingBox) -> rest.GeoBoundingBox: + return rest.GeoBoundingBox( + bottom_right=cls.convert_geo_point(model.bottom_right), + top_left=cls.convert_geo_point(model.top_left), + ) + + @classmethod + def convert_point_struct(cls, model: grpc.PointStruct) -> rest.PointStruct: + return rest.PointStruct( + id=cls.convert_point_id(model.id), + payload=cls.convert_payload(model.payload), + vector=cls.convert_vectors(model.vectors) if model.HasField("vectors") else None, + ) + + @classmethod + def convert_field_condition(cls, model: grpc.FieldCondition) -> rest.FieldCondition: + geo_bounding_box = ( + cls.convert_geo_bounding_box(model.geo_bounding_box) + if model.HasField("geo_bounding_box") + else None + ) + + geo_radius = ( + cls.convert_geo_radius(model.geo_radius) if model.HasField("geo_radius") else None + ) + + geo_polygon = ( + cls.convert_geo_polygon(model.geo_polygon) if model.HasField("geo_polygon") else None + ) + + match = cls.convert_match(model.match) if model.HasField("match") else None + + range_: Optional[rest.RangeInterface] = None + if model.HasField("range"): + range_ = cls.convert_range(model.range) + elif model.HasField("datetime_range"): + range_ = cls.convert_datetime_range(model.datetime_range) + + values_count = ( + cls.convert_values_count(model.values_count) + if model.HasField("values_count") + else None + ) + + is_empty = model.is_empty if model.HasField("is_empty") else None + + is_null = model.is_null if model.HasField("is_null") else None + + return rest.FieldCondition( + key=model.key, + geo_bounding_box=geo_bounding_box, + geo_radius=geo_radius, + geo_polygon=geo_polygon, + match=match, + range=range_, + values_count=values_count, + is_empty=is_empty, + is_null=is_null, + ) + + @classmethod + def convert_match(cls, model: grpc.Match) -> rest.Match: + name = model.WhichOneof("match_value") + if name is None: + raise ValueError(f"invalid Match model: {model}") # pragma: no cover + val = getattr(model, name) + + if name == "integer": + return rest.MatchValue(value=val) + if name == "boolean": + return rest.MatchValue(value=val) + if name == "keyword": + return rest.MatchValue(value=val) + if name == "text": + return rest.MatchText(text=val) + if name == "keywords": + return rest.MatchAny(any=list(val.strings)) + if name == "integers": + return rest.MatchAny(any=list(val.integers)) + if name == "except_keywords": + return rest.MatchExcept(**{"except": list(val.strings)}) + if name == "except_integers": + return rest.MatchExcept(**{"except": list(val.integers)}) + if name == "phrase": + return rest.MatchPhrase(phrase=val) + raise ValueError(f"invalid Match model: {model}") # pragma: no cover + + @classmethod + def convert_wal_config_diff(cls, model: grpc.WalConfigDiff) -> rest.WalConfigDiff: + return rest.WalConfigDiff( + wal_capacity_mb=model.wal_capacity_mb if model.HasField("wal_capacity_mb") else None, + wal_segments_ahead=( + model.wal_segments_ahead if model.HasField("wal_segments_ahead") else None + ), + ) + + @classmethod + def convert_collection_params(cls, model: grpc.CollectionParams) -> rest.CollectionParams: + return rest.CollectionParams( + vectors=( + cls.convert_vectors_config(model.vectors_config) + if model.HasField("vectors_config") + else None + ), + shard_number=model.shard_number, + on_disk_payload=model.on_disk_payload, + replication_factor=( + model.replication_factor if model.HasField("replication_factor") else None + ), + read_fan_out_factor=( + model.read_fan_out_factor if model.HasField("read_fan_out_factor") else None + ), + write_consistency_factor=( + model.write_consistency_factor + if model.HasField("write_consistency_factor") + else None + ), + sparse_vectors=( + cls.convert_sparse_vector_config(model.sparse_vectors_config) + if model.HasField("sparse_vectors_config") + else None + ), + sharding_method=( + cls.convert_sharding_method(model.sharding_method) + if model.HasField("sharding_method") + else None + ), + ) + + @classmethod + def convert_optimizers_config_diff( + cls, model: grpc.OptimizersConfigDiff + ) -> rest.OptimizersConfigDiff: + max_optimization_threads = None + if model.HasField("deprecated_max_optimization_threads"): + max_optimization_threads = model.deprecated_max_optimization_threads + elif model.HasField("max_optimization_threads"): + max_optimization_threads = cls.convert_max_optimization_threads( + model.max_optimization_threads + ) + + return rest.OptimizersConfigDiff( + default_segment_number=( + model.default_segment_number if model.HasField("default_segment_number") else None + ), + deleted_threshold=( + model.deleted_threshold if model.HasField("deleted_threshold") else None + ), + flush_interval_sec=( + model.flush_interval_sec if model.HasField("flush_interval_sec") else None + ), + indexing_threshold=( + model.indexing_threshold if model.HasField("indexing_threshold") else None + ), + max_optimization_threads=max_optimization_threads, + max_segment_size=( + model.max_segment_size if model.HasField("max_segment_size") else None + ), + memmap_threshold=( + model.memmap_threshold if model.HasField("memmap_threshold") else None + ), + vacuum_min_vector_number=( + model.vacuum_min_vector_number + if model.HasField("vacuum_min_vector_number") + else None + ), + ) + + @classmethod + def convert_update_collection(cls, model: grpc.UpdateCollection) -> rest.UpdateCollection: + return rest.UpdateCollection( + vectors=( + cls.convert_vectors_config_diff(model.vectors_config) + if model.HasField("vectors_config") + else None + ), + optimizers_config=( + cls.convert_optimizers_config_diff(model.optimizers_config) + if model.HasField("optimizers_config") + else None + ), + params=( + cls.convert_collection_params_diff(model.params) + if model.HasField("params") + else None + ), + hnsw_config=( + cls.convert_hnsw_config_diff(model.hnsw_config) + if model.HasField("hnsw_config") + else None + ), + quantization_config=( + cls.convert_quantization_config_diff(model.quantization_config) + if model.HasField("quantization_config") + else None + ), + ) + + @classmethod + def convert_geo_point(cls, model: grpc.GeoPoint) -> rest.GeoPoint: + return rest.GeoPoint( + lat=model.lat, + lon=model.lon, + ) + + @classmethod + def convert_alias_operations(cls, model: grpc.AliasOperations) -> rest.AliasOperations: + name = model.WhichOneof("action") + if name is None: + raise ValueError(f"invalid AliasOperations model: {model}") # pragma: no cover + val = getattr(model, name) + + if name == "rename_alias": + return rest.RenameAliasOperation(rename_alias=cls.convert_rename_alias(val)) + if name == "create_alias": + return rest.CreateAliasOperation(create_alias=cls.convert_create_alias(val)) + if name == "delete_alias": + return rest.DeleteAliasOperation(delete_alias=cls.convert_delete_alias(val)) + + raise ValueError(f"invalid AliasOperations model: {model}") # pragma: no cover + + @classmethod + def convert_alias_description(cls, model: grpc.AliasDescription) -> rest.AliasDescription: + return rest.AliasDescription( + alias_name=model.alias_name, + collection_name=model.collection_name, + ) + + @classmethod + def convert_points_selector( + cls, + model: grpc.PointsSelector, + shard_key_selector: Optional[grpc.ShardKeySelector] = None, + ) -> rest.PointsSelector: + name = model.WhichOneof("points_selector_one_of") + if name is None: + raise ValueError(f"invalid PointsSelector model: {model}") # pragma: no cover + val = getattr(model, name) + + if name == "points": + return rest.PointIdsList( + points=[cls.convert_point_id(point) for point in val.ids], + shard_key=shard_key_selector, + ) + if name == "filter": + return rest.FilterSelector( + filter=cls.convert_filter(val), + shard_key=shard_key_selector, + ) + raise ValueError(f"invalid PointsSelector model: {model}") # pragma: no cover + + @classmethod + def convert_with_payload_selector( + cls, model: grpc.WithPayloadSelector + ) -> rest.WithPayloadInterface: + name = model.WhichOneof("selector_options") + if name is None: + raise ValueError(f"invalid WithPayloadSelector model: {model}") # pragma: no cover + val = getattr(model, name) + + if name == "enable": + return val + if name == "include": + return list(val.fields) + if name == "exclude": + return rest.PayloadSelectorExclude(exclude=list(val.fields)) + + raise ValueError(f"invalid WithPayloadSelector model: {model}") # pragma: no cover + + @classmethod + def convert_with_payload_interface( + cls, model: grpc.WithPayloadSelector + ) -> rest.WithPayloadInterface: + return cls.convert_with_payload_selector(model) + + @classmethod + def convert_retrieved_point(cls, model: grpc.RetrievedPoint) -> rest.Record: + return rest.Record( + id=cls.convert_point_id(model.id), + payload=cls.convert_payload(model.payload), + vector=( + cls.convert_vectors_output(model.vectors) if model.HasField("vectors") else None + ), + shard_key=( + cls.convert_shard_key(model.shard_key) if model.HasField("shard_key") else None + ), + order_value=( + cls.convert_order_value(model.order_value) + if model.HasField("order_value") + else None + ), + ) + + @classmethod + def convert_record(cls, model: grpc.RetrievedPoint) -> rest.Record: + return cls.convert_retrieved_point(model) + + @classmethod + def convert_count_result(cls, model: grpc.CountResult) -> rest.CountResult: + return rest.CountResult(count=model.count) + + @classmethod + def convert_snapshot_description( + cls, model: grpc.SnapshotDescription + ) -> rest.SnapshotDescription: + return rest.SnapshotDescription( + name=model.name, + creation_time=( + model.creation_time.ToDatetime().isoformat() + if model.HasField("creation_time") + else None + ), + size=model.size, + ) + + @classmethod + def convert_datatype(cls, model: grpc.Datatype) -> rest.Datatype: + if model == grpc.Datatype.Float32: + return rest.Datatype.FLOAT32 + elif model == grpc.Datatype.Uint8: + return rest.Datatype.UINT8 + elif model == grpc.Datatype.Float16: + return rest.Datatype.FLOAT16 + else: + raise ValueError(f"invalid Datatype model: {model}") # pragma: no cover + + @classmethod + def convert_vector_params(cls, model: grpc.VectorParams) -> rest.VectorParams: + return rest.VectorParams( + size=model.size, + distance=cls.convert_distance(model.distance), + hnsw_config=( + cls.convert_hnsw_config_diff(model.hnsw_config) + if model.HasField("hnsw_config") + else None + ), + quantization_config=( + cls.convert_quantization_config(model.quantization_config) + if model.HasField("quantization_config") + else None + ), + on_disk=model.on_disk if model.HasField("on_disk") else None, + datatype=cls.convert_datatype(model.datatype) if model.HasField("datatype") else None, + multivector_config=( + cls.convert_multivector_config(model.multivector_config) + if model.HasField("multivector_config") + else None + ), + ) + + @classmethod + def convert_multivector_config(cls, model: grpc.MultiVectorConfig) -> rest.MultiVectorConfig: + return rest.MultiVectorConfig( + comparator=cls.convert_multivector_comparator(model.comparator) + ) + + @classmethod + def convert_multivector_comparator( + cls, model: grpc.MultiVectorComparator + ) -> rest.MultiVectorComparator: + if model == grpc.MultiVectorComparator.MaxSim: + return rest.MultiVectorComparator.MAX_SIM + + raise ValueError(f"invalid MultiVectorComparator model: {model}") # pragma: no cover + + @classmethod + def convert_vectors_config(cls, model: grpc.VectorsConfig) -> rest.VectorsConfig: + name = model.WhichOneof("config") + if name is None: + raise ValueError(f"invalid VectorsConfig model: {model}") # pragma: no cover + val = getattr(model, name) + + if name == "params": + return cls.convert_vector_params(val) + if name == "params_map": + return dict( + (key, cls.convert_vector_params(vec_params)) for key, vec_params in val.map.items() + ) + raise ValueError(f"invalid VectorsConfig model: {model}") # pragma: no cover + + @classmethod + def _convert_vector( + cls, model: Union[grpc.Vector, grpc.VectorOutput] + ) -> tuple[ + Optional[str], + Union[ + list[float], + list[list[float]], + rest.SparseVector, + grpc.Document, + grpc.Image, + grpc.InferenceObject, + ], + ]: + """Parse common parts of vector structs + + Args: + model: Vector or VectorOutput + + Returns: + Tuple of name and value, name is None if the struct was parsed and returned with the converted value, + otherwise it's propagated for further processing along with the raw value + """ + name = model.WhichOneof("vector") + if name is None: + if model.HasField("indices"): + return None, rest.SparseVector(indices=model.indices.data[:], values=model.data[:]) + if model.HasField("vectors_count"): + vectors_count = model.vectors_count + vectors = model.data + step = len(vectors) // vectors_count + return None, [vectors[i : i + step] for i in range(0, len(vectors), step)] + + return None, model.data[:] + + val = getattr(model, name) + if name == "dense": + return None, cls.convert_dense_vector(val) + + if name == "sparse": + return None, cls.convert_sparse_vector(val) + + if name == "multi_dense": + return None, cls.convert_multi_dense_vector(val) + + return name, val + + @classmethod + def convert_vector( + cls, model: grpc.Vector + ) -> Union[ + list[float], + list[list[float]], + rest.SparseVector, + rest.Document, + rest.Image, + rest.InferenceObject, + ]: + name, val = cls._convert_vector(model) + + if name is None: + return val + + if name == "document": + return cls.convert_document(val) + + if name == "image": + return cls.convert_image(val) + + if name == "object": + return cls.convert_inference_object(val) + + raise ValueError(f"invalid Vector model: {model}") # pragma: no cover + + @classmethod + def convert_vector_output( + cls, model: grpc.VectorOutput + ) -> Union[list[float], list[list[float]], rest.SparseVector]: + name, val = cls._convert_vector(model) + if name is None: + return val + raise ValueError(f"invalid Vector model: {model}") # pragma: no cover + + @classmethod + def convert_named_vectors(cls, model: grpc.NamedVectors) -> dict[str, rest.Vector]: + vectors = {} + for name, vector in model.vectors.items(): + vectors[name] = cls.convert_vector(vector) + + return vectors + + @classmethod + def convert_named_vectors_output( + cls, model: grpc.NamedVectorsOutput + ) -> dict[str, rest.VectorOutput]: + vectors = {} + for name, vector in model.vectors.items(): + vectors[name] = cls.convert_vector_output(vector) + + return vectors + + @classmethod + def convert_vectors(cls, model: grpc.Vectors) -> rest.VectorStruct: + name = model.WhichOneof("vectors_options") + if name is None: + raise ValueError(f"invalid Vectors model: {model}") # pragma: no cover + val = getattr(model, name) + + if name == "vector": + return cls.convert_vector(val) + if name == "vectors": + return cls.convert_named_vectors(val) + raise ValueError(f"invalid Vectors model: {model}") # pragma: no cover + + @classmethod + def convert_vectors_output(cls, model: grpc.VectorsOutput) -> rest.VectorStructOutput: + name = model.WhichOneof("vectors_options") + if name is None: + raise ValueError(f"invalid VectorsOutput model: {model}") # pragma: no cover + val = getattr(model, name) + + if name == "vector": + return cls.convert_vector_output(val) + if name == "vectors": + return cls.convert_named_vectors_output(val) + raise ValueError(f"invalid VectorsOutput model: {model}") # pragma: no cover + + @classmethod + def convert_dense_vector(cls, model: grpc.DenseVector) -> list[float]: + return model.data[:] + + @classmethod + def convert_sparse_vector(cls, model: grpc.SparseVector) -> rest.SparseVector: + return rest.SparseVector(indices=model.indices[:], values=model.values[:]) + + @classmethod + def convert_multi_dense_vector(cls, model: grpc.MultiDenseVector) -> list[list[float]]: + return [cls.convert_dense_vector(vector) for vector in model.vectors] + + @classmethod + def convert_document(cls, model: grpc.Document) -> rest.Document: + return rest.Document( + text=model.text, + model=model.model, + options=grpc_to_payload(model.options), + ) + + @classmethod + def convert_image(cls, model: grpc.Image) -> rest.Image: + return rest.Image( + image=value_to_json(model.image), + model=model.model, + options=grpc_to_payload(model.options), + ) + + @classmethod + def convert_inference_object(cls, model: grpc.InferenceObject) -> rest.InferenceObject: + return rest.InferenceObject( + object=value_to_json(model.object), + model=model.model, + options=grpc_to_payload(model.options), + ) + + @classmethod + def convert_vector_input(cls, model: grpc.VectorInput) -> rest.VectorInput: + name = model.WhichOneof("variant") + if name is None: + raise ValueError(f"invalid VectorInput model: {model}") # pragma: no cover + val = getattr(model, name) + + if name == "id": + return cls.convert_point_id(val) + if name == "dense": + return cls.convert_dense_vector(val) + if name == "sparse": + return cls.convert_sparse_vector(val) + if name == "multi_dense": + return cls.convert_multi_dense_vector(val) + if name == "document": + return cls.convert_document(val) + if name == "image": + return cls.convert_image(val) + if name == "object": + return cls.convert_inference_object(val) + raise ValueError(f"invalid VectorInput model: {model}") # pragma: no cover + + @classmethod + def convert_recommend_input(cls, model: grpc.RecommendInput) -> rest.RecommendInput: + return rest.RecommendInput( + positive=[cls.convert_vector_input(vector) for vector in model.positive], + negative=[cls.convert_vector_input(vector) for vector in model.negative], + strategy=( + cls.convert_recommend_strategy(model.strategy) + if model.HasField("strategy") + else None + ), + ) + + @classmethod + def convert_context_input_pair(cls, model: grpc.ContextInputPair) -> rest.ContextPair: + return rest.ContextPair( + positive=cls.convert_vector_input(model.positive), + negative=cls.convert_vector_input(model.negative), + ) + + @classmethod + def convert_context_input(cls, model: grpc.ContextInput) -> rest.ContextInput: + return [cls.convert_context_input_pair(pair) for pair in model.pairs] + + @classmethod + def convert_discover_input(cls, model: grpc.DiscoverInput) -> rest.DiscoverInput: + return rest.DiscoverInput( + target=cls.convert_vector_input(model.target), + context=cls.convert_context_input(model.context), + ) + + @classmethod + def convert_fusion(cls, model: grpc.Fusion) -> rest.Fusion: + if model == grpc.Fusion.RRF: + return rest.Fusion.RRF + + if model == grpc.Fusion.DBSF: + return rest.Fusion.DBSF + + raise ValueError(f"invalid Fusion model: {model}") # pragma: no cover + + @classmethod + def convert_sample(cls, model: grpc.Sample) -> rest.Sample: + if model == grpc.Sample.Random: + return rest.Sample.RANDOM + + raise ValueError(f"invalid Sample model: {model}") # pragma: no cover + + @classmethod + def convert_formula_query(cls, model: grpc.Formula) -> rest.FormulaQuery: + defaults = grpc_to_payload(model.defaults) + return rest.FormulaQuery( + formula=cls.convert_expression(model.expression), defaults=defaults + ) + + @classmethod + def convert_expression(cls, model: grpc.Expression) -> rest.Expression: + name = model.WhichOneof("variant") + if name is None: + raise ValueError(f"invalid Query model: {model}") # pragma: no cover + + if name == "constant": + return model.constant + if name == "variable": + return model.variable + if name == "condition": + return cls.convert_condition(model.condition) + if name == "datetime": + return rest.DatetimeExpression(datetime=model.datetime) + if name == "datetime_key": + return rest.DatetimeKeyExpression(datetime_key=model.datetime_key) + if name == "sum": + return cls.convert_sum_expression(model.sum) + if name == "mult": + return cls.convert_mult_expression(model.mult) + if name == "div": + return cls.convert_div_expression(model.div) + if name == "abs": + return rest.AbsExpression(abs=cls.convert_expression(model.abs)) + if name == "neg": + return rest.NegExpression(neg=cls.convert_expression(model.neg)) + if name == "log10": + return rest.Log10Expression(log10=cls.convert_expression(model.log10)) + if name == "ln": + return rest.LnExpression(ln=cls.convert_expression(model.ln)) + if name == "sqrt": + return rest.SqrtExpression(sqrt=cls.convert_expression(model.sqrt)) + if name == "exp": + return rest.ExpExpression(exp=cls.convert_expression(model.exp)) + if name == "pow": + return cls.convert_pow_expression(model.pow) + if name == "geo_distance": + return cls.convert_geo_distance(model.geo_distance) + if name == "lin_decay": + return rest.LinDecayExpression( + lin_decay=cls.convert_decay_params_expression(model.lin_decay) + ) + if name == "exp_decay": + return rest.ExpDecayExpression( + exp_decay=cls.convert_decay_params_expression(model.exp_decay) + ) + if name == "gauss_decay": + return rest.GaussDecayExpression( + gauss_decay=cls.convert_decay_params_expression(model.gauss_decay) + ) + + raise ValueError(f"Unknown function name: {name}") + + @classmethod + def convert_sum_expression(cls, model: grpc.SumExpression) -> rest.SumExpression: + return rest.SumExpression(sum=[cls.convert_expression(expr) for expr in model.sum]) + + @classmethod + def convert_mult_expression(cls, model: grpc.MultExpression) -> rest.MultExpression: + return rest.MultExpression(mult=[cls.convert_expression(expr) for expr in model.mult]) + + @classmethod + def convert_div_expression(cls, model: grpc.DivExpression) -> rest.DivExpression: + left = cls.convert_expression(model.left) + right = cls.convert_expression(model.right) + by_zero_default = model.by_zero_default if model.HasField("by_zero_default") else None + params = rest.DivParams(left=left, right=right, by_zero_default=by_zero_default) + return rest.DivExpression(div=params) + + @classmethod + def convert_pow_expression(cls, model: grpc.PowExpression) -> rest.PowExpression: + base = cls.convert_expression(model.base) + exponent = cls.convert_expression(model.exponent) + params = rest.PowParams(base=base, exponent=exponent) + return rest.PowExpression(pow=params) + + @classmethod + def convert_geo_distance(cls, model: grpc.GeoDistance) -> rest.GeoDistance: + origin = cls.convert_geo_point(model.origin) + params = rest.GeoDistanceParams(origin=origin, to=model.to) + return rest.GeoDistance(geo_distance=params) + + @classmethod + def convert_decay_params_expression( + cls, model: grpc.DecayParamsExpression + ) -> rest.DecayParamsExpression: + return rest.DecayParamsExpression( + x=cls.convert_expression(model.x), + target=cls.convert_expression(model.target) if model.HasField("target") else None, + midpoint=model.midpoint if model.HasField("midpoint") else None, + scale=model.scale if model.HasField("scale") else None, + ) + + @classmethod + def convert_mmr(cls, model: grpc.Mmr) -> rest.Mmr: + return rest.Mmr( + diversity=model.diversity if model.HasField("diversity") else None, + candidates_limit=model.candidates_limit + if model.HasField("candidates_limit") + else None, + ) + + @classmethod + def convert_query(cls, model: grpc.Query) -> rest.Query: + name = model.WhichOneof("variant") + if name is None: + raise ValueError(f"invalid Query model: {model}") # pragma: no cover + val = getattr(model, name) + + if name == "nearest": + return rest.NearestQuery(nearest=cls.convert_vector_input(val)) + + if name == "recommend": + return rest.RecommendQuery(recommend=cls.convert_recommend_input(val)) + + if name == "discover": + return rest.DiscoverQuery(discover=cls.convert_discover_input(val)) + + if name == "context": + return rest.ContextQuery(context=cls.convert_context_input(val)) + + if name == "order_by": + return rest.OrderByQuery(order_by=cls.convert_order_by(val)) + + if name == "fusion": + return rest.FusionQuery(fusion=cls.convert_fusion(val)) + + if name == "sample": + return rest.SampleQuery(sample=cls.convert_sample(val)) + + if name == "formula": + return cls.convert_formula_query(val) + + if name == "nearest_with_mmr": + val = model.nearest_with_mmr + return rest.NearestQuery( + nearest=cls.convert_vector_input(val.nearest), mmr=cls.convert_mmr(val.mmr) + ) + + raise ValueError(f"invalid Query model: {model}") # pragma: no cover + + @classmethod + def convert_prefetch_query(cls, model: grpc.PrefetchQuery) -> rest.Prefetch: + return rest.Prefetch( + prefetch=( + [cls.convert_prefetch_query(prefetch) for prefetch in model.prefetch] + if len(model.prefetch) != 0 + else None + ), + query=cls.convert_query(model.query) if model.HasField("query") else None, + using=model.using if model.HasField("using") else None, + filter=cls.convert_filter(model.filter) if model.HasField("filter") else None, + params=cls.convert_search_params(model.params) if model.HasField("params") else None, + score_threshold=model.score_threshold if model.HasField("score_threshold") else None, + limit=model.limit if model.HasField("limit") else None, + lookup_from=( + cls.convert_lookup_location(model.lookup_from) + if model.HasField("lookup_from") + else None + ), + ) + + @classmethod + def convert_vectors_selector(cls, model: grpc.VectorsSelector) -> list[str]: + return model.names[:] + + @classmethod + def convert_with_vectors_selector(cls, model: grpc.WithVectorsSelector) -> rest.WithVector: + name = model.WhichOneof("selector_options") + if name is None: + raise ValueError(f"invalid WithVectorsSelector model: {model}") # pragma: no cover + val = getattr(model, name) + + if name == "enable": + return val + if name == "include": + return cls.convert_vectors_selector(val) + raise ValueError(f"invalid WithVectorsSelector model: {model}") # pragma: no cover + + @classmethod + def convert_search_points(cls, model: grpc.SearchPoints) -> rest.SearchRequest: + vector = ( + rest.NamedVector(name=model.vector_name, vector=model.vector[:]) + if not model.HasField("sparse_indices") + else ( + rest.NamedSparseVector( + name=model.vector_name, + vector=rest.SparseVector( + indices=model.sparse_indices.data[:], values=model.vector[:] + ), + ) + ) + ) + return rest.SearchRequest( + vector=vector, + filter=cls.convert_filter(model.filter) if model.HasField("filter") else None, + limit=model.limit, + with_payload=( + cls.convert_with_payload_interface(model.with_payload) + if model.HasField("with_payload") + else None + ), + params=cls.convert_search_params(model.params) if model.HasField("params") else None, + score_threshold=model.score_threshold if model.HasField("score_threshold") else None, + offset=model.offset if model.HasField("offset") else None, + with_vector=( + cls.convert_with_vectors_selector(model.with_vectors) + if model.HasField("with_vectors") + else None + ), + shard_key=( + cls.convert_shard_key_selector(model.shard_key_selector) + if model.HasField("shard_key_selector") + else None + ), + ) + + @classmethod + def convert_query_points(cls, model: grpc.QueryPoints) -> rest.QueryRequest: + return rest.QueryRequest( + shard_key=( + cls.convert_shard_key_selector(model.shard_key_selector) + if model.HasField("shard_key_selector") + else None + ), + prefetch=( + [cls.convert_prefetch_query(prefetch) for prefetch in model.prefetch] + if len(model.prefetch) != 0 + else None + ), + query=cls.convert_query(model.query) if model.HasField("query") else None, + using=model.using if model.HasField("using") else None, + filter=cls.convert_filter(model.filter) if model.HasField("filter") else None, + params=cls.convert_search_params(model.params) if model.HasField("params") else None, + score_threshold=model.score_threshold if model.HasField("score_threshold") else None, + limit=model.limit if model.HasField("limit") else None, + offset=model.offset if model.HasField("offset") else None, + with_vector=( + cls.convert_with_vectors_selector(model.with_vectors) + if model.HasField("with_vectors") + else None + ), + with_payload=( + cls.convert_with_payload_interface(model.with_payload) + if model.HasField("with_payload") + else None + ), + lookup_from=( + cls.convert_lookup_location(model.lookup_from) + if model.HasField("lookup_from") + else None + ), + ) + + @classmethod + def convert_recommend_points(cls, model: grpc.RecommendPoints) -> rest.RecommendRequest: + positive_ids = [cls.convert_point_id(point_id) for point_id in model.positive] + negative_ids = [cls.convert_point_id(point_id) for point_id in model.negative] + + positive_vectors = [cls.convert_vector(vector) for vector in model.positive_vectors] + negative_vectors = [cls.convert_vector(vector) for vector in model.negative_vectors] + + return rest.RecommendRequest( + positive=positive_ids + positive_vectors, + negative=negative_ids + negative_vectors, + filter=cls.convert_filter(model.filter) if model.HasField("filter") else None, + limit=model.limit, + with_payload=( + cls.convert_with_payload_interface(model.with_payload) + if model.HasField("with_payload") + else None + ), + params=cls.convert_search_params(model.params) if model.HasField("params") else None, + score_threshold=model.score_threshold if model.HasField("score_threshold") else None, + offset=model.offset if model.HasField("offset") else None, + with_vector=( + cls.convert_with_vectors_selector(model.with_vectors) + if model.HasField("with_vectors") + else None + ), + using=model.using, + lookup_from=( + cls.convert_lookup_location(model.lookup_from) + if model.HasField("lookup_from") + else None + ), + strategy=( + cls.convert_recommend_strategy(model.strategy) + if model.HasField("strategy") + else None + ), + shard_key=( + cls.convert_shard_key_selector(model.shard_key_selector) + if model.HasField("shard_key_selector") + else None + ), + ) + + @classmethod + def convert_discover_points(cls, model: grpc.DiscoverPoints) -> rest.DiscoverRequest: + target = cls.convert_target_vector(model.target) if model.HasField("target") else None + context = [cls.convert_context_example_pair(pair) for pair in model.context] + return rest.DiscoverRequest( + target=target, + context=context, + filter=cls.convert_filter(model.filter) if model.HasField("filter") else None, + limit=model.limit, + with_payload=( + cls.convert_with_payload_interface(model.with_payload) + if model.HasField("with_payload") + else None + ), + params=cls.convert_search_params(model.params) if model.HasField("params") else None, + offset=model.offset if model.HasField("offset") else None, + with_vector=( + cls.convert_with_vectors_selector(model.with_vectors) + if model.HasField("with_vectors") + else None + ), + using=model.using, + lookup_from=( + cls.convert_lookup_location(model.lookup_from) + if model.HasField("lookup_from") + else None + ), + shard_key=( + cls.convert_shard_key_selector(model.shard_key_selector) + if model.HasField("shard_key_selector") + else None + ), + ) + + @classmethod + def convert_vector_example(cls, model: grpc.VectorExample) -> rest.RecommendExample: + if model.HasField("vector"): + return cls.convert_vector(model.vector) + if model.HasField("id"): + return cls.convert_point_id(model.id) + + raise ValueError(f"invalid VectorExample model: {model}") # pragma: no cover + + @classmethod + def convert_target_vector(cls, model: grpc.TargetVector) -> rest.RecommendExample: + if model.HasField("single"): + return cls.convert_vector_example(model.single) + + raise ValueError(f"invalid TargetVector model: {model}") # pragma: no cover + + @classmethod + def convert_context_example_pair( + cls, model: grpc.ContextExamplePair + ) -> rest.ContextExamplePair: + return rest.ContextExamplePair( + positive=cls.convert_vector_example(model.positive), + negative=cls.convert_vector_example(model.negative), + ) + + @classmethod + def convert_tokenizer_type(cls, model: grpc.TokenizerType) -> rest.TokenizerType: + if model == grpc.Unknown: + return None + + if model == grpc.Prefix: + return rest.TokenizerType.PREFIX + if model == grpc.Whitespace: + return rest.TokenizerType.WHITESPACE + if model == grpc.Word: + return rest.TokenizerType.WORD + if model == grpc.Multilingual: + return rest.TokenizerType.MULTILINGUAL + raise ValueError(f"invalid TokenizerType model: {model}") # pragma: no cover + + @classmethod + def convert_text_index_params(cls, model: grpc.TextIndexParams) -> rest.TextIndexParams: + return rest.TextIndexParams( + type="text", + tokenizer=cls.convert_tokenizer_type(model.tokenizer), + min_token_len=model.min_token_len if model.HasField("min_token_len") else None, + max_token_len=model.max_token_len if model.HasField("max_token_len") else None, + lowercase=model.lowercase if model.HasField("lowercase") else None, + phrase_matching=model.phrase_matching if model.HasField("phrase_matching") else None, + stopwords=cls.convert_stopwords(model.stopwords) + if model.HasField("stopwords") + else None, + on_disk=model.on_disk if model.HasField("on_disk") else None, + stemmer=cls.convert_stemmer(model.stemmer) if model.HasField("stemmer") else None, + ) + + @classmethod + def convert_stopwords(cls, model: grpc.StopwordsSet) -> rest.StopwordsInterface: + languages = model.languages[:] + custom = model.custom[:] + + if len(languages) == 1 and not custom: + return rest.Language(languages[0]) + return rest.StopwordsSet(languages=languages, custom=custom) + + @classmethod + def convert_stemmer(cls, model: grpc.StemmingAlgorithm) -> rest.StemmingAlgorithm: + name = model.WhichOneof("stemming_params") + if name is None: + raise ValueError(f"invalid StemmingAlgorithm model: {model}") # pragma: no cover + val = getattr(model, name) + + if name == "snowball": + return cls.convert_snowball_parameters(val) + raise ValueError(f"invalid StemmingAlgorithm model: {model}") # pragma: no cover + + @classmethod + def convert_snowball_parameters(cls, model: grpc.SnowballParams) -> rest.SnowballParams: + return rest.SnowballParams( + type=rest.Snowball.SNOWBALL, language=rest.SnowballLanguage(model.language) + ) + + @classmethod + def convert_integer_index_params( + cls, model: grpc.IntegerIndexParams + ) -> rest.IntegerIndexParams: + return rest.IntegerIndexParams( + type=rest.IntegerIndexType.INTEGER, + range=model.range, + lookup=model.lookup, + is_principal=model.is_principal if model.HasField("is_principal") else None, + on_disk=model.on_disk if model.HasField("on_disk") else None, + ) + + @classmethod + def convert_keyword_index_params( + cls, model: grpc.KeywordIndexParams + ) -> rest.KeywordIndexParams: + return rest.KeywordIndexParams( + type=rest.KeywordIndexType.KEYWORD, + is_tenant=model.is_tenant if model.HasField("is_tenant") else None, + on_disk=model.on_disk if model.HasField("on_disk") else None, + ) + + @classmethod + def convert_float_index_params(cls, model: grpc.FloatIndexParams) -> rest.FloatIndexParams: + return rest.FloatIndexParams( + type=rest.FloatIndexType.FLOAT, + is_principal=model.is_principal if model.HasField("is_principal") else None, + on_disk=model.on_disk if model.HasField("on_disk") else None, + ) + + @classmethod + def convert_geo_index_params(cls, model: grpc.GeoIndexParams) -> rest.GeoIndexParams: + return rest.GeoIndexParams( + type=rest.GeoIndexType.GEO, + on_disk=model.on_disk if model.HasField("on_disk") else None, + ) + + @classmethod + def convert_bool_index_params(cls, model: grpc.BoolIndexParams) -> rest.BoolIndexParams: + return rest.BoolIndexParams( + type=rest.BoolIndexType.BOOL, + on_disk=model.on_disk if model.HasField("on_disk") else None, + ) + + @classmethod + def convert_datetime_index_params( + cls, model: grpc.DatetimeIndexParams + ) -> rest.DatetimeIndexParams: + return rest.DatetimeIndexParams( + type=rest.DatetimeIndexType.DATETIME, + is_principal=model.is_principal if model.HasField("is_principal") else None, + on_disk=model.on_disk if model.HasField("on_disk") else None, + ) + + @classmethod + def convert_uuid_index_params(cls, model: grpc.UuidIndexParams) -> rest.UuidIndexParams: + return rest.UuidIndexParams( + type=rest.UuidIndexType.UUID, + is_tenant=model.is_tenant if model.HasField("is_tenant") else None, + on_disk=model.on_disk if model.HasField("on_disk") else None, + ) + + @classmethod + def convert_collection_params_diff( + cls, model: grpc.CollectionParamsDiff + ) -> rest.CollectionParamsDiff: + return rest.CollectionParamsDiff( + replication_factor=( + model.replication_factor if model.HasField("replication_factor") else None + ), + write_consistency_factor=( + model.write_consistency_factor + if model.HasField("write_consistency_factor") + else None + ), + read_fan_out_factor=( + model.read_fan_out_factor if model.HasField("read_fan_out_factor") else None + ), + on_disk_payload=model.on_disk_payload if model.HasField("on_disk_payload") else None, + ) + + @classmethod + def convert_lookup_location(cls, model: grpc.LookupLocation) -> rest.LookupLocation: + return rest.LookupLocation( + collection=model.collection_name, + vector=model.vector_name if model.HasField("vector_name") else None, + ) + + @classmethod + def convert_write_ordering(cls, model: grpc.WriteOrdering) -> rest.WriteOrdering: + if model.type == grpc.WriteOrderingType.Weak: + return rest.WriteOrdering.WEAK + if model.type == grpc.WriteOrderingType.Medium: + return rest.WriteOrdering.MEDIUM + if model.type == grpc.WriteOrderingType.Strong: + return rest.WriteOrdering.STRONG + raise ValueError(f"invalid WriteOrdering model: {model}") # pragma: no cover + + @classmethod + def convert_read_consistency(cls, model: grpc.ReadConsistency) -> rest.ReadConsistency: + name = model.WhichOneof("value") + if name is None: + raise ValueError(f"invalid ReadConsistency model: {model}") # pragma: no cover + val = getattr(model, name) + if name == "factor": + return val + if name == "type": + return cls.convert_read_consistency_type(val) + raise ValueError(f"invalid ReadConsistency model: {model}") # pragma: no cover + + @classmethod + def convert_read_consistency_type( + cls, model: grpc.ReadConsistencyType + ) -> rest.ReadConsistencyType: + if model == grpc.All: + return rest.ReadConsistencyType.ALL + if model == grpc.Majority: + return rest.ReadConsistencyType.MAJORITY + if model == grpc.Quorum: + return rest.ReadConsistencyType.QUORUM + raise ValueError(f"invalid ReadConsistencyType model: {model}") # pragma: no cover + + @classmethod + def convert_scalar_quantization_config( + cls, model: grpc.ScalarQuantization + ) -> rest.ScalarQuantizationConfig: + return rest.ScalarQuantizationConfig( + type=rest.ScalarType.INT8, + quantile=model.quantile if model.HasField("quantile") else None, + always_ram=model.always_ram if model.HasField("always_ram") else None, + ) + + @classmethod + def convert_product_quantization_config( + cls, model: grpc.ProductQuantization + ) -> rest.ProductQuantizationConfig: + return rest.ProductQuantizationConfig( + compression=cls.convert_compression_ratio(model.compression), + always_ram=model.always_ram if model.HasField("always_ram") else None, + ) + + @classmethod + def convert_binary_quantization_config( + cls, model: grpc.BinaryQuantization + ) -> rest.BinaryQuantizationConfig: + return rest.BinaryQuantizationConfig( + always_ram=model.always_ram if model.HasField("always_ram") else None, + encoding=cls.convert_binary_quantization_encoding(model.encoding) + if model.HasField("encoding") + else None, + query_encoding=cls.convert_binary_quantization_query_encoding(model.query_encoding) + if model.HasField("query_encoding") + else None, + ) + + @classmethod + def convert_binary_quantization_encoding( + cls, model: grpc.BinaryQuantizationEncoding + ) -> rest.BinaryQuantizationEncoding: + if model == grpc.BinaryQuantizationEncoding.OneBit: + return rest.BinaryQuantizationEncoding.ONE_BIT + + if model == grpc.BinaryQuantizationEncoding.TwoBits: + return rest.BinaryQuantizationEncoding.TWO_BITS + + if model == grpc.BinaryQuantizationEncoding.OneAndHalfBits: + return rest.BinaryQuantizationEncoding.ONE_AND_HALF_BITS + + raise ValueError(f"invalid BinaryQuantizationEncoding model: {model}") # pragma: no cover + + @classmethod + def convert_binary_quantization_query_encoding( + cls, model: grpc.BinaryQuantizationQueryEncoding + ) -> rest.BinaryQuantizationQueryEncoding: + name = model.WhichOneof("variant") + if name is None: + raise ValueError(f"invalid BinaryQuantizationQueryEncoding model: {model}") + + val = getattr(model, name) + if name == "setting": + if val == grpc.BinaryQuantizationQueryEncoding.Setting.Default: + return rest.BinaryQuantizationQueryEncoding.DEFAULT + if val == grpc.BinaryQuantizationQueryEncoding.Setting.Binary: + return rest.BinaryQuantizationQueryEncoding.BINARY + if val == grpc.BinaryQuantizationQueryEncoding.Setting.Scalar4Bits: + return rest.BinaryQuantizationQueryEncoding.SCALAR4BITS + if val == grpc.BinaryQuantizationQueryEncoding.Setting.Scalar8Bits: + return rest.BinaryQuantizationQueryEncoding.SCALAR8BITS + raise ValueError( + f"invalid BinaryQuantizationQueryEncoding setting: {val}" + ) # pragma: no cover + raise ValueError( + f"invalid BinaryQuantizationQueryEncoding model: {model}" + ) # pragma: no cover + + @classmethod + def convert_compression_ratio(cls, model: grpc.CompressionRatio) -> rest.CompressionRatio: + if model == grpc.x4: + return rest.CompressionRatio.X4 + if model == grpc.x8: + return rest.CompressionRatio.X8 + if model == grpc.x16: + return rest.CompressionRatio.X16 + if model == grpc.x32: + return rest.CompressionRatio.X32 + if model == grpc.x64: + return rest.CompressionRatio.X64 + raise ValueError(f"invalid CompressionRatio model: {model}") # pragma: no cover + + @classmethod + def convert_quantization_config( + cls, model: grpc.QuantizationConfig + ) -> rest.QuantizationConfig: + name = model.WhichOneof("quantization") + if name is None: + raise ValueError(f"invalid QuantizationConfig model: {model}") # pragma: no cover + val = getattr(model, name) + if name == "scalar": + return rest.ScalarQuantization(scalar=cls.convert_scalar_quantization_config(val)) + if name == "product": + return rest.ProductQuantization(product=cls.convert_product_quantization_config(val)) + if name == "binary": + return rest.BinaryQuantization(binary=cls.convert_binary_quantization_config(val)) + raise ValueError(f"invalid QuantizationConfig model: {model}") # pragma: no cover + + @classmethod + def convert_quantization_search_params( + cls, model: grpc.QuantizationSearchParams + ) -> rest.QuantizationSearchParams: + return rest.QuantizationSearchParams( + ignore=model.ignore if model.HasField("ignore") else None, + rescore=model.rescore if model.HasField("rescore") else None, + oversampling=model.oversampling if model.HasField("oversampling") else None, + ) + + @classmethod + def convert_point_vectors(cls, model: grpc.PointVectors) -> rest.PointVectors: + return rest.PointVectors( + id=cls.convert_point_id(model.id), + vector=cls.convert_vectors(model.vectors), + ) + + @classmethod + def convert_groups_result(cls, model: grpc.GroupsResult) -> rest.GroupsResult: + return rest.GroupsResult( + groups=[cls.convert_point_group(group) for group in model.groups], + ) + + @classmethod + def convert_point_group(cls, model: grpc.PointGroup) -> rest.PointGroup: + return rest.PointGroup( + id=cls.convert_group_id(model.id), + hits=[cls.convert_scored_point(hit) for hit in model.hits], + lookup=cls.convert_record(model.lookup) if model.HasField("lookup") else None, + ) + + @classmethod + def convert_group_id(cls, model: grpc.GroupId) -> rest.GroupId: + name = model.WhichOneof("kind") + if name is None: + raise ValueError(f"invalid GroupId model: {model}") # pragma: no cover + val = getattr(model, name) + return val + + @classmethod + def convert_with_lookup(cls, model: grpc.WithLookup) -> rest.WithLookup: + return rest.WithLookup( + collection=model.collection, + with_payload=( + cls.convert_with_payload_selector(model.with_payload) + if model.HasField("with_payload") + else None + ), + with_vectors=( + cls.convert_with_vectors_selector(model.with_vectors) + if model.HasField("with_vectors") + else None + ), + ) + + @classmethod + def convert_quantization_config_diff( + cls, model: grpc.QuantizationConfigDiff + ) -> rest.QuantizationConfigDiff: + name = model.WhichOneof("quantization") + if name is None: + raise ValueError(f"invalid QuantizationConfigDiff model: {model}") # pragma: no cover + val = getattr(model, name) + if name == "scalar": + return rest.ScalarQuantization(scalar=cls.convert_scalar_quantization_config(val)) + if name == "product": + return rest.ProductQuantization(product=cls.convert_product_quantization_config(val)) + if name == "binary": + return rest.BinaryQuantization(binary=cls.convert_binary_quantization_config(val)) + if name == "disabled": + return rest.Disabled.DISABLED + raise ValueError(f"invalid QuantizationConfigDiff model: {model}") # pragma: no cover + + @classmethod + def convert_vector_params_diff(cls, model: grpc.VectorParamsDiff) -> rest.VectorParamsDiff: + return rest.VectorParamsDiff( + hnsw_config=( + cls.convert_hnsw_config_diff(model.hnsw_config) + if model.HasField("hnsw_config") + else None + ), + quantization_config=( + cls.convert_quantization_config_diff(model.quantization_config) + if model.HasField("quantization_config") + else None + ), + on_disk=model.on_disk if model.HasField("on_disk") else None, + ) + + @classmethod + def convert_vectors_config_diff(cls, model: grpc.VectorsConfigDiff) -> rest.VectorsConfigDiff: + name = model.WhichOneof("config") + if name is None: + raise ValueError(f"invalid VectorsConfigDiff model: {model}") # pragma: no cover + val = getattr(model, name) + + if name == "params": + return {"": cls.convert_vector_params_diff(val)} + if name == "params_map": + return dict( + (key, cls.convert_vector_params_diff(vec_params)) + for key, vec_params in val.map.items() + ) + raise ValueError(f"invalid VectorsConfigDiff model: {model}") # pragma: no cover + + @classmethod + def convert_points_update_operation( + cls, model: grpc.PointsUpdateOperation + ) -> rest.UpdateOperation: + name = model.WhichOneof("operation") + if name is None: + raise ValueError(f"invalid PointsUpdateOperation model: {model}") # pragma: no cover + val = getattr(model, name) + + if name == "upsert": + shard_key_selector = ( + cls.convert_shard_key(val.shard_key_selector) + if val.HasField("shard_key_selector") + else None + ) + return rest.UpsertOperation( + upsert=rest.PointsList( + points=[cls.convert_point_struct(point) for point in val.points], + shard_key=shard_key_selector, + ) + ) + elif name == "delete_points": + shard_key_selector = ( + val.shard_key_selector if val.HasField("shard_key_selector") else None + ) + points_selector = cls.convert_points_selector( + val.points, shard_key_selector=shard_key_selector + ) + return rest.DeleteOperation(delete=points_selector) + elif name == "set_payload": + shard_key_selector = ( + val.shard_key_selector if val.HasField("shard_key_selector") else None + ) + points_selector = cls.convert_points_selector( + val.points_selector, shard_key_selector=shard_key_selector + ) + points = None + filter_ = None + if isinstance(points_selector, rest.PointIdsList): + points = points_selector.points + elif isinstance(points_selector, rest.FilterSelector): + filter_ = points_selector.filter + else: + raise ValueError( + f"invalid PointsSelector model: {points_selector}" + ) # pragma: no cover + + return rest.SetPayloadOperation( + set_payload=rest.SetPayload( + payload=cls.convert_payload(val.payload), + points=points, + filter=filter_, + key=val.key if val.HasField("key") else None, + ) + ) + elif name == "overwrite_payload": + shard_key_selector = ( + val.shard_key_selector if val.HasField("shard_key_selector") else None + ) + points_selector = cls.convert_points_selector( + val.points_selector, shard_key_selector=shard_key_selector + ) + points = None + filter_ = None + if isinstance(points_selector, rest.PointIdsList): + points = points_selector.points + elif isinstance(points_selector, rest.FilterSelector): + filter_ = points_selector.filter + else: + raise ValueError( + f"invalid PointsSelector model: {points_selector}" + ) # pragma: no cover + + return rest.OverwritePayloadOperation( + overwrite_payload=rest.SetPayload( + payload=cls.convert_payload(val.payload), + points=points, + filter=filter_, + key=val.key if val.HasField("key") else None, + ) + ) + elif name == "delete_payload": + shard_key_selector = ( + val.shard_key_selector if val.HasField("shard_key_selector") else None + ) + points_selector = cls.convert_points_selector( + val.points_selector, shard_key_selector=shard_key_selector + ) + points = None + filter_ = None + if isinstance(points_selector, rest.PointIdsList): + points = points_selector.points + elif isinstance(points_selector, rest.FilterSelector): + filter_ = points_selector.filter + else: + raise ValueError( + f"invalid PointsSelector model: {points_selector}" + ) # pragma: no cover + + return rest.DeletePayloadOperation( + delete_payload=rest.DeletePayload( + keys=[key for key in val.keys], + points=points, + filter=filter_, + ) + ) + elif name == "clear_payload": + shard_key_selector = ( + val.shard_key_selector if val.HasField("shard_key_selector") else None + ) + points_selector = cls.convert_points_selector( + val.points, shard_key_selector=shard_key_selector + ) + return rest.ClearPayloadOperation(clear_payload=points_selector) + elif name == "update_vectors": + shard_key_selector = ( + cls.convert_shard_key(val.shard_key_selector) + if val.HasField("shard_key_selector") + else None + ) + return rest.UpdateVectorsOperation( + update_vectors=rest.UpdateVectors( + points=[cls.convert_point_vectors(point) for point in val.points], + shard_key=shard_key_selector, + ) + ) + elif name == "delete_vectors": + shard_key_selector = ( + val.shard_key_selector if val.HasField("shard_key_selector") else None + ) + points_selector = cls.convert_points_selector( + val.points_selector, shard_key_selector=shard_key_selector + ) + points = None + filter_ = None + if isinstance(points_selector, rest.PointIdsList): + points = points_selector.points + elif isinstance(points_selector, rest.FilterSelector): + filter_ = points_selector.filter + else: + raise ValueError( + f"invalid PointsSelector model: {points_selector}" + ) # pragma: no cover + + return rest.DeleteVectorsOperation( + delete_vectors=rest.DeleteVectors( + vector=[name for name in val.vectors.names], + points=points, + filter=filter_, + ) + ) + else: + raise ValueError(f"invalid UpdateOperation model: {model}") # pragma: no cover + + @classmethod + def convert_init_from(cls, model: str) -> rest.InitFrom: + if isinstance(model, str): + return rest.InitFrom(collection=model) + raise ValueError(f"Invalid InitFrom model: {model}") # pragma: no cover + + @classmethod + def convert_recommend_strategy(cls, model: grpc.RecommendStrategy) -> rest.RecommendStrategy: + if model == grpc.RecommendStrategy.AverageVector: + return rest.RecommendStrategy.AVERAGE_VECTOR + if model == grpc.RecommendStrategy.BestScore: + return rest.RecommendStrategy.BEST_SCORE + if model == grpc.RecommendStrategy.SumScores: + return rest.RecommendStrategy.SUM_SCORES + raise ValueError(f"invalid RecommendStrategy model: {model}") # pragma: no cover + + @classmethod + def convert_sparse_index_config(cls, model: grpc.SparseIndexConfig) -> rest.SparseIndexParams: + return rest.SparseIndexParams( + full_scan_threshold=( + model.full_scan_threshold if model.HasField("full_scan_threshold") else None + ), + on_disk=model.on_disk if model.HasField("on_disk") else None, + datatype=cls.convert_datatype(model.datatype) if model.HasField("datatype") else None, + ) + + @classmethod + def convert_modifier(cls, model: grpc.Modifier) -> rest.Modifier: + if model == grpc.Modifier.Idf: + return rest.Modifier.IDF + if model == getattr(grpc.Modifier, "None"): + return rest.Modifier.NONE + raise ValueError(f"invalid Modifier model: {model}") # pragma: no cover + + @classmethod + def convert_sparse_vector_params( + cls, model: grpc.SparseVectorParams + ) -> rest.SparseVectorParams: + return rest.SparseVectorParams( + index=( + cls.convert_sparse_index_config(model.index) + if model.HasField("index") is not None + else None + ), + modifier=( + cls.convert_modifier(model.modifier) if model.HasField("modifier") else None + ), + ) + + @classmethod + def convert_sparse_vector_config( + cls, model: grpc.SparseVectorConfig + ) -> dict[str, rest.SparseVectorParams]: + return dict((key, cls.convert_sparse_vector_params(val)) for key, val in model.map.items()) + + @classmethod + def convert_shard_key(cls, model: grpc.ShardKey) -> rest.ShardKey: + name = model.WhichOneof("key") + if name is None: + raise ValueError(f"invalid ShardKey model: {model}") # pragma: no cover + val = getattr(model, name) + return val + + @classmethod + def convert_shard_key_selector(cls, model: grpc.ShardKeySelector) -> rest.ShardKeySelector: + if len(model.shard_keys) == 1: + return cls.convert_shard_key(model.shard_keys[0]) + return [cls.convert_shard_key(shard_key) for shard_key in model.shard_keys] + + @classmethod + def convert_sharding_method(cls, model: grpc.ShardingMethod) -> rest.ShardingMethod: + if model == grpc.Auto: + return rest.ShardingMethod.AUTO + if model == grpc.Custom: + return rest.ShardingMethod.CUSTOM + raise ValueError(f"invalid ShardingMethod model: {model}") # pragma: no cover + + @classmethod + def convert_direction(cls, model: grpc.Direction) -> rest.Direction: + if model == grpc.Asc: + return rest.Direction.ASC + if model == grpc.Desc: + return rest.Direction.DESC + raise ValueError(f"invalid Direction model: {model}") # pragma: no cover + + @classmethod + def convert_start_from(cls, model: grpc.StartFrom) -> rest.StartFrom: + if model.HasField("integer"): + return model.integer + if model.HasField("float"): + return model.float + if model.HasField("timestamp"): + dt = cls.convert_timestamp(model.timestamp) + return dt + if model.HasField("datetime"): + return model.datetime + + @classmethod + def convert_order_by(cls, model: grpc.OrderBy) -> rest.OrderBy: + return rest.OrderBy( + key=model.key, + direction=( + cls.convert_direction(model.direction) if model.HasField("direction") else None + ), + start_from=( + cls.convert_start_from(model.start_from) if model.HasField("start_from") else None + ), + ) + + @classmethod + def convert_facet_value(cls, model: grpc.FacetValue) -> rest.FacetValue: + name = model.WhichOneof("variant") + if name is None: + raise ValueError(f"invalid FacetValue model: {model}") # pragma: no cover + + val = getattr(model, name) + return val + + @classmethod + def convert_facet_value_hit(cls, model: grpc.FacetHit) -> rest.FacetValueHit: + return rest.FacetValueHit( + value=cls.convert_facet_value(model.value), + count=model.count, + ) + + @classmethod + def convert_health_check_reply(cls, model: grpc.HealthCheckReply) -> rest.VersionInfo: + return rest.VersionInfo( + title=model.title, + version=model.version, + commit=model.commit if model.HasField("commit") else None, + ) + + @classmethod + def convert_search_matrix_pair(cls, model: grpc.SearchMatrixPair) -> rest.SearchMatrixPair: + return rest.SearchMatrixPair( + a=cls.convert_point_id(model.a), + b=cls.convert_point_id(model.b), + score=model.score, + ) + + @classmethod + def convert_search_matrix_pairs( + cls, model: grpc.SearchMatrixPairs + ) -> rest.SearchMatrixPairsResponse: + return rest.SearchMatrixPairsResponse( + pairs=[cls.convert_search_matrix_pair(pair) for pair in model.pairs], + ) + + @classmethod + def convert_search_matrix_offsets( + cls, model: grpc.SearchMatrixOffsets + ) -> rest.SearchMatrixOffsetsResponse: + return rest.SearchMatrixOffsetsResponse( + offsets_row=list(model.offsets_row), + offsets_col=list(model.offsets_col), + scores=list(model.scores), + ids=[cls.convert_point_id(p_id) for p_id in model.ids], + ) + + @classmethod + def convert_strict_mode_multivector( + cls, model: grpc.StrictModeMultivector + ) -> rest.StrictModeMultivector: + return rest.StrictModeMultivector( + max_vectors=model.max_vectors if model.HasField("max_vectors") else None + ) + + @classmethod + def convert_strict_mode_multivector_config( + cls, model: grpc.StrictModeMultivectorConfig + ) -> rest.StrictModeMultivectorConfig: + return dict( + (key, cls.convert_strict_mode_multivector(val)) + for key, val in model.multivector_config.items() + ) + + @classmethod + def convert_strict_mode_sparse(cls, model: grpc.StrictModeSparse) -> rest.StrictModeSparse: + return rest.StrictModeSparse( + max_length=model.max_length if model.HasField("max_length") else None + ) + + @classmethod + def convert_strict_mode_sparse_config( + cls, model: grpc.StrictModeSparseConfig + ) -> rest.StrictModeSparseConfig: + return dict( + (key, cls.convert_strict_mode_sparse(val)) for key, val in model.sparse_config.items() + ) + + @classmethod + def convert_strict_mode_config(cls, model: grpc.StrictModeConfig) -> rest.StrictModeConfig: + return rest.StrictModeConfig( + enabled=model.enabled if model.HasField("enabled") else None, + max_query_limit=model.max_query_limit if model.HasField("max_query_limit") else None, + max_timeout=model.max_timeout if model.HasField("max_timeout") else None, + unindexed_filtering_retrieve=( + model.unindexed_filtering_retrieve + if model.HasField("unindexed_filtering_retrieve") + else None + ), + unindexed_filtering_update=( + model.unindexed_filtering_update + if model.HasField("unindexed_filtering_update") + else None + ), + search_max_hnsw_ef=( + model.search_max_hnsw_ef if model.HasField("search_max_hnsw_ef") else None + ), + search_allow_exact=( + model.search_allow_exact if model.HasField("search_allow_exact") else None + ), + search_max_oversampling=( + model.search_max_oversampling + if model.HasField("search_max_oversampling") + else None + ), + upsert_max_batchsize=( + model.upsert_max_batchsize if model.HasField("upsert_max_batchsize") else None + ), + max_collection_vector_size_bytes=( + model.max_collection_vector_size_bytes + if model.HasField("max_collection_vector_size_bytes") + else None + ), + read_rate_limit=model.read_rate_limit if model.HasField("read_rate_limit") else None, + write_rate_limit=( + model.write_rate_limit if model.HasField("write_rate_limit") else None + ), + max_collection_payload_size_bytes=( + model.max_collection_payload_size_bytes + if model.HasField("max_collection_payload_size_bytes") + else None + ), + max_points_count=( + model.max_points_count if model.HasField("max_points_count") else None + ), + filter_max_conditions=( + model.filter_max_conditions if model.HasField("filter_max_conditions") else None + ), + condition_max_size=( + model.condition_max_size if model.HasField("condition_max_size") else None + ), + multivector_config=( + cls.convert_strict_mode_multivector_config(model.multivector_config) + if model.HasField("multivector_config") + else None + ), + sparse_config=( + cls.convert_strict_mode_sparse_config(model.sparse_config) + if model.HasField("sparse_config") + else None + ), + ) + + @classmethod + def convert_strict_mode_config_output( + cls, model: grpc.StrictModeConfig + ) -> rest.StrictModeConfigOutput: + return rest.StrictModeConfigOutput( + enabled=model.enabled if model.HasField("enabled") else None, + max_query_limit=model.max_query_limit if model.HasField("max_query_limit") else None, + max_timeout=model.max_timeout if model.HasField("max_timeout") else None, + unindexed_filtering_retrieve=( + model.unindexed_filtering_retrieve + if model.HasField("unindexed_filtering_retrieve") + else None + ), + unindexed_filtering_update=( + model.unindexed_filtering_update + if model.HasField("unindexed_filtering_update") + else None + ), + search_max_hnsw_ef=( + model.search_max_hnsw_ef if model.HasField("search_max_hnsw_ef") else None + ), + search_allow_exact=( + model.search_allow_exact if model.HasField("search_allow_exact") else None + ), + search_max_oversampling=( + model.search_max_oversampling + if model.HasField("search_max_oversampling") + else None + ), + upsert_max_batchsize=( + model.upsert_max_batchsize if model.HasField("upsert_max_batchsize") else None + ), + max_collection_vector_size_bytes=( + model.max_collection_vector_size_bytes + if model.HasField("max_collection_vector_size_bytes") + else None + ), + read_rate_limit=model.read_rate_limit if model.HasField("read_rate_limit") else None, + write_rate_limit=( + model.write_rate_limit if model.HasField("write_rate_limit") else None + ), + max_collection_payload_size_bytes=( + model.max_collection_payload_size_bytes + if model.HasField("max_collection_payload_size_bytes") + else None + ), + max_points_count=( + model.max_points_count if model.HasField("max_points_count") else None + ), + filter_max_conditions=( + model.filter_max_conditions if model.HasField("filter_max_conditions") else None + ), + condition_max_size=( + model.condition_max_size if model.HasField("condition_max_size") else None + ), + multivector_config=( + cls.convert_strict_mode_multivector_config_output(model.multivector_config) + if model.HasField("multivector_config") + else None + ), + sparse_config=( + cls.convert_strict_mode_sparse_config_output(model.sparse_config) + if model.HasField("sparse_config") + else None + ), + ) + + @classmethod + def convert_strict_mode_multivector_config_output( + cls, model: grpc.StrictModeMultivectorConfig + ) -> rest.StrictModeMultivectorConfigOutput: + return dict( + (key, cls.convert_strict_mode_multivector_output(val)) + for key, val in model.multivector_config.items() + ) + + @classmethod + def convert_strict_mode_sparse_config_output( + cls, model: grpc.StrictModeSparseConfig + ) -> rest.StrictModeSparseConfigOutput: + return dict( + (key, cls.convert_strict_mode_sparse_output(val)) + for key, val in model.sparse_config.items() + ) + + @classmethod + def convert_strict_mode_sparse_output( + cls, model: grpc.StrictModeSparse + ) -> rest.StrictModeSparseOutput: + return rest.StrictModeSparseOutput( + max_length=model.max_length if model.HasField("max_length") else None + ) + + @classmethod + def convert_strict_mode_multivector_output( + cls, model: grpc.StrictModeMultivector + ) -> rest.StrictModeMultivectorOutput: + return rest.StrictModeMultivectorOutput( + max_vectors=model.max_vectors if model.HasField("max_vectors") else None + ) + + +# ---------------------------------------- +# +# ----------- REST TO gRPC --------------- +# +# ---------------------------------------- + + +class RestToGrpc: + @classmethod + def convert_filter(cls, model: rest.Filter) -> grpc.Filter: + def convert_conditions( + conditions: Union[list[rest.Condition], rest.Condition], + ) -> list[grpc.Condition]: + if not isinstance(conditions, list): + conditions = [conditions] + return [cls.convert_condition(condition) for condition in conditions] + + return grpc.Filter( + must=(convert_conditions(model.must) if model.must is not None else None), + must_not=(convert_conditions(model.must_not) if model.must_not is not None else None), + should=(convert_conditions(model.should) if model.should is not None else None), + min_should=( + grpc.MinShould( + conditions=convert_conditions(model.min_should.conditions), + min_count=model.min_should.min_count, + ) + if model.min_should is not None + else None + ), + ) + + @classmethod + def convert_range(cls, model: rest.Range) -> grpc.Range: + return grpc.Range( + lt=model.lt, + gt=model.gt, + gte=model.gte, + lte=model.lte, + ) + + @classmethod + def convert_datetime(cls, model: Union[datetime, date]) -> Timestamp: + if isinstance(model, date) and not isinstance(model, datetime): + model = datetime.combine(model, datetime.min.time()) + ts = Timestamp() + ts.FromDatetime(model) + return ts + + @classmethod + def convert_datetime_range(cls, model: rest.DatetimeRange) -> grpc.DatetimeRange: + return grpc.DatetimeRange( + lt=cls.convert_datetime(model.lt) if model.lt is not None else None, + gt=cls.convert_datetime(model.gt) if model.gt is not None else None, + gte=cls.convert_datetime(model.gte) if model.gte is not None else None, + lte=cls.convert_datetime(model.lte) if model.lte is not None else None, + ) + + @classmethod + def convert_geo_radius(cls, model: rest.GeoRadius) -> grpc.GeoRadius: + return grpc.GeoRadius(center=cls.convert_geo_point(model.center), radius=model.radius) + + @classmethod + def convert_geo_line_string(cls, model: rest.GeoLineString) -> grpc.GeoLineString: + return grpc.GeoLineString(points=[cls.convert_geo_point(point) for point in model.points]) + + @classmethod + def convert_geo_polygon(cls, model: rest.GeoPolygon) -> grpc.GeoPolygon: + return grpc.GeoPolygon( + exterior=cls.convert_geo_line_string(model.exterior), + interiors=[cls.convert_geo_line_string(interior) for interior in model.interiors] + if model.interiors + else None, + ) + + @classmethod + def convert_collection_description( + cls, model: rest.CollectionDescription + ) -> grpc.CollectionDescription: + return grpc.CollectionDescription(name=model.name) + + @classmethod + def convert_collection_info(cls, model: rest.CollectionInfo) -> grpc.CollectionInfo: + return grpc.CollectionInfo( + config=cls.convert_collection_config(model.config) if model.config else None, + optimizer_status=cls.convert_optimizer_status(model.optimizer_status), + payload_schema=( + cls.convert_payload_schema(model.payload_schema) + if model.payload_schema is not None + else None + ), + segments_count=model.segments_count, + status=cls.convert_collection_status(model.status), + vectors_count=model.vectors_count if model.vectors_count is not None else None, + points_count=model.points_count, + ) + + @classmethod + def convert_collection_status(cls, model: rest.CollectionStatus) -> grpc.CollectionStatus: + if model == rest.CollectionStatus.RED: + return grpc.CollectionStatus.Red + if model == rest.CollectionStatus.YELLOW: + return grpc.CollectionStatus.Yellow + if model == rest.CollectionStatus.GREEN: + return grpc.CollectionStatus.Green + if model == rest.CollectionStatus.GREY: + return grpc.CollectionStatus.Grey + + raise ValueError(f"invalid CollectionStatus model: {model}") # pragma: no cover + + @classmethod + def convert_optimizer_status(cls, model: rest.OptimizersStatus) -> grpc.OptimizerStatus: + if isinstance(model, rest.OptimizersStatusOneOf): + return grpc.OptimizerStatus( + ok=True, + ) + if isinstance(model, rest.OptimizersStatusOneOf1): + return grpc.OptimizerStatus(ok=False, error=model.error) + raise ValueError(f"invalid OptimizersStatus model: {model}") # pragma: no cover + + @classmethod + def convert_payload_schema( + cls, model: dict[str, rest.PayloadIndexInfo] + ) -> dict[str, grpc.PayloadSchemaInfo]: + return dict((key, cls.convert_payload_index_info(val)) for key, val in model.items()) + + @classmethod + def convert_payload_index_info(cls, model: rest.PayloadIndexInfo) -> grpc.PayloadSchemaInfo: + params = model.params + return grpc.PayloadSchemaInfo( + data_type=cls.convert_payload_schema_type(model.data_type), + params=cls.convert_payload_schema_params(params) if params is not None else None, + points=model.points, + ) + + @classmethod + def convert_payload_schema_params( + cls, model: rest.PayloadSchemaParams + ) -> grpc.PayloadIndexParams: + if isinstance(model, rest.TextIndexParams): + return grpc.PayloadIndexParams(text_index_params=cls.convert_text_index_params(model)) + + if isinstance(model, rest.IntegerIndexParams): + return grpc.PayloadIndexParams( + integer_index_params=cls.convert_integer_index_params(model) + ) + + if isinstance(model, rest.KeywordIndexParams): + return grpc.PayloadIndexParams( + keyword_index_params=cls.convert_keyword_index_params(model) + ) + + if isinstance(model, rest.FloatIndexParams): + return grpc.PayloadIndexParams( + float_index_params=cls.convert_float_index_params(model) + ) + + if isinstance(model, rest.GeoIndexParams): + return grpc.PayloadIndexParams(geo_index_params=cls.convert_geo_index_params(model)) + + if isinstance(model, rest.BoolIndexParams): + return grpc.PayloadIndexParams(bool_index_params=cls.convert_bool_index_params(model)) + + if isinstance(model, rest.DatetimeIndexParams): + return grpc.PayloadIndexParams( + datetime_index_params=cls.convert_datetime_index_params(model) + ) + + if isinstance(model, rest.UuidIndexParams): + return grpc.PayloadIndexParams(uuid_index_params=cls.convert_uuid_index_params(model)) + + raise ValueError(f"invalid PayloadSchemaParams model: {model}") # pragma: no cover + + @classmethod + def convert_payload_schema_type(cls, model: rest.PayloadSchemaType) -> grpc.PayloadSchemaType: + if model == rest.PayloadSchemaType.KEYWORD: + return grpc.PayloadSchemaType.Keyword + if model == rest.PayloadSchemaType.INTEGER: + return grpc.PayloadSchemaType.Integer + if model == rest.PayloadSchemaType.FLOAT: + return grpc.PayloadSchemaType.Float + if model == rest.PayloadSchemaType.BOOL: + return grpc.PayloadSchemaType.Bool + if model == rest.PayloadSchemaType.GEO: + return grpc.PayloadSchemaType.Geo + if model == rest.PayloadSchemaType.TEXT: + return grpc.PayloadSchemaType.Text + if model == rest.PayloadSchemaType.DATETIME: + return grpc.PayloadSchemaType.Datetime + if model == rest.PayloadSchemaType.UUID: + return grpc.PayloadSchemaType.Uuid + + raise ValueError(f"invalid PayloadSchemaType model: {model}") # pragma: no cover + + @classmethod + def convert_update_result(cls, model: rest.UpdateResult) -> grpc.UpdateResult: + return grpc.UpdateResult( + operation_id=model.operation_id, + status=cls.convert_update_stats(model.status), + ) + + @classmethod + def convert_update_stats(cls, model: rest.UpdateStatus) -> grpc.UpdateStatus: + if model == rest.UpdateStatus.COMPLETED: + return grpc.UpdateStatus.Completed + if model == rest.UpdateStatus.ACKNOWLEDGED: + return grpc.UpdateStatus.Acknowledged + + raise ValueError(f"invalid UpdateStatus model: {model}") # pragma: no cover + + @classmethod + def convert_has_id_condition(cls, model: rest.HasIdCondition) -> grpc.HasIdCondition: + return grpc.HasIdCondition( + has_id=[cls.convert_extended_point_id(idx) for idx in model.has_id] + ) + + @classmethod + def convert_has_vector_condition( + cls, model: rest.HasVectorCondition + ) -> grpc.HasVectorCondition: + return grpc.HasVectorCondition(has_vector=model.has_vector) + + @classmethod + def convert_delete_alias(cls, model: rest.DeleteAlias) -> grpc.DeleteAlias: + return grpc.DeleteAlias(alias_name=model.alias_name) + + @classmethod + def convert_rename_alias(cls, model: rest.RenameAlias) -> grpc.RenameAlias: + return grpc.RenameAlias( + old_alias_name=model.old_alias_name, new_alias_name=model.new_alias_name + ) + + @classmethod + def convert_is_empty_condition(cls, model: rest.IsEmptyCondition) -> grpc.IsEmptyCondition: + return grpc.IsEmptyCondition(key=model.is_empty.key) + + @classmethod + def convert_is_null_condition(cls, model: rest.IsNullCondition) -> grpc.IsNullCondition: + return grpc.IsNullCondition(key=model.is_null.key) + + @classmethod + def convert_nested_condition(cls, model: rest.NestedCondition) -> grpc.NestedCondition: + return grpc.NestedCondition( + key=model.nested.key, + filter=cls.convert_filter(model.nested.filter), + ) + + @classmethod + def convert_search_params(cls, model: rest.SearchParams) -> grpc.SearchParams: + return grpc.SearchParams( + hnsw_ef=model.hnsw_ef, + exact=model.exact, + quantization=( + cls.convert_quantization_search_params(model.quantization) + if model.quantization is not None + else None + ), + indexed_only=model.indexed_only, + ) + + @classmethod + def convert_create_alias(cls, model: rest.CreateAlias) -> grpc.CreateAlias: + return grpc.CreateAlias(collection_name=model.collection_name, alias_name=model.alias_name) + + @classmethod + def convert_order_value(cls, model: rest.OrderValue) -> grpc.OrderValue: + if isinstance(model, int): + return grpc.OrderValue(int=model) + if isinstance(model, float): + return grpc.OrderValue(float=model) + raise ValueError(f"invalid OrderValue model: {model}") # pragma: no cover + + @classmethod + def convert_scored_point(cls, model: rest.ScoredPoint) -> grpc.ScoredPoint: + return grpc.ScoredPoint( + id=cls.convert_extended_point_id(model.id), + payload=cls.convert_payload(model.payload) if model.payload is not None else None, + score=model.score, + vectors=( + cls.convert_vector_struct_output(model.vector) + if model.vector is not None + else None + ), + version=model.version, + shard_key=cls.convert_shard_key(model.shard_key) if model.shard_key else None, + order_value=cls.convert_order_value(model.order_value) if model.order_value else None, + ) + + @classmethod + def convert_values_count(cls, model: rest.ValuesCount) -> grpc.ValuesCount: + return grpc.ValuesCount( + lt=model.lt, + gt=model.gt, + gte=model.gte, + lte=model.lte, + ) + + @classmethod + def convert_geo_bounding_box(cls, model: rest.GeoBoundingBox) -> grpc.GeoBoundingBox: + return grpc.GeoBoundingBox( + top_left=cls.convert_geo_point(model.top_left), + bottom_right=cls.convert_geo_point(model.bottom_right), + ) + + @classmethod + def convert_point_struct(cls, model: rest.PointStruct) -> grpc.PointStruct: + return grpc.PointStruct( + id=cls.convert_extended_point_id(model.id), + vectors=cls.convert_vector_struct(model.vector), + payload=cls.convert_payload(model.payload) if model.payload is not None else None, + ) + + @classmethod + def convert_payload(cls, model: rest.Payload) -> dict[str, grpc.Value]: + return dict((key, json_to_value(val)) for key, val in model.items()) + + @classmethod + def convert_hnsw_config_diff(cls, model: rest.HnswConfigDiff) -> grpc.HnswConfigDiff: + return grpc.HnswConfigDiff( + ef_construct=model.ef_construct, + full_scan_threshold=model.full_scan_threshold, + m=model.m, + max_indexing_threads=model.max_indexing_threads, + on_disk=model.on_disk, + payload_m=model.payload_m, + ) + + @classmethod + def convert_field_condition(cls, model: rest.FieldCondition) -> grpc.FieldCondition: + if model.match is not None: + return grpc.FieldCondition(key=model.key, match=cls.convert_match(model.match)) + if model.range is not None: + if isinstance(model.range, rest.Range): + return grpc.FieldCondition(key=model.key, range=cls.convert_range(model.range)) + if isinstance(model.range, rest.DatetimeRange): + return grpc.FieldCondition( + key=model.key, + datetime_range=cls.convert_datetime_range(model.range), + ) + if model.geo_bounding_box is not None: + return grpc.FieldCondition( + key=model.key, + geo_bounding_box=cls.convert_geo_bounding_box(model.geo_bounding_box), + ) + if model.geo_radius is not None: + return grpc.FieldCondition( + key=model.key, geo_radius=cls.convert_geo_radius(model.geo_radius) + ) + if model.geo_polygon is not None: + return grpc.FieldCondition( + key=model.key, geo_polygon=cls.convert_geo_polygon(model.geo_polygon) + ) + if model.values_count is not None: + return grpc.FieldCondition( + key=model.key, values_count=cls.convert_values_count(model.values_count) + ) + if model.is_empty is not None: + return grpc.FieldCondition(key=model.key, is_empty=model.is_empty) + + if model.is_null is not None: + return grpc.FieldCondition(key=model.key, is_null=model.is_null) + raise ValueError(f"invalid FieldCondition model: {model}") # pragma: no cover + + @classmethod + def convert_wal_config_diff(cls, model: rest.WalConfigDiff) -> grpc.WalConfigDiff: + return grpc.WalConfigDiff( + wal_capacity_mb=model.wal_capacity_mb, + wal_segments_ahead=model.wal_segments_ahead, + ) + + @classmethod + def convert_collection_config(cls, model: rest.CollectionConfig) -> grpc.CollectionConfig: + return grpc.CollectionConfig( + params=cls.convert_collection_params(model.params), + hnsw_config=cls.convert_hnsw_config(model.hnsw_config), + optimizer_config=cls.convert_optimizers_config(model.optimizer_config), + wal_config=cls.convert_wal_config(model.wal_config), + quantization_config=( + cls.convert_quantization_config(model.quantization_config) + if model.quantization_config is not None + else None + ), + strict_mode_config=( + cls.convert_strict_mode_config_output(model.strict_mode_config) + if model.strict_mode_config is not None + else None + ), + ) + + @classmethod + def convert_hnsw_config(cls, model: rest.HnswConfig) -> grpc.HnswConfigDiff: + return grpc.HnswConfigDiff( + ef_construct=model.ef_construct, + full_scan_threshold=model.full_scan_threshold, + m=model.m, + max_indexing_threads=model.max_indexing_threads, + on_disk=model.on_disk, + payload_m=model.payload_m, + ) + + @classmethod + def convert_wal_config(cls, model: rest.WalConfig) -> grpc.WalConfigDiff: + return grpc.WalConfigDiff( + wal_capacity_mb=model.wal_capacity_mb, + wal_segments_ahead=model.wal_segments_ahead, + ) + + @classmethod + def convert_distance(cls, model: rest.Distance) -> grpc.Distance: + if model == rest.Distance.DOT: + return grpc.Distance.Dot + if model == rest.Distance.COSINE: + return grpc.Distance.Cosine + if model == rest.Distance.EUCLID: + return grpc.Distance.Euclid + if model == rest.Distance.MANHATTAN: + return grpc.Distance.Manhattan + + raise ValueError(f"invalid Distance model: {model}") # pragma: no cover + + @classmethod + def convert_collection_params(cls, model: rest.CollectionParams) -> grpc.CollectionParams: + return grpc.CollectionParams( + vectors_config=( + cls.convert_vectors_config(model.vectors) if model.vectors is not None else None + ), + shard_number=model.shard_number, + on_disk_payload=model.on_disk_payload or False, + write_consistency_factor=model.write_consistency_factor, + replication_factor=model.replication_factor, + read_fan_out_factor=model.read_fan_out_factor, + sparse_vectors_config=( + cls.convert_sparse_vector_config(model.sparse_vectors) + if model.sparse_vectors is not None + else None + ), + sharding_method=( + cls.convert_sharding_method(model.sharding_method) + if model.sharding_method is not None + else None + ), + ) + + @classmethod + def convert_max_optimization_threads( + cls, model: rest.MaxOptimizationThreads + ) -> grpc.MaxOptimizationThreads: + if model == rest.MaxOptimizationThreadsSetting.AUTO: + return grpc.MaxOptimizationThreads(setting=grpc.MaxOptimizationThreads.Setting.Auto) + elif isinstance(model, int): + return grpc.MaxOptimizationThreads(value=model) + raise ValueError(f"invalid MaxOptimizationThreads model: {model}") # pragma: no cover + + @classmethod + def convert_optimizers_config(cls, model: rest.OptimizersConfig) -> grpc.OptimizersConfigDiff: + return grpc.OptimizersConfigDiff( + default_segment_number=model.default_segment_number, + deleted_threshold=model.deleted_threshold, + flush_interval_sec=model.flush_interval_sec, + indexing_threshold=model.indexing_threshold, + max_optimization_threads=( + cls.convert_max_optimization_threads(model.max_optimization_threads) + if model.max_optimization_threads is not None + else None + ), + max_segment_size=model.max_segment_size, + memmap_threshold=model.memmap_threshold, + vacuum_min_vector_number=model.vacuum_min_vector_number, + deprecated_max_optimization_threads=model.max_optimization_threads, + ) + + @classmethod + def convert_optimizers_config_diff( + cls, model: rest.OptimizersConfigDiff + ) -> grpc.OptimizersConfigDiff: + deprecated_max_optimization_threads = None + if isinstance(model.max_optimization_threads, int): + deprecated_max_optimization_threads = model.max_optimization_threads + + return grpc.OptimizersConfigDiff( + default_segment_number=model.default_segment_number, + deleted_threshold=model.deleted_threshold, + flush_interval_sec=model.flush_interval_sec, + indexing_threshold=model.indexing_threshold, + max_optimization_threads=( + cls.convert_max_optimization_threads(model.max_optimization_threads) + if model.max_optimization_threads is not None + else None + ), + max_segment_size=model.max_segment_size, + memmap_threshold=model.memmap_threshold, + vacuum_min_vector_number=model.vacuum_min_vector_number, + deprecated_max_optimization_threads=deprecated_max_optimization_threads, + ) + + @classmethod + def convert_update_collection( + cls, model: rest.UpdateCollection, collection_name: str + ) -> grpc.UpdateCollection: + return grpc.UpdateCollection( + collection_name=collection_name, + optimizers_config=( + cls.convert_optimizers_config_diff(model.optimizers_config) + if model.optimizers_config is not None + else None + ), + vectors_config=( + cls.convert_vectors_config_diff(model.vectors) + if model.vectors is not None + else None + ), + params=( + cls.convert_collection_params_diff(model.params) + if model.params is not None + else None + ), + hnsw_config=( + cls.convert_hnsw_config_diff(model.hnsw_config) + if model.hnsw_config is not None + else None + ), + quantization_config=( + cls.convert_quantization_config_diff(model.quantization_config) + if model.quantization_config is not None + else None + ), + ) + + @classmethod + def convert_geo_point(cls, model: rest.GeoPoint) -> grpc.GeoPoint: + return grpc.GeoPoint(lon=model.lon, lat=model.lat) + + @classmethod + def convert_match(cls, model: rest.Match) -> grpc.Match: + if isinstance(model, rest.MatchValue): + if isinstance(model.value, bool): + return grpc.Match(boolean=model.value) + if isinstance(model.value, int): + return grpc.Match(integer=model.value) + if isinstance(model.value, str): + return grpc.Match(keyword=model.value) + if isinstance(model, rest.MatchText): + return grpc.Match(text=model.text) + if isinstance(model, rest.MatchAny): + if len(model.any) == 0: + return grpc.Match(keywords=grpc.RepeatedStrings(strings=[])) + if isinstance(model.any[0], str): + return grpc.Match(keywords=grpc.RepeatedStrings(strings=model.any)) + if isinstance(model.any[0], int): + return grpc.Match(integers=grpc.RepeatedIntegers(integers=model.any)) + raise ValueError(f"invalid MatchAny model: {model}") # pragma: no cover + if isinstance(model, rest.MatchExcept): + if len(model.except_) == 0: + return grpc.Match(except_keywords=grpc.RepeatedStrings(strings=[])) + if isinstance(model.except_[0], str): + return grpc.Match(except_keywords=grpc.RepeatedStrings(strings=model.except_)) + if isinstance(model.except_[0], int): + return grpc.Match(except_integers=grpc.RepeatedIntegers(integers=model.except_)) + raise ValueError(f"invalid MatchExcept model: {model}") # pragma: no cover + if isinstance(model, rest.MatchPhrase): + return grpc.Match(phrase=model.phrase) + raise ValueError(f"invalid Match model: {model}") # pragma: no cover + + @classmethod + def convert_alias_operations(cls, model: rest.AliasOperations) -> grpc.AliasOperations: + if isinstance(model, rest.CreateAliasOperation): + return grpc.AliasOperations(create_alias=cls.convert_create_alias(model.create_alias)) + if isinstance(model, rest.DeleteAliasOperation): + return grpc.AliasOperations(delete_alias=cls.convert_delete_alias(model.delete_alias)) + if isinstance(model, rest.RenameAliasOperation): + return grpc.AliasOperations(rename_alias=cls.convert_rename_alias(model.rename_alias)) + + raise ValueError(f"invalid AliasOperations model: {model}") # pragma: no cover + + @classmethod + def convert_alias_description(cls, model: rest.AliasDescription) -> grpc.AliasDescription: + return grpc.AliasDescription( + alias_name=model.alias_name, + collection_name=model.collection_name, + ) + + @classmethod + def convert_recommend_examples_to_ids( + cls, examples: Sequence[rest.RecommendExample] + ) -> list[grpc.PointId]: + ids: list[grpc.PointId] = [] + for example in examples: + if isinstance(example, get_args_subscribed(rest.ExtendedPointId)): + id_ = cls.convert_extended_point_id(example) + elif isinstance(example, grpc.PointId): + id_ = example + else: + continue + + ids.append(id_) + + return ids + + @classmethod + def convert_recommend_examples_to_vectors( + cls, examples: Sequence[rest.RecommendExample] + ) -> list[grpc.Vector]: + vectors: list[grpc.Vector] = [] + for example in examples: + if isinstance(example, grpc.Vector): + vector = example + elif isinstance(example, list): + vector = grpc.Vector(data=example) + elif isinstance(example, rest.SparseVector): + vector = cls.convert_sparse_vector_to_vector(example) + else: + continue + + vectors.append(vector) + + return vectors + + @classmethod + def convert_vector_example(cls, model: rest.RecommendExample) -> grpc.VectorExample: + return cls.convert_recommend_example(model) + + @classmethod + def convert_recommend_example(cls, model: rest.RecommendExample) -> grpc.VectorExample: + if isinstance(model, get_args_subscribed(rest.ExtendedPointId)): + return grpc.VectorExample(id=cls.convert_extended_point_id(model)) + if isinstance(model, rest.SparseVector): + return grpc.VectorExample(vector=cls.convert_sparse_vector_to_vector(model)) + if isinstance(model, list): + return grpc.VectorExample(vector=grpc.Vector(data=model)) + + raise ValueError(f"Invalid RecommendExample model: {model}") # pragma: no cover + + @classmethod + def convert_sparse_vector_to_vector(cls, model: rest.SparseVector) -> grpc.Vector: + return grpc.Vector( + data=model.values, + indices=grpc.SparseIndices(data=model.indices), + ) + + @classmethod + def convert_sparse_vector_to_vector_output(cls, model: rest.SparseVector) -> grpc.VectorOutput: + return grpc.VectorOutput( + data=model.values, + indices=grpc.SparseIndices(data=model.indices), + ) + + @classmethod + def convert_target_vector(cls, model: rest.RecommendExample) -> grpc.TargetVector: + return grpc.TargetVector(single=cls.convert_recommend_example(model)) + + @classmethod + def convert_context_example_pair( + cls, + model: rest.ContextExamplePair, + ) -> grpc.ContextExamplePair: + return grpc.ContextExamplePair( + positive=cls.convert_recommend_example(model.positive), + negative=cls.convert_recommend_example(model.negative), + ) + + @classmethod + def convert_extended_point_id(cls, model: rest.ExtendedPointId) -> grpc.PointId: + if isinstance(model, int): + return grpc.PointId(num=model) + if isinstance(model, str): + return grpc.PointId(uuid=model) + raise ValueError(f"invalid ExtendedPointId model: {model}") # pragma: no cover + + @classmethod + def convert_points_selector(cls, model: rest.PointsSelector) -> grpc.PointsSelector: + if isinstance(model, rest.PointIdsList): + return grpc.PointsSelector( + points=grpc.PointsIdsList( + ids=[cls.convert_extended_point_id(point) for point in model.points] + ) + ) + if isinstance(model, rest.FilterSelector): + return grpc.PointsSelector(filter=cls.convert_filter(model.filter)) + raise ValueError(f"invalid PointsSelector model: {model}") # pragma: no cover + + @classmethod + def convert_condition(cls, model: rest.Condition) -> grpc.Condition: + if isinstance(model, rest.FieldCondition): + return grpc.Condition(field=cls.convert_field_condition(model)) + if isinstance(model, rest.IsEmptyCondition): + return grpc.Condition(is_empty=cls.convert_is_empty_condition(model)) + if isinstance(model, rest.IsNullCondition): + return grpc.Condition(is_null=cls.convert_is_null_condition(model)) + if isinstance(model, rest.HasIdCondition): + return grpc.Condition(has_id=cls.convert_has_id_condition(model)) + if isinstance(model, rest.HasVectorCondition): + return grpc.Condition(has_vector=cls.convert_has_vector_condition(model)) + if isinstance(model, rest.Filter): + return grpc.Condition(filter=cls.convert_filter(model)) + if isinstance(model, rest.NestedCondition): + return grpc.Condition(nested=cls.convert_nested_condition(model)) + + raise ValueError(f"invalid Condition model: {model}") # pragma: no cover + + @classmethod + def convert_payload_selector(cls, model: rest.PayloadSelector) -> grpc.WithPayloadSelector: + if isinstance(model, rest.PayloadSelectorInclude): + return grpc.WithPayloadSelector( + include=grpc.PayloadIncludeSelector(fields=model.include) + ) + if isinstance(model, rest.PayloadSelectorExclude): + return grpc.WithPayloadSelector( + exclude=grpc.PayloadExcludeSelector(fields=model.exclude) + ) + raise ValueError(f"invalid PayloadSelector model: {model}") # pragma: no cover + + @classmethod + def convert_with_payload_selector( + cls, model: rest.PayloadSelector + ) -> grpc.WithPayloadSelector: + return cls.convert_with_payload_interface(model) + + @classmethod + def convert_with_payload_interface( + cls, model: rest.WithPayloadInterface + ) -> grpc.WithPayloadSelector: + if isinstance(model, bool): + return grpc.WithPayloadSelector(enable=model) + elif isinstance(model, list): + return grpc.WithPayloadSelector(include=grpc.PayloadIncludeSelector(fields=model)) + elif isinstance(model, get_args(rest.PayloadSelector)): + return cls.convert_payload_selector(model) + + raise ValueError(f"invalid WithPayloadInterface model: {model}") # pragma: no cover + + @classmethod + def convert_start_from(cls, model: rest.StartFrom) -> grpc.StartFrom: + if isinstance(model, int): + return grpc.StartFrom(integer=model) + if isinstance(model, float): + return grpc.StartFrom(float=model) + if isinstance(model, datetime): + ts = cls.convert_datetime(model) + return grpc.StartFrom(timestamp=ts) + if isinstance(model, str): + # Pydantic also accepts strings as datetime if they are correctly formatted + return grpc.StartFrom(datetime=model) + + raise ValueError(f"invalid StartFrom model: {model}") # pragma: no cover + + @classmethod + def convert_direction(cls, model: rest.Direction) -> grpc.Direction: + if model == rest.Direction.ASC: + return grpc.Direction.Asc + if model == rest.Direction.DESC: + return grpc.Direction.Desc + raise ValueError(f"invalid Direction model: {model}") # pragma: no cover + + @classmethod + def convert_order_by(cls, model: rest.OrderBy) -> grpc.OrderBy: + return grpc.OrderBy( + key=model.key, + direction=( + cls.convert_direction(model.direction) if model.direction is not None else None + ), + start_from=( + cls.convert_start_from(model.start_from) if model.start_from is not None else None + ), + ) + + @classmethod + def convert_order_by_interface(cls, model: rest.OrderByInterface) -> grpc.OrderBy: + # using no cover because there is no OrderByInterface in grpc + if isinstance(model, str): + return grpc.OrderBy(key=model) + if isinstance(model, rest.OrderBy): + return cls.convert_order_by(model) + raise ValueError(f"invalid OrderByInterface model: {model}") # pragma: no cover + + @classmethod + def convert_facet_value(cls, model: rest.FacetValue) -> grpc.FacetValue: + if isinstance(model, str): + return grpc.FacetValue(string_value=model) + if isinstance(model, int): + return grpc.FacetValue(integer_value=model) + + raise ValueError(f"invalid FacetValue model: {model}") # pragma: no cover + + @classmethod + def convert_facet_value_hit(cls, model: rest.FacetValueHit) -> grpc.FacetHit: + return grpc.FacetHit( + value=cls.convert_facet_value(model.value), + count=model.count, + ) + + @classmethod + def convert_record(cls, model: rest.Record) -> grpc.RetrievedPoint: + return grpc.RetrievedPoint( + id=cls.convert_extended_point_id(model.id), + payload=cls.convert_payload(model.payload), + vectors=( + cls.convert_vector_struct_output(model.vector) + if model.vector is not None + else None + ), + shard_key=cls.convert_shard_key(model.shard_key) if model.shard_key else None, + order_value=cls.convert_order_value(model.order_value) if model.order_value else None, + ) + + @classmethod + def convert_retrieved_point(cls, model: rest.Record) -> grpc.RetrievedPoint: + return cls.convert_record(model) + + @classmethod + def convert_count_result(cls, model: rest.CountResult) -> grpc.CountResult: + return grpc.CountResult(count=model.count) + + @classmethod + def convert_snapshot_description( + cls, model: rest.SnapshotDescription + ) -> grpc.SnapshotDescription: + timestamp = Timestamp() + timestamp.FromDatetime(datetime.fromisoformat(model.creation_time)) + return grpc.SnapshotDescription( + name=model.name, + creation_time=timestamp, + size=model.size, + ) + + @classmethod + def convert_datatype(cls, model: rest.Datatype) -> grpc.Datatype: + if model == rest.Datatype.FLOAT32: + return grpc.Datatype.Float32 + if model == rest.Datatype.UINT8: + return grpc.Datatype.Uint8 + if model == rest.Datatype.FLOAT16: + return grpc.Datatype.Float16 + + raise ValueError(f"invalid Datatype model: {model}") # pragma: no cover + + @classmethod + def convert_vector_params(cls, model: rest.VectorParams) -> grpc.VectorParams: + return grpc.VectorParams( + size=model.size, + distance=cls.convert_distance(model.distance), + hnsw_config=( + cls.convert_hnsw_config_diff(model.hnsw_config) + if model.hnsw_config is not None + else None + ), + quantization_config=( + cls.convert_quantization_config(model.quantization_config) + if model.quantization_config is not None + else None + ), + on_disk=model.on_disk, + datatype=cls.convert_datatype(model.datatype) if model.datatype is not None else None, + multivector_config=( + cls.convert_multivector_config(model.multivector_config) + if model.multivector_config is not None + else None + ), + ) + + @classmethod + def convert_multivector_config(cls, model: rest.MultiVectorConfig) -> grpc.MultiVectorConfig: + return grpc.MultiVectorConfig( + comparator=cls.convert_multivector_comparator(model.comparator) + ) + + @classmethod + def convert_multivector_comparator( + cls, model: rest.MultiVectorComparator + ) -> grpc.MultiVectorComparator: + if model == rest.MultiVectorComparator.MAX_SIM: + return grpc.MultiVectorComparator.MaxSim + + raise ValueError(f"invalid MultiVectorComparator model: {model}") # pragma: no cover + + @classmethod + def convert_vectors_config(cls, model: rest.VectorsConfig) -> grpc.VectorsConfig: + if isinstance(model, rest.VectorParams): + return grpc.VectorsConfig(params=cls.convert_vector_params(model)) + elif isinstance(model, dict): + return grpc.VectorsConfig( + params_map=grpc.VectorParamsMap( + map=dict((key, cls.convert_vector_params(val)) for key, val in model.items()) + ) + ) + else: + raise ValueError(f"invalid VectorsConfig model: {model}") # pragma: no cover + + @classmethod + def convert_vector_struct(cls, model: rest.VectorStruct) -> grpc.Vectors: + def convert_vector( + vector: Union[list[float], list[list[float]]], + ) -> grpc.Vector: + if len(vector) != 0 and isinstance( + vector[0], list + ): # we can't say whether it is an empty dense or multi-dense vector + return grpc.Vector( + data=[ + inner_vector + for multi_vector in vector + for inner_vector in multi_vector # type: ignore + ], + vectors_count=len(vector), + ) + return grpc.Vector(data=vector) + + if isinstance(model, list): + return grpc.Vectors(vector=convert_vector(model)) + elif isinstance(model, dict): + vectors: dict = {} + for key, val in model.items(): + if isinstance(val, list): + vectors.update({key: convert_vector(val)}) + elif isinstance(val, rest.SparseVector): + vectors.update({key: cls.convert_sparse_vector_to_vector(val)}) + elif isinstance(val, rest.Document): + vectors.update({key: grpc.Vector(document=cls.convert_document(val))}) + elif isinstance(val, rest.Image): + vectors.update({key: grpc.Vector(image=cls.convert_image(val))}) + elif isinstance(val, rest.InferenceObject): + vectors.update({key: grpc.Vector(object=cls.convert_inference_object(val))}) + return grpc.Vectors(vectors=grpc.NamedVectors(vectors=vectors)) + elif isinstance(model, rest.Document): + return grpc.Vectors(vector=grpc.Vector(document=cls.convert_document(model))) + elif isinstance(model, rest.Image): + return grpc.Vectors(vector=grpc.Vector(image=cls.convert_image(model))) + elif isinstance(model, rest.InferenceObject): + return grpc.Vectors(vector=grpc.Vector(object=cls.convert_inference_object(model))) + else: + raise ValueError(f"invalid VectorStruct model: {model}") # pragma: no cover + + @classmethod + def convert_vector_struct_output(cls, model: rest.VectorStructOutput) -> grpc.VectorsOutput: + def convert_vector( + vector: Union[list[float], list[list[float]]], + ) -> grpc.VectorOutput: + if len(vector) != 0 and isinstance( + vector[0], list + ): # we can't say whether it is an empty dense or multi-dense vector + return grpc.VectorOutput( + data=[ + inner_vector + for multi_vector in vector + for inner_vector in multi_vector # type: ignore + ], + vectors_count=len(vector), + ) + return grpc.VectorOutput(data=vector) + + if isinstance(model, list): + return grpc.VectorsOutput(vector=convert_vector(model)) + elif isinstance(model, dict): + vectors: dict = {} + for key, val in model.items(): + if isinstance(val, list): + vectors.update({key: convert_vector(val)}) + elif isinstance(val, rest.SparseVector): + vectors.update({key: cls.convert_sparse_vector_to_vector_output(val)}) + return grpc.VectorsOutput(vectors=grpc.NamedVectorsOutput(vectors=vectors)) + else: + raise ValueError(f"invalid VectorStructOutput model: {model}") # pragma: no cover + + @classmethod + def convert_with_vectors(cls, model: rest.WithVector) -> grpc.WithVectorsSelector: + if isinstance(model, bool): + return grpc.WithVectorsSelector(enable=model) + elif isinstance(model, list): + return grpc.WithVectorsSelector(include=grpc.VectorsSelector(names=model)) + else: + raise ValueError(f"invalid WithVectors model: {model}") # pragma: no cover + + @classmethod + def convert_batch_vector_struct( + cls, model: rest.BatchVectorStruct, num_records: int + ) -> list[grpc.Vectors]: + if isinstance(model, list): + return [cls.convert_vector_struct(item) for item in model] + elif isinstance(model, dict): + result: list[dict] = [{} for _ in range(num_records)] + for key, val in model.items(): + for i, item in enumerate(val): + result[i][key] = item + return [cls.convert_vector_struct(item) for item in result] + else: + raise ValueError(f"invalid BatchVectorStruct model: {model}") # pragma: no cover + + @classmethod + def convert_named_vector_struct( + cls, model: rest.NamedVectorStruct + ) -> tuple[list[float], Optional[grpc.SparseIndices], Optional[str]]: + if isinstance(model, list): + return model, None, None + elif isinstance(model, rest.NamedVector): + return model.vector, None, model.name + elif isinstance(model, rest.NamedSparseVector): + return ( + model.vector.values, + grpc.SparseIndices(data=model.vector.indices), + model.name, + ) + else: + raise ValueError(f"invalid NamedVectorStruct model: {model}") # pragma: no cover + + @classmethod + def convert_dense_vector(cls, model: list[float]) -> grpc.DenseVector: + return grpc.DenseVector(data=model) + + @classmethod + def convert_sparse_vector(cls, model: rest.SparseVector) -> grpc.SparseVector: + return grpc.SparseVector(values=model.values, indices=model.indices) + + @classmethod + def convert_multi_dense_vector(cls, model: list[list[float]]) -> grpc.MultiDenseVector: + return grpc.MultiDenseVector( + vectors=[cls.convert_dense_vector(vector) for vector in model] + ) + + @classmethod + def convert_document(cls, model: rest.Document) -> grpc.Document: + return grpc.Document( + text=model.text, + model=model.model, + options=payload_to_grpc(model.options) if model.options is not None else None, + ) + + @classmethod + def convert_image(cls, model: rest.Image) -> grpc.Image: + return grpc.Image( + image=json_to_value(model.image), + model=model.model, + options=payload_to_grpc(model.options) if model.options is not None else None, + ) + + @classmethod + def convert_inference_object(cls, model: rest.InferenceObject) -> grpc.InferenceObject: + return grpc.InferenceObject( + object=json_to_value(model.object), + model=model.model, + options=payload_to_grpc(model.options) if model.options is not None else None, + ) + + @classmethod + def convert_vector_input(cls, model: rest.VectorInput) -> grpc.VectorInput: + if isinstance(model, list): + if len(model) != 0 and isinstance( + model[0], list + ): # we can't say whether it is an empty dense or multi-dense vector + return grpc.VectorInput(multi_dense=cls.convert_multi_dense_vector(model)) + return grpc.VectorInput(dense=cls.convert_dense_vector(model)) + if isinstance(model, rest.SparseVector): + return grpc.VectorInput(sparse=cls.convert_sparse_vector(model)) + if isinstance(model, get_args_subscribed(rest.ExtendedPointId)): + return grpc.VectorInput(id=cls.convert_extended_point_id(model)) + if isinstance(model, rest.Document): + return grpc.VectorInput(document=cls.convert_document(model)) + if isinstance(model, rest.Image): + return grpc.VectorInput(image=cls.convert_image(model)) + if isinstance(model, rest.InferenceObject): + return grpc.VectorInput(object=cls.convert_inference_object(model)) + + raise ValueError(f"invalid VectorInput model: {model}") # pragma: no cover + + @classmethod + def convert_recommend_input(cls, model: rest.RecommendInput) -> grpc.RecommendInput: + return grpc.RecommendInput( + positive=( + [cls.convert_vector_input(vector) for vector in model.positive] + if model.positive is not None + else None + ), + negative=( + [cls.convert_vector_input(vector) for vector in model.negative] + if model.negative is not None + else None + ), + strategy=( + cls.convert_recommend_strategy(model.strategy) + if model.strategy is not None + else None + ), + ) + + @classmethod + def convert_context_input_pair(cls, model: rest.ContextPair) -> grpc.ContextInputPair: + return grpc.ContextInputPair( + positive=cls.convert_vector_input(model.positive), + negative=cls.convert_vector_input(model.negative), + ) + + @classmethod + def convert_context_input(cls, model: rest.ContextInput) -> grpc.ContextInput: + if isinstance(model, list): + return grpc.ContextInput( + pairs=[cls.convert_context_input_pair(pair) for pair in model] + ) + if isinstance(model, rest.ContextPair): + return grpc.ContextInput(pairs=[cls.convert_context_input_pair(model)]) + + raise ValueError(f"invalid ContextInput model: {model}") # pragma: no cover + + @classmethod + def convert_discover_input(cls, model: rest.DiscoverInput) -> grpc.DiscoverInput: + return grpc.DiscoverInput( + target=cls.convert_vector_input(model.target), + context=cls.convert_context_input(model.context), + ) + + @classmethod + def convert_fusion(cls, model: rest.Fusion) -> grpc.Fusion: + if model == rest.Fusion.RRF: + return grpc.Fusion.RRF + + if model == rest.Fusion.DBSF: + return grpc.Fusion.DBSF + + raise ValueError(f"invalid Fusion model: {model}") # pragma: no cover + + @classmethod + def convert_sample(cls, model: rest.Sample) -> grpc.Sample: + if model == rest.Sample.RANDOM: + return grpc.Sample.Random + + raise ValueError(f"invalid Sample model: {model}") # pragma: no cover + + @classmethod + def convert_mmr(cls, model: rest.Mmr) -> grpc.Mmr: + return grpc.Mmr(diversity=model.diversity, candidates_limit=model.candidates_limit) + + @classmethod + def convert_query(cls, model: rest.Query) -> grpc.Query: + if isinstance(model, rest.NearestQuery): + if model.mmr is not None: + nearest_with_mmr = grpc.NearestInputWithMmr( + nearest=cls.convert_vector_input(model.nearest), mmr=cls.convert_mmr(model.mmr) + ) + return grpc.Query(nearest_with_mmr=nearest_with_mmr) + + return grpc.Query(nearest=cls.convert_vector_input(model.nearest)) + + if isinstance(model, rest.RecommendQuery): + return grpc.Query(recommend=cls.convert_recommend_input(model.recommend)) + + if isinstance(model, rest.DiscoverQuery): + return grpc.Query(discover=cls.convert_discover_input(model.discover)) + + if isinstance(model, rest.ContextQuery): + return grpc.Query(context=cls.convert_context_input(model.context)) + + if isinstance(model, rest.OrderByQuery): + return grpc.Query(order_by=cls.convert_order_by_interface(model.order_by)) + + if isinstance(model, rest.FusionQuery): + return grpc.Query(fusion=cls.convert_fusion(model.fusion)) + + if isinstance(model, rest.SampleQuery): + return grpc.Query(sample=cls.convert_sample(model.sample)) + + if isinstance(model, rest.FormulaQuery): + return grpc.Query(formula=cls.convert_formula_query(model)) + + raise ValueError(f"invalid Query model: {model}") # pragma: no cover + + @classmethod + def convert_formula_query(cls, model: rest.FormulaQuery) -> grpc.Formula: + defaults = payload_to_grpc(model.defaults) if model.defaults is not None else None + expression = cls.convert_expression(model.formula) + return grpc.Formula(defaults=defaults, expression=expression) + + @classmethod + def convert_expression(cls, model: rest.Expression) -> grpc.Expression: + if isinstance(model, float): + return grpc.Expression(constant=model) + if isinstance(model, str): + return grpc.Expression(variable=model) + if isinstance(model, get_args_subscribed(rest.Condition)): + return grpc.Expression(condition=cls.convert_condition(model)) + if isinstance(model, rest.DatetimeExpression): + return grpc.Expression(datetime=model.datetime) + if isinstance(model, rest.DatetimeKeyExpression): + return grpc.Expression(datetime_key=model.datetime_key) + if isinstance(model, rest.NegExpression): + return grpc.Expression(neg=cls.convert_expression(model.neg)) + if isinstance(model, rest.SumExpression): + return grpc.Expression(sum=cls.convert_sum_expression(model)) + if isinstance(model, rest.MultExpression): + return grpc.Expression(mult=cls.convert_mult_expression(model)) + if isinstance(model, rest.DivExpression): + return grpc.Expression(div=cls.convert_div_expression(model)) + if isinstance(model, rest.PowExpression): + return grpc.Expression(pow=cls.convert_pow_expression(model)) + if isinstance(model, rest.Log10Expression): + return grpc.Expression(log10=cls.convert_expression(model.log10)) + if isinstance(model, rest.LnExpression): + return grpc.Expression(ln=cls.convert_expression(model.ln)) + if isinstance(model, rest.AbsExpression): + return grpc.Expression(abs=cls.convert_expression(model.abs)) + if isinstance(model, rest.SqrtExpression): + return grpc.Expression(sqrt=cls.convert_expression(model.sqrt)) + if isinstance(model, rest.ExpExpression): + return grpc.Expression(exp=cls.convert_expression(model.exp)) + if isinstance(model, rest.GeoDistance): + return grpc.Expression(geo_distance=cls.convert_geo_distance(model)) + if isinstance(model, rest.LinDecayExpression): + return grpc.Expression(lin_decay=cls.convert_decay_params_expression(model.lin_decay)) + if isinstance(model, rest.ExpDecayExpression): + return grpc.Expression(exp_decay=cls.convert_decay_params_expression(model.exp_decay)) + if isinstance(model, rest.GaussDecayExpression): + return grpc.Expression( + gauss_decay=cls.convert_decay_params_expression(model.gauss_decay) + ) + + raise ValueError(f"invalid Expression model: {model}") # pragma: no cover + + @classmethod + def convert_sum_expression(cls, model: rest.SumExpression) -> grpc.SumExpression: + return grpc.SumExpression(sum=[cls.convert_expression(expr) for expr in model.sum]) + + @classmethod + def convert_mult_expression(cls, model: rest.MultExpression) -> grpc.MultExpression: + return grpc.MultExpression(mult=[cls.convert_expression(expr) for expr in model.mult]) + + @classmethod + def convert_div_expression(cls, model: rest.DivExpression) -> grpc.DivExpression: + return grpc.DivExpression( + left=cls.convert_expression(model.div.left), + right=cls.convert_expression(model.div.right), + by_zero_default=model.div.by_zero_default, + ) + + @classmethod + def convert_pow_expression(cls, model: rest.PowExpression) -> grpc.PowExpression: + return grpc.PowExpression( + base=cls.convert_expression(model.pow.base), + exponent=cls.convert_expression(model.pow.exponent), + ) + + @classmethod + def convert_geo_distance(cls, model: rest.GeoDistance) -> grpc.GeoDistance: + return grpc.GeoDistance( + origin=cls.convert_geo_point(model.geo_distance.origin), + to=model.geo_distance.to, + ) + + @classmethod + def convert_decay_params_expression( + cls, model: rest.DecayParamsExpression + ) -> grpc.DecayParamsExpression: + return grpc.DecayParamsExpression( + x=cls.convert_expression(model.x), + target=cls.convert_expression(model.target) if model.target is not None else None, + midpoint=model.midpoint, + scale=model.scale, + ) + + @classmethod + def convert_query_interface(cls, model: rest.QueryInterface) -> grpc.Query: + if isinstance(model, get_args_subscribed(rest.VectorInput)): + return grpc.Query(nearest=cls.convert_vector_input(model)) + + if isinstance(model, get_args(rest.Query)): + return cls.convert_query(model) + + raise ValueError(f"invalid QueryInterface: {model}") # pragma: no cover + + @classmethod + def convert_prefetch_query(cls, model: rest.Prefetch) -> grpc.PrefetchQuery: + prefetch = None + if isinstance(model.prefetch, rest.Prefetch): + prefetch = [cls.convert_prefetch_query(model.prefetch)] + elif isinstance(model.prefetch, list): + prefetch = [cls.convert_prefetch_query(prefetch) for prefetch in model.prefetch] + + return grpc.PrefetchQuery( + prefetch=prefetch, + query=cls.convert_query_interface(model.query) if model.query is not None else None, + using=model.using if model.using is not None else None, + filter=cls.convert_filter(model.filter) if model.filter is not None else None, + params=cls.convert_search_params(model.params) if model.params is not None else None, + score_threshold=model.score_threshold, + limit=model.limit if model.limit is not None else None, + lookup_from=( + cls.convert_lookup_location(model.lookup_from) + if model.lookup_from is not None + else None + ), + ) + + @classmethod + def convert_search_request( + cls, model: rest.SearchRequest, collection_name: str + ) -> grpc.SearchPoints: + vector, sparse_indices, name = cls.convert_named_vector_struct(model.vector) + + return grpc.SearchPoints( + collection_name=collection_name, + vector=vector, + sparse_indices=sparse_indices, + filter=cls.convert_filter(model.filter) if model.filter is not None else None, + limit=model.limit, + with_payload=( + cls.convert_with_payload_interface(model.with_payload) + if model.with_payload is not None + else None + ), + params=cls.convert_search_params(model.params) if model.params is not None else None, + score_threshold=model.score_threshold, + offset=model.offset, + vector_name=name, + with_vectors=( + cls.convert_with_vectors(model.with_vector) + if model.with_vector is not None + else None + ), + shard_key_selector=( + cls.convert_shard_key_selector(model.shard_key) if model.shard_key else None + ), + ) + + @classmethod + def convert_search_points( + cls, model: rest.SearchRequest, collection_name: str + ) -> grpc.SearchPoints: + return cls.convert_search_request(model, collection_name) + + @classmethod + def convert_query_request( + cls, model: rest.QueryRequest, collection_name: str + ) -> grpc.QueryPoints: + prefetch = ( + [model.prefetch] if isinstance(model.prefetch, rest.Prefetch) else model.prefetch + ) + return grpc.QueryPoints( + collection_name=collection_name, + prefetch=( + [cls.convert_prefetch_query(p) for p in prefetch] + if model.prefetch is not None + else None + ), + query=cls.convert_query_interface(model.query) if model.query is not None else None, + using=model.using, + filter=cls.convert_filter(model.filter) if model.filter is not None else None, + params=cls.convert_search_params(model.params) if model.params is not None else None, + score_threshold=model.score_threshold, + limit=model.limit, + offset=model.offset, + with_vectors=( + cls.convert_with_vectors(model.with_vector) + if model.with_vector is not None + else None + ), + with_payload=( + cls.convert_with_payload_interface(model.with_payload) + if model.with_payload is not None + else None + ), + shard_key_selector=( + cls.convert_shard_key_selector(model.shard_key) + if model.shard_key is not None + else None + ), + lookup_from=( + cls.convert_lookup_location(model.lookup_from) + if model.lookup_from is not None + else None + ), + ) + + @classmethod + def convert_query_points( + cls, model: rest.QueryRequest, collection_name: str + ) -> grpc.QueryPoints: + return cls.convert_query_request(model, collection_name) + + @classmethod + def convert_recommend_request( + cls, model: rest.RecommendRequest, collection_name: str + ) -> grpc.RecommendPoints: + positive_ids = cls.convert_recommend_examples_to_ids(model.positive) + negative_ids = cls.convert_recommend_examples_to_ids(model.negative) + + positive_vectors = cls.convert_recommend_examples_to_vectors(model.positive) + negative_vectors = cls.convert_recommend_examples_to_vectors(model.negative) + + return grpc.RecommendPoints( + collection_name=collection_name, + positive=positive_ids, + negative=negative_ids, + filter=cls.convert_filter(model.filter) if model.filter is not None else None, + limit=model.limit, + with_payload=( + cls.convert_with_payload_interface(model.with_payload) + if model.with_payload is not None + else None + ), + params=cls.convert_search_params(model.params) if model.params is not None else None, + score_threshold=model.score_threshold, + offset=model.offset, + with_vectors=( + cls.convert_with_vectors(model.with_vector) + if model.with_vector is not None + else None + ), + using=model.using, + lookup_from=( + cls.convert_lookup_location(model.lookup_from) + if model.lookup_from is not None + else None + ), + strategy=( + cls.convert_recommend_strategy(model.strategy) + if model.strategy is not None + else None + ), + positive_vectors=positive_vectors, + negative_vectors=negative_vectors, + shard_key_selector=( + cls.convert_shard_key_selector(model.shard_key) if model.shard_key else None + ), + ) + + @classmethod + def convert_discover_points( + cls, model: rest.DiscoverRequest, collection_name: str + ) -> grpc.DiscoverPoints: + return cls.convert_discover_request(model, collection_name) + + @classmethod + def convert_discover_request( + cls, model: rest.DiscoverRequest, collection_name: str + ) -> grpc.DiscoverPoints: + target = cls.convert_target_vector(model.target) if model.target is not None else None + + context = ( + [cls.convert_context_example_pair(pair) for pair in model.context] + if model.context is not None + else None + ) + + query_filter = None if model.filter is None else cls.convert_filter(model=model.filter) + + search_params = None if model.params is None else cls.convert_search_params(model.params) + + with_payload = ( + None + if model.with_payload is None + else cls.convert_with_payload_interface(model.with_payload) + ) + + with_vectors = ( + None if model.with_vector is None else cls.convert_with_vectors(model.with_vector) + ) + + lookup_from = ( + None if model.lookup_from is None else cls.convert_lookup_location(model.lookup_from) + ) + + shard_key_selector = ( + None if model.shard_key is None else cls.convert_shard_key_selector(model.shard_key) + ) + + return grpc.DiscoverPoints( + collection_name=collection_name, + target=target, + context=context, + filter=query_filter, + limit=model.limit, + offset=model.offset, + with_vectors=with_vectors, + with_payload=with_payload, + params=search_params, + using=model.using, + lookup_from=lookup_from, + shard_key_selector=shard_key_selector, + ) + + @classmethod + def convert_recommend_points( + cls, model: rest.RecommendRequest, collection_name: str + ) -> grpc.RecommendPoints: + return cls.convert_recommend_request(model, collection_name) + + @classmethod + def convert_tokenizer_type(cls, model: rest.TokenizerType) -> grpc.TokenizerType: + if model == rest.TokenizerType.WORD: + return grpc.TokenizerType.Word + elif model == rest.TokenizerType.WHITESPACE: + return grpc.TokenizerType.Whitespace + elif model == rest.TokenizerType.PREFIX: + return grpc.TokenizerType.Prefix + elif model == rest.TokenizerType.MULTILINGUAL: + return grpc.TokenizerType.Multilingual + else: + raise ValueError(f"invalid TokenizerType model: {model}") # pragma: no cover + + @classmethod + def convert_text_index_params(cls, model: rest.TextIndexParams) -> grpc.TextIndexParams: + return grpc.TextIndexParams( + tokenizer=( + cls.convert_tokenizer_type(model.tokenizer) + if model.tokenizer is not None + else None + ), + lowercase=model.lowercase, + min_token_len=model.min_token_len, + max_token_len=model.max_token_len, + on_disk=model.on_disk, + stopwords=cls.convert_stopwords(model.stopwords) + if model.stopwords is not None + else None, + phrase_matching=model.phrase_matching, + stemmer=cls.convert_stemmer(model.stemmer) if model.stemmer is not None else None, + ) + + @classmethod + def convert_stopwords(cls, model: rest.StopwordsInterface) -> grpc.StopwordsSet: + if isinstance(model, rest.Language): + return grpc.StopwordsSet(languages=[model.value]) + + if isinstance(model, rest.StopwordsSet): + return grpc.StopwordsSet( + languages=[lang for lang in model.languages] if model.languages else None, + custom=model.custom, + ) + + raise ValueError(f"invalid StopwordsInterface model: {model}") # pragma: no cover + + @classmethod + def convert_stemmer(cls, model: rest.StemmingAlgorithm) -> grpc.StemmingAlgorithm: + if isinstance(model, rest.SnowballParams): + return grpc.StemmingAlgorithm(snowball=grpc.SnowballParams(language=model.language)) + + raise ValueError(f"invalid StemmingAlgorithm model: {model}") # pragma: no cover + + @classmethod + def convert_integer_index_params( + cls, model: rest.IntegerIndexParams + ) -> grpc.IntegerIndexParams: + return grpc.IntegerIndexParams( + lookup=model.lookup, + range=model.range, + is_principal=model.is_principal, + on_disk=model.on_disk, + ) + + @classmethod + def convert_keyword_index_params( + cls, model: rest.KeywordIndexParams + ) -> grpc.KeywordIndexParams: + return grpc.KeywordIndexParams(is_tenant=model.is_tenant, on_disk=model.on_disk) + + @classmethod + def convert_float_index_params(cls, model: rest.FloatIndexParams) -> grpc.FloatIndexParams: + return grpc.FloatIndexParams(is_principal=model.is_principal, on_disk=model.on_disk) + + @classmethod + def convert_geo_index_params(cls, model: rest.GeoIndexParams) -> grpc.GeoIndexParams: + return grpc.GeoIndexParams(on_disk=model.on_disk) + + @classmethod + def convert_bool_index_params(cls, model: rest.BoolIndexParams) -> grpc.BoolIndexParams: + return grpc.BoolIndexParams(on_disk=model.on_disk) + + @classmethod + def convert_datetime_index_params( + cls, model: rest.DatetimeIndexParams + ) -> grpc.DatetimeIndexParams: + return grpc.DatetimeIndexParams(is_principal=model.is_principal, on_disk=model.on_disk) + + @classmethod + def convert_uuid_index_params(cls, model: rest.UuidIndexParams) -> grpc.UuidIndexParams: + return grpc.UuidIndexParams(is_tenant=model.is_tenant, on_disk=model.on_disk) + + @classmethod + def convert_collection_params_diff( + cls, model: rest.CollectionParamsDiff + ) -> grpc.CollectionParamsDiff: + return grpc.CollectionParamsDiff( + replication_factor=model.replication_factor, + write_consistency_factor=model.write_consistency_factor, + on_disk_payload=model.on_disk_payload, + read_fan_out_factor=model.read_fan_out_factor, + ) + + @classmethod + def convert_lookup_location(cls, model: rest.LookupLocation) -> grpc.LookupLocation: + return grpc.LookupLocation( + collection_name=model.collection, + vector_name=model.vector, + ) + + @classmethod + def convert_read_consistency(cls, model: rest.ReadConsistency) -> grpc.ReadConsistency: + if isinstance(model, int): + return grpc.ReadConsistency( + factor=model, + ) + elif isinstance(model, rest.ReadConsistencyType): + return grpc.ReadConsistency( + type=cls.convert_read_consistency_type(model), + ) + else: + raise ValueError(f"invalid ReadConsistency model: {model}") # pragma: no cover + + @classmethod + def convert_read_consistency_type( + cls, model: rest.ReadConsistencyType + ) -> grpc.ReadConsistencyType: + if model == rest.ReadConsistencyType.MAJORITY: + return grpc.ReadConsistencyType.Majority + elif model == rest.ReadConsistencyType.ALL: + return grpc.ReadConsistencyType.All + elif model == rest.ReadConsistencyType.QUORUM: + return grpc.ReadConsistencyType.Quorum + else: + raise ValueError(f"invalid ReadConsistencyType model: {model}") # pragma: no cover + + @classmethod + def convert_write_ordering(cls, model: rest.WriteOrdering) -> grpc.WriteOrdering: + if model == rest.WriteOrdering.WEAK: + return grpc.WriteOrdering(type=grpc.WriteOrderingType.Weak) + elif model == rest.WriteOrdering.MEDIUM: + return grpc.WriteOrdering(type=grpc.WriteOrderingType.Medium) + elif model == rest.WriteOrdering.STRONG: + return grpc.WriteOrdering(type=grpc.WriteOrderingType.Strong) + else: + raise ValueError(f"invalid WriteOrdering model: {model}") # pragma: no cover + + @classmethod + def convert_scalar_quantization_config( + cls, model: rest.ScalarQuantizationConfig + ) -> grpc.ScalarQuantization: + return grpc.ScalarQuantization( + type=grpc.QuantizationType.Int8, + quantile=model.quantile, + always_ram=model.always_ram, + ) + + @classmethod + def convert_product_quantization_config( + cls, model: rest.ProductQuantizationConfig + ) -> grpc.ProductQuantization: + return grpc.ProductQuantization( + compression=cls.convert_compression_ratio(model.compression), + always_ram=model.always_ram, + ) + + @classmethod + def convert_binary_quantization_config( + cls, model: rest.BinaryQuantizationConfig + ) -> grpc.BinaryQuantization: + return grpc.BinaryQuantization( + always_ram=model.always_ram, + encoding=cls.convert_binary_quantization_encoding(model.encoding) + if model.encoding is not None + else None, + query_encoding=cls.convert_binary_quantization_query_encoding(model.query_encoding) + if model.query_encoding is not None + else None, + ) + + @classmethod + def convert_binary_quantization_encoding( + cls, model: rest.BinaryQuantizationEncoding + ) -> grpc.BinaryQuantizationEncoding: + if model == rest.BinaryQuantizationEncoding.ONE_BIT: + return grpc.BinaryQuantizationEncoding.OneBit + + if model == rest.BinaryQuantizationEncoding.TWO_BITS: + return grpc.BinaryQuantizationEncoding.TwoBits + + if model == rest.BinaryQuantizationEncoding.ONE_AND_HALF_BITS: + return grpc.BinaryQuantizationEncoding.OneAndHalfBits + + raise ValueError(f"invalid BinaryQuantizationEncoding model: {model}") # pragma: no cover + + @classmethod + def convert_binary_quantization_query_encoding( + cls, model: rest.BinaryQuantizationQueryEncoding + ) -> grpc.BinaryQuantizationQueryEncoding: + if model == rest.BinaryQuantizationQueryEncoding.DEFAULT: + return grpc.BinaryQuantizationQueryEncoding( + setting=grpc.BinaryQuantizationQueryEncoding.Setting.Default + ) + + if model == rest.BinaryQuantizationQueryEncoding.BINARY: + return grpc.BinaryQuantizationQueryEncoding( + setting=grpc.BinaryQuantizationQueryEncoding.Setting.Binary + ) + + if model == rest.BinaryQuantizationQueryEncoding.SCALAR4BITS: + return grpc.BinaryQuantizationQueryEncoding( + setting=grpc.BinaryQuantizationQueryEncoding.Setting.Scalar4Bits + ) + + if model == rest.BinaryQuantizationQueryEncoding.SCALAR8BITS: + return grpc.BinaryQuantizationQueryEncoding( + setting=grpc.BinaryQuantizationQueryEncoding.Setting.Scalar8Bits + ) + + raise ValueError( + f"invalid BinaryQuantizationQueryEncoding model: {model}" + ) # pragma: no cover + + @classmethod + def convert_compression_ratio(cls, model: rest.CompressionRatio) -> grpc.CompressionRatio: + if model == rest.CompressionRatio.X4: + return grpc.CompressionRatio.x4 + elif model == rest.CompressionRatio.X8: + return grpc.CompressionRatio.x8 + elif model == rest.CompressionRatio.X16: + return grpc.CompressionRatio.x16 + elif model == rest.CompressionRatio.X32: + return grpc.CompressionRatio.x32 + elif model == rest.CompressionRatio.X64: + return grpc.CompressionRatio.x64 + else: + raise ValueError(f"invalid CompressionRatio model: {model}") # pragma: no cover + + @classmethod + def convert_quantization_config( + cls, model: rest.QuantizationConfig + ) -> grpc.QuantizationConfig: + if isinstance(model, rest.ScalarQuantization): + return grpc.QuantizationConfig( + scalar=cls.convert_scalar_quantization_config(model.scalar) + ) + if isinstance(model, rest.ProductQuantization): + return grpc.QuantizationConfig( + product=cls.convert_product_quantization_config(model.product) + ) + if isinstance(model, rest.BinaryQuantization): + return grpc.QuantizationConfig( + binary=cls.convert_binary_quantization_config(model.binary) + ) + else: + raise ValueError(f"invalid QuantizationConfig model: {model}") # pragma: no cover + + @classmethod + def convert_quantization_search_params( + cls, model: rest.QuantizationSearchParams + ) -> grpc.QuantizationSearchParams: + return grpc.QuantizationSearchParams( + ignore=model.ignore, + rescore=model.rescore, + oversampling=model.oversampling, + ) + + @classmethod + def convert_point_vectors(cls, model: rest.PointVectors) -> grpc.PointVectors: + return grpc.PointVectors( + id=cls.convert_extended_point_id(model.id), + vectors=cls.convert_vector_struct(model.vector), + ) + + @classmethod + def convert_groups_result(cls, model: rest.GroupsResult) -> grpc.GroupsResult: + return grpc.GroupsResult( + groups=[cls.convert_point_group(group) for group in model.groups], + ) + + @classmethod + def convert_point_group(cls, model: rest.PointGroup) -> grpc.PointGroup: + return grpc.PointGroup( + id=cls.convert_group_id(model.id), + hits=[cls.convert_scored_point(point) for point in model.hits], + lookup=cls.convert_record(model.lookup) if model.lookup is not None else None, + ) + + @classmethod + def convert_group_id(cls, model: rest.GroupId) -> grpc.GroupId: + if isinstance(model, str): + return grpc.GroupId( + string_value=model, + ) + elif isinstance(model, int): + if model >= 0: + return grpc.GroupId( + unsigned_value=model, + ) + else: + return grpc.GroupId( + integer_value=model, + ) + else: + raise ValueError(f"invalid GroupId model: {model}") # pragma: no cover + + @classmethod + def convert_with_lookup(cls, model: rest.WithLookup) -> grpc.WithLookup: + return grpc.WithLookup( + collection=model.collection, + with_vectors=( + cls.convert_with_vectors(model.with_vectors) + if model.with_vectors is not None + else None + ), + with_payload=( + cls.convert_with_payload_interface(model.with_payload) + if model.with_payload is not None + else None + ), + ) + + @classmethod + def convert_quantization_config_diff( + cls, model: rest.QuantizationConfigDiff + ) -> grpc.QuantizationConfigDiff: + if isinstance(model, rest.ScalarQuantization): + return grpc.QuantizationConfigDiff( + scalar=cls.convert_scalar_quantization_config(model.scalar) + ) + if isinstance(model, rest.ProductQuantization): + return grpc.QuantizationConfigDiff( + product=cls.convert_product_quantization_config(model.product) + ) + if isinstance(model, rest.BinaryQuantization): + return grpc.QuantizationConfigDiff( + binary=cls.convert_binary_quantization_config(model.binary) + ) + if model == rest.Disabled.DISABLED: + return grpc.QuantizationConfigDiff( + disabled=grpc.Disabled(), + ) + else: + raise ValueError(f"invalid QuantizationConfigDiff model: {model}") # pragma: no cover + + @classmethod + def convert_vector_params_diff(cls, model: rest.VectorParamsDiff) -> grpc.VectorParamsDiff: + return grpc.VectorParamsDiff( + hnsw_config=( + cls.convert_hnsw_config_diff(model.hnsw_config) + if model.hnsw_config is not None + else None + ), + quantization_config=( + cls.convert_quantization_config_diff(model.quantization_config) + if model.quantization_config is not None + else None + ), + on_disk=model.on_disk, + ) + + @classmethod + def convert_vectors_config_diff(cls, model: rest.VectorsConfigDiff) -> grpc.VectorsConfigDiff: + if isinstance(model, dict) and len(model) == 1 and "" in model: + return grpc.VectorsConfigDiff(params=cls.convert_vector_params_diff(model[""])) + elif isinstance(model, dict): + return grpc.VectorsConfigDiff( + params_map=grpc.VectorParamsDiffMap( + map=dict( + (key, cls.convert_vector_params_diff(val)) for key, val in model.items() + ) + ) + ) + else: + raise ValueError(f"invalid VectorsConfigDiff model: {model}") # pragma: no cover + + @classmethod + def convert_point_insert_operation( + cls, model: rest.PointInsertOperations + ) -> list[grpc.PointStruct]: + if isinstance(model, rest.PointsBatch): + vectors_batch: list[grpc.Vectors] = cls.convert_batch_vector_struct( + model.batch.vectors, len(model.batch.ids) + ) + return [ + grpc.PointStruct( + id=RestToGrpc.convert_extended_point_id(model.batch.ids[idx]), + vectors=vectors_batch[idx], + payload=( + RestToGrpc.convert_payload(model.batch.payloads[idx]) + if model.batch.payloads is not None + else None + ), + ) + for idx in range(len(model.batch.ids)) + ] + elif isinstance(model, rest.PointsList): + return [cls.convert_point_struct(point) for point in model.points] + else: + raise ValueError(f"invalid PointInsertOperations model: {model}") # pragma: no cover + + @classmethod + def convert_update_operation(cls, model: rest.UpdateOperation) -> grpc.PointsUpdateOperation: + return cls.convert_points_update_operation(model) + + @classmethod + def convert_points_update_operation( + cls, model: rest.UpdateOperation + ) -> grpc.PointsUpdateOperation: + if isinstance(model, rest.UpsertOperation): + shard_key_selector = ( + cls.convert_shard_key_selector(model.upsert.shard_key) + if model.upsert.shard_key + else None + ) + return grpc.PointsUpdateOperation( + upsert=grpc.PointsUpdateOperation.PointStructList( + points=cls.convert_point_insert_operation(model.upsert), + shard_key_selector=shard_key_selector, + ) + ) + elif isinstance(model, rest.DeleteOperation): + shard_key_selector = ( + cls.convert_shard_key_selector(model.delete.shard_key) + if model.delete.shard_key + else None + ) + points_selector = cls.convert_points_selector(model.delete) + delete_points = grpc.PointsUpdateOperation.DeletePoints( + points=points_selector, + shard_key_selector=shard_key_selector, + ) + return grpc.PointsUpdateOperation( + delete_points=delete_points, + ) + elif isinstance(model, rest.SetPayloadOperation): + if model.set_payload.points: + points_selector = rest.PointIdsList(points=model.set_payload.points) + elif model.set_payload.filter: + points_selector = rest.FilterSelector(filter=model.set_payload.filter) + else: + raise ValueError(f"invalid SetPayloadOperation model: {model}") # pragma: no cover + + shard_key_selector = ( + cls.convert_shard_key_selector(model.set_payload.shard_key) + if model.set_payload.shard_key + else None + ) + + return grpc.PointsUpdateOperation( + set_payload=grpc.PointsUpdateOperation.SetPayload( + payload=cls.convert_payload(model.set_payload.payload), + points_selector=cls.convert_points_selector(points_selector), + shard_key_selector=shard_key_selector, + key=model.set_payload.key, + ) + ) + elif isinstance(model, rest.OverwritePayloadOperation): + if model.overwrite_payload.points: + points_selector = rest.PointIdsList(points=model.overwrite_payload.points) + elif model.overwrite_payload.filter: + points_selector = rest.FilterSelector(filter=model.overwrite_payload.filter) + else: + raise ValueError( + f"invalid OverwritePayloadOperation model: {model}" + ) # pragma: no cover + + shard_key_selector = ( + cls.convert_shard_key_selector(model.overwrite_payload.shard_key) + if model.overwrite_payload.shard_key + else None + ) + + return grpc.PointsUpdateOperation( + overwrite_payload=grpc.PointsUpdateOperation.OverwritePayload( + payload=cls.convert_payload(model.overwrite_payload.payload), + points_selector=cls.convert_points_selector(points_selector), + shard_key_selector=shard_key_selector, + key=model.overwrite_payload.key, + ) + ) + elif isinstance(model, rest.DeletePayloadOperation): + if model.delete_payload.points: + points_selector = rest.PointIdsList(points=model.delete_payload.points) + elif model.delete_payload.filter: + points_selector = rest.FilterSelector(filter=model.delete_payload.filter) + else: + raise ValueError( + f"invalid DeletePayloadOperation model: {model}" + ) # pragma: no cover + + shard_key_selector = ( + cls.convert_shard_key_selector(model.delete_payload.shard_key) + if model.delete_payload.shard_key + else None + ) + + return grpc.PointsUpdateOperation( + delete_payload=grpc.PointsUpdateOperation.DeletePayload( + keys=model.delete_payload.keys, + points_selector=cls.convert_points_selector(points_selector), + shard_key_selector=shard_key_selector, + ) + ) + elif isinstance(model, rest.ClearPayloadOperation): + shard_key_selector = ( + cls.convert_shard_key_selector(model.clear_payload.shard_key) + if model.clear_payload.shard_key + else None + ) + points_selector = cls.convert_points_selector(model.clear_payload) + clear_payload = grpc.PointsUpdateOperation.ClearPayload( + points=points_selector, + shard_key_selector=shard_key_selector, + ) + return grpc.PointsUpdateOperation( + clear_payload=clear_payload, + ) + elif isinstance(model, rest.UpdateVectorsOperation): + shard_key_selector = ( + cls.convert_shard_key_selector(model.update_vectors.shard_key) + if model.update_vectors.shard_key + else None + ) + + return grpc.PointsUpdateOperation( + update_vectors=grpc.PointsUpdateOperation.UpdateVectors( + points=[ + cls.convert_point_vectors(point) for point in model.update_vectors.points + ], + shard_key_selector=shard_key_selector, + ) + ) + elif isinstance(model, rest.DeleteVectorsOperation): + if model.delete_vectors.points: + points_selector = rest.PointIdsList(points=model.delete_vectors.points) + elif model.delete_vectors.filter: + points_selector = rest.FilterSelector(filter=model.delete_vectors.filter) + else: + raise ValueError( + f"invalid DeletePayloadOperation model: {model}" + ) # pragma: no cover + + shard_key_selector = ( + cls.convert_shard_key_selector(model.delete_vectors.shard_key) + if model.delete_vectors.shard_key + else None + ) + + return grpc.PointsUpdateOperation( + delete_vectors=grpc.PointsUpdateOperation.DeleteVectors( + points_selector=cls.convert_points_selector(points_selector), + vectors=grpc.VectorsSelector(names=model.delete_vectors.vector), + shard_key_selector=shard_key_selector, + ) + ) + else: + raise ValueError(f"invalid UpdateOperation model: {model}") # pragma: no cover + + @classmethod + def convert_init_from(cls, model: rest.InitFrom) -> str: + if isinstance(model, rest.InitFrom): + return model.collection + else: + raise ValueError(f"invalid InitFrom model: {model}") # pragma: no cover + + @classmethod + def convert_recommend_strategy(cls, model: rest.RecommendStrategy) -> grpc.RecommendStrategy: + if model == rest.RecommendStrategy.AVERAGE_VECTOR: + return grpc.RecommendStrategy.AverageVector + elif model == rest.RecommendStrategy.BEST_SCORE: + return grpc.RecommendStrategy.BestScore + elif model == rest.RecommendStrategy.SUM_SCORES: + return grpc.RecommendStrategy.SumScores + else: + raise ValueError(f"invalid RecommendStrategy model: {model}") # pragma: no cover + + @classmethod + def convert_sparse_index_params(cls, model: rest.SparseIndexParams) -> grpc.SparseIndexConfig: + return grpc.SparseIndexConfig( + full_scan_threshold=( + model.full_scan_threshold if model.full_scan_threshold is not None else None + ), + on_disk=model.on_disk if model.on_disk is not None else None, + datatype=cls.convert_datatype(model.datatype) if model.datatype is not None else None, + ) + + @classmethod + def convert_modifier(cls, model: rest.Modifier) -> grpc.Modifier: + if model == rest.Modifier.IDF: + return grpc.Modifier.Idf + elif model == rest.Modifier.NONE: + return getattr(grpc.Modifier, "None") + else: + raise ValueError(f"invalid Modifier model: {model}") # pragma: no cover + + @classmethod + def convert_sparse_vector_params( + cls, model: rest.SparseVectorParams + ) -> grpc.SparseVectorParams: + return grpc.SparseVectorParams( + index=( + cls.convert_sparse_index_params(model.index) if model.index is not None else None + ), + modifier=( + cls.convert_modifier(model.modifier) if model.modifier is not None else None + ), + ) + + @classmethod + def convert_sparse_vector_config( + cls, model: Mapping[str, rest.SparseVectorParams] + ) -> grpc.SparseVectorConfig: + return grpc.SparseVectorConfig( + map=dict((key, cls.convert_sparse_vector_params(val)) for key, val in model.items()) + ) + + @classmethod + def convert_shard_key(cls, model: rest.ShardKey) -> grpc.ShardKey: + if isinstance(model, int): + return grpc.ShardKey(number=model) + if isinstance(model, str): + return grpc.ShardKey(keyword=model) + + raise ValueError(f"invalid ShardKey model: {model}") # pragma: no cover + + @classmethod + def convert_shard_key_selector(cls, model: rest.ShardKeySelector) -> grpc.ShardKeySelector: + if isinstance(model, get_args_subscribed(rest.ShardKey)): + return grpc.ShardKeySelector(shard_keys=[cls.convert_shard_key(model)]) + + if isinstance(model, list): + return grpc.ShardKeySelector(shard_keys=[cls.convert_shard_key(key) for key in model]) + + raise ValueError(f"invalid ShardKeySelector model: {model}") # pragma: no cover + + @classmethod + def convert_sharding_method(cls, model: rest.ShardingMethod) -> grpc.ShardingMethod: + if model == rest.ShardingMethod.AUTO: + return grpc.Auto + elif model == rest.ShardingMethod.CUSTOM: + return grpc.Custom + else: + raise ValueError(f"invalid ShardingMethod model: {model}") # pragma: no cover + + @classmethod + def convert_health_check_reply(cls, model: rest.VersionInfo) -> grpc.HealthCheckReply: + return grpc.HealthCheckReply( + title=model.title, + version=model.version, + commit=model.commit, + ) + + @classmethod + def convert_search_matrix_pair(cls, model: rest.SearchMatrixPair) -> grpc.SearchMatrixPair: + return grpc.SearchMatrixPair( + a=cls.convert_extended_point_id(model.a), + b=cls.convert_extended_point_id(model.b), + score=model.score, + ) + + @classmethod + def convert_search_matrix_pairs( + cls, model: rest.SearchMatrixPairsResponse + ) -> grpc.SearchMatrixPairs: + return grpc.SearchMatrixPairs( + pairs=[cls.convert_search_matrix_pair(pair) for pair in model.pairs], + ) + + @classmethod + def convert_search_matrix_offsets( + cls, model: rest.SearchMatrixOffsetsResponse + ) -> grpc.SearchMatrixOffsets: + return grpc.SearchMatrixOffsets( + offsets_row=list(model.offsets_row), + offsets_col=list(model.offsets_col), + scores=list(model.scores), + ids=[cls.convert_extended_point_id(p_id) for p_id in model.ids], + ) + + @classmethod + def convert_strict_mode_multivector( + cls, model: rest.StrictModeMultivector + ) -> grpc.StrictModeMultivector: + return grpc.StrictModeMultivector( + max_vectors=model.max_vectors, + ) + + @classmethod + def convert_strict_mode_multivector_config( + cls, model: rest.StrictModeMultivectorConfig + ) -> grpc.StrictModeMultivectorConfig: + return grpc.StrictModeMultivectorConfig( + multivector_config=dict( + (key, cls.convert_strict_mode_multivector(val)) for key, val in model.items() + ) + ) + + @classmethod + def convert_strict_mode_sparse(cls, model: rest.StrictModeSparse) -> grpc.StrictModeSparse: + return grpc.StrictModeSparse( + max_length=model.max_length, + ) + + @classmethod + def convert_strict_mode_sparse_config( + cls, model: rest.StrictModeSparseConfig + ) -> grpc.StrictModeSparseConfig: + return grpc.StrictModeSparseConfig( + sparse_config=dict( + (key, cls.convert_strict_mode_sparse(val)) for key, val in model.items() + ) + ) + + @classmethod + def convert_strict_mode_config(cls, model: rest.StrictModeConfig) -> grpc.StrictModeConfig: + return grpc.StrictModeConfig( + enabled=model.enabled, + max_query_limit=model.max_query_limit, + max_timeout=model.max_timeout, + unindexed_filtering_retrieve=model.unindexed_filtering_retrieve, + unindexed_filtering_update=model.unindexed_filtering_update, + search_max_hnsw_ef=model.search_max_hnsw_ef, + search_allow_exact=model.search_allow_exact, + search_max_oversampling=model.search_max_oversampling, + upsert_max_batchsize=model.upsert_max_batchsize, + max_collection_vector_size_bytes=model.max_collection_vector_size_bytes, + read_rate_limit=model.read_rate_limit, + write_rate_limit=model.write_rate_limit, + max_collection_payload_size_bytes=model.max_collection_payload_size_bytes, + max_points_count=model.max_points_count, + filter_max_conditions=model.filter_max_conditions, + condition_max_size=model.condition_max_size, + multivector_config=( + cls.convert_strict_mode_multivector_config(model.multivector_config) + if model.multivector_config + else None + ), + sparse_config=( + cls.convert_strict_mode_sparse_config(model.sparse_config) + if model.sparse_config + else None + ), + ) + + @classmethod + def convert_strict_mode_config_output( + cls, model: rest.StrictModeConfigOutput + ) -> grpc.StrictModeConfig: + return grpc.StrictModeConfig( + enabled=model.enabled, + max_query_limit=model.max_query_limit, + max_timeout=model.max_timeout, + unindexed_filtering_retrieve=model.unindexed_filtering_retrieve, + unindexed_filtering_update=model.unindexed_filtering_update, + search_max_hnsw_ef=model.search_max_hnsw_ef, + search_allow_exact=model.search_allow_exact, + search_max_oversampling=model.search_max_oversampling, + upsert_max_batchsize=model.upsert_max_batchsize, + max_collection_vector_size_bytes=model.max_collection_vector_size_bytes, + read_rate_limit=model.read_rate_limit, + write_rate_limit=model.write_rate_limit, + max_collection_payload_size_bytes=model.max_collection_payload_size_bytes, + max_points_count=model.max_points_count, + filter_max_conditions=model.filter_max_conditions, + condition_max_size=model.condition_max_size, + multivector_config=( + cls.convert_strict_mode_multivector_config_output(model.multivector_config) + if model.multivector_config + else None + ), + sparse_config=( + cls.convert_strict_mode_sparse_config_output(model.sparse_config) + if model.sparse_config + else None + ), + ) + + @classmethod + def convert_strict_mode_multivector_config_output( + cls, model: rest.StrictModeMultivectorConfigOutput + ) -> grpc.StrictModeMultivectorConfig: + return grpc.StrictModeMultivectorConfig( + multivector_config=dict( + (key, cls.convert_strict_mode_multivector_output(val)) + for key, val in model.items() + ) + ) + + @classmethod + def convert_strict_mode_sparse_config_output( + cls, model: rest.StrictModeSparseConfigOutput + ) -> grpc.StrictModeSparseConfig: + return grpc.StrictModeSparseConfig( + sparse_config=dict( + (key, cls.convert_strict_mode_sparse_output(val)) for key, val in model.items() + ) + ) + + @classmethod + def convert_strict_mode_multivector_output( + cls, model: rest.StrictModeMultivectorOutput + ) -> grpc.StrictModeMultivector: + return grpc.StrictModeMultivector( + max_vectors=model.max_vectors, + ) + + @classmethod + def convert_strict_mode_sparse_output( + cls, model: rest.StrictModeSparseOutput + ) -> grpc.StrictModeSparse: + return grpc.StrictModeSparse( + max_length=model.max_length, + ) diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/embed/__pycache__/_inspection_cache.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/embed/__pycache__/_inspection_cache.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a33315cb825c5b2af5c4f040b37c1d9c5b861b21 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/embed/__pycache__/_inspection_cache.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/embed/__pycache__/common.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/embed/__pycache__/common.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a163b3627dca6fadf7d351f8a9c0553745d09f83 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/embed/__pycache__/common.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/embed/__pycache__/embed_inspector.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/embed/__pycache__/embed_inspector.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..964143a746bc2c76154d5b8ba53a1993ec506188 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/embed/__pycache__/embed_inspector.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/embed/__pycache__/embedder.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/embed/__pycache__/embedder.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..b1380313de7fed572ba4823b5dda23f16a83aa7e Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/embed/__pycache__/embedder.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/embed/__pycache__/model_embedder.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/embed/__pycache__/model_embedder.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..00fd78587b894368764b93f201e5b4c6cf4f3a4d Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/embed/__pycache__/model_embedder.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/embed/__pycache__/models.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/embed/__pycache__/models.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..cac7f5b8546aa26c07254dbb29ba2f9aa03683c3 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/embed/__pycache__/models.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/embed/__pycache__/schema_parser.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/embed/__pycache__/schema_parser.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..fe6fe5a051f0055839e8da3c69d85c37d8cd450e Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/embed/__pycache__/schema_parser.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/embed/__pycache__/type_inspector.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/embed/__pycache__/type_inspector.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..fc8d52ac94795bfd4fcbca6ecf350e8648d62032 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/embed/__pycache__/type_inspector.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/embed/__pycache__/utils.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/embed/__pycache__/utils.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..39d1319887270ede726c7bfd852bdeeeb1016278 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/embed/__pycache__/utils.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/embed/_inspection_cache.py b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/embed/_inspection_cache.py new file mode 100644 index 0000000000000000000000000000000000000000..b61a7f29ad4667956994b7f43140470b1a3ff2ef --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/embed/_inspection_cache.py @@ -0,0 +1,4234 @@ +CACHE_STR_PATH = { + "AbortReshardingOperation": [], + "AbortShardTransfer": [], + "AbortTransferOperation": [], + "AbsExpression": [], + "Batch": ["vectors"], + "BinaryQuantization": [], + "BinaryQuantizationConfig": [], + "BoolIndexParams": [], + "ChangeAliasesOperation": [], + "ClearPayloadOperation": [], + "CollectionParamsDiff": [], + "ContextExamplePair": [], + "ContextPair": ["negative", "positive"], + "ContextQuery": ["context.negative", "context.positive"], + "CountRequest": [], + "CreateAlias": [], + "CreateAliasOperation": [], + "CreateCollection": [], + "CreateFieldIndex": [], + "CreateShardingKey": [], + "CreateShardingKeyOperation": [], + "DatetimeExpression": [], + "DatetimeIndexParams": [], + "DatetimeKeyExpression": [], + "DatetimeRange": [], + "DecayParamsExpression": [], + "DeleteAlias": [], + "DeleteAliasOperation": [], + "DeleteOperation": [], + "DeletePayload": [], + "DeletePayloadOperation": [], + "DeleteVectors": [], + "DeleteVectorsOperation": [], + "DiscoverInput": ["context.negative", "context.positive", "target"], + "DiscoverQuery": ["discover.context.negative", "discover.context.positive", "discover.target"], + "DiscoverRequest": [], + "DiscoverRequestBatch": [], + "DivExpression": [], + "DivParams": [], + "Document": [], + "DropReplicaOperation": [], + "DropShardingKey": [], + "DropShardingKeyOperation": [], + "ExpDecayExpression": [], + "ExpExpression": [], + "FacetRequest": [], + "FieldCondition": [], + "Filter": [], + "FilterSelector": [], + "FloatIndexParams": [], + "FormulaQuery": [], + "FusionQuery": [], + "GaussDecayExpression": [], + "GeoBoundingBox": [], + "GeoDistance": [], + "GeoDistanceParams": [], + "GeoIndexParams": [], + "GeoLineString": [], + "GeoPoint": [], + "GeoPolygon": [], + "GeoRadius": [], + "HasIdCondition": [], + "HasVectorCondition": [], + "HnswConfigDiff": [], + "Image": [], + "InferenceObject": [], + "InitFrom": [], + "IntegerIndexParams": [], + "IsEmptyCondition": [], + "IsNullCondition": [], + "KeywordIndexParams": [], + "LinDecayExpression": [], + "LnExpression": [], + "LocksOption": [], + "Log10Expression": [], + "LookupLocation": [], + "MatchAny": [], + "MatchExcept": [], + "MatchPhrase": [], + "MatchText": [], + "MatchValue": [], + "MinShould": [], + "Mmr": [], + "MoveShard": [], + "MoveShardOperation": [], + "MultExpression": [], + "MultiVectorConfig": [], + "NamedSparseVector": [], + "NamedVector": [], + "NearestQuery": ["nearest"], + "NegExpression": [], + "Nested": [], + "NestedCondition": [], + "OptimizersConfigDiff": [], + "OrderBy": [], + "OrderByQuery": [], + "OverwritePayloadOperation": [], + "PayloadField": [], + "PayloadSelectorExclude": [], + "PayloadSelectorInclude": [], + "PointIdsList": [], + "PointRequest": [], + "PointStruct": ["vector"], + "PointVectors": ["vector"], + "PointsBatch": ["batch.vectors"], + "PointsList": ["points.vector"], + "PowExpression": [], + "PowParams": [], + "Prefetch": [ + "prefetch.query", + "prefetch.query.context.negative", + "prefetch.query.context.positive", + "prefetch.query.discover.context.negative", + "prefetch.query.discover.context.positive", + "prefetch.query.discover.target", + "prefetch.query.nearest", + "prefetch.query.recommend.negative", + "prefetch.query.recommend.positive", + "query", + "query.context.negative", + "query.context.positive", + "query.discover.context.negative", + "query.discover.context.positive", + "query.discover.target", + "query.nearest", + "query.recommend.negative", + "query.recommend.positive", + ], + "ProductQuantization": [], + "ProductQuantizationConfig": [], + "QuantizationSearchParams": [], + "QueryGroupsRequest": [ + "prefetch.query", + "prefetch.query.context.negative", + "prefetch.query.context.positive", + "prefetch.query.discover.context.negative", + "prefetch.query.discover.context.positive", + "prefetch.query.discover.target", + "prefetch.query.nearest", + "prefetch.query.recommend.negative", + "prefetch.query.recommend.positive", + "query", + "query.context.negative", + "query.context.positive", + "query.discover.context.negative", + "query.discover.context.positive", + "query.discover.target", + "query.nearest", + "query.recommend.negative", + "query.recommend.positive", + ], + "QueryRequest": [ + "prefetch.query", + "prefetch.query.context.negative", + "prefetch.query.context.positive", + "prefetch.query.discover.context.negative", + "prefetch.query.discover.context.positive", + "prefetch.query.discover.target", + "prefetch.query.nearest", + "prefetch.query.recommend.negative", + "prefetch.query.recommend.positive", + "query", + "query.context.negative", + "query.context.positive", + "query.discover.context.negative", + "query.discover.context.positive", + "query.discover.target", + "query.nearest", + "query.recommend.negative", + "query.recommend.positive", + ], + "QueryRequestBatch": [ + "searches.prefetch.query", + "searches.prefetch.query.context.negative", + "searches.prefetch.query.context.positive", + "searches.prefetch.query.discover.context.negative", + "searches.prefetch.query.discover.context.positive", + "searches.prefetch.query.discover.target", + "searches.prefetch.query.nearest", + "searches.prefetch.query.recommend.negative", + "searches.prefetch.query.recommend.positive", + "searches.query", + "searches.query.context.negative", + "searches.query.context.positive", + "searches.query.discover.context.negative", + "searches.query.discover.context.positive", + "searches.query.discover.target", + "searches.query.nearest", + "searches.query.recommend.negative", + "searches.query.recommend.positive", + ], + "QueryResponse": ["document"], + "Range": [], + "RecommendGroupsRequest": [], + "RecommendInput": ["negative", "positive"], + "RecommendQuery": ["recommend.negative", "recommend.positive"], + "RecommendRequest": [], + "RecommendRequestBatch": [], + "RenameAlias": [], + "RenameAliasOperation": [], + "Replica": [], + "ReplicateShard": [], + "ReplicateShardOperation": [], + "RestartTransfer": [], + "RestartTransferOperation": [], + "SampleQuery": [], + "ScalarQuantization": [], + "ScalarQuantizationConfig": [], + "ScrollRequest": [], + "SearchGroupsRequest": [], + "SearchMatrixRequest": [], + "SearchParams": [], + "SearchRequest": [], + "SearchRequestBatch": [], + "SetPayload": [], + "SetPayloadOperation": [], + "ShardSnapshotRecover": [], + "SnapshotRecover": [], + "SnowballParams": [], + "SparseIndexParams": [], + "SparseVector": [], + "SparseVectorParams": [], + "SqrtExpression": [], + "StartResharding": [], + "StartReshardingOperation": [], + "StopwordsSet": [], + "StrictModeConfig": [], + "StrictModeMultivector": [], + "StrictModeSparse": [], + "SumExpression": [], + "TextIndexParams": [], + "UpdateCollection": [], + "UpdateOperations": [ + "operations.update_vectors.points.vector", + "operations.upsert.batch.vectors", + "operations.upsert.points.vector", + ], + "UpdateVectors": ["points.vector"], + "UpdateVectorsOperation": ["update_vectors.points.vector"], + "UpsertOperation": ["upsert.batch.vectors", "upsert.points.vector"], + "UuidIndexParams": [], + "ValuesCount": [], + "VectorParams": [], + "VectorParamsDiff": [], + "WalConfigDiff": [], + "WithLookup": [], +} +DEFS = { + "AbortShardTransfer": { + "additionalProperties": False, + "properties": { + "shard_id": {"description": "", "title": "Shard Id", "type": "integer"}, + "to_peer_id": {"description": "", "title": "To Peer Id", "type": "integer"}, + "from_peer_id": {"description": "", "title": "From Peer Id", "type": "integer"}, + }, + "required": ["shard_id", "to_peer_id", "from_peer_id"], + "title": "AbortShardTransfer", + "type": "object", + }, + "AbsExpression": { + "additionalProperties": False, + "properties": { + "abs": { + "anyOf": [ + {"type": "number"}, + {"type": "string"}, + {"$ref": "#/$defs/FieldCondition"}, + {"$ref": "#/$defs/IsEmptyCondition"}, + {"$ref": "#/$defs/IsNullCondition"}, + {"$ref": "#/$defs/HasIdCondition"}, + {"$ref": "#/$defs/HasVectorCondition"}, + {"$ref": "#/$defs/NestedCondition"}, + {"$ref": "#/$defs/Filter"}, + {"$ref": "#/$defs/GeoDistance"}, + {"$ref": "#/$defs/DatetimeExpression"}, + {"$ref": "#/$defs/DatetimeKeyExpression"}, + {"$ref": "#/$defs/MultExpression"}, + {"$ref": "#/$defs/SumExpression"}, + {"$ref": "#/$defs/NegExpression"}, + {"$ref": "#/$defs/AbsExpression"}, + {"$ref": "#/$defs/DivExpression"}, + {"$ref": "#/$defs/SqrtExpression"}, + {"$ref": "#/$defs/PowExpression"}, + {"$ref": "#/$defs/ExpExpression"}, + {"$ref": "#/$defs/Log10Expression"}, + {"$ref": "#/$defs/LnExpression"}, + {"$ref": "#/$defs/LinDecayExpression"}, + {"$ref": "#/$defs/ExpDecayExpression"}, + {"$ref": "#/$defs/GaussDecayExpression"}, + ], + "description": "", + "title": "Abs", + } + }, + "required": ["abs"], + "title": "AbsExpression", + "type": "object", + }, + "DatetimeExpression": { + "additionalProperties": False, + "properties": {"datetime": {"description": "", "title": "Datetime", "type": "string"}}, + "required": ["datetime"], + "title": "DatetimeExpression", + "type": "object", + }, + "DatetimeKeyExpression": { + "additionalProperties": False, + "properties": { + "datetime_key": {"description": "", "title": "Datetime Key", "type": "string"} + }, + "required": ["datetime_key"], + "title": "DatetimeKeyExpression", + "type": "object", + }, + "DatetimeRange": { + "additionalProperties": False, + "description": "Range filter request", + "properties": { + "lt": { + "anyOf": [ + {"format": "date-time", "type": "string"}, + {"format": "date", "type": "string"}, + {"type": "null"}, + ], + "default": None, + "description": "point.key < range.lt", + "title": "Lt", + }, + "gt": { + "anyOf": [ + {"format": "date-time", "type": "string"}, + {"format": "date", "type": "string"}, + {"type": "null"}, + ], + "default": None, + "description": "point.key > range.gt", + "title": "Gt", + }, + "gte": { + "anyOf": [ + {"format": "date-time", "type": "string"}, + {"format": "date", "type": "string"}, + {"type": "null"}, + ], + "default": None, + "description": "point.key >= range.gte", + "title": "Gte", + }, + "lte": { + "anyOf": [ + {"format": "date-time", "type": "string"}, + {"format": "date", "type": "string"}, + {"type": "null"}, + ], + "default": None, + "description": "point.key <= range.lte", + "title": "Lte", + }, + }, + "title": "DatetimeRange", + "type": "object", + }, + "DecayParamsExpression": { + "additionalProperties": False, + "properties": { + "x": { + "anyOf": [ + {"type": "number"}, + {"type": "string"}, + {"$ref": "#/$defs/FieldCondition"}, + {"$ref": "#/$defs/IsEmptyCondition"}, + {"$ref": "#/$defs/IsNullCondition"}, + {"$ref": "#/$defs/HasIdCondition"}, + {"$ref": "#/$defs/HasVectorCondition"}, + {"$ref": "#/$defs/NestedCondition"}, + {"$ref": "#/$defs/Filter"}, + {"$ref": "#/$defs/GeoDistance"}, + {"$ref": "#/$defs/DatetimeExpression"}, + {"$ref": "#/$defs/DatetimeKeyExpression"}, + {"$ref": "#/$defs/MultExpression"}, + {"$ref": "#/$defs/SumExpression"}, + {"$ref": "#/$defs/NegExpression"}, + {"$ref": "#/$defs/AbsExpression"}, + {"$ref": "#/$defs/DivExpression"}, + {"$ref": "#/$defs/SqrtExpression"}, + {"$ref": "#/$defs/PowExpression"}, + {"$ref": "#/$defs/ExpExpression"}, + {"$ref": "#/$defs/Log10Expression"}, + {"$ref": "#/$defs/LnExpression"}, + {"$ref": "#/$defs/LinDecayExpression"}, + {"$ref": "#/$defs/ExpDecayExpression"}, + {"$ref": "#/$defs/GaussDecayExpression"}, + ], + "description": "", + "title": "X", + }, + "target": { + "anyOf": [ + {"type": "number"}, + {"type": "string"}, + {"$ref": "#/$defs/FieldCondition"}, + {"$ref": "#/$defs/IsEmptyCondition"}, + {"$ref": "#/$defs/IsNullCondition"}, + {"$ref": "#/$defs/HasIdCondition"}, + {"$ref": "#/$defs/HasVectorCondition"}, + {"$ref": "#/$defs/NestedCondition"}, + {"$ref": "#/$defs/Filter"}, + {"$ref": "#/$defs/GeoDistance"}, + {"$ref": "#/$defs/DatetimeExpression"}, + {"$ref": "#/$defs/DatetimeKeyExpression"}, + {"$ref": "#/$defs/MultExpression"}, + {"$ref": "#/$defs/SumExpression"}, + {"$ref": "#/$defs/NegExpression"}, + {"$ref": "#/$defs/AbsExpression"}, + {"$ref": "#/$defs/DivExpression"}, + {"$ref": "#/$defs/SqrtExpression"}, + {"$ref": "#/$defs/PowExpression"}, + {"$ref": "#/$defs/ExpExpression"}, + {"$ref": "#/$defs/Log10Expression"}, + {"$ref": "#/$defs/LnExpression"}, + {"$ref": "#/$defs/LinDecayExpression"}, + {"$ref": "#/$defs/ExpDecayExpression"}, + {"$ref": "#/$defs/GaussDecayExpression"}, + {"type": "null"}, + ], + "default": None, + "description": "The target value to start decaying from. Defaults to 0.", + "title": "Target", + }, + "scale": { + "anyOf": [{"type": "number"}, {"type": "null"}], + "default": None, + "description": "The scale factor of the decay, in terms of `x`. Defaults to 1.0. Must be a non-zero positive number.", + "title": "Scale", + }, + "midpoint": { + "anyOf": [{"type": "number"}, {"type": "null"}], + "default": None, + "description": "The midpoint of the decay. Defaults to 0.5. Output will be this value when `|x - target| == scale`.", + "title": "Midpoint", + }, + }, + "required": ["x"], + "title": "DecayParamsExpression", + "type": "object", + }, + "DivExpression": { + "additionalProperties": False, + "properties": {"div": {"$ref": "#/$defs/DivParams", "description": ""}}, + "required": ["div"], + "title": "DivExpression", + "type": "object", + }, + "DivParams": { + "additionalProperties": False, + "properties": { + "left": { + "anyOf": [ + {"type": "number"}, + {"type": "string"}, + {"$ref": "#/$defs/FieldCondition"}, + {"$ref": "#/$defs/IsEmptyCondition"}, + {"$ref": "#/$defs/IsNullCondition"}, + {"$ref": "#/$defs/HasIdCondition"}, + {"$ref": "#/$defs/HasVectorCondition"}, + {"$ref": "#/$defs/NestedCondition"}, + {"$ref": "#/$defs/Filter"}, + {"$ref": "#/$defs/GeoDistance"}, + {"$ref": "#/$defs/DatetimeExpression"}, + {"$ref": "#/$defs/DatetimeKeyExpression"}, + {"$ref": "#/$defs/MultExpression"}, + {"$ref": "#/$defs/SumExpression"}, + {"$ref": "#/$defs/NegExpression"}, + {"$ref": "#/$defs/AbsExpression"}, + {"$ref": "#/$defs/DivExpression"}, + {"$ref": "#/$defs/SqrtExpression"}, + {"$ref": "#/$defs/PowExpression"}, + {"$ref": "#/$defs/ExpExpression"}, + {"$ref": "#/$defs/Log10Expression"}, + {"$ref": "#/$defs/LnExpression"}, + {"$ref": "#/$defs/LinDecayExpression"}, + {"$ref": "#/$defs/ExpDecayExpression"}, + {"$ref": "#/$defs/GaussDecayExpression"}, + ], + "description": "", + "title": "Left", + }, + "right": { + "anyOf": [ + {"type": "number"}, + {"type": "string"}, + {"$ref": "#/$defs/FieldCondition"}, + {"$ref": "#/$defs/IsEmptyCondition"}, + {"$ref": "#/$defs/IsNullCondition"}, + {"$ref": "#/$defs/HasIdCondition"}, + {"$ref": "#/$defs/HasVectorCondition"}, + {"$ref": "#/$defs/NestedCondition"}, + {"$ref": "#/$defs/Filter"}, + {"$ref": "#/$defs/GeoDistance"}, + {"$ref": "#/$defs/DatetimeExpression"}, + {"$ref": "#/$defs/DatetimeKeyExpression"}, + {"$ref": "#/$defs/MultExpression"}, + {"$ref": "#/$defs/SumExpression"}, + {"$ref": "#/$defs/NegExpression"}, + {"$ref": "#/$defs/AbsExpression"}, + {"$ref": "#/$defs/DivExpression"}, + {"$ref": "#/$defs/SqrtExpression"}, + {"$ref": "#/$defs/PowExpression"}, + {"$ref": "#/$defs/ExpExpression"}, + {"$ref": "#/$defs/Log10Expression"}, + {"$ref": "#/$defs/LnExpression"}, + {"$ref": "#/$defs/LinDecayExpression"}, + {"$ref": "#/$defs/ExpDecayExpression"}, + {"$ref": "#/$defs/GaussDecayExpression"}, + ], + "description": "", + "title": "Right", + }, + "by_zero_default": { + "anyOf": [{"type": "number"}, {"type": "null"}], + "default": None, + "description": "", + "title": "By Zero Default", + }, + }, + "required": ["left", "right"], + "title": "DivParams", + "type": "object", + }, + "ExpDecayExpression": { + "additionalProperties": False, + "properties": {"exp_decay": {"$ref": "#/$defs/DecayParamsExpression", "description": ""}}, + "required": ["exp_decay"], + "title": "ExpDecayExpression", + "type": "object", + }, + "ExpExpression": { + "additionalProperties": False, + "properties": { + "exp": { + "anyOf": [ + {"type": "number"}, + {"type": "string"}, + {"$ref": "#/$defs/FieldCondition"}, + {"$ref": "#/$defs/IsEmptyCondition"}, + {"$ref": "#/$defs/IsNullCondition"}, + {"$ref": "#/$defs/HasIdCondition"}, + {"$ref": "#/$defs/HasVectorCondition"}, + {"$ref": "#/$defs/NestedCondition"}, + {"$ref": "#/$defs/Filter"}, + {"$ref": "#/$defs/GeoDistance"}, + {"$ref": "#/$defs/DatetimeExpression"}, + {"$ref": "#/$defs/DatetimeKeyExpression"}, + {"$ref": "#/$defs/MultExpression"}, + {"$ref": "#/$defs/SumExpression"}, + {"$ref": "#/$defs/NegExpression"}, + {"$ref": "#/$defs/AbsExpression"}, + {"$ref": "#/$defs/DivExpression"}, + {"$ref": "#/$defs/SqrtExpression"}, + {"$ref": "#/$defs/PowExpression"}, + {"$ref": "#/$defs/ExpExpression"}, + {"$ref": "#/$defs/Log10Expression"}, + {"$ref": "#/$defs/LnExpression"}, + {"$ref": "#/$defs/LinDecayExpression"}, + {"$ref": "#/$defs/ExpDecayExpression"}, + {"$ref": "#/$defs/GaussDecayExpression"}, + ], + "description": "", + "title": "Exp", + } + }, + "required": ["exp"], + "title": "ExpExpression", + "type": "object", + }, + "FieldCondition": { + "additionalProperties": False, + "description": "All possible payload filtering conditions", + "properties": { + "key": {"description": "Payload key", "title": "Key", "type": "string"}, + "match": { + "anyOf": [ + {"$ref": "#/$defs/MatchValue"}, + {"$ref": "#/$defs/MatchText"}, + {"$ref": "#/$defs/MatchPhrase"}, + {"$ref": "#/$defs/MatchAny"}, + {"$ref": "#/$defs/MatchExcept"}, + {"type": "null"}, + ], + "default": None, + "description": "Check if point has field with a given value", + "title": "Match", + }, + "range": { + "anyOf": [ + {"$ref": "#/$defs/Range"}, + {"$ref": "#/$defs/DatetimeRange"}, + {"type": "null"}, + ], + "default": None, + "description": "Check if points value lies in a given range", + "title": "Range", + }, + "geo_bounding_box": { + "anyOf": [{"$ref": "#/$defs/GeoBoundingBox"}, {"type": "null"}], + "default": None, + "description": "Check if points geolocation lies in a given area", + }, + "geo_radius": { + "anyOf": [{"$ref": "#/$defs/GeoRadius"}, {"type": "null"}], + "default": None, + "description": "Check if geo point is within a given radius", + }, + "geo_polygon": { + "anyOf": [{"$ref": "#/$defs/GeoPolygon"}, {"type": "null"}], + "default": None, + "description": "Check if geo point is within a given polygon", + }, + "values_count": { + "anyOf": [{"$ref": "#/$defs/ValuesCount"}, {"type": "null"}], + "default": None, + "description": "Check number of values of the field", + }, + "is_empty": { + "anyOf": [{"type": "boolean"}, {"type": "null"}], + "default": None, + "description": "Check that the field is empty, alternative syntax for `is_empty: 'field_name'`", + "title": "Is Empty", + }, + "is_null": { + "anyOf": [{"type": "boolean"}, {"type": "null"}], + "default": None, + "description": "Check that the field is null, alternative syntax for `is_null: 'field_name'`", + "title": "Is Null", + }, + }, + "required": ["key"], + "title": "FieldCondition", + "type": "object", + }, + "Filter": { + "additionalProperties": False, + "properties": { + "should": { + "anyOf": [ + { + "items": { + "anyOf": [ + {"$ref": "#/$defs/FieldCondition"}, + {"$ref": "#/$defs/IsEmptyCondition"}, + {"$ref": "#/$defs/IsNullCondition"}, + {"$ref": "#/$defs/HasIdCondition"}, + {"$ref": "#/$defs/HasVectorCondition"}, + {"$ref": "#/$defs/NestedCondition"}, + {"$ref": "#/$defs/Filter"}, + ] + }, + "type": "array", + }, + {"$ref": "#/$defs/FieldCondition"}, + {"$ref": "#/$defs/IsEmptyCondition"}, + {"$ref": "#/$defs/IsNullCondition"}, + {"$ref": "#/$defs/HasIdCondition"}, + {"$ref": "#/$defs/HasVectorCondition"}, + {"$ref": "#/$defs/NestedCondition"}, + {"$ref": "#/$defs/Filter"}, + {"type": "null"}, + ], + "default": None, + "description": "At least one of those conditions should match", + "title": "Should", + }, + "min_should": { + "anyOf": [{"$ref": "#/$defs/MinShould"}, {"type": "null"}], + "default": None, + "description": "At least minimum amount of given conditions should match", + }, + "must": { + "anyOf": [ + { + "items": { + "anyOf": [ + {"$ref": "#/$defs/FieldCondition"}, + {"$ref": "#/$defs/IsEmptyCondition"}, + {"$ref": "#/$defs/IsNullCondition"}, + {"$ref": "#/$defs/HasIdCondition"}, + {"$ref": "#/$defs/HasVectorCondition"}, + {"$ref": "#/$defs/NestedCondition"}, + {"$ref": "#/$defs/Filter"}, + ] + }, + "type": "array", + }, + {"$ref": "#/$defs/FieldCondition"}, + {"$ref": "#/$defs/IsEmptyCondition"}, + {"$ref": "#/$defs/IsNullCondition"}, + {"$ref": "#/$defs/HasIdCondition"}, + {"$ref": "#/$defs/HasVectorCondition"}, + {"$ref": "#/$defs/NestedCondition"}, + {"$ref": "#/$defs/Filter"}, + {"type": "null"}, + ], + "default": None, + "description": "All conditions must match", + "title": "Must", + }, + "must_not": { + "anyOf": [ + { + "items": { + "anyOf": [ + {"$ref": "#/$defs/FieldCondition"}, + {"$ref": "#/$defs/IsEmptyCondition"}, + {"$ref": "#/$defs/IsNullCondition"}, + {"$ref": "#/$defs/HasIdCondition"}, + {"$ref": "#/$defs/HasVectorCondition"}, + {"$ref": "#/$defs/NestedCondition"}, + {"$ref": "#/$defs/Filter"}, + ] + }, + "type": "array", + }, + {"$ref": "#/$defs/FieldCondition"}, + {"$ref": "#/$defs/IsEmptyCondition"}, + {"$ref": "#/$defs/IsNullCondition"}, + {"$ref": "#/$defs/HasIdCondition"}, + {"$ref": "#/$defs/HasVectorCondition"}, + {"$ref": "#/$defs/NestedCondition"}, + {"$ref": "#/$defs/Filter"}, + {"type": "null"}, + ], + "default": None, + "description": "All conditions must NOT match", + "title": "Must Not", + }, + }, + "title": "Filter", + "type": "object", + }, + "GaussDecayExpression": { + "additionalProperties": False, + "properties": { + "gauss_decay": {"$ref": "#/$defs/DecayParamsExpression", "description": ""} + }, + "required": ["gauss_decay"], + "title": "GaussDecayExpression", + "type": "object", + }, + "GeoBoundingBox": { + "additionalProperties": False, + "description": "Geo filter request Matches coordinates inside the rectangle, described by coordinates of lop-left and bottom-right edges", + "properties": { + "top_left": { + "$ref": "#/$defs/GeoPoint", + "description": "Geo filter request Matches coordinates inside the rectangle, described by coordinates of lop-left and bottom-right edges", + }, + "bottom_right": { + "$ref": "#/$defs/GeoPoint", + "description": "Geo filter request Matches coordinates inside the rectangle, described by coordinates of lop-left and bottom-right edges", + }, + }, + "required": ["top_left", "bottom_right"], + "title": "GeoBoundingBox", + "type": "object", + }, + "GeoDistance": { + "additionalProperties": False, + "properties": {"geo_distance": {"$ref": "#/$defs/GeoDistanceParams", "description": ""}}, + "required": ["geo_distance"], + "title": "GeoDistance", + "type": "object", + }, + "GeoDistanceParams": { + "additionalProperties": False, + "properties": { + "origin": {"$ref": "#/$defs/GeoPoint", "description": ""}, + "to": { + "description": "Payload field with the destination geo point", + "title": "To", + "type": "string", + }, + }, + "required": ["origin", "to"], + "title": "GeoDistanceParams", + "type": "object", + }, + "GeoLineString": { + "additionalProperties": False, + "description": "Ordered sequence of GeoPoints representing the line", + "properties": { + "points": { + "description": "Ordered sequence of GeoPoints representing the line", + "items": {"$ref": "#/$defs/GeoPoint"}, + "title": "Points", + "type": "array", + } + }, + "required": ["points"], + "title": "GeoLineString", + "type": "object", + }, + "GeoPoint": { + "additionalProperties": False, + "description": "Geo point payload schema", + "properties": { + "lon": {"description": "Geo point payload schema", "title": "Lon", "type": "number"}, + "lat": {"description": "Geo point payload schema", "title": "Lat", "type": "number"}, + }, + "required": ["lon", "lat"], + "title": "GeoPoint", + "type": "object", + }, + "GeoPolygon": { + "additionalProperties": False, + "description": "Geo filter request Matches coordinates inside the polygon, defined by `exterior` and `interiors`", + "properties": { + "exterior": { + "$ref": "#/$defs/GeoLineString", + "description": "Geo filter request Matches coordinates inside the polygon, defined by `exterior` and `interiors`", + }, + "interiors": { + "anyOf": [ + {"items": {"$ref": "#/$defs/GeoLineString"}, "type": "array"}, + {"type": "null"}, + ], + "default": None, + "description": "Interior lines (if present) bound holes within the surface each GeoLineString must consist of a minimum of 4 points, and the first and last points must be the same.", + "title": "Interiors", + }, + }, + "required": ["exterior"], + "title": "GeoPolygon", + "type": "object", + }, + "GeoRadius": { + "additionalProperties": False, + "description": "Geo filter request Matches coordinates inside the circle of `radius` and center with coordinates `center`", + "properties": { + "center": { + "$ref": "#/$defs/GeoPoint", + "description": "Geo filter request Matches coordinates inside the circle of `radius` and center with coordinates `center`", + }, + "radius": { + "description": "Radius of the area in meters", + "title": "Radius", + "type": "number", + }, + }, + "required": ["center", "radius"], + "title": "GeoRadius", + "type": "object", + }, + "HasIdCondition": { + "additionalProperties": False, + "description": "ID-based filtering condition", + "properties": { + "has_id": { + "description": "ID-based filtering condition", + "items": {"anyOf": [{"type": "integer"}, {"type": "string"}]}, + "title": "Has Id", + "type": "array", + } + }, + "required": ["has_id"], + "title": "HasIdCondition", + "type": "object", + }, + "HasVectorCondition": { + "additionalProperties": False, + "description": "Filter points which have specific vector assigned", + "properties": { + "has_vector": { + "description": "Filter points which have specific vector assigned", + "title": "Has Vector", + "type": "string", + } + }, + "required": ["has_vector"], + "title": "HasVectorCondition", + "type": "object", + }, + "IsEmptyCondition": { + "additionalProperties": False, + "description": "Select points with empty payload for a specified field", + "properties": { + "is_empty": { + "$ref": "#/$defs/PayloadField", + "description": "Select points with empty payload for a specified field", + } + }, + "required": ["is_empty"], + "title": "IsEmptyCondition", + "type": "object", + }, + "IsNullCondition": { + "additionalProperties": False, + "description": "Select points with null payload for a specified field", + "properties": { + "is_null": { + "$ref": "#/$defs/PayloadField", + "description": "Select points with null payload for a specified field", + } + }, + "required": ["is_null"], + "title": "IsNullCondition", + "type": "object", + }, + "LinDecayExpression": { + "additionalProperties": False, + "properties": {"lin_decay": {"$ref": "#/$defs/DecayParamsExpression", "description": ""}}, + "required": ["lin_decay"], + "title": "LinDecayExpression", + "type": "object", + }, + "LnExpression": { + "additionalProperties": False, + "properties": { + "ln": { + "anyOf": [ + {"type": "number"}, + {"type": "string"}, + {"$ref": "#/$defs/FieldCondition"}, + {"$ref": "#/$defs/IsEmptyCondition"}, + {"$ref": "#/$defs/IsNullCondition"}, + {"$ref": "#/$defs/HasIdCondition"}, + {"$ref": "#/$defs/HasVectorCondition"}, + {"$ref": "#/$defs/NestedCondition"}, + {"$ref": "#/$defs/Filter"}, + {"$ref": "#/$defs/GeoDistance"}, + {"$ref": "#/$defs/DatetimeExpression"}, + {"$ref": "#/$defs/DatetimeKeyExpression"}, + {"$ref": "#/$defs/MultExpression"}, + {"$ref": "#/$defs/SumExpression"}, + {"$ref": "#/$defs/NegExpression"}, + {"$ref": "#/$defs/AbsExpression"}, + {"$ref": "#/$defs/DivExpression"}, + {"$ref": "#/$defs/SqrtExpression"}, + {"$ref": "#/$defs/PowExpression"}, + {"$ref": "#/$defs/ExpExpression"}, + {"$ref": "#/$defs/Log10Expression"}, + {"$ref": "#/$defs/LnExpression"}, + {"$ref": "#/$defs/LinDecayExpression"}, + {"$ref": "#/$defs/ExpDecayExpression"}, + {"$ref": "#/$defs/GaussDecayExpression"}, + ], + "description": "", + "title": "Ln", + } + }, + "required": ["ln"], + "title": "LnExpression", + "type": "object", + }, + "Log10Expression": { + "additionalProperties": False, + "properties": { + "log10": { + "anyOf": [ + {"type": "number"}, + {"type": "string"}, + {"$ref": "#/$defs/FieldCondition"}, + {"$ref": "#/$defs/IsEmptyCondition"}, + {"$ref": "#/$defs/IsNullCondition"}, + {"$ref": "#/$defs/HasIdCondition"}, + {"$ref": "#/$defs/HasVectorCondition"}, + {"$ref": "#/$defs/NestedCondition"}, + {"$ref": "#/$defs/Filter"}, + {"$ref": "#/$defs/GeoDistance"}, + {"$ref": "#/$defs/DatetimeExpression"}, + {"$ref": "#/$defs/DatetimeKeyExpression"}, + {"$ref": "#/$defs/MultExpression"}, + {"$ref": "#/$defs/SumExpression"}, + {"$ref": "#/$defs/NegExpression"}, + {"$ref": "#/$defs/AbsExpression"}, + {"$ref": "#/$defs/DivExpression"}, + {"$ref": "#/$defs/SqrtExpression"}, + {"$ref": "#/$defs/PowExpression"}, + {"$ref": "#/$defs/ExpExpression"}, + {"$ref": "#/$defs/Log10Expression"}, + {"$ref": "#/$defs/LnExpression"}, + {"$ref": "#/$defs/LinDecayExpression"}, + {"$ref": "#/$defs/ExpDecayExpression"}, + {"$ref": "#/$defs/GaussDecayExpression"}, + ], + "description": "", + "title": "Log10", + } + }, + "required": ["log10"], + "title": "Log10Expression", + "type": "object", + }, + "MatchAny": { + "additionalProperties": False, + "description": "Exact match on any of the given values", + "properties": { + "any": { + "anyOf": [ + {"items": {"type": "string"}, "type": "array"}, + {"items": {"type": "integer"}, "type": "array"}, + ], + "description": "Exact match on any of the given values", + "title": "Any", + } + }, + "required": ["any"], + "title": "MatchAny", + "type": "object", + }, + "MatchExcept": { + "additionalProperties": False, + "description": "Should have at least one value not matching the any given values", + "properties": { + "except": { + "anyOf": [ + {"items": {"type": "string"}, "type": "array"}, + {"items": {"type": "integer"}, "type": "array"}, + ], + "description": "Should have at least one value not matching the any given values", + "title": "Except", + } + }, + "required": ["except"], + "title": "MatchExcept", + "type": "object", + }, + "MatchPhrase": { + "additionalProperties": False, + "description": "Full-text phrase match of the string.", + "properties": { + "phrase": { + "description": "Full-text phrase match of the string.", + "title": "Phrase", + "type": "string", + } + }, + "required": ["phrase"], + "title": "MatchPhrase", + "type": "object", + }, + "MatchText": { + "additionalProperties": False, + "description": "Full-text match of the strings.", + "properties": { + "text": { + "description": "Full-text match of the strings.", + "title": "Text", + "type": "string", + } + }, + "required": ["text"], + "title": "MatchText", + "type": "object", + }, + "MatchValue": { + "additionalProperties": False, + "description": "Exact match of the given value", + "properties": { + "value": { + "anyOf": [{"type": "boolean"}, {"type": "integer"}, {"type": "string"}], + "description": "Exact match of the given value", + "title": "Value", + } + }, + "required": ["value"], + "title": "MatchValue", + "type": "object", + }, + "MinShould": { + "additionalProperties": False, + "properties": { + "conditions": { + "description": "", + "items": { + "anyOf": [ + {"$ref": "#/$defs/FieldCondition"}, + {"$ref": "#/$defs/IsEmptyCondition"}, + {"$ref": "#/$defs/IsNullCondition"}, + {"$ref": "#/$defs/HasIdCondition"}, + {"$ref": "#/$defs/HasVectorCondition"}, + {"$ref": "#/$defs/NestedCondition"}, + {"$ref": "#/$defs/Filter"}, + ] + }, + "title": "Conditions", + "type": "array", + }, + "min_count": {"description": "", "title": "Min Count", "type": "integer"}, + }, + "required": ["conditions", "min_count"], + "title": "MinShould", + "type": "object", + }, + "MultExpression": { + "additionalProperties": False, + "properties": { + "mult": { + "description": "", + "items": { + "anyOf": [ + {"type": "number"}, + {"type": "string"}, + {"$ref": "#/$defs/FieldCondition"}, + {"$ref": "#/$defs/IsEmptyCondition"}, + {"$ref": "#/$defs/IsNullCondition"}, + {"$ref": "#/$defs/HasIdCondition"}, + {"$ref": "#/$defs/HasVectorCondition"}, + {"$ref": "#/$defs/NestedCondition"}, + {"$ref": "#/$defs/Filter"}, + {"$ref": "#/$defs/GeoDistance"}, + {"$ref": "#/$defs/DatetimeExpression"}, + {"$ref": "#/$defs/DatetimeKeyExpression"}, + {"$ref": "#/$defs/MultExpression"}, + {"$ref": "#/$defs/SumExpression"}, + {"$ref": "#/$defs/NegExpression"}, + {"$ref": "#/$defs/AbsExpression"}, + {"$ref": "#/$defs/DivExpression"}, + {"$ref": "#/$defs/SqrtExpression"}, + {"$ref": "#/$defs/PowExpression"}, + {"$ref": "#/$defs/ExpExpression"}, + {"$ref": "#/$defs/Log10Expression"}, + {"$ref": "#/$defs/LnExpression"}, + {"$ref": "#/$defs/LinDecayExpression"}, + {"$ref": "#/$defs/ExpDecayExpression"}, + {"$ref": "#/$defs/GaussDecayExpression"}, + ] + }, + "title": "Mult", + "type": "array", + } + }, + "required": ["mult"], + "title": "MultExpression", + "type": "object", + }, + "NegExpression": { + "additionalProperties": False, + "properties": { + "neg": { + "anyOf": [ + {"type": "number"}, + {"type": "string"}, + {"$ref": "#/$defs/FieldCondition"}, + {"$ref": "#/$defs/IsEmptyCondition"}, + {"$ref": "#/$defs/IsNullCondition"}, + {"$ref": "#/$defs/HasIdCondition"}, + {"$ref": "#/$defs/HasVectorCondition"}, + {"$ref": "#/$defs/NestedCondition"}, + {"$ref": "#/$defs/Filter"}, + {"$ref": "#/$defs/GeoDistance"}, + {"$ref": "#/$defs/DatetimeExpression"}, + {"$ref": "#/$defs/DatetimeKeyExpression"}, + {"$ref": "#/$defs/MultExpression"}, + {"$ref": "#/$defs/SumExpression"}, + {"$ref": "#/$defs/NegExpression"}, + {"$ref": "#/$defs/AbsExpression"}, + {"$ref": "#/$defs/DivExpression"}, + {"$ref": "#/$defs/SqrtExpression"}, + {"$ref": "#/$defs/PowExpression"}, + {"$ref": "#/$defs/ExpExpression"}, + {"$ref": "#/$defs/Log10Expression"}, + {"$ref": "#/$defs/LnExpression"}, + {"$ref": "#/$defs/LinDecayExpression"}, + {"$ref": "#/$defs/ExpDecayExpression"}, + {"$ref": "#/$defs/GaussDecayExpression"}, + ], + "description": "", + "title": "Neg", + } + }, + "required": ["neg"], + "title": "NegExpression", + "type": "object", + }, + "Nested": { + "additionalProperties": False, + "description": "Select points with payload for a specified nested field", + "properties": { + "key": { + "description": "Select points with payload for a specified nested field", + "title": "Key", + "type": "string", + }, + "filter": { + "$ref": "#/$defs/Filter", + "description": "Select points with payload for a specified nested field", + }, + }, + "required": ["key", "filter"], + "title": "Nested", + "type": "object", + }, + "NestedCondition": { + "additionalProperties": False, + "properties": {"nested": {"$ref": "#/$defs/Nested", "description": ""}}, + "required": ["nested"], + "title": "NestedCondition", + "type": "object", + }, + "PayloadField": { + "additionalProperties": False, + "description": "Payload field", + "properties": { + "key": {"description": "Payload field name", "title": "Key", "type": "string"} + }, + "required": ["key"], + "title": "PayloadField", + "type": "object", + }, + "PowExpression": { + "additionalProperties": False, + "properties": {"pow": {"$ref": "#/$defs/PowParams", "description": ""}}, + "required": ["pow"], + "title": "PowExpression", + "type": "object", + }, + "PowParams": { + "additionalProperties": False, + "properties": { + "base": { + "anyOf": [ + {"type": "number"}, + {"type": "string"}, + {"$ref": "#/$defs/FieldCondition"}, + {"$ref": "#/$defs/IsEmptyCondition"}, + {"$ref": "#/$defs/IsNullCondition"}, + {"$ref": "#/$defs/HasIdCondition"}, + {"$ref": "#/$defs/HasVectorCondition"}, + {"$ref": "#/$defs/NestedCondition"}, + {"$ref": "#/$defs/Filter"}, + {"$ref": "#/$defs/GeoDistance"}, + {"$ref": "#/$defs/DatetimeExpression"}, + {"$ref": "#/$defs/DatetimeKeyExpression"}, + {"$ref": "#/$defs/MultExpression"}, + {"$ref": "#/$defs/SumExpression"}, + {"$ref": "#/$defs/NegExpression"}, + {"$ref": "#/$defs/AbsExpression"}, + {"$ref": "#/$defs/DivExpression"}, + {"$ref": "#/$defs/SqrtExpression"}, + {"$ref": "#/$defs/PowExpression"}, + {"$ref": "#/$defs/ExpExpression"}, + {"$ref": "#/$defs/Log10Expression"}, + {"$ref": "#/$defs/LnExpression"}, + {"$ref": "#/$defs/LinDecayExpression"}, + {"$ref": "#/$defs/ExpDecayExpression"}, + {"$ref": "#/$defs/GaussDecayExpression"}, + ], + "description": "", + "title": "Base", + }, + "exponent": { + "anyOf": [ + {"type": "number"}, + {"type": "string"}, + {"$ref": "#/$defs/FieldCondition"}, + {"$ref": "#/$defs/IsEmptyCondition"}, + {"$ref": "#/$defs/IsNullCondition"}, + {"$ref": "#/$defs/HasIdCondition"}, + {"$ref": "#/$defs/HasVectorCondition"}, + {"$ref": "#/$defs/NestedCondition"}, + {"$ref": "#/$defs/Filter"}, + {"$ref": "#/$defs/GeoDistance"}, + {"$ref": "#/$defs/DatetimeExpression"}, + {"$ref": "#/$defs/DatetimeKeyExpression"}, + {"$ref": "#/$defs/MultExpression"}, + {"$ref": "#/$defs/SumExpression"}, + {"$ref": "#/$defs/NegExpression"}, + {"$ref": "#/$defs/AbsExpression"}, + {"$ref": "#/$defs/DivExpression"}, + {"$ref": "#/$defs/SqrtExpression"}, + {"$ref": "#/$defs/PowExpression"}, + {"$ref": "#/$defs/ExpExpression"}, + {"$ref": "#/$defs/Log10Expression"}, + {"$ref": "#/$defs/LnExpression"}, + {"$ref": "#/$defs/LinDecayExpression"}, + {"$ref": "#/$defs/ExpDecayExpression"}, + {"$ref": "#/$defs/GaussDecayExpression"}, + ], + "description": "", + "title": "Exponent", + }, + }, + "required": ["base", "exponent"], + "title": "PowParams", + "type": "object", + }, + "Range": { + "additionalProperties": False, + "description": "Range filter request", + "properties": { + "lt": { + "anyOf": [{"type": "number"}, {"type": "null"}], + "default": None, + "description": "point.key < range.lt", + "title": "Lt", + }, + "gt": { + "anyOf": [{"type": "number"}, {"type": "null"}], + "default": None, + "description": "point.key > range.gt", + "title": "Gt", + }, + "gte": { + "anyOf": [{"type": "number"}, {"type": "null"}], + "default": None, + "description": "point.key >= range.gte", + "title": "Gte", + }, + "lte": { + "anyOf": [{"type": "number"}, {"type": "null"}], + "default": None, + "description": "point.key <= range.lte", + "title": "Lte", + }, + }, + "title": "Range", + "type": "object", + }, + "SqrtExpression": { + "additionalProperties": False, + "properties": { + "sqrt": { + "anyOf": [ + {"type": "number"}, + {"type": "string"}, + {"$ref": "#/$defs/FieldCondition"}, + {"$ref": "#/$defs/IsEmptyCondition"}, + {"$ref": "#/$defs/IsNullCondition"}, + {"$ref": "#/$defs/HasIdCondition"}, + {"$ref": "#/$defs/HasVectorCondition"}, + {"$ref": "#/$defs/NestedCondition"}, + {"$ref": "#/$defs/Filter"}, + {"$ref": "#/$defs/GeoDistance"}, + {"$ref": "#/$defs/DatetimeExpression"}, + {"$ref": "#/$defs/DatetimeKeyExpression"}, + {"$ref": "#/$defs/MultExpression"}, + {"$ref": "#/$defs/SumExpression"}, + {"$ref": "#/$defs/NegExpression"}, + {"$ref": "#/$defs/AbsExpression"}, + {"$ref": "#/$defs/DivExpression"}, + {"$ref": "#/$defs/SqrtExpression"}, + {"$ref": "#/$defs/PowExpression"}, + {"$ref": "#/$defs/ExpExpression"}, + {"$ref": "#/$defs/Log10Expression"}, + {"$ref": "#/$defs/LnExpression"}, + {"$ref": "#/$defs/LinDecayExpression"}, + {"$ref": "#/$defs/ExpDecayExpression"}, + {"$ref": "#/$defs/GaussDecayExpression"}, + ], + "description": "", + "title": "Sqrt", + } + }, + "required": ["sqrt"], + "title": "SqrtExpression", + "type": "object", + }, + "SumExpression": { + "additionalProperties": False, + "properties": { + "sum": { + "description": "", + "items": { + "anyOf": [ + {"type": "number"}, + {"type": "string"}, + {"$ref": "#/$defs/FieldCondition"}, + {"$ref": "#/$defs/IsEmptyCondition"}, + {"$ref": "#/$defs/IsNullCondition"}, + {"$ref": "#/$defs/HasIdCondition"}, + {"$ref": "#/$defs/HasVectorCondition"}, + {"$ref": "#/$defs/NestedCondition"}, + {"$ref": "#/$defs/Filter"}, + {"$ref": "#/$defs/GeoDistance"}, + {"$ref": "#/$defs/DatetimeExpression"}, + {"$ref": "#/$defs/DatetimeKeyExpression"}, + {"$ref": "#/$defs/MultExpression"}, + {"$ref": "#/$defs/SumExpression"}, + {"$ref": "#/$defs/NegExpression"}, + {"$ref": "#/$defs/AbsExpression"}, + {"$ref": "#/$defs/DivExpression"}, + {"$ref": "#/$defs/SqrtExpression"}, + {"$ref": "#/$defs/PowExpression"}, + {"$ref": "#/$defs/ExpExpression"}, + {"$ref": "#/$defs/Log10Expression"}, + {"$ref": "#/$defs/LnExpression"}, + {"$ref": "#/$defs/LinDecayExpression"}, + {"$ref": "#/$defs/ExpDecayExpression"}, + {"$ref": "#/$defs/GaussDecayExpression"}, + ] + }, + "title": "Sum", + "type": "array", + } + }, + "required": ["sum"], + "title": "SumExpression", + "type": "object", + }, + "ValuesCount": { + "additionalProperties": False, + "description": "Values count filter request", + "properties": { + "lt": { + "anyOf": [{"type": "integer"}, {"type": "null"}], + "default": None, + "description": "point.key.length() < values_count.lt", + "title": "Lt", + }, + "gt": { + "anyOf": [{"type": "integer"}, {"type": "null"}], + "default": None, + "description": "point.key.length() > values_count.gt", + "title": "Gt", + }, + "gte": { + "anyOf": [{"type": "integer"}, {"type": "null"}], + "default": None, + "description": "point.key.length() >= values_count.gte", + "title": "Gte", + }, + "lte": { + "anyOf": [{"type": "integer"}, {"type": "null"}], + "default": None, + "description": "point.key.length() <= values_count.lte", + "title": "Lte", + }, + }, + "title": "ValuesCount", + "type": "object", + }, + "Document": { + "additionalProperties": False, + "description": "WARN: Work-in-progress, unimplemented Text document for embedding. Requires inference infrastructure, unimplemented.", + "properties": { + "text": { + "description": "Text of the document This field will be used as input for the embedding model", + "title": "Text", + "type": "string", + }, + "model": { + "description": "Name of the model used to generate the vector List of available models depends on a provider", + "title": "Model", + "type": "string", + }, + "options": { + "anyOf": [{"additionalProperties": True, "type": "object"}, {"type": "null"}], + "default": None, + "description": "Parameters for the model Values of the parameters are model-specific", + "title": "Options", + }, + }, + "required": ["text", "model"], + "title": "Document", + "type": "object", + }, + "Image": { + "additionalProperties": False, + "description": "WARN: Work-in-progress, unimplemented Image object for embedding. Requires inference infrastructure, unimplemented.", + "properties": { + "image": { + "description": "Image data: base64 encoded image or an URL", + "title": "Image", + }, + "model": { + "description": "Name of the model used to generate the vector List of available models depends on a provider", + "title": "Model", + "type": "string", + }, + "options": { + "anyOf": [{"additionalProperties": True, "type": "object"}, {"type": "null"}], + "default": None, + "description": "Parameters for the model Values of the parameters are model-specific", + "title": "Options", + }, + }, + "required": ["image", "model"], + "title": "Image", + "type": "object", + }, + "InferenceObject": { + "additionalProperties": False, + "description": "WARN: Work-in-progress, unimplemented Custom object for embedding. Requires inference infrastructure, unimplemented.", + "properties": { + "object": { + "description": "Arbitrary data, used as input for the embedding model Used if the model requires more than one input or a custom input", + "title": "Object", + }, + "model": { + "description": "Name of the model used to generate the vector List of available models depends on a provider", + "title": "Model", + "type": "string", + }, + "options": { + "anyOf": [{"additionalProperties": True, "type": "object"}, {"type": "null"}], + "default": None, + "description": "Parameters for the model Values of the parameters are model-specific", + "title": "Options", + }, + }, + "required": ["object", "model"], + "title": "InferenceObject", + "type": "object", + }, + "SparseVector": { + "additionalProperties": False, + "description": "Sparse vector structure", + "properties": { + "indices": { + "description": "Indices must be unique", + "items": {"type": "integer"}, + "title": "Indices", + "type": "array", + }, + "values": { + "description": "Values and indices must be the same length", + "items": {"type": "number"}, + "title": "Values", + "type": "array", + }, + }, + "required": ["indices", "values"], + "title": "SparseVector", + "type": "object", + }, + "BinaryQuantizationConfig": { + "additionalProperties": False, + "properties": { + "always_ram": { + "anyOf": [{"type": "boolean"}, {"type": "null"}], + "default": None, + "description": "", + "title": "Always Ram", + }, + "encoding": { + "anyOf": [{"$ref": "#/$defs/BinaryQuantizationEncoding"}, {"type": "null"}], + "default": None, + "description": "", + }, + "query_encoding": { + "anyOf": [{"$ref": "#/$defs/BinaryQuantizationQueryEncoding"}, {"type": "null"}], + "default": None, + "description": "Asymmetric quantization configuration allows a query to have different quantization than stored vectors. It can increase the accuracy of search at the cost of performance.", + }, + }, + "title": "BinaryQuantizationConfig", + "type": "object", + }, + "BinaryQuantizationEncoding": { + "enum": ["one_bit", "two_bits", "one_and_half_bits"], + "title": "BinaryQuantizationEncoding", + "type": "string", + }, + "BinaryQuantizationQueryEncoding": { + "enum": ["default", "binary", "scalar4bits", "scalar8bits"], + "title": "BinaryQuantizationQueryEncoding", + "type": "string", + }, + "BoolIndexType": {"enum": ["bool"], "title": "BoolIndexType", "type": "string"}, + "CreateAlias": { + "additionalProperties": False, + "description": "Create alternative name for a collection. Collection will be available under both names for search, retrieve,", + "properties": { + "collection_name": { + "description": "Create alternative name for a collection. Collection will be available under both names for search, retrieve,", + "title": "Collection Name", + "type": "string", + }, + "alias_name": { + "description": "Create alternative name for a collection. Collection will be available under both names for search, retrieve,", + "title": "Alias Name", + "type": "string", + }, + }, + "required": ["collection_name", "alias_name"], + "title": "CreateAlias", + "type": "object", + }, + "CreateAliasOperation": { + "additionalProperties": False, + "properties": {"create_alias": {"$ref": "#/$defs/CreateAlias", "description": ""}}, + "required": ["create_alias"], + "title": "CreateAliasOperation", + "type": "object", + }, + "DeleteAlias": { + "additionalProperties": False, + "description": "Delete alias if exists", + "properties": { + "alias_name": { + "description": "Delete alias if exists", + "title": "Alias Name", + "type": "string", + } + }, + "required": ["alias_name"], + "title": "DeleteAlias", + "type": "object", + }, + "DeleteAliasOperation": { + "additionalProperties": False, + "description": "Delete alias if exists", + "properties": {"delete_alias": {"$ref": "#/$defs/DeleteAlias"}}, + "required": ["delete_alias"], + "title": "DeleteAliasOperation", + "type": "object", + }, + "RenameAlias": { + "additionalProperties": False, + "description": "Change alias to a new one", + "properties": { + "old_alias_name": { + "description": "Change alias to a new one", + "title": "Old Alias Name", + "type": "string", + }, + "new_alias_name": { + "description": "Change alias to a new one", + "title": "New Alias Name", + "type": "string", + }, + }, + "required": ["old_alias_name", "new_alias_name"], + "title": "RenameAlias", + "type": "object", + }, + "RenameAliasOperation": { + "additionalProperties": False, + "description": "Change alias to a new one", + "properties": {"rename_alias": {"$ref": "#/$defs/RenameAlias"}}, + "required": ["rename_alias"], + "title": "RenameAliasOperation", + "type": "object", + }, + "FilterSelector": { + "additionalProperties": False, + "properties": { + "filter": {"$ref": "#/$defs/Filter", "description": ""}, + "shard_key": { + "anyOf": [ + {"type": "integer"}, + {"type": "string"}, + { + "items": {"anyOf": [{"type": "integer"}, {"type": "string"}]}, + "type": "array", + }, + {"type": "null"}, + ], + "default": None, + "description": "", + "title": "Shard Key", + }, + }, + "required": ["filter"], + "title": "FilterSelector", + "type": "object", + }, + "PointIdsList": { + "additionalProperties": False, + "properties": { + "points": { + "description": "", + "items": {"anyOf": [{"type": "integer"}, {"type": "string"}]}, + "title": "Points", + "type": "array", + }, + "shard_key": { + "anyOf": [ + {"type": "integer"}, + {"type": "string"}, + { + "items": {"anyOf": [{"type": "integer"}, {"type": "string"}]}, + "type": "array", + }, + {"type": "null"}, + ], + "default": None, + "description": "", + "title": "Shard Key", + }, + }, + "required": ["points"], + "title": "PointIdsList", + "type": "object", + }, + "ContextPair": { + "additionalProperties": False, + "properties": { + "positive": { + "anyOf": [ + {"items": {"type": "number"}, "type": "array"}, + {"$ref": "#/$defs/SparseVector"}, + {"items": {"items": {"type": "number"}, "type": "array"}, "type": "array"}, + {"type": "integer"}, + {"type": "string"}, + {"$ref": "#/$defs/Document"}, + {"$ref": "#/$defs/Image"}, + {"$ref": "#/$defs/InferenceObject"}, + ], + "description": "", + "title": "Positive", + }, + "negative": { + "anyOf": [ + {"items": {"type": "number"}, "type": "array"}, + {"$ref": "#/$defs/SparseVector"}, + {"items": {"items": {"type": "number"}, "type": "array"}, "type": "array"}, + {"type": "integer"}, + {"type": "string"}, + {"$ref": "#/$defs/Document"}, + {"$ref": "#/$defs/Image"}, + {"$ref": "#/$defs/InferenceObject"}, + ], + "description": "", + "title": "Negative", + }, + }, + "required": ["positive", "negative"], + "title": "ContextPair", + "type": "object", + }, + "BinaryQuantization": { + "additionalProperties": False, + "properties": {"binary": {"$ref": "#/$defs/BinaryQuantizationConfig", "description": ""}}, + "required": ["binary"], + "title": "BinaryQuantization", + "type": "object", + }, + "CompressionRatio": { + "enum": ["x4", "x8", "x16", "x32", "x64"], + "title": "CompressionRatio", + "type": "string", + }, + "Datatype": {"enum": ["float32", "uint8", "float16"], "title": "Datatype", "type": "string"}, + "Distance": { + "description": "Type of internal tags, build from payload Distance function types used to compare vectors", + "enum": ["Cosine", "Euclid", "Dot", "Manhattan"], + "title": "Distance", + "type": "string", + }, + "HnswConfigDiff": { + "additionalProperties": False, + "properties": { + "m": { + "anyOf": [{"type": "integer"}, {"type": "null"}], + "default": None, + "description": "Number of edges per node in the index graph. Larger the value - more accurate the search, more space required.", + "title": "M", + }, + "ef_construct": { + "anyOf": [{"type": "integer"}, {"type": "null"}], + "default": None, + "description": "Number of neighbours to consider during the index building. Larger the value - more accurate the search, more time required to build the index.", + "title": "Ef Construct", + }, + "full_scan_threshold": { + "anyOf": [{"type": "integer"}, {"type": "null"}], + "default": None, + "description": "Minimal size (in kilobytes) of vectors for additional payload-based indexing. If payload chunk is smaller than `full_scan_threshold_kb` additional indexing won't be used - in this case full-scan search should be preferred by query planner and additional indexing is not required. Note: 1Kb = 1 vector of size 256", + "title": "Full Scan Threshold", + }, + "max_indexing_threads": { + "anyOf": [{"type": "integer"}, {"type": "null"}], + "default": None, + "description": "Number of parallel threads used for background index building. If 0 - automatically select from 8 to 16. Best to keep between 8 and 16 to prevent likelihood of building broken/inefficient HNSW graphs. On small CPUs, less threads are used.", + "title": "Max Indexing Threads", + }, + "on_disk": { + "anyOf": [{"type": "boolean"}, {"type": "null"}], + "default": None, + "description": "Store HNSW index on disk. If set to false, the index will be stored in RAM. Default: false", + "title": "On Disk", + }, + "payload_m": { + "anyOf": [{"type": "integer"}, {"type": "null"}], + "default": None, + "description": "Custom M param for additional payload-aware HNSW links. If not set, default M will be used.", + "title": "Payload M", + }, + }, + "title": "HnswConfigDiff", + "type": "object", + }, + "InitFrom": { + "additionalProperties": False, + "description": "Operation for creating new collection and (optionally) specify index params", + "properties": { + "collection": { + "description": "Operation for creating new collection and (optionally) specify index params", + "title": "Collection", + "type": "string", + } + }, + "required": ["collection"], + "title": "InitFrom", + "type": "object", + }, + "MaxOptimizationThreadsSetting": { + "enum": ["auto"], + "title": "MaxOptimizationThreadsSetting", + "type": "string", + }, + "Modifier": { + "description": "If used, include weight modification, which will be applied to sparse vectors at query time: None - no modification (default) Idf - inverse document frequency, based on statistics of the collection", + "enum": ["none", "idf"], + "title": "Modifier", + "type": "string", + }, + "MultiVectorComparator": { + "enum": ["max_sim"], + "title": "MultiVectorComparator", + "type": "string", + }, + "MultiVectorConfig": { + "additionalProperties": False, + "properties": {"comparator": {"$ref": "#/$defs/MultiVectorComparator", "description": ""}}, + "required": ["comparator"], + "title": "MultiVectorConfig", + "type": "object", + }, + "OptimizersConfigDiff": { + "additionalProperties": False, + "properties": { + "deleted_threshold": { + "anyOf": [{"type": "number"}, {"type": "null"}], + "default": None, + "description": "The minimal fraction of deleted vectors in a segment, required to perform segment optimization", + "title": "Deleted Threshold", + }, + "vacuum_min_vector_number": { + "anyOf": [{"type": "integer"}, {"type": "null"}], + "default": None, + "description": "The minimal number of vectors in a segment, required to perform segment optimization", + "title": "Vacuum Min Vector Number", + }, + "default_segment_number": { + "anyOf": [{"type": "integer"}, {"type": "null"}], + "default": None, + "description": "Target amount of segments optimizer will try to keep. Real amount of segments may vary depending on multiple parameters: - Amount of stored points - Current write RPS It is recommended to select default number of segments as a factor of the number of search threads, so that each segment would be handled evenly by one of the threads If `default_segment_number = 0`, will be automatically selected by the number of available CPUs", + "title": "Default Segment Number", + }, + "max_segment_size": { + "anyOf": [{"type": "integer"}, {"type": "null"}], + "default": None, + "description": "Do not create segments larger this size (in kilobytes). Large segments might require disproportionately long indexation times, therefore it makes sense to limit the size of segments. If indexation speed have more priority for your - make this parameter lower. If search speed is more important - make this parameter higher. Note: 1Kb = 1 vector of size 256", + "title": "Max Segment Size", + }, + "memmap_threshold": { + "anyOf": [{"type": "integer"}, {"type": "null"}], + "default": None, + "description": "Maximum size (in kilobytes) of vectors to store in-memory per segment. Segments larger than this threshold will be stored as read-only memmapped file. Memmap storage is disabled by default, to enable it, set this threshold to a reasonable value. To disable memmap storage, set this to `0`. Note: 1Kb = 1 vector of size 256 Deprecated since Qdrant 1.15.0", + "title": "Memmap Threshold", + }, + "indexing_threshold": { + "anyOf": [{"type": "integer"}, {"type": "null"}], + "default": None, + "description": "Maximum size (in kilobytes) of vectors allowed for plain index, exceeding this threshold will enable vector indexing Default value is 20,000, based on <https://github.com/google-research/google-research/blob/master/scann/docs/algorithms.md>. To disable vector indexing, set to `0`. Note: 1kB = 1 vector of size 256.", + "title": "Indexing Threshold", + }, + "flush_interval_sec": { + "anyOf": [{"type": "integer"}, {"type": "null"}], + "default": None, + "description": "Minimum interval between forced flushes.", + "title": "Flush Interval Sec", + }, + "max_optimization_threads": { + "anyOf": [ + {"type": "integer"}, + {"$ref": "#/$defs/MaxOptimizationThreadsSetting"}, + {"type": "null"}, + ], + "default": None, + "description": "Max number of threads (jobs) for running optimizations per shard. Note: each optimization job will also use `max_indexing_threads` threads by itself for index building. If "auto" - have no limit and choose dynamically to saturate CPU. If 0 - no optimization threads, optimizations will be disabled.", + "title": "Max Optimization Threads", + }, + }, + "title": "OptimizersConfigDiff", + "type": "object", + }, + "ProductQuantization": { + "additionalProperties": False, + "properties": { + "product": {"$ref": "#/$defs/ProductQuantizationConfig", "description": ""} + }, + "required": ["product"], + "title": "ProductQuantization", + "type": "object", + }, + "ProductQuantizationConfig": { + "additionalProperties": False, + "properties": { + "compression": {"$ref": "#/$defs/CompressionRatio", "description": ""}, + "always_ram": { + "anyOf": [{"type": "boolean"}, {"type": "null"}], + "default": None, + "description": "", + "title": "Always Ram", + }, + }, + "required": ["compression"], + "title": "ProductQuantizationConfig", + "type": "object", + }, + "ScalarQuantization": { + "additionalProperties": False, + "properties": {"scalar": {"$ref": "#/$defs/ScalarQuantizationConfig", "description": ""}}, + "required": ["scalar"], + "title": "ScalarQuantization", + "type": "object", + }, + "ScalarQuantizationConfig": { + "additionalProperties": False, + "properties": { + "type": {"$ref": "#/$defs/ScalarType", "description": ""}, + "quantile": { + "anyOf": [{"type": "number"}, {"type": "null"}], + "default": None, + "description": "Quantile for quantization. Expected value range in [0.5, 1.0]. If not set - use the whole range of values", + "title": "Quantile", + }, + "always_ram": { + "anyOf": [{"type": "boolean"}, {"type": "null"}], + "default": None, + "description": "If true - quantized vectors always will be stored in RAM, ignoring the config of main storage", + "title": "Always Ram", + }, + }, + "required": ["type"], + "title": "ScalarQuantizationConfig", + "type": "object", + }, + "ScalarType": {"enum": ["int8"], "title": "ScalarType", "type": "string"}, + "ShardingMethod": {"enum": ["auto", "custom"], "title": "ShardingMethod", "type": "string"}, + "SparseIndexParams": { + "additionalProperties": False, + "description": "Configuration for sparse inverted index.", + "properties": { + "full_scan_threshold": { + "anyOf": [{"type": "integer"}, {"type": "null"}], + "default": None, + "description": "We prefer a full scan search upto (excluding) this number of vectors. Note: this is number of vectors, not KiloBytes.", + "title": "Full Scan Threshold", + }, + "on_disk": { + "anyOf": [{"type": "boolean"}, {"type": "null"}], + "default": None, + "description": "Store index on disk. If set to false, the index will be stored in RAM. Default: false", + "title": "On Disk", + }, + "datatype": { + "anyOf": [{"$ref": "#/$defs/Datatype"}, {"type": "null"}], + "default": None, + "description": "Defines which datatype should be used for the index. Choosing different datatypes allows to optimize memory usage and performance vs accuracy. - For `float32` datatype - vectors are stored as single-precision floating point numbers, 4 bytes. - For `float16` datatype - vectors are stored as half-precision floating point numbers, 2 bytes. - For `uint8` datatype - vectors are quantized to unsigned 8-bit integers, 1 byte. Quantization to fit byte range `[0, 255]` happens during indexing automatically, so the actual vector data does not need to conform to this range.", + }, + }, + "title": "SparseIndexParams", + "type": "object", + }, + "SparseVectorParams": { + "additionalProperties": False, + "description": "Params of single sparse vector data storage", + "properties": { + "index": { + "anyOf": [{"$ref": "#/$defs/SparseIndexParams"}, {"type": "null"}], + "default": None, + "description": "Custom params for index. If none - values from collection configuration are used.", + }, + "modifier": { + "anyOf": [{"$ref": "#/$defs/Modifier"}, {"type": "null"}], + "default": None, + "description": "Configures addition value modifications for sparse vectors. Default: none", + }, + }, + "title": "SparseVectorParams", + "type": "object", + }, + "StrictModeConfig": { + "additionalProperties": False, + "properties": { + "enabled": { + "anyOf": [{"type": "boolean"}, {"type": "null"}], + "default": None, + "description": "Whether strict mode is enabled for a collection or not.", + "title": "Enabled", + }, + "max_query_limit": { + "anyOf": [{"type": "integer"}, {"type": "null"}], + "default": None, + "description": "Max allowed `limit` parameter for all APIs that don't have their own max limit.", + "title": "Max Query Limit", + }, + "max_timeout": { + "anyOf": [{"type": "integer"}, {"type": "null"}], + "default": None, + "description": "Max allowed `timeout` parameter.", + "title": "Max Timeout", + }, + "unindexed_filtering_retrieve": { + "anyOf": [{"type": "boolean"}, {"type": "null"}], + "default": None, + "description": "Allow usage of unindexed fields in retrieval based (e.g. search) filters.", + "title": "Unindexed Filtering Retrieve", + }, + "unindexed_filtering_update": { + "anyOf": [{"type": "boolean"}, {"type": "null"}], + "default": None, + "description": "Allow usage of unindexed fields in filtered updates (e.g. delete by payload).", + "title": "Unindexed Filtering Update", + }, + "search_max_hnsw_ef": { + "anyOf": [{"type": "integer"}, {"type": "null"}], + "default": None, + "description": "Max HNSW value allowed in search parameters.", + "title": "Search Max Hnsw Ef", + }, + "search_allow_exact": { + "anyOf": [{"type": "boolean"}, {"type": "null"}], + "default": None, + "description": "Whether exact search is allowed or not.", + "title": "Search Allow Exact", + }, + "search_max_oversampling": { + "anyOf": [{"type": "number"}, {"type": "null"}], + "default": None, + "description": "Max oversampling value allowed in search.", + "title": "Search Max Oversampling", + }, + "upsert_max_batchsize": { + "anyOf": [{"type": "integer"}, {"type": "null"}], + "default": None, + "description": "Max batchsize when upserting", + "title": "Upsert Max Batchsize", + }, + "max_collection_vector_size_bytes": { + "anyOf": [{"type": "integer"}, {"type": "null"}], + "default": None, + "description": "Max size of a collections vector storage in bytes, ignoring replicas.", + "title": "Max Collection Vector Size Bytes", + }, + "read_rate_limit": { + "anyOf": [{"type": "integer"}, {"type": "null"}], + "default": None, + "description": "Max number of read operations per minute per replica", + "title": "Read Rate Limit", + }, + "write_rate_limit": { + "anyOf": [{"type": "integer"}, {"type": "null"}], + "default": None, + "description": "Max number of write operations per minute per replica", + "title": "Write Rate Limit", + }, + "max_collection_payload_size_bytes": { + "anyOf": [{"type": "integer"}, {"type": "null"}], + "default": None, + "description": "Max size of a collections payload storage in bytes", + "title": "Max Collection Payload Size Bytes", + }, + "max_points_count": { + "anyOf": [{"type": "integer"}, {"type": "null"}], + "default": None, + "description": "Max number of points estimated in a collection", + "title": "Max Points Count", + }, + "filter_max_conditions": { + "anyOf": [{"type": "integer"}, {"type": "null"}], + "default": None, + "description": "Max conditions a filter can have.", + "title": "Filter Max Conditions", + }, + "condition_max_size": { + "anyOf": [{"type": "integer"}, {"type": "null"}], + "default": None, + "description": "Max size of a condition, eg. items in `MatchAny`.", + "title": "Condition Max Size", + }, + "multivector_config": { + "anyOf": [ + { + "additionalProperties": {"$ref": "#/$defs/StrictModeMultivector"}, + "type": "object", + }, + {"type": "null"}, + ], + "default": None, + "description": "Multivector configuration", + "title": "Multivector Config", + }, + "sparse_config": { + "anyOf": [ + { + "additionalProperties": {"$ref": "#/$defs/StrictModeSparse"}, + "type": "object", + }, + {"type": "null"}, + ], + "default": None, + "description": "Sparse vector configuration", + "title": "Sparse Config", + }, + }, + "title": "StrictModeConfig", + "type": "object", + }, + "StrictModeMultivector": { + "additionalProperties": False, + "properties": { + "max_vectors": { + "anyOf": [{"type": "integer"}, {"type": "null"}], + "default": None, + "description": "Max number of vectors in a multivector", + "title": "Max Vectors", + } + }, + "title": "StrictModeMultivector", + "type": "object", + }, + "StrictModeSparse": { + "additionalProperties": False, + "properties": { + "max_length": { + "anyOf": [{"type": "integer"}, {"type": "null"}], + "default": None, + "description": "Max length of sparse vector", + "title": "Max Length", + } + }, + "title": "StrictModeSparse", + "type": "object", + }, + "VectorParams": { + "additionalProperties": False, + "description": "Params of single vector data storage", + "properties": { + "size": {"description": "Size of a vectors used", "title": "Size", "type": "integer"}, + "distance": { + "$ref": "#/$defs/Distance", + "description": "Params of single vector data storage", + }, + "hnsw_config": { + "anyOf": [{"$ref": "#/$defs/HnswConfigDiff"}, {"type": "null"}], + "default": None, + "description": "Custom params for HNSW index. If none - values from collection configuration are used.", + }, + "quantization_config": { + "anyOf": [ + {"$ref": "#/$defs/ScalarQuantization"}, + {"$ref": "#/$defs/ProductQuantization"}, + {"$ref": "#/$defs/BinaryQuantization"}, + {"type": "null"}, + ], + "default": None, + "description": "Custom params for quantization. If none - values from collection configuration are used.", + "title": "Quantization Config", + }, + "on_disk": { + "anyOf": [{"type": "boolean"}, {"type": "null"}], + "default": None, + "description": "If true, vectors are served from disk, improving RAM usage at the cost of latency Default: false", + "title": "On Disk", + }, + "datatype": { + "anyOf": [{"$ref": "#/$defs/Datatype"}, {"type": "null"}], + "default": None, + "description": "Defines which datatype should be used to represent vectors in the storage. Choosing different datatypes allows to optimize memory usage and performance vs accuracy. - For `float32` datatype - vectors are stored as single-precision floating point numbers, 4 bytes. - For `float16` datatype - vectors are stored as half-precision floating point numbers, 2 bytes. - For `uint8` datatype - vectors are stored as unsigned 8-bit integers, 1 byte. It expects vector elements to be in range `[0, 255]`.", + }, + "multivector_config": { + "anyOf": [{"$ref": "#/$defs/MultiVectorConfig"}, {"type": "null"}], + "default": None, + "description": "Params of single vector data storage", + }, + }, + "required": ["size", "distance"], + "title": "VectorParams", + "type": "object", + }, + "WalConfigDiff": { + "additionalProperties": False, + "properties": { + "wal_capacity_mb": { + "anyOf": [{"type": "integer"}, {"type": "null"}], + "default": None, + "description": "Size of a single WAL segment in MB", + "title": "Wal Capacity Mb", + }, + "wal_segments_ahead": { + "anyOf": [{"type": "integer"}, {"type": "null"}], + "default": None, + "description": "Number of WAL segments to create ahead of actually used ones", + "title": "Wal Segments Ahead", + }, + }, + "title": "WalConfigDiff", + "type": "object", + }, + "BoolIndexParams": { + "additionalProperties": False, + "properties": { + "type": {"$ref": "#/$defs/BoolIndexType", "description": ""}, + "on_disk": { + "anyOf": [{"type": "boolean"}, {"type": "null"}], + "default": None, + "description": "If true, store the index on disk. Default: false.", + "title": "On Disk", + }, + }, + "required": ["type"], + "title": "BoolIndexParams", + "type": "object", + }, + "DatetimeIndexParams": { + "additionalProperties": False, + "properties": { + "type": {"$ref": "#/$defs/DatetimeIndexType", "description": ""}, + "is_principal": { + "anyOf": [{"type": "boolean"}, {"type": "null"}], + "default": None, + "description": "If true - use this key to organize storage of the collection data. This option assumes that this key will be used in majority of filtered requests.", + "title": "Is Principal", + }, + "on_disk": { + "anyOf": [{"type": "boolean"}, {"type": "null"}], + "default": None, + "description": "If true, store the index on disk. Default: false.", + "title": "On Disk", + }, + }, + "required": ["type"], + "title": "DatetimeIndexParams", + "type": "object", + }, + "DatetimeIndexType": {"enum": ["datetime"], "title": "DatetimeIndexType", "type": "string"}, + "FloatIndexParams": { + "additionalProperties": False, + "properties": { + "type": {"$ref": "#/$defs/FloatIndexType", "description": ""}, + "is_principal": { + "anyOf": [{"type": "boolean"}, {"type": "null"}], + "default": None, + "description": "If true - use this key to organize storage of the collection data. This option assumes that this key will be used in majority of filtered requests.", + "title": "Is Principal", + }, + "on_disk": { + "anyOf": [{"type": "boolean"}, {"type": "null"}], + "default": None, + "description": "If true, store the index on disk. Default: false.", + "title": "On Disk", + }, + }, + "required": ["type"], + "title": "FloatIndexParams", + "type": "object", + }, + "FloatIndexType": {"enum": ["float"], "title": "FloatIndexType", "type": "string"}, + "GeoIndexParams": { + "additionalProperties": False, + "properties": { + "type": {"$ref": "#/$defs/GeoIndexType", "description": ""}, + "on_disk": { + "anyOf": [{"type": "boolean"}, {"type": "null"}], + "default": None, + "description": "If true, store the index on disk. Default: false.", + "title": "On Disk", + }, + }, + "required": ["type"], + "title": "GeoIndexParams", + "type": "object", + }, + "GeoIndexType": {"enum": ["geo"], "title": "GeoIndexType", "type": "string"}, + "IntegerIndexParams": { + "additionalProperties": False, + "properties": { + "type": {"$ref": "#/$defs/IntegerIndexType", "description": ""}, + "lookup": { + "anyOf": [{"type": "boolean"}, {"type": "null"}], + "default": None, + "description": "If true - support direct lookups. Default is true.", + "title": "Lookup", + }, + "range": { + "anyOf": [{"type": "boolean"}, {"type": "null"}], + "default": None, + "description": "If true - support ranges filters. Default is true.", + "title": "Range", + }, + "is_principal": { + "anyOf": [{"type": "boolean"}, {"type": "null"}], + "default": None, + "description": "If true - use this key to organize storage of the collection data. This option assumes that this key will be used in majority of filtered requests. Default is false.", + "title": "Is Principal", + }, + "on_disk": { + "anyOf": [{"type": "boolean"}, {"type": "null"}], + "default": None, + "description": "If true, store the index on disk. Default: false. Default is false.", + "title": "On Disk", + }, + }, + "required": ["type"], + "title": "IntegerIndexParams", + "type": "object", + }, + "IntegerIndexType": {"enum": ["integer"], "title": "IntegerIndexType", "type": "string"}, + "KeywordIndexParams": { + "additionalProperties": False, + "properties": { + "type": {"$ref": "#/$defs/KeywordIndexType", "description": ""}, + "is_tenant": { + "anyOf": [{"type": "boolean"}, {"type": "null"}], + "default": None, + "description": "If true - used for tenant optimization. Default: false.", + "title": "Is Tenant", + }, + "on_disk": { + "anyOf": [{"type": "boolean"}, {"type": "null"}], + "default": None, + "description": "If true, store the index on disk. Default: false.", + "title": "On Disk", + }, + }, + "required": ["type"], + "title": "KeywordIndexParams", + "type": "object", + }, + "KeywordIndexType": {"enum": ["keyword"], "title": "KeywordIndexType", "type": "string"}, + "Language": { + "enum": [ + "arabic", + "azerbaijani", + "basque", + "bengali", + "catalan", + "chinese", + "danish", + "dutch", + "english", + "finnish", + "french", + "german", + "greek", + "hebrew", + "hinglish", + "hungarian", + "indonesian", + "italian", + "japanese", + "kazakh", + "nepali", + "norwegian", + "portuguese", + "romanian", + "russian", + "slovene", + "spanish", + "swedish", + "tajik", + "turkish", + ], + "title": "Language", + "type": "string", + }, + "PayloadSchemaType": { + "description": "All possible names of payload types", + "enum": ["keyword", "integer", "float", "geo", "text", "bool", "datetime", "uuid"], + "title": "PayloadSchemaType", + "type": "string", + }, + "Snowball": {"enum": ["snowball"], "title": "Snowball", "type": "string"}, + "SnowballLanguage": { + "description": "Languages supported by snowball stemmer.", + "enum": [ + "arabic", + "armenian", + "danish", + "dutch", + "english", + "finnish", + "french", + "german", + "greek", + "hungarian", + "italian", + "norwegian", + "portuguese", + "romanian", + "russian", + "spanish", + "swedish", + "tamil", + "turkish", + ], + "title": "SnowballLanguage", + "type": "string", + }, + "SnowballParams": { + "additionalProperties": False, + "properties": { + "type": {"$ref": "#/$defs/Snowball", "description": ""}, + "language": {"$ref": "#/$defs/SnowballLanguage", "description": ""}, + }, + "required": ["type", "language"], + "title": "SnowballParams", + "type": "object", + }, + "StopwordsSet": { + "additionalProperties": False, + "properties": { + "languages": { + "anyOf": [ + {"items": {"$ref": "#/$defs/Language"}, "type": "array"}, + {"type": "null"}, + ], + "default": None, + "description": "", + "title": "Languages", + }, + "custom": { + "anyOf": [{"items": {"type": "string"}, "type": "array"}, {"type": "null"}], + "default": None, + "description": "", + "title": "Custom", + }, + }, + "title": "StopwordsSet", + "type": "object", + }, + "TextIndexParams": { + "additionalProperties": False, + "properties": { + "type": {"$ref": "#/$defs/TextIndexType", "description": ""}, + "tokenizer": { + "anyOf": [{"$ref": "#/$defs/TokenizerType"}, {"type": "null"}], + "default": None, + "description": "", + }, + "min_token_len": { + "anyOf": [{"type": "integer"}, {"type": "null"}], + "default": None, + "description": "Minimum characters to be tokenized.", + "title": "Min Token Len", + }, + "max_token_len": { + "anyOf": [{"type": "integer"}, {"type": "null"}], + "default": None, + "description": "Maximum characters to be tokenized.", + "title": "Max Token Len", + }, + "lowercase": { + "anyOf": [{"type": "boolean"}, {"type": "null"}], + "default": None, + "description": "If true, lowercase all tokens. Default: true.", + "title": "Lowercase", + }, + "phrase_matching": { + "anyOf": [{"type": "boolean"}, {"type": "null"}], + "default": None, + "description": "If true, support phrase matching. Default: false.", + "title": "Phrase Matching", + }, + "stopwords": { + "anyOf": [ + {"$ref": "#/$defs/Language"}, + {"$ref": "#/$defs/StopwordsSet"}, + {"type": "null"}, + ], + "default": None, + "description": "Ignore this set of tokens. Can select from predefined languages and/or provide a custom set.", + "title": "Stopwords", + }, + "on_disk": { + "anyOf": [{"type": "boolean"}, {"type": "null"}], + "default": None, + "description": "If true, store the index on disk. Default: false.", + "title": "On Disk", + }, + "stemmer": { + "anyOf": [{"$ref": "#/$defs/SnowballParams"}, {"type": "null"}], + "default": None, + "description": "Algorithm for stemming. Default: disabled.", + }, + }, + "required": ["type"], + "title": "TextIndexParams", + "type": "object", + }, + "TextIndexType": {"enum": ["text"], "title": "TextIndexType", "type": "string"}, + "TokenizerType": { + "enum": ["prefix", "whitespace", "word", "multilingual"], + "title": "TokenizerType", + "type": "string", + }, + "UuidIndexParams": { + "additionalProperties": False, + "properties": { + "type": {"$ref": "#/$defs/UuidIndexType", "description": ""}, + "is_tenant": { + "anyOf": [{"type": "boolean"}, {"type": "null"}], + "default": None, + "description": "If true - used for tenant optimization.", + "title": "Is Tenant", + }, + "on_disk": { + "anyOf": [{"type": "boolean"}, {"type": "null"}], + "default": None, + "description": "If true, store the index on disk. Default: false.", + "title": "On Disk", + }, + }, + "required": ["type"], + "title": "UuidIndexParams", + "type": "object", + }, + "UuidIndexType": {"enum": ["uuid"], "title": "UuidIndexType", "type": "string"}, + "CreateShardingKey": { + "additionalProperties": False, + "properties": { + "shard_key": { + "anyOf": [{"type": "integer"}, {"type": "string"}], + "description": "", + "title": "Shard Key", + }, + "shards_number": { + "anyOf": [{"type": "integer"}, {"type": "null"}], + "default": None, + "description": "How many shards to create for this key If not specified, will use the default value from config", + "title": "Shards Number", + }, + "replication_factor": { + "anyOf": [{"type": "integer"}, {"type": "null"}], + "default": None, + "description": "How many replicas to create for each shard If not specified, will use the default value from config", + "title": "Replication Factor", + }, + "placement": { + "anyOf": [{"items": {"type": "integer"}, "type": "array"}, {"type": "null"}], + "default": None, + "description": "Placement of shards for this key List of peer ids, that can be used to place shards for this key If not specified, will be randomly placed among all peers", + "title": "Placement", + }, + }, + "required": ["shard_key"], + "title": "CreateShardingKey", + "type": "object", + }, + "DeletePayload": { + "additionalProperties": False, + "description": "This data structure is used in API interface and applied across multiple shards", + "properties": { + "keys": { + "description": "List of payload keys to remove from payload", + "items": {"type": "string"}, + "title": "Keys", + "type": "array", + }, + "points": { + "anyOf": [ + { + "items": {"anyOf": [{"type": "integer"}, {"type": "string"}]}, + "type": "array", + }, + {"type": "null"}, + ], + "default": None, + "description": "Deletes values from each point in this list", + "title": "Points", + }, + "filter": { + "anyOf": [{"$ref": "#/$defs/Filter"}, {"type": "null"}], + "default": None, + "description": "Deletes values from points that satisfy this filter condition", + }, + "shard_key": { + "anyOf": [ + {"type": "integer"}, + {"type": "string"}, + { + "items": {"anyOf": [{"type": "integer"}, {"type": "string"}]}, + "type": "array", + }, + {"type": "null"}, + ], + "default": None, + "description": "This data structure is used in API interface and applied across multiple shards", + "title": "Shard Key", + }, + }, + "required": ["keys"], + "title": "DeletePayload", + "type": "object", + }, + "DeleteVectors": { + "additionalProperties": False, + "properties": { + "points": { + "anyOf": [ + { + "items": {"anyOf": [{"type": "integer"}, {"type": "string"}]}, + "type": "array", + }, + {"type": "null"}, + ], + "default": None, + "description": "Deletes values from each point in this list", + "title": "Points", + }, + "filter": { + "anyOf": [{"$ref": "#/$defs/Filter"}, {"type": "null"}], + "default": None, + "description": "Deletes values from points that satisfy this filter condition", + }, + "vector": { + "description": "Vector names", + "items": {"type": "string"}, + "title": "Vector", + "type": "array", + }, + "shard_key": { + "anyOf": [ + {"type": "integer"}, + {"type": "string"}, + { + "items": {"anyOf": [{"type": "integer"}, {"type": "string"}]}, + "type": "array", + }, + {"type": "null"}, + ], + "default": None, + "description": "", + "title": "Shard Key", + }, + }, + "required": ["vector"], + "title": "DeleteVectors", + "type": "object", + }, + "DiscoverInput": { + "additionalProperties": False, + "properties": { + "target": { + "anyOf": [ + {"items": {"type": "number"}, "type": "array"}, + {"$ref": "#/$defs/SparseVector"}, + {"items": {"items": {"type": "number"}, "type": "array"}, "type": "array"}, + {"type": "integer"}, + {"type": "string"}, + {"$ref": "#/$defs/Document"}, + {"$ref": "#/$defs/Image"}, + {"$ref": "#/$defs/InferenceObject"}, + ], + "description": "", + "title": "Target", + }, + "context": { + "anyOf": [ + {"items": {"$ref": "#/$defs/ContextPair"}, "type": "array"}, + {"$ref": "#/$defs/ContextPair"}, + ], + "description": "Search space will be constrained by these pairs of vectors", + "title": "Context", + }, + }, + "required": ["target", "context"], + "title": "DiscoverInput", + "type": "object", + }, + "ContextExamplePair": { + "additionalProperties": False, + "properties": { + "positive": { + "anyOf": [ + {"type": "integer"}, + {"type": "string"}, + {"items": {"type": "number"}, "type": "array"}, + {"$ref": "#/$defs/SparseVector"}, + ], + "description": "", + "title": "Positive", + }, + "negative": { + "anyOf": [ + {"type": "integer"}, + {"type": "string"}, + {"items": {"type": "number"}, "type": "array"}, + {"$ref": "#/$defs/SparseVector"}, + ], + "description": "", + "title": "Negative", + }, + }, + "required": ["positive", "negative"], + "title": "ContextExamplePair", + "type": "object", + }, + "LookupLocation": { + "additionalProperties": False, + "description": "Defines a location to use for looking up the vector. Specifies collection and vector field name.", + "properties": { + "collection": { + "description": "Name of the collection used for lookup", + "title": "Collection", + "type": "string", + }, + "vector": { + "anyOf": [{"type": "string"}, {"type": "null"}], + "default": None, + "description": "Optional name of the vector field within the collection. If not provided, the default vector field will be used.", + "title": "Vector", + }, + "shard_key": { + "anyOf": [ + {"type": "integer"}, + {"type": "string"}, + { + "items": {"anyOf": [{"type": "integer"}, {"type": "string"}]}, + "type": "array", + }, + {"type": "null"}, + ], + "default": None, + "description": "Specify in which shards to look for the points, if not specified - look in all shards", + "title": "Shard Key", + }, + }, + "required": ["collection"], + "title": "LookupLocation", + "type": "object", + }, + "PayloadSelectorExclude": { + "additionalProperties": False, + "properties": { + "exclude": { + "description": "Exclude this fields from returning payload", + "items": {"type": "string"}, + "title": "Exclude", + "type": "array", + } + }, + "required": ["exclude"], + "title": "PayloadSelectorExclude", + "type": "object", + }, + "PayloadSelectorInclude": { + "additionalProperties": False, + "properties": { + "include": { + "description": "Only include this payload keys", + "items": {"type": "string"}, + "title": "Include", + "type": "array", + } + }, + "required": ["include"], + "title": "PayloadSelectorInclude", + "type": "object", + }, + "QuantizationSearchParams": { + "additionalProperties": False, + "description": "Additional parameters of the search", + "properties": { + "ignore": { + "anyOf": [{"type": "boolean"}, {"type": "null"}], + "default": False, + "description": "If true, quantized vectors are ignored. Default is false.", + "title": "Ignore", + }, + "rescore": { + "anyOf": [{"type": "boolean"}, {"type": "null"}], + "default": None, + "description": "If true, use original vectors to re-score top-k results. Might require more time in case if original vectors are stored on disk. If not set, qdrant decides automatically apply rescoring or not.", + "title": "Rescore", + }, + "oversampling": { + "anyOf": [{"type": "number"}, {"type": "null"}], + "default": None, + "description": "Oversampling factor for quantization. Default is 1.0. Defines how many extra vectors should be pre-selected using quantized index, and then re-scored using original vectors. For example, if `oversampling` is 2.4 and `limit` is 100, then 240 vectors will be pre-selected using quantized index, and then top-100 will be returned after re-scoring.", + "title": "Oversampling", + }, + }, + "title": "QuantizationSearchParams", + "type": "object", + }, + "SearchParams": { + "additionalProperties": False, + "description": "Additional parameters of the search", + "properties": { + "hnsw_ef": { + "anyOf": [{"type": "integer"}, {"type": "null"}], + "default": None, + "description": "Params relevant to HNSW index Size of the beam in a beam-search. Larger the value - more accurate the result, more time required for search.", + "title": "Hnsw Ef", + }, + "exact": { + "anyOf": [{"type": "boolean"}, {"type": "null"}], + "default": False, + "description": "Search without approximation. If set to true, search may run long but with exact results.", + "title": "Exact", + }, + "quantization": { + "anyOf": [{"$ref": "#/$defs/QuantizationSearchParams"}, {"type": "null"}], + "default": None, + "description": "Quantization params", + }, + "indexed_only": { + "anyOf": [{"type": "boolean"}, {"type": "null"}], + "default": False, + "description": "If enabled, the engine will only perform search among indexed or small segments. Using this option prevents slow searches in case of delayed index, but does not guarantee that all uploaded vectors will be included in search results", + "title": "Indexed Only", + }, + }, + "title": "SearchParams", + "type": "object", + }, + "DiscoverRequest": { + "additionalProperties": False, + "description": "Use context and a target to find the most similar points, constrained by the context.", + "properties": { + "shard_key": { + "anyOf": [ + {"type": "integer"}, + {"type": "string"}, + { + "items": {"anyOf": [{"type": "integer"}, {"type": "string"}]}, + "type": "array", + }, + {"type": "null"}, + ], + "default": None, + "description": "Specify in which shards to look for the points, if not specified - look in all shards", + "title": "Shard Key", + }, + "target": { + "anyOf": [ + {"type": "integer"}, + {"type": "string"}, + {"items": {"type": "number"}, "type": "array"}, + {"$ref": "#/$defs/SparseVector"}, + {"type": "null"}, + ], + "default": None, + "description": "Look for vectors closest to this. When using the target (with or without context), the integer part of the score represents the rank with respect to the context, while the decimal part of the score relates to the distance to the target.", + "title": "Target", + }, + "context": { + "anyOf": [ + {"items": {"$ref": "#/$defs/ContextExamplePair"}, "type": "array"}, + {"type": "null"}, + ], + "default": None, + "description": "Pairs of { positive, negative } examples to constrain the search. When using only the context (without a target), a special search - called context search - is performed where pairs of points are used to generate a loss that guides the search towards the zone where most positive examples overlap. This means that the score minimizes the scenario of finding a point closer to a negative than to a positive part of a pair. Since the score of a context relates to loss, the maximum score a point can get is 0.0, and it becomes normal that many points can have a score of 0.0. For discovery search (when including a target), the context part of the score for each pair is calculated +1 if the point is closer to a positive than to a negative part of a pair, and -1 otherwise.", + "title": "Context", + }, + "filter": { + "anyOf": [{"$ref": "#/$defs/Filter"}, {"type": "null"}], + "default": None, + "description": "Look only for points which satisfies this conditions", + }, + "params": { + "anyOf": [{"$ref": "#/$defs/SearchParams"}, {"type": "null"}], + "default": None, + "description": "Additional search params", + }, + "limit": { + "description": "Max number of result to return", + "title": "Limit", + "type": "integer", + }, + "offset": { + "anyOf": [{"type": "integer"}, {"type": "null"}], + "default": None, + "description": "Offset of the first result to return. May be used to paginate results. Note: large offset values may cause performance issues.", + "title": "Offset", + }, + "with_payload": { + "anyOf": [ + {"type": "boolean"}, + {"items": {"type": "string"}, "type": "array"}, + {"$ref": "#/$defs/PayloadSelectorInclude"}, + {"$ref": "#/$defs/PayloadSelectorExclude"}, + {"type": "null"}, + ], + "default": None, + "description": "Select which payload to return with the response. Default is false.", + "title": "With Payload", + }, + "with_vector": { + "anyOf": [ + {"type": "boolean"}, + {"items": {"type": "string"}, "type": "array"}, + {"type": "null"}, + ], + "default": None, + "description": "Options for specifying which vectors to include into response. Default is false.", + "title": "With Vector", + }, + "using": { + "anyOf": [{"type": "string"}, {"type": "null"}], + "default": None, + "description": "Define which vector to use for recommendation, if not specified - try to use default vector", + "title": "Using", + }, + "lookup_from": { + "anyOf": [{"$ref": "#/$defs/LookupLocation"}, {"type": "null"}], + "default": None, + "description": "The location used to lookup vectors. If not specified - use current collection. Note: the other collection should have the same vector size as the current collection", + }, + }, + "required": ["limit"], + "title": "DiscoverRequest", + "type": "object", + }, + "Replica": { + "additionalProperties": False, + "properties": { + "shard_id": {"description": "", "title": "Shard Id", "type": "integer"}, + "peer_id": {"description": "", "title": "Peer Id", "type": "integer"}, + }, + "required": ["shard_id", "peer_id"], + "title": "Replica", + "type": "object", + }, + "DropShardingKey": { + "additionalProperties": False, + "properties": { + "shard_key": { + "anyOf": [{"type": "integer"}, {"type": "string"}], + "description": "", + "title": "Shard Key", + } + }, + "required": ["shard_key"], + "title": "DropShardingKey", + "type": "object", + }, + "Fusion": { + "description": "Fusion algorithm allows to combine results of multiple prefetches. Available fusion algorithms: * `rrf` - Reciprocal Rank Fusion * `dbsf` - Distribution-Based Score Fusion", + "enum": ["rrf", "dbsf"], + "title": "Fusion", + "type": "string", + }, + "ShardTransferMethodOneOf": { + "description": "Stream all shard records in batches until the whole shard is transferred.", + "enum": ["stream_records"], + "title": "ShardTransferMethodOneOf", + "type": "string", + }, + "ShardTransferMethodOneOf1": { + "description": "Snapshot the shard, transfer and restore it on the receiver.", + "enum": ["snapshot"], + "title": "ShardTransferMethodOneOf1", + "type": "string", + }, + "ShardTransferMethodOneOf2": { + "description": "Attempt to transfer shard difference by WAL delta.", + "enum": ["wal_delta"], + "title": "ShardTransferMethodOneOf2", + "type": "string", + }, + "ShardTransferMethodOneOf3": { + "description": "Shard transfer for resharding: stream all records in batches until all points are transferred.", + "enum": ["resharding_stream_records"], + "title": "ShardTransferMethodOneOf3", + "type": "string", + }, + "MoveShard": { + "additionalProperties": False, + "properties": { + "shard_id": {"description": "", "title": "Shard Id", "type": "integer"}, + "to_peer_id": {"description": "", "title": "To Peer Id", "type": "integer"}, + "from_peer_id": {"description": "", "title": "From Peer Id", "type": "integer"}, + "method": { + "anyOf": [ + {"$ref": "#/$defs/ShardTransferMethodOneOf"}, + {"$ref": "#/$defs/ShardTransferMethodOneOf1"}, + {"$ref": "#/$defs/ShardTransferMethodOneOf2"}, + {"$ref": "#/$defs/ShardTransferMethodOneOf3"}, + {"type": "null"}, + ], + "default": None, + "description": "Method for transferring the shard from one node to another", + "title": "Method", + }, + }, + "required": ["shard_id", "to_peer_id", "from_peer_id"], + "title": "MoveShard", + "type": "object", + }, + "Mmr": { + "additionalProperties": False, + "description": "Maximal Marginal Relevance (MMR) algorithm for re-ranking the points.", + "properties": { + "diversity": { + "anyOf": [{"type": "number"}, {"type": "null"}], + "default": None, + "description": "Tunable parameter for the MMR algorithm. Determines the balance between diversity and relevance. A higher value favors diversity (dissimilarity to selected results), while a lower value favors relevance (similarity to the query vector). Must be in the range [0, 1]. Default value is 0.5.", + "title": "Diversity", + }, + "candidates_limit": { + "anyOf": [{"type": "integer"}, {"type": "null"}], + "default": None, + "description": "The maximum number of candidates to consider for re-ranking. If not specified, the `limit` value is used.", + "title": "Candidates Limit", + }, + }, + "title": "Mmr", + "type": "object", + }, + "Direction": {"enum": ["asc", "desc"], "title": "Direction", "type": "string"}, + "OrderBy": { + "additionalProperties": False, + "properties": { + "key": {"description": "Payload key to order by", "title": "Key", "type": "string"}, + "direction": { + "anyOf": [{"$ref": "#/$defs/Direction"}, {"type": "null"}], + "default": None, + "description": "Direction of ordering: `asc` or `desc`. Default is ascending.", + }, + "start_from": { + "anyOf": [ + {"type": "integer"}, + {"type": "number"}, + {"format": "date-time", "type": "string"}, + {"format": "date", "type": "string"}, + {"type": "null"}, + ], + "default": None, + "description": "Which payload value to start scrolling from. Default is the lowest value for `asc` and the highest for `desc`", + "title": "Start From", + }, + }, + "required": ["key"], + "title": "OrderBy", + "type": "object", + }, + "SetPayload": { + "additionalProperties": False, + "description": "This data structure is used in API interface and applied across multiple shards", + "properties": { + "payload": { + "additionalProperties": True, + "description": "This data structure is used in API interface and applied across multiple shards", + "title": "Payload", + "type": "object", + }, + "points": { + "anyOf": [ + { + "items": {"anyOf": [{"type": "integer"}, {"type": "string"}]}, + "type": "array", + }, + {"type": "null"}, + ], + "default": None, + "description": "Assigns payload to each point in this list", + "title": "Points", + }, + "filter": { + "anyOf": [{"$ref": "#/$defs/Filter"}, {"type": "null"}], + "default": None, + "description": "Assigns payload to each point that satisfy this filter condition", + }, + "shard_key": { + "anyOf": [ + {"type": "integer"}, + {"type": "string"}, + { + "items": {"anyOf": [{"type": "integer"}, {"type": "string"}]}, + "type": "array", + }, + {"type": "null"}, + ], + "default": None, + "description": "This data structure is used in API interface and applied across multiple shards", + "title": "Shard Key", + }, + "key": { + "anyOf": [{"type": "string"}, {"type": "null"}], + "default": None, + "description": "Assigns payload to each point that satisfy this path of property", + "title": "Key", + }, + }, + "required": ["payload"], + "title": "SetPayload", + "type": "object", + }, + "Batch": { + "additionalProperties": False, + "properties": { + "ids": { + "description": "", + "items": {"anyOf": [{"type": "integer"}, {"type": "string"}]}, + "title": "Ids", + "type": "array", + }, + "vectors": { + "anyOf": [ + {"items": {"items": {"type": "number"}, "type": "array"}, "type": "array"}, + { + "items": { + "items": {"items": {"type": "number"}, "type": "array"}, + "type": "array", + }, + "type": "array", + }, + { + "additionalProperties": { + "items": { + "anyOf": [ + {"items": {"type": "number"}, "type": "array"}, + {"$ref": "#/$defs/SparseVector"}, + { + "items": {"items": {"type": "number"}, "type": "array"}, + "type": "array", + }, + {"$ref": "#/$defs/Document"}, + {"$ref": "#/$defs/Image"}, + {"$ref": "#/$defs/InferenceObject"}, + ] + }, + "type": "array", + }, + "type": "object", + }, + {"items": {"$ref": "#/$defs/Document"}, "type": "array"}, + {"items": {"$ref": "#/$defs/Image"}, "type": "array"}, + {"items": {"$ref": "#/$defs/InferenceObject"}, "type": "array"}, + ], + "description": "", + "title": "Vectors", + }, + "payloads": { + "anyOf": [ + {"items": {"additionalProperties": True, "type": "object"}, "type": "array"}, + {"type": "null"}, + ], + "default": None, + "description": "", + "title": "Payloads", + }, + }, + "required": ["ids", "vectors"], + "title": "Batch", + "type": "object", + }, + "PointStruct": { + "additionalProperties": False, + "properties": { + "id": { + "anyOf": [{"type": "integer"}, {"type": "string"}], + "description": "", + "title": "Id", + }, + "vector": { + "anyOf": [ + {"items": {"type": "number"}, "type": "array"}, + {"items": {"items": {"type": "number"}, "type": "array"}, "type": "array"}, + { + "additionalProperties": { + "anyOf": [ + {"items": {"type": "number"}, "type": "array"}, + {"$ref": "#/$defs/SparseVector"}, + { + "items": {"items": {"type": "number"}, "type": "array"}, + "type": "array", + }, + {"$ref": "#/$defs/Document"}, + {"$ref": "#/$defs/Image"}, + {"$ref": "#/$defs/InferenceObject"}, + ] + }, + "type": "object", + }, + {"$ref": "#/$defs/Document"}, + {"$ref": "#/$defs/Image"}, + {"$ref": "#/$defs/InferenceObject"}, + ], + "description": "", + "title": "Vector", + }, + "payload": { + "anyOf": [{"additionalProperties": True, "type": "object"}, {"type": "null"}], + "default": None, + "description": "Payload values (optional)", + "title": "Payload", + }, + }, + "required": ["id", "vector"], + "title": "PointStruct", + "type": "object", + }, + "ContextQuery": { + "additionalProperties": False, + "properties": { + "context": { + "anyOf": [ + {"$ref": "#/$defs/ContextPair"}, + {"items": {"$ref": "#/$defs/ContextPair"}, "type": "array"}, + ], + "description": "", + "title": "Context", + } + }, + "required": ["context"], + "title": "ContextQuery", + "type": "object", + }, + "DiscoverQuery": { + "additionalProperties": False, + "properties": {"discover": {"$ref": "#/$defs/DiscoverInput", "description": ""}}, + "required": ["discover"], + "title": "DiscoverQuery", + "type": "object", + }, + "FormulaQuery": { + "additionalProperties": False, + "properties": { + "formula": { + "anyOf": [ + {"type": "number"}, + {"type": "string"}, + {"$ref": "#/$defs/FieldCondition"}, + {"$ref": "#/$defs/IsEmptyCondition"}, + {"$ref": "#/$defs/IsNullCondition"}, + {"$ref": "#/$defs/HasIdCondition"}, + {"$ref": "#/$defs/HasVectorCondition"}, + {"$ref": "#/$defs/NestedCondition"}, + {"$ref": "#/$defs/Filter"}, + {"$ref": "#/$defs/GeoDistance"}, + {"$ref": "#/$defs/DatetimeExpression"}, + {"$ref": "#/$defs/DatetimeKeyExpression"}, + {"$ref": "#/$defs/MultExpression"}, + {"$ref": "#/$defs/SumExpression"}, + {"$ref": "#/$defs/NegExpression"}, + {"$ref": "#/$defs/AbsExpression"}, + {"$ref": "#/$defs/DivExpression"}, + {"$ref": "#/$defs/SqrtExpression"}, + {"$ref": "#/$defs/PowExpression"}, + {"$ref": "#/$defs/ExpExpression"}, + {"$ref": "#/$defs/Log10Expression"}, + {"$ref": "#/$defs/LnExpression"}, + {"$ref": "#/$defs/LinDecayExpression"}, + {"$ref": "#/$defs/ExpDecayExpression"}, + {"$ref": "#/$defs/GaussDecayExpression"}, + ], + "description": "", + "title": "Formula", + }, + "defaults": { + "anyOf": [{"additionalProperties": True, "type": "object"}, {"type": "null"}], + "default": {}, + "description": "", + "title": "Defaults", + }, + }, + "required": ["formula"], + "title": "FormulaQuery", + "type": "object", + }, + "FusionQuery": { + "additionalProperties": False, + "properties": {"fusion": {"$ref": "#/$defs/Fusion", "description": ""}}, + "required": ["fusion"], + "title": "FusionQuery", + "type": "object", + }, + "NearestQuery": { + "additionalProperties": False, + "properties": { + "nearest": { + "anyOf": [ + {"items": {"type": "number"}, "type": "array"}, + {"$ref": "#/$defs/SparseVector"}, + {"items": {"items": {"type": "number"}, "type": "array"}, "type": "array"}, + {"type": "integer"}, + {"type": "string"}, + {"$ref": "#/$defs/Document"}, + {"$ref": "#/$defs/Image"}, + {"$ref": "#/$defs/InferenceObject"}, + ], + "description": "", + "title": "Nearest", + }, + "mmr": { + "anyOf": [{"$ref": "#/$defs/Mmr"}, {"type": "null"}], + "default": None, + "description": "Perform MMR (Maximal Marginal Relevance) reranking after search, using the same vector in this query to calculate relevance.", + }, + }, + "required": ["nearest"], + "title": "NearestQuery", + "type": "object", + }, + "OrderByQuery": { + "additionalProperties": False, + "properties": { + "order_by": { + "anyOf": [{"type": "string"}, {"$ref": "#/$defs/OrderBy"}], + "description": "", + "title": "Order By", + } + }, + "required": ["order_by"], + "title": "OrderByQuery", + "type": "object", + }, + "Prefetch": { + "additionalProperties": False, + "properties": { + "prefetch": { + "anyOf": [ + {"items": {"$ref": "#/$defs/Prefetch"}, "type": "array"}, + {"$ref": "#/$defs/Prefetch"}, + {"type": "null"}, + ], + "default": None, + "description": "Sub-requests to perform first. If present, the query will be performed on the results of the prefetches.", + "title": "Prefetch", + }, + "query": { + "anyOf": [ + {"items": {"type": "number"}, "type": "array"}, + {"$ref": "#/$defs/SparseVector"}, + {"items": {"items": {"type": "number"}, "type": "array"}, "type": "array"}, + {"type": "integer"}, + {"type": "string"}, + {"$ref": "#/$defs/Document"}, + {"$ref": "#/$defs/Image"}, + {"$ref": "#/$defs/InferenceObject"}, + {"$ref": "#/$defs/NearestQuery"}, + {"$ref": "#/$defs/RecommendQuery"}, + {"$ref": "#/$defs/DiscoverQuery"}, + {"$ref": "#/$defs/ContextQuery"}, + {"$ref": "#/$defs/OrderByQuery"}, + {"$ref": "#/$defs/FusionQuery"}, + {"$ref": "#/$defs/FormulaQuery"}, + {"$ref": "#/$defs/SampleQuery"}, + {"type": "null"}, + ], + "default": None, + "description": "Query to perform. If missing without prefetches, returns points ordered by their IDs.", + "title": "Query", + }, + "using": { + "anyOf": [{"type": "string"}, {"type": "null"}], + "default": None, + "description": "Define which vector name to use for querying. If missing, the default vector is used.", + "title": "Using", + }, + "filter": { + "anyOf": [{"$ref": "#/$defs/Filter"}, {"type": "null"}], + "default": None, + "description": "Filter conditions - return only those points that satisfy the specified conditions.", + }, + "params": { + "anyOf": [{"$ref": "#/$defs/SearchParams"}, {"type": "null"}], + "default": None, + "description": "Search params for when there is no prefetch", + }, + "score_threshold": { + "anyOf": [{"type": "number"}, {"type": "null"}], + "default": None, + "description": "Return points with scores better than this threshold.", + "title": "Score Threshold", + }, + "limit": { + "anyOf": [{"type": "integer"}, {"type": "null"}], + "default": None, + "description": "Max number of points to return. Default is 10.", + "title": "Limit", + }, + "lookup_from": { + "anyOf": [{"$ref": "#/$defs/LookupLocation"}, {"type": "null"}], + "default": None, + "description": "The location to use for IDs lookup, if not specified - use the current collection and the 'using' vector Note: the other collection vectors should have the same vector size as the 'using' vector in the current collection", + }, + }, + "title": "Prefetch", + "type": "object", + }, + "RecommendInput": { + "additionalProperties": False, + "properties": { + "positive": { + "anyOf": [ + { + "items": { + "anyOf": [ + {"items": {"type": "number"}, "type": "array"}, + {"$ref": "#/$defs/SparseVector"}, + { + "items": {"items": {"type": "number"}, "type": "array"}, + "type": "array", + }, + {"type": "integer"}, + {"type": "string"}, + {"$ref": "#/$defs/Document"}, + {"$ref": "#/$defs/Image"}, + {"$ref": "#/$defs/InferenceObject"}, + ] + }, + "type": "array", + }, + {"type": "null"}, + ], + "default": None, + "description": "Look for vectors closest to the vectors from these points", + "title": "Positive", + }, + "negative": { + "anyOf": [ + { + "items": { + "anyOf": [ + {"items": {"type": "number"}, "type": "array"}, + {"$ref": "#/$defs/SparseVector"}, + { + "items": {"items": {"type": "number"}, "type": "array"}, + "type": "array", + }, + {"type": "integer"}, + {"type": "string"}, + {"$ref": "#/$defs/Document"}, + {"$ref": "#/$defs/Image"}, + {"$ref": "#/$defs/InferenceObject"}, + ] + }, + "type": "array", + }, + {"type": "null"}, + ], + "default": None, + "description": "Try to avoid vectors like the vector from these points", + "title": "Negative", + }, + "strategy": { + "anyOf": [{"$ref": "#/$defs/RecommendStrategy"}, {"type": "null"}], + "default": None, + "description": "How to use the provided vectors to find the results", + }, + }, + "title": "RecommendInput", + "type": "object", + }, + "RecommendQuery": { + "additionalProperties": False, + "properties": {"recommend": {"$ref": "#/$defs/RecommendInput", "description": ""}}, + "required": ["recommend"], + "title": "RecommendQuery", + "type": "object", + }, + "RecommendStrategy": { + "description": "How to use positive and negative examples to find the results, default is `average_vector`: * `average_vector` - Average positive and negative vectors and create a single query with the formula `query = avg_pos + avg_pos - avg_neg`. Then performs normal search. * `best_score` - Uses custom search objective. Each candidate is compared against all examples, its score is then chosen from the `max(max_pos_score, max_neg_score)`. If the `max_neg_score` is chosen then it is squared and negated, otherwise it is just the `max_pos_score`. * `sum_scores` - Uses custom search objective. Compares against all inputs, sums all the scores. Scores against positive vectors are added, against negatives are subtracted.", + "enum": ["average_vector", "best_score", "sum_scores"], + "title": "RecommendStrategy", + "type": "string", + }, + "Sample": {"enum": ["random"], "title": "Sample", "type": "string"}, + "SampleQuery": { + "additionalProperties": False, + "properties": {"sample": {"$ref": "#/$defs/Sample", "description": ""}}, + "required": ["sample"], + "title": "SampleQuery", + "type": "object", + }, + "WithLookup": { + "additionalProperties": False, + "properties": { + "collection": { + "description": "Name of the collection to use for points lookup", + "title": "Collection", + "type": "string", + }, + "with_payload": { + "anyOf": [ + {"type": "boolean"}, + {"items": {"type": "string"}, "type": "array"}, + {"$ref": "#/$defs/PayloadSelectorInclude"}, + {"$ref": "#/$defs/PayloadSelectorExclude"}, + {"type": "null"}, + ], + "default": None, + "description": "Options for specifying which payload to include (or not)", + "title": "With Payload", + }, + "with_vectors": { + "anyOf": [ + {"type": "boolean"}, + {"items": {"type": "string"}, "type": "array"}, + {"type": "null"}, + ], + "default": None, + "description": "Options for specifying which vectors to include (or not)", + "title": "With Vectors", + }, + }, + "required": ["collection"], + "title": "WithLookup", + "type": "object", + }, + "QueryRequest": { + "additionalProperties": False, + "properties": { + "shard_key": { + "anyOf": [ + {"type": "integer"}, + {"type": "string"}, + { + "items": {"anyOf": [{"type": "integer"}, {"type": "string"}]}, + "type": "array", + }, + {"type": "null"}, + ], + "default": None, + "description": "", + "title": "Shard Key", + }, + "prefetch": { + "anyOf": [ + {"items": {"$ref": "#/$defs/Prefetch"}, "type": "array"}, + {"$ref": "#/$defs/Prefetch"}, + {"type": "null"}, + ], + "default": None, + "description": "Sub-requests to perform first. If present, the query will be performed on the results of the prefetch(es).", + "title": "Prefetch", + }, + "query": { + "anyOf": [ + {"items": {"type": "number"}, "type": "array"}, + {"$ref": "#/$defs/SparseVector"}, + {"items": {"items": {"type": "number"}, "type": "array"}, "type": "array"}, + {"type": "integer"}, + {"type": "string"}, + {"$ref": "#/$defs/Document"}, + {"$ref": "#/$defs/Image"}, + {"$ref": "#/$defs/InferenceObject"}, + {"$ref": "#/$defs/NearestQuery"}, + {"$ref": "#/$defs/RecommendQuery"}, + {"$ref": "#/$defs/DiscoverQuery"}, + {"$ref": "#/$defs/ContextQuery"}, + {"$ref": "#/$defs/OrderByQuery"}, + {"$ref": "#/$defs/FusionQuery"}, + {"$ref": "#/$defs/FormulaQuery"}, + {"$ref": "#/$defs/SampleQuery"}, + {"type": "null"}, + ], + "default": None, + "description": "Query to perform. If missing without prefetches, returns points ordered by their IDs.", + "title": "Query", + }, + "using": { + "anyOf": [{"type": "string"}, {"type": "null"}], + "default": None, + "description": "Define which vector name to use for querying. If missing, the default vector is used.", + "title": "Using", + }, + "filter": { + "anyOf": [{"$ref": "#/$defs/Filter"}, {"type": "null"}], + "default": None, + "description": "Filter conditions - return only those points that satisfy the specified conditions.", + }, + "params": { + "anyOf": [{"$ref": "#/$defs/SearchParams"}, {"type": "null"}], + "default": None, + "description": "Search params for when there is no prefetch", + }, + "score_threshold": { + "anyOf": [{"type": "number"}, {"type": "null"}], + "default": None, + "description": "Return points with scores better than this threshold.", + "title": "Score Threshold", + }, + "limit": { + "anyOf": [{"type": "integer"}, {"type": "null"}], + "default": None, + "description": "Max number of points to return. Default is 10.", + "title": "Limit", + }, + "offset": { + "anyOf": [{"type": "integer"}, {"type": "null"}], + "default": None, + "description": "Offset of the result. Skip this many points. Default is 0", + "title": "Offset", + }, + "with_vector": { + "anyOf": [ + {"type": "boolean"}, + {"items": {"type": "string"}, "type": "array"}, + {"type": "null"}, + ], + "default": None, + "description": "Options for specifying which vectors to include into the response. Default is false.", + "title": "With Vector", + }, + "with_payload": { + "anyOf": [ + {"type": "boolean"}, + {"items": {"type": "string"}, "type": "array"}, + {"$ref": "#/$defs/PayloadSelectorInclude"}, + {"$ref": "#/$defs/PayloadSelectorExclude"}, + {"type": "null"}, + ], + "default": None, + "description": "Options for specifying which payload to include or not. Default is false.", + "title": "With Payload", + }, + "lookup_from": { + "anyOf": [{"$ref": "#/$defs/LookupLocation"}, {"type": "null"}], + "default": None, + "description": "The location to use for IDs lookup, if not specified - use the current collection and the 'using' vector Note: the other collection vectors should have the same vector size as the 'using' vector in the current collection", + }, + }, + "title": "QueryRequest", + "type": "object", + }, + "RecommendRequest": { + "additionalProperties": False, + "description": "Recommendation request. Provides positive and negative examples of the vectors, which can be ids of points that are already stored in the collection, raw vectors, or even ids and vectors combined. Service should look for the points which are closer to positive examples and at the same time further to negative examples. The concrete way of how to compare negative and positive distances is up to the `strategy` chosen.", + "properties": { + "shard_key": { + "anyOf": [ + {"type": "integer"}, + {"type": "string"}, + { + "items": {"anyOf": [{"type": "integer"}, {"type": "string"}]}, + "type": "array", + }, + {"type": "null"}, + ], + "default": None, + "description": "Specify in which shards to look for the points, if not specified - look in all shards", + "title": "Shard Key", + }, + "positive": { + "anyOf": [ + { + "items": { + "anyOf": [ + {"type": "integer"}, + {"type": "string"}, + {"items": {"type": "number"}, "type": "array"}, + {"$ref": "#/$defs/SparseVector"}, + ] + }, + "type": "array", + }, + {"type": "null"}, + ], + "default": [], + "description": "Look for vectors closest to those", + "title": "Positive", + }, + "negative": { + "anyOf": [ + { + "items": { + "anyOf": [ + {"type": "integer"}, + {"type": "string"}, + {"items": {"type": "number"}, "type": "array"}, + {"$ref": "#/$defs/SparseVector"}, + ] + }, + "type": "array", + }, + {"type": "null"}, + ], + "default": [], + "description": "Try to avoid vectors like this", + "title": "Negative", + }, + "strategy": { + "anyOf": [{"$ref": "#/$defs/RecommendStrategy"}, {"type": "null"}], + "default": None, + "description": "How to use positive and negative examples to find the results", + }, + "filter": { + "anyOf": [{"$ref": "#/$defs/Filter"}, {"type": "null"}], + "default": None, + "description": "Look only for points which satisfies this conditions", + }, + "params": { + "anyOf": [{"$ref": "#/$defs/SearchParams"}, {"type": "null"}], + "default": None, + "description": "Additional search params", + }, + "limit": { + "description": "Max number of result to return", + "title": "Limit", + "type": "integer", + }, + "offset": { + "anyOf": [{"type": "integer"}, {"type": "null"}], + "default": None, + "description": "Offset of the first result to return. May be used to paginate results. Note: large offset values may cause performance issues.", + "title": "Offset", + }, + "with_payload": { + "anyOf": [ + {"type": "boolean"}, + {"items": {"type": "string"}, "type": "array"}, + {"$ref": "#/$defs/PayloadSelectorInclude"}, + {"$ref": "#/$defs/PayloadSelectorExclude"}, + {"type": "null"}, + ], + "default": None, + "description": "Select which payload to return with the response. Default is false.", + "title": "With Payload", + }, + "with_vector": { + "anyOf": [ + {"type": "boolean"}, + {"items": {"type": "string"}, "type": "array"}, + {"type": "null"}, + ], + "default": None, + "description": "Options for specifying which vectors to include into response. Default is false.", + "title": "With Vector", + }, + "score_threshold": { + "anyOf": [{"type": "number"}, {"type": "null"}], + "default": None, + "description": "Define a minimal score threshold for the result. If defined, less similar results will not be returned. Score of the returned result might be higher or smaller than the threshold depending on the Distance function used. E.g. for cosine similarity only higher scores will be returned.", + "title": "Score Threshold", + }, + "using": { + "anyOf": [{"type": "string"}, {"type": "null"}], + "default": None, + "description": "Define which vector to use for recommendation, if not specified - try to use default vector", + "title": "Using", + }, + "lookup_from": { + "anyOf": [{"$ref": "#/$defs/LookupLocation"}, {"type": "null"}], + "default": None, + "description": "The location used to lookup vectors. If not specified - use current collection. Note: the other collection should have the same vector size as the current collection", + }, + }, + "required": ["limit"], + "title": "RecommendRequest", + "type": "object", + }, + "ReplicateShard": { + "additionalProperties": False, + "properties": { + "shard_id": {"description": "", "title": "Shard Id", "type": "integer"}, + "to_peer_id": {"description": "", "title": "To Peer Id", "type": "integer"}, + "from_peer_id": {"description": "", "title": "From Peer Id", "type": "integer"}, + "method": { + "anyOf": [ + {"$ref": "#/$defs/ShardTransferMethodOneOf"}, + {"$ref": "#/$defs/ShardTransferMethodOneOf1"}, + {"$ref": "#/$defs/ShardTransferMethodOneOf2"}, + {"$ref": "#/$defs/ShardTransferMethodOneOf3"}, + {"type": "null"}, + ], + "default": None, + "description": "Method for transferring the shard from one node to another", + "title": "Method", + }, + }, + "required": ["shard_id", "to_peer_id", "from_peer_id"], + "title": "ReplicateShard", + "type": "object", + }, + "RestartTransfer": { + "additionalProperties": False, + "properties": { + "shard_id": {"description": "", "title": "Shard Id", "type": "integer"}, + "from_peer_id": {"description": "", "title": "From Peer Id", "type": "integer"}, + "to_peer_id": {"description": "", "title": "To Peer Id", "type": "integer"}, + "method": { + "anyOf": [ + {"$ref": "#/$defs/ShardTransferMethodOneOf"}, + {"$ref": "#/$defs/ShardTransferMethodOneOf1"}, + {"$ref": "#/$defs/ShardTransferMethodOneOf2"}, + {"$ref": "#/$defs/ShardTransferMethodOneOf3"}, + ], + "description": "", + "title": "Method", + }, + }, + "required": ["shard_id", "from_peer_id", "to_peer_id", "method"], + "title": "RestartTransfer", + "type": "object", + }, + "NamedSparseVector": { + "additionalProperties": False, + "description": "Sparse vector data with name", + "properties": { + "name": {"description": "Name of vector data", "title": "Name", "type": "string"}, + "vector": { + "$ref": "#/$defs/SparseVector", + "description": "Sparse vector data with name", + }, + }, + "required": ["name", "vector"], + "title": "NamedSparseVector", + "type": "object", + }, + "NamedVector": { + "additionalProperties": False, + "description": "Dense vector data with name", + "properties": { + "name": {"description": "Name of vector data", "title": "Name", "type": "string"}, + "vector": { + "description": "Vector data", + "items": {"type": "number"}, + "title": "Vector", + "type": "array", + }, + }, + "required": ["name", "vector"], + "title": "NamedVector", + "type": "object", + }, + "SearchRequest": { + "additionalProperties": False, + "description": "Search request. Holds all conditions and parameters for the search of most similar points by vector similarity given the filtering restrictions.", + "properties": { + "shard_key": { + "anyOf": [ + {"type": "integer"}, + {"type": "string"}, + { + "items": {"anyOf": [{"type": "integer"}, {"type": "string"}]}, + "type": "array", + }, + {"type": "null"}, + ], + "default": None, + "description": "Specify in which shards to look for the points, if not specified - look in all shards", + "title": "Shard Key", + }, + "vector": { + "anyOf": [ + {"items": {"type": "number"}, "type": "array"}, + {"$ref": "#/$defs/NamedVector"}, + {"$ref": "#/$defs/NamedSparseVector"}, + ], + "description": "Search request. Holds all conditions and parameters for the search of most similar points by vector similarity given the filtering restrictions.", + "title": "Vector", + }, + "filter": { + "anyOf": [{"$ref": "#/$defs/Filter"}, {"type": "null"}], + "default": None, + "description": "Look only for points which satisfies this conditions", + }, + "params": { + "anyOf": [{"$ref": "#/$defs/SearchParams"}, {"type": "null"}], + "default": None, + "description": "Additional search params", + }, + "limit": { + "description": "Max number of result to return", + "title": "Limit", + "type": "integer", + }, + "offset": { + "anyOf": [{"type": "integer"}, {"type": "null"}], + "default": None, + "description": "Offset of the first result to return. May be used to paginate results. Note: large offset values may cause performance issues.", + "title": "Offset", + }, + "with_payload": { + "anyOf": [ + {"type": "boolean"}, + {"items": {"type": "string"}, "type": "array"}, + {"$ref": "#/$defs/PayloadSelectorInclude"}, + {"$ref": "#/$defs/PayloadSelectorExclude"}, + {"type": "null"}, + ], + "default": None, + "description": "Select which payload to return with the response. Default is false.", + "title": "With Payload", + }, + "with_vector": { + "anyOf": [ + {"type": "boolean"}, + {"items": {"type": "string"}, "type": "array"}, + {"type": "null"}, + ], + "default": None, + "description": "Options for specifying which vectors to include into response. Default is false.", + "title": "With Vector", + }, + "score_threshold": { + "anyOf": [{"type": "number"}, {"type": "null"}], + "default": None, + "description": "Define a minimal score threshold for the result. If defined, less similar results will not be returned. Score of the returned result might be higher or smaller than the threshold depending on the Distance function used. E.g. for cosine similarity only higher scores will be returned.", + "title": "Score Threshold", + }, + }, + "required": ["vector", "limit"], + "title": "SearchRequest", + "type": "object", + }, + "SnapshotPriority": { + "description": "Defines source of truth for snapshot recovery: `NoSync` means - restore snapshot without *any* additional synchronization. `Snapshot` means - prefer snapshot data over the current state. `Replica` means - prefer existing data over the snapshot.", + "enum": ["no_sync", "snapshot", "replica"], + "title": "SnapshotPriority", + "type": "string", + }, + "ReshardingDirectionOneOf": { + "description": "Scale up, add a new shard", + "enum": ["up"], + "title": "ReshardingDirectionOneOf", + "type": "string", + }, + "ReshardingDirectionOneOf1": { + "description": "Scale down, remove a shard", + "enum": ["down"], + "title": "ReshardingDirectionOneOf1", + "type": "string", + }, + "StartResharding": { + "additionalProperties": False, + "properties": { + "direction": { + "anyOf": [ + {"$ref": "#/$defs/ReshardingDirectionOneOf"}, + {"$ref": "#/$defs/ReshardingDirectionOneOf1"}, + ], + "description": "", + "title": "Direction", + }, + "peer_id": { + "anyOf": [{"type": "integer"}, {"type": "null"}], + "default": None, + "description": "", + "title": "Peer Id", + }, + "shard_key": { + "anyOf": [{"type": "integer"}, {"type": "string"}, {"type": "null"}], + "default": None, + "description": "", + "title": "Shard Key", + }, + }, + "required": ["direction"], + "title": "StartResharding", + "type": "object", + }, + "CollectionParamsDiff": { + "additionalProperties": False, + "properties": { + "replication_factor": { + "anyOf": [{"type": "integer"}, {"type": "null"}], + "default": None, + "description": "Number of replicas for each shard", + "title": "Replication Factor", + }, + "write_consistency_factor": { + "anyOf": [{"type": "integer"}, {"type": "null"}], + "default": None, + "description": "Minimal number successful responses from replicas to consider operation successful", + "title": "Write Consistency Factor", + }, + "read_fan_out_factor": { + "anyOf": [{"type": "integer"}, {"type": "null"}], + "default": None, + "description": "Fan-out every read request to these many additional remote nodes (and return first available response)", + "title": "Read Fan Out Factor", + }, + "on_disk_payload": { + "anyOf": [{"type": "boolean"}, {"type": "null"}], + "default": None, + "description": "If true - point's payload will not be stored in memory. It will be read from the disk every time it is requested. This setting saves RAM by (slightly) increasing the response time. Note: those payload values that are involved in filtering and are indexed - remain in RAM.", + "title": "On Disk Payload", + }, + }, + "title": "CollectionParamsDiff", + "type": "object", + }, + "Disabled": {"enum": ["Disabled"], "title": "Disabled", "type": "string"}, + "VectorParamsDiff": { + "additionalProperties": False, + "properties": { + "hnsw_config": { + "anyOf": [{"$ref": "#/$defs/HnswConfigDiff"}, {"type": "null"}], + "default": None, + "description": "Update params for HNSW index. If empty object - it will be unset.", + }, + "quantization_config": { + "anyOf": [ + {"$ref": "#/$defs/ScalarQuantization"}, + {"$ref": "#/$defs/ProductQuantization"}, + {"$ref": "#/$defs/BinaryQuantization"}, + {"$ref": "#/$defs/Disabled"}, + {"type": "null"}, + ], + "default": None, + "description": "Update params for quantization. If none - it is left unchanged.", + "title": "Quantization Config", + }, + "on_disk": { + "anyOf": [{"type": "boolean"}, {"type": "null"}], + "default": None, + "description": "If true, vectors are served from disk, improving RAM usage at the cost of latency", + "title": "On Disk", + }, + }, + "title": "VectorParamsDiff", + "type": "object", + }, + "ClearPayloadOperation": { + "additionalProperties": False, + "properties": { + "clear_payload": { + "anyOf": [{"$ref": "#/$defs/PointIdsList"}, {"$ref": "#/$defs/FilterSelector"}], + "description": "", + "title": "Clear Payload", + } + }, + "required": ["clear_payload"], + "title": "ClearPayloadOperation", + "type": "object", + }, + "DeleteOperation": { + "additionalProperties": False, + "properties": { + "delete": { + "anyOf": [{"$ref": "#/$defs/PointIdsList"}, {"$ref": "#/$defs/FilterSelector"}], + "description": "", + "title": "Delete", + } + }, + "required": ["delete"], + "title": "DeleteOperation", + "type": "object", + }, + "DeletePayloadOperation": { + "additionalProperties": False, + "properties": {"delete_payload": {"$ref": "#/$defs/DeletePayload", "description": ""}}, + "required": ["delete_payload"], + "title": "DeletePayloadOperation", + "type": "object", + }, + "DeleteVectorsOperation": { + "additionalProperties": False, + "properties": {"delete_vectors": {"$ref": "#/$defs/DeleteVectors", "description": ""}}, + "required": ["delete_vectors"], + "title": "DeleteVectorsOperation", + "type": "object", + }, + "OverwritePayloadOperation": { + "additionalProperties": False, + "properties": {"overwrite_payload": {"$ref": "#/$defs/SetPayload", "description": ""}}, + "required": ["overwrite_payload"], + "title": "OverwritePayloadOperation", + "type": "object", + }, + "PointVectors": { + "additionalProperties": False, + "properties": { + "id": { + "anyOf": [{"type": "integer"}, {"type": "string"}], + "description": "", + "title": "Id", + }, + "vector": { + "anyOf": [ + {"items": {"type": "number"}, "type": "array"}, + {"items": {"items": {"type": "number"}, "type": "array"}, "type": "array"}, + { + "additionalProperties": { + "anyOf": [ + {"items": {"type": "number"}, "type": "array"}, + {"$ref": "#/$defs/SparseVector"}, + { + "items": {"items": {"type": "number"}, "type": "array"}, + "type": "array", + }, + {"$ref": "#/$defs/Document"}, + {"$ref": "#/$defs/Image"}, + {"$ref": "#/$defs/InferenceObject"}, + ] + }, + "type": "object", + }, + {"$ref": "#/$defs/Document"}, + {"$ref": "#/$defs/Image"}, + {"$ref": "#/$defs/InferenceObject"}, + ], + "description": "", + "title": "Vector", + }, + }, + "required": ["id", "vector"], + "title": "PointVectors", + "type": "object", + }, + "PointsBatch": { + "additionalProperties": False, + "properties": { + "batch": {"$ref": "#/$defs/Batch", "description": ""}, + "shard_key": { + "anyOf": [ + {"type": "integer"}, + {"type": "string"}, + { + "items": {"anyOf": [{"type": "integer"}, {"type": "string"}]}, + "type": "array", + }, + {"type": "null"}, + ], + "default": None, + "description": "", + "title": "Shard Key", + }, + }, + "required": ["batch"], + "title": "PointsBatch", + "type": "object", + }, + "PointsList": { + "additionalProperties": False, + "properties": { + "points": { + "description": "", + "items": {"$ref": "#/$defs/PointStruct"}, + "title": "Points", + "type": "array", + }, + "shard_key": { + "anyOf": [ + {"type": "integer"}, + {"type": "string"}, + { + "items": {"anyOf": [{"type": "integer"}, {"type": "string"}]}, + "type": "array", + }, + {"type": "null"}, + ], + "default": None, + "description": "", + "title": "Shard Key", + }, + }, + "required": ["points"], + "title": "PointsList", + "type": "object", + }, + "SetPayloadOperation": { + "additionalProperties": False, + "properties": {"set_payload": {"$ref": "#/$defs/SetPayload", "description": ""}}, + "required": ["set_payload"], + "title": "SetPayloadOperation", + "type": "object", + }, + "UpdateVectors": { + "additionalProperties": False, + "properties": { + "points": { + "description": "Points with named vectors", + "items": {"$ref": "#/$defs/PointVectors"}, + "title": "Points", + "type": "array", + }, + "shard_key": { + "anyOf": [ + {"type": "integer"}, + {"type": "string"}, + { + "items": {"anyOf": [{"type": "integer"}, {"type": "string"}]}, + "type": "array", + }, + {"type": "null"}, + ], + "default": None, + "description": "", + "title": "Shard Key", + }, + }, + "required": ["points"], + "title": "UpdateVectors", + "type": "object", + }, + "UpdateVectorsOperation": { + "additionalProperties": False, + "properties": {"update_vectors": {"$ref": "#/$defs/UpdateVectors", "description": ""}}, + "required": ["update_vectors"], + "title": "UpdateVectorsOperation", + "type": "object", + }, + "UpsertOperation": { + "additionalProperties": False, + "properties": { + "upsert": { + "anyOf": [{"$ref": "#/$defs/PointsBatch"}, {"$ref": "#/$defs/PointsList"}], + "description": "", + "title": "Upsert", + } + }, + "required": ["upsert"], + "title": "UpsertOperation", + "type": "object", + }, +} +RECURSIVE_REFS = [ + "AbsExpression", + "DecayParamsExpression", + "DivExpression", + "ExpExpression", + "Filter", + "LinDecayExpression", + "LnExpression", + "Log10Expression", + "MultExpression", + "NegExpression", + "NestedCondition", + "PowExpression", + "Prefetch", + "SqrtExpression", + "SumExpression", +] +INCLUDED_RECURSIVE_REFS = ["Prefetch"] +EXCLUDED_RECURSIVE_REFS = [ + "AbsExpression", + "DecayParamsExpression", + "DivExpression", + "ExpExpression", + "Filter", + "LinDecayExpression", + "LnExpression", + "Log10Expression", + "MultExpression", + "NegExpression", + "NestedCondition", + "PowExpression", + "SqrtExpression", + "SumExpression", +] +NAME_RECURSIVE_REF_MAPPING = {"prefetch": "Prefetch"} diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/embed/common.py b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/embed/common.py new file mode 100644 index 0000000000000000000000000000000000000000..392a52798a9d189efd177381548ede505bfe5bbb --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/embed/common.py @@ -0,0 +1,6 @@ +from typing import Union + +from qdrant_client.http import models + +INFERENCE_OBJECT_NAMES: set[str] = {"Document", "Image", "InferenceObject"} +INFERENCE_OBJECT_TYPES = Union[models.Document, models.Image, models.InferenceObject] diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/embed/embed_inspector.py b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/embed/embed_inspector.py new file mode 100644 index 0000000000000000000000000000000000000000..52702bda9b911df4b6778f31c3d1096269e3b2f4 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/embed/embed_inspector.py @@ -0,0 +1,176 @@ +from copy import copy +from typing import Union, Optional, Iterable, get_args + +from pydantic import BaseModel + +from qdrant_client._pydantic_compat import model_fields_set +from qdrant_client.embed.common import INFERENCE_OBJECT_TYPES +from qdrant_client.embed.schema_parser import ModelSchemaParser + +from qdrant_client.embed.utils import convert_paths, FieldPath + + +class InspectorEmbed: + """Inspector which collects paths to objects requiring inference in the received models + + Attributes: + parser: ModelSchemaParser instance + """ + + def __init__(self, parser: Optional[ModelSchemaParser] = None) -> None: + self.parser = ModelSchemaParser() if parser is None else parser + + def inspect(self, points: Union[Iterable[BaseModel], BaseModel]) -> list[FieldPath]: + """Looks for all the paths to objects requiring inference in the received models + + Args: + points: models to inspect + + Returns: + list of FieldPath objects + """ + paths = [] + if isinstance(points, BaseModel): + self.parser.parse_model(points.__class__) + paths.extend(self._inspect_model(points)) + elif isinstance(points, dict): + for value in points.values(): + paths.extend(self.inspect(value)) + elif isinstance(points, Iterable): + for point in points: + if isinstance(point, BaseModel): + self.parser.parse_model(point.__class__) + paths.extend(self._inspect_model(point)) + + paths = sorted(set(paths)) + + return convert_paths(paths) + + def _inspect_model( + self, mod: BaseModel, paths: Optional[list[FieldPath]] = None, accum: Optional[str] = None + ) -> list[str]: + """Looks for all the paths to objects requiring inference in the received model + + Args: + mod: model to inspect + paths: list of paths to the fields possibly containing objects for inference + accum: accumulator for the path. Path is a dot separated string of field names which we assemble recursively + + Returns: + list of paths to the model fields containing objects for inference + """ + paths = self.parser.path_cache.get(mod.__class__.__name__, []) if paths is None else paths + + found_paths = [] + for path in paths: + found_paths.extend( + self._inspect_inner_models( + mod, path.current, path.tail if path.tail else [], accum + ) + ) + return found_paths + + def _inspect_inner_models( + self, + original_model: BaseModel, + current_path: str, + tail: list[FieldPath], + accum: Optional[str] = None, + ) -> list[str]: + """Looks for all the paths to objects requiring inference in the received model + + Args: + original_model: model to inspect + current_path: the field to inspect on the current iteration + tail: list of FieldPath objects to the fields possibly containing objects for inference + accum: accumulator for the path. Path is a dot separated string of field names which we assemble recursively + + Returns: + list of paths to the model fields containing objects for inference + """ + found_paths = [] + if accum is None: + accum = current_path + else: + accum += f".{current_path}" + + def inspect_recursive(member: BaseModel, accumulator: str) -> list[str]: + """Iterates over the set model fields, expand recursive ones and find paths to objects requiring inference + + Args: + member: currently inspected model, which may or may not contain recursive fields + accumulator: accumulator for the path, which is a dot separated string assembled recursively + """ + recursive_paths = [] + for field in model_fields_set(member): + if field in self.parser.name_recursive_ref_mapping: + mapped_field = self.parser.name_recursive_ref_mapping[field] + recursive_paths.extend(self.parser.path_cache[mapped_field]) + + return self._inspect_model(member, copy(recursive_paths), accumulator) + + model = getattr(original_model, current_path, None) + if model is None: + return [] + + if isinstance(model, get_args(INFERENCE_OBJECT_TYPES)): + return [accum] + + if isinstance(model, BaseModel): + found_paths.extend(inspect_recursive(model, accum)) + + for next_path in tail: + found_paths.extend( + self._inspect_inner_models( + model, next_path.current, next_path.tail if next_path.tail else [], accum + ) + ) + + return found_paths + + elif isinstance(model, list): + for current_model in model: + if not isinstance(current_model, BaseModel): + continue + + if isinstance(current_model, get_args(INFERENCE_OBJECT_TYPES)): + found_paths.append(accum) + + found_paths.extend(inspect_recursive(current_model, accum)) + + for next_path in tail: + for current_model in model: + found_paths.extend( + self._inspect_inner_models( + current_model, + next_path.current, + next_path.tail if next_path.tail else [], + accum, + ) + ) + return found_paths + + elif isinstance(model, dict): + found_paths = [] + for key, values in model.items(): + values = [values] if not isinstance(values, list) else values + for current_model in values: + if not isinstance(current_model, BaseModel): + continue + + if isinstance(current_model, get_args(INFERENCE_OBJECT_TYPES)): + found_paths.append(accum) + + found_paths.extend(inspect_recursive(current_model, accum)) + + for next_path in tail: + for current_model in values: + found_paths.extend( + self._inspect_inner_models( + current_model, + next_path.current, + next_path.tail if next_path.tail else [], + accum, + ) + ) + return found_paths diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/embed/embedder.py b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/embed/embedder.py new file mode 100644 index 0000000000000000000000000000000000000000..90c944c6a9bcfdaf7c7278200bdabdf01c9df28d --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/embed/embedder.py @@ -0,0 +1,387 @@ +from collections import defaultdict +from typing import Optional, Sequence, Any, TypeVar, Generic + +from pydantic import BaseModel + +from qdrant_client.http import models +from qdrant_client.embed.models import NumericVector +from qdrant_client.fastembed_common import ( + OnnxProvider, + ImageInput, + TextEmbedding, + SparseTextEmbedding, + LateInteractionTextEmbedding, + LateInteractionMultimodalEmbedding, + ImageEmbedding, + FastEmbedMisc, +) + + +T = TypeVar("T") + + +class ModelInstance(BaseModel, Generic[T], arbitrary_types_allowed=True): # type: ignore[call-arg] + model: T + options: dict[str, Any] + deprecated: bool = False + + +class Embedder: + def __init__(self, threads: Optional[int] = None, **kwargs: Any) -> None: + self.embedding_models: dict[str, list[ModelInstance[TextEmbedding]]] = defaultdict(list) + self.sparse_embedding_models: dict[str, list[ModelInstance[SparseTextEmbedding]]] = ( + defaultdict(list) + ) + self.late_interaction_embedding_models: dict[ + str, list[ModelInstance[LateInteractionTextEmbedding]] + ] = defaultdict(list) + self.image_embedding_models: dict[str, list[ModelInstance[ImageEmbedding]]] = defaultdict( + list + ) + self.late_interaction_multimodal_embedding_models: dict[ + str, list[ModelInstance[LateInteractionMultimodalEmbedding]] + ] = defaultdict(list) + self._threads = threads + + def get_or_init_model( + self, + model_name: str, + cache_dir: Optional[str] = None, + threads: Optional[int] = None, + providers: Optional[Sequence["OnnxProvider"]] = None, + cuda: bool = False, + device_ids: Optional[list[int]] = None, + deprecated: bool = False, + **kwargs: Any, + ) -> TextEmbedding: + if not FastEmbedMisc.is_supported_text_model(model_name): + raise ValueError( + f"Unsupported embedding model: {model_name}. Supported models: {FastEmbedMisc.list_text_models()}" + ) + options = { + "cache_dir": cache_dir, + "threads": threads or self._threads, + "providers": providers, + "cuda": cuda, + "device_ids": device_ids, + **kwargs, + } + for instance in self.embedding_models[model_name]: + if (deprecated and instance.deprecated) or ( + not deprecated and instance.options == options + ): + return instance.model + + model = TextEmbedding(model_name=model_name, **options) + model_instance: ModelInstance[TextEmbedding] = ModelInstance( + model=model, options=options, deprecated=deprecated + ) + self.embedding_models[model_name].append(model_instance) + return model + + def get_or_init_sparse_model( + self, + model_name: str, + cache_dir: Optional[str] = None, + threads: Optional[int] = None, + providers: Optional[Sequence["OnnxProvider"]] = None, + cuda: bool = False, + device_ids: Optional[list[int]] = None, + deprecated: bool = False, + **kwargs: Any, + ) -> SparseTextEmbedding: + if not FastEmbedMisc.is_supported_sparse_model(model_name): + raise ValueError( + f"Unsupported embedding model: {model_name}. Supported models: {FastEmbedMisc.list_sparse_models()}" + ) + + options = { + "cache_dir": cache_dir, + "threads": threads or self._threads, + "providers": providers, + "cuda": cuda, + "device_ids": device_ids, + **kwargs, + } + + for instance in self.sparse_embedding_models[model_name]: + if (deprecated and instance.deprecated) or ( + not deprecated and instance.options == options + ): + return instance.model + + model = SparseTextEmbedding(model_name=model_name, **options) + model_instance: ModelInstance[SparseTextEmbedding] = ModelInstance( + model=model, options=options, deprecated=deprecated + ) + self.sparse_embedding_models[model_name].append(model_instance) + return model + + def get_or_init_late_interaction_model( + self, + model_name: str, + cache_dir: Optional[str] = None, + threads: Optional[int] = None, + providers: Optional[Sequence["OnnxProvider"]] = None, + cuda: bool = False, + device_ids: Optional[list[int]] = None, + **kwargs: Any, + ) -> LateInteractionTextEmbedding: + if not FastEmbedMisc.is_supported_late_interaction_text_model(model_name): + raise ValueError( + f"Unsupported embedding model: {model_name}. " + f"Supported models: {FastEmbedMisc.list_late_interaction_text_models()}" + ) + options = { + "cache_dir": cache_dir, + "threads": threads or self._threads, + "providers": providers, + "cuda": cuda, + "device_ids": device_ids, + **kwargs, + } + + for instance in self.late_interaction_embedding_models[model_name]: + if instance.options == options: + return instance.model + + model = LateInteractionTextEmbedding(model_name=model_name, **options) + model_instance: ModelInstance[LateInteractionTextEmbedding] = ModelInstance( + model=model, options=options + ) + self.late_interaction_embedding_models[model_name].append(model_instance) + return model + + def get_or_init_late_interaction_multimodal_model( + self, + model_name: str, + cache_dir: Optional[str] = None, + threads: Optional[int] = None, + providers: Optional[Sequence["OnnxProvider"]] = None, + cuda: bool = False, + device_ids: Optional[list[int]] = None, + **kwargs: Any, + ) -> LateInteractionMultimodalEmbedding: + if not FastEmbedMisc.is_supported_late_interaction_multimodal_model(model_name): + raise ValueError( + f"Unsupported embedding model: {model_name}. " + f"Supported models: {FastEmbedMisc.list_late_interaction_multimodal_models()}" + ) + options = { + "cache_dir": cache_dir, + "threads": threads or self._threads, + "providers": providers, + "cuda": cuda, + "device_ids": device_ids, + **kwargs, + } + + for instance in self.late_interaction_multimodal_embedding_models[model_name]: + if instance.options == options: + return instance.model + + model = LateInteractionMultimodalEmbedding(model_name=model_name, **options) + model_instance: ModelInstance[LateInteractionMultimodalEmbedding] = ModelInstance( + model=model, options=options + ) + self.late_interaction_multimodal_embedding_models[model_name].append(model_instance) + return model + + def get_or_init_image_model( + self, + model_name: str, + cache_dir: Optional[str] = None, + threads: Optional[int] = None, + providers: Optional[Sequence["OnnxProvider"]] = None, + cuda: bool = False, + device_ids: Optional[list[int]] = None, + **kwargs: Any, + ) -> ImageEmbedding: + if not FastEmbedMisc.is_supported_image_model(model_name): + raise ValueError( + f"Unsupported embedding model: {model_name}. Supported models: {FastEmbedMisc.list_image_models()}" + ) + options = { + "cache_dir": cache_dir, + "threads": threads or self._threads, + "providers": providers, + "cuda": cuda, + "device_ids": device_ids, + **kwargs, + } + + for instance in self.image_embedding_models[model_name]: + if instance.options == options: + return instance.model + + model = ImageEmbedding(model_name=model_name, **options) + model_instance: ModelInstance[ImageEmbedding] = ModelInstance(model=model, options=options) + self.image_embedding_models[model_name].append(model_instance) + return model + + def embed( + self, + model_name: str, + texts: Optional[list[str]] = None, + images: Optional[list[ImageInput]] = None, + options: Optional[dict[str, Any]] = None, + is_query: bool = False, + batch_size: int = 8, + ) -> NumericVector: + if (texts is None) is (images is None): + raise ValueError("Either documents or images should be provided") + + embeddings: NumericVector # define type for a static type checker + if texts is not None: + if FastEmbedMisc.is_supported_text_model(model_name): + embeddings = self._embed_dense_text( + texts, model_name, options, is_query, batch_size + ) + elif FastEmbedMisc.is_supported_sparse_model(model_name): + embeddings = self._embed_sparse_text( + texts, model_name, options, is_query, batch_size + ) + elif FastEmbedMisc.is_supported_late_interaction_text_model(model_name): + embeddings = self._embed_late_interaction_text( + texts, model_name, options, is_query, batch_size + ) + elif FastEmbedMisc.is_supported_late_interaction_multimodal_model(model_name): + embeddings = self._embed_late_interaction_multimodal_text( + texts, model_name, options, batch_size + ) + else: + raise ValueError(f"Unsupported embedding model: {model_name}") + else: + assert ( + images is not None + ) # just to satisfy mypy which can't infer it from the previous conditions + if FastEmbedMisc.is_supported_image_model(model_name): + embeddings = self._embed_dense_image(images, model_name, options, batch_size) + elif FastEmbedMisc.is_supported_late_interaction_multimodal_model(model_name): + embeddings = self._embed_late_interaction_multimodal_image( + images, model_name, options, batch_size + ) + else: + raise ValueError(f"Unsupported embedding model: {model_name}") + + return embeddings + + def _embed_dense_text( + self, + texts: list[str], + model_name: str, + options: Optional[dict[str, Any]], + is_query: bool, + batch_size: int, + ) -> list[list[float]]: + embedding_model_inst = self.get_or_init_model(model_name=model_name, **options or {}) + + if not is_query: + embeddings = [ + embedding.tolist() + for embedding in embedding_model_inst.embed(documents=texts, batch_size=batch_size) + ] + else: + embeddings = [ + embedding.tolist() for embedding in embedding_model_inst.query_embed(query=texts) + ] + return embeddings + + def _embed_sparse_text( + self, + texts: list[str], + model_name: str, + options: Optional[dict[str, Any]], + is_query: bool, + batch_size: int, + ) -> list[models.SparseVector]: + embedding_model_inst = self.get_or_init_sparse_model( + model_name=model_name, **options or {} + ) + if not is_query: + embeddings = [ + models.SparseVector( + indices=sparse_embedding.indices.tolist(), + values=sparse_embedding.values.tolist(), + ) + for sparse_embedding in embedding_model_inst.embed( + documents=texts, batch_size=batch_size + ) + ] + else: + embeddings = [ + models.SparseVector( + indices=sparse_embedding.indices.tolist(), + values=sparse_embedding.values.tolist(), + ) + for sparse_embedding in embedding_model_inst.query_embed(query=texts) + ] + return embeddings + + def _embed_late_interaction_text( + self, + texts: list[str], + model_name: str, + options: Optional[dict[str, Any]], + is_query: bool, + batch_size: int, + ) -> list[list[list[float]]]: + embedding_model_inst = self.get_or_init_late_interaction_model( + model_name=model_name, **options or {} + ) + if not is_query: + embeddings = [ + embedding.tolist() + for embedding in embedding_model_inst.embed(documents=texts, batch_size=batch_size) + ] + else: + embeddings = [ + embedding.tolist() for embedding in embedding_model_inst.query_embed(query=texts) + ] + return embeddings + + def _embed_late_interaction_multimodal_text( + self, + texts: list[str], + model_name: str, + options: Optional[dict[str, Any]], + batch_size: int, + ) -> list[list[list[float]]]: + embedding_model_inst = self.get_or_init_late_interaction_multimodal_model( + model_name=model_name, **options or {} + ) + return [ + embedding.tolist() + for embedding in embedding_model_inst.embed_text( + documents=texts, batch_size=batch_size + ) + ] + + def _embed_late_interaction_multimodal_image( + self, + images: list[ImageInput], + model_name: str, + options: Optional[dict[str, Any]], + batch_size: int, + ) -> list[list[list[float]]]: + embedding_model_inst = self.get_or_init_late_interaction_multimodal_model( + model_name=model_name, **options or {} + ) + return [ + embedding.tolist() + for embedding in embedding_model_inst.embed_image(images=images, batch_size=batch_size) + ] + + def _embed_dense_image( + self, + images: list[ImageInput], + model_name: str, + options: Optional[dict[str, Any]], + batch_size: int, + ) -> list[list[float]]: + embedding_model_inst = self.get_or_init_image_model(model_name=model_name, **options or {}) + embeddings = [ + embedding.tolist() + for embedding in embedding_model_inst.embed(images=images, batch_size=batch_size) + ] + return embeddings diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/embed/model_embedder.py b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/embed/model_embedder.py new file mode 100644 index 0000000000000000000000000000000000000000..2ccdda49a380d229937221696ff487b08c40a569 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/embed/model_embedder.py @@ -0,0 +1,443 @@ +import os +from collections import defaultdict +from copy import deepcopy +from multiprocessing import get_all_start_methods +from typing import Optional, Union, Iterable, Any, Type, get_args + +from pydantic import BaseModel + +from qdrant_client.http import models +from qdrant_client.embed.common import INFERENCE_OBJECT_TYPES +from qdrant_client.embed.embed_inspector import InspectorEmbed +from qdrant_client.embed.embedder import Embedder +from qdrant_client.embed.models import NumericVector, NumericVectorStruct +from qdrant_client.embed.schema_parser import ModelSchemaParser +from qdrant_client.embed.utils import FieldPath +from qdrant_client.fastembed_common import FastEmbedMisc +from qdrant_client.parallel_processor import ParallelWorkerPool, Worker +from qdrant_client.uploader.uploader import iter_batch + + +class ModelEmbedderWorker(Worker): + def __init__(self, batch_size: int, **kwargs: Any): + self.model_embedder = ModelEmbedder(**kwargs) + self.batch_size = batch_size + + @classmethod + def start(cls, batch_size: int, **kwargs: Any) -> "ModelEmbedderWorker": + return cls(threads=1, batch_size=batch_size, **kwargs) + + def process(self, items: Iterable[tuple[int, Any]]) -> Iterable[tuple[int, Any]]: + for idx, batch in items: + yield ( + idx, + list( + self.model_embedder.embed_models_batch( + batch, inference_batch_size=self.batch_size + ) + ), + ) + + +class ModelEmbedder: + MAX_INTERNAL_BATCH_SIZE = 64 + + def __init__(self, parser: Optional[ModelSchemaParser] = None, **kwargs: Any): + self._batch_accumulator: dict[str, list[INFERENCE_OBJECT_TYPES]] = {} + self._embed_storage: dict[str, list[NumericVector]] = {} + self._embed_inspector = InspectorEmbed(parser=parser) + self.embedder = Embedder(**kwargs) + + def embed_models( + self, + raw_models: Union[BaseModel, Iterable[BaseModel]], + is_query: bool = False, + batch_size: int = 8, + ) -> Iterable[BaseModel]: + """Embed raw data fields in models and return models with vectors + + If any of model fields required inference, a deepcopy of a model with computed embeddings is returned, + otherwise returns original models. + Args: + raw_models: Iterable[BaseModel] - models which can contain fields with raw data + is_query: bool - flag to determine which embed method to use. Defaults to False. + batch_size: int - batch size for inference + Returns: + list[BaseModel]: models with embedded fields + """ + if isinstance(raw_models, BaseModel): + raw_models = [raw_models] + for raw_models_batch in iter_batch(raw_models, batch_size): + yield from self.embed_models_batch( + raw_models_batch, is_query, inference_batch_size=batch_size + ) + + def embed_models_strict( + self, + raw_models: Iterable[Union[dict[str, BaseModel], BaseModel]], + batch_size: int = 8, + parallel: Optional[int] = None, + ) -> Iterable[Union[dict[str, BaseModel], BaseModel]]: + """Embed raw data fields in models and return models with vectors + + Requires every input sequences element to contain raw data fields to inference. + Does not accept ready vectors. + + Args: + raw_models: Iterable[BaseModel] - models which contain fields with raw data to inference + batch_size: int - batch size for inference + parallel: int - number of parallel processes to use. Defaults to None. + + Returns: + Iterable[Union[dict[str, BaseModel], BaseModel]]: models with embedded fields + """ + is_small = False + + if isinstance(raw_models, list): + if len(raw_models) < batch_size: + is_small = True + + if parallel is None or parallel == 1 or is_small: + for batch in iter_batch(raw_models, batch_size): + yield from self.embed_models_batch(batch, inference_batch_size=batch_size) + else: + multiprocessing_batch_size = 1 # larger batch sizes do not help with data parallel + # on cpu. todo: adjust when multi-gpu is available + raw_models_batches = iter_batch(raw_models, size=multiprocessing_batch_size) + if parallel == 0: + parallel = os.cpu_count() + + start_method = "forkserver" if "forkserver" in get_all_start_methods() else "spawn" + assert parallel is not None # just a mypy complaint + pool = ParallelWorkerPool( + num_workers=parallel, + worker=self._get_worker_class(), + start_method=start_method, + max_internal_batch_size=self.MAX_INTERNAL_BATCH_SIZE, + ) + + for batch in pool.ordered_map( + raw_models_batches, batch_size=multiprocessing_batch_size + ): + yield from batch + + def embed_models_batch( + self, + raw_models: list[Union[dict[str, BaseModel], BaseModel]], + is_query: bool = False, + inference_batch_size: int = 8, + ) -> Iterable[BaseModel]: + """Embed a batch of models with raw data fields and return models with vectors + + If any of model fields required inference, a deepcopy of a model with computed embeddings is returned, + otherwise returns original models. + Args: + raw_models: list[Union[dict[str, BaseModel], BaseModel]] - models which can contain fields with raw data + is_query: bool - flag to determine which embed method to use. Defaults to False. + inference_batch_size: int - batch size for inference + Returns: + Iterable[BaseModel]: models with embedded fields + """ + for raw_model in raw_models: + self._process_model(raw_model, is_query=is_query, accumulating=True) + + if not self._batch_accumulator: + yield from raw_models + else: + yield from ( + self._process_model( + raw_model, + is_query=is_query, + accumulating=False, + inference_batch_size=inference_batch_size, + ) + for raw_model in raw_models + ) + + def _process_model( + self, + model: Union[dict[str, BaseModel], BaseModel], + paths: Optional[list[FieldPath]] = None, + is_query: bool = False, + accumulating: bool = False, + inference_batch_size: Optional[int] = None, + ) -> Union[dict[str, BaseModel], dict[str, NumericVector], BaseModel, NumericVector]: + """Embed model's fields requiring inference + + Args: + model: Qdrant http model containing fields to embed + paths: Path to fields to embed. E.g. [FieldPath(current="recommend", tail=[FieldPath(current="negative", tail=None)])] + is_query: Flag to determine which embed method to use. Defaults to False. + accumulating: Flag to determine if we are accumulating models for batch embedding. Defaults to False. + inference_batch_size: Optional[int] - batch size for inference + + Returns: + A deepcopy of the method with embedded fields + """ + + if isinstance(model, get_args(INFERENCE_OBJECT_TYPES)): + if accumulating: + self._accumulate(model) # type: ignore + else: + assert ( + inference_batch_size is not None + ), "inference_batch_size should be passed for inference" + return self._drain_accumulator( + model, # type: ignore + is_query=is_query, + inference_batch_size=inference_batch_size, + ) + + if paths is None: + model = deepcopy(model) if not accumulating else model + + if isinstance(model, dict): + for key, value in model.items(): + if accumulating: + self._process_model(value, paths, accumulating=True) + else: + model[key] = self._process_model( + value, + paths, + is_query=is_query, + accumulating=False, + inference_batch_size=inference_batch_size, + ) + return model + + paths = paths if paths is not None else self._embed_inspector.inspect(model) + + for path in paths: + list_model = [model] if not isinstance(model, list) else model + for item in list_model: + current_model = getattr(item, path.current, None) + if current_model is None: + continue + if path.tail: + self._process_model( + current_model, + path.tail, + is_query=is_query, + accumulating=accumulating, + inference_batch_size=inference_batch_size, + ) + else: + was_list = isinstance(current_model, list) + current_model = current_model if was_list else [current_model] + + if not accumulating: + assert ( + inference_batch_size is not None + ), "inference_batch_size should be passed for inference" + embeddings = [ + self._drain_accumulator( + data, is_query=is_query, inference_batch_size=inference_batch_size + ) + for data in current_model + ] + if was_list: + setattr(item, path.current, embeddings) + else: + setattr(item, path.current, embeddings[0]) + else: + for data in current_model: + self._accumulate(data) + return model + + def _accumulate(self, data: models.VectorStruct) -> None: + """Add data to batch accumulator + + Args: + data: models.VectorStruct - any vector struct data, if inference object types instances in `data` - add them + to the accumulator, otherwise - do nothing. `InferenceObject` instances are converted to proper types. + + Returns: + None + """ + if isinstance(data, dict): + for value in data.values(): + self._accumulate(value) + return None + + if isinstance(data, list): + for value in data: + if not isinstance(value, get_args(INFERENCE_OBJECT_TYPES)): # if value is a vector + return None + self._accumulate(value) + + if not isinstance(data, get_args(INFERENCE_OBJECT_TYPES)): + return None + + data = self._resolve_inference_object(data) + if data.model not in self._batch_accumulator: + self._batch_accumulator[data.model] = [] + self._batch_accumulator[data.model].append(data) + return None + + def _drain_accumulator( + self, data: models.VectorStruct, is_query: bool, inference_batch_size: int = 8 + ) -> NumericVectorStruct: + """Drain accumulator and replaces inference objects with computed embeddings + It is assumed objects are traversed in the same order as they were added to the accumulator + + Args: + data: models.VectorStruct - any vector struct data, if inference object types instances in `data` - replace + them with computed embeddings. If embeddings haven't yet been computed - compute them and then replace + inference objects. + inference_batch_size: int - batch size for inference + + Returns: + NumericVectorStruct: data with replaced inference objects + """ + if isinstance(data, dict): + for key, value in data.items(): + data[key] = self._drain_accumulator( + value, is_query=is_query, inference_batch_size=inference_batch_size + ) + return data + + if isinstance(data, list): + for i, value in enumerate(data): + if not isinstance(value, get_args(INFERENCE_OBJECT_TYPES)): # if value is vector + return data + + data[i] = self._drain_accumulator( + value, is_query=is_query, inference_batch_size=inference_batch_size + ) + return data + + if not isinstance( + data, get_args(INFERENCE_OBJECT_TYPES) + ): # ide type checker ignores `not` and scolds + return data # type: ignore + + if not self._embed_storage or not self._embed_storage.get(data.model, None): + self._embed_accumulator(is_query=is_query, inference_batch_size=inference_batch_size) + + return self._next_embed(data.model) + + def _embed_accumulator(self, is_query: bool = False, inference_batch_size: int = 8) -> None: + """Embed all accumulated objects for all models + + Args: + is_query: bool - flag to determine which embed method to use. Defaults to False. + inference_batch_size: int - batch size for inference + Returns: + None + """ + + def embed( + objects: list[INFERENCE_OBJECT_TYPES], model_name: str, batch_size: int + ) -> list[NumericVector]: + """ + Assemble batches by options and data type based groups, embeds and return embeddings in the original order + """ + unique_options: list[dict[str, Any]] = [] + unique_options_is_text: list[bool] = [] # multimodal models can have both text + # and image data, we need to track which data we process to construct separate batches for texts and images + batches: list[Any] = [] + group_indices: dict[int, list[int]] = defaultdict(list) + for i, obj in enumerate(objects): + is_text = isinstance(obj, models.Document) + for j, (options, options_is_text) in enumerate( + zip(unique_options, unique_options_is_text) + ): + if options == obj.options and is_text == options_is_text: + group_indices[j].append(i) + batches[j].append(obj.text if is_text else obj.image) + break + else: + # Create a new group if no match was found + group_indices[len(unique_options)] = [i] + unique_options.append(obj.options) + unique_options_is_text.append(is_text) + batches.append([obj.text if is_text else obj.image]) + + embeddings = [] + for i, (options, is_text) in enumerate(zip(unique_options, unique_options_is_text)): + embeddings.extend( + [ + embedding + for embedding in self.embedder.embed( + model_name=model_name, + texts=batches[i] if is_text else None, + images=batches[i] if not is_text else None, + is_query=is_query, + options=options or {}, + batch_size=batch_size, + ) + ] + ) + + iter_embeddings = iter(embeddings) + ordered_embeddings: list[list[NumericVector]] = [[]] * len(objects) + for indices in group_indices.values(): + for index in indices: + ordered_embeddings[index] = next(iter_embeddings) + return ordered_embeddings + + for model in self._batch_accumulator: + if not any( + ( + FastEmbedMisc.is_supported_text_model(model), + FastEmbedMisc.is_supported_sparse_model(model), + FastEmbedMisc.is_supported_late_interaction_text_model(model), + FastEmbedMisc.is_supported_image_model(model), + FastEmbedMisc.is_supported_late_interaction_multimodal_model(model), + ) + ): + raise ValueError(f"{model} is not among supported models") + + for model, data in self._batch_accumulator.items(): + self._embed_storage[model] = embed( + objects=data, model_name=model, batch_size=inference_batch_size + ) + self._batch_accumulator.clear() + + def _next_embed(self, model_name: str) -> NumericVector: + """Get next computed embedding from embedded batch + + Args: + model_name: str - retrieve embedding from the storage by this model name + + Returns: + NumericVector: computed embedding + """ + return self._embed_storage[model_name].pop(0) + + @staticmethod + def _resolve_inference_object(data: models.VectorStruct) -> models.VectorStruct: + """Resolve inference object into a model + + Args: + data: models.VectorStruct - data to resolve, if it's an inference object, convert it to a proper type, + otherwise - keep unchanged + + Returns: + models.VectorStruct: resolved data + """ + + if not isinstance(data, models.InferenceObject): + return data + + model_name = data.model + value = data.object + options = data.options + if any( + ( + FastEmbedMisc.is_supported_text_model(model_name), + FastEmbedMisc.is_supported_sparse_model(model_name), + FastEmbedMisc.is_supported_late_interaction_text_model(model_name), + ) + ): + return models.Document(model=model_name, text=value, options=options) + if FastEmbedMisc.is_supported_image_model(model_name): + return models.Image(model=model_name, image=value, options=options) + if FastEmbedMisc.is_supported_late_interaction_multimodal_model(model_name): + raise ValueError(f"{model_name} does not support `InferenceObject` interface") + + raise ValueError(f"{model_name} is not among supported models") + + @classmethod + def _get_worker_class(cls) -> Type[ModelEmbedderWorker]: + return ModelEmbedderWorker diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/embed/models.py b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/embed/models.py new file mode 100644 index 0000000000000000000000000000000000000000..300858b58d768762fa6736ea678c036bf9de5ade --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/embed/models.py @@ -0,0 +1,25 @@ +from typing import Union + +from pydantic import StrictFloat, StrictStr + +from qdrant_client.http.models import ExtendedPointId, SparseVector + + +NumericVector = Union[ + list[StrictFloat], + SparseVector, + list[list[StrictFloat]], +] +NumericVectorInput = Union[ + list[StrictFloat], + SparseVector, + list[list[StrictFloat]], + ExtendedPointId, +] +NumericVectorStruct = Union[ + list[StrictFloat], + list[list[StrictFloat]], + dict[StrictStr, NumericVector], +] + +__all__ = ["NumericVector", "NumericVectorInput", "NumericVectorStruct"] diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/embed/schema_parser.py b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/embed/schema_parser.py new file mode 100644 index 0000000000000000000000000000000000000000..5e33b30b3e3b89c1870306d4ee400c9e6378e058 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/embed/schema_parser.py @@ -0,0 +1,305 @@ +from copy import copy, deepcopy +from pathlib import Path +from typing import Type, Union, Any, Optional + +from pydantic import BaseModel + +from qdrant_client._pydantic_compat import model_json_schema +from qdrant_client.embed.utils import FieldPath, convert_paths + + +try: + from qdrant_client.embed._inspection_cache import ( + DEFS, + CACHE_STR_PATH, + RECURSIVE_REFS, + EXCLUDED_RECURSIVE_REFS, + INCLUDED_RECURSIVE_REFS, + NAME_RECURSIVE_REF_MAPPING, + ) +except ImportError as e: + DEFS = {} + CACHE_STR_PATH = {} + RECURSIVE_REFS = set() # type: ignore + EXCLUDED_RECURSIVE_REFS = {"Filter"} # type: ignore + INCLUDED_RECURSIVE_REFS = set() # type: ignore + NAME_RECURSIVE_REF_MAPPING = {} + + +class ModelSchemaParser: + """Model schema parser. Parses json schemas to retrieve paths to objects requiring inference. + + The parser is stateful, it accumulates the results of parsing in its internal structures. + + Attributes: + _defs: definitions extracted from json schemas + _recursive_refs: set of recursive refs found in the processed schemas, e.g.: + {"Filter", "Prefetch"} + _excluded_recursive_refs: predefined time-consuming recursive refs which don't have inference objects, e.g.: + {"Filter"} + _included_recursive_refs: set of recursive refs which have inference objects, e.g.: + {"Prefetch"} + _cache: cache of string paths for models containing objects for inference, e.g.: + {"Prefetch": ['prefetch.query', 'prefetch.query.context.negative', ...]} + path_cache: cache of FieldPath objects for models containing objects for inference, e.g.: + { + "Prefetch": [ + FieldPath( + current="prefetch", + tail=[ + FieldPath( + current="query", + tail=[ + FieldPath( + current="recommend", + tail=[ + FieldPath(current="negative", tail=None), + FieldPath(current="positive", tail=None), + ], + ), + ..., + ], + ), + ], + ) + ] + } + name_recursive_ref_mapping: mapping of model field names to ref names, e.g.: + {"prefetch": "Prefetch"} + """ + + CACHE_PATH = "_inspection_cache.py" + INFERENCE_OBJECT_NAMES = {"Document", "Image", "InferenceObject"} + + def __init__(self) -> None: + # self._defs does not include the whole schema, but only the part with the structures used in $defs + self._defs: dict[str, Union[dict[str, Any], list[dict[str, Any]]]] = deepcopy(DEFS) # type: ignore[arg-type] + self._cache: dict[str, list[str]] = deepcopy(CACHE_STR_PATH) + + self._recursive_refs: set[str] = set(RECURSIVE_REFS) + self._excluded_recursive_refs: set[str] = set(EXCLUDED_RECURSIVE_REFS) + self._included_recursive_refs: set[str] = set(INCLUDED_RECURSIVE_REFS) + + self.name_recursive_ref_mapping: dict[str, str] = { + k: v for k, v in NAME_RECURSIVE_REF_MAPPING.items() + } + self.path_cache: dict[str, list[FieldPath]] = { + model: convert_paths(paths) for model, paths in self._cache.items() + } + self._processed_recursive_defs: dict[str, Any] = {} + + def _replace_refs( + self, + schema: Union[dict[str, Any], list[dict[str, Any]]], + parent: Optional[str] = None, + seen_refs: Optional[set] = None, + ) -> Union[dict[str, Any], list[dict[str, Any]]]: + """Replace refs in schema with their definitions + + Args: + schema: schema to parse + parent: previous level key + seen_refs: set of seen refs to spot recursive paths + + Returns: + schema with replaced refs + """ + parent = parent if parent else None + seen_refs = seen_refs if seen_refs else set() + + if isinstance(schema, dict): + if "$ref" in schema: + ref_path = schema["$ref"] + def_key = ref_path.split("/")[-1] + if def_key in self._processed_recursive_defs: + return self._processed_recursive_defs[def_key] + + if def_key == parent or def_key in seen_refs: + self._recursive_refs.add(def_key) + self._processed_recursive_defs[def_key] = schema + return schema + + seen_refs.add(def_key) + + return self._replace_refs( + self._defs[def_key], parent=def_key, seen_refs=copy(seen_refs) + ) + + schemes = {} + if "properties" in schema: + for k, v in schema.items(): + if k == "properties": + schemes[k] = self._replace_refs( + schema=v, parent=parent, seen_refs=copy(seen_refs) + ) + else: + schemes[k] = v + else: + for k, v in schema.items(): + parent_key = k if isinstance(v, dict) and "properties" in v else parent + schemes[k] = self._replace_refs( + schema=v, parent=parent_key, seen_refs=copy(seen_refs) + ) + + return schemes + elif isinstance(schema, list): + return [ + self._replace_refs(schema=item, parent=parent, seen_refs=copy(seen_refs)) # type: ignore + for item in schema + ] + else: + return schema + + def _find_document_paths( + self, + schema: Union[dict[str, Any], list[dict[str, Any]]], + current_path: str = "", + after_properties: bool = False, + seen_refs: Optional[set] = None, + ) -> list[str]: + """Read a schema and find paths to objects requiring inference + + Populates model fields names to ref names mapping + + Args: + schema: schema to parse + current_path: current path in the schema + after_properties: flag indicating if the current path is after "properties" key + seen_refs: set of seen refs to spot recursive paths + + Returns: + List of string dot separated paths to objects requiring inference + """ + document_paths: list[str] = [] + seen_recursive_refs = seen_refs if seen_refs is not None else set() + + parts = current_path.split(".") + if len(parts) != len(set(parts)): # check for recursive paths + return document_paths + + if not isinstance(schema, dict): + return document_paths + + if "title" in schema and schema["title"] in self.INFERENCE_OBJECT_NAMES: + document_paths.append(current_path) + return document_paths + + for key, value in schema.items(): + if key == "$defs": + continue + + if key == "$ref": + model_name = value.split("/")[-1] + + value = self._defs[model_name] + if model_name in seen_recursive_refs: + continue + + if ( + model_name in self._excluded_recursive_refs + ): # on the first run it might be empty + continue + + if ( + model_name in self._recursive_refs + ): # included and excluded refs might not be filled up yet, we're looking in all recursive refs + # we would need to clean up name recursive ref mapping later and delete excluded refs from there + seen_recursive_refs.add(model_name) + self.name_recursive_ref_mapping[current_path.split(".")[-1]] = model_name + + if after_properties: # field name seen in pydantic models comes after "properties" key + if current_path: + new_path = f"{current_path}.{key}" + else: + new_path = key + else: + new_path = current_path + + if isinstance(value, dict): + document_paths.extend( + self._find_document_paths( + value, new_path, key == "properties", seen_refs=seen_recursive_refs + ) + ) + elif isinstance(value, list): + for item in value: + if isinstance(item, dict): + document_paths.extend( + self._find_document_paths( + item, + new_path, + key == "properties", + seen_refs=seen_recursive_refs, + ) + ) + + return sorted(set(document_paths)) + + def parse_model(self, model: Type[BaseModel]) -> None: + """Parse model schema to retrieve paths to objects requiring inference. + + Checks model json schema, extracts definitions and finds paths to objects requiring inference. + No parsing happens if model has already been processed. + + Args: + model: model to parse + + Returns: + None + """ + model_name = model.__name__ + if model_name in self._cache: + return None + + schema = model_json_schema(model) + + for k, v in schema.get("$defs", {}).items(): + if k not in self._defs: + self._defs[k] = v + + if "$defs" in schema: + raw_refs = ( + {"$ref": schema["$ref"]} + if "$ref" in schema + else {"properties": schema["properties"]} + ) + refs = self._replace_refs(raw_refs) + self._cache[model_name] = self._find_document_paths(refs) + else: + self._cache[model_name] = [] + + for ref in self._recursive_refs: + if ref in self._excluded_recursive_refs or ref in self._included_recursive_refs: + continue + + if self._find_document_paths(self._defs[ref]): + self._included_recursive_refs.add(ref) + else: + self._excluded_recursive_refs.add(ref) + + self.name_recursive_ref_mapping = { + k: v + for k, v in self.name_recursive_ref_mapping.items() + if v not in self._excluded_recursive_refs + } + + # convert str paths to FieldPath objects which group path parts and reduce the time of the traversal + self.path_cache = {model: convert_paths(paths) for model, paths in self._cache.items()} + + def _persist(self, output_path: Union[Path, str] = CACHE_PATH) -> None: + """Persist the parser state to a file + + Args: + output_path: path to the file to save the parser state + + Returns: + None + """ + with open(output_path, "w") as f: + f.write(f"CACHE_STR_PATH = {self._cache}\n") + f.write(f"DEFS = {self._defs}\n") + # `sorted is required` to use `diff` in comparisons + f.write(f"RECURSIVE_REFS = {sorted(self._recursive_refs)}\n") + f.write(f"INCLUDED_RECURSIVE_REFS = {sorted(self._included_recursive_refs)}\n") + f.write(f"EXCLUDED_RECURSIVE_REFS = {sorted(self._excluded_recursive_refs)}\n") + f.write(f"NAME_RECURSIVE_REF_MAPPING = {self.name_recursive_ref_mapping}\n") diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/embed/type_inspector.py b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/embed/type_inspector.py new file mode 100644 index 0000000000000000000000000000000000000000..9b21b57b4745ecb1c18c74792c5fd5704a0c9ec4 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/embed/type_inspector.py @@ -0,0 +1,149 @@ +from typing import Union, Optional, Iterable, get_args + +from pydantic import BaseModel + +from qdrant_client._pydantic_compat import model_fields_set +from qdrant_client.embed.common import INFERENCE_OBJECT_TYPES + +from qdrant_client.embed.schema_parser import ModelSchemaParser +from qdrant_client.embed.utils import FieldPath + + +class Inspector: + """Inspector which tries to find at least one occurrence of an object requiring inference + + Inspector is stateful and accumulates parsed model schemes in its parser. + + Attributes: + parser: ModelSchemaParser instance to inspect model json schemas + """ + + def __init__(self, parser: Optional[ModelSchemaParser] = None) -> None: + self.parser = ModelSchemaParser() if parser is None else parser + + def inspect(self, points: Union[Iterable[BaseModel], BaseModel]) -> bool: + """Looks for at least one occurrence of an object requiring inference in the received models + + Args: + points: models to inspect + + Returns: + True if at least one object requiring inference is found, False otherwise + """ + if isinstance(points, BaseModel): + self.parser.parse_model(points.__class__) + return self._inspect_model(points) + + elif isinstance(points, dict): + for value in points.values(): + if self.inspect(value): + return True + + elif isinstance(points, Iterable): + for point in points: + if isinstance(point, BaseModel): + self.parser.parse_model(point.__class__) + if self._inspect_model(point): + return True + else: + return False + return False + + def _inspect_model(self, model: BaseModel, paths: Optional[list[FieldPath]] = None) -> bool: + if isinstance(model, get_args(INFERENCE_OBJECT_TYPES)): + return True + + paths = ( + self.parser.path_cache.get(model.__class__.__name__, []) if paths is None else paths + ) + + for path in paths: + type_found = self._inspect_inner_models( + model, path.current, path.tail if path.tail else [] + ) + if type_found: + return True + return False + + def _inspect_inner_models( + self, original_model: BaseModel, current_path: str, tail: list[FieldPath] + ) -> bool: + def inspect_recursive(member: BaseModel) -> bool: + recursive_paths = [] + for field_name in model_fields_set(member): + if field_name in self.parser.name_recursive_ref_mapping: + mapped_model_name = self.parser.name_recursive_ref_mapping[field_name] + recursive_paths.extend(self.parser.path_cache[mapped_model_name]) + + if recursive_paths: + found = self._inspect_model(member, recursive_paths) + if found: + return True + + return False + + model = getattr(original_model, current_path, None) + if model is None: + return False + + if isinstance(model, get_args(INFERENCE_OBJECT_TYPES)): + return True + + if isinstance(model, BaseModel): + type_found = inspect_recursive(model) + if type_found: + return True + + for next_path in tail: + type_found = self._inspect_inner_models( + model, next_path.current, next_path.tail if next_path.tail else [] + ) + if type_found: + return True + return False + + elif isinstance(model, list): + for current_model in model: + if isinstance(current_model, get_args(INFERENCE_OBJECT_TYPES)): + return True + + if not isinstance(current_model, BaseModel): + continue + + type_found = inspect_recursive(current_model) + if type_found: + return True + + for next_path in tail: + for current_model in model: + type_found = self._inspect_inner_models( + current_model, next_path.current, next_path.tail if next_path.tail else [] + ) + if type_found: + return True + return False + + elif isinstance(model, dict): + for key, values in model.items(): + values = [values] if not isinstance(values, list) else values + for current_model in values: + if isinstance(current_model, get_args(INFERENCE_OBJECT_TYPES)): + return True + + if not isinstance(current_model, BaseModel): + continue + + found_type = inspect_recursive(current_model) + if found_type: + return True + + for next_path in tail: + for current_model in values: + found_type = self._inspect_inner_models( + current_model, + next_path.current, + next_path.tail if next_path.tail else [], + ) + if found_type: + return True + return False diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/embed/utils.py b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/embed/utils.py new file mode 100644 index 0000000000000000000000000000000000000000..5cfd331de53d7e53b255057d0175f948b093cb27 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/embed/utils.py @@ -0,0 +1,79 @@ +import base64 +from pathlib import Path +from typing import Optional, Union + +from pydantic import BaseModel, Field + + +class FieldPath(BaseModel): + current: str + tail: Optional[list["FieldPath"]] = Field(default=None) + + def as_str_list(self) -> list[str]: + """ + >>> FieldPath(current='a', tail=[FieldPath(current='b', tail=[FieldPath(current='c'), FieldPath(current='d')])]).as_str_list() + ['a.b.c', 'a.b.d'] + """ + + # Recursive function to collect all paths + def collect_paths(path: FieldPath, prefix: str = "") -> list[str]: + current_path = prefix + path.current + if not path.tail: + return [current_path] + else: + paths = [] + for sub_path in path.tail: + paths.extend(collect_paths(sub_path, current_path + ".")) + return paths + + # Collect all paths starting from this object + return collect_paths(self) + + +def convert_paths(paths: list[str]) -> list[FieldPath]: + """Convert string paths into FieldPath objects + + Paths which share the same root are grouped together. + + Args: + paths: List[str]: List of str paths containing "." as separator + + Returns: + List[FieldPath]: List of FieldPath objects + """ + sorted_paths = sorted(paths) + prev_root = None + converted_paths = [] + for path in sorted_paths: + parts = path.split(".") + root = parts[0] + if root != prev_root: + converted_paths.append(FieldPath(current=root)) + prev_root = root + current = converted_paths[-1] + for part in parts[1:]: + if current.tail is None: + current.tail = [] + found = False + for tail in current.tail: + if tail.current == part: + current = tail + found = True + break + if not found: + new_tail = FieldPath(current=part) + assert current.tail is not None + current.tail.append(new_tail) + current = new_tail + return converted_paths + + +def read_base64(file_path: Union[str, Path]) -> str: + """Convert a file path to a base64 encoded string.""" + path = Path(file_path) + if not path.exists(): + raise FileNotFoundError(f"The file {path} does not exist.") + + with open(path, "rb") as file: + file_content = file.read() + return base64.b64encode(file_content).decode("utf-8") diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/grpc/__init__.py b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/grpc/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..04ef128fcefeabf68ad29d14e1c4b02fe7e37739 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/grpc/__init__.py @@ -0,0 +1,9 @@ +from .points_pb2 import * +from .collections_pb2 import * +from .snapshots_service_pb2 import * +from .json_with_int_pb2 import * +from .collections_service_pb2_grpc import * +from .points_service_pb2_grpc import * +from .snapshots_service_pb2_grpc import * +from .qdrant_pb2 import * +from .qdrant_pb2_grpc import * diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/grpc/__pycache__/__init__.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/grpc/__pycache__/__init__.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..016dd4a3abd9d887767134f683db3e1b16e9a489 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/grpc/__pycache__/__init__.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/grpc/__pycache__/collections_pb2.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/grpc/__pycache__/collections_pb2.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..38757ac0febc2c03141c401e642bfac325f1bc51 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/grpc/__pycache__/collections_pb2.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/grpc/__pycache__/collections_pb2_grpc.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/grpc/__pycache__/collections_pb2_grpc.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c71f65abb1fdc5c3438ca2fc8f03551161eed030 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/grpc/__pycache__/collections_pb2_grpc.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/grpc/__pycache__/collections_service_pb2.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/grpc/__pycache__/collections_service_pb2.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f467ea32a642e783ff3ecb5ab8fa226d0e6adb91 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/grpc/__pycache__/collections_service_pb2.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/grpc/__pycache__/collections_service_pb2_grpc.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/grpc/__pycache__/collections_service_pb2_grpc.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..60889e337b34da43ba53ef9b6887a64ba35679ab Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/grpc/__pycache__/collections_service_pb2_grpc.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/grpc/__pycache__/json_with_int_pb2.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/grpc/__pycache__/json_with_int_pb2.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..4f0af048dfba1ee887cd1a52eb5ef4e5c1a99b13 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/grpc/__pycache__/json_with_int_pb2.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/grpc/__pycache__/json_with_int_pb2_grpc.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/grpc/__pycache__/json_with_int_pb2_grpc.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..63c9b397920622a2a87889b0499fad3a470c0e75 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/grpc/__pycache__/json_with_int_pb2_grpc.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/grpc/__pycache__/points_pb2.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/grpc/__pycache__/points_pb2.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..251448a58f92ac2669970f51a80af3f2477f26cc Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/grpc/__pycache__/points_pb2.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/grpc/__pycache__/points_pb2_grpc.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/grpc/__pycache__/points_pb2_grpc.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..656cafee5d88fe0e391c76980ebd042a18a2fb80 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/grpc/__pycache__/points_pb2_grpc.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/grpc/__pycache__/points_service_pb2.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/grpc/__pycache__/points_service_pb2.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c056ec943e3e4d86c61fcfa6a6d888dadb642163 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/grpc/__pycache__/points_service_pb2.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/grpc/__pycache__/points_service_pb2_grpc.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/grpc/__pycache__/points_service_pb2_grpc.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..3940dfbd86ffe02ff4a2c759051f8184efee2bf9 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/grpc/__pycache__/points_service_pb2_grpc.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/grpc/__pycache__/qdrant_pb2.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/grpc/__pycache__/qdrant_pb2.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2cd1823f2e20d89823416f7364b14c3ade57ffe6 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/grpc/__pycache__/qdrant_pb2.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/grpc/__pycache__/qdrant_pb2_grpc.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/grpc/__pycache__/qdrant_pb2_grpc.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d7b5fca2eb19d463eb8bc1bc3753ec2b301d417a Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/grpc/__pycache__/qdrant_pb2_grpc.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/grpc/__pycache__/snapshots_service_pb2.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/grpc/__pycache__/snapshots_service_pb2.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..0e8c7560bf226b8099db0435cef04716923c8013 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/grpc/__pycache__/snapshots_service_pb2.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/grpc/__pycache__/snapshots_service_pb2_grpc.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/grpc/__pycache__/snapshots_service_pb2_grpc.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d29e8765151a20e2dfc9b94cd2e0829235a27f03 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/grpc/__pycache__/snapshots_service_pb2_grpc.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/grpc/collections_pb2.py b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/grpc/collections_pb2.py new file mode 100644 index 0000000000000000000000000000000000000000..c01e1b8ab114f0e80f7ca2fea755568799654e11 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/grpc/collections_pb2.py @@ -0,0 +1,1074 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: collections.proto +"""Generated protocol buffer code.""" +from google.protobuf.internal import enum_type_wrapper +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import message as _message +from google.protobuf import reflection as _reflection +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x11\x63ollections.proto\x12\x06qdrant\"\x83\x03\n\x0cVectorParams\x12\x0c\n\x04size\x18\x01 \x01(\x04\x12\"\n\x08\x64istance\x18\x02 \x01(\x0e\x32\x10.qdrant.Distance\x12\x30\n\x0bhnsw_config\x18\x03 \x01(\x0b\x32\x16.qdrant.HnswConfigDiffH\x00\x88\x01\x01\x12<\n\x13quantization_config\x18\x04 \x01(\x0b\x32\x1a.qdrant.QuantizationConfigH\x01\x88\x01\x01\x12\x14\n\x07on_disk\x18\x05 \x01(\x08H\x02\x88\x01\x01\x12\'\n\x08\x64\x61tatype\x18\x06 \x01(\x0e\x32\x10.qdrant.DatatypeH\x03\x88\x01\x01\x12:\n\x12multivector_config\x18\x07 \x01(\x0b\x32\x19.qdrant.MultiVectorConfigH\x04\x88\x01\x01\x42\x0e\n\x0c_hnsw_configB\x16\n\x14_quantization_configB\n\n\x08_on_diskB\x0b\n\t_datatypeB\x15\n\x13_multivector_config\"\xd0\x01\n\x10VectorParamsDiff\x12\x30\n\x0bhnsw_config\x18\x01 \x01(\x0b\x32\x16.qdrant.HnswConfigDiffH\x00\x88\x01\x01\x12@\n\x13quantization_config\x18\x02 \x01(\x0b\x32\x1e.qdrant.QuantizationConfigDiffH\x01\x88\x01\x01\x12\x14\n\x07on_disk\x18\x03 \x01(\x08H\x02\x88\x01\x01\x42\x0e\n\x0c_hnsw_configB\x16\n\x14_quantization_configB\n\n\x08_on_disk\"\x82\x01\n\x0fVectorParamsMap\x12-\n\x03map\x18\x01 \x03(\x0b\x32 .qdrant.VectorParamsMap.MapEntry\x1a@\n\x08MapEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12#\n\x05value\x18\x02 \x01(\x0b\x32\x14.qdrant.VectorParams:\x02\x38\x01\"\x8e\x01\n\x13VectorParamsDiffMap\x12\x31\n\x03map\x18\x01 \x03(\x0b\x32$.qdrant.VectorParamsDiffMap.MapEntry\x1a\x44\n\x08MapEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\'\n\x05value\x18\x02 \x01(\x0b\x32\x18.qdrant.VectorParamsDiff:\x02\x38\x01\"p\n\rVectorsConfig\x12&\n\x06params\x18\x01 \x01(\x0b\x32\x14.qdrant.VectorParamsH\x00\x12-\n\nparams_map\x18\x02 \x01(\x0b\x32\x17.qdrant.VectorParamsMapH\x00\x42\x08\n\x06\x63onfig\"|\n\x11VectorsConfigDiff\x12*\n\x06params\x18\x01 \x01(\x0b\x32\x18.qdrant.VectorParamsDiffH\x00\x12\x31\n\nparams_map\x18\x02 \x01(\x0b\x32\x1b.qdrant.VectorParamsDiffMapH\x00\x42\x08\n\x06\x63onfig\"\x83\x01\n\x12SparseVectorParams\x12-\n\x05index\x18\x01 \x01(\x0b\x32\x19.qdrant.SparseIndexConfigH\x00\x88\x01\x01\x12\'\n\x08modifier\x18\x02 \x01(\x0e\x32\x10.qdrant.ModifierH\x01\x88\x01\x01\x42\x08\n\x06_indexB\x0b\n\t_modifier\"\x8e\x01\n\x12SparseVectorConfig\x12\x30\n\x03map\x18\x01 \x03(\x0b\x32#.qdrant.SparseVectorConfig.MapEntry\x1a\x46\n\x08MapEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12)\n\x05value\x18\x02 \x01(\x0b\x32\x1a.qdrant.SparseVectorParams:\x02\x38\x01\"F\n\x11MultiVectorConfig\x12\x31\n\ncomparator\x18\x01 \x01(\x0e\x32\x1d.qdrant.MultiVectorComparator\"3\n\x18GetCollectionInfoRequest\x12\x17\n\x0f\x63ollection_name\x18\x01 \x01(\t\"2\n\x17\x43ollectionExistsRequest\x12\x17\n\x0f\x63ollection_name\x18\x01 \x01(\t\"\"\n\x10\x43ollectionExists\x12\x0e\n\x06\x65xists\x18\x01 \x01(\x08\"R\n\x18\x43ollectionExistsResponse\x12(\n\x06result\x18\x01 \x01(\x0b\x32\x18.qdrant.CollectionExists\x12\x0c\n\x04time\x18\x02 \x01(\x01\"\x18\n\x16ListCollectionsRequest\"%\n\x15\x43ollectionDescription\x12\x0c\n\x04name\x18\x01 \x01(\t\"Q\n\x19GetCollectionInfoResponse\x12&\n\x06result\x18\x01 \x01(\x0b\x32\x16.qdrant.CollectionInfo\x12\x0c\n\x04time\x18\x02 \x01(\x01\"[\n\x17ListCollectionsResponse\x12\x32\n\x0b\x63ollections\x18\x01 \x03(\x0b\x32\x1d.qdrant.CollectionDescription\x12\x0c\n\x04time\x18\x02 \x01(\x01\"\x84\x01\n\x16MaxOptimizationThreads\x12\x0f\n\x05value\x18\x01 \x01(\x04H\x00\x12\x39\n\x07setting\x18\x02 \x01(\x0e\x32&.qdrant.MaxOptimizationThreads.SettingH\x00\"\x13\n\x07Setting\x12\x08\n\x04\x41uto\x10\x00\x42\t\n\x07variant\",\n\x0fOptimizerStatus\x12\n\n\x02ok\x18\x01 \x01(\x08\x12\r\n\x05\x65rror\x18\x02 \x01(\t\"\x90\x02\n\x0eHnswConfigDiff\x12\x0e\n\x01m\x18\x01 \x01(\x04H\x00\x88\x01\x01\x12\x19\n\x0c\x65\x66_construct\x18\x02 \x01(\x04H\x01\x88\x01\x01\x12 \n\x13\x66ull_scan_threshold\x18\x03 \x01(\x04H\x02\x88\x01\x01\x12!\n\x14max_indexing_threads\x18\x04 \x01(\x04H\x03\x88\x01\x01\x12\x14\n\x07on_disk\x18\x05 \x01(\x08H\x04\x88\x01\x01\x12\x16\n\tpayload_m\x18\x06 \x01(\x04H\x05\x88\x01\x01\x42\x04\n\x02_mB\x0f\n\r_ef_constructB\x16\n\x14_full_scan_thresholdB\x17\n\x15_max_indexing_threadsB\n\n\x08_on_diskB\x0c\n\n_payload_m\"\xa5\x01\n\x11SparseIndexConfig\x12 \n\x13\x66ull_scan_threshold\x18\x01 \x01(\x04H\x00\x88\x01\x01\x12\x14\n\x07on_disk\x18\x02 \x01(\x08H\x01\x88\x01\x01\x12\'\n\x08\x64\x61tatype\x18\x03 \x01(\x0e\x32\x10.qdrant.DatatypeH\x02\x88\x01\x01\x42\x16\n\x14_full_scan_thresholdB\n\n\x08_on_diskB\x0b\n\t_datatype\"y\n\rWalConfigDiff\x12\x1c\n\x0fwal_capacity_mb\x18\x01 \x01(\x04H\x00\x88\x01\x01\x12\x1f\n\x12wal_segments_ahead\x18\x02 \x01(\x04H\x01\x88\x01\x01\x42\x12\n\x10_wal_capacity_mbB\x15\n\x13_wal_segments_ahead\"\xe6\x04\n\x14OptimizersConfigDiff\x12\x1e\n\x11\x64\x65leted_threshold\x18\x01 \x01(\x01H\x00\x88\x01\x01\x12%\n\x18vacuum_min_vector_number\x18\x02 \x01(\x04H\x01\x88\x01\x01\x12#\n\x16\x64\x65\x66\x61ult_segment_number\x18\x03 \x01(\x04H\x02\x88\x01\x01\x12\x1d\n\x10max_segment_size\x18\x04 \x01(\x04H\x03\x88\x01\x01\x12\x1d\n\x10memmap_threshold\x18\x05 \x01(\x04H\x04\x88\x01\x01\x12\x1f\n\x12indexing_threshold\x18\x06 \x01(\x04H\x05\x88\x01\x01\x12\x1f\n\x12\x66lush_interval_sec\x18\x07 \x01(\x04H\x06\x88\x01\x01\x12\x30\n#deprecated_max_optimization_threads\x18\x08 \x01(\x04H\x07\x88\x01\x01\x12\x45\n\x18max_optimization_threads\x18\t \x01(\x0b\x32\x1e.qdrant.MaxOptimizationThreadsH\x08\x88\x01\x01\x42\x14\n\x12_deleted_thresholdB\x1b\n\x19_vacuum_min_vector_numberB\x19\n\x17_default_segment_numberB\x13\n\x11_max_segment_sizeB\x13\n\x11_memmap_thresholdB\x15\n\x13_indexing_thresholdB\x15\n\x13_flush_interval_secB&\n$_deprecated_max_optimization_threadsB\x1b\n\x19_max_optimization_threads\"\x88\x01\n\x12ScalarQuantization\x12&\n\x04type\x18\x01 \x01(\x0e\x32\x18.qdrant.QuantizationType\x12\x15\n\x08quantile\x18\x02 \x01(\x02H\x00\x88\x01\x01\x12\x17\n\nalways_ram\x18\x03 \x01(\x08H\x01\x88\x01\x01\x42\x0b\n\t_quantileB\r\n\x0b_always_ram\"l\n\x13ProductQuantization\x12-\n\x0b\x63ompression\x18\x01 \x01(\x0e\x32\x18.qdrant.CompressionRatio\x12\x17\n\nalways_ram\x18\x02 \x01(\x08H\x00\x88\x01\x01\x42\r\n\x0b_always_ram\"\xb6\x01\n\x1f\x42inaryQuantizationQueryEncoding\x12\x42\n\x07setting\x18\x04 \x01(\x0e\x32/.qdrant.BinaryQuantizationQueryEncoding.SettingH\x00\"D\n\x07Setting\x12\x0b\n\x07\x44\x65\x66\x61ult\x10\x00\x12\n\n\x06\x42inary\x10\x01\x12\x0f\n\x0bScalar4Bits\x10\x02\x12\x0f\n\x0bScalar8Bits\x10\x03\x42\t\n\x07variant\"\xdd\x01\n\x12\x42inaryQuantization\x12\x17\n\nalways_ram\x18\x01 \x01(\x08H\x00\x88\x01\x01\x12\x39\n\x08\x65ncoding\x18\x02 \x01(\x0e\x32\".qdrant.BinaryQuantizationEncodingH\x01\x88\x01\x01\x12\x44\n\x0equery_encoding\x18\x03 \x01(\x0b\x32\'.qdrant.BinaryQuantizationQueryEncodingH\x02\x88\x01\x01\x42\r\n\x0b_always_ramB\x0b\n\t_encodingB\x11\n\x0f_query_encoding\"\xb0\x01\n\x12QuantizationConfig\x12,\n\x06scalar\x18\x01 \x01(\x0b\x32\x1a.qdrant.ScalarQuantizationH\x00\x12.\n\x07product\x18\x02 \x01(\x0b\x32\x1b.qdrant.ProductQuantizationH\x00\x12,\n\x06\x62inary\x18\x03 \x01(\x0b\x32\x1a.qdrant.BinaryQuantizationH\x00\x42\x0e\n\x0cquantization\"\n\n\x08\x44isabled\"\xda\x01\n\x16QuantizationConfigDiff\x12,\n\x06scalar\x18\x01 \x01(\x0b\x32\x1a.qdrant.ScalarQuantizationH\x00\x12.\n\x07product\x18\x02 \x01(\x0b\x32\x1b.qdrant.ProductQuantizationH\x00\x12$\n\x08\x64isabled\x18\x03 \x01(\x0b\x32\x10.qdrant.DisabledH\x00\x12,\n\x06\x62inary\x18\x04 \x01(\x0b\x32\x1a.qdrant.BinaryQuantizationH\x00\x42\x0e\n\x0cquantization\"\xf7\x08\n\x10StrictModeConfig\x12\x14\n\x07\x65nabled\x18\x01 \x01(\x08H\x00\x88\x01\x01\x12\x1c\n\x0fmax_query_limit\x18\x02 \x01(\rH\x01\x88\x01\x01\x12\x18\n\x0bmax_timeout\x18\x03 \x01(\rH\x02\x88\x01\x01\x12)\n\x1cunindexed_filtering_retrieve\x18\x04 \x01(\x08H\x03\x88\x01\x01\x12\'\n\x1aunindexed_filtering_update\x18\x05 \x01(\x08H\x04\x88\x01\x01\x12\x1f\n\x12search_max_hnsw_ef\x18\x06 \x01(\rH\x05\x88\x01\x01\x12\x1f\n\x12search_allow_exact\x18\x07 \x01(\x08H\x06\x88\x01\x01\x12$\n\x17search_max_oversampling\x18\x08 \x01(\x02H\x07\x88\x01\x01\x12!\n\x14upsert_max_batchsize\x18\t \x01(\x04H\x08\x88\x01\x01\x12-\n max_collection_vector_size_bytes\x18\n \x01(\x04H\t\x88\x01\x01\x12\x1c\n\x0fread_rate_limit\x18\x0b \x01(\rH\n\x88\x01\x01\x12\x1d\n\x10write_rate_limit\x18\x0c \x01(\rH\x0b\x88\x01\x01\x12.\n!max_collection_payload_size_bytes\x18\r \x01(\x04H\x0c\x88\x01\x01\x12\"\n\x15\x66ilter_max_conditions\x18\x0e \x01(\x04H\r\x88\x01\x01\x12\x1f\n\x12\x63ondition_max_size\x18\x0f \x01(\x04H\x0e\x88\x01\x01\x12\x44\n\x12multivector_config\x18\x10 \x01(\x0b\x32#.qdrant.StrictModeMultivectorConfigH\x0f\x88\x01\x01\x12:\n\rsparse_config\x18\x11 \x01(\x0b\x32\x1e.qdrant.StrictModeSparseConfigH\x10\x88\x01\x01\x12\x1d\n\x10max_points_count\x18\x12 \x01(\x04H\x11\x88\x01\x01\x42\n\n\x08_enabledB\x12\n\x10_max_query_limitB\x0e\n\x0c_max_timeoutB\x1f\n\x1d_unindexed_filtering_retrieveB\x1d\n\x1b_unindexed_filtering_updateB\x15\n\x13_search_max_hnsw_efB\x15\n\x13_search_allow_exactB\x1a\n\x18_search_max_oversamplingB\x17\n\x15_upsert_max_batchsizeB#\n!_max_collection_vector_size_bytesB\x12\n\x10_read_rate_limitB\x13\n\x11_write_rate_limitB$\n\"_max_collection_payload_size_bytesB\x18\n\x16_filter_max_conditionsB\x15\n\x13_condition_max_sizeB\x15\n\x13_multivector_configB\x10\n\x0e_sparse_configB\x13\n\x11_max_points_count\"\xb0\x01\n\x16StrictModeSparseConfig\x12G\n\rsparse_config\x18\x01 \x03(\x0b\x32\x30.qdrant.StrictModeSparseConfig.SparseConfigEntry\x1aM\n\x11SparseConfigEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\'\n\x05value\x18\x02 \x01(\x0b\x32\x18.qdrant.StrictModeSparse:\x02\x38\x01\":\n\x10StrictModeSparse\x12\x17\n\nmax_length\x18\n \x01(\x04H\x00\x88\x01\x01\x42\r\n\x0b_max_length\"\xce\x01\n\x1bStrictModeMultivectorConfig\x12V\n\x12multivector_config\x18\x01 \x03(\x0b\x32:.qdrant.StrictModeMultivectorConfig.MultivectorConfigEntry\x1aW\n\x16MultivectorConfigEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12,\n\x05value\x18\x02 \x01(\x0b\x32\x1d.qdrant.StrictModeMultivector:\x02\x38\x01\"A\n\x15StrictModeMultivector\x12\x18\n\x0bmax_vectors\x18\x01 \x01(\x04H\x00\x88\x01\x01\x42\x0e\n\x0c_max_vectors\"\xd7\x07\n\x10\x43reateCollection\x12\x17\n\x0f\x63ollection_name\x18\x01 \x01(\t\x12\x30\n\x0bhnsw_config\x18\x04 \x01(\x0b\x32\x16.qdrant.HnswConfigDiffH\x00\x88\x01\x01\x12.\n\nwal_config\x18\x05 \x01(\x0b\x32\x15.qdrant.WalConfigDiffH\x01\x88\x01\x01\x12<\n\x11optimizers_config\x18\x06 \x01(\x0b\x32\x1c.qdrant.OptimizersConfigDiffH\x02\x88\x01\x01\x12\x19\n\x0cshard_number\x18\x07 \x01(\rH\x03\x88\x01\x01\x12\x1c\n\x0fon_disk_payload\x18\x08 \x01(\x08H\x04\x88\x01\x01\x12\x14\n\x07timeout\x18\t \x01(\x04H\x05\x88\x01\x01\x12\x32\n\x0evectors_config\x18\n \x01(\x0b\x32\x15.qdrant.VectorsConfigH\x06\x88\x01\x01\x12\x1f\n\x12replication_factor\x18\x0b \x01(\rH\x07\x88\x01\x01\x12%\n\x18write_consistency_factor\x18\x0c \x01(\rH\x08\x88\x01\x01\x12!\n\x14init_from_collection\x18\r \x01(\tH\t\x88\x01\x01\x12<\n\x13quantization_config\x18\x0e \x01(\x0b\x32\x1a.qdrant.QuantizationConfigH\n\x88\x01\x01\x12\x34\n\x0fsharding_method\x18\x0f \x01(\x0e\x32\x16.qdrant.ShardingMethodH\x0b\x88\x01\x01\x12>\n\x15sparse_vectors_config\x18\x10 \x01(\x0b\x32\x1a.qdrant.SparseVectorConfigH\x0c\x88\x01\x01\x12\x39\n\x12strict_mode_config\x18\x11 \x01(\x0b\x32\x18.qdrant.StrictModeConfigH\r\x88\x01\x01\x42\x0e\n\x0c_hnsw_configB\r\n\x0b_wal_configB\x14\n\x12_optimizers_configB\x0f\n\r_shard_numberB\x12\n\x10_on_disk_payloadB\n\n\x08_timeoutB\x11\n\x0f_vectors_configB\x15\n\x13_replication_factorB\x1b\n\x19_write_consistency_factorB\x17\n\x15_init_from_collectionB\x16\n\x14_quantization_configB\x12\n\x10_sharding_methodB\x18\n\x16_sparse_vectors_configB\x15\n\x13_strict_mode_configJ\x04\x08\x02\x10\x03J\x04\x08\x03\x10\x04\"\xf2\x04\n\x10UpdateCollection\x12\x17\n\x0f\x63ollection_name\x18\x01 \x01(\t\x12<\n\x11optimizers_config\x18\x02 \x01(\x0b\x32\x1c.qdrant.OptimizersConfigDiffH\x00\x88\x01\x01\x12\x14\n\x07timeout\x18\x03 \x01(\x04H\x01\x88\x01\x01\x12\x31\n\x06params\x18\x04 \x01(\x0b\x32\x1c.qdrant.CollectionParamsDiffH\x02\x88\x01\x01\x12\x30\n\x0bhnsw_config\x18\x05 \x01(\x0b\x32\x16.qdrant.HnswConfigDiffH\x03\x88\x01\x01\x12\x36\n\x0evectors_config\x18\x06 \x01(\x0b\x32\x19.qdrant.VectorsConfigDiffH\x04\x88\x01\x01\x12@\n\x13quantization_config\x18\x07 \x01(\x0b\x32\x1e.qdrant.QuantizationConfigDiffH\x05\x88\x01\x01\x12>\n\x15sparse_vectors_config\x18\x08 \x01(\x0b\x32\x1a.qdrant.SparseVectorConfigH\x06\x88\x01\x01\x12\x39\n\x12strict_mode_config\x18\t \x01(\x0b\x32\x18.qdrant.StrictModeConfigH\x07\x88\x01\x01\x42\x14\n\x12_optimizers_configB\n\n\x08_timeoutB\t\n\x07_paramsB\x0e\n\x0c_hnsw_configB\x11\n\x0f_vectors_configB\x16\n\x14_quantization_configB\x18\n\x16_sparse_vectors_configB\x15\n\x13_strict_mode_config\"M\n\x10\x44\x65leteCollection\x12\x17\n\x0f\x63ollection_name\x18\x01 \x01(\t\x12\x14\n\x07timeout\x18\x02 \x01(\x04H\x00\x88\x01\x01\x42\n\n\x08_timeout\";\n\x1b\x43ollectionOperationResponse\x12\x0e\n\x06result\x18\x01 \x01(\x08\x12\x0c\n\x04time\x18\x02 \x01(\x01\"\xee\x03\n\x10\x43ollectionParams\x12\x14\n\x0cshard_number\x18\x03 \x01(\r\x12\x17\n\x0fon_disk_payload\x18\x04 \x01(\x08\x12\x32\n\x0evectors_config\x18\x05 \x01(\x0b\x32\x15.qdrant.VectorsConfigH\x00\x88\x01\x01\x12\x1f\n\x12replication_factor\x18\x06 \x01(\rH\x01\x88\x01\x01\x12%\n\x18write_consistency_factor\x18\x07 \x01(\rH\x02\x88\x01\x01\x12 \n\x13read_fan_out_factor\x18\x08 \x01(\rH\x03\x88\x01\x01\x12\x34\n\x0fsharding_method\x18\t \x01(\x0e\x32\x16.qdrant.ShardingMethodH\x04\x88\x01\x01\x12>\n\x15sparse_vectors_config\x18\n \x01(\x0b\x32\x1a.qdrant.SparseVectorConfigH\x05\x88\x01\x01\x42\x11\n\x0f_vectors_configB\x15\n\x13_replication_factorB\x1b\n\x19_write_consistency_factorB\x16\n\x14_read_fan_out_factorB\x12\n\x10_sharding_methodB\x18\n\x16_sparse_vectors_configJ\x04\x08\x01\x10\x02J\x04\x08\x02\x10\x03\"\xfe\x01\n\x14\x43ollectionParamsDiff\x12\x1f\n\x12replication_factor\x18\x01 \x01(\rH\x00\x88\x01\x01\x12%\n\x18write_consistency_factor\x18\x02 \x01(\rH\x01\x88\x01\x01\x12\x1c\n\x0fon_disk_payload\x18\x03 \x01(\x08H\x02\x88\x01\x01\x12 \n\x13read_fan_out_factor\x18\x04 \x01(\rH\x03\x88\x01\x01\x42\x15\n\x13_replication_factorB\x1b\n\x19_write_consistency_factorB\x12\n\x10_on_disk_payloadB\x16\n\x14_read_fan_out_factor\"\xf4\x02\n\x10\x43ollectionConfig\x12(\n\x06params\x18\x01 \x01(\x0b\x32\x18.qdrant.CollectionParams\x12+\n\x0bhnsw_config\x18\x02 \x01(\x0b\x32\x16.qdrant.HnswConfigDiff\x12\x36\n\x10optimizer_config\x18\x03 \x01(\x0b\x32\x1c.qdrant.OptimizersConfigDiff\x12)\n\nwal_config\x18\x04 \x01(\x0b\x32\x15.qdrant.WalConfigDiff\x12<\n\x13quantization_config\x18\x05 \x01(\x0b\x32\x1a.qdrant.QuantizationConfigH\x00\x88\x01\x01\x12\x39\n\x12strict_mode_config\x18\x06 \x01(\x0b\x32\x18.qdrant.StrictModeConfigH\x01\x88\x01\x01\x42\x16\n\x14_quantization_configB\x15\n\x13_strict_mode_config\"\\\n\x12KeywordIndexParams\x12\x16\n\tis_tenant\x18\x01 \x01(\x08H\x00\x88\x01\x01\x12\x14\n\x07on_disk\x18\x02 \x01(\x08H\x01\x88\x01\x01\x42\x0c\n\n_is_tenantB\n\n\x08_on_disk\"\xa0\x01\n\x12IntegerIndexParams\x12\x13\n\x06lookup\x18\x01 \x01(\x08H\x00\x88\x01\x01\x12\x12\n\x05range\x18\x02 \x01(\x08H\x01\x88\x01\x01\x12\x19\n\x0cis_principal\x18\x03 \x01(\x08H\x02\x88\x01\x01\x12\x14\n\x07on_disk\x18\x04 \x01(\x08H\x03\x88\x01\x01\x42\t\n\x07_lookupB\x08\n\x06_rangeB\x0f\n\r_is_principalB\n\n\x08_on_disk\"`\n\x10\x46loatIndexParams\x12\x14\n\x07on_disk\x18\x01 \x01(\x08H\x00\x88\x01\x01\x12\x19\n\x0cis_principal\x18\x02 \x01(\x08H\x01\x88\x01\x01\x42\n\n\x08_on_diskB\x0f\n\r_is_principal\"2\n\x0eGeoIndexParams\x12\x14\n\x07on_disk\x18\x01 \x01(\x08H\x00\x88\x01\x01\x42\n\n\x08_on_disk\"1\n\x0cStopwordsSet\x12\x11\n\tlanguages\x18\x01 \x03(\t\x12\x0e\n\x06\x63ustom\x18\x02 \x03(\t\"\x8a\x03\n\x0fTextIndexParams\x12(\n\ttokenizer\x18\x01 \x01(\x0e\x32\x15.qdrant.TokenizerType\x12\x16\n\tlowercase\x18\x02 \x01(\x08H\x00\x88\x01\x01\x12\x1a\n\rmin_token_len\x18\x03 \x01(\x04H\x01\x88\x01\x01\x12\x1a\n\rmax_token_len\x18\x04 \x01(\x04H\x02\x88\x01\x01\x12\x14\n\x07on_disk\x18\x05 \x01(\x08H\x03\x88\x01\x01\x12,\n\tstopwords\x18\x06 \x01(\x0b\x32\x14.qdrant.StopwordsSetH\x04\x88\x01\x01\x12\x1c\n\x0fphrase_matching\x18\x07 \x01(\x08H\x05\x88\x01\x01\x12/\n\x07stemmer\x18\x08 \x01(\x0b\x32\x19.qdrant.StemmingAlgorithmH\x06\x88\x01\x01\x42\x0c\n\n_lowercaseB\x10\n\x0e_min_token_lenB\x10\n\x0e_max_token_lenB\n\n\x08_on_diskB\x0c\n\n_stopwordsB\x12\n\x10_phrase_matchingB\n\n\x08_stemmer\"R\n\x11StemmingAlgorithm\x12*\n\x08snowball\x18\x01 \x01(\x0b\x32\x16.qdrant.SnowballParamsH\x00\x42\x11\n\x0fstemming_params\"\"\n\x0eSnowballParams\x12\x10\n\x08language\x18\x01 \x01(\t\"3\n\x0f\x42oolIndexParams\x12\x14\n\x07on_disk\x18\x01 \x01(\x08H\x00\x88\x01\x01\x42\n\n\x08_on_disk\"c\n\x13\x44\x61tetimeIndexParams\x12\x14\n\x07on_disk\x18\x01 \x01(\x08H\x00\x88\x01\x01\x12\x19\n\x0cis_principal\x18\x02 \x01(\x08H\x01\x88\x01\x01\x42\n\n\x08_on_diskB\x0f\n\r_is_principal\"Y\n\x0fUuidIndexParams\x12\x16\n\tis_tenant\x18\x01 \x01(\x08H\x00\x88\x01\x01\x12\x14\n\x07on_disk\x18\x02 \x01(\x08H\x01\x88\x01\x01\x42\x0c\n\n_is_tenantB\n\n\x08_on_disk\"\xe8\x03\n\x12PayloadIndexParams\x12:\n\x14keyword_index_params\x18\x03 \x01(\x0b\x32\x1a.qdrant.KeywordIndexParamsH\x00\x12:\n\x14integer_index_params\x18\x02 \x01(\x0b\x32\x1a.qdrant.IntegerIndexParamsH\x00\x12\x36\n\x12\x66loat_index_params\x18\x04 \x01(\x0b\x32\x18.qdrant.FloatIndexParamsH\x00\x12\x32\n\x10geo_index_params\x18\x05 \x01(\x0b\x32\x16.qdrant.GeoIndexParamsH\x00\x12\x34\n\x11text_index_params\x18\x01 \x01(\x0b\x32\x17.qdrant.TextIndexParamsH\x00\x12\x34\n\x11\x62ool_index_params\x18\x06 \x01(\x0b\x32\x17.qdrant.BoolIndexParamsH\x00\x12<\n\x15\x64\x61tetime_index_params\x18\x07 \x01(\x0b\x32\x1b.qdrant.DatetimeIndexParamsH\x00\x12\x34\n\x11uuid_index_params\x18\x08 \x01(\x0b\x32\x17.qdrant.UuidIndexParamsH\x00\x42\x0e\n\x0cindex_params\"\x9d\x01\n\x11PayloadSchemaInfo\x12,\n\tdata_type\x18\x01 \x01(\x0e\x32\x19.qdrant.PayloadSchemaType\x12/\n\x06params\x18\x02 \x01(\x0b\x32\x1a.qdrant.PayloadIndexParamsH\x00\x88\x01\x01\x12\x13\n\x06points\x18\x03 \x01(\x04H\x01\x88\x01\x01\x42\t\n\x07_paramsB\t\n\x07_points\"\xe7\x03\n\x0e\x43ollectionInfo\x12(\n\x06status\x18\x01 \x01(\x0e\x32\x18.qdrant.CollectionStatus\x12\x31\n\x10optimizer_status\x18\x02 \x01(\x0b\x32\x17.qdrant.OptimizerStatus\x12\x1a\n\rvectors_count\x18\x03 \x01(\x04H\x00\x88\x01\x01\x12\x16\n\x0esegments_count\x18\x04 \x01(\x04\x12(\n\x06\x63onfig\x18\x07 \x01(\x0b\x32\x18.qdrant.CollectionConfig\x12\x41\n\x0epayload_schema\x18\x08 \x03(\x0b\x32).qdrant.CollectionInfo.PayloadSchemaEntry\x12\x19\n\x0cpoints_count\x18\t \x01(\x04H\x01\x88\x01\x01\x12\"\n\x15indexed_vectors_count\x18\n \x01(\x04H\x02\x88\x01\x01\x1aO\n\x12PayloadSchemaEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12(\n\x05value\x18\x02 \x01(\x0b\x32\x19.qdrant.PayloadSchemaInfo:\x02\x38\x01\x42\x10\n\x0e_vectors_countB\x0f\n\r_points_countB\x18\n\x16_indexed_vectors_countJ\x04\x08\x05\x10\x06J\x04\x08\x06\x10\x07\"[\n\rChangeAliases\x12(\n\x07\x61\x63tions\x18\x01 \x03(\x0b\x32\x17.qdrant.AliasOperations\x12\x14\n\x07timeout\x18\x02 \x01(\x04H\x00\x88\x01\x01\x42\n\n\x08_timeout\"\xa2\x01\n\x0f\x41liasOperations\x12+\n\x0c\x63reate_alias\x18\x01 \x01(\x0b\x32\x13.qdrant.CreateAliasH\x00\x12+\n\x0crename_alias\x18\x02 \x01(\x0b\x32\x13.qdrant.RenameAliasH\x00\x12+\n\x0c\x64\x65lete_alias\x18\x03 \x01(\x0b\x32\x13.qdrant.DeleteAliasH\x00\x42\x08\n\x06\x61\x63tion\":\n\x0b\x43reateAlias\x12\x17\n\x0f\x63ollection_name\x18\x01 \x01(\t\x12\x12\n\nalias_name\x18\x02 \x01(\t\"=\n\x0bRenameAlias\x12\x16\n\x0eold_alias_name\x18\x01 \x01(\t\x12\x16\n\x0enew_alias_name\x18\x02 \x01(\t\"!\n\x0b\x44\x65leteAlias\x12\x12\n\nalias_name\x18\x01 \x01(\t\"\x14\n\x12ListAliasesRequest\"7\n\x1cListCollectionAliasesRequest\x12\x17\n\x0f\x63ollection_name\x18\x01 \x01(\t\"?\n\x10\x41liasDescription\x12\x12\n\nalias_name\x18\x01 \x01(\t\x12\x17\n\x0f\x63ollection_name\x18\x02 \x01(\t\"N\n\x13ListAliasesResponse\x12)\n\x07\x61liases\x18\x01 \x03(\x0b\x32\x18.qdrant.AliasDescription\x12\x0c\n\x04time\x18\x02 \x01(\x01\"7\n\x1c\x43ollectionClusterInfoRequest\x12\x17\n\x0f\x63ollection_name\x18\x01 \x01(\t\"6\n\x08ShardKey\x12\x11\n\x07keyword\x18\x01 \x01(\tH\x00\x12\x10\n\x06number\x18\x02 \x01(\x04H\x00\x42\x05\n\x03key\"\x95\x01\n\x0eLocalShardInfo\x12\x10\n\x08shard_id\x18\x01 \x01(\r\x12\x14\n\x0cpoints_count\x18\x02 \x01(\x04\x12#\n\x05state\x18\x03 \x01(\x0e\x32\x14.qdrant.ReplicaState\x12(\n\tshard_key\x18\x04 \x01(\x0b\x32\x10.qdrant.ShardKeyH\x00\x88\x01\x01\x42\x0c\n\n_shard_key\"\x91\x01\n\x0fRemoteShardInfo\x12\x10\n\x08shard_id\x18\x01 \x01(\r\x12\x0f\n\x07peer_id\x18\x02 \x01(\x04\x12#\n\x05state\x18\x03 \x01(\x0e\x32\x14.qdrant.ReplicaState\x12(\n\tshard_key\x18\x04 \x01(\x0b\x32\x10.qdrant.ShardKeyH\x00\x88\x01\x01\x42\x0c\n\n_shard_key\"w\n\x11ShardTransferInfo\x12\x10\n\x08shard_id\x18\x01 \x01(\r\x12\x18\n\x0bto_shard_id\x18\x05 \x01(\rH\x00\x88\x01\x01\x12\x0c\n\x04\x66rom\x18\x02 \x01(\x04\x12\n\n\x02to\x18\x03 \x01(\x04\x12\x0c\n\x04sync\x18\x04 \x01(\x08\x42\x0e\n\x0c_to_shard_id\"\x9b\x01\n\x0eReshardingInfo\x12\x10\n\x08shard_id\x18\x01 \x01(\r\x12\x0f\n\x07peer_id\x18\x02 \x01(\x04\x12(\n\tshard_key\x18\x03 \x01(\x0b\x32\x10.qdrant.ShardKeyH\x00\x88\x01\x01\x12.\n\tdirection\x18\x04 \x01(\x0e\x32\x1b.qdrant.ReshardingDirectionB\x0c\n\n_shard_key\"\x8e\x02\n\x1d\x43ollectionClusterInfoResponse\x12\x0f\n\x07peer_id\x18\x01 \x01(\x04\x12\x13\n\x0bshard_count\x18\x02 \x01(\x04\x12,\n\x0clocal_shards\x18\x03 \x03(\x0b\x32\x16.qdrant.LocalShardInfo\x12.\n\rremote_shards\x18\x04 \x03(\x0b\x32\x17.qdrant.RemoteShardInfo\x12\x32\n\x0fshard_transfers\x18\x05 \x03(\x0b\x32\x19.qdrant.ShardTransferInfo\x12\x35\n\x15resharding_operations\x18\x06 \x03(\x0b\x32\x16.qdrant.ReshardingInfo\"\xae\x01\n\tMoveShard\x12\x10\n\x08shard_id\x18\x01 \x01(\r\x12\x18\n\x0bto_shard_id\x18\x05 \x01(\rH\x00\x88\x01\x01\x12\x14\n\x0c\x66rom_peer_id\x18\x02 \x01(\x04\x12\x12\n\nto_peer_id\x18\x03 \x01(\x04\x12\x30\n\x06method\x18\x04 \x01(\x0e\x32\x1b.qdrant.ShardTransferMethodH\x01\x88\x01\x01\x42\x0e\n\x0c_to_shard_idB\t\n\x07_method\"\xb3\x01\n\x0eReplicateShard\x12\x10\n\x08shard_id\x18\x01 \x01(\r\x12\x18\n\x0bto_shard_id\x18\x05 \x01(\rH\x00\x88\x01\x01\x12\x14\n\x0c\x66rom_peer_id\x18\x02 \x01(\x04\x12\x12\n\nto_peer_id\x18\x03 \x01(\x04\x12\x30\n\x06method\x18\x04 \x01(\x0e\x32\x1b.qdrant.ShardTransferMethodH\x01\x88\x01\x01\x42\x0e\n\x0c_to_shard_idB\t\n\x07_method\"z\n\x12\x41\x62ortShardTransfer\x12\x10\n\x08shard_id\x18\x01 \x01(\r\x12\x18\n\x0bto_shard_id\x18\x04 \x01(\rH\x00\x88\x01\x01\x12\x14\n\x0c\x66rom_peer_id\x18\x02 \x01(\x04\x12\x12\n\nto_peer_id\x18\x03 \x01(\x04\x42\x0e\n\x0c_to_shard_id\"\xa4\x01\n\x0fRestartTransfer\x12\x10\n\x08shard_id\x18\x01 \x01(\r\x12\x18\n\x0bto_shard_id\x18\x05 \x01(\rH\x00\x88\x01\x01\x12\x14\n\x0c\x66rom_peer_id\x18\x02 \x01(\x04\x12\x12\n\nto_peer_id\x18\x03 \x01(\x04\x12+\n\x06method\x18\x04 \x01(\x0e\x32\x1b.qdrant.ShardTransferMethodB\x0e\n\x0c_to_shard_id\",\n\x07Replica\x12\x10\n\x08shard_id\x18\x01 \x01(\r\x12\x0f\n\x07peer_id\x18\x02 \x01(\x04\"\xae\x01\n\x0e\x43reateShardKey\x12#\n\tshard_key\x18\x01 \x01(\x0b\x32\x10.qdrant.ShardKey\x12\x1a\n\rshards_number\x18\x02 \x01(\rH\x00\x88\x01\x01\x12\x1f\n\x12replication_factor\x18\x03 \x01(\rH\x01\x88\x01\x01\x12\x11\n\tplacement\x18\x04 \x03(\x04\x42\x10\n\x0e_shards_numberB\x15\n\x13_replication_factor\"5\n\x0e\x44\x65leteShardKey\x12#\n\tshard_key\x18\x01 \x01(\x0b\x32\x10.qdrant.ShardKey\"\xc5\x03\n#UpdateCollectionClusterSetupRequest\x12\x17\n\x0f\x63ollection_name\x18\x01 \x01(\t\x12\'\n\nmove_shard\x18\x02 \x01(\x0b\x32\x11.qdrant.MoveShardH\x00\x12\x31\n\x0freplicate_shard\x18\x03 \x01(\x0b\x32\x16.qdrant.ReplicateShardH\x00\x12\x34\n\x0e\x61\x62ort_transfer\x18\x04 \x01(\x0b\x32\x1a.qdrant.AbortShardTransferH\x00\x12\'\n\x0c\x64rop_replica\x18\x05 \x01(\x0b\x32\x0f.qdrant.ReplicaH\x00\x12\x32\n\x10\x63reate_shard_key\x18\x07 \x01(\x0b\x32\x16.qdrant.CreateShardKeyH\x00\x12\x32\n\x10\x64\x65lete_shard_key\x18\x08 \x01(\x0b\x32\x16.qdrant.DeleteShardKeyH\x00\x12\x33\n\x10restart_transfer\x18\t \x01(\x0b\x32\x17.qdrant.RestartTransferH\x00\x12\x14\n\x07timeout\x18\x06 \x01(\x04H\x01\x88\x01\x01\x42\x0b\n\toperationB\n\n\x08_timeout\"6\n$UpdateCollectionClusterSetupResponse\x12\x0e\n\x06result\x18\x01 \x01(\x08\"{\n\x15\x43reateShardKeyRequest\x12\x17\n\x0f\x63ollection_name\x18\x01 \x01(\t\x12\'\n\x07request\x18\x02 \x01(\x0b\x32\x16.qdrant.CreateShardKey\x12\x14\n\x07timeout\x18\x03 \x01(\x04H\x00\x88\x01\x01\x42\n\n\x08_timeout\"{\n\x15\x44\x65leteShardKeyRequest\x12\x17\n\x0f\x63ollection_name\x18\x01 \x01(\t\x12\'\n\x07request\x18\x02 \x01(\x0b\x32\x16.qdrant.DeleteShardKey\x12\x14\n\x07timeout\x18\x03 \x01(\x04H\x00\x88\x01\x01\x42\n\n\x08_timeout\"(\n\x16\x43reateShardKeyResponse\x12\x0e\n\x06result\x18\x01 \x01(\x08\"(\n\x16\x44\x65leteShardKeyResponse\x12\x0e\n\x06result\x18\x01 \x01(\x08*<\n\x08\x44\x61tatype\x12\x0b\n\x07\x44\x65\x66\x61ult\x10\x00\x12\x0b\n\x07\x46loat32\x10\x01\x12\t\n\x05Uint8\x10\x02\x12\x0b\n\x07\x46loat16\x10\x03*\x1d\n\x08Modifier\x12\x08\n\x04None\x10\x00\x12\x07\n\x03Idf\x10\x01*#\n\x15MultiVectorComparator\x12\n\n\x06MaxSim\x10\x00*O\n\x08\x44istance\x12\x13\n\x0fUnknownDistance\x10\x00\x12\n\n\x06\x43osine\x10\x01\x12\n\n\x06\x45uclid\x10\x02\x12\x07\n\x03\x44ot\x10\x03\x12\r\n\tManhattan\x10\x04*Y\n\x10\x43ollectionStatus\x12\x1b\n\x17UnknownCollectionStatus\x10\x00\x12\t\n\x05Green\x10\x01\x12\n\n\x06Yellow\x10\x02\x12\x07\n\x03Red\x10\x03\x12\x08\n\x04Grey\x10\x04*~\n\x11PayloadSchemaType\x12\x0f\n\x0bUnknownType\x10\x00\x12\x0b\n\x07Keyword\x10\x01\x12\x0b\n\x07Integer\x10\x02\x12\t\n\x05\x46loat\x10\x03\x12\x07\n\x03Geo\x10\x04\x12\x08\n\x04Text\x10\x05\x12\x08\n\x04\x42ool\x10\x06\x12\x0c\n\x08\x44\x61tetime\x10\x07\x12\x08\n\x04Uuid\x10\x08*5\n\x10QuantizationType\x12\x17\n\x13UnknownQuantization\x10\x00\x12\x08\n\x04Int8\x10\x01*=\n\x10\x43ompressionRatio\x12\x06\n\x02x4\x10\x00\x12\x06\n\x02x8\x10\x01\x12\x07\n\x03x16\x10\x02\x12\x07\n\x03x32\x10\x03\x12\x07\n\x03x64\x10\x04*I\n\x1a\x42inaryQuantizationEncoding\x12\n\n\x06OneBit\x10\x00\x12\x0b\n\x07TwoBits\x10\x01\x12\x12\n\x0eOneAndHalfBits\x10\x02*&\n\x0eShardingMethod\x12\x08\n\x04\x41uto\x10\x00\x12\n\n\x06\x43ustom\x10\x01*T\n\rTokenizerType\x12\x0b\n\x07Unknown\x10\x00\x12\n\n\x06Prefix\x10\x01\x12\x0e\n\nWhitespace\x10\x02\x12\x08\n\x04Word\x10\x03\x12\x10\n\x0cMultilingual\x10\x04*\x9d\x01\n\x0cReplicaState\x12\n\n\x06\x41\x63tive\x10\x00\x12\x08\n\x04\x44\x65\x61\x64\x10\x01\x12\x0b\n\x07Partial\x10\x02\x12\x10\n\x0cInitializing\x10\x03\x12\x0c\n\x08Listener\x10\x04\x12\x13\n\x0fPartialSnapshot\x10\x05\x12\x0c\n\x08Recovery\x10\x06\x12\x0e\n\nResharding\x10\x07\x12\x17\n\x13ReshardingScaleDown\x10\x08*\'\n\x13ReshardingDirection\x12\x06\n\x02Up\x10\x00\x12\x08\n\x04\x44own\x10\x01*a\n\x13ShardTransferMethod\x12\x11\n\rStreamRecords\x10\x00\x12\x0c\n\x08Snapshot\x10\x01\x12\x0c\n\x08WalDelta\x10\x02\x12\x1b\n\x17ReshardingStreamRecords\x10\x03\x42\x15\xaa\x02\x12Qdrant.Client.Grpcb\x06proto3') + +_DATATYPE = DESCRIPTOR.enum_types_by_name['Datatype'] +Datatype = enum_type_wrapper.EnumTypeWrapper(_DATATYPE) +_MODIFIER = DESCRIPTOR.enum_types_by_name['Modifier'] +Modifier = enum_type_wrapper.EnumTypeWrapper(_MODIFIER) +_MULTIVECTORCOMPARATOR = DESCRIPTOR.enum_types_by_name['MultiVectorComparator'] +MultiVectorComparator = enum_type_wrapper.EnumTypeWrapper(_MULTIVECTORCOMPARATOR) +_DISTANCE = DESCRIPTOR.enum_types_by_name['Distance'] +Distance = enum_type_wrapper.EnumTypeWrapper(_DISTANCE) +_COLLECTIONSTATUS = DESCRIPTOR.enum_types_by_name['CollectionStatus'] +CollectionStatus = enum_type_wrapper.EnumTypeWrapper(_COLLECTIONSTATUS) +_PAYLOADSCHEMATYPE = DESCRIPTOR.enum_types_by_name['PayloadSchemaType'] +PayloadSchemaType = enum_type_wrapper.EnumTypeWrapper(_PAYLOADSCHEMATYPE) +_QUANTIZATIONTYPE = DESCRIPTOR.enum_types_by_name['QuantizationType'] +QuantizationType = enum_type_wrapper.EnumTypeWrapper(_QUANTIZATIONTYPE) +_COMPRESSIONRATIO = DESCRIPTOR.enum_types_by_name['CompressionRatio'] +CompressionRatio = enum_type_wrapper.EnumTypeWrapper(_COMPRESSIONRATIO) +_BINARYQUANTIZATIONENCODING = DESCRIPTOR.enum_types_by_name['BinaryQuantizationEncoding'] +BinaryQuantizationEncoding = enum_type_wrapper.EnumTypeWrapper(_BINARYQUANTIZATIONENCODING) +_SHARDINGMETHOD = DESCRIPTOR.enum_types_by_name['ShardingMethod'] +ShardingMethod = enum_type_wrapper.EnumTypeWrapper(_SHARDINGMETHOD) +_TOKENIZERTYPE = DESCRIPTOR.enum_types_by_name['TokenizerType'] +TokenizerType = enum_type_wrapper.EnumTypeWrapper(_TOKENIZERTYPE) +_REPLICASTATE = DESCRIPTOR.enum_types_by_name['ReplicaState'] +ReplicaState = enum_type_wrapper.EnumTypeWrapper(_REPLICASTATE) +_RESHARDINGDIRECTION = DESCRIPTOR.enum_types_by_name['ReshardingDirection'] +ReshardingDirection = enum_type_wrapper.EnumTypeWrapper(_RESHARDINGDIRECTION) +_SHARDTRANSFERMETHOD = DESCRIPTOR.enum_types_by_name['ShardTransferMethod'] +ShardTransferMethod = enum_type_wrapper.EnumTypeWrapper(_SHARDTRANSFERMETHOD) +Default = 0 +Float32 = 1 +Uint8 = 2 +Float16 = 3 +globals()['None'] = 0 +Idf = 1 +MaxSim = 0 +UnknownDistance = 0 +Cosine = 1 +Euclid = 2 +Dot = 3 +Manhattan = 4 +UnknownCollectionStatus = 0 +Green = 1 +Yellow = 2 +Red = 3 +Grey = 4 +UnknownType = 0 +Keyword = 1 +Integer = 2 +Float = 3 +Geo = 4 +Text = 5 +Bool = 6 +Datetime = 7 +Uuid = 8 +UnknownQuantization = 0 +Int8 = 1 +x4 = 0 +x8 = 1 +x16 = 2 +x32 = 3 +x64 = 4 +OneBit = 0 +TwoBits = 1 +OneAndHalfBits = 2 +Auto = 0 +Custom = 1 +Unknown = 0 +Prefix = 1 +Whitespace = 2 +Word = 3 +Multilingual = 4 +Active = 0 +Dead = 1 +Partial = 2 +Initializing = 3 +Listener = 4 +PartialSnapshot = 5 +Recovery = 6 +Resharding = 7 +ReshardingScaleDown = 8 +Up = 0 +Down = 1 +StreamRecords = 0 +Snapshot = 1 +WalDelta = 2 +ReshardingStreamRecords = 3 + + +_VECTORPARAMS = DESCRIPTOR.message_types_by_name['VectorParams'] +_VECTORPARAMSDIFF = DESCRIPTOR.message_types_by_name['VectorParamsDiff'] +_VECTORPARAMSMAP = DESCRIPTOR.message_types_by_name['VectorParamsMap'] +_VECTORPARAMSMAP_MAPENTRY = _VECTORPARAMSMAP.nested_types_by_name['MapEntry'] +_VECTORPARAMSDIFFMAP = DESCRIPTOR.message_types_by_name['VectorParamsDiffMap'] +_VECTORPARAMSDIFFMAP_MAPENTRY = _VECTORPARAMSDIFFMAP.nested_types_by_name['MapEntry'] +_VECTORSCONFIG = DESCRIPTOR.message_types_by_name['VectorsConfig'] +_VECTORSCONFIGDIFF = DESCRIPTOR.message_types_by_name['VectorsConfigDiff'] +_SPARSEVECTORPARAMS = DESCRIPTOR.message_types_by_name['SparseVectorParams'] +_SPARSEVECTORCONFIG = DESCRIPTOR.message_types_by_name['SparseVectorConfig'] +_SPARSEVECTORCONFIG_MAPENTRY = _SPARSEVECTORCONFIG.nested_types_by_name['MapEntry'] +_MULTIVECTORCONFIG = DESCRIPTOR.message_types_by_name['MultiVectorConfig'] +_GETCOLLECTIONINFOREQUEST = DESCRIPTOR.message_types_by_name['GetCollectionInfoRequest'] +_COLLECTIONEXISTSREQUEST = DESCRIPTOR.message_types_by_name['CollectionExistsRequest'] +_COLLECTIONEXISTS = DESCRIPTOR.message_types_by_name['CollectionExists'] +_COLLECTIONEXISTSRESPONSE = DESCRIPTOR.message_types_by_name['CollectionExistsResponse'] +_LISTCOLLECTIONSREQUEST = DESCRIPTOR.message_types_by_name['ListCollectionsRequest'] +_COLLECTIONDESCRIPTION = DESCRIPTOR.message_types_by_name['CollectionDescription'] +_GETCOLLECTIONINFORESPONSE = DESCRIPTOR.message_types_by_name['GetCollectionInfoResponse'] +_LISTCOLLECTIONSRESPONSE = DESCRIPTOR.message_types_by_name['ListCollectionsResponse'] +_MAXOPTIMIZATIONTHREADS = DESCRIPTOR.message_types_by_name['MaxOptimizationThreads'] +_OPTIMIZERSTATUS = DESCRIPTOR.message_types_by_name['OptimizerStatus'] +_HNSWCONFIGDIFF = DESCRIPTOR.message_types_by_name['HnswConfigDiff'] +_SPARSEINDEXCONFIG = DESCRIPTOR.message_types_by_name['SparseIndexConfig'] +_WALCONFIGDIFF = DESCRIPTOR.message_types_by_name['WalConfigDiff'] +_OPTIMIZERSCONFIGDIFF = DESCRIPTOR.message_types_by_name['OptimizersConfigDiff'] +_SCALARQUANTIZATION = DESCRIPTOR.message_types_by_name['ScalarQuantization'] +_PRODUCTQUANTIZATION = DESCRIPTOR.message_types_by_name['ProductQuantization'] +_BINARYQUANTIZATIONQUERYENCODING = DESCRIPTOR.message_types_by_name['BinaryQuantizationQueryEncoding'] +_BINARYQUANTIZATION = DESCRIPTOR.message_types_by_name['BinaryQuantization'] +_QUANTIZATIONCONFIG = DESCRIPTOR.message_types_by_name['QuantizationConfig'] +_DISABLED = DESCRIPTOR.message_types_by_name['Disabled'] +_QUANTIZATIONCONFIGDIFF = DESCRIPTOR.message_types_by_name['QuantizationConfigDiff'] +_STRICTMODECONFIG = DESCRIPTOR.message_types_by_name['StrictModeConfig'] +_STRICTMODESPARSECONFIG = DESCRIPTOR.message_types_by_name['StrictModeSparseConfig'] +_STRICTMODESPARSECONFIG_SPARSECONFIGENTRY = _STRICTMODESPARSECONFIG.nested_types_by_name['SparseConfigEntry'] +_STRICTMODESPARSE = DESCRIPTOR.message_types_by_name['StrictModeSparse'] +_STRICTMODEMULTIVECTORCONFIG = DESCRIPTOR.message_types_by_name['StrictModeMultivectorConfig'] +_STRICTMODEMULTIVECTORCONFIG_MULTIVECTORCONFIGENTRY = _STRICTMODEMULTIVECTORCONFIG.nested_types_by_name['MultivectorConfigEntry'] +_STRICTMODEMULTIVECTOR = DESCRIPTOR.message_types_by_name['StrictModeMultivector'] +_CREATECOLLECTION = DESCRIPTOR.message_types_by_name['CreateCollection'] +_UPDATECOLLECTION = DESCRIPTOR.message_types_by_name['UpdateCollection'] +_DELETECOLLECTION = DESCRIPTOR.message_types_by_name['DeleteCollection'] +_COLLECTIONOPERATIONRESPONSE = DESCRIPTOR.message_types_by_name['CollectionOperationResponse'] +_COLLECTIONPARAMS = DESCRIPTOR.message_types_by_name['CollectionParams'] +_COLLECTIONPARAMSDIFF = DESCRIPTOR.message_types_by_name['CollectionParamsDiff'] +_COLLECTIONCONFIG = DESCRIPTOR.message_types_by_name['CollectionConfig'] +_KEYWORDINDEXPARAMS = DESCRIPTOR.message_types_by_name['KeywordIndexParams'] +_INTEGERINDEXPARAMS = DESCRIPTOR.message_types_by_name['IntegerIndexParams'] +_FLOATINDEXPARAMS = DESCRIPTOR.message_types_by_name['FloatIndexParams'] +_GEOINDEXPARAMS = DESCRIPTOR.message_types_by_name['GeoIndexParams'] +_STOPWORDSSET = DESCRIPTOR.message_types_by_name['StopwordsSet'] +_TEXTINDEXPARAMS = DESCRIPTOR.message_types_by_name['TextIndexParams'] +_STEMMINGALGORITHM = DESCRIPTOR.message_types_by_name['StemmingAlgorithm'] +_SNOWBALLPARAMS = DESCRIPTOR.message_types_by_name['SnowballParams'] +_BOOLINDEXPARAMS = DESCRIPTOR.message_types_by_name['BoolIndexParams'] +_DATETIMEINDEXPARAMS = DESCRIPTOR.message_types_by_name['DatetimeIndexParams'] +_UUIDINDEXPARAMS = DESCRIPTOR.message_types_by_name['UuidIndexParams'] +_PAYLOADINDEXPARAMS = DESCRIPTOR.message_types_by_name['PayloadIndexParams'] +_PAYLOADSCHEMAINFO = DESCRIPTOR.message_types_by_name['PayloadSchemaInfo'] +_COLLECTIONINFO = DESCRIPTOR.message_types_by_name['CollectionInfo'] +_COLLECTIONINFO_PAYLOADSCHEMAENTRY = _COLLECTIONINFO.nested_types_by_name['PayloadSchemaEntry'] +_CHANGEALIASES = DESCRIPTOR.message_types_by_name['ChangeAliases'] +_ALIASOPERATIONS = DESCRIPTOR.message_types_by_name['AliasOperations'] +_CREATEALIAS = DESCRIPTOR.message_types_by_name['CreateAlias'] +_RENAMEALIAS = DESCRIPTOR.message_types_by_name['RenameAlias'] +_DELETEALIAS = DESCRIPTOR.message_types_by_name['DeleteAlias'] +_LISTALIASESREQUEST = DESCRIPTOR.message_types_by_name['ListAliasesRequest'] +_LISTCOLLECTIONALIASESREQUEST = DESCRIPTOR.message_types_by_name['ListCollectionAliasesRequest'] +_ALIASDESCRIPTION = DESCRIPTOR.message_types_by_name['AliasDescription'] +_LISTALIASESRESPONSE = DESCRIPTOR.message_types_by_name['ListAliasesResponse'] +_COLLECTIONCLUSTERINFOREQUEST = DESCRIPTOR.message_types_by_name['CollectionClusterInfoRequest'] +_SHARDKEY = DESCRIPTOR.message_types_by_name['ShardKey'] +_LOCALSHARDINFO = DESCRIPTOR.message_types_by_name['LocalShardInfo'] +_REMOTESHARDINFO = DESCRIPTOR.message_types_by_name['RemoteShardInfo'] +_SHARDTRANSFERINFO = DESCRIPTOR.message_types_by_name['ShardTransferInfo'] +_RESHARDINGINFO = DESCRIPTOR.message_types_by_name['ReshardingInfo'] +_COLLECTIONCLUSTERINFORESPONSE = DESCRIPTOR.message_types_by_name['CollectionClusterInfoResponse'] +_MOVESHARD = DESCRIPTOR.message_types_by_name['MoveShard'] +_REPLICATESHARD = DESCRIPTOR.message_types_by_name['ReplicateShard'] +_ABORTSHARDTRANSFER = DESCRIPTOR.message_types_by_name['AbortShardTransfer'] +_RESTARTTRANSFER = DESCRIPTOR.message_types_by_name['RestartTransfer'] +_REPLICA = DESCRIPTOR.message_types_by_name['Replica'] +_CREATESHARDKEY = DESCRIPTOR.message_types_by_name['CreateShardKey'] +_DELETESHARDKEY = DESCRIPTOR.message_types_by_name['DeleteShardKey'] +_UPDATECOLLECTIONCLUSTERSETUPREQUEST = DESCRIPTOR.message_types_by_name['UpdateCollectionClusterSetupRequest'] +_UPDATECOLLECTIONCLUSTERSETUPRESPONSE = DESCRIPTOR.message_types_by_name['UpdateCollectionClusterSetupResponse'] +_CREATESHARDKEYREQUEST = DESCRIPTOR.message_types_by_name['CreateShardKeyRequest'] +_DELETESHARDKEYREQUEST = DESCRIPTOR.message_types_by_name['DeleteShardKeyRequest'] +_CREATESHARDKEYRESPONSE = DESCRIPTOR.message_types_by_name['CreateShardKeyResponse'] +_DELETESHARDKEYRESPONSE = DESCRIPTOR.message_types_by_name['DeleteShardKeyResponse'] +_MAXOPTIMIZATIONTHREADS_SETTING = _MAXOPTIMIZATIONTHREADS.enum_types_by_name['Setting'] +_BINARYQUANTIZATIONQUERYENCODING_SETTING = _BINARYQUANTIZATIONQUERYENCODING.enum_types_by_name['Setting'] +VectorParams = _reflection.GeneratedProtocolMessageType('VectorParams', (_message.Message,), { + 'DESCRIPTOR' : _VECTORPARAMS, + '__module__' : 'collections_pb2' + # @@protoc_insertion_point(class_scope:qdrant.VectorParams) + }) +_sym_db.RegisterMessage(VectorParams) + +VectorParamsDiff = _reflection.GeneratedProtocolMessageType('VectorParamsDiff', (_message.Message,), { + 'DESCRIPTOR' : _VECTORPARAMSDIFF, + '__module__' : 'collections_pb2' + # @@protoc_insertion_point(class_scope:qdrant.VectorParamsDiff) + }) +_sym_db.RegisterMessage(VectorParamsDiff) + +VectorParamsMap = _reflection.GeneratedProtocolMessageType('VectorParamsMap', (_message.Message,), { + + 'MapEntry' : _reflection.GeneratedProtocolMessageType('MapEntry', (_message.Message,), { + 'DESCRIPTOR' : _VECTORPARAMSMAP_MAPENTRY, + '__module__' : 'collections_pb2' + # @@protoc_insertion_point(class_scope:qdrant.VectorParamsMap.MapEntry) + }) + , + 'DESCRIPTOR' : _VECTORPARAMSMAP, + '__module__' : 'collections_pb2' + # @@protoc_insertion_point(class_scope:qdrant.VectorParamsMap) + }) +_sym_db.RegisterMessage(VectorParamsMap) +_sym_db.RegisterMessage(VectorParamsMap.MapEntry) + +VectorParamsDiffMap = _reflection.GeneratedProtocolMessageType('VectorParamsDiffMap', (_message.Message,), { + + 'MapEntry' : _reflection.GeneratedProtocolMessageType('MapEntry', (_message.Message,), { + 'DESCRIPTOR' : _VECTORPARAMSDIFFMAP_MAPENTRY, + '__module__' : 'collections_pb2' + # @@protoc_insertion_point(class_scope:qdrant.VectorParamsDiffMap.MapEntry) + }) + , + 'DESCRIPTOR' : _VECTORPARAMSDIFFMAP, + '__module__' : 'collections_pb2' + # @@protoc_insertion_point(class_scope:qdrant.VectorParamsDiffMap) + }) +_sym_db.RegisterMessage(VectorParamsDiffMap) +_sym_db.RegisterMessage(VectorParamsDiffMap.MapEntry) + +VectorsConfig = _reflection.GeneratedProtocolMessageType('VectorsConfig', (_message.Message,), { + 'DESCRIPTOR' : _VECTORSCONFIG, + '__module__' : 'collections_pb2' + # @@protoc_insertion_point(class_scope:qdrant.VectorsConfig) + }) +_sym_db.RegisterMessage(VectorsConfig) + +VectorsConfigDiff = _reflection.GeneratedProtocolMessageType('VectorsConfigDiff', (_message.Message,), { + 'DESCRIPTOR' : _VECTORSCONFIGDIFF, + '__module__' : 'collections_pb2' + # @@protoc_insertion_point(class_scope:qdrant.VectorsConfigDiff) + }) +_sym_db.RegisterMessage(VectorsConfigDiff) + +SparseVectorParams = _reflection.GeneratedProtocolMessageType('SparseVectorParams', (_message.Message,), { + 'DESCRIPTOR' : _SPARSEVECTORPARAMS, + '__module__' : 'collections_pb2' + # @@protoc_insertion_point(class_scope:qdrant.SparseVectorParams) + }) +_sym_db.RegisterMessage(SparseVectorParams) + +SparseVectorConfig = _reflection.GeneratedProtocolMessageType('SparseVectorConfig', (_message.Message,), { + + 'MapEntry' : _reflection.GeneratedProtocolMessageType('MapEntry', (_message.Message,), { + 'DESCRIPTOR' : _SPARSEVECTORCONFIG_MAPENTRY, + '__module__' : 'collections_pb2' + # @@protoc_insertion_point(class_scope:qdrant.SparseVectorConfig.MapEntry) + }) + , + 'DESCRIPTOR' : _SPARSEVECTORCONFIG, + '__module__' : 'collections_pb2' + # @@protoc_insertion_point(class_scope:qdrant.SparseVectorConfig) + }) +_sym_db.RegisterMessage(SparseVectorConfig) +_sym_db.RegisterMessage(SparseVectorConfig.MapEntry) + +MultiVectorConfig = _reflection.GeneratedProtocolMessageType('MultiVectorConfig', (_message.Message,), { + 'DESCRIPTOR' : _MULTIVECTORCONFIG, + '__module__' : 'collections_pb2' + # @@protoc_insertion_point(class_scope:qdrant.MultiVectorConfig) + }) +_sym_db.RegisterMessage(MultiVectorConfig) + +GetCollectionInfoRequest = _reflection.GeneratedProtocolMessageType('GetCollectionInfoRequest', (_message.Message,), { + 'DESCRIPTOR' : _GETCOLLECTIONINFOREQUEST, + '__module__' : 'collections_pb2' + # @@protoc_insertion_point(class_scope:qdrant.GetCollectionInfoRequest) + }) +_sym_db.RegisterMessage(GetCollectionInfoRequest) + +CollectionExistsRequest = _reflection.GeneratedProtocolMessageType('CollectionExistsRequest', (_message.Message,), { + 'DESCRIPTOR' : _COLLECTIONEXISTSREQUEST, + '__module__' : 'collections_pb2' + # @@protoc_insertion_point(class_scope:qdrant.CollectionExistsRequest) + }) +_sym_db.RegisterMessage(CollectionExistsRequest) + +CollectionExists = _reflection.GeneratedProtocolMessageType('CollectionExists', (_message.Message,), { + 'DESCRIPTOR' : _COLLECTIONEXISTS, + '__module__' : 'collections_pb2' + # @@protoc_insertion_point(class_scope:qdrant.CollectionExists) + }) +_sym_db.RegisterMessage(CollectionExists) + +CollectionExistsResponse = _reflection.GeneratedProtocolMessageType('CollectionExistsResponse', (_message.Message,), { + 'DESCRIPTOR' : _COLLECTIONEXISTSRESPONSE, + '__module__' : 'collections_pb2' + # @@protoc_insertion_point(class_scope:qdrant.CollectionExistsResponse) + }) +_sym_db.RegisterMessage(CollectionExistsResponse) + +ListCollectionsRequest = _reflection.GeneratedProtocolMessageType('ListCollectionsRequest', (_message.Message,), { + 'DESCRIPTOR' : _LISTCOLLECTIONSREQUEST, + '__module__' : 'collections_pb2' + # @@protoc_insertion_point(class_scope:qdrant.ListCollectionsRequest) + }) +_sym_db.RegisterMessage(ListCollectionsRequest) + +CollectionDescription = _reflection.GeneratedProtocolMessageType('CollectionDescription', (_message.Message,), { + 'DESCRIPTOR' : _COLLECTIONDESCRIPTION, + '__module__' : 'collections_pb2' + # @@protoc_insertion_point(class_scope:qdrant.CollectionDescription) + }) +_sym_db.RegisterMessage(CollectionDescription) + +GetCollectionInfoResponse = _reflection.GeneratedProtocolMessageType('GetCollectionInfoResponse', (_message.Message,), { + 'DESCRIPTOR' : _GETCOLLECTIONINFORESPONSE, + '__module__' : 'collections_pb2' + # @@protoc_insertion_point(class_scope:qdrant.GetCollectionInfoResponse) + }) +_sym_db.RegisterMessage(GetCollectionInfoResponse) + +ListCollectionsResponse = _reflection.GeneratedProtocolMessageType('ListCollectionsResponse', (_message.Message,), { + 'DESCRIPTOR' : _LISTCOLLECTIONSRESPONSE, + '__module__' : 'collections_pb2' + # @@protoc_insertion_point(class_scope:qdrant.ListCollectionsResponse) + }) +_sym_db.RegisterMessage(ListCollectionsResponse) + +MaxOptimizationThreads = _reflection.GeneratedProtocolMessageType('MaxOptimizationThreads', (_message.Message,), { + 'DESCRIPTOR' : _MAXOPTIMIZATIONTHREADS, + '__module__' : 'collections_pb2' + # @@protoc_insertion_point(class_scope:qdrant.MaxOptimizationThreads) + }) +_sym_db.RegisterMessage(MaxOptimizationThreads) + +OptimizerStatus = _reflection.GeneratedProtocolMessageType('OptimizerStatus', (_message.Message,), { + 'DESCRIPTOR' : _OPTIMIZERSTATUS, + '__module__' : 'collections_pb2' + # @@protoc_insertion_point(class_scope:qdrant.OptimizerStatus) + }) +_sym_db.RegisterMessage(OptimizerStatus) + +HnswConfigDiff = _reflection.GeneratedProtocolMessageType('HnswConfigDiff', (_message.Message,), { + 'DESCRIPTOR' : _HNSWCONFIGDIFF, + '__module__' : 'collections_pb2' + # @@protoc_insertion_point(class_scope:qdrant.HnswConfigDiff) + }) +_sym_db.RegisterMessage(HnswConfigDiff) + +SparseIndexConfig = _reflection.GeneratedProtocolMessageType('SparseIndexConfig', (_message.Message,), { + 'DESCRIPTOR' : _SPARSEINDEXCONFIG, + '__module__' : 'collections_pb2' + # @@protoc_insertion_point(class_scope:qdrant.SparseIndexConfig) + }) +_sym_db.RegisterMessage(SparseIndexConfig) + +WalConfigDiff = _reflection.GeneratedProtocolMessageType('WalConfigDiff', (_message.Message,), { + 'DESCRIPTOR' : _WALCONFIGDIFF, + '__module__' : 'collections_pb2' + # @@protoc_insertion_point(class_scope:qdrant.WalConfigDiff) + }) +_sym_db.RegisterMessage(WalConfigDiff) + +OptimizersConfigDiff = _reflection.GeneratedProtocolMessageType('OptimizersConfigDiff', (_message.Message,), { + 'DESCRIPTOR' : _OPTIMIZERSCONFIGDIFF, + '__module__' : 'collections_pb2' + # @@protoc_insertion_point(class_scope:qdrant.OptimizersConfigDiff) + }) +_sym_db.RegisterMessage(OptimizersConfigDiff) + +ScalarQuantization = _reflection.GeneratedProtocolMessageType('ScalarQuantization', (_message.Message,), { + 'DESCRIPTOR' : _SCALARQUANTIZATION, + '__module__' : 'collections_pb2' + # @@protoc_insertion_point(class_scope:qdrant.ScalarQuantization) + }) +_sym_db.RegisterMessage(ScalarQuantization) + +ProductQuantization = _reflection.GeneratedProtocolMessageType('ProductQuantization', (_message.Message,), { + 'DESCRIPTOR' : _PRODUCTQUANTIZATION, + '__module__' : 'collections_pb2' + # @@protoc_insertion_point(class_scope:qdrant.ProductQuantization) + }) +_sym_db.RegisterMessage(ProductQuantization) + +BinaryQuantizationQueryEncoding = _reflection.GeneratedProtocolMessageType('BinaryQuantizationQueryEncoding', (_message.Message,), { + 'DESCRIPTOR' : _BINARYQUANTIZATIONQUERYENCODING, + '__module__' : 'collections_pb2' + # @@protoc_insertion_point(class_scope:qdrant.BinaryQuantizationQueryEncoding) + }) +_sym_db.RegisterMessage(BinaryQuantizationQueryEncoding) + +BinaryQuantization = _reflection.GeneratedProtocolMessageType('BinaryQuantization', (_message.Message,), { + 'DESCRIPTOR' : _BINARYQUANTIZATION, + '__module__' : 'collections_pb2' + # @@protoc_insertion_point(class_scope:qdrant.BinaryQuantization) + }) +_sym_db.RegisterMessage(BinaryQuantization) + +QuantizationConfig = _reflection.GeneratedProtocolMessageType('QuantizationConfig', (_message.Message,), { + 'DESCRIPTOR' : _QUANTIZATIONCONFIG, + '__module__' : 'collections_pb2' + # @@protoc_insertion_point(class_scope:qdrant.QuantizationConfig) + }) +_sym_db.RegisterMessage(QuantizationConfig) + +Disabled = _reflection.GeneratedProtocolMessageType('Disabled', (_message.Message,), { + 'DESCRIPTOR' : _DISABLED, + '__module__' : 'collections_pb2' + # @@protoc_insertion_point(class_scope:qdrant.Disabled) + }) +_sym_db.RegisterMessage(Disabled) + +QuantizationConfigDiff = _reflection.GeneratedProtocolMessageType('QuantizationConfigDiff', (_message.Message,), { + 'DESCRIPTOR' : _QUANTIZATIONCONFIGDIFF, + '__module__' : 'collections_pb2' + # @@protoc_insertion_point(class_scope:qdrant.QuantizationConfigDiff) + }) +_sym_db.RegisterMessage(QuantizationConfigDiff) + +StrictModeConfig = _reflection.GeneratedProtocolMessageType('StrictModeConfig', (_message.Message,), { + 'DESCRIPTOR' : _STRICTMODECONFIG, + '__module__' : 'collections_pb2' + # @@protoc_insertion_point(class_scope:qdrant.StrictModeConfig) + }) +_sym_db.RegisterMessage(StrictModeConfig) + +StrictModeSparseConfig = _reflection.GeneratedProtocolMessageType('StrictModeSparseConfig', (_message.Message,), { + + 'SparseConfigEntry' : _reflection.GeneratedProtocolMessageType('SparseConfigEntry', (_message.Message,), { + 'DESCRIPTOR' : _STRICTMODESPARSECONFIG_SPARSECONFIGENTRY, + '__module__' : 'collections_pb2' + # @@protoc_insertion_point(class_scope:qdrant.StrictModeSparseConfig.SparseConfigEntry) + }) + , + 'DESCRIPTOR' : _STRICTMODESPARSECONFIG, + '__module__' : 'collections_pb2' + # @@protoc_insertion_point(class_scope:qdrant.StrictModeSparseConfig) + }) +_sym_db.RegisterMessage(StrictModeSparseConfig) +_sym_db.RegisterMessage(StrictModeSparseConfig.SparseConfigEntry) + +StrictModeSparse = _reflection.GeneratedProtocolMessageType('StrictModeSparse', (_message.Message,), { + 'DESCRIPTOR' : _STRICTMODESPARSE, + '__module__' : 'collections_pb2' + # @@protoc_insertion_point(class_scope:qdrant.StrictModeSparse) + }) +_sym_db.RegisterMessage(StrictModeSparse) + +StrictModeMultivectorConfig = _reflection.GeneratedProtocolMessageType('StrictModeMultivectorConfig', (_message.Message,), { + + 'MultivectorConfigEntry' : _reflection.GeneratedProtocolMessageType('MultivectorConfigEntry', (_message.Message,), { + 'DESCRIPTOR' : _STRICTMODEMULTIVECTORCONFIG_MULTIVECTORCONFIGENTRY, + '__module__' : 'collections_pb2' + # @@protoc_insertion_point(class_scope:qdrant.StrictModeMultivectorConfig.MultivectorConfigEntry) + }) + , + 'DESCRIPTOR' : _STRICTMODEMULTIVECTORCONFIG, + '__module__' : 'collections_pb2' + # @@protoc_insertion_point(class_scope:qdrant.StrictModeMultivectorConfig) + }) +_sym_db.RegisterMessage(StrictModeMultivectorConfig) +_sym_db.RegisterMessage(StrictModeMultivectorConfig.MultivectorConfigEntry) + +StrictModeMultivector = _reflection.GeneratedProtocolMessageType('StrictModeMultivector', (_message.Message,), { + 'DESCRIPTOR' : _STRICTMODEMULTIVECTOR, + '__module__' : 'collections_pb2' + # @@protoc_insertion_point(class_scope:qdrant.StrictModeMultivector) + }) +_sym_db.RegisterMessage(StrictModeMultivector) + +CreateCollection = _reflection.GeneratedProtocolMessageType('CreateCollection', (_message.Message,), { + 'DESCRIPTOR' : _CREATECOLLECTION, + '__module__' : 'collections_pb2' + # @@protoc_insertion_point(class_scope:qdrant.CreateCollection) + }) +_sym_db.RegisterMessage(CreateCollection) + +UpdateCollection = _reflection.GeneratedProtocolMessageType('UpdateCollection', (_message.Message,), { + 'DESCRIPTOR' : _UPDATECOLLECTION, + '__module__' : 'collections_pb2' + # @@protoc_insertion_point(class_scope:qdrant.UpdateCollection) + }) +_sym_db.RegisterMessage(UpdateCollection) + +DeleteCollection = _reflection.GeneratedProtocolMessageType('DeleteCollection', (_message.Message,), { + 'DESCRIPTOR' : _DELETECOLLECTION, + '__module__' : 'collections_pb2' + # @@protoc_insertion_point(class_scope:qdrant.DeleteCollection) + }) +_sym_db.RegisterMessage(DeleteCollection) + +CollectionOperationResponse = _reflection.GeneratedProtocolMessageType('CollectionOperationResponse', (_message.Message,), { + 'DESCRIPTOR' : _COLLECTIONOPERATIONRESPONSE, + '__module__' : 'collections_pb2' + # @@protoc_insertion_point(class_scope:qdrant.CollectionOperationResponse) + }) +_sym_db.RegisterMessage(CollectionOperationResponse) + +CollectionParams = _reflection.GeneratedProtocolMessageType('CollectionParams', (_message.Message,), { + 'DESCRIPTOR' : _COLLECTIONPARAMS, + '__module__' : 'collections_pb2' + # @@protoc_insertion_point(class_scope:qdrant.CollectionParams) + }) +_sym_db.RegisterMessage(CollectionParams) + +CollectionParamsDiff = _reflection.GeneratedProtocolMessageType('CollectionParamsDiff', (_message.Message,), { + 'DESCRIPTOR' : _COLLECTIONPARAMSDIFF, + '__module__' : 'collections_pb2' + # @@protoc_insertion_point(class_scope:qdrant.CollectionParamsDiff) + }) +_sym_db.RegisterMessage(CollectionParamsDiff) + +CollectionConfig = _reflection.GeneratedProtocolMessageType('CollectionConfig', (_message.Message,), { + 'DESCRIPTOR' : _COLLECTIONCONFIG, + '__module__' : 'collections_pb2' + # @@protoc_insertion_point(class_scope:qdrant.CollectionConfig) + }) +_sym_db.RegisterMessage(CollectionConfig) + +KeywordIndexParams = _reflection.GeneratedProtocolMessageType('KeywordIndexParams', (_message.Message,), { + 'DESCRIPTOR' : _KEYWORDINDEXPARAMS, + '__module__' : 'collections_pb2' + # @@protoc_insertion_point(class_scope:qdrant.KeywordIndexParams) + }) +_sym_db.RegisterMessage(KeywordIndexParams) + +IntegerIndexParams = _reflection.GeneratedProtocolMessageType('IntegerIndexParams', (_message.Message,), { + 'DESCRIPTOR' : _INTEGERINDEXPARAMS, + '__module__' : 'collections_pb2' + # @@protoc_insertion_point(class_scope:qdrant.IntegerIndexParams) + }) +_sym_db.RegisterMessage(IntegerIndexParams) + +FloatIndexParams = _reflection.GeneratedProtocolMessageType('FloatIndexParams', (_message.Message,), { + 'DESCRIPTOR' : _FLOATINDEXPARAMS, + '__module__' : 'collections_pb2' + # @@protoc_insertion_point(class_scope:qdrant.FloatIndexParams) + }) +_sym_db.RegisterMessage(FloatIndexParams) + +GeoIndexParams = _reflection.GeneratedProtocolMessageType('GeoIndexParams', (_message.Message,), { + 'DESCRIPTOR' : _GEOINDEXPARAMS, + '__module__' : 'collections_pb2' + # @@protoc_insertion_point(class_scope:qdrant.GeoIndexParams) + }) +_sym_db.RegisterMessage(GeoIndexParams) + +StopwordsSet = _reflection.GeneratedProtocolMessageType('StopwordsSet', (_message.Message,), { + 'DESCRIPTOR' : _STOPWORDSSET, + '__module__' : 'collections_pb2' + # @@protoc_insertion_point(class_scope:qdrant.StopwordsSet) + }) +_sym_db.RegisterMessage(StopwordsSet) + +TextIndexParams = _reflection.GeneratedProtocolMessageType('TextIndexParams', (_message.Message,), { + 'DESCRIPTOR' : _TEXTINDEXPARAMS, + '__module__' : 'collections_pb2' + # @@protoc_insertion_point(class_scope:qdrant.TextIndexParams) + }) +_sym_db.RegisterMessage(TextIndexParams) + +StemmingAlgorithm = _reflection.GeneratedProtocolMessageType('StemmingAlgorithm', (_message.Message,), { + 'DESCRIPTOR' : _STEMMINGALGORITHM, + '__module__' : 'collections_pb2' + # @@protoc_insertion_point(class_scope:qdrant.StemmingAlgorithm) + }) +_sym_db.RegisterMessage(StemmingAlgorithm) + +SnowballParams = _reflection.GeneratedProtocolMessageType('SnowballParams', (_message.Message,), { + 'DESCRIPTOR' : _SNOWBALLPARAMS, + '__module__' : 'collections_pb2' + # @@protoc_insertion_point(class_scope:qdrant.SnowballParams) + }) +_sym_db.RegisterMessage(SnowballParams) + +BoolIndexParams = _reflection.GeneratedProtocolMessageType('BoolIndexParams', (_message.Message,), { + 'DESCRIPTOR' : _BOOLINDEXPARAMS, + '__module__' : 'collections_pb2' + # @@protoc_insertion_point(class_scope:qdrant.BoolIndexParams) + }) +_sym_db.RegisterMessage(BoolIndexParams) + +DatetimeIndexParams = _reflection.GeneratedProtocolMessageType('DatetimeIndexParams', (_message.Message,), { + 'DESCRIPTOR' : _DATETIMEINDEXPARAMS, + '__module__' : 'collections_pb2' + # @@protoc_insertion_point(class_scope:qdrant.DatetimeIndexParams) + }) +_sym_db.RegisterMessage(DatetimeIndexParams) + +UuidIndexParams = _reflection.GeneratedProtocolMessageType('UuidIndexParams', (_message.Message,), { + 'DESCRIPTOR' : _UUIDINDEXPARAMS, + '__module__' : 'collections_pb2' + # @@protoc_insertion_point(class_scope:qdrant.UuidIndexParams) + }) +_sym_db.RegisterMessage(UuidIndexParams) + +PayloadIndexParams = _reflection.GeneratedProtocolMessageType('PayloadIndexParams', (_message.Message,), { + 'DESCRIPTOR' : _PAYLOADINDEXPARAMS, + '__module__' : 'collections_pb2' + # @@protoc_insertion_point(class_scope:qdrant.PayloadIndexParams) + }) +_sym_db.RegisterMessage(PayloadIndexParams) + +PayloadSchemaInfo = _reflection.GeneratedProtocolMessageType('PayloadSchemaInfo', (_message.Message,), { + 'DESCRIPTOR' : _PAYLOADSCHEMAINFO, + '__module__' : 'collections_pb2' + # @@protoc_insertion_point(class_scope:qdrant.PayloadSchemaInfo) + }) +_sym_db.RegisterMessage(PayloadSchemaInfo) + +CollectionInfo = _reflection.GeneratedProtocolMessageType('CollectionInfo', (_message.Message,), { + + 'PayloadSchemaEntry' : _reflection.GeneratedProtocolMessageType('PayloadSchemaEntry', (_message.Message,), { + 'DESCRIPTOR' : _COLLECTIONINFO_PAYLOADSCHEMAENTRY, + '__module__' : 'collections_pb2' + # @@protoc_insertion_point(class_scope:qdrant.CollectionInfo.PayloadSchemaEntry) + }) + , + 'DESCRIPTOR' : _COLLECTIONINFO, + '__module__' : 'collections_pb2' + # @@protoc_insertion_point(class_scope:qdrant.CollectionInfo) + }) +_sym_db.RegisterMessage(CollectionInfo) +_sym_db.RegisterMessage(CollectionInfo.PayloadSchemaEntry) + +ChangeAliases = _reflection.GeneratedProtocolMessageType('ChangeAliases', (_message.Message,), { + 'DESCRIPTOR' : _CHANGEALIASES, + '__module__' : 'collections_pb2' + # @@protoc_insertion_point(class_scope:qdrant.ChangeAliases) + }) +_sym_db.RegisterMessage(ChangeAliases) + +AliasOperations = _reflection.GeneratedProtocolMessageType('AliasOperations', (_message.Message,), { + 'DESCRIPTOR' : _ALIASOPERATIONS, + '__module__' : 'collections_pb2' + # @@protoc_insertion_point(class_scope:qdrant.AliasOperations) + }) +_sym_db.RegisterMessage(AliasOperations) + +CreateAlias = _reflection.GeneratedProtocolMessageType('CreateAlias', (_message.Message,), { + 'DESCRIPTOR' : _CREATEALIAS, + '__module__' : 'collections_pb2' + # @@protoc_insertion_point(class_scope:qdrant.CreateAlias) + }) +_sym_db.RegisterMessage(CreateAlias) + +RenameAlias = _reflection.GeneratedProtocolMessageType('RenameAlias', (_message.Message,), { + 'DESCRIPTOR' : _RENAMEALIAS, + '__module__' : 'collections_pb2' + # @@protoc_insertion_point(class_scope:qdrant.RenameAlias) + }) +_sym_db.RegisterMessage(RenameAlias) + +DeleteAlias = _reflection.GeneratedProtocolMessageType('DeleteAlias', (_message.Message,), { + 'DESCRIPTOR' : _DELETEALIAS, + '__module__' : 'collections_pb2' + # @@protoc_insertion_point(class_scope:qdrant.DeleteAlias) + }) +_sym_db.RegisterMessage(DeleteAlias) + +ListAliasesRequest = _reflection.GeneratedProtocolMessageType('ListAliasesRequest', (_message.Message,), { + 'DESCRIPTOR' : _LISTALIASESREQUEST, + '__module__' : 'collections_pb2' + # @@protoc_insertion_point(class_scope:qdrant.ListAliasesRequest) + }) +_sym_db.RegisterMessage(ListAliasesRequest) + +ListCollectionAliasesRequest = _reflection.GeneratedProtocolMessageType('ListCollectionAliasesRequest', (_message.Message,), { + 'DESCRIPTOR' : _LISTCOLLECTIONALIASESREQUEST, + '__module__' : 'collections_pb2' + # @@protoc_insertion_point(class_scope:qdrant.ListCollectionAliasesRequest) + }) +_sym_db.RegisterMessage(ListCollectionAliasesRequest) + +AliasDescription = _reflection.GeneratedProtocolMessageType('AliasDescription', (_message.Message,), { + 'DESCRIPTOR' : _ALIASDESCRIPTION, + '__module__' : 'collections_pb2' + # @@protoc_insertion_point(class_scope:qdrant.AliasDescription) + }) +_sym_db.RegisterMessage(AliasDescription) + +ListAliasesResponse = _reflection.GeneratedProtocolMessageType('ListAliasesResponse', (_message.Message,), { + 'DESCRIPTOR' : _LISTALIASESRESPONSE, + '__module__' : 'collections_pb2' + # @@protoc_insertion_point(class_scope:qdrant.ListAliasesResponse) + }) +_sym_db.RegisterMessage(ListAliasesResponse) + +CollectionClusterInfoRequest = _reflection.GeneratedProtocolMessageType('CollectionClusterInfoRequest', (_message.Message,), { + 'DESCRIPTOR' : _COLLECTIONCLUSTERINFOREQUEST, + '__module__' : 'collections_pb2' + # @@protoc_insertion_point(class_scope:qdrant.CollectionClusterInfoRequest) + }) +_sym_db.RegisterMessage(CollectionClusterInfoRequest) + +ShardKey = _reflection.GeneratedProtocolMessageType('ShardKey', (_message.Message,), { + 'DESCRIPTOR' : _SHARDKEY, + '__module__' : 'collections_pb2' + # @@protoc_insertion_point(class_scope:qdrant.ShardKey) + }) +_sym_db.RegisterMessage(ShardKey) + +LocalShardInfo = _reflection.GeneratedProtocolMessageType('LocalShardInfo', (_message.Message,), { + 'DESCRIPTOR' : _LOCALSHARDINFO, + '__module__' : 'collections_pb2' + # @@protoc_insertion_point(class_scope:qdrant.LocalShardInfo) + }) +_sym_db.RegisterMessage(LocalShardInfo) + +RemoteShardInfo = _reflection.GeneratedProtocolMessageType('RemoteShardInfo', (_message.Message,), { + 'DESCRIPTOR' : _REMOTESHARDINFO, + '__module__' : 'collections_pb2' + # @@protoc_insertion_point(class_scope:qdrant.RemoteShardInfo) + }) +_sym_db.RegisterMessage(RemoteShardInfo) + +ShardTransferInfo = _reflection.GeneratedProtocolMessageType('ShardTransferInfo', (_message.Message,), { + 'DESCRIPTOR' : _SHARDTRANSFERINFO, + '__module__' : 'collections_pb2' + # @@protoc_insertion_point(class_scope:qdrant.ShardTransferInfo) + }) +_sym_db.RegisterMessage(ShardTransferInfo) + +ReshardingInfo = _reflection.GeneratedProtocolMessageType('ReshardingInfo', (_message.Message,), { + 'DESCRIPTOR' : _RESHARDINGINFO, + '__module__' : 'collections_pb2' + # @@protoc_insertion_point(class_scope:qdrant.ReshardingInfo) + }) +_sym_db.RegisterMessage(ReshardingInfo) + +CollectionClusterInfoResponse = _reflection.GeneratedProtocolMessageType('CollectionClusterInfoResponse', (_message.Message,), { + 'DESCRIPTOR' : _COLLECTIONCLUSTERINFORESPONSE, + '__module__' : 'collections_pb2' + # @@protoc_insertion_point(class_scope:qdrant.CollectionClusterInfoResponse) + }) +_sym_db.RegisterMessage(CollectionClusterInfoResponse) + +MoveShard = _reflection.GeneratedProtocolMessageType('MoveShard', (_message.Message,), { + 'DESCRIPTOR' : _MOVESHARD, + '__module__' : 'collections_pb2' + # @@protoc_insertion_point(class_scope:qdrant.MoveShard) + }) +_sym_db.RegisterMessage(MoveShard) + +ReplicateShard = _reflection.GeneratedProtocolMessageType('ReplicateShard', (_message.Message,), { + 'DESCRIPTOR' : _REPLICATESHARD, + '__module__' : 'collections_pb2' + # @@protoc_insertion_point(class_scope:qdrant.ReplicateShard) + }) +_sym_db.RegisterMessage(ReplicateShard) + +AbortShardTransfer = _reflection.GeneratedProtocolMessageType('AbortShardTransfer', (_message.Message,), { + 'DESCRIPTOR' : _ABORTSHARDTRANSFER, + '__module__' : 'collections_pb2' + # @@protoc_insertion_point(class_scope:qdrant.AbortShardTransfer) + }) +_sym_db.RegisterMessage(AbortShardTransfer) + +RestartTransfer = _reflection.GeneratedProtocolMessageType('RestartTransfer', (_message.Message,), { + 'DESCRIPTOR' : _RESTARTTRANSFER, + '__module__' : 'collections_pb2' + # @@protoc_insertion_point(class_scope:qdrant.RestartTransfer) + }) +_sym_db.RegisterMessage(RestartTransfer) + +Replica = _reflection.GeneratedProtocolMessageType('Replica', (_message.Message,), { + 'DESCRIPTOR' : _REPLICA, + '__module__' : 'collections_pb2' + # @@protoc_insertion_point(class_scope:qdrant.Replica) + }) +_sym_db.RegisterMessage(Replica) + +CreateShardKey = _reflection.GeneratedProtocolMessageType('CreateShardKey', (_message.Message,), { + 'DESCRIPTOR' : _CREATESHARDKEY, + '__module__' : 'collections_pb2' + # @@protoc_insertion_point(class_scope:qdrant.CreateShardKey) + }) +_sym_db.RegisterMessage(CreateShardKey) + +DeleteShardKey = _reflection.GeneratedProtocolMessageType('DeleteShardKey', (_message.Message,), { + 'DESCRIPTOR' : _DELETESHARDKEY, + '__module__' : 'collections_pb2' + # @@protoc_insertion_point(class_scope:qdrant.DeleteShardKey) + }) +_sym_db.RegisterMessage(DeleteShardKey) + +UpdateCollectionClusterSetupRequest = _reflection.GeneratedProtocolMessageType('UpdateCollectionClusterSetupRequest', (_message.Message,), { + 'DESCRIPTOR' : _UPDATECOLLECTIONCLUSTERSETUPREQUEST, + '__module__' : 'collections_pb2' + # @@protoc_insertion_point(class_scope:qdrant.UpdateCollectionClusterSetupRequest) + }) +_sym_db.RegisterMessage(UpdateCollectionClusterSetupRequest) + +UpdateCollectionClusterSetupResponse = _reflection.GeneratedProtocolMessageType('UpdateCollectionClusterSetupResponse', (_message.Message,), { + 'DESCRIPTOR' : _UPDATECOLLECTIONCLUSTERSETUPRESPONSE, + '__module__' : 'collections_pb2' + # @@protoc_insertion_point(class_scope:qdrant.UpdateCollectionClusterSetupResponse) + }) +_sym_db.RegisterMessage(UpdateCollectionClusterSetupResponse) + +CreateShardKeyRequest = _reflection.GeneratedProtocolMessageType('CreateShardKeyRequest', (_message.Message,), { + 'DESCRIPTOR' : _CREATESHARDKEYREQUEST, + '__module__' : 'collections_pb2' + # @@protoc_insertion_point(class_scope:qdrant.CreateShardKeyRequest) + }) +_sym_db.RegisterMessage(CreateShardKeyRequest) + +DeleteShardKeyRequest = _reflection.GeneratedProtocolMessageType('DeleteShardKeyRequest', (_message.Message,), { + 'DESCRIPTOR' : _DELETESHARDKEYREQUEST, + '__module__' : 'collections_pb2' + # @@protoc_insertion_point(class_scope:qdrant.DeleteShardKeyRequest) + }) +_sym_db.RegisterMessage(DeleteShardKeyRequest) + +CreateShardKeyResponse = _reflection.GeneratedProtocolMessageType('CreateShardKeyResponse', (_message.Message,), { + 'DESCRIPTOR' : _CREATESHARDKEYRESPONSE, + '__module__' : 'collections_pb2' + # @@protoc_insertion_point(class_scope:qdrant.CreateShardKeyResponse) + }) +_sym_db.RegisterMessage(CreateShardKeyResponse) + +DeleteShardKeyResponse = _reflection.GeneratedProtocolMessageType('DeleteShardKeyResponse', (_message.Message,), { + 'DESCRIPTOR' : _DELETESHARDKEYRESPONSE, + '__module__' : 'collections_pb2' + # @@protoc_insertion_point(class_scope:qdrant.DeleteShardKeyResponse) + }) +_sym_db.RegisterMessage(DeleteShardKeyResponse) + +if _descriptor._USE_C_DESCRIPTORS == False: + + DESCRIPTOR._options = None + DESCRIPTOR._serialized_options = b'\252\002\022Qdrant.Client.Grpc' + _VECTORPARAMSMAP_MAPENTRY._options = None + _VECTORPARAMSMAP_MAPENTRY._serialized_options = b'8\001' + _VECTORPARAMSDIFFMAP_MAPENTRY._options = None + _VECTORPARAMSDIFFMAP_MAPENTRY._serialized_options = b'8\001' + _SPARSEVECTORCONFIG_MAPENTRY._options = None + _SPARSEVECTORCONFIG_MAPENTRY._serialized_options = b'8\001' + _STRICTMODESPARSECONFIG_SPARSECONFIGENTRY._options = None + _STRICTMODESPARSECONFIG_SPARSECONFIGENTRY._serialized_options = b'8\001' + _STRICTMODEMULTIVECTORCONFIG_MULTIVECTORCONFIGENTRY._options = None + _STRICTMODEMULTIVECTORCONFIG_MULTIVECTORCONFIGENTRY._serialized_options = b'8\001' + _COLLECTIONINFO_PAYLOADSCHEMAENTRY._options = None + _COLLECTIONINFO_PAYLOADSCHEMAENTRY._serialized_options = b'8\001' + _DATATYPE._serialized_start=14684 + _DATATYPE._serialized_end=14744 + _MODIFIER._serialized_start=14746 + _MODIFIER._serialized_end=14775 + _MULTIVECTORCOMPARATOR._serialized_start=14777 + _MULTIVECTORCOMPARATOR._serialized_end=14812 + _DISTANCE._serialized_start=14814 + _DISTANCE._serialized_end=14893 + _COLLECTIONSTATUS._serialized_start=14895 + _COLLECTIONSTATUS._serialized_end=14984 + _PAYLOADSCHEMATYPE._serialized_start=14986 + _PAYLOADSCHEMATYPE._serialized_end=15112 + _QUANTIZATIONTYPE._serialized_start=15114 + _QUANTIZATIONTYPE._serialized_end=15167 + _COMPRESSIONRATIO._serialized_start=15169 + _COMPRESSIONRATIO._serialized_end=15230 + _BINARYQUANTIZATIONENCODING._serialized_start=15232 + _BINARYQUANTIZATIONENCODING._serialized_end=15305 + _SHARDINGMETHOD._serialized_start=15307 + _SHARDINGMETHOD._serialized_end=15345 + _TOKENIZERTYPE._serialized_start=15347 + _TOKENIZERTYPE._serialized_end=15431 + _REPLICASTATE._serialized_start=15434 + _REPLICASTATE._serialized_end=15591 + _RESHARDINGDIRECTION._serialized_start=15593 + _RESHARDINGDIRECTION._serialized_end=15632 + _SHARDTRANSFERMETHOD._serialized_start=15634 + _SHARDTRANSFERMETHOD._serialized_end=15731 + _VECTORPARAMS._serialized_start=30 + _VECTORPARAMS._serialized_end=417 + _VECTORPARAMSDIFF._serialized_start=420 + _VECTORPARAMSDIFF._serialized_end=628 + _VECTORPARAMSMAP._serialized_start=631 + _VECTORPARAMSMAP._serialized_end=761 + _VECTORPARAMSMAP_MAPENTRY._serialized_start=697 + _VECTORPARAMSMAP_MAPENTRY._serialized_end=761 + _VECTORPARAMSDIFFMAP._serialized_start=764 + _VECTORPARAMSDIFFMAP._serialized_end=906 + _VECTORPARAMSDIFFMAP_MAPENTRY._serialized_start=838 + _VECTORPARAMSDIFFMAP_MAPENTRY._serialized_end=906 + _VECTORSCONFIG._serialized_start=908 + _VECTORSCONFIG._serialized_end=1020 + _VECTORSCONFIGDIFF._serialized_start=1022 + _VECTORSCONFIGDIFF._serialized_end=1146 + _SPARSEVECTORPARAMS._serialized_start=1149 + _SPARSEVECTORPARAMS._serialized_end=1280 + _SPARSEVECTORCONFIG._serialized_start=1283 + _SPARSEVECTORCONFIG._serialized_end=1425 + _SPARSEVECTORCONFIG_MAPENTRY._serialized_start=1355 + _SPARSEVECTORCONFIG_MAPENTRY._serialized_end=1425 + _MULTIVECTORCONFIG._serialized_start=1427 + _MULTIVECTORCONFIG._serialized_end=1497 + _GETCOLLECTIONINFOREQUEST._serialized_start=1499 + _GETCOLLECTIONINFOREQUEST._serialized_end=1550 + _COLLECTIONEXISTSREQUEST._serialized_start=1552 + _COLLECTIONEXISTSREQUEST._serialized_end=1602 + _COLLECTIONEXISTS._serialized_start=1604 + _COLLECTIONEXISTS._serialized_end=1638 + _COLLECTIONEXISTSRESPONSE._serialized_start=1640 + _COLLECTIONEXISTSRESPONSE._serialized_end=1722 + _LISTCOLLECTIONSREQUEST._serialized_start=1724 + _LISTCOLLECTIONSREQUEST._serialized_end=1748 + _COLLECTIONDESCRIPTION._serialized_start=1750 + _COLLECTIONDESCRIPTION._serialized_end=1787 + _GETCOLLECTIONINFORESPONSE._serialized_start=1789 + _GETCOLLECTIONINFORESPONSE._serialized_end=1870 + _LISTCOLLECTIONSRESPONSE._serialized_start=1872 + _LISTCOLLECTIONSRESPONSE._serialized_end=1963 + _MAXOPTIMIZATIONTHREADS._serialized_start=1966 + _MAXOPTIMIZATIONTHREADS._serialized_end=2098 + _MAXOPTIMIZATIONTHREADS_SETTING._serialized_start=2068 + _MAXOPTIMIZATIONTHREADS_SETTING._serialized_end=2087 + _OPTIMIZERSTATUS._serialized_start=2100 + _OPTIMIZERSTATUS._serialized_end=2144 + _HNSWCONFIGDIFF._serialized_start=2147 + _HNSWCONFIGDIFF._serialized_end=2419 + _SPARSEINDEXCONFIG._serialized_start=2422 + _SPARSEINDEXCONFIG._serialized_end=2587 + _WALCONFIGDIFF._serialized_start=2589 + _WALCONFIGDIFF._serialized_end=2710 + _OPTIMIZERSCONFIGDIFF._serialized_start=2713 + _OPTIMIZERSCONFIGDIFF._serialized_end=3327 + _SCALARQUANTIZATION._serialized_start=3330 + _SCALARQUANTIZATION._serialized_end=3466 + _PRODUCTQUANTIZATION._serialized_start=3468 + _PRODUCTQUANTIZATION._serialized_end=3576 + _BINARYQUANTIZATIONQUERYENCODING._serialized_start=3579 + _BINARYQUANTIZATIONQUERYENCODING._serialized_end=3761 + _BINARYQUANTIZATIONQUERYENCODING_SETTING._serialized_start=3682 + _BINARYQUANTIZATIONQUERYENCODING_SETTING._serialized_end=3750 + _BINARYQUANTIZATION._serialized_start=3764 + _BINARYQUANTIZATION._serialized_end=3985 + _QUANTIZATIONCONFIG._serialized_start=3988 + _QUANTIZATIONCONFIG._serialized_end=4164 + _DISABLED._serialized_start=4166 + _DISABLED._serialized_end=4176 + _QUANTIZATIONCONFIGDIFF._serialized_start=4179 + _QUANTIZATIONCONFIGDIFF._serialized_end=4397 + _STRICTMODECONFIG._serialized_start=4400 + _STRICTMODECONFIG._serialized_end=5543 + _STRICTMODESPARSECONFIG._serialized_start=5546 + _STRICTMODESPARSECONFIG._serialized_end=5722 + _STRICTMODESPARSECONFIG_SPARSECONFIGENTRY._serialized_start=5645 + _STRICTMODESPARSECONFIG_SPARSECONFIGENTRY._serialized_end=5722 + _STRICTMODESPARSE._serialized_start=5724 + _STRICTMODESPARSE._serialized_end=5782 + _STRICTMODEMULTIVECTORCONFIG._serialized_start=5785 + _STRICTMODEMULTIVECTORCONFIG._serialized_end=5991 + _STRICTMODEMULTIVECTORCONFIG_MULTIVECTORCONFIGENTRY._serialized_start=5904 + _STRICTMODEMULTIVECTORCONFIG_MULTIVECTORCONFIGENTRY._serialized_end=5991 + _STRICTMODEMULTIVECTOR._serialized_start=5993 + _STRICTMODEMULTIVECTOR._serialized_end=6058 + _CREATECOLLECTION._serialized_start=6061 + _CREATECOLLECTION._serialized_end=7044 + _UPDATECOLLECTION._serialized_start=7047 + _UPDATECOLLECTION._serialized_end=7673 + _DELETECOLLECTION._serialized_start=7675 + _DELETECOLLECTION._serialized_end=7752 + _COLLECTIONOPERATIONRESPONSE._serialized_start=7754 + _COLLECTIONOPERATIONRESPONSE._serialized_end=7813 + _COLLECTIONPARAMS._serialized_start=7816 + _COLLECTIONPARAMS._serialized_end=8310 + _COLLECTIONPARAMSDIFF._serialized_start=8313 + _COLLECTIONPARAMSDIFF._serialized_end=8567 + _COLLECTIONCONFIG._serialized_start=8570 + _COLLECTIONCONFIG._serialized_end=8942 + _KEYWORDINDEXPARAMS._serialized_start=8944 + _KEYWORDINDEXPARAMS._serialized_end=9036 + _INTEGERINDEXPARAMS._serialized_start=9039 + _INTEGERINDEXPARAMS._serialized_end=9199 + _FLOATINDEXPARAMS._serialized_start=9201 + _FLOATINDEXPARAMS._serialized_end=9297 + _GEOINDEXPARAMS._serialized_start=9299 + _GEOINDEXPARAMS._serialized_end=9349 + _STOPWORDSSET._serialized_start=9351 + _STOPWORDSSET._serialized_end=9400 + _TEXTINDEXPARAMS._serialized_start=9403 + _TEXTINDEXPARAMS._serialized_end=9797 + _STEMMINGALGORITHM._serialized_start=9799 + _STEMMINGALGORITHM._serialized_end=9881 + _SNOWBALLPARAMS._serialized_start=9883 + _SNOWBALLPARAMS._serialized_end=9917 + _BOOLINDEXPARAMS._serialized_start=9919 + _BOOLINDEXPARAMS._serialized_end=9970 + _DATETIMEINDEXPARAMS._serialized_start=9972 + _DATETIMEINDEXPARAMS._serialized_end=10071 + _UUIDINDEXPARAMS._serialized_start=10073 + _UUIDINDEXPARAMS._serialized_end=10162 + _PAYLOADINDEXPARAMS._serialized_start=10165 + _PAYLOADINDEXPARAMS._serialized_end=10653 + _PAYLOADSCHEMAINFO._serialized_start=10656 + _PAYLOADSCHEMAINFO._serialized_end=10813 + _COLLECTIONINFO._serialized_start=10816 + _COLLECTIONINFO._serialized_end=11303 + _COLLECTIONINFO_PAYLOADSCHEMAENTRY._serialized_start=11151 + _COLLECTIONINFO_PAYLOADSCHEMAENTRY._serialized_end=11230 + _CHANGEALIASES._serialized_start=11305 + _CHANGEALIASES._serialized_end=11396 + _ALIASOPERATIONS._serialized_start=11399 + _ALIASOPERATIONS._serialized_end=11561 + _CREATEALIAS._serialized_start=11563 + _CREATEALIAS._serialized_end=11621 + _RENAMEALIAS._serialized_start=11623 + _RENAMEALIAS._serialized_end=11684 + _DELETEALIAS._serialized_start=11686 + _DELETEALIAS._serialized_end=11719 + _LISTALIASESREQUEST._serialized_start=11721 + _LISTALIASESREQUEST._serialized_end=11741 + _LISTCOLLECTIONALIASESREQUEST._serialized_start=11743 + _LISTCOLLECTIONALIASESREQUEST._serialized_end=11798 + _ALIASDESCRIPTION._serialized_start=11800 + _ALIASDESCRIPTION._serialized_end=11863 + _LISTALIASESRESPONSE._serialized_start=11865 + _LISTALIASESRESPONSE._serialized_end=11943 + _COLLECTIONCLUSTERINFOREQUEST._serialized_start=11945 + _COLLECTIONCLUSTERINFOREQUEST._serialized_end=12000 + _SHARDKEY._serialized_start=12002 + _SHARDKEY._serialized_end=12056 + _LOCALSHARDINFO._serialized_start=12059 + _LOCALSHARDINFO._serialized_end=12208 + _REMOTESHARDINFO._serialized_start=12211 + _REMOTESHARDINFO._serialized_end=12356 + _SHARDTRANSFERINFO._serialized_start=12358 + _SHARDTRANSFERINFO._serialized_end=12477 + _RESHARDINGINFO._serialized_start=12480 + _RESHARDINGINFO._serialized_end=12635 + _COLLECTIONCLUSTERINFORESPONSE._serialized_start=12638 + _COLLECTIONCLUSTERINFORESPONSE._serialized_end=12908 + _MOVESHARD._serialized_start=12911 + _MOVESHARD._serialized_end=13085 + _REPLICATESHARD._serialized_start=13088 + _REPLICATESHARD._serialized_end=13267 + _ABORTSHARDTRANSFER._serialized_start=13269 + _ABORTSHARDTRANSFER._serialized_end=13391 + _RESTARTTRANSFER._serialized_start=13394 + _RESTARTTRANSFER._serialized_end=13558 + _REPLICA._serialized_start=13560 + _REPLICA._serialized_end=13604 + _CREATESHARDKEY._serialized_start=13607 + _CREATESHARDKEY._serialized_end=13781 + _DELETESHARDKEY._serialized_start=13783 + _DELETESHARDKEY._serialized_end=13836 + _UPDATECOLLECTIONCLUSTERSETUPREQUEST._serialized_start=13839 + _UPDATECOLLECTIONCLUSTERSETUPREQUEST._serialized_end=14292 + _UPDATECOLLECTIONCLUSTERSETUPRESPONSE._serialized_start=14294 + _UPDATECOLLECTIONCLUSTERSETUPRESPONSE._serialized_end=14348 + _CREATESHARDKEYREQUEST._serialized_start=14350 + _CREATESHARDKEYREQUEST._serialized_end=14473 + _DELETESHARDKEYREQUEST._serialized_start=14475 + _DELETESHARDKEYREQUEST._serialized_end=14598 + _CREATESHARDKEYRESPONSE._serialized_start=14600 + _CREATESHARDKEYRESPONSE._serialized_end=14640 + _DELETESHARDKEYRESPONSE._serialized_start=14642 + _DELETESHARDKEYRESPONSE._serialized_end=14682 +# @@protoc_insertion_point(module_scope) diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/grpc/collections_pb2_grpc.py b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/grpc/collections_pb2_grpc.py new file mode 100644 index 0000000000000000000000000000000000000000..2daafffebfc817aefe8fcb96eaec25e65b3903e8 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/grpc/collections_pb2_grpc.py @@ -0,0 +1,4 @@ +# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! +"""Client and server classes corresponding to protobuf-defined services.""" +import grpc + diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/grpc/collections_service_pb2.py b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/grpc/collections_service_pb2.py new file mode 100644 index 0000000000000000000000000000000000000000..d54f141e033d998b592d52bfe56ecf5a589eee24 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/grpc/collections_service_pb2.py @@ -0,0 +1,29 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: collections_service.proto +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import message as _message +from google.protobuf import reflection as _reflection +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from . import collections_pb2 as collections__pb2 + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x19\x63ollections_service.proto\x12\x06qdrant\x1a\x11\x63ollections.proto2\xe2\x08\n\x0b\x43ollections\x12L\n\x03Get\x12 .qdrant.GetCollectionInfoRequest\x1a!.qdrant.GetCollectionInfoResponse\"\x00\x12I\n\x04List\x12\x1e.qdrant.ListCollectionsRequest\x1a\x1f.qdrant.ListCollectionsResponse\"\x00\x12I\n\x06\x43reate\x12\x18.qdrant.CreateCollection\x1a#.qdrant.CollectionOperationResponse\"\x00\x12I\n\x06Update\x12\x18.qdrant.UpdateCollection\x1a#.qdrant.CollectionOperationResponse\"\x00\x12I\n\x06\x44\x65lete\x12\x18.qdrant.DeleteCollection\x1a#.qdrant.CollectionOperationResponse\"\x00\x12M\n\rUpdateAliases\x12\x15.qdrant.ChangeAliases\x1a#.qdrant.CollectionOperationResponse\"\x00\x12\\\n\x15ListCollectionAliases\x12$.qdrant.ListCollectionAliasesRequest\x1a\x1b.qdrant.ListAliasesResponse\"\x00\x12H\n\x0bListAliases\x12\x1a.qdrant.ListAliasesRequest\x1a\x1b.qdrant.ListAliasesResponse\"\x00\x12\x66\n\x15\x43ollectionClusterInfo\x12$.qdrant.CollectionClusterInfoRequest\x1a%.qdrant.CollectionClusterInfoResponse\"\x00\x12W\n\x10\x43ollectionExists\x12\x1f.qdrant.CollectionExistsRequest\x1a .qdrant.CollectionExistsResponse\"\x00\x12{\n\x1cUpdateCollectionClusterSetup\x12+.qdrant.UpdateCollectionClusterSetupRequest\x1a,.qdrant.UpdateCollectionClusterSetupResponse\"\x00\x12Q\n\x0e\x43reateShardKey\x12\x1d.qdrant.CreateShardKeyRequest\x1a\x1e.qdrant.CreateShardKeyResponse\"\x00\x12Q\n\x0e\x44\x65leteShardKey\x12\x1d.qdrant.DeleteShardKeyRequest\x1a\x1e.qdrant.DeleteShardKeyResponse\"\x00\x42\x15\xaa\x02\x12Qdrant.Client.Grpcb\x06proto3') + + + +_COLLECTIONS = DESCRIPTOR.services_by_name['Collections'] +if _descriptor._USE_C_DESCRIPTORS == False: + + DESCRIPTOR._options = None + DESCRIPTOR._serialized_options = b'\252\002\022Qdrant.Client.Grpc' + _COLLECTIONS._serialized_start=57 + _COLLECTIONS._serialized_end=1179 +# @@protoc_insertion_point(module_scope) diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/grpc/collections_service_pb2_grpc.py b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/grpc/collections_service_pb2_grpc.py new file mode 100644 index 0000000000000000000000000000000000000000..7f546d41a209a08939639fd723b1b729493cec8f --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/grpc/collections_service_pb2_grpc.py @@ -0,0 +1,488 @@ +# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! +"""Client and server classes corresponding to protobuf-defined services.""" +import grpc + +from . import collections_pb2 as collections__pb2 + + +class CollectionsStub(object): + """Missing associated documentation comment in .proto file.""" + + def __init__(self, channel): + """Constructor. + + Args: + channel: A grpc.Channel. + """ + self.Get = channel.unary_unary( + '/qdrant.Collections/Get', + request_serializer=collections__pb2.GetCollectionInfoRequest.SerializeToString, + response_deserializer=collections__pb2.GetCollectionInfoResponse.FromString, + ) + self.List = channel.unary_unary( + '/qdrant.Collections/List', + request_serializer=collections__pb2.ListCollectionsRequest.SerializeToString, + response_deserializer=collections__pb2.ListCollectionsResponse.FromString, + ) + self.Create = channel.unary_unary( + '/qdrant.Collections/Create', + request_serializer=collections__pb2.CreateCollection.SerializeToString, + response_deserializer=collections__pb2.CollectionOperationResponse.FromString, + ) + self.Update = channel.unary_unary( + '/qdrant.Collections/Update', + request_serializer=collections__pb2.UpdateCollection.SerializeToString, + response_deserializer=collections__pb2.CollectionOperationResponse.FromString, + ) + self.Delete = channel.unary_unary( + '/qdrant.Collections/Delete', + request_serializer=collections__pb2.DeleteCollection.SerializeToString, + response_deserializer=collections__pb2.CollectionOperationResponse.FromString, + ) + self.UpdateAliases = channel.unary_unary( + '/qdrant.Collections/UpdateAliases', + request_serializer=collections__pb2.ChangeAliases.SerializeToString, + response_deserializer=collections__pb2.CollectionOperationResponse.FromString, + ) + self.ListCollectionAliases = channel.unary_unary( + '/qdrant.Collections/ListCollectionAliases', + request_serializer=collections__pb2.ListCollectionAliasesRequest.SerializeToString, + response_deserializer=collections__pb2.ListAliasesResponse.FromString, + ) + self.ListAliases = channel.unary_unary( + '/qdrant.Collections/ListAliases', + request_serializer=collections__pb2.ListAliasesRequest.SerializeToString, + response_deserializer=collections__pb2.ListAliasesResponse.FromString, + ) + self.CollectionClusterInfo = channel.unary_unary( + '/qdrant.Collections/CollectionClusterInfo', + request_serializer=collections__pb2.CollectionClusterInfoRequest.SerializeToString, + response_deserializer=collections__pb2.CollectionClusterInfoResponse.FromString, + ) + self.CollectionExists = channel.unary_unary( + '/qdrant.Collections/CollectionExists', + request_serializer=collections__pb2.CollectionExistsRequest.SerializeToString, + response_deserializer=collections__pb2.CollectionExistsResponse.FromString, + ) + self.UpdateCollectionClusterSetup = channel.unary_unary( + '/qdrant.Collections/UpdateCollectionClusterSetup', + request_serializer=collections__pb2.UpdateCollectionClusterSetupRequest.SerializeToString, + response_deserializer=collections__pb2.UpdateCollectionClusterSetupResponse.FromString, + ) + self.CreateShardKey = channel.unary_unary( + '/qdrant.Collections/CreateShardKey', + request_serializer=collections__pb2.CreateShardKeyRequest.SerializeToString, + response_deserializer=collections__pb2.CreateShardKeyResponse.FromString, + ) + self.DeleteShardKey = channel.unary_unary( + '/qdrant.Collections/DeleteShardKey', + request_serializer=collections__pb2.DeleteShardKeyRequest.SerializeToString, + response_deserializer=collections__pb2.DeleteShardKeyResponse.FromString, + ) + + +class CollectionsServicer(object): + """Missing associated documentation comment in .proto file.""" + + def Get(self, request, context): + """ + Get detailed information about specified existing collection + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def List(self, request, context): + """ + Get list name of all existing collections + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def Create(self, request, context): + """ + Create new collection with given parameters + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def Update(self, request, context): + """ + Update parameters of the existing collection + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def Delete(self, request, context): + """ + Drop collection and all associated data + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def UpdateAliases(self, request, context): + """ + Update Aliases of the existing collection + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def ListCollectionAliases(self, request, context): + """ + Get list of all aliases for a collection + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def ListAliases(self, request, context): + """ + Get list of all aliases for all existing collections + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def CollectionClusterInfo(self, request, context): + """ + Get cluster information for a collection + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def CollectionExists(self, request, context): + """ + Check the existence of a collection + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def UpdateCollectionClusterSetup(self, request, context): + """ + Update cluster setup for a collection + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def CreateShardKey(self, request, context): + """ + Create shard key + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def DeleteShardKey(self, request, context): + """ + Delete shard key + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + +def add_CollectionsServicer_to_server(servicer, server): + rpc_method_handlers = { + 'Get': grpc.unary_unary_rpc_method_handler( + servicer.Get, + request_deserializer=collections__pb2.GetCollectionInfoRequest.FromString, + response_serializer=collections__pb2.GetCollectionInfoResponse.SerializeToString, + ), + 'List': grpc.unary_unary_rpc_method_handler( + servicer.List, + request_deserializer=collections__pb2.ListCollectionsRequest.FromString, + response_serializer=collections__pb2.ListCollectionsResponse.SerializeToString, + ), + 'Create': grpc.unary_unary_rpc_method_handler( + servicer.Create, + request_deserializer=collections__pb2.CreateCollection.FromString, + response_serializer=collections__pb2.CollectionOperationResponse.SerializeToString, + ), + 'Update': grpc.unary_unary_rpc_method_handler( + servicer.Update, + request_deserializer=collections__pb2.UpdateCollection.FromString, + response_serializer=collections__pb2.CollectionOperationResponse.SerializeToString, + ), + 'Delete': grpc.unary_unary_rpc_method_handler( + servicer.Delete, + request_deserializer=collections__pb2.DeleteCollection.FromString, + response_serializer=collections__pb2.CollectionOperationResponse.SerializeToString, + ), + 'UpdateAliases': grpc.unary_unary_rpc_method_handler( + servicer.UpdateAliases, + request_deserializer=collections__pb2.ChangeAliases.FromString, + response_serializer=collections__pb2.CollectionOperationResponse.SerializeToString, + ), + 'ListCollectionAliases': grpc.unary_unary_rpc_method_handler( + servicer.ListCollectionAliases, + request_deserializer=collections__pb2.ListCollectionAliasesRequest.FromString, + response_serializer=collections__pb2.ListAliasesResponse.SerializeToString, + ), + 'ListAliases': grpc.unary_unary_rpc_method_handler( + servicer.ListAliases, + request_deserializer=collections__pb2.ListAliasesRequest.FromString, + response_serializer=collections__pb2.ListAliasesResponse.SerializeToString, + ), + 'CollectionClusterInfo': grpc.unary_unary_rpc_method_handler( + servicer.CollectionClusterInfo, + request_deserializer=collections__pb2.CollectionClusterInfoRequest.FromString, + response_serializer=collections__pb2.CollectionClusterInfoResponse.SerializeToString, + ), + 'CollectionExists': grpc.unary_unary_rpc_method_handler( + servicer.CollectionExists, + request_deserializer=collections__pb2.CollectionExistsRequest.FromString, + response_serializer=collections__pb2.CollectionExistsResponse.SerializeToString, + ), + 'UpdateCollectionClusterSetup': grpc.unary_unary_rpc_method_handler( + servicer.UpdateCollectionClusterSetup, + request_deserializer=collections__pb2.UpdateCollectionClusterSetupRequest.FromString, + response_serializer=collections__pb2.UpdateCollectionClusterSetupResponse.SerializeToString, + ), + 'CreateShardKey': grpc.unary_unary_rpc_method_handler( + servicer.CreateShardKey, + request_deserializer=collections__pb2.CreateShardKeyRequest.FromString, + response_serializer=collections__pb2.CreateShardKeyResponse.SerializeToString, + ), + 'DeleteShardKey': grpc.unary_unary_rpc_method_handler( + servicer.DeleteShardKey, + request_deserializer=collections__pb2.DeleteShardKeyRequest.FromString, + response_serializer=collections__pb2.DeleteShardKeyResponse.SerializeToString, + ), + } + generic_handler = grpc.method_handlers_generic_handler( + 'qdrant.Collections', rpc_method_handlers) + server.add_generic_rpc_handlers((generic_handler,)) + + + # This class is part of an EXPERIMENTAL API. +class Collections(object): + """Missing associated documentation comment in .proto file.""" + + @staticmethod + def Get(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary(request, target, '/qdrant.Collections/Get', + collections__pb2.GetCollectionInfoRequest.SerializeToString, + collections__pb2.GetCollectionInfoResponse.FromString, + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + + @staticmethod + def List(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary(request, target, '/qdrant.Collections/List', + collections__pb2.ListCollectionsRequest.SerializeToString, + collections__pb2.ListCollectionsResponse.FromString, + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + + @staticmethod + def Create(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary(request, target, '/qdrant.Collections/Create', + collections__pb2.CreateCollection.SerializeToString, + collections__pb2.CollectionOperationResponse.FromString, + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + + @staticmethod + def Update(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary(request, target, '/qdrant.Collections/Update', + collections__pb2.UpdateCollection.SerializeToString, + collections__pb2.CollectionOperationResponse.FromString, + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + + @staticmethod + def Delete(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary(request, target, '/qdrant.Collections/Delete', + collections__pb2.DeleteCollection.SerializeToString, + collections__pb2.CollectionOperationResponse.FromString, + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + + @staticmethod + def UpdateAliases(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary(request, target, '/qdrant.Collections/UpdateAliases', + collections__pb2.ChangeAliases.SerializeToString, + collections__pb2.CollectionOperationResponse.FromString, + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + + @staticmethod + def ListCollectionAliases(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary(request, target, '/qdrant.Collections/ListCollectionAliases', + collections__pb2.ListCollectionAliasesRequest.SerializeToString, + collections__pb2.ListAliasesResponse.FromString, + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + + @staticmethod + def ListAliases(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary(request, target, '/qdrant.Collections/ListAliases', + collections__pb2.ListAliasesRequest.SerializeToString, + collections__pb2.ListAliasesResponse.FromString, + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + + @staticmethod + def CollectionClusterInfo(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary(request, target, '/qdrant.Collections/CollectionClusterInfo', + collections__pb2.CollectionClusterInfoRequest.SerializeToString, + collections__pb2.CollectionClusterInfoResponse.FromString, + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + + @staticmethod + def CollectionExists(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary(request, target, '/qdrant.Collections/CollectionExists', + collections__pb2.CollectionExistsRequest.SerializeToString, + collections__pb2.CollectionExistsResponse.FromString, + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + + @staticmethod + def UpdateCollectionClusterSetup(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary(request, target, '/qdrant.Collections/UpdateCollectionClusterSetup', + collections__pb2.UpdateCollectionClusterSetupRequest.SerializeToString, + collections__pb2.UpdateCollectionClusterSetupResponse.FromString, + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + + @staticmethod + def CreateShardKey(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary(request, target, '/qdrant.Collections/CreateShardKey', + collections__pb2.CreateShardKeyRequest.SerializeToString, + collections__pb2.CreateShardKeyResponse.FromString, + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + + @staticmethod + def DeleteShardKey(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary(request, target, '/qdrant.Collections/DeleteShardKey', + collections__pb2.DeleteShardKeyRequest.SerializeToString, + collections__pb2.DeleteShardKeyResponse.FromString, + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/grpc/json_with_int_pb2.py b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/grpc/json_with_int_pb2.py new file mode 100644 index 0000000000000000000000000000000000000000..d7d5f5b654aea9facbf4339e191444f965e0f07b --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/grpc/json_with_int_pb2.py @@ -0,0 +1,74 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: json_with_int.proto +"""Generated protocol buffer code.""" +from google.protobuf.internal import enum_type_wrapper +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import message as _message +from google.protobuf import reflection as _reflection +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x13json_with_int.proto\x12\x06qdrant\"r\n\x06Struct\x12*\n\x06\x66ields\x18\x01 \x03(\x0b\x32\x1a.qdrant.Struct.FieldsEntry\x1a<\n\x0b\x46ieldsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x1c\n\x05value\x18\x02 \x01(\x0b\x32\r.qdrant.Value:\x02\x38\x01\"\xe8\x01\n\x05Value\x12\'\n\nnull_value\x18\x01 \x01(\x0e\x32\x11.qdrant.NullValueH\x00\x12\x16\n\x0c\x64ouble_value\x18\x02 \x01(\x01H\x00\x12\x17\n\rinteger_value\x18\x03 \x01(\x03H\x00\x12\x16\n\x0cstring_value\x18\x04 \x01(\tH\x00\x12\x14\n\nbool_value\x18\x05 \x01(\x08H\x00\x12&\n\x0cstruct_value\x18\x06 \x01(\x0b\x32\x0e.qdrant.StructH\x00\x12\'\n\nlist_value\x18\x07 \x01(\x0b\x32\x11.qdrant.ListValueH\x00\x42\x06\n\x04kind\"*\n\tListValue\x12\x1d\n\x06values\x18\x01 \x03(\x0b\x32\r.qdrant.Value*\x1b\n\tNullValue\x12\x0e\n\nNULL_VALUE\x10\x00\x42\x15\xaa\x02\x12Qdrant.Client.Grpcb\x06proto3') + +_NULLVALUE = DESCRIPTOR.enum_types_by_name['NullValue'] +NullValue = enum_type_wrapper.EnumTypeWrapper(_NULLVALUE) +NULL_VALUE = 0 + + +_STRUCT = DESCRIPTOR.message_types_by_name['Struct'] +_STRUCT_FIELDSENTRY = _STRUCT.nested_types_by_name['FieldsEntry'] +_VALUE = DESCRIPTOR.message_types_by_name['Value'] +_LISTVALUE = DESCRIPTOR.message_types_by_name['ListValue'] +Struct = _reflection.GeneratedProtocolMessageType('Struct', (_message.Message,), { + + 'FieldsEntry' : _reflection.GeneratedProtocolMessageType('FieldsEntry', (_message.Message,), { + 'DESCRIPTOR' : _STRUCT_FIELDSENTRY, + '__module__' : 'json_with_int_pb2' + # @@protoc_insertion_point(class_scope:qdrant.Struct.FieldsEntry) + }) + , + 'DESCRIPTOR' : _STRUCT, + '__module__' : 'json_with_int_pb2' + # @@protoc_insertion_point(class_scope:qdrant.Struct) + }) +_sym_db.RegisterMessage(Struct) +_sym_db.RegisterMessage(Struct.FieldsEntry) + +Value = _reflection.GeneratedProtocolMessageType('Value', (_message.Message,), { + 'DESCRIPTOR' : _VALUE, + '__module__' : 'json_with_int_pb2' + # @@protoc_insertion_point(class_scope:qdrant.Value) + }) +_sym_db.RegisterMessage(Value) + +ListValue = _reflection.GeneratedProtocolMessageType('ListValue', (_message.Message,), { + 'DESCRIPTOR' : _LISTVALUE, + '__module__' : 'json_with_int_pb2' + # @@protoc_insertion_point(class_scope:qdrant.ListValue) + }) +_sym_db.RegisterMessage(ListValue) + +if _descriptor._USE_C_DESCRIPTORS == False: + + DESCRIPTOR._options = None + DESCRIPTOR._serialized_options = b'\252\002\022Qdrant.Client.Grpc' + _STRUCT_FIELDSENTRY._options = None + _STRUCT_FIELDSENTRY._serialized_options = b'8\001' + _NULLVALUE._serialized_start=426 + _NULLVALUE._serialized_end=453 + _STRUCT._serialized_start=31 + _STRUCT._serialized_end=145 + _STRUCT_FIELDSENTRY._serialized_start=85 + _STRUCT_FIELDSENTRY._serialized_end=145 + _VALUE._serialized_start=148 + _VALUE._serialized_end=380 + _LISTVALUE._serialized_start=382 + _LISTVALUE._serialized_end=424 +# @@protoc_insertion_point(module_scope) diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/grpc/json_with_int_pb2_grpc.py b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/grpc/json_with_int_pb2_grpc.py new file mode 100644 index 0000000000000000000000000000000000000000..2daafffebfc817aefe8fcb96eaec25e65b3903e8 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/grpc/json_with_int_pb2_grpc.py @@ -0,0 +1,4 @@ +# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! +"""Client and server classes corresponding to protobuf-defined services.""" +import grpc + diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/grpc/points_pb2.py b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/grpc/points_pb2.py new file mode 100644 index 0000000000000000000000000000000000000000..33ef2d9493d694d3850ca80062f2e035901760a6 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/grpc/points_pb2.py @@ -0,0 +1,1708 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: points.proto +"""Generated protocol buffer code.""" +from google.protobuf.internal import enum_type_wrapper +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import message as _message +from google.protobuf import reflection as _reflection +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from . import collections_pb2 as collections__pb2 +from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2 +from . import json_with_int_pb2 as json__with__int__pb2 + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x0cpoints.proto\x12\x06qdrant\x1a\x11\x63ollections.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x13json_with_int.proto\"8\n\rWriteOrdering\x12\'\n\x04type\x18\x01 \x01(\x0e\x32\x19.qdrant.WriteOrderingType\"Y\n\x0fReadConsistency\x12+\n\x04type\x18\x01 \x01(\x0e\x32\x1b.qdrant.ReadConsistencyTypeH\x00\x12\x10\n\x06\x66\x61\x63tor\x18\x02 \x01(\x04H\x00\x42\x07\n\x05value\"<\n\x07PointId\x12\r\n\x03num\x18\x01 \x01(\x04H\x00\x12\x0e\n\x04uuid\x18\x02 \x01(\tH\x00\x42\x12\n\x10point_id_options\"\x1d\n\rSparseIndices\x12\x0c\n\x04\x64\x61ta\x18\x01 \x03(\r\"\x96\x01\n\x08\x44ocument\x12\x0c\n\x04text\x18\x01 \x01(\t\x12\r\n\x05model\x18\x03 \x01(\t\x12.\n\x07options\x18\x04 \x03(\x0b\x32\x1d.qdrant.Document.OptionsEntry\x1a=\n\x0cOptionsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x1c\n\x05value\x18\x02 \x01(\x0b\x32\r.qdrant.Value:\x02\x38\x01\"\xa0\x01\n\x05Image\x12\x1c\n\x05image\x18\x01 \x01(\x0b\x32\r.qdrant.Value\x12\r\n\x05model\x18\x02 \x01(\t\x12+\n\x07options\x18\x03 \x03(\x0b\x32\x1a.qdrant.Image.OptionsEntry\x1a=\n\x0cOptionsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x1c\n\x05value\x18\x02 \x01(\x0b\x32\r.qdrant.Value:\x02\x38\x01\"\xb5\x01\n\x0fInferenceObject\x12\x1d\n\x06object\x18\x01 \x01(\x0b\x32\r.qdrant.Value\x12\r\n\x05model\x18\x02 \x01(\t\x12\x35\n\x07options\x18\x03 \x03(\x0b\x32$.qdrant.InferenceObject.OptionsEntry\x1a=\n\x0cOptionsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x1c\n\x05value\x18\x02 \x01(\x0b\x32\r.qdrant.Value:\x02\x38\x01\"\xf7\x02\n\x06Vector\x12\x0c\n\x04\x64\x61ta\x18\x01 \x03(\x02\x12+\n\x07indices\x18\x02 \x01(\x0b\x32\x15.qdrant.SparseIndicesH\x01\x88\x01\x01\x12\x1a\n\rvectors_count\x18\x03 \x01(\rH\x02\x88\x01\x01\x12$\n\x05\x64\x65nse\x18\x65 \x01(\x0b\x32\x13.qdrant.DenseVectorH\x00\x12&\n\x06sparse\x18\x66 \x01(\x0b\x32\x14.qdrant.SparseVectorH\x00\x12/\n\x0bmulti_dense\x18g \x01(\x0b\x32\x18.qdrant.MultiDenseVectorH\x00\x12$\n\x08\x64ocument\x18h \x01(\x0b\x32\x10.qdrant.DocumentH\x00\x12\x1e\n\x05image\x18i \x01(\x0b\x32\r.qdrant.ImageH\x00\x12)\n\x06object\x18j \x01(\x0b\x32\x17.qdrant.InferenceObjectH\x00\x42\x08\n\x06vectorB\n\n\x08_indicesB\x10\n\x0e_vectors_count\"\x8c\x02\n\x0cVectorOutput\x12\x0c\n\x04\x64\x61ta\x18\x01 \x03(\x02\x12+\n\x07indices\x18\x02 \x01(\x0b\x32\x15.qdrant.SparseIndicesH\x01\x88\x01\x01\x12\x1a\n\rvectors_count\x18\x03 \x01(\rH\x02\x88\x01\x01\x12$\n\x05\x64\x65nse\x18\x65 \x01(\x0b\x32\x13.qdrant.DenseVectorH\x00\x12&\n\x06sparse\x18\x66 \x01(\x0b\x32\x14.qdrant.SparseVectorH\x00\x12/\n\x0bmulti_dense\x18g \x01(\x0b\x32\x18.qdrant.MultiDenseVectorH\x00\x42\x08\n\x06vectorB\n\n\x08_indicesB\x10\n\x0e_vectors_count\"\x1b\n\x0b\x44\x65nseVector\x12\x0c\n\x04\x64\x61ta\x18\x01 \x03(\x02\"/\n\x0cSparseVector\x12\x0e\n\x06values\x18\x01 \x03(\x02\x12\x0f\n\x07indices\x18\x02 \x03(\r\"8\n\x10MultiDenseVector\x12$\n\x07vectors\x18\x01 \x03(\x0b\x32\x13.qdrant.DenseVector\"\xa7\x02\n\x0bVectorInput\x12\x1d\n\x02id\x18\x01 \x01(\x0b\x32\x0f.qdrant.PointIdH\x00\x12$\n\x05\x64\x65nse\x18\x02 \x01(\x0b\x32\x13.qdrant.DenseVectorH\x00\x12&\n\x06sparse\x18\x03 \x01(\x0b\x32\x14.qdrant.SparseVectorH\x00\x12/\n\x0bmulti_dense\x18\x04 \x01(\x0b\x32\x18.qdrant.MultiDenseVectorH\x00\x12$\n\x08\x64ocument\x18\x05 \x01(\x0b\x32\x10.qdrant.DocumentH\x00\x12\x1e\n\x05image\x18\x06 \x01(\x0b\x32\r.qdrant.ImageH\x00\x12)\n\x06object\x18\x07 \x01(\x0b\x32\x17.qdrant.InferenceObjectH\x00\x42\t\n\x07variant\"8\n\x10ShardKeySelector\x12$\n\nshard_keys\x18\x01 \x03(\x0b\x32\x10.qdrant.ShardKey\"\xf5\x01\n\x0cUpsertPoints\x12\x17\n\x0f\x63ollection_name\x18\x01 \x01(\t\x12\x11\n\x04wait\x18\x02 \x01(\x08H\x00\x88\x01\x01\x12#\n\x06points\x18\x03 \x03(\x0b\x32\x13.qdrant.PointStruct\x12,\n\x08ordering\x18\x04 \x01(\x0b\x32\x15.qdrant.WriteOrderingH\x01\x88\x01\x01\x12\x39\n\x12shard_key_selector\x18\x05 \x01(\x0b\x32\x18.qdrant.ShardKeySelectorH\x02\x88\x01\x01\x42\x07\n\x05_waitB\x0b\n\t_orderingB\x15\n\x13_shard_key_selector\"\xf8\x01\n\x0c\x44\x65letePoints\x12\x17\n\x0f\x63ollection_name\x18\x01 \x01(\t\x12\x11\n\x04wait\x18\x02 \x01(\x08H\x00\x88\x01\x01\x12&\n\x06points\x18\x03 \x01(\x0b\x32\x16.qdrant.PointsSelector\x12,\n\x08ordering\x18\x04 \x01(\x0b\x32\x15.qdrant.WriteOrderingH\x01\x88\x01\x01\x12\x39\n\x12shard_key_selector\x18\x05 \x01(\x0b\x32\x18.qdrant.ShardKeySelectorH\x02\x88\x01\x01\x42\x07\n\x05_waitB\x0b\n\t_orderingB\x15\n\x13_shard_key_selector\"\x85\x03\n\tGetPoints\x12\x17\n\x0f\x63ollection_name\x18\x01 \x01(\t\x12\x1c\n\x03ids\x18\x02 \x03(\x0b\x32\x0f.qdrant.PointId\x12\x31\n\x0cwith_payload\x18\x04 \x01(\x0b\x32\x1b.qdrant.WithPayloadSelector\x12\x36\n\x0cwith_vectors\x18\x05 \x01(\x0b\x32\x1b.qdrant.WithVectorsSelectorH\x00\x88\x01\x01\x12\x36\n\x10read_consistency\x18\x06 \x01(\x0b\x32\x17.qdrant.ReadConsistencyH\x01\x88\x01\x01\x12\x39\n\x12shard_key_selector\x18\x07 \x01(\x0b\x32\x18.qdrant.ShardKeySelectorH\x02\x88\x01\x01\x12\x14\n\x07timeout\x18\x08 \x01(\x04H\x03\x88\x01\x01\x42\x0f\n\r_with_vectorsB\x13\n\x11_read_consistencyB\x15\n\x13_shard_key_selectorB\n\n\x08_timeoutJ\x04\x08\x03\x10\x04\"\xfc\x01\n\x12UpdatePointVectors\x12\x17\n\x0f\x63ollection_name\x18\x01 \x01(\t\x12\x11\n\x04wait\x18\x02 \x01(\x08H\x00\x88\x01\x01\x12$\n\x06points\x18\x03 \x03(\x0b\x32\x14.qdrant.PointVectors\x12,\n\x08ordering\x18\x04 \x01(\x0b\x32\x15.qdrant.WriteOrderingH\x01\x88\x01\x01\x12\x39\n\x12shard_key_selector\x18\x05 \x01(\x0b\x32\x18.qdrant.ShardKeySelectorH\x02\x88\x01\x01\x42\x07\n\x05_waitB\x0b\n\t_orderingB\x15\n\x13_shard_key_selector\"M\n\x0cPointVectors\x12\x1b\n\x02id\x18\x01 \x01(\x0b\x32\x0f.qdrant.PointId\x12 \n\x07vectors\x18\x02 \x01(\x0b\x32\x0f.qdrant.Vectors\"\xb1\x02\n\x12\x44\x65letePointVectors\x12\x17\n\x0f\x63ollection_name\x18\x01 \x01(\t\x12\x11\n\x04wait\x18\x02 \x01(\x08H\x00\x88\x01\x01\x12/\n\x0fpoints_selector\x18\x03 \x01(\x0b\x32\x16.qdrant.PointsSelector\x12(\n\x07vectors\x18\x04 \x01(\x0b\x32\x17.qdrant.VectorsSelector\x12,\n\x08ordering\x18\x05 \x01(\x0b\x32\x15.qdrant.WriteOrderingH\x01\x88\x01\x01\x12\x39\n\x12shard_key_selector\x18\x06 \x01(\x0b\x32\x18.qdrant.ShardKeySelectorH\x02\x88\x01\x01\x42\x07\n\x05_waitB\x0b\n\t_orderingB\x15\n\x13_shard_key_selector\"\xb5\x03\n\x10SetPayloadPoints\x12\x17\n\x0f\x63ollection_name\x18\x01 \x01(\t\x12\x11\n\x04wait\x18\x02 \x01(\x08H\x00\x88\x01\x01\x12\x36\n\x07payload\x18\x03 \x03(\x0b\x32%.qdrant.SetPayloadPoints.PayloadEntry\x12\x34\n\x0fpoints_selector\x18\x05 \x01(\x0b\x32\x16.qdrant.PointsSelectorH\x01\x88\x01\x01\x12,\n\x08ordering\x18\x06 \x01(\x0b\x32\x15.qdrant.WriteOrderingH\x02\x88\x01\x01\x12\x39\n\x12shard_key_selector\x18\x07 \x01(\x0b\x32\x18.qdrant.ShardKeySelectorH\x03\x88\x01\x01\x12\x10\n\x03key\x18\x08 \x01(\tH\x04\x88\x01\x01\x1a=\n\x0cPayloadEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x1c\n\x05value\x18\x02 \x01(\x0b\x32\r.qdrant.Value:\x02\x38\x01\x42\x07\n\x05_waitB\x12\n\x10_points_selectorB\x0b\n\t_orderingB\x15\n\x13_shard_key_selectorB\x06\n\x04_keyJ\x04\x08\x04\x10\x05\"\xb5\x02\n\x13\x44\x65letePayloadPoints\x12\x17\n\x0f\x63ollection_name\x18\x01 \x01(\t\x12\x11\n\x04wait\x18\x02 \x01(\x08H\x00\x88\x01\x01\x12\x0c\n\x04keys\x18\x03 \x03(\t\x12\x34\n\x0fpoints_selector\x18\x05 \x01(\x0b\x32\x16.qdrant.PointsSelectorH\x01\x88\x01\x01\x12,\n\x08ordering\x18\x06 \x01(\x0b\x32\x15.qdrant.WriteOrderingH\x02\x88\x01\x01\x12\x39\n\x12shard_key_selector\x18\x07 \x01(\x0b\x32\x18.qdrant.ShardKeySelectorH\x03\x88\x01\x01\x42\x07\n\x05_waitB\x12\n\x10_points_selectorB\x0b\n\t_orderingB\x15\n\x13_shard_key_selectorJ\x04\x08\x04\x10\x05\"\xfe\x01\n\x12\x43learPayloadPoints\x12\x17\n\x0f\x63ollection_name\x18\x01 \x01(\t\x12\x11\n\x04wait\x18\x02 \x01(\x08H\x00\x88\x01\x01\x12&\n\x06points\x18\x03 \x01(\x0b\x32\x16.qdrant.PointsSelector\x12,\n\x08ordering\x18\x04 \x01(\x0b\x32\x15.qdrant.WriteOrderingH\x01\x88\x01\x01\x12\x39\n\x12shard_key_selector\x18\x05 \x01(\x0b\x32\x18.qdrant.ShardKeySelectorH\x02\x88\x01\x01\x42\x07\n\x05_waitB\x0b\n\t_orderingB\x15\n\x13_shard_key_selector\"\xaf\x02\n\x1a\x43reateFieldIndexCollection\x12\x17\n\x0f\x63ollection_name\x18\x01 \x01(\t\x12\x11\n\x04wait\x18\x02 \x01(\x08H\x00\x88\x01\x01\x12\x12\n\nfield_name\x18\x03 \x01(\t\x12*\n\nfield_type\x18\x04 \x01(\x0e\x32\x11.qdrant.FieldTypeH\x01\x88\x01\x01\x12;\n\x12\x66ield_index_params\x18\x05 \x01(\x0b\x32\x1a.qdrant.PayloadIndexParamsH\x02\x88\x01\x01\x12,\n\x08ordering\x18\x06 \x01(\x0b\x32\x15.qdrant.WriteOrderingH\x03\x88\x01\x01\x42\x07\n\x05_waitB\r\n\x0b_field_typeB\x15\n\x13_field_index_paramsB\x0b\n\t_ordering\"\xa0\x01\n\x1a\x44\x65leteFieldIndexCollection\x12\x17\n\x0f\x63ollection_name\x18\x01 \x01(\t\x12\x11\n\x04wait\x18\x02 \x01(\x08H\x00\x88\x01\x01\x12\x12\n\nfield_name\x18\x03 \x01(\t\x12,\n\x08ordering\x18\x04 \x01(\x0b\x32\x15.qdrant.WriteOrderingH\x01\x88\x01\x01\x42\x07\n\x05_waitB\x0b\n\t_ordering\"(\n\x16PayloadIncludeSelector\x12\x0e\n\x06\x66ields\x18\x01 \x03(\t\"(\n\x16PayloadExcludeSelector\x12\x0e\n\x06\x66ields\x18\x01 \x03(\t\"\xa1\x01\n\x13WithPayloadSelector\x12\x10\n\x06\x65nable\x18\x01 \x01(\x08H\x00\x12\x31\n\x07include\x18\x02 \x01(\x0b\x32\x1e.qdrant.PayloadIncludeSelectorH\x00\x12\x31\n\x07\x65xclude\x18\x03 \x01(\x0b\x32\x1e.qdrant.PayloadExcludeSelectorH\x00\x42\x12\n\x10selector_options\"\x82\x01\n\x0cNamedVectors\x12\x32\n\x07vectors\x18\x01 \x03(\x0b\x32!.qdrant.NamedVectors.VectorsEntry\x1a>\n\x0cVectorsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x1d\n\x05value\x18\x02 \x01(\x0b\x32\x0e.qdrant.Vector:\x02\x38\x01\"\x94\x01\n\x12NamedVectorsOutput\x12\x38\n\x07vectors\x18\x01 \x03(\x0b\x32\'.qdrant.NamedVectorsOutput.VectorsEntry\x1a\x44\n\x0cVectorsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12#\n\x05value\x18\x02 \x01(\x0b\x32\x14.qdrant.VectorOutput:\x02\x38\x01\"g\n\x07Vectors\x12 \n\x06vector\x18\x01 \x01(\x0b\x32\x0e.qdrant.VectorH\x00\x12\'\n\x07vectors\x18\x02 \x01(\x0b\x32\x14.qdrant.NamedVectorsH\x00\x42\x11\n\x0fvectors_options\"y\n\rVectorsOutput\x12&\n\x06vector\x18\x01 \x01(\x0b\x32\x14.qdrant.VectorOutputH\x00\x12-\n\x07vectors\x18\x02 \x01(\x0b\x32\x1a.qdrant.NamedVectorsOutputH\x00\x42\x11\n\x0fvectors_options\" \n\x0fVectorsSelector\x12\r\n\x05names\x18\x01 \x03(\t\"g\n\x13WithVectorsSelector\x12\x10\n\x06\x65nable\x18\x01 \x01(\x08H\x00\x12*\n\x07include\x18\x02 \x01(\x0b\x32\x17.qdrant.VectorsSelectorH\x00\x42\x12\n\x10selector_options\"\x88\x01\n\x18QuantizationSearchParams\x12\x13\n\x06ignore\x18\x01 \x01(\x08H\x00\x88\x01\x01\x12\x14\n\x07rescore\x18\x02 \x01(\x08H\x01\x88\x01\x01\x12\x19\n\x0coversampling\x18\x03 \x01(\x01H\x02\x88\x01\x01\x42\t\n\x07_ignoreB\n\n\x08_rescoreB\x0f\n\r_oversampling\"\xc8\x01\n\x0cSearchParams\x12\x14\n\x07hnsw_ef\x18\x01 \x01(\x04H\x00\x88\x01\x01\x12\x12\n\x05\x65xact\x18\x02 \x01(\x08H\x01\x88\x01\x01\x12;\n\x0cquantization\x18\x03 \x01(\x0b\x32 .qdrant.QuantizationSearchParamsH\x02\x88\x01\x01\x12\x19\n\x0cindexed_only\x18\x04 \x01(\x08H\x03\x88\x01\x01\x42\n\n\x08_hnsw_efB\x08\n\x06_exactB\x0f\n\r_quantizationB\x0f\n\r_indexed_only\"\x92\x05\n\x0cSearchPoints\x12\x17\n\x0f\x63ollection_name\x18\x01 \x01(\t\x12\x0e\n\x06vector\x18\x02 \x03(\x02\x12\x1e\n\x06\x66ilter\x18\x03 \x01(\x0b\x32\x0e.qdrant.Filter\x12\r\n\x05limit\x18\x04 \x01(\x04\x12\x31\n\x0cwith_payload\x18\x06 \x01(\x0b\x32\x1b.qdrant.WithPayloadSelector\x12$\n\x06params\x18\x07 \x01(\x0b\x32\x14.qdrant.SearchParams\x12\x1c\n\x0fscore_threshold\x18\x08 \x01(\x02H\x00\x88\x01\x01\x12\x13\n\x06offset\x18\t \x01(\x04H\x01\x88\x01\x01\x12\x18\n\x0bvector_name\x18\n \x01(\tH\x02\x88\x01\x01\x12\x36\n\x0cwith_vectors\x18\x0b \x01(\x0b\x32\x1b.qdrant.WithVectorsSelectorH\x03\x88\x01\x01\x12\x36\n\x10read_consistency\x18\x0c \x01(\x0b\x32\x17.qdrant.ReadConsistencyH\x04\x88\x01\x01\x12\x14\n\x07timeout\x18\r \x01(\x04H\x05\x88\x01\x01\x12\x39\n\x12shard_key_selector\x18\x0e \x01(\x0b\x32\x18.qdrant.ShardKeySelectorH\x06\x88\x01\x01\x12\x32\n\x0esparse_indices\x18\x0f \x01(\x0b\x32\x15.qdrant.SparseIndicesH\x07\x88\x01\x01\x42\x12\n\x10_score_thresholdB\t\n\x07_offsetB\x0e\n\x0c_vector_nameB\x0f\n\r_with_vectorsB\x13\n\x11_read_consistencyB\n\n\x08_timeoutB\x15\n\x13_shard_key_selectorB\x11\n\x0f_sparse_indicesJ\x04\x08\x05\x10\x06\"\xc8\x01\n\x11SearchBatchPoints\x12\x17\n\x0f\x63ollection_name\x18\x01 \x01(\t\x12+\n\rsearch_points\x18\x02 \x03(\x0b\x32\x14.qdrant.SearchPoints\x12\x36\n\x10read_consistency\x18\x03 \x01(\x0b\x32\x17.qdrant.ReadConsistencyH\x00\x88\x01\x01\x12\x14\n\x07timeout\x18\x04 \x01(\x04H\x01\x88\x01\x01\x42\x13\n\x11_read_consistencyB\n\n\x08_timeout\"\xb2\x01\n\nWithLookup\x12\x12\n\ncollection\x18\x01 \x01(\t\x12\x36\n\x0cwith_payload\x18\x02 \x01(\x0b\x32\x1b.qdrant.WithPayloadSelectorH\x00\x88\x01\x01\x12\x36\n\x0cwith_vectors\x18\x03 \x01(\x0b\x32\x1b.qdrant.WithVectorsSelectorH\x01\x88\x01\x01\x42\x0f\n\r_with_payloadB\x0f\n\r_with_vectors\"\xd5\x05\n\x11SearchPointGroups\x12\x17\n\x0f\x63ollection_name\x18\x01 \x01(\t\x12\x0e\n\x06vector\x18\x02 \x03(\x02\x12\x1e\n\x06\x66ilter\x18\x03 \x01(\x0b\x32\x0e.qdrant.Filter\x12\r\n\x05limit\x18\x04 \x01(\r\x12\x31\n\x0cwith_payload\x18\x05 \x01(\x0b\x32\x1b.qdrant.WithPayloadSelector\x12$\n\x06params\x18\x06 \x01(\x0b\x32\x14.qdrant.SearchParams\x12\x1c\n\x0fscore_threshold\x18\x07 \x01(\x02H\x00\x88\x01\x01\x12\x18\n\x0bvector_name\x18\x08 \x01(\tH\x01\x88\x01\x01\x12\x36\n\x0cwith_vectors\x18\t \x01(\x0b\x32\x1b.qdrant.WithVectorsSelectorH\x02\x88\x01\x01\x12\x10\n\x08group_by\x18\n \x01(\t\x12\x12\n\ngroup_size\x18\x0b \x01(\r\x12\x36\n\x10read_consistency\x18\x0c \x01(\x0b\x32\x17.qdrant.ReadConsistencyH\x03\x88\x01\x01\x12,\n\x0bwith_lookup\x18\r \x01(\x0b\x32\x12.qdrant.WithLookupH\x04\x88\x01\x01\x12\x14\n\x07timeout\x18\x0e \x01(\x04H\x05\x88\x01\x01\x12\x39\n\x12shard_key_selector\x18\x0f \x01(\x0b\x32\x18.qdrant.ShardKeySelectorH\x06\x88\x01\x01\x12\x32\n\x0esparse_indices\x18\x10 \x01(\x0b\x32\x15.qdrant.SparseIndicesH\x07\x88\x01\x01\x42\x12\n\x10_score_thresholdB\x0e\n\x0c_vector_nameB\x0f\n\r_with_vectorsB\x13\n\x11_read_consistencyB\x0e\n\x0c_with_lookupB\n\n\x08_timeoutB\x15\n\x13_shard_key_selectorB\x11\n\x0f_sparse_indices\"}\n\tStartFrom\x12\x0f\n\x05\x66loat\x18\x01 \x01(\x01H\x00\x12\x11\n\x07integer\x18\x02 \x01(\x03H\x00\x12/\n\ttimestamp\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampH\x00\x12\x12\n\x08\x64\x61tetime\x18\x04 \x01(\tH\x00\x42\x07\n\x05value\"\x8a\x01\n\x07OrderBy\x12\x0b\n\x03key\x18\x01 \x01(\t\x12)\n\tdirection\x18\x02 \x01(\x0e\x32\x11.qdrant.DirectionH\x00\x88\x01\x01\x12*\n\nstart_from\x18\x03 \x01(\x0b\x32\x11.qdrant.StartFromH\x01\x88\x01\x01\x42\x0c\n\n_directionB\r\n\x0b_start_from\"\x8e\x04\n\x0cScrollPoints\x12\x17\n\x0f\x63ollection_name\x18\x01 \x01(\t\x12\x1e\n\x06\x66ilter\x18\x02 \x01(\x0b\x32\x0e.qdrant.Filter\x12$\n\x06offset\x18\x03 \x01(\x0b\x32\x0f.qdrant.PointIdH\x00\x88\x01\x01\x12\x12\n\x05limit\x18\x04 \x01(\rH\x01\x88\x01\x01\x12\x31\n\x0cwith_payload\x18\x06 \x01(\x0b\x32\x1b.qdrant.WithPayloadSelector\x12\x36\n\x0cwith_vectors\x18\x07 \x01(\x0b\x32\x1b.qdrant.WithVectorsSelectorH\x02\x88\x01\x01\x12\x36\n\x10read_consistency\x18\x08 \x01(\x0b\x32\x17.qdrant.ReadConsistencyH\x03\x88\x01\x01\x12\x39\n\x12shard_key_selector\x18\t \x01(\x0b\x32\x18.qdrant.ShardKeySelectorH\x04\x88\x01\x01\x12&\n\x08order_by\x18\n \x01(\x0b\x32\x0f.qdrant.OrderByH\x05\x88\x01\x01\x12\x14\n\x07timeout\x18\x0b \x01(\x04H\x06\x88\x01\x01\x42\t\n\x07_offsetB\x08\n\x06_limitB\x0f\n\r_with_vectorsB\x13\n\x11_read_consistencyB\x15\n\x13_shard_key_selectorB\x0b\n\t_order_byB\n\n\x08_timeoutJ\x04\x08\x05\x10\x06\"\xa5\x01\n\x0eLookupLocation\x12\x17\n\x0f\x63ollection_name\x18\x01 \x01(\t\x12\x18\n\x0bvector_name\x18\x02 \x01(\tH\x00\x88\x01\x01\x12\x39\n\x12shard_key_selector\x18\x03 \x01(\x0b\x32\x18.qdrant.ShardKeySelectorH\x01\x88\x01\x01\x42\x0e\n\x0c_vector_nameB\x15\n\x13_shard_key_selector\"\xcd\x06\n\x0fRecommendPoints\x12\x17\n\x0f\x63ollection_name\x18\x01 \x01(\t\x12!\n\x08positive\x18\x02 \x03(\x0b\x32\x0f.qdrant.PointId\x12!\n\x08negative\x18\x03 \x03(\x0b\x32\x0f.qdrant.PointId\x12\x1e\n\x06\x66ilter\x18\x04 \x01(\x0b\x32\x0e.qdrant.Filter\x12\r\n\x05limit\x18\x05 \x01(\x04\x12\x31\n\x0cwith_payload\x18\x07 \x01(\x0b\x32\x1b.qdrant.WithPayloadSelector\x12$\n\x06params\x18\x08 \x01(\x0b\x32\x14.qdrant.SearchParams\x12\x1c\n\x0fscore_threshold\x18\t \x01(\x02H\x00\x88\x01\x01\x12\x13\n\x06offset\x18\n \x01(\x04H\x01\x88\x01\x01\x12\x12\n\x05using\x18\x0b \x01(\tH\x02\x88\x01\x01\x12\x36\n\x0cwith_vectors\x18\x0c \x01(\x0b\x32\x1b.qdrant.WithVectorsSelectorH\x03\x88\x01\x01\x12\x30\n\x0blookup_from\x18\r \x01(\x0b\x32\x16.qdrant.LookupLocationH\x04\x88\x01\x01\x12\x36\n\x10read_consistency\x18\x0e \x01(\x0b\x32\x17.qdrant.ReadConsistencyH\x05\x88\x01\x01\x12\x30\n\x08strategy\x18\x10 \x01(\x0e\x32\x19.qdrant.RecommendStrategyH\x06\x88\x01\x01\x12(\n\x10positive_vectors\x18\x11 \x03(\x0b\x32\x0e.qdrant.Vector\x12(\n\x10negative_vectors\x18\x12 \x03(\x0b\x32\x0e.qdrant.Vector\x12\x14\n\x07timeout\x18\x13 \x01(\x04H\x07\x88\x01\x01\x12\x39\n\x12shard_key_selector\x18\x14 \x01(\x0b\x32\x18.qdrant.ShardKeySelectorH\x08\x88\x01\x01\x42\x12\n\x10_score_thresholdB\t\n\x07_offsetB\x08\n\x06_usingB\x0f\n\r_with_vectorsB\x0e\n\x0c_lookup_fromB\x13\n\x11_read_consistencyB\x0b\n\t_strategyB\n\n\x08_timeoutB\x15\n\x13_shard_key_selectorJ\x04\x08\x06\x10\x07\"\xd1\x01\n\x14RecommendBatchPoints\x12\x17\n\x0f\x63ollection_name\x18\x01 \x01(\t\x12\x31\n\x10recommend_points\x18\x02 \x03(\x0b\x32\x17.qdrant.RecommendPoints\x12\x36\n\x10read_consistency\x18\x03 \x01(\x0b\x32\x17.qdrant.ReadConsistencyH\x00\x88\x01\x01\x12\x14\n\x07timeout\x18\x04 \x01(\x04H\x01\x88\x01\x01\x42\x13\n\x11_read_consistencyB\n\n\x08_timeout\"\x90\x07\n\x14RecommendPointGroups\x12\x17\n\x0f\x63ollection_name\x18\x01 \x01(\t\x12!\n\x08positive\x18\x02 \x03(\x0b\x32\x0f.qdrant.PointId\x12!\n\x08negative\x18\x03 \x03(\x0b\x32\x0f.qdrant.PointId\x12\x1e\n\x06\x66ilter\x18\x04 \x01(\x0b\x32\x0e.qdrant.Filter\x12\r\n\x05limit\x18\x05 \x01(\r\x12\x31\n\x0cwith_payload\x18\x06 \x01(\x0b\x32\x1b.qdrant.WithPayloadSelector\x12$\n\x06params\x18\x07 \x01(\x0b\x32\x14.qdrant.SearchParams\x12\x1c\n\x0fscore_threshold\x18\x08 \x01(\x02H\x00\x88\x01\x01\x12\x12\n\x05using\x18\t \x01(\tH\x01\x88\x01\x01\x12\x36\n\x0cwith_vectors\x18\n \x01(\x0b\x32\x1b.qdrant.WithVectorsSelectorH\x02\x88\x01\x01\x12\x30\n\x0blookup_from\x18\x0b \x01(\x0b\x32\x16.qdrant.LookupLocationH\x03\x88\x01\x01\x12\x10\n\x08group_by\x18\x0c \x01(\t\x12\x12\n\ngroup_size\x18\r \x01(\r\x12\x36\n\x10read_consistency\x18\x0e \x01(\x0b\x32\x17.qdrant.ReadConsistencyH\x04\x88\x01\x01\x12,\n\x0bwith_lookup\x18\x0f \x01(\x0b\x32\x12.qdrant.WithLookupH\x05\x88\x01\x01\x12\x30\n\x08strategy\x18\x11 \x01(\x0e\x32\x19.qdrant.RecommendStrategyH\x06\x88\x01\x01\x12(\n\x10positive_vectors\x18\x12 \x03(\x0b\x32\x0e.qdrant.Vector\x12(\n\x10negative_vectors\x18\x13 \x03(\x0b\x32\x0e.qdrant.Vector\x12\x14\n\x07timeout\x18\x14 \x01(\x04H\x07\x88\x01\x01\x12\x39\n\x12shard_key_selector\x18\x15 \x01(\x0b\x32\x18.qdrant.ShardKeySelectorH\x08\x88\x01\x01\x42\x12\n\x10_score_thresholdB\x08\n\x06_usingB\x0f\n\r_with_vectorsB\x0e\n\x0c_lookup_fromB\x13\n\x11_read_consistencyB\x0e\n\x0c_with_lookupB\x0b\n\t_strategyB\n\n\x08_timeoutB\x15\n\x13_shard_key_selector\"A\n\x0cTargetVector\x12\'\n\x06single\x18\x01 \x01(\x0b\x32\x15.qdrant.VectorExampleH\x00\x42\x08\n\x06target\"[\n\rVectorExample\x12\x1d\n\x02id\x18\x01 \x01(\x0b\x32\x0f.qdrant.PointIdH\x00\x12 \n\x06vector\x18\x02 \x01(\x0b\x32\x0e.qdrant.VectorH\x00\x42\t\n\x07\x65xample\"f\n\x12\x43ontextExamplePair\x12\'\n\x08positive\x18\x01 \x01(\x0b\x32\x15.qdrant.VectorExample\x12\'\n\x08negative\x18\x02 \x01(\x0b\x32\x15.qdrant.VectorExample\"\x8e\x05\n\x0e\x44iscoverPoints\x12\x17\n\x0f\x63ollection_name\x18\x01 \x01(\t\x12$\n\x06target\x18\x02 \x01(\x0b\x32\x14.qdrant.TargetVector\x12+\n\x07\x63ontext\x18\x03 \x03(\x0b\x32\x1a.qdrant.ContextExamplePair\x12\x1e\n\x06\x66ilter\x18\x04 \x01(\x0b\x32\x0e.qdrant.Filter\x12\r\n\x05limit\x18\x05 \x01(\x04\x12\x31\n\x0cwith_payload\x18\x06 \x01(\x0b\x32\x1b.qdrant.WithPayloadSelector\x12$\n\x06params\x18\x07 \x01(\x0b\x32\x14.qdrant.SearchParams\x12\x13\n\x06offset\x18\x08 \x01(\x04H\x00\x88\x01\x01\x12\x12\n\x05using\x18\t \x01(\tH\x01\x88\x01\x01\x12\x36\n\x0cwith_vectors\x18\n \x01(\x0b\x32\x1b.qdrant.WithVectorsSelectorH\x02\x88\x01\x01\x12\x30\n\x0blookup_from\x18\x0b \x01(\x0b\x32\x16.qdrant.LookupLocationH\x03\x88\x01\x01\x12\x36\n\x10read_consistency\x18\x0c \x01(\x0b\x32\x17.qdrant.ReadConsistencyH\x04\x88\x01\x01\x12\x14\n\x07timeout\x18\r \x01(\x04H\x05\x88\x01\x01\x12\x39\n\x12shard_key_selector\x18\x0e \x01(\x0b\x32\x18.qdrant.ShardKeySelectorH\x06\x88\x01\x01\x42\t\n\x07_offsetB\x08\n\x06_usingB\x0f\n\r_with_vectorsB\x0e\n\x0c_lookup_fromB\x13\n\x11_read_consistencyB\n\n\x08_timeoutB\x15\n\x13_shard_key_selector\"\xce\x01\n\x13\x44iscoverBatchPoints\x12\x17\n\x0f\x63ollection_name\x18\x01 \x01(\t\x12/\n\x0f\x64iscover_points\x18\x02 \x03(\x0b\x32\x16.qdrant.DiscoverPoints\x12\x36\n\x10read_consistency\x18\x03 \x01(\x0b\x32\x17.qdrant.ReadConsistencyH\x00\x88\x01\x01\x12\x14\n\x07timeout\x18\x04 \x01(\x04H\x01\x88\x01\x01\x42\x13\n\x11_read_consistencyB\n\n\x08_timeout\"\xa5\x02\n\x0b\x43ountPoints\x12\x17\n\x0f\x63ollection_name\x18\x01 \x01(\t\x12\x1e\n\x06\x66ilter\x18\x02 \x01(\x0b\x32\x0e.qdrant.Filter\x12\x12\n\x05\x65xact\x18\x03 \x01(\x08H\x00\x88\x01\x01\x12\x36\n\x10read_consistency\x18\x04 \x01(\x0b\x32\x17.qdrant.ReadConsistencyH\x01\x88\x01\x01\x12\x39\n\x12shard_key_selector\x18\x05 \x01(\x0b\x32\x18.qdrant.ShardKeySelectorH\x02\x88\x01\x01\x12\x14\n\x07timeout\x18\x06 \x01(\x04H\x03\x88\x01\x01\x42\x08\n\x06_exactB\x13\n\x11_read_consistencyB\x15\n\x13_shard_key_selectorB\n\n\x08_timeout\"\x9d\x01\n\x0eRecommendInput\x12%\n\x08positive\x18\x01 \x03(\x0b\x32\x13.qdrant.VectorInput\x12%\n\x08negative\x18\x02 \x03(\x0b\x32\x13.qdrant.VectorInput\x12\x30\n\x08strategy\x18\x03 \x01(\x0e\x32\x19.qdrant.RecommendStrategyH\x00\x88\x01\x01\x42\x0b\n\t_strategy\"`\n\x10\x43ontextInputPair\x12%\n\x08positive\x18\x01 \x01(\x0b\x32\x13.qdrant.VectorInput\x12%\n\x08negative\x18\x02 \x01(\x0b\x32\x13.qdrant.VectorInput\"[\n\rDiscoverInput\x12#\n\x06target\x18\x01 \x01(\x0b\x32\x13.qdrant.VectorInput\x12%\n\x07\x63ontext\x18\x02 \x01(\x0b\x32\x14.qdrant.ContextInput\"7\n\x0c\x43ontextInput\x12\'\n\x05pairs\x18\x01 \x03(\x0b\x32\x18.qdrant.ContextInputPair\"\xa2\x01\n\x07\x46ormula\x12&\n\nexpression\x18\x01 \x01(\x0b\x32\x12.qdrant.Expression\x12/\n\x08\x64\x65\x66\x61ults\x18\x02 \x03(\x0b\x32\x1d.qdrant.Formula.DefaultsEntry\x1a>\n\rDefaultsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x1c\n\x05value\x18\x02 \x01(\x0b\x32\r.qdrant.Value:\x02\x38\x01\"\xcc\x05\n\nExpression\x12\x12\n\x08\x63onstant\x18\x01 \x01(\x02H\x00\x12\x12\n\x08variable\x18\x02 \x01(\tH\x00\x12&\n\tcondition\x18\x03 \x01(\x0b\x32\x11.qdrant.ConditionH\x00\x12+\n\x0cgeo_distance\x18\x04 \x01(\x0b\x32\x13.qdrant.GeoDistanceH\x00\x12\x12\n\x08\x64\x61tetime\x18\x05 \x01(\tH\x00\x12\x16\n\x0c\x64\x61tetime_key\x18\x06 \x01(\tH\x00\x12&\n\x04mult\x18\x07 \x01(\x0b\x32\x16.qdrant.MultExpressionH\x00\x12$\n\x03sum\x18\x08 \x01(\x0b\x32\x15.qdrant.SumExpressionH\x00\x12$\n\x03\x64iv\x18\t \x01(\x0b\x32\x15.qdrant.DivExpressionH\x00\x12!\n\x03neg\x18\n \x01(\x0b\x32\x12.qdrant.ExpressionH\x00\x12!\n\x03\x61\x62s\x18\x0b \x01(\x0b\x32\x12.qdrant.ExpressionH\x00\x12\"\n\x04sqrt\x18\x0c \x01(\x0b\x32\x12.qdrant.ExpressionH\x00\x12$\n\x03pow\x18\r \x01(\x0b\x32\x15.qdrant.PowExpressionH\x00\x12!\n\x03\x65xp\x18\x0e \x01(\x0b\x32\x12.qdrant.ExpressionH\x00\x12#\n\x05log10\x18\x0f \x01(\x0b\x32\x12.qdrant.ExpressionH\x00\x12 \n\x02ln\x18\x10 \x01(\x0b\x32\x12.qdrant.ExpressionH\x00\x12\x32\n\texp_decay\x18\x11 \x01(\x0b\x32\x1d.qdrant.DecayParamsExpressionH\x00\x12\x34\n\x0bgauss_decay\x18\x12 \x01(\x0b\x32\x1d.qdrant.DecayParamsExpressionH\x00\x12\x32\n\tlin_decay\x18\x13 \x01(\x0b\x32\x1d.qdrant.DecayParamsExpressionH\x00\x42\t\n\x07variant\";\n\x0bGeoDistance\x12 \n\x06origin\x18\x01 \x01(\x0b\x32\x10.qdrant.GeoPoint\x12\n\n\x02to\x18\x02 \x01(\t\"2\n\x0eMultExpression\x12 \n\x04mult\x18\x01 \x03(\x0b\x32\x12.qdrant.Expression\"0\n\rSumExpression\x12\x1f\n\x03sum\x18\x01 \x03(\x0b\x32\x12.qdrant.Expression\"\x86\x01\n\rDivExpression\x12 \n\x04left\x18\x01 \x01(\x0b\x32\x12.qdrant.Expression\x12!\n\x05right\x18\x02 \x01(\x0b\x32\x12.qdrant.Expression\x12\x1c\n\x0f\x62y_zero_default\x18\x03 \x01(\x02H\x00\x88\x01\x01\x42\x12\n\x10_by_zero_default\"W\n\rPowExpression\x12 \n\x04\x62\x61se\x18\x01 \x01(\x0b\x32\x12.qdrant.Expression\x12$\n\x08\x65xponent\x18\x02 \x01(\x0b\x32\x12.qdrant.Expression\"\xac\x01\n\x15\x44\x65\x63\x61yParamsExpression\x12\x1d\n\x01x\x18\x01 \x01(\x0b\x32\x12.qdrant.Expression\x12\'\n\x06target\x18\x02 \x01(\x0b\x32\x12.qdrant.ExpressionH\x00\x88\x01\x01\x12\x12\n\x05scale\x18\x03 \x01(\x02H\x01\x88\x01\x01\x12\x15\n\x08midpoint\x18\x04 \x01(\x02H\x02\x88\x01\x01\x42\t\n\x07_targetB\x08\n\x06_scaleB\x0b\n\t_midpoint\"U\n\x13NearestInputWithMmr\x12$\n\x07nearest\x18\x01 \x01(\x0b\x32\x13.qdrant.VectorInput\x12\x18\n\x03mmr\x18\x02 \x01(\x0b\x32\x0b.qdrant.Mmr\"_\n\x03Mmr\x12\x16\n\tdiversity\x18\x02 \x01(\x02H\x00\x88\x01\x01\x12\x1d\n\x10\x63\x61ndidates_limit\x18\x03 \x01(\rH\x01\x88\x01\x01\x42\x0c\n\n_diversityB\x13\n\x11_candidates_limit\"\x81\x03\n\x05Query\x12&\n\x07nearest\x18\x01 \x01(\x0b\x32\x13.qdrant.VectorInputH\x00\x12+\n\trecommend\x18\x02 \x01(\x0b\x32\x16.qdrant.RecommendInputH\x00\x12)\n\x08\x64iscover\x18\x03 \x01(\x0b\x32\x15.qdrant.DiscoverInputH\x00\x12\'\n\x07\x63ontext\x18\x04 \x01(\x0b\x32\x14.qdrant.ContextInputH\x00\x12#\n\x08order_by\x18\x05 \x01(\x0b\x32\x0f.qdrant.OrderByH\x00\x12 \n\x06\x66usion\x18\x06 \x01(\x0e\x32\x0e.qdrant.FusionH\x00\x12 \n\x06sample\x18\x07 \x01(\x0e\x32\x0e.qdrant.SampleH\x00\x12\"\n\x07\x66ormula\x18\x08 \x01(\x0b\x32\x0f.qdrant.FormulaH\x00\x12\x37\n\x10nearest_with_mmr\x18\t \x01(\x0b\x32\x1b.qdrant.NearestInputWithMmrH\x00\x42\t\n\x07variant\"\xfb\x02\n\rPrefetchQuery\x12\'\n\x08prefetch\x18\x01 \x03(\x0b\x32\x15.qdrant.PrefetchQuery\x12!\n\x05query\x18\x02 \x01(\x0b\x32\r.qdrant.QueryH\x00\x88\x01\x01\x12\x12\n\x05using\x18\x03 \x01(\tH\x01\x88\x01\x01\x12#\n\x06\x66ilter\x18\x04 \x01(\x0b\x32\x0e.qdrant.FilterH\x02\x88\x01\x01\x12)\n\x06params\x18\x05 \x01(\x0b\x32\x14.qdrant.SearchParamsH\x03\x88\x01\x01\x12\x1c\n\x0fscore_threshold\x18\x06 \x01(\x02H\x04\x88\x01\x01\x12\x12\n\x05limit\x18\x07 \x01(\x04H\x05\x88\x01\x01\x12\x30\n\x0blookup_from\x18\x08 \x01(\x0b\x32\x16.qdrant.LookupLocationH\x06\x88\x01\x01\x42\x08\n\x06_queryB\x08\n\x06_usingB\t\n\x07_filterB\t\n\x07_paramsB\x12\n\x10_score_thresholdB\x08\n\x06_limitB\x0e\n\x0c_lookup_from\"\x85\x06\n\x0bQueryPoints\x12\x17\n\x0f\x63ollection_name\x18\x01 \x01(\t\x12\'\n\x08prefetch\x18\x02 \x03(\x0b\x32\x15.qdrant.PrefetchQuery\x12!\n\x05query\x18\x03 \x01(\x0b\x32\r.qdrant.QueryH\x00\x88\x01\x01\x12\x12\n\x05using\x18\x04 \x01(\tH\x01\x88\x01\x01\x12#\n\x06\x66ilter\x18\x05 \x01(\x0b\x32\x0e.qdrant.FilterH\x02\x88\x01\x01\x12)\n\x06params\x18\x06 \x01(\x0b\x32\x14.qdrant.SearchParamsH\x03\x88\x01\x01\x12\x1c\n\x0fscore_threshold\x18\x07 \x01(\x02H\x04\x88\x01\x01\x12\x12\n\x05limit\x18\x08 \x01(\x04H\x05\x88\x01\x01\x12\x13\n\x06offset\x18\t \x01(\x04H\x06\x88\x01\x01\x12\x36\n\x0cwith_vectors\x18\n \x01(\x0b\x32\x1b.qdrant.WithVectorsSelectorH\x07\x88\x01\x01\x12\x36\n\x0cwith_payload\x18\x0b \x01(\x0b\x32\x1b.qdrant.WithPayloadSelectorH\x08\x88\x01\x01\x12\x36\n\x10read_consistency\x18\x0c \x01(\x0b\x32\x17.qdrant.ReadConsistencyH\t\x88\x01\x01\x12\x39\n\x12shard_key_selector\x18\r \x01(\x0b\x32\x18.qdrant.ShardKeySelectorH\n\x88\x01\x01\x12\x30\n\x0blookup_from\x18\x0e \x01(\x0b\x32\x16.qdrant.LookupLocationH\x0b\x88\x01\x01\x12\x14\n\x07timeout\x18\x0f \x01(\x04H\x0c\x88\x01\x01\x42\x08\n\x06_queryB\x08\n\x06_usingB\t\n\x07_filterB\t\n\x07_paramsB\x12\n\x10_score_thresholdB\x08\n\x06_limitB\t\n\x07_offsetB\x0f\n\r_with_vectorsB\x0f\n\r_with_payloadB\x13\n\x11_read_consistencyB\x15\n\x13_shard_key_selectorB\x0e\n\x0c_lookup_fromB\n\n\x08_timeout\"\xc5\x01\n\x10QueryBatchPoints\x12\x17\n\x0f\x63ollection_name\x18\x01 \x01(\t\x12)\n\x0cquery_points\x18\x02 \x03(\x0b\x32\x13.qdrant.QueryPoints\x12\x36\n\x10read_consistency\x18\x03 \x01(\x0b\x32\x17.qdrant.ReadConsistencyH\x00\x88\x01\x01\x12\x14\n\x07timeout\x18\x04 \x01(\x04H\x01\x88\x01\x01\x42\x13\n\x11_read_consistencyB\n\n\x08_timeout\"\xcc\x06\n\x10QueryPointGroups\x12\x17\n\x0f\x63ollection_name\x18\x01 \x01(\t\x12\'\n\x08prefetch\x18\x02 \x03(\x0b\x32\x15.qdrant.PrefetchQuery\x12!\n\x05query\x18\x03 \x01(\x0b\x32\r.qdrant.QueryH\x00\x88\x01\x01\x12\x12\n\x05using\x18\x04 \x01(\tH\x01\x88\x01\x01\x12#\n\x06\x66ilter\x18\x05 \x01(\x0b\x32\x0e.qdrant.FilterH\x02\x88\x01\x01\x12)\n\x06params\x18\x06 \x01(\x0b\x32\x14.qdrant.SearchParamsH\x03\x88\x01\x01\x12\x1c\n\x0fscore_threshold\x18\x07 \x01(\x02H\x04\x88\x01\x01\x12\x31\n\x0cwith_payload\x18\x08 \x01(\x0b\x32\x1b.qdrant.WithPayloadSelector\x12\x36\n\x0cwith_vectors\x18\t \x01(\x0b\x32\x1b.qdrant.WithVectorsSelectorH\x05\x88\x01\x01\x12\x30\n\x0blookup_from\x18\n \x01(\x0b\x32\x16.qdrant.LookupLocationH\x06\x88\x01\x01\x12\x12\n\x05limit\x18\x0b \x01(\x04H\x07\x88\x01\x01\x12\x17\n\ngroup_size\x18\x0c \x01(\x04H\x08\x88\x01\x01\x12\x10\n\x08group_by\x18\r \x01(\t\x12\x36\n\x10read_consistency\x18\x0e \x01(\x0b\x32\x17.qdrant.ReadConsistencyH\t\x88\x01\x01\x12,\n\x0bwith_lookup\x18\x0f \x01(\x0b\x32\x12.qdrant.WithLookupH\n\x88\x01\x01\x12\x14\n\x07timeout\x18\x10 \x01(\x04H\x0b\x88\x01\x01\x12\x39\n\x12shard_key_selector\x18\x11 \x01(\x0b\x32\x18.qdrant.ShardKeySelectorH\x0c\x88\x01\x01\x42\x08\n\x06_queryB\x08\n\x06_usingB\t\n\x07_filterB\t\n\x07_paramsB\x12\n\x10_score_thresholdB\x0f\n\r_with_vectorsB\x0e\n\x0c_lookup_fromB\x08\n\x06_limitB\r\n\x0b_group_sizeB\x13\n\x11_read_consistencyB\x0e\n\x0c_with_lookupB\n\n\x08_timeoutB\x15\n\x13_shard_key_selector\"\xe0\x02\n\x0b\x46\x61\x63\x65tCounts\x12\x17\n\x0f\x63ollection_name\x18\x01 \x01(\t\x12\x0b\n\x03key\x18\x02 \x01(\t\x12#\n\x06\x66ilter\x18\x03 \x01(\x0b\x32\x0e.qdrant.FilterH\x00\x88\x01\x01\x12\x12\n\x05limit\x18\x04 \x01(\x04H\x01\x88\x01\x01\x12\x12\n\x05\x65xact\x18\x05 \x01(\x08H\x02\x88\x01\x01\x12\x14\n\x07timeout\x18\x06 \x01(\x04H\x03\x88\x01\x01\x12\x36\n\x10read_consistency\x18\x07 \x01(\x0b\x32\x17.qdrant.ReadConsistencyH\x04\x88\x01\x01\x12\x39\n\x12shard_key_selector\x18\x08 \x01(\x0b\x32\x18.qdrant.ShardKeySelectorH\x05\x88\x01\x01\x42\t\n\x07_filterB\x08\n\x06_limitB\x08\n\x06_exactB\n\n\x08_timeoutB\x13\n\x11_read_consistencyB\x15\n\x13_shard_key_selector\"^\n\nFacetValue\x12\x16\n\x0cstring_value\x18\x01 \x01(\tH\x00\x12\x17\n\rinteger_value\x18\x02 \x01(\x03H\x00\x12\x14\n\nbool_value\x18\x03 \x01(\x08H\x00\x42\t\n\x07variant\"<\n\x08\x46\x61\x63\x65tHit\x12!\n\x05value\x18\x01 \x01(\x0b\x32\x12.qdrant.FacetValue\x12\r\n\x05\x63ount\x18\x02 \x01(\x04\"\xfa\x02\n\x12SearchMatrixPoints\x12\x17\n\x0f\x63ollection_name\x18\x01 \x01(\t\x12#\n\x06\x66ilter\x18\x02 \x01(\x0b\x32\x0e.qdrant.FilterH\x00\x88\x01\x01\x12\x13\n\x06sample\x18\x03 \x01(\x04H\x01\x88\x01\x01\x12\x12\n\x05limit\x18\x04 \x01(\x04H\x02\x88\x01\x01\x12\x12\n\x05using\x18\x05 \x01(\tH\x03\x88\x01\x01\x12\x14\n\x07timeout\x18\x06 \x01(\x04H\x04\x88\x01\x01\x12\x36\n\x10read_consistency\x18\x07 \x01(\x0b\x32\x17.qdrant.ReadConsistencyH\x05\x88\x01\x01\x12\x39\n\x12shard_key_selector\x18\x08 \x01(\x0b\x32\x18.qdrant.ShardKeySelectorH\x06\x88\x01\x01\x42\t\n\x07_filterB\t\n\x07_sampleB\x08\n\x06_limitB\x08\n\x06_usingB\n\n\x08_timeoutB\x13\n\x11_read_consistencyB\x15\n\x13_shard_key_selector\"<\n\x11SearchMatrixPairs\x12\'\n\x05pairs\x18\x01 \x03(\x0b\x32\x18.qdrant.SearchMatrixPair\"Y\n\x10SearchMatrixPair\x12\x1a\n\x01\x61\x18\x01 \x01(\x0b\x32\x0f.qdrant.PointId\x12\x1a\n\x01\x62\x18\x02 \x01(\x0b\x32\x0f.qdrant.PointId\x12\r\n\x05score\x18\x03 \x01(\x02\"m\n\x13SearchMatrixOffsets\x12\x13\n\x0boffsets_row\x18\x01 \x03(\x04\x12\x13\n\x0boffsets_col\x18\x02 \x03(\x04\x12\x0e\n\x06scores\x18\x03 \x03(\x02\x12\x1c\n\x03ids\x18\x04 \x03(\x0b\x32\x0f.qdrant.PointId\"\x95\x12\n\x15PointsUpdateOperation\x12?\n\x06upsert\x18\x01 \x01(\x0b\x32-.qdrant.PointsUpdateOperation.PointStructListH\x00\x12\x37\n\x11\x64\x65lete_deprecated\x18\x02 \x01(\x0b\x32\x16.qdrant.PointsSelectorB\x02\x18\x01H\x00\x12?\n\x0bset_payload\x18\x03 \x01(\x0b\x32(.qdrant.PointsUpdateOperation.SetPayloadH\x00\x12K\n\x11overwrite_payload\x18\x04 \x01(\x0b\x32..qdrant.PointsUpdateOperation.OverwritePayloadH\x00\x12\x45\n\x0e\x64\x65lete_payload\x18\x05 \x01(\x0b\x32+.qdrant.PointsUpdateOperation.DeletePayloadH\x00\x12>\n\x18\x63lear_payload_deprecated\x18\x06 \x01(\x0b\x32\x16.qdrant.PointsSelectorB\x02\x18\x01H\x00\x12\x45\n\x0eupdate_vectors\x18\x07 \x01(\x0b\x32+.qdrant.PointsUpdateOperation.UpdateVectorsH\x00\x12\x45\n\x0e\x64\x65lete_vectors\x18\x08 \x01(\x0b\x32+.qdrant.PointsUpdateOperation.DeleteVectorsH\x00\x12\x43\n\rdelete_points\x18\t \x01(\x0b\x32*.qdrant.PointsUpdateOperation.DeletePointsH\x00\x12\x43\n\rclear_payload\x18\n \x01(\x0b\x32*.qdrant.PointsUpdateOperation.ClearPayloadH\x00\x1a\x88\x01\n\x0fPointStructList\x12#\n\x06points\x18\x01 \x03(\x0b\x32\x13.qdrant.PointStruct\x12\x39\n\x12shard_key_selector\x18\x02 \x01(\x0b\x32\x18.qdrant.ShardKeySelectorH\x00\x88\x01\x01\x42\x15\n\x13_shard_key_selector\x1a\xc9\x02\n\nSetPayload\x12\x46\n\x07payload\x18\x01 \x03(\x0b\x32\x35.qdrant.PointsUpdateOperation.SetPayload.PayloadEntry\x12\x34\n\x0fpoints_selector\x18\x02 \x01(\x0b\x32\x16.qdrant.PointsSelectorH\x00\x88\x01\x01\x12\x39\n\x12shard_key_selector\x18\x03 \x01(\x0b\x32\x18.qdrant.ShardKeySelectorH\x01\x88\x01\x01\x12\x10\n\x03key\x18\x04 \x01(\tH\x02\x88\x01\x01\x1a=\n\x0cPayloadEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x1c\n\x05value\x18\x02 \x01(\x0b\x32\r.qdrant.Value:\x02\x38\x01\x42\x12\n\x10_points_selectorB\x15\n\x13_shard_key_selectorB\x06\n\x04_key\x1a\xd5\x02\n\x10OverwritePayload\x12L\n\x07payload\x18\x01 \x03(\x0b\x32;.qdrant.PointsUpdateOperation.OverwritePayload.PayloadEntry\x12\x34\n\x0fpoints_selector\x18\x02 \x01(\x0b\x32\x16.qdrant.PointsSelectorH\x00\x88\x01\x01\x12\x39\n\x12shard_key_selector\x18\x03 \x01(\x0b\x32\x18.qdrant.ShardKeySelectorH\x01\x88\x01\x01\x12\x10\n\x03key\x18\x04 \x01(\tH\x02\x88\x01\x01\x1a=\n\x0cPayloadEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x1c\n\x05value\x18\x02 \x01(\x0b\x32\r.qdrant.Value:\x02\x38\x01\x42\x12\n\x10_points_selectorB\x15\n\x13_shard_key_selectorB\x06\n\x04_key\x1a\xb9\x01\n\rDeletePayload\x12\x0c\n\x04keys\x18\x01 \x03(\t\x12\x34\n\x0fpoints_selector\x18\x02 \x01(\x0b\x32\x16.qdrant.PointsSelectorH\x00\x88\x01\x01\x12\x39\n\x12shard_key_selector\x18\x03 \x01(\x0b\x32\x18.qdrant.ShardKeySelectorH\x01\x88\x01\x01\x42\x12\n\x10_points_selectorB\x15\n\x13_shard_key_selector\x1a\x87\x01\n\rUpdateVectors\x12$\n\x06points\x18\x01 \x03(\x0b\x32\x14.qdrant.PointVectors\x12\x39\n\x12shard_key_selector\x18\x02 \x01(\x0b\x32\x18.qdrant.ShardKeySelectorH\x00\x88\x01\x01\x42\x15\n\x13_shard_key_selector\x1a\xbc\x01\n\rDeleteVectors\x12/\n\x0fpoints_selector\x18\x01 \x01(\x0b\x32\x16.qdrant.PointsSelector\x12(\n\x07vectors\x18\x02 \x01(\x0b\x32\x17.qdrant.VectorsSelector\x12\x39\n\x12shard_key_selector\x18\x03 \x01(\x0b\x32\x18.qdrant.ShardKeySelectorH\x00\x88\x01\x01\x42\x15\n\x13_shard_key_selector\x1a\x88\x01\n\x0c\x44\x65letePoints\x12&\n\x06points\x18\x01 \x01(\x0b\x32\x16.qdrant.PointsSelector\x12\x39\n\x12shard_key_selector\x18\x02 \x01(\x0b\x32\x18.qdrant.ShardKeySelectorH\x00\x88\x01\x01\x42\x15\n\x13_shard_key_selector\x1a\x88\x01\n\x0c\x43learPayload\x12&\n\x06points\x18\x01 \x01(\x0b\x32\x16.qdrant.PointsSelector\x12\x39\n\x12shard_key_selector\x18\x02 \x01(\x0b\x32\x18.qdrant.ShardKeySelectorH\x00\x88\x01\x01\x42\x15\n\x13_shard_key_selectorB\x0b\n\toperation\"\xb6\x01\n\x11UpdateBatchPoints\x12\x17\n\x0f\x63ollection_name\x18\x01 \x01(\t\x12\x11\n\x04wait\x18\x02 \x01(\x08H\x00\x88\x01\x01\x12\x31\n\noperations\x18\x03 \x03(\x0b\x32\x1d.qdrant.PointsUpdateOperation\x12,\n\x08ordering\x18\x04 \x01(\x0b\x32\x15.qdrant.WriteOrderingH\x01\x88\x01\x01\x42\x07\n\x05_waitB\x0b\n\t_ordering\"z\n\x17PointsOperationResponse\x12$\n\x06result\x18\x01 \x01(\x0b\x32\x14.qdrant.UpdateResult\x12\x0c\n\x04time\x18\x02 \x01(\x01\x12!\n\x05usage\x18\x03 \x01(\x0b\x32\r.qdrant.UsageH\x00\x88\x01\x01\x42\x08\n\x06_usage\"`\n\x0cUpdateResult\x12\x19\n\x0coperation_id\x18\x01 \x01(\x04H\x00\x88\x01\x01\x12$\n\x06status\x18\x02 \x01(\x0e\x32\x14.qdrant.UpdateStatusB\x0f\n\r_operation_id\"7\n\nOrderValue\x12\r\n\x03int\x18\x01 \x01(\x03H\x00\x12\x0f\n\x05\x66loat\x18\x02 \x01(\x01H\x00\x42\t\n\x07variant\"\xf1\x02\n\x0bScoredPoint\x12\x1b\n\x02id\x18\x01 \x01(\x0b\x32\x0f.qdrant.PointId\x12\x31\n\x07payload\x18\x02 \x03(\x0b\x32 .qdrant.ScoredPoint.PayloadEntry\x12\r\n\x05score\x18\x03 \x01(\x02\x12\x0f\n\x07version\x18\x05 \x01(\x04\x12+\n\x07vectors\x18\x06 \x01(\x0b\x32\x15.qdrant.VectorsOutputH\x00\x88\x01\x01\x12(\n\tshard_key\x18\x07 \x01(\x0b\x32\x10.qdrant.ShardKeyH\x01\x88\x01\x01\x12,\n\x0border_value\x18\x08 \x01(\x0b\x32\x12.qdrant.OrderValueH\x02\x88\x01\x01\x1a=\n\x0cPayloadEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x1c\n\x05value\x18\x02 \x01(\x0b\x32\r.qdrant.Value:\x02\x38\x01\x42\n\n\x08_vectorsB\x0c\n\n_shard_keyB\x0e\n\x0c_order_valueJ\x04\x08\x04\x10\x05\"\\\n\x07GroupId\x12\x18\n\x0eunsigned_value\x18\x01 \x01(\x04H\x00\x12\x17\n\rinteger_value\x18\x02 \x01(\x03H\x00\x12\x16\n\x0cstring_value\x18\x03 \x01(\tH\x00\x42\x06\n\x04kind\"t\n\nPointGroup\x12\x1b\n\x02id\x18\x01 \x01(\x0b\x32\x0f.qdrant.GroupId\x12!\n\x04hits\x18\x02 \x03(\x0b\x32\x13.qdrant.ScoredPoint\x12&\n\x06lookup\x18\x03 \x01(\x0b\x32\x16.qdrant.RetrievedPoint\"2\n\x0cGroupsResult\x12\"\n\x06groups\x18\x01 \x03(\x0b\x32\x12.qdrant.PointGroup\"p\n\x0eSearchResponse\x12#\n\x06result\x18\x01 \x03(\x0b\x32\x13.qdrant.ScoredPoint\x12\x0c\n\x04time\x18\x02 \x01(\x01\x12!\n\x05usage\x18\x03 \x01(\x0b\x32\r.qdrant.UsageH\x00\x88\x01\x01\x42\x08\n\x06_usage\"o\n\rQueryResponse\x12#\n\x06result\x18\x01 \x03(\x0b\x32\x13.qdrant.ScoredPoint\x12\x0c\n\x04time\x18\x02 \x01(\x01\x12!\n\x05usage\x18\x03 \x01(\x0b\x32\r.qdrant.UsageH\x00\x88\x01\x01\x42\x08\n\x06_usage\"t\n\x12QueryBatchResponse\x12#\n\x06result\x18\x01 \x03(\x0b\x32\x13.qdrant.BatchResult\x12\x0c\n\x04time\x18\x02 \x01(\x01\x12!\n\x05usage\x18\x03 \x01(\x0b\x32\r.qdrant.UsageH\x00\x88\x01\x01\x42\x08\n\x06_usage\"v\n\x13QueryGroupsResponse\x12$\n\x06result\x18\x01 \x01(\x0b\x32\x14.qdrant.GroupsResult\x12\x0c\n\x04time\x18\x02 \x01(\x01\x12!\n\x05usage\x18\x03 \x01(\x0b\x32\r.qdrant.UsageH\x00\x88\x01\x01\x42\x08\n\x06_usage\"2\n\x0b\x42\x61tchResult\x12#\n\x06result\x18\x01 \x03(\x0b\x32\x13.qdrant.ScoredPoint\"u\n\x13SearchBatchResponse\x12#\n\x06result\x18\x01 \x03(\x0b\x32\x13.qdrant.BatchResult\x12\x0c\n\x04time\x18\x02 \x01(\x01\x12!\n\x05usage\x18\x03 \x01(\x0b\x32\r.qdrant.UsageH\x00\x88\x01\x01\x42\x08\n\x06_usage\"w\n\x14SearchGroupsResponse\x12$\n\x06result\x18\x01 \x01(\x0b\x32\x14.qdrant.GroupsResult\x12\x0c\n\x04time\x18\x02 \x01(\x01\x12!\n\x05usage\x18\x03 \x01(\x0b\x32\r.qdrant.UsageH\x00\x88\x01\x01\x42\x08\n\x06_usage\"o\n\rCountResponse\x12#\n\x06result\x18\x01 \x01(\x0b\x32\x13.qdrant.CountResult\x12\x0c\n\x04time\x18\x02 \x01(\x01\x12!\n\x05usage\x18\x03 \x01(\x0b\x32\r.qdrant.UsageH\x00\x88\x01\x01\x42\x08\n\x06_usage\"\xb8\x01\n\x0eScrollResponse\x12.\n\x10next_page_offset\x18\x01 \x01(\x0b\x32\x0f.qdrant.PointIdH\x00\x88\x01\x01\x12&\n\x06result\x18\x02 \x03(\x0b\x32\x16.qdrant.RetrievedPoint\x12\x0c\n\x04time\x18\x03 \x01(\x01\x12!\n\x05usage\x18\x04 \x01(\x0b\x32\r.qdrant.UsageH\x01\x88\x01\x01\x42\x13\n\x11_next_page_offsetB\x08\n\x06_usage\"\x1c\n\x0b\x43ountResult\x12\r\n\x05\x63ount\x18\x01 \x01(\x04\"\xd7\x02\n\x0eRetrievedPoint\x12\x1b\n\x02id\x18\x01 \x01(\x0b\x32\x0f.qdrant.PointId\x12\x34\n\x07payload\x18\x02 \x03(\x0b\x32#.qdrant.RetrievedPoint.PayloadEntry\x12+\n\x07vectors\x18\x04 \x01(\x0b\x32\x15.qdrant.VectorsOutputH\x00\x88\x01\x01\x12(\n\tshard_key\x18\x05 \x01(\x0b\x32\x10.qdrant.ShardKeyH\x01\x88\x01\x01\x12,\n\x0border_value\x18\x06 \x01(\x0b\x32\x12.qdrant.OrderValueH\x02\x88\x01\x01\x1a=\n\x0cPayloadEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x1c\n\x05value\x18\x02 \x01(\x0b\x32\r.qdrant.Value:\x02\x38\x01\x42\n\n\x08_vectorsB\x0c\n\n_shard_keyB\x0e\n\x0c_order_valueJ\x04\x08\x03\x10\x04\"p\n\x0bGetResponse\x12&\n\x06result\x18\x01 \x03(\x0b\x32\x16.qdrant.RetrievedPoint\x12\x0c\n\x04time\x18\x02 \x01(\x01\x12!\n\x05usage\x18\x03 \x01(\x0b\x32\r.qdrant.UsageH\x00\x88\x01\x01\x42\x08\n\x06_usage\"s\n\x11RecommendResponse\x12#\n\x06result\x18\x01 \x03(\x0b\x32\x13.qdrant.ScoredPoint\x12\x0c\n\x04time\x18\x02 \x01(\x01\x12!\n\x05usage\x18\x03 \x01(\x0b\x32\r.qdrant.UsageH\x00\x88\x01\x01\x42\x08\n\x06_usage\"x\n\x16RecommendBatchResponse\x12#\n\x06result\x18\x01 \x03(\x0b\x32\x13.qdrant.BatchResult\x12\x0c\n\x04time\x18\x02 \x01(\x01\x12!\n\x05usage\x18\x03 \x01(\x0b\x32\r.qdrant.UsageH\x00\x88\x01\x01\x42\x08\n\x06_usage\"r\n\x10\x44iscoverResponse\x12#\n\x06result\x18\x01 \x03(\x0b\x32\x13.qdrant.ScoredPoint\x12\x0c\n\x04time\x18\x02 \x01(\x01\x12!\n\x05usage\x18\x03 \x01(\x0b\x32\r.qdrant.UsageH\x00\x88\x01\x01\x42\x08\n\x06_usage\"w\n\x15\x44iscoverBatchResponse\x12#\n\x06result\x18\x01 \x03(\x0b\x32\x13.qdrant.BatchResult\x12\x0c\n\x04time\x18\x02 \x01(\x01\x12!\n\x05usage\x18\x03 \x01(\x0b\x32\r.qdrant.UsageH\x00\x88\x01\x01\x42\x08\n\x06_usage\"z\n\x17RecommendGroupsResponse\x12$\n\x06result\x18\x01 \x01(\x0b\x32\x14.qdrant.GroupsResult\x12\x0c\n\x04time\x18\x02 \x01(\x01\x12!\n\x05usage\x18\x03 \x01(\x0b\x32\r.qdrant.UsageH\x00\x88\x01\x01\x42\x08\n\x06_usage\"v\n\x13UpdateBatchResponse\x12$\n\x06result\x18\x01 \x03(\x0b\x32\x14.qdrant.UpdateResult\x12\x0c\n\x04time\x18\x02 \x01(\x01\x12!\n\x05usage\x18\x03 \x01(\x0b\x32\r.qdrant.UsageH\x00\x88\x01\x01\x42\x08\n\x06_usage\"=\n\rFacetResponse\x12\x1e\n\x04hits\x18\x01 \x03(\x0b\x32\x10.qdrant.FacetHit\x12\x0c\n\x04time\x18\x02 \x01(\x01\"\x81\x01\n\x19SearchMatrixPairsResponse\x12)\n\x06result\x18\x01 \x01(\x0b\x32\x19.qdrant.SearchMatrixPairs\x12\x0c\n\x04time\x18\x02 \x01(\x01\x12!\n\x05usage\x18\x03 \x01(\x0b\x32\r.qdrant.UsageH\x00\x88\x01\x01\x42\x08\n\x06_usage\"\x85\x01\n\x1bSearchMatrixOffsetsResponse\x12+\n\x06result\x18\x01 \x01(\x0b\x32\x1b.qdrant.SearchMatrixOffsets\x12\x0c\n\x04time\x18\x02 \x01(\x01\x12!\n\x05usage\x18\x03 \x01(\x0b\x32\r.qdrant.UsageH\x00\x88\x01\x01\x42\x08\n\x06_usage\"\xac\x01\n\x06\x46ilter\x12!\n\x06should\x18\x01 \x03(\x0b\x32\x11.qdrant.Condition\x12\x1f\n\x04must\x18\x02 \x03(\x0b\x32\x11.qdrant.Condition\x12#\n\x08must_not\x18\x03 \x03(\x0b\x32\x11.qdrant.Condition\x12*\n\nmin_should\x18\x04 \x01(\x0b\x32\x11.qdrant.MinShouldH\x00\x88\x01\x01\x42\r\n\x0b_min_should\"E\n\tMinShould\x12%\n\nconditions\x18\x01 \x03(\x0b\x32\x11.qdrant.Condition\x12\x11\n\tmin_count\x18\x02 \x01(\x04\"\xcb\x02\n\tCondition\x12\'\n\x05\x66ield\x18\x01 \x01(\x0b\x32\x16.qdrant.FieldConditionH\x00\x12,\n\x08is_empty\x18\x02 \x01(\x0b\x32\x18.qdrant.IsEmptyConditionH\x00\x12(\n\x06has_id\x18\x03 \x01(\x0b\x32\x16.qdrant.HasIdConditionH\x00\x12 \n\x06\x66ilter\x18\x04 \x01(\x0b\x32\x0e.qdrant.FilterH\x00\x12*\n\x07is_null\x18\x05 \x01(\x0b\x32\x17.qdrant.IsNullConditionH\x00\x12)\n\x06nested\x18\x06 \x01(\x0b\x32\x17.qdrant.NestedConditionH\x00\x12\x30\n\nhas_vector\x18\x07 \x01(\x0b\x32\x1a.qdrant.HasVectorConditionH\x00\x42\x12\n\x10\x63ondition_one_of\"\x1f\n\x10IsEmptyCondition\x12\x0b\n\x03key\x18\x01 \x01(\t\"\x1e\n\x0fIsNullCondition\x12\x0b\n\x03key\x18\x01 \x01(\t\"1\n\x0eHasIdCondition\x12\x1f\n\x06has_id\x18\x01 \x03(\x0b\x32\x0f.qdrant.PointId\"(\n\x12HasVectorCondition\x12\x12\n\nhas_vector\x18\x01 \x01(\t\">\n\x0fNestedCondition\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x1e\n\x06\x66ilter\x18\x02 \x01(\x0b\x32\x0e.qdrant.Filter\"\xfb\x02\n\x0e\x46ieldCondition\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x1c\n\x05match\x18\x02 \x01(\x0b\x32\r.qdrant.Match\x12\x1c\n\x05range\x18\x03 \x01(\x0b\x32\r.qdrant.Range\x12\x30\n\x10geo_bounding_box\x18\x04 \x01(\x0b\x32\x16.qdrant.GeoBoundingBox\x12%\n\ngeo_radius\x18\x05 \x01(\x0b\x32\x11.qdrant.GeoRadius\x12)\n\x0cvalues_count\x18\x06 \x01(\x0b\x32\x13.qdrant.ValuesCount\x12\'\n\x0bgeo_polygon\x18\x07 \x01(\x0b\x32\x12.qdrant.GeoPolygon\x12-\n\x0e\x64\x61tetime_range\x18\x08 \x01(\x0b\x32\x15.qdrant.DatetimeRange\x12\x15\n\x08is_empty\x18\t \x01(\x08H\x00\x88\x01\x01\x12\x14\n\x07is_null\x18\n \x01(\x08H\x01\x88\x01\x01\x42\x0b\n\t_is_emptyB\n\n\x08_is_null\"\xb5\x02\n\x05Match\x12\x11\n\x07keyword\x18\x01 \x01(\tH\x00\x12\x11\n\x07integer\x18\x02 \x01(\x03H\x00\x12\x11\n\x07\x62oolean\x18\x03 \x01(\x08H\x00\x12\x0e\n\x04text\x18\x04 \x01(\tH\x00\x12+\n\x08keywords\x18\x05 \x01(\x0b\x32\x17.qdrant.RepeatedStringsH\x00\x12,\n\x08integers\x18\x06 \x01(\x0b\x32\x18.qdrant.RepeatedIntegersH\x00\x12\x33\n\x0f\x65xcept_integers\x18\x07 \x01(\x0b\x32\x18.qdrant.RepeatedIntegersH\x00\x12\x32\n\x0f\x65xcept_keywords\x18\x08 \x01(\x0b\x32\x17.qdrant.RepeatedStringsH\x00\x12\x10\n\x06phrase\x18\t \x01(\tH\x00\x42\r\n\x0bmatch_value\"\"\n\x0fRepeatedStrings\x12\x0f\n\x07strings\x18\x01 \x03(\t\"$\n\x10RepeatedIntegers\x12\x10\n\x08integers\x18\x01 \x03(\x03\"k\n\x05Range\x12\x0f\n\x02lt\x18\x01 \x01(\x01H\x00\x88\x01\x01\x12\x0f\n\x02gt\x18\x02 \x01(\x01H\x01\x88\x01\x01\x12\x10\n\x03gte\x18\x03 \x01(\x01H\x02\x88\x01\x01\x12\x10\n\x03lte\x18\x04 \x01(\x01H\x03\x88\x01\x01\x42\x05\n\x03_ltB\x05\n\x03_gtB\x06\n\x04_gteB\x06\n\x04_lte\"\xe3\x01\n\rDatetimeRange\x12+\n\x02lt\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.TimestampH\x00\x88\x01\x01\x12+\n\x02gt\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampH\x01\x88\x01\x01\x12,\n\x03gte\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampH\x02\x88\x01\x01\x12,\n\x03lte\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampH\x03\x88\x01\x01\x42\x05\n\x03_ltB\x05\n\x03_gtB\x06\n\x04_gteB\x06\n\x04_lte\"\\\n\x0eGeoBoundingBox\x12\"\n\x08top_left\x18\x01 \x01(\x0b\x32\x10.qdrant.GeoPoint\x12&\n\x0c\x62ottom_right\x18\x02 \x01(\x0b\x32\x10.qdrant.GeoPoint\"=\n\tGeoRadius\x12 \n\x06\x63\x65nter\x18\x01 \x01(\x0b\x32\x10.qdrant.GeoPoint\x12\x0e\n\x06radius\x18\x02 \x01(\x02\"1\n\rGeoLineString\x12 \n\x06points\x18\x01 \x03(\x0b\x32\x10.qdrant.GeoPoint\"_\n\nGeoPolygon\x12\'\n\x08\x65xterior\x18\x01 \x01(\x0b\x32\x15.qdrant.GeoLineString\x12(\n\tinteriors\x18\x02 \x03(\x0b\x32\x15.qdrant.GeoLineString\"q\n\x0bValuesCount\x12\x0f\n\x02lt\x18\x01 \x01(\x04H\x00\x88\x01\x01\x12\x0f\n\x02gt\x18\x02 \x01(\x04H\x01\x88\x01\x01\x12\x10\n\x03gte\x18\x03 \x01(\x04H\x02\x88\x01\x01\x12\x10\n\x03lte\x18\x04 \x01(\x04H\x03\x88\x01\x01\x42\x05\n\x03_ltB\x05\n\x03_gtB\x06\n\x04_gteB\x06\n\x04_lte\"u\n\x0ePointsSelector\x12\'\n\x06points\x18\x01 \x01(\x0b\x32\x15.qdrant.PointsIdsListH\x00\x12 \n\x06\x66ilter\x18\x02 \x01(\x0b\x32\x0e.qdrant.FilterH\x00\x42\x18\n\x16points_selector_one_of\"-\n\rPointsIdsList\x12\x1c\n\x03ids\x18\x01 \x03(\x0b\x32\x0f.qdrant.PointId\"\xd5\x01\n\x0bPointStruct\x12\x1b\n\x02id\x18\x01 \x01(\x0b\x32\x0f.qdrant.PointId\x12\x31\n\x07payload\x18\x03 \x03(\x0b\x32 .qdrant.PointStruct.PayloadEntry\x12%\n\x07vectors\x18\x04 \x01(\x0b\x32\x0f.qdrant.VectorsH\x00\x88\x01\x01\x1a=\n\x0cPayloadEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x1c\n\x05value\x18\x02 \x01(\x0b\x32\r.qdrant.Value:\x02\x38\x01\x42\n\n\x08_vectorsJ\x04\x08\x02\x10\x03\"$\n\x08GeoPoint\x12\x0b\n\x03lon\x18\x01 \x01(\x01\x12\x0b\n\x03lat\x18\x02 \x01(\x01\"\x80\x01\n\x05Usage\x12,\n\x08hardware\x18\x01 \x01(\x0b\x32\x15.qdrant.HardwareUsageH\x00\x88\x01\x01\x12.\n\tinference\x18\x02 \x01(\x0b\x32\x16.qdrant.InferenceUsageH\x01\x88\x01\x01\x42\x0b\n\t_hardwareB\x0c\n\n_inference\"\x87\x01\n\x0eInferenceUsage\x12\x32\n\x06models\x18\x01 \x03(\x0b\x32\".qdrant.InferenceUsage.ModelsEntry\x1a\x41\n\x0bModelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12!\n\x05value\x18\x02 \x01(\x0b\x32\x12.qdrant.ModelUsage:\x02\x38\x01\"\x1c\n\nModelUsage\x12\x0e\n\x06tokens\x18\x01 \x01(\x04\"\xbf\x01\n\rHardwareUsage\x12\x0b\n\x03\x63pu\x18\x01 \x01(\x04\x12\x17\n\x0fpayload_io_read\x18\x02 \x01(\x04\x12\x18\n\x10payload_io_write\x18\x03 \x01(\x04\x12\x1d\n\x15payload_index_io_read\x18\x04 \x01(\x04\x12\x1e\n\x16payload_index_io_write\x18\x05 \x01(\x04\x12\x16\n\x0evector_io_read\x18\x06 \x01(\x04\x12\x17\n\x0fvector_io_write\x18\x07 \x01(\x04*5\n\x11WriteOrderingType\x12\x08\n\x04Weak\x10\x00\x12\n\n\x06Medium\x10\x01\x12\n\n\x06Strong\x10\x02*8\n\x13ReadConsistencyType\x12\x07\n\x03\x41ll\x10\x00\x12\x0c\n\x08Majority\x10\x01\x12\n\n\x06Quorum\x10\x02*\xad\x01\n\tFieldType\x12\x14\n\x10\x46ieldTypeKeyword\x10\x00\x12\x14\n\x10\x46ieldTypeInteger\x10\x01\x12\x12\n\x0e\x46ieldTypeFloat\x10\x02\x12\x10\n\x0c\x46ieldTypeGeo\x10\x03\x12\x11\n\rFieldTypeText\x10\x04\x12\x11\n\rFieldTypeBool\x10\x05\x12\x15\n\x11\x46ieldTypeDatetime\x10\x06\x12\x11\n\rFieldTypeUuid\x10\x07*\x1e\n\tDirection\x12\x07\n\x03\x41sc\x10\x00\x12\x08\n\x04\x44\x65sc\x10\x01*D\n\x11RecommendStrategy\x12\x11\n\rAverageVector\x10\x00\x12\r\n\tBestScore\x10\x01\x12\r\n\tSumScores\x10\x02*\x1b\n\x06\x46usion\x12\x07\n\x03RRF\x10\x00\x12\x08\n\x04\x44\x42SF\x10\x01*\x14\n\x06Sample\x12\n\n\x06Random\x10\x00*[\n\x0cUpdateStatus\x12\x17\n\x13UnknownUpdateStatus\x10\x00\x12\x10\n\x0c\x41\x63knowledged\x10\x01\x12\r\n\tCompleted\x10\x02\x12\x11\n\rClockRejected\x10\x03\x42\x15\xaa\x02\x12Qdrant.Client.Grpcb\x06proto3') + +_WRITEORDERINGTYPE = DESCRIPTOR.enum_types_by_name['WriteOrderingType'] +WriteOrderingType = enum_type_wrapper.EnumTypeWrapper(_WRITEORDERINGTYPE) +_READCONSISTENCYTYPE = DESCRIPTOR.enum_types_by_name['ReadConsistencyType'] +ReadConsistencyType = enum_type_wrapper.EnumTypeWrapper(_READCONSISTENCYTYPE) +_FIELDTYPE = DESCRIPTOR.enum_types_by_name['FieldType'] +FieldType = enum_type_wrapper.EnumTypeWrapper(_FIELDTYPE) +_DIRECTION = DESCRIPTOR.enum_types_by_name['Direction'] +Direction = enum_type_wrapper.EnumTypeWrapper(_DIRECTION) +_RECOMMENDSTRATEGY = DESCRIPTOR.enum_types_by_name['RecommendStrategy'] +RecommendStrategy = enum_type_wrapper.EnumTypeWrapper(_RECOMMENDSTRATEGY) +_FUSION = DESCRIPTOR.enum_types_by_name['Fusion'] +Fusion = enum_type_wrapper.EnumTypeWrapper(_FUSION) +_SAMPLE = DESCRIPTOR.enum_types_by_name['Sample'] +Sample = enum_type_wrapper.EnumTypeWrapper(_SAMPLE) +_UPDATESTATUS = DESCRIPTOR.enum_types_by_name['UpdateStatus'] +UpdateStatus = enum_type_wrapper.EnumTypeWrapper(_UPDATESTATUS) +Weak = 0 +Medium = 1 +Strong = 2 +All = 0 +Majority = 1 +Quorum = 2 +FieldTypeKeyword = 0 +FieldTypeInteger = 1 +FieldTypeFloat = 2 +FieldTypeGeo = 3 +FieldTypeText = 4 +FieldTypeBool = 5 +FieldTypeDatetime = 6 +FieldTypeUuid = 7 +Asc = 0 +Desc = 1 +AverageVector = 0 +BestScore = 1 +SumScores = 2 +RRF = 0 +DBSF = 1 +Random = 0 +UnknownUpdateStatus = 0 +Acknowledged = 1 +Completed = 2 +ClockRejected = 3 + + +_WRITEORDERING = DESCRIPTOR.message_types_by_name['WriteOrdering'] +_READCONSISTENCY = DESCRIPTOR.message_types_by_name['ReadConsistency'] +_POINTID = DESCRIPTOR.message_types_by_name['PointId'] +_SPARSEINDICES = DESCRIPTOR.message_types_by_name['SparseIndices'] +_DOCUMENT = DESCRIPTOR.message_types_by_name['Document'] +_DOCUMENT_OPTIONSENTRY = _DOCUMENT.nested_types_by_name['OptionsEntry'] +_IMAGE = DESCRIPTOR.message_types_by_name['Image'] +_IMAGE_OPTIONSENTRY = _IMAGE.nested_types_by_name['OptionsEntry'] +_INFERENCEOBJECT = DESCRIPTOR.message_types_by_name['InferenceObject'] +_INFERENCEOBJECT_OPTIONSENTRY = _INFERENCEOBJECT.nested_types_by_name['OptionsEntry'] +_VECTOR = DESCRIPTOR.message_types_by_name['Vector'] +_VECTOROUTPUT = DESCRIPTOR.message_types_by_name['VectorOutput'] +_DENSEVECTOR = DESCRIPTOR.message_types_by_name['DenseVector'] +_SPARSEVECTOR = DESCRIPTOR.message_types_by_name['SparseVector'] +_MULTIDENSEVECTOR = DESCRIPTOR.message_types_by_name['MultiDenseVector'] +_VECTORINPUT = DESCRIPTOR.message_types_by_name['VectorInput'] +_SHARDKEYSELECTOR = DESCRIPTOR.message_types_by_name['ShardKeySelector'] +_UPSERTPOINTS = DESCRIPTOR.message_types_by_name['UpsertPoints'] +_DELETEPOINTS = DESCRIPTOR.message_types_by_name['DeletePoints'] +_GETPOINTS = DESCRIPTOR.message_types_by_name['GetPoints'] +_UPDATEPOINTVECTORS = DESCRIPTOR.message_types_by_name['UpdatePointVectors'] +_POINTVECTORS = DESCRIPTOR.message_types_by_name['PointVectors'] +_DELETEPOINTVECTORS = DESCRIPTOR.message_types_by_name['DeletePointVectors'] +_SETPAYLOADPOINTS = DESCRIPTOR.message_types_by_name['SetPayloadPoints'] +_SETPAYLOADPOINTS_PAYLOADENTRY = _SETPAYLOADPOINTS.nested_types_by_name['PayloadEntry'] +_DELETEPAYLOADPOINTS = DESCRIPTOR.message_types_by_name['DeletePayloadPoints'] +_CLEARPAYLOADPOINTS = DESCRIPTOR.message_types_by_name['ClearPayloadPoints'] +_CREATEFIELDINDEXCOLLECTION = DESCRIPTOR.message_types_by_name['CreateFieldIndexCollection'] +_DELETEFIELDINDEXCOLLECTION = DESCRIPTOR.message_types_by_name['DeleteFieldIndexCollection'] +_PAYLOADINCLUDESELECTOR = DESCRIPTOR.message_types_by_name['PayloadIncludeSelector'] +_PAYLOADEXCLUDESELECTOR = DESCRIPTOR.message_types_by_name['PayloadExcludeSelector'] +_WITHPAYLOADSELECTOR = DESCRIPTOR.message_types_by_name['WithPayloadSelector'] +_NAMEDVECTORS = DESCRIPTOR.message_types_by_name['NamedVectors'] +_NAMEDVECTORS_VECTORSENTRY = _NAMEDVECTORS.nested_types_by_name['VectorsEntry'] +_NAMEDVECTORSOUTPUT = DESCRIPTOR.message_types_by_name['NamedVectorsOutput'] +_NAMEDVECTORSOUTPUT_VECTORSENTRY = _NAMEDVECTORSOUTPUT.nested_types_by_name['VectorsEntry'] +_VECTORS = DESCRIPTOR.message_types_by_name['Vectors'] +_VECTORSOUTPUT = DESCRIPTOR.message_types_by_name['VectorsOutput'] +_VECTORSSELECTOR = DESCRIPTOR.message_types_by_name['VectorsSelector'] +_WITHVECTORSSELECTOR = DESCRIPTOR.message_types_by_name['WithVectorsSelector'] +_QUANTIZATIONSEARCHPARAMS = DESCRIPTOR.message_types_by_name['QuantizationSearchParams'] +_SEARCHPARAMS = DESCRIPTOR.message_types_by_name['SearchParams'] +_SEARCHPOINTS = DESCRIPTOR.message_types_by_name['SearchPoints'] +_SEARCHBATCHPOINTS = DESCRIPTOR.message_types_by_name['SearchBatchPoints'] +_WITHLOOKUP = DESCRIPTOR.message_types_by_name['WithLookup'] +_SEARCHPOINTGROUPS = DESCRIPTOR.message_types_by_name['SearchPointGroups'] +_STARTFROM = DESCRIPTOR.message_types_by_name['StartFrom'] +_ORDERBY = DESCRIPTOR.message_types_by_name['OrderBy'] +_SCROLLPOINTS = DESCRIPTOR.message_types_by_name['ScrollPoints'] +_LOOKUPLOCATION = DESCRIPTOR.message_types_by_name['LookupLocation'] +_RECOMMENDPOINTS = DESCRIPTOR.message_types_by_name['RecommendPoints'] +_RECOMMENDBATCHPOINTS = DESCRIPTOR.message_types_by_name['RecommendBatchPoints'] +_RECOMMENDPOINTGROUPS = DESCRIPTOR.message_types_by_name['RecommendPointGroups'] +_TARGETVECTOR = DESCRIPTOR.message_types_by_name['TargetVector'] +_VECTOREXAMPLE = DESCRIPTOR.message_types_by_name['VectorExample'] +_CONTEXTEXAMPLEPAIR = DESCRIPTOR.message_types_by_name['ContextExamplePair'] +_DISCOVERPOINTS = DESCRIPTOR.message_types_by_name['DiscoverPoints'] +_DISCOVERBATCHPOINTS = DESCRIPTOR.message_types_by_name['DiscoverBatchPoints'] +_COUNTPOINTS = DESCRIPTOR.message_types_by_name['CountPoints'] +_RECOMMENDINPUT = DESCRIPTOR.message_types_by_name['RecommendInput'] +_CONTEXTINPUTPAIR = DESCRIPTOR.message_types_by_name['ContextInputPair'] +_DISCOVERINPUT = DESCRIPTOR.message_types_by_name['DiscoverInput'] +_CONTEXTINPUT = DESCRIPTOR.message_types_by_name['ContextInput'] +_FORMULA = DESCRIPTOR.message_types_by_name['Formula'] +_FORMULA_DEFAULTSENTRY = _FORMULA.nested_types_by_name['DefaultsEntry'] +_EXPRESSION = DESCRIPTOR.message_types_by_name['Expression'] +_GEODISTANCE = DESCRIPTOR.message_types_by_name['GeoDistance'] +_MULTEXPRESSION = DESCRIPTOR.message_types_by_name['MultExpression'] +_SUMEXPRESSION = DESCRIPTOR.message_types_by_name['SumExpression'] +_DIVEXPRESSION = DESCRIPTOR.message_types_by_name['DivExpression'] +_POWEXPRESSION = DESCRIPTOR.message_types_by_name['PowExpression'] +_DECAYPARAMSEXPRESSION = DESCRIPTOR.message_types_by_name['DecayParamsExpression'] +_NEARESTINPUTWITHMMR = DESCRIPTOR.message_types_by_name['NearestInputWithMmr'] +_MMR = DESCRIPTOR.message_types_by_name['Mmr'] +_QUERY = DESCRIPTOR.message_types_by_name['Query'] +_PREFETCHQUERY = DESCRIPTOR.message_types_by_name['PrefetchQuery'] +_QUERYPOINTS = DESCRIPTOR.message_types_by_name['QueryPoints'] +_QUERYBATCHPOINTS = DESCRIPTOR.message_types_by_name['QueryBatchPoints'] +_QUERYPOINTGROUPS = DESCRIPTOR.message_types_by_name['QueryPointGroups'] +_FACETCOUNTS = DESCRIPTOR.message_types_by_name['FacetCounts'] +_FACETVALUE = DESCRIPTOR.message_types_by_name['FacetValue'] +_FACETHIT = DESCRIPTOR.message_types_by_name['FacetHit'] +_SEARCHMATRIXPOINTS = DESCRIPTOR.message_types_by_name['SearchMatrixPoints'] +_SEARCHMATRIXPAIRS = DESCRIPTOR.message_types_by_name['SearchMatrixPairs'] +_SEARCHMATRIXPAIR = DESCRIPTOR.message_types_by_name['SearchMatrixPair'] +_SEARCHMATRIXOFFSETS = DESCRIPTOR.message_types_by_name['SearchMatrixOffsets'] +_POINTSUPDATEOPERATION = DESCRIPTOR.message_types_by_name['PointsUpdateOperation'] +_POINTSUPDATEOPERATION_POINTSTRUCTLIST = _POINTSUPDATEOPERATION.nested_types_by_name['PointStructList'] +_POINTSUPDATEOPERATION_SETPAYLOAD = _POINTSUPDATEOPERATION.nested_types_by_name['SetPayload'] +_POINTSUPDATEOPERATION_SETPAYLOAD_PAYLOADENTRY = _POINTSUPDATEOPERATION_SETPAYLOAD.nested_types_by_name['PayloadEntry'] +_POINTSUPDATEOPERATION_OVERWRITEPAYLOAD = _POINTSUPDATEOPERATION.nested_types_by_name['OverwritePayload'] +_POINTSUPDATEOPERATION_OVERWRITEPAYLOAD_PAYLOADENTRY = _POINTSUPDATEOPERATION_OVERWRITEPAYLOAD.nested_types_by_name['PayloadEntry'] +_POINTSUPDATEOPERATION_DELETEPAYLOAD = _POINTSUPDATEOPERATION.nested_types_by_name['DeletePayload'] +_POINTSUPDATEOPERATION_UPDATEVECTORS = _POINTSUPDATEOPERATION.nested_types_by_name['UpdateVectors'] +_POINTSUPDATEOPERATION_DELETEVECTORS = _POINTSUPDATEOPERATION.nested_types_by_name['DeleteVectors'] +_POINTSUPDATEOPERATION_DELETEPOINTS = _POINTSUPDATEOPERATION.nested_types_by_name['DeletePoints'] +_POINTSUPDATEOPERATION_CLEARPAYLOAD = _POINTSUPDATEOPERATION.nested_types_by_name['ClearPayload'] +_UPDATEBATCHPOINTS = DESCRIPTOR.message_types_by_name['UpdateBatchPoints'] +_POINTSOPERATIONRESPONSE = DESCRIPTOR.message_types_by_name['PointsOperationResponse'] +_UPDATERESULT = DESCRIPTOR.message_types_by_name['UpdateResult'] +_ORDERVALUE = DESCRIPTOR.message_types_by_name['OrderValue'] +_SCOREDPOINT = DESCRIPTOR.message_types_by_name['ScoredPoint'] +_SCOREDPOINT_PAYLOADENTRY = _SCOREDPOINT.nested_types_by_name['PayloadEntry'] +_GROUPID = DESCRIPTOR.message_types_by_name['GroupId'] +_POINTGROUP = DESCRIPTOR.message_types_by_name['PointGroup'] +_GROUPSRESULT = DESCRIPTOR.message_types_by_name['GroupsResult'] +_SEARCHRESPONSE = DESCRIPTOR.message_types_by_name['SearchResponse'] +_QUERYRESPONSE = DESCRIPTOR.message_types_by_name['QueryResponse'] +_QUERYBATCHRESPONSE = DESCRIPTOR.message_types_by_name['QueryBatchResponse'] +_QUERYGROUPSRESPONSE = DESCRIPTOR.message_types_by_name['QueryGroupsResponse'] +_BATCHRESULT = DESCRIPTOR.message_types_by_name['BatchResult'] +_SEARCHBATCHRESPONSE = DESCRIPTOR.message_types_by_name['SearchBatchResponse'] +_SEARCHGROUPSRESPONSE = DESCRIPTOR.message_types_by_name['SearchGroupsResponse'] +_COUNTRESPONSE = DESCRIPTOR.message_types_by_name['CountResponse'] +_SCROLLRESPONSE = DESCRIPTOR.message_types_by_name['ScrollResponse'] +_COUNTRESULT = DESCRIPTOR.message_types_by_name['CountResult'] +_RETRIEVEDPOINT = DESCRIPTOR.message_types_by_name['RetrievedPoint'] +_RETRIEVEDPOINT_PAYLOADENTRY = _RETRIEVEDPOINT.nested_types_by_name['PayloadEntry'] +_GETRESPONSE = DESCRIPTOR.message_types_by_name['GetResponse'] +_RECOMMENDRESPONSE = DESCRIPTOR.message_types_by_name['RecommendResponse'] +_RECOMMENDBATCHRESPONSE = DESCRIPTOR.message_types_by_name['RecommendBatchResponse'] +_DISCOVERRESPONSE = DESCRIPTOR.message_types_by_name['DiscoverResponse'] +_DISCOVERBATCHRESPONSE = DESCRIPTOR.message_types_by_name['DiscoverBatchResponse'] +_RECOMMENDGROUPSRESPONSE = DESCRIPTOR.message_types_by_name['RecommendGroupsResponse'] +_UPDATEBATCHRESPONSE = DESCRIPTOR.message_types_by_name['UpdateBatchResponse'] +_FACETRESPONSE = DESCRIPTOR.message_types_by_name['FacetResponse'] +_SEARCHMATRIXPAIRSRESPONSE = DESCRIPTOR.message_types_by_name['SearchMatrixPairsResponse'] +_SEARCHMATRIXOFFSETSRESPONSE = DESCRIPTOR.message_types_by_name['SearchMatrixOffsetsResponse'] +_FILTER = DESCRIPTOR.message_types_by_name['Filter'] +_MINSHOULD = DESCRIPTOR.message_types_by_name['MinShould'] +_CONDITION = DESCRIPTOR.message_types_by_name['Condition'] +_ISEMPTYCONDITION = DESCRIPTOR.message_types_by_name['IsEmptyCondition'] +_ISNULLCONDITION = DESCRIPTOR.message_types_by_name['IsNullCondition'] +_HASIDCONDITION = DESCRIPTOR.message_types_by_name['HasIdCondition'] +_HASVECTORCONDITION = DESCRIPTOR.message_types_by_name['HasVectorCondition'] +_NESTEDCONDITION = DESCRIPTOR.message_types_by_name['NestedCondition'] +_FIELDCONDITION = DESCRIPTOR.message_types_by_name['FieldCondition'] +_MATCH = DESCRIPTOR.message_types_by_name['Match'] +_REPEATEDSTRINGS = DESCRIPTOR.message_types_by_name['RepeatedStrings'] +_REPEATEDINTEGERS = DESCRIPTOR.message_types_by_name['RepeatedIntegers'] +_RANGE = DESCRIPTOR.message_types_by_name['Range'] +_DATETIMERANGE = DESCRIPTOR.message_types_by_name['DatetimeRange'] +_GEOBOUNDINGBOX = DESCRIPTOR.message_types_by_name['GeoBoundingBox'] +_GEORADIUS = DESCRIPTOR.message_types_by_name['GeoRadius'] +_GEOLINESTRING = DESCRIPTOR.message_types_by_name['GeoLineString'] +_GEOPOLYGON = DESCRIPTOR.message_types_by_name['GeoPolygon'] +_VALUESCOUNT = DESCRIPTOR.message_types_by_name['ValuesCount'] +_POINTSSELECTOR = DESCRIPTOR.message_types_by_name['PointsSelector'] +_POINTSIDSLIST = DESCRIPTOR.message_types_by_name['PointsIdsList'] +_POINTSTRUCT = DESCRIPTOR.message_types_by_name['PointStruct'] +_POINTSTRUCT_PAYLOADENTRY = _POINTSTRUCT.nested_types_by_name['PayloadEntry'] +_GEOPOINT = DESCRIPTOR.message_types_by_name['GeoPoint'] +_USAGE = DESCRIPTOR.message_types_by_name['Usage'] +_INFERENCEUSAGE = DESCRIPTOR.message_types_by_name['InferenceUsage'] +_INFERENCEUSAGE_MODELSENTRY = _INFERENCEUSAGE.nested_types_by_name['ModelsEntry'] +_MODELUSAGE = DESCRIPTOR.message_types_by_name['ModelUsage'] +_HARDWAREUSAGE = DESCRIPTOR.message_types_by_name['HardwareUsage'] +WriteOrdering = _reflection.GeneratedProtocolMessageType('WriteOrdering', (_message.Message,), { + 'DESCRIPTOR' : _WRITEORDERING, + '__module__' : 'points_pb2' + # @@protoc_insertion_point(class_scope:qdrant.WriteOrdering) + }) +_sym_db.RegisterMessage(WriteOrdering) + +ReadConsistency = _reflection.GeneratedProtocolMessageType('ReadConsistency', (_message.Message,), { + 'DESCRIPTOR' : _READCONSISTENCY, + '__module__' : 'points_pb2' + # @@protoc_insertion_point(class_scope:qdrant.ReadConsistency) + }) +_sym_db.RegisterMessage(ReadConsistency) + +PointId = _reflection.GeneratedProtocolMessageType('PointId', (_message.Message,), { + 'DESCRIPTOR' : _POINTID, + '__module__' : 'points_pb2' + # @@protoc_insertion_point(class_scope:qdrant.PointId) + }) +_sym_db.RegisterMessage(PointId) + +SparseIndices = _reflection.GeneratedProtocolMessageType('SparseIndices', (_message.Message,), { + 'DESCRIPTOR' : _SPARSEINDICES, + '__module__' : 'points_pb2' + # @@protoc_insertion_point(class_scope:qdrant.SparseIndices) + }) +_sym_db.RegisterMessage(SparseIndices) + +Document = _reflection.GeneratedProtocolMessageType('Document', (_message.Message,), { + + 'OptionsEntry' : _reflection.GeneratedProtocolMessageType('OptionsEntry', (_message.Message,), { + 'DESCRIPTOR' : _DOCUMENT_OPTIONSENTRY, + '__module__' : 'points_pb2' + # @@protoc_insertion_point(class_scope:qdrant.Document.OptionsEntry) + }) + , + 'DESCRIPTOR' : _DOCUMENT, + '__module__' : 'points_pb2' + # @@protoc_insertion_point(class_scope:qdrant.Document) + }) +_sym_db.RegisterMessage(Document) +_sym_db.RegisterMessage(Document.OptionsEntry) + +Image = _reflection.GeneratedProtocolMessageType('Image', (_message.Message,), { + + 'OptionsEntry' : _reflection.GeneratedProtocolMessageType('OptionsEntry', (_message.Message,), { + 'DESCRIPTOR' : _IMAGE_OPTIONSENTRY, + '__module__' : 'points_pb2' + # @@protoc_insertion_point(class_scope:qdrant.Image.OptionsEntry) + }) + , + 'DESCRIPTOR' : _IMAGE, + '__module__' : 'points_pb2' + # @@protoc_insertion_point(class_scope:qdrant.Image) + }) +_sym_db.RegisterMessage(Image) +_sym_db.RegisterMessage(Image.OptionsEntry) + +InferenceObject = _reflection.GeneratedProtocolMessageType('InferenceObject', (_message.Message,), { + + 'OptionsEntry' : _reflection.GeneratedProtocolMessageType('OptionsEntry', (_message.Message,), { + 'DESCRIPTOR' : _INFERENCEOBJECT_OPTIONSENTRY, + '__module__' : 'points_pb2' + # @@protoc_insertion_point(class_scope:qdrant.InferenceObject.OptionsEntry) + }) + , + 'DESCRIPTOR' : _INFERENCEOBJECT, + '__module__' : 'points_pb2' + # @@protoc_insertion_point(class_scope:qdrant.InferenceObject) + }) +_sym_db.RegisterMessage(InferenceObject) +_sym_db.RegisterMessage(InferenceObject.OptionsEntry) + +Vector = _reflection.GeneratedProtocolMessageType('Vector', (_message.Message,), { + 'DESCRIPTOR' : _VECTOR, + '__module__' : 'points_pb2' + # @@protoc_insertion_point(class_scope:qdrant.Vector) + }) +_sym_db.RegisterMessage(Vector) + +VectorOutput = _reflection.GeneratedProtocolMessageType('VectorOutput', (_message.Message,), { + 'DESCRIPTOR' : _VECTOROUTPUT, + '__module__' : 'points_pb2' + # @@protoc_insertion_point(class_scope:qdrant.VectorOutput) + }) +_sym_db.RegisterMessage(VectorOutput) + +DenseVector = _reflection.GeneratedProtocolMessageType('DenseVector', (_message.Message,), { + 'DESCRIPTOR' : _DENSEVECTOR, + '__module__' : 'points_pb2' + # @@protoc_insertion_point(class_scope:qdrant.DenseVector) + }) +_sym_db.RegisterMessage(DenseVector) + +SparseVector = _reflection.GeneratedProtocolMessageType('SparseVector', (_message.Message,), { + 'DESCRIPTOR' : _SPARSEVECTOR, + '__module__' : 'points_pb2' + # @@protoc_insertion_point(class_scope:qdrant.SparseVector) + }) +_sym_db.RegisterMessage(SparseVector) + +MultiDenseVector = _reflection.GeneratedProtocolMessageType('MultiDenseVector', (_message.Message,), { + 'DESCRIPTOR' : _MULTIDENSEVECTOR, + '__module__' : 'points_pb2' + # @@protoc_insertion_point(class_scope:qdrant.MultiDenseVector) + }) +_sym_db.RegisterMessage(MultiDenseVector) + +VectorInput = _reflection.GeneratedProtocolMessageType('VectorInput', (_message.Message,), { + 'DESCRIPTOR' : _VECTORINPUT, + '__module__' : 'points_pb2' + # @@protoc_insertion_point(class_scope:qdrant.VectorInput) + }) +_sym_db.RegisterMessage(VectorInput) + +ShardKeySelector = _reflection.GeneratedProtocolMessageType('ShardKeySelector', (_message.Message,), { + 'DESCRIPTOR' : _SHARDKEYSELECTOR, + '__module__' : 'points_pb2' + # @@protoc_insertion_point(class_scope:qdrant.ShardKeySelector) + }) +_sym_db.RegisterMessage(ShardKeySelector) + +UpsertPoints = _reflection.GeneratedProtocolMessageType('UpsertPoints', (_message.Message,), { + 'DESCRIPTOR' : _UPSERTPOINTS, + '__module__' : 'points_pb2' + # @@protoc_insertion_point(class_scope:qdrant.UpsertPoints) + }) +_sym_db.RegisterMessage(UpsertPoints) + +DeletePoints = _reflection.GeneratedProtocolMessageType('DeletePoints', (_message.Message,), { + 'DESCRIPTOR' : _DELETEPOINTS, + '__module__' : 'points_pb2' + # @@protoc_insertion_point(class_scope:qdrant.DeletePoints) + }) +_sym_db.RegisterMessage(DeletePoints) + +GetPoints = _reflection.GeneratedProtocolMessageType('GetPoints', (_message.Message,), { + 'DESCRIPTOR' : _GETPOINTS, + '__module__' : 'points_pb2' + # @@protoc_insertion_point(class_scope:qdrant.GetPoints) + }) +_sym_db.RegisterMessage(GetPoints) + +UpdatePointVectors = _reflection.GeneratedProtocolMessageType('UpdatePointVectors', (_message.Message,), { + 'DESCRIPTOR' : _UPDATEPOINTVECTORS, + '__module__' : 'points_pb2' + # @@protoc_insertion_point(class_scope:qdrant.UpdatePointVectors) + }) +_sym_db.RegisterMessage(UpdatePointVectors) + +PointVectors = _reflection.GeneratedProtocolMessageType('PointVectors', (_message.Message,), { + 'DESCRIPTOR' : _POINTVECTORS, + '__module__' : 'points_pb2' + # @@protoc_insertion_point(class_scope:qdrant.PointVectors) + }) +_sym_db.RegisterMessage(PointVectors) + +DeletePointVectors = _reflection.GeneratedProtocolMessageType('DeletePointVectors', (_message.Message,), { + 'DESCRIPTOR' : _DELETEPOINTVECTORS, + '__module__' : 'points_pb2' + # @@protoc_insertion_point(class_scope:qdrant.DeletePointVectors) + }) +_sym_db.RegisterMessage(DeletePointVectors) + +SetPayloadPoints = _reflection.GeneratedProtocolMessageType('SetPayloadPoints', (_message.Message,), { + + 'PayloadEntry' : _reflection.GeneratedProtocolMessageType('PayloadEntry', (_message.Message,), { + 'DESCRIPTOR' : _SETPAYLOADPOINTS_PAYLOADENTRY, + '__module__' : 'points_pb2' + # @@protoc_insertion_point(class_scope:qdrant.SetPayloadPoints.PayloadEntry) + }) + , + 'DESCRIPTOR' : _SETPAYLOADPOINTS, + '__module__' : 'points_pb2' + # @@protoc_insertion_point(class_scope:qdrant.SetPayloadPoints) + }) +_sym_db.RegisterMessage(SetPayloadPoints) +_sym_db.RegisterMessage(SetPayloadPoints.PayloadEntry) + +DeletePayloadPoints = _reflection.GeneratedProtocolMessageType('DeletePayloadPoints', (_message.Message,), { + 'DESCRIPTOR' : _DELETEPAYLOADPOINTS, + '__module__' : 'points_pb2' + # @@protoc_insertion_point(class_scope:qdrant.DeletePayloadPoints) + }) +_sym_db.RegisterMessage(DeletePayloadPoints) + +ClearPayloadPoints = _reflection.GeneratedProtocolMessageType('ClearPayloadPoints', (_message.Message,), { + 'DESCRIPTOR' : _CLEARPAYLOADPOINTS, + '__module__' : 'points_pb2' + # @@protoc_insertion_point(class_scope:qdrant.ClearPayloadPoints) + }) +_sym_db.RegisterMessage(ClearPayloadPoints) + +CreateFieldIndexCollection = _reflection.GeneratedProtocolMessageType('CreateFieldIndexCollection', (_message.Message,), { + 'DESCRIPTOR' : _CREATEFIELDINDEXCOLLECTION, + '__module__' : 'points_pb2' + # @@protoc_insertion_point(class_scope:qdrant.CreateFieldIndexCollection) + }) +_sym_db.RegisterMessage(CreateFieldIndexCollection) + +DeleteFieldIndexCollection = _reflection.GeneratedProtocolMessageType('DeleteFieldIndexCollection', (_message.Message,), { + 'DESCRIPTOR' : _DELETEFIELDINDEXCOLLECTION, + '__module__' : 'points_pb2' + # @@protoc_insertion_point(class_scope:qdrant.DeleteFieldIndexCollection) + }) +_sym_db.RegisterMessage(DeleteFieldIndexCollection) + +PayloadIncludeSelector = _reflection.GeneratedProtocolMessageType('PayloadIncludeSelector', (_message.Message,), { + 'DESCRIPTOR' : _PAYLOADINCLUDESELECTOR, + '__module__' : 'points_pb2' + # @@protoc_insertion_point(class_scope:qdrant.PayloadIncludeSelector) + }) +_sym_db.RegisterMessage(PayloadIncludeSelector) + +PayloadExcludeSelector = _reflection.GeneratedProtocolMessageType('PayloadExcludeSelector', (_message.Message,), { + 'DESCRIPTOR' : _PAYLOADEXCLUDESELECTOR, + '__module__' : 'points_pb2' + # @@protoc_insertion_point(class_scope:qdrant.PayloadExcludeSelector) + }) +_sym_db.RegisterMessage(PayloadExcludeSelector) + +WithPayloadSelector = _reflection.GeneratedProtocolMessageType('WithPayloadSelector', (_message.Message,), { + 'DESCRIPTOR' : _WITHPAYLOADSELECTOR, + '__module__' : 'points_pb2' + # @@protoc_insertion_point(class_scope:qdrant.WithPayloadSelector) + }) +_sym_db.RegisterMessage(WithPayloadSelector) + +NamedVectors = _reflection.GeneratedProtocolMessageType('NamedVectors', (_message.Message,), { + + 'VectorsEntry' : _reflection.GeneratedProtocolMessageType('VectorsEntry', (_message.Message,), { + 'DESCRIPTOR' : _NAMEDVECTORS_VECTORSENTRY, + '__module__' : 'points_pb2' + # @@protoc_insertion_point(class_scope:qdrant.NamedVectors.VectorsEntry) + }) + , + 'DESCRIPTOR' : _NAMEDVECTORS, + '__module__' : 'points_pb2' + # @@protoc_insertion_point(class_scope:qdrant.NamedVectors) + }) +_sym_db.RegisterMessage(NamedVectors) +_sym_db.RegisterMessage(NamedVectors.VectorsEntry) + +NamedVectorsOutput = _reflection.GeneratedProtocolMessageType('NamedVectorsOutput', (_message.Message,), { + + 'VectorsEntry' : _reflection.GeneratedProtocolMessageType('VectorsEntry', (_message.Message,), { + 'DESCRIPTOR' : _NAMEDVECTORSOUTPUT_VECTORSENTRY, + '__module__' : 'points_pb2' + # @@protoc_insertion_point(class_scope:qdrant.NamedVectorsOutput.VectorsEntry) + }) + , + 'DESCRIPTOR' : _NAMEDVECTORSOUTPUT, + '__module__' : 'points_pb2' + # @@protoc_insertion_point(class_scope:qdrant.NamedVectorsOutput) + }) +_sym_db.RegisterMessage(NamedVectorsOutput) +_sym_db.RegisterMessage(NamedVectorsOutput.VectorsEntry) + +Vectors = _reflection.GeneratedProtocolMessageType('Vectors', (_message.Message,), { + 'DESCRIPTOR' : _VECTORS, + '__module__' : 'points_pb2' + # @@protoc_insertion_point(class_scope:qdrant.Vectors) + }) +_sym_db.RegisterMessage(Vectors) + +VectorsOutput = _reflection.GeneratedProtocolMessageType('VectorsOutput', (_message.Message,), { + 'DESCRIPTOR' : _VECTORSOUTPUT, + '__module__' : 'points_pb2' + # @@protoc_insertion_point(class_scope:qdrant.VectorsOutput) + }) +_sym_db.RegisterMessage(VectorsOutput) + +VectorsSelector = _reflection.GeneratedProtocolMessageType('VectorsSelector', (_message.Message,), { + 'DESCRIPTOR' : _VECTORSSELECTOR, + '__module__' : 'points_pb2' + # @@protoc_insertion_point(class_scope:qdrant.VectorsSelector) + }) +_sym_db.RegisterMessage(VectorsSelector) + +WithVectorsSelector = _reflection.GeneratedProtocolMessageType('WithVectorsSelector', (_message.Message,), { + 'DESCRIPTOR' : _WITHVECTORSSELECTOR, + '__module__' : 'points_pb2' + # @@protoc_insertion_point(class_scope:qdrant.WithVectorsSelector) + }) +_sym_db.RegisterMessage(WithVectorsSelector) + +QuantizationSearchParams = _reflection.GeneratedProtocolMessageType('QuantizationSearchParams', (_message.Message,), { + 'DESCRIPTOR' : _QUANTIZATIONSEARCHPARAMS, + '__module__' : 'points_pb2' + # @@protoc_insertion_point(class_scope:qdrant.QuantizationSearchParams) + }) +_sym_db.RegisterMessage(QuantizationSearchParams) + +SearchParams = _reflection.GeneratedProtocolMessageType('SearchParams', (_message.Message,), { + 'DESCRIPTOR' : _SEARCHPARAMS, + '__module__' : 'points_pb2' + # @@protoc_insertion_point(class_scope:qdrant.SearchParams) + }) +_sym_db.RegisterMessage(SearchParams) + +SearchPoints = _reflection.GeneratedProtocolMessageType('SearchPoints', (_message.Message,), { + 'DESCRIPTOR' : _SEARCHPOINTS, + '__module__' : 'points_pb2' + # @@protoc_insertion_point(class_scope:qdrant.SearchPoints) + }) +_sym_db.RegisterMessage(SearchPoints) + +SearchBatchPoints = _reflection.GeneratedProtocolMessageType('SearchBatchPoints', (_message.Message,), { + 'DESCRIPTOR' : _SEARCHBATCHPOINTS, + '__module__' : 'points_pb2' + # @@protoc_insertion_point(class_scope:qdrant.SearchBatchPoints) + }) +_sym_db.RegisterMessage(SearchBatchPoints) + +WithLookup = _reflection.GeneratedProtocolMessageType('WithLookup', (_message.Message,), { + 'DESCRIPTOR' : _WITHLOOKUP, + '__module__' : 'points_pb2' + # @@protoc_insertion_point(class_scope:qdrant.WithLookup) + }) +_sym_db.RegisterMessage(WithLookup) + +SearchPointGroups = _reflection.GeneratedProtocolMessageType('SearchPointGroups', (_message.Message,), { + 'DESCRIPTOR' : _SEARCHPOINTGROUPS, + '__module__' : 'points_pb2' + # @@protoc_insertion_point(class_scope:qdrant.SearchPointGroups) + }) +_sym_db.RegisterMessage(SearchPointGroups) + +StartFrom = _reflection.GeneratedProtocolMessageType('StartFrom', (_message.Message,), { + 'DESCRIPTOR' : _STARTFROM, + '__module__' : 'points_pb2' + # @@protoc_insertion_point(class_scope:qdrant.StartFrom) + }) +_sym_db.RegisterMessage(StartFrom) + +OrderBy = _reflection.GeneratedProtocolMessageType('OrderBy', (_message.Message,), { + 'DESCRIPTOR' : _ORDERBY, + '__module__' : 'points_pb2' + # @@protoc_insertion_point(class_scope:qdrant.OrderBy) + }) +_sym_db.RegisterMessage(OrderBy) + +ScrollPoints = _reflection.GeneratedProtocolMessageType('ScrollPoints', (_message.Message,), { + 'DESCRIPTOR' : _SCROLLPOINTS, + '__module__' : 'points_pb2' + # @@protoc_insertion_point(class_scope:qdrant.ScrollPoints) + }) +_sym_db.RegisterMessage(ScrollPoints) + +LookupLocation = _reflection.GeneratedProtocolMessageType('LookupLocation', (_message.Message,), { + 'DESCRIPTOR' : _LOOKUPLOCATION, + '__module__' : 'points_pb2' + # @@protoc_insertion_point(class_scope:qdrant.LookupLocation) + }) +_sym_db.RegisterMessage(LookupLocation) + +RecommendPoints = _reflection.GeneratedProtocolMessageType('RecommendPoints', (_message.Message,), { + 'DESCRIPTOR' : _RECOMMENDPOINTS, + '__module__' : 'points_pb2' + # @@protoc_insertion_point(class_scope:qdrant.RecommendPoints) + }) +_sym_db.RegisterMessage(RecommendPoints) + +RecommendBatchPoints = _reflection.GeneratedProtocolMessageType('RecommendBatchPoints', (_message.Message,), { + 'DESCRIPTOR' : _RECOMMENDBATCHPOINTS, + '__module__' : 'points_pb2' + # @@protoc_insertion_point(class_scope:qdrant.RecommendBatchPoints) + }) +_sym_db.RegisterMessage(RecommendBatchPoints) + +RecommendPointGroups = _reflection.GeneratedProtocolMessageType('RecommendPointGroups', (_message.Message,), { + 'DESCRIPTOR' : _RECOMMENDPOINTGROUPS, + '__module__' : 'points_pb2' + # @@protoc_insertion_point(class_scope:qdrant.RecommendPointGroups) + }) +_sym_db.RegisterMessage(RecommendPointGroups) + +TargetVector = _reflection.GeneratedProtocolMessageType('TargetVector', (_message.Message,), { + 'DESCRIPTOR' : _TARGETVECTOR, + '__module__' : 'points_pb2' + # @@protoc_insertion_point(class_scope:qdrant.TargetVector) + }) +_sym_db.RegisterMessage(TargetVector) + +VectorExample = _reflection.GeneratedProtocolMessageType('VectorExample', (_message.Message,), { + 'DESCRIPTOR' : _VECTOREXAMPLE, + '__module__' : 'points_pb2' + # @@protoc_insertion_point(class_scope:qdrant.VectorExample) + }) +_sym_db.RegisterMessage(VectorExample) + +ContextExamplePair = _reflection.GeneratedProtocolMessageType('ContextExamplePair', (_message.Message,), { + 'DESCRIPTOR' : _CONTEXTEXAMPLEPAIR, + '__module__' : 'points_pb2' + # @@protoc_insertion_point(class_scope:qdrant.ContextExamplePair) + }) +_sym_db.RegisterMessage(ContextExamplePair) + +DiscoverPoints = _reflection.GeneratedProtocolMessageType('DiscoverPoints', (_message.Message,), { + 'DESCRIPTOR' : _DISCOVERPOINTS, + '__module__' : 'points_pb2' + # @@protoc_insertion_point(class_scope:qdrant.DiscoverPoints) + }) +_sym_db.RegisterMessage(DiscoverPoints) + +DiscoverBatchPoints = _reflection.GeneratedProtocolMessageType('DiscoverBatchPoints', (_message.Message,), { + 'DESCRIPTOR' : _DISCOVERBATCHPOINTS, + '__module__' : 'points_pb2' + # @@protoc_insertion_point(class_scope:qdrant.DiscoverBatchPoints) + }) +_sym_db.RegisterMessage(DiscoverBatchPoints) + +CountPoints = _reflection.GeneratedProtocolMessageType('CountPoints', (_message.Message,), { + 'DESCRIPTOR' : _COUNTPOINTS, + '__module__' : 'points_pb2' + # @@protoc_insertion_point(class_scope:qdrant.CountPoints) + }) +_sym_db.RegisterMessage(CountPoints) + +RecommendInput = _reflection.GeneratedProtocolMessageType('RecommendInput', (_message.Message,), { + 'DESCRIPTOR' : _RECOMMENDINPUT, + '__module__' : 'points_pb2' + # @@protoc_insertion_point(class_scope:qdrant.RecommendInput) + }) +_sym_db.RegisterMessage(RecommendInput) + +ContextInputPair = _reflection.GeneratedProtocolMessageType('ContextInputPair', (_message.Message,), { + 'DESCRIPTOR' : _CONTEXTINPUTPAIR, + '__module__' : 'points_pb2' + # @@protoc_insertion_point(class_scope:qdrant.ContextInputPair) + }) +_sym_db.RegisterMessage(ContextInputPair) + +DiscoverInput = _reflection.GeneratedProtocolMessageType('DiscoverInput', (_message.Message,), { + 'DESCRIPTOR' : _DISCOVERINPUT, + '__module__' : 'points_pb2' + # @@protoc_insertion_point(class_scope:qdrant.DiscoverInput) + }) +_sym_db.RegisterMessage(DiscoverInput) + +ContextInput = _reflection.GeneratedProtocolMessageType('ContextInput', (_message.Message,), { + 'DESCRIPTOR' : _CONTEXTINPUT, + '__module__' : 'points_pb2' + # @@protoc_insertion_point(class_scope:qdrant.ContextInput) + }) +_sym_db.RegisterMessage(ContextInput) + +Formula = _reflection.GeneratedProtocolMessageType('Formula', (_message.Message,), { + + 'DefaultsEntry' : _reflection.GeneratedProtocolMessageType('DefaultsEntry', (_message.Message,), { + 'DESCRIPTOR' : _FORMULA_DEFAULTSENTRY, + '__module__' : 'points_pb2' + # @@protoc_insertion_point(class_scope:qdrant.Formula.DefaultsEntry) + }) + , + 'DESCRIPTOR' : _FORMULA, + '__module__' : 'points_pb2' + # @@protoc_insertion_point(class_scope:qdrant.Formula) + }) +_sym_db.RegisterMessage(Formula) +_sym_db.RegisterMessage(Formula.DefaultsEntry) + +Expression = _reflection.GeneratedProtocolMessageType('Expression', (_message.Message,), { + 'DESCRIPTOR' : _EXPRESSION, + '__module__' : 'points_pb2' + # @@protoc_insertion_point(class_scope:qdrant.Expression) + }) +_sym_db.RegisterMessage(Expression) + +GeoDistance = _reflection.GeneratedProtocolMessageType('GeoDistance', (_message.Message,), { + 'DESCRIPTOR' : _GEODISTANCE, + '__module__' : 'points_pb2' + # @@protoc_insertion_point(class_scope:qdrant.GeoDistance) + }) +_sym_db.RegisterMessage(GeoDistance) + +MultExpression = _reflection.GeneratedProtocolMessageType('MultExpression', (_message.Message,), { + 'DESCRIPTOR' : _MULTEXPRESSION, + '__module__' : 'points_pb2' + # @@protoc_insertion_point(class_scope:qdrant.MultExpression) + }) +_sym_db.RegisterMessage(MultExpression) + +SumExpression = _reflection.GeneratedProtocolMessageType('SumExpression', (_message.Message,), { + 'DESCRIPTOR' : _SUMEXPRESSION, + '__module__' : 'points_pb2' + # @@protoc_insertion_point(class_scope:qdrant.SumExpression) + }) +_sym_db.RegisterMessage(SumExpression) + +DivExpression = _reflection.GeneratedProtocolMessageType('DivExpression', (_message.Message,), { + 'DESCRIPTOR' : _DIVEXPRESSION, + '__module__' : 'points_pb2' + # @@protoc_insertion_point(class_scope:qdrant.DivExpression) + }) +_sym_db.RegisterMessage(DivExpression) + +PowExpression = _reflection.GeneratedProtocolMessageType('PowExpression', (_message.Message,), { + 'DESCRIPTOR' : _POWEXPRESSION, + '__module__' : 'points_pb2' + # @@protoc_insertion_point(class_scope:qdrant.PowExpression) + }) +_sym_db.RegisterMessage(PowExpression) + +DecayParamsExpression = _reflection.GeneratedProtocolMessageType('DecayParamsExpression', (_message.Message,), { + 'DESCRIPTOR' : _DECAYPARAMSEXPRESSION, + '__module__' : 'points_pb2' + # @@protoc_insertion_point(class_scope:qdrant.DecayParamsExpression) + }) +_sym_db.RegisterMessage(DecayParamsExpression) + +NearestInputWithMmr = _reflection.GeneratedProtocolMessageType('NearestInputWithMmr', (_message.Message,), { + 'DESCRIPTOR' : _NEARESTINPUTWITHMMR, + '__module__' : 'points_pb2' + # @@protoc_insertion_point(class_scope:qdrant.NearestInputWithMmr) + }) +_sym_db.RegisterMessage(NearestInputWithMmr) + +Mmr = _reflection.GeneratedProtocolMessageType('Mmr', (_message.Message,), { + 'DESCRIPTOR' : _MMR, + '__module__' : 'points_pb2' + # @@protoc_insertion_point(class_scope:qdrant.Mmr) + }) +_sym_db.RegisterMessage(Mmr) + +Query = _reflection.GeneratedProtocolMessageType('Query', (_message.Message,), { + 'DESCRIPTOR' : _QUERY, + '__module__' : 'points_pb2' + # @@protoc_insertion_point(class_scope:qdrant.Query) + }) +_sym_db.RegisterMessage(Query) + +PrefetchQuery = _reflection.GeneratedProtocolMessageType('PrefetchQuery', (_message.Message,), { + 'DESCRIPTOR' : _PREFETCHQUERY, + '__module__' : 'points_pb2' + # @@protoc_insertion_point(class_scope:qdrant.PrefetchQuery) + }) +_sym_db.RegisterMessage(PrefetchQuery) + +QueryPoints = _reflection.GeneratedProtocolMessageType('QueryPoints', (_message.Message,), { + 'DESCRIPTOR' : _QUERYPOINTS, + '__module__' : 'points_pb2' + # @@protoc_insertion_point(class_scope:qdrant.QueryPoints) + }) +_sym_db.RegisterMessage(QueryPoints) + +QueryBatchPoints = _reflection.GeneratedProtocolMessageType('QueryBatchPoints', (_message.Message,), { + 'DESCRIPTOR' : _QUERYBATCHPOINTS, + '__module__' : 'points_pb2' + # @@protoc_insertion_point(class_scope:qdrant.QueryBatchPoints) + }) +_sym_db.RegisterMessage(QueryBatchPoints) + +QueryPointGroups = _reflection.GeneratedProtocolMessageType('QueryPointGroups', (_message.Message,), { + 'DESCRIPTOR' : _QUERYPOINTGROUPS, + '__module__' : 'points_pb2' + # @@protoc_insertion_point(class_scope:qdrant.QueryPointGroups) + }) +_sym_db.RegisterMessage(QueryPointGroups) + +FacetCounts = _reflection.GeneratedProtocolMessageType('FacetCounts', (_message.Message,), { + 'DESCRIPTOR' : _FACETCOUNTS, + '__module__' : 'points_pb2' + # @@protoc_insertion_point(class_scope:qdrant.FacetCounts) + }) +_sym_db.RegisterMessage(FacetCounts) + +FacetValue = _reflection.GeneratedProtocolMessageType('FacetValue', (_message.Message,), { + 'DESCRIPTOR' : _FACETVALUE, + '__module__' : 'points_pb2' + # @@protoc_insertion_point(class_scope:qdrant.FacetValue) + }) +_sym_db.RegisterMessage(FacetValue) + +FacetHit = _reflection.GeneratedProtocolMessageType('FacetHit', (_message.Message,), { + 'DESCRIPTOR' : _FACETHIT, + '__module__' : 'points_pb2' + # @@protoc_insertion_point(class_scope:qdrant.FacetHit) + }) +_sym_db.RegisterMessage(FacetHit) + +SearchMatrixPoints = _reflection.GeneratedProtocolMessageType('SearchMatrixPoints', (_message.Message,), { + 'DESCRIPTOR' : _SEARCHMATRIXPOINTS, + '__module__' : 'points_pb2' + # @@protoc_insertion_point(class_scope:qdrant.SearchMatrixPoints) + }) +_sym_db.RegisterMessage(SearchMatrixPoints) + +SearchMatrixPairs = _reflection.GeneratedProtocolMessageType('SearchMatrixPairs', (_message.Message,), { + 'DESCRIPTOR' : _SEARCHMATRIXPAIRS, + '__module__' : 'points_pb2' + # @@protoc_insertion_point(class_scope:qdrant.SearchMatrixPairs) + }) +_sym_db.RegisterMessage(SearchMatrixPairs) + +SearchMatrixPair = _reflection.GeneratedProtocolMessageType('SearchMatrixPair', (_message.Message,), { + 'DESCRIPTOR' : _SEARCHMATRIXPAIR, + '__module__' : 'points_pb2' + # @@protoc_insertion_point(class_scope:qdrant.SearchMatrixPair) + }) +_sym_db.RegisterMessage(SearchMatrixPair) + +SearchMatrixOffsets = _reflection.GeneratedProtocolMessageType('SearchMatrixOffsets', (_message.Message,), { + 'DESCRIPTOR' : _SEARCHMATRIXOFFSETS, + '__module__' : 'points_pb2' + # @@protoc_insertion_point(class_scope:qdrant.SearchMatrixOffsets) + }) +_sym_db.RegisterMessage(SearchMatrixOffsets) + +PointsUpdateOperation = _reflection.GeneratedProtocolMessageType('PointsUpdateOperation', (_message.Message,), { + + 'PointStructList' : _reflection.GeneratedProtocolMessageType('PointStructList', (_message.Message,), { + 'DESCRIPTOR' : _POINTSUPDATEOPERATION_POINTSTRUCTLIST, + '__module__' : 'points_pb2' + # @@protoc_insertion_point(class_scope:qdrant.PointsUpdateOperation.PointStructList) + }) + , + + 'SetPayload' : _reflection.GeneratedProtocolMessageType('SetPayload', (_message.Message,), { + + 'PayloadEntry' : _reflection.GeneratedProtocolMessageType('PayloadEntry', (_message.Message,), { + 'DESCRIPTOR' : _POINTSUPDATEOPERATION_SETPAYLOAD_PAYLOADENTRY, + '__module__' : 'points_pb2' + # @@protoc_insertion_point(class_scope:qdrant.PointsUpdateOperation.SetPayload.PayloadEntry) + }) + , + 'DESCRIPTOR' : _POINTSUPDATEOPERATION_SETPAYLOAD, + '__module__' : 'points_pb2' + # @@protoc_insertion_point(class_scope:qdrant.PointsUpdateOperation.SetPayload) + }) + , + + 'OverwritePayload' : _reflection.GeneratedProtocolMessageType('OverwritePayload', (_message.Message,), { + + 'PayloadEntry' : _reflection.GeneratedProtocolMessageType('PayloadEntry', (_message.Message,), { + 'DESCRIPTOR' : _POINTSUPDATEOPERATION_OVERWRITEPAYLOAD_PAYLOADENTRY, + '__module__' : 'points_pb2' + # @@protoc_insertion_point(class_scope:qdrant.PointsUpdateOperation.OverwritePayload.PayloadEntry) + }) + , + 'DESCRIPTOR' : _POINTSUPDATEOPERATION_OVERWRITEPAYLOAD, + '__module__' : 'points_pb2' + # @@protoc_insertion_point(class_scope:qdrant.PointsUpdateOperation.OverwritePayload) + }) + , + + 'DeletePayload' : _reflection.GeneratedProtocolMessageType('DeletePayload', (_message.Message,), { + 'DESCRIPTOR' : _POINTSUPDATEOPERATION_DELETEPAYLOAD, + '__module__' : 'points_pb2' + # @@protoc_insertion_point(class_scope:qdrant.PointsUpdateOperation.DeletePayload) + }) + , + + 'UpdateVectors' : _reflection.GeneratedProtocolMessageType('UpdateVectors', (_message.Message,), { + 'DESCRIPTOR' : _POINTSUPDATEOPERATION_UPDATEVECTORS, + '__module__' : 'points_pb2' + # @@protoc_insertion_point(class_scope:qdrant.PointsUpdateOperation.UpdateVectors) + }) + , + + 'DeleteVectors' : _reflection.GeneratedProtocolMessageType('DeleteVectors', (_message.Message,), { + 'DESCRIPTOR' : _POINTSUPDATEOPERATION_DELETEVECTORS, + '__module__' : 'points_pb2' + # @@protoc_insertion_point(class_scope:qdrant.PointsUpdateOperation.DeleteVectors) + }) + , + + 'DeletePoints' : _reflection.GeneratedProtocolMessageType('DeletePoints', (_message.Message,), { + 'DESCRIPTOR' : _POINTSUPDATEOPERATION_DELETEPOINTS, + '__module__' : 'points_pb2' + # @@protoc_insertion_point(class_scope:qdrant.PointsUpdateOperation.DeletePoints) + }) + , + + 'ClearPayload' : _reflection.GeneratedProtocolMessageType('ClearPayload', (_message.Message,), { + 'DESCRIPTOR' : _POINTSUPDATEOPERATION_CLEARPAYLOAD, + '__module__' : 'points_pb2' + # @@protoc_insertion_point(class_scope:qdrant.PointsUpdateOperation.ClearPayload) + }) + , + 'DESCRIPTOR' : _POINTSUPDATEOPERATION, + '__module__' : 'points_pb2' + # @@protoc_insertion_point(class_scope:qdrant.PointsUpdateOperation) + }) +_sym_db.RegisterMessage(PointsUpdateOperation) +_sym_db.RegisterMessage(PointsUpdateOperation.PointStructList) +_sym_db.RegisterMessage(PointsUpdateOperation.SetPayload) +_sym_db.RegisterMessage(PointsUpdateOperation.SetPayload.PayloadEntry) +_sym_db.RegisterMessage(PointsUpdateOperation.OverwritePayload) +_sym_db.RegisterMessage(PointsUpdateOperation.OverwritePayload.PayloadEntry) +_sym_db.RegisterMessage(PointsUpdateOperation.DeletePayload) +_sym_db.RegisterMessage(PointsUpdateOperation.UpdateVectors) +_sym_db.RegisterMessage(PointsUpdateOperation.DeleteVectors) +_sym_db.RegisterMessage(PointsUpdateOperation.DeletePoints) +_sym_db.RegisterMessage(PointsUpdateOperation.ClearPayload) + +UpdateBatchPoints = _reflection.GeneratedProtocolMessageType('UpdateBatchPoints', (_message.Message,), { + 'DESCRIPTOR' : _UPDATEBATCHPOINTS, + '__module__' : 'points_pb2' + # @@protoc_insertion_point(class_scope:qdrant.UpdateBatchPoints) + }) +_sym_db.RegisterMessage(UpdateBatchPoints) + +PointsOperationResponse = _reflection.GeneratedProtocolMessageType('PointsOperationResponse', (_message.Message,), { + 'DESCRIPTOR' : _POINTSOPERATIONRESPONSE, + '__module__' : 'points_pb2' + # @@protoc_insertion_point(class_scope:qdrant.PointsOperationResponse) + }) +_sym_db.RegisterMessage(PointsOperationResponse) + +UpdateResult = _reflection.GeneratedProtocolMessageType('UpdateResult', (_message.Message,), { + 'DESCRIPTOR' : _UPDATERESULT, + '__module__' : 'points_pb2' + # @@protoc_insertion_point(class_scope:qdrant.UpdateResult) + }) +_sym_db.RegisterMessage(UpdateResult) + +OrderValue = _reflection.GeneratedProtocolMessageType('OrderValue', (_message.Message,), { + 'DESCRIPTOR' : _ORDERVALUE, + '__module__' : 'points_pb2' + # @@protoc_insertion_point(class_scope:qdrant.OrderValue) + }) +_sym_db.RegisterMessage(OrderValue) + +ScoredPoint = _reflection.GeneratedProtocolMessageType('ScoredPoint', (_message.Message,), { + + 'PayloadEntry' : _reflection.GeneratedProtocolMessageType('PayloadEntry', (_message.Message,), { + 'DESCRIPTOR' : _SCOREDPOINT_PAYLOADENTRY, + '__module__' : 'points_pb2' + # @@protoc_insertion_point(class_scope:qdrant.ScoredPoint.PayloadEntry) + }) + , + 'DESCRIPTOR' : _SCOREDPOINT, + '__module__' : 'points_pb2' + # @@protoc_insertion_point(class_scope:qdrant.ScoredPoint) + }) +_sym_db.RegisterMessage(ScoredPoint) +_sym_db.RegisterMessage(ScoredPoint.PayloadEntry) + +GroupId = _reflection.GeneratedProtocolMessageType('GroupId', (_message.Message,), { + 'DESCRIPTOR' : _GROUPID, + '__module__' : 'points_pb2' + # @@protoc_insertion_point(class_scope:qdrant.GroupId) + }) +_sym_db.RegisterMessage(GroupId) + +PointGroup = _reflection.GeneratedProtocolMessageType('PointGroup', (_message.Message,), { + 'DESCRIPTOR' : _POINTGROUP, + '__module__' : 'points_pb2' + # @@protoc_insertion_point(class_scope:qdrant.PointGroup) + }) +_sym_db.RegisterMessage(PointGroup) + +GroupsResult = _reflection.GeneratedProtocolMessageType('GroupsResult', (_message.Message,), { + 'DESCRIPTOR' : _GROUPSRESULT, + '__module__' : 'points_pb2' + # @@protoc_insertion_point(class_scope:qdrant.GroupsResult) + }) +_sym_db.RegisterMessage(GroupsResult) + +SearchResponse = _reflection.GeneratedProtocolMessageType('SearchResponse', (_message.Message,), { + 'DESCRIPTOR' : _SEARCHRESPONSE, + '__module__' : 'points_pb2' + # @@protoc_insertion_point(class_scope:qdrant.SearchResponse) + }) +_sym_db.RegisterMessage(SearchResponse) + +QueryResponse = _reflection.GeneratedProtocolMessageType('QueryResponse', (_message.Message,), { + 'DESCRIPTOR' : _QUERYRESPONSE, + '__module__' : 'points_pb2' + # @@protoc_insertion_point(class_scope:qdrant.QueryResponse) + }) +_sym_db.RegisterMessage(QueryResponse) + +QueryBatchResponse = _reflection.GeneratedProtocolMessageType('QueryBatchResponse', (_message.Message,), { + 'DESCRIPTOR' : _QUERYBATCHRESPONSE, + '__module__' : 'points_pb2' + # @@protoc_insertion_point(class_scope:qdrant.QueryBatchResponse) + }) +_sym_db.RegisterMessage(QueryBatchResponse) + +QueryGroupsResponse = _reflection.GeneratedProtocolMessageType('QueryGroupsResponse', (_message.Message,), { + 'DESCRIPTOR' : _QUERYGROUPSRESPONSE, + '__module__' : 'points_pb2' + # @@protoc_insertion_point(class_scope:qdrant.QueryGroupsResponse) + }) +_sym_db.RegisterMessage(QueryGroupsResponse) + +BatchResult = _reflection.GeneratedProtocolMessageType('BatchResult', (_message.Message,), { + 'DESCRIPTOR' : _BATCHRESULT, + '__module__' : 'points_pb2' + # @@protoc_insertion_point(class_scope:qdrant.BatchResult) + }) +_sym_db.RegisterMessage(BatchResult) + +SearchBatchResponse = _reflection.GeneratedProtocolMessageType('SearchBatchResponse', (_message.Message,), { + 'DESCRIPTOR' : _SEARCHBATCHRESPONSE, + '__module__' : 'points_pb2' + # @@protoc_insertion_point(class_scope:qdrant.SearchBatchResponse) + }) +_sym_db.RegisterMessage(SearchBatchResponse) + +SearchGroupsResponse = _reflection.GeneratedProtocolMessageType('SearchGroupsResponse', (_message.Message,), { + 'DESCRIPTOR' : _SEARCHGROUPSRESPONSE, + '__module__' : 'points_pb2' + # @@protoc_insertion_point(class_scope:qdrant.SearchGroupsResponse) + }) +_sym_db.RegisterMessage(SearchGroupsResponse) + +CountResponse = _reflection.GeneratedProtocolMessageType('CountResponse', (_message.Message,), { + 'DESCRIPTOR' : _COUNTRESPONSE, + '__module__' : 'points_pb2' + # @@protoc_insertion_point(class_scope:qdrant.CountResponse) + }) +_sym_db.RegisterMessage(CountResponse) + +ScrollResponse = _reflection.GeneratedProtocolMessageType('ScrollResponse', (_message.Message,), { + 'DESCRIPTOR' : _SCROLLRESPONSE, + '__module__' : 'points_pb2' + # @@protoc_insertion_point(class_scope:qdrant.ScrollResponse) + }) +_sym_db.RegisterMessage(ScrollResponse) + +CountResult = _reflection.GeneratedProtocolMessageType('CountResult', (_message.Message,), { + 'DESCRIPTOR' : _COUNTRESULT, + '__module__' : 'points_pb2' + # @@protoc_insertion_point(class_scope:qdrant.CountResult) + }) +_sym_db.RegisterMessage(CountResult) + +RetrievedPoint = _reflection.GeneratedProtocolMessageType('RetrievedPoint', (_message.Message,), { + + 'PayloadEntry' : _reflection.GeneratedProtocolMessageType('PayloadEntry', (_message.Message,), { + 'DESCRIPTOR' : _RETRIEVEDPOINT_PAYLOADENTRY, + '__module__' : 'points_pb2' + # @@protoc_insertion_point(class_scope:qdrant.RetrievedPoint.PayloadEntry) + }) + , + 'DESCRIPTOR' : _RETRIEVEDPOINT, + '__module__' : 'points_pb2' + # @@protoc_insertion_point(class_scope:qdrant.RetrievedPoint) + }) +_sym_db.RegisterMessage(RetrievedPoint) +_sym_db.RegisterMessage(RetrievedPoint.PayloadEntry) + +GetResponse = _reflection.GeneratedProtocolMessageType('GetResponse', (_message.Message,), { + 'DESCRIPTOR' : _GETRESPONSE, + '__module__' : 'points_pb2' + # @@protoc_insertion_point(class_scope:qdrant.GetResponse) + }) +_sym_db.RegisterMessage(GetResponse) + +RecommendResponse = _reflection.GeneratedProtocolMessageType('RecommendResponse', (_message.Message,), { + 'DESCRIPTOR' : _RECOMMENDRESPONSE, + '__module__' : 'points_pb2' + # @@protoc_insertion_point(class_scope:qdrant.RecommendResponse) + }) +_sym_db.RegisterMessage(RecommendResponse) + +RecommendBatchResponse = _reflection.GeneratedProtocolMessageType('RecommendBatchResponse', (_message.Message,), { + 'DESCRIPTOR' : _RECOMMENDBATCHRESPONSE, + '__module__' : 'points_pb2' + # @@protoc_insertion_point(class_scope:qdrant.RecommendBatchResponse) + }) +_sym_db.RegisterMessage(RecommendBatchResponse) + +DiscoverResponse = _reflection.GeneratedProtocolMessageType('DiscoverResponse', (_message.Message,), { + 'DESCRIPTOR' : _DISCOVERRESPONSE, + '__module__' : 'points_pb2' + # @@protoc_insertion_point(class_scope:qdrant.DiscoverResponse) + }) +_sym_db.RegisterMessage(DiscoverResponse) + +DiscoverBatchResponse = _reflection.GeneratedProtocolMessageType('DiscoverBatchResponse', (_message.Message,), { + 'DESCRIPTOR' : _DISCOVERBATCHRESPONSE, + '__module__' : 'points_pb2' + # @@protoc_insertion_point(class_scope:qdrant.DiscoverBatchResponse) + }) +_sym_db.RegisterMessage(DiscoverBatchResponse) + +RecommendGroupsResponse = _reflection.GeneratedProtocolMessageType('RecommendGroupsResponse', (_message.Message,), { + 'DESCRIPTOR' : _RECOMMENDGROUPSRESPONSE, + '__module__' : 'points_pb2' + # @@protoc_insertion_point(class_scope:qdrant.RecommendGroupsResponse) + }) +_sym_db.RegisterMessage(RecommendGroupsResponse) + +UpdateBatchResponse = _reflection.GeneratedProtocolMessageType('UpdateBatchResponse', (_message.Message,), { + 'DESCRIPTOR' : _UPDATEBATCHRESPONSE, + '__module__' : 'points_pb2' + # @@protoc_insertion_point(class_scope:qdrant.UpdateBatchResponse) + }) +_sym_db.RegisterMessage(UpdateBatchResponse) + +FacetResponse = _reflection.GeneratedProtocolMessageType('FacetResponse', (_message.Message,), { + 'DESCRIPTOR' : _FACETRESPONSE, + '__module__' : 'points_pb2' + # @@protoc_insertion_point(class_scope:qdrant.FacetResponse) + }) +_sym_db.RegisterMessage(FacetResponse) + +SearchMatrixPairsResponse = _reflection.GeneratedProtocolMessageType('SearchMatrixPairsResponse', (_message.Message,), { + 'DESCRIPTOR' : _SEARCHMATRIXPAIRSRESPONSE, + '__module__' : 'points_pb2' + # @@protoc_insertion_point(class_scope:qdrant.SearchMatrixPairsResponse) + }) +_sym_db.RegisterMessage(SearchMatrixPairsResponse) + +SearchMatrixOffsetsResponse = _reflection.GeneratedProtocolMessageType('SearchMatrixOffsetsResponse', (_message.Message,), { + 'DESCRIPTOR' : _SEARCHMATRIXOFFSETSRESPONSE, + '__module__' : 'points_pb2' + # @@protoc_insertion_point(class_scope:qdrant.SearchMatrixOffsetsResponse) + }) +_sym_db.RegisterMessage(SearchMatrixOffsetsResponse) + +Filter = _reflection.GeneratedProtocolMessageType('Filter', (_message.Message,), { + 'DESCRIPTOR' : _FILTER, + '__module__' : 'points_pb2' + # @@protoc_insertion_point(class_scope:qdrant.Filter) + }) +_sym_db.RegisterMessage(Filter) + +MinShould = _reflection.GeneratedProtocolMessageType('MinShould', (_message.Message,), { + 'DESCRIPTOR' : _MINSHOULD, + '__module__' : 'points_pb2' + # @@protoc_insertion_point(class_scope:qdrant.MinShould) + }) +_sym_db.RegisterMessage(MinShould) + +Condition = _reflection.GeneratedProtocolMessageType('Condition', (_message.Message,), { + 'DESCRIPTOR' : _CONDITION, + '__module__' : 'points_pb2' + # @@protoc_insertion_point(class_scope:qdrant.Condition) + }) +_sym_db.RegisterMessage(Condition) + +IsEmptyCondition = _reflection.GeneratedProtocolMessageType('IsEmptyCondition', (_message.Message,), { + 'DESCRIPTOR' : _ISEMPTYCONDITION, + '__module__' : 'points_pb2' + # @@protoc_insertion_point(class_scope:qdrant.IsEmptyCondition) + }) +_sym_db.RegisterMessage(IsEmptyCondition) + +IsNullCondition = _reflection.GeneratedProtocolMessageType('IsNullCondition', (_message.Message,), { + 'DESCRIPTOR' : _ISNULLCONDITION, + '__module__' : 'points_pb2' + # @@protoc_insertion_point(class_scope:qdrant.IsNullCondition) + }) +_sym_db.RegisterMessage(IsNullCondition) + +HasIdCondition = _reflection.GeneratedProtocolMessageType('HasIdCondition', (_message.Message,), { + 'DESCRIPTOR' : _HASIDCONDITION, + '__module__' : 'points_pb2' + # @@protoc_insertion_point(class_scope:qdrant.HasIdCondition) + }) +_sym_db.RegisterMessage(HasIdCondition) + +HasVectorCondition = _reflection.GeneratedProtocolMessageType('HasVectorCondition', (_message.Message,), { + 'DESCRIPTOR' : _HASVECTORCONDITION, + '__module__' : 'points_pb2' + # @@protoc_insertion_point(class_scope:qdrant.HasVectorCondition) + }) +_sym_db.RegisterMessage(HasVectorCondition) + +NestedCondition = _reflection.GeneratedProtocolMessageType('NestedCondition', (_message.Message,), { + 'DESCRIPTOR' : _NESTEDCONDITION, + '__module__' : 'points_pb2' + # @@protoc_insertion_point(class_scope:qdrant.NestedCondition) + }) +_sym_db.RegisterMessage(NestedCondition) + +FieldCondition = _reflection.GeneratedProtocolMessageType('FieldCondition', (_message.Message,), { + 'DESCRIPTOR' : _FIELDCONDITION, + '__module__' : 'points_pb2' + # @@protoc_insertion_point(class_scope:qdrant.FieldCondition) + }) +_sym_db.RegisterMessage(FieldCondition) + +Match = _reflection.GeneratedProtocolMessageType('Match', (_message.Message,), { + 'DESCRIPTOR' : _MATCH, + '__module__' : 'points_pb2' + # @@protoc_insertion_point(class_scope:qdrant.Match) + }) +_sym_db.RegisterMessage(Match) + +RepeatedStrings = _reflection.GeneratedProtocolMessageType('RepeatedStrings', (_message.Message,), { + 'DESCRIPTOR' : _REPEATEDSTRINGS, + '__module__' : 'points_pb2' + # @@protoc_insertion_point(class_scope:qdrant.RepeatedStrings) + }) +_sym_db.RegisterMessage(RepeatedStrings) + +RepeatedIntegers = _reflection.GeneratedProtocolMessageType('RepeatedIntegers', (_message.Message,), { + 'DESCRIPTOR' : _REPEATEDINTEGERS, + '__module__' : 'points_pb2' + # @@protoc_insertion_point(class_scope:qdrant.RepeatedIntegers) + }) +_sym_db.RegisterMessage(RepeatedIntegers) + +Range = _reflection.GeneratedProtocolMessageType('Range', (_message.Message,), { + 'DESCRIPTOR' : _RANGE, + '__module__' : 'points_pb2' + # @@protoc_insertion_point(class_scope:qdrant.Range) + }) +_sym_db.RegisterMessage(Range) + +DatetimeRange = _reflection.GeneratedProtocolMessageType('DatetimeRange', (_message.Message,), { + 'DESCRIPTOR' : _DATETIMERANGE, + '__module__' : 'points_pb2' + # @@protoc_insertion_point(class_scope:qdrant.DatetimeRange) + }) +_sym_db.RegisterMessage(DatetimeRange) + +GeoBoundingBox = _reflection.GeneratedProtocolMessageType('GeoBoundingBox', (_message.Message,), { + 'DESCRIPTOR' : _GEOBOUNDINGBOX, + '__module__' : 'points_pb2' + # @@protoc_insertion_point(class_scope:qdrant.GeoBoundingBox) + }) +_sym_db.RegisterMessage(GeoBoundingBox) + +GeoRadius = _reflection.GeneratedProtocolMessageType('GeoRadius', (_message.Message,), { + 'DESCRIPTOR' : _GEORADIUS, + '__module__' : 'points_pb2' + # @@protoc_insertion_point(class_scope:qdrant.GeoRadius) + }) +_sym_db.RegisterMessage(GeoRadius) + +GeoLineString = _reflection.GeneratedProtocolMessageType('GeoLineString', (_message.Message,), { + 'DESCRIPTOR' : _GEOLINESTRING, + '__module__' : 'points_pb2' + # @@protoc_insertion_point(class_scope:qdrant.GeoLineString) + }) +_sym_db.RegisterMessage(GeoLineString) + +GeoPolygon = _reflection.GeneratedProtocolMessageType('GeoPolygon', (_message.Message,), { + 'DESCRIPTOR' : _GEOPOLYGON, + '__module__' : 'points_pb2' + # @@protoc_insertion_point(class_scope:qdrant.GeoPolygon) + }) +_sym_db.RegisterMessage(GeoPolygon) + +ValuesCount = _reflection.GeneratedProtocolMessageType('ValuesCount', (_message.Message,), { + 'DESCRIPTOR' : _VALUESCOUNT, + '__module__' : 'points_pb2' + # @@protoc_insertion_point(class_scope:qdrant.ValuesCount) + }) +_sym_db.RegisterMessage(ValuesCount) + +PointsSelector = _reflection.GeneratedProtocolMessageType('PointsSelector', (_message.Message,), { + 'DESCRIPTOR' : _POINTSSELECTOR, + '__module__' : 'points_pb2' + # @@protoc_insertion_point(class_scope:qdrant.PointsSelector) + }) +_sym_db.RegisterMessage(PointsSelector) + +PointsIdsList = _reflection.GeneratedProtocolMessageType('PointsIdsList', (_message.Message,), { + 'DESCRIPTOR' : _POINTSIDSLIST, + '__module__' : 'points_pb2' + # @@protoc_insertion_point(class_scope:qdrant.PointsIdsList) + }) +_sym_db.RegisterMessage(PointsIdsList) + +PointStruct = _reflection.GeneratedProtocolMessageType('PointStruct', (_message.Message,), { + + 'PayloadEntry' : _reflection.GeneratedProtocolMessageType('PayloadEntry', (_message.Message,), { + 'DESCRIPTOR' : _POINTSTRUCT_PAYLOADENTRY, + '__module__' : 'points_pb2' + # @@protoc_insertion_point(class_scope:qdrant.PointStruct.PayloadEntry) + }) + , + 'DESCRIPTOR' : _POINTSTRUCT, + '__module__' : 'points_pb2' + # @@protoc_insertion_point(class_scope:qdrant.PointStruct) + }) +_sym_db.RegisterMessage(PointStruct) +_sym_db.RegisterMessage(PointStruct.PayloadEntry) + +GeoPoint = _reflection.GeneratedProtocolMessageType('GeoPoint', (_message.Message,), { + 'DESCRIPTOR' : _GEOPOINT, + '__module__' : 'points_pb2' + # @@protoc_insertion_point(class_scope:qdrant.GeoPoint) + }) +_sym_db.RegisterMessage(GeoPoint) + +Usage = _reflection.GeneratedProtocolMessageType('Usage', (_message.Message,), { + 'DESCRIPTOR' : _USAGE, + '__module__' : 'points_pb2' + # @@protoc_insertion_point(class_scope:qdrant.Usage) + }) +_sym_db.RegisterMessage(Usage) + +InferenceUsage = _reflection.GeneratedProtocolMessageType('InferenceUsage', (_message.Message,), { + + 'ModelsEntry' : _reflection.GeneratedProtocolMessageType('ModelsEntry', (_message.Message,), { + 'DESCRIPTOR' : _INFERENCEUSAGE_MODELSENTRY, + '__module__' : 'points_pb2' + # @@protoc_insertion_point(class_scope:qdrant.InferenceUsage.ModelsEntry) + }) + , + 'DESCRIPTOR' : _INFERENCEUSAGE, + '__module__' : 'points_pb2' + # @@protoc_insertion_point(class_scope:qdrant.InferenceUsage) + }) +_sym_db.RegisterMessage(InferenceUsage) +_sym_db.RegisterMessage(InferenceUsage.ModelsEntry) + +ModelUsage = _reflection.GeneratedProtocolMessageType('ModelUsage', (_message.Message,), { + 'DESCRIPTOR' : _MODELUSAGE, + '__module__' : 'points_pb2' + # @@protoc_insertion_point(class_scope:qdrant.ModelUsage) + }) +_sym_db.RegisterMessage(ModelUsage) + +HardwareUsage = _reflection.GeneratedProtocolMessageType('HardwareUsage', (_message.Message,), { + 'DESCRIPTOR' : _HARDWAREUSAGE, + '__module__' : 'points_pb2' + # @@protoc_insertion_point(class_scope:qdrant.HardwareUsage) + }) +_sym_db.RegisterMessage(HardwareUsage) + +if _descriptor._USE_C_DESCRIPTORS == False: + + DESCRIPTOR._options = None + DESCRIPTOR._serialized_options = b'\252\002\022Qdrant.Client.Grpc' + _DOCUMENT_OPTIONSENTRY._options = None + _DOCUMENT_OPTIONSENTRY._serialized_options = b'8\001' + _IMAGE_OPTIONSENTRY._options = None + _IMAGE_OPTIONSENTRY._serialized_options = b'8\001' + _INFERENCEOBJECT_OPTIONSENTRY._options = None + _INFERENCEOBJECT_OPTIONSENTRY._serialized_options = b'8\001' + _SETPAYLOADPOINTS_PAYLOADENTRY._options = None + _SETPAYLOADPOINTS_PAYLOADENTRY._serialized_options = b'8\001' + _NAMEDVECTORS_VECTORSENTRY._options = None + _NAMEDVECTORS_VECTORSENTRY._serialized_options = b'8\001' + _NAMEDVECTORSOUTPUT_VECTORSENTRY._options = None + _NAMEDVECTORSOUTPUT_VECTORSENTRY._serialized_options = b'8\001' + _FORMULA_DEFAULTSENTRY._options = None + _FORMULA_DEFAULTSENTRY._serialized_options = b'8\001' + _POINTSUPDATEOPERATION_SETPAYLOAD_PAYLOADENTRY._options = None + _POINTSUPDATEOPERATION_SETPAYLOAD_PAYLOADENTRY._serialized_options = b'8\001' + _POINTSUPDATEOPERATION_OVERWRITEPAYLOAD_PAYLOADENTRY._options = None + _POINTSUPDATEOPERATION_OVERWRITEPAYLOAD_PAYLOADENTRY._serialized_options = b'8\001' + _POINTSUPDATEOPERATION.fields_by_name['delete_deprecated']._options = None + _POINTSUPDATEOPERATION.fields_by_name['delete_deprecated']._serialized_options = b'\030\001' + _POINTSUPDATEOPERATION.fields_by_name['clear_payload_deprecated']._options = None + _POINTSUPDATEOPERATION.fields_by_name['clear_payload_deprecated']._serialized_options = b'\030\001' + _SCOREDPOINT_PAYLOADENTRY._options = None + _SCOREDPOINT_PAYLOADENTRY._serialized_options = b'8\001' + _RETRIEVEDPOINT_PAYLOADENTRY._options = None + _RETRIEVEDPOINT_PAYLOADENTRY._serialized_options = b'8\001' + _POINTSTRUCT_PAYLOADENTRY._options = None + _POINTSTRUCT_PAYLOADENTRY._serialized_options = b'8\001' + _INFERENCEUSAGE_MODELSENTRY._options = None + _INFERENCEUSAGE_MODELSENTRY._serialized_options = b'8\001' + _WRITEORDERINGTYPE._serialized_start=27430 + _WRITEORDERINGTYPE._serialized_end=27483 + _READCONSISTENCYTYPE._serialized_start=27485 + _READCONSISTENCYTYPE._serialized_end=27541 + _FIELDTYPE._serialized_start=27544 + _FIELDTYPE._serialized_end=27717 + _DIRECTION._serialized_start=27719 + _DIRECTION._serialized_end=27749 + _RECOMMENDSTRATEGY._serialized_start=27751 + _RECOMMENDSTRATEGY._serialized_end=27819 + _FUSION._serialized_start=27821 + _FUSION._serialized_end=27848 + _SAMPLE._serialized_start=27850 + _SAMPLE._serialized_end=27870 + _UPDATESTATUS._serialized_start=27872 + _UPDATESTATUS._serialized_end=27963 + _WRITEORDERING._serialized_start=97 + _WRITEORDERING._serialized_end=153 + _READCONSISTENCY._serialized_start=155 + _READCONSISTENCY._serialized_end=244 + _POINTID._serialized_start=246 + _POINTID._serialized_end=306 + _SPARSEINDICES._serialized_start=308 + _SPARSEINDICES._serialized_end=337 + _DOCUMENT._serialized_start=340 + _DOCUMENT._serialized_end=490 + _DOCUMENT_OPTIONSENTRY._serialized_start=429 + _DOCUMENT_OPTIONSENTRY._serialized_end=490 + _IMAGE._serialized_start=493 + _IMAGE._serialized_end=653 + _IMAGE_OPTIONSENTRY._serialized_start=429 + _IMAGE_OPTIONSENTRY._serialized_end=490 + _INFERENCEOBJECT._serialized_start=656 + _INFERENCEOBJECT._serialized_end=837 + _INFERENCEOBJECT_OPTIONSENTRY._serialized_start=429 + _INFERENCEOBJECT_OPTIONSENTRY._serialized_end=490 + _VECTOR._serialized_start=840 + _VECTOR._serialized_end=1215 + _VECTOROUTPUT._serialized_start=1218 + _VECTOROUTPUT._serialized_end=1486 + _DENSEVECTOR._serialized_start=1488 + _DENSEVECTOR._serialized_end=1515 + _SPARSEVECTOR._serialized_start=1517 + _SPARSEVECTOR._serialized_end=1564 + _MULTIDENSEVECTOR._serialized_start=1566 + _MULTIDENSEVECTOR._serialized_end=1622 + _VECTORINPUT._serialized_start=1625 + _VECTORINPUT._serialized_end=1920 + _SHARDKEYSELECTOR._serialized_start=1922 + _SHARDKEYSELECTOR._serialized_end=1978 + _UPSERTPOINTS._serialized_start=1981 + _UPSERTPOINTS._serialized_end=2226 + _DELETEPOINTS._serialized_start=2229 + _DELETEPOINTS._serialized_end=2477 + _GETPOINTS._serialized_start=2480 + _GETPOINTS._serialized_end=2869 + _UPDATEPOINTVECTORS._serialized_start=2872 + _UPDATEPOINTVECTORS._serialized_end=3124 + _POINTVECTORS._serialized_start=3126 + _POINTVECTORS._serialized_end=3203 + _DELETEPOINTVECTORS._serialized_start=3206 + _DELETEPOINTVECTORS._serialized_end=3511 + _SETPAYLOADPOINTS._serialized_start=3514 + _SETPAYLOADPOINTS._serialized_end=3951 + _SETPAYLOADPOINTS_PAYLOADENTRY._serialized_start=3811 + _SETPAYLOADPOINTS_PAYLOADENTRY._serialized_end=3872 + _DELETEPAYLOADPOINTS._serialized_start=3954 + _DELETEPAYLOADPOINTS._serialized_end=4263 + _CLEARPAYLOADPOINTS._serialized_start=4266 + _CLEARPAYLOADPOINTS._serialized_end=4520 + _CREATEFIELDINDEXCOLLECTION._serialized_start=4523 + _CREATEFIELDINDEXCOLLECTION._serialized_end=4826 + _DELETEFIELDINDEXCOLLECTION._serialized_start=4829 + _DELETEFIELDINDEXCOLLECTION._serialized_end=4989 + _PAYLOADINCLUDESELECTOR._serialized_start=4991 + _PAYLOADINCLUDESELECTOR._serialized_end=5031 + _PAYLOADEXCLUDESELECTOR._serialized_start=5033 + _PAYLOADEXCLUDESELECTOR._serialized_end=5073 + _WITHPAYLOADSELECTOR._serialized_start=5076 + _WITHPAYLOADSELECTOR._serialized_end=5237 + _NAMEDVECTORS._serialized_start=5240 + _NAMEDVECTORS._serialized_end=5370 + _NAMEDVECTORS_VECTORSENTRY._serialized_start=5308 + _NAMEDVECTORS_VECTORSENTRY._serialized_end=5370 + _NAMEDVECTORSOUTPUT._serialized_start=5373 + _NAMEDVECTORSOUTPUT._serialized_end=5521 + _NAMEDVECTORSOUTPUT_VECTORSENTRY._serialized_start=5453 + _NAMEDVECTORSOUTPUT_VECTORSENTRY._serialized_end=5521 + _VECTORS._serialized_start=5523 + _VECTORS._serialized_end=5626 + _VECTORSOUTPUT._serialized_start=5628 + _VECTORSOUTPUT._serialized_end=5749 + _VECTORSSELECTOR._serialized_start=5751 + _VECTORSSELECTOR._serialized_end=5783 + _WITHVECTORSSELECTOR._serialized_start=5785 + _WITHVECTORSSELECTOR._serialized_end=5888 + _QUANTIZATIONSEARCHPARAMS._serialized_start=5891 + _QUANTIZATIONSEARCHPARAMS._serialized_end=6027 + _SEARCHPARAMS._serialized_start=6030 + _SEARCHPARAMS._serialized_end=6230 + _SEARCHPOINTS._serialized_start=6233 + _SEARCHPOINTS._serialized_end=6891 + _SEARCHBATCHPOINTS._serialized_start=6894 + _SEARCHBATCHPOINTS._serialized_end=7094 + _WITHLOOKUP._serialized_start=7097 + _WITHLOOKUP._serialized_end=7275 + _SEARCHPOINTGROUPS._serialized_start=7278 + _SEARCHPOINTGROUPS._serialized_end=8003 + _STARTFROM._serialized_start=8005 + _STARTFROM._serialized_end=8130 + _ORDERBY._serialized_start=8133 + _ORDERBY._serialized_end=8271 + _SCROLLPOINTS._serialized_start=8274 + _SCROLLPOINTS._serialized_end=8800 + _LOOKUPLOCATION._serialized_start=8803 + _LOOKUPLOCATION._serialized_end=8968 + _RECOMMENDPOINTS._serialized_start=8971 + _RECOMMENDPOINTS._serialized_end=9816 + _RECOMMENDBATCHPOINTS._serialized_start=9819 + _RECOMMENDBATCHPOINTS._serialized_end=10028 + _RECOMMENDPOINTGROUPS._serialized_start=10031 + _RECOMMENDPOINTGROUPS._serialized_end=10943 + _TARGETVECTOR._serialized_start=10945 + _TARGETVECTOR._serialized_end=11010 + _VECTOREXAMPLE._serialized_start=11012 + _VECTOREXAMPLE._serialized_end=11103 + _CONTEXTEXAMPLEPAIR._serialized_start=11105 + _CONTEXTEXAMPLEPAIR._serialized_end=11207 + _DISCOVERPOINTS._serialized_start=11210 + _DISCOVERPOINTS._serialized_end=11864 + _DISCOVERBATCHPOINTS._serialized_start=11867 + _DISCOVERBATCHPOINTS._serialized_end=12073 + _COUNTPOINTS._serialized_start=12076 + _COUNTPOINTS._serialized_end=12369 + _RECOMMENDINPUT._serialized_start=12372 + _RECOMMENDINPUT._serialized_end=12529 + _CONTEXTINPUTPAIR._serialized_start=12531 + _CONTEXTINPUTPAIR._serialized_end=12627 + _DISCOVERINPUT._serialized_start=12629 + _DISCOVERINPUT._serialized_end=12720 + _CONTEXTINPUT._serialized_start=12722 + _CONTEXTINPUT._serialized_end=12777 + _FORMULA._serialized_start=12780 + _FORMULA._serialized_end=12942 + _FORMULA_DEFAULTSENTRY._serialized_start=12880 + _FORMULA_DEFAULTSENTRY._serialized_end=12942 + _EXPRESSION._serialized_start=12945 + _EXPRESSION._serialized_end=13661 + _GEODISTANCE._serialized_start=13663 + _GEODISTANCE._serialized_end=13722 + _MULTEXPRESSION._serialized_start=13724 + _MULTEXPRESSION._serialized_end=13774 + _SUMEXPRESSION._serialized_start=13776 + _SUMEXPRESSION._serialized_end=13824 + _DIVEXPRESSION._serialized_start=13827 + _DIVEXPRESSION._serialized_end=13961 + _POWEXPRESSION._serialized_start=13963 + _POWEXPRESSION._serialized_end=14050 + _DECAYPARAMSEXPRESSION._serialized_start=14053 + _DECAYPARAMSEXPRESSION._serialized_end=14225 + _NEARESTINPUTWITHMMR._serialized_start=14227 + _NEARESTINPUTWITHMMR._serialized_end=14312 + _MMR._serialized_start=14314 + _MMR._serialized_end=14409 + _QUERY._serialized_start=14412 + _QUERY._serialized_end=14797 + _PREFETCHQUERY._serialized_start=14800 + _PREFETCHQUERY._serialized_end=15179 + _QUERYPOINTS._serialized_start=15182 + _QUERYPOINTS._serialized_end=15955 + _QUERYBATCHPOINTS._serialized_start=15958 + _QUERYBATCHPOINTS._serialized_end=16155 + _QUERYPOINTGROUPS._serialized_start=16158 + _QUERYPOINTGROUPS._serialized_end=17002 + _FACETCOUNTS._serialized_start=17005 + _FACETCOUNTS._serialized_end=17357 + _FACETVALUE._serialized_start=17359 + _FACETVALUE._serialized_end=17453 + _FACETHIT._serialized_start=17455 + _FACETHIT._serialized_end=17515 + _SEARCHMATRIXPOINTS._serialized_start=17518 + _SEARCHMATRIXPOINTS._serialized_end=17896 + _SEARCHMATRIXPAIRS._serialized_start=17898 + _SEARCHMATRIXPAIRS._serialized_end=17958 + _SEARCHMATRIXPAIR._serialized_start=17960 + _SEARCHMATRIXPAIR._serialized_end=18049 + _SEARCHMATRIXOFFSETS._serialized_start=18051 + _SEARCHMATRIXOFFSETS._serialized_end=18160 + _POINTSUPDATEOPERATION._serialized_start=18163 + _POINTSUPDATEOPERATION._serialized_end=20488 + _POINTSUPDATEOPERATION_POINTSTRUCTLIST._serialized_start=18868 + _POINTSUPDATEOPERATION_POINTSTRUCTLIST._serialized_end=19004 + _POINTSUPDATEOPERATION_SETPAYLOAD._serialized_start=19007 + _POINTSUPDATEOPERATION_SETPAYLOAD._serialized_end=19336 + _POINTSUPDATEOPERATION_SETPAYLOAD_PAYLOADENTRY._serialized_start=3811 + _POINTSUPDATEOPERATION_SETPAYLOAD_PAYLOADENTRY._serialized_end=3872 + _POINTSUPDATEOPERATION_OVERWRITEPAYLOAD._serialized_start=19339 + _POINTSUPDATEOPERATION_OVERWRITEPAYLOAD._serialized_end=19680 + _POINTSUPDATEOPERATION_OVERWRITEPAYLOAD_PAYLOADENTRY._serialized_start=3811 + _POINTSUPDATEOPERATION_OVERWRITEPAYLOAD_PAYLOADENTRY._serialized_end=3872 + _POINTSUPDATEOPERATION_DELETEPAYLOAD._serialized_start=19683 + _POINTSUPDATEOPERATION_DELETEPAYLOAD._serialized_end=19868 + _POINTSUPDATEOPERATION_UPDATEVECTORS._serialized_start=19871 + _POINTSUPDATEOPERATION_UPDATEVECTORS._serialized_end=20006 + _POINTSUPDATEOPERATION_DELETEVECTORS._serialized_start=20009 + _POINTSUPDATEOPERATION_DELETEVECTORS._serialized_end=20197 + _POINTSUPDATEOPERATION_DELETEPOINTS._serialized_start=20200 + _POINTSUPDATEOPERATION_DELETEPOINTS._serialized_end=20336 + _POINTSUPDATEOPERATION_CLEARPAYLOAD._serialized_start=20339 + _POINTSUPDATEOPERATION_CLEARPAYLOAD._serialized_end=20475 + _UPDATEBATCHPOINTS._serialized_start=20491 + _UPDATEBATCHPOINTS._serialized_end=20673 + _POINTSOPERATIONRESPONSE._serialized_start=20675 + _POINTSOPERATIONRESPONSE._serialized_end=20797 + _UPDATERESULT._serialized_start=20799 + _UPDATERESULT._serialized_end=20895 + _ORDERVALUE._serialized_start=20897 + _ORDERVALUE._serialized_end=20952 + _SCOREDPOINT._serialized_start=20955 + _SCOREDPOINT._serialized_end=21324 + _SCOREDPOINT_PAYLOADENTRY._serialized_start=3811 + _SCOREDPOINT_PAYLOADENTRY._serialized_end=3872 + _GROUPID._serialized_start=21326 + _GROUPID._serialized_end=21418 + _POINTGROUP._serialized_start=21420 + _POINTGROUP._serialized_end=21536 + _GROUPSRESULT._serialized_start=21538 + _GROUPSRESULT._serialized_end=21588 + _SEARCHRESPONSE._serialized_start=21590 + _SEARCHRESPONSE._serialized_end=21702 + _QUERYRESPONSE._serialized_start=21704 + _QUERYRESPONSE._serialized_end=21815 + _QUERYBATCHRESPONSE._serialized_start=21817 + _QUERYBATCHRESPONSE._serialized_end=21933 + _QUERYGROUPSRESPONSE._serialized_start=21935 + _QUERYGROUPSRESPONSE._serialized_end=22053 + _BATCHRESULT._serialized_start=22055 + _BATCHRESULT._serialized_end=22105 + _SEARCHBATCHRESPONSE._serialized_start=22107 + _SEARCHBATCHRESPONSE._serialized_end=22224 + _SEARCHGROUPSRESPONSE._serialized_start=22226 + _SEARCHGROUPSRESPONSE._serialized_end=22345 + _COUNTRESPONSE._serialized_start=22347 + _COUNTRESPONSE._serialized_end=22458 + _SCROLLRESPONSE._serialized_start=22461 + _SCROLLRESPONSE._serialized_end=22645 + _COUNTRESULT._serialized_start=22647 + _COUNTRESULT._serialized_end=22675 + _RETRIEVEDPOINT._serialized_start=22678 + _RETRIEVEDPOINT._serialized_end=23021 + _RETRIEVEDPOINT_PAYLOADENTRY._serialized_start=3811 + _RETRIEVEDPOINT_PAYLOADENTRY._serialized_end=3872 + _GETRESPONSE._serialized_start=23023 + _GETRESPONSE._serialized_end=23135 + _RECOMMENDRESPONSE._serialized_start=23137 + _RECOMMENDRESPONSE._serialized_end=23252 + _RECOMMENDBATCHRESPONSE._serialized_start=23254 + _RECOMMENDBATCHRESPONSE._serialized_end=23374 + _DISCOVERRESPONSE._serialized_start=23376 + _DISCOVERRESPONSE._serialized_end=23490 + _DISCOVERBATCHRESPONSE._serialized_start=23492 + _DISCOVERBATCHRESPONSE._serialized_end=23611 + _RECOMMENDGROUPSRESPONSE._serialized_start=23613 + _RECOMMENDGROUPSRESPONSE._serialized_end=23735 + _UPDATEBATCHRESPONSE._serialized_start=23737 + _UPDATEBATCHRESPONSE._serialized_end=23855 + _FACETRESPONSE._serialized_start=23857 + _FACETRESPONSE._serialized_end=23918 + _SEARCHMATRIXPAIRSRESPONSE._serialized_start=23921 + _SEARCHMATRIXPAIRSRESPONSE._serialized_end=24050 + _SEARCHMATRIXOFFSETSRESPONSE._serialized_start=24053 + _SEARCHMATRIXOFFSETSRESPONSE._serialized_end=24186 + _FILTER._serialized_start=24189 + _FILTER._serialized_end=24361 + _MINSHOULD._serialized_start=24363 + _MINSHOULD._serialized_end=24432 + _CONDITION._serialized_start=24435 + _CONDITION._serialized_end=24766 + _ISEMPTYCONDITION._serialized_start=24768 + _ISEMPTYCONDITION._serialized_end=24799 + _ISNULLCONDITION._serialized_start=24801 + _ISNULLCONDITION._serialized_end=24831 + _HASIDCONDITION._serialized_start=24833 + _HASIDCONDITION._serialized_end=24882 + _HASVECTORCONDITION._serialized_start=24884 + _HASVECTORCONDITION._serialized_end=24924 + _NESTEDCONDITION._serialized_start=24926 + _NESTEDCONDITION._serialized_end=24988 + _FIELDCONDITION._serialized_start=24991 + _FIELDCONDITION._serialized_end=25370 + _MATCH._serialized_start=25373 + _MATCH._serialized_end=25682 + _REPEATEDSTRINGS._serialized_start=25684 + _REPEATEDSTRINGS._serialized_end=25718 + _REPEATEDINTEGERS._serialized_start=25720 + _REPEATEDINTEGERS._serialized_end=25756 + _RANGE._serialized_start=25758 + _RANGE._serialized_end=25865 + _DATETIMERANGE._serialized_start=25868 + _DATETIMERANGE._serialized_end=26095 + _GEOBOUNDINGBOX._serialized_start=26097 + _GEOBOUNDINGBOX._serialized_end=26189 + _GEORADIUS._serialized_start=26191 + _GEORADIUS._serialized_end=26252 + _GEOLINESTRING._serialized_start=26254 + _GEOLINESTRING._serialized_end=26303 + _GEOPOLYGON._serialized_start=26305 + _GEOPOLYGON._serialized_end=26400 + _VALUESCOUNT._serialized_start=26402 + _VALUESCOUNT._serialized_end=26515 + _POINTSSELECTOR._serialized_start=26517 + _POINTSSELECTOR._serialized_end=26634 + _POINTSIDSLIST._serialized_start=26636 + _POINTSIDSLIST._serialized_end=26681 + _POINTSTRUCT._serialized_start=26684 + _POINTSTRUCT._serialized_end=26897 + _POINTSTRUCT_PAYLOADENTRY._serialized_start=3811 + _POINTSTRUCT_PAYLOADENTRY._serialized_end=3872 + _GEOPOINT._serialized_start=26899 + _GEOPOINT._serialized_end=26935 + _USAGE._serialized_start=26938 + _USAGE._serialized_end=27066 + _INFERENCEUSAGE._serialized_start=27069 + _INFERENCEUSAGE._serialized_end=27204 + _INFERENCEUSAGE_MODELSENTRY._serialized_start=27139 + _INFERENCEUSAGE_MODELSENTRY._serialized_end=27204 + _MODELUSAGE._serialized_start=27206 + _MODELUSAGE._serialized_end=27234 + _HARDWAREUSAGE._serialized_start=27237 + _HARDWAREUSAGE._serialized_end=27428 +# @@protoc_insertion_point(module_scope) diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/grpc/points_pb2_grpc.py b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/grpc/points_pb2_grpc.py new file mode 100644 index 0000000000000000000000000000000000000000..2daafffebfc817aefe8fcb96eaec25e65b3903e8 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/grpc/points_pb2_grpc.py @@ -0,0 +1,4 @@ +# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! +"""Client and server classes corresponding to protobuf-defined services.""" +import grpc + diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/grpc/points_service_pb2.py b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/grpc/points_service_pb2.py new file mode 100644 index 0000000000000000000000000000000000000000..22dbd507c16691bf6861492f3d31915064d753a8 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/grpc/points_service_pb2.py @@ -0,0 +1,29 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: points_service.proto +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import message as _message +from google.protobuf import reflection as _reflection +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from . import points_pb2 as points__pb2 + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x14points_service.proto\x12\x06qdrant\x1a\x0cpoints.proto2\xfd\x0f\n\x06Points\x12\x41\n\x06Upsert\x12\x14.qdrant.UpsertPoints\x1a\x1f.qdrant.PointsOperationResponse\"\x00\x12\x41\n\x06\x44\x65lete\x12\x14.qdrant.DeletePoints\x1a\x1f.qdrant.PointsOperationResponse\"\x00\x12/\n\x03Get\x12\x11.qdrant.GetPoints\x1a\x13.qdrant.GetResponse\"\x00\x12N\n\rUpdateVectors\x12\x1a.qdrant.UpdatePointVectors\x1a\x1f.qdrant.PointsOperationResponse\"\x00\x12N\n\rDeleteVectors\x12\x1a.qdrant.DeletePointVectors\x1a\x1f.qdrant.PointsOperationResponse\"\x00\x12I\n\nSetPayload\x12\x18.qdrant.SetPayloadPoints\x1a\x1f.qdrant.PointsOperationResponse\"\x00\x12O\n\x10OverwritePayload\x12\x18.qdrant.SetPayloadPoints\x1a\x1f.qdrant.PointsOperationResponse\"\x00\x12O\n\rDeletePayload\x12\x1b.qdrant.DeletePayloadPoints\x1a\x1f.qdrant.PointsOperationResponse\"\x00\x12M\n\x0c\x43learPayload\x12\x1a.qdrant.ClearPayloadPoints\x1a\x1f.qdrant.PointsOperationResponse\"\x00\x12Y\n\x10\x43reateFieldIndex\x12\".qdrant.CreateFieldIndexCollection\x1a\x1f.qdrant.PointsOperationResponse\"\x00\x12Y\n\x10\x44\x65leteFieldIndex\x12\".qdrant.DeleteFieldIndexCollection\x1a\x1f.qdrant.PointsOperationResponse\"\x00\x12\x38\n\x06Search\x12\x14.qdrant.SearchPoints\x1a\x16.qdrant.SearchResponse\"\x00\x12G\n\x0bSearchBatch\x12\x19.qdrant.SearchBatchPoints\x1a\x1b.qdrant.SearchBatchResponse\"\x00\x12I\n\x0cSearchGroups\x12\x19.qdrant.SearchPointGroups\x1a\x1c.qdrant.SearchGroupsResponse\"\x00\x12\x38\n\x06Scroll\x12\x14.qdrant.ScrollPoints\x1a\x16.qdrant.ScrollResponse\"\x00\x12\x41\n\tRecommend\x12\x17.qdrant.RecommendPoints\x1a\x19.qdrant.RecommendResponse\"\x00\x12P\n\x0eRecommendBatch\x12\x1c.qdrant.RecommendBatchPoints\x1a\x1e.qdrant.RecommendBatchResponse\"\x00\x12R\n\x0fRecommendGroups\x12\x1c.qdrant.RecommendPointGroups\x1a\x1f.qdrant.RecommendGroupsResponse\"\x00\x12>\n\x08\x44iscover\x12\x16.qdrant.DiscoverPoints\x1a\x18.qdrant.DiscoverResponse\"\x00\x12M\n\rDiscoverBatch\x12\x1b.qdrant.DiscoverBatchPoints\x1a\x1d.qdrant.DiscoverBatchResponse\"\x00\x12\x35\n\x05\x43ount\x12\x13.qdrant.CountPoints\x1a\x15.qdrant.CountResponse\"\x00\x12G\n\x0bUpdateBatch\x12\x19.qdrant.UpdateBatchPoints\x1a\x1b.qdrant.UpdateBatchResponse\"\x00\x12\x35\n\x05Query\x12\x13.qdrant.QueryPoints\x1a\x15.qdrant.QueryResponse\"\x00\x12\x44\n\nQueryBatch\x12\x18.qdrant.QueryBatchPoints\x1a\x1a.qdrant.QueryBatchResponse\"\x00\x12\x46\n\x0bQueryGroups\x12\x18.qdrant.QueryPointGroups\x1a\x1b.qdrant.QueryGroupsResponse\"\x00\x12\x35\n\x05\x46\x61\x63\x65t\x12\x13.qdrant.FacetCounts\x1a\x15.qdrant.FacetResponse\"\x00\x12T\n\x11SearchMatrixPairs\x12\x1a.qdrant.SearchMatrixPoints\x1a!.qdrant.SearchMatrixPairsResponse\"\x00\x12X\n\x13SearchMatrixOffsets\x12\x1a.qdrant.SearchMatrixPoints\x1a#.qdrant.SearchMatrixOffsetsResponse\"\x00\x42\x15\xaa\x02\x12Qdrant.Client.Grpcb\x06proto3') + + + +_POINTS = DESCRIPTOR.services_by_name['Points'] +if _descriptor._USE_C_DESCRIPTORS == False: + + DESCRIPTOR._options = None + DESCRIPTOR._serialized_options = b'\252\002\022Qdrant.Client.Grpc' + _POINTS._serialized_start=47 + _POINTS._serialized_end=2092 +# @@protoc_insertion_point(module_scope) diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/grpc/points_service_pb2_grpc.py b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/grpc/points_service_pb2_grpc.py new file mode 100644 index 0000000000000000000000000000000000000000..f2cee9b00d697aa34deeef7a959055d25ac52215 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/grpc/points_service_pb2_grpc.py @@ -0,0 +1,1027 @@ +# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! +"""Client and server classes corresponding to protobuf-defined services.""" +import grpc + +from . import points_pb2 as points__pb2 + + +class PointsStub(object): + """Missing associated documentation comment in .proto file.""" + + def __init__(self, channel): + """Constructor. + + Args: + channel: A grpc.Channel. + """ + self.Upsert = channel.unary_unary( + '/qdrant.Points/Upsert', + request_serializer=points__pb2.UpsertPoints.SerializeToString, + response_deserializer=points__pb2.PointsOperationResponse.FromString, + ) + self.Delete = channel.unary_unary( + '/qdrant.Points/Delete', + request_serializer=points__pb2.DeletePoints.SerializeToString, + response_deserializer=points__pb2.PointsOperationResponse.FromString, + ) + self.Get = channel.unary_unary( + '/qdrant.Points/Get', + request_serializer=points__pb2.GetPoints.SerializeToString, + response_deserializer=points__pb2.GetResponse.FromString, + ) + self.UpdateVectors = channel.unary_unary( + '/qdrant.Points/UpdateVectors', + request_serializer=points__pb2.UpdatePointVectors.SerializeToString, + response_deserializer=points__pb2.PointsOperationResponse.FromString, + ) + self.DeleteVectors = channel.unary_unary( + '/qdrant.Points/DeleteVectors', + request_serializer=points__pb2.DeletePointVectors.SerializeToString, + response_deserializer=points__pb2.PointsOperationResponse.FromString, + ) + self.SetPayload = channel.unary_unary( + '/qdrant.Points/SetPayload', + request_serializer=points__pb2.SetPayloadPoints.SerializeToString, + response_deserializer=points__pb2.PointsOperationResponse.FromString, + ) + self.OverwritePayload = channel.unary_unary( + '/qdrant.Points/OverwritePayload', + request_serializer=points__pb2.SetPayloadPoints.SerializeToString, + response_deserializer=points__pb2.PointsOperationResponse.FromString, + ) + self.DeletePayload = channel.unary_unary( + '/qdrant.Points/DeletePayload', + request_serializer=points__pb2.DeletePayloadPoints.SerializeToString, + response_deserializer=points__pb2.PointsOperationResponse.FromString, + ) + self.ClearPayload = channel.unary_unary( + '/qdrant.Points/ClearPayload', + request_serializer=points__pb2.ClearPayloadPoints.SerializeToString, + response_deserializer=points__pb2.PointsOperationResponse.FromString, + ) + self.CreateFieldIndex = channel.unary_unary( + '/qdrant.Points/CreateFieldIndex', + request_serializer=points__pb2.CreateFieldIndexCollection.SerializeToString, + response_deserializer=points__pb2.PointsOperationResponse.FromString, + ) + self.DeleteFieldIndex = channel.unary_unary( + '/qdrant.Points/DeleteFieldIndex', + request_serializer=points__pb2.DeleteFieldIndexCollection.SerializeToString, + response_deserializer=points__pb2.PointsOperationResponse.FromString, + ) + self.Search = channel.unary_unary( + '/qdrant.Points/Search', + request_serializer=points__pb2.SearchPoints.SerializeToString, + response_deserializer=points__pb2.SearchResponse.FromString, + ) + self.SearchBatch = channel.unary_unary( + '/qdrant.Points/SearchBatch', + request_serializer=points__pb2.SearchBatchPoints.SerializeToString, + response_deserializer=points__pb2.SearchBatchResponse.FromString, + ) + self.SearchGroups = channel.unary_unary( + '/qdrant.Points/SearchGroups', + request_serializer=points__pb2.SearchPointGroups.SerializeToString, + response_deserializer=points__pb2.SearchGroupsResponse.FromString, + ) + self.Scroll = channel.unary_unary( + '/qdrant.Points/Scroll', + request_serializer=points__pb2.ScrollPoints.SerializeToString, + response_deserializer=points__pb2.ScrollResponse.FromString, + ) + self.Recommend = channel.unary_unary( + '/qdrant.Points/Recommend', + request_serializer=points__pb2.RecommendPoints.SerializeToString, + response_deserializer=points__pb2.RecommendResponse.FromString, + ) + self.RecommendBatch = channel.unary_unary( + '/qdrant.Points/RecommendBatch', + request_serializer=points__pb2.RecommendBatchPoints.SerializeToString, + response_deserializer=points__pb2.RecommendBatchResponse.FromString, + ) + self.RecommendGroups = channel.unary_unary( + '/qdrant.Points/RecommendGroups', + request_serializer=points__pb2.RecommendPointGroups.SerializeToString, + response_deserializer=points__pb2.RecommendGroupsResponse.FromString, + ) + self.Discover = channel.unary_unary( + '/qdrant.Points/Discover', + request_serializer=points__pb2.DiscoverPoints.SerializeToString, + response_deserializer=points__pb2.DiscoverResponse.FromString, + ) + self.DiscoverBatch = channel.unary_unary( + '/qdrant.Points/DiscoverBatch', + request_serializer=points__pb2.DiscoverBatchPoints.SerializeToString, + response_deserializer=points__pb2.DiscoverBatchResponse.FromString, + ) + self.Count = channel.unary_unary( + '/qdrant.Points/Count', + request_serializer=points__pb2.CountPoints.SerializeToString, + response_deserializer=points__pb2.CountResponse.FromString, + ) + self.UpdateBatch = channel.unary_unary( + '/qdrant.Points/UpdateBatch', + request_serializer=points__pb2.UpdateBatchPoints.SerializeToString, + response_deserializer=points__pb2.UpdateBatchResponse.FromString, + ) + self.Query = channel.unary_unary( + '/qdrant.Points/Query', + request_serializer=points__pb2.QueryPoints.SerializeToString, + response_deserializer=points__pb2.QueryResponse.FromString, + ) + self.QueryBatch = channel.unary_unary( + '/qdrant.Points/QueryBatch', + request_serializer=points__pb2.QueryBatchPoints.SerializeToString, + response_deserializer=points__pb2.QueryBatchResponse.FromString, + ) + self.QueryGroups = channel.unary_unary( + '/qdrant.Points/QueryGroups', + request_serializer=points__pb2.QueryPointGroups.SerializeToString, + response_deserializer=points__pb2.QueryGroupsResponse.FromString, + ) + self.Facet = channel.unary_unary( + '/qdrant.Points/Facet', + request_serializer=points__pb2.FacetCounts.SerializeToString, + response_deserializer=points__pb2.FacetResponse.FromString, + ) + self.SearchMatrixPairs = channel.unary_unary( + '/qdrant.Points/SearchMatrixPairs', + request_serializer=points__pb2.SearchMatrixPoints.SerializeToString, + response_deserializer=points__pb2.SearchMatrixPairsResponse.FromString, + ) + self.SearchMatrixOffsets = channel.unary_unary( + '/qdrant.Points/SearchMatrixOffsets', + request_serializer=points__pb2.SearchMatrixPoints.SerializeToString, + response_deserializer=points__pb2.SearchMatrixOffsetsResponse.FromString, + ) + + +class PointsServicer(object): + """Missing associated documentation comment in .proto file.""" + + def Upsert(self, request, context): + """ + Perform insert + updates on points. If a point with a given ID already exists - it will be overwritten. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def Delete(self, request, context): + """ + Delete points + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def Get(self, request, context): + """ + Retrieve points + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def UpdateVectors(self, request, context): + """ + Update named vectors for point + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def DeleteVectors(self, request, context): + """ + Delete named vectors for points + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def SetPayload(self, request, context): + """ + Set payload for points + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def OverwritePayload(self, request, context): + """ + Overwrite payload for points + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def DeletePayload(self, request, context): + """ + Delete specified key payload for points + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def ClearPayload(self, request, context): + """ + Remove all payload for specified points + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def CreateFieldIndex(self, request, context): + """ + Create index for field in collection + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def DeleteFieldIndex(self, request, context): + """ + Delete field index for collection + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def Search(self, request, context): + """ + Retrieve closest points based on vector similarity and given filtering conditions + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def SearchBatch(self, request, context): + """ + Retrieve closest points based on vector similarity and given filtering conditions + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def SearchGroups(self, request, context): + """ + Retrieve closest points based on vector similarity and given filtering conditions, grouped by a given field + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def Scroll(self, request, context): + """ + Iterate over all or filtered points + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def Recommend(self, request, context): + """ + Look for the points which are closer to stored positive examples and at the same time further to negative examples. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def RecommendBatch(self, request, context): + """ + Look for the points which are closer to stored positive examples and at the same time further to negative examples. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def RecommendGroups(self, request, context): + """ + Look for the points which are closer to stored positive examples and at the same time further to negative examples, grouped by a given field + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def Discover(self, request, context): + """ + Use context and a target to find the most similar points to the target, constrained by the context. + + When using only the context (without a target), a special search - called context search - is performed where + pairs of points are used to generate a loss that guides the search towards the zone where + most positive examples overlap. This means that the score minimizes the scenario of + finding a point closer to a negative than to a positive part of a pair. + + Since the score of a context relates to loss, the maximum score a point can get is 0.0, + and it becomes normal that many points can have a score of 0.0. + + When using target (with or without context), the score behaves a little different: The + integer part of the score represents the rank with respect to the context, while the + decimal part of the score relates to the distance to the target. The context part of the score for + each pair is calculated +1 if the point is closer to a positive than to a negative part of a pair, + and -1 otherwise. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def DiscoverBatch(self, request, context): + """ + Batch request points based on { positive, negative } pairs of examples, and/or a target + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def Count(self, request, context): + """ + Count points in collection with given filtering conditions + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def UpdateBatch(self, request, context): + """ + Perform multiple update operations in one request + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def Query(self, request, context): + """ + Universally query points. This endpoint covers all capabilities of search, recommend, discover, filters. But also enables hybrid and multi-stage queries. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def QueryBatch(self, request, context): + """ + Universally query points in a batch fashion. This endpoint covers all capabilities of search, recommend, discover, filters. But also enables hybrid and multi-stage queries. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def QueryGroups(self, request, context): + """ + Universally query points in a group fashion. This endpoint covers all capabilities of search, recommend, discover, filters. But also enables hybrid and multi-stage queries. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def Facet(self, request, context): + """ + Perform facet counts. For each value in the field, count the number of points that have this value and match the conditions. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def SearchMatrixPairs(self, request, context): + """ + Compute distance matrix for sampled points with a pair based output format + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def SearchMatrixOffsets(self, request, context): + """ + Compute distance matrix for sampled points with an offset based output format + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + +def add_PointsServicer_to_server(servicer, server): + rpc_method_handlers = { + 'Upsert': grpc.unary_unary_rpc_method_handler( + servicer.Upsert, + request_deserializer=points__pb2.UpsertPoints.FromString, + response_serializer=points__pb2.PointsOperationResponse.SerializeToString, + ), + 'Delete': grpc.unary_unary_rpc_method_handler( + servicer.Delete, + request_deserializer=points__pb2.DeletePoints.FromString, + response_serializer=points__pb2.PointsOperationResponse.SerializeToString, + ), + 'Get': grpc.unary_unary_rpc_method_handler( + servicer.Get, + request_deserializer=points__pb2.GetPoints.FromString, + response_serializer=points__pb2.GetResponse.SerializeToString, + ), + 'UpdateVectors': grpc.unary_unary_rpc_method_handler( + servicer.UpdateVectors, + request_deserializer=points__pb2.UpdatePointVectors.FromString, + response_serializer=points__pb2.PointsOperationResponse.SerializeToString, + ), + 'DeleteVectors': grpc.unary_unary_rpc_method_handler( + servicer.DeleteVectors, + request_deserializer=points__pb2.DeletePointVectors.FromString, + response_serializer=points__pb2.PointsOperationResponse.SerializeToString, + ), + 'SetPayload': grpc.unary_unary_rpc_method_handler( + servicer.SetPayload, + request_deserializer=points__pb2.SetPayloadPoints.FromString, + response_serializer=points__pb2.PointsOperationResponse.SerializeToString, + ), + 'OverwritePayload': grpc.unary_unary_rpc_method_handler( + servicer.OverwritePayload, + request_deserializer=points__pb2.SetPayloadPoints.FromString, + response_serializer=points__pb2.PointsOperationResponse.SerializeToString, + ), + 'DeletePayload': grpc.unary_unary_rpc_method_handler( + servicer.DeletePayload, + request_deserializer=points__pb2.DeletePayloadPoints.FromString, + response_serializer=points__pb2.PointsOperationResponse.SerializeToString, + ), + 'ClearPayload': grpc.unary_unary_rpc_method_handler( + servicer.ClearPayload, + request_deserializer=points__pb2.ClearPayloadPoints.FromString, + response_serializer=points__pb2.PointsOperationResponse.SerializeToString, + ), + 'CreateFieldIndex': grpc.unary_unary_rpc_method_handler( + servicer.CreateFieldIndex, + request_deserializer=points__pb2.CreateFieldIndexCollection.FromString, + response_serializer=points__pb2.PointsOperationResponse.SerializeToString, + ), + 'DeleteFieldIndex': grpc.unary_unary_rpc_method_handler( + servicer.DeleteFieldIndex, + request_deserializer=points__pb2.DeleteFieldIndexCollection.FromString, + response_serializer=points__pb2.PointsOperationResponse.SerializeToString, + ), + 'Search': grpc.unary_unary_rpc_method_handler( + servicer.Search, + request_deserializer=points__pb2.SearchPoints.FromString, + response_serializer=points__pb2.SearchResponse.SerializeToString, + ), + 'SearchBatch': grpc.unary_unary_rpc_method_handler( + servicer.SearchBatch, + request_deserializer=points__pb2.SearchBatchPoints.FromString, + response_serializer=points__pb2.SearchBatchResponse.SerializeToString, + ), + 'SearchGroups': grpc.unary_unary_rpc_method_handler( + servicer.SearchGroups, + request_deserializer=points__pb2.SearchPointGroups.FromString, + response_serializer=points__pb2.SearchGroupsResponse.SerializeToString, + ), + 'Scroll': grpc.unary_unary_rpc_method_handler( + servicer.Scroll, + request_deserializer=points__pb2.ScrollPoints.FromString, + response_serializer=points__pb2.ScrollResponse.SerializeToString, + ), + 'Recommend': grpc.unary_unary_rpc_method_handler( + servicer.Recommend, + request_deserializer=points__pb2.RecommendPoints.FromString, + response_serializer=points__pb2.RecommendResponse.SerializeToString, + ), + 'RecommendBatch': grpc.unary_unary_rpc_method_handler( + servicer.RecommendBatch, + request_deserializer=points__pb2.RecommendBatchPoints.FromString, + response_serializer=points__pb2.RecommendBatchResponse.SerializeToString, + ), + 'RecommendGroups': grpc.unary_unary_rpc_method_handler( + servicer.RecommendGroups, + request_deserializer=points__pb2.RecommendPointGroups.FromString, + response_serializer=points__pb2.RecommendGroupsResponse.SerializeToString, + ), + 'Discover': grpc.unary_unary_rpc_method_handler( + servicer.Discover, + request_deserializer=points__pb2.DiscoverPoints.FromString, + response_serializer=points__pb2.DiscoverResponse.SerializeToString, + ), + 'DiscoverBatch': grpc.unary_unary_rpc_method_handler( + servicer.DiscoverBatch, + request_deserializer=points__pb2.DiscoverBatchPoints.FromString, + response_serializer=points__pb2.DiscoverBatchResponse.SerializeToString, + ), + 'Count': grpc.unary_unary_rpc_method_handler( + servicer.Count, + request_deserializer=points__pb2.CountPoints.FromString, + response_serializer=points__pb2.CountResponse.SerializeToString, + ), + 'UpdateBatch': grpc.unary_unary_rpc_method_handler( + servicer.UpdateBatch, + request_deserializer=points__pb2.UpdateBatchPoints.FromString, + response_serializer=points__pb2.UpdateBatchResponse.SerializeToString, + ), + 'Query': grpc.unary_unary_rpc_method_handler( + servicer.Query, + request_deserializer=points__pb2.QueryPoints.FromString, + response_serializer=points__pb2.QueryResponse.SerializeToString, + ), + 'QueryBatch': grpc.unary_unary_rpc_method_handler( + servicer.QueryBatch, + request_deserializer=points__pb2.QueryBatchPoints.FromString, + response_serializer=points__pb2.QueryBatchResponse.SerializeToString, + ), + 'QueryGroups': grpc.unary_unary_rpc_method_handler( + servicer.QueryGroups, + request_deserializer=points__pb2.QueryPointGroups.FromString, + response_serializer=points__pb2.QueryGroupsResponse.SerializeToString, + ), + 'Facet': grpc.unary_unary_rpc_method_handler( + servicer.Facet, + request_deserializer=points__pb2.FacetCounts.FromString, + response_serializer=points__pb2.FacetResponse.SerializeToString, + ), + 'SearchMatrixPairs': grpc.unary_unary_rpc_method_handler( + servicer.SearchMatrixPairs, + request_deserializer=points__pb2.SearchMatrixPoints.FromString, + response_serializer=points__pb2.SearchMatrixPairsResponse.SerializeToString, + ), + 'SearchMatrixOffsets': grpc.unary_unary_rpc_method_handler( + servicer.SearchMatrixOffsets, + request_deserializer=points__pb2.SearchMatrixPoints.FromString, + response_serializer=points__pb2.SearchMatrixOffsetsResponse.SerializeToString, + ), + } + generic_handler = grpc.method_handlers_generic_handler( + 'qdrant.Points', rpc_method_handlers) + server.add_generic_rpc_handlers((generic_handler,)) + + + # This class is part of an EXPERIMENTAL API. +class Points(object): + """Missing associated documentation comment in .proto file.""" + + @staticmethod + def Upsert(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary(request, target, '/qdrant.Points/Upsert', + points__pb2.UpsertPoints.SerializeToString, + points__pb2.PointsOperationResponse.FromString, + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + + @staticmethod + def Delete(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary(request, target, '/qdrant.Points/Delete', + points__pb2.DeletePoints.SerializeToString, + points__pb2.PointsOperationResponse.FromString, + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + + @staticmethod + def Get(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary(request, target, '/qdrant.Points/Get', + points__pb2.GetPoints.SerializeToString, + points__pb2.GetResponse.FromString, + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + + @staticmethod + def UpdateVectors(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary(request, target, '/qdrant.Points/UpdateVectors', + points__pb2.UpdatePointVectors.SerializeToString, + points__pb2.PointsOperationResponse.FromString, + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + + @staticmethod + def DeleteVectors(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary(request, target, '/qdrant.Points/DeleteVectors', + points__pb2.DeletePointVectors.SerializeToString, + points__pb2.PointsOperationResponse.FromString, + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + + @staticmethod + def SetPayload(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary(request, target, '/qdrant.Points/SetPayload', + points__pb2.SetPayloadPoints.SerializeToString, + points__pb2.PointsOperationResponse.FromString, + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + + @staticmethod + def OverwritePayload(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary(request, target, '/qdrant.Points/OverwritePayload', + points__pb2.SetPayloadPoints.SerializeToString, + points__pb2.PointsOperationResponse.FromString, + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + + @staticmethod + def DeletePayload(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary(request, target, '/qdrant.Points/DeletePayload', + points__pb2.DeletePayloadPoints.SerializeToString, + points__pb2.PointsOperationResponse.FromString, + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + + @staticmethod + def ClearPayload(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary(request, target, '/qdrant.Points/ClearPayload', + points__pb2.ClearPayloadPoints.SerializeToString, + points__pb2.PointsOperationResponse.FromString, + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + + @staticmethod + def CreateFieldIndex(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary(request, target, '/qdrant.Points/CreateFieldIndex', + points__pb2.CreateFieldIndexCollection.SerializeToString, + points__pb2.PointsOperationResponse.FromString, + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + + @staticmethod + def DeleteFieldIndex(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary(request, target, '/qdrant.Points/DeleteFieldIndex', + points__pb2.DeleteFieldIndexCollection.SerializeToString, + points__pb2.PointsOperationResponse.FromString, + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + + @staticmethod + def Search(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary(request, target, '/qdrant.Points/Search', + points__pb2.SearchPoints.SerializeToString, + points__pb2.SearchResponse.FromString, + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + + @staticmethod + def SearchBatch(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary(request, target, '/qdrant.Points/SearchBatch', + points__pb2.SearchBatchPoints.SerializeToString, + points__pb2.SearchBatchResponse.FromString, + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + + @staticmethod + def SearchGroups(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary(request, target, '/qdrant.Points/SearchGroups', + points__pb2.SearchPointGroups.SerializeToString, + points__pb2.SearchGroupsResponse.FromString, + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + + @staticmethod + def Scroll(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary(request, target, '/qdrant.Points/Scroll', + points__pb2.ScrollPoints.SerializeToString, + points__pb2.ScrollResponse.FromString, + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + + @staticmethod + def Recommend(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary(request, target, '/qdrant.Points/Recommend', + points__pb2.RecommendPoints.SerializeToString, + points__pb2.RecommendResponse.FromString, + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + + @staticmethod + def RecommendBatch(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary(request, target, '/qdrant.Points/RecommendBatch', + points__pb2.RecommendBatchPoints.SerializeToString, + points__pb2.RecommendBatchResponse.FromString, + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + + @staticmethod + def RecommendGroups(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary(request, target, '/qdrant.Points/RecommendGroups', + points__pb2.RecommendPointGroups.SerializeToString, + points__pb2.RecommendGroupsResponse.FromString, + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + + @staticmethod + def Discover(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary(request, target, '/qdrant.Points/Discover', + points__pb2.DiscoverPoints.SerializeToString, + points__pb2.DiscoverResponse.FromString, + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + + @staticmethod + def DiscoverBatch(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary(request, target, '/qdrant.Points/DiscoverBatch', + points__pb2.DiscoverBatchPoints.SerializeToString, + points__pb2.DiscoverBatchResponse.FromString, + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + + @staticmethod + def Count(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary(request, target, '/qdrant.Points/Count', + points__pb2.CountPoints.SerializeToString, + points__pb2.CountResponse.FromString, + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + + @staticmethod + def UpdateBatch(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary(request, target, '/qdrant.Points/UpdateBatch', + points__pb2.UpdateBatchPoints.SerializeToString, + points__pb2.UpdateBatchResponse.FromString, + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + + @staticmethod + def Query(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary(request, target, '/qdrant.Points/Query', + points__pb2.QueryPoints.SerializeToString, + points__pb2.QueryResponse.FromString, + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + + @staticmethod + def QueryBatch(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary(request, target, '/qdrant.Points/QueryBatch', + points__pb2.QueryBatchPoints.SerializeToString, + points__pb2.QueryBatchResponse.FromString, + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + + @staticmethod + def QueryGroups(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary(request, target, '/qdrant.Points/QueryGroups', + points__pb2.QueryPointGroups.SerializeToString, + points__pb2.QueryGroupsResponse.FromString, + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + + @staticmethod + def Facet(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary(request, target, '/qdrant.Points/Facet', + points__pb2.FacetCounts.SerializeToString, + points__pb2.FacetResponse.FromString, + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + + @staticmethod + def SearchMatrixPairs(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary(request, target, '/qdrant.Points/SearchMatrixPairs', + points__pb2.SearchMatrixPoints.SerializeToString, + points__pb2.SearchMatrixPairsResponse.FromString, + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + + @staticmethod + def SearchMatrixOffsets(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary(request, target, '/qdrant.Points/SearchMatrixOffsets', + points__pb2.SearchMatrixPoints.SerializeToString, + points__pb2.SearchMatrixOffsetsResponse.FromString, + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/grpc/qdrant_pb2.py b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/grpc/qdrant_pb2.py new file mode 100644 index 0000000000000000000000000000000000000000..660f650f3de27847ea9c08dd8a3ce5f52ceefa13 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/grpc/qdrant_pb2.py @@ -0,0 +1,51 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: qdrant.proto +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import message as _message +from google.protobuf import reflection as _reflection +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from . import collections_service_pb2 as collections__service__pb2 +from . import points_service_pb2 as points__service__pb2 +from . import snapshots_service_pb2 as snapshots__service__pb2 + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x0cqdrant.proto\x12\x06qdrant\x1a\x19\x63ollections_service.proto\x1a\x14points_service.proto\x1a\x17snapshots_service.proto\"\x14\n\x12HealthCheckRequest\"R\n\x10HealthCheckReply\x12\r\n\x05title\x18\x01 \x01(\t\x12\x0f\n\x07version\x18\x02 \x01(\t\x12\x13\n\x06\x63ommit\x18\x03 \x01(\tH\x00\x88\x01\x01\x42\t\n\x07_commit2O\n\x06Qdrant\x12\x45\n\x0bHealthCheck\x12\x1a.qdrant.HealthCheckRequest\x1a\x18.qdrant.HealthCheckReply\"\x00\x42\x15\xaa\x02\x12Qdrant.Client.Grpcb\x06proto3') + + + +_HEALTHCHECKREQUEST = DESCRIPTOR.message_types_by_name['HealthCheckRequest'] +_HEALTHCHECKREPLY = DESCRIPTOR.message_types_by_name['HealthCheckReply'] +HealthCheckRequest = _reflection.GeneratedProtocolMessageType('HealthCheckRequest', (_message.Message,), { + 'DESCRIPTOR' : _HEALTHCHECKREQUEST, + '__module__' : 'qdrant_pb2' + # @@protoc_insertion_point(class_scope:qdrant.HealthCheckRequest) + }) +_sym_db.RegisterMessage(HealthCheckRequest) + +HealthCheckReply = _reflection.GeneratedProtocolMessageType('HealthCheckReply', (_message.Message,), { + 'DESCRIPTOR' : _HEALTHCHECKREPLY, + '__module__' : 'qdrant_pb2' + # @@protoc_insertion_point(class_scope:qdrant.HealthCheckReply) + }) +_sym_db.RegisterMessage(HealthCheckReply) + +_QDRANT = DESCRIPTOR.services_by_name['Qdrant'] +if _descriptor._USE_C_DESCRIPTORS == False: + + DESCRIPTOR._options = None + DESCRIPTOR._serialized_options = b'\252\002\022Qdrant.Client.Grpc' + _HEALTHCHECKREQUEST._serialized_start=98 + _HEALTHCHECKREQUEST._serialized_end=118 + _HEALTHCHECKREPLY._serialized_start=120 + _HEALTHCHECKREPLY._serialized_end=202 + _QDRANT._serialized_start=204 + _QDRANT._serialized_end=283 +# @@protoc_insertion_point(module_scope) diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/grpc/qdrant_pb2_grpc.py b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/grpc/qdrant_pb2_grpc.py new file mode 100644 index 0000000000000000000000000000000000000000..d979410d78d5378aaf7595314d01ffc3aeaefbc7 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/grpc/qdrant_pb2_grpc.py @@ -0,0 +1,66 @@ +# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! +"""Client and server classes corresponding to protobuf-defined services.""" +import grpc + +from . import qdrant_pb2 as qdrant__pb2 + + +class QdrantStub(object): + """Missing associated documentation comment in .proto file.""" + + def __init__(self, channel): + """Constructor. + + Args: + channel: A grpc.Channel. + """ + self.HealthCheck = channel.unary_unary( + '/qdrant.Qdrant/HealthCheck', + request_serializer=qdrant__pb2.HealthCheckRequest.SerializeToString, + response_deserializer=qdrant__pb2.HealthCheckReply.FromString, + ) + + +class QdrantServicer(object): + """Missing associated documentation comment in .proto file.""" + + def HealthCheck(self, request, context): + """Missing associated documentation comment in .proto file.""" + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + +def add_QdrantServicer_to_server(servicer, server): + rpc_method_handlers = { + 'HealthCheck': grpc.unary_unary_rpc_method_handler( + servicer.HealthCheck, + request_deserializer=qdrant__pb2.HealthCheckRequest.FromString, + response_serializer=qdrant__pb2.HealthCheckReply.SerializeToString, + ), + } + generic_handler = grpc.method_handlers_generic_handler( + 'qdrant.Qdrant', rpc_method_handlers) + server.add_generic_rpc_handlers((generic_handler,)) + + + # This class is part of an EXPERIMENTAL API. +class Qdrant(object): + """Missing associated documentation comment in .proto file.""" + + @staticmethod + def HealthCheck(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary(request, target, '/qdrant.Qdrant/HealthCheck', + qdrant__pb2.HealthCheckRequest.SerializeToString, + qdrant__pb2.HealthCheckReply.FromString, + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/grpc/snapshots_service_pb2.py b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/grpc/snapshots_service_pb2.py new file mode 100644 index 0000000000000000000000000000000000000000..39655c3cbceb2785a4c347f279aee1033eb77c82 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/grpc/snapshots_service_pb2.py @@ -0,0 +1,129 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: snapshots_service.proto +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import message as _message +from google.protobuf import reflection as _reflection +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2 + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x17snapshots_service.proto\x12\x06qdrant\x1a\x1fgoogle/protobuf/timestamp.proto\"\x1b\n\x19\x43reateFullSnapshotRequest\"\x1a\n\x18ListFullSnapshotsRequest\"2\n\x19\x44\x65leteFullSnapshotRequest\x12\x15\n\rsnapshot_name\x18\x01 \x01(\t\"0\n\x15\x43reateSnapshotRequest\x12\x17\n\x0f\x63ollection_name\x18\x01 \x01(\t\"/\n\x14ListSnapshotsRequest\x12\x17\n\x0f\x63ollection_name\x18\x01 \x01(\t\"G\n\x15\x44\x65leteSnapshotRequest\x12\x17\n\x0f\x63ollection_name\x18\x01 \x01(\t\x12\x15\n\rsnapshot_name\x18\x02 \x01(\t\"\x88\x01\n\x13SnapshotDescription\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x31\n\rcreation_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x0c\n\x04size\x18\x03 \x01(\x03\x12\x15\n\x08\x63hecksum\x18\x04 \x01(\tH\x00\x88\x01\x01\x42\x0b\n\t_checksum\"a\n\x16\x43reateSnapshotResponse\x12\x39\n\x14snapshot_description\x18\x01 \x01(\x0b\x32\x1b.qdrant.SnapshotDescription\x12\x0c\n\x04time\x18\x02 \x01(\x01\"a\n\x15ListSnapshotsResponse\x12:\n\x15snapshot_descriptions\x18\x01 \x03(\x0b\x32\x1b.qdrant.SnapshotDescription\x12\x0c\n\x04time\x18\x02 \x01(\x01\"&\n\x16\x44\x65leteSnapshotResponse\x12\x0c\n\x04time\x18\x01 \x01(\x01\x32\xdd\x03\n\tSnapshots\x12I\n\x06\x43reate\x12\x1d.qdrant.CreateSnapshotRequest\x1a\x1e.qdrant.CreateSnapshotResponse\"\x00\x12\x45\n\x04List\x12\x1c.qdrant.ListSnapshotsRequest\x1a\x1d.qdrant.ListSnapshotsResponse\"\x00\x12I\n\x06\x44\x65lete\x12\x1d.qdrant.DeleteSnapshotRequest\x1a\x1e.qdrant.DeleteSnapshotResponse\"\x00\x12Q\n\nCreateFull\x12!.qdrant.CreateFullSnapshotRequest\x1a\x1e.qdrant.CreateSnapshotResponse\"\x00\x12M\n\x08ListFull\x12 .qdrant.ListFullSnapshotsRequest\x1a\x1d.qdrant.ListSnapshotsResponse\"\x00\x12Q\n\nDeleteFull\x12!.qdrant.DeleteFullSnapshotRequest\x1a\x1e.qdrant.DeleteSnapshotResponse\"\x00\x42\x15\xaa\x02\x12Qdrant.Client.Grpcb\x06proto3') + + + +_CREATEFULLSNAPSHOTREQUEST = DESCRIPTOR.message_types_by_name['CreateFullSnapshotRequest'] +_LISTFULLSNAPSHOTSREQUEST = DESCRIPTOR.message_types_by_name['ListFullSnapshotsRequest'] +_DELETEFULLSNAPSHOTREQUEST = DESCRIPTOR.message_types_by_name['DeleteFullSnapshotRequest'] +_CREATESNAPSHOTREQUEST = DESCRIPTOR.message_types_by_name['CreateSnapshotRequest'] +_LISTSNAPSHOTSREQUEST = DESCRIPTOR.message_types_by_name['ListSnapshotsRequest'] +_DELETESNAPSHOTREQUEST = DESCRIPTOR.message_types_by_name['DeleteSnapshotRequest'] +_SNAPSHOTDESCRIPTION = DESCRIPTOR.message_types_by_name['SnapshotDescription'] +_CREATESNAPSHOTRESPONSE = DESCRIPTOR.message_types_by_name['CreateSnapshotResponse'] +_LISTSNAPSHOTSRESPONSE = DESCRIPTOR.message_types_by_name['ListSnapshotsResponse'] +_DELETESNAPSHOTRESPONSE = DESCRIPTOR.message_types_by_name['DeleteSnapshotResponse'] +CreateFullSnapshotRequest = _reflection.GeneratedProtocolMessageType('CreateFullSnapshotRequest', (_message.Message,), { + 'DESCRIPTOR' : _CREATEFULLSNAPSHOTREQUEST, + '__module__' : 'snapshots_service_pb2' + # @@protoc_insertion_point(class_scope:qdrant.CreateFullSnapshotRequest) + }) +_sym_db.RegisterMessage(CreateFullSnapshotRequest) + +ListFullSnapshotsRequest = _reflection.GeneratedProtocolMessageType('ListFullSnapshotsRequest', (_message.Message,), { + 'DESCRIPTOR' : _LISTFULLSNAPSHOTSREQUEST, + '__module__' : 'snapshots_service_pb2' + # @@protoc_insertion_point(class_scope:qdrant.ListFullSnapshotsRequest) + }) +_sym_db.RegisterMessage(ListFullSnapshotsRequest) + +DeleteFullSnapshotRequest = _reflection.GeneratedProtocolMessageType('DeleteFullSnapshotRequest', (_message.Message,), { + 'DESCRIPTOR' : _DELETEFULLSNAPSHOTREQUEST, + '__module__' : 'snapshots_service_pb2' + # @@protoc_insertion_point(class_scope:qdrant.DeleteFullSnapshotRequest) + }) +_sym_db.RegisterMessage(DeleteFullSnapshotRequest) + +CreateSnapshotRequest = _reflection.GeneratedProtocolMessageType('CreateSnapshotRequest', (_message.Message,), { + 'DESCRIPTOR' : _CREATESNAPSHOTREQUEST, + '__module__' : 'snapshots_service_pb2' + # @@protoc_insertion_point(class_scope:qdrant.CreateSnapshotRequest) + }) +_sym_db.RegisterMessage(CreateSnapshotRequest) + +ListSnapshotsRequest = _reflection.GeneratedProtocolMessageType('ListSnapshotsRequest', (_message.Message,), { + 'DESCRIPTOR' : _LISTSNAPSHOTSREQUEST, + '__module__' : 'snapshots_service_pb2' + # @@protoc_insertion_point(class_scope:qdrant.ListSnapshotsRequest) + }) +_sym_db.RegisterMessage(ListSnapshotsRequest) + +DeleteSnapshotRequest = _reflection.GeneratedProtocolMessageType('DeleteSnapshotRequest', (_message.Message,), { + 'DESCRIPTOR' : _DELETESNAPSHOTREQUEST, + '__module__' : 'snapshots_service_pb2' + # @@protoc_insertion_point(class_scope:qdrant.DeleteSnapshotRequest) + }) +_sym_db.RegisterMessage(DeleteSnapshotRequest) + +SnapshotDescription = _reflection.GeneratedProtocolMessageType('SnapshotDescription', (_message.Message,), { + 'DESCRIPTOR' : _SNAPSHOTDESCRIPTION, + '__module__' : 'snapshots_service_pb2' + # @@protoc_insertion_point(class_scope:qdrant.SnapshotDescription) + }) +_sym_db.RegisterMessage(SnapshotDescription) + +CreateSnapshotResponse = _reflection.GeneratedProtocolMessageType('CreateSnapshotResponse', (_message.Message,), { + 'DESCRIPTOR' : _CREATESNAPSHOTRESPONSE, + '__module__' : 'snapshots_service_pb2' + # @@protoc_insertion_point(class_scope:qdrant.CreateSnapshotResponse) + }) +_sym_db.RegisterMessage(CreateSnapshotResponse) + +ListSnapshotsResponse = _reflection.GeneratedProtocolMessageType('ListSnapshotsResponse', (_message.Message,), { + 'DESCRIPTOR' : _LISTSNAPSHOTSRESPONSE, + '__module__' : 'snapshots_service_pb2' + # @@protoc_insertion_point(class_scope:qdrant.ListSnapshotsResponse) + }) +_sym_db.RegisterMessage(ListSnapshotsResponse) + +DeleteSnapshotResponse = _reflection.GeneratedProtocolMessageType('DeleteSnapshotResponse', (_message.Message,), { + 'DESCRIPTOR' : _DELETESNAPSHOTRESPONSE, + '__module__' : 'snapshots_service_pb2' + # @@protoc_insertion_point(class_scope:qdrant.DeleteSnapshotResponse) + }) +_sym_db.RegisterMessage(DeleteSnapshotResponse) + +_SNAPSHOTS = DESCRIPTOR.services_by_name['Snapshots'] +if _descriptor._USE_C_DESCRIPTORS == False: + + DESCRIPTOR._options = None + DESCRIPTOR._serialized_options = b'\252\002\022Qdrant.Client.Grpc' + _CREATEFULLSNAPSHOTREQUEST._serialized_start=68 + _CREATEFULLSNAPSHOTREQUEST._serialized_end=95 + _LISTFULLSNAPSHOTSREQUEST._serialized_start=97 + _LISTFULLSNAPSHOTSREQUEST._serialized_end=123 + _DELETEFULLSNAPSHOTREQUEST._serialized_start=125 + _DELETEFULLSNAPSHOTREQUEST._serialized_end=175 + _CREATESNAPSHOTREQUEST._serialized_start=177 + _CREATESNAPSHOTREQUEST._serialized_end=225 + _LISTSNAPSHOTSREQUEST._serialized_start=227 + _LISTSNAPSHOTSREQUEST._serialized_end=274 + _DELETESNAPSHOTREQUEST._serialized_start=276 + _DELETESNAPSHOTREQUEST._serialized_end=347 + _SNAPSHOTDESCRIPTION._serialized_start=350 + _SNAPSHOTDESCRIPTION._serialized_end=486 + _CREATESNAPSHOTRESPONSE._serialized_start=488 + _CREATESNAPSHOTRESPONSE._serialized_end=585 + _LISTSNAPSHOTSRESPONSE._serialized_start=587 + _LISTSNAPSHOTSRESPONSE._serialized_end=684 + _DELETESNAPSHOTRESPONSE._serialized_start=686 + _DELETESNAPSHOTRESPONSE._serialized_end=724 + _SNAPSHOTS._serialized_start=727 + _SNAPSHOTS._serialized_end=1204 +# @@protoc_insertion_point(module_scope) diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/grpc/snapshots_service_pb2_grpc.py b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/grpc/snapshots_service_pb2_grpc.py new file mode 100644 index 0000000000000000000000000000000000000000..76c0f20e6c0472602629d9344f6a0ffe30e31bb0 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/grpc/snapshots_service_pb2_grpc.py @@ -0,0 +1,243 @@ +# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! +"""Client and server classes corresponding to protobuf-defined services.""" +import grpc + +from . import snapshots_service_pb2 as snapshots__service__pb2 + + +class SnapshotsStub(object): + """Missing associated documentation comment in .proto file.""" + + def __init__(self, channel): + """Constructor. + + Args: + channel: A grpc.Channel. + """ + self.Create = channel.unary_unary( + '/qdrant.Snapshots/Create', + request_serializer=snapshots__service__pb2.CreateSnapshotRequest.SerializeToString, + response_deserializer=snapshots__service__pb2.CreateSnapshotResponse.FromString, + ) + self.List = channel.unary_unary( + '/qdrant.Snapshots/List', + request_serializer=snapshots__service__pb2.ListSnapshotsRequest.SerializeToString, + response_deserializer=snapshots__service__pb2.ListSnapshotsResponse.FromString, + ) + self.Delete = channel.unary_unary( + '/qdrant.Snapshots/Delete', + request_serializer=snapshots__service__pb2.DeleteSnapshotRequest.SerializeToString, + response_deserializer=snapshots__service__pb2.DeleteSnapshotResponse.FromString, + ) + self.CreateFull = channel.unary_unary( + '/qdrant.Snapshots/CreateFull', + request_serializer=snapshots__service__pb2.CreateFullSnapshotRequest.SerializeToString, + response_deserializer=snapshots__service__pb2.CreateSnapshotResponse.FromString, + ) + self.ListFull = channel.unary_unary( + '/qdrant.Snapshots/ListFull', + request_serializer=snapshots__service__pb2.ListFullSnapshotsRequest.SerializeToString, + response_deserializer=snapshots__service__pb2.ListSnapshotsResponse.FromString, + ) + self.DeleteFull = channel.unary_unary( + '/qdrant.Snapshots/DeleteFull', + request_serializer=snapshots__service__pb2.DeleteFullSnapshotRequest.SerializeToString, + response_deserializer=snapshots__service__pb2.DeleteSnapshotResponse.FromString, + ) + + +class SnapshotsServicer(object): + """Missing associated documentation comment in .proto file.""" + + def Create(self, request, context): + """ + Create collection snapshot + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def List(self, request, context): + """ + List collection snapshots + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def Delete(self, request, context): + """ + Delete collection snapshot + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def CreateFull(self, request, context): + """ + Create full storage snapshot + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def ListFull(self, request, context): + """ + List full storage snapshots + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def DeleteFull(self, request, context): + """ + Delete full storage snapshot + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + +def add_SnapshotsServicer_to_server(servicer, server): + rpc_method_handlers = { + 'Create': grpc.unary_unary_rpc_method_handler( + servicer.Create, + request_deserializer=snapshots__service__pb2.CreateSnapshotRequest.FromString, + response_serializer=snapshots__service__pb2.CreateSnapshotResponse.SerializeToString, + ), + 'List': grpc.unary_unary_rpc_method_handler( + servicer.List, + request_deserializer=snapshots__service__pb2.ListSnapshotsRequest.FromString, + response_serializer=snapshots__service__pb2.ListSnapshotsResponse.SerializeToString, + ), + 'Delete': grpc.unary_unary_rpc_method_handler( + servicer.Delete, + request_deserializer=snapshots__service__pb2.DeleteSnapshotRequest.FromString, + response_serializer=snapshots__service__pb2.DeleteSnapshotResponse.SerializeToString, + ), + 'CreateFull': grpc.unary_unary_rpc_method_handler( + servicer.CreateFull, + request_deserializer=snapshots__service__pb2.CreateFullSnapshotRequest.FromString, + response_serializer=snapshots__service__pb2.CreateSnapshotResponse.SerializeToString, + ), + 'ListFull': grpc.unary_unary_rpc_method_handler( + servicer.ListFull, + request_deserializer=snapshots__service__pb2.ListFullSnapshotsRequest.FromString, + response_serializer=snapshots__service__pb2.ListSnapshotsResponse.SerializeToString, + ), + 'DeleteFull': grpc.unary_unary_rpc_method_handler( + servicer.DeleteFull, + request_deserializer=snapshots__service__pb2.DeleteFullSnapshotRequest.FromString, + response_serializer=snapshots__service__pb2.DeleteSnapshotResponse.SerializeToString, + ), + } + generic_handler = grpc.method_handlers_generic_handler( + 'qdrant.Snapshots', rpc_method_handlers) + server.add_generic_rpc_handlers((generic_handler,)) + + + # This class is part of an EXPERIMENTAL API. +class Snapshots(object): + """Missing associated documentation comment in .proto file.""" + + @staticmethod + def Create(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary(request, target, '/qdrant.Snapshots/Create', + snapshots__service__pb2.CreateSnapshotRequest.SerializeToString, + snapshots__service__pb2.CreateSnapshotResponse.FromString, + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + + @staticmethod + def List(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary(request, target, '/qdrant.Snapshots/List', + snapshots__service__pb2.ListSnapshotsRequest.SerializeToString, + snapshots__service__pb2.ListSnapshotsResponse.FromString, + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + + @staticmethod + def Delete(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary(request, target, '/qdrant.Snapshots/Delete', + snapshots__service__pb2.DeleteSnapshotRequest.SerializeToString, + snapshots__service__pb2.DeleteSnapshotResponse.FromString, + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + + @staticmethod + def CreateFull(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary(request, target, '/qdrant.Snapshots/CreateFull', + snapshots__service__pb2.CreateFullSnapshotRequest.SerializeToString, + snapshots__service__pb2.CreateSnapshotResponse.FromString, + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + + @staticmethod + def ListFull(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary(request, target, '/qdrant.Snapshots/ListFull', + snapshots__service__pb2.ListFullSnapshotsRequest.SerializeToString, + snapshots__service__pb2.ListSnapshotsResponse.FromString, + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + + @staticmethod + def DeleteFull(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary(request, target, '/qdrant.Snapshots/DeleteFull', + snapshots__service__pb2.DeleteFullSnapshotRequest.SerializeToString, + snapshots__service__pb2.DeleteSnapshotResponse.FromString, + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/http/__init__.py b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/http/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..6a7834ef3392f388cdc0eeebb1cb493ec9c88a0e --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/http/__init__.py @@ -0,0 +1,17 @@ +import inspect + +from pydantic import BaseModel +from qdrant_client._pydantic_compat import update_forward_refs +from qdrant_client.http.api_client import ( # noqa F401 + ApiClient as ApiClient, + AsyncApiClient as AsyncApiClient, + AsyncApis as AsyncApis, + SyncApis as SyncApis, +) +from qdrant_client.http.models import models as models # noqa F401 + +for model in inspect.getmembers(models, inspect.isclass): + if model[1].__module__ == "qdrant_client.http.models.models": + model_class = model[1] + if issubclass(model_class, BaseModel): + update_forward_refs(model_class) diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/http/__pycache__/__init__.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/http/__pycache__/__init__.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e5fe36a80d5a5a8b269959be7da8955e07649550 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/http/__pycache__/__init__.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/http/__pycache__/api_client.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/http/__pycache__/api_client.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..faaebff6b249b9b9307f4d78fe59ecdaf36545dd Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/http/__pycache__/api_client.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/http/__pycache__/configuration.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/http/__pycache__/configuration.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..0581c9f08af8884647000467c80872bbc580ce94 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/http/__pycache__/configuration.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/http/__pycache__/exceptions.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/http/__pycache__/exceptions.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..00c6d2028e1bb77fd139cd096b1891b502323eb4 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/http/__pycache__/exceptions.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/http/api/__init__.py b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/http/api/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/http/api/__pycache__/__init__.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/http/api/__pycache__/__init__.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..3d8b5d973cbcfa74fa85f87c9e4fea41ab37708b Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/http/api/__pycache__/__init__.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/http/api/__pycache__/aliases_api.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/http/api/__pycache__/aliases_api.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d3fdb88df8b9edfba53df5df6a245b59715932c0 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/http/api/__pycache__/aliases_api.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/http/api/__pycache__/beta_api.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/http/api/__pycache__/beta_api.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..0153d4dfa6d6eec291040f5fe58ae3fe053a1af4 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/http/api/__pycache__/beta_api.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/http/api/__pycache__/collections_api.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/http/api/__pycache__/collections_api.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..417330d37cf9a7a1550e9a9e41df4236f5ab9124 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/http/api/__pycache__/collections_api.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/http/api/__pycache__/distributed_api.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/http/api/__pycache__/distributed_api.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a9203cdd8499ee2d593153d0a0420d680a2255fd Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/http/api/__pycache__/distributed_api.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/http/api/__pycache__/indexes_api.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/http/api/__pycache__/indexes_api.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..580e005df6e5805efc0775a368721991dad33bc7 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/http/api/__pycache__/indexes_api.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/http/api/__pycache__/points_api.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/http/api/__pycache__/points_api.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..acb7b8c867ab11cfc77743327279965734a4b828 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/http/api/__pycache__/points_api.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/http/api/__pycache__/search_api.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/http/api/__pycache__/search_api.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..6f3e235bfdd6d6f77e2750401406bb827073136a Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/http/api/__pycache__/search_api.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/http/api/__pycache__/service_api.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/http/api/__pycache__/service_api.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..1d93cbc8a3fc2b08f0830303e35313252fa32dad Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/http/api/__pycache__/service_api.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/http/api/__pycache__/snapshots_api.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/http/api/__pycache__/snapshots_api.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..3e8f70a5858a4a676ec8a6b5c37bec2dc99a0abb Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/http/api/__pycache__/snapshots_api.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/http/api/aliases_api.py b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/http/api/aliases_api.py new file mode 100644 index 0000000000000000000000000000000000000000..69f1c6a42bf62ac7ebefb843e822e4345511f9c1 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/http/api/aliases_api.py @@ -0,0 +1,171 @@ +# flake8: noqa E501 +from typing import TYPE_CHECKING, Any, Dict, Set, TypeVar, Union + +from pydantic import BaseModel +from pydantic.main import BaseModel +from pydantic.version import VERSION as PYDANTIC_VERSION +from qdrant_client.http.models import * +from qdrant_client.http.models import models as m + +PYDANTIC_V2 = PYDANTIC_VERSION.startswith("2.") +Model = TypeVar("Model", bound="BaseModel") + +SetIntStr = Set[Union[int, str]] +DictIntStrAny = Dict[Union[int, str], Any] +file = None + + +def to_json(model: BaseModel, *args: Any, **kwargs: Any) -> str: + if PYDANTIC_V2: + return model.model_dump_json(*args, **kwargs) + else: + return model.json(*args, **kwargs) + + +def jsonable_encoder( + obj: Any, + include: Union[SetIntStr, DictIntStrAny] = None, + exclude=None, + by_alias: bool = True, + skip_defaults: bool = None, + exclude_unset: bool = True, + exclude_none: bool = True, +): + if hasattr(obj, "json") or hasattr(obj, "model_dump_json"): + return to_json( + obj, + include=include, + exclude=exclude, + by_alias=by_alias, + exclude_unset=bool(exclude_unset or skip_defaults), + exclude_none=exclude_none, + ) + + return obj + + +if TYPE_CHECKING: + from qdrant_client.http.api_client import ApiClient + + +class _AliasesApi: + def __init__(self, api_client: "Union[ApiClient, AsyncApiClient]"): + self.api_client = api_client + + def _build_for_get_collection_aliases( + self, + collection_name: str, + ): + """ + Get list of all aliases for a collection + """ + path_params = { + "collection_name": str(collection_name), + } + + headers = {} + return self.api_client.request( + type_=m.InlineResponse2009, + method="GET", + url="/collections/{collection_name}/aliases", + headers=headers if headers else None, + path_params=path_params, + ) + + def _build_for_get_collections_aliases( + self, + ): + """ + Get list of all existing collections aliases + """ + headers = {} + return self.api_client.request( + type_=m.InlineResponse2009, + method="GET", + url="/aliases", + headers=headers if headers else None, + ) + + def _build_for_update_aliases( + self, + timeout: int = None, + change_aliases_operation: m.ChangeAliasesOperation = None, + ): + query_params = {} + if timeout is not None: + query_params["timeout"] = str(timeout) + + headers = {} + body = jsonable_encoder(change_aliases_operation) + if "Content-Type" not in headers: + headers["Content-Type"] = "application/json" + return self.api_client.request( + type_=m.InlineResponse200, + method="POST", + url="/collections/aliases", + headers=headers if headers else None, + params=query_params, + content=body, + ) + + +class AsyncAliasesApi(_AliasesApi): + async def get_collection_aliases( + self, + collection_name: str, + ) -> m.InlineResponse2009: + """ + Get list of all aliases for a collection + """ + return await self._build_for_get_collection_aliases( + collection_name=collection_name, + ) + + async def get_collections_aliases( + self, + ) -> m.InlineResponse2009: + """ + Get list of all existing collections aliases + """ + return await self._build_for_get_collections_aliases() + + async def update_aliases( + self, + timeout: int = None, + change_aliases_operation: m.ChangeAliasesOperation = None, + ) -> m.InlineResponse200: + return await self._build_for_update_aliases( + timeout=timeout, + change_aliases_operation=change_aliases_operation, + ) + + +class SyncAliasesApi(_AliasesApi): + def get_collection_aliases( + self, + collection_name: str, + ) -> m.InlineResponse2009: + """ + Get list of all aliases for a collection + """ + return self._build_for_get_collection_aliases( + collection_name=collection_name, + ) + + def get_collections_aliases( + self, + ) -> m.InlineResponse2009: + """ + Get list of all existing collections aliases + """ + return self._build_for_get_collections_aliases() + + def update_aliases( + self, + timeout: int = None, + change_aliases_operation: m.ChangeAliasesOperation = None, + ) -> m.InlineResponse200: + return self._build_for_update_aliases( + timeout=timeout, + change_aliases_operation=change_aliases_operation, + ) diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/http/api/beta_api.py b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/http/api/beta_api.py new file mode 100644 index 0000000000000000000000000000000000000000..685ca2d288690b5f36921e5a5ec8de391699c181 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/http/api/beta_api.py @@ -0,0 +1,116 @@ +# flake8: noqa E501 +from typing import TYPE_CHECKING, Any, Dict, Set, TypeVar, Union + +from pydantic import BaseModel +from pydantic.main import BaseModel +from pydantic.version import VERSION as PYDANTIC_VERSION +from qdrant_client.http.models import * + +PYDANTIC_V2 = PYDANTIC_VERSION.startswith("2.") +Model = TypeVar("Model", bound="BaseModel") + +SetIntStr = Set[Union[int, str]] +DictIntStrAny = Dict[Union[int, str], Any] +file = None + + +def to_json(model: BaseModel, *args: Any, **kwargs: Any) -> str: + if PYDANTIC_V2: + return model.model_dump_json(*args, **kwargs) + else: + return model.json(*args, **kwargs) + + +def jsonable_encoder( + obj: Any, + include: Union[SetIntStr, DictIntStrAny] = None, + exclude=None, + by_alias: bool = True, + skip_defaults: bool = None, + exclude_unset: bool = True, + exclude_none: bool = True, +): + if hasattr(obj, "json") or hasattr(obj, "model_dump_json"): + return to_json( + obj, + include=include, + exclude=exclude, + by_alias=by_alias, + exclude_unset=bool(exclude_unset or skip_defaults), + exclude_none=exclude_none, + ) + + return obj + + +if TYPE_CHECKING: + from qdrant_client.http.api_client import ApiClient + + +class _BetaApi: + def __init__(self, api_client: "Union[ApiClient, AsyncApiClient]"): + self.api_client = api_client + + def _build_for_clear_issues( + self, + ): + """ + Removes all issues reported so far + """ + headers = {} + return self.api_client.request( + type_=bool, + method="DELETE", + url="/issues", + headers=headers if headers else None, + ) + + def _build_for_get_issues( + self, + ): + """ + Get a report of performance issues and configuration suggestions + """ + headers = {} + return self.api_client.request( + type_=object, + method="GET", + url="/issues", + headers=headers if headers else None, + ) + + +class AsyncBetaApi(_BetaApi): + async def clear_issues( + self, + ) -> bool: + """ + Removes all issues reported so far + """ + return await self._build_for_clear_issues() + + async def get_issues( + self, + ) -> object: + """ + Get a report of performance issues and configuration suggestions + """ + return await self._build_for_get_issues() + + +class SyncBetaApi(_BetaApi): + def clear_issues( + self, + ) -> bool: + """ + Removes all issues reported so far + """ + return self._build_for_clear_issues() + + def get_issues( + self, + ) -> object: + """ + Get a report of performance issues and configuration suggestions + """ + return self._build_for_get_issues() diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/http/api/collections_api.py b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/http/api/collections_api.py new file mode 100644 index 0000000000000000000000000000000000000000..52c155d094c3f3d7c577dd0cfed9c82db45428cd --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/http/api/collections_api.py @@ -0,0 +1,345 @@ +# flake8: noqa E501 +from typing import TYPE_CHECKING, Any, Dict, Set, TypeVar, Union + +from pydantic import BaseModel +from pydantic.main import BaseModel +from pydantic.version import VERSION as PYDANTIC_VERSION +from qdrant_client.http.models import * +from qdrant_client.http.models import models as m + +PYDANTIC_V2 = PYDANTIC_VERSION.startswith("2.") +Model = TypeVar("Model", bound="BaseModel") + +SetIntStr = Set[Union[int, str]] +DictIntStrAny = Dict[Union[int, str], Any] +file = None + + +def to_json(model: BaseModel, *args: Any, **kwargs: Any) -> str: + if PYDANTIC_V2: + return model.model_dump_json(*args, **kwargs) + else: + return model.json(*args, **kwargs) + + +def jsonable_encoder( + obj: Any, + include: Union[SetIntStr, DictIntStrAny] = None, + exclude=None, + by_alias: bool = True, + skip_defaults: bool = None, + exclude_unset: bool = True, + exclude_none: bool = True, +): + if hasattr(obj, "json") or hasattr(obj, "model_dump_json"): + return to_json( + obj, + include=include, + exclude=exclude, + by_alias=by_alias, + exclude_unset=bool(exclude_unset or skip_defaults), + exclude_none=exclude_none, + ) + + return obj + + +if TYPE_CHECKING: + from qdrant_client.http.api_client import ApiClient + + +class _CollectionsApi: + def __init__(self, api_client: "Union[ApiClient, AsyncApiClient]"): + self.api_client = api_client + + def _build_for_collection_exists( + self, + collection_name: str, + ): + """ + Returns \"true\" if the given collection name exists, and \"false\" otherwise + """ + path_params = { + "collection_name": str(collection_name), + } + + headers = {} + return self.api_client.request( + type_=m.InlineResponse2007, + method="GET", + url="/collections/{collection_name}/exists", + headers=headers if headers else None, + path_params=path_params, + ) + + def _build_for_create_collection( + self, + collection_name: str, + timeout: int = None, + create_collection: m.CreateCollection = None, + ): + """ + Create new collection with given parameters + """ + path_params = { + "collection_name": str(collection_name), + } + + query_params = {} + if timeout is not None: + query_params["timeout"] = str(timeout) + + headers = {} + body = jsonable_encoder(create_collection) + if "Content-Type" not in headers: + headers["Content-Type"] = "application/json" + return self.api_client.request( + type_=m.InlineResponse200, + method="PUT", + url="/collections/{collection_name}", + headers=headers if headers else None, + path_params=path_params, + params=query_params, + content=body, + ) + + def _build_for_delete_collection( + self, + collection_name: str, + timeout: int = None, + ): + """ + Drop collection and all associated data + """ + path_params = { + "collection_name": str(collection_name), + } + + query_params = {} + if timeout is not None: + query_params["timeout"] = str(timeout) + + headers = {} + return self.api_client.request( + type_=m.InlineResponse200, + method="DELETE", + url="/collections/{collection_name}", + headers=headers if headers else None, + path_params=path_params, + params=query_params, + ) + + def _build_for_get_collection( + self, + collection_name: str, + ): + """ + Get detailed information about specified existing collection + """ + path_params = { + "collection_name": str(collection_name), + } + + headers = {} + return self.api_client.request( + type_=m.InlineResponse2005, + method="GET", + url="/collections/{collection_name}", + headers=headers if headers else None, + path_params=path_params, + ) + + def _build_for_get_collections( + self, + ): + """ + Get list name of all existing collections + """ + headers = {} + return self.api_client.request( + type_=m.InlineResponse2004, + method="GET", + url="/collections", + headers=headers if headers else None, + ) + + def _build_for_update_collection( + self, + collection_name: str, + timeout: int = None, + update_collection: m.UpdateCollection = None, + ): + """ + Update parameters of the existing collection + """ + path_params = { + "collection_name": str(collection_name), + } + + query_params = {} + if timeout is not None: + query_params["timeout"] = str(timeout) + + headers = {} + body = jsonable_encoder(update_collection) + if "Content-Type" not in headers: + headers["Content-Type"] = "application/json" + return self.api_client.request( + type_=m.InlineResponse200, + method="PATCH", + url="/collections/{collection_name}", + headers=headers if headers else None, + path_params=path_params, + params=query_params, + content=body, + ) + + +class AsyncCollectionsApi(_CollectionsApi): + async def collection_exists( + self, + collection_name: str, + ) -> m.InlineResponse2007: + """ + Returns \"true\" if the given collection name exists, and \"false\" otherwise + """ + return await self._build_for_collection_exists( + collection_name=collection_name, + ) + + async def create_collection( + self, + collection_name: str, + timeout: int = None, + create_collection: m.CreateCollection = None, + ) -> m.InlineResponse200: + """ + Create new collection with given parameters + """ + return await self._build_for_create_collection( + collection_name=collection_name, + timeout=timeout, + create_collection=create_collection, + ) + + async def delete_collection( + self, + collection_name: str, + timeout: int = None, + ) -> m.InlineResponse200: + """ + Drop collection and all associated data + """ + return await self._build_for_delete_collection( + collection_name=collection_name, + timeout=timeout, + ) + + async def get_collection( + self, + collection_name: str, + ) -> m.InlineResponse2005: + """ + Get detailed information about specified existing collection + """ + return await self._build_for_get_collection( + collection_name=collection_name, + ) + + async def get_collections( + self, + ) -> m.InlineResponse2004: + """ + Get list name of all existing collections + """ + return await self._build_for_get_collections() + + async def update_collection( + self, + collection_name: str, + timeout: int = None, + update_collection: m.UpdateCollection = None, + ) -> m.InlineResponse200: + """ + Update parameters of the existing collection + """ + return await self._build_for_update_collection( + collection_name=collection_name, + timeout=timeout, + update_collection=update_collection, + ) + + +class SyncCollectionsApi(_CollectionsApi): + def collection_exists( + self, + collection_name: str, + ) -> m.InlineResponse2007: + """ + Returns \"true\" if the given collection name exists, and \"false\" otherwise + """ + return self._build_for_collection_exists( + collection_name=collection_name, + ) + + def create_collection( + self, + collection_name: str, + timeout: int = None, + create_collection: m.CreateCollection = None, + ) -> m.InlineResponse200: + """ + Create new collection with given parameters + """ + return self._build_for_create_collection( + collection_name=collection_name, + timeout=timeout, + create_collection=create_collection, + ) + + def delete_collection( + self, + collection_name: str, + timeout: int = None, + ) -> m.InlineResponse200: + """ + Drop collection and all associated data + """ + return self._build_for_delete_collection( + collection_name=collection_name, + timeout=timeout, + ) + + def get_collection( + self, + collection_name: str, + ) -> m.InlineResponse2005: + """ + Get detailed information about specified existing collection + """ + return self._build_for_get_collection( + collection_name=collection_name, + ) + + def get_collections( + self, + ) -> m.InlineResponse2004: + """ + Get list name of all existing collections + """ + return self._build_for_get_collections() + + def update_collection( + self, + collection_name: str, + timeout: int = None, + update_collection: m.UpdateCollection = None, + ) -> m.InlineResponse200: + """ + Update parameters of the existing collection + """ + return self._build_for_update_collection( + collection_name=collection_name, + timeout=timeout, + update_collection=update_collection, + ) diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/http/api/distributed_api.py b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/http/api/distributed_api.py new file mode 100644 index 0000000000000000000000000000000000000000..f7a360f509876689920b8ce67b102476061d61f8 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/http/api/distributed_api.py @@ -0,0 +1,358 @@ +# flake8: noqa E501 +from typing import TYPE_CHECKING, Any, Dict, Set, TypeVar, Union + +from pydantic import BaseModel +from pydantic.main import BaseModel +from pydantic.version import VERSION as PYDANTIC_VERSION +from qdrant_client.http.models import * +from qdrant_client.http.models import models as m + +PYDANTIC_V2 = PYDANTIC_VERSION.startswith("2.") +Model = TypeVar("Model", bound="BaseModel") + +SetIntStr = Set[Union[int, str]] +DictIntStrAny = Dict[Union[int, str], Any] +file = None + + +def to_json(model: BaseModel, *args: Any, **kwargs: Any) -> str: + if PYDANTIC_V2: + return model.model_dump_json(*args, **kwargs) + else: + return model.json(*args, **kwargs) + + +def jsonable_encoder( + obj: Any, + include: Union[SetIntStr, DictIntStrAny] = None, + exclude=None, + by_alias: bool = True, + skip_defaults: bool = None, + exclude_unset: bool = True, + exclude_none: bool = True, +): + if hasattr(obj, "json") or hasattr(obj, "model_dump_json"): + return to_json( + obj, + include=include, + exclude=exclude, + by_alias=by_alias, + exclude_unset=bool(exclude_unset or skip_defaults), + exclude_none=exclude_none, + ) + + return obj + + +if TYPE_CHECKING: + from qdrant_client.http.api_client import ApiClient + + +class _DistributedApi: + def __init__(self, api_client: "Union[ApiClient, AsyncApiClient]"): + self.api_client = api_client + + def _build_for_cluster_status( + self, + ): + """ + Get information about the current state and composition of the cluster + """ + headers = {} + return self.api_client.request( + type_=m.InlineResponse2003, + method="GET", + url="/cluster", + headers=headers if headers else None, + ) + + def _build_for_collection_cluster_info( + self, + collection_name: str, + ): + """ + Get cluster information for a collection + """ + path_params = { + "collection_name": str(collection_name), + } + + headers = {} + return self.api_client.request( + type_=m.InlineResponse2008, + method="GET", + url="/collections/{collection_name}/cluster", + headers=headers if headers else None, + path_params=path_params, + ) + + def _build_for_create_shard_key( + self, + collection_name: str, + timeout: int = None, + create_sharding_key: m.CreateShardingKey = None, + ): + path_params = { + "collection_name": str(collection_name), + } + + query_params = {} + if timeout is not None: + query_params["timeout"] = str(timeout) + + headers = {} + body = jsonable_encoder(create_sharding_key) + if "Content-Type" not in headers: + headers["Content-Type"] = "application/json" + return self.api_client.request( + type_=m.InlineResponse200, + method="PUT", + url="/collections/{collection_name}/shards", + headers=headers if headers else None, + path_params=path_params, + params=query_params, + content=body, + ) + + def _build_for_delete_shard_key( + self, + collection_name: str, + timeout: int = None, + drop_sharding_key: m.DropShardingKey = None, + ): + path_params = { + "collection_name": str(collection_name), + } + + query_params = {} + if timeout is not None: + query_params["timeout"] = str(timeout) + + headers = {} + body = jsonable_encoder(drop_sharding_key) + if "Content-Type" not in headers: + headers["Content-Type"] = "application/json" + return self.api_client.request( + type_=m.InlineResponse200, + method="POST", + url="/collections/{collection_name}/shards/delete", + headers=headers if headers else None, + path_params=path_params, + params=query_params, + content=body, + ) + + def _build_for_recover_current_peer( + self, + ): + headers = {} + return self.api_client.request( + type_=m.InlineResponse200, + method="POST", + url="/cluster/recover", + headers=headers if headers else None, + ) + + def _build_for_remove_peer( + self, + peer_id: int, + force: bool = None, + ): + """ + Tries to remove peer from the cluster. Will return an error if peer has shards on it. + """ + path_params = { + "peer_id": str(peer_id), + } + + query_params = {} + if force is not None: + query_params["force"] = str(force).lower() + + headers = {} + return self.api_client.request( + type_=m.InlineResponse200, + method="DELETE", + url="/cluster/peer/{peer_id}", + headers=headers if headers else None, + path_params=path_params, + params=query_params, + ) + + def _build_for_update_collection_cluster( + self, + collection_name: str, + timeout: int = None, + cluster_operations: m.ClusterOperations = None, + ): + path_params = { + "collection_name": str(collection_name), + } + + query_params = {} + if timeout is not None: + query_params["timeout"] = str(timeout) + + headers = {} + body = jsonable_encoder(cluster_operations) + if "Content-Type" not in headers: + headers["Content-Type"] = "application/json" + return self.api_client.request( + type_=m.InlineResponse200, + method="POST", + url="/collections/{collection_name}/cluster", + headers=headers if headers else None, + path_params=path_params, + params=query_params, + content=body, + ) + + +class AsyncDistributedApi(_DistributedApi): + async def cluster_status( + self, + ) -> m.InlineResponse2003: + """ + Get information about the current state and composition of the cluster + """ + return await self._build_for_cluster_status() + + async def collection_cluster_info( + self, + collection_name: str, + ) -> m.InlineResponse2008: + """ + Get cluster information for a collection + """ + return await self._build_for_collection_cluster_info( + collection_name=collection_name, + ) + + async def create_shard_key( + self, + collection_name: str, + timeout: int = None, + create_sharding_key: m.CreateShardingKey = None, + ) -> m.InlineResponse200: + return await self._build_for_create_shard_key( + collection_name=collection_name, + timeout=timeout, + create_sharding_key=create_sharding_key, + ) + + async def delete_shard_key( + self, + collection_name: str, + timeout: int = None, + drop_sharding_key: m.DropShardingKey = None, + ) -> m.InlineResponse200: + return await self._build_for_delete_shard_key( + collection_name=collection_name, + timeout=timeout, + drop_sharding_key=drop_sharding_key, + ) + + async def recover_current_peer( + self, + ) -> m.InlineResponse200: + return await self._build_for_recover_current_peer() + + async def remove_peer( + self, + peer_id: int, + force: bool = None, + ) -> m.InlineResponse200: + """ + Tries to remove peer from the cluster. Will return an error if peer has shards on it. + """ + return await self._build_for_remove_peer( + peer_id=peer_id, + force=force, + ) + + async def update_collection_cluster( + self, + collection_name: str, + timeout: int = None, + cluster_operations: m.ClusterOperations = None, + ) -> m.InlineResponse200: + return await self._build_for_update_collection_cluster( + collection_name=collection_name, + timeout=timeout, + cluster_operations=cluster_operations, + ) + + +class SyncDistributedApi(_DistributedApi): + def cluster_status( + self, + ) -> m.InlineResponse2003: + """ + Get information about the current state and composition of the cluster + """ + return self._build_for_cluster_status() + + def collection_cluster_info( + self, + collection_name: str, + ) -> m.InlineResponse2008: + """ + Get cluster information for a collection + """ + return self._build_for_collection_cluster_info( + collection_name=collection_name, + ) + + def create_shard_key( + self, + collection_name: str, + timeout: int = None, + create_sharding_key: m.CreateShardingKey = None, + ) -> m.InlineResponse200: + return self._build_for_create_shard_key( + collection_name=collection_name, + timeout=timeout, + create_sharding_key=create_sharding_key, + ) + + def delete_shard_key( + self, + collection_name: str, + timeout: int = None, + drop_sharding_key: m.DropShardingKey = None, + ) -> m.InlineResponse200: + return self._build_for_delete_shard_key( + collection_name=collection_name, + timeout=timeout, + drop_sharding_key=drop_sharding_key, + ) + + def recover_current_peer( + self, + ) -> m.InlineResponse200: + return self._build_for_recover_current_peer() + + def remove_peer( + self, + peer_id: int, + force: bool = None, + ) -> m.InlineResponse200: + """ + Tries to remove peer from the cluster. Will return an error if peer has shards on it. + """ + return self._build_for_remove_peer( + peer_id=peer_id, + force=force, + ) + + def update_collection_cluster( + self, + collection_name: str, + timeout: int = None, + cluster_operations: m.ClusterOperations = None, + ) -> m.InlineResponse200: + return self._build_for_update_collection_cluster( + collection_name=collection_name, + timeout=timeout, + cluster_operations=cluster_operations, + ) diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/http/api/indexes_api.py b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/http/api/indexes_api.py new file mode 100644 index 0000000000000000000000000000000000000000..5bc4e9de8854aa1aa2d4f892eb5a6be6480aa248 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/http/api/indexes_api.py @@ -0,0 +1,190 @@ +# flake8: noqa E501 +from typing import TYPE_CHECKING, Any, Dict, Set, TypeVar, Union + +from pydantic import BaseModel +from pydantic.main import BaseModel +from pydantic.version import VERSION as PYDANTIC_VERSION +from qdrant_client.http.models import * +from qdrant_client.http.models import models as m + +PYDANTIC_V2 = PYDANTIC_VERSION.startswith("2.") +Model = TypeVar("Model", bound="BaseModel") + +SetIntStr = Set[Union[int, str]] +DictIntStrAny = Dict[Union[int, str], Any] +file = None + + +def to_json(model: BaseModel, *args: Any, **kwargs: Any) -> str: + if PYDANTIC_V2: + return model.model_dump_json(*args, **kwargs) + else: + return model.json(*args, **kwargs) + + +def jsonable_encoder( + obj: Any, + include: Union[SetIntStr, DictIntStrAny] = None, + exclude=None, + by_alias: bool = True, + skip_defaults: bool = None, + exclude_unset: bool = True, + exclude_none: bool = True, +): + if hasattr(obj, "json") or hasattr(obj, "model_dump_json"): + return to_json( + obj, + include=include, + exclude=exclude, + by_alias=by_alias, + exclude_unset=bool(exclude_unset or skip_defaults), + exclude_none=exclude_none, + ) + + return obj + + +if TYPE_CHECKING: + from qdrant_client.http.api_client import ApiClient + + +class _IndexesApi: + def __init__(self, api_client: "Union[ApiClient, AsyncApiClient]"): + self.api_client = api_client + + def _build_for_create_field_index( + self, + collection_name: str, + wait: bool = None, + ordering: WriteOrdering = None, + create_field_index: m.CreateFieldIndex = None, + ): + """ + Create index for field in collection + """ + path_params = { + "collection_name": str(collection_name), + } + + query_params = {} + if wait is not None: + query_params["wait"] = str(wait).lower() + if ordering is not None: + query_params["ordering"] = str(ordering) + + headers = {} + body = jsonable_encoder(create_field_index) + if "Content-Type" not in headers: + headers["Content-Type"] = "application/json" + return self.api_client.request( + type_=m.InlineResponse2006, + method="PUT", + url="/collections/{collection_name}/index", + headers=headers if headers else None, + path_params=path_params, + params=query_params, + content=body, + ) + + def _build_for_delete_field_index( + self, + collection_name: str, + field_name: str, + wait: bool = None, + ordering: WriteOrdering = None, + ): + """ + Delete field index for collection + """ + path_params = { + "collection_name": str(collection_name), + "field_name": str(field_name), + } + + query_params = {} + if wait is not None: + query_params["wait"] = str(wait).lower() + if ordering is not None: + query_params["ordering"] = str(ordering) + + headers = {} + return self.api_client.request( + type_=m.InlineResponse2006, + method="DELETE", + url="/collections/{collection_name}/index/{field_name}", + headers=headers if headers else None, + path_params=path_params, + params=query_params, + ) + + +class AsyncIndexesApi(_IndexesApi): + async def create_field_index( + self, + collection_name: str, + wait: bool = None, + ordering: WriteOrdering = None, + create_field_index: m.CreateFieldIndex = None, + ) -> m.InlineResponse2006: + """ + Create index for field in collection + """ + return await self._build_for_create_field_index( + collection_name=collection_name, + wait=wait, + ordering=ordering, + create_field_index=create_field_index, + ) + + async def delete_field_index( + self, + collection_name: str, + field_name: str, + wait: bool = None, + ordering: WriteOrdering = None, + ) -> m.InlineResponse2006: + """ + Delete field index for collection + """ + return await self._build_for_delete_field_index( + collection_name=collection_name, + field_name=field_name, + wait=wait, + ordering=ordering, + ) + + +class SyncIndexesApi(_IndexesApi): + def create_field_index( + self, + collection_name: str, + wait: bool = None, + ordering: WriteOrdering = None, + create_field_index: m.CreateFieldIndex = None, + ) -> m.InlineResponse2006: + """ + Create index for field in collection + """ + return self._build_for_create_field_index( + collection_name=collection_name, + wait=wait, + ordering=ordering, + create_field_index=create_field_index, + ) + + def delete_field_index( + self, + collection_name: str, + field_name: str, + wait: bool = None, + ordering: WriteOrdering = None, + ) -> m.InlineResponse2006: + """ + Delete field index for collection + """ + return self._build_for_delete_field_index( + collection_name=collection_name, + field_name=field_name, + wait=wait, + ordering=ordering, + ) diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/http/api/points_api.py b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/http/api/points_api.py new file mode 100644 index 0000000000000000000000000000000000000000..df1cee4aacc5d18ab00c4dc95d3211d3f2a39bd8 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/http/api/points_api.py @@ -0,0 +1,992 @@ +# flake8: noqa E501 +from typing import TYPE_CHECKING, Any, Dict, Set, TypeVar, Union + +from pydantic import BaseModel +from pydantic.main import BaseModel +from pydantic.version import VERSION as PYDANTIC_VERSION +from qdrant_client.http.models import * +from qdrant_client.http.models import models as m + +PYDANTIC_V2 = PYDANTIC_VERSION.startswith("2.") +Model = TypeVar("Model", bound="BaseModel") + +SetIntStr = Set[Union[int, str]] +DictIntStrAny = Dict[Union[int, str], Any] +file = None + + +def to_json(model: BaseModel, *args: Any, **kwargs: Any) -> str: + if PYDANTIC_V2: + return model.model_dump_json(*args, **kwargs) + else: + return model.json(*args, **kwargs) + + +def jsonable_encoder( + obj: Any, + include: Union[SetIntStr, DictIntStrAny] = None, + exclude=None, + by_alias: bool = True, + skip_defaults: bool = None, + exclude_unset: bool = True, + exclude_none: bool = True, +): + if hasattr(obj, "json") or hasattr(obj, "model_dump_json"): + return to_json( + obj, + include=include, + exclude=exclude, + by_alias=by_alias, + exclude_unset=bool(exclude_unset or skip_defaults), + exclude_none=exclude_none, + ) + + return obj + + +if TYPE_CHECKING: + from qdrant_client.http.api_client import ApiClient + + +class _PointsApi: + def __init__(self, api_client: "Union[ApiClient, AsyncApiClient]"): + self.api_client = api_client + + def _build_for_batch_update( + self, + collection_name: str, + wait: bool = None, + ordering: WriteOrdering = None, + update_operations: m.UpdateOperations = None, + ): + """ + Apply a series of update operations for points, vectors and payloads + """ + path_params = { + "collection_name": str(collection_name), + } + + query_params = {} + if wait is not None: + query_params["wait"] = str(wait).lower() + if ordering is not None: + query_params["ordering"] = str(ordering) + + headers = {} + body = jsonable_encoder(update_operations) + if "Content-Type" not in headers: + headers["Content-Type"] = "application/json" + return self.api_client.request( + type_=m.InlineResponse20015, + method="POST", + url="/collections/{collection_name}/points/batch", + headers=headers if headers else None, + path_params=path_params, + params=query_params, + content=body, + ) + + def _build_for_clear_payload( + self, + collection_name: str, + wait: bool = None, + ordering: WriteOrdering = None, + points_selector: m.PointsSelector = None, + ): + """ + Remove all payload for specified points + """ + path_params = { + "collection_name": str(collection_name), + } + + query_params = {} + if wait is not None: + query_params["wait"] = str(wait).lower() + if ordering is not None: + query_params["ordering"] = str(ordering) + + headers = {} + body = jsonable_encoder(points_selector) + if "Content-Type" not in headers: + headers["Content-Type"] = "application/json" + return self.api_client.request( + type_=m.InlineResponse2006, + method="POST", + url="/collections/{collection_name}/points/payload/clear", + headers=headers if headers else None, + path_params=path_params, + params=query_params, + content=body, + ) + + def _build_for_count_points( + self, + collection_name: str, + timeout: int = None, + count_request: m.CountRequest = None, + ): + """ + Count points which matches given filtering condition + """ + path_params = { + "collection_name": str(collection_name), + } + + query_params = {} + if timeout is not None: + query_params["timeout"] = str(timeout) + + headers = {} + body = jsonable_encoder(count_request) + if "Content-Type" not in headers: + headers["Content-Type"] = "application/json" + return self.api_client.request( + type_=m.InlineResponse20020, + method="POST", + url="/collections/{collection_name}/points/count", + headers=headers if headers else None, + path_params=path_params, + params=query_params, + content=body, + ) + + def _build_for_delete_payload( + self, + collection_name: str, + wait: bool = None, + ordering: WriteOrdering = None, + delete_payload: m.DeletePayload = None, + ): + """ + Delete specified key payload for points + """ + path_params = { + "collection_name": str(collection_name), + } + + query_params = {} + if wait is not None: + query_params["wait"] = str(wait).lower() + if ordering is not None: + query_params["ordering"] = str(ordering) + + headers = {} + body = jsonable_encoder(delete_payload) + if "Content-Type" not in headers: + headers["Content-Type"] = "application/json" + return self.api_client.request( + type_=m.InlineResponse2006, + method="POST", + url="/collections/{collection_name}/points/payload/delete", + headers=headers if headers else None, + path_params=path_params, + params=query_params, + content=body, + ) + + def _build_for_delete_points( + self, + collection_name: str, + wait: bool = None, + ordering: WriteOrdering = None, + points_selector: m.PointsSelector = None, + ): + """ + Delete points + """ + path_params = { + "collection_name": str(collection_name), + } + + query_params = {} + if wait is not None: + query_params["wait"] = str(wait).lower() + if ordering is not None: + query_params["ordering"] = str(ordering) + + headers = {} + body = jsonable_encoder(points_selector) + if "Content-Type" not in headers: + headers["Content-Type"] = "application/json" + return self.api_client.request( + type_=m.InlineResponse2006, + method="POST", + url="/collections/{collection_name}/points/delete", + headers=headers if headers else None, + path_params=path_params, + params=query_params, + content=body, + ) + + def _build_for_delete_vectors( + self, + collection_name: str, + wait: bool = None, + ordering: WriteOrdering = None, + delete_vectors: m.DeleteVectors = None, + ): + """ + Delete named vectors from the given points. + """ + path_params = { + "collection_name": str(collection_name), + } + + query_params = {} + if wait is not None: + query_params["wait"] = str(wait).lower() + if ordering is not None: + query_params["ordering"] = str(ordering) + + headers = {} + body = jsonable_encoder(delete_vectors) + if "Content-Type" not in headers: + headers["Content-Type"] = "application/json" + return self.api_client.request( + type_=m.InlineResponse2006, + method="POST", + url="/collections/{collection_name}/points/vectors/delete", + headers=headers if headers else None, + path_params=path_params, + params=query_params, + content=body, + ) + + def _build_for_facet( + self, + collection_name: str, + timeout: int = None, + consistency: m.ReadConsistency = None, + facet_request: m.FacetRequest = None, + ): + """ + Count points that satisfy the given filter for each unique value of a payload key. + """ + path_params = { + "collection_name": str(collection_name), + } + + query_params = {} + if timeout is not None: + query_params["timeout"] = str(timeout) + if consistency is not None: + query_params["consistency"] = str(consistency) + + headers = {} + body = jsonable_encoder(facet_request) + if "Content-Type" not in headers: + headers["Content-Type"] = "application/json" + return self.api_client.request( + type_=m.InlineResponse20021, + method="POST", + url="/collections/{collection_name}/facet", + headers=headers if headers else None, + path_params=path_params, + params=query_params, + content=body, + ) + + def _build_for_get_point( + self, + collection_name: str, + id: m.ExtendedPointId, + consistency: m.ReadConsistency = None, + ): + """ + Retrieve full information of single point by id + """ + path_params = { + "collection_name": str(collection_name), + "id": str(id), + } + + query_params = {} + if consistency is not None: + query_params["consistency"] = str(consistency) + + headers = {} + return self.api_client.request( + type_=m.InlineResponse20013, + method="GET", + url="/collections/{collection_name}/points/{id}", + headers=headers if headers else None, + path_params=path_params, + params=query_params, + ) + + def _build_for_get_points( + self, + collection_name: str, + consistency: m.ReadConsistency = None, + timeout: int = None, + point_request: m.PointRequest = None, + ): + """ + Retrieve multiple points by specified IDs + """ + path_params = { + "collection_name": str(collection_name), + } + + query_params = {} + if consistency is not None: + query_params["consistency"] = str(consistency) + if timeout is not None: + query_params["timeout"] = str(timeout) + + headers = {} + body = jsonable_encoder(point_request) + if "Content-Type" not in headers: + headers["Content-Type"] = "application/json" + return self.api_client.request( + type_=m.InlineResponse20014, + method="POST", + url="/collections/{collection_name}/points", + headers=headers if headers else None, + path_params=path_params, + params=query_params, + content=body, + ) + + def _build_for_overwrite_payload( + self, + collection_name: str, + wait: bool = None, + ordering: WriteOrdering = None, + set_payload: m.SetPayload = None, + ): + """ + Replace full payload of points with new one + """ + path_params = { + "collection_name": str(collection_name), + } + + query_params = {} + if wait is not None: + query_params["wait"] = str(wait).lower() + if ordering is not None: + query_params["ordering"] = str(ordering) + + headers = {} + body = jsonable_encoder(set_payload) + if "Content-Type" not in headers: + headers["Content-Type"] = "application/json" + return self.api_client.request( + type_=m.InlineResponse2006, + method="PUT", + url="/collections/{collection_name}/points/payload", + headers=headers if headers else None, + path_params=path_params, + params=query_params, + content=body, + ) + + def _build_for_scroll_points( + self, + collection_name: str, + consistency: m.ReadConsistency = None, + timeout: int = None, + scroll_request: m.ScrollRequest = None, + ): + """ + Scroll request - paginate over all points which matches given filtering condition + """ + path_params = { + "collection_name": str(collection_name), + } + + query_params = {} + if consistency is not None: + query_params["consistency"] = str(consistency) + if timeout is not None: + query_params["timeout"] = str(timeout) + + headers = {} + body = jsonable_encoder(scroll_request) + if "Content-Type" not in headers: + headers["Content-Type"] = "application/json" + return self.api_client.request( + type_=m.InlineResponse20016, + method="POST", + url="/collections/{collection_name}/points/scroll", + headers=headers if headers else None, + path_params=path_params, + params=query_params, + content=body, + ) + + def _build_for_set_payload( + self, + collection_name: str, + wait: bool = None, + ordering: WriteOrdering = None, + set_payload: m.SetPayload = None, + ): + """ + Set payload values for points + """ + path_params = { + "collection_name": str(collection_name), + } + + query_params = {} + if wait is not None: + query_params["wait"] = str(wait).lower() + if ordering is not None: + query_params["ordering"] = str(ordering) + + headers = {} + body = jsonable_encoder(set_payload) + if "Content-Type" not in headers: + headers["Content-Type"] = "application/json" + return self.api_client.request( + type_=m.InlineResponse2006, + method="POST", + url="/collections/{collection_name}/points/payload", + headers=headers if headers else None, + path_params=path_params, + params=query_params, + content=body, + ) + + def _build_for_update_vectors( + self, + collection_name: str, + wait: bool = None, + ordering: WriteOrdering = None, + update_vectors: m.UpdateVectors = None, + ): + """ + Update specified named vectors on points, keep unspecified vectors intact. + """ + path_params = { + "collection_name": str(collection_name), + } + + query_params = {} + if wait is not None: + query_params["wait"] = str(wait).lower() + if ordering is not None: + query_params["ordering"] = str(ordering) + + headers = {} + body = jsonable_encoder(update_vectors) + if "Content-Type" not in headers: + headers["Content-Type"] = "application/json" + return self.api_client.request( + type_=m.InlineResponse2006, + method="PUT", + url="/collections/{collection_name}/points/vectors", + headers=headers if headers else None, + path_params=path_params, + params=query_params, + content=body, + ) + + def _build_for_upsert_points( + self, + collection_name: str, + wait: bool = None, + ordering: WriteOrdering = None, + point_insert_operations: m.PointInsertOperations = None, + ): + """ + Perform insert + updates on points. If point with given ID already exists - it will be overwritten. + """ + path_params = { + "collection_name": str(collection_name), + } + + query_params = {} + if wait is not None: + query_params["wait"] = str(wait).lower() + if ordering is not None: + query_params["ordering"] = str(ordering) + + headers = {} + body = jsonable_encoder(point_insert_operations) + if "Content-Type" not in headers: + headers["Content-Type"] = "application/json" + return self.api_client.request( + type_=m.InlineResponse2006, + method="PUT", + url="/collections/{collection_name}/points", + headers=headers if headers else None, + path_params=path_params, + params=query_params, + content=body, + ) + + +class AsyncPointsApi(_PointsApi): + async def batch_update( + self, + collection_name: str, + wait: bool = None, + ordering: WriteOrdering = None, + update_operations: m.UpdateOperations = None, + ) -> m.InlineResponse20015: + """ + Apply a series of update operations for points, vectors and payloads + """ + return await self._build_for_batch_update( + collection_name=collection_name, + wait=wait, + ordering=ordering, + update_operations=update_operations, + ) + + async def clear_payload( + self, + collection_name: str, + wait: bool = None, + ordering: WriteOrdering = None, + points_selector: m.PointsSelector = None, + ) -> m.InlineResponse2006: + """ + Remove all payload for specified points + """ + return await self._build_for_clear_payload( + collection_name=collection_name, + wait=wait, + ordering=ordering, + points_selector=points_selector, + ) + + async def count_points( + self, + collection_name: str, + timeout: int = None, + count_request: m.CountRequest = None, + ) -> m.InlineResponse20020: + """ + Count points which matches given filtering condition + """ + return await self._build_for_count_points( + collection_name=collection_name, + timeout=timeout, + count_request=count_request, + ) + + async def delete_payload( + self, + collection_name: str, + wait: bool = None, + ordering: WriteOrdering = None, + delete_payload: m.DeletePayload = None, + ) -> m.InlineResponse2006: + """ + Delete specified key payload for points + """ + return await self._build_for_delete_payload( + collection_name=collection_name, + wait=wait, + ordering=ordering, + delete_payload=delete_payload, + ) + + async def delete_points( + self, + collection_name: str, + wait: bool = None, + ordering: WriteOrdering = None, + points_selector: m.PointsSelector = None, + ) -> m.InlineResponse2006: + """ + Delete points + """ + return await self._build_for_delete_points( + collection_name=collection_name, + wait=wait, + ordering=ordering, + points_selector=points_selector, + ) + + async def delete_vectors( + self, + collection_name: str, + wait: bool = None, + ordering: WriteOrdering = None, + delete_vectors: m.DeleteVectors = None, + ) -> m.InlineResponse2006: + """ + Delete named vectors from the given points. + """ + return await self._build_for_delete_vectors( + collection_name=collection_name, + wait=wait, + ordering=ordering, + delete_vectors=delete_vectors, + ) + + async def facet( + self, + collection_name: str, + timeout: int = None, + consistency: m.ReadConsistency = None, + facet_request: m.FacetRequest = None, + ) -> m.InlineResponse20021: + """ + Count points that satisfy the given filter for each unique value of a payload key. + """ + return await self._build_for_facet( + collection_name=collection_name, + timeout=timeout, + consistency=consistency, + facet_request=facet_request, + ) + + async def get_point( + self, + collection_name: str, + id: m.ExtendedPointId, + consistency: m.ReadConsistency = None, + ) -> m.InlineResponse20013: + """ + Retrieve full information of single point by id + """ + return await self._build_for_get_point( + collection_name=collection_name, + id=id, + consistency=consistency, + ) + + async def get_points( + self, + collection_name: str, + consistency: m.ReadConsistency = None, + timeout: int = None, + point_request: m.PointRequest = None, + ) -> m.InlineResponse20014: + """ + Retrieve multiple points by specified IDs + """ + return await self._build_for_get_points( + collection_name=collection_name, + consistency=consistency, + timeout=timeout, + point_request=point_request, + ) + + async def overwrite_payload( + self, + collection_name: str, + wait: bool = None, + ordering: WriteOrdering = None, + set_payload: m.SetPayload = None, + ) -> m.InlineResponse2006: + """ + Replace full payload of points with new one + """ + return await self._build_for_overwrite_payload( + collection_name=collection_name, + wait=wait, + ordering=ordering, + set_payload=set_payload, + ) + + async def scroll_points( + self, + collection_name: str, + consistency: m.ReadConsistency = None, + timeout: int = None, + scroll_request: m.ScrollRequest = None, + ) -> m.InlineResponse20016: + """ + Scroll request - paginate over all points which matches given filtering condition + """ + return await self._build_for_scroll_points( + collection_name=collection_name, + consistency=consistency, + timeout=timeout, + scroll_request=scroll_request, + ) + + async def set_payload( + self, + collection_name: str, + wait: bool = None, + ordering: WriteOrdering = None, + set_payload: m.SetPayload = None, + ) -> m.InlineResponse2006: + """ + Set payload values for points + """ + return await self._build_for_set_payload( + collection_name=collection_name, + wait=wait, + ordering=ordering, + set_payload=set_payload, + ) + + async def update_vectors( + self, + collection_name: str, + wait: bool = None, + ordering: WriteOrdering = None, + update_vectors: m.UpdateVectors = None, + ) -> m.InlineResponse2006: + """ + Update specified named vectors on points, keep unspecified vectors intact. + """ + return await self._build_for_update_vectors( + collection_name=collection_name, + wait=wait, + ordering=ordering, + update_vectors=update_vectors, + ) + + async def upsert_points( + self, + collection_name: str, + wait: bool = None, + ordering: WriteOrdering = None, + point_insert_operations: m.PointInsertOperations = None, + ) -> m.InlineResponse2006: + """ + Perform insert + updates on points. If point with given ID already exists - it will be overwritten. + """ + return await self._build_for_upsert_points( + collection_name=collection_name, + wait=wait, + ordering=ordering, + point_insert_operations=point_insert_operations, + ) + + +class SyncPointsApi(_PointsApi): + def batch_update( + self, + collection_name: str, + wait: bool = None, + ordering: WriteOrdering = None, + update_operations: m.UpdateOperations = None, + ) -> m.InlineResponse20015: + """ + Apply a series of update operations for points, vectors and payloads + """ + return self._build_for_batch_update( + collection_name=collection_name, + wait=wait, + ordering=ordering, + update_operations=update_operations, + ) + + def clear_payload( + self, + collection_name: str, + wait: bool = None, + ordering: WriteOrdering = None, + points_selector: m.PointsSelector = None, + ) -> m.InlineResponse2006: + """ + Remove all payload for specified points + """ + return self._build_for_clear_payload( + collection_name=collection_name, + wait=wait, + ordering=ordering, + points_selector=points_selector, + ) + + def count_points( + self, + collection_name: str, + timeout: int = None, + count_request: m.CountRequest = None, + ) -> m.InlineResponse20020: + """ + Count points which matches given filtering condition + """ + return self._build_for_count_points( + collection_name=collection_name, + timeout=timeout, + count_request=count_request, + ) + + def delete_payload( + self, + collection_name: str, + wait: bool = None, + ordering: WriteOrdering = None, + delete_payload: m.DeletePayload = None, + ) -> m.InlineResponse2006: + """ + Delete specified key payload for points + """ + return self._build_for_delete_payload( + collection_name=collection_name, + wait=wait, + ordering=ordering, + delete_payload=delete_payload, + ) + + def delete_points( + self, + collection_name: str, + wait: bool = None, + ordering: WriteOrdering = None, + points_selector: m.PointsSelector = None, + ) -> m.InlineResponse2006: + """ + Delete points + """ + return self._build_for_delete_points( + collection_name=collection_name, + wait=wait, + ordering=ordering, + points_selector=points_selector, + ) + + def delete_vectors( + self, + collection_name: str, + wait: bool = None, + ordering: WriteOrdering = None, + delete_vectors: m.DeleteVectors = None, + ) -> m.InlineResponse2006: + """ + Delete named vectors from the given points. + """ + return self._build_for_delete_vectors( + collection_name=collection_name, + wait=wait, + ordering=ordering, + delete_vectors=delete_vectors, + ) + + def facet( + self, + collection_name: str, + timeout: int = None, + consistency: m.ReadConsistency = None, + facet_request: m.FacetRequest = None, + ) -> m.InlineResponse20021: + """ + Count points that satisfy the given filter for each unique value of a payload key. + """ + return self._build_for_facet( + collection_name=collection_name, + timeout=timeout, + consistency=consistency, + facet_request=facet_request, + ) + + def get_point( + self, + collection_name: str, + id: m.ExtendedPointId, + consistency: m.ReadConsistency = None, + ) -> m.InlineResponse20013: + """ + Retrieve full information of single point by id + """ + return self._build_for_get_point( + collection_name=collection_name, + id=id, + consistency=consistency, + ) + + def get_points( + self, + collection_name: str, + consistency: m.ReadConsistency = None, + timeout: int = None, + point_request: m.PointRequest = None, + ) -> m.InlineResponse20014: + """ + Retrieve multiple points by specified IDs + """ + return self._build_for_get_points( + collection_name=collection_name, + consistency=consistency, + timeout=timeout, + point_request=point_request, + ) + + def overwrite_payload( + self, + collection_name: str, + wait: bool = None, + ordering: WriteOrdering = None, + set_payload: m.SetPayload = None, + ) -> m.InlineResponse2006: + """ + Replace full payload of points with new one + """ + return self._build_for_overwrite_payload( + collection_name=collection_name, + wait=wait, + ordering=ordering, + set_payload=set_payload, + ) + + def scroll_points( + self, + collection_name: str, + consistency: m.ReadConsistency = None, + timeout: int = None, + scroll_request: m.ScrollRequest = None, + ) -> m.InlineResponse20016: + """ + Scroll request - paginate over all points which matches given filtering condition + """ + return self._build_for_scroll_points( + collection_name=collection_name, + consistency=consistency, + timeout=timeout, + scroll_request=scroll_request, + ) + + def set_payload( + self, + collection_name: str, + wait: bool = None, + ordering: WriteOrdering = None, + set_payload: m.SetPayload = None, + ) -> m.InlineResponse2006: + """ + Set payload values for points + """ + return self._build_for_set_payload( + collection_name=collection_name, + wait=wait, + ordering=ordering, + set_payload=set_payload, + ) + + def update_vectors( + self, + collection_name: str, + wait: bool = None, + ordering: WriteOrdering = None, + update_vectors: m.UpdateVectors = None, + ) -> m.InlineResponse2006: + """ + Update specified named vectors on points, keep unspecified vectors intact. + """ + return self._build_for_update_vectors( + collection_name=collection_name, + wait=wait, + ordering=ordering, + update_vectors=update_vectors, + ) + + def upsert_points( + self, + collection_name: str, + wait: bool = None, + ordering: WriteOrdering = None, + point_insert_operations: m.PointInsertOperations = None, + ) -> m.InlineResponse2006: + """ + Perform insert + updates on points. If point with given ID already exists - it will be overwritten. + """ + return self._build_for_upsert_points( + collection_name=collection_name, + wait=wait, + ordering=ordering, + point_insert_operations=point_insert_operations, + ) diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/http/api/search_api.py b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/http/api/search_api.py new file mode 100644 index 0000000000000000000000000000000000000000..35e1fb314711b0155f6ae02fee68d6e6e67a4d6a --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/http/api/search_api.py @@ -0,0 +1,941 @@ +# flake8: noqa E501 +from typing import TYPE_CHECKING, Any, Dict, Set, TypeVar, Union + +from pydantic import BaseModel +from pydantic.main import BaseModel +from pydantic.version import VERSION as PYDANTIC_VERSION +from qdrant_client.http.models import * +from qdrant_client.http.models import models as m + +PYDANTIC_V2 = PYDANTIC_VERSION.startswith("2.") +Model = TypeVar("Model", bound="BaseModel") + +SetIntStr = Set[Union[int, str]] +DictIntStrAny = Dict[Union[int, str], Any] +file = None + + +def to_json(model: BaseModel, *args: Any, **kwargs: Any) -> str: + if PYDANTIC_V2: + return model.model_dump_json(*args, **kwargs) + else: + return model.json(*args, **kwargs) + + +def jsonable_encoder( + obj: Any, + include: Union[SetIntStr, DictIntStrAny] = None, + exclude=None, + by_alias: bool = True, + skip_defaults: bool = None, + exclude_unset: bool = True, + exclude_none: bool = True, +): + if hasattr(obj, "json") or hasattr(obj, "model_dump_json"): + return to_json( + obj, + include=include, + exclude=exclude, + by_alias=by_alias, + exclude_unset=bool(exclude_unset or skip_defaults), + exclude_none=exclude_none, + ) + + return obj + + +if TYPE_CHECKING: + from qdrant_client.http.api_client import ApiClient + + +class _SearchApi: + def __init__(self, api_client: "Union[ApiClient, AsyncApiClient]"): + self.api_client = api_client + + def _build_for_discover_batch_points( + self, + collection_name: str, + consistency: m.ReadConsistency = None, + timeout: int = None, + discover_request_batch: m.DiscoverRequestBatch = None, + ): + """ + Look for points based on target and/or positive and negative example pairs, in batch. + """ + path_params = { + "collection_name": str(collection_name), + } + + query_params = {} + if consistency is not None: + query_params["consistency"] = str(consistency) + if timeout is not None: + query_params["timeout"] = str(timeout) + + headers = {} + body = jsonable_encoder(discover_request_batch) + if "Content-Type" not in headers: + headers["Content-Type"] = "application/json" + return self.api_client.request( + type_=m.InlineResponse20018, + method="POST", + url="/collections/{collection_name}/points/discover/batch", + headers=headers if headers else None, + path_params=path_params, + params=query_params, + content=body, + ) + + def _build_for_discover_points( + self, + collection_name: str, + consistency: m.ReadConsistency = None, + timeout: int = None, + discover_request: m.DiscoverRequest = None, + ): + """ + Use context and a target to find the most similar points to the target, constrained by the context. When using only the context (without a target), a special search - called context search - is performed where pairs of points are used to generate a loss that guides the search towards the zone where most positive examples overlap. This means that the score minimizes the scenario of finding a point closer to a negative than to a positive part of a pair. Since the score of a context relates to loss, the maximum score a point can get is 0.0, and it becomes normal that many points can have a score of 0.0. When using target (with or without context), the score behaves a little different: The integer part of the score represents the rank with respect to the context, while the decimal part of the score relates to the distance to the target. The context part of the score for each pair is calculated +1 if the point is closer to a positive than to a negative part of a pair, and -1 otherwise. + """ + path_params = { + "collection_name": str(collection_name), + } + + query_params = {} + if consistency is not None: + query_params["consistency"] = str(consistency) + if timeout is not None: + query_params["timeout"] = str(timeout) + + headers = {} + body = jsonable_encoder(discover_request) + if "Content-Type" not in headers: + headers["Content-Type"] = "application/json" + return self.api_client.request( + type_=m.InlineResponse20017, + method="POST", + url="/collections/{collection_name}/points/discover", + headers=headers if headers else None, + path_params=path_params, + params=query_params, + content=body, + ) + + def _build_for_query_batch_points( + self, + collection_name: str, + consistency: m.ReadConsistency = None, + timeout: int = None, + query_request_batch: m.QueryRequestBatch = None, + ): + """ + Universally query points in batch. This endpoint covers all capabilities of search, recommend, discover, filters. But also enables hybrid and multi-stage queries. + """ + path_params = { + "collection_name": str(collection_name), + } + + query_params = {} + if consistency is not None: + query_params["consistency"] = str(consistency) + if timeout is not None: + query_params["timeout"] = str(timeout) + + headers = {} + body = jsonable_encoder(query_request_batch) + if "Content-Type" not in headers: + headers["Content-Type"] = "application/json" + return self.api_client.request( + type_=m.InlineResponse20023, + method="POST", + url="/collections/{collection_name}/points/query/batch", + headers=headers if headers else None, + path_params=path_params, + params=query_params, + content=body, + ) + + def _build_for_query_points( + self, + collection_name: str, + consistency: m.ReadConsistency = None, + timeout: int = None, + query_request: m.QueryRequest = None, + ): + """ + Universally query points. This endpoint covers all capabilities of search, recommend, discover, filters. But also enables hybrid and multi-stage queries. + """ + path_params = { + "collection_name": str(collection_name), + } + + query_params = {} + if consistency is not None: + query_params["consistency"] = str(consistency) + if timeout is not None: + query_params["timeout"] = str(timeout) + + headers = {} + body = jsonable_encoder(query_request) + if "Content-Type" not in headers: + headers["Content-Type"] = "application/json" + return self.api_client.request( + type_=m.InlineResponse20022, + method="POST", + url="/collections/{collection_name}/points/query", + headers=headers if headers else None, + path_params=path_params, + params=query_params, + content=body, + ) + + def _build_for_query_points_groups( + self, + collection_name: str, + consistency: m.ReadConsistency = None, + timeout: int = None, + query_groups_request: m.QueryGroupsRequest = None, + ): + """ + Universally query points, grouped by a given payload field + """ + path_params = { + "collection_name": str(collection_name), + } + + query_params = {} + if consistency is not None: + query_params["consistency"] = str(consistency) + if timeout is not None: + query_params["timeout"] = str(timeout) + + headers = {} + body = jsonable_encoder(query_groups_request) + if "Content-Type" not in headers: + headers["Content-Type"] = "application/json" + return self.api_client.request( + type_=m.InlineResponse20019, + method="POST", + url="/collections/{collection_name}/points/query/groups", + headers=headers if headers else None, + path_params=path_params, + params=query_params, + content=body, + ) + + def _build_for_recommend_batch_points( + self, + collection_name: str, + consistency: m.ReadConsistency = None, + timeout: int = None, + recommend_request_batch: m.RecommendRequestBatch = None, + ): + """ + Look for the points which are closer to stored positive examples and at the same time further to negative examples. + """ + path_params = { + "collection_name": str(collection_name), + } + + query_params = {} + if consistency is not None: + query_params["consistency"] = str(consistency) + if timeout is not None: + query_params["timeout"] = str(timeout) + + headers = {} + body = jsonable_encoder(recommend_request_batch) + if "Content-Type" not in headers: + headers["Content-Type"] = "application/json" + return self.api_client.request( + type_=m.InlineResponse20018, + method="POST", + url="/collections/{collection_name}/points/recommend/batch", + headers=headers if headers else None, + path_params=path_params, + params=query_params, + content=body, + ) + + def _build_for_recommend_point_groups( + self, + collection_name: str, + consistency: m.ReadConsistency = None, + timeout: int = None, + recommend_groups_request: m.RecommendGroupsRequest = None, + ): + """ + Look for the points which are closer to stored positive examples and at the same time further to negative examples, grouped by a given payload field. + """ + path_params = { + "collection_name": str(collection_name), + } + + query_params = {} + if consistency is not None: + query_params["consistency"] = str(consistency) + if timeout is not None: + query_params["timeout"] = str(timeout) + + headers = {} + body = jsonable_encoder(recommend_groups_request) + if "Content-Type" not in headers: + headers["Content-Type"] = "application/json" + return self.api_client.request( + type_=m.InlineResponse20019, + method="POST", + url="/collections/{collection_name}/points/recommend/groups", + headers=headers if headers else None, + path_params=path_params, + params=query_params, + content=body, + ) + + def _build_for_recommend_points( + self, + collection_name: str, + consistency: m.ReadConsistency = None, + timeout: int = None, + recommend_request: m.RecommendRequest = None, + ): + """ + Look for the points which are closer to stored positive examples and at the same time further to negative examples. + """ + path_params = { + "collection_name": str(collection_name), + } + + query_params = {} + if consistency is not None: + query_params["consistency"] = str(consistency) + if timeout is not None: + query_params["timeout"] = str(timeout) + + headers = {} + body = jsonable_encoder(recommend_request) + if "Content-Type" not in headers: + headers["Content-Type"] = "application/json" + return self.api_client.request( + type_=m.InlineResponse20017, + method="POST", + url="/collections/{collection_name}/points/recommend", + headers=headers if headers else None, + path_params=path_params, + params=query_params, + content=body, + ) + + def _build_for_search_batch_points( + self, + collection_name: str, + consistency: m.ReadConsistency = None, + timeout: int = None, + search_request_batch: m.SearchRequestBatch = None, + ): + """ + Retrieve by batch the closest points based on vector similarity and given filtering conditions + """ + path_params = { + "collection_name": str(collection_name), + } + + query_params = {} + if consistency is not None: + query_params["consistency"] = str(consistency) + if timeout is not None: + query_params["timeout"] = str(timeout) + + headers = {} + body = jsonable_encoder(search_request_batch) + if "Content-Type" not in headers: + headers["Content-Type"] = "application/json" + return self.api_client.request( + type_=m.InlineResponse20018, + method="POST", + url="/collections/{collection_name}/points/search/batch", + headers=headers if headers else None, + path_params=path_params, + params=query_params, + content=body, + ) + + def _build_for_search_matrix_offsets( + self, + collection_name: str, + consistency: m.ReadConsistency = None, + timeout: int = None, + search_matrix_request: m.SearchMatrixRequest = None, + ): + """ + Compute distance matrix for sampled points with an offset based output format + """ + path_params = { + "collection_name": str(collection_name), + } + + query_params = {} + if consistency is not None: + query_params["consistency"] = str(consistency) + if timeout is not None: + query_params["timeout"] = str(timeout) + + headers = {} + body = jsonable_encoder(search_matrix_request) + if "Content-Type" not in headers: + headers["Content-Type"] = "application/json" + return self.api_client.request( + type_=m.InlineResponse20025, + method="POST", + url="/collections/{collection_name}/points/search/matrix/offsets", + headers=headers if headers else None, + path_params=path_params, + params=query_params, + content=body, + ) + + def _build_for_search_matrix_pairs( + self, + collection_name: str, + consistency: m.ReadConsistency = None, + timeout: int = None, + search_matrix_request: m.SearchMatrixRequest = None, + ): + """ + Compute distance matrix for sampled points with a pair based output format + """ + path_params = { + "collection_name": str(collection_name), + } + + query_params = {} + if consistency is not None: + query_params["consistency"] = str(consistency) + if timeout is not None: + query_params["timeout"] = str(timeout) + + headers = {} + body = jsonable_encoder(search_matrix_request) + if "Content-Type" not in headers: + headers["Content-Type"] = "application/json" + return self.api_client.request( + type_=m.InlineResponse20024, + method="POST", + url="/collections/{collection_name}/points/search/matrix/pairs", + headers=headers if headers else None, + path_params=path_params, + params=query_params, + content=body, + ) + + def _build_for_search_point_groups( + self, + collection_name: str, + consistency: m.ReadConsistency = None, + timeout: int = None, + search_groups_request: m.SearchGroupsRequest = None, + ): + """ + Retrieve closest points based on vector similarity and given filtering conditions, grouped by a given payload field + """ + path_params = { + "collection_name": str(collection_name), + } + + query_params = {} + if consistency is not None: + query_params["consistency"] = str(consistency) + if timeout is not None: + query_params["timeout"] = str(timeout) + + headers = {} + body = jsonable_encoder(search_groups_request) + if "Content-Type" not in headers: + headers["Content-Type"] = "application/json" + return self.api_client.request( + type_=m.InlineResponse20019, + method="POST", + url="/collections/{collection_name}/points/search/groups", + headers=headers if headers else None, + path_params=path_params, + params=query_params, + content=body, + ) + + def _build_for_search_points( + self, + collection_name: str, + consistency: m.ReadConsistency = None, + timeout: int = None, + search_request: m.SearchRequest = None, + ): + """ + Retrieve closest points based on vector similarity and given filtering conditions + """ + path_params = { + "collection_name": str(collection_name), + } + + query_params = {} + if consistency is not None: + query_params["consistency"] = str(consistency) + if timeout is not None: + query_params["timeout"] = str(timeout) + + headers = {} + body = jsonable_encoder(search_request) + if "Content-Type" not in headers: + headers["Content-Type"] = "application/json" + return self.api_client.request( + type_=m.InlineResponse20017, + method="POST", + url="/collections/{collection_name}/points/search", + headers=headers if headers else None, + path_params=path_params, + params=query_params, + content=body, + ) + + +class AsyncSearchApi(_SearchApi): + async def discover_batch_points( + self, + collection_name: str, + consistency: m.ReadConsistency = None, + timeout: int = None, + discover_request_batch: m.DiscoverRequestBatch = None, + ) -> m.InlineResponse20018: + """ + Look for points based on target and/or positive and negative example pairs, in batch. + """ + return await self._build_for_discover_batch_points( + collection_name=collection_name, + consistency=consistency, + timeout=timeout, + discover_request_batch=discover_request_batch, + ) + + async def discover_points( + self, + collection_name: str, + consistency: m.ReadConsistency = None, + timeout: int = None, + discover_request: m.DiscoverRequest = None, + ) -> m.InlineResponse20017: + """ + Use context and a target to find the most similar points to the target, constrained by the context. When using only the context (without a target), a special search - called context search - is performed where pairs of points are used to generate a loss that guides the search towards the zone where most positive examples overlap. This means that the score minimizes the scenario of finding a point closer to a negative than to a positive part of a pair. Since the score of a context relates to loss, the maximum score a point can get is 0.0, and it becomes normal that many points can have a score of 0.0. When using target (with or without context), the score behaves a little different: The integer part of the score represents the rank with respect to the context, while the decimal part of the score relates to the distance to the target. The context part of the score for each pair is calculated +1 if the point is closer to a positive than to a negative part of a pair, and -1 otherwise. + """ + return await self._build_for_discover_points( + collection_name=collection_name, + consistency=consistency, + timeout=timeout, + discover_request=discover_request, + ) + + async def query_batch_points( + self, + collection_name: str, + consistency: m.ReadConsistency = None, + timeout: int = None, + query_request_batch: m.QueryRequestBatch = None, + ) -> m.InlineResponse20023: + """ + Universally query points in batch. This endpoint covers all capabilities of search, recommend, discover, filters. But also enables hybrid and multi-stage queries. + """ + return await self._build_for_query_batch_points( + collection_name=collection_name, + consistency=consistency, + timeout=timeout, + query_request_batch=query_request_batch, + ) + + async def query_points( + self, + collection_name: str, + consistency: m.ReadConsistency = None, + timeout: int = None, + query_request: m.QueryRequest = None, + ) -> m.InlineResponse20022: + """ + Universally query points. This endpoint covers all capabilities of search, recommend, discover, filters. But also enables hybrid and multi-stage queries. + """ + return await self._build_for_query_points( + collection_name=collection_name, + consistency=consistency, + timeout=timeout, + query_request=query_request, + ) + + async def query_points_groups( + self, + collection_name: str, + consistency: m.ReadConsistency = None, + timeout: int = None, + query_groups_request: m.QueryGroupsRequest = None, + ) -> m.InlineResponse20019: + """ + Universally query points, grouped by a given payload field + """ + return await self._build_for_query_points_groups( + collection_name=collection_name, + consistency=consistency, + timeout=timeout, + query_groups_request=query_groups_request, + ) + + async def recommend_batch_points( + self, + collection_name: str, + consistency: m.ReadConsistency = None, + timeout: int = None, + recommend_request_batch: m.RecommendRequestBatch = None, + ) -> m.InlineResponse20018: + """ + Look for the points which are closer to stored positive examples and at the same time further to negative examples. + """ + return await self._build_for_recommend_batch_points( + collection_name=collection_name, + consistency=consistency, + timeout=timeout, + recommend_request_batch=recommend_request_batch, + ) + + async def recommend_point_groups( + self, + collection_name: str, + consistency: m.ReadConsistency = None, + timeout: int = None, + recommend_groups_request: m.RecommendGroupsRequest = None, + ) -> m.InlineResponse20019: + """ + Look for the points which are closer to stored positive examples and at the same time further to negative examples, grouped by a given payload field. + """ + return await self._build_for_recommend_point_groups( + collection_name=collection_name, + consistency=consistency, + timeout=timeout, + recommend_groups_request=recommend_groups_request, + ) + + async def recommend_points( + self, + collection_name: str, + consistency: m.ReadConsistency = None, + timeout: int = None, + recommend_request: m.RecommendRequest = None, + ) -> m.InlineResponse20017: + """ + Look for the points which are closer to stored positive examples and at the same time further to negative examples. + """ + return await self._build_for_recommend_points( + collection_name=collection_name, + consistency=consistency, + timeout=timeout, + recommend_request=recommend_request, + ) + + async def search_batch_points( + self, + collection_name: str, + consistency: m.ReadConsistency = None, + timeout: int = None, + search_request_batch: m.SearchRequestBatch = None, + ) -> m.InlineResponse20018: + """ + Retrieve by batch the closest points based on vector similarity and given filtering conditions + """ + return await self._build_for_search_batch_points( + collection_name=collection_name, + consistency=consistency, + timeout=timeout, + search_request_batch=search_request_batch, + ) + + async def search_matrix_offsets( + self, + collection_name: str, + consistency: m.ReadConsistency = None, + timeout: int = None, + search_matrix_request: m.SearchMatrixRequest = None, + ) -> m.InlineResponse20025: + """ + Compute distance matrix for sampled points with an offset based output format + """ + return await self._build_for_search_matrix_offsets( + collection_name=collection_name, + consistency=consistency, + timeout=timeout, + search_matrix_request=search_matrix_request, + ) + + async def search_matrix_pairs( + self, + collection_name: str, + consistency: m.ReadConsistency = None, + timeout: int = None, + search_matrix_request: m.SearchMatrixRequest = None, + ) -> m.InlineResponse20024: + """ + Compute distance matrix for sampled points with a pair based output format + """ + return await self._build_for_search_matrix_pairs( + collection_name=collection_name, + consistency=consistency, + timeout=timeout, + search_matrix_request=search_matrix_request, + ) + + async def search_point_groups( + self, + collection_name: str, + consistency: m.ReadConsistency = None, + timeout: int = None, + search_groups_request: m.SearchGroupsRequest = None, + ) -> m.InlineResponse20019: + """ + Retrieve closest points based on vector similarity and given filtering conditions, grouped by a given payload field + """ + return await self._build_for_search_point_groups( + collection_name=collection_name, + consistency=consistency, + timeout=timeout, + search_groups_request=search_groups_request, + ) + + async def search_points( + self, + collection_name: str, + consistency: m.ReadConsistency = None, + timeout: int = None, + search_request: m.SearchRequest = None, + ) -> m.InlineResponse20017: + """ + Retrieve closest points based on vector similarity and given filtering conditions + """ + return await self._build_for_search_points( + collection_name=collection_name, + consistency=consistency, + timeout=timeout, + search_request=search_request, + ) + + +class SyncSearchApi(_SearchApi): + def discover_batch_points( + self, + collection_name: str, + consistency: m.ReadConsistency = None, + timeout: int = None, + discover_request_batch: m.DiscoverRequestBatch = None, + ) -> m.InlineResponse20018: + """ + Look for points based on target and/or positive and negative example pairs, in batch. + """ + return self._build_for_discover_batch_points( + collection_name=collection_name, + consistency=consistency, + timeout=timeout, + discover_request_batch=discover_request_batch, + ) + + def discover_points( + self, + collection_name: str, + consistency: m.ReadConsistency = None, + timeout: int = None, + discover_request: m.DiscoverRequest = None, + ) -> m.InlineResponse20017: + """ + Use context and a target to find the most similar points to the target, constrained by the context. When using only the context (without a target), a special search - called context search - is performed where pairs of points are used to generate a loss that guides the search towards the zone where most positive examples overlap. This means that the score minimizes the scenario of finding a point closer to a negative than to a positive part of a pair. Since the score of a context relates to loss, the maximum score a point can get is 0.0, and it becomes normal that many points can have a score of 0.0. When using target (with or without context), the score behaves a little different: The integer part of the score represents the rank with respect to the context, while the decimal part of the score relates to the distance to the target. The context part of the score for each pair is calculated +1 if the point is closer to a positive than to a negative part of a pair, and -1 otherwise. + """ + return self._build_for_discover_points( + collection_name=collection_name, + consistency=consistency, + timeout=timeout, + discover_request=discover_request, + ) + + def query_batch_points( + self, + collection_name: str, + consistency: m.ReadConsistency = None, + timeout: int = None, + query_request_batch: m.QueryRequestBatch = None, + ) -> m.InlineResponse20023: + """ + Universally query points in batch. This endpoint covers all capabilities of search, recommend, discover, filters. But also enables hybrid and multi-stage queries. + """ + return self._build_for_query_batch_points( + collection_name=collection_name, + consistency=consistency, + timeout=timeout, + query_request_batch=query_request_batch, + ) + + def query_points( + self, + collection_name: str, + consistency: m.ReadConsistency = None, + timeout: int = None, + query_request: m.QueryRequest = None, + ) -> m.InlineResponse20022: + """ + Universally query points. This endpoint covers all capabilities of search, recommend, discover, filters. But also enables hybrid and multi-stage queries. + """ + return self._build_for_query_points( + collection_name=collection_name, + consistency=consistency, + timeout=timeout, + query_request=query_request, + ) + + def query_points_groups( + self, + collection_name: str, + consistency: m.ReadConsistency = None, + timeout: int = None, + query_groups_request: m.QueryGroupsRequest = None, + ) -> m.InlineResponse20019: + """ + Universally query points, grouped by a given payload field + """ + return self._build_for_query_points_groups( + collection_name=collection_name, + consistency=consistency, + timeout=timeout, + query_groups_request=query_groups_request, + ) + + def recommend_batch_points( + self, + collection_name: str, + consistency: m.ReadConsistency = None, + timeout: int = None, + recommend_request_batch: m.RecommendRequestBatch = None, + ) -> m.InlineResponse20018: + """ + Look for the points which are closer to stored positive examples and at the same time further to negative examples. + """ + return self._build_for_recommend_batch_points( + collection_name=collection_name, + consistency=consistency, + timeout=timeout, + recommend_request_batch=recommend_request_batch, + ) + + def recommend_point_groups( + self, + collection_name: str, + consistency: m.ReadConsistency = None, + timeout: int = None, + recommend_groups_request: m.RecommendGroupsRequest = None, + ) -> m.InlineResponse20019: + """ + Look for the points which are closer to stored positive examples and at the same time further to negative examples, grouped by a given payload field. + """ + return self._build_for_recommend_point_groups( + collection_name=collection_name, + consistency=consistency, + timeout=timeout, + recommend_groups_request=recommend_groups_request, + ) + + def recommend_points( + self, + collection_name: str, + consistency: m.ReadConsistency = None, + timeout: int = None, + recommend_request: m.RecommendRequest = None, + ) -> m.InlineResponse20017: + """ + Look for the points which are closer to stored positive examples and at the same time further to negative examples. + """ + return self._build_for_recommend_points( + collection_name=collection_name, + consistency=consistency, + timeout=timeout, + recommend_request=recommend_request, + ) + + def search_batch_points( + self, + collection_name: str, + consistency: m.ReadConsistency = None, + timeout: int = None, + search_request_batch: m.SearchRequestBatch = None, + ) -> m.InlineResponse20018: + """ + Retrieve by batch the closest points based on vector similarity and given filtering conditions + """ + return self._build_for_search_batch_points( + collection_name=collection_name, + consistency=consistency, + timeout=timeout, + search_request_batch=search_request_batch, + ) + + def search_matrix_offsets( + self, + collection_name: str, + consistency: m.ReadConsistency = None, + timeout: int = None, + search_matrix_request: m.SearchMatrixRequest = None, + ) -> m.InlineResponse20025: + """ + Compute distance matrix for sampled points with an offset based output format + """ + return self._build_for_search_matrix_offsets( + collection_name=collection_name, + consistency=consistency, + timeout=timeout, + search_matrix_request=search_matrix_request, + ) + + def search_matrix_pairs( + self, + collection_name: str, + consistency: m.ReadConsistency = None, + timeout: int = None, + search_matrix_request: m.SearchMatrixRequest = None, + ) -> m.InlineResponse20024: + """ + Compute distance matrix for sampled points with a pair based output format + """ + return self._build_for_search_matrix_pairs( + collection_name=collection_name, + consistency=consistency, + timeout=timeout, + search_matrix_request=search_matrix_request, + ) + + def search_point_groups( + self, + collection_name: str, + consistency: m.ReadConsistency = None, + timeout: int = None, + search_groups_request: m.SearchGroupsRequest = None, + ) -> m.InlineResponse20019: + """ + Retrieve closest points based on vector similarity and given filtering conditions, grouped by a given payload field + """ + return self._build_for_search_point_groups( + collection_name=collection_name, + consistency=consistency, + timeout=timeout, + search_groups_request=search_groups_request, + ) + + def search_points( + self, + collection_name: str, + consistency: m.ReadConsistency = None, + timeout: int = None, + search_request: m.SearchRequest = None, + ) -> m.InlineResponse20017: + """ + Retrieve closest points based on vector similarity and given filtering conditions + """ + return self._build_for_search_points( + collection_name=collection_name, + consistency=consistency, + timeout=timeout, + search_request=search_request, + ) diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/http/api/service_api.py b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/http/api/service_api.py new file mode 100644 index 0000000000000000000000000000000000000000..e6942aa136e4f66156a56b165fc38d252eec31c1 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/http/api/service_api.py @@ -0,0 +1,339 @@ +# flake8: noqa E501 +from typing import TYPE_CHECKING, Any, Dict, Set, TypeVar, Union + +from pydantic import BaseModel +from pydantic.main import BaseModel +from pydantic.version import VERSION as PYDANTIC_VERSION +from qdrant_client.http.models import * +from qdrant_client.http.models import models as m + +PYDANTIC_V2 = PYDANTIC_VERSION.startswith("2.") +Model = TypeVar("Model", bound="BaseModel") + +SetIntStr = Set[Union[int, str]] +DictIntStrAny = Dict[Union[int, str], Any] +file = None + + +def to_json(model: BaseModel, *args: Any, **kwargs: Any) -> str: + if PYDANTIC_V2: + return model.model_dump_json(*args, **kwargs) + else: + return model.json(*args, **kwargs) + + +def jsonable_encoder( + obj: Any, + include: Union[SetIntStr, DictIntStrAny] = None, + exclude=None, + by_alias: bool = True, + skip_defaults: bool = None, + exclude_unset: bool = True, + exclude_none: bool = True, +): + if hasattr(obj, "json") or hasattr(obj, "model_dump_json"): + return to_json( + obj, + include=include, + exclude=exclude, + by_alias=by_alias, + exclude_unset=bool(exclude_unset or skip_defaults), + exclude_none=exclude_none, + ) + + return obj + + +if TYPE_CHECKING: + from qdrant_client.http.api_client import ApiClient + + +class _ServiceApi: + def __init__(self, api_client: "Union[ApiClient, AsyncApiClient]"): + self.api_client = api_client + + def _build_for_get_locks( + self, + ): + """ + Get lock options. If write is locked, all write operations and collection creation are forbidden + """ + headers = {} + return self.api_client.request( + type_=m.InlineResponse2002, + method="GET", + url="/locks", + headers=headers if headers else None, + ) + + def _build_for_healthz( + self, + ): + """ + An endpoint for health checking used in Kubernetes. + """ + headers = {} + return self.api_client.request( + type_=str, + method="GET", + url="/healthz", + headers=headers if headers else None, + ) + + def _build_for_livez( + self, + ): + """ + An endpoint for health checking used in Kubernetes. + """ + headers = {} + return self.api_client.request( + type_=str, + method="GET", + url="/livez", + headers=headers if headers else None, + ) + + def _build_for_metrics( + self, + anonymize: bool = None, + ): + """ + Collect metrics data including app info, collections info, cluster info and statistics + """ + query_params = {} + if anonymize is not None: + query_params["anonymize"] = str(anonymize).lower() + + headers = {} + return self.api_client.request( + type_=str, + method="GET", + url="/metrics", + headers=headers if headers else None, + params=query_params, + ) + + def _build_for_post_locks( + self, + locks_option: m.LocksOption = None, + ): + """ + Set lock options. If write is locked, all write operations and collection creation are forbidden. Returns previous lock options + """ + headers = {} + body = jsonable_encoder(locks_option) + if "Content-Type" not in headers: + headers["Content-Type"] = "application/json" + return self.api_client.request( + type_=m.InlineResponse2002, + method="POST", + url="/locks", + headers=headers if headers else None, + content=body, + ) + + def _build_for_readyz( + self, + ): + """ + An endpoint for health checking used in Kubernetes. + """ + headers = {} + return self.api_client.request( + type_=str, + method="GET", + url="/readyz", + headers=headers if headers else None, + ) + + def _build_for_root( + self, + ): + """ + Returns information about the running Qdrant instance like version and commit id + """ + headers = {} + return self.api_client.request( + type_=m.VersionInfo, + method="GET", + url="/", + headers=headers if headers else None, + ) + + def _build_for_telemetry( + self, + anonymize: bool = None, + details_level: int = None, + ): + """ + Collect telemetry data including app info, system info, collections info, cluster info, configs and statistics + """ + query_params = {} + if anonymize is not None: + query_params["anonymize"] = str(anonymize).lower() + if details_level is not None: + query_params["details_level"] = str(details_level) + + headers = {} + return self.api_client.request( + type_=m.InlineResponse2001, + method="GET", + url="/telemetry", + headers=headers if headers else None, + params=query_params, + ) + + +class AsyncServiceApi(_ServiceApi): + async def get_locks( + self, + ) -> m.InlineResponse2002: + """ + Get lock options. If write is locked, all write operations and collection creation are forbidden + """ + return await self._build_for_get_locks() + + async def healthz( + self, + ) -> str: + """ + An endpoint for health checking used in Kubernetes. + """ + return await self._build_for_healthz() + + async def livez( + self, + ) -> str: + """ + An endpoint for health checking used in Kubernetes. + """ + return await self._build_for_livez() + + async def metrics( + self, + anonymize: bool = None, + ) -> str: + """ + Collect metrics data including app info, collections info, cluster info and statistics + """ + return await self._build_for_metrics( + anonymize=anonymize, + ) + + async def post_locks( + self, + locks_option: m.LocksOption = None, + ) -> m.InlineResponse2002: + """ + Set lock options. If write is locked, all write operations and collection creation are forbidden. Returns previous lock options + """ + return await self._build_for_post_locks( + locks_option=locks_option, + ) + + async def readyz( + self, + ) -> str: + """ + An endpoint for health checking used in Kubernetes. + """ + return await self._build_for_readyz() + + async def root( + self, + ) -> m.VersionInfo: + """ + Returns information about the running Qdrant instance like version and commit id + """ + return await self._build_for_root() + + async def telemetry( + self, + anonymize: bool = None, + details_level: int = None, + ) -> m.InlineResponse2001: + """ + Collect telemetry data including app info, system info, collections info, cluster info, configs and statistics + """ + return await self._build_for_telemetry( + anonymize=anonymize, + details_level=details_level, + ) + + +class SyncServiceApi(_ServiceApi): + def get_locks( + self, + ) -> m.InlineResponse2002: + """ + Get lock options. If write is locked, all write operations and collection creation are forbidden + """ + return self._build_for_get_locks() + + def healthz( + self, + ) -> str: + """ + An endpoint for health checking used in Kubernetes. + """ + return self._build_for_healthz() + + def livez( + self, + ) -> str: + """ + An endpoint for health checking used in Kubernetes. + """ + return self._build_for_livez() + + def metrics( + self, + anonymize: bool = None, + ) -> str: + """ + Collect metrics data including app info, collections info, cluster info and statistics + """ + return self._build_for_metrics( + anonymize=anonymize, + ) + + def post_locks( + self, + locks_option: m.LocksOption = None, + ) -> m.InlineResponse2002: + """ + Set lock options. If write is locked, all write operations and collection creation are forbidden. Returns previous lock options + """ + return self._build_for_post_locks( + locks_option=locks_option, + ) + + def readyz( + self, + ) -> str: + """ + An endpoint for health checking used in Kubernetes. + """ + return self._build_for_readyz() + + def root( + self, + ) -> m.VersionInfo: + """ + Returns information about the running Qdrant instance like version and commit id + """ + return self._build_for_root() + + def telemetry( + self, + anonymize: bool = None, + details_level: int = None, + ) -> m.InlineResponse2001: + """ + Collect telemetry data including app info, system info, collections info, cluster info, configs and statistics + """ + return self._build_for_telemetry( + anonymize=anonymize, + details_level=details_level, + ) diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/http/api/snapshots_api.py b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/http/api/snapshots_api.py new file mode 100644 index 0000000000000000000000000000000000000000..460edbba569ae2888dfaa3b39c3c797364827c1b --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/http/api/snapshots_api.py @@ -0,0 +1,937 @@ +# flake8: noqa E501 +from typing import IO, TYPE_CHECKING, Any, Dict, Set, TypeVar, Union + +from pydantic import BaseModel +from pydantic.main import BaseModel +from pydantic.version import VERSION as PYDANTIC_VERSION +from qdrant_client.http.models import * +from qdrant_client.http.models import models as m + +PYDANTIC_V2 = PYDANTIC_VERSION.startswith("2.") +Model = TypeVar("Model", bound="BaseModel") + +SetIntStr = Set[Union[int, str]] +DictIntStrAny = Dict[Union[int, str], Any] +file = None + + +def to_json(model: BaseModel, *args: Any, **kwargs: Any) -> str: + if PYDANTIC_V2: + return model.model_dump_json(*args, **kwargs) + else: + return model.json(*args, **kwargs) + + +def jsonable_encoder( + obj: Any, + include: Union[SetIntStr, DictIntStrAny] = None, + exclude=None, + by_alias: bool = True, + skip_defaults: bool = None, + exclude_unset: bool = True, + exclude_none: bool = True, +): + if hasattr(obj, "json") or hasattr(obj, "model_dump_json"): + return to_json( + obj, + include=include, + exclude=exclude, + by_alias=by_alias, + exclude_unset=bool(exclude_unset or skip_defaults), + exclude_none=exclude_none, + ) + + return obj + + +if TYPE_CHECKING: + from qdrant_client.http.api_client import ApiClient + + +class _SnapshotsApi: + def __init__(self, api_client: "Union[ApiClient, AsyncApiClient]"): + self.api_client = api_client + + def _build_for_create_full_snapshot( + self, + wait: bool = None, + ): + """ + Create new snapshot of the whole storage + """ + query_params = {} + if wait is not None: + query_params["wait"] = str(wait).lower() + + headers = {} + return self.api_client.request( + type_=m.InlineResponse20012, + method="POST", + url="/snapshots", + headers=headers if headers else None, + params=query_params, + ) + + def _build_for_create_shard_snapshot( + self, + collection_name: str, + shard_id: int, + wait: bool = None, + ): + """ + Create new snapshot of a shard for a collection + """ + path_params = { + "collection_name": str(collection_name), + "shard_id": str(shard_id), + } + + query_params = {} + if wait is not None: + query_params["wait"] = str(wait).lower() + + headers = {} + return self.api_client.request( + type_=m.InlineResponse20012, + method="POST", + url="/collections/{collection_name}/shards/{shard_id}/snapshots", + headers=headers if headers else None, + path_params=path_params, + params=query_params, + ) + + def _build_for_create_snapshot( + self, + collection_name: str, + wait: bool = None, + ): + """ + Create new snapshot for a collection + """ + path_params = { + "collection_name": str(collection_name), + } + + query_params = {} + if wait is not None: + query_params["wait"] = str(wait).lower() + + headers = {} + return self.api_client.request( + type_=m.InlineResponse20012, + method="POST", + url="/collections/{collection_name}/snapshots", + headers=headers if headers else None, + path_params=path_params, + params=query_params, + ) + + def _build_for_delete_full_snapshot( + self, + snapshot_name: str, + wait: bool = None, + ): + """ + Delete snapshot of the whole storage + """ + path_params = { + "snapshot_name": str(snapshot_name), + } + + query_params = {} + if wait is not None: + query_params["wait"] = str(wait).lower() + + headers = {} + return self.api_client.request( + type_=m.InlineResponse20010, + method="DELETE", + url="/snapshots/{snapshot_name}", + headers=headers if headers else None, + path_params=path_params, + params=query_params, + ) + + def _build_for_delete_shard_snapshot( + self, + collection_name: str, + shard_id: int, + snapshot_name: str, + wait: bool = None, + ): + """ + Delete snapshot of a shard for a collection + """ + path_params = { + "collection_name": str(collection_name), + "shard_id": str(shard_id), + "snapshot_name": str(snapshot_name), + } + + query_params = {} + if wait is not None: + query_params["wait"] = str(wait).lower() + + headers = {} + return self.api_client.request( + type_=m.InlineResponse20010, + method="DELETE", + url="/collections/{collection_name}/shards/{shard_id}/snapshots/{snapshot_name}", + headers=headers if headers else None, + path_params=path_params, + params=query_params, + ) + + def _build_for_delete_snapshot( + self, + collection_name: str, + snapshot_name: str, + wait: bool = None, + ): + """ + Delete snapshot for a collection + """ + path_params = { + "collection_name": str(collection_name), + "snapshot_name": str(snapshot_name), + } + + query_params = {} + if wait is not None: + query_params["wait"] = str(wait).lower() + + headers = {} + return self.api_client.request( + type_=m.InlineResponse20010, + method="DELETE", + url="/collections/{collection_name}/snapshots/{snapshot_name}", + headers=headers if headers else None, + path_params=path_params, + params=query_params, + ) + + def _build_for_get_full_snapshot( + self, + snapshot_name: str, + ): + """ + Download specified snapshot of the whole storage as a file + """ + path_params = { + "snapshot_name": str(snapshot_name), + } + + headers = {} + return self.api_client.request( + type_=file, + method="GET", + url="/snapshots/{snapshot_name}", + headers=headers if headers else None, + path_params=path_params, + ) + + def _build_for_get_shard_snapshot( + self, + collection_name: str, + shard_id: int, + snapshot_name: str, + ): + """ + Download specified snapshot of a shard from a collection as a file + """ + path_params = { + "collection_name": str(collection_name), + "shard_id": str(shard_id), + "snapshot_name": str(snapshot_name), + } + + headers = {} + return self.api_client.request( + type_=file, + method="GET", + url="/collections/{collection_name}/shards/{shard_id}/snapshots/{snapshot_name}", + headers=headers if headers else None, + path_params=path_params, + ) + + def _build_for_get_snapshot( + self, + collection_name: str, + snapshot_name: str, + ): + """ + Download specified snapshot from a collection as a file + """ + path_params = { + "collection_name": str(collection_name), + "snapshot_name": str(snapshot_name), + } + + headers = {} + return self.api_client.request( + type_=file, + method="GET", + url="/collections/{collection_name}/snapshots/{snapshot_name}", + headers=headers if headers else None, + path_params=path_params, + ) + + def _build_for_list_full_snapshots( + self, + ): + """ + Get list of snapshots of the whole storage + """ + headers = {} + return self.api_client.request( + type_=m.InlineResponse20011, + method="GET", + url="/snapshots", + headers=headers if headers else None, + ) + + def _build_for_list_shard_snapshots( + self, + collection_name: str, + shard_id: int, + ): + """ + Get list of snapshots for a shard of a collection + """ + path_params = { + "collection_name": str(collection_name), + "shard_id": str(shard_id), + } + + headers = {} + return self.api_client.request( + type_=m.InlineResponse20011, + method="GET", + url="/collections/{collection_name}/shards/{shard_id}/snapshots", + headers=headers if headers else None, + path_params=path_params, + ) + + def _build_for_list_snapshots( + self, + collection_name: str, + ): + """ + Get list of snapshots for a collection + """ + path_params = { + "collection_name": str(collection_name), + } + + headers = {} + return self.api_client.request( + type_=m.InlineResponse20011, + method="GET", + url="/collections/{collection_name}/snapshots", + headers=headers if headers else None, + path_params=path_params, + ) + + def _build_for_recover_from_snapshot( + self, + collection_name: str, + wait: bool = None, + snapshot_recover: m.SnapshotRecover = None, + ): + """ + Recover local collection data from a snapshot. This will overwrite any data, stored on this node, for the collection. If collection does not exist - it will be created. + """ + path_params = { + "collection_name": str(collection_name), + } + + query_params = {} + if wait is not None: + query_params["wait"] = str(wait).lower() + + headers = {} + body = jsonable_encoder(snapshot_recover) + if "Content-Type" not in headers: + headers["Content-Type"] = "application/json" + return self.api_client.request( + type_=m.InlineResponse20010, + method="PUT", + url="/collections/{collection_name}/snapshots/recover", + headers=headers if headers else None, + path_params=path_params, + params=query_params, + content=body, + ) + + def _build_for_recover_from_uploaded_snapshot( + self, + collection_name: str, + wait: bool = None, + priority: SnapshotPriority = None, + checksum: str = None, + snapshot: IO[Any] = None, + ): + """ + Recover local collection data from an uploaded snapshot. This will overwrite any data, stored on this node, for the collection. If collection does not exist - it will be created. + """ + path_params = { + "collection_name": str(collection_name), + } + + query_params = {} + if wait is not None: + query_params["wait"] = str(wait).lower() + if priority is not None: + query_params["priority"] = str(priority) + if checksum is not None: + query_params["checksum"] = str(checksum) + + headers = {} + files: Dict[str, IO[Any]] = {} # noqa F841 + data: Dict[str, Any] = {} # noqa F841 + if snapshot is not None: + files["snapshot"] = snapshot + + return self.api_client.request( + type_=m.InlineResponse20010, + method="POST", + url="/collections/{collection_name}/snapshots/upload", + headers=headers if headers else None, + path_params=path_params, + params=query_params, + data=data, + files=files, + ) + + def _build_for_recover_shard_from_snapshot( + self, + collection_name: str, + shard_id: int, + wait: bool = None, + shard_snapshot_recover: m.ShardSnapshotRecover = None, + ): + """ + Recover shard of a local collection data from a snapshot. This will overwrite any data, stored in this shard, for the collection. + """ + path_params = { + "collection_name": str(collection_name), + "shard_id": str(shard_id), + } + + query_params = {} + if wait is not None: + query_params["wait"] = str(wait).lower() + + headers = {} + body = jsonable_encoder(shard_snapshot_recover) + if "Content-Type" not in headers: + headers["Content-Type"] = "application/json" + return self.api_client.request( + type_=m.InlineResponse20010, + method="PUT", + url="/collections/{collection_name}/shards/{shard_id}/snapshots/recover", + headers=headers if headers else None, + path_params=path_params, + params=query_params, + content=body, + ) + + def _build_for_recover_shard_from_uploaded_snapshot( + self, + collection_name: str, + shard_id: int, + wait: bool = None, + priority: SnapshotPriority = None, + checksum: str = None, + snapshot: IO[Any] = None, + ): + """ + Recover shard of a local collection from an uploaded snapshot. This will overwrite any data, stored on this node, for the collection shard. + """ + path_params = { + "collection_name": str(collection_name), + "shard_id": str(shard_id), + } + + query_params = {} + if wait is not None: + query_params["wait"] = str(wait).lower() + if priority is not None: + query_params["priority"] = str(priority) + if checksum is not None: + query_params["checksum"] = str(checksum) + + headers = {} + files: Dict[str, IO[Any]] = {} # noqa F841 + data: Dict[str, Any] = {} # noqa F841 + if snapshot is not None: + files["snapshot"] = snapshot + + return self.api_client.request( + type_=m.InlineResponse20010, + method="POST", + url="/collections/{collection_name}/shards/{shard_id}/snapshots/upload", + headers=headers if headers else None, + path_params=path_params, + params=query_params, + data=data, + files=files, + ) + + +class AsyncSnapshotsApi(_SnapshotsApi): + async def create_full_snapshot( + self, + wait: bool = None, + ) -> m.InlineResponse20012: + """ + Create new snapshot of the whole storage + """ + return await self._build_for_create_full_snapshot( + wait=wait, + ) + + async def create_shard_snapshot( + self, + collection_name: str, + shard_id: int, + wait: bool = None, + ) -> m.InlineResponse20012: + """ + Create new snapshot of a shard for a collection + """ + return await self._build_for_create_shard_snapshot( + collection_name=collection_name, + shard_id=shard_id, + wait=wait, + ) + + async def create_snapshot( + self, + collection_name: str, + wait: bool = None, + ) -> m.InlineResponse20012: + """ + Create new snapshot for a collection + """ + return await self._build_for_create_snapshot( + collection_name=collection_name, + wait=wait, + ) + + async def delete_full_snapshot( + self, + snapshot_name: str, + wait: bool = None, + ) -> m.InlineResponse20010: + """ + Delete snapshot of the whole storage + """ + return await self._build_for_delete_full_snapshot( + snapshot_name=snapshot_name, + wait=wait, + ) + + async def delete_shard_snapshot( + self, + collection_name: str, + shard_id: int, + snapshot_name: str, + wait: bool = None, + ) -> m.InlineResponse20010: + """ + Delete snapshot of a shard for a collection + """ + return await self._build_for_delete_shard_snapshot( + collection_name=collection_name, + shard_id=shard_id, + snapshot_name=snapshot_name, + wait=wait, + ) + + async def delete_snapshot( + self, + collection_name: str, + snapshot_name: str, + wait: bool = None, + ) -> m.InlineResponse20010: + """ + Delete snapshot for a collection + """ + return await self._build_for_delete_snapshot( + collection_name=collection_name, + snapshot_name=snapshot_name, + wait=wait, + ) + + async def get_full_snapshot( + self, + snapshot_name: str, + ) -> file: + """ + Download specified snapshot of the whole storage as a file + """ + return await self._build_for_get_full_snapshot( + snapshot_name=snapshot_name, + ) + + async def get_shard_snapshot( + self, + collection_name: str, + shard_id: int, + snapshot_name: str, + ) -> file: + """ + Download specified snapshot of a shard from a collection as a file + """ + return await self._build_for_get_shard_snapshot( + collection_name=collection_name, + shard_id=shard_id, + snapshot_name=snapshot_name, + ) + + async def get_snapshot( + self, + collection_name: str, + snapshot_name: str, + ) -> file: + """ + Download specified snapshot from a collection as a file + """ + return await self._build_for_get_snapshot( + collection_name=collection_name, + snapshot_name=snapshot_name, + ) + + async def list_full_snapshots( + self, + ) -> m.InlineResponse20011: + """ + Get list of snapshots of the whole storage + """ + return await self._build_for_list_full_snapshots() + + async def list_shard_snapshots( + self, + collection_name: str, + shard_id: int, + ) -> m.InlineResponse20011: + """ + Get list of snapshots for a shard of a collection + """ + return await self._build_for_list_shard_snapshots( + collection_name=collection_name, + shard_id=shard_id, + ) + + async def list_snapshots( + self, + collection_name: str, + ) -> m.InlineResponse20011: + """ + Get list of snapshots for a collection + """ + return await self._build_for_list_snapshots( + collection_name=collection_name, + ) + + async def recover_from_snapshot( + self, + collection_name: str, + wait: bool = None, + snapshot_recover: m.SnapshotRecover = None, + ) -> m.InlineResponse20010: + """ + Recover local collection data from a snapshot. This will overwrite any data, stored on this node, for the collection. If collection does not exist - it will be created. + """ + return await self._build_for_recover_from_snapshot( + collection_name=collection_name, + wait=wait, + snapshot_recover=snapshot_recover, + ) + + async def recover_from_uploaded_snapshot( + self, + collection_name: str, + wait: bool = None, + priority: SnapshotPriority = None, + checksum: str = None, + snapshot: IO[Any] = None, + ) -> m.InlineResponse20010: + """ + Recover local collection data from an uploaded snapshot. This will overwrite any data, stored on this node, for the collection. If collection does not exist - it will be created. + """ + return await self._build_for_recover_from_uploaded_snapshot( + collection_name=collection_name, + wait=wait, + priority=priority, + checksum=checksum, + snapshot=snapshot, + ) + + async def recover_shard_from_snapshot( + self, + collection_name: str, + shard_id: int, + wait: bool = None, + shard_snapshot_recover: m.ShardSnapshotRecover = None, + ) -> m.InlineResponse20010: + """ + Recover shard of a local collection data from a snapshot. This will overwrite any data, stored in this shard, for the collection. + """ + return await self._build_for_recover_shard_from_snapshot( + collection_name=collection_name, + shard_id=shard_id, + wait=wait, + shard_snapshot_recover=shard_snapshot_recover, + ) + + async def recover_shard_from_uploaded_snapshot( + self, + collection_name: str, + shard_id: int, + wait: bool = None, + priority: SnapshotPriority = None, + checksum: str = None, + snapshot: IO[Any] = None, + ) -> m.InlineResponse20010: + """ + Recover shard of a local collection from an uploaded snapshot. This will overwrite any data, stored on this node, for the collection shard. + """ + return await self._build_for_recover_shard_from_uploaded_snapshot( + collection_name=collection_name, + shard_id=shard_id, + wait=wait, + priority=priority, + checksum=checksum, + snapshot=snapshot, + ) + + +class SyncSnapshotsApi(_SnapshotsApi): + def create_full_snapshot( + self, + wait: bool = None, + ) -> m.InlineResponse20012: + """ + Create new snapshot of the whole storage + """ + return self._build_for_create_full_snapshot( + wait=wait, + ) + + def create_shard_snapshot( + self, + collection_name: str, + shard_id: int, + wait: bool = None, + ) -> m.InlineResponse20012: + """ + Create new snapshot of a shard for a collection + """ + return self._build_for_create_shard_snapshot( + collection_name=collection_name, + shard_id=shard_id, + wait=wait, + ) + + def create_snapshot( + self, + collection_name: str, + wait: bool = None, + ) -> m.InlineResponse20012: + """ + Create new snapshot for a collection + """ + return self._build_for_create_snapshot( + collection_name=collection_name, + wait=wait, + ) + + def delete_full_snapshot( + self, + snapshot_name: str, + wait: bool = None, + ) -> m.InlineResponse20010: + """ + Delete snapshot of the whole storage + """ + return self._build_for_delete_full_snapshot( + snapshot_name=snapshot_name, + wait=wait, + ) + + def delete_shard_snapshot( + self, + collection_name: str, + shard_id: int, + snapshot_name: str, + wait: bool = None, + ) -> m.InlineResponse20010: + """ + Delete snapshot of a shard for a collection + """ + return self._build_for_delete_shard_snapshot( + collection_name=collection_name, + shard_id=shard_id, + snapshot_name=snapshot_name, + wait=wait, + ) + + def delete_snapshot( + self, + collection_name: str, + snapshot_name: str, + wait: bool = None, + ) -> m.InlineResponse20010: + """ + Delete snapshot for a collection + """ + return self._build_for_delete_snapshot( + collection_name=collection_name, + snapshot_name=snapshot_name, + wait=wait, + ) + + def get_full_snapshot( + self, + snapshot_name: str, + ) -> file: + """ + Download specified snapshot of the whole storage as a file + """ + return self._build_for_get_full_snapshot( + snapshot_name=snapshot_name, + ) + + def get_shard_snapshot( + self, + collection_name: str, + shard_id: int, + snapshot_name: str, + ) -> file: + """ + Download specified snapshot of a shard from a collection as a file + """ + return self._build_for_get_shard_snapshot( + collection_name=collection_name, + shard_id=shard_id, + snapshot_name=snapshot_name, + ) + + def get_snapshot( + self, + collection_name: str, + snapshot_name: str, + ) -> file: + """ + Download specified snapshot from a collection as a file + """ + return self._build_for_get_snapshot( + collection_name=collection_name, + snapshot_name=snapshot_name, + ) + + def list_full_snapshots( + self, + ) -> m.InlineResponse20011: + """ + Get list of snapshots of the whole storage + """ + return self._build_for_list_full_snapshots() + + def list_shard_snapshots( + self, + collection_name: str, + shard_id: int, + ) -> m.InlineResponse20011: + """ + Get list of snapshots for a shard of a collection + """ + return self._build_for_list_shard_snapshots( + collection_name=collection_name, + shard_id=shard_id, + ) + + def list_snapshots( + self, + collection_name: str, + ) -> m.InlineResponse20011: + """ + Get list of snapshots for a collection + """ + return self._build_for_list_snapshots( + collection_name=collection_name, + ) + + def recover_from_snapshot( + self, + collection_name: str, + wait: bool = None, + snapshot_recover: m.SnapshotRecover = None, + ) -> m.InlineResponse20010: + """ + Recover local collection data from a snapshot. This will overwrite any data, stored on this node, for the collection. If collection does not exist - it will be created. + """ + return self._build_for_recover_from_snapshot( + collection_name=collection_name, + wait=wait, + snapshot_recover=snapshot_recover, + ) + + def recover_from_uploaded_snapshot( + self, + collection_name: str, + wait: bool = None, + priority: SnapshotPriority = None, + checksum: str = None, + snapshot: IO[Any] = None, + ) -> m.InlineResponse20010: + """ + Recover local collection data from an uploaded snapshot. This will overwrite any data, stored on this node, for the collection. If collection does not exist - it will be created. + """ + return self._build_for_recover_from_uploaded_snapshot( + collection_name=collection_name, + wait=wait, + priority=priority, + checksum=checksum, + snapshot=snapshot, + ) + + def recover_shard_from_snapshot( + self, + collection_name: str, + shard_id: int, + wait: bool = None, + shard_snapshot_recover: m.ShardSnapshotRecover = None, + ) -> m.InlineResponse20010: + """ + Recover shard of a local collection data from a snapshot. This will overwrite any data, stored in this shard, for the collection. + """ + return self._build_for_recover_shard_from_snapshot( + collection_name=collection_name, + shard_id=shard_id, + wait=wait, + shard_snapshot_recover=shard_snapshot_recover, + ) + + def recover_shard_from_uploaded_snapshot( + self, + collection_name: str, + shard_id: int, + wait: bool = None, + priority: SnapshotPriority = None, + checksum: str = None, + snapshot: IO[Any] = None, + ) -> m.InlineResponse20010: + """ + Recover shard of a local collection from an uploaded snapshot. This will overwrite any data, stored on this node, for the collection shard. + """ + return self._build_for_recover_shard_from_uploaded_snapshot( + collection_name=collection_name, + shard_id=shard_id, + wait=wait, + priority=priority, + checksum=checksum, + snapshot=snapshot, + ) diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/http/api_client.py b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/http/api_client.py new file mode 100644 index 0000000000000000000000000000000000000000..0cb622d27dfc324b0d86f45e210645cf11dcae2a --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/http/api_client.py @@ -0,0 +1,263 @@ +from asyncio import get_event_loop +from functools import lru_cache +from typing import Any, Awaitable, Callable, Dict, Generic, Type, TypeVar, overload +from urllib.parse import urljoin + +from httpx import AsyncClient, Client, Request, Response +from pydantic import ValidationError +from qdrant_client.common.client_exceptions import ResourceExhaustedResponse +from qdrant_client.http.api.aliases_api import AsyncAliasesApi, SyncAliasesApi +from qdrant_client.http.api.beta_api import AsyncBetaApi, SyncBetaApi +from qdrant_client.http.api.collections_api import AsyncCollectionsApi, SyncCollectionsApi +from qdrant_client.http.api.distributed_api import AsyncDistributedApi, SyncDistributedApi +from qdrant_client.http.api.indexes_api import AsyncIndexesApi, SyncIndexesApi +from qdrant_client.http.api.points_api import AsyncPointsApi, SyncPointsApi +from qdrant_client.http.api.search_api import AsyncSearchApi, SyncSearchApi +from qdrant_client.http.api.service_api import AsyncServiceApi, SyncServiceApi +from qdrant_client.http.api.snapshots_api import AsyncSnapshotsApi, SyncSnapshotsApi +from qdrant_client.http.exceptions import ResponseHandlingException, UnexpectedResponse + +ClientT = TypeVar("ClientT", bound="ApiClient") +AsyncClientT = TypeVar("AsyncClientT", bound="AsyncApiClient") + + +class AsyncApis(Generic[AsyncClientT]): + def __init__(self, host: str, **kwargs: Any): + self.client = AsyncApiClient(host, **kwargs) + + self.aliases_api = AsyncAliasesApi(self.client) + self.beta_api = AsyncBetaApi(self.client) + self.collections_api = AsyncCollectionsApi(self.client) + self.distributed_api = AsyncDistributedApi(self.client) + self.indexes_api = AsyncIndexesApi(self.client) + self.points_api = AsyncPointsApi(self.client) + self.search_api = AsyncSearchApi(self.client) + self.service_api = AsyncServiceApi(self.client) + self.snapshots_api = AsyncSnapshotsApi(self.client) + + async def aclose(self) -> None: + await self.client.aclose() + + +class SyncApis(Generic[ClientT]): + def __init__(self, host: str, **kwargs: Any): + self.client = ApiClient(host, **kwargs) + + self.aliases_api = SyncAliasesApi(self.client) + self.beta_api = SyncBetaApi(self.client) + self.collections_api = SyncCollectionsApi(self.client) + self.distributed_api = SyncDistributedApi(self.client) + self.indexes_api = SyncIndexesApi(self.client) + self.points_api = SyncPointsApi(self.client) + self.search_api = SyncSearchApi(self.client) + self.service_api = SyncServiceApi(self.client) + self.snapshots_api = SyncSnapshotsApi(self.client) + + def close(self) -> None: + self.client.close() + + +T = TypeVar("T") +Send = Callable[[Request], Response] +SendAsync = Callable[[Request], Awaitable[Response]] +MiddlewareT = Callable[[Request, Send], Response] +AsyncMiddlewareT = Callable[[Request, SendAsync], Awaitable[Response]] + + +class ApiClient: + def __init__(self, host: str, **kwargs: Any) -> None: + self.host = host + self.middleware: MiddlewareT = BaseMiddleware() + self._client = Client(**kwargs) + + @overload + def request(self, *, type_: Type[T], method: str, url: str, path_params: Dict[str, Any] = None, **kwargs: Any) -> T: + ... + + @overload # noqa F811 + def request(self, *, type_: None, method: str, url: str, path_params: Dict[str, Any] = None, **kwargs: Any) -> None: + ... + + def request( # noqa F811 + self, *, type_: Any, method: str, url: str, path_params: Dict[str, Any] = None, **kwargs: Any + ) -> Any: + if path_params is None: + path_params = {} + + host = self.host if self.host.endswith("/") else self.host + "/" + url = url[1:] if url.startswith("/") else url + # in order to do a correct join, url join requires base_url to end with /, and url to not start with /, + # since url is treated as an absolute path and might truncate prefix in base_url + url = urljoin(host, url.format(**path_params)) + if "params" in kwargs and "timeout" in kwargs["params"]: + kwargs["timeout"] = int(kwargs["params"]["timeout"]) + request = self._client.build_request(method, url, **kwargs) + return self.send(request, type_) + + @overload + def request_sync(self, *, type_: Type[T], **kwargs: Any) -> T: + ... + + @overload # noqa F811 + def request_sync(self, *, type_: None, **kwargs: Any) -> None: + ... + + def request_sync(self, *, type_: Any, **kwargs: Any) -> Any: # noqa F811 + """ + This method is not used by the generated apis, but is included for convenience + """ + return get_event_loop().run_until_complete(self.request(type_=type_, **kwargs)) + + def send(self, request: Request, type_: Type[T]) -> T: + response = self.middleware(request, self.send_inner) + + if response.status_code == 429: + retry_after_s = response.headers.get("Retry-After", None) + try: + resp = response.json() + message = resp["status"]["error"] if resp["status"] and resp["status"]["error"] else "" + except Exception: + message = "" + + if retry_after_s: + raise ResourceExhaustedResponse(message, retry_after_s) + + if response.status_code in [200, 201, 202]: + try: + return parse_as_type(response.json(), type_) + except ValidationError as e: + raise ResponseHandlingException(e) + raise UnexpectedResponse.for_response(response) + + def send_inner(self, request: Request) -> Response: + try: + response = self._client.send(request) + except Exception as e: + raise ResponseHandlingException(e) + return response + + def close(self) -> None: + self._client.close() + + def add_middleware(self, middleware: MiddlewareT) -> None: + current_middleware = self.middleware + + def new_middleware(request: Request, call_next: Send) -> Response: + def inner_send(request: Request) -> Response: + return current_middleware(request, call_next) + + return middleware(request, inner_send) + + self.middleware = new_middleware + + +class AsyncApiClient: + def __init__(self, host: str = None, **kwargs: Any) -> None: + self.host = host + self.middleware: AsyncMiddlewareT = BaseAsyncMiddleware() + self._async_client = AsyncClient(**kwargs) + + @overload + async def request( + self, *, type_: Type[T], method: str, url: str, path_params: Dict[str, Any] = None, **kwargs: Any + ) -> T: + ... + + @overload # noqa F811 + async def request( + self, *, type_: None, method: str, url: str, path_params: Dict[str, Any] = None, **kwargs: Any + ) -> None: + ... + + async def request( # noqa F811 + self, *, type_: Any, method: str, url: str, path_params: Dict[str, Any] = None, **kwargs: Any + ) -> Any: + if path_params is None: + path_params = {} + + host = self.host if self.host.endswith("/") else self.host + "/" + url = url[1:] if url.startswith("/") else url + # in order to do a correct join, url join requires base_url to end with /, and url to not start with /, + # since url is treated as an absolute path and might truncate prefix in base_url + url = urljoin(host, url.format(**path_params)) + request = self._async_client.build_request(method, url, **kwargs) + return await self.send(request, type_) + + @overload + def request_sync(self, *, type_: Type[T], **kwargs: Any) -> T: + ... + + @overload # noqa F811 + def request_sync(self, *, type_: None, **kwargs: Any) -> None: + ... + + def request_sync(self, *, type_: Any, **kwargs: Any) -> Any: # noqa F811 + """ + This method is not used by the generated apis, but is included for convenience + """ + return get_event_loop().run_until_complete(self.request(type_=type_, **kwargs)) + + async def send(self, request: Request, type_: Type[T]) -> T: + response = await self.middleware(request, self.send_inner) + + if response.status_code == 429: + retry_after_s = response.headers.get("Retry-After", None) + try: + resp = response.json() + message = resp["status"]["error"] if resp["status"] and resp["status"]["error"] else "" + except Exception: + message = "" + + if retry_after_s: + raise ResourceExhaustedResponse(message, retry_after_s) + + if response.status_code in [200, 201, 202]: + try: + return parse_as_type(response.json(), type_) + except ValidationError as e: + raise ResponseHandlingException(e) + raise UnexpectedResponse.for_response(response) + + async def send_inner(self, request: Request) -> Response: + try: + response = await self._async_client.send(request) + except Exception as e: + raise ResponseHandlingException(e) + return response + + async def aclose(self) -> None: + await self._async_client.aclose() + + def add_middleware(self, middleware: AsyncMiddlewareT) -> None: + current_middleware = self.middleware + + async def new_middleware(request: Request, call_next: SendAsync) -> Response: + async def inner_send(request: Request) -> Response: + return await current_middleware(request, call_next) + + return await middleware(request, inner_send) + + self.middleware = new_middleware + + +class BaseAsyncMiddleware: + async def __call__(self, request: Request, call_next: SendAsync) -> Response: + return await call_next(request) + + +class BaseMiddleware: + def __call__(self, request: Request, call_next: Send) -> Response: + return call_next(request) + + +@lru_cache(maxsize=None) +def _get_parsing_type(type_: Any, source: str) -> Any: + from pydantic.main import create_model + + type_name = getattr(type_, "__name__", str(type_)) + return create_model(f"ParsingModel[{type_name}] (for {source})", obj=(type_, ...)) + + +def parse_as_type(obj: Any, type_: Type[T]) -> T: + model_type = _get_parsing_type(type_, source=parse_as_type.__name__) + return model_type(obj=obj).obj diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/http/configuration.py b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/http/configuration.py new file mode 100644 index 0000000000000000000000000000000000000000..e0760a7f1e7a51e3dba18b7f95b33fef920a03b1 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/http/configuration.py @@ -0,0 +1,5 @@ +from typing import Union + +# This is a dirty hack - proper way it to upgrade OpenAPI generator for at least 5.0 +# But this upgrade will also require updating of all templates. Maybe some other day +AnyOfstringinteger = Union[str, int] diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/http/exceptions.py b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/http/exceptions.py new file mode 100644 index 0000000000000000000000000000000000000000..45437e1c0f7a395c2d80eb713b2c5453b41baac5 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/http/exceptions.py @@ -0,0 +1,46 @@ +import json +from typing import Any, Dict, Optional + +from httpx import Headers, Response + +MAX_CONTENT = 200 + + +class ApiException(Exception): + """Base class""" + + +class UnexpectedResponse(ApiException): + def __init__(self, status_code: Optional[int], reason_phrase: str, content: bytes, headers: Headers) -> None: + self.status_code = status_code + self.reason_phrase = reason_phrase + self.content = content + self.headers = headers + + @staticmethod + def for_response(response: Response) -> "ApiException": + return UnexpectedResponse( + status_code=response.status_code, + reason_phrase=response.reason_phrase, + content=response.content, + headers=response.headers, + ) + + def __str__(self) -> str: + status_code_str = f"{self.status_code}" if self.status_code is not None else "" + if self.reason_phrase == "" and self.status_code is not None: + reason_phrase_str = "(Unrecognized Status Code)" + else: + reason_phrase_str = f"({self.reason_phrase})" + status_str = f"{status_code_str} {reason_phrase_str}".strip() + short_content = self.content if len(self.content) <= MAX_CONTENT else self.content[: MAX_CONTENT - 3] + b" ..." + raw_content_str = f"Raw response content:\n{short_content!r}" + return f"Unexpected Response: {status_str}\n{raw_content_str}" + + def structured(self) -> Dict[str, Any]: + return json.loads(self.content) + + +class ResponseHandlingException(ApiException): + def __init__(self, source: Exception): + self.source = source diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/http/models/__init__.py b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/http/models/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..aed4fa323c2c8001593fdfdcd878a21718800167 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/http/models/__init__.py @@ -0,0 +1 @@ +from .models import * diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/http/models/__pycache__/__init__.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/http/models/__pycache__/__init__.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..84978390707e2032f9380e4d217d497796e8ee41 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/http/models/__pycache__/__init__.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/http/models/__pycache__/models.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/http/models/__pycache__/models.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..0604e14984e792365e2875ffee1ff2af15ab3790 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/http/models/__pycache__/models.cpython-312.pyc @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c9b471f3dbb9d5da12b8d2bfa838c3909b5ef4584176728da16858a063c76b31 +size 193332 diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/http/models/models.py b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/http/models/models.py new file mode 100644 index 0000000000000000000000000000000000000000..e0006bfcd4081d00bf38fae35d8a3140f47fd1a0 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/http/models/models.py @@ -0,0 +1,3744 @@ +from datetime import date, datetime +from enum import Enum +from typing import Any, Dict, List, Literal, Optional, Union +from uuid import UUID + +from pydantic import BaseModel, Field +from pydantic.types import StrictBool, StrictFloat, StrictInt, StrictStr + +Payload = Dict[str, Any] +SparseVectorsConfig = Dict[str, "SparseVectorParams"] +StrictModeMultivectorConfig = Dict[str, "StrictModeMultivector"] +StrictModeMultivectorConfigOutput = Dict[str, "StrictModeMultivectorOutput"] +StrictModeSparseConfig = Dict[str, "StrictModeSparse"] +StrictModeSparseConfigOutput = Dict[str, "StrictModeSparseOutput"] +VectorsConfigDiff = Dict[str, "VectorParamsDiff"] + + +class AbortReshardingOperation(BaseModel, extra="forbid"): + abort_resharding: Any = Field(..., description="") + + +class AbortShardTransfer(BaseModel, extra="forbid"): + shard_id: int = Field(..., description="") + to_peer_id: int = Field(..., description="") + from_peer_id: int = Field(..., description="") + + +class AbortTransferOperation(BaseModel, extra="forbid"): + abort_transfer: "AbortShardTransfer" = Field(..., description="") + + +class AbsExpression(BaseModel, extra="forbid"): + abs: "Expression" = Field(..., description="") + + +class AliasDescription(BaseModel): + alias_name: str = Field(..., description="") + collection_name: str = Field(..., description="") + + +class AppBuildTelemetry(BaseModel): + name: str = Field(..., description="") + version: str = Field(..., description="") + features: Optional["AppFeaturesTelemetry"] = Field(default=None, description="") + runtime_features: Optional["FeatureFlags"] = Field(default=None, description="") + hnsw_global_config: Optional["HnswGlobalConfig"] = Field(default=None, description="") + system: Optional["RunningEnvironmentTelemetry"] = Field(default=None, description="") + jwt_rbac: Optional[bool] = Field(default=None, description="") + hide_jwt_dashboard: Optional[bool] = Field(default=None, description="") + startup: Union[datetime, date] = Field(..., description="") + + +class AppFeaturesTelemetry(BaseModel): + debug: bool = Field(..., description="") + service_debug_feature: bool = Field(..., description="") + recovery_mode: bool = Field(..., description="") + gpu: bool = Field(..., description="") + rocksdb: bool = Field(..., description="") + + +class Batch(BaseModel, extra="forbid"): + ids: List["ExtendedPointId"] = Field(..., description="") + vectors: "BatchVectorStruct" = Field(..., description="") + payloads: Optional[List["Payload"]] = Field(default=None, description="") + + +class BinaryQuantization(BaseModel, extra="forbid"): + binary: "BinaryQuantizationConfig" = Field(..., description="") + + +class BinaryQuantizationConfig(BaseModel, extra="forbid"): + always_ram: Optional[bool] = Field(default=None, description="") + encoding: Optional["BinaryQuantizationEncoding"] = Field(default=None, description="") + query_encoding: Optional["BinaryQuantizationQueryEncoding"] = Field( + default=None, + description="Asymmetric quantization configuration allows a query to have different quantization than stored vectors. It can increase the accuracy of search at the cost of performance.", + ) + + +class BinaryQuantizationEncoding(str, Enum): + ONE_BIT = "one_bit" + TWO_BITS = "two_bits" + ONE_AND_HALF_BITS = "one_and_half_bits" + + +class BinaryQuantizationQueryEncoding(str, Enum): + DEFAULT = "default" + BINARY = "binary" + SCALAR4BITS = "scalar4bits" + SCALAR8BITS = "scalar8bits" + + +class BoolIndexParams(BaseModel, extra="forbid"): + type: "BoolIndexType" = Field(..., description="") + on_disk: Optional[bool] = Field(default=None, description="If true, store the index on disk. Default: false.") + + +class BoolIndexType(str, Enum): + BOOL = "bool" + + +class ChangeAliasesOperation(BaseModel, extra="forbid"): + """ + Operation for performing changes of collection aliases. Alias changes are atomic, meaning that no collection modifications can happen between alias operations. + """ + + actions: List["AliasOperations"] = Field( + ..., + description="Operation for performing changes of collection aliases. Alias changes are atomic, meaning that no collection modifications can happen between alias operations.", + ) + + +class ClearPayloadOperation(BaseModel, extra="forbid"): + clear_payload: "PointsSelector" = Field(..., description="") + + +class ClusterConfigTelemetry(BaseModel): + grpc_timeout_ms: int = Field(..., description="") + p2p: "P2pConfigTelemetry" = Field(..., description="") + consensus: "ConsensusConfigTelemetry" = Field(..., description="") + + +class ClusterStatusOneOf(BaseModel): + status: Literal[ + "disabled", + ] = Field(..., description="") + + +class ClusterStatusOneOf1(BaseModel): + """ + Description of enabled cluster + """ + + status: Literal[ + "enabled", + ] = Field(..., description="Description of enabled cluster") + peer_id: int = Field(..., description="ID of this peer") + peers: Dict[str, "PeerInfo"] = Field(..., description="Peers composition of the cluster with main information") + raft_info: "RaftInfo" = Field(..., description="Description of enabled cluster") + consensus_thread_status: "ConsensusThreadStatus" = Field(..., description="Description of enabled cluster") + message_send_failures: Dict[str, "MessageSendErrors"] = Field( + ..., + description="Consequent failures of message send operations in consensus by peer address. On the first success to send to that peer - entry is removed from this hashmap.", + ) + + +class ClusterStatusTelemetry(BaseModel): + number_of_peers: int = Field(..., description="") + term: int = Field(..., description="") + commit: int = Field(..., description="") + pending_operations: int = Field(..., description="") + role: Optional["StateRole"] = Field(default=None, description="") + is_voter: bool = Field(..., description="") + peer_id: Optional[int] = Field(default=None, description="") + consensus_thread_status: "ConsensusThreadStatus" = Field(..., description="") + + +class ClusterTelemetry(BaseModel): + enabled: bool = Field(..., description="") + status: Optional["ClusterStatusTelemetry"] = Field(default=None, description="") + config: Optional["ClusterConfigTelemetry"] = Field(default=None, description="") + peers: Optional[Dict[str, "PeerInfo"]] = Field(default=None, description="") + metadata: Optional[Dict[str, Any]] = Field(default=None, description="") + + +class CollectionClusterInfo(BaseModel): + """ + Current clustering distribution for the collection + """ + + peer_id: int = Field(..., description="ID of this peer") + shard_count: int = Field(..., description="Total number of shards") + local_shards: List["LocalShardInfo"] = Field(..., description="Local shards") + remote_shards: List["RemoteShardInfo"] = Field(..., description="Remote shards") + shard_transfers: List["ShardTransferInfo"] = Field(..., description="Shard transfers") + resharding_operations: Optional[List["ReshardingInfo"]] = Field(default=None, description="Resharding operations") + + +class CollectionConfig(BaseModel): + """ + Information about the collection configuration + """ + + params: "CollectionParams" = Field(..., description="Information about the collection configuration") + hnsw_config: "HnswConfig" = Field(..., description="Information about the collection configuration") + optimizer_config: "OptimizersConfig" = Field(..., description="Information about the collection configuration") + wal_config: Optional["WalConfig"] = Field( + default=None, description="Information about the collection configuration" + ) + quantization_config: Optional["QuantizationConfig"] = Field( + default=None, description="Information about the collection configuration" + ) + strict_mode_config: Optional["StrictModeConfigOutput"] = Field( + default=None, description="Information about the collection configuration" + ) + + +class CollectionConfigTelemetry(BaseModel): + params: "CollectionParams" = Field(..., description="") + hnsw_config: "HnswConfig" = Field(..., description="") + optimizer_config: "OptimizersConfig" = Field(..., description="") + wal_config: "WalConfig" = Field(..., description="") + quantization_config: Optional["QuantizationConfig"] = Field(default=None, description="") + strict_mode_config: Optional["StrictModeConfigOutput"] = Field(default=None, description="") + uuid: Optional[UUID] = Field(default=None, description="") + + +class CollectionDescription(BaseModel): + name: str = Field(..., description="") + + +class CollectionExistence(BaseModel): + """ + State of existence of a collection, true = exists, false = does not exist + """ + + exists: bool = Field(..., description="State of existence of a collection, true = exists, false = does not exist") + + +class CollectionInfo(BaseModel): + """ + Current statistics and configuration of the collection + """ + + status: "CollectionStatus" = Field(..., description="Current statistics and configuration of the collection") + optimizer_status: "OptimizersStatus" = Field( + ..., description="Current statistics and configuration of the collection" + ) + vectors_count: Optional[int] = Field( + default=None, + description="DEPRECATED: Approximate number of vectors in collection. All vectors in collection are available for querying. Calculated as `points_count x vectors_per_point`. Where `vectors_per_point` is a number of named vectors in schema.", + ) + indexed_vectors_count: Optional[int] = Field( + default=None, + description="Approximate number of indexed vectors in the collection. Indexed vectors in large segments are faster to query, as it is stored in a specialized vector index.", + ) + points_count: Optional[int] = Field( + default=None, + description="Approximate number of points (vectors + payloads) in collection. Each point could be accessed by unique id.", + ) + segments_count: int = Field( + ..., description="Number of segments in collection. Each segment has independent vector as payload indexes" + ) + config: "CollectionConfig" = Field(..., description="Current statistics and configuration of the collection") + payload_schema: Dict[str, "PayloadIndexInfo"] = Field(..., description="Types of stored payload") + + +class CollectionParams(BaseModel): + vectors: Optional["VectorsConfig"] = Field(default=None, description="") + shard_number: Optional[int] = Field(default=1, description="Number of shards the collection has") + sharding_method: Optional["ShardingMethod"] = Field( + default=None, + description="Sharding method Default is Auto - points are distributed across all available shards Custom - points are distributed across shards according to shard key", + ) + replication_factor: Optional[int] = Field(default=1, description="Number of replicas for each shard") + write_consistency_factor: Optional[int] = Field( + default=1, + description="Defines how many replicas should apply the operation for us to consider it successful. Increasing this number will make the collection more resilient to inconsistencies, but will also make it fail if not enough replicas are available. Does not have any performance impact.", + ) + read_fan_out_factor: Optional[int] = Field( + default=None, + description="Defines how many additional replicas should be processing read request at the same time. Default value is Auto, which means that fan-out will be determined automatically based on the busyness of the local replica. Having more than 0 might be useful to smooth latency spikes of individual nodes.", + ) + on_disk_payload: Optional[bool] = Field( + default=True, + description="If true - point's payload will not be stored in memory. It will be read from the disk every time it is requested. This setting saves RAM by (slightly) increasing the response time. Note: those payload values that are involved in filtering and are indexed - remain in RAM. Default: true", + ) + sparse_vectors: Optional[Dict[str, "SparseVectorParams"]] = Field( + default=None, description="Configuration of the sparse vector storage" + ) + + +class CollectionParamsDiff(BaseModel, extra="forbid"): + replication_factor: Optional[int] = Field(default=None, description="Number of replicas for each shard") + write_consistency_factor: Optional[int] = Field( + default=None, description="Minimal number successful responses from replicas to consider operation successful" + ) + read_fan_out_factor: Optional[int] = Field( + default=None, + description="Fan-out every read request to these many additional remote nodes (and return first available response)", + ) + on_disk_payload: Optional[bool] = Field( + default=None, + description="If true - point's payload will not be stored in memory. It will be read from the disk every time it is requested. This setting saves RAM by (slightly) increasing the response time. Note: those payload values that are involved in filtering and are indexed - remain in RAM.", + ) + + +class CollectionStatus(str, Enum): + """ + Current state of the collection. `Green` - all good. `Yellow` - optimization is running, 'Grey' - optimizations are possible but not triggered, `Red` - some operations failed and was not recovered + """ + + def __str__(self) -> str: + return str(self.value) + + GREEN = "green" + YELLOW = "yellow" + GREY = "grey" + RED = "red" + + +class CollectionTelemetry(BaseModel): + id: str = Field(..., description="") + init_time_ms: int = Field(..., description="") + config: "CollectionConfigTelemetry" = Field(..., description="") + shards: Optional[List["ReplicaSetTelemetry"]] = Field(default=None, description="") + transfers: Optional[List["ShardTransferInfo"]] = Field(default=None, description="") + resharding: Optional[List["ReshardingInfo"]] = Field(default=None, description="") + shard_clean_tasks: Optional[Dict[str, "ShardCleanStatusTelemetry"]] = Field(default=None, description="") + + +class CollectionsAggregatedTelemetry(BaseModel): + vectors: int = Field(..., description="") + optimizers_status: "OptimizersStatus" = Field(..., description="") + params: "CollectionParams" = Field(..., description="") + + +class CollectionsAliasesResponse(BaseModel): + aliases: List["AliasDescription"] = Field(..., description="") + + +class CollectionsResponse(BaseModel): + collections: List["CollectionDescription"] = Field(..., description="") + + +class CollectionsTelemetry(BaseModel): + number_of_collections: int = Field(..., description="") + max_collections: Optional[int] = Field(default=None, description="") + collections: Optional[List["CollectionTelemetryEnum"]] = Field(default=None, description="") + + +class CompressionRatio(str, Enum): + X4 = "x4" + X8 = "x8" + X16 = "x16" + X32 = "x32" + X64 = "x64" + + +class ConsensusConfigTelemetry(BaseModel): + max_message_queue_size: int = Field(..., description="") + tick_period_ms: int = Field(..., description="") + bootstrap_timeout_sec: int = Field(..., description="") + + +class ConsensusThreadStatusOneOf(BaseModel): + consensus_thread_status: Literal[ + "working", + ] = Field(..., description="") + last_update: Union[datetime, date] = Field(..., description="") + + +class ConsensusThreadStatusOneOf1(BaseModel): + consensus_thread_status: Literal[ + "stopped", + ] = Field(..., description="") + + +class ConsensusThreadStatusOneOf2(BaseModel): + consensus_thread_status: Literal[ + "stopped_with_err", + ] = Field(..., description="") + err: str = Field(..., description="") + + +class ContextExamplePair(BaseModel, extra="forbid"): + positive: "RecommendExample" = Field(..., description="") + negative: "RecommendExample" = Field(..., description="") + + +class ContextPair(BaseModel, extra="forbid"): + positive: "VectorInput" = Field(..., description="") + negative: "VectorInput" = Field(..., description="") + + +class ContextQuery(BaseModel, extra="forbid"): + context: "ContextInput" = Field(..., description="") + + +class CountRequest(BaseModel, extra="forbid"): + """ + Count Request Counts the number of points which satisfy the given filter. If filter is not provided, the count of all points in the collection will be returned. + """ + + shard_key: Optional["ShardKeySelector"] = Field( + default=None, + description="Specify in which shards to look for the points, if not specified - look in all shards", + ) + filter: Optional["Filter"] = Field(default=None, description="Look only for points which satisfies this conditions") + exact: Optional[bool] = Field( + default=True, + description="If true, count exact number of points. If false, count approximate number of points faster. Approximate count might be unreliable during the indexing process. Default: true", + ) + + +class CountResult(BaseModel): + count: int = Field(..., description="Number of points which satisfy the conditions") + + +class CpuEndian(str, Enum): + LITTLE = "little" + BIG = "big" + OTHER = "other" + + +class CreateAlias(BaseModel, extra="forbid"): + """ + Create alternative name for a collection. Collection will be available under both names for search, retrieve, + """ + + collection_name: str = Field( + ..., + description="Create alternative name for a collection. Collection will be available under both names for search, retrieve,", + ) + alias_name: str = Field( + ..., + description="Create alternative name for a collection. Collection will be available under both names for search, retrieve,", + ) + + +class CreateAliasOperation(BaseModel, extra="forbid"): + create_alias: "CreateAlias" = Field(..., description="") + + +class CreateCollection(BaseModel, extra="forbid"): + """ + Operation for creating new collection and (optionally) specify index params + """ + + vectors: Optional["VectorsConfig"] = Field( + default=None, description="Operation for creating new collection and (optionally) specify index params" + ) + shard_number: Optional[int] = Field( + default=None, + description="For auto sharding: Number of shards in collection. - Default is 1 for standalone, otherwise equal to the number of nodes - Minimum is 1 For custom sharding: Number of shards in collection per shard group. - Default is 1, meaning that each shard key will be mapped to a single shard - Minimum is 1", + ) + sharding_method: Optional["ShardingMethod"] = Field( + default=None, + description="Sharding method Default is Auto - points are distributed across all available shards Custom - points are distributed across shards according to shard key", + ) + replication_factor: Optional[int] = Field( + default=None, description="Number of shards replicas. Default is 1 Minimum is 1" + ) + write_consistency_factor: Optional[int] = Field( + default=None, + description="Defines how many replicas should apply the operation for us to consider it successful. Increasing this number will make the collection more resilient to inconsistencies, but will also make it fail if not enough replicas are available. Does not have any performance impact.", + ) + on_disk_payload: Optional[bool] = Field( + default=None, + description="If true - point's payload will not be stored in memory. It will be read from the disk every time it is requested. This setting saves RAM by (slightly) increasing the response time. Note: those payload values that are involved in filtering and are indexed - remain in RAM. Default: true", + ) + hnsw_config: Optional["HnswConfigDiff"] = Field( + default=None, + description="Custom params for HNSW index. If none - values from service configuration file are used.", + ) + wal_config: Optional["WalConfigDiff"] = Field( + default=None, description="Custom params for WAL. If none - values from service configuration file are used." + ) + optimizers_config: Optional["OptimizersConfigDiff"] = Field( + default=None, + description="Custom params for Optimizers. If none - values from service configuration file are used.", + ) + init_from: Optional["InitFrom"] = Field( + default=None, description="Specify other collection to copy data from. Deprecated since Qdrant 1.15.0." + ) + quantization_config: Optional["QuantizationConfig"] = Field( + default=None, description="Quantization parameters. If none - quantization is disabled." + ) + sparse_vectors: Optional[Dict[str, "SparseVectorParams"]] = Field( + default=None, description="Sparse vector data config." + ) + strict_mode_config: Optional["StrictModeConfig"] = Field(default=None, description="Strict-mode config.") + + +class CreateFieldIndex(BaseModel, extra="forbid"): + field_name: str = Field(..., description="") + field_schema: Optional["PayloadFieldSchema"] = Field(default=None, description="") + + +class CreateShardingKey(BaseModel, extra="forbid"): + shard_key: "ShardKey" = Field(..., description="") + shards_number: Optional[int] = Field( + default=None, + description="How many shards to create for this key If not specified, will use the default value from config", + ) + replication_factor: Optional[int] = Field( + default=None, + description="How many replicas to create for each shard If not specified, will use the default value from config", + ) + placement: Optional[List[int]] = Field( + default=None, + description="Placement of shards for this key List of peer ids, that can be used to place shards for this key If not specified, will be randomly placed among all peers", + ) + + +class CreateShardingKeyOperation(BaseModel, extra="forbid"): + create_sharding_key: "CreateShardingKey" = Field(..., description="") + + +class Datatype(str, Enum): + FLOAT32 = "float32" + UINT8 = "uint8" + FLOAT16 = "float16" + + +class DatetimeExpression(BaseModel, extra="forbid"): + datetime: str = Field(..., description="") + + +class DatetimeIndexParams(BaseModel, extra="forbid"): + type: "DatetimeIndexType" = Field(..., description="") + is_principal: Optional[bool] = Field( + default=None, + description="If true - use this key to organize storage of the collection data. This option assumes that this key will be used in majority of filtered requests.", + ) + on_disk: Optional[bool] = Field(default=None, description="If true, store the index on disk. Default: false.") + + +class DatetimeIndexType(str, Enum): + DATETIME = "datetime" + + +class DatetimeKeyExpression(BaseModel, extra="forbid"): + datetime_key: str = Field(..., description="") + + +class DatetimeRange(BaseModel, extra="forbid"): + """ + Range filter request + """ + + lt: Optional[Union[datetime, date]] = Field(default=None, description="point.key < range.lt") + gt: Optional[Union[datetime, date]] = Field(default=None, description="point.key > range.gt") + gte: Optional[Union[datetime, date]] = Field(default=None, description="point.key >= range.gte") + lte: Optional[Union[datetime, date]] = Field(default=None, description="point.key <= range.lte") + + +class DecayParamsExpression(BaseModel, extra="forbid"): + x: "Expression" = Field(..., description="") + target: Optional["Expression"] = Field( + default=None, description="The target value to start decaying from. Defaults to 0." + ) + scale: Optional[float] = Field( + default=None, + description="The scale factor of the decay, in terms of `x`. Defaults to 1.0. Must be a non-zero positive number.", + ) + midpoint: Optional[float] = Field( + default=None, + description="The midpoint of the decay. Defaults to 0.5. Output will be this value when `|x - target| == scale`.", + ) + + +class DeleteAlias(BaseModel, extra="forbid"): + """ + Delete alias if exists + """ + + alias_name: str = Field(..., description="Delete alias if exists") + + +class DeleteAliasOperation(BaseModel, extra="forbid"): + """ + Delete alias if exists + """ + + delete_alias: "DeleteAlias" = Field(..., description="Delete alias if exists") + + +class DeleteOperation(BaseModel, extra="forbid"): + delete: "PointsSelector" = Field(..., description="") + + +class DeletePayload(BaseModel, extra="forbid"): + """ + This data structure is used in API interface and applied across multiple shards + """ + + keys: List[str] = Field(..., description="List of payload keys to remove from payload") + points: Optional[List["ExtendedPointId"]] = Field( + default=None, description="Deletes values from each point in this list" + ) + filter: Optional["Filter"] = Field( + default=None, description="Deletes values from points that satisfy this filter condition" + ) + shard_key: Optional["ShardKeySelector"] = Field( + default=None, description="This data structure is used in API interface and applied across multiple shards" + ) + + +class DeletePayloadOperation(BaseModel, extra="forbid"): + delete_payload: "DeletePayload" = Field(..., description="") + + +class DeleteVectors(BaseModel, extra="forbid"): + points: Optional[List["ExtendedPointId"]] = Field( + default=None, description="Deletes values from each point in this list" + ) + filter: Optional["Filter"] = Field( + default=None, description="Deletes values from points that satisfy this filter condition" + ) + vector: List[str] = Field(..., description="Vector names") + shard_key: Optional["ShardKeySelector"] = Field(default=None, description="") + + +class DeleteVectorsOperation(BaseModel, extra="forbid"): + delete_vectors: "DeleteVectors" = Field(..., description="") + + +class Direction(str, Enum): + ASC = "asc" + DESC = "desc" + + +class Disabled(str, Enum): + DISABLED = "Disabled" + + +class DiscoverInput(BaseModel, extra="forbid"): + target: "VectorInput" = Field(..., description="") + context: Union[List["ContextPair"], "ContextPair"] = Field( + ..., description="Search space will be constrained by these pairs of vectors" + ) + + +class DiscoverQuery(BaseModel, extra="forbid"): + discover: "DiscoverInput" = Field(..., description="") + + +class DiscoverRequest(BaseModel, extra="forbid"): + """ + Use context and a target to find the most similar points, constrained by the context. + """ + + shard_key: Optional["ShardKeySelector"] = Field( + default=None, + description="Specify in which shards to look for the points, if not specified - look in all shards", + ) + target: Optional["RecommendExample"] = Field( + default=None, + description="Look for vectors closest to this. When using the target (with or without context), the integer part of the score represents the rank with respect to the context, while the decimal part of the score relates to the distance to the target.", + ) + context: Optional[List["ContextExamplePair"]] = Field( + default=None, + description="Pairs of { positive, negative } examples to constrain the search. When using only the context (without a target), a special search - called context search - is performed where pairs of points are used to generate a loss that guides the search towards the zone where most positive examples overlap. This means that the score minimizes the scenario of finding a point closer to a negative than to a positive part of a pair. Since the score of a context relates to loss, the maximum score a point can get is 0.0, and it becomes normal that many points can have a score of 0.0. For discovery search (when including a target), the context part of the score for each pair is calculated +1 if the point is closer to a positive than to a negative part of a pair, and -1 otherwise.", + ) + filter: Optional["Filter"] = Field(default=None, description="Look only for points which satisfies this conditions") + params: Optional["SearchParams"] = Field(default=None, description="Additional search params") + limit: int = Field(..., description="Max number of result to return") + offset: Optional[int] = Field( + default=None, + description="Offset of the first result to return. May be used to paginate results. Note: large offset values may cause performance issues.", + ) + with_payload: Optional["WithPayloadInterface"] = Field( + default=None, description="Select which payload to return with the response. Default is false." + ) + with_vector: Optional["WithVector"] = Field( + default=None, description="Options for specifying which vectors to include into response. Default is false." + ) + using: Optional["UsingVector"] = Field( + default=None, + description="Define which vector to use for recommendation, if not specified - try to use default vector", + ) + lookup_from: Optional["LookupLocation"] = Field( + default=None, + description="The location used to lookup vectors. If not specified - use current collection. Note: the other collection should have the same vector size as the current collection", + ) + + +class DiscoverRequestBatch(BaseModel, extra="forbid"): + searches: List["DiscoverRequest"] = Field(..., description="") + + +class Distance(str, Enum): + """ + Type of internal tags, build from payload Distance function types used to compare vectors + """ + + def __str__(self) -> str: + return str(self.value) + + COSINE = "Cosine" + EUCLID = "Euclid" + DOT = "Dot" + MANHATTAN = "Manhattan" + + +class DivExpression(BaseModel, extra="forbid"): + div: "DivParams" = Field(..., description="") + + +class DivParams(BaseModel, extra="forbid"): + left: "Expression" = Field(..., description="") + right: "Expression" = Field(..., description="") + by_zero_default: Optional[float] = Field(default=None, description="") + + +class Document(BaseModel, extra="forbid"): + """ + WARN: Work-in-progress, unimplemented Text document for embedding. Requires inference infrastructure, unimplemented. + """ + + text: str = Field(..., description="Text of the document This field will be used as input for the embedding model") + model: str = Field( + ..., description="Name of the model used to generate the vector List of available models depends on a provider" + ) + options: Optional[Dict[str, Any]] = Field( + default=None, description="Parameters for the model Values of the parameters are model-specific" + ) + + +class DropReplicaOperation(BaseModel, extra="forbid"): + drop_replica: "Replica" = Field(..., description="") + + +class DropShardingKey(BaseModel, extra="forbid"): + shard_key: "ShardKey" = Field(..., description="") + + +class DropShardingKeyOperation(BaseModel, extra="forbid"): + drop_sharding_key: "DropShardingKey" = Field(..., description="") + + +class ErrorResponse(BaseModel): + time: Optional[float] = Field(default=None, description="Time spent to process this request") + status: Optional["ErrorResponseStatus"] = Field(default=None, description="") + result: Optional[Any] = Field(default=None, description="") + + +class ErrorResponseStatus(BaseModel): + error: Optional[str] = Field(default=None, description="Description of the occurred error.") + + +class ExpDecayExpression(BaseModel, extra="forbid"): + exp_decay: "DecayParamsExpression" = Field(..., description="") + + +class ExpExpression(BaseModel, extra="forbid"): + exp: "Expression" = Field(..., description="") + + +class FacetRequest(BaseModel, extra="forbid"): + shard_key: Optional["ShardKeySelector"] = Field(default=None, description="") + key: str = Field(..., description="Payload key to use for faceting.") + limit: Optional[int] = Field(default=None, description="Max number of hits to return. Default is 10.") + filter: Optional["Filter"] = Field( + default=None, description="Filter conditions - only consider points that satisfy these conditions." + ) + exact: Optional[bool] = Field( + default=None, + description="Whether to do a more expensive exact count for each of the values in the facet. Default is false.", + ) + + +class FacetResponse(BaseModel): + hits: List["FacetValueHit"] = Field(..., description="") + + +class FacetValueHit(BaseModel): + value: "FacetValue" = Field(..., description="") + count: int = Field(..., description="") + + +class FeatureFlags(BaseModel): + all: Optional[bool] = Field( + default=False, + description="Magic feature flag that enables all features. Note that this will only be applied to all flags when passed into [`init_feature_flags`].", + ) + payload_index_skip_rocksdb: Optional[bool] = Field( + default=True, + description="Skip usage of RocksDB in new immutable payload indices. First implemented in Qdrant 1.13.5. Enabled by default in Qdrant 1.14.1", + ) + payload_index_skip_mutable_rocksdb: Optional[bool] = Field( + default=False, description="Skip usage of RocksDB in new mutable payload indices." + ) + payload_storage_skip_rocksdb: Optional[bool] = Field( + default=False, + description="Skip usage of RocksDB in new payload storages. On-disk payload storages never use Gridstore. First implemented in Qdrant 1.15.0.", + ) + incremental_hnsw_building: Optional[bool] = Field( + default=True, description="Use incremental HNSW building. Enabled by default in Qdrant 1.14.1." + ) + migrate_rocksdb_id_tracker: Optional[bool] = Field( + default=True, + description="Migrate RocksDB based ID trackers into file based ID tracker on start. Enabled by default in Qdrant 1.15.0.", + ) + migrate_rocksdb_vector_storage: Optional[bool] = Field( + default=False, description="Migrate RocksDB based vector storages into new format on start." + ) + migrate_rocksdb_payload_storage: Optional[bool] = Field( + default=False, description="Migrate RocksDB based payload storages into new format on start." + ) + migrate_rocksdb_payload_indices: Optional[bool] = Field( + default=False, + description="Migrate RocksDB based payload indices into new format on start. Rebuilds a new payload index from scratch.", + ) + + +class FieldCondition(BaseModel, extra="forbid"): + """ + All possible payload filtering conditions + """ + + key: str = Field(..., description="Payload key") + match: Optional["Match"] = Field(default=None, description="Check if point has field with a given value") + range: Optional["RangeInterface"] = Field(default=None, description="Check if points value lies in a given range") + geo_bounding_box: Optional["GeoBoundingBox"] = Field( + default=None, description="Check if points geolocation lies in a given area" + ) + geo_radius: Optional["GeoRadius"] = Field(default=None, description="Check if geo point is within a given radius") + geo_polygon: Optional["GeoPolygon"] = Field( + default=None, description="Check if geo point is within a given polygon" + ) + values_count: Optional["ValuesCount"] = Field(default=None, description="Check number of values of the field") + is_empty: Optional[bool] = Field( + default=None, description="Check that the field is empty, alternative syntax for `is_empty: 'field_name'`" + ) + is_null: Optional[bool] = Field( + default=None, description="Check that the field is null, alternative syntax for `is_null: 'field_name'`" + ) + + +class Filter(BaseModel, extra="forbid"): + should: Optional[Union[List["Condition"], "Condition"]] = Field( + default=None, description="At least one of those conditions should match" + ) + min_should: Optional["MinShould"] = Field( + default=None, description="At least minimum amount of given conditions should match" + ) + must: Optional[Union[List["Condition"], "Condition"]] = Field(default=None, description="All conditions must match") + must_not: Optional[Union[List["Condition"], "Condition"]] = Field( + default=None, description="All conditions must NOT match" + ) + + +class FilterSelector(BaseModel, extra="forbid"): + filter: "Filter" = Field(..., description="") + shard_key: Optional["ShardKeySelector"] = Field(default=None, description="") + + +class FloatIndexParams(BaseModel, extra="forbid"): + type: "FloatIndexType" = Field(..., description="") + is_principal: Optional[bool] = Field( + default=None, + description="If true - use this key to organize storage of the collection data. This option assumes that this key will be used in majority of filtered requests.", + ) + on_disk: Optional[bool] = Field(default=None, description="If true, store the index on disk. Default: false.") + + +class FloatIndexType(str, Enum): + FLOAT = "float" + + +class FormulaQuery(BaseModel, extra="forbid"): + formula: "Expression" = Field(..., description="") + defaults: Optional[Dict[str, Any]] = Field(default={}, description="") + + +class Fusion(str, Enum): + """ + Fusion algorithm allows to combine results of multiple prefetches. Available fusion algorithms: * `rrf` - Reciprocal Rank Fusion * `dbsf` - Distribution-Based Score Fusion + """ + + def __str__(self) -> str: + return str(self.value) + + RRF = "rrf" + DBSF = "dbsf" + + +class FusionQuery(BaseModel, extra="forbid"): + fusion: "Fusion" = Field(..., description="") + + +class GaussDecayExpression(BaseModel, extra="forbid"): + gauss_decay: "DecayParamsExpression" = Field(..., description="") + + +class GeoBoundingBox(BaseModel, extra="forbid"): + """ + Geo filter request Matches coordinates inside the rectangle, described by coordinates of lop-left and bottom-right edges + """ + + top_left: "GeoPoint" = Field( + ..., + description="Geo filter request Matches coordinates inside the rectangle, described by coordinates of lop-left and bottom-right edges", + ) + bottom_right: "GeoPoint" = Field( + ..., + description="Geo filter request Matches coordinates inside the rectangle, described by coordinates of lop-left and bottom-right edges", + ) + + +class GeoDistance(BaseModel, extra="forbid"): + geo_distance: "GeoDistanceParams" = Field(..., description="") + + +class GeoDistanceParams(BaseModel, extra="forbid"): + origin: "GeoPoint" = Field(..., description="") + to: str = Field(..., description="Payload field with the destination geo point") + + +class GeoIndexParams(BaseModel, extra="forbid"): + type: "GeoIndexType" = Field(..., description="") + on_disk: Optional[bool] = Field(default=None, description="If true, store the index on disk. Default: false.") + + +class GeoIndexType(str, Enum): + GEO = "geo" + + +class GeoLineString(BaseModel, extra="forbid"): + """ + Ordered sequence of GeoPoints representing the line + """ + + points: List["GeoPoint"] = Field(..., description="Ordered sequence of GeoPoints representing the line") + + +class GeoPoint(BaseModel, extra="forbid"): + """ + Geo point payload schema + """ + + lon: float = Field(..., description="Geo point payload schema") + lat: float = Field(..., description="Geo point payload schema") + + +class GeoPolygon(BaseModel, extra="forbid"): + """ + Geo filter request Matches coordinates inside the polygon, defined by `exterior` and `interiors` + """ + + exterior: "GeoLineString" = Field( + ..., + description="Geo filter request Matches coordinates inside the polygon, defined by `exterior` and `interiors`", + ) + interiors: Optional[List["GeoLineString"]] = Field( + default=None, + description="Interior lines (if present) bound holes within the surface each GeoLineString must consist of a minimum of 4 points, and the first and last points must be the same.", + ) + + +class GeoRadius(BaseModel, extra="forbid"): + """ + Geo filter request Matches coordinates inside the circle of `radius` and center with coordinates `center` + """ + + center: "GeoPoint" = Field( + ..., + description="Geo filter request Matches coordinates inside the circle of `radius` and center with coordinates `center`", + ) + radius: float = Field(..., description="Radius of the area in meters") + + +class GpuDeviceTelemetry(BaseModel): + name: str = Field(..., description="") + + +class GroupsResult(BaseModel): + groups: List["PointGroup"] = Field(..., description="") + + +class GrpcTelemetry(BaseModel): + responses: Dict[str, "OperationDurationStatistics"] = Field(..., description="") + + +class HardwareTelemetry(BaseModel): + collection_data: Dict[str, "HardwareUsage"] = Field(..., description="") + + +class HardwareUsage(BaseModel): + """ + Usage of the hardware resources, spent to process the request + """ + + cpu: int = Field(..., description="Usage of the hardware resources, spent to process the request") + payload_io_read: int = Field(..., description="Usage of the hardware resources, spent to process the request") + payload_io_write: int = Field(..., description="Usage of the hardware resources, spent to process the request") + payload_index_io_read: int = Field(..., description="Usage of the hardware resources, spent to process the request") + payload_index_io_write: int = Field( + ..., description="Usage of the hardware resources, spent to process the request" + ) + vector_io_read: int = Field(..., description="Usage of the hardware resources, spent to process the request") + vector_io_write: int = Field(..., description="Usage of the hardware resources, spent to process the request") + + +class HasIdCondition(BaseModel, extra="forbid"): + """ + ID-based filtering condition + """ + + has_id: List["ExtendedPointId"] = Field(..., description="ID-based filtering condition") + + +class HasVectorCondition(BaseModel, extra="forbid"): + """ + Filter points which have specific vector assigned + """ + + has_vector: str = Field(..., description="Filter points which have specific vector assigned") + + +class HnswConfig(BaseModel): + """ + Config of HNSW index + """ + + m: int = Field( + ..., + description="Number of edges per node in the index graph. Larger the value - more accurate the search, more space required.", + ) + ef_construct: int = Field( + ..., + description="Number of neighbours to consider during the index building. Larger the value - more accurate the search, more time required to build index.", + ) + full_scan_threshold: int = Field( + ..., + description="Minimal size (in KiloBytes) of vectors for additional payload-based indexing. If payload chunk is smaller than `full_scan_threshold_kb` additional indexing won't be used - in this case full-scan search should be preferred by query planner and additional indexing is not required. Note: 1Kb = 1 vector of size 256", + ) + max_indexing_threads: Optional[int] = Field( + default=0, + description="Number of parallel threads used for background index building. If 0 - automatically select from 8 to 16. Best to keep between 8 and 16 to prevent likelihood of slow building or broken/inefficient HNSW graphs. On small CPUs, less threads are used.", + ) + on_disk: Optional[bool] = Field( + default=None, + description="Store HNSW index on disk. If set to false, index will be stored in RAM. Default: false", + ) + payload_m: Optional[int] = Field( + default=None, + description="Custom M param for hnsw graph built for payload index. If not set, default M will be used.", + ) + + +class HnswConfigDiff(BaseModel, extra="forbid"): + m: Optional[int] = Field( + default=None, + description="Number of edges per node in the index graph. Larger the value - more accurate the search, more space required.", + ) + ef_construct: Optional[int] = Field( + default=None, + description="Number of neighbours to consider during the index building. Larger the value - more accurate the search, more time required to build the index.", + ) + full_scan_threshold: Optional[int] = Field( + default=None, + description="Minimal size (in kilobytes) of vectors for additional payload-based indexing. If payload chunk is smaller than `full_scan_threshold_kb` additional indexing won't be used - in this case full-scan search should be preferred by query planner and additional indexing is not required. Note: 1Kb = 1 vector of size 256", + ) + max_indexing_threads: Optional[int] = Field( + default=None, + description="Number of parallel threads used for background index building. If 0 - automatically select from 8 to 16. Best to keep between 8 and 16 to prevent likelihood of building broken/inefficient HNSW graphs. On small CPUs, less threads are used.", + ) + on_disk: Optional[bool] = Field( + default=None, + description="Store HNSW index on disk. If set to false, the index will be stored in RAM. Default: false", + ) + payload_m: Optional[int] = Field( + default=None, + description="Custom M param for additional payload-aware HNSW links. If not set, default M will be used.", + ) + + +class HnswGlobalConfig(BaseModel): + healing_threshold: Optional[float] = Field( + default=0.3, + description="Enable HNSW healing if the ratio of missing points is no more than this value. To disable healing completely, set this value to `0.0`.", + ) + + +class Image(BaseModel, extra="forbid"): + """ + WARN: Work-in-progress, unimplemented Image object for embedding. Requires inference infrastructure, unimplemented. + """ + + image: Any = Field(..., description="Image data: base64 encoded image or an URL") + model: str = Field( + ..., description="Name of the model used to generate the vector List of available models depends on a provider" + ) + options: Optional[Dict[str, Any]] = Field( + default=None, description="Parameters for the model Values of the parameters are model-specific" + ) + + +class IndexesOneOf(BaseModel): + """ + Do not use any index, scan whole vector collection during search. Guarantee 100% precision, but may be time consuming on large collections. + """ + + type: Literal["plain",] = Field( + ..., + description="Do not use any index, scan whole vector collection during search. Guarantee 100% precision, but may be time consuming on large collections.", + ) + options: Any = Field( + ..., + description="Do not use any index, scan whole vector collection during search. Guarantee 100% precision, but may be time consuming on large collections.", + ) + + +class IndexesOneOf1(BaseModel): + """ + Use filterable HNSW index for approximate search. Is very fast even on a very huge collections, but require additional space to store index and additional time to build it. + """ + + type: Literal["hnsw",] = Field( + ..., + description="Use filterable HNSW index for approximate search. Is very fast even on a very huge collections, but require additional space to store index and additional time to build it.", + ) + options: "HnswConfig" = Field( + ..., + description="Use filterable HNSW index for approximate search. Is very fast even on a very huge collections, but require additional space to store index and additional time to build it.", + ) + + +class InferenceObject(BaseModel, extra="forbid"): + """ + WARN: Work-in-progress, unimplemented Custom object for embedding. Requires inference infrastructure, unimplemented. + """ + + object: Any = Field( + ..., + description="Arbitrary data, used as input for the embedding model Used if the model requires more than one input or a custom input", + ) + model: str = Field( + ..., description="Name of the model used to generate the vector List of available models depends on a provider" + ) + options: Optional[Dict[str, Any]] = Field( + default=None, description="Parameters for the model Values of the parameters are model-specific" + ) + + +class InferenceUsage(BaseModel): + models: Dict[str, "ModelUsage"] = Field(..., description="") + + +class InitFrom(BaseModel, extra="forbid"): + """ + Operation for creating new collection and (optionally) specify index params + """ + + collection: str = Field( + ..., description="Operation for creating new collection and (optionally) specify index params" + ) + + +class InlineResponse200(BaseModel): + usage: Optional["Usage"] = Field(default=None, description="") + time: Optional[float] = Field(default=None, description="Time spent to process this request") + status: Optional[str] = Field(default=None, description="") + result: Optional[bool] = Field(default=None, description="") + + +class InlineResponse2001(BaseModel): + usage: Optional["Usage"] = Field(default=None, description="") + time: Optional[float] = Field(default=None, description="Time spent to process this request") + status: Optional[str] = Field(default=None, description="") + result: Optional["TelemetryData"] = Field(default=None, description="") + + +class InlineResponse20010(BaseModel): + time: Optional[float] = Field(default=None, description="Time spent to process this request") + status: Optional[str] = Field(default=None, description="") + result: Optional[bool] = Field(default=None, description="") + + +class InlineResponse20011(BaseModel): + usage: Optional["Usage"] = Field(default=None, description="") + time: Optional[float] = Field(default=None, description="Time spent to process this request") + status: Optional[str] = Field(default=None, description="") + result: Optional[List["SnapshotDescription"]] = Field(default=None, description="") + + +class InlineResponse20012(BaseModel): + time: Optional[float] = Field(default=None, description="Time spent to process this request") + status: Optional[str] = Field(default=None, description="") + result: Optional["SnapshotDescription"] = Field(default=None, description="") + + +class InlineResponse20013(BaseModel): + usage: Optional["Usage"] = Field(default=None, description="") + time: Optional[float] = Field(default=None, description="Time spent to process this request") + status: Optional[str] = Field(default=None, description="") + result: Optional["Record"] = Field(default=None, description="") + + +class InlineResponse20014(BaseModel): + usage: Optional["Usage"] = Field(default=None, description="") + time: Optional[float] = Field(default=None, description="Time spent to process this request") + status: Optional[str] = Field(default=None, description="") + result: Optional[List["Record"]] = Field(default=None, description="") + + +class InlineResponse20015(BaseModel): + usage: Optional["Usage"] = Field(default=None, description="") + time: Optional[float] = Field(default=None, description="Time spent to process this request") + status: Optional[str] = Field(default=None, description="") + result: Optional[List["UpdateResult"]] = Field(default=None, description="") + + +class InlineResponse20016(BaseModel): + usage: Optional["Usage"] = Field(default=None, description="") + time: Optional[float] = Field(default=None, description="Time spent to process this request") + status: Optional[str] = Field(default=None, description="") + result: Optional["ScrollResult"] = Field(default=None, description="") + + +class InlineResponse20017(BaseModel): + usage: Optional["Usage"] = Field(default=None, description="") + time: Optional[float] = Field(default=None, description="Time spent to process this request") + status: Optional[str] = Field(default=None, description="") + result: Optional[List["ScoredPoint"]] = Field(default=None, description="") + + +class InlineResponse20018(BaseModel): + usage: Optional["Usage"] = Field(default=None, description="") + time: Optional[float] = Field(default=None, description="Time spent to process this request") + status: Optional[str] = Field(default=None, description="") + result: Optional[List[List["ScoredPoint"]]] = Field(default=None, description="") + + +class InlineResponse20019(BaseModel): + usage: Optional["Usage"] = Field(default=None, description="") + time: Optional[float] = Field(default=None, description="Time spent to process this request") + status: Optional[str] = Field(default=None, description="") + result: Optional["GroupsResult"] = Field(default=None, description="") + + +class InlineResponse2002(BaseModel): + usage: Optional["Usage"] = Field(default=None, description="") + time: Optional[float] = Field(default=None, description="Time spent to process this request") + status: Optional[str] = Field(default=None, description="") + result: Optional["LocksOption"] = Field(default=None, description="") + + +class InlineResponse20020(BaseModel): + usage: Optional["Usage"] = Field(default=None, description="") + time: Optional[float] = Field(default=None, description="Time spent to process this request") + status: Optional[str] = Field(default=None, description="") + result: Optional["CountResult"] = Field(default=None, description="") + + +class InlineResponse20021(BaseModel): + usage: Optional["Usage"] = Field(default=None, description="") + time: Optional[float] = Field(default=None, description="Time spent to process this request") + status: Optional[str] = Field(default=None, description="") + result: Optional["FacetResponse"] = Field(default=None, description="") + + +class InlineResponse20022(BaseModel): + usage: Optional["Usage"] = Field(default=None, description="") + time: Optional[float] = Field(default=None, description="Time spent to process this request") + status: Optional[str] = Field(default=None, description="") + result: Optional["QueryResponse"] = Field(default=None, description="") + + +class InlineResponse20023(BaseModel): + usage: Optional["Usage"] = Field(default=None, description="") + time: Optional[float] = Field(default=None, description="Time spent to process this request") + status: Optional[str] = Field(default=None, description="") + result: Optional[List["QueryResponse"]] = Field(default=None, description="") + + +class InlineResponse20024(BaseModel): + usage: Optional["Usage"] = Field(default=None, description="") + time: Optional[float] = Field(default=None, description="Time spent to process this request") + status: Optional[str] = Field(default=None, description="") + result: Optional["SearchMatrixPairsResponse"] = Field(default=None, description="") + + +class InlineResponse20025(BaseModel): + usage: Optional["Usage"] = Field(default=None, description="") + time: Optional[float] = Field(default=None, description="Time spent to process this request") + status: Optional[str] = Field(default=None, description="") + result: Optional["SearchMatrixOffsetsResponse"] = Field(default=None, description="") + + +class InlineResponse2003(BaseModel): + usage: Optional["Usage"] = Field(default=None, description="") + time: Optional[float] = Field(default=None, description="Time spent to process this request") + status: Optional[str] = Field(default=None, description="") + result: Optional["ClusterStatus"] = Field(default=None, description="") + + +class InlineResponse2004(BaseModel): + usage: Optional["Usage"] = Field(default=None, description="") + time: Optional[float] = Field(default=None, description="Time spent to process this request") + status: Optional[str] = Field(default=None, description="") + result: Optional["CollectionsResponse"] = Field(default=None, description="") + + +class InlineResponse2005(BaseModel): + usage: Optional["Usage"] = Field(default=None, description="") + time: Optional[float] = Field(default=None, description="Time spent to process this request") + status: Optional[str] = Field(default=None, description="") + result: Optional["CollectionInfo"] = Field(default=None, description="") + + +class InlineResponse2006(BaseModel): + usage: Optional["Usage"] = Field(default=None, description="") + time: Optional[float] = Field(default=None, description="Time spent to process this request") + status: Optional[str] = Field(default=None, description="") + result: Optional["UpdateResult"] = Field(default=None, description="") + + +class InlineResponse2007(BaseModel): + usage: Optional["Usage"] = Field(default=None, description="") + time: Optional[float] = Field(default=None, description="Time spent to process this request") + status: Optional[str] = Field(default=None, description="") + result: Optional["CollectionExistence"] = Field(default=None, description="") + + +class InlineResponse2008(BaseModel): + usage: Optional["Usage"] = Field(default=None, description="") + time: Optional[float] = Field(default=None, description="Time spent to process this request") + status: Optional[str] = Field(default=None, description="") + result: Optional["CollectionClusterInfo"] = Field(default=None, description="") + + +class InlineResponse2009(BaseModel): + usage: Optional["Usage"] = Field(default=None, description="") + time: Optional[float] = Field(default=None, description="Time spent to process this request") + status: Optional[str] = Field(default=None, description="") + result: Optional["CollectionsAliasesResponse"] = Field(default=None, description="") + + +class InlineResponse202(BaseModel): + time: Optional[float] = Field(default=None, description="Time spent to process this request") + status: Optional[str] = Field(default=None, description="") + + +class IntegerIndexParams(BaseModel, extra="forbid"): + type: "IntegerIndexType" = Field(..., description="") + lookup: Optional[bool] = Field(default=None, description="If true - support direct lookups. Default is true.") + range: Optional[bool] = Field(default=None, description="If true - support ranges filters. Default is true.") + is_principal: Optional[bool] = Field( + default=None, + description="If true - use this key to organize storage of the collection data. This option assumes that this key will be used in majority of filtered requests. Default is false.", + ) + on_disk: Optional[bool] = Field( + default=None, description="If true, store the index on disk. Default: false. Default is false." + ) + + +class IntegerIndexType(str, Enum): + INTEGER = "integer" + + +class IsEmptyCondition(BaseModel, extra="forbid"): + """ + Select points with empty payload for a specified field + """ + + is_empty: "PayloadField" = Field(..., description="Select points with empty payload for a specified field") + + +class IsNullCondition(BaseModel, extra="forbid"): + """ + Select points with null payload for a specified field + """ + + is_null: "PayloadField" = Field(..., description="Select points with null payload for a specified field") + + +class KeywordIndexParams(BaseModel, extra="forbid"): + type: "KeywordIndexType" = Field(..., description="") + is_tenant: Optional[bool] = Field( + default=None, description="If true - used for tenant optimization. Default: false." + ) + on_disk: Optional[bool] = Field(default=None, description="If true, store the index on disk. Default: false.") + + +class KeywordIndexType(str, Enum): + KEYWORD = "keyword" + + +class Language(str, Enum): + ARABIC = "arabic" + AZERBAIJANI = "azerbaijani" + BASQUE = "basque" + BENGALI = "bengali" + CATALAN = "catalan" + CHINESE = "chinese" + DANISH = "danish" + DUTCH = "dutch" + ENGLISH = "english" + FINNISH = "finnish" + FRENCH = "french" + GERMAN = "german" + GREEK = "greek" + HEBREW = "hebrew" + HINGLISH = "hinglish" + HUNGARIAN = "hungarian" + INDONESIAN = "indonesian" + ITALIAN = "italian" + JAPANESE = "japanese" + KAZAKH = "kazakh" + NEPALI = "nepali" + NORWEGIAN = "norwegian" + PORTUGUESE = "portuguese" + ROMANIAN = "romanian" + RUSSIAN = "russian" + SLOVENE = "slovene" + SPANISH = "spanish" + SWEDISH = "swedish" + TAJIK = "tajik" + TURKISH = "turkish" + + +class LinDecayExpression(BaseModel, extra="forbid"): + lin_decay: "DecayParamsExpression" = Field(..., description="") + + +class LnExpression(BaseModel, extra="forbid"): + ln: "Expression" = Field(..., description="") + + +class LocalShardInfo(BaseModel): + shard_id: int = Field(..., description="Local shard id") + shard_key: Optional["ShardKey"] = Field(default=None, description="User-defined sharding key") + points_count: int = Field(..., description="Number of points in the shard") + state: "ReplicaState" = Field(..., description="") + + +class LocalShardTelemetry(BaseModel): + variant_name: Optional[str] = Field(default=None, description="") + status: Optional["ShardStatus"] = Field(default=None, description="") + total_optimized_points: int = Field(..., description="Total number of optimized points since the last start.") + vectors_size_bytes: Optional[int] = Field( + default=None, + description="An ESTIMATION of effective amount of bytes used for vectors Do NOT rely on this number unless you know what you are doing", + ) + payloads_size_bytes: Optional[int] = Field( + default=None, + description="An estimation of the effective amount of bytes used for payloads Do NOT rely on this number unless you know what you are doing", + ) + num_points: Optional[int] = Field( + default=None, + description="Sum of segment points This is an approximate number Do NOT rely on this number unless you know what you are doing", + ) + num_vectors: Optional[int] = Field( + default=None, + description="Sum of number of vectors in all segments This is an approximate number Do NOT rely on this number unless you know what you are doing", + ) + segments: Optional[List["SegmentTelemetry"]] = Field(default=None, description="") + optimizations: "OptimizerTelemetry" = Field(..., description="") + async_scorer: Optional[bool] = Field(default=None, description="") + + +class LocksOption(BaseModel, extra="forbid"): + error_message: Optional[str] = Field(default=None, description="") + write: bool = Field(..., description="") + + +class Log10Expression(BaseModel, extra="forbid"): + log10: "Expression" = Field(..., description="") + + +class LookupLocation(BaseModel, extra="forbid"): + """ + Defines a location to use for looking up the vector. Specifies collection and vector field name. + """ + + collection: str = Field(..., description="Name of the collection used for lookup") + vector: Optional[str] = Field( + default=None, + description="Optional name of the vector field within the collection. If not provided, the default vector field will be used.", + ) + shard_key: Optional["ShardKeySelector"] = Field( + default=None, + description="Specify in which shards to look for the points, if not specified - look in all shards", + ) + + +class MatchAny(BaseModel, extra="forbid"): + """ + Exact match on any of the given values + """ + + any: "AnyVariants" = Field(..., description="Exact match on any of the given values") + + +class MatchExcept(BaseModel, extra="forbid"): + """ + Should have at least one value not matching the any given values + """ + + except_: "AnyVariants" = Field( + ..., description="Should have at least one value not matching the any given values", alias="except" + ) + + +class MatchPhrase(BaseModel, extra="forbid"): + """ + Full-text phrase match of the string. + """ + + phrase: str = Field(..., description="Full-text phrase match of the string.") + + +class MatchText(BaseModel, extra="forbid"): + """ + Full-text match of the strings. + """ + + text: str = Field(..., description="Full-text match of the strings.") + + +class MatchValue(BaseModel, extra="forbid"): + """ + Exact match of the given value + """ + + value: "ValueVariants" = Field(..., description="Exact match of the given value") + + +class MaxOptimizationThreadsSetting(str, Enum): + AUTO = "auto" + + +class MemoryTelemetry(BaseModel): + active_bytes: int = Field(..., description="Total number of bytes in active pages allocated by the application") + allocated_bytes: int = Field(..., description="Total number of bytes allocated by the application") + metadata_bytes: int = Field(..., description="Total number of bytes dedicated to metadata") + resident_bytes: int = Field(..., description="Maximum number of bytes in physically resident data pages mapped") + retained_bytes: int = Field(..., description="Total number of bytes in virtual memory mappings") + + +class MessageSendErrors(BaseModel): + """ + Message send failures for a particular peer + """ + + count: int = Field(..., description="Message send failures for a particular peer") + latest_error: Optional[str] = Field(default=None, description="Message send failures for a particular peer") + latest_error_timestamp: Optional[Union[datetime, date]] = Field( + default=None, description="Timestamp of the latest error" + ) + + +class MinShould(BaseModel, extra="forbid"): + conditions: List["Condition"] = Field(..., description="") + min_count: int = Field(..., description="") + + +class Mmr(BaseModel, extra="forbid"): + """ + Maximal Marginal Relevance (MMR) algorithm for re-ranking the points. + """ + + diversity: Optional[float] = Field( + default=None, + description="Tunable parameter for the MMR algorithm. Determines the balance between diversity and relevance. A higher value favors diversity (dissimilarity to selected results), while a lower value favors relevance (similarity to the query vector). Must be in the range [0, 1]. Default value is 0.5.", + ) + candidates_limit: Optional[int] = Field( + default=None, + description="The maximum number of candidates to consider for re-ranking. If not specified, the `limit` value is used.", + ) + + +class ModelUsage(BaseModel): + tokens: int = Field(..., description="") + + +class Modifier(str, Enum): + """ + If used, include weight modification, which will be applied to sparse vectors at query time: None - no modification (default) Idf - inverse document frequency, based on statistics of the collection + """ + + def __str__(self) -> str: + return str(self.value) + + NONE = "none" + IDF = "idf" + + +class MoveShard(BaseModel, extra="forbid"): + shard_id: int = Field(..., description="") + to_peer_id: int = Field(..., description="") + from_peer_id: int = Field(..., description="") + method: Optional["ShardTransferMethod"] = Field( + default=None, description="Method for transferring the shard from one node to another" + ) + + +class MoveShardOperation(BaseModel, extra="forbid"): + move_shard: "MoveShard" = Field(..., description="") + + +class MultExpression(BaseModel, extra="forbid"): + mult: List["Expression"] = Field(..., description="") + + +class MultiVectorComparator(str, Enum): + MAX_SIM = "max_sim" + + +class MultiVectorConfig(BaseModel, extra="forbid"): + comparator: "MultiVectorComparator" = Field(..., description="") + + +class NamedSparseVector(BaseModel, extra="forbid"): + """ + Sparse vector data with name + """ + + name: str = Field(..., description="Name of vector data") + vector: "SparseVector" = Field(..., description="Sparse vector data with name") + + +class NamedVector(BaseModel, extra="forbid"): + """ + Dense vector data with name + """ + + name: str = Field(..., description="Name of vector data") + vector: List[float] = Field(..., description="Vector data") + + +class NearestQuery(BaseModel, extra="forbid"): + nearest: "VectorInput" = Field(..., description="") + mmr: Optional["Mmr"] = Field( + default=None, + description="Perform MMR (Maximal Marginal Relevance) reranking after search, using the same vector in this query to calculate relevance.", + ) + + +class NegExpression(BaseModel, extra="forbid"): + neg: "Expression" = Field(..., description="") + + +class Nested(BaseModel, extra="forbid"): + """ + Select points with payload for a specified nested field + """ + + key: str = Field(..., description="Select points with payload for a specified nested field") + filter: "Filter" = Field(..., description="Select points with payload for a specified nested field") + + +class NestedCondition(BaseModel, extra="forbid"): + nested: "Nested" = Field(..., description="") + + +class OperationDurationStatistics(BaseModel): + count: int = Field(..., description="") + fail_count: Optional[int] = Field(default=None, description="") + avg_duration_micros: Optional[float] = Field( + default=None, description="The average time taken by 128 latest operations, calculated as a weighted mean." + ) + min_duration_micros: Optional[float] = Field( + default=None, description="The minimum duration of the operations across all the measurements." + ) + max_duration_micros: Optional[float] = Field( + default=None, description="The maximum duration of the operations across all the measurements." + ) + total_duration_micros: Optional[int] = Field( + default=None, description="The total duration of all operations in microseconds." + ) + last_responded: Optional[Union[datetime, date]] = Field(default=None, description="") + + +class OptimizerTelemetry(BaseModel): + status: "OptimizersStatus" = Field(..., description="") + optimizations: "OperationDurationStatistics" = Field(..., description="") + log: Optional[List["TrackerTelemetry"]] = Field(default=None, description="") + + +class OptimizersConfig(BaseModel): + deleted_threshold: float = Field( + ..., + description="The minimal fraction of deleted vectors in a segment, required to perform segment optimization", + ) + vacuum_min_vector_number: int = Field( + ..., description="The minimal number of vectors in a segment, required to perform segment optimization" + ) + default_segment_number: int = Field( + ..., + description="Target amount of segments optimizer will try to keep. Real amount of segments may vary depending on multiple parameters: - Amount of stored points - Current write RPS It is recommended to select default number of segments as a factor of the number of search threads, so that each segment would be handled evenly by one of the threads. If `default_segment_number = 0`, will be automatically selected by the number of available CPUs.", + ) + max_segment_size: Optional[int] = Field( + default=None, + description="Do not create segments larger this size (in kilobytes). Large segments might require disproportionately long indexation times, therefore it makes sense to limit the size of segments. If indexing speed is more important - make this parameter lower. If search speed is more important - make this parameter higher. Note: 1Kb = 1 vector of size 256 If not set, will be automatically selected considering the number of available CPUs.", + ) + memmap_threshold: Optional[int] = Field( + default=None, + description="Maximum size (in kilobytes) of vectors to store in-memory per segment. Segments larger than this threshold will be stored as read-only memmapped file. Memmap storage is disabled by default, to enable it, set this threshold to a reasonable value. To disable memmap storage, set this to `0`. Internally it will use the largest threshold possible. Note: 1Kb = 1 vector of size 256", + ) + indexing_threshold: Optional[int] = Field( + default=None, + description="Maximum size (in kilobytes) of vectors allowed for plain index, exceeding this threshold will enable vector indexing Default value is 10,000, based on experiments and observations. To disable vector indexing, set to `0`. Note: 1kB = 1 vector of size 256.", + ) + flush_interval_sec: int = Field(..., description="Minimum interval between forced flushes.") + max_optimization_threads: Optional[int] = Field( + default=None, + description="Max number of threads (jobs) for running optimizations per shard. Note: each optimization job will also use `max_indexing_threads` threads by itself for index building. If null - have no limit and choose dynamically to saturate CPU. If 0 - no optimization threads, optimizations will be disabled.", + ) + + +class OptimizersConfigDiff(BaseModel, extra="forbid"): + deleted_threshold: Optional[float] = Field( + default=None, + description="The minimal fraction of deleted vectors in a segment, required to perform segment optimization", + ) + vacuum_min_vector_number: Optional[int] = Field( + default=None, description="The minimal number of vectors in a segment, required to perform segment optimization" + ) + default_segment_number: Optional[int] = Field( + default=None, + description="Target amount of segments optimizer will try to keep. Real amount of segments may vary depending on multiple parameters: - Amount of stored points - Current write RPS It is recommended to select default number of segments as a factor of the number of search threads, so that each segment would be handled evenly by one of the threads If `default_segment_number = 0`, will be automatically selected by the number of available CPUs", + ) + max_segment_size: Optional[int] = Field( + default=None, + description="Do not create segments larger this size (in kilobytes). Large segments might require disproportionately long indexation times, therefore it makes sense to limit the size of segments. If indexation speed have more priority for your - make this parameter lower. If search speed is more important - make this parameter higher. Note: 1Kb = 1 vector of size 256", + ) + memmap_threshold: Optional[int] = Field( + default=None, + description="Maximum size (in kilobytes) of vectors to store in-memory per segment. Segments larger than this threshold will be stored as read-only memmapped file. Memmap storage is disabled by default, to enable it, set this threshold to a reasonable value. To disable memmap storage, set this to `0`. Note: 1Kb = 1 vector of size 256 Deprecated since Qdrant 1.15.0", + ) + indexing_threshold: Optional[int] = Field( + default=None, + description="Maximum size (in kilobytes) of vectors allowed for plain index, exceeding this threshold will enable vector indexing Default value is 20,000, based on <https://github.com/google-research/google-research/blob/master/scann/docs/algorithms.md>. To disable vector indexing, set to `0`. Note: 1kB = 1 vector of size 256.", + ) + flush_interval_sec: Optional[int] = Field(default=None, description="Minimum interval between forced flushes.") + max_optimization_threads: Optional["MaxOptimizationThreads"] = Field( + default=None, + description="Max number of threads (jobs) for running optimizations per shard. Note: each optimization job will also use `max_indexing_threads` threads by itself for index building. If "auto" - have no limit and choose dynamically to saturate CPU. If 0 - no optimization threads, optimizations will be disabled.", + ) + + +class OptimizersStatusOneOf(str, Enum): + """ + Optimizers are reporting as expected + """ + + def __str__(self) -> str: + return str(self.value) + + OK = "ok" + + +class OptimizersStatusOneOf1(BaseModel): + """ + Something wrong happened with optimizers + """ + + error: str = Field(..., description="Something wrong happened with optimizers") + + +class OrderBy(BaseModel, extra="forbid"): + key: str = Field(..., description="Payload key to order by") + direction: Optional["Direction"] = Field( + default=None, description="Direction of ordering: `asc` or `desc`. Default is ascending." + ) + start_from: Optional["StartFrom"] = Field( + default=None, + description="Which payload value to start scrolling from. Default is the lowest value for `asc` and the highest for `desc`", + ) + + +class OrderByQuery(BaseModel, extra="forbid"): + order_by: "OrderByInterface" = Field(..., description="") + + +class OverwritePayloadOperation(BaseModel, extra="forbid"): + overwrite_payload: "SetPayload" = Field(..., description="") + + +class P2pConfigTelemetry(BaseModel): + connection_pool_size: int = Field(..., description="") + + +class PartialSnapshotTelemetry(BaseModel): + ongoing_create_snapshot_requests: int = Field(..., description="") + is_recovering: bool = Field(..., description="") + recovery_timestamp: int = Field(..., description="") + + +class PayloadField(BaseModel, extra="forbid"): + """ + Payload field + """ + + key: str = Field(..., description="Payload field name") + + +class PayloadIndexInfo(BaseModel): + """ + Display payload field type & index information + """ + + data_type: "PayloadSchemaType" = Field(..., description="Display payload field type & index information") + params: Optional["PayloadSchemaParams"] = Field( + default=None, description="Display payload field type & index information" + ) + points: int = Field(..., description="Number of points indexed with this index") + + +class PayloadIndexTelemetry(BaseModel): + field_name: Optional[str] = Field(default=None, description="") + index_type: str = Field(..., description="") + points_values_count: int = Field(..., description="The amount of values indexed for all points.") + points_count: int = Field(..., description="The amount of points that have at least one value indexed.") + histogram_bucket_size: Optional[int] = Field(default=None, description="") + + +class PayloadSchemaType(str, Enum): + """ + All possible names of payload types + """ + + def __str__(self) -> str: + return str(self.value) + + KEYWORD = "keyword" + INTEGER = "integer" + FLOAT = "float" + GEO = "geo" + TEXT = "text" + BOOL = "bool" + DATETIME = "datetime" + UUID = "uuid" + + +class PayloadSelectorExclude(BaseModel, extra="forbid"): + exclude: List[str] = Field(..., description="Exclude this fields from returning payload") + + +class PayloadSelectorInclude(BaseModel, extra="forbid"): + include: List[str] = Field(..., description="Only include this payload keys") + + +class PayloadStorageTypeOneOf(BaseModel): + type: Literal[ + "in_memory", + ] = Field(..., description="") + + +class PayloadStorageTypeOneOf1(BaseModel): + type: Literal[ + "on_disk", + ] = Field(..., description="") + + +class PayloadStorageTypeOneOf2(BaseModel): + type: Literal[ + "mmap", + ] = Field(..., description="") + + +class PayloadStorageTypeOneOf3(BaseModel): + type: Literal[ + "in_ram_mmap", + ] = Field(..., description="") + + +class PeerInfo(BaseModel): + """ + Information of a peer in the cluster + """ + + uri: str = Field(..., description="Information of a peer in the cluster") + + +class PointGroup(BaseModel): + hits: List["ScoredPoint"] = Field(..., description="Scored points that have the same value of the group_by key") + id: "GroupId" = Field(..., description="") + lookup: Optional["Record"] = Field(default=None, description="Record that has been looked up using the group id") + + +class PointIdsList(BaseModel, extra="forbid"): + points: List["ExtendedPointId"] = Field(..., description="") + shard_key: Optional["ShardKeySelector"] = Field(default=None, description="") + + +class PointRequest(BaseModel, extra="forbid"): + shard_key: Optional["ShardKeySelector"] = Field( + default=None, + description="Specify in which shards to look for the points, if not specified - look in all shards", + ) + ids: List["ExtendedPointId"] = Field(..., description="Look for points with ids") + with_payload: Optional["WithPayloadInterface"] = Field( + default=None, description="Select which payload to return with the response. Default is true." + ) + with_vector: Optional["WithVector"] = Field(default=None, description="") + + +class PointStruct(BaseModel, extra="forbid"): + id: "ExtendedPointId" = Field(..., description="") + vector: "VectorStruct" = Field(..., description="") + payload: Optional["Payload"] = Field(default=None, description="Payload values (optional)") + + +class PointVectors(BaseModel, extra="forbid"): + id: "ExtendedPointId" = Field(..., description="") + vector: "VectorStruct" = Field(..., description="") + + +class PointsBatch(BaseModel, extra="forbid"): + batch: "Batch" = Field(..., description="") + shard_key: Optional["ShardKeySelector"] = Field(default=None, description="") + + +class PointsList(BaseModel, extra="forbid"): + points: List["PointStruct"] = Field(..., description="") + shard_key: Optional["ShardKeySelector"] = Field(default=None, description="") + + +class PowExpression(BaseModel, extra="forbid"): + pow: "PowParams" = Field(..., description="") + + +class PowParams(BaseModel, extra="forbid"): + base: "Expression" = Field(..., description="") + exponent: "Expression" = Field(..., description="") + + +class Prefetch(BaseModel, extra="forbid"): + prefetch: Optional[Union[List["Prefetch"], "Prefetch"]] = Field( + default=None, + description="Sub-requests to perform first. If present, the query will be performed on the results of the prefetches.", + ) + query: Optional["QueryInterface"] = Field( + default=None, + description="Query to perform. If missing without prefetches, returns points ordered by their IDs.", + ) + using: Optional[str] = Field( + default=None, + description="Define which vector name to use for querying. If missing, the default vector is used.", + ) + filter: Optional["Filter"] = Field( + default=None, description="Filter conditions - return only those points that satisfy the specified conditions." + ) + params: Optional["SearchParams"] = Field(default=None, description="Search params for when there is no prefetch") + score_threshold: Optional[float] = Field( + default=None, description="Return points with scores better than this threshold." + ) + limit: Optional[int] = Field(default=None, description="Max number of points to return. Default is 10.") + lookup_from: Optional["LookupLocation"] = Field( + default=None, + description="The location to use for IDs lookup, if not specified - use the current collection and the 'using' vector Note: the other collection vectors should have the same vector size as the 'using' vector in the current collection", + ) + + +class ProductQuantization(BaseModel, extra="forbid"): + product: "ProductQuantizationConfig" = Field(..., description="") + + +class ProductQuantizationConfig(BaseModel, extra="forbid"): + compression: "CompressionRatio" = Field(..., description="") + always_ram: Optional[bool] = Field(default=None, description="") + + +class QuantizationSearchParams(BaseModel, extra="forbid"): + """ + Additional parameters of the search + """ + + ignore: Optional[bool] = Field( + default=False, description="If true, quantized vectors are ignored. Default is false." + ) + rescore: Optional[bool] = Field( + default=None, + description="If true, use original vectors to re-score top-k results. Might require more time in case if original vectors are stored on disk. If not set, qdrant decides automatically apply rescoring or not.", + ) + oversampling: Optional[float] = Field( + default=None, + description="Oversampling factor for quantization. Default is 1.0. Defines how many extra vectors should be pre-selected using quantized index, and then re-scored using original vectors. For example, if `oversampling` is 2.4 and `limit` is 100, then 240 vectors will be pre-selected using quantized index, and then top-100 will be returned after re-scoring.", + ) + + +class QueryGroupsRequest(BaseModel, extra="forbid"): + shard_key: Optional["ShardKeySelector"] = Field(default=None, description="") + prefetch: Optional[Union[List["Prefetch"], "Prefetch"]] = Field( + default=None, + description="Sub-requests to perform first. If present, the query will be performed on the results of the prefetch(es).", + ) + query: Optional["QueryInterface"] = Field( + default=None, + description="Query to perform. If missing without prefetches, returns points ordered by their IDs.", + ) + using: Optional[str] = Field( + default=None, + description="Define which vector name to use for querying. If missing, the default vector is used.", + ) + filter: Optional["Filter"] = Field( + default=None, description="Filter conditions - return only those points that satisfy the specified conditions." + ) + params: Optional["SearchParams"] = Field(default=None, description="Search params for when there is no prefetch") + score_threshold: Optional[float] = Field( + default=None, description="Return points with scores better than this threshold." + ) + with_vector: Optional["WithVector"] = Field( + default=None, description="Options for specifying which vectors to include into the response. Default is false." + ) + with_payload: Optional["WithPayloadInterface"] = Field( + default=None, description="Options for specifying which payload to include or not. Default is false." + ) + lookup_from: Optional["LookupLocation"] = Field( + default=None, + description="The location to use for IDs lookup, if not specified - use the current collection and the 'using' vector Note: the other collection vectors should have the same vector size as the 'using' vector in the current collection", + ) + group_by: str = Field( + ..., + description="Payload field to group by, must be a string or number field. If the field contains more than 1 value, all values will be used for grouping. One point can be in multiple groups.", + ) + group_size: Optional[int] = Field( + default=None, description="Maximum amount of points to return per group. Default is 3." + ) + limit: Optional[int] = Field(default=None, description="Maximum amount of groups to return. Default is 10.") + with_lookup: Optional["WithLookupInterface"] = Field( + default=None, description="Look for points in another collection using the group ids" + ) + + +class QueryRequest(BaseModel, extra="forbid"): + shard_key: Optional["ShardKeySelector"] = Field(default=None, description="") + prefetch: Optional[Union[List["Prefetch"], "Prefetch"]] = Field( + default=None, + description="Sub-requests to perform first. If present, the query will be performed on the results of the prefetch(es).", + ) + query: Optional["QueryInterface"] = Field( + default=None, + description="Query to perform. If missing without prefetches, returns points ordered by their IDs.", + ) + using: Optional[str] = Field( + default=None, + description="Define which vector name to use for querying. If missing, the default vector is used.", + ) + filter: Optional["Filter"] = Field( + default=None, description="Filter conditions - return only those points that satisfy the specified conditions." + ) + params: Optional["SearchParams"] = Field(default=None, description="Search params for when there is no prefetch") + score_threshold: Optional[float] = Field( + default=None, description="Return points with scores better than this threshold." + ) + limit: Optional[int] = Field(default=None, description="Max number of points to return. Default is 10.") + offset: Optional[int] = Field(default=None, description="Offset of the result. Skip this many points. Default is 0") + with_vector: Optional["WithVector"] = Field( + default=None, description="Options for specifying which vectors to include into the response. Default is false." + ) + with_payload: Optional["WithPayloadInterface"] = Field( + default=None, description="Options for specifying which payload to include or not. Default is false." + ) + lookup_from: Optional["LookupLocation"] = Field( + default=None, + description="The location to use for IDs lookup, if not specified - use the current collection and the 'using' vector Note: the other collection vectors should have the same vector size as the 'using' vector in the current collection", + ) + + +class QueryRequestBatch(BaseModel, extra="forbid"): + searches: List["QueryRequest"] = Field(..., description="") + + +class QueryResponse(BaseModel): + points: List["ScoredPoint"] = Field(..., description="") + + +class RaftInfo(BaseModel): + """ + Summary information about the current raft state + """ + + term: int = Field( + ..., + description="Raft divides time into terms of arbitrary length, each beginning with an election. If a candidate wins the election, it remains the leader for the rest of the term. The term number increases monotonically. Each server stores the current term number which is also exchanged in every communication.", + ) + commit: int = Field( + ..., description="The index of the latest committed (finalized) operation that this peer is aware of." + ) + pending_operations: int = Field( + ..., description="Number of consensus operations pending to be applied on this peer" + ) + leader: Optional[int] = Field(default=None, description="Leader of the current term") + role: Optional["StateRole"] = Field(default=None, description="Role of this peer in the current term") + is_voter: bool = Field(..., description="Is this peer a voter or a learner") + + +class Range(BaseModel, extra="forbid"): + """ + Range filter request + """ + + lt: Optional[float] = Field(default=None, description="point.key < range.lt") + gt: Optional[float] = Field(default=None, description="point.key > range.gt") + gte: Optional[float] = Field(default=None, description="point.key >= range.gte") + lte: Optional[float] = Field(default=None, description="point.key <= range.lte") + + +class ReadConsistencyType(str, Enum): + """ + * `majority` - send N/2+1 random request and return points, which present on all of them * `quorum` - send requests to all nodes and return points which present on majority of nodes * `all` - send requests to all nodes and return points which present on all nodes + """ + + def __str__(self) -> str: + return str(self.value) + + MAJORITY = "majority" + QUORUM = "quorum" + ALL = "all" + + +class RecommendGroupsRequest(BaseModel, extra="forbid"): + shard_key: Optional["ShardKeySelector"] = Field( + default=None, + description="Specify in which shards to look for the points, if not specified - look in all shards", + ) + positive: Optional[List["RecommendExample"]] = Field(default=[], description="Look for vectors closest to those") + negative: Optional[List["RecommendExample"]] = Field(default=[], description="Try to avoid vectors like this") + strategy: Optional["RecommendStrategy"] = Field( + default=None, description="How to use positive and negative examples to find the results" + ) + filter: Optional["Filter"] = Field(default=None, description="Look only for points which satisfies this conditions") + params: Optional["SearchParams"] = Field(default=None, description="Additional search params") + with_payload: Optional["WithPayloadInterface"] = Field( + default=None, description="Select which payload to return with the response. Default is false." + ) + with_vector: Optional["WithVector"] = Field( + default=None, description="Options for specifying which vectors to include into response. Default is false." + ) + score_threshold: Optional[float] = Field( + default=None, + description="Define a minimal score threshold for the result. If defined, less similar results will not be returned. Score of the returned result might be higher or smaller than the threshold depending on the Distance function used. E.g. for cosine similarity only higher scores will be returned.", + ) + using: Optional["UsingVector"] = Field( + default=None, + description="Define which vector to use for recommendation, if not specified - try to use default vector", + ) + lookup_from: Optional["LookupLocation"] = Field( + default=None, + description="The location used to lookup vectors. If not specified - use current collection. Note: the other collection should have the same vector size as the current collection", + ) + group_by: str = Field( + ..., + description="Payload field to group by, must be a string or number field. If the field contains more than 1 value, all values will be used for grouping. One point can be in multiple groups.", + ) + group_size: int = Field(..., description="Maximum amount of points to return per group") + limit: int = Field(..., description="Maximum amount of groups to return") + with_lookup: Optional["WithLookupInterface"] = Field( + default=None, description="Look for points in another collection using the group ids" + ) + + +class RecommendInput(BaseModel, extra="forbid"): + positive: Optional[List["VectorInput"]] = Field( + default=None, description="Look for vectors closest to the vectors from these points" + ) + negative: Optional[List["VectorInput"]] = Field( + default=None, description="Try to avoid vectors like the vector from these points" + ) + strategy: Optional["RecommendStrategy"] = Field( + default=None, description="How to use the provided vectors to find the results" + ) + + +class RecommendQuery(BaseModel, extra="forbid"): + recommend: "RecommendInput" = Field(..., description="") + + +class RecommendRequest(BaseModel, extra="forbid"): + """ + Recommendation request. Provides positive and negative examples of the vectors, which can be ids of points that are already stored in the collection, raw vectors, or even ids and vectors combined. Service should look for the points which are closer to positive examples and at the same time further to negative examples. The concrete way of how to compare negative and positive distances is up to the `strategy` chosen. + """ + + shard_key: Optional["ShardKeySelector"] = Field( + default=None, + description="Specify in which shards to look for the points, if not specified - look in all shards", + ) + positive: Optional[List["RecommendExample"]] = Field(default=[], description="Look for vectors closest to those") + negative: Optional[List["RecommendExample"]] = Field(default=[], description="Try to avoid vectors like this") + strategy: Optional["RecommendStrategy"] = Field( + default=None, description="How to use positive and negative examples to find the results" + ) + filter: Optional["Filter"] = Field(default=None, description="Look only for points which satisfies this conditions") + params: Optional["SearchParams"] = Field(default=None, description="Additional search params") + limit: int = Field(..., description="Max number of result to return") + offset: Optional[int] = Field( + default=None, + description="Offset of the first result to return. May be used to paginate results. Note: large offset values may cause performance issues.", + ) + with_payload: Optional["WithPayloadInterface"] = Field( + default=None, description="Select which payload to return with the response. Default is false." + ) + with_vector: Optional["WithVector"] = Field( + default=None, description="Options for specifying which vectors to include into response. Default is false." + ) + score_threshold: Optional[float] = Field( + default=None, + description="Define a minimal score threshold for the result. If defined, less similar results will not be returned. Score of the returned result might be higher or smaller than the threshold depending on the Distance function used. E.g. for cosine similarity only higher scores will be returned.", + ) + using: Optional["UsingVector"] = Field( + default=None, + description="Define which vector to use for recommendation, if not specified - try to use default vector", + ) + lookup_from: Optional["LookupLocation"] = Field( + default=None, + description="The location used to lookup vectors. If not specified - use current collection. Note: the other collection should have the same vector size as the current collection", + ) + + +class RecommendRequestBatch(BaseModel, extra="forbid"): + searches: List["RecommendRequest"] = Field(..., description="") + + +class RecommendStrategy(str, Enum): + """ + How to use positive and negative examples to find the results, default is `average_vector`: * `average_vector` - Average positive and negative vectors and create a single query with the formula `query = avg_pos + avg_pos - avg_neg`. Then performs normal search. * `best_score` - Uses custom search objective. Each candidate is compared against all examples, its score is then chosen from the `max(max_pos_score, max_neg_score)`. If the `max_neg_score` is chosen then it is squared and negated, otherwise it is just the `max_pos_score`. * `sum_scores` - Uses custom search objective. Compares against all inputs, sums all the scores. Scores against positive vectors are added, against negatives are subtracted. + """ + + def __str__(self) -> str: + return str(self.value) + + AVERAGE_VECTOR = "average_vector" + BEST_SCORE = "best_score" + SUM_SCORES = "sum_scores" + + +class Record(BaseModel): + """ + Point data + """ + + id: "ExtendedPointId" = Field(..., description="Point data") + payload: Optional["Payload"] = Field(default=None, description="Payload - values assigned to the point") + vector: Optional["VectorStructOutput"] = Field(default=None, description="Vector of the point") + shard_key: Optional["ShardKey"] = Field(default=None, description="Shard Key") + order_value: Optional["OrderValue"] = Field(default=None, description="Point data") + + +class RemoteShardInfo(BaseModel): + shard_id: int = Field(..., description="Remote shard id") + shard_key: Optional["ShardKey"] = Field(default=None, description="User-defined sharding key") + peer_id: int = Field(..., description="Remote peer id") + state: "ReplicaState" = Field(..., description="") + + +class RemoteShardTelemetry(BaseModel): + shard_id: int = Field(..., description="") + peer_id: Optional[int] = Field(default=None, description="") + searches: "OperationDurationStatistics" = Field(..., description="") + updates: "OperationDurationStatistics" = Field(..., description="") + + +class RenameAlias(BaseModel, extra="forbid"): + """ + Change alias to a new one + """ + + old_alias_name: str = Field(..., description="Change alias to a new one") + new_alias_name: str = Field(..., description="Change alias to a new one") + + +class RenameAliasOperation(BaseModel, extra="forbid"): + """ + Change alias to a new one + """ + + rename_alias: "RenameAlias" = Field(..., description="Change alias to a new one") + + +class Replica(BaseModel, extra="forbid"): + shard_id: int = Field(..., description="") + peer_id: int = Field(..., description="") + + +class ReplicaSetTelemetry(BaseModel): + id: int = Field(..., description="") + key: Optional["ShardKey"] = Field(default=None, description="") + local: Optional["LocalShardTelemetry"] = Field(default=None, description="") + remote: List["RemoteShardTelemetry"] = Field(..., description="") + replicate_states: Dict[str, "ReplicaState"] = Field(..., description="") + partial_snapshot: Optional["PartialSnapshotTelemetry"] = Field(default=None, description="") + + +class ReplicaState(str, Enum): + """ + State of the single shard within a replica set. + """ + + def __str__(self) -> str: + return str(self.value) + + ACTIVE = "Active" + DEAD = "Dead" + PARTIAL = "Partial" + INITIALIZING = "Initializing" + LISTENER = "Listener" + PARTIALSNAPSHOT = "PartialSnapshot" + RECOVERY = "Recovery" + RESHARDING = "Resharding" + RESHARDINGSCALEDOWN = "ReshardingScaleDown" + + +class ReplicateShard(BaseModel, extra="forbid"): + shard_id: int = Field(..., description="") + to_peer_id: int = Field(..., description="") + from_peer_id: int = Field(..., description="") + method: Optional["ShardTransferMethod"] = Field( + default=None, description="Method for transferring the shard from one node to another" + ) + + +class ReplicateShardOperation(BaseModel, extra="forbid"): + replicate_shard: "ReplicateShard" = Field(..., description="") + + +class RequestsTelemetry(BaseModel): + rest: "WebApiTelemetry" = Field(..., description="") + grpc: "GrpcTelemetry" = Field(..., description="") + + +class ReshardingDirectionOneOf(str, Enum): + """ + Scale up, add a new shard + """ + + def __str__(self) -> str: + return str(self.value) + + UP = "up" + + +class ReshardingDirectionOneOf1(str, Enum): + """ + Scale down, remove a shard + """ + + def __str__(self) -> str: + return str(self.value) + + DOWN = "down" + + +class ReshardingInfo(BaseModel): + direction: "ReshardingDirection" = Field(..., description="") + shard_id: int = Field(..., description="") + peer_id: int = Field(..., description="") + shard_key: Optional["ShardKey"] = Field(default=None, description="") + + +class RestartTransfer(BaseModel, extra="forbid"): + shard_id: int = Field(..., description="") + from_peer_id: int = Field(..., description="") + to_peer_id: int = Field(..., description="") + method: "ShardTransferMethod" = Field(..., description="") + + +class RestartTransferOperation(BaseModel, extra="forbid"): + restart_transfer: "RestartTransfer" = Field(..., description="") + + +class RunningEnvironmentTelemetry(BaseModel): + distribution: Optional[str] = Field(default=None, description="") + distribution_version: Optional[str] = Field(default=None, description="") + is_docker: bool = Field(..., description="") + cores: Optional[int] = Field(default=None, description="") + ram_size: Optional[int] = Field(default=None, description="") + disk_size: Optional[int] = Field(default=None, description="") + cpu_flags: str = Field(..., description="") + cpu_endian: Optional["CpuEndian"] = Field(default=None, description="") + gpu_devices: Optional[List["GpuDeviceTelemetry"]] = Field(default=None, description="") + + +class Sample(str, Enum): + RANDOM = "random" + + +class SampleQuery(BaseModel, extra="forbid"): + sample: "Sample" = Field(..., description="") + + +class ScalarQuantization(BaseModel, extra="forbid"): + scalar: "ScalarQuantizationConfig" = Field(..., description="") + + +class ScalarQuantizationConfig(BaseModel, extra="forbid"): + type: "ScalarType" = Field(..., description="") + quantile: Optional[float] = Field( + default=None, + description="Quantile for quantization. Expected value range in [0.5, 1.0]. If not set - use the whole range of values", + ) + always_ram: Optional[bool] = Field( + default=None, + description="If true - quantized vectors always will be stored in RAM, ignoring the config of main storage", + ) + + +class ScalarType(str, Enum): + INT8 = "int8" + + +class ScoredPoint(BaseModel): + """ + Search result + """ + + id: "ExtendedPointId" = Field(..., description="Search result") + version: int = Field(..., description="Point version") + score: float = Field(..., description="Points vector distance to the query vector") + payload: Optional["Payload"] = Field(default=None, description="Payload - values assigned to the point") + vector: Optional["VectorStructOutput"] = Field(default=None, description="Vector of the point") + shard_key: Optional["ShardKey"] = Field(default=None, description="Shard Key") + order_value: Optional["OrderValue"] = Field(default=None, description="Order-by value") + + +class ScrollRequest(BaseModel, extra="forbid"): + """ + Scroll request - paginate over all points which matches given condition + """ + + shard_key: Optional["ShardKeySelector"] = Field( + default=None, + description="Specify in which shards to look for the points, if not specified - look in all shards", + ) + offset: Optional["ExtendedPointId"] = Field(default=None, description="Start ID to read points from.") + limit: Optional[int] = Field(default=None, description="Page size. Default: 10") + filter: Optional["Filter"] = Field( + default=None, description="Look only for points which satisfies this conditions. If not provided - all points." + ) + with_payload: Optional["WithPayloadInterface"] = Field( + default=None, description="Select which payload to return with the response. Default is true." + ) + with_vector: Optional["WithVector"] = Field( + default=None, description="Scroll request - paginate over all points which matches given condition" + ) + order_by: Optional["OrderByInterface"] = Field(default=None, description="Order the records by a payload field.") + + +class ScrollResult(BaseModel): + """ + Result of the points read request + """ + + points: List["Record"] = Field(..., description="List of retrieved points") + next_page_offset: Optional["ExtendedPointId"] = Field( + default=None, description="Offset which should be used to retrieve a next page result" + ) + + +class SearchGroupsRequest(BaseModel, extra="forbid"): + shard_key: Optional["ShardKeySelector"] = Field( + default=None, + description="Specify in which shards to look for the points, if not specified - look in all shards", + ) + vector: "NamedVectorStruct" = Field(..., description="") + filter: Optional["Filter"] = Field(default=None, description="Look only for points which satisfies this conditions") + params: Optional["SearchParams"] = Field(default=None, description="Additional search params") + with_payload: Optional["WithPayloadInterface"] = Field( + default=None, description="Select which payload to return with the response. Default is false." + ) + with_vector: Optional["WithVector"] = Field( + default=None, description="Options for specifying which vectors to include into response. Default is false." + ) + score_threshold: Optional[float] = Field( + default=None, + description="Define a minimal score threshold for the result. If defined, less similar results will not be returned. Score of the returned result might be higher or smaller than the threshold depending on the Distance function used. E.g. for cosine similarity only higher scores will be returned.", + ) + group_by: str = Field( + ..., + description="Payload field to group by, must be a string or number field. If the field contains more than 1 value, all values will be used for grouping. One point can be in multiple groups.", + ) + group_size: int = Field(..., description="Maximum amount of points to return per group") + limit: int = Field(..., description="Maximum amount of groups to return") + with_lookup: Optional["WithLookupInterface"] = Field( + default=None, description="Look for points in another collection using the group ids" + ) + + +class SearchMatrixOffsetsResponse(BaseModel): + offsets_row: List[int] = Field(..., description="Row indices of the matrix") + offsets_col: List[int] = Field(..., description="Column indices of the matrix") + scores: List[float] = Field(..., description="Scores associated with matrix coordinates") + ids: List["ExtendedPointId"] = Field(..., description="Ids of the points in order") + + +class SearchMatrixPair(BaseModel): + """ + Pair of points (a, b) with score + """ + + a: "ExtendedPointId" = Field(..., description="Pair of points (a, b) with score") + b: "ExtendedPointId" = Field(..., description="Pair of points (a, b) with score") + score: float = Field(..., description="Pair of points (a, b) with score") + + +class SearchMatrixPairsResponse(BaseModel): + pairs: List["SearchMatrixPair"] = Field(..., description="List of pairs of points with scores") + + +class SearchMatrixRequest(BaseModel, extra="forbid"): + shard_key: Optional["ShardKeySelector"] = Field( + default=None, + description="Specify in which shards to look for the points, if not specified - look in all shards", + ) + filter: Optional["Filter"] = Field(default=None, description="Look only for points which satisfies this conditions") + sample: Optional[int] = Field( + default=None, description="How many points to select and search within. Default is 10." + ) + limit: Optional[int] = Field(default=None, description="How many neighbours per sample to find. Default is 3.") + using: Optional[str] = Field( + default=None, + description="Define which vector name to use for querying. If missing, the default vector is used.", + ) + + +class SearchParams(BaseModel, extra="forbid"): + """ + Additional parameters of the search + """ + + hnsw_ef: Optional[int] = Field( + default=None, + description="Params relevant to HNSW index Size of the beam in a beam-search. Larger the value - more accurate the result, more time required for search.", + ) + exact: Optional[bool] = Field( + default=False, + description="Search without approximation. If set to true, search may run long but with exact results.", + ) + quantization: Optional["QuantizationSearchParams"] = Field(default=None, description="Quantization params") + indexed_only: Optional[bool] = Field( + default=False, + description="If enabled, the engine will only perform search among indexed or small segments. Using this option prevents slow searches in case of delayed index, but does not guarantee that all uploaded vectors will be included in search results", + ) + + +class SearchRequest(BaseModel, extra="forbid"): + """ + Search request. Holds all conditions and parameters for the search of most similar points by vector similarity given the filtering restrictions. + """ + + shard_key: Optional["ShardKeySelector"] = Field( + default=None, + description="Specify in which shards to look for the points, if not specified - look in all shards", + ) + vector: "NamedVectorStruct" = Field( + ..., + description="Search request. Holds all conditions and parameters for the search of most similar points by vector similarity given the filtering restrictions.", + ) + filter: Optional["Filter"] = Field(default=None, description="Look only for points which satisfies this conditions") + params: Optional["SearchParams"] = Field(default=None, description="Additional search params") + limit: int = Field(..., description="Max number of result to return") + offset: Optional[int] = Field( + default=None, + description="Offset of the first result to return. May be used to paginate results. Note: large offset values may cause performance issues.", + ) + with_payload: Optional["WithPayloadInterface"] = Field( + default=None, description="Select which payload to return with the response. Default is false." + ) + with_vector: Optional["WithVector"] = Field( + default=None, description="Options for specifying which vectors to include into response. Default is false." + ) + score_threshold: Optional[float] = Field( + default=None, + description="Define a minimal score threshold for the result. If defined, less similar results will not be returned. Score of the returned result might be higher or smaller than the threshold depending on the Distance function used. E.g. for cosine similarity only higher scores will be returned.", + ) + + +class SearchRequestBatch(BaseModel, extra="forbid"): + searches: List["SearchRequest"] = Field(..., description="") + + +class SegmentConfig(BaseModel): + vector_data: Optional[Dict[str, "VectorDataConfig"]] = Field(default={}, description="") + sparse_vector_data: Optional[Dict[str, "SparseVectorDataConfig"]] = Field(default=None, description="") + payload_storage_type: "PayloadStorageType" = Field(..., description="") + + +class SegmentInfo(BaseModel): + """ + Aggregated information about segment + """ + + segment_type: "SegmentType" = Field(..., description="Aggregated information about segment") + num_vectors: int = Field(..., description="Aggregated information about segment") + num_points: int = Field(..., description="Aggregated information about segment") + num_indexed_vectors: int = Field(..., description="Aggregated information about segment") + num_deleted_vectors: int = Field(..., description="Aggregated information about segment") + vectors_size_bytes: int = Field( + ..., + description="An ESTIMATION of effective amount of bytes used for vectors Do NOT rely on this number unless you know what you are doing", + ) + payloads_size_bytes: int = Field( + ..., description="An estimation of the effective amount of bytes used for payloads" + ) + ram_usage_bytes: int = Field(..., description="Aggregated information about segment") + disk_usage_bytes: int = Field(..., description="Aggregated information about segment") + is_appendable: bool = Field(..., description="Aggregated information about segment") + index_schema: Dict[str, "PayloadIndexInfo"] = Field(..., description="Aggregated information about segment") + vector_data: Dict[str, "VectorDataInfo"] = Field(..., description="Aggregated information about segment") + + +class SegmentTelemetry(BaseModel): + info: "SegmentInfo" = Field(..., description="") + config: "SegmentConfig" = Field(..., description="") + vector_index_searches: List["VectorIndexSearchesTelemetry"] = Field(..., description="") + payload_field_indices: List["PayloadIndexTelemetry"] = Field(..., description="") + + +class SegmentType(str, Enum): + """ + Type of segment + """ + + def __str__(self) -> str: + return str(self.value) + + PLAIN = "plain" + INDEXED = "indexed" + SPECIAL = "special" + + +class SetPayload(BaseModel, extra="forbid"): + """ + This data structure is used in API interface and applied across multiple shards + """ + + payload: "Payload" = Field( + ..., description="This data structure is used in API interface and applied across multiple shards" + ) + points: Optional[List["ExtendedPointId"]] = Field( + default=None, description="Assigns payload to each point in this list" + ) + filter: Optional["Filter"] = Field( + default=None, description="Assigns payload to each point that satisfy this filter condition" + ) + shard_key: Optional["ShardKeySelector"] = Field( + default=None, description="This data structure is used in API interface and applied across multiple shards" + ) + key: Optional[str] = Field( + default=None, description="Assigns payload to each point that satisfy this path of property" + ) + + +class SetPayloadOperation(BaseModel, extra="forbid"): + set_payload: "SetPayload" = Field(..., description="") + + +class ShardCleanStatusFailedTelemetry(BaseModel): + reason: str = Field(..., description="") + + +class ShardCleanStatusProgressTelemetry(BaseModel): + deleted_points: int = Field(..., description="") + + +class ShardCleanStatusTelemetryOneOf(str, Enum): + STARTED = "started" + DONE = "done" + CANCELLED = "cancelled" + + +class ShardCleanStatusTelemetryOneOf1(BaseModel): + progress: "ShardCleanStatusProgressTelemetry" = Field(..., description="") + + +class ShardCleanStatusTelemetryOneOf2(BaseModel): + failed: "ShardCleanStatusFailedTelemetry" = Field(..., description="") + + +class ShardSnapshotRecover(BaseModel, extra="forbid"): + location: "ShardSnapshotLocation" = Field(..., description="") + priority: Optional["SnapshotPriority"] = Field(default=None, description="") + checksum: Optional[str] = Field( + default=None, description="Optional SHA256 checksum to verify snapshot integrity before recovery." + ) + api_key: Optional[str] = Field( + default=None, description="Optional API key used when fetching the snapshot from a remote URL." + ) + + +class ShardStatus(str, Enum): + """ + Current state of the shard (supports same states as the collection) `Green` - all good. `Yellow` - optimization is running, 'Grey' - optimizations are possible but not triggered, `Red` - some operations failed and was not recovered + """ + + def __str__(self) -> str: + return str(self.value) + + GREEN = "green" + YELLOW = "yellow" + GREY = "grey" + RED = "red" + + +class ShardTransferInfo(BaseModel): + shard_id: int = Field(..., description="") + to_shard_id: Optional[int] = Field( + default=None, + description="Target shard ID if different than source shard ID Used exclusively with `ReshardStreamRecords` transfer method.", + ) + from_: int = Field(..., description="Source peer id", alias="from") + to: int = Field(..., description="Destination peer id") + sync: bool = Field( + ..., + description="If `true` transfer is a synchronization of a replicas If `false` transfer is a moving of a shard from one peer to another", + ) + method: Optional["ShardTransferMethod"] = Field(default=None, description="") + comment: Optional[str] = Field( + default=None, description="A human-readable report of the transfer progress. Available only on the source peer." + ) + + +class ShardTransferMethodOneOf(str, Enum): + """ + Stream all shard records in batches until the whole shard is transferred. + """ + + def __str__(self) -> str: + return str(self.value) + + STREAM_RECORDS = "stream_records" + + +class ShardTransferMethodOneOf1(str, Enum): + """ + Snapshot the shard, transfer and restore it on the receiver. + """ + + def __str__(self) -> str: + return str(self.value) + + SNAPSHOT = "snapshot" + + +class ShardTransferMethodOneOf2(str, Enum): + """ + Attempt to transfer shard difference by WAL delta. + """ + + def __str__(self) -> str: + return str(self.value) + + WAL_DELTA = "wal_delta" + + +class ShardTransferMethodOneOf3(str, Enum): + """ + Shard transfer for resharding: stream all records in batches until all points are transferred. + """ + + def __str__(self) -> str: + return str(self.value) + + RESHARDING_STREAM_RECORDS = "resharding_stream_records" + + +class ShardingMethod(str, Enum): + AUTO = "auto" + CUSTOM = "custom" + + +class SnapshotDescription(BaseModel): + name: str = Field(..., description="") + creation_time: Optional[str] = Field(default=None, description="") + size: int = Field(..., description="") + checksum: Optional[str] = Field(default=None, description="") + + +class SnapshotPriority(str, Enum): + """ + Defines source of truth for snapshot recovery: `NoSync` means - restore snapshot without *any* additional synchronization. `Snapshot` means - prefer snapshot data over the current state. `Replica` means - prefer existing data over the snapshot. + """ + + def __str__(self) -> str: + return str(self.value) + + NO_SYNC = "no_sync" + SNAPSHOT = "snapshot" + REPLICA = "replica" + + +class SnapshotRecover(BaseModel, extra="forbid"): + location: str = Field( + ..., + description="Examples: - URL `http://localhost:8080/collections/my_collection/snapshots/my_snapshot` - Local path `file:///qdrant/snapshots/test_collection-2022-08-04-10-49-10.snapshot`", + ) + priority: Optional["SnapshotPriority"] = Field( + default=None, + description="Defines which data should be used as a source of truth if there are other replicas in the cluster. If set to `Snapshot`, the snapshot will be used as a source of truth, and the current state will be overwritten. If set to `Replica`, the current state will be used as a source of truth, and after recovery if will be synchronized with the snapshot.", + ) + checksum: Optional[str] = Field( + default=None, description="Optional SHA256 checksum to verify snapshot integrity before recovery." + ) + api_key: Optional[str] = Field( + default=None, description="Optional API key used when fetching the snapshot from a remote URL." + ) + + +class Snowball(str, Enum): + SNOWBALL = "snowball" + + +class SnowballLanguage(str, Enum): + """ + Languages supported by snowball stemmer. + """ + + def __str__(self) -> str: + return str(self.value) + + ARABIC = "arabic" + ARMENIAN = "armenian" + DANISH = "danish" + DUTCH = "dutch" + ENGLISH = "english" + FINNISH = "finnish" + FRENCH = "french" + GERMAN = "german" + GREEK = "greek" + HUNGARIAN = "hungarian" + ITALIAN = "italian" + NORWEGIAN = "norwegian" + PORTUGUESE = "portuguese" + ROMANIAN = "romanian" + RUSSIAN = "russian" + SPANISH = "spanish" + SWEDISH = "swedish" + TAMIL = "tamil" + TURKISH = "turkish" + + +class SnowballParams(BaseModel, extra="forbid"): + type: "Snowball" = Field(..., description="") + language: "SnowballLanguage" = Field(..., description="") + + +class SparseIndexConfig(BaseModel): + """ + Configuration for sparse inverted index. + """ + + full_scan_threshold: Optional[int] = Field( + default=None, + description="We prefer a full scan search upto (excluding) this number of vectors. Note: this is number of vectors, not KiloBytes.", + ) + index_type: "SparseIndexType" = Field(..., description="Configuration for sparse inverted index.") + datatype: Optional["VectorStorageDatatype"] = Field( + default=None, description="Datatype used to store weights in the index." + ) + + +class SparseIndexParams(BaseModel, extra="forbid"): + """ + Configuration for sparse inverted index. + """ + + full_scan_threshold: Optional[int] = Field( + default=None, + description="We prefer a full scan search upto (excluding) this number of vectors. Note: this is number of vectors, not KiloBytes.", + ) + on_disk: Optional[bool] = Field( + default=None, + description="Store index on disk. If set to false, the index will be stored in RAM. Default: false", + ) + datatype: Optional["Datatype"] = Field( + default=None, + description="Defines which datatype should be used for the index. Choosing different datatypes allows to optimize memory usage and performance vs accuracy. - For `float32` datatype - vectors are stored as single-precision floating point numbers, 4 bytes. - For `float16` datatype - vectors are stored as half-precision floating point numbers, 2 bytes. - For `uint8` datatype - vectors are quantized to unsigned 8-bit integers, 1 byte. Quantization to fit byte range `[0, 255]` happens during indexing automatically, so the actual vector data does not need to conform to this range.", + ) + + +class SparseIndexTypeOneOf(str, Enum): + """ + Mutable RAM sparse index + """ + + def __str__(self) -> str: + return str(self.value) + + MUTABLERAM = "MutableRam" + + +class SparseIndexTypeOneOf1(str, Enum): + """ + Immutable RAM sparse index + """ + + def __str__(self) -> str: + return str(self.value) + + IMMUTABLERAM = "ImmutableRam" + + +class SparseIndexTypeOneOf2(str, Enum): + """ + Mmap sparse index + """ + + def __str__(self) -> str: + return str(self.value) + + MMAP = "Mmap" + + +class SparseVector(BaseModel, extra="forbid"): + """ + Sparse vector structure + """ + + indices: List[int] = Field(..., description="Indices must be unique") + values: List[float] = Field(..., description="Values and indices must be the same length") + + +class SparseVectorDataConfig(BaseModel): + """ + Config of single sparse vector data storage + """ + + index: "SparseIndexConfig" = Field(..., description="Config of single sparse vector data storage") + storage_type: Optional["SparseVectorStorageType"] = Field( + default=None, description="Config of single sparse vector data storage" + ) + + +class SparseVectorParams(BaseModel, extra="forbid"): + """ + Params of single sparse vector data storage + """ + + index: Optional["SparseIndexParams"] = Field( + default=None, description="Custom params for index. If none - values from collection configuration are used." + ) + modifier: Optional["Modifier"] = Field( + default=None, description="Configures addition value modifications for sparse vectors. Default: none" + ) + + +class SparseVectorStorageTypeOneOf(str, Enum): + """ + Storage on disk (rocksdb storage) + """ + + def __str__(self) -> str: + return str(self.value) + + ON_DISK = "on_disk" + + +class SparseVectorStorageTypeOneOf1(str, Enum): + """ + Storage in memory maps (gridstore storage) + """ + + def __str__(self) -> str: + return str(self.value) + + MMAP = "mmap" + + +class SqrtExpression(BaseModel, extra="forbid"): + sqrt: "Expression" = Field(..., description="") + + +class StartResharding(BaseModel, extra="forbid"): + direction: "ReshardingDirection" = Field(..., description="") + peer_id: Optional[int] = Field(default=None, description="") + shard_key: Optional["ShardKey"] = Field(default=None, description="") + + +class StartReshardingOperation(BaseModel, extra="forbid"): + start_resharding: "StartResharding" = Field(..., description="") + + +class StateRole(str, Enum): + """ + Role of the peer in the consensus + """ + + def __str__(self) -> str: + return str(self.value) + + FOLLOWER = "Follower" + CANDIDATE = "Candidate" + LEADER = "Leader" + PRECANDIDATE = "PreCandidate" + + +class StopwordsSet(BaseModel, extra="forbid"): + languages: Optional[List["Language"]] = Field(default=None, description="") + custom: Optional[List[str]] = Field(default=None, description="") + + +class StrictModeConfig(BaseModel, extra="forbid"): + enabled: Optional[bool] = Field(default=None, description="Whether strict mode is enabled for a collection or not.") + max_query_limit: Optional[int] = Field( + default=None, description="Max allowed `limit` parameter for all APIs that don't have their own max limit." + ) + max_timeout: Optional[int] = Field(default=None, description="Max allowed `timeout` parameter.") + unindexed_filtering_retrieve: Optional[bool] = Field( + default=None, description="Allow usage of unindexed fields in retrieval based (e.g. search) filters." + ) + unindexed_filtering_update: Optional[bool] = Field( + default=None, description="Allow usage of unindexed fields in filtered updates (e.g. delete by payload)." + ) + search_max_hnsw_ef: Optional[int] = Field(default=None, description="Max HNSW value allowed in search parameters.") + search_allow_exact: Optional[bool] = Field(default=None, description="Whether exact search is allowed or not.") + search_max_oversampling: Optional[float] = Field( + default=None, description="Max oversampling value allowed in search." + ) + upsert_max_batchsize: Optional[int] = Field(default=None, description="Max batchsize when upserting") + max_collection_vector_size_bytes: Optional[int] = Field( + default=None, description="Max size of a collections vector storage in bytes, ignoring replicas." + ) + read_rate_limit: Optional[int] = Field( + default=None, description="Max number of read operations per minute per replica" + ) + write_rate_limit: Optional[int] = Field( + default=None, description="Max number of write operations per minute per replica" + ) + max_collection_payload_size_bytes: Optional[int] = Field( + default=None, description="Max size of a collections payload storage in bytes" + ) + max_points_count: Optional[int] = Field(default=None, description="Max number of points estimated in a collection") + filter_max_conditions: Optional[int] = Field(default=None, description="Max conditions a filter can have.") + condition_max_size: Optional[int] = Field( + default=None, description="Max size of a condition, eg. items in `MatchAny`." + ) + multivector_config: Optional["StrictModeMultivectorConfig"] = Field( + default=None, description="Multivector configuration" + ) + sparse_config: Optional["StrictModeSparseConfig"] = Field(default=None, description="Sparse vector configuration") + + +class StrictModeConfigOutput(BaseModel): + enabled: Optional[bool] = Field(default=None, description="Whether strict mode is enabled for a collection or not.") + max_query_limit: Optional[int] = Field( + default=None, description="Max allowed `limit` parameter for all APIs that don't have their own max limit." + ) + max_timeout: Optional[int] = Field(default=None, description="Max allowed `timeout` parameter.") + unindexed_filtering_retrieve: Optional[bool] = Field( + default=None, description="Allow usage of unindexed fields in retrieval based (e.g. search) filters." + ) + unindexed_filtering_update: Optional[bool] = Field( + default=None, description="Allow usage of unindexed fields in filtered updates (e.g. delete by payload)." + ) + search_max_hnsw_ef: Optional[int] = Field(default=None, description="Max HNSW value allowed in search parameters.") + search_allow_exact: Optional[bool] = Field(default=None, description="Whether exact search is allowed or not.") + search_max_oversampling: Optional[float] = Field( + default=None, description="Max oversampling value allowed in search." + ) + upsert_max_batchsize: Optional[int] = Field(default=None, description="Max batchsize when upserting") + max_collection_vector_size_bytes: Optional[int] = Field( + default=None, description="Max size of a collections vector storage in bytes, ignoring replicas." + ) + read_rate_limit: Optional[int] = Field( + default=None, description="Max number of read operations per minute per replica" + ) + write_rate_limit: Optional[int] = Field( + default=None, description="Max number of write operations per minute per replica" + ) + max_collection_payload_size_bytes: Optional[int] = Field( + default=None, description="Max size of a collections payload storage in bytes" + ) + max_points_count: Optional[int] = Field(default=None, description="Max number of points estimated in a collection") + filter_max_conditions: Optional[int] = Field(default=None, description="Max conditions a filter can have.") + condition_max_size: Optional[int] = Field( + default=None, description="Max size of a condition, eg. items in `MatchAny`." + ) + multivector_config: Optional["StrictModeMultivectorConfigOutput"] = Field( + default=None, description="Multivector configuration" + ) + sparse_config: Optional["StrictModeSparseConfigOutput"] = Field( + default=None, description="Sparse vector configuration" + ) + + +class StrictModeMultivector(BaseModel, extra="forbid"): + max_vectors: Optional[int] = Field(default=None, description="Max number of vectors in a multivector") + + +class StrictModeMultivectorOutput(BaseModel): + max_vectors: Optional[int] = Field(default=None, description="Max number of vectors in a multivector") + + +class StrictModeSparse(BaseModel, extra="forbid"): + max_length: Optional[int] = Field(default=None, description="Max length of sparse vector") + + +class StrictModeSparseOutput(BaseModel): + max_length: Optional[int] = Field(default=None, description="Max length of sparse vector") + + +class SumExpression(BaseModel, extra="forbid"): + sum: List["Expression"] = Field(..., description="") + + +class TelemetryData(BaseModel): + id: str = Field(..., description="") + app: "AppBuildTelemetry" = Field(..., description="") + collections: "CollectionsTelemetry" = Field(..., description="") + cluster: Optional["ClusterTelemetry"] = Field(default=None, description="") + requests: Optional["RequestsTelemetry"] = Field(default=None, description="") + memory: Optional["MemoryTelemetry"] = Field(default=None, description="") + hardware: Optional["HardwareTelemetry"] = Field(default=None, description="") + + +class TextIndexParams(BaseModel, extra="forbid"): + type: "TextIndexType" = Field(..., description="") + tokenizer: Optional["TokenizerType"] = Field(default=None, description="") + min_token_len: Optional[int] = Field(default=None, description="Minimum characters to be tokenized.") + max_token_len: Optional[int] = Field(default=None, description="Maximum characters to be tokenized.") + lowercase: Optional[bool] = Field(default=None, description="If true, lowercase all tokens. Default: true.") + phrase_matching: Optional[bool] = Field( + default=None, description="If true, support phrase matching. Default: false." + ) + stopwords: Optional["StopwordsInterface"] = Field( + default=None, + description="Ignore this set of tokens. Can select from predefined languages and/or provide a custom set.", + ) + on_disk: Optional[bool] = Field(default=None, description="If true, store the index on disk. Default: false.") + stemmer: Optional["StemmingAlgorithm"] = Field( + default=None, description="Algorithm for stemming. Default: disabled." + ) + + +class TextIndexType(str, Enum): + TEXT = "text" + + +class TokenizerType(str, Enum): + PREFIX = "prefix" + WHITESPACE = "whitespace" + WORD = "word" + MULTILINGUAL = "multilingual" + + +class TrackerStatusOneOf(str, Enum): + OPTIMIZING = "optimizing" + DONE = "done" + + +class TrackerStatusOneOf1(BaseModel): + cancelled: str = Field(..., description="") + + +class TrackerStatusOneOf2(BaseModel): + error: str = Field(..., description="") + + +class TrackerTelemetry(BaseModel): + """ + Tracker object used in telemetry + """ + + name: str = Field(..., description="Name of the optimizer") + segment_ids: List[int] = Field(..., description="Segment IDs being optimized") + status: "TrackerStatus" = Field(..., description="Tracker object used in telemetry") + start_at: Union[datetime, date] = Field(..., description="Start time of the optimizer") + end_at: Optional[Union[datetime, date]] = Field(default=None, description="End time of the optimizer") + + +class UpdateCollection(BaseModel, extra="forbid"): + """ + Operation for updating parameters of the existing collection + """ + + vectors: Optional["VectorsConfigDiff"] = Field( + default=None, + description="Map of vector data parameters to update for each named vector. To update parameters in a collection having a single unnamed vector, use an empty string as name.", + ) + optimizers_config: Optional["OptimizersConfigDiff"] = Field( + default=None, + description="Custom params for Optimizers. If none - it is left unchanged. This operation is blocking, it will only proceed once all current optimizations are complete", + ) + params: Optional["CollectionParamsDiff"] = Field( + default=None, description="Collection base params. If none - it is left unchanged." + ) + hnsw_config: Optional["HnswConfigDiff"] = Field( + default=None, description="HNSW parameters to update for the collection index. If none - it is left unchanged." + ) + quantization_config: Optional["QuantizationConfigDiff"] = Field( + default=None, description="Quantization parameters to update. If none - it is left unchanged." + ) + sparse_vectors: Optional["SparseVectorsConfig"] = Field( + default=None, description="Map of sparse vector data parameters to update for each sparse vector." + ) + strict_mode_config: Optional["StrictModeConfig"] = Field( + default=None, description="Operation for updating parameters of the existing collection" + ) + + +class UpdateOperations(BaseModel, extra="forbid"): + operations: List["UpdateOperation"] = Field(..., description="") + + +class UpdateResult(BaseModel): + operation_id: Optional[int] = Field(default=None, description="Sequential number of the operation") + status: "UpdateStatus" = Field(..., description="") + + +class UpdateStatus(str, Enum): + """ + `Acknowledged` - Request is saved to WAL and will be process in a queue. `Completed` - Request is completed, changes are actual. + """ + + def __str__(self) -> str: + return str(self.value) + + ACKNOWLEDGED = "acknowledged" + COMPLETED = "completed" + + +class UpdateVectors(BaseModel, extra="forbid"): + points: List["PointVectors"] = Field(..., description="Points with named vectors") + shard_key: Optional["ShardKeySelector"] = Field(default=None, description="") + + +class UpdateVectorsOperation(BaseModel, extra="forbid"): + update_vectors: "UpdateVectors" = Field(..., description="") + + +class UpsertOperation(BaseModel, extra="forbid"): + upsert: "PointInsertOperations" = Field(..., description="") + + +class Usage(BaseModel): + """ + Usage of the hardware resources, spent to process the request + """ + + hardware: Optional["HardwareUsage"] = Field( + default=None, description="Usage of the hardware resources, spent to process the request" + ) + inference: Optional["InferenceUsage"] = Field( + default=None, description="Usage of the hardware resources, spent to process the request" + ) + + +class UuidIndexParams(BaseModel, extra="forbid"): + type: "UuidIndexType" = Field(..., description="") + is_tenant: Optional[bool] = Field(default=None, description="If true - used for tenant optimization.") + on_disk: Optional[bool] = Field(default=None, description="If true, store the index on disk. Default: false.") + + +class UuidIndexType(str, Enum): + UUID = "uuid" + + +class ValuesCount(BaseModel, extra="forbid"): + """ + Values count filter request + """ + + lt: Optional[int] = Field(default=None, description="point.key.length() < values_count.lt") + gt: Optional[int] = Field(default=None, description="point.key.length() > values_count.gt") + gte: Optional[int] = Field(default=None, description="point.key.length() >= values_count.gte") + lte: Optional[int] = Field(default=None, description="point.key.length() <= values_count.lte") + + +class VectorDataConfig(BaseModel): + """ + Config of single vector data storage + """ + + size: int = Field(..., description="Size/dimensionality of the vectors used") + distance: "Distance" = Field(..., description="Config of single vector data storage") + storage_type: "VectorStorageType" = Field(..., description="Config of single vector data storage") + index: "Indexes" = Field(..., description="Config of single vector data storage") + quantization_config: Optional["QuantizationConfig"] = Field( + default=None, description="Vector specific quantization config that overrides collection config" + ) + multivector_config: Optional["MultiVectorConfig"] = Field( + default=None, description="Vector specific configuration to enable multiple vectors per point" + ) + datatype: Optional["VectorStorageDatatype"] = Field( + default=None, description="Vector specific configuration to set specific storage element type" + ) + + +class VectorDataInfo(BaseModel): + num_vectors: int = Field(..., description="") + num_indexed_vectors: int = Field(..., description="") + num_deleted_vectors: int = Field(..., description="") + + +class VectorIndexSearchesTelemetry(BaseModel): + index_name: Optional[str] = Field(default=None, description="") + unfiltered_plain: "OperationDurationStatistics" = Field(..., description="") + unfiltered_hnsw: "OperationDurationStatistics" = Field(..., description="") + unfiltered_sparse: "OperationDurationStatistics" = Field(..., description="") + filtered_plain: "OperationDurationStatistics" = Field(..., description="") + filtered_small_cardinality: "OperationDurationStatistics" = Field(..., description="") + filtered_large_cardinality: "OperationDurationStatistics" = Field(..., description="") + filtered_exact: "OperationDurationStatistics" = Field(..., description="") + filtered_sparse: "OperationDurationStatistics" = Field(..., description="") + unfiltered_exact: "OperationDurationStatistics" = Field(..., description="") + + +class VectorParams(BaseModel, extra="forbid"): + """ + Params of single vector data storage + """ + + size: int = Field(..., description="Size of a vectors used") + distance: "Distance" = Field(..., description="Params of single vector data storage") + hnsw_config: Optional["HnswConfigDiff"] = Field( + default=None, + description="Custom params for HNSW index. If none - values from collection configuration are used.", + ) + quantization_config: Optional["QuantizationConfig"] = Field( + default=None, + description="Custom params for quantization. If none - values from collection configuration are used.", + ) + on_disk: Optional[bool] = Field( + default=None, + description="If true, vectors are served from disk, improving RAM usage at the cost of latency Default: false", + ) + datatype: Optional["Datatype"] = Field( + default=None, + description="Defines which datatype should be used to represent vectors in the storage. Choosing different datatypes allows to optimize memory usage and performance vs accuracy. - For `float32` datatype - vectors are stored as single-precision floating point numbers, 4 bytes. - For `float16` datatype - vectors are stored as half-precision floating point numbers, 2 bytes. - For `uint8` datatype - vectors are stored as unsigned 8-bit integers, 1 byte. It expects vector elements to be in range `[0, 255]`.", + ) + multivector_config: Optional["MultiVectorConfig"] = Field( + default=None, description="Params of single vector data storage" + ) + + +class VectorParamsDiff(BaseModel, extra="forbid"): + hnsw_config: Optional["HnswConfigDiff"] = Field( + default=None, description="Update params for HNSW index. If empty object - it will be unset." + ) + quantization_config: Optional["QuantizationConfigDiff"] = Field( + default=None, description="Update params for quantization. If none - it is left unchanged." + ) + on_disk: Optional[bool] = Field( + default=None, description="If true, vectors are served from disk, improving RAM usage at the cost of latency" + ) + + +class VectorStorageDatatype(str, Enum): + """ + Storage types for vectors + """ + + def __str__(self) -> str: + return str(self.value) + + FLOAT32 = "float32" + FLOAT16 = "float16" + UINT8 = "uint8" + + +class VectorStorageTypeOneOf(str, Enum): + """ + Storage in memory (RAM) Will be very fast at the cost of consuming a lot of memory. + """ + + def __str__(self) -> str: + return str(self.value) + + MEMORY = "Memory" + + +class VectorStorageTypeOneOf1(str, Enum): + """ + Storage in mmap file, not appendable Search performance is defined by disk speed and the fraction of vectors that fit in memory. + """ + + def __str__(self) -> str: + return str(self.value) + + MMAP = "Mmap" + + +class VectorStorageTypeOneOf2(str, Enum): + """ + Storage in chunked mmap files, appendable Search performance is defined by disk speed and the fraction of vectors that fit in memory. + """ + + def __str__(self) -> str: + return str(self.value) + + CHUNKEDMMAP = "ChunkedMmap" + + +class VectorStorageTypeOneOf3(str, Enum): + """ + Same as `ChunkedMmap`, but vectors are forced to be locked in RAM In this way we avoid cold requests to disk, but risk to run out of memory Designed as a replacement for `Memory`, which doesn't depend on RocksDB + """ + + def __str__(self) -> str: + return str(self.value) + + INRAMCHUNKEDMMAP = "InRamChunkedMmap" + + +class VersionInfo(BaseModel): + title: str = Field(..., description="") + version: str = Field(..., description="") + commit: Optional[str] = Field(default=None, description="") + + +class WalConfig(BaseModel): + wal_capacity_mb: int = Field(..., description="Size of a single WAL segment in MB") + wal_segments_ahead: int = Field(..., description="Number of WAL segments to create ahead of actually used ones") + + +class WalConfigDiff(BaseModel, extra="forbid"): + wal_capacity_mb: Optional[int] = Field(default=None, description="Size of a single WAL segment in MB") + wal_segments_ahead: Optional[int] = Field( + default=None, description="Number of WAL segments to create ahead of actually used ones" + ) + + +class WebApiTelemetry(BaseModel): + responses: Dict[str, Dict[str, "OperationDurationStatistics"]] = Field(..., description="") + + +class WithLookup(BaseModel, extra="forbid"): + collection: str = Field(..., description="Name of the collection to use for points lookup") + with_payload: Optional["WithPayloadInterface"] = Field( + default=None, description="Options for specifying which payload to include (or not)" + ) + with_vectors: Optional["WithVector"] = Field( + default=None, description="Options for specifying which vectors to include (or not)" + ) + + +class WriteOrdering(str, Enum): + """ + Defines write ordering guarantees for collection operations * `weak` - write operations may be reordered, works faster, default * `medium` - write operations go through dynamically selected leader, may be inconsistent for a short period of time in case of leader change * `strong` - Write operations go through the permanent leader, consistent, but may be unavailable if leader is down + """ + + def __str__(self) -> str: + return str(self.value) + + WEAK = "weak" + MEDIUM = "medium" + STRONG = "strong" + + +AliasOperations = Union[ + CreateAliasOperation, + DeleteAliasOperation, + RenameAliasOperation, +] +AnyVariants = Union[ + List[StrictStr], + List[StrictInt], +] +ClusterOperations = Union[ + MoveShardOperation, + ReplicateShardOperation, + AbortTransferOperation, + DropReplicaOperation, + CreateShardingKeyOperation, + DropShardingKeyOperation, + RestartTransferOperation, + StartReshardingOperation, + AbortReshardingOperation, +] +ClusterStatus = Union[ + ClusterStatusOneOf, + ClusterStatusOneOf1, +] +CollectionTelemetryEnum = Union[ + CollectionTelemetry, + CollectionsAggregatedTelemetry, +] +Condition = Union[ + FieldCondition, + IsEmptyCondition, + IsNullCondition, + HasIdCondition, + HasVectorCondition, + NestedCondition, + Filter, +] +ConsensusThreadStatus = Union[ + ConsensusThreadStatusOneOf, + ConsensusThreadStatusOneOf1, + ConsensusThreadStatusOneOf2, +] +ContextInput = Union[ + ContextPair, + List[ContextPair], +] +ExtendedPointId = Union[ + StrictInt, + StrictStr, +] +FacetValue = Union[ + StrictBool, + StrictInt, + StrictStr, +] +GroupId = Union[ + StrictInt, + StrictStr, +] +Indexes = Union[ + IndexesOneOf, + IndexesOneOf1, +] +Match = Union[ + MatchValue, + MatchText, + MatchPhrase, + MatchAny, + MatchExcept, +] +MaxOptimizationThreads = Union[ + StrictInt, + MaxOptimizationThreadsSetting, +] +NamedVectorStruct = Union[ + List[StrictFloat], + NamedVector, + NamedSparseVector, +] +OptimizersStatus = Union[ + OptimizersStatusOneOf, + OptimizersStatusOneOf1, +] +OrderByInterface = Union[ + StrictStr, + OrderBy, +] +OrderValue = Union[ + StrictInt, + StrictFloat, +] +PayloadSchemaParams = Union[ + KeywordIndexParams, + IntegerIndexParams, + FloatIndexParams, + GeoIndexParams, + TextIndexParams, + BoolIndexParams, + DatetimeIndexParams, + UuidIndexParams, +] +PayloadSelector = Union[ + PayloadSelectorInclude, + PayloadSelectorExclude, +] +PayloadStorageType = Union[ + PayloadStorageTypeOneOf, + PayloadStorageTypeOneOf1, + PayloadStorageTypeOneOf2, + PayloadStorageTypeOneOf3, +] +PointInsertOperations = Union[ + PointsBatch, + PointsList, +] +PointsSelector = Union[ + PointIdsList, + FilterSelector, +] +QuantizationConfig = Union[ + ScalarQuantization, + ProductQuantization, + BinaryQuantization, +] +QuantizationConfigDiff = Union[ + ScalarQuantization, + ProductQuantization, + BinaryQuantization, + Disabled, +] +Query = Union[ + NearestQuery, + RecommendQuery, + DiscoverQuery, + ContextQuery, + OrderByQuery, + FusionQuery, + FormulaQuery, + SampleQuery, +] +RangeInterface = Union[ + Range, + DatetimeRange, +] +ReadConsistency = Union[ + StrictInt, + ReadConsistencyType, +] +ReshardingDirection = Union[ + ReshardingDirectionOneOf, + ReshardingDirectionOneOf1, +] +ShardCleanStatusTelemetry = Union[ + ShardCleanStatusTelemetryOneOf, + ShardCleanStatusTelemetryOneOf1, + ShardCleanStatusTelemetryOneOf2, +] +ShardKey = Union[ + StrictInt, + StrictStr, +] +ShardSnapshotLocation = Union[ + StrictStr, +] +ShardTransferMethod = Union[ + ShardTransferMethodOneOf, + ShardTransferMethodOneOf1, + ShardTransferMethodOneOf2, + ShardTransferMethodOneOf3, +] +SparseIndexType = Union[ + SparseIndexTypeOneOf, + SparseIndexTypeOneOf1, + SparseIndexTypeOneOf2, +] +SparseVectorStorageType = Union[ + SparseVectorStorageTypeOneOf, + SparseVectorStorageTypeOneOf1, +] +StartFrom = Union[ + StrictInt, + StrictFloat, + datetime, + date, +] +StemmingAlgorithm = Union[ + SnowballParams, +] +StopwordsInterface = Union[ + Language, + StopwordsSet, +] +TrackerStatus = Union[ + TrackerStatusOneOf, + TrackerStatusOneOf1, + TrackerStatusOneOf2, +] +UpdateOperation = Union[ + UpsertOperation, + DeleteOperation, + SetPayloadOperation, + OverwritePayloadOperation, + DeletePayloadOperation, + ClearPayloadOperation, + UpdateVectorsOperation, + DeleteVectorsOperation, +] +UsingVector = Union[ + StrictStr, +] +ValueVariants = Union[ + StrictBool, + StrictInt, + StrictStr, +] +Vector = Union[ + List[StrictFloat], + SparseVector, + List[List[StrictFloat]], + Document, + Image, + InferenceObject, +] +VectorOutput = Union[ + List[StrictFloat], + SparseVector, + List[List[StrictFloat]], +] +VectorStorageType = Union[ + VectorStorageTypeOneOf, + VectorStorageTypeOneOf1, + VectorStorageTypeOneOf2, + VectorStorageTypeOneOf3, +] +VectorsConfig = Union[ + VectorParams, + Dict[StrictStr, VectorParams], +] +WithLookupInterface = Union[ + StrictStr, + WithLookup, +] +WithVector = Union[ + StrictBool, + List[StrictStr], +] +BatchVectorStruct = Union[ + List[List[StrictFloat]], + List[List[List[StrictFloat]]], + Dict[StrictStr, List[Vector]], + List[Document], + List[Image], + List[InferenceObject], +] +Expression = Union[ + StrictFloat, + StrictStr, + Condition, + GeoDistance, + DatetimeExpression, + DatetimeKeyExpression, + MultExpression, + SumExpression, + NegExpression, + AbsExpression, + DivExpression, + SqrtExpression, + PowExpression, + ExpExpression, + Log10Expression, + LnExpression, + LinDecayExpression, + ExpDecayExpression, + GaussDecayExpression, +] +PayloadFieldSchema = Union[ + PayloadSchemaType, + PayloadSchemaParams, +] +RecommendExample = Union[ + ExtendedPointId, + List[StrictFloat], + SparseVector, +] +ShardKeySelector = Union[ + ShardKey, + List[ShardKey], +] +VectorInput = Union[ + List[StrictFloat], + SparseVector, + List[List[StrictFloat]], + ExtendedPointId, + Document, + Image, + InferenceObject, +] +VectorStruct = Union[ + List[StrictFloat], + List[List[StrictFloat]], + Dict[StrictStr, Vector], + Document, + Image, + InferenceObject, +] +VectorStructOutput = Union[ + List[StrictFloat], + List[List[StrictFloat]], + Dict[StrictStr, VectorOutput], +] +WithPayloadInterface = Union[ + StrictBool, + List[StrictStr], + PayloadSelector, +] +QueryInterface = Union[ + VectorInput, + Query, +] diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/hybrid/__init__.py b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/hybrid/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/hybrid/__pycache__/__init__.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/hybrid/__pycache__/__init__.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..eca420e07327a1d3737224fb92d9bf6ecf5588fd Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/hybrid/__pycache__/__init__.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/hybrid/__pycache__/formula.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/hybrid/__pycache__/formula.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..ecc18860c4d2fc27b78564217c44a05fb18ebb44 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/hybrid/__pycache__/formula.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/hybrid/__pycache__/fusion.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/hybrid/__pycache__/fusion.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..643261fcb39ac2d2c6c8692be82a7c06643ed2fa Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/hybrid/__pycache__/fusion.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/hybrid/__pycache__/test_reranking.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/hybrid/__pycache__/test_reranking.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c6c6e27a10b968917c3b03983c79527d8ccb9777 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/hybrid/__pycache__/test_reranking.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/hybrid/formula.py b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/hybrid/formula.py new file mode 100644 index 0000000000000000000000000000000000000000..bc3aed374731bbd39bb0070a8c79ff964a848901 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/hybrid/formula.py @@ -0,0 +1,370 @@ +import math + + +from qdrant_client.conversions.common_types import get_args_subscribed +from qdrant_client.http import models +from typing import Union, Any, Tuple + +from qdrant_client.local import datetime_utils +from qdrant_client.local.geo import geo_distance +from qdrant_client.local.payload_filters import check_condition +from qdrant_client.local.payload_value_extractor import value_by_key + +DEFAULT_SCORE = 0.0 +DEFAULT_DECAY_TARGET = 0.0 +DEFAULT_DECAY_MIDPOINT = 0.5 +DEFAULT_DECAY_SCALE = 1.0 + + +def evaluate_expression( + expression: models.Expression, + point_id: models.ExtendedPointId, + scores: list[dict[models.ExtendedPointId, float]], + payload: models.Payload, + has_vector: dict[str, bool], + defaults: dict[str, Any], +) -> float: + if isinstance(expression, (float, int)): # Constant + return float(expression) + + elif isinstance(expression, str): # Variable + return evaluate_variable(expression, point_id, scores, payload, defaults) + + elif isinstance(expression, get_args_subscribed(models.Condition)): + if check_condition(expression, payload, point_id, has_vector): # type: ignore + return 1.0 + return 0.0 + + elif isinstance(expression, models.MultExpression): + factors: list[float] = [] + + for expr in expression.mult: + factor = evaluate_expression(expr, point_id, scores, payload, has_vector, defaults) + # Return early if any factor is zero + if factor == 0.0: + return factor + + factors.append(factor) + + return math.prod(factors) + + elif isinstance(expression, models.SumExpression): + return sum( + evaluate_expression(expr, point_id, scores, payload, has_vector, defaults) + for expr in expression.sum + ) + + elif isinstance(expression, models.NegExpression): + value = evaluate_expression( + expression.neg, point_id, scores, payload, has_vector, defaults + ) + return -value + + elif isinstance(expression, models.AbsExpression): + return abs( + evaluate_expression(expression.abs, point_id, scores, payload, has_vector, defaults) + ) + + elif isinstance(expression, models.DivExpression): + left = evaluate_expression( + expression.div.left, point_id, scores, payload, has_vector, defaults + ) + + if left == 0.0: + return left + + right = evaluate_expression( + expression.div.right, point_id, scores, payload, has_vector, defaults + ) + + if right == 0.0: + if expression.div.by_zero_default is not None: + return expression.div.by_zero_default + raise_non_finite_error(f"{left}/{right}") + + result = left / right + if math.isfinite(result): + return result + + raise_non_finite_error(f"{left}/{right}") + + elif isinstance(expression, models.SqrtExpression): + value = evaluate_expression( + expression.sqrt, point_id, scores, payload, has_vector, defaults + ) + + if value >= 0: + return math.sqrt(value) + + raise_non_finite_error(f"√{value}") + + elif isinstance(expression, models.PowExpression): + base = evaluate_expression( + expression.pow.base, point_id, scores, payload, has_vector, defaults + ) + exponent = evaluate_expression( + expression.pow.exponent, point_id, scores, payload, has_vector, defaults + ) + + # Check for valid input + if base >= 0 or (base != 0 and exponent.is_integer()): + try: + return math.pow(base, exponent) + except OverflowError: + pass + + raise_non_finite_error(f"{base}^{exponent}") + + elif isinstance(expression, models.ExpExpression): + value = evaluate_expression( + expression.exp, point_id, scores, payload, has_vector, defaults + ) + + try: + return math.exp(value) + except OverflowError: + raise_non_finite_error(f"exp({value})") + + elif isinstance(expression, models.Log10Expression): + value = evaluate_expression( + expression.log10, point_id, scores, payload, has_vector, defaults + ) + + if value > 0: + try: + return math.log10(value) + except OverflowError: + pass + + raise_non_finite_error(f"log10({value})") + + elif isinstance(expression, models.LnExpression): + value = evaluate_expression(expression.ln, point_id, scores, payload, has_vector, defaults) + + if value > 0: + try: + return math.log(value) + except OverflowError: + pass + + raise_non_finite_error(f"ln({value})") + + elif isinstance(expression, models.GeoDistance): + origin = expression.geo_distance.origin + to = expression.geo_distance.to + + # Get value from payload + geo_value = try_extract_payload_value(to, payload, defaults) + + if isinstance(geo_value, dict): + # let this fail if it is not a valid geo point + destination = models.GeoPoint(**geo_value) + return geo_distance(origin.lon, origin.lat, destination.lon, destination.lat) + + raise ValueError( + f"Expected geo point for {to} in the payload and/or in the formula defaults." + ) + + elif isinstance(expression, models.DatetimeExpression): + # try to parse as datetime + dt = datetime_utils.parse(expression.datetime) + if dt is None: + raise ValueError(f"Expected datetime in supported format for {expression.datetime}") + + return dt.timestamp() + + elif isinstance(expression, models.DatetimeKeyExpression): + dt_str = try_extract_payload_value(expression.datetime_key, payload, defaults) + dt = datetime_utils.parse(dt_str) + if dt is None: + raise ValueError( + f"Expected datetime for {expression.datetime_key} in the payload and/or in the formula defaults." + ) + + return dt.timestamp() + + elif isinstance(expression, models.LinDecayExpression): + x, target, midpoint, scale = evaluate_decay_params( + expression.lin_decay, point_id, scores, payload, has_vector, defaults + ) + + lambda_factor = (1.0 - midpoint) / scale + diff = abs(x - target) + return max(0.0, -lambda_factor * diff + 1.0) + + elif isinstance(expression, models.ExpDecayExpression): + x, target, midpoint, scale = evaluate_decay_params( + expression.exp_decay, point_id, scores, payload, has_vector, defaults + ) + + lambda_factor = math.log(midpoint) / scale + diff = abs(x - target) + return math.exp(lambda_factor * diff) + + elif isinstance(expression, models.GaussDecayExpression): + x, target, midpoint, scale = evaluate_decay_params( + expression.gauss_decay, point_id, scores, payload, has_vector, defaults + ) + + lambda_factor = math.log(midpoint) / (scale * scale) + diff = x - target + return math.exp(lambda_factor * diff * diff) + + raise ValueError(f"Unsupported expression type: {type(expression)}") + + +def evaluate_decay_params( + params: models.DecayParamsExpression, + point_id: models.ExtendedPointId, + scores: list[dict[models.ExtendedPointId, float]], + payload: models.Payload, + has_vector: dict[str, bool], + defaults: dict[str, Any], +) -> Tuple[float, float, float, float]: + x = evaluate_expression(params.x, point_id, scores, payload, has_vector, defaults) + + if params.target is None: + target = DEFAULT_DECAY_TARGET + else: + target = evaluate_expression( + params.target, point_id, scores, payload, has_vector, defaults + ) + + midpoint = params.midpoint if params.midpoint is not None else DEFAULT_DECAY_MIDPOINT + + if midpoint <= 0.0 or midpoint >= 1.0: + raise ValueError(f"Midpoint must be between 0 and 1, got {midpoint}") + + scale = params.scale if params.scale is not None else DEFAULT_DECAY_SCALE + if scale <= 0.0: + raise ValueError(f"Scale must be non-zero positive, got {scale}") + + return x, target, midpoint, scale + + +def try_extract_payload_value(key: str, payload: models.Payload, defaults: dict[str, Any]) -> Any: + # Get value from payload + value = value_by_key(payload, key) + + if value is None or len(value) == 0: + # Or from defaults + value = defaults.get(key, None) + # Consider it None if it is an empty list + if isinstance(value, list) and len(value) == 0: + value = None + + # Consider it a single value if it's a list with one element + if isinstance(value, list) and len(value) == 1: + return value[0] + + if value is None: + raise ValueError(f"No value found for {key} in the payload nor the formula defaults") + + return value + + +def evaluate_variable( + variable: str, + point_id: models.ExtendedPointId, + scores: list[dict[models.ExtendedPointId, float]], + payload: models.Payload, + defaults: dict[str, Any], +) -> float: + var = parse_variable(variable) + if isinstance(var, str): + value = try_extract_payload_value(var, payload, defaults) + + if is_number(value): + return value + + raise ValueError( + f"Expected number value for {var} in the payload and/or in the formula defaults. Error: Value is not a number" + ) + + elif isinstance(var, int): + # Get score from scores + score = None + if var < len(scores): + score = scores[var].get(point_id, None) + if score is not None: + return score + + defined_default = defaults.get(variable, None) + if defined_default is not None: + return defined_default + + return DEFAULT_SCORE + + raise ValueError(f"Invalid variable type: {type(var)}") + + +def parse_variable(var: str) -> Union[str, int]: + # Try to parse score pattern + if not var.startswith("$score"): + # Treat as payload path + return var + + remaining = var.replace("$score", "", 1) + if remaining == "": + # end of string, default idx is 0 + return 0 + + # it must proceed with brackets + if not remaining.startswith("["): + raise ValueError(f"Invalid score pattern: {var}") + + remaining = remaining.replace("[", "", 1) + bracket_end = remaining.find("]") + if bracket_end == -1: + raise ValueError(f"Invalid score pattern: {var}") + + # try parsing the content in between brackets as integer + try: + idx = int(remaining[:bracket_end]) + except ValueError: + raise ValueError(f"Invalid score pattern: {var}") + + # make sure the string ends after the closing bracket + if len(remaining) > bracket_end + 1: + raise ValueError(f"Invalid score pattern: {var}") + + return idx + + +def raise_non_finite_error(expression: str) -> None: + raise ValueError(f"The expression {expression} produced a non-finite number") + + +def is_number(value: Any) -> bool: + return isinstance(value, (int, float)) and not isinstance(value, bool) + + +def test_parsing_variable() -> None: + assert parse_variable("$score") == 0 + assert parse_variable("$score[0]") == 0 + assert parse_variable("$score[1]") == 1 + assert parse_variable("$score[2]") == 2 + + try: + parse_variable("$score[invalid]") + assert False + except ValueError as e: + assert str(e) == "Invalid score pattern: $score[invalid]" + + try: + parse_variable("$score[10].other") + assert False + except ValueError as e: + assert str(e) == "Invalid score pattern: $score[10].other" + + +def test_try_extract_payload_value() -> None: + for payload_value, expected in [(1.2, 1.2), ([1.2], 1.2), ([1.2, 2.3], [1.2, 2.3])]: + empty_defaults: dict[str, Any] = {} + + payload = {"key": payload_value} + assert try_extract_payload_value("key", payload, empty_defaults) == expected + + defaults = {"key": payload_value} + empty_payload: dict[str, Any] = {} + assert try_extract_payload_value("key", empty_payload, defaults) == expected diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/hybrid/fusion.py b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/hybrid/fusion.py new file mode 100644 index 0000000000000000000000000000000000000000..1c8f280aa831e926363e2ba9c8ed7b304bb3e295 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/hybrid/fusion.py @@ -0,0 +1,72 @@ +from qdrant_client.http import models + + +def reciprocal_rank_fusion( + responses: list[list[models.ScoredPoint]], limit: int = 10 +) -> list[models.ScoredPoint]: + def compute_score(pos: int) -> float: + ranking_constant = ( + 2 # the constant mitigates the impact of high rankings by outlier systems + ) + return 1 / (ranking_constant + pos) + + scores: dict[models.ExtendedPointId, float] = {} + point_pile = {} + for response in responses: + for i, scored_point in enumerate(response): + if scored_point.id in scores: + scores[scored_point.id] += compute_score(i) + else: + point_pile[scored_point.id] = scored_point + scores[scored_point.id] = compute_score(i) + + sorted_scores = sorted(scores.items(), key=lambda item: item[1], reverse=True) + sorted_points = [] + for point_id, score in sorted_scores[:limit]: + point = point_pile[point_id] + point.score = score + sorted_points.append(point) + return sorted_points + + +def distribution_based_score_fusion( + responses: list[list[models.ScoredPoint]], limit: int +) -> list[models.ScoredPoint]: + def normalize(response: list[models.ScoredPoint]) -> list[models.ScoredPoint]: + if len(response) == 1: + response[0].score = 0.5 + return response + + total = sum([point.score for point in response]) + mean = total / len(response) + variance = sum([(point.score - mean) ** 2 for point in response]) / (len(response) - 1) + + if variance == 0: + for point in response: + point.score = 0.5 + return response + + std_dev = variance**0.5 + low = mean - 3 * std_dev + high = mean + 3 * std_dev + + for point in response: + point.score = (point.score - low) / (high - low) + + return response + + points_map: dict[models.ExtendedPointId, models.ScoredPoint] = {} + for response in responses: + if not response: + continue + normalized = normalize(response) + for point in normalized: + entry = points_map.get(point.id) + if entry is None: + points_map[point.id] = point + else: + entry.score += point.score + + sorted_points = sorted(points_map.values(), key=lambda item: item.score, reverse=True) + + return sorted_points[:limit] diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/hybrid/test_reranking.py b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/hybrid/test_reranking.py new file mode 100644 index 0000000000000000000000000000000000000000..bced877f31454e062ab8d1cda30e0c74b00c2682 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/hybrid/test_reranking.py @@ -0,0 +1,117 @@ +import numpy as np + +from qdrant_client.http import models +from qdrant_client.hybrid.fusion import reciprocal_rank_fusion, distribution_based_score_fusion + + +def test_reciprocal_rank_fusion() -> None: + responses = [ + [ + models.ScoredPoint(id="1", score=0.1, version=1), + models.ScoredPoint(id="2", score=0.2, version=1), + models.ScoredPoint(id="3", score=0.3, version=1), + ], + [ + models.ScoredPoint(id="5", score=12.0, version=1), + models.ScoredPoint(id="6", score=8.0, version=1), + models.ScoredPoint(id="7", score=5.0, version=1), + models.ScoredPoint(id="2", score=3.0, version=1), + ], + ] + + fused = reciprocal_rank_fusion(responses) + + assert fused[0].id == "2" + assert fused[1].id in ["1", "5"] + assert np.isclose(fused[1].score, 1 / 2) + assert fused[2].id in ["1", "5"] + assert np.isclose(fused[2].score, 1 / 2) + + +def test_distribution_based_score_fusion() -> None: + responses = [ + [ + models.ScoredPoint(id=1, version=0, score=85.0), + models.ScoredPoint(id=0, version=0, score=76.0), + models.ScoredPoint(id=5, version=0, score=68.0), + ], + [ + models.ScoredPoint(id=1, version=0, score=62.0), + models.ScoredPoint(id=0, version=0, score=61.0), + models.ScoredPoint(id=4, version=0, score=57.0), + models.ScoredPoint(id=3, version=0, score=51.0), + models.ScoredPoint(id=2, version=0, score=44.0), + ], + ] + + fused = distribution_based_score_fusion(responses, limit=3) + + assert fused[0].id == 1 + assert fused[1].id == 0 + assert fused[2].id == 4 + + +def test_reciprocal_rank_fusion_empty_responses() -> None: + responses: list[list[models.ScoredPoint]] = [[]] + fused = reciprocal_rank_fusion(responses) + assert fused == [] + + responses = [ + [ + models.ScoredPoint(id="1", score=0.1, version=1), + models.ScoredPoint(id="2", score=0.2, version=1), + models.ScoredPoint(id="3", score=0.3, version=1), + ], + [], + ] + + fused = reciprocal_rank_fusion(responses) + + assert fused[0].id == "1" + assert np.isclose(fused[0].score, 1 / 2) + assert fused[1].id == "2" + assert np.isclose(fused[1].score, 1 / 3) + assert fused[2].id == "3" + assert np.isclose(fused[2].score, 1 / 4) + + +def test_distribution_based_score_fusion_empty_response() -> None: + responses: list[list[models.ScoredPoint]] = [[]] + fused = distribution_based_score_fusion(responses, limit=3) + assert fused == [] + + responses = [ + [ + models.ScoredPoint(id=1, version=0, score=85.0), + models.ScoredPoint(id=0, version=0, score=76.0), + models.ScoredPoint(id=5, version=0, score=68.0), + ], + [], + ] + + fused = distribution_based_score_fusion(responses, limit=3) + + assert fused[0].id == 1 + assert fused[1].id == 0 + assert fused[2].id == 5 + + +def test_distribution_based_score_fusion_zero_variance() -> None: + score = 85.0 + responses = [ + [ + models.ScoredPoint(id=1, version=0, score=score), + models.ScoredPoint(id=0, version=0, score=score), + models.ScoredPoint(id=5, version=0, score=score), + ], + [], + ] + fused = distribution_based_score_fusion( + [[models.ScoredPoint(id=1, version=0, score=score)]], limit=3 + ) + assert fused[0].id == 1 + assert fused[0].score == 0.5 + + fused = distribution_based_score_fusion(responses, limit=3) + assert len(fused) == 3 + assert all([p.score == 0.5 for p in fused]) diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/local/__init__.py b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/local/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/local/__pycache__/__init__.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/local/__pycache__/__init__.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..86ba401e3ce6bfb83d4b4e4b1c598477be8c6cc3 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/local/__pycache__/__init__.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/local/__pycache__/async_qdrant_local.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/local/__pycache__/async_qdrant_local.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..0ab756e897e5aab0dbd5c34341a3090a3189b581 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/local/__pycache__/async_qdrant_local.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/local/__pycache__/datetime_utils.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/local/__pycache__/datetime_utils.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..25016004752d204cee45a42dd290a3ddac910b13 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/local/__pycache__/datetime_utils.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/local/__pycache__/distances.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/local/__pycache__/distances.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..1562fe894eb6f574afa66424190d3fac406942d4 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/local/__pycache__/distances.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/local/__pycache__/geo.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/local/__pycache__/geo.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..5183eb44714cf01625b2f662b05c7c7cec478331 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/local/__pycache__/geo.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/local/__pycache__/json_path_parser.cpython-312.pyc b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/local/__pycache__/json_path_parser.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..54352796adf58d7abd6463df82498780e234b248 Binary files /dev/null and b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/local/__pycache__/json_path_parser.cpython-312.pyc differ diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/local/async_qdrant_local.py b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/local/async_qdrant_local.py new file mode 100644 index 0000000000000000000000000000000000000000..0f46715d1e5a81d1f21854b32a1371472f1166c6 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/local/async_qdrant_local.py @@ -0,0 +1,1164 @@ +# ****** WARNING: THIS FILE IS AUTOGENERATED ****** +# +# This file is autogenerated. Do not edit it manually. +# To regenerate this file, use +# +# ``` +# bash -x tools/generate_async_client.sh +# ``` +# +# ****** WARNING: THIS FILE IS AUTOGENERATED ****** + +import importlib.metadata +import itertools +import json +import os +import shutil +from copy import deepcopy +from io import TextIOWrapper +from typing import Any, Generator, Iterable, Mapping, Optional, Sequence, Union, get_args +from uuid import uuid4 +import numpy as np +import portalocker +from qdrant_client.common.client_warnings import show_warning, show_warning_once +from qdrant_client._pydantic_compat import to_dict +from qdrant_client.async_client_base import AsyncQdrantBase +from qdrant_client.conversions import common_types as types +from qdrant_client.http import models as rest_models +from qdrant_client.http.models.models import RecommendExample +from qdrant_client.local.local_collection import ( + LocalCollection, + DEFAULT_VECTOR_NAME, + ignore_mentioned_ids_filter, +) + +META_INFO_FILENAME = "meta.json" + + +class AsyncQdrantLocal(AsyncQdrantBase): + """ + Everything Qdrant server can do, but locally. + + Use this implementation to run vector search without running a Qdrant server. + Everything that works with local Qdrant will work with server Qdrant as well. + + Use for small-scale data, demos, and tests. + If you need more speed or size, use Qdrant server. + """ + + LARGE_DATA_THRESHOLD = 20000 + + def __init__(self, location: str, force_disable_check_same_thread: bool = False) -> None: + """ + Initialize local Qdrant. + + Args: + location: Where to store data. Can be a path to a directory or `:memory:` for in-memory storage. + force_disable_check_same_thread: Disable SQLite check_same_thread check. Use only if you know what you are doing. + """ + super().__init__() + self.force_disable_check_same_thread = force_disable_check_same_thread + self.location = location + self.persistent = location != ":memory:" + self.collections: dict[str, LocalCollection] = {} + self.aliases: dict[str, str] = {} + self._flock_file: Optional[TextIOWrapper] = None + self._load() + self._closed: bool = False + + @property + def closed(self) -> bool: + return self._closed + + async def close(self, **kwargs: Any) -> None: + self._closed = True + for collection in self.collections.values(): + if collection is not None: + collection.close() + else: + show_warning( + message=f"Collection appears to be None before closing. The existing collections are: {list(self.collections.keys())}", + category=UserWarning, + stacklevel=4, + ) + try: + if self._flock_file is not None and (not self._flock_file.closed): + portalocker.unlock(self._flock_file) + self._flock_file.close() + except TypeError: + pass + + def _load(self) -> None: + if not self.persistent: + return + meta_path = os.path.join(self.location, META_INFO_FILENAME) + if not os.path.exists(meta_path): + os.makedirs(self.location, exist_ok=True) + with open(meta_path, "w") as f: + f.write(json.dumps({"collections": {}, "aliases": {}})) + else: + with open(meta_path, "r") as f: + meta = json.load(f) + for collection_name, config_json in meta["collections"].items(): + config = rest_models.CreateCollection(**config_json) + collection_path = self._collection_path(collection_name) + collection = LocalCollection( + config, + collection_path, + force_disable_check_same_thread=self.force_disable_check_same_thread, + ) + self.collections[collection_name] = collection + if len(collection.ids) > self.LARGE_DATA_THRESHOLD: + show_warning( + f"Local mode is not recommended for collections with more than {self.LARGE_DATA_THRESHOLD:,} points. Collection <{collection_name}> contains {len(collection.ids)} points. Consider using Qdrant in Docker or Qdrant Cloud for better performance with large datasets.", + category=UserWarning, + stacklevel=5, + ) + self.aliases = meta["aliases"] + lock_file_path = os.path.join(self.location, ".lock") + if not os.path.exists(lock_file_path): + os.makedirs(self.location, exist_ok=True) + with open(lock_file_path, "w") as f: + f.write("tmp lock file") + self._flock_file = open(lock_file_path, "r+") + try: + portalocker.lock( + self._flock_file, + portalocker.LockFlags.EXCLUSIVE | portalocker.LockFlags.NON_BLOCKING, + ) + except portalocker.exceptions.LockException: + raise RuntimeError( + f"Storage folder {self.location} is already accessed by another instance of Qdrant client. If you require concurrent access, use Qdrant server instead." + ) + + def _save(self) -> None: + if not self.persistent: + return + if self.closed: + raise RuntimeError("QdrantLocal instance is closed. Please create a new instance.") + meta_path = os.path.join(self.location, META_INFO_FILENAME) + with open(meta_path, "w") as f: + f.write( + json.dumps( + { + "collections": { + collection_name: to_dict(collection.config) + for (collection_name, collection) in self.collections.items() + }, + "aliases": self.aliases, + } + ) + ) + + def _get_collection(self, collection_name: str) -> LocalCollection: + if self.closed: + raise RuntimeError("QdrantLocal instance is closed. Please create a new instance.") + if collection_name in self.collections: + return self.collections[collection_name] + if collection_name in self.aliases: + return self.collections[self.aliases[collection_name]] + raise ValueError(f"Collection {collection_name} not found") + + async def search_batch( + self, collection_name: str, requests: Sequence[types.SearchRequest], **kwargs: Any + ) -> list[list[types.ScoredPoint]]: + collection = self._get_collection(collection_name) + return [ + collection.search( + query_vector=request.vector, + query_filter=request.filter, + limit=request.limit, + offset=request.offset, + with_payload=request.with_payload, + with_vectors=request.with_vector, + score_threshold=request.score_threshold, + ) + for request in requests + ] + + async def search( + self, + collection_name: str, + query_vector: Union[ + types.NumpyArray, + Sequence[float], + tuple[str, list[float]], + types.NamedVector, + types.NamedSparseVector, + ], + query_filter: Optional[types.Filter] = None, + search_params: Optional[types.SearchParams] = None, + limit: int = 10, + offset: Optional[int] = None, + with_payload: Union[bool, Sequence[str], types.PayloadSelector] = True, + with_vectors: Union[bool, Sequence[str]] = False, + score_threshold: Optional[float] = None, + **kwargs: Any, + ) -> list[types.ScoredPoint]: + collection = self._get_collection(collection_name) + return collection.search( + query_vector=query_vector, + query_filter=query_filter, + limit=limit, + offset=offset, + with_payload=with_payload, + with_vectors=with_vectors, + score_threshold=score_threshold, + ) + + async def search_matrix_offsets( + self, + collection_name: str, + query_filter: Optional[types.Filter] = None, + limit: int = 3, + sample: int = 10, + using: Optional[str] = None, + **kwargs: Any, + ) -> types.SearchMatrixOffsetsResponse: + collection = self._get_collection(collection_name) + return collection.search_matrix_offsets( + query_filter=query_filter, limit=limit, sample=sample, using=using + ) + + async def search_matrix_pairs( + self, + collection_name: str, + query_filter: Optional[types.Filter] = None, + limit: int = 3, + sample: int = 10, + using: Optional[str] = None, + **kwargs: Any, + ) -> types.SearchMatrixPairsResponse: + collection = self._get_collection(collection_name) + return collection.search_matrix_pairs( + query_filter=query_filter, limit=limit, sample=sample, using=using + ) + + async def search_groups( + self, + collection_name: str, + query_vector: Union[ + types.NumpyArray, Sequence[float], tuple[str, list[float]], types.NamedVector + ], + group_by: str, + query_filter: Optional[rest_models.Filter] = None, + search_params: Optional[rest_models.SearchParams] = None, + limit: int = 10, + group_size: int = 1, + with_payload: Union[bool, Sequence[str], rest_models.PayloadSelector] = True, + with_vectors: Union[bool, Sequence[str]] = False, + score_threshold: Optional[float] = None, + with_lookup: Optional[types.WithLookupInterface] = None, + **kwargs: Any, + ) -> types.GroupsResult: + collection = self._get_collection(collection_name) + with_lookup_collection = None + if with_lookup is not None: + if isinstance(with_lookup, str): + with_lookup_collection = self._get_collection(with_lookup) + else: + with_lookup_collection = self._get_collection(with_lookup.collection) + return collection.search_groups( + query_vector=query_vector, + query_filter=query_filter, + limit=limit, + group_by=group_by, + group_size=group_size, + with_payload=with_payload, + with_vectors=with_vectors, + score_threshold=score_threshold, + with_lookup=with_lookup, + with_lookup_collection=with_lookup_collection, + ) + + def _resolve_query_input( + self, + collection_name: str, + query: Optional[types.Query], + using: Optional[str], + lookup_from: Optional[types.LookupLocation], + ) -> tuple[types.Query, set[types.PointId]]: + """ + Resolves any possible ids into vectors and returns a new query object, along with a set of the mentioned + point ids that should be filtered when searching. + """ + lookup_collection_name = lookup_from.collection if lookup_from else collection_name + collection = self._get_collection(lookup_collection_name) + search_in_vector_name = using if using is not None else DEFAULT_VECTOR_NAME + vector_name = ( + lookup_from.vector + if lookup_from is not None and lookup_from.vector is not None + else search_in_vector_name + ) + sparse = vector_name in collection.sparse_vectors + multi = vector_name in collection.multivectors + if sparse: + collection_vectors = collection.sparse_vectors + elif multi: + collection_vectors = collection.multivectors + else: + collection_vectors = collection.vectors + mentioned_ids: set[types.PointId] = set() + + def input_into_vector(vector_input: types.VectorInput) -> types.VectorInput: + if isinstance(vector_input, get_args(types.PointId)): + point_id = vector_input + if point_id not in collection.ids: + raise ValueError(f"Point {point_id} is not found in the collection") + idx = collection.ids[point_id] + if vector_name in collection_vectors: + vec = collection_vectors[vector_name][idx] + else: + raise ValueError(f"Vector {vector_name} not found") + if isinstance(vec, np.ndarray): + vec = vec.tolist() + if collection_name == lookup_collection_name: + mentioned_ids.add(point_id) + return vec + else: + return vector_input + + query = deepcopy(query) + if isinstance(query, rest_models.NearestQuery): + query.nearest = input_into_vector(query.nearest) + elif isinstance(query, rest_models.RecommendQuery): + if query.recommend.negative is not None: + query.recommend.negative = [ + input_into_vector(vector_input) for vector_input in query.recommend.negative + ] + if query.recommend.positive is not None: + query.recommend.positive = [ + input_into_vector(vector_input) for vector_input in query.recommend.positive + ] + elif isinstance(query, rest_models.DiscoverQuery): + query.discover.target = input_into_vector(query.discover.target) + pairs = ( + query.discover.context + if isinstance(query.discover.context, list) + else [query.discover.context] + ) + query.discover.context = [ + rest_models.ContextPair( + positive=input_into_vector(pair.positive), + negative=input_into_vector(pair.negative), + ) + for pair in pairs + ] + elif isinstance(query, rest_models.ContextQuery): + pairs = query.context if isinstance(query.context, list) else [query.context] + query.context = [ + rest_models.ContextPair( + positive=input_into_vector(pair.positive), + negative=input_into_vector(pair.negative), + ) + for pair in pairs + ] + elif isinstance(query, rest_models.OrderByQuery): + pass + elif isinstance(query, rest_models.FusionQuery): + pass + return (query, mentioned_ids) + + def _resolve_prefetches_input( + self, + prefetch: Optional[Union[Sequence[types.Prefetch], types.Prefetch]], + collection_name: str, + ) -> list[types.Prefetch]: + if prefetch is None: + return [] + if isinstance(prefetch, list) and len(prefetch) == 0: + return [] + prefetches = [] + if isinstance(prefetch, types.Prefetch): + prefetches = [prefetch] + prefetches.extend( + prefetch.prefetch if isinstance(prefetch.prefetch, list) else [prefetch.prefetch] + ) + elif isinstance(prefetch, Sequence): + prefetches = list(prefetch) + return [ + self._resolve_prefetch_input(prefetch, collection_name) + for prefetch in prefetches + if prefetch is not None + ] + + def _resolve_prefetch_input( + self, prefetch: types.Prefetch, collection_name: str + ) -> types.Prefetch: + if prefetch.query is None: + return prefetch + prefetch = deepcopy(prefetch) + (query, mentioned_ids) = self._resolve_query_input( + collection_name, prefetch.query, prefetch.using, prefetch.lookup_from + ) + prefetch.query = query + prefetch.filter = ignore_mentioned_ids_filter(prefetch.filter, list(mentioned_ids)) + prefetch.prefetch = self._resolve_prefetches_input(prefetch.prefetch, collection_name) + return prefetch + + async def query_points( + self, + collection_name: str, + query: Optional[types.Query] = None, + using: Optional[str] = None, + prefetch: Union[types.Prefetch, list[types.Prefetch], None] = None, + query_filter: Optional[types.Filter] = None, + search_params: Optional[types.SearchParams] = None, + limit: int = 10, + offset: Optional[int] = None, + with_payload: Union[bool, Sequence[str], types.PayloadSelector] = True, + with_vectors: Union[bool, Sequence[str]] = False, + score_threshold: Optional[float] = None, + lookup_from: Optional[types.LookupLocation] = None, + **kwargs: Any, + ) -> types.QueryResponse: + collection = self._get_collection(collection_name) + if query is not None: + (query, mentioned_ids) = self._resolve_query_input( + collection_name, query, using, lookup_from + ) + query_filter = ignore_mentioned_ids_filter(query_filter, list(mentioned_ids)) + prefetch = self._resolve_prefetches_input(prefetch, collection_name) + return collection.query_points( + query=query, + prefetch=prefetch, + query_filter=query_filter, + using=using, + score_threshold=score_threshold, + limit=limit, + offset=offset or 0, + with_payload=with_payload, + with_vectors=with_vectors, + ) + + async def query_batch_points( + self, collection_name: str, requests: Sequence[types.QueryRequest], **kwargs: Any + ) -> list[types.QueryResponse]: + return [ + await self.query_points( + collection_name=collection_name, + query=request.query, + prefetch=request.prefetch, + query_filter=request.filter, + limit=request.limit or 10, + offset=request.offset, + with_payload=request.with_payload, + with_vectors=request.with_vector, + score_threshold=request.score_threshold, + using=request.using, + lookup_from=request.lookup_from, + ) + for request in requests + ] + + async def query_points_groups( + self, + collection_name: str, + group_by: str, + query: Union[ + types.PointId, + list[float], + list[list[float]], + types.SparseVector, + types.Query, + types.NumpyArray, + types.Document, + types.Image, + types.InferenceObject, + None, + ] = None, + using: Optional[str] = None, + prefetch: Union[types.Prefetch, list[types.Prefetch], None] = None, + query_filter: Optional[types.Filter] = None, + search_params: Optional[types.SearchParams] = None, + limit: int = 10, + group_size: int = 3, + with_payload: Union[bool, Sequence[str], types.PayloadSelector] = True, + with_vectors: Union[bool, Sequence[str]] = False, + score_threshold: Optional[float] = None, + with_lookup: Optional[types.WithLookupInterface] = None, + lookup_from: Optional[types.LookupLocation] = None, + **kwargs: Any, + ) -> types.GroupsResult: + collection = self._get_collection(collection_name) + if query is not None: + (query, mentioned_ids) = self._resolve_query_input( + collection_name, query, using, lookup_from + ) + query_filter = ignore_mentioned_ids_filter(query_filter, list(mentioned_ids)) + with_lookup_collection = None + if with_lookup is not None: + if isinstance(with_lookup, str): + with_lookup_collection = self._get_collection(with_lookup) + else: + with_lookup_collection = self._get_collection(with_lookup.collection) + return collection.query_groups( + query=query, + query_filter=query_filter, + using=using, + prefetch=prefetch, + limit=limit, + group_by=group_by, + group_size=group_size, + with_payload=with_payload, + with_vectors=with_vectors, + score_threshold=score_threshold, + with_lookup=with_lookup, + with_lookup_collection=with_lookup_collection, + ) + + async def recommend_batch( + self, collection_name: str, requests: Sequence[types.RecommendRequest], **kwargs: Any + ) -> list[list[types.ScoredPoint]]: + collection = self._get_collection(collection_name) + return [ + collection.recommend( + positive=request.positive, + negative=request.negative, + query_filter=request.filter, + limit=request.limit, + offset=request.offset, + with_payload=request.with_payload, + with_vectors=request.with_vector, + score_threshold=request.score_threshold, + using=request.using, + lookup_from_collection=self._get_collection(request.lookup_from.collection) + if request.lookup_from + else None, + lookup_from_vector_name=request.lookup_from.vector + if request.lookup_from + else None, + strategy=request.strategy, + ) + for request in requests + ] + + async def recommend( + self, + collection_name: str, + positive: Optional[Sequence[RecommendExample]] = None, + negative: Optional[Sequence[RecommendExample]] = None, + query_filter: Optional[types.Filter] = None, + search_params: Optional[types.SearchParams] = None, + limit: int = 10, + offset: int = 0, + with_payload: Union[bool, list[str], types.PayloadSelector] = True, + with_vectors: Union[bool, list[str]] = False, + score_threshold: Optional[float] = None, + using: Optional[str] = None, + lookup_from: Optional[types.LookupLocation] = None, + strategy: Optional[types.RecommendStrategy] = None, + **kwargs: Any, + ) -> list[types.ScoredPoint]: + collection = self._get_collection(collection_name) + return collection.recommend( + positive=positive, + negative=negative, + query_filter=query_filter, + limit=limit, + offset=offset, + with_payload=with_payload, + with_vectors=with_vectors, + score_threshold=score_threshold, + using=using, + lookup_from_collection=self._get_collection(lookup_from.collection) + if lookup_from + else None, + lookup_from_vector_name=lookup_from.vector if lookup_from else None, + strategy=strategy, + ) + + async def recommend_groups( + self, + collection_name: str, + group_by: str, + positive: Optional[Sequence[Union[types.PointId, list[float]]]] = None, + negative: Optional[Sequence[Union[types.PointId, list[float]]]] = None, + query_filter: Optional[types.Filter] = None, + search_params: Optional[types.SearchParams] = None, + limit: int = 10, + group_size: int = 1, + score_threshold: Optional[float] = None, + with_payload: Union[bool, Sequence[str], types.PayloadSelector] = True, + with_vectors: Union[bool, Sequence[str]] = False, + using: Optional[str] = None, + lookup_from: Optional[types.LookupLocation] = None, + with_lookup: Optional[types.WithLookupInterface] = None, + strategy: Optional[types.RecommendStrategy] = None, + **kwargs: Any, + ) -> types.GroupsResult: + collection = self._get_collection(collection_name) + with_lookup_collection = None + if with_lookup is not None: + if isinstance(with_lookup, str): + with_lookup_collection = self._get_collection(with_lookup) + else: + with_lookup_collection = self._get_collection(with_lookup.collection) + return collection.recommend_groups( + positive=positive, + negative=negative, + group_by=group_by, + group_size=group_size, + query_filter=query_filter, + limit=limit, + with_payload=with_payload, + with_vectors=with_vectors, + score_threshold=score_threshold, + using=using, + lookup_from_collection=self._get_collection(lookup_from.collection) + if lookup_from + else None, + lookup_from_vector_name=lookup_from.vector if lookup_from else None, + with_lookup=with_lookup, + with_lookup_collection=with_lookup_collection, + strategy=strategy, + ) + + async def discover( + self, + collection_name: str, + target: Optional[types.TargetVector] = None, + context: Optional[Sequence[types.ContextExamplePair]] = None, + query_filter: Optional[types.Filter] = None, + search_params: Optional[types.SearchParams] = None, + limit: int = 10, + offset: int = 0, + with_payload: Union[bool, list[str], types.PayloadSelector] = True, + with_vectors: Union[bool, list[str]] = False, + using: Optional[str] = None, + lookup_from: Optional[types.LookupLocation] = None, + consistency: Optional[types.ReadConsistency] = None, + timeout: Optional[int] = None, + **kwargs: Any, + ) -> list[types.ScoredPoint]: + collection = self._get_collection(collection_name) + return collection.discover( + target=target, + context=context, + query_filter=query_filter, + limit=limit, + offset=offset, + with_payload=with_payload, + with_vectors=with_vectors, + using=using, + lookup_from_collection=self._get_collection(lookup_from.collection) + if lookup_from + else None, + lookup_from_vector_name=lookup_from.vector if lookup_from else None, + ) + + async def discover_batch( + self, collection_name: str, requests: Sequence[types.DiscoverRequest], **kwargs: Any + ) -> list[list[types.ScoredPoint]]: + collection = self._get_collection(collection_name) + return [ + collection.discover( + target=request.target, + context=request.context, + query_filter=request.filter, + limit=request.limit, + offset=request.offset, + with_payload=request.with_payload, + with_vectors=request.with_vector, + using=request.using, + lookup_from_collection=self._get_collection(request.lookup_from.collection) + if request.lookup_from + else None, + lookup_from_vector_name=request.lookup_from.vector + if request.lookup_from + else None, + ) + for request in requests + ] + + async def scroll( + self, + collection_name: str, + scroll_filter: Optional[types.Filter] = None, + limit: int = 10, + order_by: Optional[types.OrderBy] = None, + offset: Optional[types.PointId] = None, + with_payload: Union[bool, Sequence[str], types.PayloadSelector] = True, + with_vectors: Union[bool, Sequence[str]] = False, + **kwargs: Any, + ) -> tuple[list[types.Record], Optional[types.PointId]]: + collection = self._get_collection(collection_name) + return collection.scroll( + scroll_filter=scroll_filter, + limit=limit, + order_by=order_by, + offset=offset, + with_payload=with_payload, + with_vectors=with_vectors, + ) + + async def count( + self, + collection_name: str, + count_filter: Optional[types.Filter] = None, + exact: bool = True, + **kwargs: Any, + ) -> types.CountResult: + collection = self._get_collection(collection_name) + return collection.count(count_filter=count_filter) + + async def facet( + self, + collection_name: str, + key: str, + facet_filter: Optional[types.Filter] = None, + limit: int = 10, + exact: bool = False, + **kwargs: Any, + ) -> types.FacetResponse: + collection = self._get_collection(collection_name) + return collection.facet(key=key, facet_filter=facet_filter, limit=limit) + + async def upsert( + self, collection_name: str, points: types.Points, **kwargs: Any + ) -> types.UpdateResult: + collection = self._get_collection(collection_name) + collection.upsert(points) + return self._default_update_result() + + async def update_vectors( + self, collection_name: str, points: Sequence[types.PointVectors], **kwargs: Any + ) -> types.UpdateResult: + collection = self._get_collection(collection_name) + collection.update_vectors(points) + return self._default_update_result() + + async def delete_vectors( + self, + collection_name: str, + vectors: Sequence[str], + points: types.PointsSelector, + **kwargs: Any, + ) -> types.UpdateResult: + collection = self._get_collection(collection_name) + collection.delete_vectors(vectors, points) + return self._default_update_result() + + async def retrieve( + self, + collection_name: str, + ids: Sequence[types.PointId], + with_payload: Union[bool, Sequence[str], types.PayloadSelector] = True, + with_vectors: Union[bool, Sequence[str]] = False, + **kwargs: Any, + ) -> list[types.Record]: + collection = self._get_collection(collection_name) + return collection.retrieve(ids, with_payload, with_vectors) + + @classmethod + def _default_update_result(cls, operation_id: int = 0) -> types.UpdateResult: + return types.UpdateResult( + operation_id=operation_id, status=rest_models.UpdateStatus.COMPLETED + ) + + async def delete( + self, collection_name: str, points_selector: types.PointsSelector, **kwargs: Any + ) -> types.UpdateResult: + collection = self._get_collection(collection_name) + collection.delete(points_selector) + return self._default_update_result() + + async def set_payload( + self, + collection_name: str, + payload: types.Payload, + points: types.PointsSelector, + key: Optional[str] = None, + **kwargs: Any, + ) -> types.UpdateResult: + collection = self._get_collection(collection_name) + collection.set_payload(payload=payload, selector=points, key=key) + return self._default_update_result() + + async def overwrite_payload( + self, + collection_name: str, + payload: types.Payload, + points: types.PointsSelector, + **kwargs: Any, + ) -> types.UpdateResult: + collection = self._get_collection(collection_name) + collection.overwrite_payload(payload=payload, selector=points) + return self._default_update_result() + + async def delete_payload( + self, + collection_name: str, + keys: Sequence[str], + points: types.PointsSelector, + **kwargs: Any, + ) -> types.UpdateResult: + collection = self._get_collection(collection_name) + collection.delete_payload(keys=keys, selector=points) + return self._default_update_result() + + async def clear_payload( + self, collection_name: str, points_selector: types.PointsSelector, **kwargs: Any + ) -> types.UpdateResult: + collection = self._get_collection(collection_name) + collection.clear_payload(selector=points_selector) + return self._default_update_result() + + async def batch_update_points( + self, + collection_name: str, + update_operations: Sequence[types.UpdateOperation], + **kwargs: Any, + ) -> list[types.UpdateResult]: + collection = self._get_collection(collection_name) + collection.batch_update_points(update_operations) + return [self._default_update_result()] * len(update_operations) + + async def update_collection_aliases( + self, change_aliases_operations: Sequence[types.AliasOperations], **kwargs: Any + ) -> bool: + for operation in change_aliases_operations: + if isinstance(operation, rest_models.CreateAliasOperation): + self._get_collection(operation.create_alias.collection_name) + self.aliases[operation.create_alias.alias_name] = ( + operation.create_alias.collection_name + ) + elif isinstance(operation, rest_models.DeleteAliasOperation): + self.aliases.pop(operation.delete_alias.alias_name, None) + elif isinstance(operation, rest_models.RenameAliasOperation): + new_name = operation.rename_alias.new_alias_name + old_name = operation.rename_alias.old_alias_name + self.aliases[new_name] = self.aliases.pop(old_name) + else: + raise ValueError(f"Unknown operation: {operation}") + self._save() + return True + + async def get_collection_aliases( + self, collection_name: str, **kwargs: Any + ) -> types.CollectionsAliasesResponse: + if self.closed: + raise RuntimeError("QdrantLocal instance is closed. Please create a new instance.") + return types.CollectionsAliasesResponse( + aliases=[ + rest_models.AliasDescription(alias_name=alias_name, collection_name=name) + for (alias_name, name) in self.aliases.items() + if name == collection_name + ] + ) + + async def get_aliases(self, **kwargs: Any) -> types.CollectionsAliasesResponse: + if self.closed: + raise RuntimeError("QdrantLocal instance is closed. Please create a new instance.") + return types.CollectionsAliasesResponse( + aliases=[ + rest_models.AliasDescription(alias_name=alias_name, collection_name=name) + for (alias_name, name) in self.aliases.items() + ] + ) + + async def get_collections(self, **kwargs: Any) -> types.CollectionsResponse: + if self.closed: + raise RuntimeError("QdrantLocal instance is closed. Please create a new instance.") + return types.CollectionsResponse( + collections=[ + rest_models.CollectionDescription(name=name) + for (name, _) in self.collections.items() + ] + ) + + async def get_collection(self, collection_name: str, **kwargs: Any) -> types.CollectionInfo: + collection = self._get_collection(collection_name) + return collection.info() + + async def collection_exists(self, collection_name: str, **kwargs: Any) -> bool: + try: + self._get_collection(collection_name) + return True + except ValueError: + return False + + async def update_collection( + self, + collection_name: str, + sparse_vectors_config: Optional[Mapping[str, types.SparseVectorParams]] = None, + **kwargs: Any, + ) -> bool: + _collection = self._get_collection(collection_name) + if sparse_vectors_config is not None: + for vector_name, vector_params in sparse_vectors_config.items(): + _collection.update_sparse_vectors_config(vector_name, vector_params) + return True + return False + + def _collection_path(self, collection_name: str) -> Optional[str]: + if self.persistent: + return os.path.join(self.location, "collection", collection_name) + else: + return None + + async def delete_collection(self, collection_name: str, **kwargs: Any) -> bool: + if self.closed: + raise RuntimeError("QdrantLocal instance is closed. Please create a new instance.") + _collection = self.collections.pop(collection_name, None) + del _collection + self.aliases = { + alias_name: name + for (alias_name, name) in self.aliases.items() + if name != collection_name + } + collection_path = self._collection_path(collection_name) + if collection_path is not None: + shutil.rmtree(collection_path, ignore_errors=True) + self._save() + return True + + async def create_collection( + self, + collection_name: str, + vectors_config: Optional[ + Union[types.VectorParams, Mapping[str, types.VectorParams]] + ] = None, + init_from: Optional[types.InitFrom] = None, + sparse_vectors_config: Optional[Mapping[str, types.SparseVectorParams]] = None, + **kwargs: Any, + ) -> bool: + if self.closed: + raise RuntimeError("QdrantLocal instance is closed. Please create a new instance.") + src_collection = None + from_collection_name = None + if init_from is not None: + from_collection_name = ( + init_from if isinstance(init_from, str) else init_from.collection + ) + src_collection = self._get_collection(from_collection_name) + if collection_name in self.collections: + raise ValueError(f"Collection {collection_name} already exists") + collection_path = self._collection_path(collection_name) + if collection_path is not None: + os.makedirs(collection_path, exist_ok=True) + collection = LocalCollection( + rest_models.CreateCollection( + vectors=vectors_config or {}, sparse_vectors=sparse_vectors_config + ), + location=collection_path, + force_disable_check_same_thread=self.force_disable_check_same_thread, + ) + self.collections[collection_name] = collection + if src_collection and from_collection_name: + batch_size = 100 + (records, next_offset) = await self.scroll( + from_collection_name, limit=2, with_vectors=True + ) + self.upload_records(collection_name, records) + while next_offset is not None: + (records, next_offset) = await self.scroll( + from_collection_name, offset=next_offset, limit=batch_size, with_vectors=True + ) + self.upload_records(collection_name, records) + self._save() + return True + + async def recreate_collection( + self, + collection_name: str, + vectors_config: Union[types.VectorParams, Mapping[str, types.VectorParams]], + init_from: Optional[types.InitFrom] = None, + sparse_vectors_config: Optional[Mapping[str, types.SparseVectorParams]] = None, + **kwargs: Any, + ) -> bool: + await self.delete_collection(collection_name) + return await self.create_collection( + collection_name, vectors_config, init_from, sparse_vectors_config + ) + + def upload_points( + self, collection_name: str, points: Iterable[types.PointStruct], **kwargs: Any + ) -> None: + self._upload_points(collection_name, points) + + def upload_records( + self, collection_name: str, records: Iterable[types.Record], **kwargs: Any + ) -> None: + self._upload_points(collection_name, records) + + def _upload_points( + self, collection_name: str, points: Iterable[Union[types.PointStruct, types.Record]] + ) -> None: + collection = self._get_collection(collection_name) + collection.upsert( + [ + rest_models.PointStruct( + id=point.id, vector=point.vector or {}, payload=point.payload or {} + ) + for point in points + ] + ) + + def upload_collection( + self, + collection_name: str, + vectors: Union[ + dict[str, types.NumpyArray], types.NumpyArray, Iterable[types.VectorStruct] + ], + payload: Optional[Iterable[dict[Any, Any]]] = None, + ids: Optional[Iterable[types.PointId]] = None, + **kwargs: Any, + ) -> None: + def uuid_generator() -> Generator[str, None, None]: + while True: + yield str(uuid4()) + + collection = self._get_collection(collection_name) + if isinstance(vectors, dict) and any( + (isinstance(v, np.ndarray) for v in vectors.values()) + ): + assert ( + len(set([arr.shape[0] for arr in vectors.values()])) == 1 + ), "Each named vector should have the same number of vectors" + num_vectors = next(iter(vectors.values())).shape[0] + vectors = [ + {name: vectors[name][i].tolist() for name in vectors.keys()} + for i in range(num_vectors) + ] + collection.upsert( + [ + rest_models.PointStruct( + id=point_id, + vector=(vector.tolist() if isinstance(vector, np.ndarray) else vector) or {}, + payload=payload or {}, + ) + for (point_id, vector, payload) in zip( + ids or uuid_generator(), iter(vectors), payload or itertools.cycle([{}]) + ) + ] + ) + + async def create_payload_index( + self, + collection_name: str, + field_name: str, + field_schema: Optional[types.PayloadSchemaType] = None, + field_type: Optional[types.PayloadSchemaType] = None, + **kwargs: Any, + ) -> types.UpdateResult: + show_warning_once( + message="Payload indexes have no effect in the local Qdrant. Please use server Qdrant if you need payload indexes.", + category=UserWarning, + idx="create-local-payload-indexes", + stacklevel=5, + ) + return self._default_update_result() + + async def delete_payload_index( + self, collection_name: str, field_name: str, **kwargs: Any + ) -> types.UpdateResult: + show_warning_once( + message="Payload indexes have no effect in the local Qdrant. Please use server Qdrant if you need payload indexes.", + category=UserWarning, + idx="delete-local-payload-indexes", + stacklevel=5, + ) + return self._default_update_result() + + async def list_snapshots( + self, collection_name: str, **kwargs: Any + ) -> list[types.SnapshotDescription]: + return [] + + async def create_snapshot( + self, collection_name: str, **kwargs: Any + ) -> Optional[types.SnapshotDescription]: + raise NotImplementedError( + "Snapshots are not supported in the local Qdrant. Please use server Qdrant if you need full snapshots." + ) + + async def delete_snapshot( + self, collection_name: str, snapshot_name: str, **kwargs: Any + ) -> bool: + raise NotImplementedError( + "Snapshots are not supported in the local Qdrant. Please use server Qdrant if you need full snapshots." + ) + + async def list_full_snapshots(self, **kwargs: Any) -> list[types.SnapshotDescription]: + return [] + + async def create_full_snapshot(self, **kwargs: Any) -> types.SnapshotDescription: + raise NotImplementedError( + "Snapshots are not supported in the local Qdrant. Please use server Qdrant if you need full snapshots." + ) + + async def delete_full_snapshot(self, snapshot_name: str, **kwargs: Any) -> bool: + raise NotImplementedError( + "Snapshots are not supported in the local Qdrant. Please use server Qdrant if you need full snapshots." + ) + + async def recover_snapshot(self, collection_name: str, location: str, **kwargs: Any) -> bool: + raise NotImplementedError( + "Snapshots are not supported in the local Qdrant. Please use server Qdrant if you need full snapshots." + ) + + async def list_shard_snapshots( + self, collection_name: str, shard_id: int, **kwargs: Any + ) -> list[types.SnapshotDescription]: + return [] + + async def create_shard_snapshot( + self, collection_name: str, shard_id: int, **kwargs: Any + ) -> Optional[types.SnapshotDescription]: + raise NotImplementedError( + "Snapshots are not supported in the local Qdrant. Please use server Qdrant if you need snapshots." + ) + + async def delete_shard_snapshot( + self, collection_name: str, shard_id: int, snapshot_name: str, **kwargs: Any + ) -> bool: + raise NotImplementedError( + "Snapshots are not supported in the local Qdrant. Please use server Qdrant if you need snapshots." + ) + + async def recover_shard_snapshot( + self, collection_name: str, shard_id: int, location: str, **kwargs: Any + ) -> bool: + raise NotImplementedError( + "Snapshots are not supported in the local Qdrant. Please use server Qdrant if you need snapshots." + ) + + async def lock_storage(self, reason: str, **kwargs: Any) -> types.LocksOption: + raise NotImplementedError( + "Locks are not supported in the local Qdrant. Please use server Qdrant if you need full snapshots." + ) + + async def unlock_storage(self, **kwargs: Any) -> types.LocksOption: + raise NotImplementedError( + "Locks are not supported in the local Qdrant. Please use server Qdrant if you need full snapshots." + ) + + async def get_locks(self, **kwargs: Any) -> types.LocksOption: + return types.LocksOption(error_message=None, write=False) + + async def create_shard_key( + self, + collection_name: str, + shard_key: types.ShardKey, + shards_number: Optional[int] = None, + replication_factor: Optional[int] = None, + placement: Optional[list[int]] = None, + **kwargs: Any, + ) -> bool: + raise NotImplementedError( + "Sharding is not supported in the local Qdrant. Please use server Qdrant if you need sharding." + ) + + async def delete_shard_key( + self, collection_name: str, shard_key: types.ShardKey, **kwargs: Any + ) -> bool: + raise NotImplementedError( + "Sharding is not supported in the local Qdrant. Please use server Qdrant if you need sharding." + ) + + async def info(self) -> types.VersionInfo: + version = importlib.metadata.version("qdrant-client") + return rest_models.VersionInfo( + title="qdrant - vector search engine", version=version, commit=None + ) diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/local/datetime_utils.py b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/local/datetime_utils.py new file mode 100644 index 0000000000000000000000000000000000000000..8c886561216acc7a24f89e38d9de930c50541760 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/local/datetime_utils.py @@ -0,0 +1,50 @@ +from datetime import datetime, timezone +from typing import Optional + +# These are the formats accepted by qdrant core +available_formats = [ + "%Y-%m-%dT%H:%M:%S.%f%z", + "%Y-%m-%d %H:%M:%S.%f%z", + "%Y-%m-%dT%H:%M:%S%z", + "%Y-%m-%d %H:%M:%S%z", + "%Y-%m-%dT%H:%M:%S.%f", + "%Y-%m-%d %H:%M:%S.%f", + "%Y-%m-%dT%H:%M:%S", + "%Y-%m-%d %H:%M:%S", + "%Y-%m-%d %H:%M", + "%Y-%m-%d", +] + + +def parse(date_str: str) -> Optional[datetime]: + """Parses one section of the date string at a time. + + Args: + date_str (str): Accepts any of the formats in qdrant core (see https://github.com/qdrant/qdrant/blob/0ed86ce0575d35930268db19e1f7680287072c58/lib/segment/src/types.rs#L1388-L1410) + + Returns: + Optional[datetime]: the datetime if the string is valid, otherwise None + """ + + def parse_available_formats(datetime_str: str) -> Optional[datetime]: + for fmt in available_formats: + try: + dt = datetime.strptime(datetime_str, fmt) + if dt.tzinfo is None: + # Assume UTC if no timezone is provided + dt = dt.replace(tzinfo=timezone.utc) + return dt + except ValueError: + pass + return None + + parsed_dt = parse_available_formats(date_str) + if parsed_dt is not None: + return parsed_dt + + # Python can't parse timezones containing only hours (+HH), but it can parse timezones with hours and minutes + # So we add :00 to the assumed timezone and try parsing it again + # dt examples to handle: + # "2021-01-01 00:00:00.000+01" + # "2021-01-01 00:00:00.000-10" + return parse_available_formats(date_str + ":00") diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/local/distances.py b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/local/distances.py new file mode 100644 index 0000000000000000000000000000000000000000..ba0c50f92d4412afa43887b137b4505fbe882b36 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/local/distances.py @@ -0,0 +1,302 @@ +from enum import Enum +from typing import Optional, Union + +import numpy as np + +from qdrant_client.conversions import common_types as types +from qdrant_client.http import models + +EPSILON = 1.1920929e-7 # https://doc.rust-lang.org/std/f32/constant.EPSILON.html +# https://github.com/qdrant/qdrant/blob/7164ac4a5987d28f1c93f5712aef8e09e7d93555/lib/segment/src/spaces/simple_avx.rs#L99C10-L99C10 + + +class DistanceOrder(str, Enum): + BIGGER_IS_BETTER = "bigger_is_better" + SMALLER_IS_BETTER = "smaller_is_better" + + +class RecoQuery: + def __init__( + self, + positive: Optional[list[list[float]]] = None, + negative: Optional[list[list[float]]] = None, + strategy: Optional[models.RecommendStrategy] = None, + ): + assert strategy is not None, "Recommend strategy must be provided" + + self.strategy = strategy + positive = positive if positive is not None else [] + negative = negative if negative is not None else [] + + self.positive: list[types.NumpyArray] = [np.array(vector) for vector in positive] + self.negative: list[types.NumpyArray] = [np.array(vector) for vector in negative] + + assert not np.isnan(self.positive).any(), "Positive vectors must not contain NaN" + assert not np.isnan(self.negative).any(), "Negative vectors must not contain NaN" + + +class ContextPair: + def __init__(self, positive: list[float], negative: list[float]): + self.positive: types.NumpyArray = np.array(positive) + self.negative: types.NumpyArray = np.array(negative) + + assert not np.isnan(self.positive).any(), "Positive vector must not contain NaN" + assert not np.isnan(self.negative).any(), "Negative vector must not contain NaN" + + +class DiscoveryQuery: + def __init__(self, target: list[float], context: list[ContextPair]): + self.target: types.NumpyArray = np.array(target) + self.context = context + + assert not np.isnan(self.target).any(), "Target vector must not contain NaN" + + +class ContextQuery: + def __init__(self, context_pairs: list[ContextPair]): + self.context_pairs = context_pairs + + +DenseQueryVector = Union[ + DiscoveryQuery, + ContextQuery, + RecoQuery, +] + + +def distance_to_order(distance: models.Distance) -> DistanceOrder: + """ + Convert distance to order + Args: + distance: distance to convert + Returns: + order + """ + if distance == models.Distance.EUCLID: + return DistanceOrder.SMALLER_IS_BETTER + elif distance == models.Distance.MANHATTAN: + return DistanceOrder.SMALLER_IS_BETTER + + return DistanceOrder.BIGGER_IS_BETTER + + +def cosine_similarity(query: types.NumpyArray, vectors: types.NumpyArray) -> types.NumpyArray: + """ + Calculate cosine distance between query and vectors + Args: + query: query vector + vectors: vectors to calculate distance with + Returns: + distances + """ + vectors_norm = np.linalg.norm(vectors, axis=-1)[:, np.newaxis] + vectors /= np.where(vectors_norm != 0.0, vectors_norm, EPSILON) + + if len(query.shape) == 1: + query_norm = np.linalg.norm(query) + query /= np.where(query_norm != 0.0, query_norm, EPSILON) + return np.dot(vectors, query) + + query_norm = np.linalg.norm(query, axis=-1)[:, np.newaxis] + query /= np.where(query_norm != 0.0, query_norm, EPSILON) + return np.dot(query, vectors.T) + + +def dot_product(query: types.NumpyArray, vectors: types.NumpyArray) -> types.NumpyArray: + """ + Calculate dot product between query and vectors + Args: + query: query vector. + vectors: vectors to calculate distance with + Returns: + distances + """ + if len(query.shape) == 1: + return np.dot(vectors, query) + else: + return np.dot(query, vectors.T) + + +def euclidean_distance(query: types.NumpyArray, vectors: types.NumpyArray) -> types.NumpyArray: + """ + Calculate euclidean distance between query and vectors + Args: + query: query vector. + vectors: vectors to calculate distance with + Returns: + distances + """ + if len(query.shape) == 1: + return np.linalg.norm(vectors - query, axis=-1) + else: + return np.linalg.norm(vectors - query[:, np.newaxis], axis=-1) + + +def manhattan_distance(query: types.NumpyArray, vectors: types.NumpyArray) -> types.NumpyArray: + """ + Calculate manhattan distance between query and vectors + Args: + query: query vector. + vectors: vectors to calculate distance with + Returns: + distances + """ + if len(query.shape) == 1: + return np.sum(np.abs(vectors - query), axis=-1) + else: + return np.sum(np.abs(vectors - query[:, np.newaxis]), axis=-1) + + +def calculate_distance( + query: types.NumpyArray, vectors: types.NumpyArray, distance_type: models.Distance +) -> types.NumpyArray: + assert not np.isnan(query).any(), "Query vector must not contain NaN" + + if distance_type == models.Distance.COSINE: + return cosine_similarity(query, vectors) + elif distance_type == models.Distance.DOT: + return dot_product(query, vectors) + elif distance_type == models.Distance.EUCLID: + return euclidean_distance(query, vectors) + elif distance_type == models.Distance.MANHATTAN: + return manhattan_distance(query, vectors) + else: + raise ValueError(f"Unknown distance type {distance_type}") + + +def calculate_distance_core( + query: types.NumpyArray, vectors: types.NumpyArray, distance_type: models.Distance +) -> types.NumpyArray: + """ + Calculate same internal distances as in core, rather than the final displayed distance + """ + assert not np.isnan(query).any(), "Query vector must not contain NaN" + + if distance_type == models.Distance.EUCLID: + return -np.square(vectors - query, dtype=np.float32).sum(axis=1, dtype=np.float32) + if distance_type == models.Distance.MANHATTAN: + return -np.abs(vectors - query, dtype=np.float32).sum(axis=1, dtype=np.float32) + else: + return calculate_distance(query, vectors, distance_type) + + +def fast_sigmoid(x: np.float32) -> np.float32: + if np.isnan(x) or np.isinf(x): + # To avoid divisions on NaNs or inf, which gets: RuntimeWarning: invalid value encountered in scalar divide + return x + return x / np.add(1.0, abs(x)) + + +def scaled_fast_sigmoid(x: np.float32) -> np.float32: + return 0.5 * (np.add(fast_sigmoid(x), 1.0)) + + +def calculate_recommend_best_scores( + query: RecoQuery, vectors: types.NumpyArray, distance_type: models.Distance +) -> types.NumpyArray: + def get_best_scores(examples: list[types.NumpyArray]) -> types.NumpyArray: + vector_count = vectors.shape[0] + + # Get scores to all examples + scores: list[types.NumpyArray] = [] + for example in examples: + score = calculate_distance_core(example, vectors, distance_type) + scores.append(score) + + # Keep only max for each vector + if len(scores) == 0: + scores.append(np.full(vector_count, -np.inf)) + best_scores = np.array(scores, dtype=np.float32).max(axis=0) + + return best_scores + + pos = get_best_scores(query.positive) + neg = get_best_scores(query.negative) + + # Choose from best positive or best negative, + # in in both cases we apply sigmoid and then negate depending on the order + return np.where( + pos > neg, + np.fromiter((scaled_fast_sigmoid(xi) for xi in pos), pos.dtype), + np.fromiter((-scaled_fast_sigmoid(xi) for xi in neg), neg.dtype), + ) + + +def calculate_recommend_sum_scores( + query: RecoQuery, vectors: types.NumpyArray, distance_type: models.Distance +) -> types.NumpyArray: + def get_sum_scores(examples: list[types.NumpyArray]) -> types.NumpyArray: + vector_count = vectors.shape[0] + + scores: list[types.NumpyArray] = [] + for example in examples: + score = calculate_distance_core(example, vectors, distance_type) + scores.append(score) + + if len(scores) == 0: + scores.append(np.zeros(vector_count)) + + sum_scores = np.array(scores, dtype=np.float32).sum(axis=0) + + return sum_scores + + pos = get_sum_scores(query.positive) + neg = get_sum_scores(query.negative) + + return pos - neg + + +def calculate_discovery_ranks( + context: list[ContextPair], + vectors: types.NumpyArray, + distance_type: models.Distance, +) -> types.NumpyArray: + overall_ranks = np.zeros(vectors.shape[0], dtype=np.int32) + for pair in context: + # Get distances to positive and negative vectors + pos = calculate_distance_core(pair.positive, vectors, distance_type) + neg = calculate_distance_core(pair.negative, vectors, distance_type) + + pair_ranks = np.array( + [ + 1 if is_bigger else 0 if is_equal else -1 + for is_bigger, is_equal in zip(pos > neg, pos == neg) + ] + ) + + overall_ranks += pair_ranks + + return overall_ranks + + +def calculate_discovery_scores( + query: DiscoveryQuery, vectors: types.NumpyArray, distance_type: models.Distance +) -> types.NumpyArray: + ranks = calculate_discovery_ranks(query.context, vectors, distance_type) + + # Get distances to target + distances_to_target = calculate_distance_core(query.target, vectors, distance_type) + + sigmoided_distances = np.fromiter( + (scaled_fast_sigmoid(xi) for xi in distances_to_target), np.float32 + ) + + return ranks + sigmoided_distances + + +def calculate_context_scores( + query: ContextQuery, vectors: types.NumpyArray, distance_type: models.Distance +) -> types.NumpyArray: + overall_scores = np.zeros(vectors.shape[0], dtype=np.float32) + for pair in query.context_pairs: + # Get distances to positive and negative vectors + pos = calculate_distance_core(pair.positive, vectors, distance_type) + neg = calculate_distance_core(pair.negative, vectors, distance_type) + + difference = pos - neg - EPSILON + pair_scores = np.fromiter( + (fast_sigmoid(xi) for xi in np.minimum(difference, 0.0)), np.float32 + ) + overall_scores += pair_scores + + return overall_scores diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/local/geo.py b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/local/geo.py new file mode 100644 index 0000000000000000000000000000000000000000..6a36a3cfcf72c174f8a3af9c92ffd477a54533ad --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/local/geo.py @@ -0,0 +1,90 @@ +from math import asin, cos, radians, sin, sqrt + +# Radius of earth in meters, [as recommended by the IUGG](ftp://athena.fsv.cvut.cz/ZFG/grs80-Moritz.pdf) +MEAN_EARTH_RADIUS = 6371008.8 + + +def geo_distance(lon1: float, lat1: float, lon2: float, lat2: float) -> float: + """ + Calculate distance between two points on Earth using Haversine formula. + + Args: + lon1: longitude of first point + lat1: latitude of first point + lon2: longitude of second point + lat2: latitude of second point + + Returns: + distance in meters + """ + + # convert decimal degrees to radians + lon1, lat1, lon2, lat2 = map(radians, [lon1, lat1, lon2, lat2]) + # haversine formula + dlon = lon2 - lon1 + dlat = lat2 - lat1 + a = sin(dlat / 2) ** 2 + cos(lat1) * cos(lat2) * sin(dlon / 2) ** 2 + c = 2 * asin(sqrt(a)) + + return MEAN_EARTH_RADIUS * c + + +def test_geo_distance() -> None: + moscow = {"lon": 37.6173, "lat": 55.7558} + london = {"lon": -0.1278, "lat": 51.5074} + berlin = {"lon": 13.4050, "lat": 52.5200} + + assert geo_distance(moscow["lon"], moscow["lat"], moscow["lon"], moscow["lat"]) < 1.0 + + assert geo_distance(moscow["lon"], moscow["lat"], london["lon"], london["lat"]) > 2400 * 1000 + assert geo_distance(moscow["lon"], moscow["lat"], london["lon"], london["lat"]) < 2600 * 1000 + assert geo_distance(moscow["lon"], moscow["lat"], berlin["lon"], berlin["lat"]) > 1600 * 1000 + assert geo_distance(moscow["lon"], moscow["lat"], berlin["lon"], berlin["lat"]) < 1650 * 1000 + + +def boolean_point_in_polygon( + point: tuple[float, float], + exterior: list[tuple[float, float]], + interiors: list[list[tuple[float, float]]], +) -> bool: + inside_poly = False + + if in_ring(point, exterior, True): + in_hole = False + k = 0 + while k < len(interiors) and not in_hole: + if in_ring(point, interiors[k], False): + in_hole = True + k += 1 + if not in_hole: + inside_poly = True + + return inside_poly + + +def in_ring( + pt: tuple[float, float], ring: list[tuple[float, float]], ignore_boundary: bool +) -> bool: + is_inside = False + if ring[0][0] == ring[len(ring) - 1][0] and ring[0][1] == ring[len(ring) - 1][1]: + ring = ring[0 : len(ring) - 1] + j = len(ring) - 1 + for i in range(0, len(ring)): + xi = ring[i][0] + yi = ring[i][1] + xj = ring[j][0] + yj = ring[j][1] + on_boundary = ( + (pt[1] * (xi - xj) + yi * (xj - pt[0]) + yj * (pt[0] - xi) == 0) + and ((xi - pt[0]) * (xj - pt[0]) <= 0) + and ((yi - pt[1]) * (yj - pt[1]) <= 0) + ) + if on_boundary: + return not ignore_boundary + intersect = ((yi > pt[1]) != (yj > pt[1])) and ( + pt[0] < (xj - xi) * (pt[1] - yi) / (yj - yi) + xi + ) + if intersect: + is_inside = not is_inside + j = i + return is_inside diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/local/json_path_parser.py b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/local/json_path_parser.py new file mode 100644 index 0000000000000000000000000000000000000000..1ce15ab510adfbc2bee6da5cc441da296e778681 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/local/json_path_parser.py @@ -0,0 +1,151 @@ +from enum import Enum +from typing import Optional + +from pydantic import BaseModel + + +class JsonPathItemType(str, Enum): + KEY = "key" + INDEX = "index" + WILDCARD_INDEX = "wildcard_index" + + +class JsonPathItem(BaseModel): + item_type: JsonPathItemType + index: Optional[int] = ( + None # split into index and key instead of using Union, because pydantic coerces + ) + # int to str even in case of Union[int, str]. Tested with pydantic==1.10.14 + key: Optional[str] = None + + +def parse_json_path(key: str) -> list[JsonPathItem]: + """Parse and validate json path + + Args: + key: json path + + Returns: + list[JsonPathItem]: json path split into separate keys + + Raises: + ValueError: if json path is invalid or empty + + Examples: + + # >>> parse_json_path("a[0][1].b") + # [ + # JsonPathItem(item_type=, value='a'), + # JsonPathItem(item_type=, value=0), + # JsonPathItem(item_type=, value=1), + # JsonPathItem(item_type=, value='b') + # ] + """ + keys = [] + json_path = key + while json_path: + json_path_item, rest = match_quote(json_path) + if json_path_item is None: + json_path_item, rest = match_key(json_path) + + if json_path_item is None: + raise ValueError("Invalid path") + + keys.append(json_path_item) + brackets_chunks, rest = match_brackets(rest) + keys.extend(brackets_chunks) + json_path = trunk_sep(rest) + if not json_path: + return keys + continue + + raise ValueError("Invalid path") + + +def trunk_sep(path: str) -> str: + if not path: + return path + + if len(path) == 1: + raise ValueError("Invalid path") + + if path.startswith("."): + return path[1:] + + elif path.startswith("["): + return path + else: + raise ValueError("Invalid path") + + +def match_quote(path: str) -> tuple[Optional[JsonPathItem], str]: + if not path.startswith('"'): + return None, path + + left_quote_pos = 0 + right_quote_pos = path.find('"', 1) + + if path.count('"') < 2: + raise ValueError("Invalid path") + + return ( + JsonPathItem( + item_type=JsonPathItemType.KEY, key=path[left_quote_pos + 1 : right_quote_pos] + ), + path[right_quote_pos + 1 :], + ) + + +def match_key(path: str) -> tuple[Optional[JsonPathItem], str]: + char_counter = 0 + for char in path: + if not char.isalnum() and char not in ["_", "-"]: + break + char_counter += 1 + if char_counter == 0: + return None, path + + return ( + JsonPathItem(item_type=JsonPathItemType.KEY, key=path[:char_counter]), + path[char_counter:], + ) + + +def match_brackets(rest: str) -> tuple[list[JsonPathItem], str]: + keys = [] + + while rest: + json_path_item, rest = _match_brackets(rest) + + if json_path_item is None: + break + + keys.append(json_path_item) + + return keys, rest + + +def _match_brackets(path: str) -> tuple[Optional[JsonPathItem], str]: + if "[" not in path or not path.startswith("["): + return None, path + + left_bracket_pos = 0 + right_bracket_pos = path.find("]", left_bracket_pos + 1) + + if right_bracket_pos == -1: + raise ValueError("Invalid path") + + if right_bracket_pos == (left_bracket_pos + 1): + return ( + JsonPathItem(item_type=JsonPathItemType.WILDCARD_INDEX), + path[right_bracket_pos + 1 :], + ) + + try: + index = int(path[left_bracket_pos + 1 : right_bracket_pos]) + return ( + JsonPathItem(item_type=JsonPathItemType.INDEX, index=index), + path[right_bracket_pos + 1 :], + ) + except ValueError as e: + raise ValueError("Invalid path") from e diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/local/local_collection.py b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/local/local_collection.py new file mode 100644 index 0000000000000000000000000000000000000000..216ccad389e291a6fd05a57c2c589821dc695222 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/local/local_collection.py @@ -0,0 +1,2855 @@ +import json +import math +import uuid +from collections import OrderedDict, defaultdict +from typing import ( + Any, + Callable, + Optional, + Sequence, + Union, + get_args, +) +from copy import deepcopy +import warnings + +import numpy as np + +from qdrant_client import grpc as grpc +from qdrant_client.common.client_warnings import show_warning_once +from qdrant_client._pydantic_compat import construct, to_jsonable_python as _to_jsonable_python +from qdrant_client.conversions import common_types as types +from qdrant_client.conversions.common_types import get_args_subscribed +from qdrant_client.conversions.conversion import GrpcToRest +from qdrant_client.http import models +from qdrant_client.http.models import ScoredPoint +from qdrant_client.http.models.models import Distance, ExtendedPointId, SparseVector, OrderValue +from qdrant_client.hybrid.formula import evaluate_expression, raise_non_finite_error +from qdrant_client.hybrid.fusion import reciprocal_rank_fusion, distribution_based_score_fusion +from qdrant_client.local.distances import ( + ContextPair, + ContextQuery, + DenseQueryVector, + DiscoveryQuery, + DistanceOrder, + RecoQuery, + calculate_context_scores, + calculate_discovery_scores, + calculate_distance, + calculate_recommend_best_scores, + distance_to_order, + calculate_recommend_sum_scores, + calculate_distance_core, +) +from qdrant_client.local.multi_distances import ( + MultiQueryVector, + MultiRecoQuery, + MultiDiscoveryQuery, + MultiContextQuery, + MultiContextPair, + calculate_multi_distance, + calculate_multi_recommend_best_scores, + calculate_multi_discovery_scores, + calculate_multi_context_scores, + calculate_multi_recommend_sum_scores, + calculate_multi_distance_core, +) +from qdrant_client.local.json_path_parser import JsonPathItem, parse_json_path +from qdrant_client.local.order_by import to_order_value +from qdrant_client.local.payload_filters import calculate_payload_mask +from qdrant_client.local.payload_value_extractor import value_by_key, parse_uuid +from qdrant_client.local.payload_value_setter import set_value_by_key +from qdrant_client.local.persistence import CollectionPersistence +from qdrant_client.local.sparse import ( + empty_sparse_vector, + sort_sparse_vector, + validate_sparse_vector, +) +from qdrant_client.local.sparse_distances import ( + SparseContextPair, + SparseContextQuery, + SparseDiscoveryQuery, + SparseQueryVector, + SparseRecoQuery, + calculate_distance_sparse, + calculate_sparse_context_scores, + calculate_sparse_discovery_scores, + calculate_sparse_recommend_best_scores, + merge_positive_and_negative_avg, + sparse_avg, + calculate_sparse_recommend_sum_scores, +) + +DEFAULT_VECTOR_NAME = "" +EPSILON = 1.1920929e-7 # https://doc.rust-lang.org/std/f32/constant.EPSILON.html +# https://github.com/qdrant/qdrant/blob/7164ac4a5987d28f1c93f5712aef8e09e7d93555/lib/segment/src/spaces/simple_avx.rs#L99C10-L99C10 + + +def to_jsonable_python(x: Any) -> Any: + try: + return json.loads(json.dumps(x, allow_nan=True)) + except Exception: + return json.loads(json.dumps(x, allow_nan=True, default=_to_jsonable_python)) + + +class LocalCollection: + """ + LocalCollection is a class that represents a collection of vectors in the local storage. + """ + + LARGE_DATA_THRESHOLD = 20_000 + + def __init__( + self, + config: models.CreateCollection, + location: Optional[str] = None, + force_disable_check_same_thread: bool = False, + ) -> None: + """ + Create or load a collection from the local storage. + Args: + location: path to the collection directory. If None, the collection will be created in memory. + force_disable_check_same_thread: force disable check_same_thread for sqlite3 connection. default: False + """ + self.vectors_config, self.multivectors_config = self._resolve_vectors_config( + config.vectors + ) + sparse_vectors_config = config.sparse_vectors + self.vectors: dict[str, types.NumpyArray] = { + name: np.zeros((0, params.size), dtype=np.float32) + for name, params in self.vectors_config.items() + } + self.sparse_vectors: dict[str, list[SparseVector]] = ( + {name: [] for name, params in sparse_vectors_config.items()} + if sparse_vectors_config is not None + else {} + ) + self.sparse_vectors_idf: dict[ + str, dict[int, int] + ] = {} # vector_name: {idx_in_vocab: doc frequency} + self.multivectors: dict[str, list[types.NumpyArray]] = { + name: [] for name in self.multivectors_config + } + self.payload: list[models.Payload] = [] + self.deleted: types.NumpyArray = np.zeros(0, dtype=bool) + self._all_vectors_keys = ( + list(self.vectors.keys()) + + list(self.sparse_vectors.keys()) + + list(self.multivectors.keys()) + ) + self.deleted_per_vector: dict[str, types.NumpyArray] = { + name: np.zeros(0, dtype=bool) for name in self._all_vectors_keys + } + self.ids: dict[models.ExtendedPointId, int] = {} # Mapping from external id to internal id + self.ids_inv: list[models.ExtendedPointId] = [] # Mapping from internal id to external id + self.persistent = location is not None + self.storage = None + self.config = config + if location is not None: + self.storage = CollectionPersistence(location, force_disable_check_same_thread) + self.load_vectors() + + @staticmethod + def _resolve_vectors_config( + vectors: dict[str, models.VectorParams], + ) -> tuple[dict[str, models.VectorParams], dict[str, models.VectorParams]]: + vectors_config = {} + multivectors_config = {} + if isinstance(vectors, models.VectorParams): + if vectors.multivector_config is not None: + multivectors_config = {DEFAULT_VECTOR_NAME: vectors} + else: + vectors_config = {DEFAULT_VECTOR_NAME: vectors} + return vectors_config, multivectors_config + + for name, params in vectors.items(): + if params.multivector_config is not None: + multivectors_config[name] = params + else: + vectors_config[name] = params + + return vectors_config, multivectors_config + + def close(self) -> None: + if self.storage is not None: + self.storage.close() + + def _update_idf_append(self, vector: SparseVector, vector_name: str) -> None: + if vector_name not in self.sparse_vectors_idf: + self.sparse_vectors_idf[vector_name] = defaultdict(int) + for idx in vector.indices: + self.sparse_vectors_idf[vector_name][idx] += 1 + + def _update_idf_remove(self, vector: SparseVector, vector_name: str) -> None: + for idx in vector.indices: + self.sparse_vectors_idf[vector_name][idx] -= 1 + + @classmethod + def _compute_idf(cls, df: int, n: int) -> float: + # ((n - df + 0.5) / (df + 0.5) + 1.).ln() + return math.log((n - df + 0.5) / (df + 0.5) + 1) + + def _rescore_idf(self, vector: SparseVector, vector_name: str) -> SparseVector: + num_docs = self.count(count_filter=None).count + new_values = [] + idf_store = self.sparse_vectors_idf.get(vector_name) + if idf_store is None: + return vector + + for idx, value in zip(vector.indices, vector.values): + document_frequency = idf_store.get(idx, 0) + idf = self._compute_idf(document_frequency, num_docs) + new_values.append(value * idf) + + return SparseVector(indices=vector.indices, values=new_values) + + def load_vectors(self) -> None: + if self.storage is not None: + vectors = defaultdict(list) + sparse_vectors = defaultdict(list) + multivectors = defaultdict(list) + deleted_ids = [] + + for idx, point in enumerate(self.storage.load()): + # id tracker + self.ids[point.id] = idx + # no gaps in idx + self.ids_inv.append(point.id) + + # payload tracker + self.payload.append(to_jsonable_python(point.payload) or {}) + + # persisted named vectors + loaded_vector = point.vector + + # add default name to anonymous dense or multivector + if isinstance(point.vector, list): + loaded_vector = {DEFAULT_VECTOR_NAME: point.vector} + + # handle dense vectors + all_dense_vector_names = list(self.vectors.keys()) + for name in all_dense_vector_names: + v = loaded_vector.get(name) + if v is not None: + vectors[name].append(v) + else: + vectors[name].append( + np.ones(self.vectors_config[name].size, dtype=np.float32) + ) + deleted_ids.append((idx, name)) + + # handle sparse vectors + all_sparse_vector_names = list(self.sparse_vectors.keys()) + for name in all_sparse_vector_names: + v = loaded_vector.get(name) + if v is not None: + sparse_vectors[name].append(v) + else: + sparse_vectors[name].append(empty_sparse_vector()) + deleted_ids.append((idx, name)) + + # handle multivectors + all_multivector_names = list(self.multivectors.keys()) + for name in all_multivector_names: + v = loaded_vector.get(name) + if v is not None: + multivectors[name].append(v) + else: + multivectors[name].append(np.array([])) + deleted_ids.append((idx, name)) + + # setup dense vectors by name + for name, named_vectors in vectors.items(): + self.vectors[name] = np.array(named_vectors) + self.deleted_per_vector[name] = np.zeros(len(self.payload), dtype=bool) + + # setup sparse vectors by name + for name, named_vectors in sparse_vectors.items(): + self.sparse_vectors[name] = named_vectors + self.deleted_per_vector[name] = np.zeros(len(self.payload), dtype=bool) + for vector in named_vectors: + self._update_idf_append(vector, name) + + # setup multivectors by name + for name, named_vectors in multivectors.items(): + self.multivectors[name] = [np.array(vector) for vector in named_vectors] + self.deleted_per_vector[name] = np.zeros(len(self.payload), dtype=bool) + + # track deleted points by named vector + for idx, name in deleted_ids: + self.deleted_per_vector[name][idx] = 1 + + self.deleted = np.zeros(len(self.payload), dtype=bool) + + @classmethod + def _resolve_query_vector_name( + cls, + query_vector: Union[ + list[float], + tuple[str, list[float]], + list[list[float]], + tuple[str, list[list[float]]], + types.NamedVector, + types.NamedSparseVector, + DenseQueryVector, + tuple[str, DenseQueryVector], + tuple[str, SparseQueryVector], + MultiQueryVector, + tuple[str, MultiQueryVector], + types.NumpyArray, + ], + ) -> tuple[ + str, Union[DenseQueryVector, SparseQueryVector, MultiQueryVector, types.NumpyArray] + ]: + # SparseQueryVector is not in the method's signature, because sparse vectors can only be used as named vectors, + # and there is no default name for them + vector: Union[DenseQueryVector, SparseQueryVector, MultiQueryVector, types.NumpyArray] + if isinstance(query_vector, tuple): + name, query = query_vector + if isinstance(query, list): + vector = np.array(query) + else: + vector = query + elif isinstance(query_vector, np.ndarray): + name = DEFAULT_VECTOR_NAME + vector = query_vector + elif isinstance(query_vector, types.NamedVector): + name = query_vector.name + vector = np.array(query_vector.vector) + elif isinstance(query_vector, types.NamedSparseVector): + name = query_vector.name + vector = query_vector.vector + elif isinstance(query_vector, list): + name = DEFAULT_VECTOR_NAME + vector = np.array(query_vector) + elif isinstance(query_vector, get_args(DenseQueryVector)): + name = DEFAULT_VECTOR_NAME + vector = query_vector + elif isinstance(query_vector, get_args(MultiQueryVector)): + name = DEFAULT_VECTOR_NAME + vector = query_vector + else: + raise ValueError(f"Unsupported vector type {type(query_vector)}") + + return name, vector + + def get_vector_params(self, name: str) -> models.VectorParams: + if isinstance(self.config.vectors, dict): + if name in self.config.vectors: + return self.config.vectors[name] + else: + raise ValueError(f"Vector {name} is not found in the collection") + + if isinstance(self.config.vectors, models.VectorParams): + if name != DEFAULT_VECTOR_NAME: + raise ValueError(f"Vector {name} is not found in the collection") + + return self.config.vectors + + raise ValueError(f"Malformed config.vectors: {self.config.vectors}") + + @classmethod + def _check_include_pattern(cls, pattern: str, key: str) -> bool: + """ + >>> LocalCollection._check_include_pattern('a', 'a') + True + >>> LocalCollection._check_include_pattern('a.b', 'b') + False + >>> LocalCollection._check_include_pattern('a.b', 'a.b') + True + >>> LocalCollection._check_include_pattern('a.b', 'a.b.c') + True + >>> LocalCollection._check_include_pattern('a.b[]', 'a.b[].c') + True + >>> LocalCollection._check_include_pattern('a.b[]', 'a.b.c') + False + >>> LocalCollection._check_include_pattern('a', 'a.b') + True + >>> LocalCollection._check_include_pattern('a.b', 'a') + True + >>> LocalCollection._check_include_pattern('a', 'aa.b.c') + False + >>> LocalCollection._check_include_pattern('a_b', 'a') + False + """ + pattern_parts = pattern.replace(".", "[.").split("[") + key_parts = key.replace(".", "[.").split("[") + return all(p == v for p, v in zip(pattern_parts, key_parts)) + + @classmethod + def _check_exclude_pattern(cls, pattern: str, key: str) -> bool: + if len(pattern) > len(key): + return False + pattern_parts = pattern.replace(".", "[.").split("[") + key_parts = key.replace(".", "[.").split("[") + return all(p == v for p, v in zip(pattern_parts, key_parts)) + + @classmethod + def _filter_payload( + cls, payload: Any, predicate: Callable[[str], bool], path: str = "" + ) -> Any: + if isinstance(payload, dict): + res = {} + if path != "": + new_path = path + "." + else: + new_path = path + + for key, value in payload.items(): + if predicate(new_path + key): + res[key] = cls._filter_payload(value, predicate, new_path + key) + return res + elif isinstance(payload, list): + res_array = [] + path = path + "[]" + for idx, value in enumerate(payload): + if predicate(path): + res_array.append(cls._filter_payload(value, predicate, path)) + return res_array + else: + return payload + + @classmethod + def _process_payload( + cls, + payload: dict, + with_payload: Union[bool, Sequence[str], types.PayloadSelector] = True, + ) -> Optional[dict]: + if not with_payload: + return None + + if isinstance(with_payload, bool): + return payload + + if isinstance(with_payload, list): + return cls._filter_payload( + payload, + lambda key: any( + map(lambda pattern: cls._check_include_pattern(pattern, key), with_payload) # type: ignore + ), + ) + + if isinstance(with_payload, models.PayloadSelectorInclude): + return cls._filter_payload( + payload, + lambda key: any( + map( + lambda pattern: cls._check_include_pattern(pattern, key), + with_payload.include, # type: ignore + ) + ), + ) + + if isinstance(with_payload, models.PayloadSelectorExclude): + return cls._filter_payload( + payload, + lambda key: all( + map( + lambda pattern: not cls._check_exclude_pattern(pattern, key), + with_payload.exclude, # type: ignore + ) + ), + ) + + return payload + + def _get_payload( + self, + idx: int, + with_payload: Union[bool, Sequence[str], types.PayloadSelector] = True, + return_copy: bool = True, + ) -> Optional[models.Payload]: + payload = self.payload[idx] + processed_payload = self._process_payload(payload, with_payload) + return deepcopy(processed_payload) if return_copy else processed_payload + + def _get_vectors( + self, idx: int, with_vectors: Union[bool, Sequence[str], None] = False + ) -> Optional[models.VectorStruct]: + if with_vectors is False or with_vectors is None: + return None + + dense_vectors = { + name: self.vectors[name][idx].tolist() + for name in self.vectors + if not self.deleted_per_vector[name][idx] + } + + sparse_vectors = { + name: self.sparse_vectors[name][idx] + for name in self.sparse_vectors + if not self.deleted_per_vector[name][idx] + } + + multivectors = { + name: self.multivectors[name][idx].tolist() + for name in self.multivectors + if not self.deleted_per_vector[name][idx] + } + + # merge vectors + all_vectors = {**dense_vectors, **sparse_vectors, **multivectors} + + if isinstance(with_vectors, list): + all_vectors = {name: all_vectors[name] for name in with_vectors if name in all_vectors} + + if len(all_vectors) == 1 and DEFAULT_VECTOR_NAME in all_vectors: + return all_vectors[DEFAULT_VECTOR_NAME] + + return all_vectors + + def _payload_and_non_deleted_mask( + self, + payload_filter: Optional[models.Filter], + vector_name: Optional[str] = None, + ) -> np.ndarray: + """ + Calculate mask for filtered payload and non-deleted points. True - accepted, False - rejected + """ + payload_mask = calculate_payload_mask( + payloads=self.payload, + payload_filter=payload_filter, + ids_inv=self.ids_inv, + deleted_per_vector=self.deleted_per_vector, + ) + + # in deleted: 1 - deleted, 0 - not deleted + # in payload_mask: 1 - accepted, 0 - rejected + # in mask: 1 - ok, 0 - rejected + mask = payload_mask & ~self.deleted + + if vector_name is not None: + # in deleted: 1 - deleted, 0 - not deleted + mask = mask & ~self.deleted_per_vector[vector_name] + + return mask + + def _calculate_has_vector(self, internal_id: int) -> dict[str, bool]: + has_vector: dict[str, bool] = {} + for vector_name, deleted in self.deleted_per_vector.items(): + if not deleted[internal_id]: + has_vector[vector_name] = True + + return has_vector + + def search( + self, + query_vector: Union[ + list[float], + tuple[str, list[float]], + list[list[float]], + tuple[str, list[list[float]]], + types.NamedVector, + types.NamedSparseVector, + DenseQueryVector, + tuple[str, DenseQueryVector], + SparseQueryVector, + tuple[str, SparseQueryVector], + MultiQueryVector, + tuple[str, MultiQueryVector], + types.NumpyArray, + ], + query_filter: Optional[types.Filter] = None, + limit: int = 10, + offset: Optional[int] = None, + with_payload: Union[bool, Sequence[str], types.PayloadSelector] = True, + with_vectors: Union[bool, Sequence[str]] = False, + score_threshold: Optional[float] = None, + ) -> list[models.ScoredPoint]: + name, query_vector = self._resolve_query_vector_name(query_vector) + result: list[models.ScoredPoint] = [] + sparse_scoring = False + rescore_idf = False + + # early exit if the named vector does not exist + if isinstance(query_vector, get_args(SparseQueryVector)): + if name not in self.sparse_vectors: + raise ValueError(f"Sparse vector {name} is not found in the collection") + vectors = self.sparse_vectors[name] + if self.config.sparse_vectors[name].modifier == models.Modifier.IDF: + rescore_idf = True + distance = Distance.DOT + sparse_scoring = True + elif isinstance(query_vector, get_args(MultiQueryVector)) or ( + isinstance(query_vector, np.ndarray) and len(query_vector.shape) == 2 + ): + if name not in self.multivectors: + raise ValueError(f"Multivector {name} is not found in the collection") + vectors = self.multivectors[name] + distance = self.get_vector_params(name).distance + else: + if name not in self.vectors: + raise ValueError(f"Dense vector {name} is not found in the collection") + vectors = self.vectors[name] + distance = self.get_vector_params(name).distance + + vectors = vectors[: len(self.payload)] + + if isinstance(query_vector, np.ndarray): + if len(query_vector.shape) == 1: + scores = calculate_distance(query_vector, vectors, distance) + else: + scores = calculate_multi_distance(query_vector, vectors, distance) + elif isinstance(query_vector, RecoQuery): + if query_vector.strategy == models.RecommendStrategy.BEST_SCORE: + scores = calculate_recommend_best_scores(query_vector, vectors, distance) + elif query_vector.strategy == models.RecommendStrategy.SUM_SCORES: + scores = calculate_recommend_sum_scores(query_vector, vectors, distance) + else: + raise TypeError( + f"Recommend strategy is expected to be either " + f"BEST_SCORE or SUM_SCORES, got: {query_vector.strategy}" + ) + elif isinstance(query_vector, SparseRecoQuery): + if rescore_idf: + query_vector = query_vector.transform_sparse(lambda x: self._rescore_idf(x, name)) + if query_vector.strategy == models.RecommendStrategy.BEST_SCORE: + scores = calculate_sparse_recommend_best_scores(query_vector, vectors) + elif query_vector.strategy == models.RecommendStrategy.SUM_SCORES: + scores = calculate_sparse_recommend_sum_scores(query_vector, vectors) + else: + raise TypeError( + f"Recommend strategy is expected to be either " + f"BEST_SCORE or SUM_SCORES, got: {query_vector.strategy}" + ) + elif isinstance(query_vector, MultiRecoQuery): + if query_vector.strategy == models.RecommendStrategy.BEST_SCORE: + scores = calculate_multi_recommend_best_scores(query_vector, vectors, distance) + elif query_vector.strategy == models.RecommendStrategy.SUM_SCORES: + scores = calculate_multi_recommend_sum_scores(query_vector, vectors, distance) + else: + raise TypeError( + f"Recommend strategy is expected to be either " + f"BEST_SCORE or SUM_SCORES, got: {query_vector.strategy}" + ) + elif isinstance(query_vector, DiscoveryQuery): + scores = calculate_discovery_scores(query_vector, vectors, distance) + elif isinstance(query_vector, SparseDiscoveryQuery): + if rescore_idf: + query_vector = query_vector.transform_sparse(lambda x: self._rescore_idf(x, name)) + scores = calculate_sparse_discovery_scores(query_vector, vectors) + elif isinstance(query_vector, MultiDiscoveryQuery): + scores = calculate_multi_discovery_scores(query_vector, vectors, distance) + elif isinstance(query_vector, ContextQuery): + scores = calculate_context_scores(query_vector, vectors, distance) + elif isinstance(query_vector, SparseContextQuery): + if rescore_idf: + query_vector = query_vector.transform_sparse(lambda x: self._rescore_idf(x, name)) + scores = calculate_sparse_context_scores(query_vector, vectors) + elif isinstance(query_vector, MultiContextQuery): + scores = calculate_multi_context_scores(query_vector, vectors, distance) + elif isinstance(query_vector, SparseVector): + validate_sparse_vector(query_vector) + if rescore_idf: + query_vector = self._rescore_idf(query_vector, name) + # sparse vector query must be sorted by indices for dot product to work with persisted vectors + query_vector = sort_sparse_vector(query_vector) + scores = calculate_distance_sparse(query_vector, vectors) + else: + raise (ValueError(f"Unsupported query vector type {type(query_vector)}")) + + mask = self._payload_and_non_deleted_mask(query_filter, vector_name=name) + + required_order = distance_to_order(distance) + + if required_order == DistanceOrder.BIGGER_IS_BETTER or isinstance( + query_vector, + ( + DiscoveryQuery, + ContextQuery, + RecoQuery, + MultiDiscoveryQuery, + MultiContextQuery, + MultiRecoQuery, + ), # sparse structures are not required, sparse always uses DOT + ): + order = np.argsort(scores)[::-1] + else: + order = np.argsort(scores) + + offset = offset if offset is not None else 0 + for idx in order: + if len(result) >= limit + offset: + break + + if not mask[idx]: + continue + + score = scores[idx] + # skip undefined scores from sparse vectors + if sparse_scoring and score == -np.inf: + continue + point_id = self.ids_inv[idx] + + if score_threshold is not None: + if required_order == DistanceOrder.BIGGER_IS_BETTER: + if score < score_threshold: + break + else: + if score > score_threshold: + break + + scored_point = construct( + models.ScoredPoint, + id=point_id, + score=float(score), + version=0, + payload=self._get_payload(idx, with_payload), + vector=self._get_vectors(idx, with_vectors), + ) + + result.append(scored_point) + + return result[offset:] + + def query_points( + self, + query: Optional[types.Query] = None, + prefetch: Optional[list[types.Prefetch]] = None, + query_filter: Optional[types.Filter] = None, + limit: int = 10, + offset: int = 0, + with_payload: Union[bool, Sequence[str], types.PayloadSelector] = True, + with_vectors: Union[bool, Sequence[str]] = False, + score_threshold: Optional[float] = None, + using: Optional[str] = None, + **kwargs: Any, + ) -> types.QueryResponse: + """ + Queries points in the local collection, resolving any prefetches first. + + Assumes all vectors have been homogenized so that there are no ids in the inputs + """ + + prefetches = [] + if prefetch is not None: + prefetches = prefetch if isinstance(prefetch, list) else [prefetch] + + if len(prefetches) > 0: + # It is a hybrid/re-scoring query + sources = [self._prefetch(prefetch) for prefetch in prefetches] + + if query is None: + raise ValueError("Query is required for merging prefetches") + + # Merge sources + scored_points = self._merge_sources( + sources=sources, + query=query, + limit=limit, + offset=offset, + using=using, + query_filter=query_filter, + with_payload=with_payload, + with_vectors=with_vectors, + score_threshold=score_threshold, + ) + else: + # It is a base query + scored_points = self._query_collection( + query=query, + using=using, + query_filter=query_filter, + limit=limit, + offset=offset, + with_payload=with_payload, + with_vectors=with_vectors, + score_threshold=score_threshold, + ) + + return types.QueryResponse(points=scored_points) + + def _prefetch(self, prefetch: types.Prefetch) -> list[types.ScoredPoint]: + inner_prefetches = [] + if prefetch.prefetch is not None: + inner_prefetches = ( + prefetch.prefetch if isinstance(prefetch.prefetch, list) else [prefetch.prefetch] + ) + + if len(inner_prefetches) > 0: + sources = [self._prefetch(inner_prefetch) for inner_prefetch in inner_prefetches] + + if prefetch.query is None: + raise ValueError("Query is required for merging prefetches") + + # Merge sources + return self._merge_sources( + sources=sources, + query=prefetch.query, + limit=prefetch.limit if prefetch.limit is not None else 10, + offset=0, + using=prefetch.using, + query_filter=prefetch.filter, + with_payload=False, + with_vectors=False, + score_threshold=prefetch.score_threshold, + ) + else: + # Base case: fetch from collection + return self._query_collection( + query=prefetch.query, + using=prefetch.using, + query_filter=prefetch.filter, + limit=prefetch.limit, + offset=0, + with_payload=False, + with_vectors=False, + score_threshold=prefetch.score_threshold, + ) + + def _merge_sources( + self, + sources: list[list[types.ScoredPoint]], + query: types.Query, + limit: int, + offset: int, + using: Optional[str] = None, + query_filter: Optional[types.Filter] = None, + score_threshold: Optional[float] = None, + with_payload: Union[bool, Sequence[str], types.PayloadSelector] = True, + with_vectors: Union[bool, Sequence[str]] = False, + ) -> list[types.ScoredPoint]: + if isinstance(query, models.FusionQuery): + # Fuse results + if query.fusion == models.Fusion.RRF: + # RRF: Reciprocal Rank Fusion + fused = reciprocal_rank_fusion(responses=sources, limit=limit + offset) + elif query.fusion == models.Fusion.DBSF: + # DBSF: Distribution-Based Score Fusion + fused = distribution_based_score_fusion(responses=sources, limit=limit + offset) + else: + raise ValueError(f"Fusion method {query.fusion} does not exist") + + # Fetch payload and vectors + ids = [point.id for point in fused] + fetched_points = self.retrieve( + ids, with_payload=with_payload, with_vectors=with_vectors + ) + for fetched, scored in zip(fetched_points, fused): + scored.payload = fetched.payload + scored.vector = fetched.vector + + return fused[offset:] + + elif isinstance(query, models.FormulaQuery): + # Re-score with formula + rescored = self._rescore_with_formula( + query=query, + prefetches_results=sources, + limit=limit + offset, + with_payload=with_payload, + with_vectors=with_vectors, + ) + + return rescored[offset:] + else: + # Re-score with vector + sources_ids = set() + for source in sources: + for point in source: + sources_ids.add(point.id) + + if len(sources_ids) == 0: + # no need to perform a query if there are no matches for the sources + return [] + else: + filter_with_sources = _include_ids_in_filter(query_filter, list(sources_ids)) + return self._query_collection( + query=query, + using=using, + query_filter=filter_with_sources, + limit=limit, + offset=offset, + with_payload=with_payload, + with_vectors=with_vectors, + score_threshold=score_threshold, + ) + + def _query_collection( + self, + query: Optional[types.Query] = None, + using: Optional[str] = None, + query_filter: Optional[types.Filter] = None, + limit: Optional[int] = None, + offset: Optional[int] = None, + with_payload: Union[bool, Sequence[str], types.PayloadSelector] = False, + with_vectors: Union[bool, Sequence[str]] = False, + score_threshold: Optional[float] = None, + ) -> list[types.ScoredPoint]: + """ + Performs the query on the collection, assuming it didn't have any prefetches. + """ + + using = using or DEFAULT_VECTOR_NAME + limit = limit or 10 + offset = offset or 0 + + if query is None: + records, _ = self.scroll( + scroll_filter=query_filter, + limit=limit + offset, + with_payload=with_payload, + with_vectors=with_vectors, + ) + return [record_to_scored_point(record) for record in records[offset:]] + elif isinstance(query, models.NearestQuery): + if query.mmr is not None: + return self._search_with_mmr( + query_vector=query.nearest, + mmr=query.mmr, + query_filter=query_filter, + limit=limit, + offset=offset, + using=using, + with_payload=with_payload, + with_vectors=with_vectors, + score_threshold=score_threshold, + ) + + return self.search( + query_vector=(using, query.nearest), + query_filter=query_filter, + limit=limit, + offset=offset, + with_payload=with_payload, + with_vectors=with_vectors, + score_threshold=score_threshold, + ) + elif isinstance(query, models.RecommendQuery): + return self.recommend( + positive=query.recommend.positive, + negative=query.recommend.negative, + strategy=query.recommend.strategy, + using=using, + query_filter=query_filter, + limit=limit, + offset=offset, + with_payload=with_payload, + with_vectors=with_vectors, + score_threshold=score_threshold, + ) + elif isinstance(query, models.DiscoverQuery): + return self.discover( + target=query.discover.target, + context=query.discover.context, + using=using, + query_filter=query_filter, + limit=limit, + offset=offset, + with_payload=with_payload, + with_vectors=with_vectors, + score_threshold=score_threshold, + ) + elif isinstance(query, models.ContextQuery): + return self.discover( + context=query.context, + using=using, + query_filter=query_filter, + limit=limit, + offset=offset, + with_payload=with_payload, + with_vectors=with_vectors, + score_threshold=score_threshold, + ) + elif isinstance(query, models.OrderByQuery): + records, _ = self.scroll( + scroll_filter=query_filter, + order_by=query.order_by, + limit=limit + offset, + with_payload=with_payload, + with_vectors=with_vectors, + ) + return [record_to_scored_point(record) for record in records[offset:]] + elif isinstance(query, models.SampleQuery): + if query.sample == models.Sample.RANDOM: + return self._sample_randomly( + limit=limit, + query_filter=query_filter, + with_payload=with_payload, + with_vectors=with_vectors, + ) + else: + raise ValueError(f"Unknown Sample variant: {query.sample}") + elif isinstance(query, models.FusionQuery): + raise AssertionError("Cannot perform fusion without prefetches") + elif isinstance(query, models.FormulaQuery): + raise AssertionError("Cannot perform formula without prefetches") + else: + # most likely a VectorInput, delegate to search + return self.search( + query_vector=(using, query), + query_filter=query_filter, + limit=limit, + offset=offset, + with_payload=with_payload, + with_vectors=with_vectors, + score_threshold=score_threshold, + ) + + def query_groups( + self, + group_by: str, + query: Union[ + types.PointId, + list[float], + list[list[float]], + types.SparseVector, + types.Query, + types.NumpyArray, + types.Document, + types.Image, + types.InferenceObject, + None, + ] = None, + using: Optional[str] = None, + prefetch: Union[types.Prefetch, list[types.Prefetch], None] = None, + query_filter: Optional[types.Filter] = None, + limit: int = 10, + group_size: int = 3, + with_payload: Union[bool, Sequence[str], types.PayloadSelector] = True, + with_vectors: Union[bool, Sequence[str]] = False, + score_threshold: Optional[float] = None, + with_lookup: Optional[types.WithLookupInterface] = None, + with_lookup_collection: Optional["LocalCollection"] = None, + ) -> models.GroupsResult: + max_limit = len(self.ids_inv) + # rewrite prefetch with larger limit + if prefetch is not None: + if isinstance(prefetch, list): + tmp = [] + for p in prefetch: + tmp.append(set_prefetch_limit_recursively(p, max_limit)) + prefetch = tmp + else: + prefetch = set_prefetch_limit_recursively(prefetch, max_limit) + + points = self.query_points( + query=query, + query_filter=query_filter, + prefetch=prefetch, + using=using, + limit=len(self.ids_inv), + with_payload=True, + with_vectors=with_vectors, + score_threshold=score_threshold, + ) + + groups = OrderedDict() + + for point in points.points: + if not isinstance(point.payload, dict): + continue + + group_values = value_by_key(point.payload, group_by) + if group_values is None: + continue + + group_values = list(set(v for v in group_values if isinstance(v, (str, int)))) + + point.payload = self._process_payload(point.payload, with_payload) + + for group_value in group_values: + if group_value not in groups: + groups[group_value] = models.PointGroup(id=group_value, hits=[]) + + if len(groups[group_value].hits) >= group_size: + continue + + groups[group_value].hits.append(point) + + groups_result: list[models.PointGroup] = list(groups.values())[:limit] + + if isinstance(with_lookup, str): + with_lookup = models.WithLookup( + collection=with_lookup, + with_payload=None, + with_vectors=None, + ) + + if with_lookup is not None and with_lookup_collection is not None: + for group in groups_result: + lookup = with_lookup_collection.retrieve( + ids=[group.id], + with_payload=with_lookup.with_payload, + with_vectors=with_lookup.with_vectors, + ) + group.lookup = next(iter(lookup), None) + + return models.GroupsResult(groups=groups_result) + + def search_groups( + self, + query_vector: Union[ + Sequence[float], + list[list[float]], + tuple[ + str, + Union[ + models.Vector, + RecoQuery, + SparseRecoQuery, + MultiRecoQuery, + types.NumpyArray, + ], + ], + types.NamedVector, + types.NamedSparseVector, + RecoQuery, + SparseRecoQuery, + MultiRecoQuery, + types.NumpyArray, + ], + group_by: str, + query_filter: Optional[models.Filter] = None, + limit: int = 10, + group_size: int = 1, + with_payload: Union[bool, Sequence[str], models.PayloadSelector] = True, + with_vectors: Union[bool, Sequence[str]] = False, + score_threshold: Optional[float] = None, + with_lookup: Optional[types.WithLookupInterface] = None, + with_lookup_collection: Optional["LocalCollection"] = None, + ) -> models.GroupsResult: + points = self.search( + query_vector=query_vector, + query_filter=query_filter, + limit=len(self.ids_inv), + with_payload=True, + with_vectors=with_vectors, + score_threshold=score_threshold, + ) + + groups = OrderedDict() + + for point in points: + if not isinstance(point.payload, dict): + continue + + group_values = value_by_key(point.payload, group_by) + if group_values is None: + continue + + group_values = list(set(v for v in group_values if isinstance(v, (str, int)))) + + point.payload = self._process_payload(point.payload, with_payload) + + for group_value in group_values: + if group_value not in groups: + groups[group_value] = models.PointGroup(id=group_value, hits=[]) + + if len(groups[group_value].hits) >= group_size: + continue + + groups[group_value].hits.append(point) + + groups_result: list[models.PointGroup] = list(groups.values())[:limit] + + if isinstance(with_lookup, str): + with_lookup = models.WithLookup( + collection=with_lookup, + with_payload=None, + with_vectors=None, + ) + + if with_lookup is not None and with_lookup_collection is not None: + for group in groups_result: + lookup = with_lookup_collection.retrieve( + ids=[group.id], + with_payload=with_lookup.with_payload, + with_vectors=with_lookup.with_vectors, + ) + group.lookup = next(iter(lookup), None) + + return models.GroupsResult(groups=groups_result) + + def facet( + self, + key: str, + facet_filter: Optional[types.Filter] = None, + limit: int = 10, + ) -> types.FacetResponse: + facet_hits: dict[types.FacetValue, int] = defaultdict(int) + + mask = self._payload_and_non_deleted_mask(facet_filter) + + for idx, payload in enumerate(self.payload): + if not mask[idx]: + continue + + if not isinstance(payload, dict): + continue + + values = value_by_key(payload, key) + + if values is None: + continue + + # Only count the same value for each point once + values_set: set[types.FacetValue] = set() + + # Sanitize to use only valid values + for v in values: + if type(v) not in get_args_subscribed(types.FacetValue): + continue + + # If values are UUIDs, format with hyphens + as_uuid = parse_uuid(v) + if as_uuid: + v = str(as_uuid) + + values_set.add(v) + + for v in values_set: + facet_hits[v] += 1 + + hits = [ + models.FacetValueHit(value=value, count=count) + for value, count in sorted( + facet_hits.items(), + # order by count descending, then by value ascending + key=lambda x: (-x[1], x[0]), + )[:limit] + ] + + return types.FacetResponse(hits=hits) + + def retrieve( + self, + ids: Sequence[types.PointId], + with_payload: Union[bool, Sequence[str], types.PayloadSelector] = True, + with_vectors: Union[bool, Sequence[str]] = False, + ) -> list[models.Record]: + result = [] + + for point_id in ids: + if point_id not in self.ids: + continue + + idx = self.ids[point_id] + if self.deleted[idx] == 1: + continue + + result.append( + models.Record( + id=point_id, + payload=self._get_payload(idx, with_payload), + vector=self._get_vectors(idx, with_vectors), + ) + ) + + return result + + def _preprocess_recommend_input( + self, + positive: Optional[Sequence[models.VectorInput]] = None, + negative: Optional[Sequence[models.VectorInput]] = None, + strategy: Optional[types.RecommendStrategy] = None, + query_filter: Optional[types.Filter] = None, + using: Optional[str] = None, + lookup_from_collection: Optional["LocalCollection"] = None, + lookup_from_vector_name: Optional[str] = None, + ) -> tuple[ + list[list[float]], + list[list[float]], + list[models.SparseVector], + list[models.SparseVector], + list[list[list[float]]], + list[list[list[float]]], + types.Filter, + ]: + def examples_into_vectors( + examples: Sequence[models.VectorInput], + acc: Union[list[list[float]], list[models.SparseVector], list[list[list[float]]]], + ) -> None: + for example in examples: + if isinstance(example, get_args(types.PointId)): + if example not in collection.ids: + raise ValueError(f"Point {example} is not found in the collection") + + idx = collection.ids[example] + vec = collection_vectors[vector_name][idx] + + if isinstance(vec, np.ndarray): + vec = vec.tolist() + acc.append(vec) + if collection == self: + mentioned_ids.append(example) + else: + acc.append(example) + + collection = lookup_from_collection if lookup_from_collection is not None else self + search_in_vector_name = using if using is not None else DEFAULT_VECTOR_NAME + vector_name = ( + lookup_from_vector_name + if lookup_from_vector_name is not None + else search_in_vector_name + ) + + positive = positive if positive is not None else [] + negative = negative if negative is not None else [] + + # Validate input depending on strategy + if strategy == types.RecommendStrategy.AVERAGE_VECTOR: + if len(positive) == 0: + raise ValueError("Positive list is empty") + elif ( + strategy == types.RecommendStrategy.BEST_SCORE + or strategy == types.RecommendStrategy.SUM_SCORES + ): + if len(positive) == 0 and len(negative) == 0: + raise ValueError("No positive or negative examples given") + + # Turn every example into vectors + positive_vectors: list[list[float]] = [] + negative_vectors: list[list[float]] = [] + sparse_positive_vectors: list[models.SparseVector] = [] + sparse_negative_vectors: list[models.SparseVector] = [] + positive_multivectors: list[list[list[float]]] = [] + negative_multivectors: list[list[list[float]]] = [] + mentioned_ids: list[ExtendedPointId] = [] + + sparse = vector_name in collection.sparse_vectors + multi = vector_name in collection.multivectors + if sparse: + collection_vectors = collection.sparse_vectors + examples_into_vectors(positive, sparse_positive_vectors) + examples_into_vectors(negative, sparse_negative_vectors) + elif multi: + collection_vectors = collection.multivectors + examples_into_vectors(positive, positive_multivectors) + examples_into_vectors(negative, negative_multivectors) + else: + collection_vectors = collection.vectors + examples_into_vectors(positive, positive_vectors) + examples_into_vectors(negative, negative_vectors) + + # Edit query filter + query_filter = ignore_mentioned_ids_filter(query_filter, mentioned_ids) + + return ( + positive_vectors, + negative_vectors, + sparse_positive_vectors, + sparse_negative_vectors, + positive_multivectors, + negative_multivectors, + query_filter, + ) + + @staticmethod + def _recommend_average_dense( + positive_vectors: list[list[float]], negative_vectors: list[list[float]] + ) -> types.NumpyArray: + positive_vectors_np = np.stack(positive_vectors) + negative_vectors_np = np.stack(negative_vectors) if len(negative_vectors) > 0 else None + + mean_positive_vector = np.mean(positive_vectors_np, axis=0) + + if negative_vectors_np is not None: + vector = ( + mean_positive_vector + mean_positive_vector - np.mean(negative_vectors_np, axis=0) + ) + else: + vector = mean_positive_vector + return vector + + @staticmethod + def _recommend_average_sparse( + positive_vectors: list[models.SparseVector], + negative_vectors: list[models.SparseVector], + ) -> models.SparseVector: + for i, vector in enumerate(positive_vectors): + validate_sparse_vector(vector) + positive_vectors[i] = sort_sparse_vector(vector) + + for i, vector in enumerate(negative_vectors): + validate_sparse_vector(vector) + negative_vectors[i] = sort_sparse_vector(vector) + + mean_positive_vector = sparse_avg(positive_vectors) + + if negative_vectors: + mean_negative_vector = sparse_avg(negative_vectors) + vector = merge_positive_and_negative_avg(mean_positive_vector, mean_negative_vector) + else: + vector = mean_positive_vector + return vector + + @staticmethod + def _recommend_average_multi( + positive_vectors: list[list[list[float]]], negative_vectors: list[list[list[float]]] + ) -> list[list[float]]: + recommend_vector = [vector for multi_vector in positive_vectors for vector in multi_vector] + if len(negative_vectors) > 0: + for multi_vector in negative_vectors: + for vector in multi_vector: + recommend_vector.append([-value for value in vector]) + + return recommend_vector + + def _construct_recommend_query( + self, + positive: Optional[Sequence[models.VectorInput]] = None, + negative: Optional[Sequence[models.VectorInput]] = None, + query_filter: Optional[types.Filter] = None, + using: Optional[str] = None, + lookup_from_collection: Optional["LocalCollection"] = None, + lookup_from_vector_name: Optional[str] = None, + strategy: Optional[types.RecommendStrategy] = None, + ) -> tuple[ + Union[RecoQuery, SparseRecoQuery, MultiRecoQuery, models.SparseVector, types.NumpyArray], + types.Filter, + ]: + strategy = strategy if strategy is not None else types.RecommendStrategy.AVERAGE_VECTOR + + ( + positive_vectors, + negative_vectors, + sparse_positive_vectors, + sparse_negative_vectors, + multi_positive_vectors, + multi_negative_vectors, + edited_query_filter, + ) = self._preprocess_recommend_input( + positive, + negative, + strategy, + query_filter, + using, + lookup_from_collection, + lookup_from_vector_name, + ) + + if strategy == types.RecommendStrategy.AVERAGE_VECTOR: + # Validate input + if positive_vectors: + query_vector = self._recommend_average_dense( + positive_vectors, + negative_vectors, + ) + elif sparse_positive_vectors: + query_vector = self._recommend_average_sparse( + sparse_positive_vectors, + sparse_negative_vectors, + ) + elif multi_positive_vectors: + query_vector = self._recommend_average_multi( + multi_positive_vectors, multi_negative_vectors + ) + else: + raise ValueError("No positive examples given with 'average_vector' strategy") + + elif ( + strategy == types.RecommendStrategy.BEST_SCORE + or strategy == types.RecommendStrategy.SUM_SCORES + ): + if positive_vectors or negative_vectors: + query_vector = RecoQuery( + positive=positive_vectors, + negative=negative_vectors, + strategy=strategy, + ) + elif sparse_positive_vectors or sparse_negative_vectors: + query_vector = SparseRecoQuery( + positive=sparse_positive_vectors, + negative=sparse_negative_vectors, + strategy=strategy, + ) + elif multi_positive_vectors or multi_negative_vectors: + query_vector = MultiRecoQuery( + positive=multi_positive_vectors, + negative=multi_negative_vectors, + strategy=strategy, + ) + else: + raise ValueError( + f"No positive or negative examples given with '{strategy}' strategy" + ) + else: + raise ValueError( + f"strategy `{strategy}` is not a valid strategy, choose one from {types.RecommendStrategy}" + ) + return query_vector, edited_query_filter + + def recommend( + self, + positive: Optional[Sequence[models.VectorInput]] = None, + negative: Optional[Sequence[models.VectorInput]] = None, + query_filter: Optional[types.Filter] = None, + limit: int = 10, + offset: int = 0, + with_payload: Union[bool, Sequence[str], types.PayloadSelector] = True, + with_vectors: Union[bool, Sequence[str]] = False, + score_threshold: Optional[float] = None, + using: Optional[str] = None, + lookup_from_collection: Optional["LocalCollection"] = None, + lookup_from_vector_name: Optional[str] = None, + strategy: Optional[types.RecommendStrategy] = None, + ) -> list[models.ScoredPoint]: + query_vector, edited_query_filter = self._construct_recommend_query( + positive, + negative, + query_filter, + using, + lookup_from_collection, + lookup_from_vector_name, + strategy, + ) + search_in_vector_name = using if using is not None else DEFAULT_VECTOR_NAME + + return self.search( + query_vector=(search_in_vector_name, query_vector), + query_filter=edited_query_filter, + limit=limit, + offset=offset, + with_payload=with_payload, + with_vectors=with_vectors, + score_threshold=score_threshold, + ) + + def recommend_groups( + self, + group_by: str, + positive: Optional[Sequence[models.VectorInput]] = None, + negative: Optional[Sequence[models.VectorInput]] = None, + query_filter: Optional[models.Filter] = None, + limit: int = 10, + group_size: int = 1, + score_threshold: Optional[float] = None, + with_payload: Union[bool, Sequence[str], models.PayloadSelector] = True, + with_vectors: Union[bool, Sequence[str]] = False, + using: Optional[str] = None, + lookup_from_collection: Optional["LocalCollection"] = None, + lookup_from_vector_name: Optional[str] = None, + with_lookup: Optional[types.WithLookupInterface] = None, + with_lookup_collection: Optional["LocalCollection"] = None, + strategy: Optional[types.RecommendStrategy] = None, + ) -> types.GroupsResult: + strategy = strategy if strategy is not None else types.RecommendStrategy.AVERAGE_VECTOR + + query_vector, edited_query_filter = self._construct_recommend_query( + positive, + negative, + query_filter, + using, + lookup_from_collection, + lookup_from_vector_name, + strategy, + ) + + search_in_vector_name = using if using is not None else DEFAULT_VECTOR_NAME + + return self.search_groups( + query_vector=(search_in_vector_name, query_vector), + query_filter=edited_query_filter, + group_by=group_by, + group_size=group_size, + limit=limit, + with_payload=with_payload, + with_vectors=with_vectors, + score_threshold=score_threshold, + with_lookup=with_lookup, + with_lookup_collection=with_lookup_collection, + ) + + def search_matrix_offsets( + self, + query_filter: Optional[types.Filter] = None, + limit: int = 3, + sample: int = 10, + using: Optional[str] = None, + ) -> types.SearchMatrixOffsetsResponse: + ids, all_scores = self._search_distance_matrix( + query_filter=query_filter, limit=limit, sample=sample, using=using + ) + + offsets_row = [] + offsets_col = [] + + offset_by_id = {point_id: idx for idx, point_id in enumerate(ids)} + + for row_offset, scored_points in enumerate(all_scores): + for scored_point in scored_points: + offsets_row.append(row_offset) + offsets_col.append(offset_by_id[scored_point.id]) + + # flatten the scores + scores = [] + for sample_scores in all_scores: + for score in sample_scores: + scores.append(score.score) + + return types.SearchMatrixOffsetsResponse( + offsets_row=offsets_row, + offsets_col=offsets_col, + scores=scores, + ids=ids, + ) + + def search_matrix_pairs( + self, + query_filter: Optional[types.Filter] = None, + limit: int = 3, + sample: int = 10, + using: Optional[str] = None, + ) -> types.SearchMatrixPairsResponse: + ids, all_scores = self._search_distance_matrix( + query_filter=query_filter, limit=limit, sample=sample, using=using + ) + pairs = [] + for sample_id, sample_scores in list(zip(ids, all_scores)): + for sample_score in sample_scores: + pairs.append( + types.SearchMatrixPair( + a=sample_id, b=sample_score.id, score=sample_score.score + ) + ) + + return types.SearchMatrixPairsResponse( + pairs=pairs, + ) + + def _search_distance_matrix( + self, + query_filter: Optional[types.Filter] = None, + limit: int = 3, + sample: int = 10, + using: Optional[str] = None, + ) -> tuple[list[ExtendedPointId], list[list[ScoredPoint]]]: + samples: list[ScoredPoint] = [] + search_in_vector_name = using if using is not None else DEFAULT_VECTOR_NAME + # Sample random points from the whole collection to filter out the ones without vectors + # TODO: use search_filter once with have an HasVector like condition + candidates = self._sample_randomly( + len(self.ids), query_filter, False, search_in_vector_name + ) + for candidate in candidates: + # check if enough samples are collected + if len(samples) == sample: + break + # check if the candidate has a vector + if candidate.vector is not None: + samples.append(candidate) + + # can't build a matrix with less than 2 results + if len(samples) < 2: + return [], [] + + # sort samples by id + samples = sorted(samples, key=lambda x: x.id) + # extract the ids + ids = [sample.id for sample in samples] + scores: list[list[ScoredPoint]] = [] + + # Query `limit` neighbors for each sample + for sampled_id_index, sampled in enumerate(samples): + ids_to_includes = [x for (i, x) in enumerate(ids) if i != sampled_id_index] + sampling_filter = _include_ids_in_filter(query_filter, ids_to_includes) + sampled_vector = sampled.vector + search_vector = ( + sampled_vector[search_in_vector_name] + if isinstance(sampled_vector, dict) + else sampled_vector + ) + samples_scores = self.search( + query_vector=(search_in_vector_name, search_vector), + query_filter=sampling_filter, + limit=limit, + with_payload=False, + with_vectors=False, + ) + scores.append(samples_scores) + + return ids, scores + + @staticmethod + def _preprocess_target( + target: Optional[models.VectorInput], collection: "LocalCollection", vector_name: str + ) -> tuple[models.Vector, Optional[types.PointId]]: + # todo: context can no longer be grpc.TargetVector, but models.VectorInput, currently, grpc types are not supported + target = ( + GrpcToRest.convert_target_vector(target) + if target is not None and isinstance(target, grpc.TargetVector) + else target + ) + if isinstance(target, get_args(types.PointId)): + if target not in collection.ids: + raise ValueError(f"Point {target} is not found in the collection") + + idx = collection.ids[target] + if vector_name in collection.vectors: + target_vector = collection.vectors[vector_name][idx].tolist() + elif vector_name in collection.sparse_vectors: + target_vector = collection.sparse_vectors[vector_name][idx] + else: + target_vector = collection.multivectors[vector_name][idx].tolist() + + return target_vector, target + + return target, None + + def _preprocess_context( + self, context: list[models.ContextPair], collection: "LocalCollection", vector_name: str + ) -> tuple[ + list[ContextPair], list[SparseContextPair], list[MultiContextPair], list[types.PointId] + ]: + # todo: context can no longer be ContextExamplePair, currently grpc types are not supported + context = [ + ( + GrpcToRest.convert_context_example_pair(pair) + if isinstance(pair, grpc.ContextExamplePair) + else pair + ) + for pair in context + ] + mentioned_ids = [] + dense_context_vectors = [] + sparse_context_vectors = [] + multi_context_vectors = [] + + for pair in context: + pair_vectors = [] + for example in [pair.positive, pair.negative]: + if isinstance(example, get_args(types.PointId)): + if example not in collection.ids: + raise ValueError(f"Point {example} is not found in the collection") + + idx = collection.ids[example] + if vector_name in collection.vectors: + vector = collection.vectors[vector_name][idx].tolist() + elif vector_name in collection.sparse_vectors: + vector = collection.sparse_vectors[vector_name][idx] + else: + vector = collection.multivectors[vector_name][idx].tolist() + + pair_vectors.append(vector) + if collection == self: + mentioned_ids.append(example) + else: + pair_vectors.append(example) + + if isinstance(pair_vectors[0], SparseVector) and isinstance( + pair_vectors[1], SparseVector + ): + sparse_context_vectors.append( + SparseContextPair(positive=pair_vectors[0], negative=pair_vectors[1]) + ) + elif isinstance(pair_vectors[0], list) and isinstance(pair_vectors[1], list): + if isinstance(pair_vectors[0][0], float) and isinstance(pair_vectors[1][0], float): + dense_context_vectors.append( + ContextPair(positive=pair_vectors[0], negative=pair_vectors[1]) + ) + elif isinstance(pair_vectors[0][0], list) and isinstance(pair_vectors[1][0], list): + multi_context_vectors.append( + MultiContextPair(positive=pair_vectors[0], negative=pair_vectors[1]) + ) + else: + raise ValueError( + "Context example pair must be of the same type: dense, sparse or multi vectors" + ) + else: + raise ValueError( + "Context example pair must be of the same type: dense, sparse or multi vectors" + ) + + if ( + sum( + [ + bool(sparse_context_vectors), + bool(dense_context_vectors), + bool(multi_context_vectors), + ] + ) + > 1 + ): + raise ValueError( + "All context example pairs must be either dense or sparse or multi vectors" + ) + return dense_context_vectors, sparse_context_vectors, multi_context_vectors, mentioned_ids + + def _preprocess_discover( + self, + target: Optional[models.VectorInput] = None, + context: Optional[Sequence[models.ContextPair]] = None, + query_filter: Optional[types.Filter] = None, + using: Optional[str] = None, + lookup_from_collection: Optional["LocalCollection"] = None, + lookup_from_vector_name: Optional[str] = None, + ) -> tuple[ + Optional[models.Vector], + list[ContextPair], + list[SparseContextPair], + list[MultiContextPair], + types.Filter, + ]: + if target is None and not context: + raise ValueError("No target or context given") + + collection = lookup_from_collection if lookup_from_collection is not None else self + search_in_vector_name = using if using is not None else DEFAULT_VECTOR_NAME + vector_name = ( + lookup_from_vector_name + if lookup_from_vector_name is not None + else search_in_vector_name + ) + + target_vector, target_id = self._preprocess_target(target, collection, vector_name) + context = list(context) if context is not None else [] + + dense_context_vectors, sparse_context_vectors, multi_context_vectors, mentioned_ids = ( + self._preprocess_context(context, collection, vector_name) + ) + + if target_id is not None and collection == self: + mentioned_ids.append(target_id) + + # Edit query filter + query_filter = ignore_mentioned_ids_filter(query_filter, mentioned_ids) + + return ( + target_vector, + dense_context_vectors, + sparse_context_vectors, + multi_context_vectors, + query_filter, + ) # type: ignore + + def discover( + self, + target: Optional[models.VectorInput] = None, + context: Optional[Sequence[models.ContextPair]] = None, + query_filter: Optional[types.Filter] = None, + limit: int = 10, + offset: int = 0, + with_payload: Union[bool, Sequence[str], types.PayloadSelector] = True, + with_vectors: Union[bool, Sequence[str]] = False, + using: Optional[str] = None, + lookup_from_collection: Optional["LocalCollection"] = None, + lookup_from_vector_name: Optional[str] = None, + score_threshold: Optional[float] = None, + ) -> list[models.ScoredPoint]: + ( + target_vector, + dense_context_vectors, + sparse_context_vectors, + multi_context_vectors, + edited_query_filter, + ) = self._preprocess_discover( + target, + context, + query_filter, + using, + lookup_from_collection, + lookup_from_vector_name, + ) + + query_vector: Union[DenseQueryVector, SparseQueryVector, MultiQueryVector] + + # Discovery search + if target_vector is not None: + if isinstance(target_vector, list): + if isinstance(target_vector[0], float): + query_vector = DiscoveryQuery(target_vector, dense_context_vectors) + else: + query_vector = MultiDiscoveryQuery(target_vector, multi_context_vectors) + elif isinstance(target_vector, SparseVector): + query_vector = SparseDiscoveryQuery(target_vector, sparse_context_vectors) + else: + raise ValueError("Unsupported target vector type") + + # Context search + elif target_vector is None and dense_context_vectors: + query_vector = ContextQuery(dense_context_vectors) + elif target_vector is None and sparse_context_vectors: + query_vector = SparseContextQuery(sparse_context_vectors) + elif target_vector is None and multi_context_vectors: + query_vector = MultiContextQuery(multi_context_vectors) + else: + raise ValueError("No target or context given") + + search_in_vector_name = using if using is not None else DEFAULT_VECTOR_NAME + return self.search( + query_vector=(search_in_vector_name, query_vector), + query_filter=edited_query_filter, + limit=limit, + offset=offset, + with_payload=with_payload, + with_vectors=with_vectors, + score_threshold=score_threshold, + ) + + @classmethod + def _universal_id(cls, point_id: models.ExtendedPointId) -> tuple[str, int]: + if isinstance(point_id, str): + return point_id, 0 + elif isinstance(point_id, int): + return "", point_id + raise TypeError(f"Incompatible point id type: {type(point_id)}") + + def scroll( + self, + scroll_filter: Optional[types.Filter] = None, + limit: int = 10, + order_by: Optional[types.OrderBy] = None, + offset: Optional[types.PointId] = None, + with_payload: Union[bool, Sequence[str], types.PayloadSelector] = True, + with_vectors: Union[bool, Sequence[str]] = False, + ) -> tuple[list[types.Record], Optional[types.PointId]]: + if len(self.ids) == 0: + return [], None + + if order_by is None: + # order by id (default) + return self._scroll_by_id( + scroll_filter=scroll_filter, + limit=limit, + offset=offset, + with_payload=with_payload, + with_vectors=with_vectors, + ) + + # order by value + if offset is not None: + raise ValueError( + "Offset is not supported in conjunction with `order_by` scroll parameter" + ) + + return self._scroll_by_value( + order_by=order_by, + scroll_filter=scroll_filter, + limit=limit, + with_payload=with_payload, + with_vectors=with_vectors, + ) + + def count(self, count_filter: Optional[types.Filter] = None) -> models.CountResult: + mask = self._payload_and_non_deleted_mask(count_filter) + + return models.CountResult(count=np.count_nonzero(mask)) + + def _scroll_by_id( + self, + scroll_filter: Optional[types.Filter] = None, + limit: int = 10, + offset: Optional[types.PointId] = None, + with_payload: Union[bool, Sequence[str], types.PayloadSelector] = True, + with_vectors: Union[bool, Sequence[str]] = False, + ) -> tuple[list[types.Record], Optional[types.PointId]]: + sorted_ids = sorted(self.ids.items(), key=lambda x: self._universal_id(x[0])) + + result: list[types.Record] = [] + + mask = self._payload_and_non_deleted_mask(scroll_filter) + + for point_id, idx in sorted_ids: + if offset is not None and self._universal_id(point_id) < self._universal_id(offset): + continue + + if len(result) >= limit + 1: + break + + if not mask[idx]: + continue + + result.append( + models.Record( + id=point_id, + payload=self._get_payload(idx, with_payload), + vector=self._get_vectors(idx, with_vectors), + ) + ) + + if len(result) > limit: + return result[:limit], result[limit].id + else: + return result, None + + def _scroll_by_value( + self, + order_by: types.OrderBy, + scroll_filter: Optional[types.Filter] = None, + limit: int = 10, + with_payload: Union[bool, Sequence[str], types.PayloadSelector] = True, + with_vectors: Union[bool, Sequence[str]] = False, + ) -> tuple[list[types.Record], Optional[types.PointId]]: + if isinstance(order_by, grpc.OrderBy): + order_by = GrpcToRest.convert_order_by(order_by) + if isinstance(order_by, str): + order_by = models.OrderBy(key=order_by) + + value_and_ids: list[tuple[OrderValue, ExtendedPointId, int]] = [] + + for external_id, internal_id in self.ids.items(): + # get order-by values for id + payload_values = value_by_key(self.payload[internal_id], order_by.key) + if payload_values is None: + continue + + # replicate id for each value it has + for value in payload_values: + ordering_value = to_order_value(value) + if ordering_value is not None: + value_and_ids.append((ordering_value, external_id, internal_id)) + + direction = order_by.direction if order_by.direction is not None else models.Direction.ASC + + should_reverse = direction == models.Direction.DESC + + # sort by value only + value_and_ids.sort(key=lambda x: x[0], reverse=should_reverse) + + mask = self._payload_and_non_deleted_mask(scroll_filter) + + result: list[types.Record] = [] + + start_from = to_order_value(order_by.start_from) + + # dedup by (value, external_id) + seen_tuples: set[tuple[OrderValue, ExtendedPointId]] = set() + + for value, external_id, internal_id in value_and_ids: + if start_from is not None: + if direction == models.Direction.ASC: + if value < start_from: + continue + elif direction == models.Direction.DESC: + if value > start_from: + continue + + if len(result) >= limit: + break + + if not mask[internal_id]: + continue + + if (value, external_id) in seen_tuples: + continue + + seen_tuples.add((value, external_id)) + + result.append( + models.Record( + id=external_id, + payload=self._get_payload(internal_id, with_payload), + vector=self._get_vectors(internal_id, with_vectors), + order_value=value, + ) + ) + + return result, None + + def _sample_randomly( + self, + limit: int, + query_filter: Optional[types.Filter], + with_payload: Union[bool, Sequence[str], types.PayloadSelector] = True, + with_vectors: Union[bool, Sequence[str]] = False, + ) -> list[types.ScoredPoint]: + mask = self._payload_and_non_deleted_mask(query_filter) + + random_scores = np.random.rand(len(self.ids)) + random_order = np.argsort(random_scores) + + result: list[types.ScoredPoint] = [] + for idx in random_order: + if len(result) >= limit: + break + + if not mask[idx]: + continue + + point_id = self.ids_inv[idx] + + scored_point = construct( + models.ScoredPoint, + id=point_id, + score=float(0), + version=0, + payload=self._get_payload(idx, with_payload), + vector=self._get_vectors(idx, with_vectors), + ) + + result.append(scored_point) + + return result + + def _search_with_mmr( + self, + query_vector: Union[ + list[float], + SparseVector, + list[list[float]], + ], + mmr: types.Mmr, + using: Optional[str], + query_filter: Optional[types.Filter] = None, + limit: int = 10, + offset: Optional[int] = None, + with_payload: Union[bool, Sequence[str], types.PayloadSelector] = True, + with_vectors: Union[bool, Sequence[str]] = False, + score_threshold: Optional[float] = None, + ) -> list[models.ScoredPoint]: + search_limit = mmr.candidates_limit if mmr.candidates_limit is not None else limit + using = using or DEFAULT_VECTOR_NAME + search_results = self.search( + query_vector=(using, query_vector), + query_filter=query_filter, + limit=search_limit, + offset=offset, + with_payload=with_payload, + with_vectors=with_vectors, + score_threshold=score_threshold, + ) + + diversity = mmr.diversity if mmr.diversity is not None else 0.5 + lambda_ = 1.0 - diversity + + return self._mmr(search_results, query_vector, using, lambda_, limit) + + def _mmr( + self, + search_results: list[models.ScoredPoint], + query_vector: Union[list[float], SparseVector, list[list[float]]], + using: str, + lambda_: float, + limit: int, + ) -> list[models.ScoredPoint]: + if lambda_ < 0.0 or lambda_ > 1.0: + raise ValueError("MMR lambda must be between 0.0 and 1.0") + + if not search_results: + return [] + + # distance matrix between candidates + candidate_distance_matrix: dict[ + tuple[models.ExtendedPointId, models.ExtendedPointId], float + ] = {} + + candidate_vectors = [] + candidate_ids = [] + candidates: list[models.ScoredPoint] = [] + + # `with_vectors` might be different from `using`, thus we need to retrieve vectors explicitly + for point in search_results: + idx = self.ids[point.id] + candidate_vector = self._get_vectors(idx, [using]) + if isinstance(candidate_vector, dict): + candidate_vector = candidate_vector.get(using) + + candidate_vectors.append(candidate_vector) + candidate_ids.append(point.id) + candidates.append(point) + + query_raw_similarities: dict[models.ExtendedPointId, float] = {} + id_to_point = {point.id: point for point in search_results} + + distance = ( + self.get_vector_params(using).distance if using not in self.sparse_vectors else None + ) + query_vector = ( + np.array(query_vector) + if not isinstance(query_vector, SparseVector) + else sort_sparse_vector(query_vector) + ) + + for candidate_id, candidate_vector in zip(candidate_ids, candidate_vectors): + if isinstance(candidate_vector, list) and isinstance(candidate_vector[0], float): + candidate_vector_np = np.array(candidate_vector) + if not isinstance(candidate_vectors, np.ndarray): + candidate_vectors = np.array(candidate_vectors) + nearest_candidates = calculate_distance_core( + candidate_vector_np, candidate_vectors, distance + ).tolist() + query_raw_similarities[candidate_id] = calculate_distance_core( + query_vector, candidate_vector_np[np.newaxis, :], distance + ).tolist()[0] + elif isinstance(candidate_vector, SparseVector): + nearest_candidates = calculate_distance_sparse( + candidate_vector, + candidate_vectors, + empty_is_zero=True, + ).tolist() + query_raw_similarities[candidate_id] = calculate_distance_sparse( + query_vector, + [candidate_vector], + empty_is_zero=True, + ).tolist()[0] + else: + candidate_vector_np = np.array(candidate_vector) + if not isinstance(candidate_vectors[0], np.ndarray): + candidate_vectors = [np.array(multivec) for multivec in candidate_vectors] + nearest_candidates = calculate_multi_distance_core( + candidate_vector_np, + candidate_vectors, + distance, + ).tolist() + query_raw_similarities[candidate_id] = calculate_multi_distance_core( + query_vector, [candidate_vector_np], distance + ).tolist()[0] + + for i in range(len(candidate_ids)): + candidate_distance_matrix[(candidate_id, candidate_ids[i])] = nearest_candidates[i] + + selected = [candidate_ids[0]] + pending = candidate_ids[1:] + while len(selected) < limit and len(pending) > 0: + mmr_scores = [] + + for pending_id in pending: + relevance_score = query_raw_similarities[pending_id] + similarities_to_selected = [] + for selected_id in selected: + similarities_to_selected.append( + candidate_distance_matrix[(pending_id, selected_id)] + ) + max_similarity_to_selected = max(similarities_to_selected) + mmr_score = ( + lambda_ * relevance_score - (1.0 - lambda_) * max_similarity_to_selected + ) + mmr_scores.append(mmr_score) + + if all( + [np.isneginf(sim) for sim in mmr_scores] + ): # no points left passing score threshold + break + best_candidate_index = np.argmax(mmr_scores).item() + selected.append(pending.pop(best_candidate_index)) + + return [id_to_point[candidate_id] for candidate_id in selected] + + def _rescore_with_formula( + self, + query: models.FormulaQuery, + prefetches_results: list[list[models.ScoredPoint]], + limit: int, + with_payload: Union[bool, Sequence[str], types.PayloadSelector], + with_vectors: Union[bool, Sequence[str]], + ) -> list[models.ScoredPoint]: + # collect prefetches in vec of dicts for faster lookup + prefetches_scores = [ + dict((point.id, point.score) for point in prefetch) for prefetch in prefetches_results + ] + + defaults = query.defaults or {} + + points_to_rescore: set[models.ExtendedPointId] = set() + for prefetch in prefetches_results: + for point in prefetch: + points_to_rescore.add(point.id) + + # Evaluate formula for each point + rescored: list[models.ScoredPoint] = [] + for point_id in points_to_rescore: + internal_id = self.ids[point_id] + payload = self._get_payload(internal_id, True) or {} + has_vector = self._calculate_has_vector(internal_id) + score = evaluate_expression( + expression=query.formula, + point_id=point_id, + scores=prefetches_scores, + payload=payload, + has_vector=has_vector, + defaults=defaults, + ) + # Turn score into np.float32 to match core + with warnings.catch_warnings(): + warnings.simplefilter("ignore") + score_f32 = np.float32(score) + if not np.isfinite(score_f32): + raise_non_finite_error(f"{score} as f32 = {score_f32}") + point = construct( + models.ScoredPoint, + id=point_id, + score=float(score_f32), + version=0, + payload=self._get_payload(internal_id, with_payload), + vector=self._get_vectors(internal_id, with_vectors), + ) + rescored.append(point) + + rescored.sort(key=lambda x: x.score, reverse=True) + + return rescored[:limit] + + def _update_point(self, point: models.PointStruct) -> None: + idx = self.ids[point.id] + self.payload[idx] = deepcopy( + to_jsonable_python(point.payload) if point.payload is not None else {} + ) + + if isinstance(point.vector, list): + vectors = {DEFAULT_VECTOR_NAME: point.vector} + else: + vectors = point.vector + + # dense vectors + for vector_name, _named_vectors in self.vectors.items(): + vector = vectors.get(vector_name) + if vector is not None: + params = self.get_vector_params(vector_name) + assert not np.isnan(vector).any(), "Vector contains NaN values" + if params.distance == models.Distance.COSINE: + norm = np.linalg.norm(vector) + vector = np.array(vector) / norm if norm > EPSILON else vector + self.vectors[vector_name][idx] = vector + self.deleted_per_vector[vector_name][idx] = 0 + else: + self.deleted_per_vector[vector_name][idx] = 1 + + # sparse vectors + for vector_name, _named_vectors in self.sparse_vectors.items(): + vector = vectors.get(vector_name) + was_deleted = self.deleted_per_vector[vector_name][idx] + if not was_deleted: + previous_vector = self.sparse_vectors[vector_name][idx] + self._update_idf_remove(previous_vector, vector_name) + + if vector is not None: + self.sparse_vectors[vector_name][idx] = vector + self.deleted_per_vector[vector_name][idx] = 0 + self._update_idf_append(vector, vector_name) + else: + self.deleted_per_vector[vector_name][idx] = 1 + + # multivectors + for vector_name, _named_vector in self.multivectors.items(): + vector = vectors.get(vector_name) + if vector is not None: + params = self.get_vector_params(vector_name) + assert not np.isnan(vector).any(), "Vector contains NaN values" + + if params.distance == models.Distance.COSINE: + vector_norm = np.linalg.norm(vector, axis=-1)[:, np.newaxis] + vector /= np.where(vector_norm != 0.0, vector_norm, EPSILON) + self.multivectors[vector_name][idx] = np.array(vector) + self.deleted_per_vector[vector_name][idx] = 0 + else: + self.deleted_per_vector[vector_name][idx] = 1 + + self.deleted[idx] = 0 + + def _add_point(self, point: models.PointStruct) -> None: + idx = len(self.ids) + self.ids[point.id] = idx + self.ids_inv.append(point.id) + + self.payload.append( + deepcopy(to_jsonable_python(point.payload) if point.payload is not None else {}) + ) + assert len(self.payload) == len(self.ids_inv), "Payload and ids_inv must be the same size" + self.deleted = np.append(self.deleted, 0) + + if isinstance(point.vector, list): + vectors = {DEFAULT_VECTOR_NAME: point.vector} + else: + vectors = point.vector + + # dense vectors + for vector_name, named_vectors in self.vectors.items(): + vector = vectors.get(vector_name) + + if named_vectors.shape[0] <= idx: + named_vectors = np.resize(named_vectors, (idx * 2 + 1, named_vectors.shape[1])) + + if vector is None: + # Add fake vector and mark as removed + fake_vector = np.ones(named_vectors.shape[1]) + named_vectors[idx] = fake_vector + self.deleted_per_vector[vector_name] = np.append( + self.deleted_per_vector[vector_name], 1 + ) + else: + vector_np = np.array(vector, dtype=np.float32) + assert not np.isnan(vector_np).any(), "Vector contains NaN values" + params = self.get_vector_params(vector_name) + if params.distance == models.Distance.COSINE: + norm = np.linalg.norm(vector_np) + vector_np = vector_np / norm if norm > EPSILON else vector_np + named_vectors[idx] = vector_np + self.deleted_per_vector[vector_name] = np.append( + self.deleted_per_vector[vector_name], 0 + ) + + self.vectors[vector_name] = named_vectors + + # sparse vectors + for vector_name, named_vectors in self.sparse_vectors.items(): + vector = vectors.get(vector_name) + if len(named_vectors) <= idx: + diff = idx - len(named_vectors) + 1 + for _ in range(diff): + named_vectors.append(empty_sparse_vector()) + + if vector is None: + # Add fake vector and mark as removed + fake_vector = empty_sparse_vector() + named_vectors[idx] = fake_vector + self.deleted_per_vector[vector_name] = np.append( + self.deleted_per_vector[vector_name], 1 + ) + else: + named_vectors[idx] = vector + self._update_idf_append(vector, vector_name) + self.deleted_per_vector[vector_name] = np.append( + self.deleted_per_vector[vector_name], 0 + ) + + self.sparse_vectors[vector_name] = named_vectors + + # multi vectors + for vector_name, named_vectors in self.multivectors.items(): + vector = vectors.get(vector_name) + if len(named_vectors) <= idx: + diff = idx - len(named_vectors) + 1 + for _ in range(diff): + named_vectors.append(np.array([])) + + if vector is None: + # Add fake vector and mark as removed + named_vectors[idx] = np.array([]) + self.deleted_per_vector[vector_name] = np.append( + self.deleted_per_vector[vector_name], 1 + ) + else: + vector_np = np.array(vector, dtype=np.float32) + assert not np.isnan(vector_np).any(), "Vector contains NaN values" + params = self.get_vector_params(vector_name) + if params.distance == models.Distance.COSINE: + vector_norm = np.linalg.norm(vector_np, axis=-1)[:, np.newaxis] + vector_np /= np.where(vector_norm != 0.0, vector_norm, EPSILON) + named_vectors[idx] = vector_np + self.deleted_per_vector[vector_name] = np.append( + self.deleted_per_vector[vector_name], 0 + ) + + self.multivectors[vector_name] = named_vectors + + def _upsert_point(self, point: models.PointStruct) -> None: + if isinstance(point.id, str): + # try to parse as UUID + try: + _uuid = uuid.UUID(point.id) + except ValueError as e: + raise ValueError(f"Point id {point.id} is not a valid UUID") from e + + if isinstance(point.vector, dict): + updated_sparse_vectors = {} + for vector_name, vector in point.vector.items(): + if vector_name not in self._all_vectors_keys: + raise ValueError(f"Wrong input: Not existing vector name error: {vector_name}") + if isinstance(vector, SparseVector): + # validate sparse vector + validate_sparse_vector(vector) + # sort sparse vector by indices before persistence + updated_sparse_vectors[vector_name] = sort_sparse_vector(vector) + # update point.vector with the modified values after iteration + point.vector.update(updated_sparse_vectors) + else: + vector_names = list(self.vectors.keys()) + multivector_names = list(self.multivectors.keys()) + if (vector_names and vector_names != [""]) or ( + multivector_names and multivector_names != [""] + ): + raise ValueError( + "Wrong input: Unnamed vectors are not allowed when a collection has named vectors or multivectors: " + f"{vector_names}, {multivector_names}" + ) + if not self.vectors and not self.multivectors: + raise ValueError("Wrong input: Not existing vector name error") + + if point.id in self.ids: + self._update_point(point) + else: + self._add_point(point) + + if self.storage is not None: + self.storage.persist(point) + + def upsert(self, points: Union[Sequence[models.PointStruct], models.Batch]) -> None: + if isinstance(points, list): + for point in points: + self._upsert_point(point) + elif isinstance(points, models.Batch): + batch = points + if isinstance(batch.vectors, list): + vectors = {DEFAULT_VECTOR_NAME: batch.vectors} + else: + vectors = batch.vectors + + for idx, point_id in enumerate(batch.ids): + payload = None + if batch.payloads is not None: + payload = batch.payloads[idx] + + vector = {name: v[idx] for name, v in vectors.items()} + + self._upsert_point( + models.PointStruct( + id=point_id, + payload=payload, + vector=vector, + ) + ) + else: + raise ValueError(f"Unsupported type: {type(points)}") + + if len(self.ids) > self.LARGE_DATA_THRESHOLD: + show_warning_once( + f"Local mode is not recommended for collections with more than {self.LARGE_DATA_THRESHOLD:,} " + f"points. Current collection contains {len(self.ids)} points. " + "Consider using Qdrant in Docker or Qdrant Cloud for better performance with large datasets.", + category=UserWarning, + idx="large-local-collection", + stacklevel=6, + ) + + def _update_named_vectors( + self, idx: int, vectors: dict[str, Union[list[float], SparseVector, list[list[float]]]] + ) -> None: + for vector_name, vector in vectors.items(): + if vector_name not in self._all_vectors_keys: + raise ValueError(f"Wrong input: Not existing vector name error: {vector_name}") + + self.deleted_per_vector[vector_name][idx] = 0 + + if isinstance(vector, SparseVector): + validate_sparse_vector(vector) + old_vector = self.sparse_vectors[vector_name][idx] + self._update_idf_remove(old_vector, vector_name) + new_vector = sort_sparse_vector(vector) + self.sparse_vectors[vector_name][idx] = new_vector + self._update_idf_append(new_vector, vector_name) + continue + + vector_np = np.array(vector, dtype=np.float32) + assert not np.isnan(vector_np).any(), "Vector contains NaN values" + params = self.get_vector_params(vector_name) + if vector_name in self.vectors: + if params.distance == models.Distance.COSINE: + norm = np.linalg.norm(vector_np) + vector_np = vector_np / norm if norm > EPSILON else vector_np + self.vectors[vector_name][idx] = vector_np + else: + if params.distance == models.Distance.COSINE: + vector_norm = np.linalg.norm(vector_np, axis=-1)[:, np.newaxis] + vector_np /= np.where(vector_norm != 0.0, vector_norm, EPSILON) + self.multivectors[vector_name][idx] = vector_np + + def update_vectors(self, points: Sequence[types.PointVectors]) -> None: + for point in points: + point_id = point.id + idx = self.ids[point_id] + vector_struct = point.vector + if isinstance(vector_struct, list): + fixed_vectors = {DEFAULT_VECTOR_NAME: vector_struct} + else: + fixed_vectors = vector_struct + self._update_named_vectors(idx, fixed_vectors) + self._persist_by_id(point_id) + + def delete_vectors( + self, + vectors: Sequence[str], + selector: Union[ + models.Filter, + list[models.ExtendedPointId], + models.FilterSelector, + models.PointIdsList, + ], + ) -> None: + ids = self._selector_to_ids(selector) + for point_id in ids: + idx = self.ids[point_id] + for vector_name in vectors: + self.deleted_per_vector[vector_name][idx] = 1 + self._persist_by_id(point_id) + + def _delete_ids(self, ids: list[types.PointId]) -> None: + for point_id in ids: + if point_id in self.ids: + idx = self.ids[point_id] + self.deleted[idx] = 1 + + if self.storage is not None: + for point_id in ids: + if point_id in self.ids: + self.storage.delete(point_id) + + def _filter_to_ids(self, delete_filter: types.Filter) -> list[models.ExtendedPointId]: + mask = self._payload_and_non_deleted_mask(delete_filter) + ids = [point_id for point_id, idx in self.ids.items() if mask[idx]] + return ids + + def _selector_to_ids( + self, + selector: Union[ + models.Filter, + list[models.ExtendedPointId], + models.FilterSelector, + models.PointIdsList, + ], + ) -> list[models.ExtendedPointId]: + if isinstance(selector, list): + return selector + elif isinstance(selector, models.Filter): + return self._filter_to_ids(selector) + elif isinstance(selector, models.PointIdsList): + return selector.points + elif isinstance(selector, models.FilterSelector): + return self._filter_to_ids(selector.filter) + else: + raise ValueError(f"Unsupported selector type: {type(selector)}") + + def delete( + self, + selector: Union[ + models.Filter, + list[models.ExtendedPointId], + models.FilterSelector, + models.PointIdsList, + ], + ) -> None: + ids = self._selector_to_ids(selector) + self._delete_ids(ids) + + def _persist_by_id(self, point_id: models.ExtendedPointId) -> None: + if self.storage is not None: + idx = self.ids[point_id] + point = models.PointStruct( + id=point_id, + payload=self._get_payload(idx, with_payload=True, return_copy=False), + vector=self._get_vectors(idx, with_vectors=True), + ) + self.storage.persist(point) + + def set_payload( + self, + payload: models.Payload, + selector: Union[ + models.Filter, + list[models.ExtendedPointId], + models.FilterSelector, + models.PointIdsList, + ], + key: Optional[str] = None, + ) -> None: + ids = self._selector_to_ids(selector) + jsonable_payload = deepcopy(to_jsonable_python(payload)) + + keys: Optional[list[JsonPathItem]] = parse_json_path(key) if key is not None else None + + for point_id in ids: + idx = self.ids[point_id] + if keys is None: + self.payload[idx] = {**self.payload[idx], **jsonable_payload} + else: + if self.payload[idx] is not None: + set_value_by_key(payload=self.payload[idx], value=jsonable_payload, keys=keys) + + self._persist_by_id(point_id) + + def overwrite_payload( + self, + payload: models.Payload, + selector: Union[ + models.Filter, + list[models.ExtendedPointId], + models.FilterSelector, + models.PointIdsList, + ], + ) -> None: + ids = self._selector_to_ids(selector) + for point_id in ids: + idx = self.ids[point_id] + self.payload[idx] = deepcopy(to_jsonable_python(payload)) or {} + self._persist_by_id(point_id) + + def delete_payload( + self, + keys: Sequence[str], + selector: Union[ + models.Filter, + list[models.ExtendedPointId], + models.FilterSelector, + models.PointIdsList, + ], + ) -> None: + ids = self._selector_to_ids(selector) + for point_id in ids: + idx = self.ids[point_id] + for key in keys: + if key in self.payload[idx]: + self.payload[idx].pop(key) + self._persist_by_id(point_id) + + def clear_payload( + self, + selector: Union[ + models.Filter, + list[models.ExtendedPointId], + models.FilterSelector, + models.PointIdsList, + ], + ) -> None: + ids = self._selector_to_ids(selector) + for point_id in ids: + idx = self.ids[point_id] + self.payload[idx] = {} + self._persist_by_id(point_id) + + def batch_update_points( + self, + update_operations: Sequence[types.UpdateOperation], + ) -> None: + for update_op in update_operations: + if isinstance(update_op, models.UpsertOperation): + if isinstance(update_op.upsert, models.PointsBatch): + self.upsert(update_op.upsert.batch) + elif isinstance(update_op.upsert, models.PointsList): + self.upsert(update_op.upsert.points) + else: + raise ValueError(f"Unsupported upsert type: {type(update_op.upsert)}") + elif isinstance(update_op, models.DeleteOperation): + self.delete(update_op.delete) + elif isinstance(update_op, models.SetPayloadOperation): + points_selector = update_op.set_payload.points or update_op.set_payload.filter + self.set_payload( + update_op.set_payload.payload, points_selector, update_op.set_payload.key + ) + elif isinstance(update_op, models.OverwritePayloadOperation): + points_selector = ( + update_op.overwrite_payload.points or update_op.overwrite_payload.filter + ) + self.overwrite_payload(update_op.overwrite_payload.payload, points_selector) + elif isinstance(update_op, models.DeletePayloadOperation): + points_selector = ( + update_op.delete_payload.points or update_op.delete_payload.filter + ) + self.delete_payload(update_op.delete_payload.keys, points_selector) + elif isinstance(update_op, models.ClearPayloadOperation): + self.clear_payload(update_op.clear_payload) + elif isinstance(update_op, models.UpdateVectorsOperation): + self.update_vectors(update_op.update_vectors.points) + elif isinstance(update_op, models.DeleteVectorsOperation): + points_selector = ( + update_op.delete_vectors.points or update_op.delete_vectors.filter + ) + self.delete_vectors(update_op.delete_vectors.vector, points_selector) + else: + raise ValueError(f"Unsupported update operation: {type(update_op)}") + + def update_sparse_vectors_config( + self, vector_name: str, new_config: models.SparseVectorParams + ) -> None: + if vector_name not in self.sparse_vectors: + raise ValueError(f"Vector {vector_name} does not exist in the collection") + + self.config.sparse_vectors[vector_name] = new_config + + def info(self) -> models.CollectionInfo: + return models.CollectionInfo( + status=models.CollectionStatus.GREEN, + optimizer_status=models.OptimizersStatusOneOf.OK, + vectors_count=None, + indexed_vectors_count=0, # LocalCollection does not do indexing + points_count=self.count().count, + segments_count=1, + payload_schema={}, + config=models.CollectionConfig( + params=models.CollectionParams( + vectors=self.config.vectors, + shard_number=self.config.shard_number, + replication_factor=self.config.replication_factor, + write_consistency_factor=self.config.write_consistency_factor, + on_disk_payload=self.config.on_disk_payload, + sparse_vectors=self.config.sparse_vectors, + ), + hnsw_config=models.HnswConfig( + m=16, + ef_construct=100, + full_scan_threshold=10000, + ), + wal_config=models.WalConfig( + wal_capacity_mb=32, + wal_segments_ahead=0, + ), + optimizer_config=models.OptimizersConfig( + deleted_threshold=0.2, + vacuum_min_vector_number=1000, + default_segment_number=0, + indexing_threshold=20000, + flush_interval_sec=5, + max_optimization_threads=1, + ), + quantization_config=None, + ), + ) + + +def ignore_mentioned_ids_filter( + query_filter: Optional[types.Filter], mentioned_ids: list[types.PointId] +) -> types.Filter: + if len(mentioned_ids) == 0: + return query_filter + + ignore_mentioned_ids = models.HasIdCondition(has_id=mentioned_ids) + + if query_filter is None: + query_filter = models.Filter(must_not=[ignore_mentioned_ids]) + else: + # as of mypy v1.11.0 mypy is complaining on deep-copied structures with None + query_filter = deepcopy(query_filter) + assert query_filter is not None # educating mypy + if query_filter.must_not is None: + query_filter.must_not = [ignore_mentioned_ids] + elif isinstance(query_filter.must_not, list): + query_filter.must_not.append(ignore_mentioned_ids) + else: + query_filter.must_not = [query_filter.must_not, ignore_mentioned_ids] + + return query_filter + + +def _include_ids_in_filter( + query_filter: Optional[types.Filter], ids: list[types.PointId] +) -> types.Filter: + if len(ids) == 0: + return query_filter + + include_ids = models.HasIdCondition(has_id=ids) + + if query_filter is None: + query_filter = models.Filter(must=[include_ids]) + else: + # as of mypy v1.11.0 mypy is complaining on deep-copied structures with None + query_filter = deepcopy(query_filter) + assert query_filter is not None # educating mypy + if query_filter.must is None: + query_filter.must = [include_ids] + elif isinstance(query_filter.must, list): + query_filter.must.append(include_ids) + else: + query_filter.must = [query_filter.must, include_ids] + + return query_filter + + +def record_to_scored_point(record: types.Record) -> types.ScoredPoint: + return types.ScoredPoint( + id=record.id, + version=0, + score=0, + payload=record.payload, + vector=record.vector, + order_value=record.order_value, + ) + + +def set_prefetch_limit_recursively(prefetch: types.Prefetch, limit: int) -> types.Prefetch: + if prefetch is not None: + if isinstance(prefetch.prefetch, list): + return types.Prefetch( + limit=limit, + prefetch=[set_prefetch_limit_recursively(p, limit) for p in prefetch.prefetch], + ) + else: + return types.Prefetch(limit=limit, prefetch=list()) diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/local/multi_distances.py b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/local/multi_distances.py new file mode 100644 index 0000000000000000000000000000000000000000..79935181c296c8395a03d933a8c16495554f8c8e --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/local/multi_distances.py @@ -0,0 +1,222 @@ +from typing import Optional, Union, Any + +import numpy as np + +from qdrant_client.http import models +from qdrant_client.conversions import common_types as types +from qdrant_client.local.distances import ( + distance_to_order, + DistanceOrder, + calculate_distance, + scaled_fast_sigmoid, + EPSILON, + fast_sigmoid, +) + + +class MultiRecoQuery: + def __init__( + self, + positive: Optional[list[list[list[float]]]] = None, # list of matrices + negative: Optional[list[list[list[float]]]] = None, # list of matrices + strategy: Optional[models.RecommendStrategy] = None, + ): + assert strategy is not None, "Recommend strategy must be provided" + + self.strategy = strategy + + positive = positive if positive is not None else [] + negative = negative if negative is not None else [] + + for vector in positive: + assert not np.isnan(vector).any(), "Positive vectors must not contain NaN" + for vector in negative: + assert not np.isnan(vector).any(), "Negative vectors must not contain NaN" + + self.positive: list[types.NumpyArray] = [np.array(vector) for vector in positive] + self.negative: list[types.NumpyArray] = [np.array(vector) for vector in negative] + + +class MultiContextPair: + def __init__(self, positive: list[list[float]], negative: list[list[float]]): + self.positive: types.NumpyArray = np.array(positive) + self.negative: types.NumpyArray = np.array(negative) + + assert not np.isnan(self.positive).any(), "Positive vector must not contain NaN" + assert not np.isnan(self.negative).any(), "Negative vector must not contain NaN" + + +class MultiDiscoveryQuery: + def __init__(self, target: list[list[float]], context: list[MultiContextPair]): + self.target: types.NumpyArray = np.array(target) + self.context = context + + assert not np.isnan(self.target).any(), "Target vector must not contain NaN" + + +class MultiContextQuery: + def __init__(self, context_pairs: list[MultiContextPair]): + self.context_pairs = context_pairs + + +MultiQueryVector = Union[ + MultiDiscoveryQuery, + MultiContextQuery, + MultiRecoQuery, +] + + +def calculate_multi_distance( + query_matrix: types.NumpyArray, + matrices: list[types.NumpyArray], + distance_type: models.Distance, +) -> types.NumpyArray: + assert not np.isnan(query_matrix).any(), "Query matrix must not contain NaN" + assert len(query_matrix.shape) == 2, "Query must be a matrix" + + distances = calculate_multi_distance_core(query_matrix, matrices, distance_type) + + if distance_type == models.Distance.EUCLID: + distances = np.sqrt(np.abs(distances)) + elif distance_type == models.Distance.MANHATTAN: + distances = np.abs(distances) + return distances + + +def calculate_multi_distance_core( + query_matrix: types.NumpyArray, + matrices: list[types.NumpyArray], + distance_type: models.Distance, +) -> types.NumpyArray: + def euclidean(q: types.NumpyArray, m: types.NumpyArray, *_: Any) -> types.NumpyArray: + return -np.square(m - q, dtype=np.float32).sum(axis=-1, dtype=np.float32) + + def manhattan(q: types.NumpyArray, m: types.NumpyArray, *_: Any) -> types.NumpyArray: + return -np.abs(m - q, dtype=np.float32).sum(axis=-1, dtype=np.float32) + + assert not np.isnan(query_matrix).any(), "Query vector must not contain NaN" + similarities: list[float] = [] + + # Euclid and Manhattan are the only ones which are calculated differently during candidate selection + # in core, here we make sure to use the same internal similarity function as in core. + if distance_type in [models.Distance.EUCLID, models.Distance.MANHATTAN]: + query_matrix = query_matrix[:, np.newaxis] + dist_func = euclidean if distance_type == models.Distance.EUCLID else manhattan + else: + dist_func = calculate_distance # type: ignore + + for matrix in matrices: + sim_matrix = dist_func(query_matrix, matrix, distance_type) + similarity = float(np.sum(np.max(sim_matrix, axis=-1))) + similarities.append(similarity) + return np.array(similarities) + + +def calculate_multi_recommend_best_scores( + query: MultiRecoQuery, matrices: list[types.NumpyArray], distance_type: models.Distance +) -> types.NumpyArray: + def get_best_scores(examples: list[types.NumpyArray]) -> types.NumpyArray: + matrix_count = len(matrices) + + # Get scores to all examples + scores: list[types.NumpyArray] = [] + for example in examples: + score = calculate_multi_distance_core(example, matrices, distance_type) + scores.append(score) + + # Keep only max for each vector + if len(scores) == 0: + scores.append(np.full(matrix_count, -np.inf)) + best_scores = np.array(scores, dtype=np.float32).max(axis=0) + + return best_scores + + pos = get_best_scores(query.positive) + neg = get_best_scores(query.negative) + + # Choose from the best positive or the best negative, + # in both cases we apply sigmoid and then negate depending on the order + return np.where( + pos > neg, + np.fromiter((scaled_fast_sigmoid(xi) for xi in pos), pos.dtype), + np.fromiter((-scaled_fast_sigmoid(xi) for xi in neg), neg.dtype), + ) + + +def calculate_multi_recommend_sum_scores( + query: MultiRecoQuery, matrices: list[types.NumpyArray], distance_type: models.Distance +) -> types.NumpyArray: + def get_sum_scores(examples: list[types.NumpyArray]) -> types.NumpyArray: + matrix_count = len(matrices) + + scores: list[types.NumpyArray] = [] + for example in examples: + score = calculate_multi_distance_core(example, matrices, distance_type) + scores.append(score) + + if len(scores) == 0: + scores.append(np.zeros(matrix_count)) + + sum_scores = np.array(scores, dtype=np.float32).sum(axis=0) + return sum_scores + + pos = get_sum_scores(query.positive) + neg = get_sum_scores(query.negative) + + return pos - neg + + +def calculate_multi_discovery_ranks( + context: list[MultiContextPair], + matrices: list[types.NumpyArray], + distance_type: models.Distance, +) -> types.NumpyArray: + overall_ranks: types.NumpyArray = np.zeros(len(matrices), dtype=np.int32) + for pair in context: + # Get distances to positive and negative vectors + pos = calculate_multi_distance_core(pair.positive, matrices, distance_type) + neg = calculate_multi_distance_core(pair.negative, matrices, distance_type) + + pair_ranks = np.array( + [ + 1 if is_bigger else 0 if is_equal else -1 + for is_bigger, is_equal in zip(pos > neg, pos == neg) + ] + ) + + overall_ranks += pair_ranks + + return overall_ranks + + +def calculate_multi_discovery_scores( + query: MultiDiscoveryQuery, matrices: list[types.NumpyArray], distance_type: models.Distance +) -> types.NumpyArray: + ranks = calculate_multi_discovery_ranks(query.context, matrices, distance_type) + + # Get distances to target + distances_to_target = calculate_multi_distance_core(query.target, matrices, distance_type) + + sigmoided_distances = np.fromiter( + (scaled_fast_sigmoid(xi) for xi in distances_to_target), np.float32 + ) + + return ranks + sigmoided_distances + + +def calculate_multi_context_scores( + query: MultiContextQuery, matrices: list[types.NumpyArray], distance_type: models.Distance +) -> types.NumpyArray: + overall_scores: types.NumpyArray = np.zeros(len(matrices), dtype=np.float32) + for pair in query.context_pairs: + # Get distances to positive and negative vectors + pos = calculate_multi_distance_core(pair.positive, matrices, distance_type) + neg = calculate_multi_distance_core(pair.negative, matrices, distance_type) + + difference = pos - neg - EPSILON + pair_scores = np.fromiter( + (fast_sigmoid(xi) for xi in np.minimum(difference, 0.0)), np.float32 + ) + overall_scores += pair_scores + + return overall_scores diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/local/order_by.py b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/local/order_by.py new file mode 100644 index 0000000000000000000000000000000000000000..074bab2b467427cfbadadbe7c92648188594739d --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/local/order_by.py @@ -0,0 +1,30 @@ +from datetime import datetime +from typing import Optional, Union + +from qdrant_client.http.models import OrderValue +from qdrant_client.local.datetime_utils import parse + +MICROS_PER_SECOND = 1_000_000 + + +def datetime_to_microseconds(dt: datetime) -> int: + return int(dt.timestamp() * MICROS_PER_SECOND) + + +def to_order_value(value: Union[None, OrderValue, datetime, str]) -> Optional[OrderValue]: + if value is None: + return None + + # check if OrderValue + if isinstance(value, (int, float)): + return value + + if isinstance(value, datetime): + return datetime_to_microseconds(value) + + if isinstance(value, str): + dt = parse(value) + if dt is not None: + return datetime_to_microseconds(dt) + + return None diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/local/payload_filters.py b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/local/payload_filters.py new file mode 100644 index 0000000000000000000000000000000000000000..dc911f8fb5979cc14f779aa82d8c679add25d4f8 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/local/payload_filters.py @@ -0,0 +1,333 @@ +from datetime import date, datetime, timezone +from typing import Any, Optional, Union, Dict + +import numpy as np + +from qdrant_client.http import models +from qdrant_client.local import datetime_utils +from qdrant_client.local.geo import boolean_point_in_polygon, geo_distance +from qdrant_client.local.payload_value_extractor import value_by_key +from qdrant_client.conversions import common_types as types + + +def get_value_counts(values: list[Any]) -> list[int]: + counts = [] + + if all(value is None for value in values): + counts.append(0) + else: + for value in values: + if value is None: + counts.append(0) + elif hasattr(value, "__len__") and not isinstance(value, str): + counts.append(len(value)) + else: + counts.append(1) + return counts + + +def check_values_count(condition: models.ValuesCount, values: Optional[list[Any]]) -> bool: + if values is None: + return False + + counts = get_value_counts(values) + + if condition.lt is not None and all(count >= condition.lt for count in counts): + return False + if condition.lte is not None and all(count > condition.lte for count in counts): + return False + if condition.gt is not None and all(count <= condition.gt for count in counts): + return False + if condition.gte is not None and all(count < condition.gte for count in counts): + return False + return True + + +def check_geo_radius(condition: models.GeoRadius, values: Any) -> bool: + if isinstance(values, dict) and "lat" in values and "lon" in values: + lat = values["lat"] + lon = values["lon"] + + distance = geo_distance( + lon1=lon, + lat1=lat, + lon2=condition.center.lon, + lat2=condition.center.lat, + ) + + return distance < condition.radius + + return False + + +def check_geo_bounding_box(condition: models.GeoBoundingBox, values: Any) -> bool: + if isinstance(values, dict) and "lat" in values and "lon" in values: + lat = values["lat"] + lon = values["lon"] + + # handle anti-meridian crossing case + if condition.top_left.lon > condition.bottom_right.lon: + longitude_condition = ( + condition.top_left.lon <= lon <= 180 or -180 <= lon <= condition.bottom_right.lon + ) + else: + longitude_condition = condition.top_left.lon <= lon <= condition.bottom_right.lon + + latitude_condition = condition.top_left.lat >= lat >= condition.bottom_right.lat + + return longitude_condition and latitude_condition + + return False + + +def check_geo_polygon(condition: models.GeoPolygon, values: Any) -> bool: + if isinstance(values, dict) and "lat" in values and "lon" in values: + lat = values["lat"] + lon = values["lon"] + exterior = [(point.lat, point.lon) for point in condition.exterior.points] + interiors = [] + if condition.interiors is not None: + interiors = [ + [(point.lat, point.lon) for point in interior.points] + for interior in condition.interiors + ] + return boolean_point_in_polygon(point=(lat, lon), exterior=exterior, interiors=interiors) + + return False + + +def check_range_interface(condition: models.RangeInterface, value: Any) -> bool: + if isinstance(condition, models.Range): + return check_range(condition, value) + if isinstance(condition, models.DatetimeRange): + return check_datetime_range(condition, value) + return False + + +def check_range(condition: models.Range, value: Any) -> bool: + if not isinstance(value, (int, float)): + return False + return ( + (condition.lt is None or value < condition.lt) + and (condition.lte is None or value <= condition.lte) + and (condition.gt is None or value > condition.gt) + and (condition.gte is None or value >= condition.gte) + ) + + +def check_datetime_range(condition: models.DatetimeRange, value: Any) -> bool: + def make_condition_tz_aware(dt: Optional[Union[datetime, date]]) -> Optional[datetime]: + if isinstance(dt, date) and not isinstance(dt, datetime): + dt = datetime.combine(dt, datetime.min.time()) + + if dt is None or dt.tzinfo is not None: + return dt + + # Assume UTC if no timezone is provided + return dt.replace(tzinfo=timezone.utc) + + if not isinstance(value, str): + return False + + dt = datetime_utils.parse(value) + + if dt is None: + return False + + condition.lt = make_condition_tz_aware(condition.lt) + condition.lte = make_condition_tz_aware(condition.lte) + condition.gt = make_condition_tz_aware(condition.gt) + condition.gte = make_condition_tz_aware(condition.gte) + + return ( + (condition.lt is None or dt < condition.lt) + and (condition.lte is None or dt <= condition.lte) + and (condition.gt is None or dt > condition.gt) + and (condition.gte is None or dt >= condition.gte) + ) + + +def check_match(condition: models.Match, value: Any) -> bool: + if isinstance(condition, models.MatchValue): + return value == condition.value + if isinstance(condition, models.MatchText): + return value is not None and condition.text in value + if isinstance(condition, models.MatchAny): + return value in condition.any + if isinstance(condition, models.MatchExcept): + return value not in condition.except_ + raise ValueError(f"Unknown match condition: {condition}") + + +def check_nested_filter(nested_filter: models.Filter, values: list[Any]) -> bool: + return any(check_filter(nested_filter, v, point_id=-1, has_vector={}) for v in values) + + +def check_condition( + condition: models.Condition, + payload: dict[str, Any], + point_id: models.ExtendedPointId, + has_vector: Dict[str, bool], +) -> bool: + if isinstance(condition, models.IsNullCondition): + values = value_by_key(payload, condition.is_null.key, flat=False) + if values is None: + return False + if any(v is None for v in values): + return True + elif isinstance(condition, models.IsEmptyCondition): + values = value_by_key(payload, condition.is_empty.key, flat=False) + if ( + values is None + or len(values) == 0 + or all((v is None or (isinstance(v, list) and len(v) == 0)) for v in values) + ): + return True + elif isinstance(condition, models.HasIdCondition): + if point_id in condition.has_id: + return True + elif isinstance(condition, models.HasVectorCondition): + if condition.has_vector in has_vector and has_vector[condition.has_vector]: + return True + elif isinstance(condition, models.FieldCondition): + values = value_by_key(payload, condition.key) + if condition.match is not None: + if values is None: + return False + return any(check_match(condition.match, v) for v in values) + if condition.range is not None: + if values is None: + return False + return any(check_range_interface(condition.range, v) for v in values) + if condition.geo_bounding_box is not None: + if values is None: + return False + return any(check_geo_bounding_box(condition.geo_bounding_box, v) for v in values) + if condition.geo_radius is not None: + if values is None: + return False + return any(check_geo_radius(condition.geo_radius, v) for v in values) + if condition.values_count is not None: + values = value_by_key(payload, condition.key, flat=False) + return check_values_count(condition.values_count, values) + if condition.geo_polygon is not None: + if values is None: + return False + return any(check_geo_polygon(condition.geo_polygon, v) for v in values) + elif isinstance(condition, models.NestedCondition): + values = value_by_key(payload, condition.nested.key) + if values is None: + return False + return check_nested_filter(condition.nested.filter, values) + elif isinstance(condition, models.Filter): + return check_filter(condition, payload, point_id, has_vector) + else: + raise ValueError(f"Unknown condition: {condition}") + return False + + +def check_must( + conditions: list[models.Condition], + payload: dict, + point_id: models.ExtendedPointId, + has_vector: Dict[str, bool], +) -> bool: + return all( + check_condition(condition, payload, point_id, has_vector) for condition in conditions + ) + + +def check_must_not( + conditions: list[models.Condition], + payload: dict, + point_id: models.ExtendedPointId, + has_vector: Dict[str, bool], +) -> bool: + return all( + not check_condition(condition, payload, point_id, has_vector) for condition in conditions + ) + + +def check_should( + conditions: list[models.Condition], + payload: dict, + point_id: models.ExtendedPointId, + has_vector: Dict[str, bool], +) -> bool: + return any( + check_condition(condition, payload, point_id, has_vector) for condition in conditions + ) + + +def check_min_should( + conditions: list[models.Condition], + payload: dict, + point_id: models.ExtendedPointId, + vectors: Dict[str, Any], + min_count: int, +) -> bool: + return ( + sum(check_condition(condition, payload, point_id, vectors) for condition in conditions) + >= min_count + ) + + +def check_filter( + payload_filter: models.Filter, + payload: dict, + point_id: models.ExtendedPointId, + has_vector: Dict[str, bool], +) -> bool: + def ensure_condition_list( + condition: Union[models.Condition, list[models.Condition]], + ) -> list[models.Condition]: + if isinstance(condition, list): + return condition + return [condition] + + if payload_filter.must is not None: + if not check_must( + ensure_condition_list(payload_filter.must), payload, point_id, has_vector + ): + return False + if payload_filter.must_not is not None: + if not check_must_not( + ensure_condition_list(payload_filter.must_not), payload, point_id, has_vector + ): + return False + if payload_filter.should is not None: + if not check_should( + ensure_condition_list(payload_filter.should), payload, point_id, has_vector + ): + return False + if payload_filter.min_should is not None: + if not check_min_should( + payload_filter.min_should.conditions, + payload, + point_id, + has_vector, + payload_filter.min_should.min_count, + ): + return False + return True + + +def calculate_payload_mask( + payloads: list[dict], + payload_filter: Optional[models.Filter], + ids_inv: list[models.ExtendedPointId], + deleted_per_vector: Dict[str, np.ndarray], +) -> types.NumpyArray: + if payload_filter is None: + return np.ones(len(payloads), dtype=bool) + + mask: types.NumpyArray = np.zeros(len(payloads), dtype=bool) + for i, payload in enumerate(payloads): + has_vector = {} + for vector_name, deleted in deleted_per_vector.items(): + if not deleted[i]: + has_vector[vector_name] = True + + if check_filter(payload_filter, payload, ids_inv[i], has_vector): + mask[i] = True + return mask diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/local/payload_value_extractor.py b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/local/payload_value_extractor.py new file mode 100644 index 0000000000000000000000000000000000000000..d343a709c4b8a4d51bda87827ce6c22f76432fe2 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/local/payload_value_extractor.py @@ -0,0 +1,92 @@ +import uuid +from typing import Any, Optional + +from qdrant_client.local.json_path_parser import ( + JsonPathItem, + JsonPathItemType, + parse_json_path, +) + + +def value_by_key(payload: dict[str, Any], key: str, flat: bool = True) -> Optional[list[Any]]: + """ + Get value from payload by key. + Args: + payload: arbitrary json-like object + flat: If True, extend list of values. If False, append. By default, we use True and flatten the arrays, + we need it for filters, however for `count` method we need to keep the arrays as is. + key: + Key or path to value in payload. + Examples: + - "name" + - "address.city" + - "location[].name" + - "location[0].name" + + Returns: + List of values or None if key not found. + """ + keys = parse_json_path(key) + result = [] + + def _get_value(data: Any, k_list: list[JsonPathItem]) -> None: + if not k_list: + return + + current_key = k_list.pop(0) + if len(k_list) == 0: + if isinstance(data, dict) and current_key.item_type == JsonPathItemType.KEY: + if current_key.key in data: + value = data[current_key.key] + if isinstance(value, list) and flat: + result.extend(value) + else: + result.append(value) + + elif isinstance(data, list): + if current_key.item_type == JsonPathItemType.WILDCARD_INDEX: + result.extend(data) + + elif current_key.item_type == JsonPathItemType.INDEX: + assert current_key.index is not None + + if current_key.index < len(data): + result.append(data[current_key.index]) + + elif current_key.item_type == JsonPathItemType.KEY: + if not isinstance(data, dict): + return + + if current_key.key in data: + _get_value(data[current_key.key], k_list.copy()) + + elif current_key.item_type == JsonPathItemType.INDEX: + assert current_key.index is not None + + if not isinstance(data, list): + return + + if current_key.index < len(data): + _get_value(data[current_key.index], k_list.copy()) + + elif current_key.item_type == JsonPathItemType.WILDCARD_INDEX: + if not isinstance(data, list): + return + + for item in data: + _get_value(item, k_list.copy()) + + _get_value(payload, keys) + return result if result else None + + +def parse_uuid(value: Any) -> Optional[uuid.UUID]: + """ + Parse UUID from value. + Args: + value: arbitrary value + """ + try: + return uuid.UUID(str(value)) + except ValueError: + return None diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/local/payload_value_setter.py b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/local/payload_value_setter.py new file mode 100644 index 0000000000000000000000000000000000000000..002c881a1fdb71918045ae4829c6d8954ec913f8 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/local/payload_value_setter.py @@ -0,0 +1,247 @@ +from typing import Any, Optional, Type + +from qdrant_client.local.json_path_parser import JsonPathItem, JsonPathItemType + + +def set_value_by_key(payload: dict, keys: list[JsonPathItem], value: Any) -> None: + """ + Set value in payload by key. + Args: + payload: arbitrary json-like object + keys: + list of json path items, e.g.: + [ + JsonPathItem(item_type=, value='a'), + JsonPathItem(item_type=, value=0), + JsonPathItem(item_type=, value=1), + JsonPathItem(item_type=, value='b') + ] + + The original keys could look like this: + - "name" + - "address.city" + - "location[].name" + - "location[0].name" + + value: value to set + """ + Setter.set(payload, keys.copy(), value, None, None) + + +class Setter: + TYPE: Any + SETTERS: dict[JsonPathItemType, Type["Setter"]] = {} + + @classmethod + def add_setter(cls, item_type: JsonPathItemType, setter: Type["Setter"]) -> None: + cls.SETTERS[item_type] = setter + + @classmethod + def set( + cls, + data: Any, + k_list: list[JsonPathItem], + value: dict[str, Any], + prev_data: Any, + prev_key: Optional[JsonPathItem], + ) -> None: + if not k_list: + return + + current_key = k_list.pop(0) + cls.SETTERS[current_key.item_type]._set( + data, + current_key, + k_list, + value, + prev_data, + prev_key, + ) + + @classmethod + def _set( + cls, + data: Any, + current_key: JsonPathItem, + k_list: list[JsonPathItem], + value: dict[str, Any], + prev_data: Any, + prev_key: Optional[JsonPathItem], + ) -> None: + if isinstance(data, cls.TYPE): + cls._set_compatible_types( + data=data, current_key=current_key, k_list=k_list, value=value + ) + else: + cls._set_incompatible_types( + current_key=current_key, + k_list=k_list, + value=value, + prev_data=prev_data, + prev_key=prev_key, + ) + + @classmethod + def _set_compatible_types( + cls, + data: Any, + current_key: JsonPathItem, + k_list: list[JsonPathItem], + value: dict[str, Any], + ) -> None: + raise NotImplementedError() + + @classmethod + def _set_incompatible_types( + cls, + current_key: JsonPathItem, + k_list: list[JsonPathItem], + value: dict[str, Any], + prev_data: Any, + prev_key: Optional[JsonPathItem], + ) -> None: + raise NotImplementedError() + + +class KeySetter(Setter): + TYPE = dict + + @classmethod + def _set_compatible_types( + cls, + data: Any, + current_key: JsonPathItem, + k_list: list[JsonPathItem], + value: dict[str, Any], + ) -> None: + if current_key.key not in data: + data[current_key.key] = {} + + if len(k_list) == 0: + if isinstance(data[current_key.key], dict): + data[current_key.key].update(value) + else: + data[current_key.key] = value + else: + cls.set(data[current_key.key], k_list.copy(), value, data, current_key) + + @classmethod + def _set_incompatible_types( + cls, + current_key: JsonPathItem, + k_list: list[JsonPathItem], + value: dict[str, Any], + prev_data: Any, + prev_key: Optional[JsonPathItem], + ) -> None: + assert prev_key is not None + + if len(k_list) == 0: + if prev_key.item_type == JsonPathItemType.KEY: + prev_data[prev_key.key] = {current_key.key: value} + else: # if prev key was WILDCARD, we need to pass INDEX instead with an index set + prev_data[prev_key.index] = {current_key.key: value} + else: + if prev_key.item_type == JsonPathItemType.KEY: + prev_data[prev_key.key] = {current_key.key: {}} + cls.set( + prev_data[prev_key.key][current_key.key], + k_list.copy(), + value, + prev_data[prev_key.key], + current_key, + ) + else: + prev_data[prev_key.index] = {current_key.key: {}} + cls.set( + prev_data[prev_key.index][current_key.key], + k_list.copy(), + value, + prev_data[prev_key.index], + current_key, + ) + + +class _ListSetter(Setter): + TYPE = list + + @classmethod + def _set_incompatible_types( + cls, + current_key: JsonPathItem, + k_list: list[JsonPathItem], + value: dict[str, Any], + prev_data: Any, + prev_key: Optional[JsonPathItem], + ) -> None: + assert prev_key is not None + + if prev_key.item_type == JsonPathItemType.KEY: + prev_data[prev_key.key] = [] + return + else: + prev_data[prev_key.index] = [] + return + + @classmethod + def _set_compatible_types( + cls, + data: Any, + current_key: JsonPathItem, + k_list: list[JsonPathItem], + value: dict[str, Any], + ) -> None: + raise NotImplementedError() + + +class IndexSetter(_ListSetter): + @classmethod + def _set_compatible_types( + cls, + data: Any, + current_key: JsonPathItem, + k_list: list[JsonPathItem], + value: dict[str, Any], + ) -> None: + assert current_key.index is not None + + if current_key.index < len(data): + if len(k_list) == 0: + if isinstance(data[current_key.index], dict): + data[current_key.index].update(value) + else: + data[current_key.index] = value + return + + cls.set(data[current_key.index], k_list.copy(), value, data, current_key) + + +class WildcardIndexSetter(_ListSetter): + @classmethod + def _set_compatible_types( + cls, + data: Any, + current_key: JsonPathItem, + k_list: list[JsonPathItem], + value: dict[str, Any], + ) -> None: + if len(k_list) == 0: + for i, item in enumerate(data): + if isinstance(item, dict): + data[i].update(value) + else: + data[i] = value + else: + for i, item in enumerate(data): + cls.set( + item, + k_list.copy(), + value, + data, + JsonPathItem(item_type=JsonPathItemType.INDEX, index=i), + ) + + +Setter.add_setter(JsonPathItemType.KEY, KeySetter) +Setter.add_setter(JsonPathItemType.INDEX, IndexSetter) +Setter.add_setter(JsonPathItemType.WILDCARD_INDEX, WildcardIndexSetter) diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/local/persistence.py b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/local/persistence.py new file mode 100644 index 0000000000000000000000000000000000000000..c43f7d781f469000ab61cea0257a71698664e621 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/local/persistence.py @@ -0,0 +1,175 @@ +import base64 +import dbm +import logging +import pickle +import sqlite3 +from pathlib import Path +from typing import Iterable, Optional + +from qdrant_client.http import models + +STORAGE_FILE_NAME_OLD = "storage.dbm" +STORAGE_FILE_NAME = "storage.sqlite" + + +def try_migrate_to_sqlite(location: str) -> None: + dbm_path = Path(location) / STORAGE_FILE_NAME_OLD + sql_path = Path(location) / STORAGE_FILE_NAME + + if sql_path.exists(): + return + + if not dbm_path.exists(): + return + + try: + dbm_storage = dbm.open(str(dbm_path), "c") + + con = sqlite3.connect(str(sql_path)) + cur = con.cursor() + + # Create table + cur.execute("CREATE TABLE IF NOT EXISTS points (id TEXT PRIMARY KEY, point BLOB)") + + for key in dbm_storage.keys(): + value = dbm_storage[key] + if isinstance(key, str): + key = key.encode("utf-8") + key = pickle.loads(key) + sqlite_key = CollectionPersistence.encode_key(key) + # Insert a row of data + cur.execute( + "INSERT INTO points VALUES (?, ?)", + ( + sqlite_key, + sqlite3.Binary(value), + ), + ) + con.commit() + con.close() + dbm_storage.close() + dbm_path.unlink() + except Exception as e: + logging.error("Failed to migrate dbm to sqlite:", e) + logging.error( + "Please try to use previous version of qdrant-client or re-create collection" + ) + raise e + + +class CollectionPersistence: + CHECK_SAME_THREAD: Optional[bool] = None + + @classmethod + def encode_key(cls, key: models.ExtendedPointId) -> str: + return base64.b64encode(pickle.dumps(key)).decode("utf-8") + + def __init__(self, location: str, force_disable_check_same_thread: bool = False): + """ + Create or load a collection from the local storage. + Args: + location: path to the collection directory. + """ + + try_migrate_to_sqlite(location) + + self.location = Path(location) / STORAGE_FILE_NAME + self.location.parent.mkdir(exist_ok=True, parents=True) + + if self.CHECK_SAME_THREAD is None and force_disable_check_same_thread is False: + with sqlite3.connect(":memory:") as tmp_conn: + # it is unsafe to use `sqlite3.threadsafety` until python3.11 since it was hardcoded to 1, thus we + # need to fetch threadsafe with a query + # THREADSAFE = 0: Threads may not share the module + # THREADSAFE = 1: Threads may share the module, connections and cursors. Default for Linux. + # THREADSAFE = 2: Threads may share the module, but not connections. Default for macOS. + threadsafe = tmp_conn.execute( + "select * from pragma_compile_options where compile_options like 'THREADSAFE=%'" + ).fetchone()[0] + self.__class__.CHECK_SAME_THREAD = threadsafe != "THREADSAFE=1" + + if force_disable_check_same_thread: + self.__class__.CHECK_SAME_THREAD = False + + self.storage = sqlite3.connect( + str(self.location), check_same_thread=self.CHECK_SAME_THREAD # type: ignore + ) + + self._ensure_table() + + def close(self) -> None: + self.storage.close() + + def _ensure_table(self) -> None: + cursor = self.storage.cursor() + cursor.execute("CREATE TABLE IF NOT EXISTS points (id TEXT PRIMARY KEY, point BLOB)") + self.storage.commit() + + def persist(self, point: models.PointStruct) -> None: + """ + Persist a point in the local storage. + Args: + point: point to persist + """ + key = self.encode_key(point.id) + value = pickle.dumps(point) + + cursor = self.storage.cursor() + # Insert or update by key + cursor.execute( + "INSERT OR REPLACE INTO points VALUES (?, ?)", + ( + key, + sqlite3.Binary(value), + ), + ) + + self.storage.commit() + + def delete(self, point_id: models.ExtendedPointId) -> None: + """ + Delete a point from the local storage. + Args: + point_id: id of the point to delete + """ + key = self.encode_key(point_id) + cursor = self.storage.cursor() + cursor.execute( + "DELETE FROM points WHERE id = ?", + (key,), + ) + self.storage.commit() + + def load(self) -> Iterable[models.PointStruct]: + """ + Load a point from the local storage. + Returns: + point: loaded point + """ + cursor = self.storage.cursor() + cursor.execute("SELECT point FROM points") + for row in cursor.fetchall(): + yield pickle.loads(row[0]) + + +def test_persistence() -> None: + import tempfile + + with tempfile.TemporaryDirectory() as tmpdir: + persistence = CollectionPersistence(tmpdir) + point = models.PointStruct(id=1, vector=[1.0, 2.0, 3.0], payload={"a": 1}) + persistence.persist(point) + for loaded_point in persistence.load(): + assert loaded_point == point + break + + del persistence + persistence = CollectionPersistence(tmpdir) + for loaded_point in persistence.load(): + assert loaded_point == point + break + + persistence.delete(point.id) + persistence.delete(point.id) + for _ in persistence.load(): + assert False, "Should not load anything" diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/local/qdrant_local.py b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/local/qdrant_local.py new file mode 100644 index 0000000000000000000000000000000000000000..6b5d0b875e8530ba446768bee4ebbc19be07842c --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/local/qdrant_local.py @@ -0,0 +1,1260 @@ +import importlib.metadata +import itertools +import json +import os +import shutil +from copy import deepcopy +from io import TextIOWrapper +from typing import ( + Any, + Generator, + Iterable, + Mapping, + Optional, + Sequence, + Union, + get_args, +) +from uuid import uuid4 + +import numpy as np +import portalocker + +from qdrant_client.common.client_warnings import show_warning, show_warning_once +from qdrant_client._pydantic_compat import to_dict +from qdrant_client.client_base import QdrantBase +from qdrant_client.conversions import common_types as types +from qdrant_client.http import models as rest_models +from qdrant_client.http.models.models import RecommendExample +from qdrant_client.local.local_collection import ( + LocalCollection, + DEFAULT_VECTOR_NAME, + ignore_mentioned_ids_filter, +) + +META_INFO_FILENAME = "meta.json" + + +class QdrantLocal(QdrantBase): + """ + Everything Qdrant server can do, but locally. + + Use this implementation to run vector search without running a Qdrant server. + Everything that works with local Qdrant will work with server Qdrant as well. + + Use for small-scale data, demos, and tests. + If you need more speed or size, use Qdrant server. + """ + + LARGE_DATA_THRESHOLD = 20_000 + + def __init__(self, location: str, force_disable_check_same_thread: bool = False) -> None: + """ + Initialize local Qdrant. + + Args: + location: Where to store data. Can be a path to a directory or `:memory:` for in-memory storage. + force_disable_check_same_thread: Disable SQLite check_same_thread check. Use only if you know what you are doing. + """ + super().__init__() + self.force_disable_check_same_thread = force_disable_check_same_thread + self.location = location + self.persistent = location != ":memory:" + self.collections: dict[str, LocalCollection] = {} + self.aliases: dict[str, str] = {} + self._flock_file: Optional[TextIOWrapper] = None + self._load() + self._closed: bool = False + + @property + def closed(self) -> bool: + return self._closed + + def close(self, **kwargs: Any) -> None: + self._closed = True + for collection in self.collections.values(): + if collection is not None: + collection.close() + else: + show_warning( + message=f"Collection appears to be None before closing. The existing collections are: " + f"{list(self.collections.keys())}", + category=UserWarning, + stacklevel=4, + ) + + try: + if self._flock_file is not None and not self._flock_file.closed: + portalocker.unlock(self._flock_file) + self._flock_file.close() + except TypeError: # sometimes portalocker module can be garbage collected before + # QdrantLocal instance + pass + + def _load(self) -> None: + if not self.persistent: + return + meta_path = os.path.join(self.location, META_INFO_FILENAME) + if not os.path.exists(meta_path): + os.makedirs(self.location, exist_ok=True) + with open(meta_path, "w") as f: + f.write(json.dumps({"collections": {}, "aliases": {}})) + else: + with open(meta_path, "r") as f: + meta = json.load(f) + for collection_name, config_json in meta["collections"].items(): + config = rest_models.CreateCollection(**config_json) + collection_path = self._collection_path(collection_name) + collection = LocalCollection( + config, + collection_path, + force_disable_check_same_thread=self.force_disable_check_same_thread, + ) + self.collections[collection_name] = collection + if len(collection.ids) > self.LARGE_DATA_THRESHOLD: + show_warning( + f"Local mode is not recommended for collections with more than " + f"{self.LARGE_DATA_THRESHOLD:,} points. " + f"Collection <{collection_name}> contains {len(collection.ids)} points. " + "Consider using Qdrant in Docker or Qdrant Cloud for better performance " + "with large datasets.", + category=UserWarning, + stacklevel=5, + ) + self.aliases = meta["aliases"] + + lock_file_path = os.path.join(self.location, ".lock") + if not os.path.exists(lock_file_path): + os.makedirs(self.location, exist_ok=True) + with open(lock_file_path, "w") as f: + f.write("tmp lock file") + self._flock_file = open(lock_file_path, "r+") + try: + portalocker.lock( + self._flock_file, + portalocker.LockFlags.EXCLUSIVE | portalocker.LockFlags.NON_BLOCKING, + ) + except portalocker.exceptions.LockException: + raise RuntimeError( + f"Storage folder {self.location} is already accessed by another instance of Qdrant client." + f" If you require concurrent access, use Qdrant server instead." + ) + + def _save(self) -> None: + if not self.persistent: + return + + if self.closed: + raise RuntimeError("QdrantLocal instance is closed. Please create a new instance.") + + meta_path = os.path.join(self.location, META_INFO_FILENAME) + with open(meta_path, "w") as f: + f.write( + json.dumps( + { + "collections": { + collection_name: to_dict(collection.config) + for collection_name, collection in self.collections.items() + }, + "aliases": self.aliases, + } + ) + ) + + def _get_collection(self, collection_name: str) -> LocalCollection: + if self.closed: + raise RuntimeError("QdrantLocal instance is closed. Please create a new instance.") + + if collection_name in self.collections: + return self.collections[collection_name] + if collection_name in self.aliases: + return self.collections[self.aliases[collection_name]] + raise ValueError(f"Collection {collection_name} not found") + + def search_batch( + self, + collection_name: str, + requests: Sequence[types.SearchRequest], + **kwargs: Any, + ) -> list[list[types.ScoredPoint]]: + collection = self._get_collection(collection_name) + + return [ + collection.search( + query_vector=request.vector, + query_filter=request.filter, + limit=request.limit, + offset=request.offset, + with_payload=request.with_payload, + with_vectors=request.with_vector, + score_threshold=request.score_threshold, + ) + for request in requests + ] + + def search( + self, + collection_name: str, + query_vector: Union[ + types.NumpyArray, + Sequence[float], + tuple[str, list[float]], + types.NamedVector, + types.NamedSparseVector, + ], + query_filter: Optional[types.Filter] = None, + search_params: Optional[types.SearchParams] = None, + limit: int = 10, + offset: Optional[int] = None, + with_payload: Union[bool, Sequence[str], types.PayloadSelector] = True, + with_vectors: Union[bool, Sequence[str]] = False, + score_threshold: Optional[float] = None, + **kwargs: Any, + ) -> list[types.ScoredPoint]: + collection = self._get_collection(collection_name) + return collection.search( + query_vector=query_vector, + query_filter=query_filter, + limit=limit, + offset=offset, + with_payload=with_payload, + with_vectors=with_vectors, + score_threshold=score_threshold, + ) + + def search_matrix_offsets( + self, + collection_name: str, + query_filter: Optional[types.Filter] = None, + limit: int = 3, + sample: int = 10, + using: Optional[str] = None, + **kwargs: Any, + ) -> types.SearchMatrixOffsetsResponse: + collection = self._get_collection(collection_name) + return collection.search_matrix_offsets( + query_filter=query_filter, limit=limit, sample=sample, using=using + ) + + def search_matrix_pairs( + self, + collection_name: str, + query_filter: Optional[types.Filter] = None, + limit: int = 3, + sample: int = 10, + using: Optional[str] = None, + **kwargs: Any, + ) -> types.SearchMatrixPairsResponse: + collection = self._get_collection(collection_name) + return collection.search_matrix_pairs( + query_filter=query_filter, limit=limit, sample=sample, using=using + ) + + def search_groups( + self, + collection_name: str, + query_vector: Union[ + types.NumpyArray, + Sequence[float], + tuple[str, list[float]], + types.NamedVector, + ], + group_by: str, + query_filter: Optional[rest_models.Filter] = None, + search_params: Optional[rest_models.SearchParams] = None, + limit: int = 10, + group_size: int = 1, + with_payload: Union[bool, Sequence[str], rest_models.PayloadSelector] = True, + with_vectors: Union[bool, Sequence[str]] = False, + score_threshold: Optional[float] = None, + with_lookup: Optional[types.WithLookupInterface] = None, + **kwargs: Any, + ) -> types.GroupsResult: + collection = self._get_collection(collection_name) + with_lookup_collection = None + if with_lookup is not None: + if isinstance(with_lookup, str): + with_lookup_collection = self._get_collection(with_lookup) + else: + with_lookup_collection = self._get_collection(with_lookup.collection) + + return collection.search_groups( + query_vector=query_vector, + query_filter=query_filter, + limit=limit, + group_by=group_by, + group_size=group_size, + with_payload=with_payload, + with_vectors=with_vectors, + score_threshold=score_threshold, + with_lookup=with_lookup, + with_lookup_collection=with_lookup_collection, + ) + + def _resolve_query_input( + self, + collection_name: str, + query: Optional[types.Query], + using: Optional[str], + lookup_from: Optional[types.LookupLocation], + ) -> tuple[types.Query, set[types.PointId]]: + """ + Resolves any possible ids into vectors and returns a new query object, along with a set of the mentioned + point ids that should be filtered when searching. + """ + + lookup_collection_name = lookup_from.collection if lookup_from else collection_name + collection = self._get_collection(lookup_collection_name) + + search_in_vector_name = using if using is not None else DEFAULT_VECTOR_NAME + vector_name = ( + lookup_from.vector + if lookup_from is not None and lookup_from.vector is not None + else search_in_vector_name + ) + + sparse = vector_name in collection.sparse_vectors + multi = vector_name in collection.multivectors + if sparse: + collection_vectors = collection.sparse_vectors + elif multi: + collection_vectors = collection.multivectors + else: + collection_vectors = collection.vectors + + # mentioned ids in the search collection which should be excluded from search + mentioned_ids: set[types.PointId] = set() + + def input_into_vector( + vector_input: types.VectorInput, + ) -> types.VectorInput: + if isinstance(vector_input, get_args(types.PointId)): + point_id = vector_input # rename for clarity + if point_id not in collection.ids: + raise ValueError(f"Point {point_id} is not found in the collection") + + idx = collection.ids[point_id] + if vector_name in collection_vectors: + vec = collection_vectors[vector_name][idx] + else: + raise ValueError(f"Vector {vector_name} not found") + if isinstance(vec, np.ndarray): + vec = vec.tolist() + if collection_name == lookup_collection_name: + mentioned_ids.add(point_id) + return vec + else: + return vector_input + + query = deepcopy(query) + if isinstance(query, rest_models.NearestQuery): + query.nearest = input_into_vector(query.nearest) + + elif isinstance(query, rest_models.RecommendQuery): + if query.recommend.negative is not None: + query.recommend.negative = [ + input_into_vector(vector_input) for vector_input in query.recommend.negative + ] + if query.recommend.positive is not None: + query.recommend.positive = [ + input_into_vector(vector_input) for vector_input in query.recommend.positive + ] + + elif isinstance(query, rest_models.DiscoverQuery): + query.discover.target = input_into_vector(query.discover.target) + pairs = ( + query.discover.context + if isinstance(query.discover.context, list) + else [query.discover.context] + ) + query.discover.context = [ + rest_models.ContextPair( + positive=input_into_vector(pair.positive), + negative=input_into_vector(pair.negative), + ) + for pair in pairs + ] + elif isinstance(query, rest_models.ContextQuery): + pairs = query.context if isinstance(query.context, list) else [query.context] + query.context = [ + rest_models.ContextPair( + positive=input_into_vector(pair.positive), + negative=input_into_vector(pair.negative), + ) + for pair in pairs + ] + elif isinstance(query, rest_models.OrderByQuery): + pass + elif isinstance(query, rest_models.FusionQuery): + pass + return query, mentioned_ids + + def _resolve_prefetches_input( + self, + prefetch: Optional[Union[Sequence[types.Prefetch], types.Prefetch]], + collection_name: str, + ) -> list[types.Prefetch]: + if prefetch is None: + return [] + + if isinstance(prefetch, list) and len(prefetch) == 0: + return [] + + prefetches = [] + if isinstance(prefetch, types.Prefetch): + prefetches = [prefetch] + prefetches.extend( + prefetch.prefetch if isinstance(prefetch.prefetch, list) else [prefetch.prefetch] + ) + elif isinstance(prefetch, Sequence): + prefetches = list(prefetch) + + return [ + self._resolve_prefetch_input(prefetch, collection_name) + for prefetch in prefetches + if prefetch is not None + ] + + def _resolve_prefetch_input( + self, prefetch: types.Prefetch, collection_name: str + ) -> types.Prefetch: + if prefetch.query is None: + return prefetch + + prefetch = deepcopy(prefetch) + query, mentioned_ids = self._resolve_query_input( + collection_name, + prefetch.query, + prefetch.using, + prefetch.lookup_from, + ) + prefetch.query = query + + prefetch.filter = ignore_mentioned_ids_filter(prefetch.filter, list(mentioned_ids)) + + prefetch.prefetch = self._resolve_prefetches_input(prefetch.prefetch, collection_name) + + return prefetch + + def query_points( + self, + collection_name: str, + query: Optional[types.Query] = None, + using: Optional[str] = None, + prefetch: Union[types.Prefetch, list[types.Prefetch], None] = None, + query_filter: Optional[types.Filter] = None, + search_params: Optional[types.SearchParams] = None, + limit: int = 10, + offset: Optional[int] = None, + with_payload: Union[bool, Sequence[str], types.PayloadSelector] = True, + with_vectors: Union[bool, Sequence[str]] = False, + score_threshold: Optional[float] = None, + lookup_from: Optional[types.LookupLocation] = None, + **kwargs: Any, + ) -> types.QueryResponse: + collection = self._get_collection(collection_name) + + if query is not None: + query, mentioned_ids = self._resolve_query_input( + collection_name, query, using, lookup_from + ) + query_filter = ignore_mentioned_ids_filter(query_filter, list(mentioned_ids)) + + prefetch = self._resolve_prefetches_input(prefetch, collection_name) + + return collection.query_points( + query=query, + prefetch=prefetch, + query_filter=query_filter, + using=using, + score_threshold=score_threshold, + limit=limit, + offset=offset or 0, + with_payload=with_payload, + with_vectors=with_vectors, + ) + + def query_batch_points( + self, + collection_name: str, + requests: Sequence[types.QueryRequest], + **kwargs: Any, + ) -> list[types.QueryResponse]: + return [ + self.query_points( + collection_name=collection_name, + query=request.query, + prefetch=request.prefetch, + query_filter=request.filter, + limit=request.limit or 10, + offset=request.offset, + with_payload=request.with_payload, + with_vectors=request.with_vector, + score_threshold=request.score_threshold, + using=request.using, + lookup_from=request.lookup_from, + ) + for request in requests + ] + + def query_points_groups( + self, + collection_name: str, + group_by: str, + query: Union[ + types.PointId, + list[float], + list[list[float]], + types.SparseVector, + types.Query, + types.NumpyArray, + types.Document, + types.Image, + types.InferenceObject, + None, + ] = None, + using: Optional[str] = None, + prefetch: Union[types.Prefetch, list[types.Prefetch], None] = None, + query_filter: Optional[types.Filter] = None, + search_params: Optional[types.SearchParams] = None, + limit: int = 10, + group_size: int = 3, + with_payload: Union[bool, Sequence[str], types.PayloadSelector] = True, + with_vectors: Union[bool, Sequence[str]] = False, + score_threshold: Optional[float] = None, + with_lookup: Optional[types.WithLookupInterface] = None, + lookup_from: Optional[types.LookupLocation] = None, + **kwargs: Any, + ) -> types.GroupsResult: + collection = self._get_collection(collection_name) + if query is not None: + query, mentioned_ids = self._resolve_query_input( + collection_name, query, using, lookup_from + ) + query_filter = ignore_mentioned_ids_filter(query_filter, list(mentioned_ids)) + with_lookup_collection = None + if with_lookup is not None: + if isinstance(with_lookup, str): + with_lookup_collection = self._get_collection(with_lookup) + else: + with_lookup_collection = self._get_collection(with_lookup.collection) + + return collection.query_groups( + query=query, + query_filter=query_filter, + using=using, + prefetch=prefetch, + limit=limit, + group_by=group_by, + group_size=group_size, + with_payload=with_payload, + with_vectors=with_vectors, + score_threshold=score_threshold, + with_lookup=with_lookup, + with_lookup_collection=with_lookup_collection, + ) + + def recommend_batch( + self, + collection_name: str, + requests: Sequence[types.RecommendRequest], + **kwargs: Any, + ) -> list[list[types.ScoredPoint]]: + collection = self._get_collection(collection_name) + + return [ + collection.recommend( + positive=request.positive, + negative=request.negative, + query_filter=request.filter, + limit=request.limit, + offset=request.offset, + with_payload=request.with_payload, + with_vectors=request.with_vector, + score_threshold=request.score_threshold, + using=request.using, + lookup_from_collection=self._get_collection(request.lookup_from.collection) + if request.lookup_from + else None, + lookup_from_vector_name=request.lookup_from.vector + if request.lookup_from + else None, + strategy=request.strategy, + ) + for request in requests + ] + + def recommend( + self, + collection_name: str, + positive: Optional[Sequence[RecommendExample]] = None, + negative: Optional[Sequence[RecommendExample]] = None, + query_filter: Optional[types.Filter] = None, + search_params: Optional[types.SearchParams] = None, + limit: int = 10, + offset: int = 0, + with_payload: Union[bool, list[str], types.PayloadSelector] = True, + with_vectors: Union[bool, list[str]] = False, + score_threshold: Optional[float] = None, + using: Optional[str] = None, + lookup_from: Optional[types.LookupLocation] = None, + strategy: Optional[types.RecommendStrategy] = None, + **kwargs: Any, + ) -> list[types.ScoredPoint]: + collection = self._get_collection(collection_name) + return collection.recommend( + positive=positive, + negative=negative, + query_filter=query_filter, + limit=limit, + offset=offset, + with_payload=with_payload, + with_vectors=with_vectors, + score_threshold=score_threshold, + using=using, + lookup_from_collection=self._get_collection(lookup_from.collection) + if lookup_from + else None, + lookup_from_vector_name=lookup_from.vector if lookup_from else None, + strategy=strategy, + ) + + def recommend_groups( + self, + collection_name: str, + group_by: str, + positive: Optional[Sequence[Union[types.PointId, list[float]]]] = None, + negative: Optional[Sequence[Union[types.PointId, list[float]]]] = None, + query_filter: Optional[types.Filter] = None, + search_params: Optional[types.SearchParams] = None, + limit: int = 10, + group_size: int = 1, + score_threshold: Optional[float] = None, + with_payload: Union[bool, Sequence[str], types.PayloadSelector] = True, + with_vectors: Union[bool, Sequence[str]] = False, + using: Optional[str] = None, + lookup_from: Optional[types.LookupLocation] = None, + with_lookup: Optional[types.WithLookupInterface] = None, + strategy: Optional[types.RecommendStrategy] = None, + **kwargs: Any, + ) -> types.GroupsResult: + collection = self._get_collection(collection_name) + with_lookup_collection = None + if with_lookup is not None: + if isinstance(with_lookup, str): + with_lookup_collection = self._get_collection(with_lookup) + else: + with_lookup_collection = self._get_collection(with_lookup.collection) + + return collection.recommend_groups( + positive=positive, + negative=negative, + group_by=group_by, + group_size=group_size, + query_filter=query_filter, + limit=limit, + with_payload=with_payload, + with_vectors=with_vectors, + score_threshold=score_threshold, + using=using, + lookup_from_collection=self._get_collection(lookup_from.collection) + if lookup_from + else None, + lookup_from_vector_name=lookup_from.vector if lookup_from else None, + with_lookup=with_lookup, + with_lookup_collection=with_lookup_collection, + strategy=strategy, + ) + + def discover( + self, + collection_name: str, + target: Optional[types.TargetVector] = None, + context: Optional[Sequence[types.ContextExamplePair]] = None, + query_filter: Optional[types.Filter] = None, + search_params: Optional[types.SearchParams] = None, + limit: int = 10, + offset: int = 0, + with_payload: Union[bool, list[str], types.PayloadSelector] = True, + with_vectors: Union[bool, list[str]] = False, + using: Optional[str] = None, + lookup_from: Optional[types.LookupLocation] = None, + consistency: Optional[types.ReadConsistency] = None, + timeout: Optional[int] = None, + **kwargs: Any, + ) -> list[types.ScoredPoint]: + collection = self._get_collection(collection_name) + return collection.discover( + target=target, + context=context, + query_filter=query_filter, + limit=limit, + offset=offset, + with_payload=with_payload, + with_vectors=with_vectors, + using=using, + lookup_from_collection=self._get_collection(lookup_from.collection) + if lookup_from + else None, + lookup_from_vector_name=lookup_from.vector if lookup_from else None, + ) + + def discover_batch( + self, + collection_name: str, + requests: Sequence[types.DiscoverRequest], + **kwargs: Any, + ) -> list[list[types.ScoredPoint]]: + collection = self._get_collection(collection_name) + + return [ + collection.discover( + target=request.target, + context=request.context, + query_filter=request.filter, + limit=request.limit, + offset=request.offset, + with_payload=request.with_payload, + with_vectors=request.with_vector, + using=request.using, + lookup_from_collection=self._get_collection(request.lookup_from.collection) + if request.lookup_from + else None, + lookup_from_vector_name=request.lookup_from.vector + if request.lookup_from + else None, + ) + for request in requests + ] + + def scroll( + self, + collection_name: str, + scroll_filter: Optional[types.Filter] = None, + limit: int = 10, + order_by: Optional[types.OrderBy] = None, + offset: Optional[types.PointId] = None, + with_payload: Union[bool, Sequence[str], types.PayloadSelector] = True, + with_vectors: Union[bool, Sequence[str]] = False, + **kwargs: Any, + ) -> tuple[list[types.Record], Optional[types.PointId]]: + collection = self._get_collection(collection_name) + return collection.scroll( + scroll_filter=scroll_filter, + limit=limit, + order_by=order_by, + offset=offset, + with_payload=with_payload, + with_vectors=with_vectors, + ) + + def count( + self, + collection_name: str, + count_filter: Optional[types.Filter] = None, + exact: bool = True, + **kwargs: Any, + ) -> types.CountResult: + collection = self._get_collection(collection_name) + return collection.count(count_filter=count_filter) + + def facet( + self, + collection_name: str, + key: str, + facet_filter: Optional[types.Filter] = None, + limit: int = 10, + exact: bool = False, + **kwargs: Any, + ) -> types.FacetResponse: + collection = self._get_collection(collection_name) + return collection.facet(key=key, facet_filter=facet_filter, limit=limit) + + def upsert( + self, collection_name: str, points: types.Points, **kwargs: Any + ) -> types.UpdateResult: + collection = self._get_collection(collection_name) + collection.upsert(points) + return self._default_update_result() + + def update_vectors( + self, + collection_name: str, + points: Sequence[types.PointVectors], + **kwargs: Any, + ) -> types.UpdateResult: + collection = self._get_collection(collection_name) + collection.update_vectors(points) + return self._default_update_result() + + def delete_vectors( + self, + collection_name: str, + vectors: Sequence[str], + points: types.PointsSelector, + **kwargs: Any, + ) -> types.UpdateResult: + collection = self._get_collection(collection_name) + collection.delete_vectors(vectors, points) + return self._default_update_result() + + def retrieve( + self, + collection_name: str, + ids: Sequence[types.PointId], + with_payload: Union[bool, Sequence[str], types.PayloadSelector] = True, + with_vectors: Union[bool, Sequence[str]] = False, + **kwargs: Any, + ) -> list[types.Record]: + collection = self._get_collection(collection_name) + return collection.retrieve(ids, with_payload, with_vectors) + + @classmethod + def _default_update_result(cls, operation_id: int = 0) -> types.UpdateResult: + return types.UpdateResult( + operation_id=operation_id, + status=rest_models.UpdateStatus.COMPLETED, + ) + + def delete( + self, collection_name: str, points_selector: types.PointsSelector, **kwargs: Any + ) -> types.UpdateResult: + collection = self._get_collection(collection_name) + collection.delete(points_selector) + return self._default_update_result() + + def set_payload( + self, + collection_name: str, + payload: types.Payload, + points: types.PointsSelector, + key: Optional[str] = None, + **kwargs: Any, + ) -> types.UpdateResult: + collection = self._get_collection(collection_name) + collection.set_payload(payload=payload, selector=points, key=key) + return self._default_update_result() + + def overwrite_payload( + self, + collection_name: str, + payload: types.Payload, + points: types.PointsSelector, + **kwargs: Any, + ) -> types.UpdateResult: + collection = self._get_collection(collection_name) + collection.overwrite_payload(payload=payload, selector=points) + return self._default_update_result() + + def delete_payload( + self, + collection_name: str, + keys: Sequence[str], + points: types.PointsSelector, + **kwargs: Any, + ) -> types.UpdateResult: + collection = self._get_collection(collection_name) + collection.delete_payload(keys=keys, selector=points) + return self._default_update_result() + + def clear_payload( + self, collection_name: str, points_selector: types.PointsSelector, **kwargs: Any + ) -> types.UpdateResult: + collection = self._get_collection(collection_name) + collection.clear_payload(selector=points_selector) + return self._default_update_result() + + def batch_update_points( + self, + collection_name: str, + update_operations: Sequence[types.UpdateOperation], + **kwargs: Any, + ) -> list[types.UpdateResult]: + collection = self._get_collection(collection_name) + collection.batch_update_points(update_operations) + return [self._default_update_result()] * len(update_operations) + + def update_collection_aliases( + self, change_aliases_operations: Sequence[types.AliasOperations], **kwargs: Any + ) -> bool: + for operation in change_aliases_operations: + if isinstance(operation, rest_models.CreateAliasOperation): + self._get_collection(operation.create_alias.collection_name) + self.aliases[operation.create_alias.alias_name] = ( + operation.create_alias.collection_name + ) + elif isinstance(operation, rest_models.DeleteAliasOperation): + self.aliases.pop(operation.delete_alias.alias_name, None) + elif isinstance(operation, rest_models.RenameAliasOperation): + new_name = operation.rename_alias.new_alias_name + old_name = operation.rename_alias.old_alias_name + self.aliases[new_name] = self.aliases.pop(old_name) + else: + raise ValueError(f"Unknown operation: {operation}") + self._save() + return True + + def get_collection_aliases( + self, collection_name: str, **kwargs: Any + ) -> types.CollectionsAliasesResponse: + if self.closed: + raise RuntimeError("QdrantLocal instance is closed. Please create a new instance.") + + return types.CollectionsAliasesResponse( + aliases=[ + rest_models.AliasDescription( + alias_name=alias_name, + collection_name=name, + ) + for alias_name, name in self.aliases.items() + if name == collection_name + ] + ) + + def get_aliases(self, **kwargs: Any) -> types.CollectionsAliasesResponse: + if self.closed: + raise RuntimeError("QdrantLocal instance is closed. Please create a new instance.") + + return types.CollectionsAliasesResponse( + aliases=[ + rest_models.AliasDescription( + alias_name=alias_name, + collection_name=name, + ) + for alias_name, name in self.aliases.items() + ] + ) + + def get_collections(self, **kwargs: Any) -> types.CollectionsResponse: + if self.closed: + raise RuntimeError("QdrantLocal instance is closed. Please create a new instance.") + + return types.CollectionsResponse( + collections=[ + rest_models.CollectionDescription(name=name) + for name, _ in self.collections.items() + ] + ) + + def get_collection(self, collection_name: str, **kwargs: Any) -> types.CollectionInfo: + collection = self._get_collection(collection_name) + return collection.info() + + def collection_exists(self, collection_name: str, **kwargs: Any) -> bool: + try: + self._get_collection(collection_name) + return True + except ValueError: + return False + + def update_collection( + self, + collection_name: str, + sparse_vectors_config: Optional[Mapping[str, types.SparseVectorParams]] = None, + **kwargs: Any, + ) -> bool: + _collection = self._get_collection(collection_name) + + if sparse_vectors_config is not None: + for vector_name, vector_params in sparse_vectors_config.items(): + _collection.update_sparse_vectors_config(vector_name, vector_params) + + return True + return False + + def _collection_path(self, collection_name: str) -> Optional[str]: + if self.persistent: + return os.path.join(self.location, "collection", collection_name) + else: + return None + + def delete_collection(self, collection_name: str, **kwargs: Any) -> bool: + if self.closed: + raise RuntimeError("QdrantLocal instance is closed. Please create a new instance.") + + _collection = self.collections.pop(collection_name, None) + del _collection + self.aliases = { + alias_name: name + for alias_name, name in self.aliases.items() + if name != collection_name + } + collection_path = self._collection_path(collection_name) + if collection_path is not None: + shutil.rmtree(collection_path, ignore_errors=True) + self._save() + return True + + def create_collection( + self, + collection_name: str, + vectors_config: Optional[ + Union[types.VectorParams, Mapping[str, types.VectorParams]] + ] = None, + init_from: Optional[types.InitFrom] = None, + sparse_vectors_config: Optional[Mapping[str, types.SparseVectorParams]] = None, + **kwargs: Any, + ) -> bool: + if self.closed: + raise RuntimeError("QdrantLocal instance is closed. Please create a new instance.") + + src_collection = None + from_collection_name = None + if init_from is not None: + from_collection_name = ( + init_from if isinstance(init_from, str) else init_from.collection + ) + src_collection = self._get_collection(from_collection_name) + + if collection_name in self.collections: + raise ValueError(f"Collection {collection_name} already exists") + collection_path = self._collection_path(collection_name) + if collection_path is not None: + os.makedirs(collection_path, exist_ok=True) + + collection = LocalCollection( + rest_models.CreateCollection( + vectors=vectors_config or {}, + sparse_vectors=sparse_vectors_config, + ), + location=collection_path, + force_disable_check_same_thread=self.force_disable_check_same_thread, + ) + self.collections[collection_name] = collection + + if src_collection and from_collection_name: + batch_size = 100 + records, next_offset = self.scroll(from_collection_name, limit=2, with_vectors=True) + self.upload_records( + collection_name, records + ) # it is not crucial to replace upload_records here + # since it is an internal usage, and we don't have custom shard keys in qdrant local + while next_offset is not None: + records, next_offset = self.scroll( + from_collection_name, offset=next_offset, limit=batch_size, with_vectors=True + ) + self.upload_records(collection_name, records) + + self._save() + return True + + def recreate_collection( + self, + collection_name: str, + vectors_config: Union[types.VectorParams, Mapping[str, types.VectorParams]], + init_from: Optional[types.InitFrom] = None, + sparse_vectors_config: Optional[Mapping[str, types.SparseVectorParams]] = None, + **kwargs: Any, + ) -> bool: + self.delete_collection(collection_name) + return self.create_collection( + collection_name, vectors_config, init_from, sparse_vectors_config + ) + + def upload_points( + self, collection_name: str, points: Iterable[types.PointStruct], **kwargs: Any + ) -> None: + self._upload_points(collection_name, points) + + def upload_records( + self, collection_name: str, records: Iterable[types.Record], **kwargs: Any + ) -> None: + # upload_records in local mode behaves like upload_records with wait=True in server mode + self._upload_points(collection_name, records) + + def _upload_points( + self, + collection_name: str, + points: Iterable[Union[types.PointStruct, types.Record]], + ) -> None: + collection = self._get_collection(collection_name) + collection.upsert( + [ + rest_models.PointStruct( + id=point.id, + vector=point.vector or {}, + payload=point.payload or {}, + ) + for point in points + ] + ) + + def upload_collection( + self, + collection_name: str, + vectors: Union[ + dict[str, types.NumpyArray], types.NumpyArray, Iterable[types.VectorStruct] + ], + payload: Optional[Iterable[dict[Any, Any]]] = None, + ids: Optional[Iterable[types.PointId]] = None, + **kwargs: Any, + ) -> None: + # upload_collection in local mode behaves like upload_collection with wait=True in server mode + def uuid_generator() -> Generator[str, None, None]: + while True: + yield str(uuid4()) + + collection = self._get_collection(collection_name) + if isinstance(vectors, dict) and any(isinstance(v, np.ndarray) for v in vectors.values()): + assert ( + len(set([arr.shape[0] for arr in vectors.values()])) == 1 + ), "Each named vector should have the same number of vectors" + + num_vectors = next(iter(vectors.values())).shape[0] + # convert dict[str, np.ndarray] to list[dict[str, list[float]]] + vectors = [ + {name: vectors[name][i].tolist() for name in vectors.keys()} + for i in range(num_vectors) + ] + + collection.upsert( + [ + rest_models.PointStruct( + id=point_id, + vector=(vector.tolist() if isinstance(vector, np.ndarray) else vector) or {}, + payload=payload or {}, + ) + for (point_id, vector, payload) in zip( + ids or uuid_generator(), + iter(vectors), + payload or itertools.cycle([{}]), + ) + ] + ) + + def create_payload_index( + self, + collection_name: str, + field_name: str, + field_schema: Optional[types.PayloadSchemaType] = None, + field_type: Optional[types.PayloadSchemaType] = None, + **kwargs: Any, + ) -> types.UpdateResult: + show_warning_once( + message="Payload indexes have no effect in the local Qdrant. Please use server Qdrant if you need payload indexes.", + category=UserWarning, + idx="create-local-payload-indexes", + stacklevel=5, + ) + return self._default_update_result() + + def delete_payload_index( + self, collection_name: str, field_name: str, **kwargs: Any + ) -> types.UpdateResult: + show_warning_once( + message="Payload indexes have no effect in the local Qdrant. Please use server Qdrant if you need payload indexes.", + category=UserWarning, + idx="delete-local-payload-indexes", + stacklevel=5, + ) + return self._default_update_result() + + def list_snapshots( + self, collection_name: str, **kwargs: Any + ) -> list[types.SnapshotDescription]: + return [] + + def create_snapshot( + self, collection_name: str, **kwargs: Any + ) -> Optional[types.SnapshotDescription]: + raise NotImplementedError( + "Snapshots are not supported in the local Qdrant. Please use server Qdrant if you need full snapshots." + ) + + def delete_snapshot(self, collection_name: str, snapshot_name: str, **kwargs: Any) -> bool: + raise NotImplementedError( + "Snapshots are not supported in the local Qdrant. Please use server Qdrant if you need full snapshots." + ) + + def list_full_snapshots(self, **kwargs: Any) -> list[types.SnapshotDescription]: + return [] + + def create_full_snapshot(self, **kwargs: Any) -> types.SnapshotDescription: + raise NotImplementedError( + "Snapshots are not supported in the local Qdrant. Please use server Qdrant if you need full snapshots." + ) + + def delete_full_snapshot(self, snapshot_name: str, **kwargs: Any) -> bool: + raise NotImplementedError( + "Snapshots are not supported in the local Qdrant. Please use server Qdrant if you need full snapshots." + ) + + def recover_snapshot(self, collection_name: str, location: str, **kwargs: Any) -> bool: + raise NotImplementedError( + "Snapshots are not supported in the local Qdrant. Please use server Qdrant if you need full snapshots." + ) + + def list_shard_snapshots( + self, collection_name: str, shard_id: int, **kwargs: Any + ) -> list[types.SnapshotDescription]: + return [] + + def create_shard_snapshot( + self, collection_name: str, shard_id: int, **kwargs: Any + ) -> Optional[types.SnapshotDescription]: + raise NotImplementedError( + "Snapshots are not supported in the local Qdrant. Please use server Qdrant if you need snapshots." + ) + + def delete_shard_snapshot( + self, collection_name: str, shard_id: int, snapshot_name: str, **kwargs: Any + ) -> bool: + raise NotImplementedError( + "Snapshots are not supported in the local Qdrant. Please use server Qdrant if you need snapshots." + ) + + def recover_shard_snapshot( + self, + collection_name: str, + shard_id: int, + location: str, + **kwargs: Any, + ) -> bool: + raise NotImplementedError( + "Snapshots are not supported in the local Qdrant. Please use server Qdrant if you need snapshots." + ) + + def lock_storage(self, reason: str, **kwargs: Any) -> types.LocksOption: + raise NotImplementedError( + "Locks are not supported in the local Qdrant. Please use server Qdrant if you need full snapshots." + ) + + def unlock_storage(self, **kwargs: Any) -> types.LocksOption: + raise NotImplementedError( + "Locks are not supported in the local Qdrant. Please use server Qdrant if you need full snapshots." + ) + + def get_locks(self, **kwargs: Any) -> types.LocksOption: + return types.LocksOption( + error_message=None, + write=False, + ) + + def create_shard_key( + self, + collection_name: str, + shard_key: types.ShardKey, + shards_number: Optional[int] = None, + replication_factor: Optional[int] = None, + placement: Optional[list[int]] = None, + **kwargs: Any, + ) -> bool: + raise NotImplementedError( + "Sharding is not supported in the local Qdrant. Please use server Qdrant if you need sharding." + ) + + def delete_shard_key( + self, + collection_name: str, + shard_key: types.ShardKey, + **kwargs: Any, + ) -> bool: + raise NotImplementedError( + "Sharding is not supported in the local Qdrant. Please use server Qdrant if you need sharding." + ) + + def info(self) -> types.VersionInfo: + version = importlib.metadata.version("qdrant-client") + return rest_models.VersionInfo( + title="qdrant - vector search engine", version=version, commit=None + ) diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/local/sparse.py b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/local/sparse.py new file mode 100644 index 0000000000000000000000000000000000000000..36eed891c0ef1ea61121d36a1f82a86a16c214bd --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/local/sparse.py @@ -0,0 +1,36 @@ +import numpy as np + +from qdrant_client.http.models import SparseVector + + +def empty_sparse_vector() -> SparseVector: + return SparseVector( + indices=[], + values=[], + ) + + +def validate_sparse_vector(vector: SparseVector) -> None: + assert len(vector.indices) == len( + vector.values + ), "Indices and values must have the same length" + assert not np.isnan(vector.values).any(), "Values must not contain NaN" + assert len(vector.indices) == len(set(vector.indices)), "Indices must be unique" + + +def is_sorted(vector: SparseVector) -> bool: + for i in range(1, len(vector.indices)): + if vector.indices[i] < vector.indices[i - 1]: + return False + return True + + +def sort_sparse_vector(vector: SparseVector) -> SparseVector: + if is_sorted(vector): + return vector + + sorted_indices = np.argsort(vector.indices) + return SparseVector( + indices=[vector.indices[i] for i in sorted_indices], + values=[vector.values[i] for i in sorted_indices], + ) diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/local/sparse_distances.py b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/local/sparse_distances.py new file mode 100644 index 0000000000000000000000000000000000000000..2f3ac55ed1f9c4e5f232ad39a3576b0a6251da31 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/local/sparse_distances.py @@ -0,0 +1,314 @@ +from typing import Callable, Optional, Sequence, Union + +import numpy as np + +from qdrant_client.conversions import common_types as types +from qdrant_client.http.models import SparseVector +from qdrant_client.local.distances import EPSILON, fast_sigmoid, scaled_fast_sigmoid +from qdrant_client.local.sparse import ( + empty_sparse_vector, + is_sorted, + sort_sparse_vector, + validate_sparse_vector, +) + + +class SparseRecoQuery: + def __init__( + self, + positive: Optional[list[SparseVector]] = None, + negative: Optional[list[SparseVector]] = None, + strategy: Optional[types.RecommendStrategy] = None, + ): + assert strategy is not None, "Recommend strategy must be provided" + + self.strategy = strategy + + positive = positive if positive is not None else [] + negative = negative if negative is not None else [] + + for i, vector in enumerate(positive): + validate_sparse_vector(vector) + positive[i] = sort_sparse_vector(vector) + + for i, vector in enumerate(negative): + validate_sparse_vector(vector) + negative[i] = sort_sparse_vector(vector) + + self.positive = positive + self.negative = negative + + def transform_sparse( + self, foo: Callable[["SparseVector"], "SparseVector"] + ) -> "SparseRecoQuery": + return SparseRecoQuery( + positive=[foo(vector) for vector in self.positive], + negative=[foo(vector) for vector in self.negative], + strategy=self.strategy, + ) + + +class SparseContextPair: + def __init__(self, positive: SparseVector, negative: SparseVector): + validate_sparse_vector(positive) + validate_sparse_vector(negative) + self.positive: SparseVector = sort_sparse_vector(positive) + self.negative: SparseVector = sort_sparse_vector(negative) + + +class SparseDiscoveryQuery: + def __init__(self, target: SparseVector, context: list[SparseContextPair]): + validate_sparse_vector(target) + self.target: SparseVector = sort_sparse_vector(target) + self.context = context + + def transform_sparse( + self, foo: Callable[["SparseVector"], "SparseVector"] + ) -> "SparseDiscoveryQuery": + return SparseDiscoveryQuery( + target=foo(self.target), + context=[ + SparseContextPair(foo(pair.positive), foo(pair.negative)) for pair in self.context + ], + ) + + +class SparseContextQuery: + def __init__(self, context_pairs: list[SparseContextPair]): + self.context_pairs = context_pairs + + def transform_sparse( + self, foo: Callable[["SparseVector"], "SparseVector"] + ) -> "SparseContextQuery": + return SparseContextQuery( + context_pairs=[ + SparseContextPair(foo(pair.positive), foo(pair.negative)) + for pair in self.context_pairs + ] + ) + + +SparseQueryVector = Union[ + SparseVector, + SparseDiscoveryQuery, + SparseContextQuery, + SparseRecoQuery, +] + + +def calculate_distance_sparse( + query: SparseVector, vectors: list[SparseVector], empty_is_zero: bool = False +) -> types.NumpyArray: + """Calculate distances between a query sparse vector and a list of sparse vectors. + + Args: + query (SparseVector): The query sparse vector. + vectors (list[SparseVector]): A list of sparse vectors to compare against. + empty_is_zero (bool): If True, distance between vectors with no overlap is treated as zero. + Otherwise, it is treated as negative infinity. + Simple nearest search requires `empty_is_zero` to be False, while methods like + recommend, discovery, and context search require True. + """ + scores = [] + + for vector in vectors: + score = sparse_dot_product(query, vector) + if score is not None: + scores.append(score) + elif not empty_is_zero: + # means no overlap + scores.append(np.float32("-inf")) + else: + scores.append(np.float32(0.0)) + + return np.array(scores, dtype=np.float32) + + +# Expects sorted indices +# Returns None if no overlap +def sparse_dot_product(vector1: SparseVector, vector2: SparseVector) -> Optional[np.float32]: + result = 0.0 + i, j = 0, 0 + overlap = False + + assert is_sorted(vector1), "Query sparse vector must be sorted" + assert is_sorted(vector2), "Sparse vector to compare with must be sorted" + + while i < len(vector1.indices) and j < len(vector2.indices): + if vector1.indices[i] == vector2.indices[j]: + overlap = True + result += vector1.values[i] * vector2.values[j] + i += 1 + j += 1 + elif vector1.indices[i] < vector2.indices[j]: + i += 1 + else: + j += 1 + + if overlap: + return np.float32(result) + else: + return None + + +def calculate_sparse_discovery_ranks( + context: list[SparseContextPair], + vectors: list[SparseVector], +) -> types.NumpyArray: + overall_ranks: types.NumpyArray = np.zeros(len(vectors), dtype=np.int32) + for pair in context: + # Get distances to positive and negative vectors + pos = calculate_distance_sparse(pair.positive, vectors, empty_is_zero=True) + neg = calculate_distance_sparse(pair.negative, vectors, empty_is_zero=True) + + pair_ranks = np.array( + [ + 1 if is_bigger else 0 if is_equal else -1 + for is_bigger, is_equal in zip(pos > neg, pos == neg) + ] + ) + + overall_ranks += pair_ranks + + return overall_ranks + + +def calculate_sparse_discovery_scores( + query: SparseDiscoveryQuery, vectors: list[SparseVector] +) -> types.NumpyArray: + ranks = calculate_sparse_discovery_ranks(query.context, vectors) + + # Get distances to target + distances_to_target = calculate_distance_sparse(query.target, vectors, empty_is_zero=True) + + sigmoided_distances = np.fromiter( + (scaled_fast_sigmoid(xi) for xi in distances_to_target), np.float32 + ) + + return ranks + sigmoided_distances + + +def calculate_sparse_context_scores( + query: SparseContextQuery, vectors: list[SparseVector] +) -> types.NumpyArray: + overall_scores: types.NumpyArray = np.zeros(len(vectors), dtype=np.float32) + for pair in query.context_pairs: + # Get distances to positive and negative vectors + pos = calculate_distance_sparse(pair.positive, vectors, empty_is_zero=True) + neg = calculate_distance_sparse(pair.negative, vectors, empty_is_zero=True) + + difference = pos - neg - EPSILON + pair_scores = np.fromiter( + (fast_sigmoid(xi) for xi in np.minimum(difference, 0.0)), np.float32 + ) + overall_scores += pair_scores + + return overall_scores + + +def calculate_sparse_recommend_best_scores( + query: SparseRecoQuery, vectors: list[SparseVector] +) -> types.NumpyArray: + def get_best_scores(examples: list[SparseVector]) -> types.NumpyArray: + vector_count = len(vectors) + + # Get scores to all examples + scores: list[types.NumpyArray] = [] + for example in examples: + score = calculate_distance_sparse(example, vectors, empty_is_zero=True) + scores.append(score) + + # Keep only max for each vector + if len(scores) == 0: + scores.append(np.full(vector_count, -np.inf)) + best_scores = np.array(scores, dtype=np.float32).max(axis=0) + + return best_scores + + pos = get_best_scores(query.positive) + neg = get_best_scores(query.negative) + + # Choose from best positive or best negative, + # in both cases we apply sigmoid and then negate depending on the order + return np.where( + pos > neg, + np.fromiter((scaled_fast_sigmoid(xi) for xi in pos), pos.dtype), + np.fromiter((-scaled_fast_sigmoid(xi) for xi in neg), neg.dtype), + ) + + +def calculate_sparse_recommend_sum_scores( + query: SparseRecoQuery, vectors: list[SparseVector] +) -> types.NumpyArray: + def get_sum_scores(examples: list[SparseVector]) -> types.NumpyArray: + vector_count = len(vectors) + + scores: list[types.NumpyArray] = [] + for example in examples: + score = calculate_distance_sparse(example, vectors, empty_is_zero=True) + scores.append(score) + + if len(scores) == 0: + scores.append(np.zeros(vector_count)) + + sum_scores = np.array(scores, dtype=np.float32).sum(axis=0) + return sum_scores + + pos = get_sum_scores(query.positive) + neg = get_sum_scores(query.negative) + + return pos - neg + + +# Expects sorted indices +def combine_aggregate(vector1: SparseVector, vector2: SparseVector, op: Callable) -> SparseVector: + result = empty_sparse_vector() + i, j = 0, 0 + while i < len(vector1.indices) and j < len(vector2.indices): + if vector1.indices[i] == vector2.indices[j]: + result.indices.append(vector1.indices[i]) + result.values.append(op(vector1.values[i], vector2.values[j])) + i += 1 + j += 1 + elif vector1.indices[i] < vector2.indices[j]: + result.indices.append(vector1.indices[i]) + result.values.append(op(vector1.values[i], 0.0)) + i += 1 + else: + result.indices.append(vector2.indices[j]) + result.values.append(op(0.0, vector2.values[j])) + j += 1 + + while i < len(vector1.indices): + result.indices.append(vector1.indices[i]) + result.values.append(op(vector1.values[i], 0.0)) + i += 1 + + while j < len(vector2.indices): + result.indices.append(vector2.indices[j]) + result.values.append(op(0.0, vector2.values[j])) + j += 1 + + return result + + +# Expects sorted indices +def sparse_avg(vectors: Sequence[SparseVector]) -> SparseVector: + result = empty_sparse_vector() + if len(vectors) == 0: + return result + + sparse_count = 0 + for vector in vectors: + sparse_count += 1 + result = combine_aggregate(result, vector, lambda v1, v2: v1 + v2) + + result.values = np.divide(result.values, sparse_count).tolist() + return result + + +# Expects sorted indices +def merge_positive_and_negative_avg( + positive: SparseVector, negative: SparseVector +) -> SparseVector: + return combine_aggregate(positive, negative, lambda pos, neg: pos + pos - neg) diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/migrate/__init__.py b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/migrate/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..1c629e2686df6591cddac891ce0cf9f94ccf62f7 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/migrate/__init__.py @@ -0,0 +1 @@ +from .migrate import migrate diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/migrate/migrate.py b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/migrate/migrate.py new file mode 100644 index 0000000000000000000000000000000000000000..2ce4dd4534467fbf5c29ad592086d3de0b6cd1be --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/migrate/migrate.py @@ -0,0 +1,185 @@ +import time +from typing import Iterable, Optional, Any + +from qdrant_client._pydantic_compat import to_dict, model_fields +from qdrant_client.client_base import QdrantBase +from qdrant_client.http import models + + +def upload_with_retry( + client: QdrantBase, + collection_name: str, + points: Iterable[models.PointStruct], + max_attempts: int = 3, + pause: float = 3.0, +) -> None: + attempts = 1 + while attempts <= max_attempts: + try: + client.upload_points( + collection_name=collection_name, + points=points, + wait=True, + ) + return + except Exception as e: + print(f"Exception: {e}, attempt {attempts}/{max_attempts}") + if attempts < max_attempts: + print(f"Next attempt in {pause} seconds") + time.sleep(pause) + attempts += 1 + + raise Exception(f"Failed to upload points after {max_attempts} attempts") + + +def migrate( + source_client: QdrantBase, + dest_client: QdrantBase, + collection_names: Optional[list[str]] = None, + recreate_on_collision: bool = False, + batch_size: int = 100, +) -> None: + """ + Migrate collections from source client to destination client + + Args: + source_client (QdrantBase): Source client + dest_client (QdrantBase): Destination client + collection_names (list[str], optional): List of collection names to migrate. + If None - migrate all source client collections. Defaults to None. + recreate_on_collision (bool, optional): If True - recreate collection if it exists, otherwise + raise ValueError. + batch_size (int, optional): Batch size for scrolling and uploading vectors. Defaults to 100. + """ + collection_names = _select_source_collections(source_client, collection_names) + if any( + _has_custom_shards(source_client, collection_name) for collection_name in collection_names + ): + raise ValueError("Migration of collections with custom shards is not supported yet") + + collisions = _find_collisions(dest_client, collection_names) + absent_dest_collections = set(collection_names) - set(collisions) + + if collisions and not recreate_on_collision: + raise ValueError(f"Collections already exist in dest_client: {collisions}") + + for collection_name in absent_dest_collections: + _recreate_collection(source_client, dest_client, collection_name) + _migrate_collection(source_client, dest_client, collection_name, batch_size) + + for collection_name in collisions: + _recreate_collection(source_client, dest_client, collection_name) + _migrate_collection(source_client, dest_client, collection_name, batch_size) + + +def _has_custom_shards(source_client: QdrantBase, collection_name: str) -> bool: + collection_info = source_client.get_collection(collection_name) + return ( + getattr(collection_info.config.params, "sharding_method", None) + == models.ShardingMethod.CUSTOM + ) + + +def _select_source_collections( + source_client: QdrantBase, collection_names: Optional[list[str]] = None +) -> list[str]: + source_collections = source_client.get_collections().collections + source_collection_names = [collection.name for collection in source_collections] + + if collection_names is not None: + assert all( + collection_name in source_collection_names for collection_name in collection_names + ), f"Source client does not have collections: {set(collection_names) - set(source_collection_names)}" + else: + collection_names = source_collection_names + + return collection_names + + +def _find_collisions(dest_client: QdrantBase, collection_names: list[str]) -> list[str]: + dest_collections = dest_client.get_collections().collections + dest_collection_names = {collection.name for collection in dest_collections} + existing_dest_collections = dest_collection_names & set(collection_names) + return list(existing_dest_collections) + + +def _recreate_collection( + source_client: QdrantBase, + dest_client: QdrantBase, + collection_name: str, +) -> None: + src_collection_info = source_client.get_collection(collection_name) + src_config = src_collection_info.config + src_payload_schema = src_collection_info.payload_schema + if dest_client.collection_exists(collection_name): + dest_client.delete_collection(collection_name) + + strict_mode_config: Optional[models.StrictModeConfig] = None + if src_config.strict_mode_config is not None: + strict_mode_config = models.StrictModeConfig( + **{ + k: v + for k, v in to_dict(src_config.strict_mode_config).items() + if k in model_fields(models.StrictModeConfig) + } + ) + dest_client.create_collection( + collection_name, + vectors_config=src_config.params.vectors, + sparse_vectors_config=src_config.params.sparse_vectors, + shard_number=src_config.params.shard_number, + replication_factor=src_config.params.replication_factor, + write_consistency_factor=src_config.params.write_consistency_factor, + on_disk_payload=src_config.params.on_disk_payload, + hnsw_config=models.HnswConfigDiff(**to_dict(src_config.hnsw_config)), + optimizers_config=models.OptimizersConfigDiff(**to_dict(src_config.optimizer_config)), + wal_config=models.WalConfigDiff(**to_dict(src_config.wal_config)), + quantization_config=src_config.quantization_config, + strict_mode_config=strict_mode_config, + ) + + _recreate_payload_schema(dest_client, collection_name, src_payload_schema) + + +def _recreate_payload_schema( + dest_client: QdrantBase, + collection_name: str, + payload_schema: dict[str, models.PayloadIndexInfo], +) -> None: + for field_name, field_info in payload_schema.items(): + dest_client.create_payload_index( + collection_name, + field_name=field_name, + field_schema=field_info.data_type if field_info.params is None else field_info.params, + ) + + +def _migrate_collection( + source_client: QdrantBase, + dest_client: QdrantBase, + collection_name: str, + batch_size: int = 100, +) -> None: + """Migrate collection from source client to destination client + + Args: + collection_name (str): Collection name + source_client (QdrantBase): Source client + dest_client (QdrantBase): Destination client + batch_size (int, optional): Batch size for scrolling and uploading vectors. Defaults to 100. + """ + records, next_offset = source_client.scroll(collection_name, limit=2, with_vectors=True) + upload_with_retry(client=dest_client, collection_name=collection_name, points=records) # type: ignore + # upload_records has been deprecated due to the usage of models.Record; models.Record has been deprecated as a + # structure for uploading due to a `shard_key` field, and now is used only as a result structure. + # since shard_keys are not supported in migration, we can safely type ignore here and use Records for uploading + while next_offset is not None: + records, next_offset = source_client.scroll( + collection_name, offset=next_offset, limit=batch_size, with_vectors=True + ) + upload_with_retry(client=dest_client, collection_name=collection_name, points=records) # type: ignore + source_client_vectors_count = source_client.count(collection_name).count + dest_client_vectors_count = dest_client.count(collection_name).count + assert ( + source_client_vectors_count == dest_client_vectors_count + ), f"Migration failed, vectors count are not equal: source vector count {source_client_vectors_count}, dest vector count {dest_client_vectors_count}" diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/models/__init__.py b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/models/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..3614a6d6229119f8a392a7f45f75f877ec954c79 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/models/__init__.py @@ -0,0 +1,3 @@ +from qdrant_client.http.models import * +from qdrant_client.fastembed_common import * +from qdrant_client.embed.models import * diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/proto/collections.proto b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/proto/collections.proto new file mode 100644 index 0000000000000000000000000000000000000000..da376673d03e6ef449b6228ca9394db684f810b1 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/proto/collections.proto @@ -0,0 +1,762 @@ +syntax = "proto3"; +package qdrant; + +option csharp_namespace = "Qdrant.Client.Grpc"; + +enum Datatype { + Default = 0; + Float32 = 1; + Uint8 = 2; + Float16 = 3; +} + +message VectorParams { + uint64 size = 1; // Size of the vectors + Distance distance = 2; // Distance function used for comparing vectors + optional HnswConfigDiff hnsw_config = 3; // Configuration of vector HNSW graph. If omitted - the collection configuration will be used + optional QuantizationConfig quantization_config = 4; // Configuration of vector quantization config. If omitted - the collection configuration will be used + optional bool on_disk = 5; // If true - serve vectors from disk. If set to false, the vectors will be loaded in RAM. + optional Datatype datatype = 6; // Data type of the vectors + optional MultiVectorConfig multivector_config = 7; // Configuration for multi-vector search +} + +message VectorParamsDiff { + optional HnswConfigDiff hnsw_config = 1; // Update params for HNSW index. If empty object - it will be unset + optional QuantizationConfigDiff quantization_config = 2; // Update quantization params. If none - it is left unchanged. + optional bool on_disk = 3; // If true - serve vectors from disk. If set to false, the vectors will be loaded in RAM. +} + +message VectorParamsMap { + map map = 1; +} + +message VectorParamsDiffMap { + map map = 1; +} + +message VectorsConfig { + oneof config { + VectorParams params = 1; + VectorParamsMap params_map = 2; + } +} + +message VectorsConfigDiff { + oneof config { + VectorParamsDiff params = 1; + VectorParamsDiffMap params_map = 2; + } +} + +enum Modifier { + None = 0; + Idf = 1; // Apply Inverse Document Frequency +} + +message SparseVectorParams { + optional SparseIndexConfig index = 1; // Configuration of sparse index + optional Modifier modifier = 2; // If set - apply modifier to the vector values +} + +message SparseVectorConfig { + map map = 1; +} + +enum MultiVectorComparator { + MaxSim = 0; +} + +message MultiVectorConfig { + MultiVectorComparator comparator = 1; // Comparator for multi-vector search +} + +message GetCollectionInfoRequest { + string collection_name = 1; // Name of the collection +} + +message CollectionExistsRequest { + string collection_name = 1; +} + +message CollectionExists { + bool exists = 1; +} + +message CollectionExistsResponse { + CollectionExists result = 1; + double time = 2; // Time spent to process +} + +message ListCollectionsRequest {} + +message CollectionDescription { + string name = 1; // Name of the collection +} + +message GetCollectionInfoResponse { + CollectionInfo result = 1; + double time = 2; // Time spent to process +} + +message ListCollectionsResponse { + repeated CollectionDescription collections = 1; + double time = 2; // Time spent to process +} + +enum Distance { + UnknownDistance = 0; + Cosine = 1; + Euclid = 2; + Dot = 3; + Manhattan = 4; +} + +enum CollectionStatus { + UnknownCollectionStatus = 0; + Green = 1; // All segments are ready + Yellow = 2; // Optimization in process + Red = 3; // Something went wrong + Grey = 4; // Optimization is pending +} + +enum PayloadSchemaType { + UnknownType = 0; + Keyword = 1; + Integer = 2; + Float = 3; + Geo = 4; + Text = 5; + Bool = 6; + Datetime = 7; + Uuid = 8; +} + +enum QuantizationType { + UnknownQuantization = 0; + Int8 = 1; +} + +enum CompressionRatio { + x4 = 0; + x8 = 1; + x16 = 2; + x32 = 3; + x64 = 4; +} + +message MaxOptimizationThreads { + enum Setting { + Auto = 0; + } + + oneof variant { + uint64 value = 1; + Setting setting = 2; + } +} + +message OptimizerStatus { + bool ok = 1; + string error = 2; +} + +message HnswConfigDiff { + /* + Number of edges per node in the index graph. Larger the value - more accurate the search, more space required. + */ + optional uint64 m = 1; + /* + Number of neighbours to consider during the index building. Larger the value - more accurate the search, more time required to build the index. + */ + optional uint64 ef_construct = 2; + /* + Minimal size (in KiloBytes) of vectors for additional payload-based indexing. + If the payload chunk is smaller than `full_scan_threshold` additional indexing won't be used - + in this case full-scan search should be preferred by query planner and additional indexing is not required. + Note: 1 Kb = 1 vector of size 256 + */ + optional uint64 full_scan_threshold = 3; + /* + Number of parallel threads used for background index building. + If 0 - automatically select from 8 to 16. + Best to keep between 8 and 16 to prevent likelihood of building broken/inefficient HNSW graphs. + On small CPUs, less threads are used. + */ + optional uint64 max_indexing_threads = 4; + /* + Store HNSW index on disk. If set to false, the index will be stored in RAM. + */ + optional bool on_disk = 5; + /* + Number of additional payload-aware links per node in the index graph. If not set - regular M parameter will be used. + */ + optional uint64 payload_m = 6; +} + +message SparseIndexConfig { + /* + Prefer a full scan search upto (excluding) this number of vectors. + Note: this is number of vectors, not KiloBytes. + */ + optional uint64 full_scan_threshold = 1; + /* + Store inverted index on disk. If set to false, the index will be stored in RAM. + */ + optional bool on_disk = 2; + /* + Datatype used to store weights in the index. + */ + optional Datatype datatype = 3; +} + +message WalConfigDiff { + optional uint64 wal_capacity_mb = 1; // Size of a single WAL block file + optional uint64 wal_segments_ahead = 2; // Number of segments to create in advance +} + +message OptimizersConfigDiff { + /* + The minimal fraction of deleted vectors in a segment, required to perform segment optimization + */ + optional double deleted_threshold = 1; + /* + The minimal number of vectors in a segment, required to perform segment optimization + */ + optional uint64 vacuum_min_vector_number = 2; + /* + Target amount of segments the optimizer will try to keep. + Real amount of segments may vary depending on multiple parameters: + + - Amount of stored points. + - Current write RPS. + + It is recommended to select the default number of segments as a factor of the number of search threads, + so that each segment would be handled evenly by one of the threads. + */ + optional uint64 default_segment_number = 3; + /* + Do not create segments larger this size (in kilobytes). + Large segments might require disproportionately long indexation times, + therefore it makes sense to limit the size of segments. + + If indexing speed is more important - make this parameter lower. + If search speed is more important - make this parameter higher. + Note: 1Kb = 1 vector of size 256 + If not set, will be automatically selected considering the number of available CPUs. + */ + optional uint64 max_segment_size = 4; + /* + Maximum size (in kilobytes) of vectors to store in-memory per segment. + Segments larger than this threshold will be stored as read-only memmapped file. + + Memmap storage is disabled by default, to enable it, set this threshold to a reasonable value. + + To disable memmap storage, set this to `0`. + + Note: 1Kb = 1 vector of size 256 + */ + optional uint64 memmap_threshold = 5; + /* + Maximum size (in kilobytes) of vectors allowed for plain index, exceeding this threshold will enable vector indexing + + Default value is 20,000, based on . + + To disable vector indexing, set to `0`. + + Note: 1kB = 1 vector of size 256. + */ + optional uint64 indexing_threshold = 6; + /* + Interval between forced flushes. + */ + optional uint64 flush_interval_sec = 7; + + // Deprecated in favor of `max_optimization_threads` + optional uint64 deprecated_max_optimization_threads = 8; + + /* + Max number of threads (jobs) for running optimizations per shard. + Note: each optimization job will also use `max_indexing_threads` threads by itself for index building. + If "auto" - have no limit and choose dynamically to saturate CPU. + If 0 - no optimization threads, optimizations will be disabled. + */ + optional MaxOptimizationThreads max_optimization_threads = 9; +} + +message ScalarQuantization { + QuantizationType type = 1; // Type of quantization + optional float quantile = 2; // Number of bits to use for quantization + optional bool always_ram = 3; // If true - quantized vectors always will be stored in RAM, ignoring the config of main storage +} + +message ProductQuantization { + CompressionRatio compression = 1; // Compression ratio + optional bool always_ram = 2; // If true - quantized vectors always will be stored in RAM, ignoring the config of main storage +} + +enum BinaryQuantizationEncoding { + OneBit = 0; + TwoBits = 1; + OneAndHalfBits = 2; +} + +message BinaryQuantizationQueryEncoding { + enum Setting { + Default = 0; + Binary = 1; + Scalar4Bits = 2; + Scalar8Bits = 3; + } + + oneof variant { + Setting setting = 4; + } +} + +message BinaryQuantization { + optional bool always_ram = 1; // If true - quantized vectors always will be stored in RAM, ignoring the config of main storage + optional BinaryQuantizationEncoding encoding = 2; // Binary quantization encoding method + /* + Asymmetric quantization configuration allows a query to have different quantization than stored vectors. + It can increase the accuracy of search at the cost of performance. + */ + optional BinaryQuantizationQueryEncoding query_encoding = 3; +} + +message QuantizationConfig { + oneof quantization { + ScalarQuantization scalar = 1; + ProductQuantization product = 2; + BinaryQuantization binary = 3; + } +} + +message Disabled {} + +message QuantizationConfigDiff { + oneof quantization { + ScalarQuantization scalar = 1; + ProductQuantization product = 2; + Disabled disabled = 3; + BinaryQuantization binary = 4; + } +} + +enum ShardingMethod { + Auto = 0; // Auto-sharding based on record ids + Custom = 1; // Shard by user-defined key +} + +message StrictModeConfig { + optional bool enabled = 1; + optional uint32 max_query_limit = 2; + optional uint32 max_timeout = 3; + optional bool unindexed_filtering_retrieve = 4; + optional bool unindexed_filtering_update = 5; + + optional uint32 search_max_hnsw_ef = 6; + optional bool search_allow_exact = 7; + optional float search_max_oversampling = 8; + optional uint64 upsert_max_batchsize = 9; + optional uint64 max_collection_vector_size_bytes = 10; + optional uint32 read_rate_limit = 11; // Max number of read operations per minute per replica + optional uint32 write_rate_limit = 12; // Max number of write operations per minute per replica + optional uint64 max_collection_payload_size_bytes = 13; + optional uint64 filter_max_conditions = 14; + optional uint64 condition_max_size = 15; + optional StrictModeMultivectorConfig multivector_config = 16; + optional StrictModeSparseConfig sparse_config = 17; + optional uint64 max_points_count = 18; +} + +message StrictModeSparseConfig { + map sparse_config = 1; +} + +message StrictModeSparse { + optional uint64 max_length = 10; +} + +message StrictModeMultivectorConfig { + map multivector_config = 1; +} + +message StrictModeMultivector { + optional uint64 max_vectors = 1; +} + +message CreateCollection { + string collection_name = 1; // Name of the collection + reserved 2; // Deprecated + reserved 3; // Deprecated + optional HnswConfigDiff hnsw_config = 4; // Configuration of vector index + optional WalConfigDiff wal_config = 5; // Configuration of the Write-Ahead-Log + optional OptimizersConfigDiff optimizers_config = 6; // Configuration of the optimizers + optional uint32 shard_number = 7; // Number of shards in the collection, default is 1 for standalone, otherwise equal to the number of nodes. Minimum is 1 + optional bool on_disk_payload = 8; // If true - point's payload will not be stored in memory + optional uint64 timeout = 9; // Wait timeout for operation commit in seconds, if not specified - default value will be supplied + optional VectorsConfig vectors_config = 10; // Configuration for vectors + optional uint32 replication_factor = 11; // Number of replicas of each shard that network tries to maintain, default = 1 + optional uint32 write_consistency_factor = 12; // How many replicas should apply the operation for us to consider it successful, default = 1 + optional string init_from_collection = 13; // Specify name of the other collection to copy data from + optional QuantizationConfig quantization_config = 14; // Quantization configuration of vector + optional ShardingMethod sharding_method = 15; // Sharding method + optional SparseVectorConfig sparse_vectors_config = 16; // Configuration for sparse vectors + optional StrictModeConfig strict_mode_config = 17; // Configuration for strict mode +} + +message UpdateCollection { + string collection_name = 1; // Name of the collection + optional OptimizersConfigDiff optimizers_config = 2; // New configuration parameters for the collection. This operation is blocking, it will only proceed once all current optimizations are complete + optional uint64 timeout = 3; // Wait timeout for operation commit in seconds if blocking, if not specified - default value will be supplied + optional CollectionParamsDiff params = 4; // New configuration parameters for the collection + optional HnswConfigDiff hnsw_config = 5; // New HNSW parameters for the collection index + optional VectorsConfigDiff vectors_config = 6; // New vector parameters + optional QuantizationConfigDiff quantization_config = 7; // Quantization configuration of vector + optional SparseVectorConfig sparse_vectors_config = 8; // New sparse vector parameters + optional StrictModeConfig strict_mode_config = 9; // New strict mode configuration +} + +message DeleteCollection { + string collection_name = 1; // Name of the collection + optional uint64 timeout = 2; // Wait timeout for operation commit in seconds, if not specified - default value will be supplied +} + +message CollectionOperationResponse { + bool result = 1; // if operation made changes + double time = 2; // Time spent to process +} + +message CollectionParams { + reserved 1; // Deprecated + reserved 2; // Deprecated + uint32 shard_number = 3; // Number of shards in collection + bool on_disk_payload = 4; // If true - point's payload will not be stored in memory + optional VectorsConfig vectors_config = 5; // Configuration for vectors + optional uint32 replication_factor = 6; // Number of replicas of each shard that network tries to maintain + optional uint32 write_consistency_factor = 7; // How many replicas should apply the operation for us to consider it successful + optional uint32 read_fan_out_factor = 8; // Fan-out every read request to these many additional remote nodes (and return first available response) + optional ShardingMethod sharding_method = 9; // Sharding method + optional SparseVectorConfig sparse_vectors_config = 10; // Configuration for sparse vectors +} + +message CollectionParamsDiff { + optional uint32 replication_factor = 1; // Number of replicas of each shard that network tries to maintain + optional uint32 write_consistency_factor = 2; // How many replicas should apply the operation for us to consider it successful + optional bool on_disk_payload = 3; // If true - point's payload will not be stored in memory + optional uint32 read_fan_out_factor = 4; // Fan-out every read request to these many additional remote nodes (and return first available response) +} + +message CollectionConfig { + CollectionParams params = 1; // Collection parameters + HnswConfigDiff hnsw_config = 2; // Configuration of vector index + OptimizersConfigDiff optimizer_config = 3; // Configuration of the optimizers + WalConfigDiff wal_config = 4; // Configuration of the Write-Ahead-Log + optional QuantizationConfig quantization_config = 5; // Configuration of the vector quantization + optional StrictModeConfig strict_mode_config = 6; // Configuration of strict mode. +} + +enum TokenizerType { + Unknown = 0; + Prefix = 1; + Whitespace = 2; + Word = 3; + Multilingual = 4; +} + +message KeywordIndexParams { + optional bool is_tenant = 1; // If true - used for tenant optimization. + optional bool on_disk = 2; // If true - store index on disk. +} + +message IntegerIndexParams { + optional bool lookup = 1; // If true - support direct lookups. Default is true. + optional bool range = 2; // If true - support ranges filters. Default is true. + optional bool is_principal = 3; // If true - use this key to organize storage of the collection data. This option assumes that this key will be used in majority of filtered requests. Default is false. + optional bool on_disk = 4; // If true - store index on disk. Default is false. +} + +message FloatIndexParams { + optional bool on_disk = 1; // If true - store index on disk. + optional bool is_principal = 2; // If true - use this key to organize storage of the collection data. This option assumes that this key will be used in majority of filtered requests. +} + +message GeoIndexParams { + optional bool on_disk = 1; // If true - store index on disk. +} + +message StopwordsSet { + repeated string languages = 1; // List of languages to use stopwords from + repeated string custom = 2; // List of custom stopwords +} + +message TextIndexParams { + TokenizerType tokenizer = 1; // Tokenizer type + optional bool lowercase = 2; // If true - all tokens will be lowercase + optional uint64 min_token_len = 3; // Minimal token length + optional uint64 max_token_len = 4; // Maximal token length + optional bool on_disk = 5; // If true - store index on disk. + optional StopwordsSet stopwords = 6; // Stopwords for the text index + optional bool phrase_matching = 7; // If true - support phrase matching. + optional StemmingAlgorithm stemmer = 8; // Set an algorithm for stemming. +} + +message StemmingAlgorithm { + oneof stemming_params { + SnowballParams snowball = 1; // Parameters for snowball stemming + } +} + +message SnowballParams { + string language = 1; // Which language the algorithm should stem. +} + +message BoolIndexParams { + optional bool on_disk = 1; // If true - store index on disk. +} + +message DatetimeIndexParams { + optional bool on_disk = 1; // If true - store index on disk. + optional bool is_principal = 2; // If true - use this key to organize storage of the collection data. This option assumes that this key will be used in majority of filtered requests. +} + +message UuidIndexParams { + optional bool is_tenant = 1; // If true - used for tenant optimization. + optional bool on_disk = 2; // If true - store index on disk. +} + +message PayloadIndexParams { + oneof index_params { + KeywordIndexParams keyword_index_params = 3; // Parameters for keyword index + IntegerIndexParams integer_index_params = 2; // Parameters for integer index + FloatIndexParams float_index_params = 4; // Parameters for float index + GeoIndexParams geo_index_params = 5; // Parameters for geo index + TextIndexParams text_index_params = 1; // Parameters for text index + BoolIndexParams bool_index_params = 6; // Parameters for bool index + DatetimeIndexParams datetime_index_params = 7; // Parameters for datetime index + UuidIndexParams uuid_index_params = 8; // Parameters for uuid index + } +} + +message PayloadSchemaInfo { + PayloadSchemaType data_type = 1; // Field data type + optional PayloadIndexParams params = 2; // Field index parameters + optional uint64 points = 3; // Number of points indexed within this field indexed +} + +message CollectionInfo { + CollectionStatus status = 1; // operating condition of the collection + OptimizerStatus optimizer_status = 2; // status of collection optimizers + optional uint64 vectors_count = 3; // Approximate number of vectors in the collection + uint64 segments_count = 4; // Number of independent segments + reserved 5; // Deprecated + reserved 6; // Deprecated + CollectionConfig config = 7; // Configuration + map payload_schema = 8; // Collection data types + optional uint64 points_count = 9; // Approximate number of points in the collection + optional uint64 indexed_vectors_count = 10; // Approximate number of indexed vectors in the collection. +} + +message ChangeAliases { + repeated AliasOperations actions = 1; // List of actions + optional uint64 timeout = 2; // Wait timeout for operation commit in seconds, if not specified - default value will be supplied +} + +message AliasOperations { + oneof action { + CreateAlias create_alias = 1; + RenameAlias rename_alias = 2; + DeleteAlias delete_alias = 3; + } +} + +message CreateAlias { + string collection_name = 1; // Name of the collection + string alias_name = 2; // New name of the alias +} + +message RenameAlias { + string old_alias_name = 1; // Name of the alias to rename + string new_alias_name = 2; // Name of the alias +} + +message DeleteAlias { + string alias_name = 1; // Name of the alias +} + +message ListAliasesRequest {} + +message ListCollectionAliasesRequest { + string collection_name = 1; // Name of the collection +} + +message AliasDescription { + string alias_name = 1; // Name of the alias + string collection_name = 2; // Name of the collection +} + +message ListAliasesResponse { + repeated AliasDescription aliases = 1; + double time = 2; // Time spent to process +} + +message CollectionClusterInfoRequest { + string collection_name = 1; // Name of the collection +} + +enum ReplicaState { + Active = 0; // Active and sound + Dead = 1; // Failed for some reason + Partial = 2; // The shard is partially loaded and is currently receiving data from other shards + Initializing = 3; // Collection is being created + Listener = 4; // A shard which receives data, but is not used for search; Useful for backup shards + PartialSnapshot = 5; // Deprecated: snapshot shard transfer is in progress; Updates should not be sent to (and are ignored by) the shard + Recovery = 6; // Shard is undergoing recovered by an external node; Normally rejects updates, accepts updates if force is true + Resharding = 7; // Points are being migrated to this shard as part of scale-up resharding + ReshardingScaleDown = 8; // Points are being migrated to this shard as part of scale-down resharding +} + +message ShardKey { + oneof key { + string keyword = 1; // String key + uint64 number = 2; // Number key + } +} + +message LocalShardInfo { + uint32 shard_id = 1; // Local shard id + uint64 points_count = 2; // Number of points in the shard + ReplicaState state = 3; // Is replica active + optional ShardKey shard_key = 4; // User-defined shard key +} + +message RemoteShardInfo { + uint32 shard_id = 1; // Local shard id + uint64 peer_id = 2; // Remote peer id + ReplicaState state = 3; // Is replica active + optional ShardKey shard_key = 4; // User-defined shard key +} + +message ShardTransferInfo { + uint32 shard_id = 1; // Local shard id + optional uint32 to_shard_id = 5; + uint64 from = 2; + uint64 to = 3; + bool sync = 4; // If `true` transfer is a synchronization of a replicas; If `false` transfer is a moving of a shard from one peer to another +} + +message ReshardingInfo { + uint32 shard_id = 1; + uint64 peer_id = 2; + optional ShardKey shard_key = 3; + ReshardingDirection direction = 4; +} + +/* + Resharding direction, scale up or down in number of shards +*/ +enum ReshardingDirection { + Up = 0; // Scale up, add a new shard + Down = 1; // Scale down, remove a shard +} + +message CollectionClusterInfoResponse { + uint64 peer_id = 1; // ID of this peer + uint64 shard_count = 2; // Total number of shards + repeated LocalShardInfo local_shards = 3; // Local shards + repeated RemoteShardInfo remote_shards = 4; // Remote shards + repeated ShardTransferInfo shard_transfers = 5; // Shard transfers + repeated ReshardingInfo resharding_operations = 6; // Resharding operations +} + +message MoveShard { + uint32 shard_id = 1; // Local shard id + optional uint32 to_shard_id = 5; + uint64 from_peer_id = 2; + uint64 to_peer_id = 3; + optional ShardTransferMethod method = 4; +} + +message ReplicateShard { + uint32 shard_id = 1; // Local shard id + optional uint32 to_shard_id = 5; + uint64 from_peer_id = 2; + uint64 to_peer_id = 3; + optional ShardTransferMethod method = 4; +} + +message AbortShardTransfer { + uint32 shard_id = 1; // Local shard id + optional uint32 to_shard_id = 4; + uint64 from_peer_id = 2; + uint64 to_peer_id = 3; +} + +message RestartTransfer { + uint32 shard_id = 1; // Local shard id + optional uint32 to_shard_id = 5; + uint64 from_peer_id = 2; + uint64 to_peer_id = 3; + ShardTransferMethod method = 4; +} + +enum ShardTransferMethod { + StreamRecords = 0; // Stream shard records in batches + Snapshot = 1; // Snapshot the shard and recover it on the target peer + WalDelta = 2; // Resolve WAL delta between peers and transfer the difference + ReshardingStreamRecords = 3; // Stream shard records in batches for resharding +} + +message Replica { + uint32 shard_id = 1; + uint64 peer_id = 2; +} + +message CreateShardKey { + ShardKey shard_key = 1; // User-defined shard key + optional uint32 shards_number = 2; // Number of shards to create per shard key + optional uint32 replication_factor = 3; // Number of replicas of each shard to create + repeated uint64 placement = 4; // List of peer ids, allowed to create shards. If empty - all peers are allowed +} + +message DeleteShardKey { + ShardKey shard_key = 1; // Shard key to delete +} + +message UpdateCollectionClusterSetupRequest { + string collection_name = 1; // Name of the collection + oneof operation { + MoveShard move_shard = 2; + ReplicateShard replicate_shard = 3; + AbortShardTransfer abort_transfer = 4; + Replica drop_replica = 5; + CreateShardKey create_shard_key = 7; + DeleteShardKey delete_shard_key = 8; + RestartTransfer restart_transfer = 9; + } + optional uint64 timeout = 6; // Wait timeout for operation commit in seconds, if not specified - default value will be supplied +} + +message UpdateCollectionClusterSetupResponse { + bool result = 1; +} + +message CreateShardKeyRequest { + string collection_name = 1; // Name of the collection + CreateShardKey request = 2; // Request to create shard key + optional uint64 timeout = 3; // Wait timeout for operation commit in seconds, if not specified - default value will be supplied +} + +message DeleteShardKeyRequest { + string collection_name = 1; // Name of the collection + DeleteShardKey request = 2; // Request to delete shard key + optional uint64 timeout = 3; // Wait timeout for operation commit in seconds, if not specified - default value will be supplied +} + +message CreateShardKeyResponse { + bool result = 1; +} + +message DeleteShardKeyResponse { + bool result = 1; +} diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/proto/collections_service.proto b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/proto/collections_service.proto new file mode 100644 index 0000000000000000000000000000000000000000..52caa8d2e40ddfcf3dd9d8b503abecd6111bad76 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/proto/collections_service.proto @@ -0,0 +1,61 @@ +syntax = "proto3"; + +import "collections.proto"; + +package qdrant; +option csharp_namespace = "Qdrant.Client.Grpc"; + +service Collections { + /* + Get detailed information about specified existing collection + */ + rpc Get (GetCollectionInfoRequest) returns (GetCollectionInfoResponse) {} + /* + Get list name of all existing collections + */ + rpc List (ListCollectionsRequest) returns (ListCollectionsResponse) {} + /* + Create new collection with given parameters + */ + rpc Create (CreateCollection) returns (CollectionOperationResponse) {} + /* + Update parameters of the existing collection + */ + rpc Update (UpdateCollection) returns (CollectionOperationResponse) {} + /* + Drop collection and all associated data + */ + rpc Delete (DeleteCollection) returns (CollectionOperationResponse) {} + /* + Update Aliases of the existing collection + */ + rpc UpdateAliases (ChangeAliases) returns (CollectionOperationResponse) {} + /* + Get list of all aliases for a collection + */ + rpc ListCollectionAliases (ListCollectionAliasesRequest) returns (ListAliasesResponse) {} + /* + Get list of all aliases for all existing collections + */ + rpc ListAliases (ListAliasesRequest) returns (ListAliasesResponse) {} + /* + Get cluster information for a collection + */ + rpc CollectionClusterInfo (CollectionClusterInfoRequest) returns (CollectionClusterInfoResponse) {} + /* + Check the existence of a collection + */ + rpc CollectionExists (CollectionExistsRequest) returns (CollectionExistsResponse) {} + /* + Update cluster setup for a collection + */ + rpc UpdateCollectionClusterSetup (UpdateCollectionClusterSetupRequest) returns (UpdateCollectionClusterSetupResponse) {} + /* + Create shard key + */ + rpc CreateShardKey (CreateShardKeyRequest) returns (CreateShardKeyResponse) {} + /* + Delete shard key + */ + rpc DeleteShardKey (DeleteShardKeyRequest) returns (DeleteShardKeyResponse) {} +} diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/proto/json_with_int.proto b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/proto/json_with_int.proto new file mode 100644 index 0000000000000000000000000000000000000000..283fdc3b0d5d4748ce05608414de9939e49e2342 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/proto/json_with_int.proto @@ -0,0 +1,62 @@ +// Fork of the google.protobuf.Value with explicit support for integer values + +syntax = "proto3"; + +package qdrant; +option csharp_namespace = "Qdrant.Client.Grpc"; + +// `Struct` represents a structured data value, consisting of fields +// which map to dynamically typed values. In some languages, `Struct` +// might be supported by a native representation. For example, in +// scripting languages like JS a struct is represented as an +// object. The details of that representation are described together +// with the proto support for the language. +// +// The JSON representation for `Struct` is a JSON object. +message Struct { + // Unordered map of dynamically typed values. + map fields = 1; +} + +// `Value` represents a dynamically typed value which can be either +// null, a number, a string, a boolean, a recursive struct value, or a +// list of values. A producer of value is expected to set one of those +// variants, absence of any variant indicates an error. +// +// The JSON representation for `Value` is a JSON value. +message Value { + // The kind of value. + oneof kind { + // Represents a null value. + NullValue null_value = 1; + // Represents a double value. + double double_value = 2; + // Represents an integer value + int64 integer_value = 3; + // Represents a string value. + string string_value = 4; + // Represents a boolean value. + bool bool_value = 5; + // Represents a structured value. + Struct struct_value = 6; + // Represents a repeated `Value`. + ListValue list_value = 7; + } +} + +// `NullValue` is a singleton enumeration to represent the null value for the +// `Value` type union. +// +// The JSON representation for `NullValue` is JSON `null`. +enum NullValue { + // Null value. + NULL_VALUE = 0; +} + +// `ListValue` is a wrapper around a repeated field of values. +// +// The JSON representation for `ListValue` is a JSON array. +message ListValue { + // Repeated field of dynamically typed values. + repeated Value values = 1; +} diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/proto/points.proto b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/proto/points.proto new file mode 100644 index 0000000000000000000000000000000000000000..921e85a9233e3e84a1c84bc2fc5b8cf2887e816f --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/proto/points.proto @@ -0,0 +1,1232 @@ +syntax = "proto3"; + +package qdrant; +option csharp_namespace = "Qdrant.Client.Grpc"; + +import "collections.proto"; +import "google/protobuf/timestamp.proto"; +import "json_with_int.proto"; + + +enum WriteOrderingType { + Weak = 0; // Write operations may be reordered, works faster, default + Medium = 1; // Write operations go through dynamically selected leader, may be inconsistent for a short period of time in case of leader change + Strong = 2; // Write operations go through the permanent leader, consistent, but may be unavailable if leader is down +} + +message WriteOrdering { + WriteOrderingType type = 1; // Write ordering guarantees +} + +enum ReadConsistencyType { + All = 0; // Send request to all nodes and return points which are present on all of them + Majority = 1; // Send requests to all nodes and return points which are present on majority of them + Quorum = 2; // Send requests to half + 1 nodes, return points which are present on all of them +} + +message ReadConsistency { + oneof value { + ReadConsistencyType type = 1; // Common read consistency configurations + uint64 factor = 2; // Send request to a specified number of nodes, and return points which are present on all of them + } +} + +// --------------------------------------------- +// ------------- Point Id Requests ------------- +// --------------------------------------------- + +message PointId { + oneof point_id_options { + uint64 num = 1; // Numerical ID of the point + string uuid = 2; // UUID + } +} + +message SparseIndices { + repeated uint32 data = 1; +} + +message Document { + string text = 1; // Text of the document + string model = 3; // Model name + map options = 4; // Model options +} + +message Image { + Value image = 1; // Image data, either base64 encoded or URL + string model = 2; // Model name + map options = 3; // Model options +} + +message InferenceObject { + Value object = 1; // Object to infer + string model = 2; // Model name + map options = 3; // Model options +} + +// Legacy vector format, which determines the vector type by the configuration of its fields. +message Vector { + repeated float data = 1; // Vector data (flatten for multi vectors), deprecated + optional SparseIndices indices = 2; // Sparse indices for sparse vectors, deprecated + optional uint32 vectors_count = 3; // Number of vectors per multi vector, deprecated + oneof vector { + DenseVector dense = 101; // Dense vector + SparseVector sparse = 102; // Sparse vector + MultiDenseVector multi_dense = 103; // Multi dense vector + Document document = 104; + Image image = 105; + InferenceObject object = 106; + } +} + +message VectorOutput { + repeated float data = 1; // Vector data (flatten for multi vectors), deprecated + optional SparseIndices indices = 2; // Sparse indices for sparse vectors, deprecated + optional uint32 vectors_count = 3; // Number of vectors per multi vector, deprecated + oneof vector { + DenseVector dense = 101; // Dense vector + SparseVector sparse = 102; // Sparse vector + MultiDenseVector multi_dense = 103; // Multi dense vector + } +} + +message DenseVector { + repeated float data = 1; +} + +message SparseVector { + repeated float values = 1; + repeated uint32 indices = 2; +} + +message MultiDenseVector { + repeated DenseVector vectors = 1; +} + +// Vector type to be used in queries. Ids will be substituted with their corresponding vectors from the collection. +message VectorInput { + oneof variant { + PointId id = 1; + DenseVector dense = 2; + SparseVector sparse = 3; + MultiDenseVector multi_dense = 4; + Document document = 5; + Image image = 6; + InferenceObject object = 7; + } +} + +// --------------------------------------------- +// ----------------- ShardKeySelector ---------- +// --------------------------------------------- + +message ShardKeySelector { + repeated ShardKey shard_keys = 1; // List of shard keys which should be used in the request +} + + +// --------------------------------------------- +// ---------------- RPC Requests --------------- +// --------------------------------------------- + +message UpsertPoints { + string collection_name = 1; // name of the collection + optional bool wait = 2; // Wait until the changes have been applied? + repeated PointStruct points = 3; + optional WriteOrdering ordering = 4; // Write ordering guarantees + optional ShardKeySelector shard_key_selector = 5; // Option for custom sharding to specify used shard keys +} + +message DeletePoints { + string collection_name = 1; // name of the collection + optional bool wait = 2; // Wait until the changes have been applied? + PointsSelector points = 3; // Affected points + optional WriteOrdering ordering = 4; // Write ordering guarantees + optional ShardKeySelector shard_key_selector = 5; // Option for custom sharding to specify used shard keys +} + +message GetPoints { + string collection_name = 1; // name of the collection + repeated PointId ids = 2; // List of points to retrieve + reserved 3; // deprecated "with_vector" field + WithPayloadSelector with_payload = 4; // Options for specifying which payload to include or not + optional WithVectorsSelector with_vectors = 5; // Options for specifying which vectors to include into response + optional ReadConsistency read_consistency = 6; // Options for specifying read consistency guarantees + optional ShardKeySelector shard_key_selector = 7; // Specify in which shards to look for the points, if not specified - look in all shards + optional uint64 timeout = 8; // If set, overrides global timeout setting for this request. Unit is seconds. +} + +message UpdatePointVectors { + string collection_name = 1; // name of the collection + optional bool wait = 2; // Wait until the changes have been applied? + repeated PointVectors points = 3; // List of points and vectors to update + optional WriteOrdering ordering = 4; // Write ordering guarantees + optional ShardKeySelector shard_key_selector = 5; // Option for custom sharding to specify used shard keys +} + +message PointVectors { + PointId id = 1; // ID to update vectors for + Vectors vectors = 2; // Named vectors to update, leave others intact +} + +message DeletePointVectors { + string collection_name = 1; // name of the collection + optional bool wait = 2; // Wait until the changes have been applied? + PointsSelector points_selector = 3; // Affected points + VectorsSelector vectors = 4; // List of vector names to delete + optional WriteOrdering ordering = 5; // Write ordering guarantees + optional ShardKeySelector shard_key_selector = 6; // Option for custom sharding to specify used shard keys +} + +message SetPayloadPoints { + string collection_name = 1; // name of the collection + optional bool wait = 2; // Wait until the changes have been applied? + map payload = 3; // New payload values + reserved 4; // List of point to modify, deprecated + optional PointsSelector points_selector = 5; // Affected points + optional WriteOrdering ordering = 6; // Write ordering guarantees + optional ShardKeySelector shard_key_selector = 7; // Option for custom sharding to specify used shard keys + optional string key = 8; // Option for indicate property of payload +} + +message DeletePayloadPoints { + string collection_name = 1; // name of the collection + optional bool wait = 2; // Wait until the changes have been applied? + repeated string keys = 3; // List of keys to delete + reserved 4; // Affected points, deprecated + optional PointsSelector points_selector = 5; // Affected points + optional WriteOrdering ordering = 6; // Write ordering guarantees + optional ShardKeySelector shard_key_selector = 7; // Option for custom sharding to specify used shard keys +} + +message ClearPayloadPoints { + string collection_name = 1; // name of the collection + optional bool wait = 2; // Wait until the changes have been applied? + PointsSelector points = 3; // Affected points + optional WriteOrdering ordering = 4; // Write ordering guarantees + optional ShardKeySelector shard_key_selector = 5; // Option for custom sharding to specify used shard keys +} + +enum FieldType { + FieldTypeKeyword = 0; + FieldTypeInteger = 1; + FieldTypeFloat = 2; + FieldTypeGeo = 3; + FieldTypeText = 4; + FieldTypeBool = 5; + FieldTypeDatetime = 6; + FieldTypeUuid = 7; +} + +message CreateFieldIndexCollection { + string collection_name = 1; // name of the collection + optional bool wait = 2; // Wait until the changes have been applied? + string field_name = 3; // Field name to index + optional FieldType field_type = 4; // Field type. + optional PayloadIndexParams field_index_params = 5; // Payload index params. + optional WriteOrdering ordering = 6; // Write ordering guarantees +} + +message DeleteFieldIndexCollection { + string collection_name = 1; // name of the collection + optional bool wait = 2; // Wait until the changes have been applied? + string field_name = 3; // Field name to delete + optional WriteOrdering ordering = 4; // Write ordering guarantees +} + +message PayloadIncludeSelector { + repeated string fields = 1; // List of payload keys to include into result +} + +message PayloadExcludeSelector { + repeated string fields = 1; // List of payload keys to exclude from the result +} + +message WithPayloadSelector { + oneof selector_options { + bool enable = 1; // If `true` - return all payload, if `false` - none + PayloadIncludeSelector include = 2; + PayloadExcludeSelector exclude = 3; + } +} + +message NamedVectors { + map vectors = 1; +} + +message NamedVectorsOutput { + map vectors = 1; +} + +message Vectors { + oneof vectors_options { + Vector vector = 1; + NamedVectors vectors = 2; + } +} + +message VectorsOutput { + oneof vectors_options { + VectorOutput vector = 1; + NamedVectorsOutput vectors = 2; + } +} + +message VectorsSelector { + repeated string names = 1; // List of vectors to include into result +} + +message WithVectorsSelector { + oneof selector_options { + bool enable = 1; // If `true` - return all vectors, if `false` - none + VectorsSelector include = 2; // List of payload keys to include into result + } +} + +message QuantizationSearchParams { + /* + If set to true, search will ignore quantized vector data + */ + optional bool ignore = 1; + + /* + If true, use original vectors to re-score top-k results. If ignored, qdrant decides automatically does rescore enabled or not. + */ + optional bool rescore = 2; + + /* + Oversampling factor for quantization. + + Defines how many extra vectors should be pre-selected using quantized index, + and then re-scored using original vectors. + + For example, if `oversampling` is 2.4 and `limit` is 100, then 240 vectors will be pre-selected using quantized index, + and then top-100 will be returned after re-scoring. + */ + optional double oversampling = 3; +} + +message SearchParams { + /* + Params relevant to HNSW index. Size of the beam in a beam-search. + Larger the value - more accurate the result, more time required for search. + */ + optional uint64 hnsw_ef = 1; + + /* + Search without approximation. If set to true, search may run long but with exact results. + */ + optional bool exact = 2; + + /* + If set to true, search will ignore quantized vector data + */ + optional QuantizationSearchParams quantization = 3; + /* + If enabled, the engine will only perform search among indexed or small segments. + Using this option prevents slow searches in case of delayed index, but does not + guarantee that all uploaded vectors will be included in search results + */ + optional bool indexed_only = 4; +} + +message SearchPoints { + string collection_name = 1; // name of the collection + repeated float vector = 2; // vector + Filter filter = 3; // Filter conditions - return only those points that satisfy the specified conditions + uint64 limit = 4; // Max number of result + reserved 5; // deprecated "with_vector" field + WithPayloadSelector with_payload = 6; // Options for specifying which payload to include or not + SearchParams params = 7; // Search config + optional float score_threshold = 8; // If provided - cut off results with worse scores + optional uint64 offset = 9; // Offset of the result + optional string vector_name = 10; // Which vector to use for search, if not specified - use default vector + optional WithVectorsSelector with_vectors = 11; // Options for specifying which vectors to include into response + optional ReadConsistency read_consistency = 12; // Options for specifying read consistency guarantees + optional uint64 timeout = 13; // If set, overrides global timeout setting for this request. Unit is seconds. + optional ShardKeySelector shard_key_selector = 14; // Specify in which shards to look for the points, if not specified - look in all shards + optional SparseIndices sparse_indices = 15; +} + +message SearchBatchPoints { + string collection_name = 1; // Name of the collection + repeated SearchPoints search_points = 2; + optional ReadConsistency read_consistency = 3; // Options for specifying read consistency guarantees + optional uint64 timeout = 4; // If set, overrides global timeout setting for this request. Unit is seconds. +} + +message WithLookup { + string collection = 1; // Name of the collection to use for points lookup + optional WithPayloadSelector with_payload = 2; // Options for specifying which payload to include (or not) + optional WithVectorsSelector with_vectors = 3; // Options for specifying which vectors to include (or not) +} + + +message SearchPointGroups { + string collection_name = 1; // Name of the collection + repeated float vector = 2; // Vector to compare against + Filter filter = 3; // Filter conditions - return only those points that satisfy the specified conditions + uint32 limit = 4; // Max number of result + WithPayloadSelector with_payload = 5; // Options for specifying which payload to include or not + SearchParams params = 6; // Search config + optional float score_threshold = 7; // If provided - cut off results with worse scores + optional string vector_name = 8; // Which vector to use for search, if not specified - use default vector + optional WithVectorsSelector with_vectors = 9; // Options for specifying which vectors to include into response + string group_by = 10; // Payload field to group by, must be a string or number field. If there are multiple values for the field, all of them will be used. One point can be in multiple groups. + uint32 group_size = 11; // Maximum amount of points to return per group + optional ReadConsistency read_consistency = 12; // Options for specifying read consistency guarantees + optional WithLookup with_lookup = 13; // Options for specifying how to use the group id to lookup points in another collection + optional uint64 timeout = 14; // If set, overrides global timeout setting for this request. Unit is seconds. + optional ShardKeySelector shard_key_selector = 15; // Specify in which shards to look for the points, if not specified - look in all shards + optional SparseIndices sparse_indices = 16; +} + +enum Direction { + Asc = 0; + Desc = 1; +} + +message StartFrom { + oneof value { + double float = 1; + int64 integer = 2; + google.protobuf.Timestamp timestamp = 3; + string datetime = 4; + } +} + +message OrderBy { + string key = 1; // Payload key to order by + optional Direction direction = 2; // Ascending or descending order + optional StartFrom start_from = 3; // Start from this value +} + +message ScrollPoints { + string collection_name = 1; + Filter filter = 2; // Filter conditions - return only those points that satisfy the specified conditions + optional PointId offset = 3; // Start with this ID + optional uint32 limit = 4; // Max number of result + reserved 5; // deprecated "with_vector" field + WithPayloadSelector with_payload = 6; // Options for specifying which payload to include or not + optional WithVectorsSelector with_vectors = 7; // Options for specifying which vectors to include into response + optional ReadConsistency read_consistency = 8; // Options for specifying read consistency guarantees + optional ShardKeySelector shard_key_selector = 9; // Specify in which shards to look for the points, if not specified - look in all shards + optional OrderBy order_by = 10; // Order the records by a payload field + optional uint64 timeout = 11; // If set, overrides global timeout setting for this request. Unit is seconds. +} + +// How to use positive and negative vectors to find the results, default is `AverageVector`. +enum RecommendStrategy { + // Average positive and negative vectors and create a single query with the formula + // `query = avg_pos + avg_pos - avg_neg`. Then performs normal search. + AverageVector = 0; + + // Uses custom search objective. Each candidate is compared against all + // examples, its score is then chosen from the `max(max_pos_score, max_neg_score)`. + // If the `max_neg_score` is chosen then it is squared and negated. + BestScore = 1; + + // Uses custom search objective. Compares against all inputs, sums all the scores. + // Scores against positive vectors are added, against negatives are subtracted. + SumScores = 2; +} + +message LookupLocation { + string collection_name = 1; + optional string vector_name = 2; // Which vector to use for search, if not specified - use default vector + optional ShardKeySelector shard_key_selector = 3; // Specify in which shards to look for the points, if not specified - look in all shards +} + +message RecommendPoints { + string collection_name = 1; // name of the collection + repeated PointId positive = 2; // Look for vectors closest to the vectors from these points + repeated PointId negative = 3; // Try to avoid vectors like the vector from these points + Filter filter = 4; // Filter conditions - return only those points that satisfy the specified conditions + uint64 limit = 5; // Max number of result + reserved 6; // deprecated "with_vector" field + WithPayloadSelector with_payload = 7; // Options for specifying which payload to include or not + SearchParams params = 8; // Search config + optional float score_threshold = 9; // If provided - cut off results with worse scores + optional uint64 offset = 10; // Offset of the result + optional string using = 11; // Define which vector to use for recommendation, if not specified - default vector + optional WithVectorsSelector with_vectors = 12; // Options for specifying which vectors to include into response + optional LookupLocation lookup_from = 13; // Name of the collection to use for points lookup, if not specified - use current collection + optional ReadConsistency read_consistency = 14; // Options for specifying read consistency guarantees + optional RecommendStrategy strategy = 16; // How to use the example vectors to find the results + repeated Vector positive_vectors = 17; // Look for vectors closest to those + repeated Vector negative_vectors = 18; // Try to avoid vectors like this + optional uint64 timeout = 19; // If set, overrides global timeout setting for this request. Unit is seconds. + optional ShardKeySelector shard_key_selector = 20; // Specify in which shards to look for the points, if not specified - look in all shards +} + +message RecommendBatchPoints { + string collection_name = 1; // Name of the collection + repeated RecommendPoints recommend_points = 2; + optional ReadConsistency read_consistency = 3; // Options for specifying read consistency guarantees + optional uint64 timeout = 4; // If set, overrides global timeout setting for this request. Unit is seconds. +} + +message RecommendPointGroups { + string collection_name = 1; // Name of the collection + repeated PointId positive = 2; // Look for vectors closest to the vectors from these points + repeated PointId negative = 3; // Try to avoid vectors like the vector from these points + Filter filter = 4; // Filter conditions - return only those points that satisfy the specified conditions + uint32 limit = 5; // Max number of groups in result + WithPayloadSelector with_payload = 6; // Options for specifying which payload to include or not + SearchParams params = 7; // Search config + optional float score_threshold = 8; // If provided - cut off results with worse scores + optional string using = 9; // Define which vector to use for recommendation, if not specified - default vector + optional WithVectorsSelector with_vectors = 10; // Options for specifying which vectors to include into response + optional LookupLocation lookup_from = 11; // Name of the collection to use for points lookup, if not specified - use current collection + string group_by = 12; // Payload field to group by, must be a string or number field. If there are multiple values for the field, all of them will be used. One point can be in multiple groups. + uint32 group_size = 13; // Maximum amount of points to return per group + optional ReadConsistency read_consistency = 14; // Options for specifying read consistency guarantees + optional WithLookup with_lookup = 15; // Options for specifying how to use the group id to lookup points in another collection + optional RecommendStrategy strategy = 17; // How to use the example vectors to find the results + repeated Vector positive_vectors = 18; // Look for vectors closest to those + repeated Vector negative_vectors = 19; // Try to avoid vectors like this + optional uint64 timeout = 20; // If set, overrides global timeout setting for this request. Unit is seconds. + optional ShardKeySelector shard_key_selector = 21; // Specify in which shards to look for the points, if not specified - look in all shards +} + +message TargetVector { + oneof target { + VectorExample single = 1; + + // leaving extensibility for possibly adding multi-target + } +} + +message VectorExample { + oneof example { + PointId id = 1; + Vector vector = 2; + } +} + +message ContextExamplePair { + VectorExample positive = 1; + VectorExample negative = 2; +} + +message DiscoverPoints { + string collection_name = 1; // name of the collection + TargetVector target = 2; // Use this as the primary search objective + repeated ContextExamplePair context = 3; // Search will be constrained by these pairs of examples + Filter filter = 4; // Filter conditions - return only those points that satisfy the specified conditions + uint64 limit = 5; // Max number of result + WithPayloadSelector with_payload = 6; // Options for specifying which payload to include or not + SearchParams params = 7; // Search config + optional uint64 offset = 8; // Offset of the result + optional string using = 9; // Define which vector to use for recommendation, if not specified - default vector + optional WithVectorsSelector with_vectors = 10; // Options for specifying which vectors to include into response + optional LookupLocation lookup_from = 11; // Name of the collection to use for points lookup, if not specified - use current collection + optional ReadConsistency read_consistency = 12; // Options for specifying read consistency guarantees + optional uint64 timeout = 13; // If set, overrides global timeout setting for this request. Unit is seconds. + optional ShardKeySelector shard_key_selector = 14; // Specify in which shards to look for the points, if not specified - look in all shards +} + +message DiscoverBatchPoints { + string collection_name = 1; // Name of the collection + repeated DiscoverPoints discover_points = 2; + optional ReadConsistency read_consistency = 3; // Options for specifying read consistency guarantees + optional uint64 timeout = 4; // If set, overrides global timeout setting for this request. Unit is seconds. +} + +message CountPoints { + string collection_name = 1; // Name of the collection + Filter filter = 2; // Filter conditions - return only those points that satisfy the specified conditions + optional bool exact = 3; // If `true` - return exact count, if `false` - return approximate count + optional ReadConsistency read_consistency = 4; // Options for specifying read consistency guarantees + optional ShardKeySelector shard_key_selector = 5; // Specify in which shards to look for the points, if not specified - look in all shards + optional uint64 timeout = 6; // If set, overrides global timeout setting for this request. Unit is seconds. +} + +message RecommendInput { + repeated VectorInput positive = 1; // Look for vectors closest to the vectors from these points + repeated VectorInput negative = 2; // Try to avoid vectors like the vector from these points + optional RecommendStrategy strategy = 3; // How to use the provided vectors to find the results +} + +message ContextInputPair { + VectorInput positive = 1; // A positive vector + VectorInput negative = 2; // Repel from this vector +} + +message DiscoverInput { + VectorInput target = 1; // Use this as the primary search objective + ContextInput context = 2; // Search space will be constrained by these pairs of vectors +} + +message ContextInput { + repeated ContextInputPair pairs = 1; // Search space will be constrained by these pairs of vectors +} + +enum Fusion { + RRF = 0; // Reciprocal Rank Fusion + DBSF = 1; // Distribution-Based Score Fusion +} + +// Sample points from the collection +// +// Available sampling methods: +// +// * `random` - Random sampling +enum Sample { + Random = 0; +} + +message Formula { + Expression expression = 1; + map defaults = 2; +} + +message Expression { + oneof variant { + float constant = 1; + string variable = 2; // Payload key or reference to score. + Condition condition = 3; // Payload condition. If true, becomes 1.0; otherwise 0.0 + GeoDistance geo_distance = 4; // Geographic distance in meters + string datetime = 5; // Date-time constant + string datetime_key = 6; // Payload key with date-time values + MultExpression mult = 7; // Multiply + SumExpression sum = 8; // Sum + DivExpression div = 9; // Divide + Expression neg = 10; // Negate + Expression abs = 11; // Absolute value + Expression sqrt = 12; // Square root + PowExpression pow = 13; // Power + Expression exp = 14; // Exponential + Expression log10 = 15; // Logarithm + Expression ln = 16; // Natural logarithm + DecayParamsExpression exp_decay = 17; // Exponential decay + DecayParamsExpression gauss_decay = 18; // Gaussian decay + DecayParamsExpression lin_decay = 19; // Linear decay + } +} + +message GeoDistance { + GeoPoint origin = 1; + string to = 2; +} + +message MultExpression { + repeated Expression mult = 1; +} + +message SumExpression { + repeated Expression sum = 1; +} + +message DivExpression { + Expression left = 1; + Expression right = 2; + optional float by_zero_default = 3; +} + +message PowExpression { + Expression base = 1; + Expression exponent = 2; +} + +message DecayParamsExpression { + // The variable to decay + Expression x = 1; + // The target value to start decaying from. Defaults to 0. + optional Expression target = 2; + // The scale factor of the decay, in terms of `x`. Defaults to 1.0. Must be a non-zero positive number. + optional float scale = 3; + // The midpoint of the decay. Defaults to 0.5. Output will be this value when `|x - target| == scale`. + optional float midpoint = 4; +} + +message NearestInputWithMmr { + // The vector to search for nearest neighbors. + VectorInput nearest = 1; + + // Perform MMR (Maximal Marginal Relevance) reranking after search, + // using the same vector in this query to calculate relevance. + Mmr mmr = 2; +} + +// Maximal Marginal Relevance (MMR) algorithm for re-ranking the points. +message Mmr { + // Tunable parameter for the MMR algorithm. + // Determines the balance between diversity and relevance. + // + // A higher value favors diversity (dissimilarity to selected results), + // while a lower value favors relevance (similarity to the query vector). + // + // Must be in the range [0, 1]. + // Default value is 0.5. + optional float diversity = 2; + + // The maximum number of candidates to consider for re-ranking. + // + // If not specified, the `limit` value is used. + optional uint32 candidates_limit = 3; +} + +message Query { + oneof variant { + VectorInput nearest = 1; // Find the nearest neighbors to this vector. + RecommendInput recommend = 2; // Use multiple positive and negative vectors to find the results. + DiscoverInput discover = 3; // Search for nearest points, but constrain the search space with context + ContextInput context = 4; // Return points that live in positive areas. + OrderBy order_by = 5; // Order the points by a payload field. + Fusion fusion = 6; // Fuse the results of multiple prefetches. + Sample sample = 7; // Sample points from the collection. + Formula formula = 8; // Score boosting via an arbitrary formula + NearestInputWithMmr nearest_with_mmr = 9; // Search nearest neighbors, but re-rank based on the Maximal Marginal Relevance algorithm. + } +} + +message PrefetchQuery { + repeated PrefetchQuery prefetch = 1; // Sub-requests to perform first. If present, the query will be performed on the results of the prefetches. + optional Query query = 2; // Query to perform. If missing, returns points ordered by their IDs. + optional string using = 3; // Define which vector to use for querying. If missing, the default vector is is used. + optional Filter filter = 4; // Filter conditions - return only those points that satisfy the specified conditions. + optional SearchParams params = 5; // Search params for when there is no prefetch. + optional float score_threshold = 6; // Return points with scores better than this threshold. + optional uint64 limit = 7; // Max number of points. Default is 10 + optional LookupLocation lookup_from = 8; // The location to use for IDs lookup, if not specified - use the current collection and the 'using' vector +} + +message QueryPoints { + string collection_name = 1; // Name of the collection + repeated PrefetchQuery prefetch = 2; // Sub-requests to perform first. If present, the query will be performed on the results of the prefetches. + optional Query query = 3; // Query to perform. If missing, returns points ordered by their IDs. + optional string using = 4; // Define which vector to use for querying. If missing, the default vector is used. + optional Filter filter = 5; // Filter conditions - return only those points that satisfy the specified conditions. + optional SearchParams params = 6; // Search params for when there is no prefetch. + optional float score_threshold = 7; // Return points with scores better than this threshold. + optional uint64 limit = 8; // Max number of points. Default is 10. + optional uint64 offset = 9; // Offset of the result. Skip this many points. Default is 0. + optional WithVectorsSelector with_vectors = 10; // Options for specifying which vectors to include into the response. + optional WithPayloadSelector with_payload = 11; // Options for specifying which payload to include or not. + optional ReadConsistency read_consistency = 12; // Options for specifying read consistency guarantees. + optional ShardKeySelector shard_key_selector = 13; // Specify in which shards to look for the points, if not specified - look in all shards. + optional LookupLocation lookup_from = 14; // The location to use for IDs lookup, if not specified - use the current collection and the 'using' vector + optional uint64 timeout = 15; // If set, overrides global timeout setting for this request. Unit is seconds. +} + +message QueryBatchPoints { + string collection_name = 1; + repeated QueryPoints query_points = 2; + optional ReadConsistency read_consistency = 3; // Options for specifying read consistency guarantees + optional uint64 timeout = 4; // If set, overrides global timeout setting for this request. Unit is seconds. +} + +message QueryPointGroups { + string collection_name = 1; // Name of the collection + repeated PrefetchQuery prefetch = 2; // Sub-requests to perform first. If present, the query will be performed on the results of the prefetches. + optional Query query = 3; // Query to perform. If missing, returns points ordered by their IDs. + optional string using = 4; // Define which vector to use for querying. If missing, the default vector is used. + optional Filter filter = 5; // Filter conditions - return only those points that satisfy the specified conditions. + optional SearchParams params = 6; // Search params for when there is no prefetch. + optional float score_threshold = 7; // Return points with scores better than this threshold. + WithPayloadSelector with_payload = 8; // Options for specifying which payload to include or not + optional WithVectorsSelector with_vectors = 9; // Options for specifying which vectors to include into response + optional LookupLocation lookup_from = 10; // The location to use for IDs lookup, if not specified - use the current collection and the 'using' vector + optional uint64 limit = 11; // Max number of points. Default is 3. + optional uint64 group_size = 12; // Maximum amount of points to return per group. Default to 10. + string group_by = 13; // Payload field to group by, must be a string or number field. If there are multiple values for the field, all of them will be used. One point can be in multiple groups. + optional ReadConsistency read_consistency = 14; // Options for specifying read consistency guarantees + optional WithLookup with_lookup = 15; // Options for specifying how to use the group id to lookup points in another collection + optional uint64 timeout = 16; // If set, overrides global timeout setting for this request. Unit is seconds. + optional ShardKeySelector shard_key_selector = 17; // Specify in which shards to look for the points, if not specified - look in all shards +} + +message FacetCounts { + string collection_name = 1; // Name of the collection + string key = 2; // Payload key of the facet + optional Filter filter = 3; // Filter conditions - return only those points that satisfy the specified conditions. + optional uint64 limit = 4; // Max number of facets. Default is 10. + optional bool exact = 5; // If true, return exact counts, slower but useful for debugging purposes. Default is false. + optional uint64 timeout = 6; // If set, overrides global timeout setting for this request. Unit is seconds. + optional ReadConsistency read_consistency = 7; // Options for specifying read consistency guarantees + optional ShardKeySelector shard_key_selector = 8; // Specify in which shards to look for the points, if not specified - look in all shards +} + +message FacetValue { + oneof variant { + string string_value = 1; // String value from the facet + int64 integer_value = 2; // Integer value from the facet + bool bool_value = 3; // Boolean value from the facet + } +} + +message FacetHit { + FacetValue value = 1; // Value from the facet + uint64 count = 2; // Number of points with this value +} + +message SearchMatrixPoints { + string collection_name = 1; // Name of the collection + optional Filter filter = 2; // Filter conditions - return only those points that satisfy the specified conditions. + optional uint64 sample = 3; // How many points to select and search within. Default is 10. + optional uint64 limit = 4; // How many neighbours per sample to find. Default is 3. + optional string using = 5; // Define which vector to use for querying. If missing, the default vector is is used. + optional uint64 timeout = 6; // If set, overrides global timeout setting for this request. Unit is seconds. + optional ReadConsistency read_consistency = 7; // Options for specifying read consistency guarantees + optional ShardKeySelector shard_key_selector = 8; // Specify in which shards to look for the points, if not specified - look in all shards +} + +message SearchMatrixPairs { + repeated SearchMatrixPair pairs = 1; // List of pairs of points with scores +} + +message SearchMatrixPair { + PointId a = 1; // first id of the pair + PointId b = 2; // second id of the pair + float score = 3; // score of the pair +} + +message SearchMatrixOffsets { + repeated uint64 offsets_row = 1; // Row indices of the matrix + repeated uint64 offsets_col = 2; // Column indices of the matrix + repeated float scores = 3; // Scores associated with matrix coordinates + repeated PointId ids = 4; // Ids of the points in order +} + + +message PointsUpdateOperation { + message PointStructList { + repeated PointStruct points = 1; + optional ShardKeySelector shard_key_selector = 2; // Option for custom sharding to specify used shard keys + } + message SetPayload { + map payload = 1; + optional PointsSelector points_selector = 2; // Affected points + optional ShardKeySelector shard_key_selector = 3; // Option for custom sharding to specify used shard keys + optional string key = 4; // Option for indicate property of payload + } + message OverwritePayload { + map payload = 1; + optional PointsSelector points_selector = 2; // Affected points + optional ShardKeySelector shard_key_selector = 3; // Option for custom sharding to specify used shard keys + optional string key = 4; // Option for indicate property of payload + } + message DeletePayload { + repeated string keys = 1; + optional PointsSelector points_selector = 2; // Affected points + optional ShardKeySelector shard_key_selector = 3; // Option for custom sharding to specify used shard keys + } + message UpdateVectors { + repeated PointVectors points = 1; // List of points and vectors to update + optional ShardKeySelector shard_key_selector = 2; // Option for custom sharding to specify used shard keys + } + message DeleteVectors { + PointsSelector points_selector = 1; // Affected points + VectorsSelector vectors = 2; // List of vector names to delete + optional ShardKeySelector shard_key_selector = 3; // Option for custom sharding to specify used shard keys + } + message DeletePoints { + PointsSelector points = 1; // Affected points + optional ShardKeySelector shard_key_selector = 2; // Option for custom sharding to specify used shard keys + } + message ClearPayload { + PointsSelector points = 1; // Affected points + optional ShardKeySelector shard_key_selector = 2; // Option for custom sharding to specify used shard keys + } + + oneof operation { + PointStructList upsert = 1; + PointsSelector delete_deprecated = 2 [deprecated=true]; + SetPayload set_payload = 3; + OverwritePayload overwrite_payload = 4; + DeletePayload delete_payload = 5; + PointsSelector clear_payload_deprecated = 6 [deprecated=true]; + UpdateVectors update_vectors = 7; + DeleteVectors delete_vectors = 8; + DeletePoints delete_points = 9; + ClearPayload clear_payload = 10; + } +} + +message UpdateBatchPoints { + string collection_name = 1; // name of the collection + optional bool wait = 2; // Wait until the changes have been applied? + repeated PointsUpdateOperation operations = 3; + optional WriteOrdering ordering = 4; // Write ordering guarantees +} + +// --------------------------------------------- +// ---------------- RPC Response --------------- +// --------------------------------------------- + +message PointsOperationResponse { + UpdateResult result = 1; + double time = 2; // Time spent to process + optional Usage usage = 3; +} + +message UpdateResult { + optional uint64 operation_id = 1; // Number of operation + UpdateStatus status = 2; // Operation status +} + +enum UpdateStatus { + UnknownUpdateStatus = 0; + Acknowledged = 1; // Update is received, but not processed yet + Completed = 2; // Update is applied and ready for search + ClockRejected = 3; // Internal: update is rejected due to an outdated clock +} + +message OrderValue { + oneof variant { + int64 int = 1; + double float = 2; + } +} + +message ScoredPoint { + PointId id = 1; // Point id + map payload = 2; // Payload + float score = 3; // Similarity score + reserved 4; // deprecated "vector" field + uint64 version = 5; // Last update operation applied to this point + optional VectorsOutput vectors = 6; // Vectors to search + optional ShardKey shard_key = 7; // Shard key + optional OrderValue order_value = 8; // Order by value +} + +message GroupId { + oneof kind { + // Represents a double value. + uint64 unsigned_value = 1; + // Represents an integer value + int64 integer_value = 2; + // Represents a string value. + string string_value = 3; + } +} + +message PointGroup { + GroupId id = 1; // Group id + repeated ScoredPoint hits = 2; // Points in the group + RetrievedPoint lookup = 3; // Point(s) from the lookup collection that matches the group id +} + +message GroupsResult { + repeated PointGroup groups = 1; // Groups +} + +message SearchResponse { + repeated ScoredPoint result = 1; + double time = 2; // Time spent to process + optional Usage usage = 3; +} + +message QueryResponse { + repeated ScoredPoint result = 1; + double time = 2; // Time spent to process + optional Usage usage = 3; +} + +message QueryBatchResponse { + repeated BatchResult result = 1; + double time = 2; // Time spent to process + optional Usage usage = 3; +} + +message QueryGroupsResponse { + GroupsResult result = 1; + double time = 2; // Time spent to process + optional Usage usage = 3; +} + +message BatchResult { + repeated ScoredPoint result = 1; +} + +message SearchBatchResponse { + repeated BatchResult result = 1; + double time = 2; // Time spent to process + optional Usage usage = 3; +} + +message SearchGroupsResponse { + GroupsResult result = 1; + double time = 2; // Time spent to process + optional Usage usage = 3; +} + +message CountResponse { + CountResult result = 1; + double time = 2; // Time spent to process + optional Usage usage = 3; +} + +message ScrollResponse { + optional PointId next_page_offset = 1; // Use this offset for the next query + repeated RetrievedPoint result = 2; + double time = 3; // Time spent to process + optional Usage usage = 4; +} + +message CountResult { + uint64 count = 1; +} + +message RetrievedPoint { + PointId id = 1; + map payload = 2; + reserved 3; // deprecated "vector" field + optional VectorsOutput vectors = 4; + optional ShardKey shard_key = 5; // Shard key + optional OrderValue order_value = 6; // Order-by value +} + +message GetResponse { + repeated RetrievedPoint result = 1; + double time = 2; // Time spent to process + optional Usage usage = 3; +} + +message RecommendResponse { + repeated ScoredPoint result = 1; + double time = 2; // Time spent to process + optional Usage usage = 3; +} + +message RecommendBatchResponse { + repeated BatchResult result = 1; + double time = 2; // Time spent to process + optional Usage usage = 3; +} + +message DiscoverResponse { + repeated ScoredPoint result = 1; + double time = 2; // Time spent to process + optional Usage usage = 3; +} + +message DiscoverBatchResponse { + repeated BatchResult result = 1; + double time = 2; // Time spent to process + optional Usage usage = 3; +} + +message RecommendGroupsResponse { + GroupsResult result = 1; + double time = 2; // Time spent to process + optional Usage usage = 3; +} + +message UpdateBatchResponse { + repeated UpdateResult result = 1; + double time = 2; // Time spent to process + optional Usage usage = 3; +} + +message FacetResponse { + repeated FacetHit hits = 1; + double time = 2; // Time spent to process +} + +message SearchMatrixPairsResponse { + SearchMatrixPairs result = 1; + double time = 2; // Time spent to process + optional Usage usage = 3; +} + +message SearchMatrixOffsetsResponse { + SearchMatrixOffsets result = 1; + double time = 2; // Time spent to process + optional Usage usage = 3; +} + +// --------------------------------------------- +// ------------- Filter Conditions ------------- +// --------------------------------------------- + +message Filter { + repeated Condition should = 1; // At least one of those conditions should match + repeated Condition must = 2; // All conditions must match + repeated Condition must_not = 3; // All conditions must NOT match + optional MinShould min_should = 4; // At least minimum amount of given conditions should match +} + +message MinShould { + repeated Condition conditions = 1; + uint64 min_count = 2; +} + +message Condition { + oneof condition_one_of { + FieldCondition field = 1; + IsEmptyCondition is_empty = 2; + HasIdCondition has_id = 3; + Filter filter = 4; + IsNullCondition is_null = 5; + NestedCondition nested = 6; + HasVectorCondition has_vector = 7; + } +} + +message IsEmptyCondition { + string key = 1; +} + +message IsNullCondition { + string key = 1; +} + +message HasIdCondition { + repeated PointId has_id = 1; +} + +message HasVectorCondition { + string has_vector = 1; +} + +message NestedCondition { + string key = 1; // Path to nested object + Filter filter = 2; // Filter condition +} + +message FieldCondition { + string key = 1; + Match match = 2; // Check if point has field with a given value + Range range = 3; // Check if points value lies in a given range + GeoBoundingBox geo_bounding_box = 4; // Check if points geolocation lies in a given area + GeoRadius geo_radius = 5; // Check if geo point is within a given radius + ValuesCount values_count = 6; // Check number of values for a specific field + GeoPolygon geo_polygon = 7; // Check if geo point is within a given polygon + DatetimeRange datetime_range = 8; // Check if datetime is within a given range + optional bool is_empty = 9; // Check if field is empty + optional bool is_null = 10; // Check if field is null +} + +message Match { + oneof match_value { + string keyword = 1; // Match string keyword + int64 integer = 2; // Match integer + bool boolean = 3; // Match boolean + string text = 4; // Match text + RepeatedStrings keywords = 5; // Match multiple keywords + RepeatedIntegers integers = 6; // Match multiple integers + RepeatedIntegers except_integers = 7; // Match any other value except those integers + RepeatedStrings except_keywords = 8; // Match any other value except those keywords + string phrase = 9; // Match phrase text + } +} + +message RepeatedStrings { + repeated string strings = 1; +} + +message RepeatedIntegers { + repeated int64 integers = 1; +} + +message Range { + optional double lt = 1; + optional double gt = 2; + optional double gte = 3; + optional double lte = 4; +} + +message DatetimeRange { + optional google.protobuf.Timestamp lt = 1; + optional google.protobuf.Timestamp gt = 2; + optional google.protobuf.Timestamp gte = 3; + optional google.protobuf.Timestamp lte = 4; +} + +message GeoBoundingBox { + GeoPoint top_left = 1; // north-west corner + GeoPoint bottom_right = 2; // south-east corner +} + +message GeoRadius { + GeoPoint center = 1; // Center of the circle + float radius = 2; // In meters +} + +message GeoLineString { + repeated GeoPoint points = 1; // Ordered sequence of GeoPoints representing the line +} + +// For a valid GeoPolygon, both the exterior and interior GeoLineStrings must consist of a minimum of 4 points. +// Additionally, the first and last points of each GeoLineString must be the same. +message GeoPolygon { + GeoLineString exterior = 1; // The exterior line bounds the surface + repeated GeoLineString interiors = 2; // Interior lines (if present) bound holes within the surface +} + +message ValuesCount { + optional uint64 lt = 1; + optional uint64 gt = 2; + optional uint64 gte = 3; + optional uint64 lte = 4; +} + +// --------------------------------------------- +// -------------- Points Selector -------------- +// --------------------------------------------- + +message PointsSelector { + oneof points_selector_one_of { + PointsIdsList points = 1; + Filter filter = 2; + } +} + +message PointsIdsList { + repeated PointId ids = 1; +} + +// --------------------------------------------- +// ------------------- Point ------------------- +// --------------------------------------------- + + +message PointStruct { + PointId id = 1; + reserved 2; // deprecated "vector" field + map payload = 3; + optional Vectors vectors = 4; +} + + +message GeoPoint { + double lon = 1; + double lat = 2; +} + +// --------------------------------------------- +// ----------- Measurements collector ---------- +// --------------------------------------------- +message Usage { + optional HardwareUsage hardware = 1; + optional InferenceUsage inference = 2; +} + + +// --------------------------------------------- +// ------------ Inference measurements ---------- +// --------------------------------------------- + +message InferenceUsage { + map models = 1; +} + +message ModelUsage { + uint64 tokens = 1; +} + +// --------------------------------------------- +// ------------ Hardware measurements ---------- +// --------------------------------------------- + +message HardwareUsage { + uint64 cpu = 1; + uint64 payload_io_read = 2; + uint64 payload_io_write = 3; + uint64 payload_index_io_read = 4; + uint64 payload_index_io_write = 5; + uint64 vector_io_read = 6; + uint64 vector_io_write = 7; +} diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/proto/points_service.proto b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/proto/points_service.proto new file mode 100644 index 0000000000000000000000000000000000000000..ef830078e68ef4e33837e0da4944859c37cfc633 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/proto/points_service.proto @@ -0,0 +1,136 @@ +syntax = "proto3"; + +import "points.proto"; + +package qdrant; +option csharp_namespace = "Qdrant.Client.Grpc"; + +service Points { + /* + Perform insert + updates on points. If a point with a given ID already exists - it will be overwritten. + */ + rpc Upsert (UpsertPoints) returns (PointsOperationResponse) {} + /* + Delete points + */ + rpc Delete (DeletePoints) returns (PointsOperationResponse) {} + /* + Retrieve points + */ + rpc Get (GetPoints) returns (GetResponse) {} + /* + Update named vectors for point + */ + rpc UpdateVectors (UpdatePointVectors) returns (PointsOperationResponse) {} + /* + Delete named vectors for points + */ + rpc DeleteVectors (DeletePointVectors) returns (PointsOperationResponse) {} + /* + Set payload for points + */ + rpc SetPayload (SetPayloadPoints) returns (PointsOperationResponse) {} + /* + Overwrite payload for points + */ + rpc OverwritePayload (SetPayloadPoints) returns (PointsOperationResponse) {} + /* + Delete specified key payload for points + */ + rpc DeletePayload (DeletePayloadPoints) returns (PointsOperationResponse) {} + /* + Remove all payload for specified points + */ + rpc ClearPayload (ClearPayloadPoints) returns (PointsOperationResponse) {} + /* + Create index for field in collection + */ + rpc CreateFieldIndex (CreateFieldIndexCollection) returns (PointsOperationResponse) {} + /* + Delete field index for collection + */ + rpc DeleteFieldIndex (DeleteFieldIndexCollection) returns (PointsOperationResponse) {} + /* + Retrieve closest points based on vector similarity and given filtering conditions + */ + rpc Search (SearchPoints) returns (SearchResponse) {} + /* + Retrieve closest points based on vector similarity and given filtering conditions + */ + rpc SearchBatch (SearchBatchPoints) returns (SearchBatchResponse) {} + /* + Retrieve closest points based on vector similarity and given filtering conditions, grouped by a given field + */ + rpc SearchGroups (SearchPointGroups) returns (SearchGroupsResponse) {} + /* + Iterate over all or filtered points + */ + rpc Scroll (ScrollPoints) returns (ScrollResponse) {} + /* + Look for the points which are closer to stored positive examples and at the same time further to negative examples. + */ + rpc Recommend (RecommendPoints) returns (RecommendResponse) {} + /* + Look for the points which are closer to stored positive examples and at the same time further to negative examples. + */ + rpc RecommendBatch (RecommendBatchPoints) returns (RecommendBatchResponse) {} + /* + Look for the points which are closer to stored positive examples and at the same time further to negative examples, grouped by a given field + */ + rpc RecommendGroups (RecommendPointGroups) returns (RecommendGroupsResponse) {} + /* + Use context and a target to find the most similar points to the target, constrained by the context. + + When using only the context (without a target), a special search - called context search - is performed where + pairs of points are used to generate a loss that guides the search towards the zone where + most positive examples overlap. This means that the score minimizes the scenario of + finding a point closer to a negative than to a positive part of a pair. + + Since the score of a context relates to loss, the maximum score a point can get is 0.0, + and it becomes normal that many points can have a score of 0.0. + + When using target (with or without context), the score behaves a little different: The + integer part of the score represents the rank with respect to the context, while the + decimal part of the score relates to the distance to the target. The context part of the score for + each pair is calculated +1 if the point is closer to a positive than to a negative part of a pair, + and -1 otherwise. + */ + rpc Discover (DiscoverPoints) returns (DiscoverResponse) {} + /* + Batch request points based on { positive, negative } pairs of examples, and/or a target + */ + rpc DiscoverBatch (DiscoverBatchPoints) returns (DiscoverBatchResponse) {} + /* + Count points in collection with given filtering conditions + */ + rpc Count (CountPoints) returns (CountResponse) {} + + /* + Perform multiple update operations in one request + */ + rpc UpdateBatch (UpdateBatchPoints) returns (UpdateBatchResponse) {} + /* + Universally query points. This endpoint covers all capabilities of search, recommend, discover, filters. But also enables hybrid and multi-stage queries. + */ + rpc Query (QueryPoints) returns (QueryResponse) {} + /* + Universally query points in a batch fashion. This endpoint covers all capabilities of search, recommend, discover, filters. But also enables hybrid and multi-stage queries. + */ + rpc QueryBatch (QueryBatchPoints) returns (QueryBatchResponse) {} + /* + Universally query points in a group fashion. This endpoint covers all capabilities of search, recommend, discover, filters. But also enables hybrid and multi-stage queries. + */ + rpc QueryGroups (QueryPointGroups) returns (QueryGroupsResponse) {} + /* + Perform facet counts. For each value in the field, count the number of points that have this value and match the conditions. + */ + rpc Facet (FacetCounts) returns (FacetResponse) {} + /* + Compute distance matrix for sampled points with a pair based output format + */ + rpc SearchMatrixPairs (SearchMatrixPoints) returns (SearchMatrixPairsResponse) {} + /* + Compute distance matrix for sampled points with an offset based output format + */ + rpc SearchMatrixOffsets (SearchMatrixPoints) returns (SearchMatrixOffsetsResponse) {} +} diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/proto/qdrant.proto b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/proto/qdrant.proto new file mode 100644 index 0000000000000000000000000000000000000000..723bb659057708785cd2365240f2c03fbf570b8a --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/proto/qdrant.proto @@ -0,0 +1,20 @@ +syntax = "proto3"; + +import "collections_service.proto"; +import "points_service.proto"; +import "snapshots_service.proto"; + +package qdrant; +option csharp_namespace = "Qdrant.Client.Grpc"; + +service Qdrant { + rpc HealthCheck (HealthCheckRequest) returns (HealthCheckReply) {} +} + +message HealthCheckRequest {} + +message HealthCheckReply { + string title = 1; + string version = 2; + optional string commit = 3; +} diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/proto/snapshots_service.proto b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/proto/snapshots_service.proto new file mode 100644 index 0000000000000000000000000000000000000000..63c9e5192b01c45d4ccbe901a3de92f524925d01 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/proto/snapshots_service.proto @@ -0,0 +1,75 @@ +syntax = "proto3"; + +package qdrant; +option csharp_namespace = "Qdrant.Client.Grpc"; + +import "google/protobuf/timestamp.proto"; + +service Snapshots { + /* + Create collection snapshot + */ + rpc Create (CreateSnapshotRequest) returns (CreateSnapshotResponse) {} + /* + List collection snapshots + */ + rpc List (ListSnapshotsRequest) returns (ListSnapshotsResponse) {} + /* + Delete collection snapshot + */ + rpc Delete (DeleteSnapshotRequest) returns (DeleteSnapshotResponse) {} + /* + Create full storage snapshot + */ + rpc CreateFull (CreateFullSnapshotRequest) returns (CreateSnapshotResponse) {} + /* + List full storage snapshots + */ + rpc ListFull (ListFullSnapshotsRequest) returns (ListSnapshotsResponse) {} + /* + Delete full storage snapshot + */ + rpc DeleteFull (DeleteFullSnapshotRequest) returns (DeleteSnapshotResponse) {} +} + +message CreateFullSnapshotRequest {} + +message ListFullSnapshotsRequest {} + +message DeleteFullSnapshotRequest { + string snapshot_name = 1; // Name of the full snapshot +} + +message CreateSnapshotRequest { + string collection_name = 1; // Name of the collection +} + +message ListSnapshotsRequest { + string collection_name = 1; // Name of the collection +} + +message DeleteSnapshotRequest { + string collection_name = 1; // Name of the collection + string snapshot_name = 2; // Name of the collection snapshot +} + +message SnapshotDescription { + string name = 1; // Name of the snapshot + google.protobuf.Timestamp creation_time = 2; // Creation time of the snapshot + int64 size = 3; // Size of the snapshot in bytes + optional string checksum = 4; // SHA256 digest of the snapshot file +} + +message CreateSnapshotResponse { + SnapshotDescription snapshot_description = 1; + double time = 2; // Time spent to process +} + +message ListSnapshotsResponse { + repeated SnapshotDescription snapshot_descriptions = 1; + double time = 2; // Time spent to process +} + +message DeleteSnapshotResponse { + double time = 1; // Time spent to process +} diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/uploader/__init__.py b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/uploader/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/uploader/grpc_uploader.py b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/uploader/grpc_uploader.py new file mode 100644 index 0000000000000000000000000000000000000000..fbe72d8d5c42d1ab3b677925cabe496216e38b20 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/uploader/grpc_uploader.py @@ -0,0 +1,131 @@ +from itertools import count +from time import sleep +from typing import Any, Generator, Iterable, Optional, Union +from uuid import uuid4 + +from qdrant_client import grpc as grpc +from qdrant_client.common.client_exceptions import ResourceExhaustedResponse +from qdrant_client.connection import get_channel +from qdrant_client.conversions.conversion import RestToGrpc, payload_to_grpc +from qdrant_client.grpc import PointId, PointsStub, PointStruct +from qdrant_client.http.models import Batch, ShardKeySelector +from qdrant_client.uploader.uploader import BaseUploader +from qdrant_client.common.client_warnings import show_warning + + +def upload_batch_grpc( + points_client: PointsStub, + collection_name: str, + batch: Union[Batch, tuple], + max_retries: int, + shard_key_selector: Optional[ShardKeySelector], + wait: bool = False, + timeout: Optional[int] = None, +) -> bool: + ids_batch, vectors_batch, payload_batch = batch + + ids_batch = (PointId(uuid=str(uuid4())) for _ in count()) if ids_batch is None else ids_batch + payload_batch = (None for _ in count()) if payload_batch is None else payload_batch + + points = [ + PointStruct( + id=RestToGrpc.convert_extended_point_id(idx) if not isinstance(idx, PointId) else idx, + vectors=RestToGrpc.convert_vector_struct(vector), + payload=payload_to_grpc(payload or {}), + ) + for idx, vector, payload in zip(ids_batch, vectors_batch, payload_batch) + ] + + attempt = 0 + while attempt < max_retries: + try: + points_client.Upsert( + grpc.UpsertPoints( + collection_name=collection_name, + points=points, + wait=wait, + shard_key_selector=RestToGrpc.convert_shard_key_selector(shard_key_selector) + if shard_key_selector is not None + else None, + ), + timeout=timeout, + ) + break + except ResourceExhaustedResponse as ex: + show_warning( + message=f"Batch upload failed due to rate limit. Waiting for {ex.retry_after_s} seconds before retrying...", + category=UserWarning, + stacklevel=8, + ) + sleep(ex.retry_after_s) + + except Exception as e: + show_warning( + message=f"Batch upload failed {attempt + 1} times. Retrying...", + category=UserWarning, + stacklevel=8, + ) + + if attempt == max_retries - 1: + raise e + + attempt += 1 + return True + + +class GrpcBatchUploader(BaseUploader): + def __init__( + self, + host: str, + port: int, + collection_name: str, + max_retries: int, + wait: bool = False, + shard_key_selector: Optional[ShardKeySelector] = None, + **kwargs: Any, + ): + self.collection_name = collection_name + self._host = host + self._port = port + self.max_retries = max_retries + self._kwargs = kwargs + self._wait = wait + self._shard_key_selector = shard_key_selector + self._timeout = kwargs.pop("timeout", None) + + @classmethod + def start( + cls, + collection_name: Optional[str] = None, + host: str = "localhost", + port: int = 6334, + max_retries: int = 3, + **kwargs: Any, + ) -> "GrpcBatchUploader": + if not collection_name: + raise RuntimeError("Collection name could not be empty") + + return cls( + host=host, + port=port, + collection_name=collection_name, + max_retries=max_retries, + **kwargs, + ) + + def process_upload(self, items: Iterable[Any]) -> Generator[bool, None, None]: + channel = get_channel(host=self._host, port=self._port, **self._kwargs) + points_client = PointsStub(channel) + for batch in items: + yield upload_batch_grpc( + points_client, + self.collection_name, + batch, + shard_key_selector=self._shard_key_selector, + max_retries=self.max_retries, + wait=self._wait, + timeout=self._timeout, + ) + + def process(self, items: Iterable[Any]) -> Iterable[bool]: + yield from self.process_upload(items) diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/uploader/rest_uploader.py b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/uploader/rest_uploader.py new file mode 100644 index 0000000000000000000000000000000000000000..1fd15bf03f9b27a951e1247d67547136815c3b2f --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/uploader/rest_uploader.py @@ -0,0 +1,105 @@ +from itertools import count +from time import sleep +from typing import Any, Iterable, Optional, Union +from uuid import uuid4 + +import numpy as np + +from qdrant_client.common.client_exceptions import ResourceExhaustedResponse +from qdrant_client.http import SyncApis +from qdrant_client.http.models import Batch, PointsList, PointStruct, ShardKeySelector +from qdrant_client.uploader.uploader import BaseUploader +from qdrant_client.common.client_warnings import show_warning + + +def upload_batch( + openapi_client: SyncApis, + collection_name: str, + batch: Union[tuple, Batch], + max_retries: int, + shard_key_selector: Optional[ShardKeySelector], + wait: bool = False, +) -> bool: + ids_batch, vectors_batch, payload_batch = batch + + ids_batch = (str(uuid4()) for _ in count()) if ids_batch is None else ids_batch + payload_batch = (None for _ in count()) if payload_batch is None else payload_batch + + points = [ + PointStruct( + id=idx, + vector=(vector.tolist() if isinstance(vector, np.ndarray) else vector) or {}, + payload=payload, + ) + for idx, vector, payload in zip(ids_batch, vectors_batch, payload_batch) + ] + + attempt = 0 + while attempt < max_retries: + try: + openapi_client.points_api.upsert_points( + collection_name=collection_name, + point_insert_operations=PointsList(points=points, shard_key=shard_key_selector), + wait=wait, + ) + break + except ResourceExhaustedResponse as ex: + show_warning( + message=f"Batch upload failed due to rate limit. Waiting for {ex.retry_after_s} seconds before retrying...", + category=UserWarning, + stacklevel=7, + ) + sleep(ex.retry_after_s) + + except Exception as e: + show_warning( + message=f"Batch upload failed {attempt + 1} times. Retrying...", + category=UserWarning, + stacklevel=7, + ) + + if attempt == max_retries - 1: + raise e + + attempt += 1 + return True + + +class RestBatchUploader(BaseUploader): + def __init__( + self, + uri: str, + collection_name: str, + max_retries: int, + wait: bool = False, + shard_key_selector: Optional[ShardKeySelector] = None, + **kwargs: Any, + ): + self.collection_name = collection_name + self.openapi_client: SyncApis = SyncApis(host=uri, **kwargs) + self.max_retries = max_retries + self._wait = wait + self._shard_key_selector = shard_key_selector + + @classmethod + def start( + cls, + collection_name: Optional[str] = None, + uri: str = "http://localhost:6333", + max_retries: int = 3, + **kwargs: Any, + ) -> "RestBatchUploader": + if not collection_name: + raise RuntimeError("Collection name could not be empty") + return cls(uri=uri, collection_name=collection_name, max_retries=max_retries, **kwargs) + + def process(self, items: Iterable[Any]) -> Iterable[bool]: + for batch in items: + yield upload_batch( + self.openapi_client, + self.collection_name, + batch, + shard_key_selector=self._shard_key_selector, + max_retries=self.max_retries, + wait=self._wait, + ) diff --git a/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/uploader/uploader.py b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/uploader/uploader.py new file mode 100644 index 0000000000000000000000000000000000000000..27ad0af97f7b62e444f1ca136d33f9e3499a4ae3 --- /dev/null +++ b/platform/dbops/archive/databases_old/data/home/x/.local/lib/python3.12/site-packages/qdrant_client/uploader/uploader.py @@ -0,0 +1,94 @@ +from abc import ABC +from itertools import count, islice +from typing import Any, Generator, Iterable, Optional, Union + +import numpy as np + +from qdrant_client.conversions import common_types as types +from qdrant_client.conversions.common_types import Record +from qdrant_client.http.models import ExtendedPointId +from qdrant_client.parallel_processor import Worker + + +def iter_batch(iterable: Union[Iterable, Generator], size: int) -> Iterable: + """ + >>> list(iter_batch([1,2,3,4,5], 3)) + [[1, 2, 3], [4, 5]] + """ + source_iter = iter(iterable) + while source_iter: + b = list(islice(source_iter, size)) + if len(b) == 0: + break + yield b + + +class BaseUploader(Worker, ABC): + @classmethod + def iterate_records_batches( + cls, + records: Iterable[Union[Record, types.PointStruct]], + batch_size: int, + ) -> Iterable: + record_batches = iter_batch(records, batch_size) + for record_batch in record_batches: + ids_batch, vectors_batch, payload_batch = [], [], [] + + for record in record_batch: + ids_batch.append(record.id) + vectors_batch.append(record.vector) + payload_batch.append(record.payload) + + yield ids_batch, vectors_batch, payload_batch + + @classmethod + def iterate_batches( + cls, + vectors: Union[ + dict[str, types.NumpyArray], types.NumpyArray, Iterable[types.VectorStruct] + ], + payload: Optional[Iterable[dict]], + ids: Optional[Iterable[ExtendedPointId]], + batch_size: int, + ) -> Iterable: + if ids is None: + ids_batches: Iterable = (None for _ in count()) + else: + ids_batches = iter_batch(ids, batch_size) + + if payload is None: + payload_batches: Iterable = (None for _ in count()) + else: + payload_batches = iter_batch(payload, batch_size) + + if isinstance(vectors, np.ndarray): + vector_batches: Iterable[Any] = cls._vector_batches_from_numpy(vectors, batch_size) + elif isinstance(vectors, dict) and any( + isinstance(value, np.ndarray) for value in vectors.values() + ): + vector_batches = cls._vector_batches_from_numpy_named_vectors(vectors, batch_size) + else: + vector_batches = iter_batch(vectors, batch_size) + + yield from zip(ids_batches, vector_batches, payload_batches) + + @staticmethod + def _vector_batches_from_numpy(vectors: types.NumpyArray, batch_size: int) -> Iterable[float]: + for i in range(0, vectors.shape[0], batch_size): + yield vectors[i : i + batch_size].tolist() + + @staticmethod + def _vector_batches_from_numpy_named_vectors( + vectors: dict[str, types.NumpyArray], batch_size: int + ) -> Iterable[dict[str, list[float]]]: + assert ( + len(set([arr.shape[0] for arr in vectors.values()])) == 1 + ), "Each named vector should have the same number of vectors" + + num_vectors = next(iter(vectors.values())).shape[0] + # Convert dict[str, np.ndarray] to Generator(dict[str, list[float]]) + vector_batches = ( + {name: vectors[name][i].tolist() for name in vectors.keys()} + for i in range(num_vectors) + ) + yield from iter_batch(vector_batches, batch_size)