This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import sys | |
| import typing | |
| if typing.TYPE_CHECKING: | |
| import types | |
| def srcfile_import(modpath: str, modname: str) -> "types.ModuleType": | |
| """It imports a python module from its srcfile |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import argparse | |
| import bisect | |
| from typing import Any | |
| from gekko import GEKKO | |
| cumulative_deposit_config = { | |
| "grossinterest": 2.6, | |
| "deduction": 3.5 + 1.5, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import logging | |
| import typing | |
| import psutil | |
| T = typing.TypeVar("T") | |
| def safe_execute(function: typing.Callable[..., T], *args, **kwargs, timeout: int = 60) -> T: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import typing | |
| from uuid import UUID, uuid4 | |
| from datetime import datetime, timezone | |
| from functools import partial | |
| from typing import Any | |
| from pydantic import BaseModel | |
| from sqlalchemy import select, func, sql | |
| from sqlalchemy.dialects.mysql import insert as mysql_insert | |
| from sqlalchemy.dialects.postgresql import insert as postgres_insert |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import asyncio | |
| import json | |
| import os | |
| import re | |
| import typing | |
| import uuid | |
| from contextlib import contextmanager | |
| from typing import Any | |
| import numpy as np |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """OpenTelemetry tracing utilities for any library. | |
| This module provides decorators to simplify the integration of OpenTelemetry | |
| tracing into Python applications. It offers `trace_function` for instrumenting | |
| individual functions (both synchronous and asynchronous) and `trace_class` | |
| for instrumenting multiple methods within a class. | |
| The tracer is initialized with the module name and version defined by | |
| `INSTRUMENTING_MODULE` ('<module>') and | |
| `INSTRUMENTING_MODULE_VERSION` ('<version>'). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import asyncio | |
| import json | |
| import logging | |
| import uuid | |
| import redis.asyncio as redis | |
| from a2a.server.events.event_queue import EventQueue | |
| from a2a.server.events.queue_manager import ( | |
| NoTaskQueue, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import math | |
| import numpy as np | |
| from scipy.stats import beta | |
| from collections import defaultdict | |
| # ============================================================================== | |
| # 1. Metric Estimation Functions | |
| # ============================================================================== | |
| def pass_at_k_unbiased_estimator(n, c, k): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import asyncio | |
| from typing import Any, Coroutine | |
| class _AsyncThread(threading.Thread): | |
| """helper thread class for running async coroutines in a separate thread""" | |
| def __init__(self, coroutine: Coroutine[Any, Any, Any]): | |
| self.coroutine = coroutine | |
| self.result = None |
OlderNewer