text
stringlengths
185
73.3k
repo
stringlengths
7
100
path
stringlengths
4
146
language
stringclasses
7 values
hash
stringlengths
16
16
score
float64
7
8.5
stars
int64
0
237k
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. from .default_maya_handler import DefaultMayaHandler import maya.cmds import maya.mel class VRayHandler(DefaultMayaHandler): """Render Handler for V-Ray""" def __init__(self): """ Initializes the V-Ray Renderer Handler. ...
aws-deadline/deadline-cloud-for-maya
src/deadline/maya_adaptor/MayaClient/render_handlers/vray_handler.py
.py
801c4f2146e51343
7.65
19
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. from __future__ import annotations import os import re import time from functools import lru_cache from pathlib import Path from typing import Any, Generator, Iterable from .file_path_editor import FilePathEditor from .scene import Animation, Render...
aws-deadline/deadline-cloud-for-maya
src/deadline/maya_submitter/assets.py
.py
6c55405443c98ba1
7.65
19
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. from __future__ import annotations import maya.cmds """ Functionality for interacting with Cameras in a Maya scene. """ ALL_CAMERAS = "All Renderable Cameras" def get_renderable_camera_names() -> list[str]: """ Returns a list of all camer...
aws-deadline/deadline-cloud-for-maya
src/deadline/maya_submitter/cameras.py
.py
3cecaad9e1d21dbd
7.65
19
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. from __future__ import annotations import dataclasses from dataclasses import dataclass, field from pathlib import Path import json from deadline.client.ui.dataclasses.timeouts import TimeoutEntry, TimeoutTableEntries from datetime import timedelta ...
aws-deadline/deadline-cloud-for-maya
src/deadline/maya_submitter/data_classes.py
.py
5cd6a08c29ce7f47
7.65
19
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. from __future__ import annotations import os from dataclasses import dataclass from typing import Optional import maya.cmds from .utils import strtobool @dataclass class FileRef: """ Dataclass containing a reference to a single reference...
aws-deadline/deadline-cloud-for-maya
src/deadline/maya_submitter/file_path_editor.py
.py
8768fe192382e620
7.65
19
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. """ Functionality for creating a global logger for the maya submitter. """ from __future__ import absolute_import, print_function import logging import logging.handlers import os import tempfile from typing import Any import maya.OpenMaya as om #...
aws-deadline/deadline-cloud-for-maya
src/deadline/maya_submitter/logging.py
.py
a65a3de596f907ba
7.65
19
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. """ Defines the Render submitter command which is registered in Maya. """ import maya.api.OpenMaya as om # pylint: disable=import-error import maya.cmds from qtpy.QtCore import Qt # type: ignore from qtpy.QtWidgets import ( # type: ignore QAp...
aws-deadline/deadline-cloud-for-maya
src/deadline/maya_submitter/mel_commands.py
.py
48a5ba8f0cf07bd3
7.65
19
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. """ Functionality for interacting with Maya's Render Layers """ from contextlib import contextmanager from enum import IntEnum from typing import List import maya.app.renderSetup.model.renderSetupPreferences as renderSetupPrefs # type: ignore impo...
aws-deadline/deadline-cloud-for-maya
src/deadline/maya_submitter/render_layers.py
.py
309ed4e7d7610d4d
7.65
19
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. from __future__ import annotations import os from dataclasses import dataclass from enum import Enum from typing import Iterator, Optional import maya.cmds """ Functionality used for querying scene settings """ class RendererNames(Enum): """ ...
aws-deadline/deadline-cloud-for-maya
src/deadline/maya_submitter/scene.py
.py
2bab68c88d41da00
7.65
19
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. import os from qtpy.QtCore import QSize, Qt, QRegularExpression # type: ignore from qtpy.QtWidgets import ( # type: ignore QCheckBox, QComboBox, QFileDialog, QGridLayout, QHBoxLayout, QLabel, QLineEdit, QPushButton, ...
aws-deadline/deadline-cloud-for-maya
src/deadline/maya_submitter/ui/components/scene_settings_tab.py
.py
3cc585ed7ebb7045
7.65
19
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. """Utilities for checking and displaying update notifications.""" import logging from dataclasses import dataclass from deadline.client.api import safe_check_for_updates, UpdateCheckResult, UpdateCheckStatus from deadline.client.ui.dialogs.update_a...
aws-deadline/deadline-cloud-for-maya
src/deadline/maya_submitter/update_utils.py
.py
515aac0a22dcb9d6
7.65
19
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. """ Minor utility functions """ from __future__ import annotations import os import re import time from functools import wraps from typing import Callable from maya.app.general.fileTexturePathResolver import _patternToRegex def strtobool(val: st...
aws-deadline/deadline-cloud-for-maya
src/deadline/maya_submitter/utils.py
.py
f32a45f955d21cca
7.65
19
""" SecurityGuard — Security fence enforcer (Tool Wrapper's police). This module blocks dangerous operations at code level — Agent CANNOT bypass: - Blacklist command interception (regex matching) - Path restriction enforcement - Write protection toggle """ from __future__ import annotations import logging import re ...
NVFivem/pattern8
src/p8/enforcement/security_guard.py
.py
b51970953cbed427
7.45
7
"""Base class for optimization atoms.""" from abc import ABC, abstractmethod from dataclasses import dataclass import torch from typing_extensions import Self from rlaopt.expression import Expression, ExprTree, Variable from rlaopt.ext_tensordict import TensorDict @dataclass(kw_only=True, frozen=True) class AtomDe...
udellgroup/rlaopt
rlaopt/atoms/atom.py
.py
1d8b9b01813dd2f3
7.42
6
"""Box constraint atom for optimization.""" import torch from rlaopt.atoms.polyhedron import Polyhedron from rlaopt.expression import Variable from rlaopt.ext_tensordict import TensorDict class Box(Polyhedron): """Box constraint atom representing elementwise bounds. A box constraint restricts each element ...
udellgroup/rlaopt
rlaopt/atoms/box.py
.py
af6dd36448a3929c
7.42
6
"""Elastic net regularization atom.""" import torch from rlaopt.atoms.nonsmooth_regularizer import NonsmoothRegularizer from rlaopt.expression import Expression from rlaopt.ext_tensordict import TensorDict class ElasticNet(NonsmoothRegularizer): """Elastic net regularization combining L1 and L2 penalties. ...
udellgroup/rlaopt
rlaopt/atoms/elastic_net.py
.py
45a738e1b8c9c1a3
7.42
6
"""Halfspace constraint atom for optimization.""" import torch from rlaopt.atoms.polyhedron import Polyhedron from rlaopt.expression import Variable from rlaopt.ext_tensordict import TensorDict class Halfspace(Polyhedron): """Halfspace constraint atom representing a linear inequality. A halfspace constrain...
udellgroup/rlaopt
rlaopt/atoms/halfspace.py
.py
1e04f45f62f1b7f8
7.42
6
"""Linear equality constraint atom for optimization.""" import torch from rlaopt.atoms.polyhedron import Polyhedron from rlaopt.expression import Variable from rlaopt.ext_tensordict import TensorDict class LinearEquality(Polyhedron): """Linear equality constraint atom enforcing A @ x = b. Represents a syst...
udellgroup/rlaopt
rlaopt/atoms/linear_equality.py
.py
6293c2bc29d79734
7.42
6
from enum import Enum import torch from ._tweedie import ( CompoundPoissonGammaLoss, GammaLoss, InverseGaussianLoss, PoissonLoss, ) class LossType(Enum): """Enumeration of different loss types for GLM models.""" GAMMA = "gamma" HUBER = "huber" INV_GAUSS = "inverse_gaussian" LEAS...
udellgroup/rlaopt
rlaopt/atoms/linear_model/_loss_factory.py
.py
1243dcb9e5f8b6da
7.42
6
"""Tweedie loss functions. This module provides loss functions for GLMs with link functions, from the Tweedie family of distributions. """ import torch from torch.nn.modules.loss import _Loss class TweedieLoss(_Loss): """Tweedie loss for regression. The Tweedie distribution is a family of distributions tha...
udellgroup/rlaopt
rlaopt/atoms/linear_model/_tweedie.py
.py
5c28ab029891f162
7.42
6
"""Norm ball constraint atoms for optimization.""" from abc import ABC, abstractmethod from numbers import Real import torch from rlaopt.atoms.atom import Atom, AtomDecomposition from rlaopt.atoms.lp_norm_helpers import ( project_onto_l1_ball, project_onto_l2_ball, project_onto_linf_ball, ) from rlaopt.e...
udellgroup/rlaopt
rlaopt/atoms/lp_norm_balls.py
.py
2ce8f651c11480db
7.42
6
"""Euclidean projections onto Lp-norm balls.""" import functools import torch def _zero_for_nonpositive_radius(projection): """Normalize ``radius`` to a tensor and short-circuit a zero projection. Wraps a projection so it converts ``radius`` to a tensor on ``x``'s device and dtype and, when the radius ...
udellgroup/rlaopt
rlaopt/atoms/lp_norm_helpers.py
.py
237627255e71e701
7.42
6
"""Non-negativity constraint atom for optimization.""" from rlaopt.atoms.box import Box from rlaopt.expression import Variable class NonNegative(Box): """Non-negativity constraint atom enforcing x >= 0. A convenience class for box constraints with lower bound of zero and no upper bound, enforcing that a...
udellgroup/rlaopt
rlaopt/atoms/non_negative.py
.py
9e4c5a328a2b46e9
7.42
6
"""Base class for nonsmooth regularization atoms.""" from abc import ABC import torch from typing_extensions import Self from rlaopt.atoms.atom import Atom, AtomDecomposition from rlaopt.expression import Expression, Variable class NonsmoothRegularizer(Atom, ABC): """Base class for nonsmooth regularization ato...
udellgroup/rlaopt
rlaopt/atoms/nonsmooth_regularizer.py
.py
702538c621441b06
7.42
6
"""Nuclear norm atom for matrix regularization.""" from typing import Any import torch from rlaopt.atoms.nonsmooth_regularizer import NonsmoothRegularizer from rlaopt.expression import Expression from rlaopt.ext_tensordict import TensorDict class NucNorm(NonsmoothRegularizer): """Nuclear norm (sum of singular ...
udellgroup/rlaopt
rlaopt/atoms/nuc_norm.py
.py
baed6860e9d2e4e5
7.42
6
"""Polyhedron constraint atom for optimization.""" from enum import Enum, auto from functools import partial from math import isclose from typing import Callable from warnings import warn import torch from typing_extensions import Self from rlaopt.atoms.atom import Atom, AtomDecomposition from rlaopt.expression impo...
udellgroup/rlaopt
rlaopt/atoms/polyhedron.py
.py
add3f7e0a0687289
7.42
6
"""Implementations of quadratic form atoms.""" from abc import ABC import torch from rlaopt.atoms.atom import Atom from rlaopt.expression import Expression, Variable from rlaopt.ext_tensordict import TensorDict class _QuadForm(Atom, ABC): """Base class for quadratic form atoms ``f(x) = x^T Q x``. The matr...
udellgroup/rlaopt
rlaopt/atoms/quad_form.py
.py
3003d99c25fb7873
7.42
6
"""Collate functions for batching dataset samples with index tracking.""" import torch from torch.utils.data._utils.collate import default_collate class IndexTrackingCollate: """Collate function to stack (data, target, index) tuples into batch tensors.""" def __call__(self, batch): """Stack (data, t...
udellgroup/rlaopt
rlaopt/data/collate.py
.py
81f2111d00540184
7.42
6
"""Custom DataLoader implementation with extended functionality for Dataset types. This module provides a DataLoader class that extends PyTorch's standard DataLoader to work with custom Dataset and BatchedDataset types, offering efficient access to training labels based on the dataset type. """ from functools import ...
udellgroup/rlaopt
rlaopt/data/dataloader.py
.py
2381b8f788b10d67
7.42
6
"""Dataset classes for handling various data modalities in machine learning workflows. This module provides flexible dataset classes that bridge the gap between common data formats (numpy, pandas) and PyTorch tensors, with support for both in-memory and out-of-memory datasets. Classes: AbstractDataset: Base abstr...
udellgroup/rlaopt
rlaopt/data/datasets.py
.py
ecbba62a7c1219bb
7.42
6
from abc import ABC, abstractmethod import torch from rlaopt.expression.expression import Expression from rlaopt.expression.tree import ExprTree class _NAryOpExpression(Expression, ABC): """Private base class for n-ary operations (operations on multiple expressions). Provides infrastructure for expressions...
udellgroup/rlaopt
rlaopt/expression/_nary_op_expression.py
.py
0006570e313d54d3
7.42
6
"""Module for Constant class.""" import torch from rlaopt.expression.expression import Expression from rlaopt.expression.tree import ExprTree class Constant(Expression): """Constant value expression. Represents a constant (non-trainable) value in an expression tree. Constants are stored as buffers rath...
udellgroup/rlaopt
rlaopt/expression/constant.py
.py
97e326d2006918ea
7.42
6
"""Expression tree for testing and visualization.""" from collections import Counter from typing_extensions import Self class ExprTree: """Tree representation of expression structure. Used for testing expression optimizations and visualizing expression structure. Each node has a type (class name) and z...
udellgroup/rlaopt
rlaopt/expression/tree.py
.py
625d3121700bb16a
7.42
6
"""Utility functions for expression module.""" from functools import reduce import torch from rlaopt.expression import expr_types def _create_sum(left, right): """Create an addition expression with automatic optimizations. Optimizations: - Flattens nested SumExpressions: (a + b) + c -> SumExpression(a...
udellgroup/rlaopt
rlaopt/expression/utils.py
.py
5de66d33e6fd4907
7.42
6
"""Module for Variable class.""" import torch from typing_extensions import Self from rlaopt.expression.expression import Expression from rlaopt.expression.tree import ExprTree from rlaopt.settings import VAR_PREFIX from rlaopt.utils.counter import get_id class Variable(Expression): """Leaf optimization variabl...
udellgroup/rlaopt
rlaopt/expression/variable.py
.py
6259222aa5ef378d
7.42
6
"""Extended TensorDict module.""" import tensordict as td_lib import torch from torch.utils._pytree import register_pytree_node from typing_extensions import Self class TensorDict(td_lib.TensorDict): """Extended TensorDict with additional methods for optimization algorithms. This class extends the PyTorch t...
udellgroup/rlaopt
rlaopt/ext_tensordict.py
.py
c78e29299f055812
7.42
6
"""LinSys module for positive-definite linear systems.""" from warnings import warn import torch from linops import LinearOperator, aslinearoperator class LinSys(torch.nn.Module): """Module for regularized linear systems (A + reg * I)w = B.""" def __init__( self, A: torch.Tensor | LinearOpe...
udellgroup/rlaopt
rlaopt/linalg/lin_sys.py
.py
6cc38be5358690a3
7.42
6
"""Factory for creating preconditioners based on configuration.""" import torch from linops import LinearOperator from rlaopt.linalg.preconditioners.identity import Identity, IdentityConfig from rlaopt.linalg.preconditioners.nystrom import Nystrom, NystromConfig from rlaopt.linalg.preconditioners.preconditioner impor...
udellgroup/rlaopt
rlaopt/linalg/preconditioners/factory.py
.py
2fefec20c766bf81
7.42
6
"""Identity preconditioner and configuration.""" import torch from linops import LinearOperator from rlaopt.linalg.preconditioners.preconditioner import ( Preconditioner, PreconditionerConfig, ) class IdentityConfig(PreconditionerConfig): """Configuration for the Identity preconditioner.""" @proper...
udellgroup/rlaopt
rlaopt/linalg/preconditioners/identity.py
.py
35448e2bdf4cec3f
7.42
6
"""Nyström preconditioner and configuration.""" from typing import Literal from warnings import warn import torch from linops import LinearOperator from pydantic import Field, model_validator from typing_extensions import Self from rlaopt.linalg.preconditioners.preconditioner import ( Preconditioner, Precond...
udellgroup/rlaopt
rlaopt/linalg/preconditioners/nystrom.py
.py
905a9e2af271d879
7.42
6
""" Scrape state metro(s) gas price daily averages from AAA Gas Prices website. Usage:: mkdir -p data/metro-daily-averages pip install selenium webdriver-manager pandas python scrape_metro_daily_averages.py """ import datetime import logging import os import random import time from pathlib import Path ...
lykmapipo/US-Gas-Prices
scrape_metro_daily_averages.py
.py
918c9b15457765fb
7.48
8
"""pytest configuration file. This governs the arguments we can pass pytest and sets up the local test server. The test server runs locally and mimics the DeepOrigin Platform API endpoints. All tests use this local server instead of making real API calls. """ import os import pytest from deeporigin.auth import get...
deeporiginbio/do-dd-client
conftest.py
.py
9c49a4b972dc0c1c
8.09
14
"""PROTOTYPE DDOS-6937 — iframe postMessage ↔ AnyWidget bridge. Throwaway module validating a supported Jupyter Widget Comm round trip. Candidate lift target: ``deeporigin.utils.notebook.render_html_with_comm``. """ from __future__ import annotations from dataclasses import dataclass, field from typing import Any, C...
deeporiginbio/do-dd-client
prototypes/ddos-6937-interactive-box-wireframe/comm_bridge.py
.py
18abcad48dd7daf2
7.59
14
#!/usr/bin/env python3 """Detect stale tool-run fixtures whose version doesn't match ``TOOL_KEYS_AND_VERSIONS``. A fixture is "stale" when the tool version baked into the fixture JSON (``tool.version``, ``function.version``, or ``function.manifestBody.version``) does not match the canonical version in ``deeporigin.pla...
deeporiginbio/do-dd-client
scripts/check_stale_fixtures.py
.py
dd37c583e449657f
7.59
14
#!/usr/bin/env python3 """Browser smoke test: JupyterLab renders the AnyWidget iframe bridge.""" from __future__ import annotations from pathlib import Path import subprocess import time import urllib.error import urllib.request def _repo_root() -> Path: """Return the do-dd-client repository root.""" root =...
deeporiginbio/do-dd-client
scripts/smoke_widget_render.py
.py
7a9e825932749f2b
7.59
14
"""Generate standalone Mol* visualization HTML files for the docs. This is the single source of truth for how each ``docs/images/*.html`` Mol* visualization is produced. Each entry in ``VIZ_REGISTRY`` maps a docs-image name to a builder that returns a complete, self-contained HTML document (from the ``deeporigin.viz.m...
deeporiginbio/do-dd-client
skills/make-viz/scripts/build_docs_viz.py
.py
2da78f0e0f87361d
7.59
14
"""Command-line interface for Deep Origin.""" from __future__ import annotations import json from typing import Annotated from beartype import beartype import typer from deeporigin.platform.client import DeepOriginClient app = typer.Typer(help="Deep Origin CLI.") results_app = typer.Typer(help="Result explorer com...
deeporiginbio/do-dd-client
src/cli.py
.py
826a27d44c8d13e9
7.59
14
"""Simplified configuration management for Deep Origin client. This module stores and retrieves configuration values including ``env`` and ``org_key``. Project selection is held in the :class:`~deeporigin.platform.client.DeepOriginClient` instance only — nothing project-related is persisted to disk. Behavior: - If th...
deeporiginbio/do-dd-client
src/config.py
.py
3c5cfc3befe7f31f
7.59
14
"""Admet -- predict admet-now endpoints for ligands (served, sync-only). Backed by the served platform tool ``deeporigin.admet-properties``. One :class:`Admet` instance is configured with ligands, then executed with a blocking :meth:`run`, which returns a :class:`pandas.DataFrame` of predictions keyed by admet-now tas...
deeporiginbio/do-dd-client
src/drug_discovery/admet.py
.py
3ea1043a4e18b303
7.59
14
"""this module contains functions for aligning RDKit molecules.""" import copy import numpy as np def randomize_mol_pose(mol, seed: int = None): """ Takes a 3D RDKit molecule and returns a copy with a randomly rotated and translated conformation. Args: mol: RDKit molecule to randomize s...
deeporiginbio/do-dd-client
src/drug_discovery/align.py
.py
51fee1ab2e2d70e7
7.59
14
"""Contains functions for working with SDF files.""" from collections.abc import Sequence from pathlib import Path import re from typing import Literal, Optional, Tuple from beartype import beartype import numpy as np from rdkit import Chem, RDLogger from rdkit.Chem import AllChem, SDWriter, rdFMCS, rdMolAlign KeyTy...
deeporiginbio/do-dd-client
src/drug_discovery/chemistry.py
.py
fd997761fec45309
7.59
14
"""Mixins that compose execution capabilities for job classes. These mixins are combined with ``Execution`` to build concrete types: - ``SyncExecutableMixin`` -- blocking execution via ``run()`` - ``AsyncExecutableMixin`` -- async, stateful execution via ``start()`` and ``cancel()`` (platform refresh uses :meth:`...
deeporiginbio/do-dd-client
src/drug_discovery/execution_mixins.py
.py
a37b6f57e8097805
7.59
14
""" Utility functions for protein structure analysis. Provides functions for working with protein structure files (PDB, CIF), sequence extraction, sequence alignment analysis, and format conversion. """ import os from beartype import beartype @beartype def three2one(prot) -> str: """Translate a protein sequenc...
deeporiginbio/do-dd-client
src/drug_discovery/external_tools/protein_structure.py
.py
d27f86ced9c2f7d1
7.59
14
"""Shared FEP parameter serialization for ABFE and RBFE workflow tools.""" from __future__ import annotations from dataclasses import dataclass from typing import Any from beartype import beartype from deeporigin.drug_discovery.structures.ligand import Ligand from deeporigin.drug_discovery.structures.pose import Po...
deeporiginbio/do-dd-client
src/drug_discovery/fep_common.py
.py
65873fb3fceba71b
7.59
14
"""Synchronous ligand network generation with the Konnektor platform tool.""" from __future__ import annotations from dataclasses import dataclass from pathlib import Path from typing import Any, Literal from beartype import beartype from deeporigin.drug_discovery.execution import Execution from deeporigin.drug_dis...
deeporiginbio/do-dd-client
src/drug_discovery/konnektor.py
.py
f59aa03b7c22a6ac
7.59
14
"""Molprops -- synchronous ADMET / molprops runs on one or more ligands. Backed by the single combined platform tool ``deeporigin.mol-props-combined``, which accepts a list of ``ligands`` and a ``molprops`` array selecting which properties to compute, and returns one row per input ligand keyed by ``ligand_id``. Usage...
deeporiginbio/do-dd-client
src/drug_discovery/molprops.py
.py
b8ee7d3c14936d2b
7.59
14
"""Mixin for live Jupyter HTML updates while polling platform execution state. - :meth:`NotebookWatchMixin.watch` — by default ``await`` returns immediately with a background :class:`asyncio.Task` that updates the notebook display. - Pass ``blocking=True`` or set env :data:`~deeporigin.utils.constants.JOB_WATCH_BLOC...
deeporiginbio/do-dd-client
src/drug_discovery/notebook_watch_mixin.py
.py
c2abea593993bec9
7.59
14
"""Patent -- extract chemical structures from PDF documents via ``deeporigin.draco``.""" from __future__ import annotations from pathlib import Path from typing import Any, Self import uuid from beartype import beartype import pandas as pd from deeporigin.drug_discovery.execution import Execution from deeporigin.dr...
deeporiginbio/do-dd-client
src/drug_discovery/patent.py
.py
a019e0f895d99779
7.59
14
"""PocketFinder -- find binding pockets via synchronous or asynchronous execution. Sync usage (blocking, returns pockets directly):: pf = PocketFinder(protein) pf.run(quote=True) # populates pf.estimate; pf.status == "Quoted" pockets = pf.run() # blocking; calls get_results(); populates pf.cost Async...
deeporiginbio/do-dd-client
src/drug_discovery/pocket_finder.py
.py
08314174dbfc3907
7.59
14
"""Synchronous ligand protonation via ``client.executions.create``.""" from __future__ import annotations from typing import Any from beartype import beartype from rdkit import Chem from deeporigin.drug_discovery.execution import Execution from deeporigin.drug_discovery.execution_mixins import SyncExecutableMixin f...
deeporiginbio/do-dd-client
src/drug_discovery/protonation.py
.py
14bdd724209073c5
7.59
14
""" This module defines the Entity class for handling file uploads to a remote server in the context of drug discovery structures. The Entity class provides methods to manage file uploads, such as protein structure files, to a remote storage system using the DeepOrigin FilesClient. """ from abc import ABC, abstractme...
deeporiginbio/do-dd-client
src/drug_discovery/structures/entity.py
.py
86eca7d3c64bb3a2
7.59
14
"""SystemPrep -- sync-only execution for preparing a protein-pose system for ABFE or RBFE. Usage (ABFE):: sysprep = SystemPrep(protein=protein, pose=pose) sysprep.run(quote=True) # populates sysprep.estimate; status == "Quoted" prepared = sysprep.run() # returns PreparedSystem via get_results() # U...
deeporiginbio/do-dd-client
src/drug_discovery/system_prep.py
.py
e4c65d93920f4778
7.59
14
"""Utility functions for the Drug Discovery module""" import importlib.resources import json from typing import Any from beartype import beartype from deeporigin.drug_discovery.utils.visualize import ( render_smiles_in_dataframe, # noqa: F401 ) @beartype def _load_params(param_file: str) -> dict: """load ...
deeporiginbio/do-dd-client
src/drug_discovery/utils/__init__.py
.py
d609e551cedcd5c3
7.59
14
import base64 import logging import os import re import subprocess import sys import tempfile import xml.etree.ElementTree as ET # ruff: ignore[suspicious-xml-etree-import] import boto3 import botocore import requests from iterfzf import iterfzf from pyquery import PyQuery as pq # ruff: ignore[camelcase-imported-as-...
app-sre/rh-aws-saml-login
rh_aws_saml_login/_core.py
.py
654859bffb7f3068
7.65
19
"""Tests for the core module.""" # ruff: file-ignore[import-private-name] import base64 from collections.abc import Callable from pathlib import Path import pytest from requests_mock import Mocker as RequestsMocker from rh_aws_saml_login._core import get_aws_accounts, get_saml_auth, select_aws_account from rh_aws_sa...
app-sre/rh-aws-saml-login
tests/test_core.py
.py
37e4ced94377484f
7.15
19
"""Test all public API methods are available.""" # ruff: file-ignore[undocumented-public-function, import-outside-top-level] from dataclasses import is_dataclass def test_public_get_aws_credentials() -> None: from rh_aws_saml_login import get_aws_credentials assert callable(get_aws_credentials) def test_p...
app-sre/rh-aws-saml-login
tests/test_public.py
.py
ab315e1cd356a838
8.15
19
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. import os import shutil from datetime import datetime, timezone from typing import Any from hatchling.builders.hooks.plugin.interface import BuildHookInterface class HatchCustomBuildHook(BuildHookInterface): """ This class implements Hatch'...
aws-deadline/deadline-cloud-for-cinema-4d
hatch_custom_hook.py
.py
b0926072d8fe64f5
7.63
17
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. """Script to create platform-specific Deadline Client installers using InstallBuilder.""" import os import shutil import sys import tempfile from pathlib import Path from common import EvaluationBuildError, get_version_string, run from deps_bundle i...
aws-deadline/deadline-cloud-for-cinema-4d
scripts/build_installer.py
.py
88744fe108d30bfa
7.63
17
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. """ Utility script to extract and clean Redshift debug logs from Cinema 4D detailed log files. This script extracts HTML Redshift debug logs from Cinema 4D detailed log files and removes timestamp prefixes to make them easier to read and compare. It'...
aws-deadline/deadline-cloud-for-cinema-4d
scripts/clean_redshift_detailed_logs.py
.py
9b876142376327d7
7.63
17
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. from __future__ import annotations import fnmatch import re import shutil import subprocess from pathlib import Path from tempfile import TemporaryDirectory from typing import Any from _project import Dependency, get_dependencies, get_project_dict ...
aws-deadline/deadline-cloud-for-cinema-4d
scripts/deps_bundle.py
.py
9d614d9aee8f6333
7.63
17
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. from __future__ import annotations import os import sys from types import FrameType # The Cinema4D Adaptor adds the `openjd` namespace directory to PYTHONPATH, # so that importing just the adaptor_runtime_client should work. try: from adaptor_r...
aws-deadline/deadline-cloud-for-cinema-4d
src/deadline/cinema4d_adaptor/Cinema4DClient/cinema4d_client.py
.py
7bbed521dc6780ac
7.63
17
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. """OCIO view-transform baking for non-tile renders. Works around a Cinema 4D SDK bug: ``RenderDocument``'s internal save does not apply the OCIO View Transform, so ordinary (non-tile) renders to 8-bit display formats are written un-tone-mapped (dark/...
aws-deadline/deadline-cloud-for-cinema-4d
src/deadline/cinema4d_adaptor/Cinema4DClient/ocio_bake.py
.py
e4d80864cc976974
7.63
17
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. from __future__ import annotations import os from dataclasses import dataclass from typing import Any try: import c4d # type: ignore from c4d import bitmaps except ImportError: # pragma: no cover raise OSError("Could not find the Cinem...
aws-deadline/deadline-cloud-for-cinema-4d
src/deadline/cinema4d_adaptor/Cinema4DClient/tile_rendering.py
.py
807a1f3ca8876178
7.63
17
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. from __future__ import annotations import logging import re from pathlib import Path import c4d from .font_utils import FONTS_DIR, copy_font_to_scene_folder, is_asset_a_font from .path_validator import validate_asset_paths from .platform_utils impo...
aws-deadline/deadline-cloud-for-cinema-4d
src/deadline/cinema4d_submitter/assets.py
.py
5c96de7922429652
7.63
17
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. """Find and print Cinema 4D and Redshift log files after rendering.""" import os import shutil import sys from pathlib import Path # Constants C4D_DETAILED_LOG_FILENAME = "c4d_detailed_logs.txt" C4D_SECURE_TEMP_DIR_ENV_VAR = "C4D_DETAILED_LOG_DIR" C...
aws-deadline/deadline-cloud-for-cinema-4d
src/deadline/cinema4d_submitter/detailed_logging_scripts/print_logs.py
.py
63c90cf9d9b64a9d
7.63
17
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. """Configure environment variables for Cinema 4D detailed logging.""" import os import sys import tempfile # Constants C4D_DETAILED_LOG_FILENAME = "c4d_detailed_logs.txt" C4D_SECURE_TEMP_DIR_ENV_VAR = "C4D_DETAILED_LOG_DIR" CONDA_PREFIX_ENV_VAR = "C...
aws-deadline/deadline-cloud-for-cinema-4d
src/deadline/cinema4d_submitter/detailed_logging_scripts/setup_logging.py
.py
b774388e65489da8
7.63
17
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. import logging import os import shutil from dataclasses import dataclass from pathlib import Path from typing import Any import c4d from .platform_utils import is_windows from .warning_logging_handler import WarningCollectorHandler FONTS_DIR = "fo...
aws-deadline/deadline-cloud-for-cinema-4d
src/deadline/cinema4d_submitter/font_utils.py
.py
0363768aca685a35
7.63
17
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. """ Platform utility functions for cross-platform compatibility. """ import sys def is_windows() -> bool: """Check if running on Windows.""" return sys.platform == "win32" def is_macos() -> bool: """Check if running on macOS.""" ...
aws-deadline/deadline-cloud-for-cinema-4d
src/deadline/cinema4d_submitter/platform_utils.py
.py
f877449848dc6972
7.13
17
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. from __future__ import annotations from copy import deepcopy from typing import Any from ._yaml_utils import _build_embedded_yaml from .data_classes import RenderSubmitterUISettings def build_tile_task_parameters(tiles_columns: int, tiles_rows: in...
aws-deadline/deadline-cloud-for-cinema-4d
src/deadline/cinema4d_submitter/tile_utils.py
.py
72d6400669f00b8b
7.63
17
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. import os from qtpy.QtCore import QSize, Qt # type: ignore from qtpy.QtWidgets import ( # type: ignore QCheckBox, QComboBox, QFileDialog, QGridLayout, QGroupBox, QHBoxLayout, QLabel, QLineEdit, QPushButton, Q...
aws-deadline/deadline-cloud-for-cinema-4d
src/deadline/cinema4d_submitter/ui/components/scene_settings_tab.py
.py
95e59e4cfe67ef33
7.63
17
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. from qtpy.QtWidgets import ( QDialog, QHBoxLayout, QLabel, QPushButton, QTextEdit, QVBoxLayout, ) from ...style import HEADER_LABEL_STYLE class SubmissionWarningDialog(QDialog): """ Dialog to display warnings to us...
aws-deadline/deadline-cloud-for-cinema-4d
src/deadline/cinema4d_submitter/ui/components/submission_warning_dialog.py
.py
3591939ce42aac77
7.63
17
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. """Utilities for checking and displaying update notifications.""" import logging from dataclasses import dataclass from deadline.client.api import UpdateCheckResult, UpdateCheckStatus, safe_check_for_updates from deadline.client.ui.dialogs.update_a...
aws-deadline/deadline-cloud-for-cinema-4d
src/deadline/cinema4d_submitter/update_utils.py
.py
a3af6cc081d910dc
7.63
17
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. class WarningCollector: """ Collects warnings during asset processing to display them to users. """ def __init__(self): self._warnings: list[str] = [] def add_warning(self, warning_message: str): """Add a warnin...
aws-deadline/deadline-cloud-for-cinema-4d
src/deadline/cinema4d_submitter/warning_collector.py
.py
a326387ea3429b2a
7.63
17
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. import logging from .warning_collector import warning_collector class WarningCollectorHandler(logging.Handler): """ Custom logging handler that automatically adds warning messages to the warning collector. """ def emit(self, recor...
aws-deadline/deadline-cloud-for-cinema-4d
src/deadline/cinema4d_submitter/warning_logging_handler.py
.py
d96c3f3a125d69a5
7.63
17
"""Update checker for SRR — stdlib only, no new dependencies.""" import asyncio import json import logging import urllib.error import urllib.request from typing import Optional from version import __version__ LATEST_RELEASE_URL = "https://github.com/Mefgner/Smart-Refresh-Rate/releases/latest" RELEASES_API_URL = "htt...
Mefgner/Smart-Refresh-Rate
update_check.py
.py
880aa688dc909d24
7.42
6
#!/usr/bin/env python3 import os import subprocess import sys from pathlib import Path def find_project_root(start_dir: Path, cli_rel_path: str) -> Path: """Traverse upward from start_dir to find a directory containing cli_rel_path.""" current = start_dir.resolve() root = Path(current.root) while curr...
matthewhand/open-swarm
scripts/codey_py_entry.py
.py
5c2f129989634e6c
7.63
17
#!/usr/bin/env python3 """ Auto-generates a markdown table of all blueprints and their metadata for the README. Run this after adding or updating any blueprint metadata. """ import glob import importlib.util import inspect import os import sys REPO_ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) REA...
matthewhand/open-swarm
scripts/gen_blueprint_table.py
.py
3e79c757a32c108e
7.63
17
#!/usr/bin/env python3 """ Marker-driven exact paste for USERGUIDE.md (and README.md). Insert before a ```text block: <!-- from-scratch: wizard-capture.txt --> ```text ...old... ``` It replaces the body with exact content of $SCRATCH/wizard-capture.txt (stripped? but keep structure). Run after fresh captures, before t...
matthewhand/open-swarm
scripts/paste_userguide_from_scratch.py
.py
093412c251cb4973
7.63
17
#!/usr/bin/env python3 """Prove every available CLI works across every framework permutation. Discovers the installed catalog CLIs and exercises them LIVE through each blueprint/consensus mode, printing a PASS/FAIL matrix with verbatim output. Run: DJANGO_DEBUG=true python scripts/prove_cli_permutations.py """ impor...
matthewhand/open-swarm
scripts/prove_cli_permutations.py
.py
8d63b7d0b44c878a
7.63
17
#!/usr/bin/env python3 """Render docs/demo/cli-and-api.gif — the README terminal demo. The GIF shows the core differentiator: ONE blueprint (zeus) runs as a local CLI command AND answers via the OpenAI-compatible HTTP API. Honesty rule: every output line shown in the animation is a genuine capture (see docs/demo/capt...
matthewhand/open-swarm
scripts/render_demo_gif.py
.py
256dafaa3496f4ae
7.63
17
#!/usr/bin/env python3 """ Run pytest in a stable way across environments: - Disable auto plugin autoload (blocks problematic global plugins) - Explicitly enable required plugins: pytest-django, pytest-asyncio, pytest-mock Usage: python scripts/run_tests.py [pytest args] # or ./scripts/run_tests.py -q """ import...
matthewhand/open-swarm
scripts/run_tests.py
.py
1252552cc3b9ec0f
7.13
17
#!/usr/bin/env python """Parallel stress-test harness for the Open Swarm test suite. Ported from archive/local-main-2025-04 (swarm_nuclear_scale.py). Spawns many concurrent, staggered pytest runs of the same target to flush out flaky tests, shared-state bugs, and resource contention. Uses only the stdlib plus pytest. ...
matthewhand/open-swarm
scripts/stress_test_suite.py
.py
dfec2e93831a8b70
8.13
17
import logging import logging.config import os # Import os from django.apps import AppConfig # Import Django settings and logging config from django.conf import settings logger = logging.getLogger(__name__) class SwarmConfig(AppConfig): default_auto_field = 'django.db.models.BigAutoField' name = 'swarm' ...
matthewhand/open-swarm
src/swarm/apps.py
.py
cdcd74683607e026
7.63
17
import asyncio import logging import os import sys from pathlib import Path from typing import Any, ClassVar from dotenv import load_dotenv load_dotenv(override=True) # Set logging to WARNING by default unless SWARM_DEBUG=1 if not os.environ.get("SWARM_DEBUG"): logging.basicConfig(level=logging.WARNING) else: ...
matthewhand/open-swarm
src/swarm/blueprints/chatbot/blueprint_chatbot.py
.py
f5800d17b4a82dde
7.63
17
""" Chucks Angels Blueprint """ from collections.abc import AsyncGenerator from typing import Any from swarm.core.blueprint_base import BlueprintBase # Import the base class class ChucksAngelsBlueprint(BlueprintBase): # Inherit from BlueprintBase """ Blueprint for Chucks Angels. Coordinates angelic tasks, C...
matthewhand/open-swarm
src/swarm/blueprints/chucks_angels/blueprint_chucks_angels.py
.py
33bb22af9f7f6bb2
7.63
17
"""CLI Agent blueprint — expose a single configured agentic CLI over the OpenAI-compatible API. This is the minimal drop-in: a request to ``model: "cli_agent"`` runs one configured CLI (``claude``, ``gemini``, ...) one-shot and streams its answer back as a normal chat completion. Which CLI runs is chosen by (in order)...
matthewhand/open-swarm
src/swarm/blueprints/cli_agent/blueprint_cli_agent.py
.py
37cf2a8fa68f56b2
7.63
17
"""CLI Orchestrator blueprint — granular consensus. The prototype of "fusion as a composable primitive". A cheap **router** CLI runs a single inference and answers directly; when it judges the question high-stakes (correctness-critical, security/production, contested) it *escalates that one question* to a cross-model ...
matthewhand/open-swarm
src/swarm/blueprints/cli_orchestrator/blueprint_cli_orchestrator.py
.py
5e5eedbe8d3df445
7.63
17
"""CLI Pipeline blueprint — sequential refinement. The sequential complement to ``cli_fusion``. Where fusion sends the *same* prompt to a panel **in parallel** and finds consensus, pipeline chains CLIs **in order**: each stage refines the previous stage's output. Different backends play to their strengths in sequence ...
matthewhand/open-swarm
src/swarm/blueprints/cli_pipeline/blueprint_cli_pipeline.py
.py
8129811989c0a342
7.63
17
"""CLI Planner blueprint — Magentic-One-style ledger. A planner CLI maintains a *task ledger*: it drafts an initial plan, delegates subtasks to specialist worker CLIs one at a time, inspects each result, and **re-plans on stall** — adding follow-up subtasks until the goal is met or a round budget is exhausted — then s...
matthewhand/open-swarm
src/swarm/blueprints/cli_planner/blueprint_cli_planner.py
.py
37d07e9b2657d2d5
7.63
17
"""Shared helpers for the CLI-agent blueprints (``cli_agent`` and ``cli_fusion``). Keeps prompt rendering, adapter-registry construction, panelist selection, and the chunk shapes blueprints yield in one place so the single-CLI and fusion blueprints stay consistent. """ from __future__ import annotations import loggi...
matthewhand/open-swarm
src/swarm/blueprints/common/cli_fusion_support.py
.py
f6d81af13e797982
7.63
17