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,000
continental/pydremio
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/continental_pydremio/src/dremio/models/jobs.py
dremio.models.jobs.Job
from dataclasses import dataclass from uuid import UUID from datetime import datetime from typing import Literal, Optional, Any, TypedDict, Union, List, Dict, overload @dataclass class Job: jobState: Literal['COMPLETED', 'CANCELED', 'FAILED', 'RUNNING'] errorMessage: str startedAt: datetime queryType: ...
@dataclass class Job: pass
2
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
29
0
29
8
28
0
14
8
13
0
0
0
0
326,001
continental/pydremio
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/continental_pydremio/src/dremio/models/jobs.py
dremio.models.jobs.JobResult
from typing import Literal, Optional, Any, TypedDict, Union, List, Dict, overload import polars as pl from dataclasses import dataclass from .schema import Schema, SQLType, SchemaField import pyarrow @dataclass class JobResult: """This is a job result object. You can run `json()`, `to_polars()` or `to_pandas()...
@dataclass class JobResult: '''This is a job result object. You can run `json()`, `to_polars()` or `to_pandas()` on the result to use the data. ''' @staticmethod def from_arrow_table(arrow_table: pyarrow.Table) -> 'JobResult': pass @staticmethod def from_dict(d: JobResultDict) -> 'Jo...
24
8
7
1
4
2
1
0.43
0
10
2
0
14
0
16
16
148
32
81
39
53
35
59
31
39
4
0
1
22
326,002
continental/pydremio
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/continental_pydremio/src/dremio/models/jobs.py
dremio.models.jobs.JobResultDict
from typing import Literal, Optional, Any, TypedDict, Union, List, Dict, overload from .schema import Schema, SQLType, SchemaField class JobResultDict(TypedDict): rowCount: int schema: list[SchemaField] rows: list[dict[str, Any]]
class JobResultDict(TypedDict): pass
1
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
4
0
4
1
3
0
4
1
3
0
1
0
0
326,003
continental/pydremio
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/continental_pydremio/src/dremio/models/jobs.py
dremio.models.jobs.ReflectionRelationship
from dataclasses import dataclass from uuid import UUID from typing import Literal, Optional, Any, TypedDict, Union, List, Dict, overload @dataclass class ReflectionRelationship: datasetId: UUID reflectionId: UUID relationship: Literal['CONSIDERED', 'MATCHED', 'CHOSEN']
@dataclass class ReflectionRelationship: pass
2
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
4
0
4
1
3
0
4
1
3
0
0
0
0
326,004
continental/pydremio
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/continental_pydremio/src/dremio/models/lineage.py
dremio.models.lineage.Lineage
from dataclasses import dataclass from .custom_objects import CatalogElement @dataclass class Lineage: sources: list[CatalogElement] parents: list[CatalogElement] children: list[CatalogElement]
@dataclass class Lineage: pass
2
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
4
0
4
1
3
0
4
1
3
0
0
0
0
326,005
continental/pydremio
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/continental_pydremio/src/dremio/models/reflections.py
dremio.models.reflections.DimensionField
from typing import Literal, Optional, List from dataclasses import dataclass @dataclass class DimensionField: name: str granularity: Optional[str] = None
@dataclass class DimensionField: pass
2
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
3
0
3
2
2
0
3
2
2
0
0
0
0
326,006
continental/pydremio
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/continental_pydremio/src/dremio/models/reflections.py
dremio.models.reflections.Field
from dataclasses import dataclass @dataclass class Field: name: str
@dataclass class Field: pass
2
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
2
0
2
1
1
0
2
1
1
0
0
0
0
326,007
continental/pydremio
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/continental_pydremio/src/dremio/models/reflections.py
dremio.models.reflections.MeasureField
from typing import Literal, Optional, List from dataclasses import dataclass @dataclass class MeasureField: name: str measureTypeList: List[Literal['COUNT', 'SUM', 'APPROX_COUNT_DISTINCT', 'MIN', 'MAX', 'UNKNOWN']]
@dataclass class MeasureField: pass
2
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
5
0
5
1
4
0
3
1
2
0
0
0
0
326,008
continental/pydremio
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/continental_pydremio/src/dremio/models/reflections.py
dremio.models.reflections.NewReflection
from dataclasses import dataclass from typing import Literal, Optional, List @dataclass class NewReflection: type: Literal['RAW', 'AGGREGATION'] enabled: bool entityType: Optional[str] = None canAlter: Optional[bool] = None partitionDistributionStrategy: Optional[str] = None sortFields: Optiona...
@dataclass class NewReflection: pass
2
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
14
0
14
12
13
0
14
12
13
0
0
0
0
326,009
continental/pydremio
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/continental_pydremio/src/dremio/models/reflections.py
dremio.models.reflections.Reflection
from dataclasses import dataclass from datetime import datetime from uuid import UUID from typing import Literal, Optional, List @dataclass class Reflection: id: UUID type: Literal['RAW', 'AGGREGATION'] name: str tag: str createdAt: datetime updatedAt: datetime datasetId: UUID currentSi...
@dataclass class Reflection: pass
2
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
23
0
23
12
22
0
23
12
22
0
0
0
0
326,010
continental/pydremio
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/continental_pydremio/src/dremio/models/reflections.py
dremio.models.reflections.Status
from datetime import datetime from typing import Literal, Optional, List from dataclasses import dataclass @dataclass class Status: config: Literal['OK', 'INVALID'] refresh: Literal['GIVEN_UP', 'MANUAL', 'RUNNING', 'SCHEDULED'] availability: Literal['NONE', 'INCOMPLETE', 'EXPIRED', 'AVAILABLE'] combine...
@dataclass class Status: pass
2
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
19
0
19
1
18
0
8
1
7
0
0
0
0
326,011
continental/pydremio
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/continental_pydremio/src/dremio/models/utils.py
dremio.models.utils.Message
from dataclasses import dataclass, fields @dataclass class Message: message: str
@dataclass class Message: pass
2
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
2
0
2
1
1
0
2
1
1
0
0
0
0
326,012
continental/pydremio
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/continental_pydremio/src/dremio/utils/multithreading.py
dremio.utils.multithreading.ThreadWithReturnValue
from threading import Thread class ThreadWithReturnValue(Thread): def __init__(self, group=None, target=None, name=None, args=(), kwargs={}, Verbose=None): Thread.__init__(self, group, target, name, args, kwargs) self._return = None def run(self): if self._target is not None: ...
class ThreadWithReturnValue(Thread): def __init__(self, group=None, target=None, name=None, args=(), kwargs={}, Verbose=None): pass def run(self): pass def join(self, *args): pass
4
0
4
0
4
1
1
0.17
1
0
0
0
3
1
3
28
14
2
12
7
6
2
10
5
6
2
1
1
4
326,013
continental/pydremio
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/continental_pydremio/src/dremio/utils/validation.py
dremio.utils.validation.Validation
import re from typing import Callable, Dict, Literal, Any, Union class Validation: regex = {'email': '^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\\.[a-zA-Z0-9-.]+$', 'password': '^.{8,}$', 'username': '^[a-zA-Z0-9_.-@]{3,}$', 'hostname': '^https?:\\/\\/(?:www\\.)?[-a-zA-Z0-9@:%._\\+~#=]{1,256}$', 'port': '^[0-9]{1,5}$'} ...
null
4
2
18
2
13
3
5
0.21
0
4
0
0
3
0
3
3
64
8
48
14
39
10
31
9
27
10
0
2
14
326,014
continental/pydremio
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/continental_pydremio/src/dremio/utils/validation.py
dremio.utils.validation.ValidationError
class ValidationError(Exception): pass
class ValidationError(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
326,015
Jelly-RDF/pyjelly
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/Jelly-RDF_pyjelly/pyjelly/errors.py
pyjelly.errors.JellyAssertionError
class JellyAssertionError(AssertionError): """Raised when a recommended assertion from the specification fails."""
class JellyAssertionError(AssertionError): '''Raised when a recommended assertion from the specification fails.''' pass
1
1
0
0
0
0
0
1
1
0
0
0
0
0
0
11
2
0
1
1
0
1
1
1
0
0
4
0
0
326,016
Jelly-RDF/pyjelly
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/Jelly-RDF_pyjelly/pyjelly/errors.py
pyjelly.errors.JellyConformanceError
class JellyConformanceError(Exception): """Raised when Jelly conformance is violated."""
class JellyConformanceError(Exception): '''Raised when Jelly conformance is violated.''' pass
1
1
0
0
0
0
0
1
1
0
0
0
0
0
0
10
2
0
1
1
0
1
1
1
0
0
3
0
0
326,017
Jelly-RDF/pyjelly
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/Jelly-RDF_pyjelly/pyjelly/errors.py
pyjelly.errors.JellyNotImplementedError
class JellyNotImplementedError(NotImplementedError): """Raised when a future feature is not yet implemented."""
class JellyNotImplementedError(NotImplementedError): '''Raised when a future feature is not yet implemented.''' pass
1
1
0
0
0
0
0
1
1
0
0
0
0
0
0
12
2
0
1
1
0
1
1
1
0
0
5
0
0
326,018
Jelly-RDF/pyjelly
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/Jelly-RDF_pyjelly/pyjelly/integrations/generic/generic_sink.py
pyjelly.integrations.generic.generic_sink.BlankNode
class BlankNode: """Class for blank nodes, storing BN's identifier as a string.""" def __init__(self, identifier: str) -> None: self._identifier: str = identifier def __str__(self) -> str: return f'_:{self._identifier}' def __repr__(self) -> str: return f'BlankNode(identifier=...
class BlankNode: '''Class for blank nodes, storing BN's identifier as a string.''' def __init__(self, identifier: str) -> None: pass def __str__(self) -> str: pass def __repr__(self) -> str: pass def __eq__(self, other: object) -> bool: pass def __hash__(self...
6
1
2
0
2
0
1
0.08
0
4
0
0
5
1
5
5
19
5
13
7
7
1
13
7
7
2
0
1
6
326,019
Jelly-RDF/pyjelly
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/Jelly-RDF_pyjelly/pyjelly/integrations/generic/generic_sink.py
pyjelly.integrations.generic.generic_sink.GenericStatementSink
from typing import IO, NamedTuple, Union from collections import deque from collections.abc import Generator class GenericStatementSink: _store: deque[Triple | Quad] def __init__(self, identifier: GraphName=DefaultGraph) -> None: """ Initialize statements storage, namespaces dictionary, and pa...
class GenericStatementSink: def __init__(self, identifier: GraphName=DefaultGraph) -> None: ''' Initialize statements storage, namespaces dictionary, and parser. Notes: _store preserves the order of statements. Args: identifier (str, optional): Identifier fo...
16
2
4
1
3
1
1
0.37
0
11
3
0
11
2
11
11
66
18
35
21
17
13
31
17
17
1
0
0
11
326,020
Jelly-RDF/pyjelly
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/Jelly-RDF_pyjelly/pyjelly/integrations/generic/generic_sink.py
pyjelly.integrations.generic.generic_sink.IRI
class IRI: """Class for IRIs, storing IRI as a string.""" def __init__(self, iri: str) -> None: self._iri: str = iri def __str__(self) -> str: return f'<{self._iri}>' def __repr__(self) -> str: return f'IRI({self._iri})' def __eq__(self, other: object) -> bool: if...
class IRI: '''Class for IRIs, storing IRI as a string.''' def __init__(self, iri: str) -> None: pass def __str__(self) -> str: pass def __repr__(self) -> str: pass def __eq__(self, other: object) -> bool: pass def __hash__(self) -> int: pass
6
1
2
0
2
0
1
0.08
0
4
0
0
5
1
5
5
19
5
13
7
7
1
13
7
7
2
0
1
6
326,021
Jelly-RDF/pyjelly
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/Jelly-RDF_pyjelly/pyjelly/integrations/generic/generic_sink.py
pyjelly.integrations.generic.generic_sink.Literal
class Literal: """ Class for literals. Notes: Consists of: lexical form, and optional language tag and datatype. All parts of literal are stored as strings. """ def __init__(self, lex: str, langtag: str | None=None, datatype: str | None=None) -> None: self._lex: str = lex ...
class Literal: ''' Class for literals. Notes: Consists of: lexical form, and optional language tag and datatype. All parts of literal are stored as strings. ''' def __init__(self, lex: str, langtag: str | None=None, datatype: str | None=None) -> None: pass def __str__(s...
6
1
6
0
6
0
2
0.21
0
4
0
0
5
3
5
5
42
7
29
12
21
6
19
10
13
3
0
1
8
326,022
Jelly-RDF/pyjelly
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/Jelly-RDF_pyjelly/pyjelly/integrations/generic/generic_sink.py
pyjelly.integrations.generic.generic_sink.Prefix
from typing import IO, NamedTuple, Union class Prefix(NamedTuple): """Class for generic namespace declaration.""" prefix: str iri: IRI
class Prefix(NamedTuple): '''Class for generic namespace declaration.''' pass
1
1
0
0
0
0
0
0.33
1
0
0
0
0
0
0
0
5
1
3
1
2
1
3
1
2
0
1
0
0
326,023
Jelly-RDF/pyjelly
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/Jelly-RDF_pyjelly/pyjelly/integrations/generic/generic_sink.py
pyjelly.integrations.generic.generic_sink.Quad
from typing import IO, NamedTuple, Union class Quad(NamedTuple): """Class for RDF quads.""" s: Node p: Node o: Node g: GraphName
class Quad(NamedTuple): '''Class for RDF quads.''' pass
1
1
0
0
0
0
0
0.2
1
0
0
0
0
0
0
0
7
1
5
1
4
1
5
1
4
0
1
0
0
326,024
Jelly-RDF/pyjelly
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/Jelly-RDF_pyjelly/pyjelly/integrations/generic/generic_sink.py
pyjelly.integrations.generic.generic_sink.Triple
from typing import IO, NamedTuple, Union class Triple(NamedTuple): """Class for RDF triples.""" s: Node p: Node o: Node
class Triple(NamedTuple): '''Class for RDF triples.''' pass
1
1
0
0
0
0
0
0.25
1
0
0
0
0
0
0
0
6
1
4
1
3
1
4
1
3
0
1
0
0
326,025
Jelly-RDF/pyjelly
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/Jelly-RDF_pyjelly/pyjelly/integrations/generic/generic_sink.py
pyjelly.integrations.generic.generic_sink._DefaultGraph
class _DefaultGraph: def __repr__(self) -> str: return ''
class _DefaultGraph: def __repr__(self) -> str: pass
2
0
2
0
2
0
1
0
0
1
0
0
1
0
1
1
3
0
3
2
1
0
3
2
1
1
0
0
1
326,026
Jelly-RDF/pyjelly
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/Jelly-RDF_pyjelly/pyjelly/integrations/generic/parse.py
pyjelly.integrations.generic.parse.GenericGraphsAdapter
from pyjelly.errors import JellyConformanceError from collections.abc import Generator, Iterable from typing import IO, Any, Callable, Union from pyjelly.parse.decode import Adapter, Decoder, ParserOptions from itertools import chain from typing_extensions import override from pyjelly.integrations.generic.generic_sink ...
class GenericGraphsAdapter(GenericQuadsBaseAdapter): ''' Extends GenericQuadsBaseAdapter for GRAPHS physical type. Notes: introduces graph start/end, checks if graph exists. Args: GenericQuadsBaseAdapter (_type_): quads adapter that handles base quads processing. Raises:...
10
1
3
0
3
0
1
0.45
1
7
3
0
5
0
5
44
42
10
22
14
9
10
15
7
9
2
6
1
6
326,027
Jelly-RDF/pyjelly
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/Jelly-RDF_pyjelly/pyjelly/integrations/generic/parse.py
pyjelly.integrations.generic.parse.GenericQuadsAdapter
from typing_extensions import override from pyjelly.integrations.generic.generic_sink import IRI, BlankNode, DefaultGraph, GenericStatementSink, GraphName, Literal, Prefix, Quad, Triple from typing import IO, Any, Callable, Union from collections.abc import Generator, Iterable class GenericQuadsAdapter(GenericQuadsBas...
class GenericQuadsAdapter(GenericQuadsBaseAdapter): ''' Extends GenericQuadsBaseAdapter for QUADS physical type. Args: GenericQuadsBaseAdapter (_type_): quads adapter that handles base quads processing. ''' @override def quad(self, terms: Iterable[Any]) -> Quad: pass
3
1
2
0
2
0
1
1.5
1
3
1
0
1
0
1
40
13
3
4
3
1
6
3
2
1
1
6
0
1
326,028
Jelly-RDF/pyjelly
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/Jelly-RDF_pyjelly/pyjelly/integrations/generic/parse.py
pyjelly.integrations.generic.parse.GenericQuadsBaseAdapter
from pyjelly.parse.decode import Adapter, Decoder, ParserOptions class GenericQuadsBaseAdapter(GenericStatementSinkAdapter): def __init__(self, options: ParserOptions) -> None: super().__init__(options=options)
class GenericQuadsBaseAdapter(GenericStatementSinkAdapter): def __init__(self, options: ParserOptions) -> None: pass
2
0
2
0
2
0
1
0
1
2
1
2
1
0
1
39
3
0
3
2
1
0
3
2
1
1
5
0
1
326,029
Jelly-RDF/pyjelly
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/Jelly-RDF_pyjelly/pyjelly/integrations/generic/parse.py
pyjelly.integrations.generic.parse.GenericStatementSinkAdapter
from pyjelly.integrations.generic.generic_sink import IRI, BlankNode, DefaultGraph, GenericStatementSink, GraphName, Literal, Prefix, Quad, Triple from typing import IO, Any, Callable, Union from pyjelly.parse.decode import Adapter, Decoder, ParserOptions from collections.abc import Generator, Iterable from typing_exte...
class GenericStatementSinkAdapter(Adapter): ''' Implement Adapter for generic statements. Notes: Returns custom RDF terms expected by GenericStatementSink, handles namespace declarations, and quoted triples. Args: Adapter (_type_): base Adapter class ''' @override de...
13
1
3
0
3
0
1
0.33
1
8
5
2
6
0
6
38
41
9
24
18
6
8
13
7
6
1
4
0
6
326,030
Jelly-RDF/pyjelly
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/Jelly-RDF_pyjelly/pyjelly/integrations/generic/parse.py
pyjelly.integrations.generic.parse.GenericTriplesAdapter
from collections.abc import Generator, Iterable from typing import IO, Any, Callable, Union from typing_extensions import override from pyjelly.parse.decode import Adapter, Decoder, ParserOptions from pyjelly.integrations.generic.generic_sink import IRI, BlankNode, DefaultGraph, GenericStatementSink, GraphName, Literal...
class GenericTriplesAdapter(GenericStatementSinkAdapter): ''' Triples adapted implementation for GenericStatementSink. Args: GenericStatementSinkAdapter (_type_): base GenericStatementSink adapter implementation that handles terms and namespaces. ''' def __init__(self, options:...
4
1
4
0
4
0
1
0.67
1
5
2
0
2
0
2
40
19
4
9
7
2
6
5
3
2
1
5
0
2
326,031
Jelly-RDF/pyjelly
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/Jelly-RDF_pyjelly/pyjelly/integrations/generic/serialize.py
pyjelly.integrations.generic.serialize.GenericSinkTermEncoder
from pyjelly.integrations.generic.generic_sink import GenericStatementSink, Quad, Triple, DefaultGraph, GraphName, IRI, BlankNode, Literal from pyjelly.serialize.encode import Rows, Slot, TermEncoder, HasGraph, Statement class GenericSinkTermEncoder(TermEncoder): def encode_spo(self, term: object, slot: Slot, sta...
class GenericSinkTermEncoder(TermEncoder): def encode_spo(self, term: object, slot: Slot, statement: Statement) -> Rows: ''' Encode term based on its GenericSink object. Args: term (object): term to encode slot (Slot): its place in statement. statement (...
3
2
34
6
20
10
5
0.47
1
7
5
0
2
0
2
14
70
13
40
6
37
19
26
6
23
5
1
1
10
326,032
Jelly-RDF/pyjelly
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/Jelly-RDF_pyjelly/pyjelly/integrations/rdflib/parse.py
pyjelly.integrations.rdflib.parse.Prefix
from typing_extensions import Never, Self, override import rdflib class Prefix(tuple[str, rdflib.URIRef]): """ Describe RDF Prefix(i.e, namespace declaration). Args: tuple (str, rdflib.URIRef): expects prefix as a string, and full namespace URI as Rdflib.URIRef. Returns: P...
class Prefix(tuple[str, rdflib.URIRef]): ''' Describe RDF Prefix(i.e, namespace declaration). Args: tuple (str, rdflib.URIRef): expects prefix as a string, and full namespace URI as Rdflib.URIRef. Returns: Prefix: prefix as tuple(prefix, iri). ''' def __new__(cls, p...
6
1
2
0
2
0
1
0.8
1
1
0
0
3
0
3
23
25
7
10
7
4
8
8
5
4
1
2
0
3
326,033
Jelly-RDF/pyjelly
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/Jelly-RDF_pyjelly/pyjelly/integrations/rdflib/parse.py
pyjelly.integrations.rdflib.parse.Quad
from typing_extensions import Never, Self, override from rdflib import Node class Quad(tuple[Node, Node, Node, GraphName]): """ Describe RDFLib quad. Args: tuple (Node, Node, Node, GraphName): s/p/o/g as a tuple of RDFLib nodes and a GraphName, Returns: Quad: quad as tuple...
class Quad(tuple[Node, Node, Node, GraphName]): ''' Describe RDFLib quad. Args: tuple (Node, Node, Node, GraphName): s/p/o/g as a tuple of RDFLib nodes and a GraphName, Returns: Quad: quad as tuple. ''' def __new__(cls, s: Node, p: Node, o: Node, g: GraphName) -> Se...
10
1
2
0
2
0
1
0.5
1
0
0
0
5
0
5
25
33
9
16
11
6
8
12
7
6
1
2
0
5
326,034
Jelly-RDF/pyjelly
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/Jelly-RDF_pyjelly/pyjelly/integrations/rdflib/parse.py
pyjelly.integrations.rdflib.parse.RDFLibAdapter
import rdflib from typing_extensions import Never, Self, override from rdflib.graph import DATASET_DEFAULT_GRAPH_ID, Dataset, Graph from pyjelly.parse.decode import Adapter, Decoder, ParserOptions class RDFLibAdapter(Adapter): """ RDFLib adapter class, is extended by triples and quads implementations. Arg...
class RDFLibAdapter(Adapter): ''' RDFLib adapter class, is extended by triples and quads implementations. Args: Adapter (): abstract adapter class ''' @override def iri(self, iri: str) -> rdflib.URIRef: pass @override def bnode(self, bnode: str) -> rdflib.BNode: ...
11
1
3
0
3
0
1
0.24
1
2
1
2
5
0
5
37
33
7
21
16
5
5
11
6
5
1
4
0
5
326,035
Jelly-RDF/pyjelly
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/Jelly-RDF_pyjelly/pyjelly/integrations/rdflib/parse.py
pyjelly.integrations.rdflib.parse.RDFLibGraphsAdapter
from pyjelly.parse.decode import Adapter, Decoder, ParserOptions from collections.abc import Generator, Iterable from typing_extensions import Never, Self, override from pyjelly.errors import JellyConformanceError from itertools import chain from typing import IO, Any, Callable, Union class RDFLibGraphsAdapter(RDFLibQ...
class RDFLibGraphsAdapter(RDFLibQuadsBaseAdapter): ''' Extension of RDFLibQuadsBaseAdapter for the GRAPHS physical type. Notes: introduces graph start/end, checks if graph exists. Args: RDFLibQuadsBaseAdapter (RDFLibAdapter): base adapter for quads management. Raises: JellyConforman...
10
1
3
0
3
0
1
0.36
1
8
3
0
5
0
5
43
40
10
22
14
9
8
15
7
9
2
6
1
6
326,036
Jelly-RDF/pyjelly
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/Jelly-RDF_pyjelly/pyjelly/integrations/rdflib/parse.py
pyjelly.integrations.rdflib.parse.RDFLibJellyParser
from rdflib.graph import DATASET_DEFAULT_GRAPH_ID, Dataset, Graph from rdflib.parser import Parser as RDFLibParser from rdflib.parser import InputSource class RDFLibJellyParser(RDFLibParser): def parse(self, source: InputSource, sink: Graph) -> None: """ Parse jelly file into provided RDFLib Graph...
class RDFLibJellyParser(RDFLibParser): def parse(self, source: InputSource, sink: Graph) -> None: ''' Parse jelly file into provided RDFLib Graph. Args: source (InputSource): jelly file as buffered binary stream InputSource obj sink (Graph): RDFLib Graph Rai...
2
1
21
3
10
9
2
0.82
1
1
0
0
1
0
1
1
22
3
11
4
9
9
7
4
5
2
1
1
2
326,037
Jelly-RDF/pyjelly
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/Jelly-RDF_pyjelly/pyjelly/integrations/rdflib/parse.py
pyjelly.integrations.rdflib.parse.RDFLibQuadsAdapter
from collections.abc import Generator, Iterable from typing_extensions import Never, Self, override from typing import IO, Any, Callable, Union class RDFLibQuadsAdapter(RDFLibQuadsBaseAdapter): """ Extended RDFLib adapter for the QUADS physical type. Args: RDFLibQuadsBaseAdapter (RDFLibAdapter): b...
class RDFLibQuadsAdapter(RDFLibQuadsBaseAdapter): ''' Extended RDFLib adapter for the QUADS physical type. Args: RDFLibQuadsBaseAdapter (RDFLibAdapter): base quads adapter (shared with graphs physical type) ''' @override def quad(self, terms: Iterable[Any]) -> Quad: ...
3
1
2
0
2
0
1
1.5
1
3
1
0
1
0
1
39
13
3
4
3
1
6
3
2
1
1
6
0
1
326,038
Jelly-RDF/pyjelly
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/Jelly-RDF_pyjelly/pyjelly/integrations/rdflib/parse.py
pyjelly.integrations.rdflib.parse.RDFLibQuadsBaseAdapter
from pyjelly.parse.decode import Adapter, Decoder, ParserOptions class RDFLibQuadsBaseAdapter(RDFLibAdapter): def __init__(self, options: ParserOptions) -> None: super().__init__(options=options)
class RDFLibQuadsBaseAdapter(RDFLibAdapter): def __init__(self, options: ParserOptions) -> None: pass
2
0
2
0
2
0
1
0
1
2
1
2
1
0
1
38
3
0
3
2
1
0
3
2
1
1
5
0
1
326,039
Jelly-RDF/pyjelly
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/Jelly-RDF_pyjelly/pyjelly/integrations/rdflib/parse.py
pyjelly.integrations.rdflib.parse.RDFLibTriplesAdapter
from typing import IO, Any, Callable, Union from collections.abc import Generator, Iterable from typing_extensions import Never, Self, override from pyjelly.parse.decode import Adapter, Decoder, ParserOptions class RDFLibTriplesAdapter(RDFLibAdapter): """ Triples adapter RDFLib implementation. Notes: retu...
class RDFLibTriplesAdapter(RDFLibAdapter): ''' Triples adapter RDFLib implementation. Notes: returns triple/namespace declaration as soon as receives them. ''' def __init__(self, options: ParserOptions) -> None: pass @override def triple(self, terms: Iterable[Any]) -> Triple: ...
4
1
4
0
4
0
1
0.44
1
5
2
0
2
0
2
39
16
3
9
7
2
4
5
3
2
1
5
0
2
326,040
Jelly-RDF/pyjelly
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/Jelly-RDF_pyjelly/pyjelly/integrations/rdflib/parse.py
pyjelly.integrations.rdflib.parse.Triple
from typing_extensions import Never, Self, override from rdflib import Node class Triple(tuple[Node, Node, Node]): """ Describe RDFLib triple. Args: tuple (Node, Node, Node): s/p/o tuple of RDFLib Nodes. Returns: Triple: triple as tuple. """ __slots__ = () def __new__(cl...
class Triple(tuple[Node, Node, Node]): ''' Describe RDFLib triple. Args: tuple (Node, Node, Node): s/p/o tuple of RDFLib Nodes. Returns: Triple: triple as tuple. ''' def __new__(cls, s: Node, p: Node, o: Node) -> Self: pass @property def s(self) -> Node: ...
8
1
2
0
2
0
1
0.54
1
0
0
0
4
0
4
24
28
8
13
9
5
7
10
6
5
1
2
0
4
326,041
Jelly-RDF/pyjelly
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/Jelly-RDF_pyjelly/pyjelly/integrations/rdflib/serialize.py
pyjelly.integrations.rdflib.serialize.RDFLibJellySerializer
from rdflib import Graph from pyjelly.serialize.ioutils import write_delimited, write_single from typing import Any, IO from pyjelly.serialize.streams import GraphStream, QuadStream, SerializerOptions, Stream, TripleStream from typing_extensions import override from rdflib.serializer import Serializer as RDFLibSerializ...
class RDFLibJellySerializer(RDFLibSerializer): ''' RDFLib serializer for writing graphs in Jelly RDF stream format. Handles streaming RDF terms into Jelly frames using internal encoders. Supports only graphs and datasets (not quoted graphs). ''' def __init__(self, store: Graph) -> None: ...
4
2
17
1
11
6
4
0.7
1
7
2
0
2
0
2
2
44
6
23
15
11
16
14
6
11
5
1
1
7
326,042
Jelly-RDF/pyjelly
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/Jelly-RDF_pyjelly/pyjelly/integrations/rdflib/serialize.py
pyjelly.integrations.rdflib.serialize.RDFLibTermEncoder
import rdflib from pyjelly.serialize.encode import Rows, Slot, TermEncoder, Statement, HasGraph from rdflib.graph import DATASET_DEFAULT_GRAPH_ID, Dataset, QuotedGraph class RDFLibTermEncoder(TermEncoder): def encode_spo(self, term: object, slot: Slot, statement: Statement) -> Rows: """ Encode s/p...
class RDFLibTermEncoder(TermEncoder): def encode_spo(self, term: object, slot: Slot, statement: Statement) -> Rows: ''' Encode s/p/o term based on its RDFLib object. Args: term (object): term to encode slot (Slot): its place in statement. statement (Stat...
3
2
28
6
13
11
4
0.81
1
4
1
0
2
0
2
14
57
12
26
5
23
21
21
5
18
4
1
1
8
326,043
Jelly-RDF/pyjelly
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/Jelly-RDF_pyjelly/pyjelly/options.py
pyjelly.options.LookupPreset
from pyjelly.errors import JellyAssertionError, JellyConformanceError from dataclasses import dataclass from typing_extensions import Self @dataclass(frozen=True) class LookupPreset: max_names: int = DEFAULT_NAME_LOOKUP_SIZE max_prefixes: int = DEFAULT_PREFIX_LOOKUP_SIZE max_datatypes: int = DEFAULT_DATATY...
@dataclass(frozen=True) class LookupPreset: def __post_init__(self) -> None: pass @classmethod def small(cls) -> Self: pass
5
0
3
0
3
0
2
0
0
1
1
0
1
0
2
2
13
2
11
8
7
0
10
7
7
2
0
1
3
326,044
Jelly-RDF/pyjelly
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/Jelly-RDF_pyjelly/pyjelly/options.py
pyjelly.options.StreamParameters
from dataclasses import dataclass from pyjelly.errors import JellyAssertionError, JellyConformanceError @dataclass(frozen=True) class StreamParameters: generalized_statements: bool = False rdf_star: bool = False version: int = MAX_VERSION delimited: bool = True namespace_declarations: bool = False ...
@dataclass(frozen=True) class StreamParameters: def __post_init__(self) -> None: pass
3
0
7
0
7
0
3
0
0
2
1
0
1
0
1
1
15
1
14
10
12
0
13
10
11
3
0
1
3
326,045
Jelly-RDF/pyjelly
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/Jelly-RDF_pyjelly/pyjelly/options.py
pyjelly.options.StreamTypes
from dataclasses import dataclass from pyjelly import jelly from contextlib import suppress @dataclass(frozen=True) class StreamTypes: physical_type: jelly.PhysicalStreamType = jelly.PHYSICAL_STREAM_TYPE_UNSPECIFIED logical_type: jelly.LogicalStreamType = jelly.LOGICAL_STREAM_TYPE_UNSPECIFIED @property ...
@dataclass(frozen=True) class StreamTypes: @property def flat(self) -> bool: pass def __repr__(self) -> str: ''' Return the representation of StreamTypes. >>> repr(StreamTypes(9999, 8888)) 'StreamTypes(9999, 8888)' ''' pass def __post_init__(sel...
6
1
7
0
5
2
1
0.25
0
4
0
0
3
0
3
3
29
4
20
9
15
5
13
8
9
1
0
1
3
326,046
Jelly-RDF/pyjelly
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/Jelly-RDF_pyjelly/pyjelly/parse/decode.py
pyjelly.parse.decode.Adapter
from collections.abc import Iterable, Iterator, Sequence from typing import Any, ClassVar, NamedTuple from abc import ABCMeta, abstractmethod class Adapter(metaclass=ABCMeta): def __init__(self, options: ParserOptions, parsing_mode: ParsingMode=ParsingMode.FLAT) -> None: self.options = options sel...
class Adapter(metaclass=ABCMeta): def __init__(self, options: ParserOptions, parsing_mode: ParsingMode=ParsingMode.FLAT) -> None: pass @abstractmethod def iri(self, iri: str) -> Any: pass @abstractmethod def default_graph(self) -> Any: pass @abstractmethod def bnode...
17
0
3
0
3
0
1
0.15
1
6
2
3
12
2
12
32
59
11
46
26
22
7
26
15
13
1
3
0
12
326,047
Jelly-RDF/pyjelly
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/Jelly-RDF_pyjelly/pyjelly/parse/decode.py
pyjelly.parse.decode.Decoder
from typing import Any, ClassVar, NamedTuple from collections.abc import Iterable, Iterator, Sequence from pyjelly import jelly from pyjelly.parse.lookup import LookupDecoder class Decoder: def __init__(self, adapter: Adapter) -> None: """ Initialize decoder. Initializes decoder with a lo...
class Decoder: def __init__(self, adapter: Adapter) -> None: ''' Initialize decoder. Initializes decoder with a lookup tables with preset sizes, integration-dependent adapter and empty repeated terms dictionary. Args: adapter (Adapter): integration-dependent ada...
22
11
12
2
6
4
2
0.65
0
12
3
0
20
5
20
20
283
57
137
64
108
89
100
56
79
4
0
3
31
326,048
Jelly-RDF/pyjelly
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/Jelly-RDF_pyjelly/pyjelly/parse/decode.py
pyjelly.parse.decode.ParserOptions
from pyjelly.options import MAX_VERSION, LookupPreset, StreamParameters, StreamTypes from typing import Any, ClassVar, NamedTuple class ParserOptions(NamedTuple): stream_types: StreamTypes lookup_preset: LookupPreset params: StreamParameters
class ParserOptions(NamedTuple): pass
1
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
4
0
4
1
3
0
4
1
3
0
1
0
0
326,049
Jelly-RDF/pyjelly
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/Jelly-RDF_pyjelly/pyjelly/parse/decode.py
pyjelly.parse.decode.ParsingMode
from enum import Enum, auto class ParsingMode(Enum): """ Specifies how jelly frames should be treated. Modes: FLAT Yield all frames as one Graph or Dataset. GROUPED Yield one Graph/Dataset per frame (grouped parsing). """ FLAT = auto() GROUPED = auto()
class ParsingMode(Enum): ''' Specifies how jelly frames should be treated. Modes: FLAT Yield all frames as one Graph or Dataset. GROUPED Yield one Graph/Dataset per frame (grouped parsing). ''' pass
1
1
0
0
0
0
0
2.67
1
0
0
0
0
0
0
49
13
2
3
3
2
8
3
3
2
0
4
0
0
326,050
Jelly-RDF/pyjelly
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/Jelly-RDF_pyjelly/pyjelly/parse/lookup.py
pyjelly.parse.lookup.LookupDecoder
from dataclasses import dataclass from collections import deque from pyjelly.options import MAX_LOOKUP_SIZE from pyjelly.errors import JellyAssertionError, JellyConformanceError @dataclass class LookupDecoder: """ Shared base for RDF lookup encoders using Jelly compression. Tracks the last assigned and la...
@dataclass class LookupDecoder: ''' Shared base for RDF lookup encoders using Jelly compression. Tracks the last assigned and last reused index. Parameters ---------- lookup_size Maximum lookup size. ''' def __init__(self, *, lookup_size: int) -> None: pass def assi...
8
1
7
0
7
0
2
0.19
0
5
2
0
6
2
6
6
60
10
42
18
35
8
42
18
35
2
0
1
12
326,051
Jelly-RDF/pyjelly
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/Jelly-RDF_pyjelly/pyjelly/serialize/encode.py
pyjelly.serialize.encode.Slot
from enum import IntEnum class Slot(IntEnum): subject = 0 predicate = 1 object = 2 graph = 3
class Slot(IntEnum): pass
1
0
0
0
0
0
0
0
1
0
0
0
0
0
0
55
5
0
5
5
4
0
5
5
4
0
3
0
0
326,052
Jelly-RDF/pyjelly
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/Jelly-RDF_pyjelly/pyjelly/serialize/encode.py
pyjelly.serialize.encode.TermEncoder
from pyjelly.serialize.lookup import LookupEncoder from collections.abc import Iterable, Iterator, Sequence from pyjelly.errors import JellyConformanceError from pyjelly import jelly, options class TermEncoder: def __init__(self, lookup_preset: options.LookupPreset | None=None) -> None: if lookup_preset i...
class TermEncoder: def __init__(self, lookup_preset: options.LookupPreset | None=None) -> None: pass def encode_iri_indices(self, iri_string: str) -> tuple[Rows, int, int]: ''' Encode lookup indices for IRI. Args: iri_string (str): full iri in string format. ...
13
9
15
2
9
4
2
0.46
0
12
4
2
12
4
12
12
197
35
111
49
84
51
90
35
77
6
0
2
29
326,053
Jelly-RDF/pyjelly
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/Jelly-RDF_pyjelly/pyjelly/serialize/flows.py
pyjelly.serialize.flows.BoundedFrameFlow
from dataclasses import dataclass from typing_extensions import override from pyjelly import jelly from collections.abc import Iterable @dataclass class BoundedFrameFlow(FrameFlow): """ Produce frames automatically when a fixed number of rows is reached. Used for delimited encoding (default mode). """...
@dataclass class BoundedFrameFlow(FrameFlow): ''' Produce frames automatically when a fixed number of rows is reached. Used for delimited encoding (default mode). ''' @override def __init__(self, initlist: Iterable[jelly.RdfStreamRow] | None=None, logical_type: jelly.LogicalStreamType | None...
6
2
10
1
7
3
2
0.5
1
2
0
2
2
0
2
82
33
6
18
12
7
9
10
4
7
2
9
1
3
326,054
Jelly-RDF/pyjelly
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/Jelly-RDF_pyjelly/pyjelly/serialize/flows.py
pyjelly.serialize.flows.DatasetsFrameFlow
from pyjelly import jelly class DatasetsFrameFlow(FrameFlow): logical_type = jelly.LOGICAL_STREAM_TYPE_DATASETS def frame_from_dataset(self) -> jelly.RdfStreamFrame | None: """ Emit current flow content (dataset) as jelly frame. Returns: jelly.RdfStreamFrame | None: jelly ...
class DatasetsFrameFlow(FrameFlow): def frame_from_dataset(self) -> jelly.RdfStreamFrame | None: ''' Emit current flow content (dataset) as jelly frame. Returns: jelly.RdfStreamFrame | None: jelly frame or none if flow is empty. ''' pass
2
1
10
2
2
6
1
1.5
1
0
0
0
1
0
1
81
13
3
4
3
2
6
4
3
2
1
9
0
1
326,055
Jelly-RDF/pyjelly
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/Jelly-RDF_pyjelly/pyjelly/serialize/flows.py
pyjelly.serialize.flows.FlatQuadsFrameFlow
from pyjelly import jelly class FlatQuadsFrameFlow(BoundedFrameFlow): logical_type = jelly.LOGICAL_STREAM_TYPE_FLAT_QUADS
class FlatQuadsFrameFlow(BoundedFrameFlow): pass
1
0
0
0
0
0
0
0
1
0
0
0
0
0
0
82
2
0
2
2
1
0
2
2
1
0
10
0
0
326,056
Jelly-RDF/pyjelly
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/Jelly-RDF_pyjelly/pyjelly/serialize/flows.py
pyjelly.serialize.flows.FlatTriplesFrameFlow
from pyjelly import jelly class FlatTriplesFrameFlow(BoundedFrameFlow): logical_type = jelly.LOGICAL_STREAM_TYPE_FLAT_TRIPLES
class FlatTriplesFrameFlow(BoundedFrameFlow): pass
1
0
0
0
0
0
0
0
1
0
0
0
0
0
0
82
2
0
2
2
1
0
2
2
1
0
10
0
0
326,057
Jelly-RDF/pyjelly
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/Jelly-RDF_pyjelly/pyjelly/serialize/flows.py
pyjelly.serialize.flows.FrameFlow
from typing import Any, ClassVar from collections import UserList from collections.abc import Iterable from pyjelly import jelly class FrameFlow(UserList[jelly.RdfStreamRow]): """ Abstract base class for producing Jelly frames from RDF stream rows. Collects stream rows and assembles them into RdfStreamFra...
class FrameFlow(UserList[jelly.RdfStreamRow]): ''' Abstract base class for producing Jelly frames from RDF stream rows. Collects stream rows and assembles them into RdfStreamFrame objects when ready. Allows for passing LogicalStreamType, required for logical subtypes and non-delimited streams. ...
6
4
8
1
4
3
1
0.88
1
2
0
4
5
0
5
80
58
13
24
14
12
21
18
8
12
2
8
1
6
326,058
Jelly-RDF/pyjelly
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/Jelly-RDF_pyjelly/pyjelly/serialize/flows.py
pyjelly.serialize.flows.GraphsFrameFlow
from pyjelly import jelly class GraphsFrameFlow(FrameFlow): logical_type = jelly.LOGICAL_STREAM_TYPE_GRAPHS def frame_from_graph(self) -> jelly.RdfStreamFrame | None: """ Emit current flow content (one graph) as jelly frame. Returns: jelly.RdfStreamFrame | None: jelly fram...
class GraphsFrameFlow(FrameFlow): def frame_from_graph(self) -> jelly.RdfStreamFrame | None: ''' Emit current flow content (one graph) as jelly frame. Returns: jelly.RdfStreamFrame | None: jelly frame or none if flow is empty. ''' pass
2
1
10
2
2
6
1
1.5
1
0
0
0
1
0
1
81
13
3
4
3
2
6
4
3
2
1
9
0
1
326,059
Jelly-RDF/pyjelly
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/Jelly-RDF_pyjelly/pyjelly/serialize/flows.py
pyjelly.serialize.flows.ManualFrameFlow
from pyjelly import jelly class ManualFrameFlow(FrameFlow): """ Produces frames only when manually requested (never automatically). !!! warning All stream rows are kept in memory until `to_stream_frame()` is called. This may lead to high memory usage for large streams. Used for non-de...
class ManualFrameFlow(FrameFlow): ''' Produces frames only when manually requested (never automatically). !!! warning All stream rows are kept in memory until `to_stream_frame()` is called. This may lead to high memory usage for large streams. Used for non-delimited serialization. '...
1
1
0
0
0
0
0
3.5
1
0
0
0
0
0
0
80
12
3
2
2
1
7
2
2
1
0
9
0
0
326,060
Jelly-RDF/pyjelly
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/Jelly-RDF_pyjelly/pyjelly/serialize/lookup.py
pyjelly.serialize.lookup.Lookup
from collections import OrderedDict from typing import final @final class Lookup: """ Fixed-size 1-based string-to-index mapping with LRU eviction. - Assigns incrementing indices starting from 1. - After reaching the maximum size, reuses the existing indices from evicting the least-recently-used...
@final class Lookup: ''' Fixed-size 1-based string-to-index mapping with LRU eviction. - Assigns incrementing indices starting from 1. - After reaching the maximum size, reuses the existing indices from evicting the least-recently-used entries. - Index 0 is reserved for delta encoding in Jelly...
6
1
6
0
6
0
2
0.57
0
4
0
0
4
3
4
4
44
8
23
11
18
13
22
11
17
3
0
1
6
326,061
Jelly-RDF/pyjelly
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/Jelly-RDF_pyjelly/pyjelly/serialize/lookup.py
pyjelly.serialize.lookup.LookupEncoder
from dataclasses import dataclass @dataclass class LookupEncoder: """ Shared base for RDF lookup encoders using Jelly compression. Tracks the last assigned and last reused index. Parameters ---------- lookup_size Maximum lookup size. """ last_assigned_index: int last_reus...
@dataclass class LookupEncoder: ''' Shared base for RDF lookup encoders using Jelly compression. Tracks the last assigned and last reused index. Parameters ---------- lookup_size Maximum lookup size. ''' def __init__(self, *, lookup_size: int) -> None: pass def enco...
8
2
10
1
7
2
2
0.47
0
4
1
0
6
1
6
6
78
13
45
15
38
21
45
15
38
5
0
2
14
326,062
Jelly-RDF/pyjelly
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/Jelly-RDF_pyjelly/pyjelly/serialize/streams.py
pyjelly.serialize.streams.GraphStream
from collections.abc import Generator, Iterable from pyjelly.serialize.flows import DEFAULT_FRAME_SIZE, BoundedFrameFlow, FlatQuadsFrameFlow, FlatTriplesFrameFlow, FrameFlow, ManualFrameFlow, flow_for_type from typing import ClassVar from pyjelly import jelly class GraphStream(TripleStream): physical_type = jelly....
class GraphStream(TripleStream): def graph(self, graph_id: object, graph: Iterable[Iterable[object]]) -> Generator[jelly.RdfStreamFrame]: ''' Process one graph into a sequence of jelly frames. Args: graph_id (object): graph id (BN, Literal, iri, default) graph (Iter...
2
1
28
3
17
9
4
0.45
1
3
0
0
1
0
1
8
32
4
20
13
14
9
16
8
14
4
2
2
4
326,063
Jelly-RDF/pyjelly
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/Jelly-RDF_pyjelly/pyjelly/serialize/streams.py
pyjelly.serialize.streams.QuadStream
from typing import ClassVar from collections.abc import Generator, Iterable from pyjelly.serialize.encode import Slot, TermEncoder, encode_namespace_declaration, encode_options, encode_quad, encode_triple from pyjelly.serialize.flows import DEFAULT_FRAME_SIZE, BoundedFrameFlow, FlatQuadsFrameFlow, FlatTriplesFrameFlow,...
class QuadStream(Stream): def quad(self, terms: Iterable[object]) -> jelly.RdfStreamFrame | None: ''' Process one quad to Protobuf messages. Args: terms (Iterable[object]): terms to encode. Returns: jelly.RdfStreamFrame | None: stream frame if ...
2
1
19
3
8
8
1
0.73
1
2
0
0
1
1
1
7
23
4
11
6
9
8
7
5
5
1
1
0
1
326,064
Jelly-RDF/pyjelly
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/Jelly-RDF_pyjelly/pyjelly/serialize/streams.py
pyjelly.serialize.streams.SerializerOptions
from pyjelly.options import LookupPreset, StreamParameters, StreamTypes from pyjelly import jelly from dataclasses import dataclass, field from pyjelly.serialize.flows import DEFAULT_FRAME_SIZE, BoundedFrameFlow, FlatQuadsFrameFlow, FlatTriplesFrameFlow, FrameFlow, ManualFrameFlow, flow_for_type @dataclass class Seria...
@dataclass class SerializerOptions: pass
2
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
6
0
6
6
5
0
6
6
5
0
0
0
0
326,065
Jelly-RDF/pyjelly
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/Jelly-RDF_pyjelly/pyjelly/serialize/streams.py
pyjelly.serialize.streams.Stream
from pyjelly.serialize.encode import Slot, TermEncoder, encode_namespace_declaration, encode_options, encode_quad, encode_triple from pyjelly.options import LookupPreset, StreamParameters, StreamTypes from pyjelly import jelly from typing import ClassVar from pyjelly.serialize.flows import DEFAULT_FRAME_SIZE, BoundedFr...
class Stream: def __init__(self, *, encoder: TermEncoder, options: SerializerOptions | None=None) -> None: pass def infer_flow(self) -> FrameFlow: ''' Return flow based on the stream options provided. Returns: FrameFlow: initialised FrameFlow object. ''' ...
8
5
17
2
12
4
2
0.3
0
10
8
2
5
5
6
6
115
16
76
24
62
23
45
18
37
4
0
2
14
326,066
Jelly-RDF/pyjelly
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/Jelly-RDF_pyjelly/pyjelly/serialize/streams.py
pyjelly.serialize.streams.TripleStream
from collections.abc import Generator, Iterable from pyjelly.serialize.flows import DEFAULT_FRAME_SIZE, BoundedFrameFlow, FlatQuadsFrameFlow, FlatTriplesFrameFlow, FrameFlow, ManualFrameFlow, flow_for_type from typing import ClassVar from pyjelly import jelly from pyjelly.serialize.encode import Slot, TermEncoder, enco...
class TripleStream(Stream): def triple(self, terms: Iterable[object]) -> jelly.RdfStreamFrame | None: ''' Process one triple to Protobuf messages. Note: Adds new rows to the current flow and returns StreamFrame if frame size conditions are met. Args: ...
2
1
23
4
8
11
1
1
1
2
0
1
1
1
1
7
27
5
11
6
9
11
7
5
5
1
1
0
1
326,067
lightspeed-core/lightspeed-stack
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/lightspeed-core_lightspeed-stack/src/auth/interface.py
src.auth.interface.AuthInterface
from fastapi import Request from abc import ABC, abstractmethod class AuthInterface(ABC): """Base class for all authentication method implementations.""" @abstractmethod async def __call__(self, request: Request) -> AuthTuple: """Validate FastAPI Requests for authentication and authorization."""
class AuthInterface(ABC): '''Base class for all authentication method implementations.''' @abstractmethod async def __call__(self, request: Request) -> AuthTuple: '''Validate FastAPI Requests for authentication and authorization.''' pass
3
2
2
0
1
1
1
1
1
0
0
4
1
0
1
21
6
1
3
3
0
3
2
2
0
1
4
0
1
326,068
lightspeed-core/lightspeed-stack
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/lightspeed-core_lightspeed-stack/src/auth/jwk_token.py
src.auth.jwk_token.JwkTokenAuthDependency
from auth.interface import NO_AUTH_TUPLE, AuthInterface, AuthTuple from authlib.jose.errors import BadSignatureError, DecodeError, ExpiredTokenError, JoseError from models.config import JwkConfiguration from fastapi import Request, HTTPException, status from authlib.jose import JsonWebKey, KeySet, jwt, Key from auth.ut...
class JwkTokenAuthDependency(AuthInterface): '''JWK AuthDependency class for JWK-based JWT authentication.''' def __init__(self, config: JwkConfiguration, virtual_path: str=DEFAULT_VIRTUAL_PATH) -> None: '''Initialize the required allowed paths for authorization checks.''' pass async def ...
3
3
39
4
35
1
7
0.06
1
5
2
0
2
2
2
23
82
9
70
13
65
4
39
10
36
12
5
1
13
326,069
lightspeed-core/lightspeed-stack
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/lightspeed-core_lightspeed-stack/src/auth/jwk_token.py
src.auth.jwk_token.KeyNotFoundError
class KeyNotFoundError(Exception): """Exception raised when a key is not found in the JWK set based on kid/alg."""
class KeyNotFoundError(Exception): '''Exception raised when a key is not found in the JWK set based on kid/alg.''' pass
1
1
0
0
0
0
0
1
1
0
0
0
0
0
0
10
2
0
1
1
0
1
1
1
0
0
3
0
0
326,070
lightspeed-core/lightspeed-stack
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/lightspeed-core_lightspeed-stack/src/auth/k8s.py
src.auth.k8s.ClusterIDUnavailableError
class ClusterIDUnavailableError(Exception): """Cluster ID is not available."""
class ClusterIDUnavailableError(Exception): '''Cluster ID is not available.''' pass
1
1
0
0
0
0
0
1
1
0
0
0
0
0
0
10
2
0
1
1
0
1
1
1
0
0
3
0
0
326,071
lightspeed-core/lightspeed-stack
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/lightspeed-core_lightspeed-stack/src/auth/k8s.py
src.auth.k8s.K8SAuthDependency
from auth.utils import extract_user_token from constants import DEFAULT_VIRTUAL_PATH import kubernetes.client from fastapi import Request, HTTPException from kubernetes.client.rest import ApiException from auth.interface import AuthInterface class K8SAuthDependency(AuthInterface): """FastAPI dependency for Kuberne...
class K8SAuthDependency(AuthInterface): '''FastAPI dependency for Kubernetes (k8s) authentication and authorization. K8SAuthDependency is an authentication and authorization dependency for FastAPI endpoints, integrating with Kubernetes RBAC via SubjectAccessReview (SAR). This class extracts the user to...
3
3
22
2
16
4
3
0.53
1
3
1
0
2
1
2
23
58
10
32
10
29
17
20
9
17
5
5
2
6
326,072
lightspeed-core/lightspeed-stack
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/lightspeed-core_lightspeed-stack/src/auth/k8s.py
src.auth.k8s.K8sClientSingleton
from typing import Optional, Self from kubernetes.config import ConfigException from pathlib import Path from kubernetes.client.rest import ApiException import kubernetes.client from configuration import configuration class K8sClientSingleton: """Return the Kubernetes client instances. Ensures we initialize t...
class K8sClientSingleton: '''Return the Kubernetes client instances. Ensures we initialize the k8s client only once per application life cycle. manage the initialization and config loading. ''' def __new__(cls: type[Self]) -> Self: '''Create a new instance of the singleton, or returns the ...
12
6
19
1
15
2
4
0.17
0
8
1
0
1
0
6
6
135
14
103
23
91
18
73
15
66
6
0
4
21
326,073
lightspeed-core/lightspeed-stack
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/lightspeed-core_lightspeed-stack/src/auth/noop.py
src.auth.noop.NoopAuthDependency
from constants import DEFAULT_USER_NAME, DEFAULT_USER_UID, NO_USER_TOKEN, DEFAULT_VIRTUAL_PATH from auth.interface import AuthInterface from fastapi import Request class NoopAuthDependency(AuthInterface): """No-op AuthDependency class that bypasses authentication and authorization checks.""" def __init__(self...
class NoopAuthDependency(AuthInterface): '''No-op AuthDependency class that bypasses authentication and authorization checks.''' def __init__(self, virtual_path: str=DEFAULT_VIRTUAL_PATH) -> None: '''Initialize the required allowed paths for authorization checks.''' pass async def __call_...
3
3
11
1
5
5
1
1
1
2
0
0
2
1
2
23
25
4
11
5
8
11
8
5
5
1
5
0
2
326,074
lightspeed-core/lightspeed-stack
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/lightspeed-core_lightspeed-stack/src/auth/noop_with_token.py
src.auth.noop_with_token.NoopWithTokenAuthDependency
from auth.interface import AuthInterface from constants import DEFAULT_USER_NAME, DEFAULT_USER_UID, DEFAULT_VIRTUAL_PATH from fastapi import Request from auth.utils import extract_user_token class NoopWithTokenAuthDependency(AuthInterface): """No-op AuthDependency class that bypasses authentication and authorizati...
class NoopWithTokenAuthDependency(AuthInterface): '''No-op AuthDependency class that bypasses authentication and authorization checks.''' def __init__(self, virtual_path: str=DEFAULT_VIRTUAL_PATH) -> None: '''Initialize the required allowed paths for authorization checks.''' pass async de...
3
3
12
1
6
5
1
0.86
1
2
0
0
2
1
2
23
29
4
14
8
9
12
9
6
6
1
5
0
2
326,075
lightspeed-core/lightspeed-stack
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/lightspeed-core_lightspeed-stack/src/authorization/resolvers.py
src.authorization.resolvers.AccessResolver
from abc import ABC, abstractmethod from models.config import JwtRoleRule, AccessRule, JsonPathOperator, Action class AccessResolver(ABC): """Base class for all access resolution strategies.""" @abstractmethod def check_access(self, action: Action, user_roles: UserRoles) -> bool: """Check if the u...
class AccessResolver(ABC): '''Base class for all access resolution strategies.''' @abstractmethod def check_access(self, action: Action, user_roles: UserRoles) -> bool: '''Check if the user has access to the specified action based on their roles.''' pass @abstractmethod def get_acti...
5
3
2
0
1
1
1
0.8
1
3
1
2
2
0
2
22
10
2
5
5
0
4
3
3
0
1
4
0
2
326,076
lightspeed-core/lightspeed-stack
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/lightspeed-core_lightspeed-stack/src/authorization/resolvers.py
src.authorization.resolvers.GenericAccessResolver
from models.config import JwtRoleRule, AccessRule, JsonPathOperator, Action class GenericAccessResolver(AccessResolver): """Generic role-based access resolver, should apply with most authentication methods. This resolver simply checks if a list of roles allow a user to perform a specific action. The speci...
class GenericAccessResolver(AccessResolver): '''Generic role-based access resolver, should apply with most authentication methods. This resolver simply checks if a list of roles allow a user to perform a specific action. The special action ADMIN will grant the user the ability to perform any action, ''...
4
4
16
2
11
3
4
0.37
1
8
2
0
3
2
3
25
57
10
35
10
31
13
25
9
21
5
5
2
11
326,077
lightspeed-core/lightspeed-stack
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/lightspeed-core_lightspeed-stack/src/authorization/resolvers.py
src.authorization.resolvers.JwtRolesResolver
from models.config import JwtRoleRule, AccessRule, JsonPathOperator, Action from auth.interface import AuthTuple from jsonpath_ng import parse from typing import Any import constants class JwtRolesResolver(RolesResolver): """Processes JWT claims with the given JSONPath rules to get roles.""" def __init__(self...
class JwtRolesResolver(RolesResolver): '''Processes JWT claims with the given JSONPath rules to get roles.''' def __init__(self, role_rules: list[JwtRoleRule]): '''Initialize the resolver with rules.''' pass async def resolve_roles(self, auth: AuthTuple) -> UserRoles: '''Extract r...
9
6
11
1
9
1
2
0.19
1
9
3
0
2
1
5
26
65
10
48
17
35
9
25
12
18
5
5
1
12
326,078
lightspeed-core/lightspeed-stack
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/lightspeed-core_lightspeed-stack/src/authorization/resolvers.py
src.authorization.resolvers.NoopAccessResolver
from models.config import JwtRoleRule, AccessRule, JsonPathOperator, Action class NoopAccessResolver(AccessResolver): """No-op access resolver that does not perform any access checks.""" def check_access(self, action: Action, user_roles: UserRoles) -> bool: """Return True always, indicating access is ...
class NoopAccessResolver(AccessResolver): '''No-op access resolver that does not perform any access checks.''' def check_access(self, action: Action, user_roles: UserRoles) -> bool: '''Return True always, indicating access is granted.''' pass def get_actions(self, user_roles: UserRoles) -...
3
3
5
0
4
3
1
0.88
1
3
1
0
2
0
2
24
13
2
8
5
5
7
8
5
5
1
5
0
2
326,079
lightspeed-core/lightspeed-stack
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/lightspeed-core_lightspeed-stack/src/authorization/resolvers.py
src.authorization.resolvers.NoopRolesResolver
from auth.interface import AuthTuple class NoopRolesResolver(RolesResolver): """No-op roles resolver that does not perform any role resolution.""" async def resolve_roles(self, auth: AuthTuple) -> UserRoles: """Return an empty list of roles.""" _ = auth return set()
class NoopRolesResolver(RolesResolver): '''No-op roles resolver that does not perform any role resolution.''' async def resolve_roles(self, auth: AuthTuple) -> UserRoles: '''Return an empty list of roles.''' pass
2
2
4
0
3
2
1
1
1
1
0
0
1
0
1
22
7
1
4
3
2
4
4
3
2
1
5
0
1
326,080
lightspeed-core/lightspeed-stack
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/lightspeed-core_lightspeed-stack/src/authorization/resolvers.py
src.authorization.resolvers.RoleResolutionError
class RoleResolutionError(Exception): """Custom exception for role resolution errors."""
class RoleResolutionError(Exception): '''Custom exception for role resolution errors.''' pass
1
1
0
0
0
0
0
1
1
0
0
0
0
0
0
10
2
0
1
1
0
1
1
1
0
0
3
0
0
326,081
lightspeed-core/lightspeed-stack
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/lightspeed-core_lightspeed-stack/src/authorization/resolvers.py
src.authorization.resolvers.RolesResolver
from auth.interface import AuthTuple from abc import ABC, abstractmethod class RolesResolver(ABC): """Base class for all role resolution strategies.""" @abstractmethod async def resolve_roles(self, auth: AuthTuple) -> UserRoles: """Given an auth tuple, return the list of user roles."""
class RolesResolver(ABC): '''Base class for all role resolution strategies.''' @abstractmethod async def resolve_roles(self, auth: AuthTuple) -> UserRoles: '''Given an auth tuple, return the list of user roles.''' pass
3
2
2
0
1
1
1
1
1
0
0
2
1
0
1
21
6
1
3
3
0
3
2
2
0
1
4
0
1
326,082
lightspeed-core/lightspeed-stack
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/lightspeed-core_lightspeed-stack/src/client.py
src.client.AsyncLlamaStackClientHolder
from typing import Optional from llama_stack_client import AsyncLlamaStackClient from llama_stack import AsyncLlamaStackAsLibraryClient from models.config import LlamaStackConfiguration from utils.types import Singleton class AsyncLlamaStackClientHolder(metaclass=Singleton): """Container for an initialised AsyncLl...
class AsyncLlamaStackClientHolder(metaclass=Singleton): '''Container for an initialised AsyncLlamaStackClient.''' async def load(self, llama_stack_config: LlamaStackConfiguration) -> None: '''Retrieve Async Llama stack client according to configuration.''' pass def get_client(self) -> AsyncLlamaS...
3
3
14
0
12
2
3
0.15
1
3
1
0
2
0
2
16
33
3
26
6
23
4
18
6
15
3
3
2
5
326,083
lightspeed-core/lightspeed-stack
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/lightspeed-core_lightspeed-stack/src/configuration.py
src.configuration.AppConfig
from models.config import AuthorizationConfiguration, Configuration, Customization, LlamaStackConfiguration, UserDataCollection, ServiceConfiguration, ModelContextProtocolServer, AuthenticationConfiguration, InferenceConfiguration, DatabaseConfiguration from llama_stack.core.stack import replace_env_vars from typing im...
class AppConfig: '''Singleton class to load and store the configuration.''' def __new__(cls, *args: Any, **kwargs: Any) -> 'AppConfig': '''Create a new instance of the class.''' pass def __init__(self) -> None: '''Initialize the class instance.''' pass def load_config...
25
15
5
0
4
1
2
0.21
0
16
11
0
14
1
14
14
104
19
70
29
45
15
60
18
45
3
0
1
27
326,084
lightspeed-core/lightspeed-stack
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/lightspeed-core_lightspeed-stack/src/configuration.py
src.configuration.LogicError
class LogicError(Exception): """Error in application logic."""
class LogicError(Exception): '''Error in application logic.''' pass
1
1
0
0
0
0
0
1
1
0
0
0
0
0
0
10
2
0
1
1
0
1
1
1
0
0
3
0
0
326,085
lightspeed-core/lightspeed-stack
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/lightspeed-core_lightspeed-stack/src/models/config.py
src.models.config.AccessRule
class AccessRule(ConfigurationBase): """Rule defining what actions a role can perform.""" role: str actions: list[Action]
class AccessRule(ConfigurationBase): '''Rule defining what actions a role can perform.''' pass
1
1
0
0
0
0
0
1
1
0
0
0
0
0
0
82
5
1
3
1
2
3
3
1
2
0
6
0
0
326,086
lightspeed-core/lightspeed-stack
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/lightspeed-core_lightspeed-stack/src/models/config.py
src.models.config.Action
from enum import Enum class Action(str, Enum): """Available actions in the system.""" ADMIN = 'admin' LIST_OTHERS_CONVERSATIONS = 'list_other_conversations' READ_OTHERS_CONVERSATIONS = 'read_other_conversations' QUERY_OTHERS_CONVERSATIONS = 'query_other_conversations' DELETE_OTHERS_CONVERSATION...
class Action(str, Enum): '''Available actions in the system.''' pass
1
1
0
0
0
0
0
0.69
2
0
0
0
0
0
0
115
38
11
16
16
15
11
16
16
15
0
4
0
0
326,087
lightspeed-core/lightspeed-stack
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/lightspeed-core_lightspeed-stack/src/models/config.py
src.models.config.AuthenticationConfiguration
from typing_extensions import Self, Literal from typing import Optional, Any, Pattern from pydantic import BaseModel, ConfigDict, Field, model_validator, FilePath, AnyHttpUrl, PositiveInt, SecretStr import constants class AuthenticationConfiguration(ConfigurationBase): """Authentication configuration.""" modul...
class AuthenticationConfiguration(ConfigurationBase): '''Authentication configuration.''' @model_validator(mode='after') def check_authentication_model(self) -> Self: '''Validate YAML containing authentication configuration section.''' pass @property def jwk_configuration(self) -> J...
5
3
13
1
11
1
4
0.1
1
2
1
0
2
0
2
84
37
5
29
11
24
3
20
9
17
4
6
2
7
326,088
lightspeed-core/lightspeed-stack
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/lightspeed-core_lightspeed-stack/src/models/config.py
src.models.config.AuthorizationConfiguration
from pydantic import BaseModel, ConfigDict, Field, model_validator, FilePath, AnyHttpUrl, PositiveInt, SecretStr class AuthorizationConfiguration(ConfigurationBase): """Authorization configuration.""" access_rules: list[AccessRule] = Field(default_factory=list)
class AuthorizationConfiguration(ConfigurationBase): '''Authorization configuration.''' pass
1
1
0
0
0
0
0
0.5
1
0
0
0
0
0
0
82
6
1
4
2
3
2
2
2
1
0
6
0
0
326,089
lightspeed-core/lightspeed-stack
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/lightspeed-core_lightspeed-stack/src/models/config.py
src.models.config.CORSConfiguration
from pydantic import BaseModel, ConfigDict, Field, model_validator, FilePath, AnyHttpUrl, PositiveInt, SecretStr from typing_extensions import Self, Literal class CORSConfiguration(ConfigurationBase): """CORS configuration.""" allow_origins: list[str] = ['*'] allow_credentials: bool = False allow_metho...
class CORSConfiguration(ConfigurationBase): '''CORS configuration.''' @model_validator(mode='after') def check_cors_configuration(self) -> Self: '''Check CORS configuration.''' pass
3
2
11
0
8
3
2
0.31
1
1
0
0
1
0
1
83
22
2
16
7
13
5
9
6
7
2
6
1
2
326,090
lightspeed-core/lightspeed-stack
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/lightspeed-core_lightspeed-stack/src/models/config.py
src.models.config.Configuration
from typing import Optional, Any, Pattern class Configuration(ConfigurationBase): """Global service configuration.""" name: str service: ServiceConfiguration llama_stack: LlamaStackConfiguration user_data_collection: UserDataCollection database: DatabaseConfiguration = DatabaseConfiguration() ...
class Configuration(ConfigurationBase): '''Global service configuration.''' def dump(self, filename: str='configuration.json') -> None: '''Dump actual configuration into JSON file.''' pass
2
2
4
0
3
1
1
0.14
1
1
0
0
1
0
1
83
18
2
14
9
12
2
14
8
12
1
6
1
1
326,091
lightspeed-core/lightspeed-stack
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/lightspeed-core_lightspeed-stack/src/models/config.py
src.models.config.ConfigurationBase
from pydantic import BaseModel, ConfigDict, Field, model_validator, FilePath, AnyHttpUrl, PositiveInt, SecretStr class ConfigurationBase(BaseModel): """Base class for all configuration models that rejects unknown fields.""" model_config = ConfigDict(extra='forbid')
class ConfigurationBase(BaseModel): '''Base class for all configuration models that rejects unknown fields.''' pass
1
1
0
0
0
0
0
0.5
1
0
0
18
0
0
0
82
4
1
2
2
1
1
2
2
1
0
5
0
0
326,092
lightspeed-core/lightspeed-stack
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/lightspeed-core_lightspeed-stack/src/models/config.py
src.models.config.Customization
from typing import Optional, Any, Pattern from utils import checks from pydantic import BaseModel, ConfigDict, Field, model_validator, FilePath, AnyHttpUrl, PositiveInt, SecretStr from typing_extensions import Self, Literal class Customization(ConfigurationBase): """Service customization.""" disable_query_syst...
class Customization(ConfigurationBase): '''Service customization.''' @model_validator(mode='after') def check_customization_model(self) -> Self: '''Load system prompt from file.''' pass
3
2
8
0
7
1
2
0.17
1
1
0
0
1
0
1
83
16
2
12
6
9
2
9
5
7
2
6
1
2
326,093
lightspeed-core/lightspeed-stack
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/lightspeed-core_lightspeed-stack/src/models/config.py
src.models.config.DatabaseConfiguration
from typing import Optional, Any, Pattern from typing_extensions import Self, Literal from pydantic import BaseModel, ConfigDict, Field, model_validator, FilePath, AnyHttpUrl, PositiveInt, SecretStr class DatabaseConfiguration(ConfigurationBase): """Database configuration.""" sqlite: Optional[SQLiteDatabaseCon...
class DatabaseConfiguration(ConfigurationBase): '''Database configuration.''' @model_validator(mode='after') def check_database_configuration(self) -> Self: '''Check that exactly one database type is configured.''' pass @property def db_type(self) -> Literal['sqlite', 'postgres']: ...
7
4
9
1
7
2
3
0.27
1
3
2
0
3
0
3
85
39
6
26
11
19
7
22
8
18
3
6
1
9
326,094
lightspeed-core/lightspeed-stack
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/lightspeed-core_lightspeed-stack/src/models/config.py
src.models.config.InferenceConfiguration
from typing_extensions import Self, Literal from pydantic import BaseModel, ConfigDict, Field, model_validator, FilePath, AnyHttpUrl, PositiveInt, SecretStr from typing import Optional, Any, Pattern class InferenceConfiguration(ConfigurationBase): """Inference configuration.""" default_model: Optional[str] = N...
class InferenceConfiguration(ConfigurationBase): '''Inference configuration.''' @model_validator(mode='after') def check_default_model_and_provider(self) -> Self: '''Check default model and provider.''' pass
3
2
11
0
10
1
3
0.14
1
1
0
0
1
0
1
83
18
2
14
5
11
2
9
4
7
3
6
1
3
326,095
lightspeed-core/lightspeed-stack
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/lightspeed-core_lightspeed-stack/src/models/config.py
src.models.config.JsonPathOperator
from enum import Enum class JsonPathOperator(str, Enum): """Supported operators for JSONPath evaluation.""" EQUALS = 'equals' CONTAINS = 'contains' IN = 'in' MATCH = 'match'
class JsonPathOperator(str, Enum): '''Supported operators for JSONPath evaluation.''' pass
1
1
0
0
0
0
0
0.25
2
0
0
0
0
0
0
115
6
1
4
4
3
1
4
4
3
0
4
0
0
326,096
lightspeed-core/lightspeed-stack
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/lightspeed-core_lightspeed-stack/src/models/config.py
src.models.config.JwkConfiguration
from pydantic import BaseModel, ConfigDict, Field, model_validator, FilePath, AnyHttpUrl, PositiveInt, SecretStr class JwkConfiguration(ConfigurationBase): """JWK configuration.""" url: AnyHttpUrl jwt_configuration: JwtConfiguration = JwtConfiguration()
class JwkConfiguration(ConfigurationBase): '''JWK configuration.''' pass
1
1
0
0
0
0
0
0.33
1
0
0
0
0
0
0
82
5
1
3
2
2
1
3
2
2
0
6
0
0
326,097
lightspeed-core/lightspeed-stack
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/lightspeed-core_lightspeed-stack/src/models/config.py
src.models.config.JwtConfiguration
import constants from pydantic import BaseModel, ConfigDict, Field, model_validator, FilePath, AnyHttpUrl, PositiveInt, SecretStr class JwtConfiguration(ConfigurationBase): """JWT configuration.""" user_id_claim: str = constants.DEFAULT_JWT_UID_CLAIM username_claim: str = constants.DEFAULT_JWT_USER_NAME_CL...
class JwtConfiguration(ConfigurationBase): '''JWT configuration.''' pass
1
1
0
0
0
0
0
0.33
1
0
0
0
0
0
0
82
8
1
6
4
5
2
4
4
3
0
6
0
0
326,098
lightspeed-core/lightspeed-stack
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/lightspeed-core_lightspeed-stack/src/models/config.py
src.models.config.JwtRoleRule
import jsonpath_ng from pydantic import BaseModel, ConfigDict, Field, model_validator, FilePath, AnyHttpUrl, PositiveInt, SecretStr from jsonpath_ng.exceptions import JSONPathError from typing import Optional, Any, Pattern from typing_extensions import Self, Literal import re from functools import cached_property clas...
class JwtRoleRule(ConfigurationBase): '''Rule for extracting roles from JWT claims.''' @model_validator(mode='after') def check_jsonpath(self) -> Self: '''Verify that the JSONPath expression is valid.''' pass @model_validator(mode='after') def check_roles(self) -> Self: '''E...
9
5
12
2
10
1
3
0.3
1
2
0
0
2
0
2
84
36
6
27
7
22
8
20
4
17
4
6
1
6
326,099
lightspeed-core/lightspeed-stack
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/lightspeed-core_lightspeed-stack/src/models/config.py
src.models.config.LlamaStackConfiguration
from typing_extensions import Self, Literal from typing import Optional, Any, Pattern from pydantic import BaseModel, ConfigDict, Field, model_validator, FilePath, AnyHttpUrl, PositiveInt, SecretStr from utils import checks from pathlib import Path class LlamaStackConfiguration(ConfigurationBase): """Llama stack c...
class LlamaStackConfiguration(ConfigurationBase): '''Llama stack configuration.''' @model_validator(mode='after') def check_llama_stack_model(self) -> Self: ''' Validate the Llama stack configuration after model initialization. Ensures that either a URL is provided for server mode o...
3
2
35
2
21
13
7
0.52
1
2
0
0
1
0
1
83
44
4
27
7
24
14
18
6
16
7
6
2
7