repo stringlengths 7 90 | file_url stringlengths 81 315 | file_path stringlengths 4 228 | content stringlengths 0 32.8k | language stringclasses 1
value | license stringclasses 7
values | commit_sha stringlengths 40 40 | retrieved_at stringdate 2026-01-04 14:38:15 2026-01-05 02:33:18 | truncated bool 2
classes |
|---|---|---|---|---|---|---|---|---|
wyczzy/AIGI-Holmes | https://github.com/wyczzy/AIGI-Holmes/blob/bae30b9e807230255a9f3fd18c9c64c08805b427/examples/pytorch/sdxl/infer_dreambooth_lora.py | examples/pytorch/sdxl/infer_dreambooth_lora.py | # Copyright (c) Alibaba, Inc. and its affiliates.
from swift.aigc import infer_dreambooth_lora
if __name__ == '__main__':
infer_dreambooth_lora()
| python | Apache-2.0 | bae30b9e807230255a9f3fd18c9c64c08805b427 | 2026-01-05T07:09:55.123229Z | false |
wyczzy/AIGI-Holmes | https://github.com/wyczzy/AIGI-Holmes/blob/bae30b9e807230255a9f3fd18c9c64c08805b427/examples/pytorch/sdxl/train_text_to_image_lora.py | examples/pytorch/sdxl/train_text_to_image_lora.py | # Copyright (c) Alibaba, Inc. and its affiliates.
from swift.aigc import train_text_to_image_lora
if __name__ == '__main__':
train_text_to_image_lora()
| python | Apache-2.0 | bae30b9e807230255a9f3fd18c9c64c08805b427 | 2026-01-05T07:09:55.123229Z | false |
wyczzy/AIGI-Holmes | https://github.com/wyczzy/AIGI-Holmes/blob/bae30b9e807230255a9f3fd18c9c64c08805b427/examples/pytorch/sdxl/train_text_to_image_lora_sdxl.py | examples/pytorch/sdxl/train_text_to_image_lora_sdxl.py | # Copyright (c) Alibaba, Inc. and its affiliates.
from swift.aigc import train_text_to_image_lora_sdxl
if __name__ == '__main__':
train_text_to_image_lora_sdxl()
| python | Apache-2.0 | bae30b9e807230255a9f3fd18c9c64c08805b427 | 2026-01-05T07:09:55.123229Z | false |
wyczzy/AIGI-Holmes | https://github.com/wyczzy/AIGI-Holmes/blob/bae30b9e807230255a9f3fd18c9c64c08805b427/examples/pytorch/sdxl/train_text_to_image_sdxl.py | examples/pytorch/sdxl/train_text_to_image_sdxl.py | # Copyright (c) Alibaba, Inc. and its affiliates.
from swift.aigc import train_text_to_image_sdxl
if __name__ == '__main__':
train_text_to_image_sdxl()
| python | Apache-2.0 | bae30b9e807230255a9f3fd18c9c64c08805b427 | 2026-01-05T07:09:55.123229Z | false |
wyczzy/AIGI-Holmes | https://github.com/wyczzy/AIGI-Holmes/blob/bae30b9e807230255a9f3fd18c9c64c08805b427/examples/pytorch/multi_modal/notebook/text_to_image_synthesis.py | examples/pytorch/multi_modal/notebook/text_to_image_synthesis.py | import os
import cv2
from modelscope.models import Model
from modelscope.msdatasets import MsDataset
from modelscope.pipelines import pipeline
from modelscope.trainers import build_trainer
from modelscope.utils.config import Config
from modelscope.utils.constant import ModelFile
from swift import LoRAConfig, SCETunin... | python | Apache-2.0 | bae30b9e807230255a9f3fd18c9c64c08805b427 | 2026-01-05T07:09:55.123229Z | false |
wyczzy/AIGI-Holmes | https://github.com/wyczzy/AIGI-Holmes/blob/bae30b9e807230255a9f3fd18c9c64c08805b427/examples/pytorch/llm/llm_sft.py | examples/pytorch/llm/llm_sft.py | # Copyright (c) Alibaba, Inc. and its affiliates.
import custom
from swift.llm import sft_main
if __name__ == '__main__':
output = sft_main()
| python | Apache-2.0 | bae30b9e807230255a9f3fd18c9c64c08805b427 | 2026-01-05T07:09:55.123229Z | false |
wyczzy/AIGI-Holmes | https://github.com/wyczzy/AIGI-Holmes/blob/bae30b9e807230255a9f3fd18c9c64c08805b427/examples/pytorch/llm/llm_infer.py | examples/pytorch/llm/llm_infer.py | # Copyright (c) Alibaba, Inc. and its affiliates.
import custom
from swift.llm import infer_main
if __name__ == '__main__':
result = infer_main()
| python | Apache-2.0 | bae30b9e807230255a9f3fd18c9c64c08805b427 | 2026-01-05T07:09:55.123229Z | false |
wyczzy/AIGI-Holmes | https://github.com/wyczzy/AIGI-Holmes/blob/bae30b9e807230255a9f3fd18c9c64c08805b427/examples/pytorch/llm/llm_rlhf.py | examples/pytorch/llm/llm_rlhf.py | # Copyright (c) Alibaba, Inc. and its affiliates.
"""
This script runs the main process of Human Preferences Alignment using different algorithms.
Specify the algorithm using the --rlhf_type argument.
Options:
--rlhf_type dpo : Direct Preference Optimization (DPO)
--rlhf_type kto : Kahneman-Tversky Optim... | python | Apache-2.0 | bae30b9e807230255a9f3fd18c9c64c08805b427 | 2026-01-05T07:09:55.123229Z | false |
wyczzy/AIGI-Holmes | https://github.com/wyczzy/AIGI-Holmes/blob/bae30b9e807230255a9f3fd18c9c64c08805b427/examples/pytorch/llm/custom.py | examples/pytorch/llm/custom.py | # Copyright (c) Alibaba, Inc. and its affiliates.
from typing import Any, Dict
import torch
from datasets import Dataset as HfDataset
from transformers import AutoConfig, AutoModelForCausalLM, AutoTokenizer
from transformers.utils.versions import require_version
from swift.llm import (LoRATM, Template, TemplateType, ... | python | Apache-2.0 | bae30b9e807230255a9f3fd18c9c64c08805b427 | 2026-01-05T07:09:55.123229Z | false |
wyczzy/AIGI-Holmes | https://github.com/wyczzy/AIGI-Holmes/blob/bae30b9e807230255a9f3fd18c9c64c08805b427/examples/pytorch/llm/app.py | examples/pytorch/llm/app.py | # Copyright (c) Alibaba, Inc. and its affiliates.
# import os
# os.environ['CUDA_VISIBLE_DEVICES'] = '0'
import custom
from swift.llm import AppUIArguments, ModelType, app_ui_main
if __name__ == '__main__':
# Please refer to the `infer.sh` for setting the parameters.
# text-generation
# args = AppUIArgume... | python | Apache-2.0 | bae30b9e807230255a9f3fd18c9c64c08805b427 | 2026-01-05T07:09:55.123229Z | false |
wyczzy/AIGI-Holmes | https://github.com/wyczzy/AIGI-Holmes/blob/bae30b9e807230255a9f3fd18c9c64c08805b427/examples/pytorch/llm/rome_infer.py | examples/pytorch/llm/rome_infer.py | # Copyright (c) Alibaba, Inc. and its affiliates.
from swift.llm import rome_main
if __name__ == '__main__':
rome_main()
| python | Apache-2.0 | bae30b9e807230255a9f3fd18c9c64c08805b427 | 2026-01-05T07:09:55.123229Z | false |
wyczzy/AIGI-Holmes | https://github.com/wyczzy/AIGI-Holmes/blob/bae30b9e807230255a9f3fd18c9c64c08805b427/examples/pytorch/animatediff/animatediff_infer.py | examples/pytorch/animatediff/animatediff_infer.py | # Copyright (c) Alibaba, Inc. and its affiliates.
from swift.aigc import animatediff_infer_main
if __name__ == '__main__':
animatediff_infer_main()
| python | Apache-2.0 | bae30b9e807230255a9f3fd18c9c64c08805b427 | 2026-01-05T07:09:55.123229Z | false |
wyczzy/AIGI-Holmes | https://github.com/wyczzy/AIGI-Holmes/blob/bae30b9e807230255a9f3fd18c9c64c08805b427/examples/pytorch/animatediff/animatediff_sft.py | examples/pytorch/animatediff/animatediff_sft.py | # Copyright (c) Alibaba, Inc. and its affiliates.
from swift.aigc import animatediff_main
if __name__ == '__main__':
animatediff_main()
| python | Apache-2.0 | bae30b9e807230255a9f3fd18c9c64c08805b427 | 2026-01-05T07:09:55.123229Z | false |
wyczzy/AIGI-Holmes | https://github.com/wyczzy/AIGI-Holmes/blob/bae30b9e807230255a9f3fd18c9c64c08805b427/examples/pytorch/stable_diffusion/finetune_stable_diffusion.py | examples/pytorch/stable_diffusion/finetune_stable_diffusion.py | import os
from dataclasses import dataclass, field
import cv2
import torch
from modelscope import get_logger, snapshot_download
from modelscope.metainfo import Trainers
from modelscope.models import Model
from modelscope.msdatasets import MsDataset
from modelscope.pipelines import pipeline
from modelscope.trainers imp... | python | Apache-2.0 | bae30b9e807230255a9f3fd18c9c64c08805b427 | 2026-01-05T07:09:55.123229Z | false |
lmzpai/roboMamba | https://github.com/lmzpai/roboMamba/blob/c2f52c49217a0e383eadb71a5751567fb05b452c/src/judger.py | src/judger.py | import copy
import datetime
import json
import os
import random
import re
import sys
# Interface for accessing the VQA dataset.
# This code is based on the code written by Tsung-Yi Lin for MSCOCO Python API available at the following link:
# (https://github.com/pdollar/coco/blob/master/PythonAPI/pycocotools/coco.py).... | python | MIT | c2f52c49217a0e383eadb71a5751567fb05b452c | 2026-01-05T07:10:12.549240Z | false |
lmzpai/roboMamba | https://github.com/lmzpai/roboMamba/blob/c2f52c49217a0e383eadb71a5751567fb05b452c/src/test.py | src/test.py | import json
import os
import argparse
import time
import re
os.environ["TOKENIZERS_PARALLELISM"] = "false"
import torch
from PIL import Image, ImageFile
from tqdm import tqdm
from torch.utils.data import DataLoader, Dataset
from torch.utils.data.distributed import DistributedSampler
from sklearn.metrics import accura... | python | MIT | c2f52c49217a0e383eadb71a5751567fb05b452c | 2026-01-05T07:10:12.549240Z | false |
lmzpai/roboMamba | https://github.com/lmzpai/roboMamba/blob/c2f52c49217a0e383eadb71a5751567fb05b452c/src/model/create.py | src/model/create.py | import os
from model.vision import Vision
from model.llm import MyMambaLLM, MambaLLM
from model.vlm import LinearVLM, Projector
from model.manip import LinearManip
def create_model(vision_encoder, llm_type, types='VLM'):
vision = Vision(vision_encoder)
if llm_type.startswith('mamba-'):
llm = MyMa... | python | MIT | c2f52c49217a0e383eadb71a5751567fb05b452c | 2026-01-05T07:10:12.549240Z | false |
lmzpai/roboMamba | https://github.com/lmzpai/roboMamba/blob/c2f52c49217a0e383eadb71a5751567fb05b452c/src/model/vision.py | src/model/vision.py | import timm
from torch import nn
from torchvision.transforms import Compose, Resize
vision_encoders = {
'SIGLIP256': 'vit_large_patch16_siglip_256',
'SIGLIP384': 'vit_large_patch16_siglip_384',
'CLIP224': 'vit_large_patch14_clip_224.openai',
'CLIP336': 'vit_large_patch14_clip_336.openai'
}
img_size ... | python | MIT | c2f52c49217a0e383eadb71a5751567fb05b452c | 2026-01-05T07:10:12.549240Z | false |
lmzpai/roboMamba | https://github.com/lmzpai/roboMamba/blob/c2f52c49217a0e383eadb71a5751567fb05b452c/src/model/llm.py | src/model/llm.py |
from transformers import MambaForCausalLM, AutoTokenizer
import torch
import torch.nn as nn
from safetensors.torch import load_file
from .my_mamba.modeling_mamba import MyMambaForCausalLM
mamba_dict = {
'mamba-2.8b': 'state-spaces/mamba-2.8b-hf',
'mamba-1.4b': 'state-spaces/mamba-1.4b-hf',
'mamba-79... | python | MIT | c2f52c49217a0e383eadb71a5751567fb05b452c | 2026-01-05T07:10:12.549240Z | false |
lmzpai/roboMamba | https://github.com/lmzpai/roboMamba/blob/c2f52c49217a0e383eadb71a5751567fb05b452c/src/model/manip.py | src/model/manip.py | from functools import partial
import os
import time
import torch
from torch import nn
import torch.nn.init as init
from torch.distributed.fsdp.wrap import _or_policy, transformer_auto_wrap_policy, _module_wrap_policy, lambda_auto_wrap_policy
import torch.nn.functional as F
from transformers.models.mamba.modeling_mamba... | python | MIT | c2f52c49217a0e383eadb71a5751567fb05b452c | 2026-01-05T07:10:12.549240Z | false |
lmzpai/roboMamba | https://github.com/lmzpai/roboMamba/blob/c2f52c49217a0e383eadb71a5751567fb05b452c/src/model/vlm.py | src/model/vlm.py | from functools import partial
import os
import time
import torch
from torch import nn
from torch.distributed.fsdp.wrap import _or_policy, transformer_auto_wrap_policy, _module_wrap_policy, lambda_auto_wrap_policy
from transformers.models.mamba.modeling_mamba import MambaBlock
from timm.models.vision_transformer import... | python | MIT | c2f52c49217a0e383eadb71a5751567fb05b452c | 2026-01-05T07:10:12.549240Z | false |
lmzpai/roboMamba | https://github.com/lmzpai/roboMamba/blob/c2f52c49217a0e383eadb71a5751567fb05b452c/src/model/my_mamba/configuration_mamba.py | src/model/my_mamba/configuration_mamba.py | # coding=utf-8
# Copyright (c) 2023 Jean-Loup Tastet
from transformers.configuration_utils import PretrainedConfig
MAMBA_PRETRAINED_CONFIG_ARCHIVE_MAP = {
"state-spaces/mamba-2.8b": "https://huggingface.co/state-spaces/mamba-2.8b/resolve/main/config.json",
"state-spaces/mamba-1.4b": "https://huggingface.co/s... | python | MIT | c2f52c49217a0e383eadb71a5751567fb05b452c | 2026-01-05T07:10:12.549240Z | false |
lmzpai/roboMamba | https://github.com/lmzpai/roboMamba/blob/c2f52c49217a0e383eadb71a5751567fb05b452c/src/model/my_mamba/modeling_mamba.py | src/model/my_mamba/modeling_mamba.py | # Based on the implementation of hf-mamba: https://github.com/JLTastet/transformers/tree/mamba
# coding=utf-8
# Copyright (c) 2023 the contributors (see AUTHORS)
# Based on various files from https://github.com/state-spaces/mamba
import gc
import sys
import warnings
import os
from pathlib import Path
from packaging.v... | python | MIT | c2f52c49217a0e383eadb71a5751567fb05b452c | 2026-01-05T07:10:12.549240Z | true |
lmzpai/roboMamba | https://github.com/lmzpai/roboMamba/blob/c2f52c49217a0e383eadb71a5751567fb05b452c/src/data/data.py | src/data/data.py | import json
import os
import re
import pickle
import pathlib
from PIL import Image
import torch
from torch.utils.data import Dataset, DataLoader
from torch.utils.data.dataloader import default_collate
from torch.nn.utils.rnn import pad_sequence
IGNORED = -100
class JsonDatset(Dataset):
def __init__(self, json_p... | python | MIT | c2f52c49217a0e383eadb71a5751567fb05b452c | 2026-01-05T07:10:12.549240Z | false |
joncage/ed-scout | https://github.com/joncage/ed-scout/blob/5c1fb49f4c271e9978dbbb5774e91d28df0a03b0/__init__.py | __init__.py | #from . import EDScoutCore
#from . import EDScoutWebUI
| python | MIT | 5c1fb49f4c271e9978dbbb5774e91d28df0a03b0 | 2026-01-05T07:10:15.574477Z | false |
joncage/ed-scout | https://github.com/joncage/ed-scout/blob/5c1fb49f4c271e9978dbbb5774e91d28df0a03b0/DataAcquistion/FindRingInfo.py | DataAcquistion/FindRingInfo.py | import os
import glob
import json
from EDScoutCore.SavedGamesLocator import get_saved_games_path
def find_rings(journal_lines):
max_len = 0
ring_types = set()
for line in journal_lines:
if 'rings' in line.lower():
data = json.loads(line)
rings = data['Rings']
ri... | python | MIT | 5c1fb49f4c271e9978dbbb5774e91d28df0a03b0 | 2026-01-05T07:10:15.574477Z | false |
joncage/ed-scout | https://github.com/joncage/ed-scout/blob/5c1fb49f4c271e9978dbbb5774e91d28df0a03b0/EdScoutConfig/__init__.py | EdScoutConfig/__init__.py | from . import ConfigHandler | python | MIT | 5c1fb49f4c271e9978dbbb5774e91d28df0a03b0 | 2026-01-05T07:10:15.574477Z | false |
joncage/ed-scout | https://github.com/joncage/ed-scout/blob/5c1fb49f4c271e9978dbbb5774e91d28df0a03b0/EdScoutConfig/ConfigHandler.py | EdScoutConfig/ConfigHandler.py | import configparser
import os
import logging
from pathlib import Path
class Config:
DefaultPath = os.path.join(os.path.expanduser('~'), 'AppData', 'Local', 'EDScout')
def __init__(self, config_dir=DefaultPath):
self.config = configparser.ConfigParser()
self.config_dir = config_dir
i... | python | MIT | 5c1fb49f4c271e9978dbbb5774e91d28df0a03b0 | 2026-01-05T07:10:15.574477Z | false |
joncage/ed-scout | https://github.com/joncage/ed-scout/blob/5c1fb49f4c271e9978dbbb5774e91d28df0a03b0/Installer/create_version_file.py | Installer/create_version_file.py | import os
import re
from jinja2 import Environment, FileSystemLoader
def extract_version_parts(git_response):
regex = r"v(\d)\.(\d)\.(\d)(?:-(\d+)-([a-z0-9]+)(?:-([a-z0-9]+))?)?"
matches = re.finditer(regex, git_response, re.MULTILINE)
groups = list(matches)[0].groups()
if len(groups) > 3:
c... | python | MIT | 5c1fb49f4c271e9978dbbb5774e91d28df0a03b0 | 2026-01-05T07:10:15.574477Z | false |
joncage/ed-scout | https://github.com/joncage/ed-scout/blob/5c1fb49f4c271e9978dbbb5774e91d28df0a03b0/EDScoutWebUI/WindowToggler.py | EDScoutWebUI/WindowToggler.py | import platform
if platform.system() == 'Windows':
import win32con as wcon
import win32gui as wgui
from pynput import keyboard
class WindowFinder:
@staticmethod
def get_scout_handle():
if platform.system() == 'Windows':
return wgui.FindWindow(None, "ED Scout v1.4.0")
else:... | python | MIT | 5c1fb49f4c271e9978dbbb5774e91d28df0a03b0 | 2026-01-05T07:10:15.574477Z | false |
joncage/ed-scout | https://github.com/joncage/ed-scout/blob/5c1fb49f4c271e9978dbbb5774e91d28df0a03b0/EDScoutWebUI/HudColourAdjuster.py | EDScoutWebUI/HudColourAdjuster.py | import xml.etree.ElementTree as ET
import re
import os
import platform
osname = platform.system()
if osname == 'Windows':
default_config_file = os.path.join(os.path.expanduser('~'), r"AppData\Local\Frontier Developments\Elite Dangerous\Options\Graphics\GraphicsConfigurationOverride.xml")
elif osname == 'Linux':
... | python | MIT | 5c1fb49f4c271e9978dbbb5774e91d28df0a03b0 | 2026-01-05T07:10:15.574477Z | false |
joncage/ed-scout | https://github.com/joncage/ed-scout/blob/5c1fb49f4c271e9978dbbb5774e91d28df0a03b0/EDScoutWebUI/EDScout.py | EDScoutWebUI/EDScout.py | import json
import os
import sys
import logging
import argparse
import tempfile
import platform
import psutil
import time
from datetime import datetime, timezone
from pathlib import Path
from flask import Flask, render_template, send_from_directory
from flask_socketio import SocketIO
from flaskwebgui import FlaskUI
f... | python | MIT | 5c1fb49f4c271e9978dbbb5774e91d28df0a03b0 | 2026-01-05T07:10:15.574477Z | false |
joncage/ed-scout | https://github.com/joncage/ed-scout/blob/5c1fb49f4c271e9978dbbb5774e91d28df0a03b0/EDScoutWebUI/__init__.py | EDScoutWebUI/__init__.py | python | MIT | 5c1fb49f4c271e9978dbbb5774e91d28df0a03b0 | 2026-01-05T07:10:15.574477Z | false | |
joncage/ed-scout | https://github.com/joncage/ed-scout/blob/5c1fb49f4c271e9978dbbb5774e91d28df0a03b0/EDScoutWebUI/VersionChecker.py | EDScoutWebUI/VersionChecker.py | import requests
import requests_cache
import logging
import re
from EDScoutWebUI import version
current_version = version.version
log = logging.getLogger('VersionChecker')
def get_version_parts(version):
regex = r"[vV]?(\d)+\.(\d)+\.(\d)+\.?(\d)?"
match = re.search(regex, version)
if match is not None:
... | python | MIT | 5c1fb49f4c271e9978dbbb5774e91d28df0a03b0 | 2026-01-05T07:10:15.574477Z | false |
joncage/ed-scout | https://github.com/joncage/ed-scout/blob/5c1fb49f4c271e9978dbbb5774e91d28df0a03b0/EDScoutWebUI/test_HudColourAdjuster.py | EDScoutWebUI/test_HudColourAdjuster.py | from . import HudColourAdjuster
import os
import pytest
import xml
def get_test_file_path(filename):
script_path = os.path.dirname(__file__)
data_dir = "./TestData/"
return os.path.abspath(os.path.join(script_path, data_dir, filename))
def test_can_read_values_correctly():
script_path = os.path.dir... | python | MIT | 5c1fb49f4c271e9978dbbb5774e91d28df0a03b0 | 2026-01-05T07:10:15.574477Z | false |
joncage/ed-scout | https://github.com/joncage/ed-scout/blob/5c1fb49f4c271e9978dbbb5774e91d28df0a03b0/EDScoutCore/EDSMInterface.py | EDScoutCore/EDSMInterface.py | import requests
import requests_cache
import os
import platform
# See https://www.edsm.net/en_GB/api-v1
# Setup the cache directory in the user area.
osname = platform.system()
if osname == 'Windows':
cache_path = os.path.join(os.path.expanduser('~'), 'AppData', 'Local', 'EDScout')
elif osname == 'Linux':
cac... | python | MIT | 5c1fb49f4c271e9978dbbb5774e91d28df0a03b0 | 2026-01-05T07:10:15.574477Z | false |
joncage/ed-scout | https://github.com/joncage/ed-scout/blob/5c1fb49f4c271e9978dbbb5774e91d28df0a03b0/EDScoutCore/FileSystemUpdatePrompter.py | EDScoutCore/FileSystemUpdatePrompter.py | from threading import Thread
import logging
import os
from time import sleep
logger = logging.getLogger('EDScoutCore')
class FileSystemUpdatePrompter:
def __init__(self, path_to_query):
self.path_to_query = path_to_query
self.file_size = None
t = Thread(target=self.file_check)
t... | python | MIT | 5c1fb49f4c271e9978dbbb5774e91d28df0a03b0 | 2026-01-05T07:10:15.574477Z | false |
joncage/ed-scout | https://github.com/joncage/ed-scout/blob/5c1fb49f4c271e9978dbbb5774e91d28df0a03b0/EDScoutCore/test_EDSMInterface.py | EDScoutCore/test_EDSMInterface.py | from . import EDSMInterface
import requests_cache
class TestEDSMInterface:
def test_get_system(self):
import sys
print(f"paths: {sys.path}")
value = EDSMInterface.get_system("Wolf 397")
print(f"{value}")
expected_value = {
'name': 'Wolf 397',
'coor... | python | MIT | 5c1fb49f4c271e9978dbbb5774e91d28df0a03b0 | 2026-01-05T07:10:15.574477Z | false |
joncage/ed-scout | https://github.com/joncage/ed-scout/blob/5c1fb49f4c271e9978dbbb5774e91d28df0a03b0/EDScoutCore/BodyAppraiser.py | EDScoutCore/BodyAppraiser.py |
# Uses calculations from here: https://forums.frontier.co.uk/threads/exploration-value-formulae.232000/
# https://github.com/EDSM-NET/Component/blob/master/Body/Value.php
# Ported from the EDSM code base.
star_types = {
# Main sequence
'O': 1,
'B': 2,
'B_BlueSuperGiant': 201,
'A': 3,
'A_Blue... | python | MIT | 5c1fb49f4c271e9978dbbb5774e91d28df0a03b0 | 2026-01-05T07:10:15.574477Z | false |
joncage/ed-scout | https://github.com/joncage/ed-scout/blob/5c1fb49f4c271e9978dbbb5774e91d28df0a03b0/EDScoutCore/SavedGamesLocator.py | EDScoutCore/SavedGamesLocator.py |
import os
import platform
osname = platform.system()
if osname == 'Windows':
import winreg
def get_saved_games_path():
"""Returns the default downloads path for linux or windows
Adapted from this: https://stackoverflow.com/questions/35851281/python-finding-the-users-downloads-folder?lq=1
"""
sa... | python | MIT | 5c1fb49f4c271e9978dbbb5774e91d28df0a03b0 | 2026-01-05T07:10:15.574477Z | false |
joncage/ed-scout | https://github.com/joncage/ed-scout/blob/5c1fb49f4c271e9978dbbb5774e91d28df0a03b0/EDScoutCore/EDScout.py | EDScoutCore/EDScout.py | import time
import json
import logging
from .SavedGamesLocator import get_saved_games_path
import requests
from .NavRouteIntegrator import NavRouteIntegrator
from . import EDSMInterface
from .ZmqWrappers import Sender
from .JournalInterface import JournalWatcher, JournalChangeProcessor
from . import BodyAppraiser
fro... | python | MIT | 5c1fb49f4c271e9978dbbb5774e91d28df0a03b0 | 2026-01-05T07:10:15.574477Z | false |
joncage/ed-scout | https://github.com/joncage/ed-scout/blob/5c1fb49f4c271e9978dbbb5774e91d28df0a03b0/EDScoutCore/test_EdScout.py | EDScoutCore/test_EdScout.py | import pytest
import tempfile
from .EDScout import EDScout
class TestEdScoutJournalProcessing:
test_data = [
{"timestamp": "2020-07-17T21:49:18Z", "event": "FSDTarget", "Name": "HIP 64420", "SystemAddress": 560233253227,
"StarClass": "F", "RemainingJumpsInRoute": 1},
{"timestamp": "2020-0... | python | MIT | 5c1fb49f4c271e9978dbbb5774e91d28df0a03b0 | 2026-01-05T07:10:15.574477Z | false |
joncage/ed-scout | https://github.com/joncage/ed-scout/blob/5c1fb49f4c271e9978dbbb5774e91d28df0a03b0/EDScoutCore/NavRouteIntegrator.py | EDScoutCore/NavRouteIntegrator.py | import logging
import json
import os
from pathlib import Path
from .SavedGamesLocator import get_saved_games_path
logger = logging.getLogger('EDScoutCore')
class NavRouteIntegrator:
def __init__(self, nav_route_file=None):
self.last_nav_route = None
if not nav_route_file:
self.nav_r... | python | MIT | 5c1fb49f4c271e9978dbbb5774e91d28df0a03b0 | 2026-01-05T07:10:15.574477Z | false |
joncage/ed-scout | https://github.com/joncage/ed-scout/blob/5c1fb49f4c271e9978dbbb5774e91d28df0a03b0/EDScoutCore/DataAcquirerForTests.py | EDScoutCore/DataAcquirerForTests.py | import os
import sys
import glob
import json
from EDScoutCore import BodyAppraiser
from EDScoutCore.SavedGamesLocator import get_saved_games_path
def generate_key(body_info):
"""
Generates a key that uniquely identifies the type of processing that BodyAppraiser.calculate_estimated_value will apply so we onl... | python | MIT | 5c1fb49f4c271e9978dbbb5774e91d28df0a03b0 | 2026-01-05T07:10:15.574477Z | false |
joncage/ed-scout | https://github.com/joncage/ed-scout/blob/5c1fb49f4c271e9978dbbb5774e91d28df0a03b0/EDScoutCore/OutputRecorder.py | EDScoutCore/OutputRecorder.py | import json
import os
import platform
from pathlib import Path
from datetime import datetime, timezone
class OutputRecorder:
def __init__(self, file_name_prefix):
osname = platform.system()
if osname == 'Windows':
recording_dir = os.path.join(os.path.expanduser('~'), 'AppData', 'Local... | python | MIT | 5c1fb49f4c271e9978dbbb5774e91d28df0a03b0 | 2026-01-05T07:10:15.574477Z | false |
joncage/ed-scout | https://github.com/joncage/ed-scout/blob/5c1fb49f4c271e9978dbbb5774e91d28df0a03b0/EDScoutCore/test_JournalChangeIdentifier.py | EDScoutCore/test_JournalChangeIdentifier.py | import tempfile
import os
from shutil import copyfile
from .JournalInterface import JournalChangeProcessor
class TestJournalWatcher:
@staticmethod
def get_test_file_path(filename):
script_path = os.path.dirname(__file__)
data_dir = "../ExampleData/"
return os.path.abspath(os.path.joi... | python | MIT | 5c1fb49f4c271e9978dbbb5774e91d28df0a03b0 | 2026-01-05T07:10:15.574477Z | false |
joncage/ed-scout | https://github.com/joncage/ed-scout/blob/5c1fb49f4c271e9978dbbb5774e91d28df0a03b0/EDScoutCore/JournalInterface.py | EDScoutCore/JournalInterface.py | import json
import time
import os
import glob
import logging
from watchdog.observers import Observer
from watchdog.observers.polling import PollingObserver
from watchdog.events import PatternMatchingEventHandler
from .FileSystemUpdatePrompter import FileSystemUpdatePrompter
journal_file_pattern = "Journal.*.log"
log... | python | MIT | 5c1fb49f4c271e9978dbbb5774e91d28df0a03b0 | 2026-01-05T07:10:15.574477Z | false |
joncage/ed-scout | https://github.com/joncage/ed-scout/blob/5c1fb49f4c271e9978dbbb5774e91d28df0a03b0/EDScoutCore/test_JournalWatcher.py | EDScoutCore/test_JournalWatcher.py | import tempfile
import os
import pytest
from shutil import copyfile
from .JournalInterface import JournalWatcher
class TestJournalWatcher():
def setup_method(self):
# Create a temporary directory
self.test_dir = tempfile.TemporaryDirectory()
self.callback_arg = None
def teardown_me... | python | MIT | 5c1fb49f4c271e9978dbbb5774e91d28df0a03b0 | 2026-01-05T07:10:15.574477Z | false |
joncage/ed-scout | https://github.com/joncage/ed-scout/blob/5c1fb49f4c271e9978dbbb5774e91d28df0a03b0/EDScoutCore/__init__.py | EDScoutCore/__init__.py | from . import EDScout
from . import EDSMInterface
from . import BodyAppraiser
from . import NavRouteIntegrator
| python | MIT | 5c1fb49f4c271e9978dbbb5774e91d28df0a03b0 | 2026-01-05T07:10:15.574477Z | false |
joncage/ed-scout | https://github.com/joncage/ed-scout/blob/5c1fb49f4c271e9978dbbb5774e91d28df0a03b0/EDScoutCore/test_BodyAppraiser.py | EDScoutCore/test_BodyAppraiser.py | import pytest
import os
import json
from .BodyAppraiser import calculate_estimated_value, appraise_body
def get_test_file_path(filename):
script_path = os.path.dirname(__file__)
data_dir = "../ExampleData/"
return os.path.abspath(os.path.join(script_path, data_dir, filename))
def test_calculate_estimat... | python | MIT | 5c1fb49f4c271e9978dbbb5774e91d28df0a03b0 | 2026-01-05T07:10:15.574477Z | false |
joncage/ed-scout | https://github.com/joncage/ed-scout/blob/5c1fb49f4c271e9978dbbb5774e91d28df0a03b0/EDScoutCore/NavRouteWatcher.py | EDScoutCore/NavRouteWatcher.py | import json
import time
import logging
from watchdog.observers import Observer
from watchdog.events import PatternMatchingEventHandler
from .SavedGamesLocator import get_saved_games_path
log = logging.getLogger('NavRouteWatcher')
class NavRouteWatcher:
def __init__(self):
path = get_saved_games_path()... | python | MIT | 5c1fb49f4c271e9978dbbb5774e91d28df0a03b0 | 2026-01-05T07:10:15.574477Z | false |
joncage/ed-scout | https://github.com/joncage/ed-scout/blob/5c1fb49f4c271e9978dbbb5774e91d28df0a03b0/EDScoutCore/ZmqWrappers.py | EDScoutCore/ZmqWrappers.py | import eventlet.green.zmq as zmq
class Sender:
def __init__(self):
self.context = zmq.Context()
self.socket = self.context.socket(zmq.PUB)
self.port = self.socket.bind_to_random_port("tcp://*")
def send(self, message):
self.socket.send_string(message)
class Receiver:
d... | python | MIT | 5c1fb49f4c271e9978dbbb5774e91d28df0a03b0 | 2026-01-05T07:10:15.574477Z | false |
asad70/wallstreetbets-sentiment-analysis | https://github.com/asad70/wallstreetbets-sentiment-analysis/blob/8bd1e6c6b6aa3a2940abe072972e7db8538cb3dd/Wallstreetbets.py | Wallstreetbets.py | '''*****************************************************************************
Purpose: To analyze the sentiments of r/wallstreetbets
This program uses Vader SentimentIntensityAnalyzer to calculate the ticker compound value.
You can change multiple parameters to suit your needs. See below under "set program paramete... | python | MIT | 8bd1e6c6b6aa3a2940abe072972e7db8538cb3dd | 2026-01-05T07:10:16.842835Z | false |
asad70/wallstreetbets-sentiment-analysis | https://github.com/asad70/wallstreetbets-sentiment-analysis/blob/8bd1e6c6b6aa3a2940abe072972e7db8538cb3dd/api.py | api.py | from flask import Flask, jsonify
import Wallstreetbets
import json
import os
clientid = os.getenv('CLIENT_ID')
clientsecret = os.getenv('CLIENT_SECRET')
usernme = os.getenv('USERNAME')
passwrd = os.getenv('PASSWORD')
app = Flask(__name__)
@app.route("/analyze")
def hello():
print("Analyzing WallStreetBets")
... | python | MIT | 8bd1e6c6b6aa3a2940abe072972e7db8538cb3dd | 2026-01-05T07:10:16.842835Z | false |
asad70/wallstreetbets-sentiment-analysis | https://github.com/asad70/wallstreetbets-sentiment-analysis/blob/8bd1e6c6b6aa3a2940abe072972e7db8538cb3dd/data.py | data.py | '''includes US stock symbols with market cap > 100 Million, and price above $3. As wsb doesn't allow
penny stocks discussions.
Download the csv file https://www.nasdaq.com/market-activity/stocks/screener?exchange=nasdaq&letter=0&render=download
of all the NYSE, NASDAQ and NYSEAMERICAN public traded companies.
'''
us... | python | MIT | 8bd1e6c6b6aa3a2940abe072972e7db8538cb3dd | 2026-01-05T07:10:16.842835Z | true |
StackGuardian/tirith | https://github.com/StackGuardian/tirith/blob/c0675040d00d56a19bfbf009024a47026276abd5/setup.py | setup.py | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
from __future__ import absolute_import
from __future__ import print_function
import io
import re
from glob import glob
from os.path import basename
from os.path import dirname
from os.path import join
from os.path import splitext
from setuptools import find_packages
fro... | python | Apache-2.0 | c0675040d00d56a19bfbf009024a47026276abd5 | 2026-01-05T07:10:13.936244Z | false |
StackGuardian/tirith | https://github.com/StackGuardian/tirith/blob/c0675040d00d56a19bfbf009024a47026276abd5/tools/bump_version.py | tools/bump_version.py | #!/usr/bin/env python3
"""
Version Bump Script for Tirith
This script automatically bumps the version in all necessary files:
- setup.py
- src/tirith/__init__.py
- CHANGELOG.md
Usage:
python bump_version.py <new_version> [--change-type TYPE] [--description DESC]
Examples:
python bump_version.py 1.0.5 --chang... | python | Apache-2.0 | c0675040d00d56a19bfbf009024a47026276abd5 | 2026-01-05T07:10:13.936244Z | false |
StackGuardian/tirith | https://github.com/StackGuardian/tirith/blob/c0675040d00d56a19bfbf009024a47026276abd5/src/tirith/cli.py | src/tirith/cli.py | """
CLI
"""
import argparse
import json
import logging
import sys
import textwrap
from tirith.logging import setup_logging
from tirith.prettyprinter import pretty_print_result_dict
from tirith.status import ExitStatus
from tirith import __version__
from .core import start_policy_evaluation
logger = logging.getLogg... | python | Apache-2.0 | c0675040d00d56a19bfbf009024a47026276abd5 | 2026-01-05T07:10:13.936244Z | false |
StackGuardian/tirith | https://github.com/StackGuardian/tirith/blob/c0675040d00d56a19bfbf009024a47026276abd5/src/tirith/__main__.py | src/tirith/__main__.py | #!/usr/bin/env python
"""
Entrypoint module when invoked like `python -m tirith`.
"""
import sys
def main():
try:
from .cli import main
exit_status = main()
except KeyboardInterrupt:
from tirith.status import ExitStatus
exit_status = ExitStatus.ERROR_CTRL_C
if exit_statu... | python | Apache-2.0 | c0675040d00d56a19bfbf009024a47026276abd5 | 2026-01-05T07:10:13.936244Z | false |
StackGuardian/tirith | https://github.com/StackGuardian/tirith/blob/c0675040d00d56a19bfbf009024a47026276abd5/src/tirith/utils.py | src/tirith/utils.py | import logging
import json
logger = logging.getLogger(__name__)
from typing import Any
def json_format_value(value: Any) -> str:
"""
Format a Python value as a JSON string representation.
This produces a more language-agnostic representation of values that's
suitable for displaying in evaluation mes... | python | Apache-2.0 | c0675040d00d56a19bfbf009024a47026276abd5 | 2026-01-05T07:10:13.936244Z | false |
StackGuardian/tirith | https://github.com/StackGuardian/tirith/blob/c0675040d00d56a19bfbf009024a47026276abd5/src/tirith/logging.py | src/tirith/logging.py | """
Sets up logging configuration for the application.
"""
import logging
import logging.config
import sys
from typing import Any, Dict
DEFAULT_LOGGING_CONFIG: Dict[str, Any] = {
"version": 1,
"formatters": {
"verbose_formatter": {
"format": "[%(levelname)s] (%(process)d) %(asctime)s (%(pa... | python | Apache-2.0 | c0675040d00d56a19bfbf009024a47026276abd5 | 2026-01-05T07:10:13.936244Z | false |
StackGuardian/tirith | https://github.com/StackGuardian/tirith/blob/c0675040d00d56a19bfbf009024a47026276abd5/src/tirith/__init__.py | src/tirith/__init__.py | """
tirith: Execute policies defined using Tirith (StackGuardian Policy Framework)
"""
__version__ = "1.0.5"
__author__ = "StackGuardian"
__license__ = "Apache"
| python | Apache-2.0 | c0675040d00d56a19bfbf009024a47026276abd5 | 2026-01-05T07:10:13.936244Z | false |
StackGuardian/tirith | https://github.com/StackGuardian/tirith/blob/c0675040d00d56a19bfbf009024a47026276abd5/src/tirith/prettyprinter.py | src/tirith/prettyprinter.py | from typing import Dict, List
class TermStyle:
PURE_RED = "\033[0;31m"
DARK_GREEN = "\033[0;32m"
ORANGE = "\033[0;33m"
DARK_BLUE = "\033[0;34m"
BRIGHT_PURPLE = "\033[0;35m"
DARK_CYAN = "\033[0;36m"
DULL_WHITE = "\033[0;37m"
PURE_BLACK = "\033[0;30m"
BRIGHT_RED = "\033[0;91m"
LI... | python | Apache-2.0 | c0675040d00d56a19bfbf009024a47026276abd5 | 2026-01-05T07:10:13.936244Z | false |
StackGuardian/tirith | https://github.com/StackGuardian/tirith/blob/c0675040d00d56a19bfbf009024a47026276abd5/src/tirith/status.py | src/tirith/status.py | from enum import IntEnum, unique
@unique
class ExitStatus(IntEnum):
"""Program exit status code constants."""
SUCCESS = 0
ERROR = 1
ERROR_TIMEOUT = 2
# <http://www.tldp.org/LDP/abs/html/exitcodes.html>
# 128+2 SIGINT
ERROR_CTRL_C = 130
| python | Apache-2.0 | c0675040d00d56a19bfbf009024a47026276abd5 | 2026-01-05T07:10:13.936244Z | false |
StackGuardian/tirith | https://github.com/StackGuardian/tirith/blob/c0675040d00d56a19bfbf009024a47026276abd5/src/tirith/exceptions/all.py | src/tirith/exceptions/all.py | class UnsupportedConditionTypeInPolicy(Exception):
def __init__(self, message="Condition Type is not supported"):
self.message = message
super().__init__(self.message)
class UnsupportedKeyInPolicy(Exception):
def __init__(self, message="Unsupported Key in policy"):
self.message = messa... | python | Apache-2.0 | c0675040d00d56a19bfbf009024a47026276abd5 | 2026-01-05T07:10:13.936244Z | false |
StackGuardian/tirith | https://github.com/StackGuardian/tirith/blob/c0675040d00d56a19bfbf009024a47026276abd5/src/tirith/exceptions/__init__.py | src/tirith/exceptions/__init__.py | python | Apache-2.0 | c0675040d00d56a19bfbf009024a47026276abd5 | 2026-01-05T07:10:13.936244Z | false | |
StackGuardian/tirith | https://github.com/StackGuardian/tirith/blob/c0675040d00d56a19bfbf009024a47026276abd5/src/tirith/providers/common.py | src/tirith/providers/common.py | import pydash
from typing import Dict, Any
def create_result_dict(value=None, meta=None, err=None) -> Dict:
return dict(value=value, meta=meta, err=err)
class PydashPathNotFound:
pass
def _get_path_value_from_input_internal(splitted_paths, input_data, place_none_if_not_found=False):
if not splitted_... | python | Apache-2.0 | c0675040d00d56a19bfbf009024a47026276abd5 | 2026-01-05T07:10:13.936244Z | false |
StackGuardian/tirith | https://github.com/StackGuardian/tirith/blob/c0675040d00d56a19bfbf009024a47026276abd5/src/tirith/providers/__init__.py | src/tirith/providers/__init__.py | from typing import Callable, Dict
from .terraform_plan.handler import *
from .infracost import provide as infracost_provider
from .sg_workflow import provide as sg_wf_provider
from .terraform_plan import provide as terraform_provider
from .json import provide as json_provider
from .kubernetes import provide as kuberne... | python | Apache-2.0 | c0675040d00d56a19bfbf009024a47026276abd5 | 2026-01-05T07:10:13.936244Z | false |
StackGuardian/tirith | https://github.com/StackGuardian/tirith/blob/c0675040d00d56a19bfbf009024a47026276abd5/src/tirith/providers/infracost/handler.py | src/tirith/providers/infracost/handler.py | import logging
logger = logging.getLogger(__name__)
def __get_all_costs(operation_type, input_data):
logger.debug(f"costType : {operation_type}")
pointer = {
"total_monthly_cost": ["totalMonthlyCost", "monthlyCost"],
"total_hourly_cost": ["totalHourlyCost", "hourlyCost"],
}
total_sum... | python | Apache-2.0 | c0675040d00d56a19bfbf009024a47026276abd5 | 2026-01-05T07:10:13.936244Z | false |
StackGuardian/tirith | https://github.com/StackGuardian/tirith/blob/c0675040d00d56a19bfbf009024a47026276abd5/src/tirith/providers/infracost/__init__.py | src/tirith/providers/infracost/__init__.py | from .handler import provide
| python | Apache-2.0 | c0675040d00d56a19bfbf009024a47026276abd5 | 2026-01-05T07:10:13.936244Z | false |
StackGuardian/tirith | https://github.com/StackGuardian/tirith/blob/c0675040d00d56a19bfbf009024a47026276abd5/src/tirith/providers/terraform_plan/handler.py | src/tirith/providers/terraform_plan/handler.py | """
terraform_plan provider
Error severity values explanation
Value = 1, When a resource is not found
Value = 2, When an attribute of a resource is not found
"""
# input->(list ["a.b","c", "d"],value of resource)
# returns->[any, any, any]
from typing import Iterable, Tuple
import pydash
from ..common import Provide... | python | Apache-2.0 | c0675040d00d56a19bfbf009024a47026276abd5 | 2026-01-05T07:10:13.936244Z | false |
StackGuardian/tirith | https://github.com/StackGuardian/tirith/blob/c0675040d00d56a19bfbf009024a47026276abd5/src/tirith/providers/terraform_plan/__init__.py | src/tirith/providers/terraform_plan/__init__.py | from .handler import provide
| python | Apache-2.0 | c0675040d00d56a19bfbf009024a47026276abd5 | 2026-01-05T07:10:13.936244Z | false |
StackGuardian/tirith | https://github.com/StackGuardian/tirith/blob/c0675040d00d56a19bfbf009024a47026276abd5/src/tirith/providers/sg_workflow/handler.py | src/tirith/providers/sg_workflow/handler.py | import logging
logger = logging.getLogger(__name__)
def __getValue(key, data):
logger.debug(f"Searching {key} in input data")
result = ""
if key == "integrationId":
temp = []
if "DeploymentPlatformConfig" in data:
for obj in data["DeploymentPlatformConfig"]:
i... | python | Apache-2.0 | c0675040d00d56a19bfbf009024a47026276abd5 | 2026-01-05T07:10:13.936244Z | false |
StackGuardian/tirith | https://github.com/StackGuardian/tirith/blob/c0675040d00d56a19bfbf009024a47026276abd5/src/tirith/providers/sg_workflow/__init__.py | src/tirith/providers/sg_workflow/__init__.py | from .handler import provide
| python | Apache-2.0 | c0675040d00d56a19bfbf009024a47026276abd5 | 2026-01-05T07:10:13.936244Z | false |
StackGuardian/tirith | https://github.com/StackGuardian/tirith/blob/c0675040d00d56a19bfbf009024a47026276abd5/src/tirith/providers/json/handler.py | src/tirith/providers/json/handler.py | from typing import Callable, Dict, List
from ..common import create_result_dict, ProviderError, get_path_value_from_input
def get_value(provider_args: Dict, input_data: Dict) -> List[dict]:
# Must be validated first whether the provider args are valid for this op type
key_path: str = provider_args["key_path"]... | python | Apache-2.0 | c0675040d00d56a19bfbf009024a47026276abd5 | 2026-01-05T07:10:13.936244Z | false |
StackGuardian/tirith | https://github.com/StackGuardian/tirith/blob/c0675040d00d56a19bfbf009024a47026276abd5/src/tirith/providers/json/__init__.py | src/tirith/providers/json/__init__.py | from .handler import provide
| python | Apache-2.0 | c0675040d00d56a19bfbf009024a47026276abd5 | 2026-01-05T07:10:13.936244Z | false |
StackGuardian/tirith | https://github.com/StackGuardian/tirith/blob/c0675040d00d56a19bfbf009024a47026276abd5/src/tirith/providers/kubernetes/handler.py | src/tirith/providers/kubernetes/handler.py | from typing import Callable, Dict, List, Union
from ..common import create_result_dict, ProviderError, get_path_value_from_input
def get_value(provider_args: Dict, input_data: Union[Dict, List], outputs: list) -> Dict:
# Must be validated first whether the provider args are valid for this op type
target_kind:... | python | Apache-2.0 | c0675040d00d56a19bfbf009024a47026276abd5 | 2026-01-05T07:10:13.936244Z | false |
StackGuardian/tirith | https://github.com/StackGuardian/tirith/blob/c0675040d00d56a19bfbf009024a47026276abd5/src/tirith/providers/kubernetes/__init__.py | src/tirith/providers/kubernetes/__init__.py | from .handler import provide
| python | Apache-2.0 | c0675040d00d56a19bfbf009024a47026276abd5 | 2026-01-05T07:10:13.936244Z | false |
StackGuardian/tirith | https://github.com/StackGuardian/tirith/blob/c0675040d00d56a19bfbf009024a47026276abd5/src/tirith/core/policy_parameterization.py | src/tirith/core/policy_parameterization.py | import re
import pydash
from typing import List, Tuple
_VAR_PATTERN = re.compile(r"{{\s*var\.([\w\.]+)\s*}}")
class _VariableNotFound:
pass
def _replace_vars_in_dict(dictionary: dict, var_dict: dict, not_found_vars: List[str]):
"""
Replace the variables in the dictionary with the values from the var_d... | python | Apache-2.0 | c0675040d00d56a19bfbf009024a47026276abd5 | 2026-01-05T07:10:13.936244Z | false |
StackGuardian/tirith | https://github.com/StackGuardian/tirith/blob/c0675040d00d56a19bfbf009024a47026276abd5/src/tirith/core/core.py | src/tirith/core/core.py | import ast
import json
import logging
import re
import yaml
from types import CodeType
from typing import Any, Dict, List, Tuple, Optional
from tirith.providers.common import ProviderError
from ..providers import PROVIDERS_DICT
from .evaluators import EVALUATORS_DICT
from .policy_parameterization import get_policy_wi... | python | Apache-2.0 | c0675040d00d56a19bfbf009024a47026276abd5 | 2026-01-05T07:10:13.936244Z | false |
StackGuardian/tirith | https://github.com/StackGuardian/tirith/blob/c0675040d00d56a19bfbf009024a47026276abd5/src/tirith/core/__init__.py | src/tirith/core/__init__.py | from .core import start_policy_evaluation
| python | Apache-2.0 | c0675040d00d56a19bfbf009024a47026276abd5 | 2026-01-05T07:10:13.936244Z | false |
StackGuardian/tirith | https://github.com/StackGuardian/tirith/blob/c0675040d00d56a19bfbf009024a47026276abd5/src/tirith/core/evaluators/not_contains.py | src/tirith/core/evaluators/not_contains.py | import logging
from .base_evaluator import BaseEvaluator
from tirith.utils import sort_collections, json_format_value
logger = logging.getLogger(__name__)
# Checks if :attr: `evaluator_input` does not contain :attr:`evaluator_data`.
# Args:
# value (mixed): Value to compare.
# other (mixed): Other value to... | python | Apache-2.0 | c0675040d00d56a19bfbf009024a47026276abd5 | 2026-01-05T07:10:13.936244Z | false |
StackGuardian/tirith | https://github.com/StackGuardian/tirith/blob/c0675040d00d56a19bfbf009024a47026276abd5/src/tirith/core/evaluators/regex_match.py | src/tirith/core/evaluators/regex_match.py | import re
from .base_evaluator import BaseEvaluator
from tirith.utils import json_format_value
class RegexMatch(BaseEvaluator):
def evaluate(self, evaluator_input, evaluator_data):
evaluation_result = {"passed": False, "message": "Not evaluated"}
try:
match = 0
if type(eva... | python | Apache-2.0 | c0675040d00d56a19bfbf009024a47026276abd5 | 2026-01-05T07:10:13.936244Z | false |
StackGuardian/tirith | https://github.com/StackGuardian/tirith/blob/c0675040d00d56a19bfbf009024a47026276abd5/src/tirith/core/evaluators/greater_than_equal_to.py | src/tirith/core/evaluators/greater_than_equal_to.py | import logging
from typing import Dict, Any
from .base_evaluator import BaseEvaluator
from tirith.utils import json_format_value
# Checks if :attr:`value` is more then or equal to :attr:`other`. Automatically casts values to the same type if possible.
# Args:
# value (mixed): Value to compare.
# other (mixed)... | python | Apache-2.0 | c0675040d00d56a19bfbf009024a47026276abd5 | 2026-01-05T07:10:13.936244Z | false |
StackGuardian/tirith | https://github.com/StackGuardian/tirith/blob/c0675040d00d56a19bfbf009024a47026276abd5/src/tirith/core/evaluators/base_evaluator.py | src/tirith/core/evaluators/base_evaluator.py | from abc import ABC, abstractmethod
from typing import Any, Dict, TypedDict
class EvaluatorResult(TypedDict):
passed: bool
message: str
error: str
meta: Any
class BaseEvaluator(ABC):
@abstractmethod
def evaluate(self, evaluator_input: Dict, evaluator_data: Dict) -> EvaluatorResult:
"... | python | Apache-2.0 | c0675040d00d56a19bfbf009024a47026276abd5 | 2026-01-05T07:10:13.936244Z | false |
StackGuardian/tirith | https://github.com/StackGuardian/tirith/blob/c0675040d00d56a19bfbf009024a47026276abd5/src/tirith/core/evaluators/is_not_empty.py | src/tirith/core/evaluators/is_not_empty.py | from .base_evaluator import BaseEvaluator
from tirith.utils import json_format_value
# Checks if input is not empty
# Args:
# value (mixed): Value to check.
# Returns:
# bool: Whether :attr:`value` is not empty
# Example:
# >>> e('')
# False
# >>> e("abc")
# True
# >>> l([])
# False... | python | Apache-2.0 | c0675040d00d56a19bfbf009024a47026276abd5 | 2026-01-05T07:10:13.936244Z | false |
StackGuardian/tirith | https://github.com/StackGuardian/tirith/blob/c0675040d00d56a19bfbf009024a47026276abd5/src/tirith/core/evaluators/not_equals.py | src/tirith/core/evaluators/not_equals.py | import logging
from typing import Dict, Any
from .base_evaluator import BaseEvaluator
from tirith.utils import sort_collections, json_format_value
logger = logging.getLogger(__name__)
# Checks if :attr:`value` is not equal to :attr:`other`. Automatically casts values to the same type if possible.
# Args:
# valu... | python | Apache-2.0 | c0675040d00d56a19bfbf009024a47026276abd5 | 2026-01-05T07:10:13.936244Z | false |
StackGuardian/tirith | https://github.com/StackGuardian/tirith/blob/c0675040d00d56a19bfbf009024a47026276abd5/src/tirith/core/evaluators/less_than.py | src/tirith/core/evaluators/less_than.py | import logging
from typing import Dict, Any
from .base_evaluator import BaseEvaluator
from tirith.utils import json_format_value
# Checks if :attr:`value` is less then :attr:`other`. Automatically casts values to the same type if possible.
# Args:
# value (mixed): Value to compare.
# other (mixed): Other val... | python | Apache-2.0 | c0675040d00d56a19bfbf009024a47026276abd5 | 2026-01-05T07:10:13.936244Z | false |
StackGuardian/tirith | https://github.com/StackGuardian/tirith/blob/c0675040d00d56a19bfbf009024a47026276abd5/src/tirith/core/evaluators/contained_in.py | src/tirith/core/evaluators/contained_in.py | import logging
from .base_evaluator import BaseEvaluator
from tirith.utils import sort_collections, json_format_value
logger = logging.getLogger(__name__)
# Checks if :attr: `evaluator_input` is contained in :attr:`evaluator_data`.
# Args:
# value (mixed): Value to compare.
# other (mixed): Other value to c... | python | Apache-2.0 | c0675040d00d56a19bfbf009024a47026276abd5 | 2026-01-05T07:10:13.936244Z | false |
StackGuardian/tirith | https://github.com/StackGuardian/tirith/blob/c0675040d00d56a19bfbf009024a47026276abd5/src/tirith/core/evaluators/is_empty.py | src/tirith/core/evaluators/is_empty.py | import logging
from typing import Dict, Any
from .base_evaluator import BaseEvaluator
from tirith.utils import json_format_value
# Checks if input is empty (null, empty list [], empty dict {}, empty str '')
# Args:
# value (mixed): Value to check.
# Returns:
# bool: Whether :attr:`value` is empty
# Example... | python | Apache-2.0 | c0675040d00d56a19bfbf009024a47026276abd5 | 2026-01-05T07:10:13.936244Z | false |
StackGuardian/tirith | https://github.com/StackGuardian/tirith/blob/c0675040d00d56a19bfbf009024a47026276abd5/src/tirith/core/evaluators/__init__.py | src/tirith/core/evaluators/__init__.py | from typing import Dict, Type
from .base_evaluator import BaseEvaluator
from .contained_in import ContainedIn
from .contains import Contains
from .equals import Equals
from .greater_than_equal_to import GreaterThanEqualTo
from .greater_than import GreaterThan
from .is_empty import IsEmpty
from .is_not_empty import IsN... | python | Apache-2.0 | c0675040d00d56a19bfbf009024a47026276abd5 | 2026-01-05T07:10:13.936244Z | false |
StackGuardian/tirith | https://github.com/StackGuardian/tirith/blob/c0675040d00d56a19bfbf009024a47026276abd5/src/tirith/core/evaluators/contains.py | src/tirith/core/evaluators/contains.py | import logging
from typing import Any
from .base_evaluator import BaseEvaluator
from tirith.utils import sort_collections, json_format_value
logger = logging.getLogger(__name__)
# Checks if :attr: `evaluator_input` is contained in :attr:`evaluator_data`.
# Args:
# value (mixed): Value to compare.
# other (... | python | Apache-2.0 | c0675040d00d56a19bfbf009024a47026276abd5 | 2026-01-05T07:10:13.936244Z | false |
StackGuardian/tirith | https://github.com/StackGuardian/tirith/blob/c0675040d00d56a19bfbf009024a47026276abd5/src/tirith/core/evaluators/equals.py | src/tirith/core/evaluators/equals.py | import logging
from typing import Dict, Any
from .base_evaluator import BaseEvaluator
from tirith.utils import sort_collections, json_format_value
logger = logging.getLogger(__name__)
# Checks if :attr:`value` is equal to :attr:`other`. Automatically casts values to the same type if possible.
# Args:
# value (m... | python | Apache-2.0 | c0675040d00d56a19bfbf009024a47026276abd5 | 2026-01-05T07:10:13.936244Z | false |
StackGuardian/tirith | https://github.com/StackGuardian/tirith/blob/c0675040d00d56a19bfbf009024a47026276abd5/src/tirith/core/evaluators/less_than_equal_to.py | src/tirith/core/evaluators/less_than_equal_to.py | import logging
from typing import Dict, Any
from .base_evaluator import BaseEvaluator
from tirith.utils import json_format_value
# Checks if :attr:`value` is less then or equal to :attr:`other`. Automatically casts values to the same type if possible.
# Args:
# value (mixed): Value to compare.
# other (mixed... | python | Apache-2.0 | c0675040d00d56a19bfbf009024a47026276abd5 | 2026-01-05T07:10:13.936244Z | false |
StackGuardian/tirith | https://github.com/StackGuardian/tirith/blob/c0675040d00d56a19bfbf009024a47026276abd5/src/tirith/core/evaluators/greater_than.py | src/tirith/core/evaluators/greater_than.py | import logging
from typing import Dict, Any
from .base_evaluator import BaseEvaluator
from tirith.utils import json_format_value
logger = logging.getLogger(__name__)
# Checks if :attr:`value` is more then :attr:`other`. Automatically casts values to the same type if possible.
# Args:
# value (mixed): Value to... | python | Apache-2.0 | c0675040d00d56a19bfbf009024a47026276abd5 | 2026-01-05T07:10:13.936244Z | false |
StackGuardian/tirith | https://github.com/StackGuardian/tirith/blob/c0675040d00d56a19bfbf009024a47026276abd5/src/tirith/core/evaluators/not_contained_in.py | src/tirith/core/evaluators/not_contained_in.py | import logging
from .base_evaluator import BaseEvaluator
from tirith.utils import sort_collections, json_format_value
logger = logging.getLogger(__name__)
# Checks if :attr: `evaluator_input` is not contained in :attr:`evaluator_data`.
# Args:
# value (mixed): Value to compare.
# other (mixed): Other value... | python | Apache-2.0 | c0675040d00d56a19bfbf009024a47026276abd5 | 2026-01-05T07:10:13.936244Z | false |
StackGuardian/tirith | https://github.com/StackGuardian/tirith/blob/c0675040d00d56a19bfbf009024a47026276abd5/tests/providers/test_common.py | tests/providers/test_common.py | import pytest
from tirith.providers.common import get_path_value_from_input
# Test data for simple path access
simple_path_cases = [
({"user": {"name": "Alice", "age": 30}}, "user.name", ["Alice"]),
({"level1": {"level2": {"level3": {"value": "deep"}}}}, "level1.level2.level3.value", ["deep"]),
({"name": ... | python | Apache-2.0 | c0675040d00d56a19bfbf009024a47026276abd5 | 2026-01-05T07:10:13.936244Z | false |
StackGuardian/tirith | https://github.com/StackGuardian/tirith/blob/c0675040d00d56a19bfbf009024a47026276abd5/tests/providers/infracost/tests_infracost.py | tests/providers/infracost/tests_infracost.py | import json
import os
import pytest
from tirith.providers.infracost import handler
def load_terraform_plan_json(json_path):
with open(f"{os.path.dirname(os.path.abspath(__file__))}/{json_path}", "r") as fp:
return json.load(fp)
input_data = load_terraform_plan_json("input.json")
provider_inputs_1 = {
... | python | Apache-2.0 | c0675040d00d56a19bfbf009024a47026276abd5 | 2026-01-05T07:10:13.936244Z | false |
StackGuardian/tirith | https://github.com/StackGuardian/tirith/blob/c0675040d00d56a19bfbf009024a47026276abd5/tests/providers/terraform_plan/test_terraform_plan.py | tests/providers/terraform_plan/test_terraform_plan.py | import pytest
from tirith.providers.terraform_plan import handler
from utils import load_terraform_plan_json
input_data = load_terraform_plan_json("input.json")
# 1 and 2 -----> To check output of the attribute that if the functionality is active or not
provider_args_1 = {
"operation_type": "attribute",
"t... | python | Apache-2.0 | c0675040d00d56a19bfbf009024a47026276abd5 | 2026-01-05T07:10:13.936244Z | false |
StackGuardian/tirith | https://github.com/StackGuardian/tirith/blob/c0675040d00d56a19bfbf009024a47026276abd5/tests/providers/terraform_plan/test_exclude_resource_types.py | tests/providers/terraform_plan/test_exclude_resource_types.py | import pytest
from tirith.providers.terraform_plan import handler
from tirith.core.core import start_policy_evaluation_from_dict
import json
import os
def load_json_from_fixtures(json_path):
current_path = os.path.dirname(os.path.abspath(__file__))
with open(os.path.join(current_path, "fixtures", json_path)) ... | python | Apache-2.0 | c0675040d00d56a19bfbf009024a47026276abd5 | 2026-01-05T07:10:13.936244Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.