id int64 0 328k | repository_name stringlengths 7 58 | file_path stringlengths 9 302 | class_name stringlengths 5 256 | human_written_code stringlengths 16 2.16M | class_skeleton stringlengths 18 1.49M ⌀ | total_program_units int64 1 1.76k | total_doc_str int64 0 771 | AvgCountLine float64 0 7.89k | AvgCountLineBlank float64 0 297 | AvgCountLineCode float64 0 7.89k | AvgCountLineComment float64 0 7.89k | AvgCyclomatic float64 0 130 | CommentToCodeRatio float64 0 168 | CountClassBase float64 0 40 | CountClassCoupled float64 0 583 | CountClassCoupledModified float64 0 575 | CountClassDerived float64 0 5.35k | CountDeclInstanceMethod float64 0 529 | CountDeclInstanceVariable float64 0 296 | CountDeclMethod float64 0 599 | CountDeclMethodAll float64 0 1.12k | CountLine float64 1 40.4k | CountLineBlank float64 0 8.16k | CountLineCode float64 1 25.7k | CountLineCodeDecl float64 1 8.15k | CountLineCodeExe float64 0 24.2k | CountLineComment float64 0 16.5k | CountStmt float64 1 9.71k | CountStmtDecl float64 1 8.15k | CountStmtExe float64 0 9.69k | MaxCyclomatic float64 0 759 | MaxInheritanceTree float64 0 16 | MaxNesting float64 0 34 | SumCyclomatic float64 0 2.9k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
328,100 | gazorby/strawchemy | /Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/gazorby_strawchemy/src/strawchemy/strawberry/repository/_sync.py | strawchemy.strawberry.repository._sync.StrawchemySyncRepository | from strawchemy.sqlalchemy.repository import SQLAlchemyGraphQLSyncRepository
from ._base import GraphQLResult, StrawchemyRepository
from typing import TYPE_CHECKING, Any, Optional, TypeVar
from dataclasses import dataclass
from strawchemy.strawberry._utils import default_session_getter, dto_model_from_type, strawberry_... | @dataclass
class StrawchemySyncRepository(StrawchemyRepository[T]):
'''Asynchronous repository implementation for GraphQL data access.
This class provides asynchronous methods for querying and mutating data
through GraphQL, using SQLAlchemy's asynchronous API under the hood.
Args:
type: The Stra... | 12 | 11 | 19 | 2 | 9 | 8 | 1 | 0.98 | 1 | 8 | 5 | 0 | 10 | 2 | 10 | 17 | 226 | 36 | 96 | 54 | 58 | 94 | 37 | 25 | 26 | 1 | 2 | 0 | 10 |
328,101 | gazorby/strawchemy | /Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/gazorby_strawchemy/src/strawchemy/types.py | strawchemy.types.DefaultOffsetPagination | from dataclasses import dataclass
@dataclass(eq=True, frozen=True)
class DefaultOffsetPagination:
limit: int = 100
offset: int = 0 | @dataclass(eq=True, frozen=True)
class DefaultOffsetPagination:
pass | 2 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 | 0 | 3 | 3 | 2 | 0 | 3 | 3 | 2 | 0 | 0 | 0 | 0 |
328,102 | gazorby/strawchemy | /Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/gazorby_strawchemy/src/strawchemy/typing.py | strawchemy.typing.DataclassProtocol | from typing import TYPE_CHECKING, Any, ClassVar, Literal, Protocol, Union
class DataclassProtocol(Protocol):
__dataclass_fields__: ClassVar[dict[str, Any]] |
class DataclassProtocol(Protocol):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 24 | 2 | 0 | 2 | 1 | 1 | 0 | 2 | 1 | 1 | 0 | 5 | 0 | 0 |
328,103 | gazorby/strawchemy | /Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/gazorby_strawchemy/src/strawchemy/validation/base.py | strawchemy.validation.base.InputValidationError | from typing import TYPE_CHECKING, Any, Generic, Protocol, TypeVar
class InputValidationError(Exception):
"""Exception raised when input validation fails.
This exception wraps the original validation error and provides a method to convert
it to a GraphQL-compatible error type.
Attributes:
vali... |
class InputValidationError(Exception):
'''Exception raised when input validation fails.
This exception wraps the original validation error and provides a method to convert
it to a GraphQL-compatible error type.
Attributes:
validation: The validation protocol instance that failed
excepti... | 3 | 3 | 8 | 1 | 3 | 5 | 1 | 2.67 | 1 | 3 | 2 | 0 | 2 | 2 | 2 | 12 | 28 | 6 | 6 | 5 | 3 | 16 | 6 | 5 | 3 | 1 | 3 | 0 | 2 |
328,104 | gazorby/strawchemy | /Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/gazorby_strawchemy/src/strawchemy/validation/base.py | strawchemy.validation.base.ValidationProtocol | from typing import TYPE_CHECKING, Any, Generic, Protocol, TypeVar
class ValidationProtocol(Protocol, Generic[T]):
"""Protocol defining the interface for validation classes.
This protocol specifies the required methods that validation classes must implement
to be compatible with Strawchemy's validation sys... |
class ValidationProtocol(Protocol, Generic[T]):
'''Protocol defining the interface for validation classes.
This protocol specifies the required methods that validation classes must implement
to be compatible with Strawchemy's validation system.
'''
def validate(self, **kwargs: Any) -> MappedDTO[T]... | 3 | 3 | 12 | 3 | 2 | 7 | 1 | 3.6 | 2 | 4 | 2 | 1 | 2 | 0 | 2 | 26 | 31 | 8 | 5 | 3 | 2 | 18 | 5 | 3 | 2 | 1 | 5 | 0 | 2 |
328,105 | gazorby/strawchemy | /Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/gazorby_strawchemy/src/strawchemy/validation/pydantic.py | strawchemy.validation.pydantic.MappedPydanticGraphQLDTO | from strawchemy.dto.base import ModelT
from strawchemy.dto.backend.pydantic import MappedPydanticDTO, PydanticDTOBackend
from strawchemy.strawberry.dto import StrawchemyDTOAttributes
from typing import TYPE_CHECKING, Any, ClassVar, Optional
class MappedPydanticGraphQLDTO(StrawchemyDTOAttributes, MappedPydanticDTO[Mode... |
class MappedPydanticGraphQLDTO(StrawchemyDTOAttributes, MappedPydanticDTO[ModelT]):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 | 0 | 0 | 0 | 0 | 0 | 0 | 85 | 3 | 0 | 3 | 3 | 2 | 0 | 3 | 3 | 2 | 0 | 7 | 0 | 0 |
328,106 | gazorby/strawchemy | /Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/gazorby_strawchemy/src/strawchemy/validation/pydantic.py | strawchemy.validation.pydantic.PydanticMapper | from functools import partial
from strawchemy.dto.backend.pydantic import MappedPydanticDTO, PydanticDTOBackend
class PydanticMapper:
"""Provides methods to generate Pydantic models for input validation.
This class leverages a `StrawchemyInputValidationFactory` to create
Pydantic models tailored for diffe... |
class PydanticMapper:
'''Provides methods to generate Pydantic models for input validation.
This class leverages a `StrawchemyInputValidationFactory` to create
Pydantic models tailored for different input scenarios such as creation,
update by primary key, and update by filter.
'''
def __init__... | 2 | 2 | 20 | 2 | 9 | 9 | 1 | 1.4 | 0 | 4 | 3 | 0 | 1 | 5 | 1 | 1 | 28 | 4 | 10 | 8 | 8 | 14 | 8 | 8 | 6 | 1 | 0 | 0 | 1 |
328,107 | gazorby/strawchemy | /Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/gazorby_strawchemy/src/strawchemy/validation/pydantic.py | strawchemy.validation.pydantic.PydanticValidation | from pydantic import ValidationError
from strawchemy.strawberry.mutation.types import LocalizedErrorType, ValidationErrorType
from .base import InputValidationError, T, ValidationProtocol
from strawchemy.utils import snake_to_lower_camel_case
from typing import TYPE_CHECKING, Any, ClassVar, Optional
from dataclasses im... | @dataclass
class PydanticValidation(ValidationProtocol[T]):
@classmethod
def _to_localized_error(cls, errors: ErrorDetails, to_camel: bool) -> LocalizedErrorType:
pass
@override
def validate(self, **kwargs: Any) -> MappedDTO[T]:
pass
@override
def to_error(self, exception: Valid... | 8 | 0 | 4 | 0 | 4 | 0 | 2 | 0 | 1 | 8 | 4 | 0 | 2 | 0 | 3 | 29 | 22 | 3 | 19 | 9 | 12 | 0 | 12 | 5 | 8 | 2 | 6 | 1 | 5 |
328,108 | gazorby/strawchemy | /Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/gazorby_strawchemy/src/strawchemy/validation/pydantic.py | strawchemy.validation.pydantic.StrawchemyInputValidationFactory | from strawchemy.strawberry.factories.types import InputFactory
from typing_extensions import override
from sqlalchemy.orm import DeclarativeBase
from typing import TYPE_CHECKING, Any, ClassVar, Optional
from strawchemy.dto.utils import read_partial
from collections.abc import Callable
from .base import InputValidationE... |
class StrawchemyInputValidationFactory(InputFactory[MappedPydanticGraphQLDTO[Any]]):
@override
def _resolve_type(self, field: DTOFieldDefinition[DeclarativeBase, QueryableAttribute[Any]], dto_config: DTOConfig, node: Node[Relation[DeclarativeBase, MappedPydanticGraphQLDTO[Any]], None], *, mode: GraphQLPurpose... | 7 | 0 | 20 | 0 | 20 | 0 | 1 | 0 | 1 | 16 | 6 | 0 | 3 | 0 | 3 | 55 | 67 | 3 | 64 | 46 | 19 | 0 | 10 | 4 | 6 | 2 | 6 | 1 | 4 |
328,109 | XAI-liacs/BLADE | /Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/XAI-liacs_BLADE/iohblade/Problem.py | iohblade.Problem.Problem | import shutil
from .utils import TimeoutException
from abc import ABC, abstractmethod
import tempfile
import subprocess
from .solution import Solution
import multiprocessing
from pathlib import Path
import os
import numpy as np
class Problem(ABC):
"""
Abstract problem class.
"""
def __init__(self, log... |
class Problem(ABC):
'''
Abstract problem class.
'''
def __init__(self, logger=None, training_instances=None, test_instances=None, name='Problem', eval_timeout=6000, dependencies=None, imports=None):
'''
Initializes a problem instance with logging and dataset references.
Arg... | 13 | 9 | 21 | 2 | 14 | 6 | 3 | 0.44 | 1 | 5 | 2 | 0 | 9 | 17 | 9 | 29 | 205 | 23 | 128 | 47 | 105 | 56 | 86 | 33 | 75 | 12 | 4 | 3 | 30 |
328,110 | XAI-liacs/BLADE | /Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/XAI-liacs_BLADE/iohblade/Solution.py | iohblade.Solution.Solution | import json
import uuid
import numpy as np
class Solution:
"""
Represents a candidate solution (an individual) in the evolutionary algorithm.
Each individual has properties such as code, fitness, feedback, and metadata for additional information.
"""
def __init__(self, code='', name='', descriptio... |
class Solution:
'''
Represents a candidate solution (an individual) in the evolutionary algorithm.
Each individual has properties such as code, fitness, feedback, and metadata for additional information.
'''
def __init__(self, code='', name='', description='', configspace=None, generation=0, paren... | 14 | 11 | 16 | 1 | 9 | 6 | 1 | 0.71 | 0 | 3 | 0 | 0 | 10 | 12 | 10 | 10 | 172 | 22 | 91 | 37 | 71 | 65 | 61 | 26 | 50 | 3 | 0 | 2 | 14 |
328,111 | XAI-liacs/BLADE | /Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/XAI-liacs_BLADE/iohblade/baselines/modcma.py | iohblade.baselines.modcma.ModularCMAES | from modcma import c_maes
class ModularCMAES:
"""
Baseline implementation of CMA-ES with active update.
Can be extended later to cover all Modular CMAES options.
"""
def __init__(self, budget=10000, dim=10, **kwargs):
self.budget = budget
self.dim = dim
self.modules = c_mae... |
class ModularCMAES:
'''
Baseline implementation of CMA-ES with active update.
Can be extended later to cover all Modular CMAES options.
'''
def __init__(self, budget=10000, dim=10, **kwargs):
pass
def __call__(self, func):
pass | 3 | 1 | 8 | 0 | 6 | 2 | 1 | 0.67 | 0 | 0 | 0 | 0 | 2 | 6 | 2 | 2 | 22 | 2 | 12 | 9 | 9 | 8 | 12 | 9 | 9 | 1 | 0 | 0 | 2 |
328,112 | XAI-liacs/BLADE | /Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/XAI-liacs_BLADE/iohblade/experiment.py | iohblade.experiment.Experiment | import numpy as np
from abc import ABC, abstractmethod
import logging
import copy
from .loggers import ExperimentLogger
import sys
from concurrent.futures import ThreadPoolExecutor, as_completed
import contextlib
class Experiment(ABC):
"""
Abstract class for an entire experiment, running multiple algorithms on... |
class Experiment(ABC):
'''
Abstract class for an entire experiment, running multiple algorithms on multiple problems.
'''
def __init__(self, methods: list, problems: list, runs=5, budget=100, seeds=None, show_stdout=False, exp_logger=None, n_jobs=1):
'''
Initializes an experiment w... | 8 | 7 | 21 | 1 | 18 | 3 | 3 | 0.18 | 1 | 4 | 1 | 2 | 7 | 8 | 7 | 27 | 158 | 11 | 125 | 44 | 107 | 23 | 78 | 33 | 70 | 9 | 4 | 5 | 21 |
328,113 | XAI-liacs/BLADE | /Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/XAI-liacs_BLADE/iohblade/experiment.py | iohblade.experiment.MA_BBOB_Experiment | from .problems import MA_BBOB
class MA_BBOB_Experiment(Experiment):
def __init__(self, methods: list, show_stdout=False, runs=5, budget=100, seeds=None, dims=[2, 5], budget_factor=2000, exp_logger=None, n_jobs=1, **kwargs):
"""
Initializes an experiment on MA-BBOB.
Args:
metho... |
class MA_BBOB_Experiment(Experiment):
def __init__(self, methods: list, show_stdout=False, runs=5, budget=100, seeds=None, dims=[2, 5], budget_factor=2000, exp_logger=None, n_jobs=1, **kwargs):
'''
Initializes an experiment on MA-BBOB.
Args:
methods (list): List of method insta... | 2 | 1 | 45 | 1 | 30 | 14 | 1 | 0.45 | 1 | 3 | 1 | 0 | 1 | 0 | 1 | 28 | 46 | 1 | 31 | 14 | 17 | 14 | 3 | 2 | 1 | 1 | 5 | 0 | 1 |
328,114 | XAI-liacs/BLADE | /Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/XAI-liacs_BLADE/iohblade/llm.py | iohblade.llm.Claude_LLM | import time
import anthropic
import logging
import copy
class Claude_LLM(LLM):
"""A manager class for handling requests to Anthropic's Claude models."""
def __init__(self, api_key, model='claude-3-haiku-20240307', base_url=None, temperature=0.8, max_tokens=4096, **kwargs):
"""Initializes the LLM manag... |
class Claude_LLM(LLM):
'''A manager class for handling requests to Anthropic's Claude models.'''
def __init__(self, api_key, model='claude-3-haiku-20240307', base_url=None, temperature=0.8, max_tokens=4096, **kwargs):
'''Initializes the LLM manager with an API key and model name.'''
pass
... | 6 | 3 | 15 | 1 | 14 | 0 | 3 | 0.06 | 1 | 8 | 0 | 0 | 5 | 5 | 5 | 35 | 84 | 10 | 70 | 31 | 56 | 4 | 53 | 21 | 47 | 10 | 5 | 4 | 17 |
328,115 | XAI-liacs/BLADE | /Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/XAI-liacs_BLADE/iohblade/llm.py | iohblade.llm.DeepSeek_LLM | import openai
class DeepSeek_LLM(OpenAI_LLM):
"""A manager class for the DeepSeek chat models."""
def __init__(self, api_key, model='deepseek-chat', temperature=0.8, **kwargs):
"""Initializes DeepSeek LLM with required base URL."""
super().__init__(api_key, model=model, temperature=temperature... |
class DeepSeek_LLM(OpenAI_LLM):
'''A manager class for the DeepSeek chat models.'''
def __init__(self, api_key, model='deepseek-chat', temperature=0.8, **kwargs):
'''Initializes DeepSeek LLM with required base URL.'''
pass | 2 | 2 | 6 | 0 | 5 | 1 | 1 | 0.33 | 1 | 2 | 0 | 0 | 1 | 2 | 1 | 36 | 9 | 1 | 6 | 4 | 4 | 2 | 6 | 4 | 4 | 1 | 6 | 0 | 1 |
328,116 | XAI-liacs/BLADE | /Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/XAI-liacs_BLADE/iohblade/llm.py | iohblade.llm.Dummy_LLM | class Dummy_LLM(LLM):
def __init__(self, model='DUMMY', **kwargs):
"""
Initializes the DUMMY LLM manager with a model name. This is a placeholder
and does not connect to any LLM provider. It is used for testing purposes only.
Args:
model (str, optional): model abbreviat... | class Dummy_LLM(LLM):
def __init__(self, model='DUMMY', **kwargs):
'''
Initializes the DUMMY LLM manager with a model name. This is a placeholder
and does not connect to any LLM provider. It is used for testing purposes only.
Args:
model (str, optional): model abbreviati... | 3 | 2 | 30 | 4 | 17 | 10 | 2 | 0.56 | 1 | 1 | 0 | 0 | 2 | 0 | 2 | 32 | 61 | 8 | 34 | 6 | 31 | 19 | 9 | 6 | 6 | 2 | 5 | 1 | 3 |
328,117 | XAI-liacs/BLADE | /Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/XAI-liacs_BLADE/iohblade/llm.py | iohblade.llm.Gemini_LLM | import copy
import re
import time
from google import genai
class Gemini_LLM(LLM):
"""
A manager class for handling requests to Google's Gemini models.
"""
def __init__(self, api_key, model='gemini-2.0-flash', generation_config=None, **kwargs):
"""
Initializes the LLM manager with an AP... |
class Gemini_LLM(LLM):
'''
A manager class for handling requests to Google's Gemini models.
'''
def __init__(self, api_key, model='gemini-2.0-flash', generation_config=None, **kwargs):
'''
Initializes the LLM manager with an API key and model name.
Args:
api_key... | 6 | 3 | 32 | 4 | 19 | 10 | 4 | 0.59 | 1 | 4 | 0 | 0 | 2 | 3 | 2 | 32 | 70 | 10 | 39 | 16 | 34 | 23 | 26 | 12 | 23 | 6 | 5 | 3 | 8 |
328,118 | XAI-liacs/BLADE | /Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/XAI-liacs_BLADE/iohblade/llm.py | iohblade.llm.LLM | from abc import ABC, abstractmethod
from .solution import Solution
import logging
from tokencost import calculate_completion_cost, calculate_prompt_cost, count_message_tokens, count_string_tokens
import re
class LLM(ABC):
def __init__(self, api_key, model='', base_url='', code_pattern=None, name_pattern=None, des... |
class LLM(ABC):
def __init__(self, api_key, model='', base_url='', code_pattern=None, name_pattern=None, desc_pattern=None, cs_pattern=None, logger=None):
'''
Initializes the LLM manager with an API key, model name and base_url.
Args:
api_key (str): api key for authentication.
... | 12 | 10 | 23 | 3 | 13 | 8 | 3 | 0.65 | 1 | 3 | 1 | 13 | 10 | 9 | 10 | 30 | 241 | 34 | 127 | 49 | 104 | 83 | 81 | 37 | 69 | 7 | 4 | 2 | 27 |
328,119 | XAI-liacs/BLADE | /Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/XAI-liacs_BLADE/iohblade/llm.py | iohblade.llm.Ollama_LLM | import time
import ollama
class Ollama_LLM(LLM):
def __init__(self, model='llama3.2', **kwargs):
"""
Initializes the Ollama LLM manager with a model name. See https://ollama.com/search for models.
Args:
model (str, optional): model abbreviation. Defaults to "llama3.2".
... |
class Ollama_LLM(LLM):
def __init__(self, model='llama3.2', **kwargs):
'''
Initializes the Ollama LLM manager with a model name. See https://ollama.com/search for models.
Args:
model (str, optional): model abbreviation. Defaults to "llama3.2".
See for options: h... | 3 | 2 | 20 | 3 | 10 | 8 | 3 | 0.75 | 1 | 2 | 0 | 0 | 2 | 1 | 2 | 32 | 41 | 6 | 20 | 9 | 17 | 15 | 17 | 7 | 14 | 5 | 5 | 3 | 6 |
328,120 | XAI-liacs/BLADE | /Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/XAI-liacs_BLADE/iohblade/llm.py | iohblade.llm.OpenAI_LLM | import time
import openai
import copy
import logging
class OpenAI_LLM(LLM):
"""
A manager class for handling requests to OpenAI's GPT models.
"""
def __init__(self, api_key, model='gpt-4-turbo', temperature=0.8, **kwargs):
"""
Initializes the LLM manager with an API key and model name.... |
class OpenAI_LLM(LLM):
'''
A manager class for handling requests to OpenAI's GPT models.
'''
def __init__(self, api_key, model='gpt-4-turbo', temperature=0.8, **kwargs):
'''
Initializes the LLM manager with an API key and model name.
Args:
api_key (str): api key... | 6 | 6 | 16 | 2 | 11 | 5 | 3 | 0.49 | 1 | 8 | 0 | 1 | 5 | 4 | 5 | 35 | 91 | 13 | 55 | 19 | 49 | 27 | 45 | 17 | 39 | 8 | 5 | 3 | 14 |
328,121 | XAI-liacs/BLADE | /Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/XAI-liacs_BLADE/iohblade/loggers/base.py | iohblade.loggers.base.ExperimentLogger | from ..solution import Solution
from ..utils import convert_to_serializable
import json
import jsonlines
from ..problem import Problem
import os
from ..method import Method
from ConfigSpace.read_and_write import json as cs_json
from threading import Lock
from ..llm import LLM
from datetime import datetime
import pandas... |
class ExperimentLogger:
'''
Logs an entire experiment of multiple runs.
'''
def __init__(self, name='', read=False):
'''Create or load an experiment logging directory.
If ``read`` is ``True`` the logger is opened in read only mode.
Otherwise a new directory is created unless ``... | 21 | 14 | 19 | 1 | 15 | 3 | 3 | 0.23 | 0 | 12 | 5 | 1 | 18 | 5 | 18 | 18 | 364 | 33 | 271 | 73 | 241 | 61 | 168 | 57 | 148 | 10 | 0 | 6 | 55 |
328,122 | XAI-liacs/BLADE | /Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/XAI-liacs_BLADE/iohblade/loggers/base.py | iohblade.loggers.base.RunLogger | import os
import jsonlines
from ConfigSpace.read_and_write import json as cs_json
from ..utils import convert_to_serializable
from datetime import datetime
class RunLogger:
"""
Logs an LLM-driven optimization run.
"""
def __init__(self, name='', root_dir='', budget=100, progress_callback=None):
... |
class RunLogger:
'''
Logs an LLM-driven optimization run.
'''
def __init__(self, name='', root_dir='', budget=100, progress_callback=None):
'''
Initializes an instance of the RunLogger.
Sets up a new logging directory named with the current date and time.
Args:
... | 10 | 10 | 14 | 1 | 7 | 6 | 2 | 0.88 | 0 | 3 | 0 | 1 | 9 | 4 | 9 | 9 | 138 | 19 | 64 | 27 | 54 | 56 | 53 | 22 | 43 | 3 | 0 | 2 | 17 |
328,123 | XAI-liacs/BLADE | /Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/XAI-liacs_BLADE/iohblade/loggers/mlflow.py | iohblade.loggers.mlflow.MLFlowExperimentLogger | from .base import ExperimentLogger, RunLogger
import os
from ..llm import LLM
from ..solution import Solution
from ..utils import convert_to_serializable
import json
from ..method import Method
from ..problem import Problem
from ConfigSpace.read_and_write import json as cs_json
class MLFlowExperimentLogger(ExperimentL... |
class MLFlowExperimentLogger(ExperimentLogger):
'''
An ExperimentLogger subclass that keeps the original file-based logging,
and also logs runs to MLflow. The idea is:
- Call open_run() at the start of a run (this calls mlflow.start_run()).
- Run your optimization, logging step-level data via M... | 6 | 3 | 38 | 3 | 26 | 10 | 3 | 0.46 | 1 | 7 | 5 | 0 | 3 | 5 | 3 | 21 | 126 | 12 | 79 | 24 | 67 | 36 | 42 | 15 | 38 | 4 | 1 | 1 | 9 |
328,124 | XAI-liacs/BLADE | /Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/XAI-liacs_BLADE/iohblade/loggers/mlflow.py | iohblade.loggers.mlflow.MLFlowRunLogger | from .base import ExperimentLogger, RunLogger
import json
from ..utils import convert_to_serializable
from datetime import datetime
from ConfigSpace.read_and_write import json as cs_json
class MLFlowRunLogger(RunLogger):
"""
A RunLogger subclass that logs data to MLflow *and* to file,
relying on the fact t... |
class MLFlowRunLogger(RunLogger):
'''
A RunLogger subclass that logs data to MLflow *and* to file,
relying on the fact that the MLFlowExperimentLogger has opened a run.
'''
def __init__(self, name='', root_dir='', budget=100, progress_callback=None):
pass
def log_conversation(self, ro... | 7 | 6 | 11 | 1 | 6 | 4 | 1 | 0.76 | 1 | 5 | 0 | 0 | 6 | 0 | 6 | 15 | 76 | 11 | 37 | 10 | 30 | 28 | 25 | 10 | 18 | 2 | 1 | 1 | 8 |
328,125 | XAI-liacs/BLADE | /Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/XAI-liacs_BLADE/iohblade/method.py | iohblade.method.Method | from .problem import Problem
from abc import ABC, abstractmethod
from .llm import LLM
class Method(ABC):
def __init__(self, llm: LLM, budget, name='Method'):
"""
Initializes a method (optimization algorithm) instance.
Args:
llm (LLM): LLM instance to be used.
budge... |
class Method(ABC):
def __init__(self, llm: LLM, budget, name='Method'):
'''
Initializes a method (optimization algorithm) instance.
Args:
llm (LLM): LLM instance to be used.
budget (int): Budget of evaluations.
name (str): Name of the method (or variatio... | 6 | 3 | 9 | 1 | 3 | 6 | 1 | 1.55 | 1 | 2 | 2 | 14 | 3 | 3 | 3 | 23 | 33 | 5 | 11 | 9 | 5 | 17 | 9 | 7 | 5 | 1 | 4 | 0 | 3 |
328,126 | XAI-liacs/BLADE | /Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/XAI-liacs_BLADE/iohblade/methods/LLaMEA.py | iohblade.methods.LLaMEA.LLaMEA | from ..method import Method
from ..problem import Problem
from ..llm import LLM
from llamea import LLaMEA as LLAMEA_Algorithm
class LLaMEA(Method):
def __init__(self, llm: LLM, budget: int, name='LLaMEA', **kwargs):
"""
Initializes the LLaMEA algorithm within the benchmarking framework.
A... |
class LLaMEA(Method):
def __init__(self, llm: LLM, budget: int, name='LLaMEA', **kwargs):
'''
Initializes the LLaMEA algorithm within the benchmarking framework.
Args:
problem (Problem): The problem instance to optimize.
llm (LLM): The LLM instance to use for soluti... | 4 | 3 | 15 | 1 | 8 | 8 | 1 | 0.96 | 1 | 4 | 2 | 0 | 3 | 4 | 3 | 26 | 48 | 5 | 24 | 8 | 20 | 23 | 9 | 6 | 5 | 2 | 5 | 0 | 4 |
328,127 | XAI-liacs/BLADE | /Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/XAI-liacs_BLADE/iohblade/methods/eoh.py | iohblade.methods.eoh.EoH | import re
from ..solution import Solution
import json
from ..problem import Problem
from ..method import Method
from ..llm import LLM
import os
class EoH(Method):
def __init__(self, llm: LLM, budget: int, name='EoH', **kwargs):
"""
Initializes the EoH algorithm within the benchmarking framework.
... |
class EoH(Method):
def __init__(self, llm: LLM, budget: int, name='EoH', **kwargs):
'''
Initializes the EoH algorithm within the benchmarking framework.
Args:
problem (Problem): The problem instance to optimize.
llm (LLM): The LLM instance to use for solution genera... | 4 | 3 | 27 | 3 | 17 | 7 | 3 | 0.38 | 1 | 10 | 5 | 0 | 3 | 1 | 3 | 26 | 85 | 12 | 53 | 15 | 49 | 20 | 29 | 14 | 25 | 6 | 5 | 1 | 9 |
328,128 | XAI-liacs/BLADE | /Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/XAI-liacs_BLADE/iohblade/methods/eoh.py | iohblade.methods.eoh._BladeInterfaceLLM | from ..llm import LLM
class _BladeInterfaceLLM:
"""Provide EoH with the BLADE LLM interface."""
def __init__(self, llm: LLM):
self.llm = llm
def get_response(self, prompt_content):
return self.llm.query([{'role': 'user', 'content': prompt_content}]) |
class _BladeInterfaceLLM:
'''Provide EoH with the BLADE LLM interface.'''
def __init__(self, llm: LLM):
pass
def get_response(self, prompt_content):
pass | 3 | 1 | 2 | 0 | 2 | 0 | 1 | 0.2 | 0 | 1 | 1 | 0 | 2 | 1 | 2 | 2 | 8 | 2 | 5 | 4 | 2 | 1 | 5 | 4 | 2 | 1 | 0 | 0 | 2 |
328,129 | XAI-liacs/BLADE | /Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/XAI-liacs_BLADE/iohblade/methods/eoh.py | iohblade.methods.eoh._BladeProblemAdapter | from ..solution import Solution
from ..utils import class_info, first_class_name
from ..problem import Problem
class _BladeProblemAdapter:
"""Wraps a BLADE problem for use with EoH."""
def __init__(self, problem: Problem):
self.problem = problem
self.prompts = _BladePrompts(problem)
def e... |
class _BladeProblemAdapter:
'''Wraps a BLADE problem for use with EoH.'''
def __init__(self, problem: Problem):
pass
def evaluate(self, code_string):
pass | 3 | 1 | 7 | 0 | 7 | 1 | 1 | 0.14 | 0 | 3 | 3 | 0 | 2 | 2 | 2 | 2 | 17 | 2 | 14 | 6 | 11 | 2 | 8 | 6 | 5 | 1 | 0 | 0 | 2 |
328,130 | XAI-liacs/BLADE | /Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/XAI-liacs_BLADE/iohblade/methods/eoh.py | iohblade.methods.eoh._BladePrompts | from ..problem import Problem
class _BladePrompts:
"""Adapter exposing the prompt interface expected by EoH."""
def __init__(self, problem: Problem):
self.problem = problem
def get_task(self):
return self.problem.task_prompt
def get_func_name(self):
return self.problem.func_n... |
class _BladePrompts:
'''Adapter exposing the prompt interface expected by EoH.'''
def __init__(self, problem: Problem):
pass
def get_task(self):
pass
def get_func_name(self):
pass
def get_func_inputs(self):
pass
def get_init_inputs(self):
pass
d... | 9 | 1 | 3 | 0 | 3 | 0 | 1 | 0.04 | 0 | 1 | 1 | 0 | 8 | 1 | 8 | 8 | 34 | 8 | 25 | 10 | 16 | 1 | 17 | 10 | 8 | 1 | 0 | 0 | 8 |
328,131 | XAI-liacs/BLADE | /Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/XAI-liacs_BLADE/iohblade/methods/funsearch.py | iohblade.methods.funsearch.funsearch | from ..method import Method
from ..llm import LLM
from ..problem import Problem
class funsearch(Method):
def __init__(self, llm: LLM, budget: int, name='funsearch', **kwargs):
"""
Initializes the funsearch algorithm within the benchmarking framework.
Args:
problem (Problem): T... |
class funsearch(Method):
def __init__(self, llm: LLM, budget: int, name='funsearch', **kwargs):
'''
Initializes the funsearch algorithm within the benchmarking framework.
Args:
problem (Problem): The problem instance to optimize.
llm (LLM): The LLM instance to use f... | 4 | 3 | 11 | 1 | 4 | 6 | 1 | 1.58 | 1 | 5 | 2 | 0 | 3 | 1 | 3 | 26 | 36 | 5 | 12 | 5 | 8 | 19 | 8 | 5 | 4 | 2 | 5 | 0 | 4 |
328,132 | XAI-liacs/BLADE | /Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/XAI-liacs_BLADE/iohblade/methods/llamea.py | iohblade.methods.llamea.LLaMEA | from ..llm import LLM
from ..method import Method
from llamea import LLaMEA as LLAMEA_Algorithm
from ..problem import Problem
class LLaMEA(Method):
def __init__(self, llm: LLM, budget: int, name='LLaMEA', **kwargs):
"""
Initializes the LLaMEA algorithm within the benchmarking framework.
A... |
class LLaMEA(Method):
def __init__(self, llm: LLM, budget: int, name='LLaMEA', **kwargs):
'''
Initializes the LLaMEA algorithm within the benchmarking framework.
Args:
problem (Problem): The problem instance to optimize.
llm (LLM): The LLM instance to use for soluti... | 4 | 3 | 15 | 1 | 8 | 8 | 1 | 0.96 | 1 | 4 | 2 | 0 | 3 | 4 | 3 | 26 | 48 | 5 | 24 | 8 | 20 | 23 | 9 | 6 | 5 | 2 | 5 | 0 | 4 |
328,133 | XAI-liacs/BLADE | /Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/XAI-liacs_BLADE/iohblade/methods/random_search.py | iohblade.methods.random_search.RandomSearch | from ..llm import LLM
from ..problem import Problem
from ..method import Method
class RandomSearch(Method):
def __init__(self, llm: LLM, budget, name='RandomSearch', **kwargs):
"""
Initializes the LLaMEA algorithm within the benchmarking framework.
Args:
llm (LLM): The LLM ins... |
class RandomSearch(Method):
def __init__(self, llm: LLM, budget, name='RandomSearch', **kwargs):
'''
Initializes the LLaMEA algorithm within the benchmarking framework.
Args:
llm (LLM): The LLM instance to use for solution generation.
budget (int): The maximum numbe... | 4 | 3 | 12 | 1 | 6 | 6 | 2 | 0.94 | 1 | 4 | 2 | 0 | 3 | 0 | 3 | 26 | 40 | 5 | 18 | 7 | 14 | 17 | 13 | 7 | 9 | 3 | 5 | 2 | 6 |
328,134 | XAI-liacs/BLADE | /Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/XAI-liacs_BLADE/iohblade/methods/reevo.py | iohblade.methods.reevo.ReEvo | from typing import Any
from ..llm import LLM
from ..method import Method
from ..problem import Problem
from ..utils import class_info, first_class_name
from ..solution import Solution
class ReEvo(Method):
"""Wrapper for the ReEvo baseline."""
def __init__(self, llm: LLM, budget: int, name: str='ReEvo', **kwar... |
class ReEvo(Method):
'''Wrapper for the ReEvo baseline.'''
def __init__(self, llm: LLM, budget: int, name: str='ReEvo', **kwargs: Any):
pass
def _eval_population(self, reevo: Any, population: list[dict], problem: Problem):
pass
def __call__(self, problem: Problem):
pass
... | 5 | 1 | 20 | 1 | 19 | 1 | 2 | 0.05 | 1 | 13 | 4 | 0 | 4 | 1 | 4 | 27 | 87 | 8 | 75 | 17 | 69 | 4 | 40 | 17 | 34 | 4 | 5 | 2 | 9 |
328,135 | XAI-liacs/BLADE | /Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/XAI-liacs_BLADE/iohblade/methods/reevo.py | iohblade.methods.reevo._BladeReEvoClient | from ..llm import LLM
class _BladeReEvoClient(BaseClient):
"""Adapter that exposes the interface expected by ReEvo."""
def __init__(self, llm: LLM, temperature: float=1.0) -> None:
super().__init__(model=llm.model, temperature=temperature)
self.llm = llm
def _chat_completion_api(self, mes... |
class _BladeReEvoClient(BaseClient):
'''Adapter that exposes the interface expected by ReEvo.'''
def __init__(self, llm: LLM, temperature: float=1.0) -> None:
pass
def _chat_completion_api(self, messages: list[dict], temperature: float, n: int=1):
pass
def multi_chat_completion(self,... | 4 | 2 | 19 | 1 | 11 | 7 | 3 | 0.67 | 1 | 9 | 1 | 0 | 3 | 1 | 3 | 3 | 61 | 7 | 33 | 18 | 22 | 22 | 22 | 11 | 18 | 6 | 1 | 2 | 9 |
328,136 | XAI-liacs/BLADE | /Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/XAI-liacs_BLADE/iohblade/misc/ast.py | iohblade.misc.ast.BuildAST | import ast
import networkx as nx
class BuildAST(ast.NodeVisitor):
def __init__(self):
"""
Class to build a directed graph representation (networkx.DiGraph) of a Python Abstract
Syntax Tree (AST). Each AST node is represented as a graph node, and edges indicate
parent-child relation... |
class BuildAST(ast.NodeVisitor):
def __init__(self):
'''
Class to build a directed graph representation (networkx.DiGraph) of a Python Abstract
Syntax Tree (AST). Each AST node is represented as a graph node, and edges indicate
parent-child relationships in the AST.
'''
... | 4 | 3 | 13 | 2 | 6 | 6 | 1 | 0.94 | 1 | 2 | 0 | 0 | 3 | 3 | 3 | 6 | 43 | 8 | 18 | 9 | 14 | 17 | 18 | 9 | 14 | 2 | 2 | 1 | 4 |
328,137 | XAI-liacs/BLADE | /Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/XAI-liacs_BLADE/iohblade/problem.py | iohblade.problem.Problem | from abc import ABC, abstractmethod
import tempfile
import os
from .utils import TimeoutException
import multiprocessing
from .solution import Solution
from pathlib import Path
import numpy as np
import subprocess
import shutil
class Problem(ABC):
"""
Abstract problem class.
"""
def __init__(self, log... |
class Problem(ABC):
'''
Abstract problem class.
'''
def __init__(self, logger=None, training_instances=None, test_instances=None, name='Problem', eval_timeout=6000, dependencies=None, imports=None):
'''
Initializes a problem instance with logging and dataset references.
Arg... | 13 | 9 | 21 | 2 | 14 | 6 | 3 | 0.44 | 1 | 5 | 2 | 14 | 9 | 17 | 9 | 29 | 205 | 23 | 128 | 47 | 105 | 56 | 86 | 33 | 75 | 12 | 4 | 3 | 30 |
328,138 | XAI-liacs/BLADE | /Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/XAI-liacs_BLADE/iohblade/problems/AutoML.py | iohblade.problems.AutoML.AutoML | import sklearn
from sklearn.datasets import load_breast_cancer
from ..solution import Solution
from ..problem import BASE_DEPENDENCIES, Problem
from sklearn.metrics import accuracy_score
class AutoML(Problem):
"""
Problem class for evaluating AutoML pipelines (sample).
"""
def __init__(self, logger=N... |
class AutoML(Problem):
'''
Problem class for evaluating AutoML pipelines (sample).
'''
def __init__(self, logger=None, datasets=None, name='AutoML-breast_cancer', eval_timeout=360, dependencies=None, imports=None):
pass
def get_prompt(self):
'''
Returns the problem descrip... | 6 | 5 | 23 | 3 | 17 | 4 | 1 | 0.25 | 1 | 2 | 1 | 0 | 5 | 11 | 5 | 34 | 125 | 19 | 85 | 31 | 71 | 21 | 32 | 20 | 26 | 3 | 5 | 1 | 7 |
328,139 | XAI-liacs/BLADE | /Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/XAI-liacs_BLADE/iohblade/problems/automl.py | iohblade.problems.automl.AutoML | from sklearn.metrics import accuracy_score
from sklearn.datasets import load_breast_cancer
from ..solution import Solution
import sklearn
from ..problem import BASE_DEPENDENCIES, Problem
class AutoML(Problem):
"""
Problem class for evaluating AutoML pipelines (sample).
"""
def __init__(self, logger=N... |
class AutoML(Problem):
'''
Problem class for evaluating AutoML pipelines (sample).
'''
def __init__(self, logger=None, datasets=None, name='AutoML-breast_cancer', eval_timeout=360, dependencies=None, imports=None):
pass
def get_prompt(self):
'''
Returns the problem descrip... | 6 | 5 | 23 | 3 | 17 | 4 | 1 | 0.25 | 1 | 2 | 1 | 0 | 5 | 11 | 5 | 34 | 125 | 19 | 85 | 31 | 71 | 21 | 32 | 20 | 26 | 3 | 5 | 1 | 7 |
328,140 | XAI-liacs/BLADE | /Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/XAI-liacs_BLADE/iohblade/problems/bbob_sboxcost.py | iohblade.problems.bbob_sboxcost.BBOB_SBOX | from ..problem import BASE_DEPENDENCIES, Problem
from ioh import logger as ioh_logger
import numpy as np
from ..utils import OverBudgetException, aoc_logger, correct_aoc
from ioh import get_problem
from ..solution import Solution
import ioh
class BBOB_SBOX(Problem):
"""
Problem class for evaluating optimizatio... |
class BBOB_SBOX(Problem):
'''
Problem class for evaluating optimization algorithms on the SBOX-COST or BBOB benchmark. See also https://github.com/sbox-cost/Examples
Black-Box Optimization Benchmarking (BBOB) problem set, which contains 24 noiseless real-valued test functions supported on [-5, 5]^n, where ... | 6 | 6 | 53 | 3 | 43 | 8 | 4 | 0.22 | 1 | 5 | 3 | 0 | 5 | 15 | 5 | 34 | 284 | 27 | 214 | 61 | 192 | 47 | 84 | 45 | 78 | 9 | 5 | 3 | 20 |
328,141 | XAI-liacs/BLADE | /Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/XAI-liacs_BLADE/iohblade/problems/kerneltuner.py | iohblade.problems.kerneltuner.Kerneltuner | import os
from ..problem import BASE_DEPENDENCIES, Problem
from pathlib import Path
from ..solution import Solution
class Kerneltuner(Problem):
"""
Problem class for evaluating optimization algorithms on kernel tuner real world benchmark.
Note that this problem requires additional installation steps.
... |
class Kerneltuner(Problem):
'''
Problem class for evaluating optimization algorithms on kernel tuner real world benchmark.
Note that this problem requires additional installation steps.
'''
def __init__(self, logger=None, gpus=None, kernels=None, name='kerneltuner', eval_timeout=600, budget=1000, ... | 6 | 5 | 54 | 6 | 40 | 9 | 3 | 0.24 | 1 | 5 | 1 | 0 | 5 | 10 | 5 | 34 | 282 | 34 | 203 | 51 | 185 | 49 | 64 | 37 | 58 | 8 | 5 | 2 | 13 |
328,142 | XAI-liacs/BLADE | /Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/XAI-liacs_BLADE/iohblade/problems/mabbob.py | iohblade.problems.mabbob.MA_BBOB | import numpy as np
from ..problem import BASE_DEPENDENCIES, Problem
from ioh import get_problem
import os
from ..solution import Solution
from ioh import logger as ioh_logger
from ..utils import OverBudgetException, aoc_logger, correct_aoc
import ioh
import pandas as pd
class MA_BBOB(Problem):
"""
Problem clas... |
class MA_BBOB(Problem):
'''
Problem class for evaluating optimization algorithms on the MA-BBOB benchmark.
'''
def __init__(self, logger=None, training_instances=None, test_instances=None, name='MA_BBOB', eval_timeout=60, dims=[2, 5], budget_factor=2000, dependencies=None, imports=None):
'... | 6 | 6 | 39 | 3 | 30 | 6 | 3 | 0.23 | 1 | 6 | 3 | 0 | 5 | 12 | 5 | 34 | 203 | 20 | 151 | 48 | 134 | 34 | 77 | 37 | 71 | 8 | 5 | 3 | 16 |
328,143 | XAI-liacs/BLADE | /Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/XAI-liacs_BLADE/iohblade/problems/photonics.py | iohblade.problems.photonics.Photonics | from ioh import get_problem
from ..solution import Solution
from .photonic_instances import algorithmic_insights, get_photonic_instance, problem_descriptions
import ioh
from ioh import logger as ioh_logger
import numpy as np
from ..problem import BASE_DEPENDENCIES, Problem
from ..utils import OverBudgetException, aoc_l... |
class Photonics(Problem):
'''
Problem class for evaluating optimization algorithms on different Real-World Photnoics applications.
'''
def __init__(self, logger, problem_type='bragg', test_instances=None, name='Bragg', eval_timeout=3600, budget_factor=500, seeds=5, dependencies=None, imports=None)... | 6 | 6 | 37 | 3 | 28 | 6 | 3 | 0.22 | 1 | 5 | 3 | 0 | 5 | 13 | 5 | 34 | 195 | 22 | 143 | 47 | 126 | 31 | 78 | 36 | 72 | 9 | 5 | 2 | 16 |
328,144 | XAI-liacs/BLADE | /Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/XAI-liacs_BLADE/iohblade/problems/photonics_instances/problems/brag_mirror.py | iohblade.problems.photonics_instances.problems.brag_mirror.brag_mirror | import PyMoosh as pm
import numpy as np
from .photonic_problem import photonic_problem
class brag_mirror(photonic_problem):
def __init__(self, nb_layers, target_wl, mat_env, mat1, mat2):
"""
Args:
mat_env (float): environment ref. index
mat1 (float): material 1 ref. index
... |
class brag_mirror(photonic_problem):
def __init__(self, nb_layers, target_wl, mat_env, mat1, mat2):
'''
Args:
mat_env (float): environment ref. index
mat1 (float): material 1 ref. index
mat2 (float): material 2 ref. index
'''
pass
def setup_... | 4 | 3 | 18 | 2 | 10 | 7 | 1 | 0.73 | 1 | 2 | 0 | 0 | 3 | 10 | 3 | 6 | 58 | 7 | 30 | 21 | 26 | 22 | 26 | 21 | 22 | 1 | 1 | 0 | 3 |
328,145 | XAI-liacs/BLADE | /Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/XAI-liacs_BLADE/iohblade/problems/photonics_instances/problems/ellipsometry_inverse.py | iohblade.problems.photonics_instances.problems.ellipsometry_inverse.ellipsometry | from .photonic_problem import photonic_problem
import numpy as np
import PyMoosh as pm
class ellipsometry(photonic_problem):
def __init__(self, mat_env, mat_substrate, nb_layers, min_thick, max_thick, min_eps, max_eps, wavelengths, angle):
self.n = nb_layers * 2
self.mat_env = mat_env
self... |
class ellipsometry(photonic_problem):
def __init__(self, mat_env, mat_substrate, nb_layers, min_thick, max_thick, min_eps, max_eps, wavelengths, angle):
pass
def setup_structure(self, x):
'''helper to create pymoosh structure object with user-defined
thicknesses and materials
... | 4 | 2 | 27 | 1 | 18 | 8 | 2 | 0.44 | 1 | 4 | 0 | 0 | 3 | 13 | 3 | 6 | 85 | 6 | 55 | 43 | 40 | 24 | 38 | 32 | 34 | 2 | 1 | 1 | 5 |
328,146 | XAI-liacs/BLADE | /Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/XAI-liacs_BLADE/iohblade/problems/photonics_instances/problems/grating2D.py | iohblade.problems.photonics_instances.problems.grating2D.grating2D | from .photonic_problem import photonic_problem
import numpy as np
from scipy.linalg import toeplitz
class grating2D(photonic_problem):
def __init__(self, nb_layers, min_w, max_w, min_thick, max_thick, min_p, max_p):
super().__init__()
self.nb_layers = nb_layers
self.n = 3 * nb_layers
... |
class grating2D(photonic_problem):
def __init__(self, nb_layers, min_w, max_w, min_thick, max_thick, min_p, max_p):
pass
def cascade(self, T, U):
pass
def c_bas(self, A, V, h):
pass
def marche(self, a, b, p, n, x):
pass
def creneau(self, k0, a0, pol, e1, e2, a, ... | 9 | 0 | 20 | 0 | 20 | 0 | 1 | 0.03 | 1 | 4 | 0 | 0 | 8 | 10 | 8 | 11 | 172 | 10 | 158 | 61 | 149 | 4 | 91 | 61 | 82 | 3 | 1 | 1 | 11 |
328,147 | XAI-liacs/BLADE | /Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/XAI-liacs_BLADE/iohblade/problems/photonics_instances/problems/photonic_problem.py | iohblade.problems.photonics_instances.problems.photonic_problem.photonic_problem | class photonic_problem:
def __init__(self):
self.n = None
def setup_structure(self):
pass
def __call__(self):
pass | class photonic_problem:
def __init__(self):
pass
def setup_structure(self):
pass
def __call__(self):
pass | 4 | 0 | 2 | 0 | 2 | 0 | 1 | 0 | 0 | 0 | 0 | 5 | 3 | 1 | 3 | 3 | 9 | 2 | 7 | 5 | 3 | 0 | 7 | 5 | 3 | 1 | 0 | 0 | 3 |
328,148 | XAI-liacs/BLADE | /Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/XAI-liacs_BLADE/iohblade/problems/photonics_instances/problems/plasmonic_nanostructure.py | iohblade.problems.photonics_instances.problems.plasmonic_nanostructure.plasmonic_nanostructure | import warnings
from pyGDM2 import linear, structures, tools, visu
from .photonic_problem import photonic_problem
import numpy as np
class plasmonic_nanostructure(photonic_problem):
def __init__(self, element_sim, method, verbose=0):
"""
Args:
mat_env (float): environment ref. index
... |
class plasmonic_nanostructure(photonic_problem):
def __init__(self, element_sim, method, verbose=0):
'''
Args:
mat_env (float): environment ref. index
mat_substrate (str): substrate material
nb_layers (int): number of layers
min_thick (float): minimu... | 4 | 3 | 35 | 4 | 21 | 11 | 2 | 0.56 | 1 | 2 | 0 | 0 | 3 | 4 | 3 | 6 | 110 | 14 | 63 | 28 | 59 | 35 | 41 | 28 | 37 | 4 | 1 | 2 | 7 |
328,149 | XAI-liacs/BLADE | /Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/XAI-liacs_BLADE/iohblade/problems/photonics_instances/problems/sophisticated_antireflection_design.py | iohblade.problems.photonics_instances.problems.sophisticated_antireflection_design.sophisticated_antireflection_design | import PyMoosh as pm
from .photonic_problem import photonic_problem
import numpy as np
class sophisticated_antireflection_design(photonic_problem):
def __init__(self, nb_layers, min_thick, max_thick, wl_min, wl_max, thick_aSi=30000, number_pts=300, pola=0, incidence=0):
super().__init__()
self.n =... |
class sophisticated_antireflection_design(photonic_problem):
def __init__(self, nb_layers, min_thick, max_thick, wl_min, wl_max, thick_aSi=30000, number_pts=300, pola=0, incidence=0):
pass
def setup_structure(self, x):
'''helper to create pymoosh structure object, alternating 2 materials
... | 4 | 2 | 24 | 2 | 16 | 7 | 1 | 0.42 | 1 | 2 | 0 | 0 | 3 | 12 | 3 | 6 | 75 | 7 | 48 | 35 | 33 | 20 | 29 | 24 | 25 | 1 | 1 | 0 | 3 |
328,150 | XAI-liacs/BLADE | /Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/XAI-liacs_BLADE/iohblade/solution.py | iohblade.solution.Solution | import numpy as np
import json
import uuid
class Solution:
"""
Represents a candidate solution (an individual) in the evolutionary algorithm.
Each individual has properties such as code, fitness, feedback, and metadata for additional information.
"""
def __init__(self, code='', name='', descriptio... |
class Solution:
'''
Represents a candidate solution (an individual) in the evolutionary algorithm.
Each individual has properties such as code, fitness, feedback, and metadata for additional information.
'''
def __init__(self, code='', name='', description='', configspace=None, generation=0, paren... | 14 | 11 | 16 | 1 | 9 | 6 | 1 | 0.71 | 0 | 3 | 0 | 0 | 10 | 12 | 10 | 10 | 172 | 22 | 91 | 37 | 71 | 65 | 61 | 26 | 50 | 3 | 0 | 2 | 14 |
328,151 | XAI-liacs/BLADE | /Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/XAI-liacs_BLADE/iohblade/utils.py | iohblade.utils.NoCodeException | class NoCodeException(Exception):
"""Could not extract generated code."""
pass | class NoCodeException(Exception):
'''Could not extract generated code.'''
pass | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0.5 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 10 | 4 | 1 | 2 | 1 | 1 | 1 | 2 | 1 | 1 | 0 | 3 | 0 | 0 |
328,152 | XAI-liacs/BLADE | /Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/XAI-liacs_BLADE/iohblade/utils.py | iohblade.utils.OverBudgetException | class OverBudgetException(Exception):
"""The algorithm tried to do more evaluations than allowed."""
pass | class OverBudgetException(Exception):
'''The algorithm tried to do more evaluations than allowed.'''
pass | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0.5 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 10 | 4 | 1 | 2 | 1 | 1 | 1 | 2 | 1 | 1 | 0 | 3 | 0 | 0 |
328,153 | XAI-liacs/BLADE | /Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/XAI-liacs_BLADE/iohblade/utils.py | iohblade.utils.ThresholdReachedException | class ThresholdReachedException(Exception):
"""The algorithm reached the lower threshold."""
pass | class ThresholdReachedException(Exception):
'''The algorithm reached the lower threshold.'''
pass | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0.5 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 10 | 4 | 1 | 2 | 1 | 1 | 1 | 2 | 1 | 1 | 0 | 3 | 0 | 0 |
328,154 | XAI-liacs/BLADE | /Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/XAI-liacs_BLADE/iohblade/utils.py | iohblade.utils.TimeoutException | class TimeoutException(Exception):
"""Custom exception for handling timeouts."""
pass | class TimeoutException(Exception):
'''Custom exception for handling timeouts.'''
pass | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0.5 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 10 | 4 | 1 | 2 | 1 | 1 | 1 | 2 | 1 | 1 | 0 | 3 | 0 | 0 |
328,155 | XAI-liacs/BLADE | /Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/XAI-liacs_BLADE/iohblade/utils.py | iohblade.utils.aoc_logger | import numpy as np
class aoc_logger(logger.AbstractLogger):
"""aoc_logger class implementing the logging module for ioh."""
def __init__(self, budget, lower=1e-08, upper=100000000.0, scale_log=True, stop_on_threshold=False, *args, **kwargs):
"""Initialize the logger.
Args:
budget ... |
class aoc_logger(logger.AbstractLogger):
'''aoc_logger class implementing the logging module for ioh.'''
def __init__(self, budget, lower=1e-08, upper=100000000.0, scale_log=True, stop_on_threshold=False, *args, **kwargs):
'''Initialize the logger.
Args:
budget (int): Evaluation bu... | 4 | 3 | 14 | 1 | 10 | 3 | 2 | 0.28 | 1 | 3 | 2 | 0 | 3 | 6 | 3 | 3 | 46 | 5 | 32 | 20 | 19 | 9 | 21 | 11 | 17 | 4 | 1 | 1 | 6 |
328,156 | XAI-liacs/BLADE | /Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/XAI-liacs_BLADE/iohblade/utils.py | iohblade.utils.budget_logger | class budget_logger(logger.AbstractLogger):
"""budget_logger class implementing the logging module for ioh."""
def __init__(self, budget, *args, **kwargs):
"""Initialize the logger.
Args:
budget (int): Evaluation budget for calculating aoc.
"""
super().__init__(*arg... | class budget_logger(logger.AbstractLogger):
'''budget_logger class implementing the logging module for ioh.'''
def __init__(self, budget, *args, **kwargs):
'''Initialize the logger.
Args:
budget (int): Evaluation budget for calculating aoc.
'''
pass
def __call__... | 4 | 3 | 8 | 1 | 4 | 3 | 1 | 0.64 | 1 | 2 | 1 | 0 | 3 | 1 | 3 | 3 | 28 | 5 | 14 | 10 | 5 | 9 | 9 | 5 | 5 | 2 | 1 | 1 | 4 |
328,157 | BottlecapDave/HomeAssistant-TargetTimeframes | /Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/BottlecapDave_HomeAssistant-TargetTimeframes/custom_components/target_timeframes/config_flow.py | custom_components.target_timeframes.config_flow.RollingTargetTimePeriodSubentryFlowHandler | from .config.rolling_target_timeframe import merge_rolling_target_timeframe_config, validate_rolling_target_timeframe_config
from typing import Any
from .const import CONFIG_DATA_UNIQUE_ID, CONFIG_KIND, CONFIG_KIND_ROLLING_TARGET_RATE, CONFIG_KIND_TARGET_RATE, CONFIG_DATA_SOURCE_NAME, CONFIG_TARGET_NAME, CONFIG_VERSION... |
class RollingTargetTimePeriodSubentryFlowHandler(ConfigSubentryFlow):
async def async_step_user(self, user_input: dict[str, Any] | None=None) -> SubentryFlowResult:
'''Setup a target based on the provided user input'''
pass
async def async_step_reconfigure(self, user_input: dict[str, Any] | None=None... | 3 | 1 | 21 | 2 | 18 | 1 | 4 | 0.05 | 1 | 3 | 0 | 0 | 2 | 0 | 2 | 2 | 44 | 5 | 37 | 9 | 32 | 2 | 14 | 7 | 11 | 5 | 1 | 1 | 7 |
328,158 | BottlecapDave/HomeAssistant-TargetTimeframes | /Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/BottlecapDave_HomeAssistant-TargetTimeframes/custom_components/target_timeframes/config_flow.py | custom_components.target_timeframes.config_flow.TargetTimePeriodSubentryFlowHandler | from .const import CONFIG_DATA_UNIQUE_ID, CONFIG_KIND, CONFIG_KIND_ROLLING_TARGET_RATE, CONFIG_KIND_TARGET_RATE, CONFIG_DATA_SOURCE_NAME, CONFIG_TARGET_NAME, CONFIG_VERSION, DATA_SCHEMA_ROLLING_TARGET_TIME_PERIOD, DATA_SCHEMA_SOURCE, DATA_SCHEMA_TARGET_TIME_PERIOD, DOMAIN
from homeassistant.config_entries import Config... |
class TargetTimePeriodSubentryFlowHandler(ConfigSubentryFlow):
async def async_step_user(self, user_input: dict[str, Any] | None=None) -> SubentryFlowResult:
pass
async def async_step_reconfigure(self, user_input: dict[str, Any] | None=None):
pass | 3 | 0 | 21 | 2 | 18 | 1 | 4 | 0.03 | 1 | 3 | 0 | 0 | 2 | 0 | 2 | 2 | 44 | 6 | 37 | 9 | 32 | 1 | 14 | 7 | 11 | 5 | 1 | 1 | 7 |
328,159 | BottlecapDave/HomeAssistant-TargetTimeframes | /Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/BottlecapDave_HomeAssistant-TargetTimeframes/custom_components/target_timeframes/config_flow.py | custom_components.target_timeframes.config_flow.TargetTimeframesConfigFlow | from homeassistant.core import callback
from .config.data_source import validate_source_config
from .const import CONFIG_DATA_UNIQUE_ID, CONFIG_KIND, CONFIG_KIND_ROLLING_TARGET_RATE, CONFIG_KIND_TARGET_RATE, CONFIG_DATA_SOURCE_NAME, CONFIG_TARGET_NAME, CONFIG_VERSION, DATA_SCHEMA_ROLLING_TARGET_TIME_PERIOD, DATA_SCHEMA... |
class TargetTimeframesConfigFlow(ConfigFlow, domain=DOMAIN):
'''Config flow.'''
async def async_step_user(self, user_input):
'''Setup based on user config'''
pass
async def async_step_reconfigure(self, user_input: dict[str, Any] | None=None):
pass
@classmethod
@callback
def async_... | 6 | 3 | 19 | 3 | 15 | 1 | 2 | 0.1 | 2 | 6 | 2 | 0 | 2 | 0 | 3 | 3 | 67 | 12 | 50 | 11 | 42 | 5 | 26 | 8 | 22 | 3 | 1 | 2 | 7 |
328,160 | BottlecapDave/HomeAssistant-TargetTimeframes | /Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/BottlecapDave_HomeAssistant-TargetTimeframes/custom_components/target_timeframes/entities/data_source.py | custom_components.target_timeframes.entities.data_source.TargetTimePeriodDataSource | from homeassistant.const import STATE_UNAVAILABLE, STATE_UNKNOWN
from homeassistant.exceptions import ServiceValidationError
from ..const import DOMAIN, EVENT_DATA_SOURCE
from homeassistant.core import HomeAssistant, callback
from homeassistant.components.sensor import RestoreSensor, SensorDeviceClass
from ..storage.da... |
class TargetTimePeriodDataSource(RestoreSensor):
'''Sensor for displaying a target time period data source'''
def __init__(self, hass: HomeAssistant, source_id: str):
'''Init sensor.'''
pass
@property
def unique_id(self):
'''The id of the sensor.'''
pass
@property
... | 17 | 9 | 9 | 1 | 7 | 1 | 2 | 0.14 | 1 | 5 | 1 | 0 | 9 | 5 | 9 | 9 | 97 | 18 | 69 | 28 | 52 | 10 | 42 | 21 | 32 | 4 | 1 | 1 | 14 |
328,161 | BottlecapDave/HomeAssistant-TargetTimeframes | /Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/BottlecapDave_HomeAssistant-TargetTimeframes/custom_components/target_timeframes/entities/rolling_target_timeframe.py | custom_components.target_timeframes.entities.rolling_target_timeframe.TargetTimeframesRollingTargetRate | from homeassistant.util.dt import utcnow, now
from . import calculate_continuous_times, calculate_intermittent_times, compare_config, create_weighting, extract_config, get_rolling_applicable_time_periods, get_target_time_period_info, should_evaluate_target_timeframes
from homeassistant.components.binary_sensor import B... |
class TargetTimeframesRollingTargetRate(BinarySensorEntity, RestoreEntity):
'''Sensor for calculating when a target should be turned on or off.'''
def __init__(self, hass: HomeAssistant, data_source_id: str, config_entry, config_subentry, config, initial_data):
'''Init sensor.'''
pass
@pro... | 19 | 10 | 24 | 4 | 18 | 2 | 5 | 0.1 | 2 | 5 | 0 | 0 | 11 | 11 | 11 | 11 | 284 | 55 | 209 | 55 | 190 | 20 | 150 | 48 | 138 | 21 | 1 | 4 | 56 |
328,162 | BottlecapDave/HomeAssistant-TargetTimeframes | /Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/BottlecapDave_HomeAssistant-TargetTimeframes/custom_components/target_timeframes/entities/target_timeframe.py | custom_components.target_timeframes.entities.target_timeframe.TargetTimeframesTargetRate | import voluptuous as vol
from homeassistant.helpers import translation
from ..const import CONFIG_TARGET_CALCULATE_WITH_INCOMPLETE_DATA, CONFIG_TARGET_DANGEROUS_SETTINGS, CONFIG_TARGET_DEFAULT_MINIMUM_REQUIRED_MINUTES_IN_SLOT, CONFIG_TARGET_MINIMUM_REQUIRED_MINUTES_IN_SLOT, CONFIG_TARGET_TARGET_TIMES_EVALUATION_MODE, C... |
class TargetTimeframesTargetRate(BinarySensorEntity, RestoreEntity):
'''Sensor for calculating when a target should be turned on or off.'''
def __init__(self, hass: HomeAssistant, data_source_id: str, config_entry, config_subentry, config, initial_data):
'''Init sensor.'''
pass
@property
... | 19 | 10 | 28 | 5 | 21 | 2 | 6 | 0.09 | 2 | 5 | 0 | 0 | 11 | 11 | 11 | 11 | 324 | 62 | 241 | 64 | 222 | 21 | 170 | 57 | 158 | 24 | 1 | 4 | 64 |
328,163 | BottlecapDave/HomeAssistant-TargetTimeframes | /Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/BottlecapDave_HomeAssistant-TargetTimeframes/custom_components/target_timeframes/utils/data_source_data.py | custom_components.target_timeframes.utils.data_source_data.DataSourceItem | from typing import Any
from datetime import datetime, timedelta
from pydantic import BaseModel
class DataSourceItem(BaseModel):
start: datetime
end: datetime
value: float
metadata: Any |
class DataSourceItem(BaseModel):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 82 | 5 | 0 | 5 | 1 | 4 | 0 | 5 | 1 | 4 | 0 | 5 | 0 | 0 |
328,164 | BottlecapDave/HomeAssistant-TargetTimeframes | /Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/BottlecapDave_HomeAssistant-TargetTimeframes/custom_components/target_timeframes/utils/data_source_data.py | custom_components.target_timeframes.utils.data_source_data.ValidateDataSourceDataResult | class ValidateDataSourceDataResult:
def __init__(self, success: bool, data_source_id: str, data: list[DataSourceItem]=[], error_message: str | None=None):
self.success = success
self.data = data
self.data_source_id = data_source_id
self.error_message = error_message | class ValidateDataSourceDataResult:
def __init__(self, success: bool, data_source_id: str, data: list[DataSourceItem]=[], error_message: str | None=None):
pass | 2 | 0 | 5 | 0 | 5 | 0 | 1 | 0 | 0 | 4 | 1 | 0 | 1 | 4 | 1 | 1 | 7 | 1 | 6 | 6 | 4 | 0 | 6 | 6 | 4 | 1 | 0 | 0 | 1 |
328,165 | BottlecapDave/HomeAssistant-TargetTimeframes | /Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/BottlecapDave_HomeAssistant-TargetTimeframes/custom_components/target_timeframes/storage/data_source_data.py | data_source_data.DataSourceData | from ..utils.data_source_data import DataSourceItem
from pydantic import BaseModel
class DataSourceData(BaseModel):
data: list[DataSourceItem] |
class DataSourceData(BaseModel):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 82 | 2 | 0 | 2 | 1 | 1 | 0 | 2 | 1 | 1 | 0 | 5 | 0 | 0 |
328,166 | marutilai/Katalyst | /Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/marutilai_Katalyst/src/katalyst/katalyst_core/utils/checkpointer_manager.py | checkpointer_manager.CheckpointerManager | from langgraph.checkpoint.base import BaseCheckpointSaver
from typing import Optional
class CheckpointerManager:
"""Singleton manager for the global checkpointer."""
_instance: Optional['CheckpointerManager'] = None
_checkpointer: Optional[BaseCheckpointSaver] = None
def __new__(cls):
if cls._... |
class CheckpointerManager:
'''Singleton manager for the global checkpointer.'''
def __new__(cls):
pass
def set_checkpointer(self, checkpointer: BaseCheckpointSaver):
'''Set the global checkpointer.'''
pass
def get_checkpointer(self) -> Optional[BaseCheckpointSaver]:
'... | 4 | 3 | 3 | 0 | 3 | 1 | 1 | 0.27 | 0 | 1 | 0 | 0 | 3 | 0 | 3 | 3 | 18 | 4 | 11 | 6 | 7 | 3 | 11 | 6 | 7 | 2 | 0 | 1 | 4 |
328,167 | marutilai/Katalyst | /Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/marutilai_Katalyst/src/katalyst/katalyst_core/config/llm_config.py | config.llm_config.LLMConfig | import os
from typing import Dict, Optional
class LLMConfig:
"""Manages LLM configuration with provider profiles and overrides."""
def __init__(self):
self._provider = None
self._profile = None
self._custom_models = {}
self._timeout = None
self._load_config()
def _... |
class LLMConfig:
'''Manages LLM configuration with provider profiles and overrides.'''
def __init__(self):
pass
def _load_config(self):
'''Load configuration from environment variables.'''
pass
def get_model_for_component(self, component: str) -> str:
'''
Get ... | 9 | 8 | 15 | 2 | 10 | 3 | 2 | 0.35 | 0 | 4 | 0 | 0 | 8 | 4 | 8 | 8 | 126 | 21 | 78 | 22 | 69 | 27 | 57 | 22 | 48 | 7 | 0 | 1 | 19 |
328,168 | marutilai/Katalyst | /Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/marutilai_Katalyst/src/katalyst/katalyst_core/utils/error_handling.py | error_handling.ErrorType | from enum import Enum
class ErrorType(Enum):
"""
Error types used across the Katalyst agent system.
These are used to create structured error messages that the LLM can understand.
"""
TOOL_ERROR = 'TOOL_ERROR'
PARSING_ERROR = 'PARSING_ERROR'
LLM_ERROR = 'LLM_ERROR'
REPLAN_REQUESTED = '... |
class ErrorType(Enum):
'''
Error types used across the Katalyst agent system.
These are used to create structured error messages that the LLM can understand.
'''
pass | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 1.33 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 49 | 14 | 1 | 9 | 9 | 8 | 12 | 9 | 9 | 8 | 0 | 4 | 0 | 0 |
328,169 | marutilai/Katalyst | /Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/marutilai_Katalyst/src/katalyst/katalyst_core/utils/exceptions.py | exceptions.SandboxViolationError | class SandboxViolationError(Exception):
"""
Raised when a tool attempts to access a path outside the project directory.
This exception enforces the security sandbox that restricts all file
operations to within the project root directory.
"""
def __init__(self, attempted_path: str, project_root... | class SandboxViolationError(Exception):
'''
Raised when a tool attempts to access a path outside the project directory.
This exception enforces the security sandbox that restricts all file
operations to within the project root directory.
'''
def __init__(self, attempted_path: str, project_root:... | 2 | 1 | 7 | 0 | 7 | 0 | 1 | 0.63 | 1 | 2 | 0 | 0 | 1 | 2 | 1 | 11 | 15 | 2 | 8 | 4 | 6 | 5 | 5 | 4 | 3 | 1 | 3 | 0 | 1 |
328,170 | marutilai/Katalyst | /Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/marutilai_Katalyst/src/katalyst/katalyst_core/utils/exceptions.py | exceptions.UserInputRequiredException | from typing import List, Optional
class UserInputRequiredException(Exception):
"""
Raised when a tool needs user input during execution.
This exception is used to interrupt agent execution and return control
to the main REPL for handling user interaction.
"""
def __init__(self, question: str,... |
class UserInputRequiredException(Exception):
'''
Raised when a tool needs user input during execution.
This exception is used to interrupt agent execution and return control
to the main REPL for handling user interaction.
'''
def __init__(self, question: str, suggested_responses: List[str], to... | 2 | 1 | 10 | 0 | 10 | 0 | 1 | 0.45 | 1 | 2 | 0 | 0 | 1 | 3 | 1 | 11 | 18 | 2 | 11 | 10 | 4 | 5 | 6 | 5 | 4 | 1 | 3 | 0 | 1 |
328,171 | marutilai/Katalyst | /Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/marutilai_Katalyst/src/katalyst/app/execution_controller.py | katalyst.app.execution_controller.ExecutionController | from katalyst.katalyst_core.utils.logger import get_logger
import time
from typing import Callable
import sys
from rich.console import Console
import signal
import threading
class ExecutionController:
"""
Manages execution state and provides global Ctrl+C (SIGINT) handler functionality.
Handles:
- Sin... |
class ExecutionController:
'''
Manages execution state and provides global Ctrl+C (SIGINT) handler functionality.
Handles:
- Single Ctrl+C: Cancels current operation
- Double Ctrl+C: Exits Katalyst completely
'''
def __init__(self):
pass
def is_cancelled(self) -> bool:
... | 10 | 8 | 13 | 2 | 8 | 4 | 2 | 0.68 | 0 | 5 | 0 | 0 | 8 | 7 | 8 | 8 | 110 | 22 | 53 | 21 | 43 | 36 | 51 | 21 | 41 | 3 | 0 | 2 | 14 |
328,172 | marutilai/Katalyst | /Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/marutilai_Katalyst/src/katalyst/app/main.py | katalyst.app.main.ReplInterruptHandler | import time
import os
class ReplInterruptHandler:
"""Handles interrupt signals for the REPL with double-press detection."""
def __init__(self, console):
self.console = console
self.last_interrupt_time = 0
self.interrupt_count = 0
self.double_press_window = 0.5
def __call__... |
class ReplInterruptHandler:
'''Handles interrupt signals for the REPL with double-press detection.'''
def __init__(self, console):
pass
def __call__(self, signum, frame):
'''Handle SIGINT with double-press detection.'''
pass | 3 | 2 | 13 | 1 | 11 | 2 | 2 | 0.23 | 0 | 1 | 0 | 0 | 2 | 4 | 2 | 2 | 29 | 3 | 22 | 9 | 19 | 5 | 17 | 9 | 14 | 2 | 0 | 1 | 3 |
328,173 | marutilai/Katalyst | /Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/marutilai_Katalyst/src/katalyst/app/ui/input_handler.py | katalyst.app.ui.input_handler.InputHandler | import os
from rich.console import Console
from rich.table import Table
import sys
from typing import List, Optional, Callable, Union, Dict, Any
from rich.syntax import Syntax
from rich.prompt import Prompt, Confirm
from rich.panel import Panel
class InputHandler:
"""Unified handler for all user input operations i... |
class InputHandler:
'''Unified handler for all user input operations in Katalyst.'''
def __init__(self, console: Optional[Console]=None):
'''
Initialize the InputHandler.
Args:
console: Optional Rich Console instance. Creates new one if not provided.
'''
pas... | 11 | 11 | 41 | 5 | 25 | 12 | 4 | 0.49 | 0 | 18 | 0 | 0 | 10 | 1 | 10 | 10 | 424 | 58 | 247 | 98 | 183 | 122 | 122 | 45 | 110 | 12 | 0 | 3 | 41 |
328,174 | marutilai/Katalyst | /Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/marutilai_Katalyst/src/katalyst/data_science_agent/kernel_manager_simple.py | katalyst.data_science_agent.kernel_manager_simple.SimpleKernelManager | from queue import Empty
from typing import Dict, Any, Optional
import time
import os
from jupyter_client import KernelManager
from katalyst.katalyst_core.utils.logger import get_logger
class SimpleKernelManager:
"""Simple kernel manager without complex state management."""
def __init__(self):
self.log... |
class SimpleKernelManager:
'''Simple kernel manager without complex state management.'''
def __init__(self):
pass
def ensure_kernel(self) -> None:
'''Ensure kernel is running.'''
pass
def execute_code(self, code: str, timeout: int=120) -> Dict[str, Any]:
'''Execute co... | 6 | 5 | 28 | 3 | 22 | 3 | 6 | 0.16 | 0 | 6 | 0 | 0 | 5 | 3 | 5 | 5 | 148 | 19 | 111 | 19 | 105 | 18 | 89 | 18 | 83 | 15 | 0 | 4 | 29 |
328,175 | marutilai/Katalyst | /Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/marutilai_Katalyst/src/katalyst/katalyst_core/utils/langchain_models.py | langchain_models.DummyResponse | from pydantic import BaseModel
class DummyResponse(BaseModel):
response: str |
class DummyResponse(BaseModel):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 82 | 2 | 0 | 2 | 1 | 1 | 0 | 2 | 1 | 1 | 0 | 5 | 0 | 0 |
328,176 | marutilai/Katalyst | /Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/marutilai_Katalyst/src/katalyst/katalyst_core/utils/langchain_models.py | langchain_models.RetryChatLiteLLMRouter | from tenacity import retry, stop_after_attempt, wait_fixed, retry_if_exception_type
from pydantic import BaseModel
from typing import Optional, Any
from langchain_litellm import ChatLiteLLMRouter
class RetryChatLiteLLMRouter(ChatLiteLLMRouter):
def __init__(self, *args, **kwargs):
super().__init__(*args, ... |
class RetryChatLiteLLMRouter(ChatLiteLLMRouter):
def __init__(self, *args, **kwargs):
pass
def _convert_tool_choice(self, tool_choice):
'''Convert LangChain tool_choice values to OpenAI-compatible values'''
pass
def _validate_and_return_structured_response(self, response: Any, re... | 8 | 2 | 8 | 0 | 7 | 1 | 2 | 0.09 | 1 | 6 | 0 | 0 | 5 | 0 | 5 | 5 | 61 | 4 | 53 | 31 | 27 | 5 | 30 | 10 | 24 | 4 | 1 | 2 | 10 |
328,177 | marutilai/Katalyst | /Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/marutilai_Katalyst/src/katalyst/katalyst_core/utils/models.py | models.EnhancedPlannerOutput | from pydantic import BaseModel, Field
from typing import List, Optional, Dict
class EnhancedPlannerOutput(BaseModel):
subtasks: List[TaskInfo] = Field(..., description='List of subtasks generated by the planner LLM, each as a single actionable instruction with task type classification.') |
class EnhancedPlannerOutput(BaseModel):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 82 | 5 | 0 | 5 | 2 | 4 | 0 | 2 | 2 | 1 | 0 | 5 | 0 | 0 |
328,178 | marutilai/Katalyst | /Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/marutilai_Katalyst/src/katalyst/katalyst_core/utils/models.py | models.PlannerOutput | from typing import List, Optional, Dict
from pydantic import BaseModel, Field
class PlannerOutput(BaseModel):
subtasks: List[str] = Field(..., description='List of subtasks generated by the planner LLM, each as a single actionable instruction.') |
class PlannerOutput(BaseModel):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 82 | 5 | 0 | 5 | 2 | 4 | 0 | 2 | 2 | 1 | 0 | 5 | 0 | 0 |
328,179 | marutilai/Katalyst | /Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/marutilai_Katalyst/src/katalyst/katalyst_core/utils/models.py | models.ReplannerOutput | from typing import List, Optional, Dict
from pydantic import BaseModel, Field
class ReplannerOutput(BaseModel):
is_complete: bool = Field(..., description='True if the overall goal is achieved, False otherwise.')
subtasks: List[str] = Field(default_factory=list, description='New list of subtasks if not complet... |
class ReplannerOutput(BaseModel):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 82 | 8 | 0 | 8 | 3 | 7 | 0 | 3 | 3 | 2 | 0 | 5 | 0 | 0 |
328,180 | marutilai/Katalyst | /Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/marutilai_Katalyst/src/katalyst/katalyst_core/utils/models.py | models.RequestUserInputArgs | from typing import List, Optional, Dict
from pydantic import BaseModel, Field
class RequestUserInputArgs(BaseModel):
"""Arguments for the request_user_input tool."""
question_to_ask_user: str = Field(..., description='The question to ask the user')
suggested_responses: List[str] = Field(..., description='L... |
class RequestUserInputArgs(BaseModel):
'''Arguments for the request_user_input tool.'''
pass | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0.14 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 82 | 9 | 1 | 7 | 3 | 6 | 1 | 3 | 3 | 2 | 0 | 5 | 0 | 0 |
328,181 | marutilai/Katalyst | /Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/marutilai_Katalyst/src/katalyst/katalyst_core/utils/models.py | models.TaskInfo | from pydantic import BaseModel, Field
class TaskInfo(BaseModel):
description: str = Field(..., description='The task to be performed')
task_type: TaskType = Field(..., description='Classification of the task') |
class TaskInfo(BaseModel):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 82 | 3 | 0 | 3 | 3 | 2 | 0 | 3 | 3 | 2 | 0 | 5 | 0 | 0 |
328,182 | marutilai/Katalyst | /Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/marutilai_Katalyst/src/katalyst/katalyst_core/utils/models.py | models.TaskType | from enum import Enum
class TaskType(str, Enum):
TEST_CREATION = 'test_creation'
REFACTOR = 'refactor'
DOCUMENTATION = 'documentation'
DATA_EXPLORATION = 'data_exploration'
FEATURE_ENGINEERING = 'feature_engineering'
MODEL_TRAINING = 'model_training'
MODEL_EVALUATION = 'model_evaluation'
... |
class TaskType(str, Enum):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0.33 | 2 | 0 | 0 | 0 | 0 | 0 | 0 | 115 | 14 | 2 | 9 | 9 | 8 | 3 | 9 | 9 | 8 | 0 | 4 | 0 | 0 |
328,183 | marutilai/Katalyst | /Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/marutilai_Katalyst/src/katalyst/katalyst_core/state.py | state.KatalystState | from typing import List, Tuple, Optional, Union, Callable, Dict, Any, Set
from katalyst.app import config
from langchain_core.agents import AgentAction, AgentFinish
from langchain_core.messages import BaseMessage
from pydantic import BaseModel, Field
class KatalystState(BaseModel):
task: str = Field(..., descripti... | null | 2 | 0 | 0 | 0 | 0 | 0 | 0 | 0.09 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 82 | 115 | 8 | 99 | 27 | 97 | 9 | 27 | 27 | 25 | 0 | 5 | 0 | 0 |
328,184 | marutilai/Katalyst | /Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/marutilai_Katalyst/src/katalyst/katalyst_core/utils/task_manager.py | task_manager.TaskManager | from pathlib import Path
from typing import List, Dict, Any, Optional, Tuple, Set
import json
from katalyst.app.config import KATALYST_DIR
from katalyst.katalyst_core.utils.logger import get_logger
class TaskManager:
"""Manages tasks with automatic persistence to disk (Singleton)."""
_instance = None
def ... |
class TaskManager:
'''Manages tasks with automatic persistence to disk (Singleton).'''
def __new__(cls, file_path: Optional[Path]=None):
'''Ensure only one instance exists (Singleton pattern).'''
pass
def __init__(self, file_path: Optional[Path]=None):
'''
Initialize TaskM... | 23 | 18 | 17 | 3 | 9 | 5 | 3 | 0.55 | 0 | 11 | 0 | 0 | 16 | 5 | 17 | 17 | 320 | 63 | 166 | 54 | 142 | 92 | 141 | 43 | 123 | 9 | 0 | 2 | 49 |
328,185 | marutilai/Katalyst | /Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/marutilai_Katalyst/src/katalyst/katalyst_core/utils/tool_repetition_detector.py | tool_repetition_detector.ToolRepetitionDetector | from pydantic import BaseModel, Field, ConfigDict
from collections import deque
import hashlib
import json
from typing import Dict, Any, Tuple
class ToolRepetitionDetector(BaseModel):
"""
Detects repetitive tool calls to prevent infinite loops.
This detector tracks recent tool calls and identifies when th... |
class ToolRepetitionDetector(BaseModel):
'''
Detects repetitive tool calls to prevent infinite loops.
This detector tracks recent tool calls and identifies when the agent
is stuck in a loop by calling the same tool with identical inputs
multiple times.
'''
def _hash_input(self, tool_input:... | 6 | 6 | 15 | 3 | 5 | 8 | 1 | 1.35 | 1 | 6 | 0 | 0 | 5 | 0 | 5 | 87 | 101 | 21 | 34 | 18 | 28 | 46 | 28 | 17 | 22 | 2 | 5 | 1 | 7 |
328,186 | saya-ashen/Dingent | /Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/saya-ashen_Dingent/src/dingent/cli/cli.py | dingent.cli.cli.ProjectInitializer | from pathlib import Path
from rich import print
from cookiecutter.exceptions import RepositoryNotFound
import typer
from cookiecutter.main import cookiecutter
class ProjectInitializer:
"""Handles the logic for the 'init' command."""
def __init__(self, project_name, template, checkout):
self.project_na... |
class ProjectInitializer:
'''Handles the logic for the 'init' command.'''
def __init__(self, project_name, template, checkout):
pass
def run(self):
'''Executes the entire project initialization workflow.'''
pass
def _create_from_template(self):
'''Builds the project u... | 5 | 4 | 9 | 0 | 9 | 1 | 2 | 0.11 | 0 | 2 | 0 | 0 | 4 | 4 | 4 | 4 | 43 | 4 | 35 | 13 | 30 | 4 | 29 | 12 | 24 | 3 | 0 | 1 | 6 |
328,187 | saya-ashen/Dingent | /Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/saya-ashen_Dingent/src/dingent/cli/cli.py | dingent.cli.cli.Service | from pathlib import Path
import subprocess
class Service:
def __init__(self, name: str, command: list[str], cwd: Path, color: str, env: dict[str, str] | None=None, open_browser_hint: bool=False):
self.name = name
self.command = command
self.cwd = cwd
self.color = color
self... |
class Service:
def __init__(self, name: str, command: list[str], cwd: Path, color: str, env: dict[str, str] | None=None, open_browser_hint: bool=False):
pass | 2 | 0 | 16 | 0 | 16 | 0 | 1 | 0 | 0 | 6 | 0 | 0 | 1 | 7 | 1 | 1 | 17 | 0 | 17 | 17 | 7 | 0 | 9 | 9 | 7 | 1 | 0 | 0 | 1 |
328,188 | saya-ashen/Dingent | /Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/saya-ashen_Dingent/src/dingent/cli/cli.py | dingent.cli.cli.ServiceSupervisor | import os
import re
import typer
import webbrowser
from rich import print
import threading
import subprocess
from rich.text import Text
import time
import queue
class ServiceSupervisor:
def __init__(self, services: list[Service], auto_open_frontend: bool=True):
self.services = services
self.auto_o... |
class ServiceSupervisor:
def __init__(self, services: list[Service], auto_open_frontend: bool=True):
pass
def start_all(self):
pass
def stop_all(self, force: bool=False):
pass
def _start_service(self, svc: Service):
pass
def _stream_reader(self, svc: Service):
... | 7 | 0 | 17 | 1 | 17 | 0 | 5 | 0 | 0 | 14 | 1 | 0 | 6 | 6 | 6 | 6 | 109 | 9 | 100 | 28 | 92 | 0 | 90 | 28 | 82 | 8 | 0 | 4 | 28 |
328,189 | saya-ashen/Dingent | /Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/saya-ashen_Dingent/src/dingent/cli/context.py | dingent.cli.context.CliContext | from functools import cached_property
from dingent.core.config_manager import ConfigManager
from importlib import resources
from typing import TYPE_CHECKING, cast
from pathlib import Path
from dingent.core.utils import find_project_root
from dingent.core.log_manager import LogManager
class CliContext:
def __init_... |
class CliContext:
def __init__(self):
'''
The __init__ method is now empty. All properties are loaded lazily
when they are first accessed.
'''
pass
@cached_property
def config_manager(self) -> 'ConfigManager':
'''Lazily gets the config_manager from the app_c... | 14 | 7 | 4 | 0 | 2 | 1 | 1 | 0.42 | 0 | 4 | 2 | 0 | 7 | 0 | 7 | 7 | 40 | 6 | 24 | 18 | 10 | 10 | 18 | 12 | 10 | 1 | 0 | 0 | 7 |
328,190 | saya-ashen/Dingent | /Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/saya-ashen_Dingent/src/dingent/core/assistant_manager.py | dingent.core.assistant_manager.Assistant | from .plugin_manager import PluginInstance, PluginManager
from langchain_mcp_adapters.tools import load_mcp_tools
from contextlib import AsyncExitStack, asynccontextmanager
from collections.abc import Callable, Iterable
from .settings import AssistantSettings
class Assistant:
"""
运行期 Assistant。
destination... |
class Assistant:
'''
运行期 Assistant。
destinations: 当前活动 Workflow 中(经 workflow_manager.instantiate_workflow_assistants 构建后)
此 Assistant 可直接到达的下游 Assistant 名称(或 ID)列表。
单一活动 Workflow 场景下,可以直接覆盖。
'''
def __init__(self, assistant_id: str, name: str, description: str, ... | 10 | 3 | 11 | 0 | 10 | 1 | 2 | 0.2 | 0 | 10 | 4 | 0 | 4 | 6 | 5 | 5 | 79 | 7 | 60 | 42 | 43 | 12 | 46 | 28 | 39 | 3 | 0 | 3 | 13 |
328,191 | saya-ashen/Dingent | /Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/saya-ashen_Dingent/src/dingent/core/assistant_manager.py | dingent.core.assistant_manager.AssistantManager | from collections.abc import Callable, Iterable
from .settings import AssistantSettings
from pydantic import BaseModel, ValidationError
from .config_manager import ConfigManager
import asyncio
from .plugin_manager import PluginInstance, PluginManager
from dingent.core.log_manager import LogManager
class AssistantManage... |
class AssistantManager:
'''
Assistant 运行期实例管理器(与 ConfigManager 解耦,仅消费其数据):
- 负责按需(Lazy)创建 Assistant 实例(包含插件实例)。
- 订阅 ConfigManager 的 on_change 事件,自动感知配置变更:
* 删除的助手 -> 关闭并移除实例
* 修改的助手(配置 hash 变化)-> 关闭并重建(可配置策略)
* 新增的助手 -> 不主动创建(按需)
- 提供 rebuild() 进行全量重建。
- 提供 refresh_sett... | 21 | 14 | 17 | 1 | 12 | 4 | 4 | 0.43 | 0 | 16 | 5 | 0 | 20 | 9 | 20 | 20 | 391 | 43 | 244 | 91 | 213 | 106 | 219 | 74 | 196 | 8 | 0 | 5 | 71 |
328,192 | saya-ashen/Dingent | /Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/saya-ashen_Dingent/src/dingent/core/assistant_manager.py | dingent.core.assistant_manager.RunnableTool | from collections.abc import Callable, Iterable
from typing import Any
from mcp.types import Tool
from pydantic import BaseModel, ValidationError
class RunnableTool(BaseModel):
tool: Tool
run: Callable[[dict], Any] |
class RunnableTool(BaseModel):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 82 | 3 | 0 | 3 | 1 | 2 | 0 | 3 | 1 | 2 | 0 | 5 | 0 | 0 |
328,193 | saya-ashen/Dingent | /Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/saya-ashen_Dingent/src/dingent/core/config_manager.py | dingent.core.config_manager.AssistantNotFoundError | class AssistantNotFoundError(ConfigError, KeyError):
pass | class AssistantNotFoundError(ConfigError, KeyError):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 | 0 | 0 | 0 | 0 | 0 | 0 | 13 | 2 | 0 | 2 | 1 | 1 | 0 | 2 | 1 | 1 | 0 | 5 | 0 | 0 |
328,194 | saya-ashen/Dingent | /Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/saya-ashen_Dingent/src/dingent/core/config_manager.py | dingent.core.config_manager.ConfigError | class ConfigError(Exception):
pass | class ConfigError(Exception):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 2 | 0 | 0 | 0 | 10 | 2 | 0 | 2 | 1 | 1 | 0 | 2 | 1 | 1 | 0 | 3 | 0 | 0 |
328,195 | saya-ashen/Dingent | /Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/saya-ashen_Dingent/src/dingent/core/config_manager.py | dingent.core.config_manager.ConfigManager | import time
from contextlib import contextmanager
import tomlkit
import yaml
from threading import RLock
from .settings import AppSettings, AssistantSettings
from typing import Any
from copy import deepcopy
from .types import AssistantCreate, AssistantUpdate, PluginUserConfig
import shutil
from pathlib import Path
from... |
class ConfigManager:
'''
职责聚焦版:
- 负责拆分式配置文件的 I/O(global / assistants / plugins)
- 提供线程安全获取与更新
- 提供快照/恢复、事务批处理、迁移框架、on_change 订阅
- 不做:插件业务逻辑(增删单个插件)、工作流对象管理、跨服务协作
目录结构:
project_root/
dingent.toml
config/
assistants/{assistant_id}.yaml
plugins... | 29 | 9 | 16 | 1 | 13 | 2 | 4 | 0.21 | 0 | 18 | 7 | 0 | 27 | 13 | 27 | 27 | 476 | 48 | 358 | 144 | 321 | 74 | 337 | 125 | 309 | 15 | 0 | 4 | 105 |
328,196 | saya-ashen/Dingent | /Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/saya-ashen_Dingent/src/dingent/core/config_manager.py | dingent.core.config_manager.ConfigMigrationRegistry | from collections.abc import Callable
class ConfigMigrationRegistry:
def __init__(self):
self._migrations: dict[int, Callable[[dict], dict]] = {}
def register(self, from_version: int, func: Callable[[dict], dict]) -> None:
self._migrations[from_version] = func
def migrate(self, data: dict... |
class ConfigMigrationRegistry:
def __init__(self):
pass
def register(self, from_version: int, func: Callable[[dict], dict]) -> None:
pass
def migrate(self, data: dict, current_version: int, target_version: int) -> dict:
'''
顺序执行 from_version -> from_version+1 ... 直到 targe... | 4 | 1 | 5 | 0 | 4 | 1 | 2 | 0.31 | 0 | 4 | 1 | 0 | 3 | 1 | 3 | 3 | 19 | 2 | 13 | 6 | 9 | 4 | 13 | 6 | 9 | 3 | 0 | 2 | 5 |
328,197 | saya-ashen/Dingent | /Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/saya-ashen_Dingent/src/dingent/core/config_manager.py | dingent.core.config_manager.ConfigUpdateError | class ConfigUpdateError(ConfigError):
pass | class ConfigUpdateError(ConfigError):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 10 | 2 | 0 | 2 | 1 | 1 | 0 | 2 | 1 | 1 | 0 | 4 | 0 | 0 |
328,198 | saya-ashen/Dingent | /Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/saya-ashen_Dingent/src/dingent/core/config_manager.py | dingent.core.config_manager.MigrationError | class MigrationError(Exception):
pass | class MigrationError(Exception):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 10 | 2 | 0 | 2 | 1 | 1 | 0 | 2 | 1 | 1 | 0 | 3 | 0 | 0 |
328,199 | saya-ashen/Dingent | /Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/saya-ashen_Dingent/src/dingent/core/config_manager.py | dingent.core.config_manager.SecretAction | from enum import Enum, auto
class SecretAction(Enum):
SAVE = auto()
LOAD = auto() |
class SecretAction(Enum):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0.67 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 49 | 3 | 0 | 3 | 3 | 2 | 2 | 3 | 3 | 2 | 0 | 4 | 0 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.