repo_full_name stringlengths 6 93 | repo_url stringlengths 25 112 | repo_api_url stringclasses 28
values | owner stringclasses 28
values | repo_name stringclasses 28
values | description stringclasses 28
values | stars int64 617 98.8k | forks int64 31 355 ⌀ | watchers int64 990 999 ⌀ | license stringclasses 2
values | default_branch stringclasses 2
values | repo_created_at timestamp[s]date 2012-07-24 23:12:50 2025-06-16 08:07:28 ⌀ | repo_updated_at timestamp[s]date 2026-02-23 15:23:15 2026-05-03 18:52:12 ⌀ | repo_topics listlengths 0 13 ⌀ | repo_languages unknown | is_fork bool 1
class | open_issues int64 3 104 ⌀ | file_path stringlengths 3 208 | file_name stringclasses 509
values | file_extension stringclasses 1
value | file_size_bytes int64 101 84k ⌀ | file_url stringclasses 627
values | file_raw_url stringclasses 627
values | file_sha stringclasses 624
values | language stringclasses 8
values | parsed_at stringdate 2026-05-04 01:12:36 2026-05-04 19:41:55 | text stringlengths 100 102k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
LeCAR-Lab/dial-mpc | https://github.com/LeCAR-Lab/dial-mpc | null | null | null | null | 966 | null | null | apache-2.0 | null | null | null | null | null | null | null | dial_mpc/core/dial_config.py | null | null | null | null | null | null | Python | 2026-05-04T02:37:28.511035 | from dataclasses import dataclass
@dataclass
class DialConfig:
# exp
seed: int = 0
output_dir: str = "output"
n_steps: int = 100
# env
env_name: str = "unitree_h1_walk"
# diffusion
Nsample: int = 2048 # number of samples
Hsample: int = 16 # horizon of samples
Hnode: int = 4 ... |
LeCAR-Lab/dial-mpc | https://github.com/LeCAR-Lab/dial-mpc | null | null | null | null | 966 | null | null | apache-2.0 | null | null | null | null | null | null | null | dial_mpc/config/base_env_config.py | null | null | null | null | null | null | Python | 2026-05-04T02:37:28.512029 | from dataclasses import dataclass
@dataclass
class BaseEnvConfig:
task_name: str = "default"
randomize_tasks: bool = False # Whether to randomize the task.
# P gain, or a list of P gains for each joint.
kp: float = 30.0
# D gain, or a list of D gains for each joint.
kd: float = 1.0
debug:... |
LeCAR-Lab/dial-mpc | https://github.com/LeCAR-Lab/dial-mpc | null | null | null | null | 966 | null | null | apache-2.0 | null | null | null | null | null | null | null | dial_mpc/core/dial_sim2sim.py | null | null | null | null | null | null | Python | 2026-05-04T02:37:28.515643 | import subprocess
import sys
import time
def main():
args = sys.argv[1:]
arg_list = args if args is not None else []
subprocess.run(["dial-mpc-sim"] + arg_list)
delay = 2.0
time.sleep(delay)
subprocess.run(["dial-mpc-plan"] + arg_list)
|
LeCAR-Lab/dial-mpc | https://github.com/LeCAR-Lab/dial-mpc | null | null | null | null | 966 | null | null | apache-2.0 | null | null | null | null | null | null | null | dial_mpc/deploy/dial_real.py | null | null | null | null | null | null | Python | 2026-05-04T02:37:28.516663 | import os
import time
import csv
import sys
import importlib
from multiprocessing import shared_memory
from threading import Thread
from typing import List, Union
from dataclasses import dataclass
import mujoco
import mujoco.viewer
import numpy as np
import argparse
from scipy.spatial.transform import Rotation as R
im... |
LeCAR-Lab/dial-mpc | https://github.com/LeCAR-Lab/dial-mpc | null | null | null | null | 966 | null | null | apache-2.0 | null | null | null | null | null | null | null | dial_mpc/core/dial_core.py | null | null | null | null | null | null | Python | 2026-05-04T02:37:28.545482 | import os
import time
from dataclasses import dataclass
import importlib
import sys
import yaml
import argparse
from tqdm import tqdm
import matplotlib.pyplot as plt
import scienceplots
import art
import emoji
import jax
from jax import numpy as jnp
from jax_cosmo.scipy.interpolate import InterpolatedUnivariateSpline... |
LeCAR-Lab/dial-mpc | https://github.com/LeCAR-Lab/dial-mpc | null | null | null | null | 966 | null | null | apache-2.0 | null | null | null | null | null | null | null | dial_mpc/deploy/localization/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T02:37:29.123276 | import threading
import pkgutil
import os
import importlib
plugin_registry = {}
_registry_lock = threading.Lock()
def get_available_plugins():
with _registry_lock:
return list(plugin_registry.keys())
def discover_builtin_plugins():
plugin_path = os.path.dirname(__file__)
for finder, name, ispkg i... |
LeCAR-Lab/dial-mpc | https://github.com/LeCAR-Lab/dial-mpc | null | null | null | null | 966 | null | null | apache-2.0 | null | null | null | null | null | null | null | dial_mpc/deploy/dial_sim.py | null | null | null | null | null | null | Python | 2026-05-04T02:37:29.124812 | import os
import time
from multiprocessing import shared_memory
from dataclasses import dataclass
import importlib
import sys
import yaml
import argparse
import numpy as np
import matplotlib.pyplot as plt
import scienceplots
import art
import mujoco
import mujoco.viewer
from dial_mpc.config.base_env_config import Ba... |
LeCAR-Lab/dial-mpc | https://github.com/LeCAR-Lab/dial-mpc | null | null | null | null | 966 | null | null | apache-2.0 | null | null | null | null | null | null | null | dial_mpc/deploy/localization/ros2_odometry_plugin.py | null | null | null | null | null | null | Python | 2026-05-04T02:37:29.150745 | import numpy as np
from scipy.spatial.transform import Rotation as R
import rclpy
from rclpy.node import Node
from nav_msgs.msg import Odometry
from dial_mpc.deploy.localization.base_plugin import BaseLocalizationPlugin
class ROS2OdometryPlugin(BaseLocalizationPlugin, Node):
def __init__(self, config):
... |
LeCAR-Lab/dial-mpc | https://github.com/LeCAR-Lab/dial-mpc | null | null | null | null | 966 | null | null | apache-2.0 | null | null | null | null | null | null | null | dial_mpc/envs/base_env.py | null | null | null | null | null | null | Python | 2026-05-04T02:37:29.151932 | from dataclasses import dataclass
from typing import Any, Dict, Sequence, Tuple, Union, List
import jax
import jax.numpy as jnp
from functools import partial
from brax.base import System
from brax.envs.base import PipelineEnv
from dial_mpc.config.base_env_config import BaseEnvConfig
class BaseEnv(PipelineEnv):
... |
LeCAR-Lab/dial-mpc | https://github.com/LeCAR-Lab/dial-mpc | null | null | null | null | 966 | null | null | apache-2.0 | null | null | null | null | null | null | null | dial_mpc/deploy/localization/base_plugin.py | null | null | null | null | null | null | Python | 2026-05-04T02:37:29.181156 | from typing import Dict, Any
class BaseLocalizationPlugin:
def __init__(self, config: Dict[str, Any]):
self.config = config
def get_state(self):
"""
Returns base qpos (3+4) and qvel (3+3) in a 1D array of size 13.
Returns None if no update has been received.
ALL VELOCI... |
LeCAR-Lab/dial-mpc | https://github.com/LeCAR-Lab/dial-mpc | null | null | null | null | 966 | null | null | apache-2.0 | null | null | null | null | null | null | null | dial_mpc/envs/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T02:37:29.182172 | from typing import Any, Dict, Sequence, Tuple, Union, List
from dial_mpc.envs.unitree_h1_env import (
UnitreeH1WalkEnvConfig,
UnitreeH1PushCrateEnvConfig,
UnitreeH1LocoEnvConfig,
)
from dial_mpc.envs.unitree_go2_env import (
UnitreeGo2EnvConfig,
UnitreeGo2SeqJumpEnvConfig,
UnitreeGo2CrateEnvConf... |
LeCAR-Lab/dial-mpc | https://github.com/LeCAR-Lab/dial-mpc | null | null | null | null | 966 | null | null | apache-2.0 | null | null | null | null | null | null | null | dial_mpc/envs/manipulation.py | null | null | null | null | null | null | Python | 2026-05-04T02:37:29.183212 | from dataclasses import dataclass
from typing import Any, Dict, Sequence, Tuple, Union, List
import jax
import jax.numpy as jnp
from functools import partial
from brax import math
import brax.base as base
from brax.base import System
from brax import envs as brax_envs
from brax.envs.base import PipelineEnv, State
fro... |
LeCAR-Lab/dial-mpc | https://github.com/LeCAR-Lab/dial-mpc | null | null | null | null | 966 | null | null | apache-2.0 | null | null | null | null | null | null | null | dial_mpc/deploy/localization/vicon_shm_plugin.py | null | null | null | null | null | null | Python | 2026-05-04T02:37:29.184125 | import struct
import time
from multiprocessing import shared_memory
import threading
import numpy as np
from scipy.spatial.transform import Rotation as R
from scipy.signal import butter, lfilter
from pyvicon_datastream import tools
from dial_mpc.deploy.localization.base_plugin import BaseLocalizationPlugin
class Vic... |
LeCAR-Lab/dial-mpc | https://github.com/LeCAR-Lab/dial-mpc | null | null | null | null | 966 | null | null | apache-2.0 | null | null | null | null | null | null | null | dial_mpc/envs/unitree_go2_env.py | null | null | null | null | null | null | Python | 2026-05-04T02:37:29.186411 | from dataclasses import dataclass
from typing import Any, Dict, Sequence, Tuple, Union, List
import numpy as np
import jax
import jax.numpy as jnp
from functools import partial
from brax import math
import brax.base as base
from brax.base import System
from brax import envs as brax_envs
from brax.envs.base import Pi... |
LeCAR-Lab/dial-mpc | https://github.com/LeCAR-Lab/dial-mpc | null | null | null | null | 966 | null | null | apache-2.0 | null | null | null | null | null | null | null | dial_mpc/envs/unitree_h1_env.py | null | null | null | null | null | null | Python | 2026-05-04T02:37:29.215897 | from dataclasses import dataclass, field
from typing import Any, Dict, Sequence, Tuple, Union, List
import numpy as np
import jax
import jax.numpy as jnp
from functools import partial
from brax import math
import brax.base as base
from brax.base import System
from brax import envs as brax_envs
from brax.envs.base im... |
LeCAR-Lab/dial-mpc | https://github.com/LeCAR-Lab/dial-mpc | null | null | null | null | 966 | null | null | apache-2.0 | null | null | null | null | null | null | null | dial_mpc/examples/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T02:37:29.725300 | examples = [
"unitree_h1_jog",
"unitree_h1_push_crate",
"unitree_h1_loco",
"unitree_go2_trot",
"unitree_go2_seq_jump",
"unitree_go2_crate_climb",
"allegro_reorient",
]
deploy_examples = [
"unitree_go2_trot_deploy",
"unitree_go2_seq_jump_deploy",
"unitree_h1_loco_deploy",
]
|
LeCAR-Lab/dial-mpc | https://github.com/LeCAR-Lab/dial-mpc | null | null | null | null | 966 | null | null | apache-2.0 | null | null | null | null | null | null | null | dial_mpc/utils/function_utils.py | null | null | null | null | null | null | Python | 2026-05-04T02:37:29.750761 | from brax import math
import jax.numpy as jnp
import jax
def global_to_body_velocity(v, q):
"""Transforms global velocity to body velocity."""
# rotate v by inverse of q
return math.inv_rotate(v, q)
def body_to_global_velocity(v, q):
"""Transforms body velocity to global velocity."""
return mat... |
LeCAR-Lab/dial-mpc | https://github.com/LeCAR-Lab/dial-mpc | null | null | null | null | 966 | null | null | apache-2.0 | null | null | null | null | null | null | null | dial_mpc/utils/io_utils.py | null | null | null | null | null | null | Python | 2026-05-04T02:37:29.751230 | import importlib.resources
import os
def get_model_path(robot_name, model_name):
with importlib.resources.path(f"dial_mpc.models.{robot_name}", model_name) as path:
return path
def get_example_path(example_name):
with importlib.resources.path(f"dial_mpc.examples", example_name) as path:
retu... |
LeCAR-Lab/dial-mpc | https://github.com/LeCAR-Lab/dial-mpc | null | null | null | null | 966 | null | null | apache-2.0 | null | null | null | null | null | null | null | dial_mpc/utils/unitree_legged_const.py | null | null | null | null | null | null | Python | 2026-05-04T02:37:29.787039 | LegID = {
"FR_0": 0, # Front right hip
"FR_1": 1, # Front right thigh
"FR_2": 2, # Front right calf
"FL_0": 3,
"FL_1": 4,
"FL_2": 5,
"RR_0": 6,
"RR_1": 7,
"RR_2": 8,
"RL_0": 9,
"RL_1": 10,
"RL_2": 11,
}
HIGHLEVEL = 0xEE
LOWLEVEL = 0xFF
TRIGERLEVEL = 0xF0
PosStopF = 2.... |
LeCAR-Lab/dial-mpc | https://github.com/LeCAR-Lab/dial-mpc | null | null | null | null | 966 | null | null | apache-2.0 | null | null | null | null | null | null | null | setup.py | null | null | null | null | null | null | Python | 2026-05-04T02:37:29.820011 | from setuptools import setup, find_packages
setup(
name="dial-mpc",
author="Haoru Xue",
author_email="haoru-xue@berkeley.edu",
packages=find_packages(include=["dial_mpc"]),
version="0.0.2",
install_requires=[
"numpy<2.0.0",
"matplotlib",
"tqdm",
"tyro",
"... |
warpdotdev/themes | https://github.com/warpdotdev/themes | null | null | null | null | 966 | null | null | apache-2.0 | null | null | null | null | null | null | null | scripts/gen_theme_previews.py | null | null | null | null | null | null | Python | 2026-05-04T02:37:32.521713 | import argparse
import os
from pathlib import Path
from typing import Any
import yaml
def get_all_input_files(
input_dir: str,
) -> list[str]:
"""Parameters
----------
input_dir :
Returns
-------
"""
filenames: Any = next(os.walk(input_dir), (None, None, []))[2]
return list(filt... |
PrithivirajDamodaran/FlashRank | https://github.com/PrithivirajDamodaran/FlashRank | null | null | null | null | 965 | null | null | apache-2.0 | null | null | null | null | null | null | null | flashrank/Ranker.py | null | null | null | null | null | null | Python | 2026-05-04T02:37:34.828298 | import json
from pathlib import Path
from tokenizers import AddedToken, Tokenizer
import onnxruntime as ort
import numpy as np
import os
import zipfile
import requests
from tqdm import tqdm
from flashrank.Config import default_model, default_cache_dir, model_url, model_file_map, listwise_rankers
import collections
from... |
PrithivirajDamodaran/FlashRank | https://github.com/PrithivirajDamodaran/FlashRank | null | null | null | null | 965 | null | null | apache-2.0 | null | null | null | null | null | null | null | flashrank/Config.py | null | null | null | null | null | null | Python | 2026-05-04T02:37:34.828856 | # Moved to HF - My cloud bucket and $ wont be abused anymore :-)
# THE HF Repo is UNDER CC-BY-SA LICENSE. USE APPROPRIATELY.
import os
from urllib.parse import urljoin
hf_endpoint = os.environ.get('HF_ENDPOINT', default='https://huggingface.co')
model_url = urljoin(hf_endpoint, 'prithivida/flashrank/resolve/main/{}.zi... |
PrithivirajDamodaran/FlashRank | https://github.com/PrithivirajDamodaran/FlashRank | null | null | null | null | 965 | null | null | apache-2.0 | null | null | null | null | null | null | null | setup.py | null | null | null | null | null | null | Python | 2026-05-04T02:37:34.858187 | from setuptools import setup, find_packages
setup(
name='FlashRank',
version='0.2.9',
packages=find_packages(),
install_requires=[
'tokenizers',
'onnxruntime',
'numpy',
'requests',
'tqdm'
],
extras_require={
'listwise': ['llama-cpp-python==0.2... |
tsinghua-fib-lab/AgentSociety | https://github.com/tsinghua-fib-lab/AgentSociety | null | null | null | null | 965 | null | null | apache-2.0 | null | null | null | null | null | null | null | examples/inflammatory_message/control.py | null | null | null | null | null | null | Python | 2026-05-04T02:37:37.373026 | import asyncio
import copy
import json
import random
from agentsociety.cityagent import (
SocietyAgent,
default,
)
from agentsociety.configs import (
AgentsConfig,
Config,
EnvConfig,
ExpConfig,
LLMConfig,
MapConfig,
)
from agentsociety.configs.agent import AgentConfig
from agentsociety.... |
tsinghua-fib-lab/AgentSociety | https://github.com/tsinghua-fib-lab/AgentSociety | null | null | null | null | 965 | null | null | apache-2.0 | null | null | null | null | null | null | null | docs/workspace_template/project_template.py | null | null | null | null | null | null | Python | 2026-05-04T02:37:37.416216 | # AgentSociety 2 Workspace Template
# This is a template for a new AgentSociety 2 project
"""
AgentSociety 2 Workspace
This workspace contains custom agents and environment modules
for AgentSociety 2 experiments.
"""
__version__ = "0.1.0"
|
tsinghua-fib-lab/AgentSociety | https://github.com/tsinghua-fib-lab/AgentSociety | null | null | null | null | 965 | null | null | apache-2.0 | null | null | null | null | null | null | null | examples/inflammatory_message/emotional.py | null | null | null | null | null | null | Python | 2026-05-04T02:37:37.416779 | import asyncio
import copy
import json
import random
from agentsociety.cityagent import (
SocietyAgent,
default,
)
from agentsociety.configs import (
AgentsConfig,
Config,
EnvConfig,
ExpConfig,
LLMConfig,
MapConfig,
)
from agentsociety.configs.agent import AgentConfig
from agentsociety.... |
tsinghua-fib-lab/AgentSociety | https://github.com/tsinghua-fib-lab/AgentSociety | null | null | null | null | 965 | null | null | apache-2.0 | null | null | null | null | null | null | null | examples/UBI/main.py | null | null | null | null | null | null | Python | 2026-05-04T02:37:37.418804 | import asyncio
from agentsociety.cityagent import (
MobilityBlock,
MobilityBlockParams,
SocialBlock,
SocialBlockParams,
EconomyBlock,
EconomyBlockParams,
OtherBlock,
OtherBlockParams,
SocietyAgent,
default,
)
from agentsociety.configs import (
AgentsConfig,
Config,
E... |
tsinghua-fib-lab/AgentSociety | https://github.com/tsinghua-fib-lab/AgentSociety | null | null | null | null | 965 | null | null | apache-2.0 | null | null | null | null | null | null | null | docs_v1/conf.py | null | null | null | null | null | null | Python | 2026-05-04T02:37:37.429731 | # Configuration file for the Sphinx documentation builder.
#
# For the full list of built-in configuration values, see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Project information -----------------------------------------------------
# https://www.sphinx-doc.org/en/master... |
tsinghua-fib-lab/AgentSociety | https://github.com/tsinghua-fib-lab/AgentSociety | null | null | null | null | 965 | null | null | apache-2.0 | null | null | null | null | null | null | null | examples/polarization/back_firing.py | null | null | null | null | null | null | Python | 2026-05-04T02:37:37.434273 | import asyncio
from message_agent import AgreeAgent, DisagreeAgent
from agentsociety.cityagent import (
SocietyAgent,
default,
)
from agentsociety.configs import (
AgentsConfig,
Config,
EnvConfig,
ExpConfig,
LLMConfig,
MapConfig,
)
from agentsociety.configs.agent import AgentConfig
from... |
tsinghua-fib-lab/AgentSociety | https://github.com/tsinghua-fib-lab/AgentSociety | null | null | null | null | 965 | null | null | apache-2.0 | null | null | null | null | null | null | null | examples/inflammatory_message/edge_intercept.py | null | null | null | null | null | null | Python | 2026-05-04T02:37:37.435185 | import asyncio
import copy
import json
import random
from agentsociety.cityagent import (
SocietyAgent,
default,
)
from agentsociety.configs import (
AgentsConfig,
Config,
EnvConfig,
ExpConfig,
LLMConfig,
MapConfig,
)
from agentsociety.configs.agent import AgentConfig
from agentsociety.... |
tsinghua-fib-lab/AgentSociety | https://github.com/tsinghua-fib-lab/AgentSociety | null | null | null | null | 965 | null | null | apache-2.0 | null | null | null | null | null | null | null | examples/inflammatory_message/point_intercept.py | null | null | null | null | null | null | Python | 2026-05-04T02:37:37.464305 | import asyncio
import copy
import json
import random
from agentsociety.cityagent import (
SocietyAgent,
default,
)
from agentsociety.configs import (
AgentsConfig,
Config,
EnvConfig,
ExpConfig,
LLMConfig,
MapConfig,
)
from agentsociety.configs.agent import AgentConfig
from agentsociety.... |
tsinghua-fib-lab/AgentSociety | https://github.com/tsinghua-fib-lab/AgentSociety | null | null | null | null | 965 | null | null | apache-2.0 | null | null | null | null | null | null | null | examples/hurricane_impact/hurricane.py | null | null | null | null | null | null | Python | 2026-05-04T02:37:37.464901 | import asyncio
from agentsociety.cityagent import default
from agentsociety.configs import (
AgentsConfig,
Config,
EnvConfig,
ExpConfig,
LLMConfig,
MapConfig,
)
from agentsociety.configs.agent import AgentConfig
from agentsociety.configs.exp import WorkflowStepConfig, WorkflowType
from agentsoc... |
tsinghua-fib-lab/AgentSociety | https://github.com/tsinghua-fib-lab/AgentSociety | null | null | null | null | 965 | null | null | apache-2.0 | null | null | null | null | null | null | null | examples/polarization/control.py | null | null | null | null | null | null | Python | 2026-05-04T02:37:37.497244 | import asyncio
from agentsociety.cityagent import (
SocietyAgent,
default,
)
from agentsociety.configs import (
AgentsConfig,
Config,
EnvConfig,
ExpConfig,
LLMConfig,
MapConfig,
)
from agentsociety.configs.agent import AgentConfig
from agentsociety.configs.exp import (
AgentFilterCo... |
tsinghua-fib-lab/AgentSociety | https://github.com/tsinghua-fib-lab/AgentSociety | null | null | null | null | 965 | null | null | apache-2.0 | null | null | null | null | null | null | null | examples/polarization/echo_chamber.py | null | null | null | null | null | null | Python | 2026-05-04T02:37:37.941548 | import asyncio
from message_agent import AgreeAgent, DisagreeAgent
from agentsociety.cityagent import (
SocietyAgent,
default,
)
from agentsociety.configs import (
AgentsConfig,
Config,
EnvConfig,
ExpConfig,
LLMConfig,
MapConfig,
)
from agentsociety.configs.agent import AgentConfig
fro... |
tsinghua-fib-lab/AgentSociety | https://github.com/tsinghua-fib-lab/AgentSociety | null | null | null | null | 965 | null | null | apache-2.0 | null | null | null | null | null | null | null | examples/polarization/message_agent.py | null | null | null | null | null | null | Python | 2026-05-04T02:37:38.023711 | import asyncio
import json
from typing import Any
import json_repair
from typing import Optional
from agentsociety.agent import CitizenAgentBase, Block, MemoryAttribute
from agentsociety.message import Message
from agentsociety.agent.agent_base import AgentToolbox
from agentsociety.agent.prompt import FormatPrompt
fr... |
tsinghua-fib-lab/AgentSociety | https://github.com/tsinghua-fib-lab/AgentSociety | null | null | null | null | 965 | null | null | apache-2.0 | null | null | null | null | null | null | null | examples/prospect_theory/step_two.py | null | null | null | null | null | null | Python | 2026-05-04T02:37:38.040945 | import asyncio
from agentsociety.cityagent import (
SocietyAgent,
default,
)
from agentsociety.configs import (
AgentsConfig,
Config,
EnvConfig,
ExpConfig,
LLMConfig,
MapConfig,
)
from agentsociety.configs.agent import AgentConfig
from agentsociety.configs.exp import (
AgentFilterCo... |
tsinghua-fib-lab/AgentSociety | https://github.com/tsinghua-fib-lab/AgentSociety | null | null | null | null | 965 | null | null | apache-2.0 | null | null | null | null | null | null | null | examples/rumor_spreader/network_generator.py | null | null | null | null | null | null | Python | 2026-05-04T02:37:38.047558 | import logging
import networkx as nx
def generate_networks(
agent_count: int,
public_m: int,
private_m: int,
public_seed: int = 42,
private_seed: int = 123,
) -> tuple[nx.Graph, nx.Graph]:
"""
Generate public and private social networks (Barabási-Albert model).
If files ... |
tsinghua-fib-lab/AgentSociety | https://github.com/tsinghua-fib-lab/AgentSociety | null | null | null | null | 965 | null | null | apache-2.0 | null | null | null | null | null | null | null | examples/prospect_theory/surveys.py | null | null | null | null | null | null | Python | 2026-05-04T02:37:38.049892 | import uuid
from datetime import datetime
from agentsociety.survey.models import Survey, Page, Question, QuestionType
def personality_survey() -> Survey:
survey_id = uuid.uuid4()
# Create questions for the survey
questions = [
Question(
name="scenario",
title="你在参与一个抽奖活... |
tsinghua-fib-lab/AgentSociety | https://github.com/tsinghua-fib-lab/AgentSociety | null | null | null | null | 965 | null | null | apache-2.0 | null | null | null | null | null | null | null | examples/prospect_theory/step_one.py | null | null | null | null | null | null | Python | 2026-05-04T02:37:38.053844 | import asyncio
from agentsociety.cityagent import (
SocietyAgent,
default,
)
from agentsociety.configs import (
AgentsConfig,
Config,
EnvConfig,
ExpConfig,
LLMConfig,
MapConfig,
)
from agentsociety.configs.agent import AgentConfig
from agentsociety.configs.exp import (
AgentFilterCo... |
tsinghua-fib-lab/AgentSociety | https://github.com/tsinghua-fib-lab/AgentSociety | null | null | null | null | 965 | null | null | apache-2.0 | null | null | null | null | null | null | null | examples/prospect_theory/step_three.py | null | null | null | null | null | null | Python | 2026-05-04T02:37:38.084082 | import asyncio
from agentsociety.cityagent import (
SocietyAgent,
default,
)
from agentsociety.configs import (
AgentsConfig,
Config,
EnvConfig,
ExpConfig,
LLMConfig,
MapConfig,
)
from agentsociety.configs.agent import AgentConfig
from agentsociety.configs.exp import (
AgentFilterCo... |
tsinghua-fib-lab/AgentSociety | https://github.com/tsinghua-fib-lab/AgentSociety | null | null | null | null | 965 | null | null | apache-2.0 | null | null | null | null | null | null | null | extension/skills/agentsociety-analysis/scripts/analyze.py | null | null | null | null | null | null | Python | 2026-05-04T02:37:38.100500 | #!/usr/bin/env python3
"""Data analysis CLI script"""
import argparse
import asyncio
from pathlib import Path
from dotenv import load_dotenv
# Load environment variables from workspace .env file
workspace_root = Path(__file__).resolve().parents[4]
env_file = workspace_root / ".env"
if env_file.exists():
load_dote... |
tsinghua-fib-lab/AgentSociety | https://github.com/tsinghua-fib-lab/AgentSociety | null | null | null | null | 965 | null | null | apache-2.0 | null | null | null | null | null | null | null | extension/skills/agentsociety-create-agent/scripts/validate.py | null | null | null | null | null | null | Python | 2026-05-04T02:37:38.102031 | #!/usr/bin/env python3
"""Validate Agent class implementation.
Checks that an Agent file correctly implements the AgentBase interface.
Usage:
python scripts/validate.py --file custom/agents/my_agent.py
python scripts/validate.py --file custom/agents/my_agent.py --json
"""
from __future__ import annotations
... |
tsinghua-fib-lab/AgentSociety | https://github.com/tsinghua-fib-lab/AgentSociety | null | null | null | null | 965 | null | null | apache-2.0 | null | null | null | null | null | null | null | examples/rumor_spreader/utils.py | null | null | null | null | null | null | Python | 2026-05-04T02:37:38.128793 | import random
import networkx as nx
import numpy as np
from agentsociety.cityagent.societyagent import SocietyAgent
from agentsociety.logger import get_logger
from agentsociety.simulation import AgentSociety
__all__ = ["initialize_social_network_with_graphs"]
async def initialize_social_network_with_graphs(
ne... |
tsinghua-fib-lab/AgentSociety | https://github.com/tsinghua-fib-lab/AgentSociety | null | null | null | null | 965 | null | null | apache-2.0 | null | null | null | null | null | null | null | extension/skills/agentsociety-create-dataset/scripts/create.py | null | null | null | null | null | null | Python | 2026-05-04T02:37:38.600574 | #!/usr/bin/env python3
"""Dataset creation CLI — create, validate, package, and upload datasets."""
import argparse
import calendar
import json
import os
import re
import sys
import time
import webbrowser
import zipfile
from pathlib import Path
from urllib.error import HTTPError, URLError
from urllib.request import Re... |
tsinghua-fib-lab/AgentSociety | https://github.com/tsinghua-fib-lab/AgentSociety | null | null | null | null | 965 | null | null | apache-2.0 | null | null | null | null | null | null | null | extension/skills/agentsociety-create-env-module/scripts/resolve_sources.py | null | null | null | null | null | null | Python | 2026-05-04T02:37:38.608090 | #!/usr/bin/env python3
"""Resolve installed agentsociety2 source locations for this skill."""
from __future__ import annotations
import argparse
import json
from importlib import metadata
from pathlib import Path
DEFAULT_MODULES = [
"agentsociety2.env.base",
"agentsociety2.env.router_codegen",
"agentsoc... |
tsinghua-fib-lab/AgentSociety | https://github.com/tsinghua-fib-lab/AgentSociety | null | null | null | null | 965 | null | null | apache-2.0 | null | null | null | null | null | null | null | extension/skills/agentsociety-create-env-module/scripts/validate.py | null | null | null | null | null | null | Python | 2026-05-04T02:37:38.614131 | #!/usr/bin/env python3
"""Local validation entrypoint for the create-env skill."""
from __future__ import annotations
import argparse
import importlib.util
import inspect
import json
import sys
from datetime import datetime, timezone
from pathlib import Path
from typing import Any
from uuid import uuid4
TRACE_NAMES... |
tsinghua-fib-lab/AgentSociety | https://github.com/tsinghua-fib-lab/AgentSociety | null | null | null | null | 965 | null | null | apache-2.0 | null | null | null | null | null | null | null | extension/skills/agentsociety-experiment-config/scripts/config.py | null | null | null | null | null | null | Python | 2026-05-04T02:37:38.628434 | #!/usr/bin/env python3
"""实验配置生成脚本
提供实验配置的验证、准备、信息查询、运行和检查功能。
Usage:
python scripts/config.py --hypothesis-id 1 --experiment-id 1 --action validate
python scripts/config.py --hypothesis-id 1 --experiment-id 1 --action prepare
python scripts/config.py --hypothesis-id 1 --experiment-id 1 --action info
p... |
tsinghua-fib-lab/AgentSociety | https://github.com/tsinghua-fib-lab/AgentSociety | null | null | null | null | 965 | null | null | apache-2.0 | null | null | null | null | null | null | null | extension/skills/agentsociety-experiment-config/scripts/validate_config.py | null | null | null | null | null | null | Python | 2026-05-04T02:37:38.668292 | #!/usr/bin/env python3
"""实验配置验证脚本
通过实例化实际的 agent 类和环境模块来验证配置。
这是最严格的验证方式,确保配置可以真正运行。
Usage:
python scripts/validate_config.py --hypothesis-id 1 --experiment-id 1
"""
from __future__ import annotations
import argparse
import json
import sys
from pathlib import Path
from typing import Any
# 加载环境变量
workspace_roo... |
tsinghua-fib-lab/AgentSociety | https://github.com/tsinghua-fib-lab/AgentSociety | null | null | null | null | 965 | null | null | apache-2.0 | null | null | null | null | null | null | null | extension/skills/agentsociety-generate-paper/scripts/generate.py | null | null | null | null | null | null | Python | 2026-05-04T02:37:38.696371 | #!/usr/bin/env python3
"""Generate paper CLI script"""
import asyncio
import argparse
from datetime import datetime
import os
from pathlib import Path
from dotenv import load_dotenv
# Load environment variables from workspace .env file
workspace_root = Path(__file__).resolve().parents[4]
env_file = workspace_root / "... |
tsinghua-fib-lab/AgentSociety | https://github.com/tsinghua-fib-lab/AgentSociety | null | null | null | null | 965 | null | null | apache-2.0 | null | null | null | null | null | null | null | extension/skills/agentsociety-run-experiment/scripts/run.py | null | null | null | null | null | null | Python | 2026-05-04T02:37:38.697880 | #!/usr/bin/env python3
"""Run experiment CLI script
This script manages experiment execution by:
1. Reading experiment configuration from init/init_config.json
2. Reading execution steps from init/steps.yaml
3. Running the experiment and storing all output in run/
The simplified structure means config files are direc... |
tsinghua-fib-lab/AgentSociety | https://github.com/tsinghua-fib-lab/AgentSociety | null | null | null | null | 965 | null | null | apache-2.0 | null | null | null | null | null | null | null | extension/skills/agentsociety-hypothesis/scripts/hypothesis.py | null | null | null | null | null | null | Python | 2026-05-04T02:37:38.706592 | #!/usr/bin/env python3
"""Hypothesis management CLI script"""
import argparse
import json
import os
from pathlib import Path
from dotenv import load_dotenv
# Load environment variables from workspace .env file
workspace_root = Path(__file__).resolve().parents[4]
env_file = workspace_root / ".env"
if env_file.exists()... |
tsinghua-fib-lab/AgentSociety | https://github.com/tsinghua-fib-lab/AgentSociety | null | null | null | null | 965 | null | null | apache-2.0 | null | null | null | null | null | null | null | extension/skills/agentsociety-literature-search/scripts/search.py | null | null | null | null | null | null | Python | 2026-05-04T02:37:38.720295 | #!/usr/bin/env python3
"""Literature search CLI script"""
import asyncio
import argparse
import os
from pathlib import Path
from dotenv import load_dotenv
# Load environment variables from workspace .env file
workspace_root = Path(__file__).resolve().parents[4]
env_file = workspace_root / ".env"
if env_file.exists():... |
tsinghua-fib-lab/AgentSociety | https://github.com/tsinghua-fib-lab/AgentSociety | null | null | null | null | 965 | null | null | apache-2.0 | null | null | null | null | null | null | null | extension/skills/agentsociety-scan-modules/scripts/scan_modules.py | null | null | null | null | null | null | Python | 2026-05-04T02:37:38.737827 | #!/usr/bin/env python3
"""扫描和查询 AgentSociety2 工作区中的 agent 和 env 类
提供对已注册 agent 类和环境模块的扫描和查询功能。
Usage:
python scripts/scan_modules.py list [--type agent|env] [--custom-only]
python scripts/scan_modules.py info --type agent|env --name NAME
python scripts/scan_modules.py search --keyword KEYWORD
python s... |
tsinghua-fib-lab/AgentSociety | https://github.com/tsinghua-fib-lab/AgentSociety | null | null | null | null | 965 | null | null | apache-2.0 | null | null | null | null | null | null | null | extension/skills/agentsociety-synthesize/scripts/synthesize.py | null | null | null | null | null | null | Python | 2026-05-04T02:37:39.480431 | #!/usr/bin/env python3
"""Synthesize CLI script
支持两种模式:
1. 自动发现模式:不指定参数,自动发现工作区中所有假设和实验进行综合
2. 指定范围模式:指定 --hypothesis-ids 或 --experiment-ids 进行部分综合
Examples:
# 自动发现所有假设和实验进行综合
$PYTHON_PATH scripts/synthesize.py
# 只综合特定假设
$PYTHON_PATH scripts/synthesize.py --hypothesis-ids 1 2 3
# 只综合特定实验
$PY... |
tsinghua-fib-lab/AgentSociety | https://github.com/tsinghua-fib-lab/AgentSociety | null | null | null | null | 965 | null | null | apache-2.0 | null | null | null | null | null | null | null | extension/skills/agentsociety-use-dataset/scripts/use.py | null | null | null | null | null | null | Python | 2026-05-04T02:37:39.481592 | #!/usr/bin/env python3
"""Dataset usage CLI — search, download, and inspect datasets from agentsociety2-web."""
import argparse
import json
import os
import sys
import time
import zipfile
from pathlib import Path
from urllib.error import HTTPError, URLError
from urllib.request import Request, urlopen
DEFAULT_SERVER_U... |
tsinghua-fib-lab/AgentSociety | https://github.com/tsinghua-fib-lab/AgentSociety | null | null | null | null | 965 | null | null | apache-2.0 | null | null | null | null | null | null | null | extension/skills/docx/scripts/office/helpers/merge_runs.py | null | null | null | null | null | null | Python | 2026-05-04T02:37:39.483025 | """Merge adjacent runs with identical formatting in DOCX.
Merges adjacent <w:r> elements that have identical <w:rPr> properties.
Works on runs in paragraphs and inside tracked changes (<w:ins>, <w:del>).
Also:
- Removes rsid attributes from runs (revision metadata that doesn't affect rendering)
- Removes proofErr ele... |
tsinghua-fib-lab/AgentSociety | https://github.com/tsinghua-fib-lab/AgentSociety | null | null | null | null | 965 | null | null | apache-2.0 | null | null | null | null | null | null | null | extension/skills/docx/scripts/accept_changes.py | null | null | null | null | null | null | Python | 2026-05-04T02:37:39.484142 | """Accept all tracked changes in a DOCX file using LibreOffice.
Requires LibreOffice (soffice) to be installed.
"""
import argparse
import logging
import shutil
import subprocess
from pathlib import Path
from office.soffice import get_soffice_env
logger = logging.getLogger(__name__)
LIBREOFFICE_PROFILE = "/tmp/lib... |
tsinghua-fib-lab/AgentSociety | https://github.com/tsinghua-fib-lab/AgentSociety | null | null | null | null | 965 | null | null | apache-2.0 | null | null | null | null | null | null | null | extension/skills/docx/scripts/comment.py | null | null | null | null | null | null | Python | 2026-05-04T02:37:39.485290 | """Add comments to DOCX documents.
Usage:
python comment.py unpacked/ 0 "Comment text"
python comment.py unpacked/ 1 "Reply text" --parent 0
Text should be pre-escaped XML (e.g., & for &, ’ for smart quotes).
After running, add markers to document.xml:
<w:commentRangeStart w:id="0"/>
... comme... |
tsinghua-fib-lab/AgentSociety | https://github.com/tsinghua-fib-lab/AgentSociety | null | null | null | null | 965 | null | null | apache-2.0 | null | null | null | null | null | null | null | extension/skills/agentsociety-web-research/scripts/research.py | null | null | null | null | null | null | Python | 2026-05-04T02:37:39.835538 | #!/usr/bin/env python3
"""Web research CLI script"""
import asyncio
import argparse
import os
from pathlib import Path
from dotenv import load_dotenv
# Load environment variables from workspace .env file
workspace_root = Path(__file__).resolve().parents[4]
env_file = workspace_root / ".env"
if env_file.exists():
... |
tsinghua-fib-lab/AgentSociety | https://github.com/tsinghua-fib-lab/AgentSociety | null | null | null | null | 965 | null | null | apache-2.0 | null | null | null | null | null | null | null | extension/skills/docx/scripts/office/pack.py | null | null | null | null | null | null | Python | 2026-05-04T02:37:39.948223 | """Pack a directory into a DOCX, PPTX, or XLSX file.
Validates with auto-repair, condenses XML formatting, and creates the Office file.
Usage:
python pack.py <input_directory> <output_file> [--original <file>] [--validate true|false]
Examples:
python pack.py unpacked/ output.docx --original input.docx
py... |
tsinghua-fib-lab/AgentSociety | https://github.com/tsinghua-fib-lab/AgentSociety | null | null | null | null | 965 | null | null | apache-2.0 | null | null | null | null | null | null | null | extension/skills/docx/scripts/office/helpers/simplify_redlines.py | null | null | null | null | null | null | Python | 2026-05-04T02:37:40.023659 | """Simplify tracked changes by merging adjacent w:ins or w:del elements.
Merges adjacent <w:ins> elements from the same author into a single element.
Same for <w:del> elements. This makes heavily-redlined documents easier to
work with by reducing the number of tracked change wrappers.
Rules:
- Only merges w:ins with ... |
tsinghua-fib-lab/AgentSociety | https://github.com/tsinghua-fib-lab/AgentSociety | null | null | null | null | 965 | null | null | apache-2.0 | null | null | null | null | null | null | null | extension/skills/docx/scripts/office/validate.py | null | null | null | null | null | null | Python | 2026-05-04T02:37:40.195700 | """
Command line tool to validate Office document XML files against XSD schemas and tracked changes.
Usage:
python validate.py <path> [--original <original_file>] [--auto-repair] [--author NAME]
The first argument can be either:
- An unpacked directory containing the Office document XML files
- A packed Office fi... |
tsinghua-fib-lab/AgentSociety | https://github.com/tsinghua-fib-lab/AgentSociety | null | null | null | null | 965 | null | null | apache-2.0 | null | null | null | null | null | null | null | extension/skills/docx/scripts/office/unpack.py | null | null | null | null | null | null | Python | 2026-05-04T02:37:40.201802 | """Unpack Office files (DOCX, PPTX, XLSX) for editing.
Extracts the ZIP archive, pretty-prints XML files, and optionally:
- Merges adjacent runs with identical formatting (DOCX only)
- Simplifies adjacent tracked changes from same author (DOCX only)
Usage:
python unpack.py <office_file> <output_dir> [options]
Ex... |
tsinghua-fib-lab/AgentSociety | https://github.com/tsinghua-fib-lab/AgentSociety | null | null | null | null | 965 | null | null | apache-2.0 | null | null | null | null | null | null | null | extension/skills/docx/scripts/office/soffice.py | null | null | null | null | null | null | Python | 2026-05-04T02:37:40.202439 | """
Helper for running LibreOffice (soffice) in environments where AF_UNIX
sockets may be blocked (e.g., sandboxed VMs). Detects the restriction
at runtime and applies an LD_PRELOAD shim if needed.
Usage:
from office.soffice import run_soffice, get_soffice_env
# Option 1 – run soffice directly
result = r... |
tsinghua-fib-lab/AgentSociety | https://github.com/tsinghua-fib-lab/AgentSociety | null | null | null | null | 965 | null | null | apache-2.0 | null | null | null | null | null | null | null | extension/skills/docx/scripts/office/validators/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T02:37:40.209848 | """
Validation modules for Word document processing.
"""
from .base import BaseSchemaValidator
from .docx import DOCXSchemaValidator
from .pptx import PPTXSchemaValidator
from .redlining import RedliningValidator
__all__ = [
"BaseSchemaValidator",
"DOCXSchemaValidator",
"PPTXSchemaValidator",
"Redlini... |
tsinghua-fib-lab/AgentSociety | https://github.com/tsinghua-fib-lab/AgentSociety | null | null | null | null | 965 | null | null | apache-2.0 | null | null | null | null | null | null | null | extension/skills/docx/scripts/office/validators/base.py | null | null | null | null | null | null | Python | 2026-05-04T02:37:40.215017 | """
Base validator with common validation logic for document files.
"""
import re
from pathlib import Path
import defusedxml.minidom
import lxml.etree
class BaseSchemaValidator:
IGNORED_VALIDATION_ERRORS = [
"hyphenationZone",
"purl.org/dc/terms",
]
UNIQUE_ID_REQUIREMENTS = {
"... |
tsinghua-fib-lab/AgentSociety | https://github.com/tsinghua-fib-lab/AgentSociety | null | null | null | null | 965 | null | null | apache-2.0 | null | null | null | null | null | null | null | extension/skills/docx/scripts/office/validators/docx.py | null | null | null | null | null | null | Python | 2026-05-04T02:37:40.231745 | """
Validator for Word document XML files against XSD schemas.
"""
import random
import re
import tempfile
import zipfile
import defusedxml.minidom
import lxml.etree
from .base import BaseSchemaValidator
class DOCXSchemaValidator(BaseSchemaValidator):
WORD_2006_NAMESPACE = "http://schemas.openxmlformats.org/w... |
tsinghua-fib-lab/AgentSociety | https://github.com/tsinghua-fib-lab/AgentSociety | null | null | null | null | 965 | null | null | apache-2.0 | null | null | null | null | null | null | null | extension/skills/docx/scripts/office/validators/pptx.py | null | null | null | null | null | null | Python | 2026-05-04T02:37:40.433130 | """
Validator for PowerPoint presentation XML files against XSD schemas.
"""
import re
from .base import BaseSchemaValidator
class PPTXSchemaValidator(BaseSchemaValidator):
PRESENTATIONML_NAMESPACE = (
"http://schemas.openxmlformats.org/presentationml/2006/main"
)
ELEMENT_RELATIONSHIP_TYPES = ... |
tsinghua-fib-lab/AgentSociety | https://github.com/tsinghua-fib-lab/AgentSociety | null | null | null | null | 965 | null | null | apache-2.0 | null | null | null | null | null | null | null | extension/skills/docx/scripts/office/validators/redlining.py | null | null | null | null | null | null | Python | 2026-05-04T02:37:40.503547 | """
Validator for tracked changes in Word documents.
"""
import subprocess
import tempfile
import zipfile
from pathlib import Path
class RedliningValidator:
def __init__(self, unpacked_dir, original_docx, verbose=False, author="Claude"):
self.unpacked_dir = Path(unpacked_dir)
self.original_docx ... |
tsinghua-fib-lab/AgentSociety | https://github.com/tsinghua-fib-lab/AgentSociety | null | null | null | null | 965 | null | null | apache-2.0 | null | null | null | null | null | null | null | extension/skills/pdf/scripts/check_bounding_boxes.py | null | null | null | null | null | null | Python | 2026-05-04T02:37:40.585594 | from dataclasses import dataclass
import json
import sys
@dataclass
class RectAndField:
rect: list[float]
rect_type: str
field: dict
def get_bounding_box_messages(fields_json_stream) -> list[str]:
messages = []
fields = json.load(fields_json_stream)
messages.append(f"Read {len(fields['form... |
tsinghua-fib-lab/AgentSociety | https://github.com/tsinghua-fib-lab/AgentSociety | null | null | null | null | 965 | null | null | apache-2.0 | null | null | null | null | null | null | null | extension/skills/pdf/scripts/check_fillable_fields.py | null | null | null | null | null | null | Python | 2026-05-04T02:37:40.676482 | import sys
from pypdf import PdfReader
reader = PdfReader(sys.argv[1])
if (reader.get_fields()):
print("This PDF has fillable form fields")
else:
print("This PDF does not have fillable form fields; you will need to visually determine where to enter data")
|
coding-kitties/investing-algorithm-framework | https://github.com/coding-kitties/investing-algorithm-framework | null | null | null | null | 965 | null | null | apache-2.0 | null | null | null | null | null | null | null | examples/bitvavo_trading_bot.py | null | null | null | null | null | null | Python | 2026-05-04T02:37:48.948348 | from dotenv import load_dotenv
from typing import Dict, Any
import logging.config
from investing_algorithm_framework import TimeUnit, TradingStrategy, \
create_app, DEFAULT_LOGGING_CONFIG, Context, DataSource
"""
Bitvavo trading bot example with market data sources of bitvavo.
Bitvavo does not requires you to hav... |
coding-kitties/investing-algorithm-framework | https://github.com/coding-kitties/investing-algorithm-framework | null | null | null | null | 965 | null | null | apache-2.0 | null | null | null | null | null | null | null | investing_algorithm_framework/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T02:37:49.011316 | from .analysis import generate_rolling_backtest_windows, \
select_backtest_date_ranges, rank_results, create_weights, \
get_missing_timeseries_data_entries, fill_missing_timeseries_data, \
create_markdown_table
from .app import App, Algorithm, \
TradingStrategy, StatelessAction, Task, AppHook, Context, ... |
coding-kitties/investing-algorithm-framework | https://github.com/coding-kitties/investing-algorithm-framework | null | null | null | null | 965 | null | null | apache-2.0 | null | null | null | null | null | null | null | examples/download_data.py | null | null | null | null | null | null | Python | 2026-05-04T02:37:49.012302 | from investing_algorithm_framework import download
if __name__ == "__main__":
btceur_ohlcv = download(
symbol="btc/eur",
market="bitvavo",
time_frame="1d",
start_date="2023-01-01",
end_date="2023-12-31",
pandas=False,
save=True,
storage_path="./data"
... |
coding-kitties/investing-algorithm-framework | https://github.com/coding-kitties/investing-algorithm-framework | null | null | null | null | 965 | null | null | apache-2.0 | null | null | null | null | null | null | null | examples/open.py | null | null | null | null | null | null | Python | 2026-05-04T02:37:49.054042 | import os
from investing_algorithm_framework import BacktestReport, recalculate_backtests, retag_backtests
batch_one_path = os.path.join(os.path.dirname(__file__), "tutorial/backtest_results/in_sample")
if __name__ == "__main__":
report = BacktestReport.open(directory_path=batch_one_path)
report.show()
|
coding-kitties/investing-algorithm-framework | https://github.com/coding-kitties/investing-algorithm-framework | null | null | null | null | 965 | null | null | apache-2.0 | null | null | null | null | null | null | null | examples/tutorial/strategies/ema_crossover_rsi_filter/strategy.py | null | null | null | null | null | null | Python | 2026-05-04T02:37:49.054659 |
from typing import Dict, Any
import pandas as pd
from pyindicators import ema, rsi, crossover, crossunder
from investing_algorithm_framework import TradingStrategy, DataSource, \
TimeUnit, DataType, PositionSize, StopLossRule, TakeProfitRule, \
ScalingRule, TradingCost
class EMACrossoverRSIFFilterStrategy(... |
coding-kitties/investing-algorithm-framework | https://github.com/coding-kitties/investing-algorithm-framework | null | null | null | null | 965 | null | null | apache-2.0 | null | null | null | null | null | null | null | examples/coinbase_trading_bot.py | null | null | null | null | null | null | Python | 2026-05-04T02:37:49.068642 | from dotenv import load_dotenv
from typing import Dict, Any
import logging.config
from investing_algorithm_framework import TimeUnit, \
DataSource, TradingStrategy, create_app, DEFAULT_LOGGING_CONFIG, Context
"""
Coinbase trading bot example. Coinbase requires you to have an API key
and secret key to access their ... |
coding-kitties/investing-algorithm-framework | https://github.com/coding-kitties/investing-algorithm-framework | null | null | null | null | 965 | null | null | apache-2.0 | null | null | null | null | null | null | null | examples/tutorial/strategies/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T02:37:49.093632 | from .ema_crossover_rsi_filter import EMACrossoverRSIFFilterStrategy
__all__ = [
"EMACrossoverRSIFFilterStrategy"
]
|
coding-kitties/investing-algorithm-framework | https://github.com/coding-kitties/investing-algorithm-framework | null | null | null | null | 965 | null | null | apache-2.0 | null | null | null | null | null | null | null | investing_algorithm_framework/analysis/backtest_data_ranges.py | null | null | null | null | null | null | Python | 2026-05-04T02:37:49.909980 | import pandas as pd
from logging import getLogger
from datetime import datetime
from typing import List, Dict, Union
from datetime import timezone
from investing_algorithm_framework.domain import BacktestDateRange, \
OperationalException
logger = getLogger(__name__)
def select_backtest_date_ranges(
df: pd.D... |
coding-kitties/investing-algorithm-framework | https://github.com/coding-kitties/investing-algorithm-framework | null | null | null | null | 965 | null | null | apache-2.0 | null | null | null | null | null | null | null | investing_algorithm_framework/analysis/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T02:37:49.978734 | from .markdown import create_markdown_table
from .backtest_data_ranges import select_backtest_date_ranges, \
generate_rolling_backtest_windows
from .ranking import create_weights, rank_results
# Import from new location for backward compatibility
from investing_algorithm_framework.services.data_providers.data impor... |
coding-kitties/investing-algorithm-framework | https://github.com/coding-kitties/investing-algorithm-framework | null | null | null | null | 965 | null | null | apache-2.0 | null | null | null | null | null | null | null | investing_algorithm_framework/app/context.py | null | null | null | null | null | null | Python | 2026-05-04T02:37:50.084354 | import logging
from datetime import datetime, timezone
from typing import List
from investing_algorithm_framework.services import ConfigurationService, \
MarketCredentialService, OrderService, PortfolioConfigurationService, \
PortfolioService, PositionService, TradeService, DataProviderService, \
TradeStop... |
coding-kitties/investing-algorithm-framework | https://github.com/coding-kitties/investing-algorithm-framework | null | null | null | null | 965 | null | null | apache-2.0 | null | null | null | null | null | null | null | investing_algorithm_framework/app/eventloop.py | null | null | null | null | null | null | Python | 2026-05-04T02:37:50.519009 | from datetime import datetime, timedelta, timezone
from time import sleep
from typing import List, Set, Dict
from logging import getLogger
import polars as pl
from investing_algorithm_framework.domain import Environment, ENVIRONMENT, \
OrderStatus, DataSource, DataType, tqdm, \
TradeStatus, SNAPSHOT_INTERVAL,... |
coding-kitties/investing-algorithm-framework | https://github.com/coding-kitties/investing-algorithm-framework | null | null | null | null | 965 | null | null | apache-2.0 | null | null | null | null | null | null | null | investing_algorithm_framework/app/algorithm/algorithm.py | null | null | null | null | null | null | Python | 2026-05-04T02:37:50.953188 | import inspect
import logging
from typing import List
from investing_algorithm_framework.app.app_hook import AppHook
from investing_algorithm_framework.app.strategy import TradingStrategy
from investing_algorithm_framework.domain import OperationalException, \
DataSource
logger = logging.getLogger("investing_algo... |
coding-kitties/investing-algorithm-framework | https://github.com/coding-kitties/investing-algorithm-framework | null | null | null | null | 965 | null | null | apache-2.0 | null | null | null | null | null | null | null | investing_algorithm_framework/app/reporting/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T02:37:50.954302 | from .generate import add_html_report
from .backtest_report import BacktestReport
from .ascii import pretty_print_backtest, pretty_print_positions, \
pretty_print_trades, pretty_print_orders
from .charts import get_equity_curve_with_drawdown_chart, \
get_rolling_sharpe_ratio_chart, \
get_monthly_returns_hea... |
coding-kitties/investing-algorithm-framework | https://github.com/coding-kitties/investing-algorithm-framework | null | null | null | null | 965 | null | null | apache-2.0 | null | null | null | null | null | null | null | investing_algorithm_framework/app/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T02:37:51.059706 | from investing_algorithm_framework.app.app import App, AppHook
from investing_algorithm_framework.app.stateless import StatelessAction
from investing_algorithm_framework.app.strategy import TradingStrategy
from investing_algorithm_framework.app.task import Task
from investing_algorithm_framework.app.web import create_f... |
coding-kitties/investing-algorithm-framework | https://github.com/coding-kitties/investing-algorithm-framework | null | null | null | null | 965 | null | null | apache-2.0 | null | null | null | null | null | null | null | investing_algorithm_framework/analysis/markdown.py | null | null | null | null | null | null | Python | 2026-05-04T02:37:51.079468 | from typing import Dict, List, Any, Union
def create_markdown_table(data: List[Union[Dict[str, Any], Any]]):
"""
Create a markdown table with evenly spaced columns for nice display
in notebook output cells.
Args:
data (List[dict] or List[object]): List of dictionaries or objects
c... |
coding-kitties/investing-algorithm-framework | https://github.com/coding-kitties/investing-algorithm-framework | null | null | null | null | 965 | null | null | apache-2.0 | null | null | null | null | null | null | null | investing_algorithm_framework/app/reporting/ascii.py | null | null | null | null | null | null | Python | 2026-05-04T02:37:51.080947 | import os
from datetime import datetime
from typing import List
from tabulate import tabulate
from investing_algorithm_framework.domain import DATETIME_FORMAT, Backtest, \
BacktestDateRange, TradeStatus, OrderSide
from investing_algorithm_framework.domain.constants import \
DATETIME_FORMAT_BACKTESTING
COLOR_... |
coding-kitties/investing-algorithm-framework | https://github.com/coding-kitties/investing-algorithm-framework | null | null | null | null | 965 | null | null | apache-2.0 | null | null | null | null | null | null | null | investing_algorithm_framework/app/app_hook.py | null | null | null | null | null | null | Python | 2026-05-04T02:37:51.165863 | from abc import abstractmethod
class AppHook:
"""
Abstract class for app hooks. App hooks are used to run code before
actions of the framework are executed. This is useful for running code
that needs to be run before the following events:
- App initialization
- Strategy run
"""
@abstr... |
coding-kitties/investing-algorithm-framework | https://github.com/coding-kitties/investing-algorithm-framework | null | null | null | null | 965 | null | null | apache-2.0 | null | null | null | null | null | null | null | investing_algorithm_framework/analysis/ranking.py | null | null | null | null | null | null | Python | 2026-05-04T02:37:51.214924 | import math
from typing import List
from statistics import mean
from investing_algorithm_framework.domain import BacktestEvaluationFocus, \
BacktestDateRange, Backtest, BacktestMetrics, OperationalException
def normalize(value, min_val, max_val):
"""
Normalize a value to a range [0, 1].
"""
if va... |
coding-kitties/investing-algorithm-framework | https://github.com/coding-kitties/investing-algorithm-framework | null | null | null | null | 965 | null | null | apache-2.0 | null | null | null | null | null | null | null | investing_algorithm_framework/app/reporting/charts/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T02:37:51.541065 | from .equity_curve_drawdown import get_equity_curve_with_drawdown_chart
from .equity_curve import get_equity_curve_chart
from .rolling_sharp_ratio import get_rolling_sharpe_ratio_chart
from .monthly_returns_heatmap import get_monthly_returns_heatmap_chart
from .yearly_returns_barchart import get_yearly_returns_bar_char... |
coding-kitties/investing-algorithm-framework | https://github.com/coding-kitties/investing-algorithm-framework | null | null | null | null | 965 | null | null | apache-2.0 | null | null | null | null | null | null | null | investing_algorithm_framework/app/reporting/charts/entry_exist_signals.py | null | null | null | null | null | null | Python | 2026-05-04T02:37:51.632736 | import pandas as pd
import plotly.graph_objects as go
def get_entry_and_exit_signals(
entry_signals: pd.Series,
exit_signals: pd.Series,
price_data: pd.DataFrame
):
"""
Plots the price chart with entry and exit signals.
Args:
entry_signals (pd.Series): Series containing buy
... |
coding-kitties/investing-algorithm-framework | https://github.com/coding-kitties/investing-algorithm-framework | null | null | null | null | 965 | null | null | apache-2.0 | null | null | null | null | null | null | null | investing_algorithm_framework/app/reporting/backtest_report_old.py | null | null | null | null | null | null | Python | 2026-05-04T02:37:51.679155 | import logging
import os
import tempfile
from pathlib import Path
import webbrowser
from dataclasses import dataclass
from dataclasses import field
from typing import List, Union
import pandas as pd
from IPython import get_ipython
from IPython.display import display, HTML
from jinja2 import Environment, FileSystemLoad... |
coding-kitties/investing-algorithm-framework | https://github.com/coding-kitties/investing-algorithm-framework | null | null | null | null | 965 | null | null | apache-2.0 | null | null | null | null | null | null | null | investing_algorithm_framework/app/reporting/charts/equity_curve.py | null | null | null | null | null | null | Python | 2026-05-04T02:37:51.708290 | import pandas as pd
from plotly import graph_objects as go
def get_equity_curve_chart(equity_curve_series):
equity_curve_df = pd.DataFrame(
equity_curve_series, columns=["value", "datetime"]
)
# Normalize equity to start at 1
equity_curve_df["value"] = (
equity_curve_df["value"] / equ... |
coding-kitties/investing-algorithm-framework | https://github.com/coding-kitties/investing-algorithm-framework | null | null | null | null | 965 | null | null | apache-2.0 | null | null | null | null | null | null | null | investing_algorithm_framework/app/reporting/charts/line_chart.py | null | null | null | null | null | null | Python | 2026-05-04T02:37:51.710156 | import plotly.graph_objects as go
def create_line_scatter(x, y, name, colour = 'blue'):
return go.Scatter(
x=x,
y=y,
mode='lines',
name=name,
line=dict(color=colour)
)
|
coding-kitties/investing-algorithm-framework | https://github.com/coding-kitties/investing-algorithm-framework | null | null | null | null | 965 | null | null | apache-2.0 | null | null | null | null | null | null | null | investing_algorithm_framework/app/algorithm/algorithm_factory.py | null | null | null | null | null | null | Python | 2026-05-04T02:37:51.761849 | import inspect
from .algorithm import Algorithm
from investing_algorithm_framework.app.strategy import TradingStrategy
from investing_algorithm_framework.domain import generate_algorithm_id
class AlgorithmFactory:
"""
Factory class for creating an algorithm instance.
"""
@staticmethod
def _insta... |
coding-kitties/investing-algorithm-framework | https://github.com/coding-kitties/investing-algorithm-framework | null | null | null | null | 965 | null | null | apache-2.0 | null | null | null | null | null | null | null | investing_algorithm_framework/app/reporting/charts/equity_curve_drawdown.py | null | null | null | null | null | null | Python | 2026-05-04T02:37:51.778032 | import pandas as pd
from plotly.subplots import make_subplots
from plotly import graph_objects as go
def get_equity_curve_with_drawdown_chart(equity_curve_series, drawdown_series):
equity_curve_df = pd.DataFrame(
equity_curve_series, columns=["value", "datetime"]
)
drawdown_df = pd.DataFrame(
... |
coding-kitties/investing-algorithm-framework | https://github.com/coding-kitties/investing-algorithm-framework | null | null | null | null | 965 | null | null | apache-2.0 | null | null | null | null | null | null | null | investing_algorithm_framework/app/algorithm/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T02:37:51.804156 | from .algorithm_factory import AlgorithmFactory
from .algorithm import Algorithm
__all__ = [
"AlgorithmFactory",
"Algorithm"
]
|
coding-kitties/investing-algorithm-framework | https://github.com/coding-kitties/investing-algorithm-framework | null | null | null | null | 965 | null | null | apache-2.0 | null | null | null | null | null | null | null | investing_algorithm_framework/app/reporting/charts/monthly_returns_heatmap.py | null | null | null | null | null | null | Python | 2026-05-04T02:37:51.840895 | import pandas as pd
import plotly.graph_objects as go
def get_monthly_returns_heatmap_chart(monthly_return_series):
df = pd.DataFrame(monthly_return_series, columns=["Return", "Timestamp"])
df["Timestamp"] = pd.to_datetime(df["Timestamp"], errors='coerce')
df["Year"] = df["Timestamp"].dt.year
df["Mont... |
coding-kitties/investing-algorithm-framework | https://github.com/coding-kitties/investing-algorithm-framework | null | null | null | null | 965 | null | null | apache-2.0 | null | null | null | null | null | null | null | investing_algorithm_framework/app/reporting/charts/ohlcv_data_completeness.py | null | null | null | null | null | null | Python | 2026-05-04T02:37:53.452631 | import plotly.graph_objects as go
import pandas as pd
import plotly.io as pio
def get_ohlcv_data_completeness_chart(
df,
timeframe='1min',
windowsize=100,
title="OHLCV Data completenes"
):
df = df.copy()
df['Datetime'] = pd.to_datetime(df['Datetime'])
df = df.sort_values('Datetime').tail(wi... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.