diff options
author | Oscar Najera <hi@oscarnajera.com> | 2023-12-08 14:13:14 +0100 |
---|---|---|
committer | Oscar Najera <hi@oscarnajera.com> | 2024-01-13 02:27:42 +0100 |
commit | 97d4f907f670b4a16edf972a9339c194822eb476 (patch) | |
tree | eb18e4c692aabd9364df2193ec88cc6a1a6937cd /scratch/semgrep/utils.py | |
parent | 2d9291a7f24268ce58a3d98a4ad9a16a05665df0 (diff) | |
download | dotfiles-97d4f907f670b4a16edf972a9339c194822eb476.tar.gz dotfiles-97d4f907f670b4a16edf972a9339c194822eb476.tar.bz2 dotfiles-97d4f907f670b4a16edf972a9339c194822eb476.zip |
semgrep package
Diffstat (limited to 'scratch/semgrep/utils.py')
-rw-r--r-- | scratch/semgrep/utils.py | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/scratch/semgrep/utils.py b/scratch/semgrep/utils.py new file mode 100644 index 0000000..66ee410 --- /dev/null +++ b/scratch/semgrep/utils.py @@ -0,0 +1,21 @@ +#!/usr/bin/env python3 +# This functions don't necessarily stand alone. I used on debug process +import uuid + +response = collection.query( + query_texts="machines scale", + where={"node-id": "496d4874-be24-4601-8a87-214d55e11297"}, +) +collection.query(query_texts="machines scale") + + +def get_node(node_id): + return collection.get(where={"node-id": node_id}) + + +def get_data(amount): + nodeid = str(uuid.uuid4()) + data = ["heelo" for _ in range(amount)] + metadata = [{"node-id": nodeid, "point": i} for i in range(amount)] + ids = [str(uuid.uuid4()) for _ in range(amount)] + return {"documents": data, "metadatas": metadata, "ids": ids} |