repo stringclasses 44
values | path stringlengths 6 100 | size int64 146 125k | copies int64 0 0 | license stringclasses 1
value | content stringlengths 146 125k | token_count int64 51 32.1k | hash stringlengths 64 64 | line_mean float64 12.5 80.7 | line_max int64 30 924 | alpha_frac float64 0.36 0.8 | ratio float64 1.55 5.96 | autogenerated bool 1
class | config_or_test bool 2
classes | has_no_keywords bool 2
classes | has_few_assignments bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
crestalnetwork/intentkit | skills/allora/__init__.py | 2,059 | 0 | MIT License | """Allora skill module."""
import logging
from typing import NotRequired, TypedDict
from abstracts.skill import SkillStoreABC
from skills.allora.base import AlloraBaseTool
from skills.allora.price import AlloraGetPrice
from skills.base import SkillConfig, SkillState
# Cache skills at the system level, because they a... | 547 | c8f767634a1da118872662344f775f97a5819481ad9691ae3885297785e36aca | 23.807229 | 70 | 0.641088 | 3.764168 | false | true | false | false |
pydantic/pydantic-ai | tests/models/test_cohere.py | 12,440 | 0 | MIT License | from __future__ import annotations as _annotations
import json
from collections.abc import Sequence
from dataclasses import dataclass
from datetime import timezone
from typing import Any, Union, cast
import pytest
from inline_snapshot import snapshot
from pydantic_ai import Agent, ModelHTTPError, ModelRetry
from pyd... | 2,992 | 12d11bb6596db25ba3dcaeb857c4eeccd5026878e60f7a7ebd783c844c83de16 | 33.269972 | 117 | 0.552814 | 4.157754 | false | false | false | false |
HKUDS/LightRAG | examples/get_all_edges_nx.py | 1,253 | 0 | MIT License | import networkx as nx
G = nx.read_graphml("./dickensTestEmbedcall/graph_chunk_entity_relation.graphml")
def get_all_edges_and_nodes(G):
# Get all edges and their properties
edges_with_properties = []
for u, v, data in G.edges(data=True):
edges_with_properties.append(
{
... | 337 | 5e1df27c5f96f08f2ceec7e1dedd734bb25c5cd1f01b37011304b4b500b7314a | 30.325 | 81 | 0.548284 | 3.718101 | false | false | false | false |
meta-llama/llama-stack | llama_stack/models/llama/llama3_1/prompts.py | 12,244 | 0 | MIT License | # Copyright (c) Meta Platforms, Inc. and affiliates.
# All rights reserved.
#
# This source code is licensed under the terms described in the LICENSE file in
# the root directory of this source tree.
# Copyright (c) Meta Platforms, Inc. and affiliates.
# All rights reserved.
#
# This source code is licensed under the ... | 2,524 | 7e69e6e476cd1ff344a20cf4195b03f5316a1ee747b7cca8277c7eef362a3c64 | 46.457364 | 413 | 0.527932 | 4.85103 | false | false | false | false |
crestalnetwork/intentkit | app/services/twitter/oauth2_callback.py | 4,968 | 0 | MIT License | """Twitter OAuth2 callback handler."""
from datetime import datetime, timezone
from typing import Optional
from urllib.parse import parse_qs, urlencode, urlparse
import tweepy
from fastapi import APIRouter, HTTPException
from starlette.responses import JSONResponse, RedirectResponse
from app.config.config import con... | 1,184 | f3097720036c5038918e113b07983f57e6afac2e25e38a2e6457797fbae03ac6 | 35.262774 | 100 | 0.625403 | 4.195946 | false | false | false | false |
virattt/ai-hedge-fund | src/data/models.py | 3,736 | 0 | MIT License | from pydantic import BaseModel
class Price(BaseModel):
open: float
close: float
high: float
low: float
volume: int
time: str
class PriceResponse(BaseModel):
ticker: str
prices: list[Price]
class FinancialMetrics(BaseModel):
ticker: str
report_period: str
period: str
... | 1,023 | d0955b70c6fd1fe552c85c4b576a1d4c6e26e16ccf67d3288ec98fcf52439cf0 | 24.073826 | 77 | 0.680675 | 3.652004 | false | false | false | false |
meta-llama/llama-stack | llama_stack/apis/common/deployment_types.py | 753 | 0 | MIT License | # Copyright (c) Meta Platforms, Inc. and affiliates.
# All rights reserved.
#
# This source code is licensed under the terms described in the LICENSE file in
# the root directory of this source tree.
from enum import Enum
from typing import Any, Dict, Optional
from pydantic import BaseModel
from llama_stack.apis.com... | 216 | f074cd9f2c3f20aeda5fd5ceba097b16cdd8e67741a7e2a350279a6d2bb7792a | 24.1 | 79 | 0.722444 | 3.486111 | false | false | false | false |
meta-llama/llama-stack | llama_stack/models/llama/llama4/ffn.py | 2,196 | 0 | MIT License | # Copyright (c) Meta Platforms, Inc. and affiliates.
# All rights reserved.
#
# This source code is licensed under the terms described in the LICENSE file in
# the root directory of this source tree.
# Copyright (c) Meta Platforms, Inc. and affiliates.
# All rights reserved.
#
# This source code is licensed under the ... | 642 | 9149f23fe08c0db08c6b5b29f4926d13cab37ba4c8f79a2942186afe8f43e39d | 36.862069 | 113 | 0.651639 | 3.420561 | false | false | false | false |
MadcowD/ell | examples/future/limbo.py | 1,455 | 0 | MIT License | from typing import List
import ell
from ell.types.message import Message
ell.init(verbose=True, store='./logdir', autocommit=True)
@ell.tool()
def order_t_shirt(size : str, color : str, address : str):
# ....\
pass
@ell.tool()
def get_order_arrival_date(order_id: str):
"""Gets the arrival date o... | 421 | bc5531025ccf18b168f4a8ba117b0dfe3f0dad44e073b04b60137883626cf182 | 28.693878 | 262 | 0.646048 | 3.456057 | false | false | false | false |
crestalnetwork/intentkit | app/admin/api.py | 29,057 | 0 | MIT License | import asyncio
import importlib
import json
import logging
from typing import TypedDict
from aiogram import Bot
from aiogram.exceptions import TelegramConflictError, TelegramUnauthorizedError
from aiogram.utils.token import TokenValidationError
from cdp import Wallet
from cdp.cdp import Cdp
from fastapi import (
A... | 6,813 | b7c0c7b4f2116e0390c1f2f1d072ec17465497bfec0a45bc2869078d91f3a458 | 31.86991 | 106 | 0.588808 | 4.264935 | false | true | false | false |
fudan-generative-vision/hallo2 | basicsr/data/__init__.py | 4,254 | 0 | MIT License | import importlib
import numpy as np
import random
import torch
import torch.utils.data
from copy import deepcopy
from functools import partial
from os import path as osp
from basicsr.data.prefetch_dataloader import PrefetchDataLoader
from basicsr.utils import get_root_logger, scandir
from basicsr.utils.dist_util impor... | 1,161 | 3214fde7389be3f63e073e38f206d7448efe6d9b49bab3fd55f2eb1dac16216a | 41.54 | 113 | 0.657029 | 3.664083 | false | false | false | false |
meta-llama/llama-stack | llama_stack/providers/remote/inference/nvidia/openai_utils.py | 7,685 | 0 | MIT License | # Copyright (c) Meta Platforms, Inc. and affiliates.
# All rights reserved.
#
# This source code is licensed under the terms described in the LICENSE file in
# the root directory of this source tree.
import warnings
from typing import Any, AsyncGenerator, Dict, List, Optional
from openai import AsyncStream
from opena... | 2,104 | f82873fb13c906f185bfab605e378ce0141d4c304d83760fab397b7ef7f0d0ea | 34.578704 | 119 | 0.668705 | 3.652567 | false | false | false | false |
trycua/cua | libs/agent/agent/providers/anthropic/types.py | 421 | 0 | MIT License | from enum import StrEnum
class LLMProvider(StrEnum):
"""Enum for supported API providers."""
ANTHROPIC = "anthropic"
BEDROCK = "bedrock"
VERTEX = "vertex"
PROVIDER_TO_DEFAULT_MODEL_NAME: dict[LLMProvider, str] = {
LLMProvider.ANTHROPIC: "claude-3-7-sonnet-20250219",
LLMProvider.BEDROCK: "an... | 161 | 9f0fefaa638a906a2dee096912b6fa6069b5ff916d47297342eb3b0f1cabe484 | 25.3125 | 69 | 0.700713 | 2.614907 | false | false | false | false |
meta-llama/llama-stack | llama_stack/providers/utils/telemetry/sqlite_trace_store.py | 6,946 | 0 | MIT License | # Copyright (c) Meta Platforms, Inc. and affiliates.
# All rights reserved.
#
# This source code is licensed under the terms described in the LICENSE file in
# the root directory of this source tree.
import json
from datetime import datetime
from typing import Dict, List, Optional, Protocol
import aiosqlite
from lla... | 1,672 | 3ad99d3123bf995e22334dc4d1869ca72bdd343bb4bebfd340936dfbbb38071f | 36.344086 | 118 | 0.530089 | 4.154306 | false | false | false | false |
autoscrape-labs/pydoll | pydoll/browser/page.py | 25,924 | 0 | MIT License | import asyncio
import json
import logging
from contextlib import asynccontextmanager
from functools import partial
from pathlib import Path
from typing import List, Optional, Tuple, Union
import aiofiles
from pydoll.commands import (
DomCommands,
FetchCommands,
NetworkCommands,
PageCommands,
Runti... | 5,539 | f3a968ce0028c85f9d309a9d22ea60f7d3fcd2a98c7d49687251526a25d2701c | 31.486216 | 79 | 0.586638 | 4.680267 | false | false | false | false |
openai/openai-agents-python | src/agents/extensions/handoff_filters.py | 1,977 | 0 | MIT License | from __future__ import annotations
from ..handoffs import HandoffInputData
from ..items import (
HandoffCallItem,
HandoffOutputItem,
RunItem,
ToolCallItem,
ToolCallOutputItem,
TResponseInputItem,
)
"""Contains common handoff input filters, for convenience. """
def remove_all_tools(handoff_in... | 533 | 7da5d4e08f0d80b8d44816665c6bc70024922afb10e68b599c44ce255823ce07 | 28.507463 | 95 | 0.650986 | 3.709193 | false | false | false | false |
browser-use/browser-use | examples/use-cases/google_sheets.py | 7,576 | 0 | MIT License | import os
import sys
from browser_use.browser.context import BrowserContext
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
import asyncio
import pyperclip
from dotenv import load_dotenv
from langchain_openai import ChatOpenAI
from browser_use import ActionResult, Agent, Controller
from... | 2,298 | 623f6d876c280782cedee4a319aa635d451ac4dbde667498850d02757688e115 | 38.253886 | 154 | 0.757128 | 3.29678 | false | false | false | false |
HKUDS/AutoAgent | autoagent/workflows/math_solver_workflow_flow.py | 8,795 | 0 | MIT License | import asyncio
import json
import argparse
from openai import AsyncOpenAI
from openai.types.chat import ChatCompletionMessageToolCall
from autoagent.flow import default_drive, EventInput, ReturnBehavior
from autoagent.flow.dynamic import goto_events, abort_this
import re
from autoagent import MetaChain
from autoagent.t... | 2,320 | c86700e0fd59c6b80869c02761a41ded8e8ea73a9979cb1a6bacfc6807888ce7 | 42.756219 | 272 | 0.612166 | 3.790948 | false | false | false | false |
MadcowD/ell | examples/claude.py | 387 | 0 | MIT License | import ell # type: ignore
@ell.simple(model="claude-3-5-sonnet-20241022", max_tokens=100)
def hello_from_claude():
"""You are an AI assistant. Your task is to respond to the user's message with a friendly greeting."""
return "Say hello to the world!!!"
if __name__ == "__main__":
ell.init(verbose=True, ... | 124 | e4c04ea149b61475c86a19b1b3cec0ffaf179b02e6cef871cd068c354a327e47 | 31.25 | 106 | 0.666667 | 3.120968 | false | false | false | false |
fudan-generative-vision/hallo | scripts/train_stage2.py | 37,347 | 0 | MIT License | # pylint: disable=E1101,C0415,W0718,R0801
# scripts/train_stage2.py
"""
This is the main training script for stage 2 of the project.
It imports necessary packages, defines necessary classes and functions, and trains the model using the provided configuration.
The script includes the following classes and functions:
... | 9,334 | 4d47c87601970edb30a6004ea1f343f7e1b3fffcbef50adb7d2729a39fc672af | 36.686176 | 126 | 0.590891 | 4.001178 | false | false | false | false |
microsoft/TRELLIS | dataset_toolkits/datasets/HSSD.py | 3,654 | 0 | MIT License | import os
import re
import argparse
import tarfile
from concurrent.futures import ThreadPoolExecutor
from tqdm import tqdm
import pandas as pd
import huggingface_hub
from utils import get_file_hash
def add_args(parser: argparse.ArgumentParser):
pass
def get_metadata(**kwargs):
metadata = pd.read_csv("hf://d... | 941 | 2941f745453ea7f0e0e270ce24debab54a8e2721fc0a4b92b0a5a14fbb63bf49 | 34.475728 | 158 | 0.594964 | 3.883103 | false | false | false | false |
End of preview. Expand in Data Studio
README.md exists but content is empty.
- Downloads last month
- 4