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
324,900
elementsinteractive/lgtm-ai
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/elementsinteractive_lgtm-ai/src/lgtm_ai/config/exceptions.py
lgtm_ai.config.exceptions.ConfigFileNotFoundError
from lgtm_ai.base.exceptions import LGTMException class ConfigFileNotFoundError(LGTMException): ...
class ConfigFileNotFoundError(LGTMException): pass
1
0
0
0
0
0
0
0
1
0
0
0
0
0
0
15
1
0
1
1
1
0
2
1
1
0
5
0
0
324,901
elementsinteractive/lgtm-ai
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/elementsinteractive_lgtm-ai/src/lgtm_ai/config/exceptions.py
lgtm_ai.config.exceptions.InvalidConfigError
from lgtm_ai.base.exceptions import LGTMException from pydantic_core import ErrorDetails class InvalidConfigError(LGTMException): def __init__(self, source: str, errors: list[ErrorDetails]) -> None: self.source = source self.errors = errors self.message = self._generate_message() def ...
class InvalidConfigError(LGTMException): def __init__(self, source: str, errors: list[ErrorDetails]) -> None: pass def __str__(self) -> str: pass def _generate_message(self) -> str: pass
4
0
3
0
3
0
1
0
1
3
0
0
3
3
3
18
12
2
10
8
6
0
10
8
6
1
5
0
3
324,902
elementsinteractive/lgtm-ai
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/elementsinteractive_lgtm-ai/src/lgtm_ai/config/exceptions.py
lgtm_ai.config.exceptions.InvalidConfigFileError
from lgtm_ai.base.exceptions import LGTMException class InvalidConfigFileError(LGTMException): ...
class InvalidConfigFileError(LGTMException): pass
1
0
0
0
0
0
0
0
1
0
0
0
0
0
0
15
1
0
1
1
1
0
2
1
1
0
5
0
0
324,903
elementsinteractive/lgtm-ai
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/elementsinteractive_lgtm-ai/src/lgtm_ai/config/exceptions.py
lgtm_ai.config.exceptions.MissingRequiredConfigError
from lgtm_ai.base.exceptions import LGTMException class MissingRequiredConfigError(LGTMException): ...
class MissingRequiredConfigError(LGTMException): pass
1
0
0
0
0
0
0
0
1
0
0
0
0
0
0
15
1
0
1
1
1
0
2
1
1
0
5
0
0
324,904
elementsinteractive/lgtm-ai
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/elementsinteractive_lgtm-ai/src/lgtm_ai/formatters/base.py
lgtm_ai.formatters.base.Formatter
from typing import Protocol, TypeVar from lgtm_ai.ai.schemas import Review, ReviewComment, ReviewGuide class Formatter(Protocol[_T]): """Formatter for LGTM reviews. There are several ways in which one may want to display a review (in the terminal, as a markdown file, etc.). This protocol defines the meth...
class Formatter(Protocol[_T]): '''Formatter for LGTM reviews. There are several ways in which one may want to display a review (in the terminal, as a markdown file, etc.). This protocol defines the methods that a formatter should implement to format a review in a specific way. Specialize the generic ty...
5
2
3
1
1
2
1
2.4
1
5
3
5
4
0
4
28
25
8
5
5
3
12
8
5
3
1
5
0
4
324,905
elementsinteractive/lgtm-ai
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/elementsinteractive_lgtm-ai/src/lgtm_ai/formatters/json.py
lgtm_ai.formatters.json.JsonFormatter
from lgtm_ai.ai.schemas import Review, ReviewComment, ReviewGuide from lgtm_ai.formatters.base import Formatter class JsonFormatter(Formatter[str]): def format_review_summary_section(self, review: Review, comments: list[ReviewComment] | None=None) -> str: """Format the **whole** review as JSON.""" ...
class JsonFormatter(Formatter[str]): def format_review_summary_section(self, review: Review, comments: list[ReviewComment] | None=None) -> str: '''Format the **whole** review as JSON.''' pass def format_review_comments_section(self, comments: list[ReviewComment]) -> str: '''No-op. ...
5
4
4
0
2
2
1
0.67
1
6
3
0
4
0
4
32
19
4
9
5
4
6
9
5
4
1
6
0
4
324,906
elementsinteractive/lgtm-ai
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/elementsinteractive_lgtm-ai/src/lgtm_ai/formatters/markdown.py
lgtm_ai.formatters.markdown.MarkDownFormatter
from lgtm_ai.formatters.base import Formatter import pathlib from jinja2 import Environment, FileSystemLoader from typing import ClassVar from lgtm_ai.formatters.constants import CATEGORY_MAP, SCORE_MAP, SEVERITY_MAP from lgtm_ai.ai.schemas import PublishMetadata, Review, ReviewComment, ReviewGuide class MarkDownForma...
class MarkDownFormatter(Formatter[str]): def __init__(self, add_ranges_to_suggestions: bool=False) -> None: pass def format_review_summary_section(self, review: Review, comments: list[ReviewComment] | None=None) -> str: pass def format_review_comments_section(self, comments: list[ReviewC...
8
0
9
0
9
0
1
0
1
8
4
0
7
2
7
35
78
7
71
33
63
0
41
33
33
2
6
1
9
324,907
elementsinteractive/lgtm-ai
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/elementsinteractive_lgtm-ai/src/lgtm_ai/formatters/pretty.py
lgtm_ai.formatters.pretty.PrettyFormatter
from rich.text import Text from rich.panel import Panel from rich.markdown import Markdown from rich.layout import Layout from lgtm_ai.formatters.constants import SCORE_MAP, SEVERITY_MAP from rich.console import Group from lgtm_ai.ai.schemas import Review, ReviewComment, ReviewGuide from lgtm_ai.formatters.base import ...
class PrettyFormatter(Formatter[Panel | Layout | Group]): def format_review_summary_section(self, review: Review, comments: list[ReviewComment] | None=None) -> Panel: pass def format_review_comments_section(self, comments: list[ReviewComment]) -> Group: pass def format_review_comments_se...
5
0
18
1
17
0
2
0.01
1
10
3
0
4
0
4
32
77
6
70
13
65
1
25
13
20
2
6
1
6
324,908
elementsinteractive/lgtm-ai
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/elementsinteractive_lgtm-ai/src/lgtm_ai/git_client/base.py
lgtm_ai.git_client.base.GitClient
from pydantic import HttpUrl from lgtm_ai.ai.schemas import Review, ReviewGuide from typing import Protocol from lgtm_ai.base.schemas import PRUrl from lgtm_ai.git_client.schemas import ContextBranch, IssueContent, PRDiff, PRMetadata class GitClient(Protocol): """Interface for any Git service client.""" def g...
class GitClient(Protocol): '''Interface for any Git service client.''' def get_diff_from_url(self, pr_url: PRUrl) -> PRDiff: '''Get the diff from the PR URL. It will be used to generate the review.''' pass def publish_review(self, pr_url: PRUrl, review: Review) -> None: '''Publish...
7
7
3
0
1
1
1
1.33
1
6
5
3
5
0
5
29
20
6
6
6
0
8
6
6
0
1
5
0
5
324,909
elementsinteractive/lgtm-ai
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/elementsinteractive_lgtm-ai/src/lgtm_ai/git_client/exceptions.py
lgtm_ai.git_client.exceptions.DecodingFileError
from lgtm_ai.base.exceptions import LGTMException class DecodingFileError(LGTMException): message = 'Failed to decode the file' def __init__(self) -> None: super().__init__(self.message)
class DecodingFileError(LGTMException): def __init__(self) -> None: pass
2
0
2
0
2
0
1
0
1
1
0
0
1
0
1
16
5
1
4
3
2
0
4
3
2
1
5
0
1
324,910
elementsinteractive/lgtm-ai
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/elementsinteractive_lgtm-ai/src/lgtm_ai/git_client/exceptions.py
lgtm_ai.git_client.exceptions.InvalidGitAuthError
from lgtm_ai.base.exceptions import LGTMException class InvalidGitAuthError(LGTMException): message = 'Invalid Git service authentication token' def __init__(self) -> None: super().__init__(self.message)
class InvalidGitAuthError(LGTMException): def __init__(self) -> None: pass
2
0
2
0
2
0
1
0
1
1
0
0
1
0
1
16
5
1
4
3
2
0
4
3
2
1
5
0
1
324,911
elementsinteractive/lgtm-ai
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/elementsinteractive_lgtm-ai/src/lgtm_ai/git_client/exceptions.py
lgtm_ai.git_client.exceptions.PublishGuideError
from lgtm_ai.base.exceptions import LGTMException class PublishGuideError(LGTMException): message = 'Failed to publish the review guide' def __init__(self) -> None: super().__init__(self.message)
class PublishGuideError(LGTMException): def __init__(self) -> None: pass
2
0
2
0
2
0
1
0
1
1
0
0
1
0
1
16
5
1
4
3
2
0
4
3
2
1
5
0
1
324,912
elementsinteractive/lgtm-ai
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/elementsinteractive_lgtm-ai/src/lgtm_ai/git_client/exceptions.py
lgtm_ai.git_client.exceptions.PublishReviewError
from lgtm_ai.base.exceptions import LGTMException class PublishReviewError(LGTMException): message = 'Failed to publish the review' def __init__(self) -> None: super().__init__(self.message)
class PublishReviewError(LGTMException): def __init__(self) -> None: pass
2
0
2
0
2
0
1
0
1
1
0
0
1
0
1
16
5
1
4
3
2
0
4
3
2
1
5
0
1
324,913
elementsinteractive/lgtm-ai
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/elementsinteractive_lgtm-ai/src/lgtm_ai/git_client/exceptions.py
lgtm_ai.git_client.exceptions.PullRequestDiffError
from lgtm_ai.base.exceptions import LGTMException class PullRequestDiffError(LGTMException): message = 'Failed to retrieve the diff of the pull request' def __init__(self) -> None: super().__init__(self.message)
class PullRequestDiffError(LGTMException): def __init__(self) -> None: pass
2
0
2
0
2
0
1
0
1
1
0
0
1
0
1
16
5
1
4
3
2
0
4
3
2
1
5
0
1
324,914
elementsinteractive/lgtm-ai
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/elementsinteractive_lgtm-ai/src/lgtm_ai/git_client/exceptions.py
lgtm_ai.git_client.exceptions.PullRequestDiffNotFoundError
from lgtm_ai.base.exceptions import LGTMException class PullRequestDiffNotFoundError(LGTMException): message = 'No diff found for this pull request' def __init__(self) -> None: super().__init__(self.message)
class PullRequestDiffNotFoundError(LGTMException): def __init__(self) -> None: pass
2
0
2
0
2
0
1
0
1
1
0
0
1
0
1
16
5
1
4
3
2
0
4
3
2
1
5
0
1
324,915
elementsinteractive/lgtm-ai
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/elementsinteractive_lgtm-ai/src/lgtm_ai/git_client/exceptions.py
lgtm_ai.git_client.exceptions.PullRequestMetadataError
from lgtm_ai.base.exceptions import LGTMException class PullRequestMetadataError(LGTMException): message = 'Failed to retrieve the metadata of the pull request' def __init__(self) -> None: super().__init__(self.message)
class PullRequestMetadataError(LGTMException): def __init__(self) -> None: pass
2
0
2
0
2
0
1
0
1
1
0
0
1
0
1
16
5
1
4
3
2
0
4
3
2
1
5
0
1
324,916
elementsinteractive/lgtm-ai
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/elementsinteractive_lgtm-ai/src/lgtm_ai/git_client/github.py
lgtm_ai.git_client.github.GitHubClient
import github.Repository from lgtm_ai.base.schemas import PRUrl from lgtm_ai.git_client.exceptions import PublishGuideError, PublishReviewError, PullRequestDiffError, PullRequestMetadataError from lgtm_ai.git_parser.exceptions import GitDiffParseError import github.PullRequest from lgtm_ai.git_client.base import GitCli...
class GitHubClient(GitClient): def __init__(self, client: github.Github, formatter: Formatter[str]) -> None: pass def get_diff_from_url(self, pr_url: PRUrl) -> PRDiff: '''Return a PRDiff object containing an identifier to the diff and a stringified representation of the diff from the latest v...
8
3
20
1
18
1
3
0.05
1
19
13
0
6
2
6
35
128
11
111
34
104
6
70
29
63
7
6
3
19
324,917
elementsinteractive/lgtm-ai
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/elementsinteractive_lgtm-ai/src/lgtm_ai/git_client/gitlab.py
lgtm_ai.git_client.gitlab.GitlabClient
import base64 from typing import Any, cast from lgtm_ai.formatters.base import Formatter from lgtm_ai.git_client.exceptions import InvalidGitAuthError, PublishGuideError, PublishReviewError, PullRequestDiffError, PullRequestDiffNotFoundError from lgtm_ai.git_parser.parser import DiffFileMetadata, DiffResult, parse_diff...
class GitlabClient(GitClient): def __init__(self, client: gitlab.Gitlab, formatter: Formatter[str]) -> None: pass def get_diff_from_url(self, pr_url: PRUrl) -> PRDiff: '''Return a PRDiff object containing an identifier to the diff and a stringified representation of the diff from latest versi...
13
4
18
2
14
2
3
0.12
1
23
15
0
11
3
11
40
204
30
155
47
139
19
118
39
106
7
6
3
32
324,918
elementsinteractive/lgtm-ai
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/elementsinteractive_lgtm-ai/src/lgtm_ai/git_parser/exceptions.py
lgtm_ai.git_parser.exceptions.GitDiffParseError
from lgtm_ai.base.exceptions import LGTMException class GitDiffParseError(LGTMException): ...
class GitDiffParseError(LGTMException): pass
1
0
0
0
0
0
0
0
1
0
0
0
0
0
0
15
1
0
1
1
1
0
2
1
1
0
5
0
0
324,919
elementsinteractive/lgtm-ai
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/elementsinteractive_lgtm-ai/src/lgtm_ai/git_parser/parser.py
lgtm_ai.git_parser.parser.DiffFileMetadata
from pydantic import BaseModel class DiffFileMetadata(BaseModel): new_file: bool deleted_file: bool renamed_file: bool new_path: str old_path: str | None = None model_config = {'extra': 'ignore'}
class DiffFileMetadata(BaseModel): pass
1
0
0
0
0
0
0
0
1
0
0
0
0
0
0
82
8
1
7
3
6
0
7
3
6
0
5
0
0
324,920
elementsinteractive/lgtm-ai
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/elementsinteractive_lgtm-ai/src/lgtm_ai/git_parser/parser.py
lgtm_ai.git_parser.parser.DiffResult
from pydantic import BaseModel class DiffResult(BaseModel): metadata: DiffFileMetadata modified_lines: list[ModifiedLine]
class DiffResult(BaseModel): pass
1
0
0
0
0
0
0
0
1
0
0
0
0
0
0
82
3
0
3
1
2
0
3
1
2
0
5
0
0
324,921
elementsinteractive/lgtm-ai
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/elementsinteractive_lgtm-ai/src/lgtm_ai/git_parser/parser.py
lgtm_ai.git_parser.parser.ModifiedLine
from pydantic import BaseModel from typing import Literal class ModifiedLine(BaseModel): line: str line_number: int relative_line_number: int modification_type: Literal['added', 'removed']
class ModifiedLine(BaseModel): pass
1
0
0
0
0
0
0
0
1
0
0
0
0
0
0
82
5
0
5
1
4
0
5
1
4
0
5
0
0
324,922
elementsinteractive/lgtm-ai
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/elementsinteractive_lgtm-ai/src/lgtm_ai/review/context.py
lgtm_ai.review.context.ContextRetriever
from lgtm_ai.git_client.schemas import ContextBranch, IssueContent, PRDiff, PRMetadata from lgtm_ai.base.schemas import PRUrl from lgtm_ai.ai.schemas import AdditionalContext from lgtm_ai.review.schemas import PRCodeContext from lgtm_ai.git_client.base import GitClient from pydantic import HttpUrl import re import http...
class ContextRetriever: '''Retrieves context for a given PR. "Context" is defined as "whatever information the LLM might need (apart from the git diff) to make better reviews or guides". ''' def __init__(self, git_client: GitClient, issues_client: IssuesClient, httpx_client: httpx.Client) -> None:...
9
6
16
1
12
3
3
0.26
0
10
5
0
6
2
6
6
104
12
73
22
64
19
54
19
47
6
0
4
17
324,923
elementsinteractive/lgtm-ai
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/elementsinteractive_lgtm-ai/src/lgtm_ai/review/guide.py
lgtm_ai.review.guide.ReviewGuideGenerator
from lgtm_ai.config.handler import ResolvedConfig from pydantic_ai import Agent import httpx from lgtm_ai.review.context import ContextRetriever from lgtm_ai.ai.schemas import GuideResponse, PublishMetadata, ReviewGuide from lgtm_ai.base.schemas import PRUrl from pydantic_ai.usage import UsageLimits from lgtm_ai.review...
class ReviewGuideGenerator: def __init__(self, *, guide_agent: Agent[None, GuideResponse], model: Model, git_client: GitClient, config: ResolvedConfig) -> None: pass def generate_review_guide(self, pr_url: PRUrl) -> ReviewGuide: pass
3
0
18
2
17
0
1
0
0
8
8
0
2
5
2
2
38
4
34
22
24
0
19
15
16
1
0
1
2
324,924
elementsinteractive/lgtm-ai
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/elementsinteractive_lgtm-ai/src/lgtm_ai/review/prompt_generators.py
lgtm_ai.review.prompt_generators.PromptGenerator
from lgtm_ai.ai.schemas import AdditionalContext, ReviewResponse from lgtm_ai.base.exceptions import NothingToReviewError from lgtm_ai.base.utils import file_matches_any_pattern from jinja2 import Environment, FileSystemLoader import json from lgtm_ai.git_client.schemas import IssueContent, PRDiff, PRMetadata import pa...
class PromptGenerator: '''Generates the prompts for the AI model to review the PR.''' def __init__(self, config: ResolvedConfig, pr_metadata: PRMetadata) -> None: pass def generate_review_prompt(self, *, pr_diff: PRDiff, context: PRCodeContext, additional_context: list[AdditionalContext] | None=N...
7
4
10
1
7
2
2
0.31
0
11
8
0
6
3
6
6
70
13
45
23
32
14
27
17
20
4
0
2
9
324,925
elementsinteractive/lgtm-ai
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/elementsinteractive_lgtm-ai/src/lgtm_ai/review/reviewer.py
lgtm_ai.review.reviewer.CodeReviewer
from lgtm_ai.base.schemas import PRUrl from lgtm_ai.git_client.base import GitClient from lgtm_ai.review.context import ContextRetriever from lgtm_ai.config.handler import ResolvedConfig from lgtm_ai.ai.schemas import PublishMetadata, Review, ReviewerDeps, ReviewResponse, SummarizingDeps from pydantic_ai.usage import R...
class CodeReviewer: ''' CodeReviewer orchestrates the automated review of pull requests using AI agents and contextual information. This class coordinates the process of reviewing a pull request (PR) by leveraging two pydantic-ai agents: - reviewer_agent: Generates the initial review, including comment...
5
5
27
1
26
1
1
0.04
0
12
11
0
4
6
4
4
115
6
105
50
76
4
38
26
33
1
0
1
4
324,926
elementsinteractive/lgtm-ai
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/elementsinteractive_lgtm-ai/src/lgtm_ai/review/schemas.py
lgtm_ai.review.schemas.PRCodeContext
from lgtm_ai.git_client.schemas import ContextBranch from pydantic import BaseModel class PRCodeContext(BaseModel): """Represents the context a reviewer might need when reviewing PRs. At the moment, it is just the contents of the files that are changed in the PR. """ file_contents: list[PRContextFileC...
class PRCodeContext(BaseModel): '''Represents the context a reviewer might need when reviewing PRs. At the moment, it is just the contents of the files that are changed in the PR. ''' def __bool__(self) -> bool: pass def add_file(self, file_path: str, content: str, branch: ContextBranch='...
3
1
2
0
2
0
1
0.5
1
3
1
0
2
0
2
84
13
4
6
3
3
3
6
3
3
1
5
0
2
324,927
elementsinteractive/lgtm-ai
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/elementsinteractive_lgtm-ai/src/lgtm_ai/review/schemas.py
lgtm_ai.review.schemas.PRContextFileContents
from lgtm_ai.git_client.schemas import ContextBranch from pydantic import BaseModel class PRContextFileContents(BaseModel): file_path: str content: str branch: ContextBranch = 'source'
class PRContextFileContents(BaseModel): pass
1
0
0
0
0
0
0
0
1
0
0
0
0
0
0
82
4
0
4
2
3
0
4
2
3
0
5
0
0
324,928
elementsinteractive/lgtm-ai
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/elementsinteractive_lgtm-ai/src/lgtm_ai/validators.py
lgtm_ai.validators.AllowedLocations
from enum import StrEnum class AllowedLocations(StrEnum): Gitlab = 'gitlab.com' Github = 'github.com'
class AllowedLocations(StrEnum): pass
1
0
0
0
0
0
0
0
1
0
0
0
0
0
0
68
3
0
3
3
2
0
3
3
2
0
3
0
0
324,929
elementsinteractive/lgtm-ai
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/elementsinteractive_lgtm-ai/src/lgtm_ai/validators.py
lgtm_ai.validators.AllowedSchemes
from enum import StrEnum class AllowedSchemes(StrEnum): Https = 'https' Http = 'http'
class AllowedSchemes(StrEnum): pass
1
0
0
0
0
0
0
0
1
0
0
0
0
0
0
68
3
0
3
3
2
0
3
3
2
0
3
0
0
324,930
elementsinteractive/lgtm-ai
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/elementsinteractive_lgtm-ai/src/lgtm_ai/validators.py
lgtm_ai.validators.IntOrNoLimitType
from lgtm_ai.base.schemas import IntOrNoLimit, PRSource, PRUrl import click class IntOrNoLimitType(click.ParamType): name = 'int-or-no-limit' def convert(self, value: str, param: click.Parameter | None, ctx: click.Context | None) -> IntOrNoLimit: if value == 'no-limit': return 'no-limit' ...
class IntOrNoLimitType(click.ParamType): def convert(self, value: str, param: click.Parameter | None, ctx: click.Context | None) -> IntOrNoLimit: pass def get_metavar(self, param: click.Parameter, ctx: click.Context) -> str | None: pass
3
0
5
0
5
0
2
0
0
4
0
0
2
0
2
2
13
2
11
4
8
0
11
4
8
3
0
1
4
324,931
elementsinteractive/lgtm-ai
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/elementsinteractive_lgtm-ai/src/lgtm_ai/validators.py
lgtm_ai.validators.ModelChoice
import click class ModelChoice(click.ParamType): """Custom click parameter type for selecting AI models. lgtm accepts a variety of AI models, and we show them in the usage of the CLI. However, we allow users to specify a custom model name as well. """ name: str = 'model' choices: tuple[str, .....
class ModelChoice(click.ParamType): '''Custom click parameter type for selecting AI models. lgtm accepts a variety of AI models, and we show them in the usage of the CLI. However, we allow users to specify a custom model name as well. ''' def __init__(self, choices: tuple[str, ...]) -> None: ...
5
1
2
0
2
0
1
0.36
0
2
0
0
4
0
4
4
21
6
11
6
6
4
11
6
6
1
0
0
4
324,932
AllDotPy/EasySwitch
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/AllDotPy_EasySwitch/easyswitch/conf/sources/dict.py
dict.DictConfigSource
from easyswitch.conf.base import BaseConfigSource from typing import Any, Dict from easyswitch.conf import register_source @register_source('dict') class DictConfigSource(BaseConfigSource): """Load EasySwitch configurations from a Python dictionnary object.""" def __init__(self, config_dict: Dict[str, Any]): ...
@register_source('dict') class DictConfigSource(BaseConfigSource): '''Load EasySwitch configurations from a Python dictionnary object.''' def __init__(self, config_dict: Dict[str, Any]): pass def load(self) -> Dict[str, Any]: '''Return the config dict.''' pass def is_valid(sel...
5
3
3
0
2
1
1
0.43
1
3
0
0
3
1
3
25
13
3
7
5
3
3
7
5
3
1
5
0
3
324,933
AllDotPy/EasySwitch
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/AllDotPy_EasySwitch/easyswitch/adapters/base.py
easyswitch.adapters.base.AdaptersRegistry
from easyswitch.exceptions import InvalidProviderError from typing import Any, ClassVar, Dict, List, Optional, Type, Union class AdaptersRegistry: """ Registry for all payment adapters. This class is used to register and retrieve adapters based on their provider. """ _registry: ClassVar[Dict[str, T...
class AdaptersRegistry: ''' Registry for all payment adapters. This class is used to register and retrieve adapters based on their provider. ''' @classmethod def register(cls, name: Optional[str]=None) -> None: '''Register a new Adapter class.''' pass def wrapper(ad...
12
7
7
1
5
2
1
0.5
0
3
1
0
0
0
5
5
50
12
28
14
15
14
21
9
13
2
0
1
8
324,934
AllDotPy/EasySwitch
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/AllDotPy_EasySwitch/easyswitch/adapters/base.py
easyswitch.adapters.base.BaseAdapter
from easyswitch.types import ApiCredentials, Currency, CustomerInfo, PaymentResponse, Provider, TransactionDetail, TransactionStatus from easyswitch.utils import USER_AGENT from easyswitch.exceptions import InvalidProviderError from typing import Any, ClassVar, Dict, List, Optional, Type, Union from easyswitch.utils.ht...
null
36
22
15
2
4
9
1
1.67
1
10
6
6
19
2
21
41
376
66
116
66
60
194
60
32
38
2
4
1
24
324,935
AllDotPy/EasySwitch
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/AllDotPy_EasySwitch/easyswitch/client.py
easyswitch.client.EasySwitch
import asyncio from easyswitch.conf import RootConfig from easyswitch.exceptions import AuthenticationError, ConfigurationError, InvalidProviderError from easyswitch.types import Currency, CustomerInfo, PaymentResponse, Provider, TransactionStatus, TransactionDetail, WebhookEvent from easyswitch.adapters import Adapter...
class EasySwitch: ''' Main client for EasySwitch SDK with flexible configuration options. Examples: >>> # From environment variables >>> client = EasySwitch.from_env() >>> # From JSON file >>> client = EasySwitch.from_json("config.json") >>> # From multiple sources ...
23
17
20
2
11
7
2
0.66
0
18
11
0
10
2
16
16
363
51
188
94
111
124
81
33
64
5
0
2
29
324,936
AllDotPy/EasySwitch
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/AllDotPy_EasySwitch/easyswitch/conf/base.py
easyswitch.conf.base.BaseConfigModel
from pydantic import BaseModel, Field, field_validator, model_validator class BaseConfigModel(BaseModel): """Base class of all configuration models.""" class Config: extra = 'forbid' validate_all = True use_enum_values = True
null
2
1
0
0
0
0
0
0.4
1
0
0
2
0
0
0
82
7
1
5
5
3
2
5
5
3
0
5
0
0
324,937
AllDotPy/EasySwitch
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/AllDotPy_EasySwitch/easyswitch/conf/base.py
easyswitch.conf.base.BaseConfigSource
from typing import Any, Dict, Optional, Type from abc import ABC, abstractmethod class BaseConfigSource(ABC): """Base interface for all configuration sources.""" @abstractmethod def load(self) -> Dict[str, Any]: """Loads configurations from the source.""" pass @abstractmethod def ...
class BaseConfigSource(ABC): '''Base interface for all configuration sources.''' @abstractmethod def load(self) -> Dict[str, Any]: '''Loads configurations from the source.''' pass @abstractmethod def is_valid(self) -> bool: '''Check if the sourse is valid''' pass
5
3
3
0
2
1
1
0.43
1
3
0
4
2
0
2
22
12
2
7
5
2
3
5
3
2
1
4
0
2
324,938
AllDotPy/EasySwitch
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/AllDotPy_EasySwitch/easyswitch/conf/base.py
easyswitch.conf.base.LogFormat
from enum import Enum class LogFormat(str, Enum): """Log Format choices.""" PLAIN = 'plain' JSON = 'json'
class LogFormat(str, Enum): '''Log Format choices.''' pass
1
1
0
0
0
0
0
0.33
2
0
0
0
0
0
0
115
5
1
3
3
2
1
3
3
2
0
4
0
0
324,939
AllDotPy/EasySwitch
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/AllDotPy_EasySwitch/easyswitch/conf/base.py
easyswitch.conf.base.LogLevel
from enum import Enum class LogLevel(str, Enum): """Log Levels""" DEBUG = 'debug' INFO = 'info' WARNING = 'warning' ERROR = 'error' CRITICAL = 'critical'
class LogLevel(str, Enum): '''Log Levels''' pass
1
1
0
0
0
0
0
0.17
2
0
0
0
0
0
0
115
8
1
6
6
5
1
6
6
5
0
4
0
0
324,940
AllDotPy/EasySwitch
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/AllDotPy_EasySwitch/easyswitch/conf/base.py
easyswitch.conf.base.LoggingConfig
from typing import Any, Dict, Optional, Type from pydantic import BaseModel, Field, field_validator, model_validator class LoggingConfig(BaseModel): """Logging Configuration Model""" enabled: bool = False level: LogLevel = LogLevel.INFO file: Optional[str] = None console: bool = True max_size: ...
class LoggingConfig(BaseModel): '''Logging Configuration Model''' pass
1
1
0
0
0
0
0
0.2
1
0
0
0
0
0
0
82
12
1
10
9
9
2
10
9
9
0
5
0
0
324,941
AllDotPy/EasySwitch
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/AllDotPy_EasySwitch/easyswitch/conf/base.py
easyswitch.conf.base.ProviderConfig
from easyswitch.exceptions import ConfigurationError from pydantic import BaseModel, Field, field_validator, model_validator from typing import Any, Dict, Optional, Type class ProviderConfig(BaseConfigModel): """A configuration model for Providers.""" api_key: Optional[str] = None api_secret: Optional[str]...
class ProviderConfig(BaseConfigModel): '''A configuration model for Providers.''' @field_validator('environment') def validate_environment(cls, v): ''' Ensure Config's environment value is valid. ''' pass @model_validator(mode='before') @classmethod def check_keys(cls, v): ...
6
3
8
1
6
1
2
0.2
1
1
1
0
1
0
2
84
33
5
25
14
19
5
18
12
15
2
6
1
4
324,942
AllDotPy/EasySwitch
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/AllDotPy_EasySwitch/easyswitch/conf/base.py
easyswitch.conf.base.RootConfig
from easyswitch.types import Currency, Provider from pydantic import BaseModel, Field, field_validator, model_validator from typing import Any, Dict, Optional, Type from easyswitch.exceptions import ConfigurationError class RootConfig(BaseConfigModel): """Configuration root, represents EasySwitch config.""" de...
class RootConfig(BaseConfigModel): '''Configuration root, represents EasySwitch config.''' @field_validator('default_provider') def validate_default_provider(cls, v, values): '''Ensure default provider is valid.''' pass @field_validator('default_currency') def validate_default_curre...
5
3
12
2
9
2
3
0.4
1
4
3
0
2
0
2
84
46
11
25
10
20
10
16
8
13
3
6
1
5
324,943
AllDotPy/EasySwitch
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/AllDotPy_EasySwitch/easyswitch/conf/config.py
easyswitch.conf.config.Config
from dotenv import load_dotenv from typing import Any, Dict, List, Optional, Type from dataclasses import dataclass, field import os @dataclass class Config: """EasySwitch SDK configurations class.""" environment: str = 'sandbox' timeout: int = 30 debug: bool = False log_level: str = 'INFO' log...
@dataclass class Config: '''EasySwitch SDK configurations class.''' def __post_init__(self): '''Post-initialization method to load environment variables and validate credentials.''' pass def _load_from_env(self): '''Load configuration from environment variables.''' pass ...
5
4
9
2
6
2
2
0.69
0
3
0
0
3
0
3
3
57
14
29
16
25
20
29
16
25
2
0
1
5
324,944
AllDotPy/EasySwitch
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/AllDotPy_EasySwitch/easyswitch/conf/manager.py
easyswitch.conf.manager.ConfigManager
from typing import Any, Dict, List, Optional, Union from easyswitch.conf import get_source from easyswitch.conf.base import BaseConfigSource, RootConfig from easyswitch.exceptions import ConfigurationError from pathlib import Path class ConfigManager: """Main Configuration Manager.""" def __init__(self): ...
class ConfigManager: '''Main Configuration Manager.''' def __init__(self): pass def add_source(self, source_type: str, **kwargs) -> 'ConfigManager': '''Adds a new configuration source.''' pass def load(self) -> 'ConfigManager': '''Loads configurations from all availab...
14
9
8
1
5
1
2
0.24
0
8
3
0
5
2
9
9
84
17
54
23
40
13
43
18
33
5
0
2
17
324,945
AllDotPy/EasySwitch
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/AllDotPy_EasySwitch/easyswitch/exceptions.py
easyswitch.exceptions.APIError
from typing import Any, Dict, Optional class APIError(EasySwitchError): """Base class for API errors.""" def __init__(self, message: str, status_code: Optional[int]=None, provider: Optional[str]=None, raw_response: Optional[Dict[str, Any]]=None, **kwargs): self.status_code = status_code self.p...
class APIError(EasySwitchError): '''Base class for API errors.''' def __init__(self, message: str, status_code: Optional[int]=None, provider: Optional[str]=None, raw_response: Optional[Dict[str, Any]]=None, **kwargs): pass
2
1
21
0
21
0
1
0.05
1
4
0
9
1
3
1
12
24
1
22
12
13
1
6
5
4
1
4
0
1
324,946
AllDotPy/EasySwitch
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/AllDotPy_EasySwitch/easyswitch/exceptions.py
easyswitch.exceptions.AuthenticationError
class AuthenticationError(EasySwitchError): """Authentication error with the provider.""" pass
class AuthenticationError(EasySwitchError): '''Authentication error with the provider.''' pass
1
1
0
0
0
0
0
0.5
1
0
0
0
0
0
0
11
3
0
2
1
1
1
2
1
1
0
4
0
0
324,947
AllDotPy/EasySwitch
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/AllDotPy_EasySwitch/easyswitch/exceptions.py
easyswitch.exceptions.BalanceError
class BalanceError(APIError): """Balance error when processing a balance operation.""" pass
class BalanceError(APIError): '''Balance error when processing a balance operation.''' pass
1
1
0
0
0
0
0
0.5
1
0
0
0
0
0
0
12
3
0
2
1
1
1
2
1
1
0
5
0
0
324,948
AllDotPy/EasySwitch
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/AllDotPy_EasySwitch/easyswitch/exceptions.py
easyswitch.exceptions.CancellationError
class CancellationError(APIError): """Cancellation error when processing a cancellation.""" pass
class CancellationError(APIError): '''Cancellation error when processing a cancellation.''' pass
1
1
0
0
0
0
0
0.5
1
0
0
0
0
0
0
12
3
0
2
1
1
1
2
1
1
0
5
0
0
324,949
AllDotPy/EasySwitch
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/AllDotPy_EasySwitch/easyswitch/exceptions.py
easyswitch.exceptions.ConfigurationError
class ConfigurationError(EasySwitchError): """Configuration error in EasySwitch SDK.""" pass
class ConfigurationError(EasySwitchError): '''Configuration error in EasySwitch SDK.''' pass
1
1
0
0
0
0
0
0.5
1
0
0
0
0
0
0
11
3
0
2
1
1
1
2
1
1
0
4
0
0
324,950
AllDotPy/EasySwitch
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/AllDotPy_EasySwitch/easyswitch/exceptions.py
easyswitch.exceptions.CurrencyError
class CurrencyError(APIError): """Currency error when processing a transaction with an unsupported currency.""" pass
class CurrencyError(APIError): '''Currency error when processing a transaction with an unsupported currency.''' pass
1
1
0
0
0
0
0
0.5
1
0
0
0
0
0
0
12
3
0
2
1
1
1
2
1
1
0
5
0
0
324,951
AllDotPy/EasySwitch
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/AllDotPy_EasySwitch/easyswitch/exceptions.py
easyswitch.exceptions.CustomerError
class CustomerError(APIError): """Customer error when processing a customer creation.""" pass
class CustomerError(APIError): '''Customer error when processing a customer creation.''' pass
1
1
0
0
0
0
0
0.5
1
0
0
0
0
0
0
12
3
0
2
1
1
1
2
1
1
0
5
0
0
324,952
AllDotPy/EasySwitch
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/AllDotPy_EasySwitch/easyswitch/exceptions.py
easyswitch.exceptions.EasySwitchError
from typing import Any, Dict, Optional class EasySwitchError(Exception): """Base Exception for EasySwitch SDK.""" def __init__(self, message: str, code: Optional[str]=None, details: Optional[Dict[str, Any]]=None): self.message = message self.code = code self.details = details or {} ...
class EasySwitchError(Exception): '''Base Exception for EasySwitch SDK.''' def __init__(self, message: str, code: Optional[str]=None, details: Optional[Dict[str, Any]]=None): pass
2
1
10
1
9
0
1
0.1
1
3
0
10
1
3
1
11
13
2
10
9
4
1
6
5
4
1
3
0
1
324,953
AllDotPy/EasySwitch
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/AllDotPy_EasySwitch/easyswitch/exceptions.py
easyswitch.exceptions.InvalidProviderError
class InvalidProviderError(EasySwitchError): """Invalid provider error.""" pass
class InvalidProviderError(EasySwitchError): '''Invalid provider error.''' pass
1
1
0
0
0
0
0
0.5
1
0
0
0
0
0
0
11
3
0
2
1
1
1
2
1
1
0
4
0
0
324,954
AllDotPy/EasySwitch
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/AllDotPy_EasySwitch/easyswitch/exceptions.py
easyswitch.exceptions.InvalidRequestError
class InvalidRequestError(EasySwitchError): """Invalid request error.""" pass
class InvalidRequestError(EasySwitchError): '''Invalid request error.''' pass
1
1
0
0
0
0
0
0.5
1
0
0
0
0
0
0
11
3
0
2
1
1
1
2
1
1
0
4
0
0
324,955
AllDotPy/EasySwitch
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/AllDotPy_EasySwitch/easyswitch/exceptions.py
easyswitch.exceptions.LogError
class LogError(APIError): """Log error when processing a log operation.""" pass
class LogError(APIError): '''Log error when processing a log operation.''' pass
1
1
0
0
0
0
0
0.5
1
0
0
0
0
0
0
12
3
0
2
1
1
1
2
1
1
0
5
0
0
324,956
AllDotPy/EasySwitch
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/AllDotPy_EasySwitch/easyswitch/exceptions.py
easyswitch.exceptions.NetworkError
class NetworkError(EasySwitchError): """Network error when communicating with the provider.""" pass
class NetworkError(EasySwitchError): '''Network error when communicating with the provider.''' pass
1
1
0
0
0
0
0
0.5
1
0
0
0
0
0
0
11
3
0
2
1
1
1
2
1
1
0
4
0
0
324,957
AllDotPy/EasySwitch
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/AllDotPy_EasySwitch/easyswitch/exceptions.py
easyswitch.exceptions.PaymentError
class PaymentError(APIError): """Payment error when processing a payment.""" pass
class PaymentError(APIError): '''Payment error when processing a payment.''' pass
1
1
0
0
0
0
0
0.5
1
0
0
0
0
0
0
12
3
0
2
1
1
1
2
1
1
0
5
0
0
324,958
AllDotPy/EasySwitch
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/AllDotPy_EasySwitch/easyswitch/exceptions.py
easyswitch.exceptions.RateLimitError
class RateLimitError(APIError): """Rate limit error when the API is called too frequently.""" pass
class RateLimitError(APIError): '''Rate limit error when the API is called too frequently.''' pass
1
1
0
0
0
0
0
0.5
1
0
0
0
0
0
0
12
3
0
2
1
1
1
2
1
1
0
5
0
0
324,959
AllDotPy/EasySwitch
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/AllDotPy_EasySwitch/easyswitch/exceptions.py
easyswitch.exceptions.RefundError
class RefundError(APIError): """Refund error when processing a refund.""" pass
class RefundError(APIError): '''Refund error when processing a refund.''' pass
1
1
0
0
0
0
0
0.5
1
0
0
0
0
0
0
12
3
0
2
1
1
1
2
1
1
0
5
0
0
324,960
AllDotPy/EasySwitch
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/AllDotPy_EasySwitch/easyswitch/exceptions.py
easyswitch.exceptions.TransactionNotFoundError
class TransactionNotFoundError(EasySwitchError): """Transaction not found error.""" pass
class TransactionNotFoundError(EasySwitchError): '''Transaction not found error.''' pass
1
1
0
0
0
0
0
0.5
1
0
0
0
0
0
0
11
3
0
2
1
1
1
2
1
1
0
4
0
0
324,961
AllDotPy/EasySwitch
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/AllDotPy_EasySwitch/easyswitch/exceptions.py
easyswitch.exceptions.UnsupportedOperationError
class UnsupportedOperationError(EasySwitchError): """Unsupported operation error.""" pass
class UnsupportedOperationError(EasySwitchError): '''Unsupported operation error.''' pass
1
1
0
0
0
0
0
0.5
1
0
0
0
0
0
0
11
3
0
2
1
1
1
2
1
1
0
4
0
0
324,962
AllDotPy/EasySwitch
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/AllDotPy_EasySwitch/easyswitch/exceptions.py
easyswitch.exceptions.ValidationError
from typing import Any, Dict, Optional class ValidationError(EasySwitchError): """Validation error for request data.""" def __init__(self, message: str, field: Optional[str]=None, **kwargs): self.field = field super().__init__(message=message, code='validation_error', details={'field': field, ...
class ValidationError(EasySwitchError): '''Validation error for request data.''' def __init__(self, message: str, field: Optional[str]=None, **kwargs): pass
2
1
7
0
7
0
1
0.13
1
2
0
0
1
1
1
12
10
1
8
3
6
1
4
3
2
1
4
0
1
324,963
AllDotPy/EasySwitch
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/AllDotPy_EasySwitch/easyswitch/exceptions.py
easyswitch.exceptions.WebhookError
class WebhookError(APIError): """Webhook error when processing a webhook operation.""" pass
class WebhookError(APIError): '''Webhook error when processing a webhook operation.''' pass
1
1
0
0
0
0
0
0.5
1
0
0
0
0
0
0
12
3
0
2
1
1
1
2
1
1
0
5
0
0
324,964
AllDotPy/EasySwitch
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/AllDotPy_EasySwitch/easyswitch/exceptions.py
easyswitch.exceptions.WebhookValidationError
class WebhookValidationError(EasySwitchError): """Webhook validation error.""" pass
class WebhookValidationError(EasySwitchError): '''Webhook validation error.''' pass
1
1
0
0
0
0
0
0.5
1
0
0
0
0
0
0
11
3
0
2
1
1
1
2
1
1
0
4
0
0
324,965
AllDotPy/EasySwitch
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/AllDotPy_EasySwitch/easyswitch/integrators/bizao.py
easyswitch.integrators.bizao.BizaoAdapter
from typing import Any, ClassVar, Dict, List, Optional from easyswitch.types import Currency, CustomerInfo, PaymentResponse, Provider, TransactionDetail, TransactionStatus, TransactionStatusResponse, TransactionType, WebhookEvent import base64 from easyswitch.adapters.base import AdaptersRegistry, BaseAdapter from easy...
@AdaptersRegistry.register() class BizaoAdapter(BaseAdapter): '''Bizao Integrator for EasySwitch SDK.''' def validate_credentials(self) -> bool: ''' Validate the credentials for Bizao. ''' pass def get_credentials(self): '''Get the credentials for Bizao.''' pass def ge...
19
16
17
1
12
4
2
0.31
1
17
8
0
17
0
17
58
347
48
238
52
208
73
72
37
54
3
5
2
27
324,966
AllDotPy/EasySwitch
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/AllDotPy_EasySwitch/easyswitch/integrators/cinetpay.py
easyswitch.integrators.cinetpay.CinetpayAdapter
import hashlib from easyswitch.adapters.base import AdaptersRegistry, BaseAdapter from typing import Any, ClassVar, Dict, List, Optional from easyswitch.exceptions import AuthenticationError, PaymentError, UnsupportedOperationError import json from easyswitch.types import Currency, CustomerInfo, PaymentResponse, Provid...
@AdaptersRegistry.register() class CinetpayAdapter(BaseAdapter): '''CinetPay Integrator for EasySwitch SDK.''' def validate_credentials(self) -> bool: ''' Validate the credentials for CinetPay. ''' pass def get_credentials(self): '''Get the credentials for CinetPay.''' pass...
16
15
20
2
14
5
1
0.32
1
14
8
0
14
0
14
55
322
41
219
39
200
69
63
33
48
3
5
2
19
324,967
AllDotPy/EasySwitch
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/AllDotPy_EasySwitch/easyswitch/integrators/fedapay/__init__.py
easyswitch.integrators.fedapay.FedapayAdapter
from typing import Any, ClassVar, Dict, List, Optional from easyswitch.integrators.fedapay.types import BalanceDetail, CurrencyResponse, CustomerSearchResponse, FedapayCustomerUpdate, FedapayTransactionUpdate, LogDetail, LogsResponse, PaymentLinkResponse, TransactionSearchResponse, WebhookDetail, WebhooksResponse from ...
@AdaptersRegistry.register() class FedapayAdapter(BaseAdapter): '''FedaPay Integrator for EasySwitch SDK.''' def __str__(self): pass def validate_credentials(self) -> bool: ''' Validate the credentials for FedaPay. ''' pass def get_credentials(self): '''Get the credent...
41
39
30
3
18
9
2
0.5
1
38
31
0
39
0
39
80
1,258
165
731
176
662
369
267
128
227
7
5
3
86
324,968
AllDotPy/EasySwitch
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/AllDotPy_EasySwitch/easyswitch/integrators/fedapay/types.py
easyswitch.integrators.fedapay.types.BalanceDetail
from dataclasses import dataclass, field from typing import Any, Dict, List, Optional @dataclass class BalanceDetail: id: int amount: float mode: Optional[str] = None created_at: Optional[str] = None updated_at: Optional[str] = None provider: Optional[str] = None metadata: Dict[str, Any] = ...
@dataclass class BalanceDetail: pass
2
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
9
0
9
7
8
0
9
7
8
0
0
0
0
324,969
AllDotPy/EasySwitch
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/AllDotPy_EasySwitch/easyswitch/integrators/fedapay/types.py
easyswitch.integrators.fedapay.types.CurrencyResponse
from typing import Any, Dict, List, Optional from datetime import datetime from easyswitch.types import Currency, CustomerInfo, PaginationMeta, Provider, TransactionDetail, TransactionStatus from dataclasses import dataclass, field @dataclass class CurrencyResponse: """Standardized Currency response structure.""" ...
@dataclass class CurrencyResponse: '''Standardized Currency response structure.''' def __post_init__(self): '''Ensure modes are unique and always a list.''' pass
3
2
5
0
4
1
3
0.15
0
2
0
0
1
0
1
1
17
2
13
6
11
2
13
6
11
3
0
1
3
324,970
AllDotPy/EasySwitch
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/AllDotPy_EasySwitch/easyswitch/integrators/fedapay/types.py
easyswitch.integrators.fedapay.types.CustomerSearchResponse
from dataclasses import dataclass, field from easyswitch.types import Currency, CustomerInfo, PaginationMeta, Provider, TransactionDetail, TransactionStatus from typing import Any, Dict, List, Optional @dataclass class CustomerSearchResponse: customers: List[CustomerInfo] meta: PaginationMeta
@dataclass class CustomerSearchResponse: pass
2
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
3
0
3
1
2
0
3
1
2
0
0
0
0
324,971
AllDotPy/EasySwitch
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/AllDotPy_EasySwitch/easyswitch/integrators/fedapay/types.py
easyswitch.integrators.fedapay.types.FedapayCustomerUpdate
from easyswitch.utils import parse_phone from dataclasses import dataclass, field from typing import Any, Dict, List, Optional @dataclass class FedapayCustomerUpdate: """Standardized FedaPay's customer update structure.""" firstname: str lastname: str email: Optional[str] = None phone_number: Optio...
@dataclass class FedapayCustomerUpdate: '''Standardized FedaPay's customer update structure.''' def to_payload(self) -> Dict[str, Any]: '''Prepares the payload for the FedaPay API by keeping only the filled fields.''' pass
3
2
22
5
15
2
3
0.15
0
2
0
0
1
0
1
1
29
6
20
6
18
3
14
6
12
3
0
1
3
324,972
AllDotPy/EasySwitch
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/AllDotPy_EasySwitch/easyswitch/integrators/fedapay/types.py
easyswitch.integrators.fedapay.types.FedapayTransactionUpdate
from easyswitch.types import Currency, CustomerInfo, PaginationMeta, Provider, TransactionDetail, TransactionStatus from dataclasses import dataclass, field from typing import Any, Dict, List, Optional @dataclass class FedapayTransactionUpdate: """ Standardized FedaPay's transaction update structure. """ amoun...
@dataclass class FedapayTransactionUpdate: ''' Standardized FedaPay's transaction update structure. ''' pass
2
1
0
0
0
0
0
0.17
0
0
0
0
0
0
0
0
7
0
6
6
5
1
6
6
5
0
0
0
0
324,973
AllDotPy/EasySwitch
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/AllDotPy_EasySwitch/easyswitch/integrators/fedapay/types.py
easyswitch.integrators.fedapay.types.LogDetail
from easyswitch.types import Currency, CustomerInfo, PaginationMeta, Provider, TransactionDetail, TransactionStatus from datetime import datetime from dataclasses import dataclass, field from typing import Any, Dict, List, Optional @dataclass class LogDetail: """Standardized log detail structure.""" id: int ...
@dataclass class LogDetail: '''Standardized log detail structure.''' pass
2
1
0
0
0
0
0
0.06
0
0
0
0
0
0
0
0
19
1
17
9
16
1
17
9
16
0
0
0
0
324,974
AllDotPy/EasySwitch
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/AllDotPy_EasySwitch/easyswitch/integrators/fedapay/types.py
easyswitch.integrators.fedapay.types.LogsResponse
from dataclasses import dataclass, field from typing import Any, Dict, List, Optional from easyswitch.types import Currency, CustomerInfo, PaginationMeta, Provider, TransactionDetail, TransactionStatus @dataclass class LogsResponse: """Standardized response structure for logs.""" logs: List[LogDetail] meta...
@dataclass class LogsResponse: '''Standardized response structure for logs.''' pass
2
1
0
0
0
0
0
0.33
0
0
0
0
0
0
0
0
4
0
3
1
2
1
3
1
2
0
0
0
0
324,975
AllDotPy/EasySwitch
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/AllDotPy_EasySwitch/easyswitch/integrators/fedapay/types.py
easyswitch.integrators.fedapay.types.PaymentLinkResponse
from typing import Any, Dict, List, Optional from dataclasses import dataclass, field @dataclass class PaymentLinkResponse: """ Standardized Payment Link response structure.""" token: str url: str raw_response: Optional[Dict[str, Any]] = None
@dataclass class PaymentLinkResponse: ''' Standardized Payment Link response structure.''' pass
2
1
0
0
0
0
0
0.25
0
0
0
0
0
0
0
0
5
0
4
2
3
1
4
2
3
0
0
0
0
324,976
AllDotPy/EasySwitch
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/AllDotPy_EasySwitch/easyswitch/integrators/fedapay/types.py
easyswitch.integrators.fedapay.types.TransactionSearchResponse
from typing import Any, Dict, List, Optional from easyswitch.types import Currency, CustomerInfo, PaginationMeta, Provider, TransactionDetail, TransactionStatus from dataclasses import dataclass, field @dataclass class TransactionSearchResponse: transactions: List[TransactionDetail] meta: PaginationMeta
@dataclass class TransactionSearchResponse: pass
2
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
3
0
3
1
2
0
3
1
2
0
0
0
0
324,977
AllDotPy/EasySwitch
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/AllDotPy_EasySwitch/easyswitch/integrators/fedapay/types.py
easyswitch.integrators.fedapay.types.WebhookDetail
from typing import Any, Dict, List, Optional from easyswitch.types import Currency, CustomerInfo, PaginationMeta, Provider, TransactionDetail, TransactionStatus from dataclasses import dataclass, field from datetime import datetime @dataclass class WebhookDetail: """Standardized webhook detail structure.""" id...
@dataclass class WebhookDetail: '''Standardized webhook detail structure.''' pass
2
1
0
0
0
0
0
0.08
0
0
0
0
0
0
0
0
15
1
13
6
12
1
13
6
12
0
0
0
0
324,978
AllDotPy/EasySwitch
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/AllDotPy_EasySwitch/easyswitch/integrators/fedapay/types.py
easyswitch.integrators.fedapay.types.WebhooksResponse
from dataclasses import dataclass, field from typing import Any, Dict, List, Optional from easyswitch.types import Currency, CustomerInfo, PaginationMeta, Provider, TransactionDetail, TransactionStatus @dataclass class WebhooksResponse: """Standardized response structure for webhooks.""" webhooks: List[Webhook...
@dataclass class WebhooksResponse: '''Standardized response structure for webhooks.''' pass
2
1
0
0
0
0
0
0.33
0
0
0
0
0
0
0
0
4
0
3
1
2
1
3
1
2
0
0
0
0
324,979
AllDotPy/EasySwitch
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/AllDotPy_EasySwitch/easyswitch/integrators/fedapay/utils.py
easyswitch.integrators.fedapay.utils.FedapayCurrencyMapper
class FedapayCurrencyMapper: """ A utility class to map FedaPay currency IDs to their corresponding ISO codes. This class provides a method to retrieve the ISO code for a given FedaPay currency ID. It also allows for dynamic addition of new currency mappings. """ _id_to_iso = {1: 'XOF', 2: 'GNF'...
class FedapayCurrencyMapper: ''' A utility class to map FedaPay currency IDs to their corresponding ISO codes. This class provides a method to retrieve the ISO code for a given FedaPay currency ID. It also allows for dynamic addition of new currency mappings. ''' @classmethod def get_iso(cls...
5
3
12
1
4
8
2
1.53
0
3
0
0
0
0
2
2
39
4
15
7
10
23
9
5
6
2
0
1
3
324,980
AllDotPy/EasySwitch
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/AllDotPy_EasySwitch/easyswitch/integrators/mtn.py
easyswitch.integrators.mtn.MTNIntegrator
import base64 from easyswitch.utils.http import HTTPClient from easyswitch.conf.config import Config import json from typing import Any, Dict, List, Optional, Union import uuid from easyswitch.adapters.base import BaseAdapter import hmac from easyswitch.types import Currency, CustomerInfo, PaymentResponse, Provider, Tr...
class MTNIntegrator(BaseAdapter): '''Integrator for MTN Mobile Money API.''' def __init__(self, config: Config): ''' Initialize the MTN integrator. Args: config: Configuration du SDK ''' pass async def _ensure_auth_token(self) -> str: ''' ...
9
9
46
7
28
12
3
0.41
1
22
11
0
8
7
8
49
377
60
225
62
203
93
87
45
78
6
5
3
23
324,981
AllDotPy/EasySwitch
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/AllDotPy_EasySwitch/easyswitch/integrators/paygate.py
easyswitch.integrators.paygate.PayGateAdapter
from easyswitch.exceptions import AuthenticationError, InvalidProviderError, PaymentError, UnsupportedOperationError from easyswitch.adapters.base import AdaptersRegistry, BaseAdapter from easyswitch.types import Currency, CustomerInfo, PaymentResponse, Provider, TransactionDetail, TransactionStatus, TransactionStatusR...
@AdaptersRegistry.register() class PayGateAdapter(BaseAdapter): '''PayGate Global Integrator for EasySwitch SDK.''' def get_credentials(self) -> Dict[str, str]: '''Get PayGate credentials (just API key in this case)''' pass def validate_credentials(self) -> bool: '''Validate creden...
21
17
15
1
11
3
2
0.27
1
18
11
0
17
0
18
59
320
52
218
42
198
59
82
41
63
4
5
1
30
324,982
AllDotPy/EasySwitch
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/AllDotPy_EasySwitch/easyswitch/integrators/semoa.py
easyswitch.integrators.semoa.SemoaAdapter
from typing import Any, ClassVar, Dict, List, Optional, Union from easyswitch.types import Currency, CustomerInfo, PaymentResponse, Provider, TransactionDetail, TransactionStatus, TransactionType from easyswitch.exceptions import AuthenticationError, PaymentError, TransactionNotFoundError, UnsupportedOperationError fro...
class SemoaAdapter(BaseAdapter): '''Semoa Integrator for EasySwitch SDK.''' def _validate_credentials(self) -> bool: ''' Validate the credentials for CinetPay. ''' pass def get_credentials(self): '''Get the credentials for Semoa.''' pass def get_headers(self, authoriz...
9
9
20
1
13
6
2
0.42
1
9
5
0
8
0
8
49
192
22
125
25
116
52
43
24
34
2
5
2
12
324,983
AllDotPy/EasySwitch
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/AllDotPy_EasySwitch/easyswitch/types.py
easyswitch.types.ApiCredentials
from typing import Any, Dict, Optional from dataclasses import dataclass, field import os @dataclass class ApiCredentials: """Authentication credentials for the API.""" api_key: str api_secret: Optional[str] = None client_id: Optional[str] = None client_secret: Optional[str] = None merchant_id:...
@dataclass class ApiCredentials: '''Authentication credentials for the API.''' def load_from_env(self, provider: Provider): '''Load credentials from environment variables.''' pass def write_to_env(self, provider: Provider): '''Write credentials to environment variables.''' ...
4
3
8
1
6
1
3
0.14
0
1
1
0
2
0
2
2
36
5
28
21
25
4
28
21
25
3
0
2
6
324,984
AllDotPy/EasySwitch
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/AllDotPy_EasySwitch/easyswitch/types.py
easyswitch.types.Countries
from enum import Enum class Countries(str, Enum): """Supported Countries Choices.""" TOGO = 'TG' BENIN = 'BJ' GHANA = 'GH' BURKINA = 'BF' IVORY_COAST = 'CI'
class Countries(str, Enum): '''Supported Countries Choices.''' pass
1
1
0
0
0
0
0
0.17
2
0
0
0
0
0
0
115
8
1
6
6
5
1
6
6
5
0
4
0
0
324,985
AllDotPy/EasySwitch
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/AllDotPy_EasySwitch/easyswitch/types.py
easyswitch.types.Currency
from enum import Enum class Currency(str, Enum): """Available Currencies Choices.""" XOF = 'XOF' XAF = 'XAF' NGN = 'NGN' GHS = 'GHS' EUR = 'EUR' USD = 'USD' CDF = 'CDF' GNF = 'GNF' KMF = 'KMF'
class Currency(str, Enum): '''Available Currencies Choices.''' pass
1
1
0
0
0
0
0
1
2
0
0
0
0
0
0
115
12
1
10
10
9
10
10
10
9
0
4
0
0
324,986
AllDotPy/EasySwitch
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/AllDotPy_EasySwitch/easyswitch/types.py
easyswitch.types.CustomerInfo
from typing import Any, Dict, Optional from dataclasses import dataclass, field @dataclass class CustomerInfo: """Customer informations.""" phone_number: str = '' first_name: Optional[str] = None last_name: Optional[str] = None email: Optional[str] = None address: Optional[str] = None city:...
@dataclass class CustomerInfo: '''Customer informations.''' pass
2
1
0
0
0
0
0
0.08
0
0
0
0
0
0
0
0
15
1
13
12
12
1
13
12
12
0
0
0
0
324,987
AllDotPy/EasySwitch
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/AllDotPy_EasySwitch/easyswitch/types.py
easyswitch.types.PaginationMeta
from typing import Any, Dict, Optional from dataclasses import dataclass, field @dataclass class PaginationMeta: """Standardized pagination metadata structure.""" current_page: int next_page: Optional[int] prev_page: Optional[int] per_page: int total_pages: int total_count: int
@dataclass class PaginationMeta: '''Standardized pagination metadata structure.''' 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
324,988
AllDotPy/EasySwitch
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/AllDotPy_EasySwitch/easyswitch/types.py
easyswitch.types.PaymentResponse
from datetime import datetime from dataclasses import dataclass, field from typing import Any, Dict, Optional @dataclass class PaymentResponse: """Standardized Payment response structure.""" transaction_id: str provider: Provider status: TransactionStatus amount: float currency: Currency cr...
@dataclass class PaymentResponse: '''Standardized Payment response structure.''' @property def is_successful(self) -> bool: '''Check if the transaction was successful.''' pass @property def is_pending(self) -> bool: '''Check if the transaction is pending.''' pass ...
8
4
6
0
5
1
1
0.13
0
2
1
0
3
0
3
3
39
4
31
15
24
4
20
12
16
1
0
0
3
324,989
AllDotPy/EasySwitch
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/AllDotPy_EasySwitch/easyswitch/types.py
easyswitch.types.Provider
from enum import Enum class Provider(str, Enum): """ Available choices for supported Payment providers. """ SEMOA = 'SEMOA' BIZAO = 'BIZAO' CINETPAY = 'CINETPAY' PAYGATE = 'PAYGATE' FEDAPAY = 'FEDAPAY'
class Provider(str, Enum): ''' Available choices for supported Payment providers. ''' pass
1
1
0
0
0
0
0
0.17
2
0
0
0
0
0
0
115
8
1
6
6
5
1
6
6
5
0
4
0
0
324,990
AllDotPy/EasySwitch
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/AllDotPy_EasySwitch/easyswitch/types.py
easyswitch.types.TransactionDetail
from datetime import datetime from typing import Any, Dict, Optional from dataclasses import dataclass, field @dataclass class TransactionDetail: """Standardized Transaction detail structure.""" transaction_id: str provider: Provider amount: float currency: Currency status: TransactionStatus = ...
@dataclass class TransactionDetail: '''Standardized Transaction detail structure.''' pass
2
1
0
0
0
0
0
0.06
0
0
0
0
0
0
0
0
19
1
17
13
16
1
17
13
16
0
0
0
0
324,991
AllDotPy/EasySwitch
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/AllDotPy_EasySwitch/easyswitch/types.py
easyswitch.types.TransactionStatus
from enum import Enum class TransactionStatus(str, Enum): """Possible statues of a transaction.""" PENDING = 'pending' SUCCESSFUL = 'successful' FAILED = 'failed' ERROR = 'error' CANCELLED = 'cancelled' REFUSED = 'refused' DECLINED = 'declined' EXPIRED = 'expired' REFUNDED = 're...
class TransactionStatus(str, Enum): '''Possible statues of a transaction.''' pass
1
1
0
0
0
0
0
0.07
2
0
0
0
0
0
0
115
17
1
15
15
14
1
15
15
14
0
4
0
0
324,992
AllDotPy/EasySwitch
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/AllDotPy_EasySwitch/easyswitch/types.py
easyswitch.types.TransactionStatusResponse
from typing import Any, Dict, Optional from dataclasses import dataclass, field @dataclass class TransactionStatusResponse: """Standardized Transaction status response structure.""" transaction_id: str provider: Provider status: TransactionStatus amount: float data: Dict[str, Any] = field(defau...
@dataclass class TransactionStatusResponse: '''Standardized Transaction status response structure.''' pass
2
1
0
0
0
0
0
0.17
0
0
0
0
0
0
0
0
8
1
6
2
5
1
6
2
5
0
0
0
0
324,993
AllDotPy/EasySwitch
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/AllDotPy_EasySwitch/easyswitch/types.py
easyswitch.types.TransactionType
from enum import Enum class TransactionType(str, Enum): """Supported transaction types.""" PAYMENT = 'payment' DEPOSIT = 'deposit' WITHDRAWAL = 'withdrawal' REFUND = 'refund' TRANSFER = 'transfer'
class TransactionType(str, Enum): '''Supported transaction types.''' pass
1
1
0
0
0
0
0
0.17
2
0
0
0
0
0
0
115
8
1
6
6
5
1
6
6
5
0
4
0
0
324,994
AllDotPy/EasySwitch
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/AllDotPy_EasySwitch/easyswitch/types.py
easyswitch.types.WebhookEvent
from typing import Any, Dict, Optional from dataclasses import dataclass, field from datetime import datetime @dataclass class WebhookEvent: """Standardized webhook event structure.""" event_type: str provider: Provider transaction_id: str status: TransactionStatus amount: float currency: C...
@dataclass class WebhookEvent: '''Standardized webhook event structure.''' pass
2
1
0
0
0
0
0
0.09
0
0
0
0
0
0
0
0
13
1
11
5
10
1
11
5
10
0
0
0
0
324,995
AllDotPy/EasySwitch
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/AllDotPy_EasySwitch/easyswitch/utils/http.py
easyswitch.utils.http.HTTPClient
from aiohttp import ClientTimeout, ClientResponse, ClientSession from typing import Any, Dict, Optional, Union, AsyncIterator, List from easyswitch.exceptions import NetworkError, RateLimitError, APIError import json from time import monotonic import aiohttp import asyncio class HTTPClient: """Advanced asynchronou...
class HTTPClient: '''Advanced asynchronous HTTP client with retry logic and connection pooling''' def __init__(self, base_url: str, default_headers: Optional[Dict[str, str]]=None, timeout: int=30, max_retries: int=3, retry_delay: float=1.0, debug: bool=False, proxy: Optional[str]=None, pool_size: int=100): ...
15
12
20
1
15
4
2
0.24
0
17
4
0
13
10
13
13
281
30
203
102
127
48
80
37
66
11
0
5
27
324,996
AllDotPy/EasySwitch
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/AllDotPy_EasySwitch/easyswitch/utils/http.py
easyswitch.utils.http.HTTPResponse
from dataclasses import dataclass from typing import Any, Dict, Optional, Union, AsyncIterator, List @dataclass class HTTPResponse: """Structured HTTP response container""" status: int headers: Dict[str, str] data: Union[Dict[str, Any], str] elapsed: float url: str
@dataclass class HTTPResponse: '''Structured HTTP response container''' pass
2
1
0
0
0
0
0
0.17
0
0
0
0
0
0
0
0
7
0
6
1
5
1
6
1
5
0
0
0
0
324,997
AllDotPy/EasySwitch
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/AllDotPy_EasySwitch/easyswitch/utils/logger.py
easyswitch.utils.logger.PaymentLogger
import logging from typing import Any, Dict, Optional, Union class PaymentLogger: """ Specialized logger for payment operations. Records payment events with appropriate information. """ def __init__(self, logger_name: str='easyswitch.payment'): """ Initialize the payment logger. ...
class PaymentLogger: ''' Specialized logger for payment operations. Records payment events with appropriate information. ''' def __init__(self, logger_name: str='easyswitch.payment'): ''' Initialize the payment logger. Args: logger_name: Logger name ''' ...
11
11
7
0
5
1
1
0.34
0
3
0
0
10
1
10
10
82
11
53
16
42
18
25
16
14
2
0
0
14
324,998
AllDotPy/EasySwitch
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/AllDotPy_EasySwitch/easyswitch/conf/sources/env.py
env.EnvConfigSource
from easyswitch.conf import register_source import os from pathlib import Path from dotenv import load_dotenv from typing import Any, Dict, List, Optional from easyswitch.conf.base import BaseConfigSource @register_source('env') class EnvConfigSource(BaseConfigSource): """Loads EasySwitch configurations from envir...
@register_source('env') class EnvConfigSource(BaseConfigSource): '''Loads EasySwitch configurations from environment variables.''' def __init__(self, env_file: Optional[str]=None): pass def load(self) -> Dict[str, Any]: '''Loads configs from .env file.''' pass def _load_loggin...
12
10
11
1
8
1
3
0.19
1
7
0
0
10
1
10
32
117
21
81
25
70
15
63
24
52
6
5
4
25
324,999
AllDotPy/EasySwitch
/Users/umroot/Documents/PhD_works/PhD-Core-Contents/Class-level-dataset-curation/unseen_data/git_repos_for_analysis/AllDotPy_EasySwitch/easyswitch/conf/sources/json.py
json.JsonConfigSource
from easyswitch.conf.base import BaseConfigSource from easyswitch.conf import register_source import json from pathlib import Path from typing import Any, Dict @register_source('json') class JsonConfigSource(BaseConfigSource): """Loads EasySwitch configurations from a JSON file.""" def __init__(self, file_pat...
@register_source('json') class JsonConfigSource(BaseConfigSource): '''Loads EasySwitch configurations from a JSON file.''' def __init__(self, file_path: str): pass def load(self) -> Dict[str, Any]: '''Load the JSON file''' pass def is_valid(self) -> bool: '''Check if t...
5
3
6
1
5
1
2
0.2
1
6
0
0
3
1
3
25
23
5
15
7
11
3
15
5
11
3
5
2
5