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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
michael-lazar/rtv | https://github.com/michael-lazar/rtv | null | null | null | null | 4,647 | null | null | mit | null | null | null | null | null | null | null | rtv/theme.py | null | null | null | null | null | null | Python | 2026-05-04T01:56:27.921248 | # pylint: disable=bad-whitespace
import os
import codecs
import curses
import logging
from collections import OrderedDict
from contextlib import contextmanager
import six
from six.moves import configparser
from .config import THEMES, DEFAULT_THEMES
from .exceptions import ConfigError
_logger = logging.getLogger(__n... |
michael-lazar/rtv | https://github.com/michael-lazar/rtv | null | null | null | null | 4,647 | null | null | mit | null | null | null | null | null | null | null | scripts/build_manpage.py | null | null | null | null | null | null | Python | 2026-05-04T01:56:27.948454 | #!/usr/bin/env python
"""
Internal tool used to automatically generate an up-to-date version of the rtv
man page. Currently this script should be manually ran after each version bump.
In the future, it would be nice to have this functionality built into setup.py.
Usage:
$ python scripts/build_manpage.py
"""
impo... |
michael-lazar/rtv | https://github.com/michael-lazar/rtv | null | null | null | null | 4,647 | null | null | mit | null | null | null | null | null | null | null | scripts/demo_theme.py | null | null | null | null | null | null | Python | 2026-05-04T01:56:28.204884 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from __future__ import print_function
import os
import sys
import time
import curses
import locale
import threading
from types import MethodType
from collections import Counter
from vcr import VCR
from six.moves.urllib.parse import ... |
michael-lazar/rtv | https://github.com/michael-lazar/rtv | null | null | null | null | 4,647 | null | null | mit | null | null | null | null | null | null | null | scripts/initialize_session.py | null | null | null | null | null | null | Python | 2026-05-04T01:56:28.289068 | """
Initialize an authenticated instance of PRAW to interact with.
$ python -i initialize_session.py
"""
from rtv.docs import AGENT
from rtv.packages import praw
from rtv.content import RequestHeaderRateLimiter
from rtv.config import Config
config = Config()
config.load_refresh_token()
reddit = praw.Reddit(
user... |
michael-lazar/rtv | https://github.com/michael-lazar/rtv | null | null | null | null | 4,647 | null | null | mit | null | null | null | null | null | null | null | tests/test_clipboard.py | null | null | null | null | null | null | Python | 2026-05-04T01:56:28.654390 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import pytest
from rtv.clipboard import copy_linux, copy_osx
from rtv.exceptions import ProgramError
try:
from unittest import mock
except ImportError:
import mock
def test_copy():
with mock.patch('subprocess.Popen') as Popen, \
... |
michael-lazar/rtv | https://github.com/michael-lazar/rtv | null | null | null | null | 4,647 | null | null | mit | null | null | null | null | null | null | null | scripts/update_packages.py | null | null | null | null | null | null | Python | 2026-05-04T01:56:28.731086 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Update the project's bundled dependencies by downloading the git repository and
copying over the most recent commit.
"""
import os
import shutil
import subprocess
import tempfile
_filepath = os.path.dirname(os.path.relpath(__file__))
ROOT = os.path.abspath(os.path.jo... |
michael-lazar/rtv | https://github.com/michael-lazar/rtv | null | null | null | null | 4,647 | null | null | mit | null | null | null | null | null | null | null | tests/test_content.py | null | null | null | null | null | null | Python | 2026-05-04T01:56:28.732345 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import time
from itertools import islice
from collections import OrderedDict
import six
import pytest
from rtv import exceptions
from rtv.packages import praw
from rtv.content import (
Content, SubmissionContent, SubredditContent, SubscriptionConten... |
michael-lazar/rtv | https://github.com/michael-lazar/rtv | null | null | null | null | 4,647 | null | null | mit | null | null | null | null | null | null | null | tests/test_inbox.py | null | null | null | null | null | null | Python | 2026-05-04T01:56:28.733721 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import pytest
from rtv.packages.praw.errors import InvalidUser
from rtv import exceptions
from rtv.docs import FOOTER_INBOX
from rtv.inbox_page import InboxPage
from rtv.submission_page import SubmissionPage
try:
from unittest import mock
except Imp... |
michael-lazar/rtv | https://github.com/michael-lazar/rtv | null | null | null | null | 4,647 | null | null | mit | null | null | null | null | null | null | null | tests/conftest.py | null | null | null | null | null | null | Python | 2026-05-04T01:56:28.811431 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import os
import curses
import logging
import threading
from functools import partial
import pytest
from vcr import VCR
from six.moves.urllib.parse import urlparse, parse_qs
from rtv.oauth import OAuthHelper, OAuthHandler, OAuthHTTPServer
from rtv.conte... |
michael-lazar/rtv | https://github.com/michael-lazar/rtv | null | null | null | null | 4,647 | null | null | mit | null | null | null | null | null | null | null | setup.py | null | null | null | null | null | null | Python | 2026-05-04T01:56:28.843964 | import sys
import codecs
import setuptools
from version import __version__ as version
install_requires = [
'beautifulsoup4',
'decorator',
'kitchen',
'requests >=2.4.0', # https://github.com/michael-lazar/rtv/issues/325
'six',
]
tests_require = [
'coveralls',
'pytest>=3.1.0', # Pinned f... |
michael-lazar/rtv | https://github.com/michael-lazar/rtv | null | null | null | null | 4,647 | null | null | mit | null | null | null | null | null | null | null | scripts/inspect_webbrowser.py | null | null | null | null | null | null | Python | 2026-05-04T01:56:28.894271 | #!/usr/bin/env python
"""
Utility script used to examine the python webbrowser module with different OSs.
"""
import os
os.environ['BROWSER'] = 'firefox'
# If we want to override the $BROWSER variable that the python webbrowser
# references, it needs to be done before the webbrowser module is imported
# for the fir... |
michael-lazar/rtv | https://github.com/michael-lazar/rtv | null | null | null | null | 4,647 | null | null | mit | null | null | null | null | null | null | null | tests/test_config.py | null | null | null | null | null | null | Python | 2026-05-04T01:56:28.927949 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import os
import codecs
from tempfile import NamedTemporaryFile
from rtv.config import Config, copy_default_config, copy_default_mailcap
try:
from unittest import mock
except ImportError:
import mock
def test_copy_default_config():
"""Make... |
michael-lazar/rtv | https://github.com/michael-lazar/rtv | null | null | null | null | 4,647 | null | null | mit | null | null | null | null | null | null | null | tests/test_objects.py | null | null | null | null | null | null | Python | 2026-05-04T01:56:29.271348 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import time
import curses
from collections import OrderedDict
import os
import six
import pytest
import requests
from six.moves import reload_module
from rtv import exceptions
from rtv.objects import Controller, Navigator, Command, KeyMap, \
curses_... |
michael-lazar/rtv | https://github.com/michael-lazar/rtv | null | null | null | null | 4,647 | null | null | mit | null | null | null | null | null | null | null | tests/test_page.py | null | null | null | null | null | null | Python | 2026-05-04T01:56:29.321106 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import curses
import pytest
from rtv.page import Page, PageController, logged_in
try:
from unittest import mock
except ImportError:
import mock
def test_page_logged_in(terminal):
page = mock.MagicMock()
page.term = terminal
@log... |
michael-lazar/rtv | https://github.com/michael-lazar/rtv | null | null | null | null | 4,647 | null | null | mit | null | null | null | null | null | null | null | tests/test_submission.py | null | null | null | null | null | null | Python | 2026-05-04T01:56:29.329264 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import curses
from collections import OrderedDict
import pytest
from rtv.submission_page import SubmissionPage
from rtv.docs import FOOTER_SUBMISSION
try:
from unittest import mock
except ImportError:
import mock
PROMPTS = OrderedDict([
(... |
michael-lazar/rtv | https://github.com/michael-lazar/rtv | null | null | null | null | 4,647 | null | null | mit | null | null | null | null | null | null | null | tests/test_packages.py | null | null | null | null | null | null | Python | 2026-05-04T01:56:29.338509 | from rtv import packages
def test_praw3_package():
# Sanity check that the package was installed
assert packages.praw
assert len(packages.__praw_hash__) == 40
assert packages.__praw_bundled__ is True
|
michael-lazar/rtv | https://github.com/michael-lazar/rtv | null | null | null | null | 4,647 | null | null | mit | null | null | null | null | null | null | null | tests/test_subreddit.py | null | null | null | null | null | null | Python | 2026-05-04T01:56:29.425611 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import curses
from collections import OrderedDict
import six
import pytest
from rtv import __version__
from rtv.subreddit_page import SubredditPage
from rtv.packages.praw.errors import NotFound, HTTPException
from requests.exceptions import ReadTimeout
... |
michael-lazar/rtv | https://github.com/michael-lazar/rtv | null | null | null | null | 4,647 | null | null | mit | null | null | null | null | null | null | null | tests/test_subscription.py | null | null | null | null | null | null | Python | 2026-05-04T01:56:29.522368 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import curses
import pytest
from rtv.subscription_page import SubscriptionPage
try:
from unittest import mock
except ImportError:
import mock
def test_subscription_page_construct(reddit, terminal, config, oauth,
... |
michael-lazar/rtv | https://github.com/michael-lazar/rtv | null | null | null | null | 4,647 | null | null | mit | null | null | null | null | null | null | null | tests/test_terminal.py | null | null | null | null | null | null | Python | 2026-05-04T01:56:29.540123 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import re
import os
import curses
import codecs
from textwrap import dedent
import six
import pytest
from rtv.theme import Theme
from rtv.docs import (HELP, REPLY_FILE, COMMENT_EDIT_FILE, TOKEN,
SUBMISSION_FILE, SUBMISSION_EDIT_FIL... |
michael-lazar/rtv | https://github.com/michael-lazar/rtv | null | null | null | null | 4,647 | null | null | mit | null | null | null | null | null | null | null | tests/test_theme.py | null | null | null | null | null | null | Python | 2026-05-04T01:56:29.632506 | import os
import shutil
import curses
from collections import OrderedDict
from contextlib import contextmanager
from tempfile import mkdtemp, NamedTemporaryFile
import pytest
from rtv.theme import Theme
from rtv.config import DEFAULT_THEMES
from rtv.exceptions import ConfigError
try:
from unittest import mock
ex... |
michael-lazar/rtv | https://github.com/michael-lazar/rtv | null | null | null | null | 4,647 | null | null | mit | null | null | null | null | null | null | null | tests/test_mime_parsers.py | null | null | null | null | null | null | Python | 2026-05-04T01:56:29.963202 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import re
from collections import OrderedDict
import pytest
from rtv.mime_parsers import parsers, ImgurApiMIMEParser
RegexpType = type(re.compile(''))
URLS = OrderedDict([
('simple_png', (
'http://www.example.com/i/image.png', # 1. URL
... |
michael-lazar/rtv | https://github.com/michael-lazar/rtv | null | null | null | null | 4,647 | null | null | mit | null | null | null | null | null | null | null | tests/test_oauth.py | null | null | null | null | null | null | Python | 2026-05-04T01:56:34.163533 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import requests
from rtv.oauth import OAuthHelper, OAuthHandler
from rtv.exceptions import InvalidRefreshToken
from rtv.packages.praw.errors import OAuthException
try:
from unittest import mock
except ImportError:
import mock
def test_oauth_h... |
LearningCircuit/local-deep-research | https://github.com/LearningCircuit/local-deep-research | null | null | null | null | 4,643 | null | null | mit | null | null | null | null | null | null | null | .pre-commit-hooks/check-absolute-module-paths.py | null | null | null | null | null | null | Python | 2026-05-04T01:56:36.906985 | #!/usr/bin/env python3
"""
Pre-commit hook to prevent absolute module paths in the codebase.
Module path configuration values MUST use relative imports (starting with ".")
instead of absolute paths (starting with "local_deep_research.").
The module whitelist security boundary requires relative paths for search engines... |
LearningCircuit/local-deep-research | https://github.com/LearningCircuit/local-deep-research | null | null | null | null | 4,643 | null | null | mit | null | null | null | null | null | null | null | .pre-commit-hooks/check-deprecated-db.py | null | null | null | null | null | null | Python | 2026-05-04T01:56:36.910438 | #!/usr/bin/env python3
"""
Pre-commit hook to check for usage of deprecated database connection methods.
Ensures code uses per-user database connections instead of the deprecated shared database.
"""
import sys
import re
import os
# Set environment variable for pre-commit hooks to allow unencrypted databases
os.envir... |
LearningCircuit/local-deep-research | https://github.com/LearningCircuit/local-deep-research | null | null | null | null | 4,643 | null | null | mit | null | null | null | null | null | null | null | .pre-commit-hooks/check-external-resources.py | null | null | null | null | null | null | Python | 2026-05-04T01:56:36.911483 | #!/usr/bin/env python3
"""
Pre-commit hook to check for external CDN and resource references.
Ensures all resources are served locally from vendor directories.
"""
import re
import sys
from pathlib import Path
from typing import List, Tuple
# Patterns that indicate external resources
EXTERNAL_PATTERNS = [
# CDN U... |
LearningCircuit/local-deep-research | https://github.com/LearningCircuit/local-deep-research | null | null | null | null | 4,643 | null | null | mit | null | null | null | null | null | null | null | .pre-commit-hooks/check-css-class-prefix.py | null | null | null | null | null | null | Python | 2026-05-04T01:56:36.919205 | #!/usr/bin/env python3
"""
Pre-commit hook to ensure all LDR-specific CSS class names are prefixed with 'ldr-'.
This prevents CSS class name conflicts when Vite bundles CSS from dependencies.
"""
import re
import sys
from pathlib import Path
from typing import List, Tuple
# Allowed patterns - ONLY third-party framewo... |
LearningCircuit/local-deep-research | https://github.com/LearningCircuit/local-deep-research | null | null | null | null | 4,643 | null | null | mit | null | null | null | null | null | null | null | .pre-commit-hooks/check-deprecated-settings-wrapper.py | null | null | null | null | null | null | Python | 2026-05-04T01:56:36.925766 | #!/usr/bin/env python3
"""
Pre-commit hook to warn about usage of deprecated get_setting_from_db_main_thread wrapper.
This function is deprecated because it's redundant - use the SettingsManager directly
with proper session context management instead.
NOTE: This hook currently only warns about usage to allow gradual ... |
LearningCircuit/local-deep-research | https://github.com/LearningCircuit/local-deep-research | null | null | null | null | 4,643 | null | null | mit | null | null | null | null | null | null | null | .pre-commit-hooks/check-double-escaping.py | null | null | null | null | null | null | Python | 2026-05-04T01:56:36.926749 | #!/usr/bin/env python3
"""
Pre-commit hook to detect double-escaping in JavaScript files.
Catches patterns where escapeHtml() is called on values that are then
passed to functions which already escape internally (showError, showSuccess,
showInfo, showAlert).
Known limitations:
- Multi-line function calls are not dete... |
LearningCircuit/local-deep-research | https://github.com/LearningCircuit/local-deep-research | null | null | null | null | 4,643 | null | null | mit | null | null | null | null | null | null | null | .pre-commit-hooks/check-fixture-duplication.py | null | null | null | null | null | null | Python | 2026-05-04T01:56:36.929570 | #!/usr/bin/env python3
"""
Pre-commit hook to warn when test files redefine root-conftest fixtures.
The root tests/conftest.py provides `app`, `client`, and `authenticated_client`
fixtures with security-relevant setup (CSRF, auth DB init, temp data dir).
Full-app redefinitions (those calling `create_app()`) often skip... |
LearningCircuit/local-deep-research | https://github.com/LearningCircuit/local-deep-research | null | null | null | null | 4,643 | null | null | mit | null | null | null | null | null | null | null | .pre-commit-hooks/check-env-vars.py | null | null | null | null | null | null | Python | 2026-05-04T01:56:36.930796 | #!/usr/bin/env python3
"""
Simple pre-commit hook to check for direct os.environ usage.
This is a lightweight check - comprehensive validation happens in CI.
"""
import ast
import sys
from pathlib import Path
# Allowlist entries, partitioned by matching strategy.
#
# Previously this was a single ALLOWED_PATTERNS set... |
LearningCircuit/local-deep-research | https://github.com/LearningCircuit/local-deep-research | null | null | null | null | 4,643 | null | null | mit | null | null | null | null | null | null | null | .github/scripts/validate-workflow-images.py | null | null | null | null | null | null | Python | 2026-05-04T01:56:36.963693 | #!/usr/bin/env python3
"""
Validates that all GitHub Actions workflow service containers and container images
use SHA256 digests for supply chain security.
Prevents tag tampering attacks by ensuring immutable image references.
"""
import sys
from pathlib import Path
from typing import List, Tuple
try:
import yam... |
LearningCircuit/local-deep-research | https://github.com/LearningCircuit/local-deep-research | null | null | null | null | 4,643 | null | null | mit | null | null | null | null | null | null | null | .pre-commit-hooks/_commit_analysis.py | null | null | null | null | null | null | Python | 2026-05-04T01:56:37.019795 | """Shared utility module for pre-commit hooks analyzing staged files."""
import subprocess
from dataclasses import dataclass, field
from pathlib import PurePosixPath
@dataclass
class StagedFileInfo:
path: str
added: int
removed: int
is_new: bool
category: str
@dataclass
class CommitAnalysis:
... |
LearningCircuit/local-deep-research | https://github.com/LearningCircuit/local-deep-research | null | null | null | null | 4,643 | null | null | mit | null | null | null | null | null | null | null | .pre-commit-hooks/check-golden-master-settings.py | null | null | null | null | null | null | Python | 2026-05-04T01:56:37.518527 | #!/usr/bin/env python3
"""Check that golden master settings are updated when default settings change."""
import subprocess
import sys
def _find_venv_python():
"""Find the project's venv Python interpreter."""
import pathlib
for candidate in [
pathlib.Path(".venv/bin/python"),
pathlib.Pat... |
LearningCircuit/local-deep-research | https://github.com/LearningCircuit/local-deep-research | null | null | null | null | 4,643 | null | null | mit | null | null | null | null | null | null | null | .pre-commit-hooks/check-ldr-db.py | null | null | null | null | null | null | Python | 2026-05-04T01:56:37.562578 | #!/usr/bin/env python3
"""
Pre-commit hook to prevent usage of ldr.db (shared database).
All data should be stored in per-user encrypted databases.
"""
import sys
import re
import os
from pathlib import Path
# Set environment variable for pre-commit hooks to allow unencrypted databases
os.environ["LDR_ALLOW_UNENCRYPT... |
LearningCircuit/local-deep-research | https://github.com/LearningCircuit/local-deep-research | null | null | null | null | 4,643 | null | null | mit | null | null | null | null | null | null | null | .pre-commit-hooks/check-layer-imports.py | null | null | null | null | null | null | Python | 2026-05-04T01:56:37.569617 | #!/usr/bin/env python3
"""Pre-commit hook to enforce that infrastructure packages do not import from web/.
Packages like settings/, utilities/, security/, and config/ should not depend
on web/ — this breaks CLI, MCP, and programmatic API usage.
"""
import re
import sys
# Infrastructure packages that must not import ... |
LearningCircuit/local-deep-research | https://github.com/LearningCircuit/local-deep-research | null | null | null | null | 4,643 | null | null | mit | null | null | null | null | null | null | null | .pre-commit-hooks/check-loguru-formatting.py | null | null | null | null | null | null | Python | 2026-05-04T01:56:37.570199 | #!/usr/bin/env python3
"""
Pre-commit hook to prevent stdlib printf-style formatting in direct loguru calls.
loguru uses brace formatting (`{}`), not stdlib logging placeholders like
`%s` or `%d`. Mixing the two leaves placeholders unrendered in runtime logs.
"""
import ast
from pathlib import Path
import re
import s... |
LearningCircuit/local-deep-research | https://github.com/LearningCircuit/local-deep-research | null | null | null | null | 4,643 | null | null | mit | null | null | null | null | null | null | null | .pre-commit-hooks/check-pathlib-usage.py | null | null | null | null | null | null | Python | 2026-05-04T01:56:37.607352 | #!/usr/bin/env python3
"""
Pre-commit hook to enforce using pathlib.Path instead of os.path.
This hook checks for os.path usage in Python files and suggests
using pathlib.Path instead for better cross-platform compatibility
and more modern Python code.
"""
import argparse
import ast
import sys
from pathlib import Pat... |
LearningCircuit/local-deep-research | https://github.com/LearningCircuit/local-deep-research | null | null | null | null | 4,643 | null | null | mit | null | null | null | null | null | null | null | .pre-commit-hooks/check-sensitive-logging.py | null | null | null | null | null | null | Python | 2026-05-04T01:56:37.612279 | #!/usr/bin/env python3
"""
Pre-commit hook to detect potential logging of sensitive data.
Prevents passwords, tokens, and other sensitive information from being logged.
Note: this hook is part of the reason we do NOT enforce ``raise X from e``
universally (see ADR-0003). Exception chains preserved via ``from e`` can
l... |
LearningCircuit/local-deep-research | https://github.com/LearningCircuit/local-deep-research | null | null | null | null | 4,643 | null | null | mit | null | null | null | null | null | null | null | .pre-commit-hooks/check-safe-requests.py | null | null | null | null | null | null | Python | 2026-05-04T01:56:37.617424 | #!/usr/bin/env python3
"""
Pre-commit hook to enforce safe_requests usage for SSRF protection.
This prevents direct usage of requests.get/post/Session which bypasses
SSRF validation. Use safe_get/safe_post/SafeSession from the security module.
See: https://cwe.mitre.org/data/definitions/918.html (CWE-918: SSRF)
"""
... |
LearningCircuit/local-deep-research | https://github.com/LearningCircuit/local-deep-research | null | null | null | null | 4,643 | null | null | mit | null | null | null | null | null | null | null | .pre-commit-hooks/check-research-id-type.py | null | null | null | null | null | null | Python | 2026-05-04T01:56:37.945428 | #!/usr/bin/env python3
"""
Pre-commit hook to check for incorrect research_id type hints.
Research IDs are UUIDs and should always be treated as strings, never as integers.
"""
import sys
import re
import os
from pathlib import Path
# Set environment variable for pre-commit hooks to allow unencrypted databases
os.env... |
LearningCircuit/local-deep-research | https://github.com/LearningCircuit/local-deep-research | null | null | null | null | 4,643 | null | null | mit | null | null | null | null | null | null | null | .pre-commit-hooks/check-journal-quality-readonly.py | null | null | null | null | null | null | Python | 2026-05-04T01:56:38.570178 | #!/usr/bin/env python3
"""Pre-commit hook: enforce that journal_quality.db is opened read-only.
The compiled journal-quality DB has exactly one writer — `build_db()` in
`src/local_deep_research/journal_quality/db.py`. Every other consumer
must open the file with SQLite URI flag `mode=ro` (and ideally also
`immutable=1... |
LearningCircuit/local-deep-research | https://github.com/LearningCircuit/local-deep-research | null | null | null | null | 4,643 | null | null | mit | null | null | null | null | null | null | null | .pre-commit-hooks/check-url-security.py | null | null | null | null | null | null | Python | 2026-05-04T01:56:38.985232 | #!/usr/bin/env python3
"""
Pre-commit hook to check for unsafe URL scheme validation in JavaScript files.
This hook ensures that JavaScript code properly validates URLs to prevent
XSS attacks through javascript:, data:, and vbscript: schemes.
"""
import sys
import re
from pathlib import Path
def check_url_validatio... |
LearningCircuit/local-deep-research | https://github.com/LearningCircuit/local-deep-research | null | null | null | null | 4,643 | null | null | mit | null | null | null | null | null | null | null | .pre-commit-hooks/check-raw-console.py | null | null | null | null | null | null | Python | 2026-05-04T01:56:38.987990 | #!/usr/bin/env python3
"""
Pre-commit hook to detect raw console.* calls in JavaScript files.
All JS logging should use SafeLogger (from security/safe-logger.js) which
sanitises output and prevents accidental leakage of sensitive data.
Allowed exceptions:
- safe-logger.js itself (it wraps console.*)
- Comment lin... |
LearningCircuit/local-deep-research | https://github.com/LearningCircuit/local-deep-research | null | null | null | null | 4,643 | null | null | mit | null | null | null | null | null | null | null | .pre-commit-hooks/check-utcnow-parens.py | null | null | null | null | null | null | Python | 2026-05-04T01:56:39.170505 | #!/usr/bin/env python3
"""
Pre-commit hook to prevent removing parentheses from utcnow() in SQLAlchemy
Column defaults.
utcnow (from sqlalchemy_utc) is a FunctionElement *class*, not a plain
Python function. ``default=utcnow()`` creates a SQL expression object that
SQLAlchemy renders inline per-INSERT (e.g. CURRENT_T... |
LearningCircuit/local-deep-research | https://github.com/LearningCircuit/local-deep-research | null | null | null | null | 4,643 | null | null | mit | null | null | null | null | null | null | null | .pre-commit-hooks/check-version-sync.py | null | null | null | null | null | null | Python | 2026-05-04T01:56:39.423379 | #!/usr/bin/env python3
"""Check that package.json version matches __version__.py."""
import json
import re
import sys
from pathlib import Path
def main():
root = Path(__file__).parent.parent
# Read __version__.py
version_file = root / "src" / "local_deep_research" / "__version__.py"
if not version_f... |
LearningCircuit/local-deep-research | https://github.com/LearningCircuit/local-deep-research | null | null | null | null | 4,643 | null | null | mit | null | null | null | null | null | null | null | .pre-commit-hooks/check-silent-exceptions.py | null | null | null | null | null | null | Python | 2026-05-04T01:56:39.525519 | #!/usr/bin/env python3
"""
Pre-commit hook to detect silent exception swallowing.
Flags ``except Exception: pass`` and ``except: pass`` patterns where no
logging, re-raise, or meaningful handling occurs. At minimum a
``logger.debug()`` should be present so failures are traceable.
Legitimate suppression (e.g. optional... |
LearningCircuit/local-deep-research | https://github.com/LearningCircuit/local-deep-research | null | null | null | null | 4,643 | null | null | mit | null | null | null | null | null | null | null | .pre-commit-hooks/check-settings-manager-thread-safety.py | null | null | null | null | null | null | Python | 2026-05-04T01:56:39.559808 | #!/usr/bin/env python3
"""
Pre-commit hook to detect get_settings_manager() calls without db_session
in code that runs in background threads.
Background threads have no Flask app context, so get_settings_manager()
without an explicit db_session falls back to JSON defaults only. Settings
that have no JSON defaults (e.... |
LearningCircuit/local-deep-research | https://github.com/LearningCircuit/local-deep-research | null | null | null | null | 4,643 | null | null | mit | null | null | null | null | null | null | null | .pre-commit-hooks/fix-exception-logging.py | null | null | null | null | null | null | Python | 2026-05-04T01:56:39.603281 | #!/usr/bin/env python3
"""
Auto-fixer for exception variable leaks and exc_info in production logs.
Handles two patterns:
1. Exception variables in log messages (f"...{e}", "...%s", e)
→ Removes the exception variable from the message
2. exc_info=True on warning/error/critical logs
→ Removes the exc_info keyword... |
LearningCircuit/local-deep-research | https://github.com/LearningCircuit/local-deep-research | null | null | null | null | 4,643 | null | null | mit | null | null | null | null | null | null | null | .pre-commit-hooks/custom-checks.py | null | null | null | null | null | null | Python | 2026-05-04T01:56:39.637963 | #!/usr/bin/env python3
"""
Custom pre-commit hook for Local Deep Research project.
Checks for:
1. If loguru is used instead of standard logging
2. If logger.exception is used instead of logger.error for error handling
3. That no raw SQL is used, only ORM methods
4. That ORM models (classes inheriting from Base) are def... |
LearningCircuit/local-deep-research | https://github.com/LearningCircuit/local-deep-research | null | null | null | null | 4,643 | null | null | mit | null | null | null | null | null | null | null | .pre-commit-hooks/check-unmarked-sleep.py | null | null | null | null | null | null | Python | 2026-05-04T01:56:39.657265 | #!/usr/bin/env python3
"""
Pre-commit hook to detect time.sleep() calls in test files missing @pytest.mark.slow.
Tests that call time.sleep() with a delay > 0.1 seconds should be marked with
@pytest.mark.slow so CI can skip them with ``-m "not slow"``.
Uses Python AST to find real ``time.sleep(>0.1)`` calls (ignores ... |
LearningCircuit/local-deep-research | https://github.com/LearningCircuit/local-deep-research | null | null | null | null | 4,643 | null | null | mit | null | null | null | null | null | null | null | .pre-commit-hooks/recommend-docs.py | null | null | null | null | null | null | Python | 2026-05-04T01:56:39.747555 | #!/usr/bin/env python3
"""Gentle reminder to update docs when source files change.
Always exits 0 (non-blocking). Prints a suggestion when source files
are staged without any documentation updates.
"""
import sys
from pathlib import Path
# Allow importing sibling module
sys.path.insert(0, str(Path(__file__).resolve(... |
LearningCircuit/local-deep-research | https://github.com/LearningCircuit/local-deep-research | null | null | null | null | 4,643 | null | null | mit | null | null | null | null | null | null | null | .pre-commit-hooks/recommend-performance-tests.py | null | null | null | null | null | null | Python | 2026-05-04T01:56:39.992902 | #!/usr/bin/env python3
"""Advisory reminder for subsystem fast tests + opt-in live performance tests.
When staged source files touch a subsystem listed in PATH_RULES, print a
two-tier reminder: (1) the narrow fast mocked tests that catch
logic/contract regressions in seconds, and (2) the opt-in live
performance tests ... |
LearningCircuit/local-deep-research | https://github.com/LearningCircuit/local-deep-research | null | null | null | null | 4,643 | null | null | mit | null | null | null | null | null | null | null | .pre-commit-hooks/recommend-release-notes.py | null | null | null | null | null | null | Python | 2026-05-04T01:56:40.138047 | #!/usr/bin/env python3
"""Remind contributors about news fragments.
Always exits 0 (non-blocking). Two messages:
- When any file under changelog.d/ is staged: confirm that the fragment
will be rolled into the next release's notes by towncrier and validate
the filename matches the expected pattern.
- When source ch... |
LearningCircuit/local-deep-research | https://github.com/LearningCircuit/local-deep-research | null | null | null | null | 4,643 | null | null | mit | null | null | null | null | null | null | null | .pre-commit-hooks/recommend-tests.py | null | null | null | null | null | null | Python | 2026-05-04T01:56:40.150504 | #!/usr/bin/env python3
"""Direct recommendation to include tests when source files change.
Always exits 0 (non-blocking). Prints an assertive warning when source
files are staged without any test files.
"""
import sys
from pathlib import Path
# Allow importing sibling module
sys.path.insert(0, str(Path(__file__).res... |
LearningCircuit/local-deep-research | https://github.com/LearningCircuit/local-deep-research | null | null | null | null | 4,643 | null | null | mit | null | null | null | null | null | null | null | .pre-commit-hooks/require-strategy-deletion-docs.py | null | null | null | null | null | null | Python | 2026-05-04T01:56:40.200805 | #!/usr/bin/env python3
"""Require a notes file when a file under ``advanced_search_system/`` is deleted.
Any commit that deletes a ``.py`` file under
``src/local_deep_research/advanced_search_system/`` — or renames one out of
that tree, which removes it from the tracked module — must also add or
modify a ``.md`` file ... |
LearningCircuit/local-deep-research | https://github.com/LearningCircuit/local-deep-research | null | null | null | null | 4,643 | null | null | mit | null | null | null | null | null | null | null | .pre-commit-hooks/require-tests.py | null | null | null | null | null | null | Python | 2026-05-04T01:56:40.231852 | #!/usr/bin/env python3
"""Block commits with substantial new code but no tests.
Exits 1 (blocks commit) when zero test files are staged AND at least one of:
- A new source file has >50 added lines (real new functionality)
- >300 total new lines across source files (substantial change)
Otherwise exits 0 silently.
... |
LearningCircuit/local-deep-research | https://github.com/LearningCircuit/local-deep-research | null | null | null | null | 4,643 | null | null | mit | null | null | null | null | null | null | null | cookiecutter-docker/hooks/post_gen_project.py | null | null | null | null | null | null | Python | 2026-05-04T01:56:40.263458 | """
Extracts the compose file from the cookiecutter directory.
"""
import os
import shutil
import time
from pathlib import Path
COMPOSE_FILE_NAME = "docker-compose.{{cookiecutter.config_name}}.yml"
def rmtree_with_retry(
path: Path, max_retries: int = 5, initial_delay: float = 0.1
):
"""
Remove a direct... |
LearningCircuit/local-deep-research | https://github.com/LearningCircuit/local-deep-research | null | null | null | null | 4,643 | null | null | mit | null | null | null | null | null | null | null | cookiecutter-docker/hooks/pre_prompt.py | null | null | null | null | null | null | Python | 2026-05-04T01:56:40.344664 | import json
import os
import subprocess
from typing import Any, Dict
import cookiecutter.prompt
def config_ollama(context: Dict[str, Any]) -> None:
"""
Prompts the user for questions that are specific to Ollama. It is in a hook
so that we can run it only if Ollama is enabled.
"""
enable_ollama =... |
LearningCircuit/local-deep-research | https://github.com/LearningCircuit/local-deep-research | null | null | null | null | 4,643 | null | null | mit | null | null | null | null | null | null | null | examples/api_usage/http/advanced/http_api_examples.py | null | null | null | null | null | null | Python | 2026-05-04T01:56:40.628977 | #!/usr/bin/env python3
"""
HTTP API Examples for Local Deep Research v1.0+
This script demonstrates comprehensive usage of the LDR HTTP API with authentication.
Includes examples for research, settings management, and batch operations.
Requirements:
- LDR v1.0+ (with authentication features)
- LDR server running: pyt... |
LearningCircuit/local-deep-research | https://github.com/LearningCircuit/local-deep-research | null | null | null | null | 4,643 | null | null | mit | null | null | null | null | null | null | null | examples/api_usage/http/advanced/simple_http_example.py | null | null | null | null | null | null | Python | 2026-05-04T01:56:40.703310 | #!/usr/bin/env python3
"""
Simple HTTP API Example for Local Deep Research v1.0+
This example shows how to use the LDR API with authentication.
Works completely out of the box with automatic user creation.
================================================================================
IMPORTANT - LOCALHOST ONLY
====... |
LearningCircuit/local-deep-research | https://github.com/LearningCircuit/local-deep-research | null | null | null | null | 4,643 | null | null | mit | null | null | null | null | null | null | null | examples/api_usage/http/simple_working_example.py | null | null | null | null | null | null | Python | 2026-05-04T01:56:40.753157 | #!/usr/bin/env python3
"""
Simple Working HTTP API Example for Local Deep Research v1.0+
This is a clean, working example that demonstrates the correct way to use the LDR API.
It creates a user automatically and handles authentication properly.
Requirements:
- LDR v1.0+ server running: python -m local_deep_research.w... |
LearningCircuit/local-deep-research | https://github.com/LearningCircuit/local-deep-research | null | null | null | null | 4,643 | null | null | mit | null | null | null | null | null | null | null | examples/api_usage/programmatic/api_public_contract_guardrail.py | null | null | null | null | null | null | Python | 2026-05-04T01:56:40.815594 | #!/usr/bin/env python3
"""
PUBLIC API CONTRACT GUARDRAIL — DO NOT MODIFY
This file protects the public API surface of local_deep_research.
It exists to DETECT breaking changes, not to be "fixed" when they happen.
If this file fails:
1. A BREAKING CHANGE was introduced to the public API
2. Do NOT modify this file ... |
LearningCircuit/local-deep-research | https://github.com/LearningCircuit/local-deep-research | null | null | null | null | 4,643 | null | null | mit | null | null | null | null | null | null | null | examples/api_usage/programmatic/advanced_features_example.py | null | null | null | null | null | null | Python | 2026-05-04T01:56:40.929443 | #!/usr/bin/env python3
"""
Advanced Features Example for Local Deep Research
This example demonstrates advanced programmatic features including:
1. generate_report() - Create comprehensive markdown reports
2. Export formats - Save reports in different formats
3. Result analysis - Extract and analyze research findings
... |
LearningCircuit/local-deep-research | https://github.com/LearningCircuit/local-deep-research | null | null | null | null | 4,643 | null | null | mit | null | null | null | null | null | null | null | examples/api_usage/programmatic/hybrid_search_example.py | null | null | null | null | null | null | Python | 2026-05-04T01:56:40.978630 | #!/usr/bin/env python3
"""
Hybrid Search Example for Local Deep Research
This example demonstrates how to combine multiple search sources:
1. Multiple named retrievers for different document types
2. Combining custom retrievers with web search
3. Analyzing and comparing sources from different origins
"""
from typing ... |
LearningCircuit/local-deep-research | https://github.com/LearningCircuit/local-deep-research | null | null | null | null | 4,643 | null | null | mit | null | null | null | null | null | null | null | examples/api_usage/programmatic/custom_llm_retriever_example.py | null | null | null | null | null | null | Python | 2026-05-04T01:56:41.012931 | #!/usr/bin/env python3
"""
Example of using a custom LLM with a custom retriever in Local Deep Research.
This demonstrates how to integrate your own LLM implementation and custom
retrieval system for programmatic access.
"""
from typing import List, Dict
from langchain_ollama import ChatOllama
from langchain_core.ret... |
LearningCircuit/local-deep-research | https://github.com/LearningCircuit/local-deep-research | null | null | null | null | 4,643 | null | null | mit | null | null | null | null | null | null | null | examples/api_usage/programmatic/minimal_working_example.py | null | null | null | null | null | null | Python | 2026-05-04T01:56:41.227319 | #!/usr/bin/env python3
"""
Minimal working example for programmatic access to Local Deep Research.
This shows how to use the core functionality without database dependencies.
"""
from langchain_ollama import ChatOllama
from local_deep_research.search_system import AdvancedSearchSystem
# Re-enable logging after impor... |
LearningCircuit/local-deep-research | https://github.com/LearningCircuit/local-deep-research | null | null | null | null | 4,643 | null | null | mit | null | null | null | null | null | null | null | examples/api_usage/programmatic/search_strategies_example.py | null | null | null | null | null | null | Python | 2026-05-04T01:56:41.308260 | #!/usr/bin/env python3
"""
Search Strategies Example for Local Deep Research
This example demonstrates the two main search strategies:
1. source-based: Comprehensive research with source citation
2. focused-iteration: Iterative refinement of research questions
Each strategy has different strengths and use cases.
"""
... |
LearningCircuit/local-deep-research | https://github.com/LearningCircuit/local-deep-research | null | null | null | null | 4,643 | null | null | mit | null | null | null | null | null | null | null | examples/api_usage/programmatic/searxng_example.py | null | null | null | null | null | null | Python | 2026-05-04T01:56:41.392228 | #!/usr/bin/env python3
"""
Example of using SearXNG search engine with Local Deep Research.
This demonstrates how to use SearXNG for web search in programmatic mode.
Note: Requires a running SearXNG instance.
"""
import os
from langchain_ollama import ChatOllama
from local_deep_research.search_system import AdvancedS... |
LearningCircuit/local-deep-research | https://github.com/LearningCircuit/local-deep-research | null | null | null | null | 4,643 | null | null | mit | null | null | null | null | null | null | null | examples/api_usage/programmatic/simple_programmatic_example.py | null | null | null | null | null | null | Python | 2026-05-04T01:56:41.392762 | #!/usr/bin/env python3
"""
Simple Programmatic API Example for Local Deep Research
Quick example showing how to use the LDR Python API directly.
"""
from local_deep_research.api import (
detailed_research,
quick_summary,
generate_report,
)
from local_deep_research.api.settings_utils import (
create_se... |
LearningCircuit/local-deep-research | https://github.com/LearningCircuit/local-deep-research | null | null | null | null | 4,643 | null | null | mit | null | null | null | null | null | null | null | .pre-commit-hooks/check-service-context-managers.py | null | null | null | null | null | null | Python | 2026-05-04T01:56:43.131710 | #!/usr/bin/env python3
"""
Pre-commit hook to detect resources (services, database sessions) that are
instantiated without context managers.
Services like DownloadService, LibraryRAGService, and LocalEmbeddingManager
hold resources (file handles, connections, models) that need to be released.
They should be used with ... |
LearningCircuit/local-deep-research | https://github.com/LearningCircuit/local-deep-research | null | null | null | null | 4,643 | null | null | mit | null | null | null | null | null | null | null | .pre-commit-hooks/check-session-context-manager.py | null | null | null | null | null | null | Python | 2026-05-04T01:56:43.238039 | #!/usr/bin/env python3
"""
Pre-commit hook to detect try/finally session patterns and suggest context managers.
This hook checks for SQLAlchemy session management patterns that use try/finally
blocks and suggests replacing them with context managers for better resource
management and cleaner code.
"""
import ast
impo... |
LearningCircuit/local-deep-research | https://github.com/LearningCircuit/local-deep-research | null | null | null | null | 4,643 | null | null | mit | null | null | null | null | null | null | null | .pre-commit-hooks/check-silent-cleanup.py | null | null | null | null | null | null | Python | 2026-05-04T01:56:43.316477 | #!/usr/bin/env python3
"""
Pre-commit hook to flag unsafe cleanup patterns.
Check 1 — Silent close() methods:
Detects `def close(self)` methods that contain bare `except Exception: pass`
or `except: pass` — cleanup failures should be logged via safe_close() from
utilities.resource_utils, or with explicit logger ... |
llm-attacks/llm-attacks | https://github.com/llm-attacks/llm-attacks | null | null | null | null | 4,643 | null | null | mit | null | null | null | null | null | null | null | experiments/configs/individual_vicuna.py | null | null | null | null | null | null | Python | 2026-05-04T01:56:45.721529 | import os
os.sys.path.append("..")
from configs.template import get_config as default_config
def get_config():
config = default_config()
return config |
llm-attacks/llm-attacks | https://github.com/llm-attacks/llm-attacks | null | null | null | null | 4,643 | null | null | mit | null | null | null | null | null | null | null | experiments/configs/individual_llama2.py | null | null | null | null | null | null | Python | 2026-05-04T01:56:45.722409 | import os
os.sys.path.append("..")
from configs.template import get_config as default_config
def get_config():
config = default_config()
config.result_prefix = 'results/individual_llama2'
config.tokenizer_paths=["/DIR/llama-2/llama/llama-2-7b-chat-hf"]
config.model_paths=["/DIR/llama-2/llama/ll... |
llm-attacks/llm-attacks | https://github.com/llm-attacks/llm-attacks | null | null | null | null | 4,643 | null | null | mit | null | null | null | null | null | null | null | experiments/configs/transfer_llama2.py | null | null | null | null | null | null | Python | 2026-05-04T01:56:45.726760 | import os
os.sys.path.append("..")
from configs.template import get_config as default_config
def get_config():
config = default_config()
config.transfer = True
config.logfile = ""
config.progressive_goals = False
config.stop_on_success = False
config.tokenizer_paths = [
"/DIR/ll... |
llm-attacks/llm-attacks | https://github.com/llm-attacks/llm-attacks | null | null | null | null | 4,643 | null | null | mit | null | null | null | null | null | null | null | api_experiments/evaluate_api_models.py | null | null | null | null | null | null | Python | 2026-05-04T01:56:45.728203 | import os
import openai
from scriptify import scriptify
import numpy as np
import json
from anthropic import Anthropic, HUMAN_PROMPT, AI_PROMPT
import time
openai.api_key = os.getenv("OPENAI_API_KEY")
ANTHROPIC_API_KEY = os.getenv("ANTHROPIC_API_KEY")
class NpEncoder(json.JSONEncoder):
def default(self, obj):
... |
llm-attacks/llm-attacks | https://github.com/llm-attacks/llm-attacks | null | null | null | null | 4,643 | null | null | mit | null | null | null | null | null | null | null | experiments/configs/transfer_vicuna.py | null | null | null | null | null | null | Python | 2026-05-04T01:56:45.738083 | import os
os.sys.path.append("..")
from configs.template import get_config as default_config
def get_config():
config = default_config()
config.transfer = True
config.logfile = ""
config.progressive_goals = False
config.stop_on_success = False
config.tokenizer_paths = [
"/DIR/vi... |
llm-attacks/llm-attacks | https://github.com/llm-attacks/llm-attacks | null | null | null | null | 4,643 | null | null | mit | null | null | null | null | null | null | null | experiments/configs/transfer_vicuna_guanaco.py | null | null | null | null | null | null | Python | 2026-05-04T01:56:45.754103 | import os
os.sys.path.append("..")
from configs.template import get_config as default_config
def get_config():
config = default_config()
config.transfer = True
config.logfile = ""
config.progressive_goals = False
config.stop_on_success = False
config.tokenizer_paths = [
"TheBlok... |
llm-attacks/llm-attacks | https://github.com/llm-attacks/llm-attacks | null | null | null | null | 4,643 | null | null | mit | null | null | null | null | null | null | null | experiments/configs/template.py | null | null | null | null | null | null | Python | 2026-05-04T01:56:45.755462 | from ml_collections import config_dict
def get_config():
config = config_dict.ConfigDict()
# Experiment type
config.transfer = False
# General parameters
config.target_weight=1.0
config.control_weight=0.0
config.progressive_goals=False
config.progressive_models=False
config.annea... |
llm-attacks/llm-attacks | https://github.com/llm-attacks/llm-attacks | null | null | null | null | 4,643 | null | null | mit | null | null | null | null | null | null | null | experiments/evaluate.py | null | null | null | null | null | null | Python | 2026-05-04T01:56:45.756846 | import argparse
import sys
import math
import random
import json
import shutil
import time
import gc
import os
from copy import deepcopy
from types import SimpleNamespace
import numpy as np
from tqdm.auto import tqdm
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.multiprocessing as m... |
llm-attacks/llm-attacks | https://github.com/llm-attacks/llm-attacks | null | null | null | null | 4,643 | null | null | mit | null | null | null | null | null | null | null | experiments/evaluate_individual.py | null | null | null | null | null | null | Python | 2026-05-04T01:56:46.321843 | import argparse
import sys
import math
import random
import json
import shutil
import time
import gc
import os
from copy import deepcopy
from types import SimpleNamespace
import numpy as np
from tqdm.auto import tqdm
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.multiprocessing as m... |
llm-attacks/llm-attacks | https://github.com/llm-attacks/llm-attacks | null | null | null | null | 4,643 | null | null | mit | null | null | null | null | null | null | null | experiments/main.py | null | null | null | null | null | null | Python | 2026-05-04T01:56:46.322996 | '''A main script to run attack for LLMs.'''
import time
import importlib
import numpy as np
import torch.multiprocessing as mp
from absl import app
from ml_collections import config_flags
from llm_attacks import get_goals_and_targets, get_workers
_CONFIG = config_flags.DEFINE_config_file('config')
# Function to impo... |
llm-attacks/llm-attacks | https://github.com/llm-attacks/llm-attacks | null | null | null | null | 4,643 | null | null | mit | null | null | null | null | null | null | null | llm_attacks/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T01:56:46.327724 | __version__ = '0.0.1'
from .base.attack_manager import (
AttackPrompt,
PromptManager,
MultiPromptAttack,
IndividualPromptAttack,
ProgressiveMultiPromptAttack,
EvaluateAttack,
get_embedding_layer,
get_embedding_matrix,
get_embeddings,
get_nonascii_toks,
get_goals_and_targets,... |
llm-attacks/llm-attacks | https://github.com/llm-attacks/llm-attacks | null | null | null | null | 4,643 | null | null | mit | null | null | null | null | null | null | null | llm_attacks/gcg/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T01:56:46.354637 | from .gcg_attack import GCGAttackPrompt as AttackPrompt
from .gcg_attack import GCGPromptManager as PromptManager
from .gcg_attack import GCGMultiPromptAttack as MultiPromptAttack
from llm_attacks import ProgressiveMultiPromptAttack
from llm_attacks import IndividualPromptAttack |
llm-attacks/llm-attacks | https://github.com/llm-attacks/llm-attacks | null | null | null | null | 4,643 | null | null | mit | null | null | null | null | null | null | null | llm_attacks/base/attack_manager.py | null | null | null | null | null | null | Python | 2026-05-04T01:56:46.363760 | import gc
import json
import math
import random
import time
from copy import deepcopy
from typing import Optional, Any
import numpy as np
import pandas as pd
import torch
import torch.multiprocessing as mp
import torch.nn as nn
import torch.nn.functional as F
from fastchat.model import get_conversation_template
from t... |
llm-attacks/llm-attacks | https://github.com/llm-attacks/llm-attacks | null | null | null | null | 4,643 | null | null | mit | null | null | null | null | null | null | null | llm_attacks/gcg/gcg_attack.py | null | null | null | null | null | null | Python | 2026-05-04T01:56:46.385188 | import gc
import numpy as np
import torch
import torch.nn as nn
from tqdm.auto import tqdm
from llm_attacks import AttackPrompt, MultiPromptAttack, PromptManager
from llm_attacks import get_embedding_matrix, get_embeddings
def token_gradients(model, input_ids, input_slice, target_slice, loss_slice):
"""
Co... |
llm-attacks/llm-attacks | https://github.com/llm-attacks/llm-attacks | null | null | null | null | 4,643 | null | null | mit | null | null | null | null | null | null | null | llm_attacks/minimal_gcg/opt_utils.py | null | null | null | null | null | null | Python | 2026-05-04T01:56:46.389470 | import gc
import numpy as np
import torch
import torch.nn as nn
from transformers import AutoModelForCausalLM, AutoTokenizer
from llm_attacks import get_embedding_matrix, get_embeddings
def token_gradients(model, input_ids, input_slice, target_slice, loss_slice):
"""
Computes gradients of the loss with res... |
llm-attacks/llm-attacks | https://github.com/llm-attacks/llm-attacks | null | null | null | null | 4,643 | null | null | mit | null | null | null | null | null | null | null | llm_attacks/minimal_gcg/string_utils.py | null | null | null | null | null | null | Python | 2026-05-04T01:56:46.435602 | import torch
import fastchat
def load_conversation_template(template_name):
conv_template = fastchat.model.get_conversation_template(template_name)
if conv_template.name == 'zero_shot':
conv_template.roles = tuple(['### ' + r for r in conv_template.roles])
conv_template.sep = '\n'
elif con... |
llm-attacks/llm-attacks | https://github.com/llm-attacks/llm-attacks | null | null | null | null | 4,643 | null | null | mit | null | null | null | null | null | null | null | setup.py | null | null | null | null | null | null | Python | 2026-05-04T01:56:47.038935 | import os
from setuptools import setup, find_packages
with open('README.md', 'r', encoding='utf-8') as f:
long_description = f.read()
def read(rel_path):
here = os.path.abspath(os.path.dirname(__file__))
# intentionally *not* adding an encoding option to open, See:
# https://github.com/pypa/virtua... |
hunvreus/devpush | https://github.com/hunvreus/devpush | null | null | null | null | 4,640 | null | null | mit | null | null | null | null | null | null | null | app/forms/auth.py | null | null | null | null | null | null | Python | 2026-05-04T01:56:49.650511 | from starlette_wtf import StarletteForm
from wtforms import StringField, SubmitField
from wtforms.validators import DataRequired, Email, Length
from dependencies import get_lazy_translation as _l
class EmailLoginForm(StarletteForm):
email = StringField(
_l("Email address"),
filters=[lambda v: v.s... |
hunvreus/devpush | https://github.com/hunvreus/devpush | null | null | null | null | 4,640 | null | null | mit | null | null | null | null | null | null | null | app/dependencies.py | null | null | null | null | null | null | Python | 2026-05-04T01:56:49.651942 | from fastapi import Request, Depends, HTTPException, status
from fastapi.responses import (
RedirectResponse as FastAPIRedirect,
Response as FastAPIResponse,
)
from starlette.background import BackgroundTask
from authlib.integrations.starlette_client import OAuth
from fastapi.templating import Jinja2Templates
f... |
hunvreus/devpush | https://github.com/hunvreus/devpush | null | null | null | null | 4,640 | null | null | mit | null | null | null | null | null | null | null | app/config.py | null | null | null | null | null | null | Python | 2026-05-04T01:56:49.660047 | import os
import logging
from functools import lru_cache
from pydantic_settings import BaseSettings, SettingsConfigDict
logger = logging.getLogger(__name__)
class Settings(BaseSettings):
app_name: str = "/dev/push"
app_description: str = (
"An open-source platform to build and deploy any app from G... |
hunvreus/devpush | https://github.com/hunvreus/devpush | null | null | null | null | 4,640 | null | null | mit | null | null | null | null | null | null | null | app/db.py | null | null | null | null | null | null | Python | 2026-05-04T01:56:49.661203 | from sqlalchemy.ext.asyncio import create_async_engine, AsyncSession, async_sessionmaker
from sqlalchemy.orm import DeclarativeBase
from config import get_settings
# Database configuration
settings = get_settings()
database_url = f"postgresql+asyncpg://{settings.postgres_user}:{settings.postgres_password}@pgsql:5432/{... |
hunvreus/devpush | https://github.com/hunvreus/devpush | null | null | null | null | 4,640 | null | null | mit | null | null | null | null | null | null | null | app/forms/user.py | null | null | null | null | null | null | Python | 2026-05-04T01:56:49.669823 | from starlette_wtf import StarletteForm
from wtforms import (
StringField,
SubmitField,
BooleanField,
FileField,
HiddenField,
SelectField,
)
from wtforms.validators import ValidationError, DataRequired, Length, Regexp, Email
from sqlalchemy import select, func
from sqlalchemy.ext.asyncio import ... |
hunvreus/devpush | https://github.com/hunvreus/devpush | null | null | null | null | 4,640 | null | null | mit | null | null | null | null | null | null | null | app/forms/admin.py | null | null | null | null | null | null | Python | 2026-05-04T01:56:49.671029 | from starlette_wtf import StarletteForm
from wtforms import (
BooleanField,
HiddenField,
SelectField,
StringField,
SubmitField,
TextAreaField,
)
from wtforms.validators import DataRequired, Optional, ValidationError
from dependencies import get_translation as _, get_lazy_translation as _l
cla... |
hunvreus/devpush | https://github.com/hunvreus/devpush | null | null | null | null | 4,640 | null | null | mit | null | null | null | null | null | null | null | app/forms/project.py | null | null | null | null | null | null | Python | 2026-05-04T01:56:49.674128 | from starlette_wtf import StarletteForm
from wtforms import (
StringField,
IntegerField,
DecimalField,
SelectField,
SubmitField,
FieldList,
FormField,
Form,
BooleanField,
FileField,
HiddenField,
TextAreaField,
)
from wtforms.validators import (
ValidationError,
Da... |
hunvreus/devpush | https://github.com/hunvreus/devpush | null | null | null | null | 4,640 | null | null | mit | null | null | null | null | null | null | null | app/forms/team.py | null | null | null | null | null | null | Python | 2026-05-04T01:56:49.686647 | from starlette_wtf import StarletteForm
from wtforms import (
StringField,
SubmitField,
BooleanField,
FileField,
HiddenField,
SelectField,
)
from wtforms.validators import ValidationError, DataRequired, Length, Regexp, Email
from sqlalchemy import select, func
from sqlalchemy.ext.asyncio import ... |
hunvreus/devpush | https://github.com/hunvreus/devpush | null | null | null | null | 4,640 | null | null | mit | null | null | null | null | null | null | null | app/main.py | null | null | null | null | null | null | Python | 2026-05-04T01:56:49.716409 | import logging
import os
from contextlib import asynccontextmanager
from arq import create_pool
from arq.connections import RedisSettings
from fastapi import FastAPI, Request, Depends, HTTPException, Response
from fastapi.responses import RedirectResponse
from fastapi.staticfiles import StaticFiles
from sqlalchemy imp... |
hunvreus/devpush | https://github.com/hunvreus/devpush | null | null | null | null | 4,640 | null | null | mit | null | null | null | null | null | null | null | app/forms/storage.py | null | null | null | null | null | null | Python | 2026-05-04T01:56:49.722779 | import json
from starlette.requests import Request
from starlette_wtf import StarletteForm
from wtforms import (
HiddenField,
StringField,
SubmitField,
SelectField,
TextAreaField,
BooleanField,
)
from wtforms.validators import DataRequired, Length, Regexp, ValidationError, Optional
from sqlalche... |
hunvreus/devpush | https://github.com/hunvreus/devpush | null | null | null | null | 4,640 | null | null | mit | null | null | null | null | null | null | null | app/migrations/versions/b6bd1dff4015_storage.py | null | null | null | null | null | null | Python | 2026-05-04T01:56:50.743832 | """Storage
Revision ID: b6bd1dff4015
Revises: 31fe53421216
Create Date: 2026-01-09 02:35:35.553275
"""
from typing import Sequence, Union
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql
# revision identifiers, used by Alembic.
revision: str = 'b6bd1dff4015'
down_revision: U... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.