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
getredash/redash
https://github.com/getredash/redash/blob/7d325f167dfa22160e43aededb863ac573778c91/tests/query_runner/test_ignite.py
tests/query_runner/test_ignite.py
import datetime from unittest import TestCase from redash.query_runner.ignite import Ignite class TestIgnite(TestCase): def test_server_to_connection(self): config = { "server": "localhost,localhost:10801,invalid:port:100", } ignite = Ignite(config) server = ignite.co...
python
BSD-2-Clause
7d325f167dfa22160e43aededb863ac573778c91
2026-01-04T14:43:51.827535Z
false
getredash/redash
https://github.com/getredash/redash/blob/7d325f167dfa22160e43aededb863ac573778c91/tests/query_runner/test_basesql_queryrunner.py
tests/query_runner/test_basesql_queryrunner.py
import unittest from redash.query_runner import BaseQueryRunner, BaseSQLQueryRunner from redash.utils import gen_query_hash class TestBaseSQLQueryRunner(unittest.TestCase): def setUp(self): self.query_runner = BaseSQLQueryRunner({}) def test_check_query_limit_no_limit(self): query = "SELECT ...
python
BSD-2-Clause
7d325f167dfa22160e43aededb863ac573778c91
2026-01-04T14:43:51.827535Z
false
getredash/redash
https://github.com/getredash/redash/blob/7d325f167dfa22160e43aededb863ac573778c91/tests/query_runner/test_trino.py
tests/query_runner/test_trino.py
""" Some test cases for Trino. """ from unittest import TestCase from unittest.mock import patch from redash.query_runner.trino import Trino class TestTrino(TestCase): catalog_name = "memory" schema_name = "default" table_name = "users" column_name = "id" column_type = "integer" @patch.obje...
python
BSD-2-Clause
7d325f167dfa22160e43aededb863ac573778c91
2026-01-04T14:43:51.827535Z
false
getredash/redash
https://github.com/getredash/redash/blob/7d325f167dfa22160e43aededb863ac573778c91/tests/query_runner/test_tinybird.py
tests/query_runner/test_tinybird.py
import json from unittest import TestCase from unittest.mock import Mock, patch from redash.query_runner import TYPE_DATETIME, TYPE_INTEGER, TYPE_STRING from redash.query_runner.tinybird import Tinybird DATASOURCES_RESPONSE = { "datasources": [ { "id": "t_datasource_id", "name": "t...
python
BSD-2-Clause
7d325f167dfa22160e43aededb863ac573778c91
2026-01-04T14:43:51.827535Z
false
getredash/redash
https://github.com/getredash/redash/blob/7d325f167dfa22160e43aededb863ac573778c91/tests/handlers/test_query_snippets.py
tests/handlers/test_query_snippets.py
from redash.models import QuerySnippet from tests import BaseTestCase class TestQuerySnippetResource(BaseTestCase): def test_get_snippet(self): snippet = self.factory.create_query_snippet() rv = self.make_request("get", "/api/query_snippets/{}".format(snippet.id)) for field in ("snippet"...
python
BSD-2-Clause
7d325f167dfa22160e43aededb863ac573778c91
2026-01-04T14:43:51.827535Z
false
getredash/redash
https://github.com/getredash/redash/blob/7d325f167dfa22160e43aededb863ac573778c91/tests/handlers/test_users.py
tests/handlers/test_users.py
from mock import patch from redash import models from tests import BaseTestCase class TestUserListResourcePost(BaseTestCase): def test_returns_403_for_non_admin(self): rv = self.make_request("post", "/api/users") self.assertEqual(rv.status_code, 403) def test_returns_400_when_missing_fields(...
python
BSD-2-Clause
7d325f167dfa22160e43aededb863ac573778c91
2026-01-04T14:43:51.827535Z
false
getredash/redash
https://github.com/getredash/redash/blob/7d325f167dfa22160e43aededb863ac573778c91/tests/handlers/test_dashboards.py
tests/handlers/test_dashboards.py
from redash.models import AccessPermission, ApiKey, Dashboard, db from redash.permissions import ACCESS_TYPE_MODIFY from redash.serializers import serialize_dashboard from redash.utils import json_loads from tests import BaseTestCase class TestDashboardListResource(BaseTestCase): def test_create_new_dashboard(sel...
python
BSD-2-Clause
7d325f167dfa22160e43aededb863ac573778c91
2026-01-04T14:43:51.827535Z
false
getredash/redash
https://github.com/getredash/redash/blob/7d325f167dfa22160e43aededb863ac573778c91/tests/handlers/test_order_results.py
tests/handlers/test_order_results.py
from redash import models from redash.handlers.base import order_results from redash.models import db from tests import BaseTestCase class TestOrderResults(BaseTestCase): def setUp(self): super().setUp() user1 = self.factory.create_user(name="Charlie") user2 = self.factory.create_user(nam...
python
BSD-2-Clause
7d325f167dfa22160e43aededb863ac573778c91
2026-01-04T14:43:51.827535Z
false
getredash/redash
https://github.com/getredash/redash/blob/7d325f167dfa22160e43aededb863ac573778c91/tests/handlers/test_groups.py
tests/handlers/test_groups.py
from funcy import project from redash.models import DataSource, Group, db from tests import BaseTestCase class TestGroupDataSourceListResource(BaseTestCase): def test_returns_only_groups_for_current_org(self): group = self.factory.create_group(org=self.factory.create_org()) self.factory.create_da...
python
BSD-2-Clause
7d325f167dfa22160e43aededb863ac573778c91
2026-01-04T14:43:51.827535Z
false
getredash/redash
https://github.com/getredash/redash/blob/7d325f167dfa22160e43aededb863ac573778c91/tests/handlers/test_widgets.py
tests/handlers/test_widgets.py
from redash import models from tests import BaseTestCase class WidgetAPITest(BaseTestCase): def create_widget(self, dashboard, visualization, width=1): data = { "visualization_id": visualization.id, "dashboard_id": dashboard.id, "options": {}, "width": width...
python
BSD-2-Clause
7d325f167dfa22160e43aededb863ac573778c91
2026-01-04T14:43:51.827535Z
false
getredash/redash
https://github.com/getredash/redash/blob/7d325f167dfa22160e43aededb863ac573778c91/tests/handlers/test_query_results.py
tests/handlers/test_query_results.py
from redash.handlers.query_results import error_messages, run_query from redash.models import db from tests import BaseTestCase class TestRunQuery(BaseTestCase): def test_run_query_with_no_data_source(self): response, status = run_query(None, None, None, None, None) self.assertDictEqual(response, ...
python
BSD-2-Clause
7d325f167dfa22160e43aededb863ac573778c91
2026-01-04T14:43:51.827535Z
false
getredash/redash
https://github.com/getredash/redash/blob/7d325f167dfa22160e43aededb863ac573778c91/tests/handlers/test_paginate.py
tests/handlers/test_paginate.py
from unittest import TestCase from mock import MagicMock from werkzeug.exceptions import BadRequest from redash.handlers.base import paginate class DummyResults: items = [i for i in range(25)] dummy_results = DummyResults() class TestPaginate(TestCase): def setUp(self): self.query_set = MagicMoc...
python
BSD-2-Clause
7d325f167dfa22160e43aededb863ac573778c91
2026-01-04T14:43:51.827535Z
false
getredash/redash
https://github.com/getredash/redash/blob/7d325f167dfa22160e43aededb863ac573778c91/tests/handlers/test_favorites.py
tests/handlers/test_favorites.py
from tests import BaseTestCase class TestQueryFavoriteResource(BaseTestCase): def test_favorite(self): query = self.factory.create_query() rv = self.make_request("post", "/api/queries/{}/favorite".format(query.id)) self.assertEqual(rv.status_code, 200) rv = self.make_request("get...
python
BSD-2-Clause
7d325f167dfa22160e43aededb863ac573778c91
2026-01-04T14:43:51.827535Z
false
getredash/redash
https://github.com/getredash/redash/blob/7d325f167dfa22160e43aededb863ac573778c91/tests/handlers/test_queries.py
tests/handlers/test_queries.py
from redash import models from redash.models import db from redash.permissions import ACCESS_TYPE_MODIFY from redash.serializers import serialize_query from tests import BaseTestCase class TestQueryResourceGet(BaseTestCase): def test_get_query(self): query = self.factory.create_query() rv = self....
python
BSD-2-Clause
7d325f167dfa22160e43aededb863ac573778c91
2026-01-04T14:43:51.827535Z
false
getredash/redash
https://github.com/getredash/redash/blob/7d325f167dfa22160e43aededb863ac573778c91/tests/handlers/test_data_sources.py
tests/handlers/test_data_sources.py
from funcy import pairwise from redash.models import DataSource from tests import BaseTestCase class TestDataSourceGetSchema(BaseTestCase): def test_fails_if_user_doesnt_belong_to_org(self): other_user = self.factory.create_user(org=self.factory.create_org()) response = self.make_request( ...
python
BSD-2-Clause
7d325f167dfa22160e43aededb863ac573778c91
2026-01-04T14:43:51.827535Z
false
getredash/redash
https://github.com/getredash/redash/blob/7d325f167dfa22160e43aededb863ac573778c91/tests/handlers/test_authentication.py
tests/handlers/test_authentication.py
import time import mock from redash import limiter, settings from redash.authentication.account import invite_token from redash.models import User from tests import BaseTestCase class TestResetPassword(BaseTestCase): def test_shows_reset_password_form(self): user = self.factory.create_user(is_invitation...
python
BSD-2-Clause
7d325f167dfa22160e43aededb863ac573778c91
2026-01-04T14:43:51.827535Z
false
getredash/redash
https://github.com/getredash/redash/blob/7d325f167dfa22160e43aededb863ac573778c91/tests/handlers/test_alerts.py
tests/handlers/test_alerts.py
import datetime from mock import patch from redash.models import Alert, AlertSubscription, db from redash.utils import utcnow from tests import BaseTestCase class TestAlertResourceGet(BaseTestCase): def test_returns_200_if_allowed(self): alert = self.factory.create_alert() rv = self.make_reques...
python
BSD-2-Clause
7d325f167dfa22160e43aededb863ac573778c91
2026-01-04T14:43:51.827535Z
false
getredash/redash
https://github.com/getredash/redash/blob/7d325f167dfa22160e43aededb863ac573778c91/tests/handlers/__init__.py
tests/handlers/__init__.py
python
BSD-2-Clause
7d325f167dfa22160e43aededb863ac573778c91
2026-01-04T14:43:51.827535Z
false
getredash/redash
https://github.com/getredash/redash/blob/7d325f167dfa22160e43aededb863ac573778c91/tests/handlers/test_visualizations.py
tests/handlers/test_visualizations.py
from redash import models from tests import BaseTestCase class VisualizationResourceTest(BaseTestCase): def test_create_visualization(self): query = self.factory.create_query() models.db.session.commit() data = { "query_id": query.id, "name": "Chart", "d...
python
BSD-2-Clause
7d325f167dfa22160e43aededb863ac573778c91
2026-01-04T14:43:51.827535Z
false
getredash/redash
https://github.com/getredash/redash/blob/7d325f167dfa22160e43aededb863ac573778c91/tests/handlers/test_settings.py
tests/handlers/test_settings.py
from redash.models import Organization from tests import BaseTestCase class TestOrganizationSettings(BaseTestCase): def test_post(self): admin = self.factory.create_admin() rv = self.make_request( "post", "/api/settings/organization", data={"auth_password_login_...
python
BSD-2-Clause
7d325f167dfa22160e43aededb863ac573778c91
2026-01-04T14:43:51.827535Z
false
getredash/redash
https://github.com/getredash/redash/blob/7d325f167dfa22160e43aededb863ac573778c91/tests/handlers/test_permissions.py
tests/handlers/test_permissions.py
from redash.models import AccessPermission from redash.permissions import ACCESS_TYPE_MODIFY from tests import BaseTestCase class TestObjectPermissionsListGet(BaseTestCase): def test_returns_empty_list_when_no_permissions(self): query = self.factory.create_query() user = self.factory.user ...
python
BSD-2-Clause
7d325f167dfa22160e43aededb863ac573778c91
2026-01-04T14:43:51.827535Z
false
getredash/redash
https://github.com/getredash/redash/blob/7d325f167dfa22160e43aededb863ac573778c91/tests/handlers/test_embed.py
tests/handlers/test_embed.py
from redash.models import db from tests import BaseTestCase class TestUnembedables(BaseTestCase): def test_not_embedable(self): query = self.factory.create_query() res = self.make_request("get", "/api/queries/{0}".format(query.id)) self.assertEqual(res.status_code, 200) self.assert...
python
BSD-2-Clause
7d325f167dfa22160e43aededb863ac573778c91
2026-01-04T14:43:51.827535Z
false
getredash/redash
https://github.com/getredash/redash/blob/7d325f167dfa22160e43aededb863ac573778c91/tests/handlers/test_destinations.py
tests/handlers/test_destinations.py
import json import textwrap from unittest import mock from redash.destinations.asana import Asana from redash.destinations.datadog import Datadog from redash.destinations.discord import Discord from redash.destinations.slack import Slack from redash.destinations.webex import Webex from redash.models import Alert, Noti...
python
BSD-2-Clause
7d325f167dfa22160e43aededb863ac573778c91
2026-01-04T14:43:51.827535Z
false
getredash/redash
https://github.com/getredash/redash/blob/7d325f167dfa22160e43aededb863ac573778c91/tests/destinations/test_webhook.py
tests/destinations/test_webhook.py
import json from unittest import mock from redash.destinations.webhook import Webhook from redash.models import Alert def test_webhook_notify_handles_unicode(): # Create a mock alert with all the properties needed by serialize_alert alert = mock.Mock() alert.id = 1 alert.name = "Test Alert" alert...
python
BSD-2-Clause
7d325f167dfa22160e43aededb863ac573778c91
2026-01-04T14:43:51.827535Z
false
getredash/redash
https://github.com/getredash/redash/blob/7d325f167dfa22160e43aededb863ac573778c91/bin/get_changes.py
bin/get_changes.py
#!/bin/env python3 import re import subprocess import sys def get_change_log(previous_sha): args = [ "git", "--no-pager", "log", "--merges", "--grep", "Merge pull request", '--pretty=format:"%h|%s|%b|%p"', "master...{}".format(previous_sha), ] ...
python
BSD-2-Clause
7d325f167dfa22160e43aededb863ac573778c91
2026-01-04T14:43:51.827535Z
false
getredash/redash
https://github.com/getredash/redash/blob/7d325f167dfa22160e43aededb863ac573778c91/bin/release_manager.py
bin/release_manager.py
#!/usr/bin/env python3 import os import re import subprocess import sys from urllib.parse import urlparse import requests import simplejson github_token = os.environ["GITHUB_TOKEN"] auth = (github_token, "x-oauth-basic") repo = "getredash/redash" def _github_request(method, path, params=None, headers={}): if ur...
python
BSD-2-Clause
7d325f167dfa22160e43aededb863ac573778c91
2026-01-04T14:43:51.827535Z
false
getredash/redash
https://github.com/getredash/redash/blob/7d325f167dfa22160e43aededb863ac573778c91/migrations/0001_warning.py
migrations/0001_warning.py
from __future__ import print_function # This is here just to print a warning for users who use the old Fabric upgrade script. if __name__ == '__main__': warning = "You're using an outdated upgrade script that is running migrations the wrong way. Please upgrade to " \ "newer version of the script befo...
python
BSD-2-Clause
7d325f167dfa22160e43aededb863ac573778c91
2026-01-04T14:43:51.827535Z
false
getredash/redash
https://github.com/getredash/redash/blob/7d325f167dfa22160e43aededb863ac573778c91/migrations/env.py
migrations/env.py
from __future__ import with_statement from alembic import context from sqlalchemy import engine_from_config, pool from logging.config import fileConfig import logging # this is the Alembic Config object, which provides # access to the values within the .ini file in use. config = context.config # Interpret the config ...
python
BSD-2-Clause
7d325f167dfa22160e43aededb863ac573778c91
2026-01-04T14:43:51.827535Z
false
getredash/redash
https://github.com/getredash/redash/blob/7d325f167dfa22160e43aededb863ac573778c91/migrations/versions/73beceabb948_bring_back_null_schedule.py
migrations/versions/73beceabb948_bring_back_null_schedule.py
"""bring_back_null_schedule Revision ID: 73beceabb948 Revises: e7f8a917aa8e Create Date: 2019-01-17 13:22:21.729334 """ from alembic import op import sqlalchemy as sa from sqlalchemy.sql import table from redash.models import MutableDict # revision identifiers, used by Alembic. revision = "73beceabb948" down_revisi...
python
BSD-2-Clause
7d325f167dfa22160e43aededb863ac573778c91
2026-01-04T14:43:51.827535Z
false
getredash/redash
https://github.com/getredash/redash/blob/7d325f167dfa22160e43aededb863ac573778c91/migrations/versions/969126bd800f_.py
migrations/versions/969126bd800f_.py
"""Update widget's position data based on dashboard layout. Revision ID: 969126bd800f Revises: 6b5be7e0a0ef Create Date: 2018-01-31 15:20:30.396533 """ import json from alembic import op import sqlalchemy as sa from redash.models import Dashboard, Widget, db # revision identifiers, used by Alembic. revision = "96...
python
BSD-2-Clause
7d325f167dfa22160e43aededb863ac573778c91
2026-01-04T14:43:51.827535Z
false
getredash/redash
https://github.com/getredash/redash/blob/7d325f167dfa22160e43aededb863ac573778c91/migrations/versions/7671dca4e604_.py
migrations/versions/7671dca4e604_.py
"""empty message Revision ID: 7671dca4e604 Revises: d1eae8b9893e Create Date: 2017-11-22 22:20:25.166045 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = "7671dca4e604" down_revision = "d1eae8b9893e" branch_labels = None depends_on = None def upgrade(): op...
python
BSD-2-Clause
7d325f167dfa22160e43aededb863ac573778c91
2026-01-04T14:43:51.827535Z
false
getredash/redash
https://github.com/getredash/redash/blob/7d325f167dfa22160e43aededb863ac573778c91/migrations/versions/71477dadd6ef_favorites_unique_constraint.py
migrations/versions/71477dadd6ef_favorites_unique_constraint.py
"""favorites_unique_constraint Revision ID: 71477dadd6ef Revises: 0f740a081d20 Create Date: 2018-07-11 12:49:52.792123 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = "71477dadd6ef" down_revision = "0f740a081d20" branch_labels = None depends_on = None def upg...
python
BSD-2-Clause
7d325f167dfa22160e43aededb863ac573778c91
2026-01-04T14:43:51.827535Z
false
getredash/redash
https://github.com/getredash/redash/blob/7d325f167dfa22160e43aededb863ac573778c91/migrations/versions/640888ce445d_.py
migrations/versions/640888ce445d_.py
""" Add new scheduling data. Revision ID: 640888ce445d Revises: 71477dadd6ef Create Date: 2018-09-21 19:35:58.578796 """ import json from alembic import op import sqlalchemy as sa from sqlalchemy.sql import table from redash.models import MutableDict # revision identifiers, used by Alembic. revision = "640888ce445d...
python
BSD-2-Clause
7d325f167dfa22160e43aededb863ac573778c91
2026-01-04T14:43:51.827535Z
false
getredash/redash
https://github.com/getredash/redash/blob/7d325f167dfa22160e43aededb863ac573778c91/migrations/versions/89bc7873a3e0_fix_multiple_heads.py
migrations/versions/89bc7873a3e0_fix_multiple_heads.py
"""fix_multiple_heads Revision ID: 89bc7873a3e0 Revises: 0ec979123ba4, d7d747033183 Create Date: 2021-01-21 18:11:04.312259 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = '89bc7873a3e0' down_revision = ('0ec979123ba4', 'd7d747033183') branch_labels = None depe...
python
BSD-2-Clause
7d325f167dfa22160e43aededb863ac573778c91
2026-01-04T14:43:51.827535Z
false
getredash/redash
https://github.com/getredash/redash/blob/7d325f167dfa22160e43aededb863ac573778c91/migrations/versions/a92d92aa678e_inline_tags.py
migrations/versions/a92d92aa678e_inline_tags.py
"""inline_tags Revision ID: a92d92aa678e Revises: e7004224f284 Create Date: 2018-05-10 15:41:28.053237 """ import re from funcy import flatten, compact from alembic import op import sqlalchemy as sa from sqlalchemy.dialects.postgresql import ARRAY from redash import models # revision identifiers, used by Alembic. re...
python
BSD-2-Clause
7d325f167dfa22160e43aededb863ac573778c91
2026-01-04T14:43:51.827535Z
false
getredash/redash
https://github.com/getredash/redash/blob/7d325f167dfa22160e43aededb863ac573778c91/migrations/versions/5ec5c84ba61e_.py
migrations/versions/5ec5c84ba61e_.py
"""Add Query.search_vector field for full text search. Revision ID: 5ec5c84ba61e Revises: 7671dca4e604 Create Date: 2017-10-17 18:21:00.174015 """ from alembic import op import sqlalchemy as sa import sqlalchemy_utils as su import sqlalchemy_searchable as ss # revision identifiers, used by Alembic. revision = "5ec5...
python
BSD-2-Clause
7d325f167dfa22160e43aededb863ac573778c91
2026-01-04T14:43:51.827535Z
false
getredash/redash
https://github.com/getredash/redash/blob/7d325f167dfa22160e43aededb863ac573778c91/migrations/versions/e5c7a4e2df4d_remove_query_tracker_keys.py
migrations/versions/e5c7a4e2df4d_remove_query_tracker_keys.py
"""remove_query_tracker_keys Revision ID: e5c7a4e2df4d Revises: 98af61feea92 Create Date: 2019-02-27 11:30:15.375318 """ from alembic import op import sqlalchemy as sa from redash import redis_connection # revision identifiers, used by Alembic. revision = "e5c7a4e2df4d" down_revision = "98af61feea92" branch_labels...
python
BSD-2-Clause
7d325f167dfa22160e43aededb863ac573778c91
2026-01-04T14:43:51.827535Z
false
getredash/redash
https://github.com/getredash/redash/blob/7d325f167dfa22160e43aededb863ac573778c91/migrations/versions/6b5be7e0a0ef_.py
migrations/versions/6b5be7e0a0ef_.py
"""Re-index Query.search_vector with existing queries. Revision ID: 6b5be7e0a0ef Revises: 5ec5c84ba61e Create Date: 2017-11-02 20:42:13.356360 """ from alembic import op import sqlalchemy as sa import sqlalchemy_searchable as ss # revision identifiers, used by Alembic. revision = "6b5be7e0a0ef" down_revision = "5ec...
python
BSD-2-Clause
7d325f167dfa22160e43aededb863ac573778c91
2026-01-04T14:43:51.827535Z
false
getredash/redash
https://github.com/getredash/redash/blob/7d325f167dfa22160e43aededb863ac573778c91/migrations/versions/e7004224f284_add_org_id_to_favorites.py
migrations/versions/e7004224f284_add_org_id_to_favorites.py
"""add_org_id_to_favorites Revision ID: e7004224f284 Revises: d4c798575877 Create Date: 2018-05-10 09:46:31.169938 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = "e7004224f284" down_revision = "d4c798575877" branch_labels = None depends_on = None def upgrade...
python
BSD-2-Clause
7d325f167dfa22160e43aededb863ac573778c91
2026-01-04T14:43:51.827535Z
false
getredash/redash
https://github.com/getredash/redash/blob/7d325f167dfa22160e43aededb863ac573778c91/migrations/versions/d4c798575877_create_favorites.py
migrations/versions/d4c798575877_create_favorites.py
"""empty message Revision ID: d4c798575877 Revises: 1daa601d3ae5 Create Date: 2018-05-09 10:28:22.931442 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = "d4c798575877" down_revision = "1daa601d3ae5" branch_labels = None depends_on = None def upgrade(): op...
python
BSD-2-Clause
7d325f167dfa22160e43aededb863ac573778c91
2026-01-04T14:43:51.827535Z
false
getredash/redash
https://github.com/getredash/redash/blob/7d325f167dfa22160e43aededb863ac573778c91/migrations/versions/7205816877ec_change_type_of_json_fields_from_varchar_.py
migrations/versions/7205816877ec_change_type_of_json_fields_from_varchar_.py
"""change type of json fields from varchar to json Revision ID: 7205816877ec Revises: 7ce5925f832b Create Date: 2024-01-03 13:55:18.885021 """ from alembic import op import sqlalchemy as sa from sqlalchemy.dialects.postgresql import JSONB, JSON # revision identifiers, used by Alembic. revision = '7205816877ec' down...
python
BSD-2-Clause
7d325f167dfa22160e43aededb863ac573778c91
2026-01-04T14:43:51.827535Z
false
getredash/redash
https://github.com/getredash/redash/blob/7d325f167dfa22160e43aededb863ac573778c91/migrations/versions/9e8c841d1a30_fix_hash.py
migrations/versions/9e8c841d1a30_fix_hash.py
"""fix_hash Revision ID: 9e8c841d1a30 Revises: 7205816877ec Create Date: 2024-10-05 18:55:35.730573 """ import logging from alembic import op import sqlalchemy as sa from sqlalchemy.sql import table from sqlalchemy import select from redash.query_runner import BaseQueryRunner, get_query_runner # revision identifie...
python
BSD-2-Clause
7d325f167dfa22160e43aededb863ac573778c91
2026-01-04T14:43:51.827535Z
false
getredash/redash
https://github.com/getredash/redash/blob/7d325f167dfa22160e43aededb863ac573778c91/migrations/versions/65fc9ede4746_add_is_draft_status_to_queries_and_.py
migrations/versions/65fc9ede4746_add_is_draft_status_to_queries_and_.py
"""Add is_draft status to queries and dashboards Revision ID: 65fc9ede4746 Revises: Create Date: 2016-12-07 18:08:13.395586 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. from sqlalchemy.exc import ProgrammingError revision = "65fc9ede4746" down_revision = None branch_l...
python
BSD-2-Clause
7d325f167dfa22160e43aededb863ac573778c91
2026-01-04T14:43:51.827535Z
false
getredash/redash
https://github.com/getredash/redash/blob/7d325f167dfa22160e43aededb863ac573778c91/migrations/versions/1038c2174f5d_make_case_insensitive_hash_of_query_text.py
migrations/versions/1038c2174f5d_make_case_insensitive_hash_of_query_text.py
"""Make case insensitive hash of query text Revision ID: 1038c2174f5d Revises: fd4fc850d7ea Create Date: 2023-07-16 23:10:12.885949 """ from alembic import op import sqlalchemy as sa from sqlalchemy.sql import table from redash.utils import gen_query_hash # revision identifiers, used by Alembic. revision = '1038c21...
python
BSD-2-Clause
7d325f167dfa22160e43aededb863ac573778c91
2026-01-04T14:43:51.827535Z
false
getredash/redash
https://github.com/getredash/redash/blob/7d325f167dfa22160e43aededb863ac573778c91/migrations/versions/d1eae8b9893e_.py
migrations/versions/d1eae8b9893e_.py
"""add Query.schedule_failures Revision ID: d1eae8b9893e Revises: 65fc9ede4746 Create Date: 2017-02-03 01:45:02.954923 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = "d1eae8b9893e" down_revision = "65fc9ede4746" branch_labels = None depends_on = None def upg...
python
BSD-2-Clause
7d325f167dfa22160e43aededb863ac573778c91
2026-01-04T14:43:51.827535Z
false
getredash/redash
https://github.com/getredash/redash/blob/7d325f167dfa22160e43aededb863ac573778c91/migrations/versions/1655999df5e3_default_alert_selector.py
migrations/versions/1655999df5e3_default_alert_selector.py
"""set default alert selector Revision ID: 1655999df5e3 Revises: 9e8c841d1a30 Create Date: 2025-07-09 14:44:00 """ from alembic import op # revision identifiers, used by Alembic. revision = '1655999df5e3' down_revision = '9e8c841d1a30' branch_labels = None depends_on = None def upgrade(): op.execute(""" U...
python
BSD-2-Clause
7d325f167dfa22160e43aededb863ac573778c91
2026-01-04T14:43:51.827535Z
false
getredash/redash
https://github.com/getredash/redash/blob/7d325f167dfa22160e43aededb863ac573778c91/migrations/versions/fd4fc850d7ea_.py
migrations/versions/fd4fc850d7ea_.py
"""Convert user details to jsonb and move user profile image url into details column Revision ID: fd4fc850d7ea Revises: 89bc7873a3e0 Create Date: 2022-01-31 15:24:16.507888 """ from alembic import op import sqlalchemy as sa from sqlalchemy.dialects.postgresql import JSON, JSONB from redash.models import db # revisi...
python
BSD-2-Clause
7d325f167dfa22160e43aededb863ac573778c91
2026-01-04T14:43:51.827535Z
false
getredash/redash
https://github.com/getredash/redash/blob/7d325f167dfa22160e43aededb863ac573778c91/migrations/versions/1daa601d3ae5_add_columns_for_disabled_users.py
migrations/versions/1daa601d3ae5_add_columns_for_disabled_users.py
"""add columns for disabled users Revision ID: 1daa601d3ae5 Revises: 969126bd800f Create Date: 2018-03-07 10:20:10.410159 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = "1daa601d3ae5" down_revision = "969126bd800f" branch_labels = None depends_on = None def ...
python
BSD-2-Clause
7d325f167dfa22160e43aededb863ac573778c91
2026-01-04T14:43:51.827535Z
false
getredash/redash
https://github.com/getredash/redash/blob/7d325f167dfa22160e43aededb863ac573778c91/migrations/versions/d7d747033183_encrypt_alert_destinations.py
migrations/versions/d7d747033183_encrypt_alert_destinations.py
"""encrypt alert destinations Revision ID: d7d747033183 Revises: e5c7a4e2df4d Create Date: 2020-12-14 21:42:48.661684 """ from alembic import op import sqlalchemy as sa from sqlalchemy.dialects.postgresql import BYTEA from sqlalchemy.sql import table from sqlalchemy_utils.types.encrypted.encrypted_type import FernetE...
python
BSD-2-Clause
7d325f167dfa22160e43aededb863ac573778c91
2026-01-04T14:43:51.827535Z
false
getredash/redash
https://github.com/getredash/redash/blob/7d325f167dfa22160e43aededb863ac573778c91/migrations/versions/7ce5925f832b_create_sqlalchemy_searchable_expressions.py
migrations/versions/7ce5925f832b_create_sqlalchemy_searchable_expressions.py
"""create sqlalchemy_searchable expressions Revision ID: 7ce5925f832b Revises: 1038c2174f5d Create Date: 2023-09-29 16:48:29.517762 """ from alembic import op import sqlalchemy as sa from sqlalchemy_searchable import sql_expressions # revision identifiers, used by Alembic. revision = '7ce5925f832b' down_revision = ...
python
BSD-2-Clause
7d325f167dfa22160e43aededb863ac573778c91
2026-01-04T14:43:51.827535Z
false
getredash/redash
https://github.com/getredash/redash/blob/7d325f167dfa22160e43aededb863ac573778c91/migrations/versions/e7f8a917aa8e_add_user_details_json_column.py
migrations/versions/e7f8a917aa8e_add_user_details_json_column.py
"""Add user details JSON column. Revision ID: e7f8a917aa8e Revises: 71477dadd6ef Create Date: 2018-11-08 16:12:17.023569 """ from alembic import op import sqlalchemy as sa from sqlalchemy.dialects.postgresql import JSON # revision identifiers, used by Alembic. revision = "e7f8a917aa8e" down_revision = "640888ce445d"...
python
BSD-2-Clause
7d325f167dfa22160e43aededb863ac573778c91
2026-01-04T14:43:51.827535Z
false
getredash/redash
https://github.com/getredash/redash/blob/7d325f167dfa22160e43aededb863ac573778c91/migrations/versions/0ec979123ba4_.py
migrations/versions/0ec979123ba4_.py
"""empty message Revision ID: 0ec979123ba4 Revises: e5c7a4e2df4d Create Date: 2020-12-23 21:35:32.766354 """ from alembic import op import sqlalchemy as sa from sqlalchemy.dialects.postgresql import JSON # revision identifiers, used by Alembic. revision = '0ec979123ba4' down_revision = 'e5c7a4e2df4d' branch_labels =...
python
BSD-2-Clause
7d325f167dfa22160e43aededb863ac573778c91
2026-01-04T14:43:51.827535Z
false
getredash/redash
https://github.com/getredash/redash/blob/7d325f167dfa22160e43aededb863ac573778c91/migrations/versions/98af61feea92_add_encrypted_options_to_data_sources.py
migrations/versions/98af61feea92_add_encrypted_options_to_data_sources.py
"""add_encrypted_options_to_data_sources Revision ID: 98af61feea92 Revises: 73beceabb948 Create Date: 2019-01-31 09:21:31.517265 """ from alembic import op import sqlalchemy as sa from sqlalchemy.dialects.postgresql import BYTEA from sqlalchemy.sql import table from sqlalchemy_utils.types.encrypted.encrypted_type imp...
python
BSD-2-Clause
7d325f167dfa22160e43aededb863ac573778c91
2026-01-04T14:43:51.827535Z
false
getredash/redash
https://github.com/getredash/redash/blob/7d325f167dfa22160e43aededb863ac573778c91/migrations/versions/db0aca1ebd32_12_column_dashboard_layout.py
migrations/versions/db0aca1ebd32_12_column_dashboard_layout.py
"""12-column dashboard layout Revision ID: db0aca1ebd32 Revises: 1655999df5e3 Create Date: 2025-03-31 13:45:43.160893 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = 'db0aca1ebd32' down_revision = '1655999df5e3' branch_labels = None depends_on = None def upgr...
python
BSD-2-Clause
7d325f167dfa22160e43aededb863ac573778c91
2026-01-04T14:43:51.827535Z
false
getredash/redash
https://github.com/getredash/redash/blob/7d325f167dfa22160e43aededb863ac573778c91/migrations/versions/0f740a081d20_inline_tags.py
migrations/versions/0f740a081d20_inline_tags.py
"""inline_tags Revision ID: 0f740a081d20 Revises: a92d92aa678e Create Date: 2018-05-10 15:47:56.120338 """ import re from funcy import flatten, compact from alembic import op import sqlalchemy as sa from sqlalchemy.sql import text from redash import models # revision identifiers, used by Alembic. revision = "0f740a...
python
BSD-2-Clause
7d325f167dfa22160e43aededb863ac573778c91
2026-01-04T14:43:51.827535Z
false
stanford-oval/storm
https://github.com/stanford-oval/storm/blob/fb951af7744dab086e34962e9bc6fe878e145f83/setup.py
setup.py
import re from setuptools import setup, find_packages # Read the content of the README file with open("README.md", encoding="utf-8") as f: long_description = f.read() # Remove p tags. pattern = re.compile(r"<p.*?>.*?</p>", re.DOTALL) long_description = re.sub(pattern, "", long_description) # Read the...
python
MIT
fb951af7744dab086e34962e9bc6fe878e145f83
2026-01-04T14:44:02.494109Z
false
stanford-oval/storm
https://github.com/stanford-oval/storm/blob/fb951af7744dab086e34962e9bc6fe878e145f83/knowledge_storm/encoder.py
knowledge_storm/encoder.py
import os import numpy as np from concurrent.futures import ThreadPoolExecutor, as_completed from typing import List, Tuple, Union, Optional, Dict, Literal from pathlib import Path try: import warnings with warnings.catch_warnings(): warnings.filterwarnings("ignore", category=UserWarning) if ...
python
MIT
fb951af7744dab086e34962e9bc6fe878e145f83
2026-01-04T14:44:02.494109Z
false
stanford-oval/storm
https://github.com/stanford-oval/storm/blob/fb951af7744dab086e34962e9bc6fe878e145f83/knowledge_storm/lm.py
knowledge_storm/lm.py
import backoff import dspy import functools import logging import os import random import requests import threading from typing import Optional, Literal, Any import ujson from pathlib import Path from dsp import ERRORS, backoff_hdlr, giveup_hdlr from dsp.modules.hf import openai_to_hf from dsp.modules.hf_client impor...
python
MIT
fb951af7744dab086e34962e9bc6fe878e145f83
2026-01-04T14:44:02.494109Z
true
stanford-oval/storm
https://github.com/stanford-oval/storm/blob/fb951af7744dab086e34962e9bc6fe878e145f83/knowledge_storm/rm.py
knowledge_storm/rm.py
import logging import os from typing import Callable, Union, List import backoff import dspy import requests from dsp import backoff_hdlr, giveup_hdlr from .utils import WebPageHelper class YouRM(dspy.Retrieve): def __init__(self, ydc_api_key=None, k=3, is_valid_source: Callable = None): super().__init_...
python
MIT
fb951af7744dab086e34962e9bc6fe878e145f83
2026-01-04T14:44:02.494109Z
true
stanford-oval/storm
https://github.com/stanford-oval/storm/blob/fb951af7744dab086e34962e9bc6fe878e145f83/knowledge_storm/dataclass.py
knowledge_storm/dataclass.py
import dspy import numpy as np import re import threading from typing import Set, Dict, List, Optional, Union, Tuple from .encoder import Encoder from .interface import Information class ConversationTurn: """ A class to represent a turn in a conversation. Attributes: role (str): A short phrase o...
python
MIT
fb951af7744dab086e34962e9bc6fe878e145f83
2026-01-04T14:44:02.494109Z
false
stanford-oval/storm
https://github.com/stanford-oval/storm/blob/fb951af7744dab086e34962e9bc6fe878e145f83/knowledge_storm/interface.py
knowledge_storm/interface.py
import concurrent.futures import dspy import functools import hashlib import json import logging import time from abc import ABC, abstractmethod from collections import OrderedDict from typing import Dict, List, Optional, Union, TYPE_CHECKING from .utils import ArticleTextProcessing logging.basicConfig( level=log...
python
MIT
fb951af7744dab086e34962e9bc6fe878e145f83
2026-01-04T14:44:02.494109Z
false
stanford-oval/storm
https://github.com/stanford-oval/storm/blob/fb951af7744dab086e34962e9bc6fe878e145f83/knowledge_storm/utils.py
knowledge_storm/utils.py
import concurrent.futures import dspy import httpx import json import logging import os import pickle import re import regex import sys import toml from typing import List, Dict from tqdm import tqdm from langchain_text_splitters import RecursiveCharacterTextSplitter from trafilatura import extract from .lm import Li...
python
MIT
fb951af7744dab086e34962e9bc6fe878e145f83
2026-01-04T14:44:02.494109Z
false
stanford-oval/storm
https://github.com/stanford-oval/storm/blob/fb951af7744dab086e34962e9bc6fe878e145f83/knowledge_storm/logging_wrapper.py
knowledge_storm/logging_wrapper.py
from contextlib import contextmanager import time import pytz from datetime import datetime # Define California timezone CALIFORNIA_TZ = pytz.timezone("America/Los_Angeles") class EventLog: def __init__(self, event_name): self.event_name = event_name self.start_time = None self.end_time =...
python
MIT
fb951af7744dab086e34962e9bc6fe878e145f83
2026-01-04T14:44:02.494109Z
false
stanford-oval/storm
https://github.com/stanford-oval/storm/blob/fb951af7744dab086e34962e9bc6fe878e145f83/knowledge_storm/__init__.py
knowledge_storm/__init__.py
from .storm_wiki import * from .collaborative_storm import * from .encoder import * from .interface import * from .lm import * from .rm import * from .utils import * from .dataclass import * __version__ = "1.1.0"
python
MIT
fb951af7744dab086e34962e9bc6fe878e145f83
2026-01-04T14:44:02.494109Z
false
stanford-oval/storm
https://github.com/stanford-oval/storm/blob/fb951af7744dab086e34962e9bc6fe878e145f83/knowledge_storm/storm_wiki/__init__.py
knowledge_storm/storm_wiki/__init__.py
from .engine import * from .modules import *
python
MIT
fb951af7744dab086e34962e9bc6fe878e145f83
2026-01-04T14:44:02.494109Z
false
stanford-oval/storm
https://github.com/stanford-oval/storm/blob/fb951af7744dab086e34962e9bc6fe878e145f83/knowledge_storm/storm_wiki/engine.py
knowledge_storm/storm_wiki/engine.py
import json import logging import os from dataclasses import dataclass, field from typing import Union, Literal, Optional import dspy from .modules.article_generation import StormArticleGenerationModule from .modules.article_polish import StormArticlePolishingModule from .modules.callback import BaseCallbackHandler f...
python
MIT
fb951af7744dab086e34962e9bc6fe878e145f83
2026-01-04T14:44:02.494109Z
false
stanford-oval/storm
https://github.com/stanford-oval/storm/blob/fb951af7744dab086e34962e9bc6fe878e145f83/knowledge_storm/storm_wiki/modules/persona_generator.py
knowledge_storm/storm_wiki/modules/persona_generator.py
import logging import re from typing import Union, List import dspy import requests from bs4 import BeautifulSoup def get_wiki_page_title_and_toc(url): """Get the main title and table of contents from an url of a Wikipedia page.""" response = requests.get(url) soup = BeautifulSoup(response.content, "htm...
python
MIT
fb951af7744dab086e34962e9bc6fe878e145f83
2026-01-04T14:44:02.494109Z
false
stanford-oval/storm
https://github.com/stanford-oval/storm/blob/fb951af7744dab086e34962e9bc6fe878e145f83/knowledge_storm/storm_wiki/modules/callback.py
knowledge_storm/storm_wiki/modules/callback.py
class BaseCallbackHandler: """Base callback handler that can be used to handle callbacks from the STORM pipeline.""" def on_identify_perspective_start(self, **kwargs): """Run when the perspective identification starts.""" pass def on_identify_perspective_end(self, perspectives: list[str], ...
python
MIT
fb951af7744dab086e34962e9bc6fe878e145f83
2026-01-04T14:44:02.494109Z
false
stanford-oval/storm
https://github.com/stanford-oval/storm/blob/fb951af7744dab086e34962e9bc6fe878e145f83/knowledge_storm/storm_wiki/modules/article_polish.py
knowledge_storm/storm_wiki/modules/article_polish.py
import copy from typing import Union import dspy from .storm_dataclass import StormArticle from ...interface import ArticlePolishingModule from ...utils import ArticleTextProcessing class StormArticlePolishingModule(ArticlePolishingModule): """ The interface for article generation stage. Given topic, collec...
python
MIT
fb951af7744dab086e34962e9bc6fe878e145f83
2026-01-04T14:44:02.494109Z
false
stanford-oval/storm
https://github.com/stanford-oval/storm/blob/fb951af7744dab086e34962e9bc6fe878e145f83/knowledge_storm/storm_wiki/modules/storm_dataclass.py
knowledge_storm/storm_wiki/modules/storm_dataclass.py
import copy import re from collections import OrderedDict from typing import Union, Optional, Any, List, Tuple, Dict import numpy as np from sentence_transformers import SentenceTransformer from sklearn.metrics.pairwise import cosine_similarity from ...interface import Information, InformationTable, Article, ArticleS...
python
MIT
fb951af7744dab086e34962e9bc6fe878e145f83
2026-01-04T14:44:02.494109Z
false
stanford-oval/storm
https://github.com/stanford-oval/storm/blob/fb951af7744dab086e34962e9bc6fe878e145f83/knowledge_storm/storm_wiki/modules/__init__.py
knowledge_storm/storm_wiki/modules/__init__.py
from .knowledge_curation import * from .persona_generator import * from .retriever import * from .storm_dataclass import *
python
MIT
fb951af7744dab086e34962e9bc6fe878e145f83
2026-01-04T14:44:02.494109Z
false
stanford-oval/storm
https://github.com/stanford-oval/storm/blob/fb951af7744dab086e34962e9bc6fe878e145f83/knowledge_storm/storm_wiki/modules/retriever.py
knowledge_storm/storm_wiki/modules/retriever.py
from typing import Union, List from urllib.parse import urlparse import dspy from ...interface import Retriever, Information from ...utils import ArticleTextProcessing # Internet source restrictions according to Wikipedia standard: # https://en.wikipedia.org/wiki/Wikipedia:Reliable_sources/Perennial_sources GENERALL...
python
MIT
fb951af7744dab086e34962e9bc6fe878e145f83
2026-01-04T14:44:02.494109Z
false
stanford-oval/storm
https://github.com/stanford-oval/storm/blob/fb951af7744dab086e34962e9bc6fe878e145f83/knowledge_storm/storm_wiki/modules/knowledge_curation.py
knowledge_storm/storm_wiki/modules/knowledge_curation.py
import concurrent.futures import logging import os from concurrent.futures import as_completed from typing import Union, List, Tuple, Optional, Dict import dspy from .callback import BaseCallbackHandler from .persona_generator import StormPersonaGenerator from .storm_dataclass import DialogueTurn, StormInformationTab...
python
MIT
fb951af7744dab086e34962e9bc6fe878e145f83
2026-01-04T14:44:02.494109Z
false
stanford-oval/storm
https://github.com/stanford-oval/storm/blob/fb951af7744dab086e34962e9bc6fe878e145f83/knowledge_storm/storm_wiki/modules/outline_generation.py
knowledge_storm/storm_wiki/modules/outline_generation.py
from typing import Union, Optional, Tuple import dspy from .callback import BaseCallbackHandler from .storm_dataclass import StormInformationTable, StormArticle from ...interface import OutlineGenerationModule from ...utils import ArticleTextProcessing class StormOutlineGenerationModule(OutlineGenerationModule): ...
python
MIT
fb951af7744dab086e34962e9bc6fe878e145f83
2026-01-04T14:44:02.494109Z
false
stanford-oval/storm
https://github.com/stanford-oval/storm/blob/fb951af7744dab086e34962e9bc6fe878e145f83/knowledge_storm/storm_wiki/modules/article_generation.py
knowledge_storm/storm_wiki/modules/article_generation.py
import concurrent.futures import copy import logging from concurrent.futures import as_completed from typing import List, Union import dspy from .callback import BaseCallbackHandler from .storm_dataclass import StormInformationTable, StormArticle from ...interface import ArticleGenerationModule, Information from ...u...
python
MIT
fb951af7744dab086e34962e9bc6fe878e145f83
2026-01-04T14:44:02.494109Z
false
stanford-oval/storm
https://github.com/stanford-oval/storm/blob/fb951af7744dab086e34962e9bc6fe878e145f83/knowledge_storm/collaborative_storm/__init__.py
knowledge_storm/collaborative_storm/__init__.py
from .modules import * from .engine import *
python
MIT
fb951af7744dab086e34962e9bc6fe878e145f83
2026-01-04T14:44:02.494109Z
false
stanford-oval/storm
https://github.com/stanford-oval/storm/blob/fb951af7744dab086e34962e9bc6fe878e145f83/knowledge_storm/collaborative_storm/engine.py
knowledge_storm/collaborative_storm/engine.py
import dspy import os from dataclasses import dataclass, field, asdict from typing import List, Union, Literal, Optional, Dict from .modules import collaborative_storm_utils as collaborative_storm_utils from .modules.callback import BaseCallbackHandler from .modules.co_storm_agents import ( SimulatedUser, Pure...
python
MIT
fb951af7744dab086e34962e9bc6fe878e145f83
2026-01-04T14:44:02.494109Z
false
stanford-oval/storm
https://github.com/stanford-oval/storm/blob/fb951af7744dab086e34962e9bc6fe878e145f83/knowledge_storm/collaborative_storm/modules/warmstart_hierarchical_chat.py
knowledge_storm/collaborative_storm/modules/warmstart_hierarchical_chat.py
""" Warm starts the Co-STORM system by conducting a background information search to establish a shared conceptual space with the user. This stage functions as a mini-STORM, where multiple LLM agents are spawned with different perspectives to engage in multi-round conversations. The knowledge base (represented as a ...
python
MIT
fb951af7744dab086e34962e9bc6fe878e145f83
2026-01-04T14:44:02.494109Z
false
stanford-oval/storm
https://github.com/stanford-oval/storm/blob/fb951af7744dab086e34962e9bc6fe878e145f83/knowledge_storm/collaborative_storm/modules/co_storm_agents.py
knowledge_storm/collaborative_storm/modules/co_storm_agents.py
import dspy from itertools import zip_longest import numpy as np from sklearn.metrics.pairwise import cosine_similarity from typing import List, Optional, TYPE_CHECKING from .callback import BaseCallbackHandler from .collaborative_storm_utils import ( extract_storm_info_snippet, _get_answer_question_module_ins...
python
MIT
fb951af7744dab086e34962e9bc6fe878e145f83
2026-01-04T14:44:02.494109Z
false
stanford-oval/storm
https://github.com/stanford-oval/storm/blob/fb951af7744dab086e34962e9bc6fe878e145f83/knowledge_storm/collaborative_storm/modules/callback.py
knowledge_storm/collaborative_storm/modules/callback.py
from typing import List from ...interface import Information class BaseCallbackHandler: """Base callback handler to manage callbacks from the Co-STORM pipeline.""" def on_turn_policy_planning_start(self, **kwargs): """Run when the turn policy planning begins, before deciding the direction or goal for...
python
MIT
fb951af7744dab086e34962e9bc6fe878e145f83
2026-01-04T14:44:02.494109Z
false
stanford-oval/storm
https://github.com/stanford-oval/storm/blob/fb951af7744dab086e34962e9bc6fe878e145f83/knowledge_storm/collaborative_storm/modules/grounded_question_answering.py
knowledge_storm/collaborative_storm/modules/grounded_question_answering.py
import dspy from typing import Union, List from .callback import BaseCallbackHandler from .collaborative_storm_utils import ( trim_output_after_hint, format_search_results, extract_cited_storm_info, separate_citations, ) from ...logging_wrapper import LoggingWrapper from ...utils import ArticleTextProc...
python
MIT
fb951af7744dab086e34962e9bc6fe878e145f83
2026-01-04T14:44:02.494109Z
false
stanford-oval/storm
https://github.com/stanford-oval/storm/blob/fb951af7744dab086e34962e9bc6fe878e145f83/knowledge_storm/collaborative_storm/modules/information_insertion_module.py
knowledge_storm/collaborative_storm/modules/information_insertion_module.py
import dspy import numpy as np import re import traceback from concurrent.futures import ThreadPoolExecutor, as_completed from sklearn.metrics.pairwise import cosine_similarity from typing import List, Union, Dict, Optional from .collaborative_storm_utils import trim_output_after_hint from ...dataclass import Knowled...
python
MIT
fb951af7744dab086e34962e9bc6fe878e145f83
2026-01-04T14:44:02.494109Z
false
stanford-oval/storm
https://github.com/stanford-oval/storm/blob/fb951af7744dab086e34962e9bc6fe878e145f83/knowledge_storm/collaborative_storm/modules/simulate_user.py
knowledge_storm/collaborative_storm/modules/simulate_user.py
import dspy from typing import List, Union from .collaborative_storm_utils import extract_and_remove_citations from ...dataclass import ConversationTurn from ...storm_wiki.modules.knowledge_curation import AskQuestionWithPersona class GenSimulatedUserUtterance(dspy.Module): def __init__(self, engine: Union[dspy....
python
MIT
fb951af7744dab086e34962e9bc6fe878e145f83
2026-01-04T14:44:02.494109Z
false
stanford-oval/storm
https://github.com/stanford-oval/storm/blob/fb951af7744dab086e34962e9bc6fe878e145f83/knowledge_storm/collaborative_storm/modules/__init__.py
knowledge_storm/collaborative_storm/modules/__init__.py
from .article_generation import * from .grounded_question_answering import * from .grounded_question_generation import * from .information_insertion_module import * from .simulate_user import * from .warmstart_hierarchical_chat import * from .knowledge_base_summary import * from .costorm_expert_utterance_generator impo...
python
MIT
fb951af7744dab086e34962e9bc6fe878e145f83
2026-01-04T14:44:02.494109Z
false
stanford-oval/storm
https://github.com/stanford-oval/storm/blob/fb951af7744dab086e34962e9bc6fe878e145f83/knowledge_storm/collaborative_storm/modules/grounded_question_generation.py
knowledge_storm/collaborative_storm/modules/grounded_question_generation.py
""" This module handles question generation within the Co-STORM framework, specifically designed to support the Moderator role. The Moderator generates insightful, thought-provoking questions that introduce new directions into the conversation. By leveraging uncited or unused snippets of information retrieved during ...
python
MIT
fb951af7744dab086e34962e9bc6fe878e145f83
2026-01-04T14:44:02.494109Z
false
stanford-oval/storm
https://github.com/stanford-oval/storm/blob/fb951af7744dab086e34962e9bc6fe878e145f83/knowledge_storm/collaborative_storm/modules/article_generation.py
knowledge_storm/collaborative_storm/modules/article_generation.py
import dspy from concurrent.futures import ThreadPoolExecutor, as_completed from typing import Set, Union from .collaborative_storm_utils import clean_up_section from ...dataclass import KnowledgeBase, KnowledgeNode class ArticleGenerationModule(dspy.Module): """Use the information collected from the information...
python
MIT
fb951af7744dab086e34962e9bc6fe878e145f83
2026-01-04T14:44:02.494109Z
false
stanford-oval/storm
https://github.com/stanford-oval/storm/blob/fb951af7744dab086e34962e9bc6fe878e145f83/knowledge_storm/collaborative_storm/modules/expert_generation.py
knowledge_storm/collaborative_storm/modules/expert_generation.py
import dspy import re from typing import Union class GenerateExpertGeneral(dspy.Signature): """You need to select a group of diverse experts who will be suitable to be invited to a roundtable discussion on the given topic. Each expert should represent a different perspective, role, or affiliation related to t...
python
MIT
fb951af7744dab086e34962e9bc6fe878e145f83
2026-01-04T14:44:02.494109Z
false
stanford-oval/storm
https://github.com/stanford-oval/storm/blob/fb951af7744dab086e34962e9bc6fe878e145f83/knowledge_storm/collaborative_storm/modules/knowledge_base_summary.py
knowledge_storm/collaborative_storm/modules/knowledge_base_summary.py
import dspy from typing import Union from ...dataclass import KnowledgeBase class KnowledgeBaseSummmary(dspy.Signature): """Your job is to give brief summary of what's been discussed in a roundtable conversation. Contents are themantically organized into hierarchical sections. You will be presented with these...
python
MIT
fb951af7744dab086e34962e9bc6fe878e145f83
2026-01-04T14:44:02.494109Z
false
stanford-oval/storm
https://github.com/stanford-oval/storm/blob/fb951af7744dab086e34962e9bc6fe878e145f83/knowledge_storm/collaborative_storm/modules/collaborative_storm_utils.py
knowledge_storm/collaborative_storm/modules/collaborative_storm_utils.py
import dspy import os import re import sys import toml from typing import List, Tuple, Dict, Optional, TYPE_CHECKING if TYPE_CHECKING: from ..engine import RunnerArgument from ...interface import Information, Retriever, LMConfigs from ...logging_wrapper import LoggingWrapper from ...rm import BingSearch def extr...
python
MIT
fb951af7744dab086e34962e9bc6fe878e145f83
2026-01-04T14:44:02.494109Z
false
stanford-oval/storm
https://github.com/stanford-oval/storm/blob/fb951af7744dab086e34962e9bc6fe878e145f83/knowledge_storm/collaborative_storm/modules/costorm_expert_utterance_generator.py
knowledge_storm/collaborative_storm/modules/costorm_expert_utterance_generator.py
import dspy from typing import Union from .callback import BaseCallbackHandler from .collaborative_storm_utils import ( trim_output_after_hint, extract_and_remove_citations, keep_first_and_last_paragraph, ) from .grounded_question_answering import AnswerQuestionModule from .grounded_question_generation im...
python
MIT
fb951af7744dab086e34962e9bc6fe878e145f83
2026-01-04T14:44:02.494109Z
false
stanford-oval/storm
https://github.com/stanford-oval/storm/blob/fb951af7744dab086e34962e9bc6fe878e145f83/examples/storm_examples/run_storm_wiki_claude.py
examples/storm_examples/run_storm_wiki_claude.py
""" STORM Wiki pipeline powered by Claude family models and You.com search engine. You need to set up the following environment variables to run this script: - ANTHROPIC_API_KEY: Anthropic API key - YDC_API_KEY: You.com API key; BING_SEARCH_API_KEY: Bing Search API key, SERPER_API_KEY: Serper API key, BRAVE_API...
python
MIT
fb951af7744dab086e34962e9bc6fe878e145f83
2026-01-04T14:44:02.494109Z
false
stanford-oval/storm
https://github.com/stanford-oval/storm/blob/fb951af7744dab086e34962e9bc6fe878e145f83/examples/storm_examples/run_storm_wiki_deepseek.py
examples/storm_examples/run_storm_wiki_deepseek.py
""" STORM Wiki pipeline powered by DeepSeek models and You.com or Bing search engine. You need to set up the following environment variables to run this script: - DEEPSEEK_API_KEY: DeepSeek API key - DEEPSEEK_API_BASE: DeepSeek API base URL (default is https://api.deepseek.com) - YDC_API_KEY: You.com API ke...
python
MIT
fb951af7744dab086e34962e9bc6fe878e145f83
2026-01-04T14:44:02.494109Z
false
stanford-oval/storm
https://github.com/stanford-oval/storm/blob/fb951af7744dab086e34962e9bc6fe878e145f83/examples/storm_examples/run_storm_wiki_ollama_with_searxng.py
examples/storm_examples/run_storm_wiki_ollama_with_searxng.py
import os from argparse import ArgumentParser from dspy import Example from knowledge_storm import ( STORMWikiRunnerArguments, STORMWikiRunner, STORMWikiLMConfigs, ) from knowledge_storm.lm import OllamaClient from knowledge_storm.rm import SearXNG from knowledge_storm.utils import load_api_key def main...
python
MIT
fb951af7744dab086e34962e9bc6fe878e145f83
2026-01-04T14:44:02.494109Z
false
stanford-oval/storm
https://github.com/stanford-oval/storm/blob/fb951af7744dab086e34962e9bc6fe878e145f83/examples/storm_examples/run_storm_wiki_ollama.py
examples/storm_examples/run_storm_wiki_ollama.py
""" STORM Wiki pipeline powered by local model hosted by Ollama server and You.com or Bing search engine. You need to set up the following environment variables to run this script: - YDC_API_KEY: You.com API key; BING_SEARCH_API_KEY: Bing Search API key, SERPER_API_KEY: Serper API key, BRAVE_API_KEY: Brave API key,...
python
MIT
fb951af7744dab086e34962e9bc6fe878e145f83
2026-01-04T14:44:02.494109Z
false
stanford-oval/storm
https://github.com/stanford-oval/storm/blob/fb951af7744dab086e34962e9bc6fe878e145f83/examples/storm_examples/run_storm_wiki_gpt.py
examples/storm_examples/run_storm_wiki_gpt.py
""" STORM Wiki pipeline powered by GPT-3.5/4 and You.com search engine. You need to set up the following environment variables to run this script: - OPENAI_API_KEY: OpenAI API key - OPENAI_API_TYPE: OpenAI API type (e.g., 'openai' or 'azure') - AZURE_API_BASE: Azure API base URL if using Azure API - AZU...
python
MIT
fb951af7744dab086e34962e9bc6fe878e145f83
2026-01-04T14:44:02.494109Z
false
stanford-oval/storm
https://github.com/stanford-oval/storm/blob/fb951af7744dab086e34962e9bc6fe878e145f83/examples/storm_examples/run_storm_wiki_serper.py
examples/storm_examples/run_storm_wiki_serper.py
""" STORM Wiki pipeline powered by Claude family models and serper search engine. You need to set up the following environment variables to run this script: - ANTHROPIC_API_KEY: Anthropic API key - SERPER_API_KEY: Serper.dev api key Output will be structured as below args.output_dir/ topic_name/ # topic_n...
python
MIT
fb951af7744dab086e34962e9bc6fe878e145f83
2026-01-04T14:44:02.494109Z
false
stanford-oval/storm
https://github.com/stanford-oval/storm/blob/fb951af7744dab086e34962e9bc6fe878e145f83/examples/storm_examples/run_storm_wiki_gemini.py
examples/storm_examples/run_storm_wiki_gemini.py
""" STORM Wiki pipeline powered by Google Gemini models and search engine. You need to set up the following environment variables to run this script: - GOOGLE_API_KEY: Google API key (Can be obtained from https://ai.google.dev/gemini-api/docs/api-key) - YDC_API_KEY: You.com API key; BING_SEARCH_API_KEY: Bing Se...
python
MIT
fb951af7744dab086e34962e9bc6fe878e145f83
2026-01-04T14:44:02.494109Z
false
stanford-oval/storm
https://github.com/stanford-oval/storm/blob/fb951af7744dab086e34962e9bc6fe878e145f83/examples/storm_examples/run_storm_wiki_groq.py
examples/storm_examples/run_storm_wiki_groq.py
""" STORM Wiki pipeline powered by llama3-70b-8192 hosted by Groq server and You.com search engine. You need to set up the following environment variables to run this script: - GROQ_API_KEY: You can get your Groq API Key at https://console.groq.com/keys - YDC_API_KEY: You.com API key; BING_SEARCH_API_KEY: Bing ...
python
MIT
fb951af7744dab086e34962e9bc6fe878e145f83
2026-01-04T14:44:02.494109Z
false
stanford-oval/storm
https://github.com/stanford-oval/storm/blob/fb951af7744dab086e34962e9bc6fe878e145f83/examples/storm_examples/run_storm_wiki_gpt_with_VectorRM.py
examples/storm_examples/run_storm_wiki_gpt_with_VectorRM.py
""" This STORM Wiki pipeline powered by GPT-3.5/4 and local retrieval model that uses Qdrant. You need to set up the following environment variables to run this script: - OPENAI_API_KEY: OpenAI API key - OPENAI_API_TYPE: OpenAI API type (e.g., 'openai' or 'azure') - QDRANT_API_KEY: Qdrant API key (needed ON...
python
MIT
fb951af7744dab086e34962e9bc6fe878e145f83
2026-01-04T14:44:02.494109Z
false
stanford-oval/storm
https://github.com/stanford-oval/storm/blob/fb951af7744dab086e34962e9bc6fe878e145f83/examples/storm_examples/run_storm_wiki_mistral.py
examples/storm_examples/run_storm_wiki_mistral.py
""" STORM Wiki pipeline powered by Mistral-7B-Instruct-v0.2 hosted by VLLM server and You.com search engine. You need to set up the following environment variables to run this script: - YDC_API_KEY: You.com API key; BING_SEARCH_API_KEY: Bing Search API key, SERPER_API_KEY: Serper API key, BRAVE_API_KEY: Brave API k...
python
MIT
fb951af7744dab086e34962e9bc6fe878e145f83
2026-01-04T14:44:02.494109Z
false