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
326,400
danielmeppiel/awd-cli
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/danielmeppiel_awd-cli/src/apm_cli/compilation/agents_compiler.py
apm_cli.compilation.agents_compiler.AgentsCompiler
import datetime from ..primitives.discovery import discover_primitives from pathlib import Path from ..version import get_version from typing import List, Optional, Dict, Any from .link_resolver import resolve_markdown_links, validate_link_targets from .template_builder import build_conditional_sections, generate_agent...
class AgentsCompiler: '''Main compiler for generating AGENTS.md files.''' def __init__(self, base_dir: str='.'): '''Initialize the compiler. Args: base_dir (str): Base directory for compilation. Defaults to current directory. ''' pass def compile(self, config: ...
8
8
27
4
14
8
3
0.61
0
11
4
0
7
3
7
7
195
37
98
33
90
60
70
30
62
9
0
4
23
326,401
danielmeppiel/awd-cli
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/danielmeppiel_awd-cli/src/apm_cli/compilation/agents_compiler.py
apm_cli.compilation.agents_compiler.CompilationConfig
from dataclasses import dataclass from typing import List, Optional, Dict, Any from pathlib import Path @dataclass class CompilationConfig: """Configuration for AGENTS.md compilation.""" output_path: str = 'AGENTS.md' chatmode: Optional[str] = None resolve_links: bool = True dry_run: bool = False ...
@dataclass class CompilationConfig: '''Configuration for AGENTS.md compilation.''' @classmethod def from_apm_yml(cls, **overrides) -> 'CompilationConfig': '''Create configuration from apm.yml with command-line overrides. Args: **overrides: Command-line arguments that override con...
4
2
41
9
21
12
8
0.48
0
2
0
0
0
0
1
1
49
10
27
14
22
13
26
12
22
8
0
3
8
326,402
danielmeppiel/awd-cli
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/danielmeppiel_awd-cli/src/apm_cli/compilation/agents_compiler.py
apm_cli.compilation.agents_compiler.CompilationResult
from typing import List, Optional, Dict, Any from dataclasses import dataclass @dataclass class CompilationResult: """Result of AGENTS.md compilation.""" success: bool output_path: str content: str warnings: List[str] errors: List[str] stats: Dict[str, Any]
@dataclass class CompilationResult: '''Result of AGENTS.md compilation.''' pass
2
1
0
0
0
0
0
0.14
0
0
0
0
0
0
0
0
8
0
7
1
6
1
7
1
6
0
0
0
0
326,403
danielmeppiel/awd-cli
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/danielmeppiel_awd-cli/src/apm_cli/compilation/template_builder.py
apm_cli.compilation.template_builder.TemplateData
from typing import List, Dict, Optional, Tuple from dataclasses import dataclass @dataclass class TemplateData: """Data structure for template generation.""" instructions_content: str timestamp: str version: str chatmode_content: Optional[str] = None
@dataclass class TemplateData: '''Data structure for template generation.''' pass
2
1
0
0
0
0
0
0.2
0
0
0
0
0
0
0
0
6
0
5
2
4
1
5
2
4
0
0
0
0
326,404
danielmeppiel/awd-cli
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/danielmeppiel_awd-cli/src/apm_cli/core/script_runner.py
apm_cli.core.script_runner.PromptCompiler
from pathlib import Path from typing import Dict, Optional class PromptCompiler: """Compiles .prompt.md files with parameter substitution.""" def __init__(self): """Initialize compiler.""" self.compiled_dir = Path('.apm/compiled') def compile(self, prompt_file: str, params: Dict[str, str]...
class PromptCompiler: '''Compiles .prompt.md files with parameter substitution.''' def __init__(self): '''Initialize compiler.''' pass def compile(self, prompt_file: str, params: Dict[str, str]) -> str: '''Compile a .prompt.md file with parameter substitution. Args: ...
4
4
21
4
10
8
2
0.77
0
3
0
0
3
1
3
3
69
14
31
17
27
24
29
16
25
4
0
2
7
326,405
danielmeppiel/awd-cli
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/danielmeppiel_awd-cli/src/apm_cli/core/script_runner.py
apm_cli.core.script_runner.ScriptRunner
from typing import Dict, Optional import re from pathlib import Path import subprocess import yaml class ScriptRunner: """Executes APM scripts with auto-compilation of .prompt.md files.""" def __init__(self, compiler=None): """Initialize script runner with optional compiler.""" self.compiler =...
class ScriptRunner: '''Executes APM scripts with auto-compilation of .prompt.md files.''' def __init__(self, compiler=None): '''Initialize script runner with optional compiler.''' pass def run_script(self, script_name: str, params: Dict[str, str]) -> bool: '''Run a script from apm...
7
7
27
5
14
9
5
0.6
0
8
1
0
6
1
6
6
172
33
87
35
79
52
79
31
72
15
0
4
27
326,406
danielmeppiel/awd-cli
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/danielmeppiel_awd-cli/src/apm_cli/factory.py
apm_cli.factory.ClientFactory
from .adapters.client.vscode import VSCodeClientAdapter class ClientFactory: """Factory for creating MCP client adapters.""" @staticmethod def create_client(client_type): """Create a client adapter based on the specified type. Args: client_type (str): Type of client adapter to...
class ClientFactory: '''Factory for creating MCP client adapters.''' @staticmethod def create_client(client_type): '''Create a client adapter based on the specified type. Args: client_type (str): Type of client adapter to create. Returns: MCPClientAdapter: An...
3
2
21
5
7
9
2
1.11
0
2
1
0
0
0
1
1
25
6
9
4
6
10
6
3
4
2
0
1
2
326,407
danielmeppiel/awd-cli
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/danielmeppiel_awd-cli/src/apm_cli/factory.py
apm_cli.factory.PackageManagerFactory
from .adapters.package_manager.default_manager import DefaultMCPPackageManager class PackageManagerFactory: """Factory for creating MCP package manager adapters.""" @staticmethod def create_package_manager(manager_type='default'): """Create a package manager adapter based on the specified type. ...
class PackageManagerFactory: '''Factory for creating MCP package manager adapters.''' @staticmethod def create_package_manager(manager_type='default'): '''Create a package manager adapter based on the specified type. Args: manager_type (str, optional): Type of package manager ad...
3
2
22
5
7
10
2
1.22
0
2
1
0
0
0
1
1
26
6
9
4
6
11
6
3
4
2
0
1
2
326,408
danielmeppiel/awd-cli
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/danielmeppiel_awd-cli/src/apm_cli/primitives/models.py
apm_cli.primitives.models.Chatmode
from typing import Optional, List, Union from dataclasses import dataclass from pathlib import Path @dataclass class Chatmode: """Represents a chatmode primitive.""" name: str file_path: Path description: str apply_to: Optional[str] content: str author: Optional[str] = None version: Opt...
@dataclass class Chatmode: '''Represents a chatmode primitive.''' def validate(self) -> List[str]: '''Validate chatmode structure. Returns: List[str]: List of validation errors. ''' pass
3
2
12
1
7
4
3
0.4
0
1
0
0
1
0
1
1
22
2
15
5
13
6
15
5
13
3
0
1
3
326,409
danielmeppiel/awd-cli
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/danielmeppiel_awd-cli/src/apm_cli/primitives/models.py
apm_cli.primitives.models.Context
from pathlib import Path from typing import Optional, List, Union from dataclasses import dataclass @dataclass class Context: """Represents a context primitive.""" name: str file_path: Path content: str description: Optional[str] = None author: Optional[str] = None version: Optional[str] = ...
@dataclass class Context: '''Represents a context primitive.''' def validate(self) -> List[str]: '''Validate context structure. Returns: List[str]: List of validation errors. ''' pass
3
2
10
1
5
4
2
0.42
0
1
0
0
1
0
1
1
19
2
12
6
10
5
12
6
10
2
0
1
2
326,410
danielmeppiel/awd-cli
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/danielmeppiel_awd-cli/src/apm_cli/primitives/models.py
apm_cli.primitives.models.Instruction
from pathlib import Path from typing import Optional, List, Union from dataclasses import dataclass @dataclass class Instruction: """Represents an instruction primitive.""" name: str file_path: Path description: str apply_to: str content: str author: Optional[str] = None version: Option...
@dataclass class Instruction: '''Represents an instruction primitive.''' def validate(self) -> List[str]: '''Validate instruction structure. Returns: List[str]: List of validation errors. ''' pass
3
2
14
1
9
4
4
0.35
0
1
0
0
1
0
1
1
24
2
17
5
15
6
17
5
15
4
0
1
4
326,411
danielmeppiel/awd-cli
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/danielmeppiel_awd-cli/src/apm_cli/primitives/models.py
apm_cli.primitives.models.PrimitiveCollection
from typing import Optional, List, Union from dataclasses import dataclass @dataclass class PrimitiveCollection: """Collection of discovered primitives.""" chatmodes: List[Chatmode] instructions: List[Instruction] contexts: List[Context] def __init__(self): self.chatmodes = [] self...
@dataclass class PrimitiveCollection: '''Collection of discovered primitives.''' def __init__(self): pass def add_primitive(self, primitive: Primitive) -> None: '''Add a primitive to the appropriate collection.''' pass def all_primitives(self) -> List[Primitive]: '''Ge...
6
4
5
0
4
1
2
0.19
0
6
3
0
4
0
4
4
29
4
21
5
16
4
18
5
13
4
0
1
7
326,412
danielmeppiel/awd-cli
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/danielmeppiel_awd-cli/src/apm_cli/registry/client.py
apm_cli.registry.client.SimpleRegistryClient
import os from typing import Dict, List, Optional, Any, Tuple import requests class SimpleRegistryClient: """Simple client for querying MCP registries for server discovery.""" def __init__(self, registry_url: Optional[str]=None): """Initialize the registry client. Args: registry_u...
class SimpleRegistryClient: '''Simple client for querying MCP registries for server discovery.''' def __init__(self, registry_url: Optional[str]=None): '''Initialize the registry client. Args: registry_url (str, optional): URL of the MCP registry. If not provided, u...
7
7
23
5
9
9
3
1.04
0
6
0
0
6
2
6
6
149
37
55
24
48
57
49
24
42
6
0
3
16
326,413
danielmeppiel/awd-cli
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/danielmeppiel_awd-cli/src/apm_cli/registry/integration.py
apm_cli.registry.integration.RegistryIntegration
from typing import Dict, List, Any, Optional from .client import SimpleRegistryClient import requests class RegistryIntegration: """Integration class for connecting registry discovery to package manager.""" def __init__(self, registry_url: Optional[str]=None): """Initialize the registry integration. ...
class RegistryIntegration: '''Integration class for connecting registry discovery to package manager.''' def __init__(self, registry_url: Optional[str]=None): '''Initialize the registry integration. Args: registry_url (str, optional): URL of the MCP registry. If not...
8
8
20
4
8
8
3
0.98
0
5
1
0
7
1
7
7
147
32
58
20
50
57
50
20
42
7
0
3
20
326,414
danielmeppiel/awd-cli
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/danielmeppiel_awd-cli/src/apm_cli/runtime/base.py
apm_cli.runtime.base.RuntimeAdapter
from typing import Dict, Any, Optional from abc import ABC, abstractmethod class RuntimeAdapter(ABC): """Base adapter interface for LLM runtimes.""" @abstractmethod def execute_prompt(self, prompt_content: str, **kwargs) -> str: """Execute a single prompt and return the response. Args: ...
class RuntimeAdapter(ABC): '''Base adapter interface for LLM runtimes.''' @abstractmethod def execute_prompt(self, prompt_content: str, **kwargs) -> str: '''Execute a single prompt and return the response. Args: prompt_content: The prompt text to execute **kwargs: Ad...
14
7
7
1
2
4
1
1.25
1
3
0
2
4
0
6
26
57
12
20
12
6
25
13
7
6
1
4
0
6
326,415
danielmeppiel/awd-cli
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/danielmeppiel_awd-cli/src/apm_cli/runtime/codex_runtime.py
apm_cli.runtime.codex_runtime.CodexRuntime
import subprocess from typing import Dict, Any, Optional from .base import RuntimeAdapter import shutil class CodexRuntime(RuntimeAdapter): """APM adapter for the Codex CLI.""" def __init__(self, model_name: Optional[str]=None): """Initialize Codex runtime. Args: model_name: Model...
class CodexRuntime(RuntimeAdapter): '''APM adapter for the Codex CLI.''' def __init__(self, model_name: Optional[str]=None): '''Initialize Codex runtime. Args: model_name: Model name (not used for Codex, included for compatibility) ''' pass def execute_prompt(s...
10
7
19
3
11
6
3
0.51
1
8
0
0
5
1
7
33
141
25
79
23
67
40
47
18
37
8
5
3
18
326,416
danielmeppiel/awd-cli
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/danielmeppiel_awd-cli/src/apm_cli/runtime/factory.py
apm_cli.runtime.factory.RuntimeFactory
from .base import RuntimeAdapter from typing import List, Dict, Any, Optional, Type from .codex_runtime import CodexRuntime from .llm_runtime import LLMRuntime class RuntimeFactory: """Factory for creating runtime adapters with auto-detection.""" _RUNTIME_ADAPTERS: List[Type[RuntimeAdapter]] = [CodexRuntime, L...
class RuntimeFactory: '''Factory for creating runtime adapters with auto-detection.''' @classmethod def get_available_runtimes(cls) -> List[Dict[str, Any]]: '''Get list of available runtimes on the system. Returns: List[Dict[str, Any]]: List of available runtime information ...
11
6
21
3
10
7
4
0.67
0
7
1
0
0
0
5
5
122
22
61
20
50
41
43
13
37
5
0
4
18
326,417
danielmeppiel/awd-cli
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/danielmeppiel_awd-cli/src/apm_cli/runtime/llm_runtime.py
apm_cli.runtime.llm_runtime.LLMRuntime
from typing import Dict, Any, Optional import subprocess from .base import RuntimeAdapter class LLMRuntime(RuntimeAdapter): """APM adapter for the llm CLI.""" def __init__(self, model_name: Optional[str]=None): """Initialize LLM runtime with specified model. Args: model_name: Name...
class LLMRuntime(RuntimeAdapter): '''APM adapter for the llm CLI.''' def __init__(self, model_name: Optional[str]=None): '''Initialize LLM runtime with specified model. Args: model_name: Name of the LLM model to use (optional) ''' pass def execute_prompt(self, ...
12
8
17
2
10
5
3
0.49
1
8
0
0
5
1
8
34
146
25
83
28
71
41
56
22
47
7
5
3
20
326,418
danielmeppiel/awd-cli
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/danielmeppiel_awd-cli/src/apm_cli/runtime/manager.py
apm_cli.runtime.manager.RuntimeManager
import tempfile import click from typing import Dict, List, Optional from colorama import Fore, Style import sys import shutil import subprocess from pathlib import Path class RuntimeManager: """Manages AI runtime installation and configuration via embedded scripts.""" def __init__(self): self.runtime...
class RuntimeManager: '''Manages AI runtime installation and configuration via embedded scripts.''' def __init__(self): pass def get_embedded_script(self, script_name: str) -> str: '''Get embedded setup script content.''' pass def get_common_script(self) -> str: '''Ge...
11
10
20
3
15
3
4
0.18
0
7
0
0
10
2
10
10
210
38
148
46
136
26
119
40
108
8
0
4
37
326,419
danielmeppiel/awd-cli
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/danielmeppiel_awd-cli/src/apm_cli/workflow/parser.py
apm_cli.workflow.parser.WorkflowDefinition
class WorkflowDefinition: """Simple container for workflow data.""" def __init__(self, name, file_path, metadata, content): """Initialize a workflow definition. Args: name (str): Name of the workflow. file_path (str): Path to the workflow file. metadata (dic...
class WorkflowDefinition: '''Simple container for workflow data.''' def __init__(self, name, file_path, metadata, content): '''Initialize a workflow definition. Args: name (str): Name of the workflow. file_path (str): Path to the workflow file. metadata (dict...
3
3
14
1
7
7
2
0.93
0
0
0
0
2
8
2
2
32
4
15
12
12
14
15
12
12
2
0
1
3
326,420
florence-bockting/elicito
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/florence-bockting_elicito/src/elicito/__init__.py
elicito.Elicit
import joblib from typing import Any import tensorflow as tf from elicito import initialization, losses, networks, optimization, plots, simulations, targets, types, utils from elicito.types import ExpertDict, Initializer, NFDict, Parallel, Parameter, SaveHist, SaveResults, Target, Trainer from elicito.elicit import exp...
class Elicit: ''' Configure the elicitation method ''' def __init__(self, model: dict[str, Any], parameters: list[Parameter], targets: list[Target], expert: ExpertDict, trainer: Trainer, optimizer: dict[str, Any], network: NFDict | None=None, initializer: Initializer | None=None): ''' ...
8
8
84
11
46
28
7
0.62
0
26
10
0
7
10
7
7
605
82
326
71
297
203
155
49
147
24
0
4
48
326,421
florence-bockting/elicito
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/florence-bockting_elicito/src/elicito/elicit.py
elicito.elicit.Dtype
import tensorflow as tf class Dtype: """ Create a tensorflow scalar or array depending on the vtype attribute. Attributes ---------- vtype Type of input x. dim Dimensionality of input x. Scalar: `dim = 1`; Vector: `dim > 1` Returns ------- : Tensor...
class Dtype: ''' Create a tensorflow scalar or array depending on the vtype attribute. Attributes ---------- vtype Type of input x. dim Dimensionality of input x. Scalar: `dim = 1`; Vector: `dim > 1` Returns ------- : Tensor of shape depending on `vty...
3
3
20
2
8
10
3
2.13
0
2
0
0
2
2
2
2
59
9
16
6
13
34
14
6
11
5
0
1
6
326,422
florence-bockting/elicito
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/florence-bockting_elicito/src/elicito/elicit.py
elicito.elicit.Expert
import tensorflow as tf from elicito.types import ExpertDict, Hyper, Initializer, Parameter, QueriesDict, Target, Trainer, Uniform from typing import Any, Callable, Optional class Expert: """ specify the expert data """ def data(self, dat: dict[str, list[tf.Tensor]]) -> ExpertDict: """ ...
class Expert: ''' specify the expert data ''' def data(self, dat: dict[str, list[tf.Tensor]]) -> ExpertDict: ''' Provide elicited-expert data for learning prior distributions. Parameters ---------- dat Elicited data from expert provided as dictionary...
3
3
51
6
8
37
1
4.53
0
6
1
0
2
0
2
2
108
14
17
8
12
77
8
6
5
1
0
0
2
326,423
florence-bockting/elicito
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/florence-bockting_elicito/src/elicito/elicit.py
elicito.elicit.Queries
from elicito.types import ExpertDict, Hyper, Initializer, Parameter, QueriesDict, Target, Trainer, Uniform from typing import Any, Callable, Optional class Queries: """ specify elicitation techniques """ def quantiles(self, quantiles: tuple[float, ...]) -> QueriesDict: """ Implement a ...
class Queries: ''' specify elicitation techniques ''' def quantiles(self, quantiles: tuple[float, ...]) -> QueriesDict: ''' Implement a quantile-based elicitation technique. Parameters ---------- quantiles Tuple with respective quantiles ranging betw...
5
5
21
4
6
11
2
2
0
6
1
0
4
0
4
4
91
19
24
12
19
48
18
12
13
3
0
2
6
326,424
florence-bockting/elicito
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/florence-bockting_elicito/src/elicito/exceptions.py
elicito.exceptions.MissingOptionalDependencyError
class MissingOptionalDependencyError(ImportError): """ Raised when an optional dependency is missing For example, plotting dependencies like matplotlib """ def __init__(self, callable_name: str, requirement: str) -> None: """ Initialise the error Parameters -------...
class MissingOptionalDependencyError(ImportError): ''' Raised when an optional dependency is missing For example, plotting dependencies like matplotlib ''' def __init__(self, callable_name: str, requirement: str) -> None: ''' Initialise the error Parameters ---------...
2
2
14
2
3
9
1
3.25
1
2
0
0
1
0
1
13
21
4
4
3
2
13
4
3
2
1
4
0
1
326,425
florence-bockting/elicito
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/florence-bockting_elicito/src/elicito/losses.py
elicito.losses.MMD2
from typing import Any, Optional, Union import tensorflow as tf class MMD2: """ Maximum mean discrepancy loss """ def __init__(self, kernel: str='energy', **kwargs: dict[Any, Any]): """ Compute the biased, squared maximum mean discrepancy Parameters ---------- ...
class MMD2: ''' Maximum mean discrepancy loss ''' def __init__(self, kernel: str='energy', **kwargs: dict[Any, Any]): ''' Compute the biased, squared maximum mean discrepancy Parameters ---------- kernel Kernel type used for computing the MMD. ...
6
6
35
6
12
19
2
1.66
0
7
0
0
5
2
5
5
183
35
59
38
39
98
40
24
34
4
0
1
10
326,426
florence-bockting/elicito
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/florence-bockting_elicito/src/elicito/networks.py
elicito.networks.ActNorm
import numpy as np from typing import Any, Callable, Optional import tensorflow as tf class ActNorm(tf.keras.Model): """Implement an Activation Normalization (ActNorm) Layer. Activation Normalization is learned invertible normalization, using a Scale (s) and Bias (b) vector:: y = s * x + b(forward...
null
6
6
23
2
9
13
2
1.95
1
8
0
0
5
2
5
5
146
23
44
19
33
86
28
14
22
3
1
1
9
326,427
florence-bockting/elicito
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/florence-bockting_elicito/src/elicito/networks.py
elicito.networks.AffineCoupling
import tensorflow as tf from numpy import pi as PI_CONST from typing import Any, Callable, Optional class AffineCoupling(tf.keras.Model): """Implement a conditional affine coupling block Implementation according to [1, 2], with additional options, such as residual blocks or Monte Carlo Dropout. [1] ...
class AffineCoupling(tf.keras.Model): '''Implement a conditional affine coupling block Implementation according to [1, 2], with additional options, such as residual blocks or Monte Carlo Dropout. [1] Kingma, D. P., & Dhariwal, P. (2018). Glow: Generative flow with invertible 1x1 convolutions. ...
5
5
44
4
18
24
3
1.52
1
9
1
0
4
4
4
4
193
22
71
38
45
108
31
17
26
4
1
1
10
326,428
florence-bockting/elicito
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/florence-bockting_elicito/src/elicito/networks.py
elicito.networks.BaseNormal
import tensorflow as tf from typing import Any, Callable, Optional class BaseNormal: """ standard normal base distribution for normalizing flow """ def __call__(self, num_params: int) -> Any: """ Multivariate standard normal distribution distribution has as many dimensions as ...
class BaseNormal: ''' standard normal base distribution for normalizing flow ''' def __call__(self, num_params: int) -> Any: ''' Multivariate standard normal distribution distribution has as many dimensions as parameters in the generative model. Parameters -----...
2
2
21
4
5
12
1
2.5
0
2
0
0
1
0
1
1
26
5
6
3
4
15
4
3
2
1
0
0
1
326,429
florence-bockting/elicito
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/florence-bockting_elicito/src/elicito/networks.py
elicito.networks.CouplingLayer
import numpy as np from typing import Any, Callable, Optional import tensorflow as tf class CouplingLayer(tf.keras.Model): """General wrapper for a coupling layer with different settings.""" def __init__(self, latent_dim: int, coupling_settings: Optional[dict[str, Any]]=None, coupling_design: str | Callable[[...
class CouplingLayer(tf.keras.Model): '''General wrapper for a coupling layer with different settings.''' def __init__(self, latent_dim: int, coupling_settings: Optional[dict[str, Any]]=None, coupling_design: str | Callable[[Any], Any]='affine', permutation: Optional[str]='fixed', use_act_norm: bool=True, act_...
7
7
48
5
19
27
4
1.41
1
14
5
0
6
7
6
6
295
34
116
62
77
164
65
30
58
10
1
1
21
326,430
florence-bockting/elicito
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/florence-bockting_elicito/src/elicito/networks.py
elicito.networks.DenseCouplingNet
from tensorflow.keras.models import Sequential import tensorflow as tf from tensorflow.keras.layers import Dense, Dropout from typing import Any, Callable, Optional class DenseCouplingNet(tf.keras.Model): """Implement a conditional version of a standard fully connected network. Would also work as an unconditi...
class DenseCouplingNet(tf.keras.Model): '''Implement a conditional version of a standard fully connected network. Would also work as an unconditional estimator. ''' def __init__(self, settings: dict[str, Any], dim_out: int, **kwargs: dict[str, Any]): '''Create a conditional coupling net (FC ne...
3
3
55
7
27
25
6
1
1
8
2
0
2
2
2
2
118
18
54
17
44
54
34
10
31
7
1
2
12
326,431
florence-bockting/elicito
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/florence-bockting_elicito/src/elicito/networks.py
elicito.networks.InvertibleNetwork
import tensorflow as tf from typing import Any, Callable, Optional import numpy as np class InvertibleNetwork(tf.keras.Model): """Implement a chain of conditional invertible coupling layers Implementation for conditional density estimation. """ available_designs = ('affine', 'spline', 'interleaved') ...
null
9
7
48
5
21
23
3
1.08
1
13
1
0
4
7
6
6
300
37
130
64
94
141
63
34
56
6
1
2
19
326,432
florence-bockting/elicito
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/florence-bockting_elicito/src/elicito/networks.py
elicito.networks.MCDropout
from tensorflow.keras.layers import Dense, Dropout from typing import Any, Callable, Optional import tensorflow as tf class MCDropout(tf.keras.Model): """Implement Monte Carlo Dropout Dropout is implemented as a Bayesian approximation according to [1]. [1] Gal, Y., & Ghahramani, Z. (2016, June). Dropout ...
class MCDropout(tf.keras.Model): '''Implement Monte Carlo Dropout Dropout is implemented as a Bayesian approximation according to [1]. [1] Gal, Y., & Ghahramani, Z. (2016, June). Dropout as a bayesian approximation: Representing model uncertainty in deep learning. In international conference on mac...
3
3
14
3
3
9
1
3.57
1
5
0
0
2
1
2
2
39
9
7
5
4
25
7
5
4
1
1
0
2
326,433
florence-bockting/elicito
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/florence-bockting_elicito/src/elicito/networks.py
elicito.networks.MetaDictSetting
from typing import Any, Callable, Optional class MetaDictSetting: """Implement interface for a default meta_dict""" def __init__(self, meta_dict: dict[str, Any], mandatory_fields: list[str]=[]): """Configure meta dict with mandatory arguments Parameters ---------- meta_dict ...
class MetaDictSetting: '''Implement interface for a default meta_dict''' def __init__(self, meta_dict: dict[str, Any], mandatory_fields: list[str]=[]): '''Configure meta dict with mandatory arguments Parameters ---------- meta_dict Default dictionary. mandat...
2
2
12
1
3
8
1
2.25
0
4
0
0
1
2
1
1
15
2
4
4
2
9
4
4
2
1
0
0
1
326,434
florence-bockting/elicito
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/florence-bockting_elicito/src/elicito/networks.py
elicito.networks.Orthogonal
from typing import Any, Callable, Optional import tensorflow as tf class Orthogonal(tf.keras.Model): """Implement a learnable orthogonal transformation Implementation according to [1]. Can be used as an alternative to a fixed ``Permutation`` layer. [1] Kingma, D. P., & Dhariwal, P. (2018). Glow: Gene...
class Orthogonal(tf.keras.Model): '''Implement a learnable orthogonal transformation Implementation according to [1]. Can be used as an alternative to a fixed ``Permutation`` layer. [1] Kingma, D. P., & Dhariwal, P. (2018). Glow: Generative flow with invertible 1x1 convolutions. Advances in neural ...
5
5
15
1
8
7
2
1.13
1
4
0
0
4
1
4
4
73
11
31
13
26
35
24
13
19
2
1
1
7
326,435
florence-bockting/elicito
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/florence-bockting_elicito/src/elicito/networks.py
elicito.networks.Permutation
import numpy as np from typing import Any, Callable, Optional import tensorflow as tf class Permutation(tf.keras.Model): """Implement a permutation layer layer to permute the inputs entering a (conditional) coupling layer. Uses fixed permutations, as these perform equally well compared to learned perm...
class Permutation(tf.keras.Model): '''Implement a permutation layer layer to permute the inputs entering a (conditional) coupling layer. Uses fixed permutations, as these perform equally well compared to learned permutations. ''' def __init__(self, input_dim: int): '''Create an inverti...
5
5
13
1
6
7
1
1.23
1
4
0
0
4
2
4
4
62
9
26
9
21
32
15
9
10
2
1
1
5
326,436
florence-bockting/elicito
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/florence-bockting_elicito/src/elicito/networks.py
elicito.networks.SpectralNormalization
import tensorflow as tf from typing import Any, Callable, Optional class SpectralNormalization(tf.keras.layers.Wrapper): """Performs spectral normalization on neural network weights. Adapted from: https://www.tensorflow.org/addons/api_docs/python/tfa/layers/SpectralNormalization This wrapper controls...
class SpectralNormalization(tf.keras.layers.Wrapper): '''Performs spectral normalization on neural network weights. Adapted from: https://www.tensorflow.org/addons/api_docs/python/tfa/layers/SpectralNormalization This wrapper controls the Lipschitz constant of a layer by constraining its spectral n...
6
4
14
1
10
3
2
0.5
1
9
0
0
5
5
5
5
88
14
52
19
46
26
36
19
30
3
1
2
10
326,437
florence-bockting/elicito
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/florence-bockting_elicito/src/elicito/networks.py
elicito.networks.SplineCoupling
import tensorflow as tf from numpy import e as EULER_CONST from typing import Any, Callable, Optional class SplineCoupling(tf.keras.Model): """Implement a conditional spline coupling block Implementation according to [1, 2], with additional options, such as residual blocks or Monte Carlo Dropout. [1]...
class SplineCoupling(tf.keras.Model): '''Implement a conditional spline coupling block Implementation according to [1, 2], with additional options, such as residual blocks or Monte Carlo Dropout. [1] Durkan, C., Bekasov, A., Murray, I., & Papamakarios, G. (2019). Neural spline flows. Advances in Ne...
8
8
54
6
25
25
2
1.06
1
10
1
0
7
6
7
7
402
53
178
95
147
188
118
72
110
7
1
2
16
326,438
florence-bockting/elicito
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/florence-bockting_elicito/src/elicito/simulations.py
elicito.simulations.Priors
from elicito.types import ExpertDict, NFDict, Parameter, Trainer import tensorflow as tf from typing import Any, Callable, Optional, Union class Priors(tf.Module): """ Initialize the hyperparameters (i.e., trainable variables) Parameters ---------- ground_truth True if expert data are simu...
class Priors(tf.Module): ''' Initialize the hyperparameters (i.e., trainable variables) Parameters ---------- ground_truth True if expert data are simulated from a given ground truth (oracle) init_matrix_slice Samples drawn from the initialization distribution to initialize ...
3
2
28
2
21
7
2
0.88
1
10
4
0
2
7
2
2
89
12
42
20
30
37
16
11
13
2
1
1
3
326,439
florence-bockting/elicito
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/florence-bockting_elicito/src/elicito/types.py
elicito.types.ExpertDict
from typing import Any, TypedDict class ExpertDict(TypedDict, total=False): """ typed dictionary of specification of [`expert`][elicito.elicit.Expert] """ ground_truth: dict[str, Any] num_samples: int data: dict[str, list[Any]]
class ExpertDict(TypedDict, total=False): ''' typed dictionary of specification of [`expert`][elicito.elicit.Expert] ''' pass
1
1
0
0
0
0
0
0.75
2
0
0
0
0
0
0
0
8
1
4
1
3
3
4
1
3
0
1
0
0
326,440
florence-bockting/elicito
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/florence-bockting_elicito/src/elicito/types.py
elicito.types.Hyper
from typing import Any, TypedDict from collections.abc import Callable import tensorflow as tf class Hyper(TypedDict): """ Typed dictionary for specification of [`hyper`][elicito.elicit.hyper] """ name: str constraint: Callable[[float], tf.Tensor] constraint_name: str vtype: Callable[[Any],...
class Hyper(TypedDict): ''' Typed dictionary for specification of [`hyper`][elicito.elicit.hyper] ''' pass
1
1
0
0
0
0
0
0.43
1
0
0
0
0
0
0
0
11
1
7
1
6
3
7
1
6
0
1
0
0
326,441
florence-bockting/elicito
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/florence-bockting_elicito/src/elicito/types.py
elicito.types.Initializer
from typing import Any, TypedDict class Initializer(TypedDict): """ typed dictionary for specification of initialization method """ method: str | None distribution: Uniform | None loss_quantile: float | None iterations: int | None hyperparams: dict[str, Any] | None
class Initializer(TypedDict): ''' typed dictionary for specification of initialization method ''' pass
1
1
0
0
0
0
0
0.5
1
0
0
0
0
0
0
0
10
1
6
1
5
3
6
1
5
0
1
0
0
326,442
florence-bockting/elicito
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/florence-bockting_elicito/src/elicito/types.py
elicito.types.NFDict
from collections.abc import Callable from typing import Any, TypedDict class NFDict(TypedDict): """ Typed dictionary for specification of normalizing flow See [`network`][elicito.networks.NF] """ inference_network: Callable[[Any], Any] network_specs: dict[str, Any] base_distribution: Call...
class NFDict(TypedDict): ''' Typed dictionary for specification of normalizing flow See [`network`][elicito.networks.NF] ''' pass
1
1
0
0
0
0
0
1
1
0
0
0
0
0
0
0
11
3
4
1
3
4
4
1
3
0
1
0
0
326,443
florence-bockting/elicito
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/florence-bockting_elicito/src/elicito/types.py
elicito.types.Parallel
from typing import Any, TypedDict class Parallel(TypedDict): """ Typed dictionary for specification of parallelization `parallel` See [`parallel`][elicito.utils.parallel] """ runs: int cores: int seeds: list[int] | None
class Parallel(TypedDict): ''' Typed dictionary for specification of parallelization `parallel` See [`parallel`][elicito.utils.parallel] ''' pass
1
1
0
0
0
0
0
1
1
0
0
0
0
0
0
0
10
2
4
1
3
4
4
1
3
0
1
0
0
326,444
florence-bockting/elicito
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/florence-bockting_elicito/src/elicito/types.py
elicito.types.Parameter
from collections.abc import Callable from typing import Any, TypedDict class Parameter(dict[str, Any]): """Class for specification of a parameter, inheriting from `dict`.""" def __init__(self, name: str, family: Any, hyperparams: dict[str, Hyper] | None, constraint_name: str, constraint: Callable[[float], flo...
class Parameter(dict[str, Any]): '''Class for specification of a parameter, inheriting from `dict`.''' def __init__(self, name: str, family: Any, hyperparams: dict[str, Hyper] | None, constraint_name: str, constraint: Callable[[float], float]): pass def __str__(self) -> str: '''Return a r...
4
3
12
0
11
1
2
0.09
1
6
1
0
3
5
3
30
42
4
35
18
24
3
18
11
14
3
2
1
5
326,445
florence-bockting/elicito
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/florence-bockting_elicito/src/elicito/types.py
elicito.types.QueriesDict
from typing import Any, TypedDict class QueriesDict(TypedDict, total=False): """ Typed dictionary for specification of [`queries`][elicito.elicit.Queries] """ name: str value: Any | None func_name: str
class QueriesDict(TypedDict, total=False): ''' Typed dictionary for specification of [`queries`][elicito.elicit.Queries] ''' pass
1
1
0
0
0
0
0
0.75
2
0
0
0
0
0
0
0
8
1
4
1
3
3
4
1
3
0
1
0
0
326,446
florence-bockting/elicito
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/florence-bockting_elicito/src/elicito/types.py
elicito.types.SaveHist
from typing import Any, TypedDict class SaveHist(TypedDict): """ Typed dictionary for specification of saving `history` results See [`save_history`][elicito.utils.save_history] """ loss: bool time: bool loss_component: bool hyperparameter: bool hyperparameter_gradient: bool
class SaveHist(TypedDict): ''' Typed dictionary for specification of saving `history` results See [`save_history`][elicito.utils.save_history] ''' pass
1
1
0
0
0
0
0
0.67
1
0
0
0
0
0
0
0
12
2
6
1
5
4
6
1
5
0
1
0
0
326,447
florence-bockting/elicito
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/florence-bockting_elicito/src/elicito/types.py
elicito.types.SaveResults
from typing import Any, TypedDict class SaveResults(TypedDict): """ Typed dictionary for specification of saving `results` See [`save_results`][elicito.utils.save_results] """ target_quantities: bool elicited_statistics: bool prior_samples: bool model_samples: bool expert_elicited_...
class SaveResults(TypedDict): ''' Typed dictionary for specification of saving `results` See [`save_results`][elicito.utils.save_results] ''' pass
1
1
0
0
0
0
0
0.33
1
0
0
0
0
0
0
0
18
2
12
1
11
4
12
1
11
0
1
0
0
326,448
florence-bockting/elicito
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/florence-bockting_elicito/src/elicito/types.py
elicito.types.Target
from collections.abc import Callable from typing import Any, TypedDict class Target(dict[str, Any]): """Class for specification of a target, inheriting from `dict`.""" def __init__(self, name: str, query: QueriesDict, target_method: Callable[[Any], Any] | None, loss: Callable[[Any], float], weight: float): ...
class Target(dict[str, Any]): '''Class for specification of a target, inheriting from `dict`.''' def __init__(self, name: str, query: QueriesDict, target_method: Callable[[Any], Any] | None, loss: Callable[[Any], float], weight: float): pass def __str__(self) -> str: '''Return a readable ...
4
3
10
0
9
1
1
0.11
1
6
1
0
3
5
3
30
34
3
28
16
17
3
12
9
8
1
2
0
3
326,449
florence-bockting/elicito
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/florence-bockting_elicito/src/elicito/types.py
elicito.types.Trainer
from typing import Any, TypedDict class Trainer(TypedDict, total=False): """ typed dictionary for specification of [`trainer`][elicito.elicit.trainer] """ method: str seed: int B: int num_samples: int epochs: int seed_chain: int progress: int
class Trainer(TypedDict, total=False): ''' typed dictionary for specification of [`trainer`][elicito.elicit.trainer] ''' pass
1
1
0
0
0
0
0
0.38
2
0
0
0
0
0
0
0
12
1
8
1
7
3
8
1
7
0
1
0
0
326,450
florence-bockting/elicito
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/florence-bockting_elicito/src/elicito/types.py
elicito.types.Uniform
from typing import Any, TypedDict class Uniform(TypedDict): """ typed dictionary for specification of initialization distribution See [`uniform`][elicito.initialization.uniform] """ radius: float | list[float | int] mean: float | list[float | int] hyper: list[str] | None
class Uniform(TypedDict): ''' typed dictionary for specification of initialization distribution See [`uniform`][elicito.initialization.uniform] ''' pass
1
1
0
0
0
0
0
1
1
0
0
0
0
0
0
0
11
3
4
1
3
4
4
1
3
0
1
0
0
326,451
florence-bockting/elicito
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/florence-bockting_elicito/src/elicito/utils.py
elicito.utils.DoubleBound
import tensorflow as tf class DoubleBound: """ constrain double-bounded distributions """ def __init__(self, lower: float, upper: float): """ Constrain double-bounded distribution A variable constrained to be in the open interval (``lower``, ``upper``) is transformed t...
class DoubleBound: ''' constrain double-bounded distributions ''' def __init__(self, lower: float, upper: float): ''' Constrain double-bounded distribution A variable constrained to be in the open interval (``lower``, ``upper``) is transformed to an unconstrained variab...
6
6
25
6
4
16
1
4.15
0
1
0
0
5
2
5
5
136
33
20
12
14
83
20
12
14
1
0
0
5
326,452
florence-bockting/elicito
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/florence-bockting_elicito/src/elicito/utils.py
elicito.utils.LowerBound
import tensorflow_probability as tfp from typing import Any, Optional import tensorflow as tf class LowerBound: """ constrain lower-bounded distributions """ def __init__(self, lower: float): """ Transform ``lower`` bound variable to unconstrained variable Y use inverse-softpl...
class LowerBound: ''' constrain lower-bounded distributions ''' def __init__(self, lower: float): ''' Transform ``lower`` bound variable to unconstrained variable Y use inverse-softplus transform. References ---------- - [Stan](https://mc-stan.org/docs/r...
4
4
22
5
3
14
1
4
0
2
0
0
3
1
3
3
72
17
11
7
7
44
11
7
7
1
0
0
3
326,453
florence-bockting/elicito
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/florence-bockting_elicito/src/elicito/utils.py
elicito.utils.UpperBound
from typing import Any, Optional import tensorflow as tf import tensorflow_probability as tfp class UpperBound: """ transform ``upper`` bounded distribution """ def __init__(self, upper: float): """ Transform ``upper`` bounded x into unconstrained y use inverse-softplus transf...
class UpperBound: ''' transform ``upper`` bounded distribution ''' def __init__(self, upper: float): ''' Transform ``upper`` bounded x into unconstrained y use inverse-softplus transform. Parameters ---------- upper Upper bound of variable X....
4
4
23
5
3
14
1
4.18
0
2
0
0
3
1
3
3
76
19
11
7
7
46
11
7
7
1
0
0
3
326,454
florence-bockting/elicito
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/florence-bockting_elicito/docs/gen_doc_stubs.py
gen_doc_stubs.PackageInfo
from attrs import define @define class PackageInfo: """ Package information used to help us auto-generate the docs Not stricly needed anymore now that mkdocstrings-python has a summary option, but being kept in case we need something like this pattern again. """ full_name: str stem: str ...
@define class PackageInfo: ''' Package information used to help us auto-generate the docs Not stricly needed anymore now that mkdocstrings-python has a summary option, but being kept in case we need something like this pattern again. ''' pass
2
1
0
0
0
0
0
1.25
0
0
0
0
0
0
0
0
11
2
4
1
3
5
4
1
3
0
0
0
0
326,455
florence-bockting/elicito
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/florence-bockting_elicito/docs/tutorials/getting-started-deep.py
getting-started-deep.ToyModel
import tensorflow as tf from typing import Any class ToyModel: """ generative model """ def __call__(self, prior_samples: Any, design_matrix: Any) -> dict[str, Any]: """ Compute target quantities from generative model Parameters ---------- prior_samples ...
class ToyModel: ''' generative model ''' def __call__(self, prior_samples: Any, design_matrix: Any) -> dict[str, Any]: ''' Compute target quantities from generative model Parameters ---------- prior_samples prior samples design_matrix ...
2
2
31
6
8
17
1
2.22
0
3
0
0
1
0
1
1
36
7
9
6
7
20
7
6
5
1
0
0
1
326,456
florence-bockting/elicito
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/florence-bockting_elicito/docs/tutorials/getting-started-param.py
getting-started-param.ToyModel
from typing import Any import tensorflow as tf class ToyModel: """ generative model """ def __call__(self, prior_samples: Any, design_matrix: Any) -> dict[str, Any]: """ Compute target quantities from generative model Parameters ---------- prior_samples ...
class ToyModel: ''' generative model ''' def __call__(self, prior_samples: Any, design_matrix: Any) -> dict[str, Any]: ''' Compute target quantities from generative model Parameters ---------- prior_samples prior samples design_matrix ...
2
2
31
6
8
17
1
2.22
0
3
0
0
1
0
1
1
36
7
9
6
7
20
7
6
5
1
0
0
1
326,457
florence-bockting/elicito
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/florence-bockting_elicito/scripts/print-conda-recipe-pins.py
print-conda-recipe-pins.VersionInfoHere
from attrs import define @define class VersionInfoHere: """Version info class for use in this script""" name: str min_pin: str max_pin: str
@define class VersionInfoHere: '''Version info class for use in this script''' pass
2
1
0
0
0
0
0
0.25
0
0
0
0
0
0
0
0
6
1
4
1
3
1
4
1
3
0
0
0
0
326,458
florence-bockting/elicito
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/florence-bockting_elicito/docs/how-to-guides/save-and-load-eliobj.py
save-and-load-eliobj.ToyModel
from typing import Any, Union import tensorflow as tf class ToyModel: """ Generative model """ def __call__(self, prior_samples: Any, design_matrix: Any) -> dict[str, Any]: """ Run the generative model Parameters ---------- prior_samples samples fro...
class ToyModel: ''' Generative model ''' def __call__(self, prior_samples: Any, design_matrix: Any) -> dict[str, Any]: ''' Run the generative model Parameters ---------- prior_samples samples from the prior distribution design_matrix ...
2
2
38
6
14
18
1
1.4
0
3
0
0
1
0
1
1
43
7
15
9
13
21
10
9
8
1
0
0
1
326,459
florence-bockting/elicito
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/florence-bockting_elicito/docs/how-to-guides/use-discrete-rv.py
use-discrete-rv.ToyModel
import elicito as el from typing import Any import tensorflow as tf class ToyModel: """ generative model with discrete likelihood """ def __call__(self, prior_samples: Any, design_matrix: Any, total_count: int, temp: float) -> dict[str, Any]: """ Sample from the generative model ...
class ToyModel: ''' generative model with discrete likelihood ''' def __call__(self, prior_samples: Any, design_matrix: Any, total_count: int, temp: float) -> dict[str, Any]: ''' Sample from the generative model Parameters ---------- prior_samples sa...
2
2
47
9
16
22
1
1.47
0
5
0
0
1
0
1
1
52
10
17
11
13
25
10
9
8
1
0
0
1
326,460
natixnetwork/streetvision-subnet
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/natixnetwork_streetvision-subnet/base_miner/datasets/base_dataset.py
base_miner.datasets.base_dataset.BaseDataset
from torchvision.transforms import Compose from base_miner.datasets.download_data import load_huggingface_dataset from typing import Optional from abc import ABC, abstractmethod from datasets import Dataset class BaseDataset(ABC): def __init__(self, huggingface_dataset_path: Optional[str]=None, huggingface_datase...
class BaseDataset(ABC): def __init__(self, huggingface_dataset_path: Optional[str]=None, huggingface_dataset_split: str='train', huggingface_dataset_name: Optional[str]=None, huggingface_dataset: Optional[Dataset]=None, download_mode: Optional[str]=None, transforms: Optional[Compose]=None): '''Base class ...
6
3
21
2
11
8
2
0.62
1
7
0
1
3
6
3
23
69
9
37
20
23
23
24
10
20
4
4
2
6
326,461
natixnetwork/streetvision-subnet
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/natixnetwork_streetvision-subnet/base_miner/datasets/image_dataset.py
base_miner.datasets.image_dataset.ImageDataset
from torchvision.transforms import Compose from typing import Optional from io import BytesIO from datasets import Dataset from .download_data import download_image from PIL import Image from .base_dataset import BaseDataset class ImageDataset(BaseDataset): def __init__(self, huggingface_dataset_path: Optional[st...
class ImageDataset(BaseDataset): def __init__(self, huggingface_dataset_path: Optional[str]=None, huggingface_dataset_split: str='train', huggingface_dataset_name: Optional[str]=None, huggingface_dataset: Optional[Dataset]=None, download_mode: Optional[str]=None, transforms: Optional[Compose]=None): '''In...
4
3
32
4
16
12
4
0.75
1
7
0
0
3
0
3
26
98
14
48
15
36
36
27
7
23
11
5
2
13
326,462
natixnetwork/streetvision-subnet
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/natixnetwork_streetvision-subnet/base_miner/datasets/real_fake_dataset.py
base_miner.datasets.real_fake_dataset.RealFakeDataset
import torch import numpy as np class RealFakeDataset: def __init__(self, real_image_datasets: list, fake_image_datasets: list, fake_prob=0.5, source_label_mapping=None): """ Initialize the RealFakeDataset instance. Args: real_image_datasets (list): List of ImageDataset object...
class RealFakeDataset: def __init__(self, real_image_datasets: list, fake_image_datasets: list, fake_prob=0.5, source_label_mapping=None): ''' Initialize the RealFakeDataset instance. Args: real_image_datasets (list): List of ImageDataset objects containing real images ...
7
3
17
2
9
6
2
0.6
0
4
0
0
4
5
5
5
90
16
47
20
40
28
37
19
31
4
0
1
8
326,463
natixnetwork/streetvision-subnet
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/natixnetwork_streetvision-subnet/base_miner/detectors/feature_detector.py
base_miner.detectors.feature_detector.FeatureDetector
import torch from abc import ABC, abstractmethod from pathlib import Path import yaml from typing import Optional from base_miner.detectors.configs.constants import CONFIGS_DIR import bittensor as bt from huggingface_hub import hf_hub_download from PIL import Image class FeatureDetector(ABC): """Abstract base clas...
class FeatureDetector(ABC): '''Abstract base class for detecting image features via binary classification. This class is intended to be subclassed by detector implementations using different underlying model architectures, routing via gates, or configurations. Attributes: model_name (str): ...
10
7
15
2
7
5
2
0.94
1
4
0
2
7
5
7
27
126
25
52
23
42
49
48
17
40
4
4
3
16
326,464
natixnetwork/streetvision-subnet
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/natixnetwork_streetvision-subnet/base_miner/detectors/roadwork_detector.py
base_miner.detectors.roadwork_detector.RoadworkDetector
from PIL import Image from base_miner.gating_mechanisms import GatingMechanism from base_miner.registry import DETECTOR_REGISTRY from base_miner.detectors import FeatureDetector @DETECTOR_REGISTRY.register_module(module_name='ROADWORK') class RoadworkDetector(FeatureDetector): """ This DeepfakeDetector subclas...
@DETECTOR_REGISTRY.register_module(module_name='ROADWORK') class RoadworkDetector(FeatureDetector): ''' This DeepfakeDetector subclass implements Content-Aware Model Orchestration (CAMO), a mixture-of-experts approach to the binary classification of real and fake images, breaking the classification prob...
5
4
15
1
7
7
2
1.71
1
5
1
0
3
2
3
30
66
9
21
11
17
36
16
11
12
3
5
2
5
326,465
natixnetwork/streetvision-subnet
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/natixnetwork_streetvision-subnet/base_miner/detectors/vit_detector.py
base_miner.detectors.vit_detector.ViTImageDetector
import torch import torchvision.transforms as transforms from base_miner.detectors import FeatureDetector import random from transformers import AutoImageProcessor, AutoModelForImageClassification, pipeline import bittensor as bt from PIL import Image from base_miner.registry import DETECTOR_REGISTRY import gc @DETECT...
@DETECTOR_REGISTRY.register_module(module_name='ViT') class ViTImageDetector(FeatureDetector): ''' ViTImageDetector subclass that initializes a pretrained model for binary classification of roadwork. Attributes: model_name (str): Name of the detector instance. config_name (str): Name of ...
10
4
10
1
7
2
2
0.41
1
3
0
0
8
4
8
35
97
16
59
20
50
24
48
19
39
5
5
1
15
326,466
natixnetwork/streetvision-subnet
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/natixnetwork_streetvision-subnet/base_miner/gating_mechanisms/gate.py
base_miner.gating_mechanisms.gate.Gate
import numpy as np from abc import ABC, abstractmethod from PIL import Image class Gate(ABC): """ Abstract base class for image content detection and preprocessing. Used to route deepfake detection inference inputs to tailored models in a single agent or mixture-of-experts design. This class is in...
class Gate(ABC): ''' Abstract base class for image content detection and preprocessing. Used to route deepfake detection inference inputs to tailored models in a single agent or mixture-of-experts design. This class is intended to be subclassed by specific gate implementations that handle diffe...
6
3
5
0
2
2
1
1.7
1
1
0
0
3
2
3
23
33
6
10
8
4
17
8
6
4
1
4
0
3
326,467
natixnetwork/streetvision-subnet
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/natixnetwork_streetvision-subnet/base_miner/gating_mechanisms/gating_mechanism.py
base_miner.gating_mechanisms.gating_mechanism.GatingMechanism
from base_miner.registry import GATE_REGISTRY from PIL import Image class GatingMechanism: """ This class orchestrates multi-gate content detection and content-specific preprocessing to facilitate use by downstream models This is useful for routing images to appropriate detectors trained to handle...
class GatingMechanism: ''' This class orchestrates multi-gate content detection and content-specific preprocessing to facilitate use by downstream models This is useful for routing images to appropriate detectors trained to handle different content types in a mixture-of-experts framework such a...
3
1
5
1
5
0
2
0.7
0
1
0
0
2
1
2
2
21
4
10
7
7
7
10
7
7
3
0
2
4
326,468
natixnetwork/streetvision-subnet
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/natixnetwork_streetvision-subnet/base_miner/gating_mechanisms/roadwork_gate.py
base_miner.gating_mechanisms.roadwork_gate.RoadworkGate
from PIL import Image from base_miner.gating_mechanisms import Gate import numpy as np from base_miner.registry import GATE_REGISTRY @GATE_REGISTRY.register_module(module_name='ROADWORK') class RoadworkGate(Gate): """ Gate subclass for roadwork content detection and preprocessing. Attributes: gate...
@GATE_REGISTRY.register_module(module_name='ROADWORK') class RoadworkGate(Gate): ''' Gate subclass for roadwork content detection and preprocessing. Attributes: gate_name (str): The name of the gate. predictor_path (str): Path to dlib face landmark model. ''' def __init__(self, gate...
5
3
11
2
4
5
1
1.83
1
3
0
0
3
0
3
3
44
10
12
7
8
22
12
7
8
2
1
1
4
326,469
natixnetwork/streetvision-subnet
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/natixnetwork_streetvision-subnet/base_miner/registry.py
base_miner.registry.Registry
class Registry(object): def __init__(self): self.data = {} def register_module(self, module_name=None): def _register(cls): name = module_name if module_name is None: name = cls.__name__ self.data[name] = cls return cls r...
class Registry(object): def __init__(self): pass def register_module(self, module_name=None): pass def _register(cls): pass def __getitem__(self, key): pass def __contains__(self, key): pass
6
0
4
0
4
0
1
0
1
0
0
0
4
1
4
4
19
4
15
8
9
0
15
8
9
2
1
1
6
326,470
natixnetwork/streetvision-subnet
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/natixnetwork_streetvision-subnet/natix/utils/image_transforms.py
image_transforms.ApplyDeeperForensicsDistortion
import random import numpy as np import torch class ApplyDeeperForensicsDistortion: """Wrapper for applying DeeperForensics distortions.""" def __init__(self, distortion_type, level_min=0, level_max=3): self.distortion_type = distortion_type self.level_min = level_min self.level_max = ...
class ApplyDeeperForensicsDistortion: '''Wrapper for applying DeeperForensics distortions.''' def __init__(self, distortion_type, level_min=0, level_max=3): pass def __call__(self, img, level=None): pass
3
1
17
3
14
0
4
0.04
0
0
0
0
2
6
2
2
37
8
28
9
25
1
26
9
23
6
0
1
7
326,471
natixnetwork/streetvision-subnet
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/natixnetwork_streetvision-subnet/natix/utils/image_transforms.py
image_transforms.CLAHE
import cv2 from PIL import Image import numpy as np class CLAHE: """Contrast Limited Adaptive Histogram Equalization.""" def __init__(self): self.clahe = cv2.createCLAHE(clipLimit=1.0, tileGridSize=(8, 8)) def __call__(self, image): image_np = np.array(image) if len(image_np.shape...
class CLAHE: '''Contrast Limited Adaptive Histogram Equalization.''' def __init__(self): pass def __call__(self, image): pass
3
1
9
2
6
3
2
0.46
0
0
0
0
2
1
2
2
22
5
13
9
10
6
12
9
9
2
0
1
3
326,472
natixnetwork/streetvision-subnet
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/natixnetwork_streetvision-subnet/natix/utils/image_transforms.py
image_transforms.ComposeWithParams
import torchvision.transforms as transforms class ComposeWithParams: def __init__(self, transforms): self.transforms = transforms self.params = {} def __call__(self, input_data, clear_params=True): if clear_params: self.params = {} output_data = [] list_inp...
class ComposeWithParams: def __init__(self, transforms): pass def __call__(self, input_data, clear_params=True): pass
3
0
16
2
14
0
5
0
0
2
0
0
2
2
2
2
33
5
28
10
25
0
27
10
24
9
0
4
10
326,473
natixnetwork/streetvision-subnet
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/natixnetwork_streetvision-subnet/natix/utils/image_transforms.py
image_transforms.ConvertToRGB
class ConvertToRGB: def __call__(self, img): img = img.convert('RGB') return img
class ConvertToRGB: def __call__(self, img): pass
2
0
3
0
3
0
1
0
0
0
0
0
1
0
1
1
4
0
4
2
2
0
4
2
2
1
0
0
1
326,474
natixnetwork/streetvision-subnet
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/natixnetwork_streetvision-subnet/natix/utils/image_transforms.py
image_transforms.RandomHorizontalFlipWithParams
import torchvision.transforms as transforms import torch class RandomHorizontalFlipWithParams(transforms.RandomHorizontalFlip): def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) self.params = {} def forward(self, img, do_flip=None): if do_flip is not None: ...
class RandomHorizontalFlipWithParams(transforms.RandomHorizontalFlip): def __init__(self, *args, **kwargs): pass def forward(self, img, do_flip=None): pass
3
0
7
0
7
0
4
0
1
1
0
0
2
1
2
2
16
2
14
4
11
0
12
4
9
6
1
1
7
326,475
natixnetwork/streetvision-subnet
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/natixnetwork_streetvision-subnet/natix/utils/image_transforms.py
image_transforms.RandomResizedCropWithParams
import torchvision.transforms.functional as F import torchvision.transforms as transforms class RandomResizedCropWithParams(transforms.RandomResizedCrop): def __init__(self, *args, include_point=None, **kwargs): super().__init__(*args, **kwargs) self.params = None self.include_point = incl...
class RandomResizedCropWithParams(transforms.RandomResizedCrop): def __init__(self, *args, include_point=None, **kwargs): pass def forward(self, img, crop_params=None): ''' Args: img: PIL Image to be cropped and resized crop_params: Optional pre-computed crop p...
3
1
16
2
12
3
4
0.25
1
1
0
0
2
4
2
2
34
4
24
9
21
6
21
8
18
7
1
3
8
326,476
natixnetwork/streetvision-subnet
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/natixnetwork_streetvision-subnet/natix/utils/image_transforms.py
image_transforms.RandomRotationWithParams
import torchvision.transforms as transforms class RandomRotationWithParams(transforms.RandomRotation): def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) self.params = None def forward(self, img, angle=None): if angle is None: angle = self.get_params(se...
class RandomRotationWithParams(transforms.RandomRotation): def __init__(self, *args, **kwargs): pass def forward(self, img, angle=None): pass
3
0
4
0
4
0
2
0
1
1
0
0
2
1
2
2
10
1
9
4
6
0
9
4
6
2
1
1
3
326,477
natixnetwork/streetvision-subnet
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/natixnetwork_streetvision-subnet/natix/utils/image_transforms.py
image_transforms.RandomVerticalFlipWithParams
import torchvision.transforms as transforms import torch class RandomVerticalFlipWithParams(transforms.RandomVerticalFlip): def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) self.params = {} def forward(self, img, do_flip=None): if do_flip is not None: ...
class RandomVerticalFlipWithParams(transforms.RandomVerticalFlip): def __init__(self, *args, **kwargs): pass def forward(self, img, do_flip=None): pass
3
0
7
0
7
0
4
0
1
1
0
0
2
1
2
2
15
1
14
4
11
0
12
4
9
6
1
1
7
326,478
natixnetwork/streetvision-subnet
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/natixnetwork_streetvision-subnet/natix/utils/image_transforms.py
image_transforms.TensorCLAHE
import cv2 import numpy as np import torch class TensorCLAHE: def __init__(self): self.clahe = cv2.createCLAHE(clipLimit=1.0, tileGridSize=(8, 8)) def __call__(self, tensor): img_np = tensor.permute(1, 2, 0).numpy() * 255 img_np = img_np.astype(np.uint8) channels = cv2.split(i...
class TensorCLAHE: def __init__(self): pass def __call__(self, tensor): pass
3
0
8
1
5
2
1
0.27
0
0
0
0
2
1
2
2
17
3
11
8
8
3
11
8
8
1
0
0
2
326,479
natixnetwork/streetvision-subnet
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/natixnetwork_streetvision-subnet/natix/utils/mock.py
mock.MockDendrite
from typing import List import random import time import asyncio import numpy as np import bittensor as bt class MockDendrite(bt.dendrite): """ Replaces a real bittensor network request with a mock request that just returns some static response for all axons that are passed and adds some random delay. ...
class MockDendrite(bt.dendrite): ''' Replaces a real bittensor network request with a mock request that just returns some static response for all axons that are passed and adds some random delay. ''' def __init__(self, wallet): pass async def forward(self, axons: List[bt.axon], synaps...
6
4
24
3
16
5
2
0.41
1
6
0
0
3
0
3
3
65
10
39
17
25
16
29
9
23
3
1
1
8
326,480
natixnetwork/streetvision-subnet
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/natixnetwork_streetvision-subnet/natix/utils/mock.py
mock.MockImageDataset
class MockImageDataset: def __init__(self, huggingface_dataset_path: str, huggingface_datset_split: str='train', huggingface_datset_name: str=None, create_splits: bool=False, download_mode: str=None): self.huggingface_dataset_path = huggingface_dataset_path self.huggingface_dataset_name = huggingfa...
class MockImageDataset: def __init__(self, huggingface_dataset_path: str, huggingface_datset_split: str='train', huggingface_datset_name: str=None, create_splits: bool=False, download_mode: str=None): pass def __getitem__(self, index: int) -> dict: pass def __len__(self): pass ...
5
0
5
0
5
0
1
0.05
0
5
0
0
4
4
4
4
23
4
19
16
7
1
12
9
7
1
0
0
4
326,481
natixnetwork/streetvision-subnet
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/natixnetwork_streetvision-subnet/natix/utils/mock.py
mock.MockMetagraph
import bittensor as bt class MockMetagraph(bt.metagraph): def __init__(self, netuid, network='mock', subtensor=None): super().__init__(netuid=netuid, network=network, sync=False) self.default_ip = '127.0.0.0' self.default_port = 8092 if subtensor is not None: self.subte...
class MockMetagraph(bt.metagraph): def __init__(self, netuid, network='mock', subtensor=None): pass
2
0
15
3
12
0
3
0
1
1
0
0
1
3
1
1
16
3
13
6
11
0
13
6
11
3
1
1
3
326,482
natixnetwork/streetvision-subnet
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/natixnetwork_streetvision-subnet/natix/utils/mock.py
mock.MockSubtensor
import bittensor as bt class MockSubtensor(bt.MockSubtensor): def __init__(self, netuid, n=16, wallet=None, network='mock'): super().__init__(network=network) bt.MockSubtensor.reset() if not self.subnet_exists(netuid): self.create_subnet(netuid) if wallet is not None: ...
class MockSubtensor(bt.MockSubtensor): def __init__(self, netuid, n=16, wallet=None, network='mock'): pass
2
0
32
3
27
3
6
0.11
1
3
0
0
1
0
1
1
33
3
28
4
26
3
16
3
14
6
1
2
6
326,483
natixnetwork/streetvision-subnet
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/natixnetwork_streetvision-subnet/natix/utils/mock.py
mock.MockSyntheticDataGenerator
import numpy as np from natix.validator.config import MODEL_NAMES class MockSyntheticDataGenerator: def __init__(self, prompt_type, use_random_t2v_model, t2v_model_name): self.prompt_type = prompt_type self.t2v_model_name = t2v_model_name self.use_random_t2v_model = use_random_t2v_model ...
class MockSyntheticDataGenerator: def __init__(self, prompt_type, use_random_t2v_model, t2v_model_name): pass def generate(self, k=1, real_images=None, modality='image'): pass def load_diffuser(self, t2v_model_name) -> None: ''' loads a huggingface diffuser model. ...
4
1
6
0
5
1
2
0.2
0
1
0
0
3
3
3
3
21
3
15
7
11
3
14
7
10
2
0
1
5
326,484
natixnetwork/streetvision-subnet
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/natixnetwork_streetvision-subnet/natix/base/miner.py
natix.base.miner.BaseMinerNeuron
import bittensor as bt import time import asyncio from natix.base.neuron import BaseNeuron import threading import argparse from typing import Union from natix.utils.config import add_miner_args import typing import traceback class BaseMinerNeuron(BaseNeuron): """ Base class for Bittensor miners. """ n...
class BaseMinerNeuron(BaseNeuron): ''' Base class for Bittensor miners. ''' @classmethod def add_args(cls, parser: argparse.ArgumentParser): pass def __init__(self, config=None): pass def run(self): ''' Initiates and manages the main loop for the miner ...
12
9
22
4
9
10
3
1.14
1
8
0
1
9
6
10
42
232
46
88
21
76
100
83
20
72
6
5
4
26
326,485
natixnetwork/streetvision-subnet
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/natixnetwork_streetvision-subnet/natix/base/neuron.py
natix.base.neuron.BaseNeuron
from natix.utils.mock import MockMetagraph, MockSubtensor from natix.utils.misc import ttl_get_block import bittensor as bt from natix import __spec_version__ as spec_version from natix.utils.config import add_args, check_config, config import copy from abc import ABC, abstractmethod class BaseNeuron(ABC): """ ...
class BaseNeuron(ABC): ''' Base class for Bittensor miners. This class is abstract and should be inherited by a subclass. It contains the core logic for all neurons; validators and miners. In addition to creating a wallet, subtensor, and metagraph, this class also handles the synchronization of the...
18
3
9
1
6
2
2
0.33
1
3
2
2
9
3
12
32
137
28
83
24
66
27
62
19
49
3
4
1
18
326,486
natixnetwork/streetvision-subnet
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/natixnetwork_streetvision-subnet/natix/base/validator.py
natix.base.validator.BaseValidatorNeuron
import threading import asyncio from natix.utils.mock import MockDendrite import time import argparse import copy from traceback import print_exception from natix.utils.config import add_validator_args import numpy as np from natix.validator.miner_performance_tracker import MinerPerformanceTracker from natix.base.utils...
class BaseValidatorNeuron(BaseNeuron): ''' Base class for Bittensor validators. Your validator should inherit from this class. ''' @classmethod def add_args(cls, parser: argparse.ArgumentParser): pass def __init__(self, config=None): pass def serve_axon(self): ...
22
13
24
3
16
5
3
0.36
1
14
2
1
17
14
18
50
466
70
296
70
272
106
236
58
214
9
5
3
55
326,487
natixnetwork/streetvision-subnet
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/natixnetwork_streetvision-subnet/natix/protocol.py
natix.protocol.ExtendedImageSynapse
class ExtendedImageSynapse(ImageSynapse): model_url: str = ''
class ExtendedImageSynapse(ImageSynapse): pass
1
0
0
0
0
0
0
0
1
0
0
0
0
0
0
1
2
0
2
2
1
0
2
2
1
0
2
0
0
326,488
natixnetwork/streetvision-subnet
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/natixnetwork_streetvision-subnet/natix/protocol.py
natix.protocol.ImageSynapse
import pydantic import bittensor as bt class ImageSynapse(bt.Synapse): """ This protocol helps in handling image/prediction request and response communication between the miner and the validator. Attributes: - image: a bas64 encoded images - prediction: a float indicating the probabilty that ...
class ImageSynapse(bt.Synapse): ''' This protocol helps in handling image/prediction request and response communication between the miner and the validator. Attributes: - image: a bas64 encoded images - prediction: a float indicating the probabilty that the image is AI generated/modified. ...
2
2
10
1
2
7
1
1.64
1
1
0
1
1
0
1
1
34
6
11
5
9
18
6
5
4
1
1
0
1
326,489
natixnetwork/streetvision-subnet
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/natixnetwork_streetvision-subnet/natix/synthetic_data_generation/prompt_generator.py
natix.synthetic_data_generation.prompt_generator.PromptGenerator
from transformers import pipeline import torch from transformers import AutoModelForCausalLM, AutoTokenizer, Blip2ForConditionalGeneration, Blip2Processor import bittensor as bt from transformers import logging as transformers_logging from natix.validator.config import HUGGINGFACE_CACHE_DIR from PIL import Image import...
class PromptGenerator: ''' A class for generating and moderating image annotations using transformer models. This class provides functionality to generate descriptive captions for images using BLIP2 models and optionally moderate the generated text using a separate language model. ''' def ...
7
6
30
4
19
8
4
0.46
0
6
0
0
6
6
6
6
194
32
112
32
100
51
86
26
79
9
0
3
26
326,490
natixnetwork/streetvision-subnet
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/natixnetwork_streetvision-subnet/natix/synthetic_data_generation/synthetic_data_generator.py
natix.synthetic_data_generation.synthetic_data_generator.SyntheticDataGenerator
from PIL import Image import numpy as np from natix.validator.cache import ImageCache from typing import Any, Dict, Optional, Union from diffusers.utils import export_to_video from natix.synthetic_data_generation.image_utils import create_random_mask from natix.synthetic_data_generation.prompt_utils import truncate_pro...
class SyntheticDataGenerator: ''' A class for generating synthetic images and videos based on text prompts. This class supports different prompt generation strategies and can utilize various text-to-video (t2v) and text-to-image (t2i) models. Attributes: use_random_model: Whether to randoml...
9
9
45
6
29
10
6
0.38
0
16
2
0
8
8
8
8
384
60
236
81
209
89
179
61
170
14
0
3
47
326,491
natixnetwork/streetvision-subnet
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/natixnetwork_streetvision-subnet/natix/validator/cache/base_cache.py
natix.validator.cache.base_cache.BaseCache
from .util import get_most_recent_update_time, seconds_to_str from abc import ABC, abstractmethod import bittensor as bt from .download import download_files, list_hf_files import time import numpy as np from typing import Any, Dict, List, Optional, Union import asyncio from pathlib import Path class BaseCache(ABC): ...
class BaseCache(ABC): ''' Abstract base class for managing file caches with compressed sources. This class provides the basic infrastructure for maintaining both a compressed source cache and an extracted cache, with automatic refresh intervals and background update tasks. ''' def __init__...
20
17
13
1
10
2
2
0.22
1
10
0
1
16
13
16
36
236
38
162
69
131
36
138
52
121
5
4
3
38
326,492
natixnetwork/streetvision-subnet
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/natixnetwork_streetvision-subnet/natix/validator/cache/image_cache.py
natix.validator.cache.image_cache.ImageCache
from pathlib import Path from PIL import Image import random from .base_cache import BaseCache from .util import is_parquet_complete from typing import Any, Dict, List, Optional, Union from .extract import extract_images_from_parquet import json import os import bittensor as bt class ImageCache(BaseCache): """ ...
class ImageCache(BaseCache): ''' A class to manage image caching from parquet files. This class handles the caching, updating, and sampling of images stored in parquet files. It maintains both a compressed cache of parquet files and an extracted cache of images ready for processing. ''' de...
5
5
30
3
21
7
5
0.4
1
7
0
0
4
1
4
40
133
17
83
29
68
33
56
16
51
9
5
4
19
326,493
natixnetwork/streetvision-subnet
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/natixnetwork_streetvision-subnet/natix/validator/cache/util.py
natix.validator.cache.util.FileType
from enum import Enum, auto class FileType(Enum): PARQUET = auto() ZIP = auto()
class FileType(Enum): pass
1
0
0
0
0
0
0
0
1
0
0
0
0
0
0
49
3
0
3
3
2
0
3
3
2
0
4
0
0
326,494
natixnetwork/streetvision-subnet
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/natixnetwork_streetvision-subnet/natix/validator/miner_performance_tracker.py
natix.validator.miner_performance_tracker.MinerPerformanceTracker
import bittensor as bt from typing import Dict from collections import deque import numpy as np from sklearn.metrics import accuracy_score, f1_score, matthews_corrcoef, precision_score, recall_score, roc_auc_score class MinerPerformanceTracker: """ Tracks all recent miner performance to facilitate reward compu...
class MinerPerformanceTracker: ''' Tracks all recent miner performance to facilitate reward computation. ''' def __init__(self, store_last_n_predictions: int=100): pass def reset_miner_history(self, uid: int, miner_hotkey: str): ''' Reset the history for a miner. '...
7
6
15
2
8
5
2
0.62
0
5
0
0
6
4
6
6
98
17
50
24
43
31
49
23
42
7
0
2
14
326,495
natixnetwork/streetvision-subnet
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/natixnetwork_streetvision-subnet/natix/validator/organic_task_distributor.py
natix.validator.organic_task_distributor.OrganicTaskDistributor
import hashlib import bittensor as bt import random from collections import defaultdict, deque import time import asyncio from typing import Dict, List, Optional, Set, Tuple from natix.utils.uids import get_random_uids class OrganicTaskDistributor: """ Handles organic task distribution with anti-collusion mech...
class OrganicTaskDistributor: ''' Handles organic task distribution with anti-collusion mechanisms. This class is designed to be used within an async context and handles its own dendrite initialization to avoid context issues. ''' def __init__(self, validator, miners_per_task: int=3, deduplica...
12
10
29
5
23
2
3
0.11
0
9
1
0
10
12
10
10
310
57
227
78
200
26
123
58
111
7
0
3
31
326,496
natixnetwork/streetvision-subnet
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/natixnetwork_streetvision-subnet/natix/validator/proxy.py
natix.validator.proxy.ProxyCounter
from datetime import date import json import os class ProxyCounter: def __init__(self, save_path): self.save_path = save_path if os.path.exists(save_path): try: self.proxy_logs = json.load(open(save_path)) except Exception as e: print(f'Error...
class ProxyCounter: def __init__(self, save_path): pass def update(self, is_success): pass def save(self): pass
4
0
6
0
6
0
2
0
0
3
0
0
3
2
3
3
22
2
20
8
16
0
18
7
14
3
0
2
6
326,497
natixnetwork/streetvision-subnet
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/natixnetwork_streetvision-subnet/neurons/miner.py
neurons.miner.Miner
from base_miner.registry import DETECTOR_REGISTRY from natix.utils.config import get_device from PIL import Image import base64 from natix.protocol import ExtendedImageSynapse import io from natix.base.miner import BaseMinerNeuron import bittensor as bt import typing class Miner(BaseMinerNeuron): def __init__(sel...
class Miner(BaseMinerNeuron): def __init__(self, config=None): pass def load_image_detector(self): pass async def forward_image(self, synapse: ExtendedImageSynapse) -> ExtendedImageSynapse: ''' Perform inference on image Args: synapse (bt.Synapse): The...
7
1
11
1
8
1
2
0.16
1
6
1
0
6
1
6
48
73
14
51
12
44
8
41
11
34
4
6
2
11
326,498
natixnetwork/streetvision-subnet
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/natixnetwork_streetvision-subnet/neurons/validator_proxy.py
neurons.validator_proxy.ValidatorProxy
from natix.validator.proxy import ProxyCounter from natix.validator.organic_task_distributor import OrganicTaskDistributor import socket from concurrent.futures import ThreadPoolExecutor from natix.protocol import prepare_synapse from cryptography.hazmat.primitives.asymmetric.ed25519 import Ed25519PublicKey import base...
class ValidatorProxy: def __init__(self, validator): pass def get_credentials(self): pass def verify_credentials(public_key_bytes): pass def start_server(self): pass def authenticate_token(self, public_key_bytes): pass async ...
9
0
25
3
21
0
3
0.02
0
12
2
0
7
9
7
7
197
30
164
44
152
3
119
37
110
9
0
3
25
326,499
circuit-synth/circuit-synth
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/circuit-synth_circuit-synth/src/circuit_synth/ai_integration/claude/agent_registry.py
circuit_synth.ai_integration.claude.agent_registry.CircuitSubAgent
import json from typing import Any, Callable, Dict, List, Optional class CircuitSubAgent: """Represents a circuit design sub-agent""" def __init__(self, name: str, description: str, system_prompt: str, allowed_tools: List[str], expertise_area: str, model: Optional[str]=None): self.name = name ...
class CircuitSubAgent: '''Represents a circuit design sub-agent''' def __init__(self, name: str, description: str, system_prompt: str, allowed_tools: List[str], expertise_area: str, model: Optional[str]=None): pass def to_markdown(self) -> str: '''Convert agent to Claude Code markdown for...
3
2
18
2
16
1
3
0.09
0
2
0
0
2
6
2
2
40
5
32
20
21
3
19
12
16
4
0
2
5