repo
stringlengths
7
90
file_url
stringlengths
81
315
file_path
stringlengths
4
228
content
stringlengths
0
32.8k
language
stringclasses
1 value
license
stringclasses
7 values
commit_sha
stringlengths
40
40
retrieved_at
stringdate
2026-01-04 14:38:15
2026-01-05 02:33:18
truncated
bool
2 classes
roostorg/osprey
https://github.com/roostorg/osprey/blob/5c1f999c156b420043be7efdd472c8e31096bfb5/osprey_worker/src/osprey/engine/stdlib/udfs/string_hashes.py
osprey_worker/src/osprey/engine/stdlib/udfs/string_hashes.py
from hashlib import md5, sha1, sha256, sha512 from ._prelude import ArgumentsBase, ExecutionContext, UDFBase from .categories import UdfCategories class Arguments(ArgumentsBase): input: str # Use usedforsecurity=False in 3.9+, md5 is insecure but we're not using this in a security context. class HashMd5(UDFBas...
python
Apache-2.0
5c1f999c156b420043be7efdd472c8e31096bfb5
2026-01-05T07:11:51.519046Z
false
roostorg/osprey
https://github.com/roostorg/osprey/blob/5c1f999c156b420043be7efdd472c8e31096bfb5/osprey_worker/src/osprey/engine/stdlib/udfs/experiments.py
osprey_worker/src/osprey/engine/stdlib/udfs/experiments.py
from __future__ import annotations from decimal import Decimal from enum import Enum from math import floor from typing import Any, Dict, List, Optional, Tuple, Type import mmh3 # type: ignore from osprey.engine.ast import grammar from osprey.engine.ast_validator.validation_utils import add_must_assign_to_variable_e...
python
Apache-2.0
5c1f999c156b420043be7efdd472c8e31096bfb5
2026-01-05T07:11:51.519046Z
false
roostorg/osprey
https://github.com/roostorg/osprey/blob/5c1f999c156b420043be7efdd472c8e31096bfb5/osprey_worker/src/osprey/engine/stdlib/udfs/rules.py
osprey_worker/src/osprey/engine/stdlib/udfs/rules.py
import re from typing import List, Optional, cast from osprey.engine.ast import grammar from osprey.engine.ast_validator.validation_utils import add_must_assign_to_variable_error from osprey.engine.executor.node_executor.call_executor import CallExecutor from osprey.engine.language_types.effects import EffectBase from...
python
Apache-2.0
5c1f999c156b420043be7efdd472c8e31096bfb5
2026-01-05T07:11:51.519046Z
false
roostorg/osprey
https://github.com/roostorg/osprey/blob/5c1f999c156b420043be7efdd472c8e31096bfb5/osprey_worker/src/osprey/engine/stdlib/udfs/list_sort.py
osprey_worker/src/osprey/engine/stdlib/udfs/list_sort.py
from typing import Any, List from ._prelude import ArgumentsBase, ExecutionContext, UDFBase from .categories import UdfCategories class Arguments(ArgumentsBase): list: List[Any] reverse: bool = False class ListSort(UDFBase[Arguments, List[Any]]): """Returns a sorted list.""" category = UdfCategori...
python
Apache-2.0
5c1f999c156b420043be7efdd472c8e31096bfb5
2026-01-05T07:11:51.519046Z
false
roostorg/osprey
https://github.com/roostorg/osprey/blob/5c1f999c156b420043be7efdd472c8e31096bfb5/osprey_worker/src/osprey/engine/stdlib/udfs/list_length.py
osprey_worker/src/osprey/engine/stdlib/udfs/list_length.py
from typing import Any, List from ._prelude import ArgumentsBase, ExecutionContext, UDFBase from .categories import UdfCategories class Arguments(ArgumentsBase): list: List[Any] class ListLength(UDFBase[Arguments, int]): """Returns the length of a list.""" category = UdfCategories.ENGINE def exec...
python
Apache-2.0
5c1f999c156b420043be7efdd472c8e31096bfb5
2026-01-05T07:11:51.519046Z
false
roostorg/osprey
https://github.com/roostorg/osprey/blob/5c1f999c156b420043be7efdd472c8e31096bfb5/osprey_worker/src/osprey/engine/stdlib/udfs/time_since.py
osprey_worker/src/osprey/engine/stdlib/udfs/time_since.py
from datetime import timedelta, timezone from dateutil import parser from osprey.engine.language_types.time_delta import TimeDeltaT from ._prelude import ArgumentsBase, ExecutionContext, UDFBase from .categories import UdfCategories _ZERO_TIMEDELTA = timedelta() class Arguments(ArgumentsBase): timestamp: str ...
python
Apache-2.0
5c1f999c156b420043be7efdd472c8e31096bfb5
2026-01-05T07:11:51.519046Z
false
roostorg/osprey
https://github.com/roostorg/osprey/blob/5c1f999c156b420043be7efdd472c8e31096bfb5/osprey_worker/src/osprey/engine/stdlib/udfs/import_.py
osprey_worker/src/osprey/engine/stdlib/udfs/import_.py
import typing from collections import defaultdict from osprey.engine.ast import ast_utils, grammar, printer from ._prelude import ArgumentsBase, ConstExpr, ExecutionContext, Source, UDFBase, ValidationContext class Arguments(ArgumentsBase): rules: ConstExpr[typing.List[str]] """A list of rule files to Inclu...
python
Apache-2.0
5c1f999c156b420043be7efdd472c8e31096bfb5
2026-01-05T07:11:51.519046Z
false
roostorg/osprey
https://github.com/roostorg/osprey/blob/5c1f999c156b420043be7efdd472c8e31096bfb5/osprey_worker/src/osprey/engine/stdlib/udfs/_prelude.py
osprey_worker/src/osprey/engine/stdlib/udfs/_prelude.py
from osprey.engine.ast.grammar import Source from osprey.engine.ast_validator.validation_context import ValidationContext from osprey.engine.executor.execution_context import ExecutionContext from osprey.engine.udf.arguments import ArgumentsBase, ConstExpr from osprey.engine.udf.base import UDFBase __all__ = [ 'So...
python
Apache-2.0
5c1f999c156b420043be7efdd472c8e31096bfb5
2026-01-05T07:11:51.519046Z
false
roostorg/osprey
https://github.com/roostorg/osprey/blob/5c1f999c156b420043be7efdd472c8e31096bfb5/osprey_worker/src/osprey/engine/stdlib/udfs/json_utils.py
osprey_worker/src/osprey/engine/stdlib/udfs/json_utils.py
from typing import Any, Dict, TypeVar from jsonpath_rw import JSONPath, parse from osprey.engine.executor.execution_context import ExpectedUdfException from osprey.engine.udf.arguments import ConstExpr from osprey.engine.udf.rvalue_type_checker import RValueTypeChecker from osprey.engine.udf.type_helpers import to_dis...
python
Apache-2.0
5c1f999c156b420043be7efdd472c8e31096bfb5
2026-01-05T07:11:51.519046Z
false
roostorg/osprey
https://github.com/roostorg/osprey/blob/5c1f999c156b420043be7efdd472c8e31096bfb5/osprey_worker/src/osprey/engine/stdlib/udfs/require.py
osprey_worker/src/osprey/engine/stdlib/udfs/require.py
from osprey.engine.ast import grammar from ._prelude import ArgumentsBase, ExecutionContext, UDFBase, ValidationContext from .categories import UdfCategories class Arguments(ArgumentsBase): rule: str """The relative path to a *.sml rule file.""" require_if: bool = True """Optional: Only include the s...
python
Apache-2.0
5c1f999c156b420043be7efdd472c8e31096bfb5
2026-01-05T07:11:51.519046Z
false
roostorg/osprey
https://github.com/roostorg/osprey/blob/5c1f999c156b420043be7efdd472c8e31096bfb5/osprey_worker/src/osprey/engine/stdlib/udfs/extract_cookie.py
osprey_worker/src/osprey/engine/stdlib/udfs/extract_cookie.py
from http.cookies import BaseCookie from osprey.engine.executor.execution_context import ExpectedUdfException from ._prelude import ArgumentsBase, ConstExpr, ExecutionContext, UDFBase from .categories import UdfCategories class Arguments(ArgumentsBase): header: str """A header string to extract a cookie fro...
python
Apache-2.0
5c1f999c156b420043be7efdd472c8e31096bfb5
2026-01-05T07:11:51.519046Z
false
roostorg/osprey
https://github.com/roostorg/osprey/blob/5c1f999c156b420043be7efdd472c8e31096bfb5/osprey_worker/src/osprey/engine/stdlib/udfs/email_local_part.py
osprey_worker/src/osprey/engine/stdlib/udfs/email_local_part.py
from osprey.engine.executor.execution_context import ExpectedUdfException from ._prelude import ArgumentsBase, ExecutionContext, UDFBase from .categories import UdfCategories class Arguments(ArgumentsBase): email: str class EmailLocalPart(UDFBase[Arguments, str]): """Returns the local part of an email addr...
python
Apache-2.0
5c1f999c156b420043be7efdd472c8e31096bfb5
2026-01-05T07:11:51.519046Z
false
roostorg/osprey
https://github.com/roostorg/osprey/blob/5c1f999c156b420043be7efdd472c8e31096bfb5/osprey_worker/src/osprey/engine/stdlib/udfs/categories.py
osprey_worker/src/osprey/engine/stdlib/udfs/categories.py
from enum import Enum # this needs to be combed thru class UdfCategories(str, Enum): DATETIME = 'Datetime' DNS = 'DNS' EMAIL = 'Email' ENCODING = 'Encoding' ENGINE = 'Engine' ENTITY = 'Entity' HASH = 'Hash' HTTP = 'HTTP' IP = 'IP' PHONE = 'Phone' RANDOM = 'Random' STRIN...
python
Apache-2.0
5c1f999c156b420043be7efdd472c8e31096bfb5
2026-01-05T07:11:51.519046Z
false
roostorg/osprey
https://github.com/roostorg/osprey/blob/5c1f999c156b420043be7efdd472c8e31096bfb5/osprey_worker/src/osprey/engine/stdlib/udfs/__init__.py
osprey_worker/src/osprey/engine/stdlib/udfs/__init__.py
python
Apache-2.0
5c1f999c156b420043be7efdd472c8e31096bfb5
2026-01-05T07:11:51.519046Z
false
roostorg/osprey
https://github.com/roostorg/osprey/blob/5c1f999c156b420043be7efdd472c8e31096bfb5/osprey_worker/src/osprey/engine/stdlib/udfs/string_base64.py
osprey_worker/src/osprey/engine/stdlib/udfs/string_base64.py
from base64 import b64decode, b64encode from ._prelude import ArgumentsBase, ExecutionContext, UDFBase from .categories import UdfCategories class Arguments(ArgumentsBase): input: str class Base64Encode(UDFBase[Arguments, str]): """Encodes a string in Base 64.""" category = UdfCategories.ENCODING ...
python
Apache-2.0
5c1f999c156b420043be7efdd472c8e31096bfb5
2026-01-05T07:11:51.519046Z
false
roostorg/osprey
https://github.com/roostorg/osprey/blob/5c1f999c156b420043be7efdd472c8e31096bfb5/osprey_worker/src/osprey/engine/stdlib/udfs/ip_network.py
osprey_worker/src/osprey/engine/stdlib/udfs/ip_network.py
from ipaddress import AddressValueError, IPv4Address, IPv6Address from osprey.worker.lib.utils.ip_address import is_v4, is_v6 from ._prelude import ArgumentsBase, ExecutionContext, UDFBase from .categories import UdfCategories class Arguments(ArgumentsBase): ip: str class IpNetwork(UDFBase[Arguments, str]): ...
python
Apache-2.0
5c1f999c156b420043be7efdd472c8e31096bfb5
2026-01-05T07:11:51.519046Z
false
roostorg/osprey
https://github.com/roostorg/osprey/blob/5c1f999c156b420043be7efdd472c8e31096bfb5/osprey_worker/src/osprey/engine/stdlib/udfs/random_bool.py
osprey_worker/src/osprey/engine/stdlib/udfs/random_bool.py
import random from ._prelude import ArgumentsBase, ConstExpr, ExecutionContext, UDFBase, ValidationContext from .categories import UdfCategories class Arguments(ArgumentsBase): percentage: ConstExpr[float] class RandomBool(UDFBase[Arguments, bool]): """Randomly returns `True` with `percentage` chance.""" ...
python
Apache-2.0
5c1f999c156b420043be7efdd472c8e31096bfb5
2026-01-05T07:11:51.519046Z
false
roostorg/osprey
https://github.com/roostorg/osprey/blob/5c1f999c156b420043be7efdd472c8e31096bfb5/osprey_worker/src/osprey/engine/stdlib/udfs/entity.py
osprey_worker/src/osprey/engine/stdlib/udfs/entity.py
from typing import TypeVar from osprey.engine.language_types.entities import EntityT from osprey.engine.language_types.osprey_invariant_generic import OspreyInvariantGeneric from osprey.engine.udf.rvalue_type_checker import EntityTypeChecker, RValueTypeChecker from osprey.engine.utils.types import cached_property fro...
python
Apache-2.0
5c1f999c156b420043be7efdd472c8e31096bfb5
2026-01-05T07:11:51.519046Z
false
roostorg/osprey
https://github.com/roostorg/osprey/blob/5c1f999c156b420043be7efdd472c8e31096bfb5/osprey_worker/src/osprey/engine/stdlib/udfs/resolve_optional.py
osprey_worker/src/osprey/engine/stdlib/udfs/resolve_optional.py
from typing import Optional, TypeVar from osprey.engine.executor.execution_context import ExpectedUdfException from osprey.engine.language_types.osprey_invariant_generic import OspreyInvariantGeneric from ._prelude import ArgumentsBase, ConstExpr, ExecutionContext, UDFBase _T = TypeVar('_T') class Arguments(Osprey...
python
Apache-2.0
5c1f999c156b420043be7efdd472c8e31096bfb5
2026-01-05T07:11:51.519046Z
false
roostorg/osprey
https://github.com/roostorg/osprey/blob/5c1f999c156b420043be7efdd472c8e31096bfb5/osprey_worker/src/osprey/engine/stdlib/udfs/mx_lookup.py
osprey_worker/src/osprey/engine/stdlib/udfs/mx_lookup.py
from dns.resolver import NXDOMAIN, YXDOMAIN, LRUCache, NoAnswer, NoNameservers, Resolver from osprey.engine.executor.execution_context import ExpectedUdfException from ._prelude import ArgumentsBase, ExecutionContext, UDFBase from .categories import UdfCategories resolver = Resolver() resolver.cache = LRUCache(max_si...
python
Apache-2.0
5c1f999c156b420043be7efdd472c8e31096bfb5
2026-01-05T07:11:51.519046Z
false
roostorg/osprey
https://github.com/roostorg/osprey/blob/5c1f999c156b420043be7efdd472c8e31096bfb5/osprey_worker/src/osprey/engine/stdlib/udfs/phone_prefix.py
osprey_worker/src/osprey/engine/stdlib/udfs/phone_prefix.py
from osprey.engine.executor.execution_context import ExpectedUdfException from ._prelude import ArgumentsBase, ExecutionContext, UDFBase from .categories import UdfCategories class Arguments(ArgumentsBase): phone_number: str class PhonePrefix(UDFBase[Arguments, str]): """ Returns all but the last 4 num...
python
Apache-2.0
5c1f999c156b420043be7efdd472c8e31096bfb5
2026-01-05T07:11:51.519046Z
false
roostorg/osprey
https://github.com/roostorg/osprey/blob/5c1f999c156b420043be7efdd472c8e31096bfb5/osprey_worker/src/osprey/engine/stdlib/udfs/domain_tld.py
osprey_worker/src/osprey/engine/stdlib/udfs/domain_tld.py
from typing import cast from osprey.engine.executor.execution_context import ExpectedUdfException from tld import get_tld from ._prelude import ArgumentsBase, ExecutionContext, UDFBase from .categories import UdfCategories class Arguments(ArgumentsBase): domain: str class DomainTld(UDFBase[Arguments, str]): ...
python
Apache-2.0
5c1f999c156b420043be7efdd472c8e31096bfb5
2026-01-05T07:11:51.519046Z
false
roostorg/osprey
https://github.com/roostorg/osprey/blob/5c1f999c156b420043be7efdd472c8e31096bfb5/osprey_worker/src/osprey/engine/stdlib/udfs/time_delta.py
osprey_worker/src/osprey/engine/stdlib/udfs/time_delta.py
from datetime import timedelta from osprey.engine.language_types.time_delta import TimeDeltaT from ._prelude import ArgumentsBase, ConstExpr, ExecutionContext, UDFBase from .categories import UdfCategories class Arguments(ArgumentsBase): weeks: ConstExpr[int] = ConstExpr.for_default('weeks', 0) days: ConstE...
python
Apache-2.0
5c1f999c156b420043be7efdd472c8e31096bfb5
2026-01-05T07:11:51.519046Z
false
roostorg/osprey
https://github.com/roostorg/osprey/blob/5c1f999c156b420043be7efdd472c8e31096bfb5/osprey_worker/src/osprey/engine/stdlib/udfs/email_domain.py
osprey_worker/src/osprey/engine/stdlib/udfs/email_domain.py
from typing import cast from osprey.engine.executor.execution_context import ExpectedUdfException from tld import get_tld from ._prelude import ArgumentsBase, ExecutionContext, UDFBase from .categories import UdfCategories class Arguments(ArgumentsBase): email: str class EmailDomain(UDFBase[Arguments, str]): ...
python
Apache-2.0
5c1f999c156b420043be7efdd472c8e31096bfb5
2026-01-05T07:11:51.519046Z
false
roostorg/osprey
https://github.com/roostorg/osprey/blob/5c1f999c156b420043be7efdd472c8e31096bfb5/osprey_worker/src/osprey/engine/stdlib/udfs/phone_country.py
osprey_worker/src/osprey/engine/stdlib/udfs/phone_country.py
from osprey.engine.executor.execution_context import ExpectedUdfException from phone_iso3166.country import phone_country from phone_iso3166.errors import InvalidPhone from ._prelude import ArgumentsBase, ExecutionContext, UDFBase from .categories import UdfCategories class Arguments(ArgumentsBase): phone_number...
python
Apache-2.0
5c1f999c156b420043be7efdd472c8e31096bfb5
2026-01-05T07:11:51.519046Z
false
roostorg/osprey
https://github.com/roostorg/osprey/blob/5c1f999c156b420043be7efdd472c8e31096bfb5/osprey_worker/src/osprey/engine/stdlib/udfs/get_action_name.py
osprey_worker/src/osprey/engine/stdlib/udfs/get_action_name.py
from ._prelude import ArgumentsBase, ExecutionContext, UDFBase from .categories import UdfCategories class Arguments(ArgumentsBase): pass class GetActionName(UDFBase[Arguments, str]): """Returns the Action Name of the event being processed.""" category = UdfCategories.ENGINE def execute(self, exec...
python
Apache-2.0
5c1f999c156b420043be7efdd472c8e31096bfb5
2026-01-05T07:11:51.519046Z
false
roostorg/osprey
https://github.com/roostorg/osprey/blob/5c1f999c156b420043be7efdd472c8e31096bfb5/osprey_worker/src/osprey/engine/stdlib/udfs/tests/test_secret_data.py
osprey_worker/src/osprey/engine/stdlib/udfs/tests/test_secret_data.py
from typing import Any, Callable, Dict, List, Optional import pytest from osprey.engine.conftest import CheckFailureFunction, ExecuteFunction, RunValidationFunction from osprey.engine.stdlib.udfs.json_data import JsonData from osprey.engine.stdlib.udfs.string import StringClean, StringLength from osprey.engine.udf.reg...
python
Apache-2.0
5c1f999c156b420043be7efdd472c8e31096bfb5
2026-01-05T07:11:51.519046Z
false
roostorg/osprey
https://github.com/roostorg/osprey/blob/5c1f999c156b420043be7efdd472c8e31096bfb5/osprey_worker/src/osprey/engine/stdlib/udfs/tests/test_verdicts.py
osprey_worker/src/osprey/engine/stdlib/udfs/tests/test_verdicts.py
from typing import Any, Callable, List import pytest from osprey.engine.ast_validator.validators.feature_name_to_entity_type_mapping import ( FeatureNameToEntityTypeMapping, ) from osprey.engine.ast_validator.validators.unique_stored_names import UniqueStoredNames from osprey.engine.ast_validator.validators.valida...
python
Apache-2.0
5c1f999c156b420043be7efdd472c8e31096bfb5
2026-01-05T07:11:51.519046Z
false
roostorg/osprey
https://github.com/roostorg/osprey/blob/5c1f999c156b420043be7efdd472c8e31096bfb5/osprey_worker/src/osprey/engine/stdlib/udfs/tests/test_resolve_optional.py
osprey_worker/src/osprey/engine/stdlib/udfs/tests/test_resolve_optional.py
from typing import Any, Callable, List import pytest from osprey.engine.ast_validator.validators.imports_must_not_have_cycles import ImportsMustNotHaveCycles from osprey.engine.ast_validator.validators.unique_stored_names import UniqueStoredNames from osprey.engine.ast_validator.validators.validate_call_kwargs import ...
python
Apache-2.0
5c1f999c156b420043be7efdd472c8e31096bfb5
2026-01-05T07:11:51.519046Z
false
roostorg/osprey
https://github.com/roostorg/osprey/blob/5c1f999c156b420043be7efdd472c8e31096bfb5/osprey_worker/src/osprey/engine/stdlib/udfs/tests/test_string_hashes.py
osprey_worker/src/osprey/engine/stdlib/udfs/tests/test_string_hashes.py
import pytest from osprey.engine.conftest import ExecuteFunction from osprey.engine.stdlib.udfs.string_hashes import HashMd5, HashSha1, HashSha256, HashSha512 from osprey.engine.udf.registry import UDFRegistry pytestmark = [ pytest.mark.use_udf_registry(UDFRegistry.with_udfs(HashMd5, HashSha1, HashSha256, HashSha5...
python
Apache-2.0
5c1f999c156b420043be7efdd472c8e31096bfb5
2026-01-05T07:11:51.519046Z
false
roostorg/osprey
https://github.com/roostorg/osprey/blob/5c1f999c156b420043be7efdd472c8e31096bfb5/osprey_worker/src/osprey/engine/stdlib/udfs/tests/test_experiments.py
osprey_worker/src/osprey/engine/stdlib/udfs/tests/test_experiments.py
from typing import Any, Callable, List, Tuple from unittest import mock import pytest from osprey.engine.ast_validator.validators.unique_stored_names import UniqueStoredNames from osprey.engine.ast_validator.validators.validate_call_kwargs import ValidateCallKwargs from osprey.engine.conftest import CheckFailureFuncti...
python
Apache-2.0
5c1f999c156b420043be7efdd472c8e31096bfb5
2026-01-05T07:11:51.519046Z
false
roostorg/osprey
https://github.com/roostorg/osprey/blob/5c1f999c156b420043be7efdd472c8e31096bfb5/osprey_worker/src/osprey/engine/stdlib/udfs/tests/test_json_data.py
osprey_worker/src/osprey/engine/stdlib/udfs/tests/test_json_data.py
from typing import Any, Callable, List import pytest from osprey.engine.ast_validator.validators.unique_stored_names import UniqueStoredNames from osprey.engine.ast_validator.validators.validate_call_kwargs import ValidateCallKwargs from osprey.engine.ast_validator.validators.validate_dynamic_calls_have_annotated_rval...
python
Apache-2.0
5c1f999c156b420043be7efdd472c8e31096bfb5
2026-01-05T07:11:51.519046Z
false
roostorg/osprey
https://github.com/roostorg/osprey/blob/5c1f999c156b420043be7efdd472c8e31096bfb5/osprey_worker/src/osprey/engine/stdlib/udfs/tests/test_time_delta.py
osprey_worker/src/osprey/engine/stdlib/udfs/tests/test_time_delta.py
import pytest from osprey.engine.conftest import ExecuteFunction from osprey.engine.stdlib.udfs.time_delta import TimeDelta from osprey.engine.udf.registry import UDFRegistry pytestmark = [ pytest.mark.use_udf_registry(UDFRegistry.with_udfs(TimeDelta)), ] def test_time_delta_post_execution_type(execute: ExecuteF...
python
Apache-2.0
5c1f999c156b420043be7efdd472c8e31096bfb5
2026-01-05T07:11:51.519046Z
false
roostorg/osprey
https://github.com/roostorg/osprey/blob/5c1f999c156b420043be7efdd472c8e31096bfb5/osprey_worker/src/osprey/engine/stdlib/udfs/tests/test_time_bucket.py
osprey_worker/src/osprey/engine/stdlib/udfs/tests/test_time_bucket.py
from typing import Any, Callable, List import pytest from osprey.engine.ast_validator.validators.unique_stored_names import UniqueStoredNames from osprey.engine.ast_validator.validators.validate_call_kwargs import ValidateCallKwargs from osprey.engine.conftest import CheckFailureFunction, ExecuteFunction, RunValidatio...
python
Apache-2.0
5c1f999c156b420043be7efdd472c8e31096bfb5
2026-01-05T07:11:51.519046Z
false
roostorg/osprey
https://github.com/roostorg/osprey/blob/5c1f999c156b420043be7efdd472c8e31096bfb5/osprey_worker/src/osprey/engine/stdlib/udfs/tests/test_extract_cookie.py
osprey_worker/src/osprey/engine/stdlib/udfs/tests/test_extract_cookie.py
from typing import Any, Callable, List import pytest from osprey.engine.ast_validator.validators.validate_call_kwargs import ValidateCallKwargs from osprey.engine.conftest import ExecuteFunction from osprey.engine.stdlib.udfs.extract_cookie import ExtractCookie from osprey.engine.stdlib.udfs.json_data import JsonData ...
python
Apache-2.0
5c1f999c156b420043be7efdd472c8e31096bfb5
2026-01-05T07:11:51.519046Z
false
roostorg/osprey
https://github.com/roostorg/osprey/blob/5c1f999c156b420043be7efdd472c8e31096bfb5/osprey_worker/src/osprey/engine/stdlib/udfs/tests/test_entity.py
osprey_worker/src/osprey/engine/stdlib/udfs/tests/test_entity.py
from typing import Any, Callable, List import pytest from osprey.engine.ast_validator.validators.unique_stored_names import UniqueStoredNames from osprey.engine.ast_validator.validators.validate_call_kwargs import ValidateCallKwargs from osprey.engine.conftest import ( CheckFailureFunction, ExecuteFunction, ...
python
Apache-2.0
5c1f999c156b420043be7efdd472c8e31096bfb5
2026-01-05T07:11:51.519046Z
false
roostorg/osprey
https://github.com/roostorg/osprey/blob/5c1f999c156b420043be7efdd472c8e31096bfb5/osprey_worker/src/osprey/engine/stdlib/udfs/tests/test_rules.py
osprey_worker/src/osprey/engine/stdlib/udfs/tests/test_rules.py
import dataclasses import json from datetime import datetime, timedelta from typing import Any, Callable, Dict, List, Mapping, Sequence import pytest from osprey.engine.ast_validator.validators.unique_stored_names import UniqueStoredNames from osprey.engine.ast_validator.validators.validate_call_kwargs import Validate...
python
Apache-2.0
5c1f999c156b420043be7efdd472c8e31096bfb5
2026-01-05T07:11:51.519046Z
false
roostorg/osprey
https://github.com/roostorg/osprey/blob/5c1f999c156b420043be7efdd472c8e31096bfb5/osprey_worker/src/osprey/engine/stdlib/udfs/tests/test_labels.py
osprey_worker/src/osprey/engine/stdlib/udfs/tests/test_labels.py
import json from datetime import datetime, timedelta, timezone from typing import Any, Callable, Dict, List, Optional, Sequence, Set import gevent import pytest from gevent.event import Event from gevent.pool import Pool from osprey.engine.ast_validator.validators.feature_name_to_entity_type_mapping import ( Featu...
python
Apache-2.0
5c1f999c156b420043be7efdd472c8e31096bfb5
2026-01-05T07:11:51.519046Z
false
roostorg/osprey
https://github.com/roostorg/osprey/blob/5c1f999c156b420043be7efdd472c8e31096bfb5/osprey_worker/src/osprey/engine/stdlib/udfs/tests/test_get_action_name.py
osprey_worker/src/osprey/engine/stdlib/udfs/tests/test_get_action_name.py
from typing import Any, Callable, List import pytest from osprey.engine.ast_validator.validators.validate_call_kwargs import ValidateCallKwargs from osprey.engine.conftest import ExecuteFunction from osprey.engine.stdlib.udfs.get_action_name import GetActionName from osprey.engine.udf.registry import UDFRegistry pyte...
python
Apache-2.0
5c1f999c156b420043be7efdd472c8e31096bfb5
2026-01-05T07:11:51.519046Z
false
roostorg/osprey
https://github.com/roostorg/osprey/blob/5c1f999c156b420043be7efdd472c8e31096bfb5/osprey_worker/src/osprey/engine/stdlib/udfs/tests/test_list_length.py
osprey_worker/src/osprey/engine/stdlib/udfs/tests/test_list_length.py
from typing import Any, List, Optional import pytest from osprey.engine.conftest import ExecuteFunction from osprey.engine.stdlib.udfs.list_length import ListLength from osprey.engine.udf.registry import UDFRegistry pytestmark = [pytest.mark.use_udf_registry(UDFRegistry.with_udfs(ListLength))] @pytest.mark.parametr...
python
Apache-2.0
5c1f999c156b420043be7efdd472c8e31096bfb5
2026-01-05T07:11:51.519046Z
false
roostorg/osprey
https://github.com/roostorg/osprey/blob/5c1f999c156b420043be7efdd472c8e31096bfb5/osprey_worker/src/osprey/engine/stdlib/udfs/tests/test_strings.py
osprey_worker/src/osprey/engine/stdlib/udfs/tests/test_strings.py
import string from dataclasses import dataclass from typing import Any, Callable, Dict, Iterable, List, Optional, Union, cast import pytest from osprey.engine.conftest import ExecuteFunction from osprey.engine.stdlib.udfs.string import ( StringClean, StringEndsWith, StringExtractDomains, StringExtractU...
python
Apache-2.0
5c1f999c156b420043be7efdd472c8e31096bfb5
2026-01-05T07:11:51.519046Z
false
roostorg/osprey
https://github.com/roostorg/osprey/blob/5c1f999c156b420043be7efdd472c8e31096bfb5/osprey_worker/src/osprey/engine/stdlib/udfs/tests/test_ip_network.py
osprey_worker/src/osprey/engine/stdlib/udfs/tests/test_ip_network.py
from ipaddress import AddressValueError from typing import Any, Callable, List import pytest from osprey.engine.ast_validator.validators.validate_call_kwargs import ValidateCallKwargs from osprey.engine.conftest import ExecuteFunction from osprey.engine.stdlib.udfs.ip_network import IpNetwork from osprey.engine.stdlib...
python
Apache-2.0
5c1f999c156b420043be7efdd472c8e31096bfb5
2026-01-05T07:11:51.519046Z
false
roostorg/osprey
https://github.com/roostorg/osprey/blob/5c1f999c156b420043be7efdd472c8e31096bfb5/osprey_worker/src/osprey/engine/stdlib/udfs/tests/test_regex_match.py
osprey_worker/src/osprey/engine/stdlib/udfs/tests/test_regex_match.py
from typing import Any, Callable, List, Optional import pytest from osprey.engine.ast_validator.validators.unique_stored_names import UniqueStoredNames from osprey.engine.ast_validator.validators.validate_call_kwargs import ValidateCallKwargs from osprey.engine.conftest import CheckFailureFunction, ExecuteFunction, Ru...
python
Apache-2.0
5c1f999c156b420043be7efdd472c8e31096bfb5
2026-01-05T07:11:51.519046Z
false
roostorg/osprey
https://github.com/roostorg/osprey/blob/5c1f999c156b420043be7efdd472c8e31096bfb5/osprey_worker/src/osprey/engine/stdlib/udfs/tests/test_mx_lookup.py
osprey_worker/src/osprey/engine/stdlib/udfs/tests/test_mx_lookup.py
from typing import Any, Callable, List from unittest.mock import MagicMock, patch import pytest from osprey.engine.ast_validator.validators.validate_call_kwargs import ValidateCallKwargs from osprey.engine.conftest import ExecuteFunction from osprey.engine.stdlib.udfs.mx_lookup import MXLookup from osprey.engine.udf.r...
python
Apache-2.0
5c1f999c156b420043be7efdd472c8e31096bfb5
2026-01-05T07:11:51.519046Z
false
roostorg/osprey
https://github.com/roostorg/osprey/blob/5c1f999c156b420043be7efdd472c8e31096bfb5/osprey_worker/src/osprey/engine/stdlib/udfs/tests/test_domain_tld.py
osprey_worker/src/osprey/engine/stdlib/udfs/tests/test_domain_tld.py
from typing import Any, Callable, List import pytest from osprey.engine.ast_validator.validators.validate_call_kwargs import ValidateCallKwargs from osprey.engine.conftest import ExecuteFunction from osprey.engine.stdlib.udfs.domain_tld import DomainTld from osprey.engine.udf.registry import UDFRegistry pytestmark: L...
python
Apache-2.0
5c1f999c156b420043be7efdd472c8e31096bfb5
2026-01-05T07:11:51.519046Z
false
roostorg/osprey
https://github.com/roostorg/osprey/blob/5c1f999c156b420043be7efdd472c8e31096bfb5/osprey_worker/src/osprey/engine/stdlib/udfs/tests/test_email_domain.py
osprey_worker/src/osprey/engine/stdlib/udfs/tests/test_email_domain.py
from typing import Dict, Optional import pytest from osprey.engine.ast_validator.validators.validate_call_kwargs import ValidateCallKwargs from osprey.engine.conftest import ExecuteFunction from osprey.engine.stdlib.udfs.email_domain import EmailDomain, EmailSubdomain from osprey.engine.stdlib.udfs.json_data import Js...
python
Apache-2.0
5c1f999c156b420043be7efdd472c8e31096bfb5
2026-01-05T07:11:51.519046Z
false
roostorg/osprey
https://github.com/roostorg/osprey/blob/5c1f999c156b420043be7efdd472c8e31096bfb5/osprey_worker/src/osprey/engine/stdlib/udfs/tests/test_random_int.py
osprey_worker/src/osprey/engine/stdlib/udfs/tests/test_random_int.py
from typing import Any, Callable, List import pytest from osprey.engine.ast_validator.validators.unique_stored_names import UniqueStoredNames from osprey.engine.ast_validator.validators.validate_call_kwargs import ValidateCallKwargs from osprey.engine.conftest import CheckFailureFunction, ExecuteFunction, RunValidatio...
python
Apache-2.0
5c1f999c156b420043be7efdd472c8e31096bfb5
2026-01-05T07:11:51.519046Z
false
roostorg/osprey
https://github.com/roostorg/osprey/blob/5c1f999c156b420043be7efdd472c8e31096bfb5/osprey_worker/src/osprey/engine/stdlib/udfs/tests/test_email_local_part.py
osprey_worker/src/osprey/engine/stdlib/udfs/tests/test_email_local_part.py
from typing import Any, Callable, List, Optional import pytest from osprey.engine.ast_validator.validators.validate_call_kwargs import ValidateCallKwargs from osprey.engine.conftest import ExecuteFunction from osprey.engine.stdlib.udfs.email_local_part import EmailLocalPart from osprey.engine.udf.registry import UDFRe...
python
Apache-2.0
5c1f999c156b420043be7efdd472c8e31096bfb5
2026-01-05T07:11:51.519046Z
false
roostorg/osprey
https://github.com/roostorg/osprey/blob/5c1f999c156b420043be7efdd472c8e31096bfb5/osprey_worker/src/osprey/engine/stdlib/udfs/tests/__init__.py
osprey_worker/src/osprey/engine/stdlib/udfs/tests/__init__.py
python
Apache-2.0
5c1f999c156b420043be7efdd472c8e31096bfb5
2026-01-05T07:11:51.519046Z
false
roostorg/osprey
https://github.com/roostorg/osprey/blob/5c1f999c156b420043be7efdd472c8e31096bfb5/osprey_worker/src/osprey/engine/stdlib/udfs/tests/test_domain_chopper.py
osprey_worker/src/osprey/engine/stdlib/udfs/tests/test_domain_chopper.py
from typing import Any, Callable, List import pytest from osprey.engine.ast_validator.validators.validate_call_kwargs import ValidateCallKwargs from osprey.engine.conftest import ExecuteFunction from osprey.engine.stdlib.udfs.domain_chopper import DomainChopper from osprey.engine.udf.registry import UDFRegistry pytes...
python
Apache-2.0
5c1f999c156b420043be7efdd472c8e31096bfb5
2026-01-05T07:11:51.519046Z
false
roostorg/osprey
https://github.com/roostorg/osprey/blob/5c1f999c156b420043be7efdd472c8e31096bfb5/osprey_worker/src/osprey/engine/stdlib/udfs/tests/test_list_sort.py
osprey_worker/src/osprey/engine/stdlib/udfs/tests/test_list_sort.py
from typing import Any, List, Optional import pytest from osprey.engine.conftest import ExecuteFunction from osprey.engine.stdlib.udfs.list_sort import ListSort from osprey.engine.udf.registry import UDFRegistry pytestmark = [pytest.mark.use_udf_registry(UDFRegistry.with_udfs(ListSort))] @pytest.mark.parametrize( ...
python
Apache-2.0
5c1f999c156b420043be7efdd472c8e31096bfb5
2026-01-05T07:11:51.519046Z
false
roostorg/osprey
https://github.com/roostorg/osprey/blob/5c1f999c156b420043be7efdd472c8e31096bfb5/osprey_worker/src/osprey/engine/stdlib/udfs/tests/test_require.py
osprey_worker/src/osprey/engine/stdlib/udfs/tests/test_require.py
from typing import Any, Callable, Dict, List, Optional import pytest from osprey.engine.ast_validator.validators.unique_stored_names import UniqueStoredNames from osprey.engine.ast_validator.validators.validate_call_kwargs import ValidateCallKwargs from osprey.engine.ast_validator.validators.validate_dynamic_calls_hav...
python
Apache-2.0
5c1f999c156b420043be7efdd472c8e31096bfb5
2026-01-05T07:11:51.519046Z
false
roostorg/osprey
https://github.com/roostorg/osprey/blob/5c1f999c156b420043be7efdd472c8e31096bfb5/osprey_worker/src/osprey/engine/stdlib/udfs/tests/test_string_base64.py
osprey_worker/src/osprey/engine/stdlib/udfs/tests/test_string_base64.py
import pytest from osprey.engine.conftest import ExecuteFunction from osprey.engine.stdlib.udfs.string_base64 import Base64Decode, Base64Encode from osprey.engine.udf.registry import UDFRegistry pytestmark = [ pytest.mark.use_udf_registry(UDFRegistry.with_udfs(Base64Encode, Base64Decode)), ] def test_string_base...
python
Apache-2.0
5c1f999c156b420043be7efdd472c8e31096bfb5
2026-01-05T07:11:51.519046Z
false
roostorg/osprey
https://github.com/roostorg/osprey/blob/5c1f999c156b420043be7efdd472c8e31096bfb5/osprey_worker/src/osprey/engine/stdlib/udfs/tests/test_list_read.py
osprey_worker/src/osprey/engine/stdlib/udfs/tests/test_list_read.py
from typing import Any, List, Optional import pytest from osprey.engine.conftest import ExecuteFunction from osprey.engine.stdlib.udfs.list_read import ListRead from osprey.engine.udf.registry import UDFRegistry pytestmark = [pytest.mark.use_udf_registry(UDFRegistry.with_udfs(ListRead))] @pytest.mark.parametrize( ...
python
Apache-2.0
5c1f999c156b420043be7efdd472c8e31096bfb5
2026-01-05T07:11:51.519046Z
false
roostorg/osprey
https://github.com/roostorg/osprey/blob/5c1f999c156b420043be7efdd472c8e31096bfb5/osprey_worker/src/osprey/engine/stdlib/udfs/tests/test_import.py
osprey_worker/src/osprey/engine/stdlib/udfs/tests/test_import.py
from typing import Any, Callable, List import pytest from osprey.engine.ast_validator.validators.imports_must_not_have_cycles import ImportsMustNotHaveCycles from osprey.engine.ast_validator.validators.unique_stored_names import UniqueStoredNames from osprey.engine.ast_validator.validators.validate_call_kwargs import ...
python
Apache-2.0
5c1f999c156b420043be7efdd472c8e31096bfb5
2026-01-05T07:11:51.519046Z
false
roostorg/osprey
https://github.com/roostorg/osprey/blob/5c1f999c156b420043be7efdd472c8e31096bfb5/osprey_worker/src/osprey/engine/stdlib/udfs/tests/test_time_since.py
osprey_worker/src/osprey/engine/stdlib/udfs/tests/test_time_since.py
from datetime import datetime, timezone import pytest from osprey.engine.conftest import ExecuteFunction from osprey.engine.stdlib.udfs.time_since import TimeSince from osprey.engine.udf.registry import UDFRegistry pytestmark = [ pytest.mark.use_udf_registry(UDFRegistry.with_udfs(TimeSince)), ] @pytest.mark.par...
python
Apache-2.0
5c1f999c156b420043be7efdd472c8e31096bfb5
2026-01-05T07:11:51.519046Z
false
roostorg/osprey
https://github.com/roostorg/osprey/blob/5c1f999c156b420043be7efdd472c8e31096bfb5/osprey_worker/src/osprey/engine/stdlib/udfs/tests/test_phone_country.py
osprey_worker/src/osprey/engine/stdlib/udfs/tests/test_phone_country.py
from typing import Any, Callable, List import pytest from osprey.engine.ast_validator.validators.validate_call_kwargs import ValidateCallKwargs from osprey.engine.conftest import ExecuteFunction from osprey.engine.stdlib.udfs.phone_country import PhoneCountry from osprey.engine.udf.registry import UDFRegistry pytestm...
python
Apache-2.0
5c1f999c156b420043be7efdd472c8e31096bfb5
2026-01-05T07:11:51.519046Z
false
roostorg/osprey
https://github.com/roostorg/osprey/blob/5c1f999c156b420043be7efdd472c8e31096bfb5/osprey_worker/src/osprey/engine/stdlib/udfs/tests/test_external_service_utils.py
osprey_worker/src/osprey/engine/stdlib/udfs/tests/test_external_service_utils.py
from typing import List import gevent from gevent.event import Event from osprey.engine.executor.external_service_utils import ExternalService, ExternalServiceAccessor class CountingService(ExternalService[str, int]): def __init__(self) -> None: from typing import List self.calls: List[str] = []...
python
Apache-2.0
5c1f999c156b420043be7efdd472c8e31096bfb5
2026-01-05T07:11:51.519046Z
false
roostorg/osprey
https://github.com/roostorg/osprey/blob/5c1f999c156b420043be7efdd472c8e31096bfb5/osprey_worker/src/osprey/engine/stdlib/udfs/tests/test_random_bool.py
osprey_worker/src/osprey/engine/stdlib/udfs/tests/test_random_bool.py
from typing import Any, Callable, List import pytest from osprey.engine.ast_validator.validators.unique_stored_names import UniqueStoredNames from osprey.engine.ast_validator.validators.validate_call_kwargs import ValidateCallKwargs from osprey.engine.conftest import CheckFailureFunction, ExecuteFunction, RunValidatio...
python
Apache-2.0
5c1f999c156b420043be7efdd472c8e31096bfb5
2026-01-05T07:11:51.519046Z
false
roostorg/osprey
https://github.com/roostorg/osprey/blob/5c1f999c156b420043be7efdd472c8e31096bfb5/osprey_worker/src/osprey/engine/stdlib/configs/feature_flags_config.py
osprey_worker/src/osprey/engine/stdlib/configs/feature_flags_config.py
from random import random from typing import Dict from pydantic import BaseModel, validator from .._registry import register_config_subkey FEATURE_FLAGS_CONFIG_SUBKEY = 'feature_flags' ### Feature Flags ### WEBHOOKS_USE_PUBSUB = 'WEBHOOKS_USE_PUBSUB' class PercentageFlagInfo(BaseModel): value: float desc...
python
Apache-2.0
5c1f999c156b420043be7efdd472c8e31096bfb5
2026-01-05T07:11:51.519046Z
false
roostorg/osprey
https://github.com/roostorg/osprey/blob/5c1f999c156b420043be7efdd472c8e31096bfb5/osprey_worker/src/osprey/engine/stdlib/configs/analytics_config.py
osprey_worker/src/osprey/engine/stdlib/configs/analytics_config.py
from typing import Dict, Set from pydantic import BaseModel from .._registry import register_config_subkey ANALYTICS_CONFIG_SUBKEY = 'analytics' class CounterInfo(BaseModel): threshold: int @register_config_subkey(ANALYTICS_CONFIG_SUBKEY) class AnalyticsConfig(BaseModel): """ hold the `analytics` con...
python
Apache-2.0
5c1f999c156b420043be7efdd472c8e31096bfb5
2026-01-05T07:11:51.519046Z
false
roostorg/osprey
https://github.com/roostorg/osprey/blob/5c1f999c156b420043be7efdd472c8e31096bfb5/osprey_worker/src/osprey/engine/stdlib/configs/__init__.py
osprey_worker/src/osprey/engine/stdlib/configs/__init__.py
python
Apache-2.0
5c1f999c156b420043be7efdd472c8e31096bfb5
2026-01-05T07:11:51.519046Z
false
roostorg/osprey
https://github.com/roostorg/osprey/blob/5c1f999c156b420043be7efdd472c8e31096bfb5/osprey_worker/src/osprey/engine/stdlib/configs/labels_config.py
osprey_worker/src/osprey/engine/stdlib/configs/labels_config.py
from enum import Enum from typing import Dict, List from pydantic import BaseModel, root_validator from .._registry import register_config_subkey # If you change this also change osprey_worker/src/osprey/worker/shared/labels.py class LabelConnotation(Enum): POSITIVE = 'positive' NEGATIVE = 'negative' NE...
python
Apache-2.0
5c1f999c156b420043be7efdd472c8e31096bfb5
2026-01-05T07:11:51.519046Z
false
roostorg/osprey
https://github.com/roostorg/osprey/blob/5c1f999c156b420043be7efdd472c8e31096bfb5/osprey_worker/src/osprey/engine/stdlib/configs/tests/test_analytics_config.py
osprey_worker/src/osprey/engine/stdlib/configs/tests/test_analytics_config.py
from osprey.engine.stdlib.configs.analytics_config import AnalyticsConfig def test_filtered_labels_for_analytics() -> None: labels = ['label_1', 'label_2'] config = AnalyticsConfig.parse_obj( {'filtered_labels': labels}, ) assert config.filtered_labels == set(labels) def test_filtered_labels...
python
Apache-2.0
5c1f999c156b420043be7efdd472c8e31096bfb5
2026-01-05T07:11:51.519046Z
false
roostorg/osprey
https://github.com/roostorg/osprey/blob/5c1f999c156b420043be7efdd472c8e31096bfb5/osprey_worker/src/osprey/engine/stdlib/configs/tests/__init__.py
osprey_worker/src/osprey/engine/stdlib/configs/tests/__init__.py
python
Apache-2.0
5c1f999c156b420043be7efdd472c8e31096bfb5
2026-01-05T07:11:51.519046Z
false
roostorg/osprey
https://github.com/roostorg/osprey/blob/5c1f999c156b420043be7efdd472c8e31096bfb5/osprey_worker/src/osprey/engine/ast/ast_utils.py
osprey_worker/src/osprey/engine/ast/ast_utils.py
import copy from typing import Any, Callable, Dict, Iterator, List, Optional, Sequence, Set, Tuple, Type, TypeVar, Union # from osprey.engine.utils.periodic_execution_yielder import maybe_periodic_yield from .grammar import ASTNode, Root, Statement T = TypeVar('T', bound='ASTNode') def iter_fields(node: 'ASTNode') ...
python
Apache-2.0
5c1f999c156b420043be7efdd472c8e31096bfb5
2026-01-05T07:11:51.519046Z
false
roostorg/osprey
https://github.com/roostorg/osprey/blob/5c1f999c156b420043be7efdd472c8e31096bfb5/osprey_worker/src/osprey/engine/ast/py_ast.py
osprey_worker/src/osprey/engine/ast/py_ast.py
"""This implements the Python AST -> Osprey AST transformer.""" import ast from typing import Any, Optional, Type, TypeVar, Union from typing import List as ListT from .ast_utils import iter_field_values from .errors import OspreySyntaxError from .grammar import ( Add, And, Annotation, AnnotationWithV...
python
Apache-2.0
5c1f999c156b420043be7efdd472c8e31096bfb5
2026-01-05T07:11:51.519046Z
false
roostorg/osprey
https://github.com/roostorg/osprey/blob/5c1f999c156b420043be7efdd472c8e31096bfb5/osprey_worker/src/osprey/engine/ast/sources.py
osprey_worker/src/osprey/engine/ast/sources.py
import fnmatch from functools import reduce from hashlib import sha256 from itertools import chain from pathlib import Path from typing import Any, Dict, Iterator, List, Optional, Sequence, Set, Union import deepmerge import yaml from .grammar import Source, Span from .yaml import SafeDumper, SafeLineLoader, WithLine...
python
Apache-2.0
5c1f999c156b420043be7efdd472c8e31096bfb5
2026-01-05T07:11:51.519046Z
false
roostorg/osprey
https://github.com/roostorg/osprey/blob/5c1f999c156b420043be7efdd472c8e31096bfb5/osprey_worker/src/osprey/engine/ast/error_utils.py
osprey_worker/src/osprey/engine/ast/error_utils.py
import math from dataclasses import dataclass from typing import Optional, Sequence, Union from osprey.engine.utils.types import add_slots from .grammar import Span @add_slots @dataclass(frozen=True) class SpanWithHint: """Holds a pair of (span, hint)""" span: Span hint: str def _assert_valid_message...
python
Apache-2.0
5c1f999c156b420043be7efdd472c8e31096bfb5
2026-01-05T07:11:51.519046Z
false
roostorg/osprey
https://github.com/roostorg/osprey/blob/5c1f999c156b420043be7efdd472c8e31096bfb5/osprey_worker/src/osprey/engine/ast/yaml.py
osprey_worker/src/osprey/engine/ast/yaml.py
from __future__ import annotations from typing import TYPE_CHECKING, Any, ClassVar, Dict, Hashable, Iterator, List, Type, TypeVar import yaml from osprey.engine.ast.grammar import Source from yaml.dumper import SafeDumper as _SafeDumper from yaml.representer import SafeRepresenter _T = TypeVar('_T', bound='WithLineA...
python
Apache-2.0
5c1f999c156b420043be7efdd472c8e31096bfb5
2026-01-05T07:11:51.519046Z
false
roostorg/osprey
https://github.com/roostorg/osprey/blob/5c1f999c156b420043be7efdd472c8e31096bfb5/osprey_worker/src/osprey/engine/ast/errors.py
osprey_worker/src/osprey/engine/ast/errors.py
from .grammar import Source, Span class OspreySyntaxError(Exception): """Some error happened while trying to transform the python ast into Osprey ast.""" def __init__(self, source: Source, span: Span, error: str, hint: str = ''): super().__init__(span, error) self.span = span self...
python
Apache-2.0
5c1f999c156b420043be7efdd472c8e31096bfb5
2026-01-05T07:11:51.519046Z
false
roostorg/osprey
https://github.com/roostorg/osprey/blob/5c1f999c156b420043be7efdd472c8e31096bfb5/osprey_worker/src/osprey/engine/ast/printer.py
osprey_worker/src/osprey/engine/ast/printer.py
from . import grammar # noinspection PyUnusedLocal class ASTPrinter: """Given a osprey_ast node tree, transform it back to the source representation.""" def transform(self, node: grammar.ASTNode) -> str: method = 'transform_' + node.__class__.__name__ transformer = getattr(self, method, None)...
python
Apache-2.0
5c1f999c156b420043be7efdd472c8e31096bfb5
2026-01-05T07:11:51.519046Z
false
roostorg/osprey
https://github.com/roostorg/osprey/blob/5c1f999c156b420043be7efdd472c8e31096bfb5/osprey_worker/src/osprey/engine/ast/grammar.py
osprey_worker/src/osprey/engine/ast/grammar.py
from __future__ import annotations from collections import defaultdict from dataclasses import dataclass, field, replace from enum import Enum from pathlib import Path from typing import ClassVar, Dict, Optional, Sequence, TypeVar, Union from gevent.lock import Semaphore # TODO: Uncomment logging when we have a logg...
python
Apache-2.0
5c1f999c156b420043be7efdd472c8e31096bfb5
2026-01-05T07:11:51.519046Z
false
roostorg/osprey
https://github.com/roostorg/osprey/blob/5c1f999c156b420043be7efdd472c8e31096bfb5/osprey_worker/src/osprey/engine/ast/__init__.py
osprey_worker/src/osprey/engine/ast/__init__.py
python
Apache-2.0
5c1f999c156b420043be7efdd472c8e31096bfb5
2026-01-05T07:11:51.519046Z
false
roostorg/osprey
https://github.com/roostorg/osprey/blob/5c1f999c156b420043be7efdd472c8e31096bfb5/osprey_worker/src/osprey/engine/ast_validator/validation_utils.py
osprey_worker/src/osprey/engine/ast_validator/validation_utils.py
from typing import Optional from osprey.engine.ast import ast_utils, grammar, printer from .validation_context import ValidationContext def add_must_assign_to_variable_error( context: ValidationContext, message: str, node: grammar.ASTNode, example_variable_name: str = 'SomeVariable', type_annota...
python
Apache-2.0
5c1f999c156b420043be7efdd472c8e31096bfb5
2026-01-05T07:11:51.519046Z
false
roostorg/osprey
https://github.com/roostorg/osprey/blob/5c1f999c156b420043be7efdd472c8e31096bfb5/osprey_worker/src/osprey/engine/ast_validator/validation_context.py
osprey_worker/src/osprey/engine/ast_validator/validation_context.py
from abc import ABC from typing import TYPE_CHECKING, Any, ClassVar, Dict, List, Optional, Sequence, Tuple, Type, Union, cast from osprey.engine.ast.error_utils import SpanWithHint, render_span_context_with_message from osprey.engine.ast.errors import OspreySyntaxError from osprey.engine.ast.grammar import Source, Spa...
python
Apache-2.0
5c1f999c156b420043be7efdd472c8e31096bfb5
2026-01-05T07:11:51.519046Z
false
roostorg/osprey
https://github.com/roostorg/osprey/blob/5c1f999c156b420043be7efdd472c8e31096bfb5/osprey_worker/src/osprey/engine/ast_validator/validator_registry.py
osprey_worker/src/osprey/engine/ast_validator/validator_registry.py
from typing import ClassVar, Iterator, Optional, Set, Type from .base_validator import BaseValidator class ValidatorRegistry: """Holds all the registered validators.""" _instance: ClassVar[Optional['ValidatorRegistry']] = None @classmethod def get_instance(cls) -> 'ValidatorRegistry': """Ge...
python
Apache-2.0
5c1f999c156b420043be7efdd472c8e31096bfb5
2026-01-05T07:11:51.519046Z
false
roostorg/osprey
https://github.com/roostorg/osprey/blob/5c1f999c156b420043be7efdd472c8e31096bfb5/osprey_worker/src/osprey/engine/ast_validator/base_validator.py
osprey_worker/src/osprey/engine/ast_validator/base_validator.py
from abc import ABC, abstractmethod from typing import TYPE_CHECKING, Dict, Generic, Type, TypeVar from osprey.engine.utils.periodic_execution_yielder import maybe_periodic_yield from pydantic import BaseModel T_co = TypeVar('T_co', covariant=True) T = TypeVar('T') if TYPE_CHECKING: from osprey.engine.ast.gramma...
python
Apache-2.0
5c1f999c156b420043be7efdd472c8e31096bfb5
2026-01-05T07:11:51.519046Z
false
roostorg/osprey
https://github.com/roostorg/osprey/blob/5c1f999c156b420043be7efdd472c8e31096bfb5/osprey_worker/src/osprey/engine/ast_validator/__init__.py
osprey_worker/src/osprey/engine/ast_validator/__init__.py
from osprey.engine.ast.sources import Sources from osprey.engine.udf.registry import UDFRegistry from .validation_context import ValidatedSources, ValidationContext from .validator_registry import ValidatorRegistry def validate_sources( sources: Sources, udf_registry: UDFRegistry, validator_registry: ValidatorRe...
python
Apache-2.0
5c1f999c156b420043be7efdd472c8e31096bfb5
2026-01-05T07:11:51.519046Z
false
roostorg/osprey
https://github.com/roostorg/osprey/blob/5c1f999c156b420043be7efdd472c8e31096bfb5/osprey_worker/src/osprey/engine/ast_validator/validators/validate_call_kwargs.py
osprey_worker/src/osprey/engine/ast_validator/validators/validate_call_kwargs.py
from __future__ import annotations from typing import TYPE_CHECKING, Any, Dict, Mapping, Tuple from osprey.engine.ast.ast_utils import filter_nodes from osprey.engine.ast.grammar import Assign, Call, Literal, Name, Source, Store, UnaryOperation from osprey.engine.udf.arguments import ( EXTRA_ARGS_ATTR, Argume...
python
Apache-2.0
5c1f999c156b420043be7efdd472c8e31096bfb5
2026-01-05T07:11:51.519046Z
false
roostorg/osprey
https://github.com/roostorg/osprey/blob/5c1f999c156b420043be7efdd472c8e31096bfb5/osprey_worker/src/osprey/engine/ast_validator/validators/validate_experiments.py
osprey_worker/src/osprey/engine/ast_validator/validators/validate_experiments.py
from dataclasses import dataclass from functools import lru_cache from typing import Dict, List, Optional, cast from osprey.engine.ast import grammar from osprey.engine.ast_validator.base_validator import BaseValidator, HasInput, HasResult from ..validation_context import ValidationContext from .feature_name_to_entit...
python
Apache-2.0
5c1f999c156b420043be7efdd472c8e31096bfb5
2026-01-05T07:11:51.519046Z
false
roostorg/osprey
https://github.com/roostorg/osprey/blob/5c1f999c156b420043be7efdd472c8e31096bfb5/osprey_worker/src/osprey/engine/ast_validator/validators/validate_static_types.py
osprey_worker/src/osprey/engine/ast_validator/validators/validate_static_types.py
from dataclasses import dataclass, replace from functools import lru_cache from typing import TYPE_CHECKING, Any, Callable, Dict, List, Optional, Sequence, Set, Type, Union, cast from osprey.engine.ast import grammar from osprey.engine.ast.error_utils import SpanWithHint from osprey.engine.language_types.entities impo...
python
Apache-2.0
5c1f999c156b420043be7efdd472c8e31096bfb5
2026-01-05T07:11:51.519046Z
true
roostorg/osprey
https://github.com/roostorg/osprey/blob/5c1f999c156b420043be7efdd472c8e31096bfb5/osprey_worker/src/osprey/engine/ast_validator/validators/validate_labels.py
osprey_worker/src/osprey/engine/ast_validator/validators/validate_labels.py
from osprey.engine.ast import grammar from osprey.engine.ast.ast_utils import filter_nodes from osprey.engine.ast.error_utils import SpanWithHint from osprey.engine.ast_validator.base_validator import SourceValidator from osprey.engine.stdlib.configs.labels_config import LABELS_CONFIG_SUBKEY, LabelsConfig from osprey.e...
python
Apache-2.0
5c1f999c156b420043be7efdd472c8e31096bfb5
2026-01-05T07:11:51.519046Z
false
roostorg/osprey
https://github.com/roostorg/osprey/blob/5c1f999c156b420043be7efdd472c8e31096bfb5/osprey_worker/src/osprey/engine/ast_validator/validators/imports_must_not_have_cycles.py
osprey_worker/src/osprey/engine/ast_validator/validators/imports_must_not_have_cycles.py
from dataclasses import dataclass from typing import TYPE_CHECKING, Dict, List, Sequence, Tuple, cast from osprey.engine.ast.ast_utils import filter_nodes from osprey.engine.ast.grammar import Call, Source, Span from osprey.engine.utils.graph import CyclicDependencyError, Graph from ..base_validator import BaseValida...
python
Apache-2.0
5c1f999c156b420043be7efdd472c8e31096bfb5
2026-01-05T07:11:51.519046Z
false
roostorg/osprey
https://github.com/roostorg/osprey/blob/5c1f999c156b420043be7efdd472c8e31096bfb5/osprey_worker/src/osprey/engine/ast_validator/validators/variables_must_be_defined.py
osprey_worker/src/osprey/engine/ast_validator/validators/variables_must_be_defined.py
from collections import defaultdict from typing import DefaultDict, Mapping, Sequence, Set, cast from osprey.engine.ast.ast_utils import filter_nodes, iter_nodes from osprey.engine.ast.grammar import Assign, ASTNode, Call, Load, Name, Source, Store from osprey.engine.stdlib.udfs.import_ import Import from osprey.engin...
python
Apache-2.0
5c1f999c156b420043be7efdd472c8e31096bfb5
2026-01-05T07:11:51.519046Z
false
roostorg/osprey
https://github.com/roostorg/osprey/blob/5c1f999c156b420043be7efdd472c8e31096bfb5/osprey_worker/src/osprey/engine/ast_validator/validators/feature_name_to_entity_type_mapping.py
osprey_worker/src/osprey/engine/ast_validator/validators/feature_name_to_entity_type_mapping.py
from typing import Dict from osprey.engine.ast import grammar from osprey.engine.stdlib.udfs.entity import EntityArgumentsBase from ..base_validator import HasResult, SourceValidator from ..validation_context import ValidationContext from .validate_call_kwargs import UDFNodeMapping, ValidateCallKwargs class Feature...
python
Apache-2.0
5c1f999c156b420043be7efdd472c8e31096bfb5
2026-01-05T07:11:51.519046Z
false
roostorg/osprey
https://github.com/roostorg/osprey/blob/5c1f999c156b420043be7efdd472c8e31096bfb5/osprey_worker/src/osprey/engine/ast_validator/validators/__init__.py
osprey_worker/src/osprey/engine/ast_validator/validators/__init__.py
python
Apache-2.0
5c1f999c156b420043be7efdd472c8e31096bfb5
2026-01-05T07:11:51.519046Z
false
roostorg/osprey
https://github.com/roostorg/osprey/blob/5c1f999c156b420043be7efdd472c8e31096bfb5/osprey_worker/src/osprey/engine/ast_validator/validators/validate_call_rvalue.py
osprey_worker/src/osprey/engine/ast_validator/validators/validate_call_rvalue.py
from osprey.engine.ast.ast_utils import filter_nodes from osprey.engine.ast.grammar import Assign, Call, Name, Source from ..base_validator import SourceValidator class ValidateCallRValue(SourceValidator): """ Validates that the return value of a call is used (if it has a result), and not attempted to be use...
python
Apache-2.0
5c1f999c156b420043be7efdd472c8e31096bfb5
2026-01-05T07:11:51.519046Z
false
roostorg/osprey
https://github.com/roostorg/osprey/blob/5c1f999c156b420043be7efdd472c8e31096bfb5/osprey_worker/src/osprey/engine/ast_validator/validators/rule_name_to_description_mapping.py
osprey_worker/src/osprey/engine/ast_validator/validators/rule_name_to_description_mapping.py
from typing import Dict from osprey.engine.ast.grammar import Assign, Call, FormatString, Source, String from ..base_validator import HasResult, SourceValidator from ..validation_context import ValidationContext class RuleNameToDescriptionMapping(SourceValidator, HasResult[Dict[str, str]]): def __init__(self, c...
python
Apache-2.0
5c1f999c156b420043be7efdd472c8e31096bfb5
2026-01-05T07:11:51.519046Z
false
roostorg/osprey
https://github.com/roostorg/osprey/blob/5c1f999c156b420043be7efdd472c8e31096bfb5/osprey_worker/src/osprey/engine/ast_validator/validators/no_unused_locals.py
osprey_worker/src/osprey/engine/ast_validator/validators/no_unused_locals.py
from typing import Dict, Tuple from osprey.engine.ast.ast_utils import filter_nodes from osprey.engine.ast.grammar import Load, Name, Source, Store from ..base_validator import SourceValidator class NoUnusedLocals(SourceValidator): """ Validates that all locals that are defined are read at least once. "...
python
Apache-2.0
5c1f999c156b420043be7efdd472c8e31096bfb5
2026-01-05T07:11:51.519046Z
false
roostorg/osprey
https://github.com/roostorg/osprey/blob/5c1f999c156b420043be7efdd472c8e31096bfb5/osprey_worker/src/osprey/engine/ast_validator/validators/validate_dynamic_calls_have_annotated_rvalue.py
osprey_worker/src/osprey/engine/ast_validator/validators/validate_dynamic_calls_have_annotated_rvalue.py
from typing import TYPE_CHECKING from osprey.engine.ast.ast_utils import filter_nodes from osprey.engine.ast.grammar import Assign, Call, Name, Source from osprey.engine.ast_validator.base_validator import SourceValidator from osprey.engine.ast_validator.validation_utils import add_must_assign_to_variable_error from o...
python
Apache-2.0
5c1f999c156b420043be7efdd472c8e31096bfb5
2026-01-05T07:11:51.519046Z
false
roostorg/osprey
https://github.com/roostorg/osprey/blob/5c1f999c156b420043be7efdd472c8e31096bfb5/osprey_worker/src/osprey/engine/ast_validator/validators/unique_stored_names.py
osprey_worker/src/osprey/engine/ast_validator/validators/unique_stored_names.py
from collections import defaultdict from typing import TYPE_CHECKING, DefaultDict, Dict, List from osprey.engine.ast.ast_utils import filter_nodes from osprey.engine.ast.grammar import Name, Span, Store from ..base_validator import BaseValidator, HasResult if TYPE_CHECKING: from ..validation_context import Valid...
python
Apache-2.0
5c1f999c156b420043be7efdd472c8e31096bfb5
2026-01-05T07:11:51.519046Z
false
roostorg/osprey
https://github.com/roostorg/osprey/blob/5c1f999c156b420043be7efdd472c8e31096bfb5/osprey_worker/src/osprey/engine/ast_validator/validators/tests/test_feature_name_to_entity_type_mapping.py
osprey_worker/src/osprey/engine/ast_validator/validators/tests/test_feature_name_to_entity_type_mapping.py
import pytest from osprey.engine.ast_validator.validators.feature_name_to_entity_type_mapping import FeatureNameToEntityTypeMapping from osprey.engine.ast_validator.validators.unique_stored_names import UniqueStoredNames from osprey.engine.ast_validator.validators.validate_call_kwargs import ValidateCallKwargs from osp...
python
Apache-2.0
5c1f999c156b420043be7efdd472c8e31096bfb5
2026-01-05T07:11:51.519046Z
false
roostorg/osprey
https://github.com/roostorg/osprey/blob/5c1f999c156b420043be7efdd472c8e31096bfb5/osprey_worker/src/osprey/engine/ast_validator/validators/tests/test_no_unused_locals.py
osprey_worker/src/osprey/engine/ast_validator/validators/tests/test_no_unused_locals.py
import pytest from osprey.engine.ast_validator.validators.no_unused_locals import NoUnusedLocals from osprey.engine.conftest import CheckFailureFunction, RunValidationFunction pytestmark = pytest.mark.use_validators([NoUnusedLocals]) def test_no_unused_locals_succeeds_if_locals_are_used(run_validation: RunValidation...
python
Apache-2.0
5c1f999c156b420043be7efdd472c8e31096bfb5
2026-01-05T07:11:51.519046Z
false
roostorg/osprey
https://github.com/roostorg/osprey/blob/5c1f999c156b420043be7efdd472c8e31096bfb5/osprey_worker/src/osprey/engine/ast_validator/validators/tests/test_validate_call_kwargs.py
osprey_worker/src/osprey/engine/ast_validator/validators/tests/test_validate_call_kwargs.py
from __future__ import annotations from typing import Any, Callable, Dict, List, Type import pytest from osprey.engine.ast_validator.validation_context import ValidationContext from osprey.engine.ast_validator.validators.unique_stored_names import UniqueStoredNames from osprey.engine.ast_validator.validators.validate...
python
Apache-2.0
5c1f999c156b420043be7efdd472c8e31096bfb5
2026-01-05T07:11:51.519046Z
false
roostorg/osprey
https://github.com/roostorg/osprey/blob/5c1f999c156b420043be7efdd472c8e31096bfb5/osprey_worker/src/osprey/engine/ast_validator/validators/tests/test_validate_call_rvalue.py
osprey_worker/src/osprey/engine/ast_validator/validators/tests/test_validate_call_rvalue.py
from typing import Any, Callable, List import pytest from osprey.engine.ast_validator.validators.unique_stored_names import UniqueStoredNames from osprey.engine.ast_validator.validators.validate_call_rvalue import ValidateCallRValue from osprey.engine.conftest import CheckFailureFunction, RunValidationFunction from os...
python
Apache-2.0
5c1f999c156b420043be7efdd472c8e31096bfb5
2026-01-05T07:11:51.519046Z
false
roostorg/osprey
https://github.com/roostorg/osprey/blob/5c1f999c156b420043be7efdd472c8e31096bfb5/osprey_worker/src/osprey/engine/ast_validator/validators/tests/test_validate_dynamic_calls_have_annotated_rvalue.py
osprey_worker/src/osprey/engine/ast_validator/validators/tests/test_validate_dynamic_calls_have_annotated_rvalue.py
import pytest from osprey.engine.ast_validator.validators.unique_stored_names import UniqueStoredNames from osprey.engine.ast_validator.validators.validate_call_kwargs import ValidateCallKwargs from osprey.engine.ast_validator.validators.validate_dynamic_calls_have_annotated_rvalue import ( ValidateDynamicCallsHave...
python
Apache-2.0
5c1f999c156b420043be7efdd472c8e31096bfb5
2026-01-05T07:11:51.519046Z
false
roostorg/osprey
https://github.com/roostorg/osprey/blob/5c1f999c156b420043be7efdd472c8e31096bfb5/osprey_worker/src/osprey/engine/ast_validator/validators/tests/test_validate_experiments.py
osprey_worker/src/osprey/engine/ast_validator/validators/tests/test_validate_experiments.py
from typing import cast import pytest from osprey.engine.ast_validator.validators.unique_stored_names import UniqueStoredNames from osprey.engine.ast_validator.validators.validate_call_kwargs import ValidateCallKwargs from osprey.engine.ast_validator.validators.validate_experiments import ( ExperimentValidationRes...
python
Apache-2.0
5c1f999c156b420043be7efdd472c8e31096bfb5
2026-01-05T07:11:51.519046Z
false
roostorg/osprey
https://github.com/roostorg/osprey/blob/5c1f999c156b420043be7efdd472c8e31096bfb5/osprey_worker/src/osprey/engine/ast_validator/validators/tests/__init__.py
osprey_worker/src/osprey/engine/ast_validator/validators/tests/__init__.py
python
Apache-2.0
5c1f999c156b420043be7efdd472c8e31096bfb5
2026-01-05T07:11:51.519046Z
false
roostorg/osprey
https://github.com/roostorg/osprey/blob/5c1f999c156b420043be7efdd472c8e31096bfb5/osprey_worker/src/osprey/engine/ast_validator/validators/tests/test_unique_stored_names.py
osprey_worker/src/osprey/engine/ast_validator/validators/tests/test_unique_stored_names.py
import pytest from osprey.engine.ast_validator.validators.unique_stored_names import UniqueStoredNames from osprey.engine.conftest import CheckFailureFunction, RunValidationFunction pytestmark = pytest.mark.use_validators([UniqueStoredNames]) def test_unique_stored_names_succeeds(run_validation: RunValidationFunctio...
python
Apache-2.0
5c1f999c156b420043be7efdd472c8e31096bfb5
2026-01-05T07:11:51.519046Z
false