id int64 0 458k | file_name stringlengths 4 119 | file_path stringlengths 14 227 | content stringlengths 24 9.96M | size int64 24 9.96M | language stringclasses 1
value | extension stringclasses 14
values | total_lines int64 1 219k | avg_line_length float64 2.52 4.63M | max_line_length int64 5 9.91M | alphanum_fraction float64 0 1 | repo_name stringlengths 7 101 | repo_stars int64 100 139k | repo_forks int64 0 26.4k | repo_open_issues int64 0 2.27k | repo_license stringclasses 12
values | repo_extraction_date stringclasses 433
values |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
2,286,300 | pragma_directive.py | NioTheFirst_ScType/slither/core/declarations/pragma_directive.py | from typing import List, TYPE_CHECKING
from slither.core.source_mapping.source_mapping import SourceMapping
if TYPE_CHECKING:
from slither.core.scope.scope import FileScope
class Pragma(SourceMapping):
def __init__(self, directive: List[str], scope: "FileScope"):
super().__init__()
self._dir... | 1,126 | Python | .py | 33 | 27.121212 | 96 | 0.620499 | NioTheFirst/ScType | 8 | 4 | 1 | AGPL-3.0 | 9/5/2024, 10:48:01 PM (Europe/Amsterdam) |
2,286,301 | modifier.py | NioTheFirst_ScType/slither/core/declarations/modifier.py | """
Modifier module
"""
from .function_contract import FunctionContract
class Modifier(FunctionContract):
pass
| 121 | Python | .py | 6 | 17.5 | 47 | 0.787611 | NioTheFirst/ScType | 8 | 4 | 1 | AGPL-3.0 | 9/5/2024, 10:48:01 PM (Europe/Amsterdam) |
2,286,302 | enum_top_level.py | NioTheFirst_ScType/slither/core/declarations/enum_top_level.py | from typing import TYPE_CHECKING, List
from slither.core.declarations import Enum
from slither.core.declarations.top_level import TopLevel
if TYPE_CHECKING:
from slither.core.scope.scope import FileScope
class EnumTopLevel(Enum, TopLevel):
def __init__(self, name: str, canonical_name: str, values: List[str]... | 443 | Python | .py | 9 | 45.111111 | 94 | 0.746512 | NioTheFirst/ScType | 8 | 4 | 1 | AGPL-3.0 | 9/5/2024, 10:48:01 PM (Europe/Amsterdam) |
2,286,303 | function_contract.py | NioTheFirst_ScType/slither/core/declarations/function_contract.py | """
Function module
"""
from typing import TYPE_CHECKING, List, Tuple
from slither.core.children.child_contract import ChildContract
from slither.core.children.child_inheritance import ChildInheritance
from slither.core.declarations import Function
# pylint: disable=import-outside-toplevel,too-many-instance-attri... | 4,429 | Python | .py | 95 | 38.389474 | 126 | 0.484371 | NioTheFirst/ScType | 8 | 4 | 1 | AGPL-3.0 | 9/5/2024, 10:48:01 PM (Europe/Amsterdam) |
2,286,304 | contract.py | NioTheFirst_ScType/slither/core/declarations/contract.py | """"
Contract module
"""
import logging
from collections import defaultdict
from pathlib import Path
from typing import Optional, List, Dict, Callable, Tuple, TYPE_CHECKING, Union, Set
from crytic_compile.platform import Type as PlatformType
from slither.core.cfg.scope import Scope
from slither.core.solidity_type... | 58,101 | Python | .py | 1,264 | 36.173259 | 118 | 0.535287 | NioTheFirst/ScType | 8 | 4 | 1 | AGPL-3.0 | 9/5/2024, 10:48:01 PM (Europe/Amsterdam) |
2,286,305 | custom_error_contract.py | NioTheFirst_ScType/slither/core/declarations/custom_error_contract.py | from slither.core.children.child_contract import ChildContract
from slither.core.declarations.custom_error import CustomError
class CustomErrorContract(CustomError, ChildContract):
def is_declared_by(self, contract):
"""
Check if the element is declared by the contract
:param contract:
... | 387 | Python | .py | 10 | 32.3 | 62 | 0.72 | NioTheFirst/ScType | 8 | 4 | 1 | AGPL-3.0 | 9/5/2024, 10:48:01 PM (Europe/Amsterdam) |
2,286,306 | function_top_level.py | NioTheFirst_ScType/slither/core/declarations/function_top_level.py | """
Function module
"""
from typing import List, Tuple, TYPE_CHECKING
from slither.core.declarations import Function
from slither.core.declarations.top_level import TopLevel
if TYPE_CHECKING:
from slither.core.compilation_unit import SlitherCompilationUnit
from slither.core.scope.scope import FileScope
... | 3,712 | Python | .py | 79 | 39.177215 | 126 | 0.450124 | NioTheFirst/ScType | 8 | 4 | 1 | AGPL-3.0 | 9/5/2024, 10:48:01 PM (Europe/Amsterdam) |
2,286,307 | convert.py | NioTheFirst_ScType/slither/slithir/convert.py | import logging
from pathlib import Path
from typing import List, TYPE_CHECKING, Union, Optional
# pylint: disable= too-many-lines,import-outside-toplevel,too-many-branches,too-many-statements,too-many-nested-blocks
from slither.core.declarations import (
Contract,
Enum,
Event,
Function,
SolidityFun... | 72,250 | Python | .py | 1,652 | 31.905569 | 120 | 0.551347 | NioTheFirst/ScType | 8 | 4 | 1 | AGPL-3.0 | 9/5/2024, 10:48:01 PM (Europe/Amsterdam) |
2,286,308 | tmp_new_elementary_type.py | NioTheFirst_ScType/slither/slithir/tmp_operations/tmp_new_elementary_type.py | from typing import List
from slither.slithir.operations.lvalue import OperationWithLValue
from slither.core.solidity_types.elementary_type import ElementaryType
class TmpNewElementaryType(OperationWithLValue):
def __init__(self, new_type: ElementaryType, lvalue):
assert isinstance(new_type, ElementaryTyp... | 648 | Python | .py | 17 | 32.058824 | 70 | 0.6896 | NioTheFirst/ScType | 8 | 4 | 1 | AGPL-3.0 | 9/5/2024, 10:48:01 PM (Europe/Amsterdam) |
2,286,309 | tmp_new_array.py | NioTheFirst_ScType/slither/slithir/tmp_operations/tmp_new_array.py | from slither.slithir.operations.lvalue import OperationWithLValue
from slither.core.solidity_types.type import Type
class TmpNewArray(OperationWithLValue):
def __init__(self, depth, array_type, lvalue):
super().__init__()
assert isinstance(array_type, Type)
self._depth = depth
self... | 665 | Python | .py | 20 | 26.75 | 75 | 0.644757 | NioTheFirst/ScType | 8 | 4 | 1 | AGPL-3.0 | 9/5/2024, 10:48:01 PM (Europe/Amsterdam) |
2,286,310 | tmp_new_contract.py | NioTheFirst_ScType/slither/slithir/tmp_operations/tmp_new_contract.py | from slither.slithir.operations.lvalue import OperationWithLValue
class TmpNewContract(OperationWithLValue):
def __init__(self, contract_name, lvalue):
super().__init__()
self._contract_name = contract_name
self._lvalue = lvalue
self._call_value = None
self._call_salt = Non... | 842 | Python | .py | 28 | 23.321429 | 65 | 0.627329 | NioTheFirst/ScType | 8 | 4 | 1 | AGPL-3.0 | 9/5/2024, 10:48:01 PM (Europe/Amsterdam) |
2,286,311 | tmp_call.py | NioTheFirst_ScType/slither/slithir/tmp_operations/tmp_call.py | from slither.core.declarations import (
Event,
Contract,
SolidityVariableComposed,
SolidityFunction,
Structure,
)
from slither.core.declarations.custom_error import CustomError
from slither.core.variables.variable import Variable
from slither.slithir.operations.lvalue import OperationWithLValue
cl... | 2,204 | Python | .py | 80 | 19.875 | 88 | 0.595442 | NioTheFirst/ScType | 8 | 4 | 1 | AGPL-3.0 | 9/5/2024, 10:48:01 PM (Europe/Amsterdam) |
2,286,312 | tmp_new_structure.py | NioTheFirst_ScType/slither/slithir/tmp_operations/tmp_new_structure.py | from slither.slithir.operations.lvalue import OperationWithLValue
class TmpNewStructure(OperationWithLValue):
def __init__(self, contract_name, lvalue):
super().__init__()
self._contract_name = contract_name
self._lvalue = lvalue
@property
def contract_name(self):
return s... | 478 | Python | .py | 14 | 27.642857 | 65 | 0.660131 | NioTheFirst/ScType | 8 | 4 | 1 | AGPL-3.0 | 9/5/2024, 10:48:01 PM (Europe/Amsterdam) |
2,286,313 | argument.py | NioTheFirst_ScType/slither/slithir/tmp_operations/argument.py | from enum import Enum
from slither.slithir.operations.operation import Operation
class ArgumentType(Enum):
CALL = 0
VALUE = 1
GAS = 2
DATA = 3
class Argument(Operation):
def __init__(self, argument):
super().__init__()
self._argument = argument
self._type = ArgumentType.C... | 963 | Python | .py | 35 | 20.828571 | 71 | 0.59542 | NioTheFirst/ScType | 8 | 4 | 1 | AGPL-3.0 | 9/5/2024, 10:48:01 PM (Europe/Amsterdam) |
2,286,314 | solidity_call.py | NioTheFirst_ScType/slither/slithir/operations/solidity_call.py | from slither.core.declarations.solidity_variables import SolidityFunction
from slither.slithir.operations.call import Call
from slither.slithir.operations.lvalue import OperationWithLValue
class SolidityCall(Call, OperationWithLValue):
def __init__(self, function, nbr_arguments, result, type_call):
assert... | 1,590 | Python | .py | 41 | 29.97561 | 98 | 0.60026 | NioTheFirst/ScType | 8 | 4 | 1 | AGPL-3.0 | 9/5/2024, 10:48:01 PM (Europe/Amsterdam) |
2,286,315 | internal_call.py | NioTheFirst_ScType/slither/slithir/operations/internal_call.py | from typing import Union, Tuple, List, Optional
from slither.core.declarations import Modifier
from slither.core.declarations.function import Function
from slither.core.declarations.function_contract import FunctionContract
from slither.slithir.operations.call import Call
from slither.slithir.operations.lvalue import O... | 2,675 | Python | .py | 69 | 30.826087 | 94 | 0.642004 | NioTheFirst/ScType | 8 | 4 | 1 | AGPL-3.0 | 9/5/2024, 10:48:01 PM (Europe/Amsterdam) |
2,286,316 | high_level_call.py | NioTheFirst_ScType/slither/slithir/operations/high_level_call.py | from typing import Union
from slither.slithir.operations.call import Call
from slither.slithir.operations.lvalue import OperationWithLValue
from slither.core.variables.variable import Variable
from slither.core.declarations.solidity_variables import SolidityVariable
from slither.core.declarations.function import Funct... | 5,965 | Python | .py | 150 | 31.44 | 100 | 0.550104 | NioTheFirst/ScType | 8 | 4 | 1 | AGPL-3.0 | 9/5/2024, 10:48:01 PM (Europe/Amsterdam) |
2,286,317 | unary.py | NioTheFirst_ScType/slither/slithir/operations/unary.py | import logging
from enum import Enum
from slither.slithir.operations.lvalue import OperationWithLValue
from slither.slithir.utils.utils import is_valid_lvalue, is_valid_rvalue
from slither.slithir.exceptions import SlithIRError
logger = logging.getLogger("BinaryOperationIR")
class UnaryType(Enum):
BANG = 0 # !... | 1,518 | Python | .py | 45 | 26.466667 | 80 | 0.636052 | NioTheFirst/ScType | 8 | 4 | 1 | AGPL-3.0 | 9/5/2024, 10:48:01 PM (Europe/Amsterdam) |
2,286,318 | member.py | NioTheFirst_ScType/slither/slithir/operations/member.py | from slither.core.declarations import Contract, Function
from slither.core.declarations.custom_error import CustomError
from slither.core.declarations.enum import Enum
from slither.core.declarations.solidity_import_placeholder import SolidityImportPlaceHolder
from slither.core.solidity_types import ElementaryType
from ... | 2,252 | Python | .py | 58 | 31.982759 | 97 | 0.67934 | NioTheFirst/ScType | 8 | 4 | 1 | AGPL-3.0 | 9/5/2024, 10:48:01 PM (Europe/Amsterdam) |
2,286,319 | operation.py | NioTheFirst_ScType/slither/slithir/operations/operation.py | import abc
from slither.core.context.context import Context
from slither.core.children.child_expression import ChildExpression
from slither.core.children.child_node import ChildNode
from slither.utils.utils import unroll
class AbstractOperation(abc.ABC):
@property
@abc.abstractmethod
def read(self):
... | 913 | Python | .py | 31 | 23.483871 | 72 | 0.684932 | NioTheFirst/ScType | 8 | 4 | 1 | AGPL-3.0 | 9/5/2024, 10:48:01 PM (Europe/Amsterdam) |
2,286,320 | phi_callback.py | NioTheFirst_ScType/slither/slithir/operations/phi_callback.py | from slither.slithir.utils.utils import is_valid_lvalue
from slither.slithir.operations.phi import Phi
class PhiCallback(Phi):
def __init__(self, left_variable, nodes, call_ir, rvalue):
assert is_valid_lvalue(left_variable)
assert isinstance(nodes, set)
super().__init__(left_variable, node... | 1,055 | Python | .py | 33 | 25.121212 | 100 | 0.632774 | NioTheFirst/ScType | 8 | 4 | 1 | AGPL-3.0 | 9/5/2024, 10:48:01 PM (Europe/Amsterdam) |
2,286,321 | library_call.py | NioTheFirst_ScType/slither/slithir/operations/library_call.py | from slither.core.declarations import Function
from slither.slithir.operations.high_level_call import HighLevelCall
from slither.core.declarations.contract import Contract
class LibraryCall(HighLevelCall):
"""
High level message call
"""
# Development function, to be removed once the code is stable
... | 1,771 | Python | .py | 48 | 27.770833 | 86 | 0.600466 | NioTheFirst/ScType | 8 | 4 | 1 | AGPL-3.0 | 9/5/2024, 10:48:01 PM (Europe/Amsterdam) |
2,286,322 | phi.py | NioTheFirst_ScType/slither/slithir/operations/phi.py | from slither.slithir.operations.lvalue import OperationWithLValue
from slither.slithir.utils.utils import is_valid_lvalue
class Phi(OperationWithLValue):
def __init__(self, left_variable, nodes):
# When Phi operations are created the
# correct indexes of the variables are not yet computed
... | 1,063 | Python | .py | 29 | 29.62069 | 96 | 0.655307 | NioTheFirst/ScType | 8 | 4 | 1 | AGPL-3.0 | 9/5/2024, 10:48:01 PM (Europe/Amsterdam) |
2,286,323 | transfer.py | NioTheFirst_ScType/slither/slithir/operations/transfer.py | from slither.slithir.operations.call import Call
from slither.core.variables.variable import Variable
from slither.core.declarations.solidity_variables import SolidityVariable
class Transfer(Call):
def __init__(self, destination, value):
assert isinstance(destination, (Variable, SolidityVariable))
... | 823 | Python | .py | 23 | 29.391304 | 73 | 0.688131 | NioTheFirst/ScType | 8 | 4 | 1 | AGPL-3.0 | 9/5/2024, 10:48:01 PM (Europe/Amsterdam) |
2,286,324 | nop.py | NioTheFirst_ScType/slither/slithir/operations/nop.py | from .operation import Operation
class Nop(Operation):
@property
def read(self):
return []
@property
def used(self):
return []
def __str__(self):
return "NOP"
| 207 | Python | .py | 10 | 14.9 | 32 | 0.590674 | NioTheFirst/ScType | 8 | 4 | 1 | AGPL-3.0 | 9/5/2024, 10:48:01 PM (Europe/Amsterdam) |
2,286,325 | event_call.py | NioTheFirst_ScType/slither/slithir/operations/event_call.py | from slither.slithir.operations.call import Call
class EventCall(Call):
def __init__(self, name):
super().__init__()
self._name = name
# todo add instance of the Event
@property
def name(self):
return self._name
@property
def read(self):
return self._unrol... | 463 | Python | .py | 15 | 24.2 | 52 | 0.600451 | NioTheFirst/ScType | 8 | 4 | 1 | AGPL-3.0 | 9/5/2024, 10:48:01 PM (Europe/Amsterdam) |
2,286,326 | condition.py | NioTheFirst_ScType/slither/slithir/operations/condition.py | from slither.slithir.operations.operation import Operation
from slither.slithir.utils.utils import is_valid_rvalue
class Condition(Operation):
"""
Condition
Only present as last operation in conditional node
"""
def __init__(self, value):
assert is_valid_rvalue(value)
super().__i... | 547 | Python | .py | 19 | 22.789474 | 58 | 0.654511 | NioTheFirst/ScType | 8 | 4 | 1 | AGPL-3.0 | 9/5/2024, 10:48:01 PM (Europe/Amsterdam) |
2,286,327 | init_array.py | NioTheFirst_ScType/slither/slithir/operations/init_array.py | from slither.slithir.operations.lvalue import OperationWithLValue
from slither.slithir.utils.utils import is_valid_rvalue
class InitArray(OperationWithLValue):
def __init__(self, init_values, lvalue):
# init_values can be an array of n dimension
# reduce was removed in py3
super().__init__... | 1,170 | Python | .py | 32 | 27.15625 | 68 | 0.596103 | NioTheFirst/ScType | 8 | 4 | 1 | AGPL-3.0 | 9/5/2024, 10:48:01 PM (Europe/Amsterdam) |
2,286,328 | type_conversion.py | NioTheFirst_ScType/slither/slithir/operations/type_conversion.py | from slither.core.declarations import Contract
from slither.core.solidity_types.type import Type
from slither.slithir.operations.lvalue import OperationWithLValue
from slither.slithir.utils.utils import is_valid_lvalue, is_valid_rvalue
class TypeConversion(OperationWithLValue):
def __init__(self, result, variable... | 925 | Python | .py | 24 | 32.25 | 78 | 0.697987 | NioTheFirst/ScType | 8 | 4 | 1 | AGPL-3.0 | 9/5/2024, 10:48:01 PM (Europe/Amsterdam) |
2,286,329 | delete.py | NioTheFirst_ScType/slither/slithir/operations/delete.py | from slither.slithir.operations.lvalue import OperationWithLValue
from slither.slithir.utils.utils import is_valid_lvalue
class Delete(OperationWithLValue):
"""
Delete has a lvalue, as it has for effect to change the value
of its operand
"""
def __init__(self, lvalue, variable):
assert i... | 653 | Python | .py | 20 | 26.5 | 65 | 0.664537 | NioTheFirst/ScType | 8 | 4 | 1 | AGPL-3.0 | 9/5/2024, 10:48:01 PM (Europe/Amsterdam) |
2,286,330 | codesize.py | NioTheFirst_ScType/slither/slithir/operations/codesize.py | from slither.core.solidity_types import ElementaryType
from slither.slithir.operations.lvalue import OperationWithLValue
from slither.slithir.utils.utils import is_valid_lvalue, is_valid_rvalue
class CodeSize(OperationWithLValue):
def __init__(self, value, lvalue):
super().__init__()
assert is_val... | 693 | Python | .py | 19 | 30.157895 | 72 | 0.681614 | NioTheFirst/ScType | 8 | 4 | 1 | AGPL-3.0 | 9/5/2024, 10:48:01 PM (Europe/Amsterdam) |
2,286,331 | return_operation.py | NioTheFirst_ScType/slither/slithir/operations/return_operation.py | from slither.core.declarations import Function
from slither.slithir.operations.operation import Operation
from slither.slithir.variables.tuple import TupleVariable
from slither.slithir.utils.utils import is_valid_rvalue
class Return(Operation):
"""
Return
Only present as last operation in RETURN node
... | 1,575 | Python | .py | 46 | 24.978261 | 89 | 0.581197 | NioTheFirst/ScType | 8 | 4 | 1 | AGPL-3.0 | 9/5/2024, 10:48:01 PM (Europe/Amsterdam) |
2,286,332 | __init__.py | NioTheFirst_ScType/slither/slithir/operations/__init__.py | from .assignment import Assignment
from .binary import Binary, BinaryType
from .call import Call
from .condition import Condition
from .delete import Delete
from .event_call import EventCall
from .high_level_call import HighLevelCall
from .index import Index
from .init_array import InitArray
from .internal_call import ... | 1,073 | Python | .py | 31 | 33.612903 | 54 | 0.858925 | NioTheFirst/ScType | 8 | 4 | 1 | AGPL-3.0 | 9/5/2024, 10:48:01 PM (Europe/Amsterdam) |
2,286,333 | send.py | NioTheFirst_ScType/slither/slithir/operations/send.py | from slither.core.declarations.solidity_variables import SolidityVariable
from slither.core.variables.variable import Variable
from slither.slithir.operations.call import Call
from slither.slithir.operations.lvalue import OperationWithLValue
from slither.slithir.utils.utils import is_valid_lvalue
class Send(Call, Ope... | 1,061 | Python | .py | 28 | 31.821429 | 76 | 0.705767 | NioTheFirst/ScType | 8 | 4 | 1 | AGPL-3.0 | 9/5/2024, 10:48:01 PM (Europe/Amsterdam) |
2,286,334 | length.py | NioTheFirst_ScType/slither/slithir/operations/length.py | from slither.core.solidity_types import ElementaryType
from slither.slithir.operations.lvalue import OperationWithLValue
from slither.slithir.utils.utils import is_valid_lvalue, is_valid_rvalue
class Length(OperationWithLValue):
def __init__(self, value, lvalue):
super().__init__()
assert is_valid... | 689 | Python | .py | 19 | 29.947368 | 72 | 0.679699 | NioTheFirst/ScType | 8 | 4 | 1 | AGPL-3.0 | 9/5/2024, 10:48:01 PM (Europe/Amsterdam) |
2,286,335 | new_structure.py | NioTheFirst_ScType/slither/slithir/operations/new_structure.py | from slither.slithir.operations.call import Call
from slither.slithir.operations.lvalue import OperationWithLValue
from slither.slithir.utils.utils import is_valid_lvalue
from slither.core.declarations.structure import Structure
class NewStructure(Call, OperationWithLValue):
def __init__(self, structure, lvalue... | 942 | Python | .py | 24 | 32.916667 | 77 | 0.698901 | NioTheFirst/ScType | 8 | 4 | 1 | AGPL-3.0 | 9/5/2024, 10:48:01 PM (Europe/Amsterdam) |
2,286,336 | new_array.py | NioTheFirst_ScType/slither/slithir/operations/new_array.py | from slither.slithir.operations.lvalue import OperationWithLValue
from slither.slithir.operations.call import Call
from slither.core.solidity_types.type import Type
class NewArray(Call, OperationWithLValue):
def __init__(self, depth, array_type, lvalue):
super().__init__()
assert isinstance(array_... | 809 | Python | .py | 22 | 30.363636 | 92 | 0.657692 | NioTheFirst/ScType | 8 | 4 | 1 | AGPL-3.0 | 9/5/2024, 10:48:01 PM (Europe/Amsterdam) |
2,286,337 | index.py | NioTheFirst_ScType/slither/slithir/operations/index.py | from slither.core.declarations import SolidityVariableComposed
from slither.slithir.operations.lvalue import OperationWithLValue
from slither.slithir.utils.utils import is_valid_lvalue, is_valid_rvalue
from slither.slithir.variables.reference import ReferenceVariable
class Index(OperationWithLValue):
def __init__... | 1,240 | Python | .py | 32 | 32.125 | 98 | 0.695 | NioTheFirst/ScType | 8 | 4 | 1 | AGPL-3.0 | 9/5/2024, 10:48:01 PM (Europe/Amsterdam) |
2,286,338 | assignment.py | NioTheFirst_ScType/slither/slithir/operations/assignment.py | import logging
from slither.core.declarations.function import Function
from slither.slithir.operations.lvalue import OperationWithLValue
from slither.slithir.utils.utils import is_valid_lvalue, is_valid_rvalue
from slither.slithir.variables import TupleVariable, ReferenceVariable
logger = logging.getLogger("Assignmen... | 1,538 | Python | .py | 36 | 35.472222 | 88 | 0.689216 | NioTheFirst/ScType | 8 | 4 | 1 | AGPL-3.0 | 9/5/2024, 10:48:01 PM (Europe/Amsterdam) |
2,286,339 | new_contract.py | NioTheFirst_ScType/slither/slithir/operations/new_contract.py | from slither.slithir.operations import Call, OperationWithLValue
from slither.slithir.utils.utils import is_valid_lvalue
from slither.slithir.variables.constant import Constant
class NewContract(Call, OperationWithLValue): # pylint: disable=too-many-instance-attributes
def __init__(self, contract_name, lvalue):
... | 3,065 | Python | .py | 79 | 31.21519 | 93 | 0.564983 | NioTheFirst/ScType | 8 | 4 | 1 | AGPL-3.0 | 9/5/2024, 10:48:01 PM (Europe/Amsterdam) |
2,286,340 | internal_dynamic_call.py | NioTheFirst_ScType/slither/slithir/operations/internal_dynamic_call.py | from slither.core.solidity_types import FunctionType
from slither.core.variables.variable import Variable
from slither.slithir.operations.call import Call
from slither.slithir.operations.lvalue import OperationWithLValue
from slither.slithir.utils.utils import is_valid_lvalue
class InternalDynamicCall(
Call, Oper... | 2,193 | Python | .py | 62 | 28.096774 | 86 | 0.626062 | NioTheFirst/ScType | 8 | 4 | 1 | AGPL-3.0 | 9/5/2024, 10:48:01 PM (Europe/Amsterdam) |
2,286,341 | new_elementary_type.py | NioTheFirst_ScType/slither/slithir/operations/new_elementary_type.py | from slither.core.solidity_types.elementary_type import ElementaryType
from slither.slithir.operations.call import Call
from slither.slithir.operations.lvalue import OperationWithLValue
from slither.slithir.utils.utils import is_valid_lvalue
class NewElementaryType(Call, OperationWithLValue):
def __init__(self, n... | 790 | Python | .py | 20 | 33.4 | 70 | 0.692408 | NioTheFirst/ScType | 8 | 4 | 1 | AGPL-3.0 | 9/5/2024, 10:48:01 PM (Europe/Amsterdam) |
2,286,342 | low_level_call.py | NioTheFirst_ScType/slither/slithir/operations/low_level_call.py | from slither.slithir.operations.call import Call
from slither.slithir.operations.lvalue import OperationWithLValue
from slither.core.variables.variable import Variable
from slither.core.declarations.solidity_variables import SolidityVariable
from slither.slithir.variables.constant import Constant
class LowLevelCall(... | 3,143 | Python | .py | 94 | 25.446809 | 94 | 0.611955 | NioTheFirst/ScType | 8 | 4 | 1 | AGPL-3.0 | 9/5/2024, 10:48:01 PM (Europe/Amsterdam) |
2,286,343 | call.py | NioTheFirst_ScType/slither/slithir/operations/call.py | from typing import Optional, List
from slither.slithir.operations.operation import Operation
class Call(Operation):
def __init__(self) -> None:
super().__init__()
self._arguments = []
@property
def arguments(self):
return self._arguments
@arguments.setter
def arguments(s... | 763 | Python | .py | 24 | 24.666667 | 100 | 0.613388 | NioTheFirst/ScType | 8 | 4 | 1 | AGPL-3.0 | 9/5/2024, 10:48:01 PM (Europe/Amsterdam) |
2,286,344 | lvalue.py | NioTheFirst_ScType/slither/slithir/operations/lvalue.py | from slither.slithir.operations.operation import Operation
class OperationWithLValue(Operation):
"""
Operation with a lvalue
"""
def __init__(self):
super().__init__()
self._lvalue = None
@property
def lvalue(self):
return self._lvalue
@property
def used(sel... | 445 | Python | .py | 17 | 20.058824 | 58 | 0.631829 | NioTheFirst/ScType | 8 | 4 | 1 | AGPL-3.0 | 9/5/2024, 10:48:01 PM (Europe/Amsterdam) |
2,286,345 | binary.py | NioTheFirst_ScType/slither/slithir/operations/binary.py | import logging
from enum import Enum
from slither.core.declarations import Function
from slither.core.solidity_types import ElementaryType
from slither.slithir.exceptions import SlithIRError
from slither.slithir.operations.lvalue import OperationWithLValue
from slither.slithir.utils.utils import is_valid_lvalue, is_va... | 6,166 | Python | .py | 172 | 26.761628 | 117 | 0.584268 | NioTheFirst/ScType | 8 | 4 | 1 | AGPL-3.0 | 9/5/2024, 10:48:01 PM (Europe/Amsterdam) |
2,286,346 | unpack.py | NioTheFirst_ScType/slither/slithir/operations/unpack.py | from slither.slithir.operations.lvalue import OperationWithLValue
from slither.slithir.utils.utils import is_valid_lvalue
from slither.slithir.variables.tuple import TupleVariable
class Unpack(OperationWithLValue):
def __init__(self, result, tuple_var, idx):
assert is_valid_lvalue(result)
assert i... | 810 | Python | .py | 23 | 28.73913 | 93 | 0.669654 | NioTheFirst/ScType | 8 | 4 | 1 | AGPL-3.0 | 9/5/2024, 10:48:01 PM (Europe/Amsterdam) |
2,286,347 | ssa.py | NioTheFirst_ScType/slither/slithir/utils/ssa.py | import logging
from slither.core.cfg.node import NodeType
from slither.core.declarations import (
Contract,
Enum,
Function,
SolidityFunction,
SolidityVariable,
Structure,
)
from slither.core.declarations.solidity_import_placeholder import SolidityImportPlaceHolder
from slither.core.solidity_typ... | 32,701 | Python | .py | 738 | 34.97561 | 113 | 0.590005 | NioTheFirst/ScType | 8 | 4 | 1 | AGPL-3.0 | 9/5/2024, 10:48:01 PM (Europe/Amsterdam) |
2,286,348 | utils.py | NioTheFirst_ScType/slither/slithir/utils/utils.py | from slither.core.variables.local_variable import LocalVariable
from slither.core.variables.state_variable import StateVariable
from slither.core.declarations.solidity_variables import SolidityVariable
from slither.core.variables.top_level_variable import TopLevelVariable
from slither.slithir.variables.temporary impo... | 1,036 | Python | .py | 32 | 24.6875 | 73 | 0.700401 | NioTheFirst/ScType | 8 | 4 | 1 | AGPL-3.0 | 9/5/2024, 10:48:01 PM (Europe/Amsterdam) |
2,286,349 | reference_ssa.py | NioTheFirst_ScType/slither/slithir/variables/reference_ssa.py | """
This class is used for the SSA version of slithIR
It is similar to the non-SSA version of slithIR
as the ReferenceVariable are in SSA form in both version
"""
from slither.slithir.variables.reference import ReferenceVariable
class ReferenceVariableSSA(ReferenceVariable): # pylint: disable=too-few-pub... | 551 | Python | .py | 13 | 37.384615 | 88 | 0.73221 | NioTheFirst/ScType | 8 | 4 | 1 | AGPL-3.0 | 9/5/2024, 10:48:01 PM (Europe/Amsterdam) |
2,286,350 | state_variable.py | NioTheFirst_ScType/slither/slithir/variables/state_variable.py | from slither.core.variables.state_variable import StateVariable
from slither.slithir.variables.variable import SlithIRVariable
class StateIRVariable(
StateVariable, SlithIRVariable
): # pylint: disable=too-many-instance-attributes
def __init__(self, state_variable):
assert isinstance(state_variable, ... | 1,327 | Python | .py | 35 | 30.428571 | 66 | 0.676034 | NioTheFirst/ScType | 8 | 4 | 1 | AGPL-3.0 | 9/5/2024, 10:48:01 PM (Europe/Amsterdam) |
2,286,351 | temporary.py | NioTheFirst_ScType/slither/slithir/variables/temporary.py | from typing import TYPE_CHECKING
from slither.core.children.child_node import ChildNode
from slither.core.variables.variable import Variable
if TYPE_CHECKING:
from slither.core.cfg.node import Node
class TemporaryVariable(ChildNode, Variable):
def __init__(self, node: "Node", index=None):
super().__... | 819 | Python | .py | 25 | 26 | 73 | 0.655216 | NioTheFirst/ScType | 8 | 4 | 1 | AGPL-3.0 | 9/5/2024, 10:48:01 PM (Europe/Amsterdam) |
2,286,352 | __init__.py | NioTheFirst_ScType/slither/slithir/variables/__init__.py | from .constant import Constant
from .reference import ReferenceVariable
from .reference_ssa import ReferenceVariableSSA
from .temporary import TemporaryVariable
from .temporary_ssa import TemporaryVariableSSA
from .tuple import TupleVariable
from .tuple_ssa import TupleVariableSSA
from .local_variable import LocalIRVar... | 370 | Python | .py | 9 | 40.111111 | 47 | 0.886427 | NioTheFirst/ScType | 8 | 4 | 1 | AGPL-3.0 | 9/5/2024, 10:48:01 PM (Europe/Amsterdam) |
2,286,353 | local_variable.py | NioTheFirst_ScType/slither/slithir/variables/local_variable.py | from slither.core.variables.local_variable import LocalVariable
from slither.slithir.variables.temporary import TemporaryVariable
from slither.slithir.variables.variable import SlithIRVariable
class LocalIRVariable(
LocalVariable, SlithIRVariable
): # pylint: disable=too-many-instance-attributes
def __init__... | 2,235 | Python | .py | 57 | 31.403509 | 87 | 0.661425 | NioTheFirst/ScType | 8 | 4 | 1 | AGPL-3.0 | 9/5/2024, 10:48:01 PM (Europe/Amsterdam) |
2,286,354 | temporary_ssa.py | NioTheFirst_ScType/slither/slithir/variables/temporary_ssa.py | """
This class is used for the SSA version of slithIR
It is similar to the non-SSA version of slithIR
as the TemporaryVariable are in SSA form in both version
"""
from slither.slithir.variables.temporary import TemporaryVariable
class TemporaryVariableSSA(TemporaryVariable): # pylint: disable=too-few-pub... | 551 | Python | .py | 13 | 37.384615 | 88 | 0.73221 | NioTheFirst/ScType | 8 | 4 | 1 | AGPL-3.0 | 9/5/2024, 10:48:01 PM (Europe/Amsterdam) |
2,286,355 | constant.py | NioTheFirst_ScType/slither/slithir/variables/constant.py | from functools import total_ordering
from slither.core.solidity_types.elementary_type import ElementaryType, Int, Uint
from slither.slithir.variables.variable import SlithIRVariable
from slither.utils.arithmetic import convert_subdenomination
from slither.utils.integer_conversion import convert_string_to_int
@total_... | 2,297 | Python | .py | 64 | 26.96875 | 81 | 0.594229 | NioTheFirst/ScType | 8 | 4 | 1 | AGPL-3.0 | 9/5/2024, 10:48:01 PM (Europe/Amsterdam) |
2,286,356 | reference.py | NioTheFirst_ScType/slither/slithir/variables/reference.py | from typing import TYPE_CHECKING
from slither.core.children.child_node import ChildNode
from slither.core.declarations import Contract, Enum, SolidityVariable, Function
from slither.core.variables.variable import Variable
if TYPE_CHECKING:
from slither.core.cfg.node import Node
class ReferenceVariable(ChildNode... | 2,002 | Python | .py | 58 | 26.931034 | 80 | 0.64456 | NioTheFirst/ScType | 8 | 4 | 1 | AGPL-3.0 | 9/5/2024, 10:48:01 PM (Europe/Amsterdam) |
2,286,357 | tuple_ssa.py | NioTheFirst_ScType/slither/slithir/variables/tuple_ssa.py | """
This class is used for the SSA version of slithIR
It is similar to the non-SSA version of slithIR
as the TupleVariable are in SSA form in both version
"""
from slither.slithir.variables.tuple import TupleVariable
class TupleVariableSSA(TupleVariable): # pylint: disable=too-few-public-methods
def ... | 499 | Python | .py | 13 | 33.384615 | 80 | 0.70332 | NioTheFirst/ScType | 8 | 4 | 1 | AGPL-3.0 | 9/5/2024, 10:48:01 PM (Europe/Amsterdam) |
2,286,358 | tuple.py | NioTheFirst_ScType/slither/slithir/variables/tuple.py | from typing import TYPE_CHECKING
from slither.core.children.child_node import ChildNode
from slither.slithir.variables.variable import SlithIRVariable
if TYPE_CHECKING:
from slither.core.cfg.node import Node
class TupleVariable(ChildNode, SlithIRVariable):
def __init__(self, node: "Node", index=None):
... | 827 | Python | .py | 25 | 26.28 | 69 | 0.65826 | NioTheFirst/ScType | 8 | 4 | 1 | AGPL-3.0 | 9/5/2024, 10:48:01 PM (Europe/Amsterdam) |
2,286,359 | variable.py | NioTheFirst_ScType/slither/slithir/variables/variable.py | from slither.core.variables.variable import Variable
class SlithIRVariable(Variable):
token_type = -1;
def __init__(self):
super().__init__()
self._index = 0
@property
def ssa_name(self):
return self.name
def __str__(self):
return self.ssa_name
def set_token_... | 352 | Python | .py | 13 | 20.769231 | 52 | 0.607784 | NioTheFirst/ScType | 8 | 4 | 1 | AGPL-3.0 | 9/5/2024, 10:48:01 PM (Europe/Amsterdam) |
2,286,360 | tracepicture.py | jianhuxwx_invisomark/tracepicture.py | import requests
def fetch_google_lens_page_token(api_key, image_url, language=None, country=None, no_cache=None, async_param=None):
"""
Fetches the page token for Google Lens Image Sources API using SerpApi.
:param api_key: Your SerpApi private key.
:param image_url: URL of the image to perform the Go... | 2,350 | Python | .py | 51 | 40.823529 | 144 | 0.697288 | jianhuxwx/invisomark | 8 | 0 | 0 | GPL-3.0 | 9/5/2024, 10:48:01 PM (Europe/Amsterdam) |
2,286,361 | ipfs.py | jianhuxwx_invisomark/ipfs.py | import requests
import json
def upload_to_ipfs(file_path):
url = "https://api.nft.storage/upload"
headers = {
"Authorization": f"Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJkaWQ6ZXRocjoweDljNzAyNDM4NjQ4MTg0NERCN2FkQzdEMDhjNzYyRjY1NEFEOWY5NGQiLCJpc3MiOiJuZnQtc3RvcmFnZSIsImlhdCI6MTY5OTkzODUyNT... | 1,133 | Python | .py | 19 | 52.578947 | 269 | 0.803387 | jianhuxwx/invisomark | 8 | 0 | 0 | GPL-3.0 | 9/5/2024, 10:48:01 PM (Europe/Amsterdam) |
2,286,362 | basic_watermark.py | jianhuxwx_invisomark/basic_watermark.py | from PIL import Image, ImageDraw, ImageFont
def add_watermark(input_image_path, output_image_path, watermark_text):
# 打开图片
image = Image.open(input_image_path)
width, height = image.size
# 创建一个可以在图片上绘图的对象
draw = ImageDraw.Draw(image)
# 设置较大的字体
font = ImageFont.truetype("arial.ttf", 36) #... | 1,148 | Python | .py | 24 | 35.416667 | 138 | 0.67957 | jianhuxwx/invisomark | 8 | 0 | 0 | GPL-3.0 | 9/5/2024, 10:48:01 PM (Europe/Amsterdam) |
2,286,363 | blind.py | jianhuxwx_invisomark/blind.py | from blind_watermark import WaterMark
def embed_watermark(original_image_path, watermark_content, output_image_path):
bwm = WaterMark(password_img=1, password_wm=1)
bwm.read_img(original_image_path)
bwm.read_wm(watermark_content, mode='str')
bwm.embed(output_image_path)
len_wm = len(bwm.wm_bit)
... | 916 | Python | .py | 20 | 41.2 | 118 | 0.735023 | jianhuxwx/invisomark | 8 | 0 | 0 | GPL-3.0 | 9/5/2024, 10:48:01 PM (Europe/Amsterdam) |
2,286,364 | blur.py | jianhuxwx_invisomark/blur.py | from PIL import Image, ImageFilter
def blur_image(input_image_path, output_image_path, blur_amount):
# 打开图片
image = Image.open(input_image_path)
# 应用模糊效果
blurred_image = image.filter(ImageFilter.GaussianBlur(blur_amount))
# 保存模糊后的图片
blurred_image.save(output_image_path)
# 使用示例
#blur_image('/... | 476 | Python | .py | 10 | 39.4 | 125 | 0.751196 | jianhuxwx/invisomark | 8 | 0 | 0 | GPL-3.0 | 9/5/2024, 10:48:01 PM (Europe/Amsterdam) |
2,286,365 | line.py | jianhuxwx_invisomark/line.py | import cv2
import numpy as np
from PIL import Image, ImageDraw, ImageFont
def extract_edges(image_path):
# 读取图片并转换为灰度图
image = cv2.imread(image_path, cv2.IMREAD_COLOR) # 确保图像始终为彩色图像
if image is None:
raise ValueError("无法加载图像,请检查路径和文件格式。")
gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
# 使... | 2,144 | Python | .py | 43 | 38.534884 | 169 | 0.626757 | jianhuxwx/invisomark | 8 | 0 | 0 | GPL-3.0 | 9/5/2024, 10:48:01 PM (Europe/Amsterdam) |
2,286,366 | metadata.py | jianhuxwx_invisomark/metadata.py | from PIL import Image
from PIL.ExifTags import TAGS
def get_reversed_tags():
return {value: key for key, value in TAGS.items()}
def add_metadata(image_path, metadata):
image = Image.open(image_path)
exif_data = image.getexif()
reversed_tags = get_reversed_tags()
for tag, value in metadata.items()... | 914 | Python | .py | 22 | 36.681818 | 117 | 0.708189 | jianhuxwx/invisomark | 8 | 0 | 0 | GPL-3.0 | 9/5/2024, 10:48:01 PM (Europe/Amsterdam) |
2,286,367 | full_watermark.py | jianhuxwx_invisomark/full_watermark.py | from PIL import Image, ImageDraw, ImageFont
def estimate_text_size(text, font_size):
"""估算文本尺寸的简化方法。"""
average_char_width = font_size * 0.6 # 假设每个字符的平均宽度
text_width = int(average_char_width * len(text))
text_height = font_size
return text_width, text_height
def add_watermark(input_image_path, ou... | 1,446 | Python | .py | 28 | 40.392857 | 140 | 0.698785 | jianhuxwx/invisomark | 8 | 0 | 0 | GPL-3.0 | 9/5/2024, 10:48:01 PM (Europe/Amsterdam) |
2,286,368 | signature.py | jianhuxwx_invisomark/signature.py | import hashlib
from cryptography.fernet import Fernet
import base64
import sys
def compute_hash(file_path):
hasher = hashlib.sha256()
with open(file_path, 'rb') as file:
buf = file.read()
hasher.update(buf)
return hasher.digest()
def encrypt_hash(hash_value, key):
fernet = Fernet(key)
... | 1,892 | Python | .py | 44 | 37.636364 | 129 | 0.731941 | jianhuxwx/invisomark | 8 | 0 | 0 | GPL-3.0 | 9/5/2024, 10:48:01 PM (Europe/Amsterdam) |
2,286,369 | main.py | jianhuxwx_invisomark/main.py | '''
<INVISOMARK - Greatest Watermark Software>
Copyright (C) <2023> <YuexuChen>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the Licens... | 20,299 | Python | .py | 397 | 42.670025 | 145 | 0.712808 | jianhuxwx/invisomark | 8 | 0 | 0 | GPL-3.0 | 9/5/2024, 10:48:01 PM (Europe/Amsterdam) |
2,286,370 | main_en.py | jianhuxwx_invisomark/main_en.py | '''
<INVISOMARK - Greatest Watermark Software>
Copyright (C) <2023> <YuexuChen>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the Licens... | 20,853 | Python | .py | 397 | 46.080605 | 234 | 0.714865 | jianhuxwx/invisomark | 8 | 0 | 0 | GPL-3.0 | 9/5/2024, 10:48:01 PM (Europe/Amsterdam) |
2,286,371 | _copySymbols.js | gmkung_Cheemera/node_modules/lodash/_copySymbols.js | var copyObject = require('./_copyObject'),
getSymbols = require('./_getSymbols');
/**
* Copies own symbols of `source` to `object`.
*
* @private
* @param {Object} source The object to copy symbols from.
* @param {Object} [object={}] The object to copy symbols to.
* @returns {Object} Returns `object`.
*/
fun... | 446 | Python | .py | 14 | 29.785714 | 61 | 0.709302 | gmkung/Cheemera | 8 | 1 | 1 | AGPL-3.0 | 9/5/2024, 10:48:01 PM (Europe/Amsterdam) |
2,286,372 | _copyArray.js | gmkung_Cheemera/node_modules/lodash/_copyArray.js | /**
* Copies the values of `source` to `array`.
*
* @private
* @param {Array} source The array to copy values from.
* @param {Array} [array=[]] The array to copy values to.
* @returns {Array} Returns `array`.
*/
function copyArray(source, array) {
var index = -1,
length = source.length;
array || (arra... | 454 | Python | .py | 18 | 22.611111 | 57 | 0.654378 | gmkung/Cheemera | 8 | 1 | 1 | AGPL-3.0 | 9/5/2024, 10:48:01 PM (Europe/Amsterdam) |
2,286,373 | _copySymbolsIn.js | gmkung_Cheemera/node_modules/lodash/_copySymbolsIn.js | var copyObject = require('./_copyObject'),
getSymbolsIn = require('./_getSymbolsIn');
/**
* Copies own and inherited symbols of `source` to `object`.
*
* @private
* @param {Object} source The object to copy symbols from.
* @param {Object} [object={}] The object to copy symbols to.
* @returns {Object} Returns... | 470 | Python | .py | 14 | 31.5 | 61 | 0.720264 | gmkung/Cheemera | 8 | 1 | 1 | AGPL-3.0 | 9/5/2024, 10:48:01 PM (Europe/Amsterdam) |
2,286,374 | _copyObject.js | gmkung_Cheemera/node_modules/lodash/_copyObject.js | var assignValue = require('./_assignValue'),
baseAssignValue = require('./_baseAssignValue');
/**
* Copies properties of `source` to `object`.
*
* @private
* @param {Object} source The object to copy properties from.
* @param {Array} props The property identifiers to copy.
* @param {Object} [object={}] The o... | 1,044 | Python | .py | 34 | 26.911765 | 74 | 0.665339 | gmkung/Cheemera | 8 | 1 | 1 | AGPL-3.0 | 9/5/2024, 10:48:01 PM (Europe/Amsterdam) |
2,286,375 | test.py | gmkung_Cheemera/python/test.py | import json
from typing import NamedTuple, List
from Cheemera import *
# Function to create Property instances
def create_property(data):
return Property(valence=data['valence'], sentence=data['sentence'])
# Function to create Consequence instances
def create_consequence(data):
return Consequence(modal=data[... | 4,882 | Python | .py | 177 | 17.135593 | 104 | 0.471353 | gmkung/Cheemera | 8 | 1 | 1 | AGPL-3.0 | 9/5/2024, 10:48:01 PM (Europe/Amsterdam) |
2,286,376 | Cheemera.py | gmkung_Cheemera/python/Cheemera.py | from typing import NamedTuple, List, Optional, Any, Dict,Set
import json
import hashlib
def explore_belief_set(request_body: Dict[str, Any]):
try:
explore = request_body['explore']
belief_set = request_body['beliefSet']
# Normalise to 'LET' scenarios
normalised_belief_set = normali... | 8,716 | Python | .py | 176 | 39.744318 | 128 | 0.673457 | gmkung/Cheemera | 8 | 1 | 1 | AGPL-3.0 | 9/5/2024, 10:48:01 PM (Europe/Amsterdam) |
2,286,377 | Cheemera.cpython-39.pyc | gmkung_Cheemera/python/__pycache__/Cheemera.cpython-39.pyc | a
ÕT„e
" ã @ sò d dl mZmZmZmZmZmZ d dlZd dlZee ef dœdd„Z
G dd„ deƒZG dd „ d eƒZG d
d„ deƒZ
G dd
„ d
eƒZG dd„ deƒZG dd„ deƒZG dd„ deƒZG dd„ deƒZG dd„ deƒZee ee dœdd„Zeee edœdd„Zeee ee ... | 8,964 | Python | .py | 56 | 159.053571 | 1,089 | 0.405545 | gmkung/Cheemera | 8 | 1 | 1 | AGPL-3.0 | 9/5/2024, 10:48:01 PM (Europe/Amsterdam) |
2,286,378 | Cheemera.cpython-39.pyc | gmkung_Cheemera/python/__pycache__/Cheemera.cpython-39.pyc | a
ÕT„e
" ã @ sò d dl mZmZmZmZmZmZ d dlZd dlZee ef dœdd„Z
G dd„ deƒZG dd „ d eƒZG d
d„ deƒZ
G dd
„ d
eƒZG dd„ deƒZG dd„ deƒZG dd„ deƒZG dd„ deƒZG dd„ deƒZee ee dœdd„Zeee edœdd„Zeee ee ... | 8,964 | Python | .pyt | 56 | 159.053571 | 1,089 | 0.405545 | gmkung/Cheemera | 8 | 1 | 1 | AGPL-3.0 | 9/5/2024, 10:48:01 PM (Europe/Amsterdam) |
2,286,379 | _stackHas.js | gmkung_Cheemera/node_modules/lodash/_stackHas.js | /**
* Checks if a stack value for `key` exists.
*
* @private
* @name has
* @memberOf Stack
* @param {string} key The key of the entry to check.
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
*/
function stackHas(key) {
return this.__data__.has(key);
}
module.exports = stackHa... | 323 | Python | .tac | 13 | 23 | 80 | 0.679612 | gmkung/Cheemera | 8 | 1 | 1 | AGPL-3.0 | 9/5/2024, 10:48:01 PM (Europe/Amsterdam) |
2,286,380 | _stackSet.js | gmkung_Cheemera/node_modules/lodash/_stackSet.js | var ListCache = require('./_ListCache'),
Map = require('./_Map'),
MapCache = require('./_MapCache');
/** Used as the size to enable large array optimizations. */
var LARGE_ARRAY_SIZE = 200;
/**
* Sets the stack `key` to `value`.
*
* @private
* @name set
* @memberOf Stack
* @param {string} key The key of... | 853 | Python | .tac | 31 | 24.387097 | 60 | 0.634921 | gmkung/Cheemera | 8 | 1 | 1 | AGPL-3.0 | 9/5/2024, 10:48:01 PM (Europe/Amsterdam) |
2,286,381 | _stackClear.js | gmkung_Cheemera/node_modules/lodash/_stackClear.js | var ListCache = require('./_ListCache');
/**
* Removes all key-value entries from the stack.
*
* @private
* @name clear
* @memberOf Stack
*/
function stackClear() {
this.__data__ = new ListCache;
this.size = 0;
}
module.exports = stackClear;
| 254 | Python | .tac | 13 | 17.615385 | 48 | 0.686192 | gmkung/Cheemera | 8 | 1 | 1 | AGPL-3.0 | 9/5/2024, 10:48:01 PM (Europe/Amsterdam) |
2,286,382 | _stackGet.js | gmkung_Cheemera/node_modules/lodash/_stackGet.js | /**
* Gets the stack value for `key`.
*
* @private
* @name get
* @memberOf Stack
* @param {string} key The key of the value to get.
* @returns {*} Returns the entry value.
*/
function stackGet(key) {
return this.__data__.get(key);
}
module.exports = stackGet;
| 271 | Python | .tac | 13 | 19 | 51 | 0.669261 | gmkung/Cheemera | 8 | 1 | 1 | AGPL-3.0 | 9/5/2024, 10:48:01 PM (Europe/Amsterdam) |
2,286,383 | _stackDelete.js | gmkung_Cheemera/node_modules/lodash/_stackDelete.js | /**
* Removes `key` and its value from the stack.
*
* @private
* @name delete
* @memberOf Stack
* @param {string} key The key of the value to remove.
* @returns {boolean} Returns `true` if the entry was removed, else `false`.
*/
function stackDelete(key) {
var data = this.__data__,
result = data['delete... | 405 | Python | .tac | 16 | 22.9375 | 76 | 0.679587 | gmkung/Cheemera | 8 | 1 | 1 | AGPL-3.0 | 9/5/2024, 10:48:01 PM (Europe/Amsterdam) |
2,286,384 | _Stack.js | gmkung_Cheemera/node_modules/lodash/_Stack.js | var ListCache = require('./_ListCache'),
stackClear = require('./_stackClear'),
stackDelete = require('./_stackDelete'),
stackGet = require('./_stackGet'),
stackHas = require('./_stackHas'),
stackSet = require('./_stackSet');
/**
* Creates a stack cache object to store key-value pairs.
*
* @priv... | 734 | Python | .tac | 24 | 28.208333 | 57 | 0.700141 | gmkung/Cheemera | 8 | 1 | 1 | AGPL-3.0 | 9/5/2024, 10:48:01 PM (Europe/Amsterdam) |
2,286,385 | ocr.py | yousefmrashad_bookipedia/preprocessing/ocr.py | # Utils
from root_config import *
from utils.init import *
from utils.hocr import HocrTransform
# ===================================================================== #
# OCR
class OCR:
def __init__(self, doc_path: str, scale=5):
self.doc_path = doc_path
self.scale = scale
f... | 5,121 | Python | .py | 98 | 41.193878 | 102 | 0.558872 | yousefmrashad/bookipedia | 8 | 2 | 0 | GPL-3.0 | 9/5/2024, 10:48:01 PM (Europe/Amsterdam) |
2,286,386 | embedding.py | yousefmrashad_bookipedia/preprocessing/embedding.py | # Utils
from root_config import *
from utils.init import *
# ===================================================================== #
# HFEmbedding Model
class HFEmbedding(Embeddings):
def __init__(self, model_name=EMBEDDING_MODEL_NAME,
prompt=RETRIEVAL_PROMPT):
self.model = Sentenc... | 744 | Python | .py | 16 | 40 | 84 | 0.533887 | yousefmrashad/bookipedia | 8 | 2 | 0 | GPL-3.0 | 9/5/2024, 10:48:01 PM (Europe/Amsterdam) |
2,286,387 | root_config.py | yousefmrashad_bookipedia/preprocessing/root_config.py | # -- Setup directory for utils package -- #
import sys, os
root_path = os.path.dirname(os.path.dirname(__file__))
sys.path.append(root_path)
# =================================================== # | 200 | Python | .py | 5 | 38.4 | 55 | 0.505102 | yousefmrashad/bookipedia | 8 | 2 | 0 | GPL-3.0 | 9/5/2024, 10:48:01 PM (Europe/Amsterdam) |
2,286,388 | document.py | yousefmrashad_bookipedia/preprocessing/document.py | # Utils
from root_config import *
from utils.init import *
# ===================================================================== #
class Document:
def __init__(self, doc_path: str, doc_id: str, lib_doc:bool = False):
self.doc_path = doc_path
self.doc_id = doc_id
self.doc = fitz.o... | 3,742 | Python | .py | 71 | 37.028169 | 116 | 0.46984 | yousefmrashad/bookipedia | 8 | 2 | 0 | GPL-3.0 | 9/5/2024, 10:48:01 PM (Europe/Amsterdam) |
2,286,389 | weaviate_retriever.py | yousefmrashad_bookipedia/rag/weaviate_retriever.py | # Utils
from root_config import *
from utils.init import *
# ================================================== #
class Weaviate(VectorStore):
def __init__(self, client: WeaviateClient, embedder: Embeddings) -> None:
self.client = client
self.embedder = embedder
self.collection = s... | 8,416 | Python | .py | 146 | 44.410959 | 141 | 0.528524 | yousefmrashad/bookipedia | 8 | 2 | 0 | GPL-3.0 | 9/5/2024, 10:48:01 PM (Europe/Amsterdam) |
2,286,390 | web_weaviate.py | yousefmrashad_bookipedia/rag/web_weaviate.py | # Utils
from root_config import *
from utils.init import *
# ===================================================================== #
class WebWeaviate(VectorStore):
def __init__(self, client: WeaviateClient, embedder: Embeddings) -> None:
self.client = client
self.embedder = embedder
self.c... | 2,331 | Python | .py | 47 | 40.12766 | 98 | 0.529884 | yousefmrashad/bookipedia | 8 | 2 | 0 | GPL-3.0 | 9/5/2024, 10:48:01 PM (Europe/Amsterdam) |
2,286,391 | rag_pipeline.py | yousefmrashad_bookipedia/rag/rag_pipeline.py | # Utils
from root_config import *
from utils.init import *
from rag.web_weaviate import WebWeaviate
from rag.web_researcher import WebResearchRetriever
from rag.weaviate_retriever import Weaviate
# ===================================================================== #
class RAGPipeline:
def __init__(self, embedd... | 11,021 | Python | .py | 166 | 54.771084 | 272 | 0.602599 | yousefmrashad/bookipedia | 8 | 2 | 0 | GPL-3.0 | 9/5/2024, 10:48:01 PM (Europe/Amsterdam) |
2,286,392 | root_config.py | yousefmrashad_bookipedia/rag/root_config.py | # -- Setup directory for utils package -- #
import sys, os
root_path = os.path.dirname(os.path.dirname(__file__))
sys.path.append(root_path)
# =================================================== # | 200 | Python | .py | 5 | 38.4 | 55 | 0.505102 | yousefmrashad/bookipedia | 8 | 2 | 0 | GPL-3.0 | 9/5/2024, 10:48:01 PM (Europe/Amsterdam) |
2,286,393 | web_researcher.py | yousefmrashad_bookipedia/rag/web_researcher.py | import logging
import re
from typing import List, Optional
from langchain_community.utilities.duckduckgo_search import DuckDuckGoSearchAPIWrapper
from langchain_community.document_loaders.async_html import AsyncHtmlLoader
from langchain_community.document_transformers import Html2TextTransformer
from langchain_communi... | 8,352 | Python | .py | 190 | 35.473684 | 96 | 0.664247 | yousefmrashad/bookipedia | 8 | 2 | 0 | GPL-3.0 | 9/5/2024, 10:48:01 PM (Europe/Amsterdam) |
2,286,394 | config.py | yousefmrashad_bookipedia/utils/config.py | # Using PyTorch
import os
os.environ["USE_TORCH"] = "1"
# --------------------------------------------------------------------- #
# -- Modules -- #
# Basics
import torch
import re, json, math, requests, asyncio
from collections import Counter
import math
import logging
# Image Preprocessing
import num... | 4,087 | Python | .py | 110 | 32.009091 | 88 | 0.656409 | yousefmrashad/bookipedia | 8 | 2 | 0 | GPL-3.0 | 9/5/2024, 10:48:01 PM (Europe/Amsterdam) |
2,286,395 | root_config.py | yousefmrashad_bookipedia/utils/root_config.py | # -- Setup directory for utils package -- #
import sys, os
root_path = os.path.dirname(os.path.dirname(__file__))
sys.path.append(root_path)
# =================================================== # | 200 | Python | .py | 5 | 38.4 | 55 | 0.505102 | yousefmrashad/bookipedia | 8 | 2 | 0 | GPL-3.0 | 9/5/2024, 10:48:01 PM (Europe/Amsterdam) |
2,286,396 | font.py | yousefmrashad_bookipedia/utils/font.py | # SPDX-FileCopyrightText: 2023 James R. Barlow
# SPDX-License-Identifier: MPL-2.0
from __future__ import annotations
import logging
import unicodedata
import zlib
import os
from pikepdf import (
Dictionary,
Name,
Pdf,
)
from pikepdf.canvas import Font
log = logging.getLogger(__name__)
... | 4,754 | Python | .py | 125 | 26.256 | 89 | 0.55587 | yousefmrashad/bookipedia | 8 | 2 | 0 | GPL-3.0 | 9/5/2024, 10:48:01 PM (Europe/Amsterdam) |
2,286,397 | functions.py | yousefmrashad_bookipedia/utils/functions.py | # Config
from root_config import *
from utils.config import *
# ===================================================================== #
# -- Helpers -- #
# OCR
def map_values(img, in_min, in_max, out_min, out_max):
return (img - in_min) * ((out_max - out_min) / (in_max - in_min)) + out_min
# -----------... | 3,035 | Python | .py | 72 | 34.597222 | 87 | 0.487989 | yousefmrashad/bookipedia | 8 | 2 | 0 | GPL-3.0 | 9/5/2024, 10:48:01 PM (Europe/Amsterdam) |
2,286,398 | db_config.py | yousefmrashad_bookipedia/utils/db_config.py | # Config
from root_config import *
from utils.config import *
# ================================================== #
class DB:
def __init__(self):
self.client = weaviate.connect_to_local()
def connect(self):
if not (self.client.collections.exists(DB_NAME)):
self.create()... | 1,506 | Python | .py | 24 | 51.083333 | 165 | 0.619738 | yousefmrashad/bookipedia | 8 | 2 | 0 | GPL-3.0 | 9/5/2024, 10:48:01 PM (Europe/Amsterdam) |
2,286,399 | hocr.py | yousefmrashad_bookipedia/utils/hocr.py | # SPDX-FileCopyrightText: 2010 Jonathan Brinley
# SPDX-FileCopyrightText: 2013-2014 Julien Pfefferkorn
# SPDX-FileCopyrightText: 2023 James R. Barlow
# SPDX-License-Identifier: MIT
"""hOCR transform implementation."""
from __future__ import annotations
import logging
import os
import re
import unicodedat... | 18,360 | Python | .py | 439 | 29.904328 | 87 | 0.559555 | yousefmrashad/bookipedia | 8 | 2 | 0 | GPL-3.0 | 9/5/2024, 10:48:01 PM (Europe/Amsterdam) |