diff --git a/.gitignore b/.gitignore index eacdca2..8c20825 100644 --- a/.gitignore +++ b/.gitignore @@ -34,4 +34,3 @@ __pycache__ /.php-cs-fixer.cache /.phpunit.cache config.h.in~ -/lib/ diff --git a/examples/lib.php b/examples/lib.php new file mode 100644 index 0000000..d160fb8 --- /dev/null +++ b/examples/lib.php @@ -0,0 +1,5 @@ +AST; + self::$Add = self::$__module->Add; + self::$And = self::$__module->And; + self::$AnnAssign = self::$__module->AnnAssign; + self::$Assert = self::$__module->Assert; + self::$Assign = self::$__module->Assign; + self::$AsyncFor = self::$__module->AsyncFor; + self::$AsyncFunctionDef = self::$__module->AsyncFunctionDef; + self::$AsyncWith = self::$__module->AsyncWith; + self::$Attribute = self::$__module->Attribute; + self::$AugAssign = self::$__module->AugAssign; + self::$AugLoad = self::$__module->AugLoad; + self::$AugStore = self::$__module->AugStore; + self::$Await = self::$__module->Await; + self::$BinOp = self::$__module->BinOp; + self::$BitAnd = self::$__module->BitAnd; + self::$BitOr = self::$__module->BitOr; + self::$BitXor = self::$__module->BitXor; + self::$BoolOp = self::$__module->BoolOp; + self::$Break = self::$__module->Break; + self::$Bytes = self::$__module->Bytes; + self::$Call = self::$__module->Call; + self::$ClassDef = self::$__module->ClassDef; + self::$Compare = self::$__module->Compare; + self::$Constant = self::$__module->Constant; + self::$Continue = self::$__module->Continue; + self::$Del = self::$__module->Del; + self::$Delete = self::$__module->Delete; + self::$Dict = self::$__module->Dict; + self::$DictComp = self::$__module->DictComp; + self::$Div = self::$__module->Div; + self::$Ellipsis = self::$__module->Ellipsis; + self::$Eq = self::$__module->Eq; + self::$ExceptHandler = self::$__module->ExceptHandler; + self::$Expr = self::$__module->Expr; + self::$Expression = self::$__module->Expression; + self::$ExtSlice = self::$__module->ExtSlice; + self::$FloorDiv = self::$__module->FloorDiv; + self::$For = self::$__module->For; + self::$FormattedValue = self::$__module->FormattedValue; + self::$FunctionDef = self::$__module->FunctionDef; + self::$FunctionType = self::$__module->FunctionType; + self::$GeneratorExp = self::$__module->GeneratorExp; + self::$Global = self::$__module->Global; + self::$Gt = self::$__module->Gt; + self::$GtE = self::$__module->GtE; + self::$If = self::$__module->If; + self::$IfExp = self::$__module->IfExp; + self::$Import = self::$__module->Import; + self::$ImportFrom = self::$__module->ImportFrom; + self::$In = self::$__module->In; + self::$Index = self::$__module->Index; + self::$IntEnum = self::$__module->IntEnum; + self::$Interactive = self::$__module->Interactive; + self::$Invert = self::$__module->Invert; + self::$Is = self::$__module->Is; + self::$IsNot = self::$__module->IsNot; + self::$JoinedStr = self::$__module->JoinedStr; + self::$LShift = self::$__module->LShift; + self::$Lambda = self::$__module->Lambda; + self::$List = self::$__module->List; + self::$ListComp = self::$__module->ListComp; + self::$Load = self::$__module->Load; + self::$Lt = self::$__module->Lt; + self::$LtE = self::$__module->LtE; + self::$MatMult = self::$__module->MatMult; + self::$Match = self::$__module->Match; + self::$MatchAs = self::$__module->MatchAs; + self::$MatchClass = self::$__module->MatchClass; + self::$MatchMapping = self::$__module->MatchMapping; + self::$MatchOr = self::$__module->MatchOr; + self::$MatchSequence = self::$__module->MatchSequence; + self::$MatchSingleton = self::$__module->MatchSingleton; + self::$MatchStar = self::$__module->MatchStar; + self::$MatchValue = self::$__module->MatchValue; + self::$Mod = self::$__module->Mod; + self::$Module = self::$__module->Module; + self::$Mult = self::$__module->Mult; + self::$Name = self::$__module->Name; + self::$NameConstant = self::$__module->NameConstant; + self::$NamedExpr = self::$__module->NamedExpr; + self::$NodeTransformer = self::$__module->NodeTransformer; + self::$NodeVisitor = self::$__module->NodeVisitor; + self::$Nonlocal = self::$__module->Nonlocal; + self::$Not = self::$__module->Not; + self::$NotEq = self::$__module->NotEq; + self::$NotIn = self::$__module->NotIn; + self::$Num = self::$__module->Num; + self::$Or = self::$__module->Or; + self::$Param = self::$__module->Param; + self::$Pass = self::$__module->Pass; + self::$Pow = self::$__module->Pow; + self::$RShift = self::$__module->RShift; + self::$Raise = self::$__module->Raise; + self::$Return = self::$__module->Return; + self::$Set = self::$__module->Set; + self::$SetComp = self::$__module->SetComp; + self::$Slice = self::$__module->Slice; + self::$Starred = self::$__module->Starred; + self::$Store = self::$__module->Store; + self::$Str = self::$__module->Str; + self::$Sub = self::$__module->Sub; + self::$Subscript = self::$__module->Subscript; + self::$Suite = self::$__module->Suite; + self::$Try = self::$__module->Try; + self::$TryStar = self::$__module->TryStar; + self::$Tuple = self::$__module->Tuple; + self::$TypeIgnore = self::$__module->TypeIgnore; + self::$UAdd = self::$__module->UAdd; + self::$USub = self::$__module->USub; + self::$UnaryOp = self::$__module->UnaryOp; + self::$While = self::$__module->While; + self::$With = self::$__module->With; + self::$Yield = self::$__module->Yield; + self::$YieldFrom = self::$__module->YieldFrom; + self::$_ABC = self::$__module->_ABC; + self::$_ALL_QUOTES = self::$__module->_ALL_QUOTES; + self::$_MULTI_QUOTES = self::$__module->_MULTI_QUOTES; + self::$_Precedence = self::$__module->_Precedence; + self::$_SINGLE_QUOTES = self::$__module->_SINGLE_QUOTES; + self::$_Unparser = self::$__module->_Unparser; + self::$__spec__ = self::$__module->__spec__; + self::$_const_node_type_names = self::$__module->_const_node_type_names; + self::$_const_types = self::$__module->_const_types; + self::$_const_types_not = self::$__module->_const_types_not; + self::$alias = self::$__module->alias; + self::$arg = self::$__module->arg; + self::$arguments = self::$__module->arguments; + self::$auto = self::$__module->auto; + self::$boolop = self::$__module->boolop; + self::$cmpop = self::$__module->cmpop; + self::$comprehension = self::$__module->comprehension; + self::$excepthandler = self::$__module->excepthandler; + self::$expr = self::$__module->expr; + self::$expr_context = self::$__module->expr_context; + self::$keyword = self::$__module->keyword; + self::$match_case = self::$__module->match_case; + self::$mod = self::$__module->mod; + self::$nullcontext = self::$__module->nullcontext; + self::$operator = self::$__module->operator; + self::$pattern = self::$__module->pattern; + self::$slice = self::$__module->slice; + self::$stmt = self::$__module->stmt; + self::$sys = self::$__module->sys; + self::$type_ignore = self::$__module->type_ignore; + self::$unaryop = self::$__module->unaryop; + self::$withitem = self::$__module->withitem; + } + } + + public const PyCF_ALLOW_TOP_LEVEL_AWAIT = 8192; + public const PyCF_ONLY_AST = 1024; + public const PyCF_TYPE_COMMENTS = 4096; + + public static $_INFSTR = "1e309"; + public static $__cached__ = "/opt/anaconda3/lib/python3.11/__pycache__/ast.cpython-311.pyc"; + public static $__file__ = "/opt/anaconda3/lib/python3.11/ast.py"; + public static $__name__ = "ast"; + public static $__package__ = ""; + + public static $AST = null; + public static $Add = null; + public static $And = null; + public static $AnnAssign = null; + public static $Assert = null; + public static $Assign = null; + public static $AsyncFor = null; + public static $AsyncFunctionDef = null; + public static $AsyncWith = null; + public static $Attribute = null; + public static $AugAssign = null; + public static $AugLoad = null; + public static $AugStore = null; + public static $Await = null; + public static $BinOp = null; + public static $BitAnd = null; + public static $BitOr = null; + public static $BitXor = null; + public static $BoolOp = null; + public static $Break = null; + public static $Bytes = null; + public static $Call = null; + public static $ClassDef = null; + public static $Compare = null; + public static $Constant = null; + public static $Continue = null; + public static $Del = null; + public static $Delete = null; + public static $Dict = null; + public static $DictComp = null; + public static $Div = null; + public static $Ellipsis = null; + public static $Eq = null; + public static $ExceptHandler = null; + public static $Expr = null; + public static $Expression = null; + public static $ExtSlice = null; + public static $FloorDiv = null; + public static $For = null; + public static $FormattedValue = null; + public static $FunctionDef = null; + public static $FunctionType = null; + public static $GeneratorExp = null; + public static $Global = null; + public static $Gt = null; + public static $GtE = null; + public static $If = null; + public static $IfExp = null; + public static $Import = null; + public static $ImportFrom = null; + public static $In = null; + public static $Index = null; + public static $IntEnum = null; + public static $Interactive = null; + public static $Invert = null; + public static $Is = null; + public static $IsNot = null; + public static $JoinedStr = null; + public static $LShift = null; + public static $Lambda = null; + public static $List = null; + public static $ListComp = null; + public static $Load = null; + public static $Lt = null; + public static $LtE = null; + public static $MatMult = null; + public static $Match = null; + public static $MatchAs = null; + public static $MatchClass = null; + public static $MatchMapping = null; + public static $MatchOr = null; + public static $MatchSequence = null; + public static $MatchSingleton = null; + public static $MatchStar = null; + public static $MatchValue = null; + public static $Mod = null; + public static $Module = null; + public static $Mult = null; + public static $Name = null; + public static $NameConstant = null; + public static $NamedExpr = null; + public static $NodeTransformer = null; + public static $NodeVisitor = null; + public static $Nonlocal = null; + public static $Not = null; + public static $NotEq = null; + public static $NotIn = null; + public static $Num = null; + public static $Or = null; + public static $Param = null; + public static $Pass = null; + public static $Pow = null; + public static $RShift = null; + public static $Raise = null; + public static $Return = null; + public static $Set = null; + public static $SetComp = null; + public static $Slice = null; + public static $Starred = null; + public static $Store = null; + public static $Str = null; + public static $Sub = null; + public static $Subscript = null; + public static $Suite = null; + public static $Try = null; + public static $TryStar = null; + public static $Tuple = null; + public static $TypeIgnore = null; + public static $UAdd = null; + public static $USub = null; + public static $UnaryOp = null; + public static $While = null; + public static $With = null; + public static $Yield = null; + public static $YieldFrom = null; + public static $_ABC = null; + public static $_ALL_QUOTES = null; + public static $_MULTI_QUOTES = null; + public static $_Precedence = null; + public static $_SINGLE_QUOTES = null; + public static $_Unparser = null; + public static $__spec__ = null; + public static $_const_node_type_names = null; + public static $_const_types = null; + public static $_const_types_not = null; + public static $alias = null; + public static $arg = null; + public static $arguments = null; + public static $auto = null; + public static $boolop = null; + public static $cmpop = null; + public static $comprehension = null; + public static $excepthandler = null; + public static $expr = null; + public static $expr_context = null; + public static $keyword = null; + public static $match_case = null; + public static $mod = null; + public static $nullcontext = null; + public static $operator = null; + public static $pattern = null; + public static $slice = null; + public static $stmt = null; + public static $sys = null; + public static $type_ignore = null; + public static $unaryop = null; + public static $withitem = null; + + public static function _dims_getter($self) + { + return self::$__module->_dims_getter($self); + } + public static function _dims_setter($self, $value) + { + return self::$__module->_dims_setter($self, $value); + } + public static function _getter($self) + { + return self::$__module->_getter($self); + } + public static function _new($cls) + { + return self::$__module->_new($cls); + } + public static function _pad_whitespace($source) + { + return self::$__module->_pad_whitespace($source); + } + public static function _setter($self, $value) + { + return self::$__module->_setter($self, $value); + } + public static function _simple_enum($etype=array ( +)) + { + return self::$__module->_simple_enum($etype); + } + public static function _splitlines_no_ff($source) + { + return self::$__module->_splitlines_no_ff($source); + } + public static function contextmanager($func) + { + return self::$__module->contextmanager($func); + } + public static function copy_location($new_node, $old_node) + { + return self::$__module->copy_location($new_node, $old_node); + } + public static function dump($node, $annotate_fields=true, $include_attributes=false) + { + return self::$__module->dump($node, $annotate_fields, $include_attributes); + } + public static function fix_missing_locations($node) + { + return self::$__module->fix_missing_locations($node); + } + public static function get_docstring($node, $clean=true) + { + return self::$__module->get_docstring($node, $clean); + } + public static function get_source_segment($source, $node) + { + return self::$__module->get_source_segment($source, $node); + } + public static function increment_lineno($node, $n=1) + { + return self::$__module->increment_lineno($node, $n); + } + public static function iter_child_nodes($node) + { + return self::$__module->iter_child_nodes($node); + } + public static function iter_fields($node) + { + return self::$__module->iter_fields($node); + } + public static function literal_eval($node_or_string) + { + return self::$__module->literal_eval($node_or_string); + } + public static function main() + { + return self::$__module->main(); + } + public static function parse($source, $filename="", $mode="exec") + { + return self::$__module->parse($source, $filename, $mode); + } + public static function unparse($ast_obj) + { + return self::$__module->unparse($ast_obj); + } + public static function walk($node) + { + return self::$__module->walk($node); + } +} + +ast::__init(); diff --git a/lib/python/base64.php b/lib/python/base64.php new file mode 100644 index 0000000..e2febf8 Binary files /dev/null and b/lib/python/base64.php differ diff --git a/lib/python/calendar.php b/lib/python/calendar.php new file mode 100644 index 0000000..3da9920 --- /dev/null +++ b/lib/python/calendar.php @@ -0,0 +1,159 @@ +Calendar; + self::$HTMLCalendar = self::$__module->HTMLCalendar; + self::$IllegalMonthError = self::$__module->IllegalMonthError; + self::$IllegalWeekdayError = self::$__module->IllegalWeekdayError; + self::$LocaleHTMLCalendar = self::$__module->LocaleHTMLCalendar; + self::$LocaleTextCalendar = self::$__module->LocaleTextCalendar; + self::$TextCalendar = self::$__module->TextCalendar; + self::$__spec__ = self::$__module->__spec__; + self::$_locale = self::$__module->_locale; + self::$_localized_day = self::$__module->_localized_day; + self::$_localized_month = self::$__module->_localized_month; + self::$c = self::$__module->c; + self::$calendar = self::$__module->calendar; + self::$datetime = self::$__module->datetime; + self::$day_abbr = self::$__module->day_abbr; + self::$day_name = self::$__module->day_name; + self::$different_locale = self::$__module->different_locale; + self::$error = self::$__module->error; + self::$firstweekday = self::$__module->firstweekday; + self::$mdays = self::$__module->mdays; + self::$month = self::$__module->month; + self::$month_abbr = self::$__module->month_abbr; + self::$month_name = self::$__module->month_name; + self::$monthcalendar = self::$__module->monthcalendar; + self::$prcal = self::$__module->prcal; + self::$prmonth = self::$__module->prmonth; + self::$prweek = self::$__module->prweek; + self::$repeat = self::$__module->repeat; + self::$sys = self::$__module->sys; + self::$week = self::$__module->week; + self::$weekheader = self::$__module->weekheader; + } + } + + public const EPOCH = 1970; + public const FRIDAY = 4; + public const February = 2; + public const January = 1; + public const MONDAY = 0; + public const SATURDAY = 5; + public const SUNDAY = 6; + public const THURSDAY = 3; + public const TUESDAY = 1; + public const WEDNESDAY = 2; + public const _EPOCH_ORD = 719163; + public const _colwidth = 20; + public const _spacing = 6; + + public static $__cached__ = "/opt/anaconda3/lib/python3.11/__pycache__/calendar.cpython-311.pyc"; + public static $__file__ = "/opt/anaconda3/lib/python3.11/calendar.py"; + public static $__name__ = "calendar"; + public static $__package__ = ""; + + public static $Calendar = null; + public static $HTMLCalendar = null; + public static $IllegalMonthError = null; + public static $IllegalWeekdayError = null; + public static $LocaleHTMLCalendar = null; + public static $LocaleTextCalendar = null; + public static $TextCalendar = null; + public static $__spec__ = null; + public static $_locale = null; + public static $_localized_day = null; + public static $_localized_month = null; + public static $c = null; + public static $calendar = null; + public static $datetime = null; + public static $day_abbr = null; + public static $day_name = null; + public static $different_locale = null; + public static $error = null; + public static $firstweekday = null; + public static $mdays = null; + public static $month = null; + public static $month_abbr = null; + public static $month_name = null; + public static $monthcalendar = null; + public static $prcal = null; + public static $prmonth = null; + public static $prweek = null; + public static $repeat = null; + public static $sys = null; + public static $week = null; + public static $weekheader = null; + + public static function _get_default_locale() + { + return self::$__module->_get_default_locale(); + } + public static function _monthlen($year, $month) + { + return self::$__module->_monthlen($year, $month); + } + public static function _nextmonth($year, $month) + { + return self::$__module->_nextmonth($year, $month); + } + public static function _prevmonth($year, $month) + { + return self::$__module->_prevmonth($year, $month); + } + public static function format($cols, $colwidth=20, $spacing=6) + { + return self::$__module->format($cols, $colwidth, $spacing); + } + public static function formatstring($cols, $colwidth=20, $spacing=6) + { + return self::$__module->formatstring($cols, $colwidth, $spacing); + } + public static function isleap($year) + { + return self::$__module->isleap($year); + } + public static function leapdays($y1, $y2) + { + return self::$__module->leapdays($y1, $y2); + } + public static function main($args) + { + return self::$__module->main($args); + } + public static function monthrange($year, $month) + { + return self::$__module->monthrange($year, $month); + } + public static function setfirstweekday($firstweekday) + { + return self::$__module->setfirstweekday($firstweekday); + } + public static function timegm($tuple) + { + return self::$__module->timegm($tuple); + } + public static function weekday($year, $month, $day) + { + return self::$__module->weekday($year, $month, $day); + } +} + +calendar::__init(); diff --git a/lib/python/json.php b/lib/python/json.php new file mode 100644 index 0000000..1b4c7bf --- /dev/null +++ b/lib/python/json.php @@ -0,0 +1,167 @@ + is a subset of +JavaScript syntax (ECMA-262 3rd edition) used as a lightweight data +interchange format. + +:mod:`json` exposes an API familiar to users of the standard library +:mod:`marshal` and :mod:`pickle` modules. It is derived from a +version of the externally maintained simplejson library. + +Encoding basic Python object hierarchies:: + + >>> import json + >>> json.dumps(['foo', {'bar': ('baz', None, 1.0, 2)}]) + '["foo", {"bar": ["baz", null, 1.0, 2]}]' + >>> print(json.dumps("\"foo\bar")) + "\"foo\bar" + >>> print(json.dumps('\u1234')) + "\u1234" + >>> print(json.dumps('\\')) + "\\" + >>> print(json.dumps({"c": 0, "b": 0, "a": 0}, sort_keys=True)) + {"a": 0, "b": 0, "c": 0} + >>> from io import StringIO + >>> io = StringIO() + >>> json.dump(['streaming API'], io) + >>> io.getvalue() + '["streaming API"]' + +Compact encoding:: + + >>> import json + >>> mydict = {'4': 5, '6': 7} + >>> json.dumps([1,2,3,mydict], separators=(',', ':')) + '[1,2,3,{"4":5,"6":7}]' + +Pretty printing:: + + >>> import json + >>> print(json.dumps({'4': 5, '6': 7}, sort_keys=True, indent=4)) + { + "4": 5, + "6": 7 + } + +Decoding JSON:: + + >>> import json + >>> obj = ['foo', {'bar': ['baz', None, 1.0, 2]}] + >>> json.loads('["foo", {"bar":["baz", null, 1.0, 2]}]') == obj + True + >>> json.loads('"\\"foo\\bar"') == '"foo\x08ar' + True + >>> from io import StringIO + >>> io = StringIO('["streaming API"]') + >>> json.load(io)[0] == 'streaming API' + True + +Specializing JSON object decoding:: + + >>> import json + >>> def as_complex(dct): + ... if '__complex__' in dct: + ... return complex(dct['real'], dct['imag']) + ... return dct + ... + >>> json.loads('{"__complex__": true, "real": 1, "imag": 2}', + ... object_hook=as_complex) + (1+2j) + >>> from decimal import Decimal + >>> json.loads('1.1', parse_float=Decimal) == Decimal('1.1') + True + +Specializing JSON object encoding:: + + >>> import json + >>> def encode_complex(obj): + ... if isinstance(obj, complex): + ... return [obj.real, obj.imag] + ... raise TypeError(f'Object of type {obj.__class__.__name__} ' + ... f'is not JSON serializable') + ... + >>> json.dumps(2 + 1j, default=encode_complex) + '[2.0, 1.0]' + >>> json.JSONEncoder(default=encode_complex).encode(2 + 1j) + '[2.0, 1.0]' + >>> ''.join(json.JSONEncoder(default=encode_complex).iterencode(2 + 1j)) + '[2.0, 1.0]' + + +Using json.tool from the shell to validate and pretty-print:: + + $ echo '{"json":"obj"}' | python -m json.tool + { + "json": "obj" + } + $ echo '{ 1.2:3.4}' | python -m json.tool + Expecting property name enclosed in double quotes: line 1 column 3 (char 2) +*/ +class json{ + private static ?PyModule $__module = null; + + public static function __init(): void { + if (self::$__module == null) { + self::$__module = PyCore::import('json'); + self::$JSONDecodeError = self::$__module->JSONDecodeError; + self::$JSONDecoder = self::$__module->JSONDecoder; + self::$JSONEncoder = self::$__module->JSONEncoder; + self::$__path__ = self::$__module->__path__; + self::$__spec__ = self::$__module->__spec__; + self::$_default_decoder = self::$__module->_default_decoder; + self::$_default_encoder = self::$__module->_default_encoder; + self::$codecs = self::$__module->codecs; + self::$decoder = self::$__module->decoder; + self::$encoder = self::$__module->encoder; + self::$scanner = self::$__module->scanner; + } + } + + + public static $__author__ = "Bob Ippolito "; + public static $__cached__ = "/opt/anaconda3/lib/python3.11/json/__pycache__/__init__.cpython-311.pyc"; + public static $__file__ = "/opt/anaconda3/lib/python3.11/json/__init__.py"; + public static $__name__ = "json"; + public static $__package__ = "json"; + public static $__version__ = "2.0.9"; + + public static $JSONDecodeError = null; + public static $JSONDecoder = null; + public static $JSONEncoder = null; + public static $__path__ = null; + public static $__spec__ = null; + public static $_default_decoder = null; + public static $_default_encoder = null; + public static $codecs = null; + public static $decoder = null; + public static $encoder = null; + public static $scanner = null; + + public static function detect_encoding($b) + { + return self::$__module->detect_encoding($b); + } + public static function dump($obj, $fp) + { + return self::$__module->dump($obj, $fp); + } + public static function dumps($obj) + { + return self::$__module->dumps($obj); + } + public static function load($fp) + { + return self::$__module->load($fp); + } + public static function loads($s) + { + return self::$__module->loads($s); + } +} + +json::__init(); diff --git a/lib/python/os.php b/lib/python/os.php new file mode 100644 index 0000000..2eab989 --- /dev/null +++ b/lib/python/os.php @@ -0,0 +1,992 @@ +DirEntry; + self::$GenericAlias = self::$__module->GenericAlias; + self::$Mapping = self::$__module->Mapping; + self::$MutableMapping = self::$__module->MutableMapping; + self::$PathLike = self::$__module->PathLike; + self::$_Environ = self::$__module->_Environ; + self::$__spec__ = self::$__module->__spec__; + self::$_wrap_close = self::$__module->_wrap_close; + self::$abc = self::$__module->abc; + self::$confstr_names = self::$__module->confstr_names; + self::$environ = self::$__module->environ; + self::$environb = self::$__module->environb; + self::$error = self::$__module->error; + self::$path = self::$__module->path; + self::$pathconf_names = self::$__module->pathconf_names; + self::$sched_param = self::$__module->sched_param; + self::$st = self::$__module->st; + self::$stat_result = self::$__module->stat_result; + self::$statvfs_result = self::$__module->statvfs_result; + self::$supports_dir_fd = self::$__module->supports_dir_fd; + self::$supports_effective_ids = self::$__module->supports_effective_ids; + self::$supports_fd = self::$__module->supports_fd; + self::$supports_follow_symlinks = self::$__module->supports_follow_symlinks; + self::$sys = self::$__module->sys; + self::$sysconf_names = self::$__module->sysconf_names; + self::$terminal_size = self::$__module->terminal_size; + self::$times_result = self::$__module->times_result; + self::$uname_result = self::$__module->uname_result; + self::$waitid_result = self::$__module->waitid_result; + } + } + + public const CLD_CONTINUED = 6; + public const CLD_DUMPED = 3; + public const CLD_EXITED = 1; + public const CLD_KILLED = 2; + public const CLD_STOPPED = 5; + public const CLD_TRAPPED = 4; + public const EFD_CLOEXEC = 524288; + public const EFD_NONBLOCK = 2048; + public const EFD_SEMAPHORE = 1; + public const EX_CANTCREAT = 73; + public const EX_CONFIG = 78; + public const EX_DATAERR = 65; + public const EX_IOERR = 74; + public const EX_NOHOST = 68; + public const EX_NOINPUT = 66; + public const EX_NOPERM = 77; + public const EX_NOUSER = 67; + public const EX_OK = 0; + public const EX_OSERR = 71; + public const EX_OSFILE = 72; + public const EX_PROTOCOL = 76; + public const EX_SOFTWARE = 70; + public const EX_TEMPFAIL = 75; + public const EX_UNAVAILABLE = 69; + public const EX_USAGE = 64; + public const F_LOCK = 1; + public const F_OK = 0; + public const F_TEST = 3; + public const F_TLOCK = 2; + public const F_ULOCK = 0; + public const GRND_NONBLOCK = 1; + public const GRND_RANDOM = 2; + public const NGROUPS_MAX = 65536; + public const O_ACCMODE = 3; + public const O_APPEND = 1024; + public const O_ASYNC = 8192; + public const O_CLOEXEC = 524288; + public const O_CREAT = 64; + public const O_DIRECT = 16384; + public const O_DIRECTORY = 65536; + public const O_DSYNC = 4096; + public const O_EXCL = 128; + public const O_FSYNC = 1052672; + public const O_LARGEFILE = 0; + public const O_NDELAY = 2048; + public const O_NOATIME = 262144; + public const O_NOCTTY = 256; + public const O_NOFOLLOW = 131072; + public const O_NONBLOCK = 2048; + public const O_PATH = 2097152; + public const O_RDONLY = 0; + public const O_RDWR = 2; + public const O_RSYNC = 1052672; + public const O_SYNC = 1052672; + public const O_TMPFILE = 4259840; + public const O_TRUNC = 512; + public const O_WRONLY = 1; + public const POSIX_FADV_DONTNEED = 4; + public const POSIX_FADV_NOREUSE = 5; + public const POSIX_FADV_NORMAL = 0; + public const POSIX_FADV_RANDOM = 1; + public const POSIX_FADV_SEQUENTIAL = 2; + public const POSIX_FADV_WILLNEED = 3; + public const POSIX_SPAWN_CLOSE = 1; + public const POSIX_SPAWN_DUP2 = 2; + public const POSIX_SPAWN_OPEN = 0; + public const PRIO_PGRP = 1; + public const PRIO_PROCESS = 0; + public const PRIO_USER = 2; + public const P_ALL = 0; + public const P_NOWAIT = 1; + public const P_NOWAITO = 1; + public const P_PGID = 2; + public const P_PID = 1; + public const P_WAIT = 0; + public const RTLD_DEEPBIND = 8; + public const RTLD_GLOBAL = 256; + public const RTLD_LAZY = 1; + public const RTLD_LOCAL = 0; + public const RTLD_NODELETE = 4096; + public const RTLD_NOLOAD = 4; + public const RTLD_NOW = 2; + public const R_OK = 4; + public const SCHED_BATCH = 3; + public const SCHED_FIFO = 1; + public const SCHED_IDLE = 5; + public const SCHED_OTHER = 0; + public const SCHED_RESET_ON_FORK = 1073741824; + public const SCHED_RR = 2; + public const SEEK_CUR = 1; + public const SEEK_DATA = 3; + public const SEEK_END = 2; + public const SEEK_HOLE = 4; + public const SEEK_SET = 0; + public const SPLICE_F_MORE = 4; + public const SPLICE_F_MOVE = 1; + public const SPLICE_F_NONBLOCK = 2; + public const ST_APPEND = 256; + public const ST_MANDLOCK = 64; + public const ST_NOATIME = 1024; + public const ST_NODEV = 4; + public const ST_NODIRATIME = 2048; + public const ST_NOEXEC = 8; + public const ST_NOSUID = 2; + public const ST_RDONLY = 1; + public const ST_RELATIME = 4096; + public const ST_SYNCHRONOUS = 16; + public const ST_WRITE = 128; + public const TMP_MAX = 238328; + public const WCONTINUED = 8; + public const WEXITED = 4; + public const WNOHANG = 1; + public const WNOWAIT = 16777216; + public const WSTOPPED = 2; + public const WUNTRACED = 2; + public const W_OK = 2; + public const XATTR_CREATE = 1; + public const XATTR_REPLACE = 2; + public const XATTR_SIZE_MAX = 65536; + public const X_OK = 1; + + public static $__file__ = "/opt/anaconda3/lib/python3.11/os.py"; + public static $__name__ = "os"; + public static $__package__ = ""; + public static $altsep = null; + public static $curdir = "."; + public static $defpath = "/bin:/usr/bin"; + public static $devnull = "/dev/null"; + public static $extsep = "."; + public static $linesep = "\n"; + public static $name = "posix"; + public static $pardir = ".."; + public static $pathsep = ":"; + public static $sep = "/"; + public static $supports_bytes_environ = true; + + public static $DirEntry = null; + public static $GenericAlias = null; + public static $Mapping = null; + public static $MutableMapping = null; + public static $PathLike = null; + public static $_Environ = null; + public static $__spec__ = null; + public static $_wrap_close = null; + public static $abc = null; + public static $confstr_names = null; + public static $environ = null; + public static $environb = null; + public static $error = null; + public static $path = null; + public static $pathconf_names = null; + public static $sched_param = null; + public static $st = null; + public static $stat_result = null; + public static $statvfs_result = null; + public static $supports_dir_fd = null; + public static $supports_effective_ids = null; + public static $supports_fd = null; + public static $supports_follow_symlinks = null; + public static $sys = null; + public static $sysconf_names = null; + public static $terminal_size = null; + public static $times_result = null; + public static $uname_result = null; + public static $waitid_result = null; + + public static function WCOREDUMP($status) + { + return self::$__module->WCOREDUMP($status); + } + public static function WEXITSTATUS($status) + { + return self::$__module->WEXITSTATUS($status); + } + public static function WIFCONTINUED($status) + { + return self::$__module->WIFCONTINUED($status); + } + public static function WIFEXITED($status) + { + return self::$__module->WIFEXITED($status); + } + public static function WIFSIGNALED($status) + { + return self::$__module->WIFSIGNALED($status); + } + public static function WIFSTOPPED($status) + { + return self::$__module->WIFSTOPPED($status); + } + public static function WSTOPSIG($status) + { + return self::$__module->WSTOPSIG($status); + } + public static function WTERMSIG($status) + { + return self::$__module->WTERMSIG($status); + } + public static function _check_methods($C) + { + return self::$__module->_check_methods($C); + } + public static function _execvpe($file, $args, $env=null) + { + return self::$__module->_execvpe($file, $args, $env); + } + public static function _exists($name) + { + return self::$__module->_exists($name); + } + public static function _exit($status) + { + return self::$__module->_exit($status); + } + public static function _fspath($path) + { + return self::$__module->_fspath($path); + } + public static function _fwalk($topfd, $toppath, $isbytes, $topdown, $onerror, $follow_symlinks) + { + return self::$__module->_fwalk($topfd, $toppath, $isbytes, $topdown, $onerror, $follow_symlinks); + } + public static function _get_exports_list($module) + { + return self::$__module->_get_exports_list($module); + } + public static function _spawnvef($mode, $file, $args, $env, $func) + { + return self::$__module->_spawnvef($mode, $file, $args, $env, $func); + } + public static function _walk($top, $topdown, $onerror, $followlinks) + { + return self::$__module->_walk($top, $topdown, $onerror, $followlinks); + } + public static function abort() + { + return self::$__module->abort(); + } + public static function access($path, $mode) + { + return self::$__module->access($path, $mode); + } + public static function chdir($path) + { + return self::$__module->chdir($path); + } + public static function chmod($path, $mode) + { + return self::$__module->chmod($path, $mode); + } + public static function chown($path, $uid, $gid) + { + return self::$__module->chown($path, $uid, $gid); + } + public static function chroot($path) + { + return self::$__module->chroot($path); + } + public static function close($fd) + { + return self::$__module->close($fd); + } + public static function closerange($fd_low, $fd_high) + { + return self::$__module->closerange($fd_low, $fd_high); + } + public static function confstr($name) + { + return self::$__module->confstr($name); + } + public static function cpu_count() + { + return self::$__module->cpu_count(); + } + public static function ctermid() + { + return self::$__module->ctermid(); + } + public static function device_encoding($fd) + { + return self::$__module->device_encoding($fd); + } + public static function dup($fd) + { + return self::$__module->dup($fd); + } + public static function dup2($fd, $fd2, $inheritable=true) + { + return self::$__module->dup2($fd, $fd2, $inheritable); + } + public static function eventfd($initval, $flags=524288) + { + return self::$__module->eventfd($initval, $flags); + } + public static function eventfd_read($fd) + { + return self::$__module->eventfd_read($fd); + } + public static function eventfd_write($fd, $value) + { + return self::$__module->eventfd_write($fd, $value); + } + public static function execl($file) + { + return self::$__module->execl($file); + } + public static function execle($file) + { + return self::$__module->execle($file); + } + public static function execlp($file) + { + return self::$__module->execlp($file); + } + public static function execlpe($file) + { + return self::$__module->execlpe($file); + } + public static function execv($path, $argv) + { + return self::$__module->execv($path, $argv); + } + public static function execve($path, $argv, $env) + { + return self::$__module->execve($path, $argv, $env); + } + public static function execvp($file, $args) + { + return self::$__module->execvp($file, $args); + } + public static function execvpe($file, $args, $env) + { + return self::$__module->execvpe($file, $args, $env); + } + public static function fchdir($fd) + { + return self::$__module->fchdir($fd); + } + public static function fchmod($fd, $mode) + { + return self::$__module->fchmod($fd, $mode); + } + public static function fchown($fd, $uid, $gid) + { + return self::$__module->fchown($fd, $uid, $gid); + } + public static function fdatasync($fd) + { + return self::$__module->fdatasync($fd); + } + public static function fdopen($fd, $mode="r", $buffering=-1, $encoding=null) + { + return self::$__module->fdopen($fd, $mode, $buffering, $encoding); + } + public static function fork() + { + return self::$__module->fork(); + } + public static function forkpty() + { + return self::$__module->forkpty(); + } + public static function fpathconf($fd, $name) + { + return self::$__module->fpathconf($fd, $name); + } + public static function fsdecode($filename) + { + return self::$__module->fsdecode($filename); + } + public static function fsencode($filename) + { + return self::$__module->fsencode($filename); + } + public static function fspath($path) + { + return self::$__module->fspath($path); + } + public static function fstat($fd) + { + return self::$__module->fstat($fd); + } + public static function fstatvfs($fd) + { + return self::$__module->fstatvfs($fd); + } + public static function fsync($fd) + { + return self::$__module->fsync($fd); + } + public static function ftruncate($fd, $length) + { + return self::$__module->ftruncate($fd, $length); + } + public static function fwalk($top=".", $topdown=true, $onerror=null) + { + return self::$__module->fwalk($top, $topdown, $onerror); + } + public static function get_blocking($fd) + { + return self::$__module->get_blocking($fd); + } + public static function get_exec_path($env=null) + { + return self::$__module->get_exec_path($env); + } + public static function get_inheritable($fd) + { + return self::$__module->get_inheritable($fd); + } + public static function getcwd() + { + return self::$__module->getcwd(); + } + public static function getcwdb() + { + return self::$__module->getcwdb(); + } + public static function getegid() + { + return self::$__module->getegid(); + } + public static function getenv($key, $default=null) + { + return self::$__module->getenv($key, $default); + } + public static function getenvb($key, $default=null) + { + return self::$__module->getenvb($key, $default); + } + public static function geteuid() + { + return self::$__module->geteuid(); + } + public static function getgid() + { + return self::$__module->getgid(); + } + public static function getgrouplist($user, $group) + { + return self::$__module->getgrouplist($user, $group); + } + public static function getgroups() + { + return self::$__module->getgroups(); + } + public static function getloadavg() + { + return self::$__module->getloadavg(); + } + public static function getlogin() + { + return self::$__module->getlogin(); + } + public static function getpgid($pid) + { + return self::$__module->getpgid($pid); + } + public static function getpgrp() + { + return self::$__module->getpgrp(); + } + public static function getpid() + { + return self::$__module->getpid(); + } + public static function getppid() + { + return self::$__module->getppid(); + } + public static function getpriority($which, $who) + { + return self::$__module->getpriority($which, $who); + } + public static function getrandom($size, $flags=0) + { + return self::$__module->getrandom($size, $flags); + } + public static function getresgid() + { + return self::$__module->getresgid(); + } + public static function getresuid() + { + return self::$__module->getresuid(); + } + public static function getsid($pid) + { + return self::$__module->getsid($pid); + } + public static function getuid() + { + return self::$__module->getuid(); + } + public static function getxattr($path, $attribute) + { + return self::$__module->getxattr($path, $attribute); + } + public static function initgroups($username, $gid) + { + return self::$__module->initgroups($username, $gid); + } + public static function isatty($fd) + { + return self::$__module->isatty($fd); + } + public static function kill($pid, $signal) + { + return self::$__module->kill($pid, $signal); + } + public static function killpg($pgid, $signal) + { + return self::$__module->killpg($pgid, $signal); + } + public static function lchown($path, $uid, $gid) + { + return self::$__module->lchown($path, $uid, $gid); + } + public static function link($src, $dst) + { + return self::$__module->link($src, $dst); + } + public static function listdir($path=null) + { + return self::$__module->listdir($path); + } + public static function listxattr($path=null) + { + return self::$__module->listxattr($path); + } + public static function lockf($fd, $command, $length) + { + return self::$__module->lockf($fd, $command, $length); + } + public static function login_tty($fd) + { + return self::$__module->login_tty($fd); + } + public static function lseek($fd, $position, $whence) + { + return self::$__module->lseek($fd, $position, $whence); + } + public static function lstat($path) + { + return self::$__module->lstat($path); + } + public static function major($device) + { + return self::$__module->major($device); + } + public static function makedev($major, $minor) + { + return self::$__module->makedev($major, $minor); + } + public static function makedirs($name, $mode=511, $exist_ok=false) + { + return self::$__module->makedirs($name, $mode, $exist_ok); + } + public static function minor($device) + { + return self::$__module->minor($device); + } + public static function mkdir($path, $mode=511) + { + return self::$__module->mkdir($path, $mode); + } + public static function mkfifo($path, $mode=438) + { + return self::$__module->mkfifo($path, $mode); + } + public static function mknod($path, $mode=384, $device=0) + { + return self::$__module->mknod($path, $mode, $device); + } + public static function nice($increment) + { + return self::$__module->nice($increment); + } + public static function open($path, $flags, $mode=511) + { + return self::$__module->open($path, $flags, $mode); + } + public static function openpty() + { + return self::$__module->openpty(); + } + public static function pathconf($path, $name) + { + return self::$__module->pathconf($path, $name); + } + public static function pipe() + { + return self::$__module->pipe(); + } + public static function pipe2($flags) + { + return self::$__module->pipe2($flags); + } + public static function popen($cmd, $mode="r", $buffering=-1) + { + return self::$__module->popen($cmd, $mode, $buffering); + } + public static function posix_fadvise($fd, $offset, $length, $advice) + { + return self::$__module->posix_fadvise($fd, $offset, $length, $advice); + } + public static function posix_fallocate($fd, $offset, $length) + { + return self::$__module->posix_fallocate($fd, $offset, $length); + } + public static function pread($fd, $length, $offset) + { + return self::$__module->pread($fd, $length, $offset); + } + public static function preadv($fd, $buffers, $offset, $flags=0) + { + return self::$__module->preadv($fd, $buffers, $offset, $flags); + } + public static function putenv($name, $value) + { + return self::$__module->putenv($name, $value); + } + public static function pwrite($fd, $buffer, $offset) + { + return self::$__module->pwrite($fd, $buffer, $offset); + } + public static function pwritev($fd, $buffers, $offset, $flags=0) + { + return self::$__module->pwritev($fd, $buffers, $offset, $flags); + } + public static function read($fd, $length) + { + return self::$__module->read($fd, $length); + } + public static function readlink($path) + { + return self::$__module->readlink($path); + } + public static function readv($fd, $buffers) + { + return self::$__module->readv($fd, $buffers); + } + public static function remove($path) + { + return self::$__module->remove($path); + } + public static function removedirs($name) + { + return self::$__module->removedirs($name); + } + public static function removexattr($path, $attribute) + { + return self::$__module->removexattr($path, $attribute); + } + public static function rename($src, $dst) + { + return self::$__module->rename($src, $dst); + } + public static function renames($old, $new) + { + return self::$__module->renames($old, $new); + } + public static function replace($src, $dst) + { + return self::$__module->replace($src, $dst); + } + public static function rmdir($path) + { + return self::$__module->rmdir($path); + } + public static function scandir($path=null) + { + return self::$__module->scandir($path); + } + public static function sched_get_priority_max($policy) + { + return self::$__module->sched_get_priority_max($policy); + } + public static function sched_get_priority_min($policy) + { + return self::$__module->sched_get_priority_min($policy); + } + public static function sched_getaffinity($pid) + { + return self::$__module->sched_getaffinity($pid); + } + public static function sched_getparam($pid) + { + return self::$__module->sched_getparam($pid); + } + public static function sched_getscheduler($pid) + { + return self::$__module->sched_getscheduler($pid); + } + public static function sched_rr_get_interval($pid) + { + return self::$__module->sched_rr_get_interval($pid); + } + public static function sched_setaffinity($pid, $mask) + { + return self::$__module->sched_setaffinity($pid, $mask); + } + public static function sched_setparam($pid, $param) + { + return self::$__module->sched_setparam($pid, $param); + } + public static function sched_setscheduler($pid, $policy, $param) + { + return self::$__module->sched_setscheduler($pid, $policy, $param); + } + public static function sched_yield() + { + return self::$__module->sched_yield(); + } + public static function sendfile($out_fd, $in_fd, $offset, $count) + { + return self::$__module->sendfile($out_fd, $in_fd, $offset, $count); + } + public static function set_blocking($fd, $blocking) + { + return self::$__module->set_blocking($fd, $blocking); + } + public static function set_inheritable($fd, $inheritable) + { + return self::$__module->set_inheritable($fd, $inheritable); + } + public static function setegid($egid) + { + return self::$__module->setegid($egid); + } + public static function seteuid($euid) + { + return self::$__module->seteuid($euid); + } + public static function setgid($gid) + { + return self::$__module->setgid($gid); + } + public static function setgroups($groups) + { + return self::$__module->setgroups($groups); + } + public static function setpgid($pid, $pgrp) + { + return self::$__module->setpgid($pid, $pgrp); + } + public static function setpgrp() + { + return self::$__module->setpgrp(); + } + public static function setpriority($which, $who, $priority) + { + return self::$__module->setpriority($which, $who, $priority); + } + public static function setregid($rgid, $egid) + { + return self::$__module->setregid($rgid, $egid); + } + public static function setresgid($rgid, $egid, $sgid) + { + return self::$__module->setresgid($rgid, $egid, $sgid); + } + public static function setresuid($ruid, $euid, $suid) + { + return self::$__module->setresuid($ruid, $euid, $suid); + } + public static function setreuid($ruid, $euid) + { + return self::$__module->setreuid($ruid, $euid); + } + public static function setsid() + { + return self::$__module->setsid(); + } + public static function setuid($uid) + { + return self::$__module->setuid($uid); + } + public static function setxattr($path, $attribute, $value, $flags=0) + { + return self::$__module->setxattr($path, $attribute, $value, $flags); + } + public static function spawnl($mode, $file) + { + return self::$__module->spawnl($mode, $file); + } + public static function spawnle($mode, $file) + { + return self::$__module->spawnle($mode, $file); + } + public static function spawnlp($mode, $file) + { + return self::$__module->spawnlp($mode, $file); + } + public static function spawnlpe($mode, $file) + { + return self::$__module->spawnlpe($mode, $file); + } + public static function spawnv($mode, $file, $args) + { + return self::$__module->spawnv($mode, $file, $args); + } + public static function spawnve($mode, $file, $args, $env) + { + return self::$__module->spawnve($mode, $file, $args, $env); + } + public static function spawnvp($mode, $file, $args) + { + return self::$__module->spawnvp($mode, $file, $args); + } + public static function spawnvpe($mode, $file, $args, $env) + { + return self::$__module->spawnvpe($mode, $file, $args, $env); + } + public static function splice($src, $dst, $count, $offset_src=null, $offset_dst=null, $flags=0) + { + return self::$__module->splice($src, $dst, $count, $offset_src, $offset_dst, $flags); + } + public static function stat($path) + { + return self::$__module->stat($path); + } + public static function statvfs($path) + { + return self::$__module->statvfs($path); + } + public static function strerror($code) + { + return self::$__module->strerror($code); + } + public static function symlink($src, $dst, $target_is_directory=false) + { + return self::$__module->symlink($src, $dst, $target_is_directory); + } + public static function sync() + { + return self::$__module->sync(); + } + public static function sysconf($name) + { + return self::$__module->sysconf($name); + } + public static function system($command) + { + return self::$__module->system($command); + } + public static function tcgetpgrp($fd) + { + return self::$__module->tcgetpgrp($fd); + } + public static function tcsetpgrp($fd, $pgid) + { + return self::$__module->tcsetpgrp($fd, $pgid); + } + public static function times() + { + return self::$__module->times(); + } + public static function truncate($path, $length) + { + return self::$__module->truncate($path, $length); + } + public static function ttyname($fd) + { + return self::$__module->ttyname($fd); + } + public static function umask($mask) + { + return self::$__module->umask($mask); + } + public static function uname() + { + return self::$__module->uname(); + } + public static function unlink($path) + { + return self::$__module->unlink($path); + } + public static function unsetenv($name) + { + return self::$__module->unsetenv($name); + } + public static function urandom($size) + { + return self::$__module->urandom($size); + } + public static function wait() + { + return self::$__module->wait(); + } + public static function wait3($options) + { + return self::$__module->wait3($options); + } + public static function wait4($pid, $options) + { + return self::$__module->wait4($pid, $options); + } + public static function waitid($idtype, $id, $options) + { + return self::$__module->waitid($idtype, $id, $options); + } + public static function waitpid($pid, $options) + { + return self::$__module->waitpid($pid, $options); + } + public static function waitstatus_to_exitcode($status) + { + return self::$__module->waitstatus_to_exitcode($status); + } + public static function walk($top, $topdown=true, $onerror=null, $followlinks=false) + { + return self::$__module->walk($top, $topdown, $onerror, $followlinks); + } + public static function write($fd, $data) + { + return self::$__module->write($fd, $data); + } + public static function writev($fd, $buffers) + { + return self::$__module->writev($fd, $buffers); + } +} + +os::__init(); diff --git a/lib/python/pickle.php b/lib/python/pickle.php new file mode 100644 index 0000000..7d34aec --- /dev/null +++ b/lib/python/pickle.php @@ -0,0 +1,236 @@ + string + load(file) -> object + loads(bytes) -> object + +Misc variables: + + __version__ + format_version + compatible_formats + +*/ +class pickle{ + private static ?PyModule $__module = null; + + public static function __init(): void { + if (self::$__module == null) { + self::$__module = PyCore::import('pickle'); + self::$FunctionType = self::$__module->FunctionType; + self::$PickleBuffer = self::$__module->PickleBuffer; + self::$PickleError = self::$__module->PickleError; + self::$Pickler = self::$__module->Pickler; + self::$PicklingError = self::$__module->PicklingError; + self::$Unpickler = self::$__module->Unpickler; + self::$UnpicklingError = self::$__module->UnpicklingError; + self::$_Framer = self::$__module->_Framer; + self::$_Pickler = self::$__module->_Pickler; + self::$_Stop = self::$__module->_Stop; + self::$_Unframer = self::$__module->_Unframer; + self::$_Unpickler = self::$__module->_Unpickler; + self::$__spec__ = self::$__module->__spec__; + self::$_compat_pickle = self::$__module->_compat_pickle; + self::$_extension_cache = self::$__module->_extension_cache; + self::$_extension_registry = self::$__module->_extension_registry; + self::$_inverted_registry = self::$__module->_inverted_registry; + self::$_tuplesize2code = self::$__module->_tuplesize2code; + self::$bytes_types = self::$__module->bytes_types; + self::$codecs = self::$__module->codecs; + self::$compatible_formats = self::$__module->compatible_formats; + self::$dispatch_table = self::$__module->dispatch_table; + self::$io = self::$__module->io; + self::$islice = self::$__module->islice; + self::$partial = self::$__module->partial; + self::$re = self::$__module->re; + self::$sys = self::$__module->sys; + } + } + + public const DEFAULT_PROTOCOL = 4; + public const DUP = 2; + public const HIGHEST_PROTOCOL = 5; + public const POP = 0; + public const POP_MARK = 1; + public const maxsize = 9223372036854775807; + + public static $ADDITEMS = ""; + public static $APPEND = "a"; + public static $APPENDS = "e"; + public static $BINBYTES = "B"; + public static $BINBYTES8 = ""; + public static $BINFLOAT = "G"; + public static $BINGET = "h"; + public static $BININT = "J"; + public static $BININT1 = "K"; + public static $BININT2 = "M"; + public static $BINPERSID = "Q"; + public static $BINPUT = "q"; + public static $BINSTRING = "T"; + public static $BINUNICODE = "X"; + public static $BINUNICODE8 = ""; + public static $BUILD = "b"; + public static $BYTEARRAY8 = ""; + public static $DICT = "d"; + public static $EMPTY_DICT = "}"; + public static $EMPTY_LIST = "]"; + public static $EMPTY_SET = ""; + public static $EMPTY_TUPLE = ")"; + public static $EXT1 = ""; + public static $EXT2 = ""; + public static $EXT4 = ""; + public static $FALSE = "I00\n"; + public static $FLOAT = "F"; + public static $FRAME = ""; + public static $FROZENSET = ""; + public static $GET = "g"; + public static $GLOBAL = "c"; + public static $INST = "i"; + public static $INT = "I"; + public static $LIST = "l"; + public static $LONG = "L"; + public static $LONG1 = ""; + public static $LONG4 = ""; + public static $LONG_BINGET = "j"; + public static $LONG_BINPUT = "r"; + public static $MARK = "("; + public static $MEMOIZE = ""; + public static $NEWFALSE = ""; + public static $NEWOBJ = ""; + public static $NEWOBJ_EX = ""; + public static $NEWTRUE = ""; + public static $NEXT_BUFFER = ""; + public static $NONE = "N"; + public static $OBJ = "o"; + public static $PERSID = "P"; + public static $PROTO = ""; + public static $PUT = "p"; + public static $PyStringMap = null; + public static $READONLY_BUFFER = ""; + public static $REDUCE = "R"; + public static $SETITEM = "s"; + public static $SETITEMS = "u"; + public static $SHORT_BINBYTES = "C"; + public static $SHORT_BINSTRING = "U"; + public static $SHORT_BINUNICODE = ""; + public static $STACK_GLOBAL = ""; + public static $STOP = "."; + public static $STRING = "S"; + public static $TRUE = "I01\n"; + public static $TUPLE = "t"; + public static $TUPLE1 = ""; + public static $TUPLE2 = ""; + public static $TUPLE3 = ""; + public static $UNICODE = "V"; + public static $_HAVE_PICKLE_BUFFER = true; + public static $__cached__ = "/opt/anaconda3/lib/python3.11/__pycache__/pickle.cpython-311.pyc"; + public static $__file__ = "/opt/anaconda3/lib/python3.11/pickle.py"; + public static $__name__ = "pickle"; + public static $__package__ = ""; + public static $format_version = "4.0"; + + public static $FunctionType = null; + public static $PickleBuffer = null; + public static $PickleError = null; + public static $Pickler = null; + public static $PicklingError = null; + public static $Unpickler = null; + public static $UnpicklingError = null; + public static $_Framer = null; + public static $_Pickler = null; + public static $_Stop = null; + public static $_Unframer = null; + public static $_Unpickler = null; + public static $__spec__ = null; + public static $_compat_pickle = null; + public static $_extension_cache = null; + public static $_extension_registry = null; + public static $_inverted_registry = null; + public static $_tuplesize2code = null; + public static $bytes_types = null; + public static $codecs = null; + public static $compatible_formats = null; + public static $dispatch_table = null; + public static $io = null; + public static $islice = null; + public static $partial = null; + public static $re = null; + public static $sys = null; + + public static function _dump($obj, $file, $protocol=null) + { + return self::$__module->_dump($obj, $file, $protocol); + } + public static function _dumps($obj, $protocol=null) + { + return self::$__module->_dumps($obj, $protocol); + } + public static function _getattribute($obj, $name) + { + return self::$__module->_getattribute($obj, $name); + } + public static function _load($file) + { + return self::$__module->_load($file); + } + public static function _loads($s) + { + return self::$__module->_loads($s); + } + public static function _test() + { + return self::$__module->_test(); + } + public static function decode_long($data) + { + return self::$__module->decode_long($data); + } + public static function dump($obj, $file, $protocol=null) + { + return self::$__module->dump($obj, $file, $protocol); + } + public static function dumps($obj, $protocol=null) + { + return self::$__module->dumps($obj, $protocol); + } + public static function encode_long($x) + { + return self::$__module->encode_long($x); + } + public static function load($file) + { + return self::$__module->load($file); + } + public static function loads($data) + { + return self::$__module->loads($data); + } + public static function unpack($format, $buffer) + { + return self::$__module->unpack($format, $buffer); + } + public static function whichmodule($obj, $name) + { + return self::$__module->whichmodule($obj, $name); + } +} + +pickle::__init(); diff --git a/lib/python/random.php b/lib/python/random.php new file mode 100644 index 0000000..1c85038 --- /dev/null +++ b/lib/python/random.php @@ -0,0 +1,207 @@ +Random; + self::$SystemRandom = self::$__module->SystemRandom; + self::$_Sequence = self::$__module->_Sequence; + self::$_Set = self::$__module->_Set; + self::$__spec__ = self::$__module->__spec__; + self::$_accumulate = self::$__module->_accumulate; + self::$_inst = self::$__module->_inst; + self::$_os = self::$__module->_os; + self::$_random = self::$__module->_random; + self::$_repeat = self::$__module->_repeat; + self::$betavariate = self::$__module->betavariate; + self::$choice = self::$__module->choice; + self::$choices = self::$__module->choices; + self::$expovariate = self::$__module->expovariate; + self::$gammavariate = self::$__module->gammavariate; + self::$gauss = self::$__module->gauss; + self::$getstate = self::$__module->getstate; + self::$lognormvariate = self::$__module->lognormvariate; + self::$normalvariate = self::$__module->normalvariate; + self::$paretovariate = self::$__module->paretovariate; + self::$randbytes = self::$__module->randbytes; + self::$randint = self::$__module->randint; + self::$randrange = self::$__module->randrange; + self::$sample = self::$__module->sample; + self::$seed = self::$__module->seed; + self::$setstate = self::$__module->setstate; + self::$shuffle = self::$__module->shuffle; + self::$triangular = self::$__module->triangular; + self::$uniform = self::$__module->uniform; + self::$vonmisesvariate = self::$__module->vonmisesvariate; + self::$weibullvariate = self::$__module->weibullvariate; + } + } + + public const BPF = 53; + public const LOG4 = 1.3862943611199; + public const NV_MAGICCONST = 1.7155277699214; + public const RECIP_BPF = 1.1102230246252E-16; + public const SG_MAGICCONST = 2.5040773967763; + public const TWOPI = 6.2831853071796; + public const _ONE = 1; + public const _e = 2.718281828459; + public const _pi = 3.1415926535898; + + public static $__cached__ = "/opt/anaconda3/lib/python3.11/__pycache__/random.cpython-311.pyc"; + public static $__file__ = "/opt/anaconda3/lib/python3.11/random.py"; + public static $__name__ = "random"; + public static $__package__ = ""; + + public static $Random = null; + public static $SystemRandom = null; + public static $_Sequence = null; + public static $_Set = null; + public static $__spec__ = null; + public static $_accumulate = null; + public static $_inst = null; + public static $_os = null; + public static $_random = null; + public static $_repeat = null; + public static $betavariate = null; + public static $choice = null; + public static $choices = null; + public static $expovariate = null; + public static $gammavariate = null; + public static $gauss = null; + public static $getstate = null; + public static $lognormvariate = null; + public static $normalvariate = null; + public static $paretovariate = null; + public static $randbytes = null; + public static $randint = null; + public static $randrange = null; + public static $sample = null; + public static $seed = null; + public static $setstate = null; + public static $shuffle = null; + public static $triangular = null; + public static $uniform = null; + public static $vonmisesvariate = null; + public static $weibullvariate = null; + + public static function _acos($x) + { + return self::$__module->_acos($x); + } + public static function _bisect($a, $x, $lo=0, $hi=null) + { + return self::$__module->_bisect($a, $x, $lo, $hi); + } + public static function _ceil($x) + { + return self::$__module->_ceil($x); + } + public static function _cos($x) + { + return self::$__module->_cos($x); + } + public static function _exp($x) + { + return self::$__module->_exp($x); + } + public static function _floor($x) + { + return self::$__module->_floor($x); + } + public static function _index($a) + { + return self::$__module->_index($a); + } + public static function _isfinite($x) + { + return self::$__module->_isfinite($x); + } + public static function _sha512($string="") + { + return self::$__module->_sha512($string); + } + public static function _sin($x) + { + return self::$__module->_sin($x); + } + public static function _sqrt($x) + { + return self::$__module->_sqrt($x); + } + public static function _test($N=2000) + { + return self::$__module->_test($N); + } + public static function _test_generator($n, $func, $args) + { + return self::$__module->_test_generator($n, $func, $args); + } + public static function _urandom($size) + { + return self::$__module->_urandom($size); + } + public static function _warn($message, $category=null, $stacklevel=1, $source=null) + { + return self::$__module->_warn($message, $category, $stacklevel, $source); + } + public static function getrandbits($self, $k) + { + return self::$__module->getrandbits($self, $k); + } + public static function random($self) + { + return self::$__module->random($self); + } +} + +random::__init(); diff --git a/lib/python/string.php b/lib/python/string.php new file mode 100644 index 0000000..de2753b --- /dev/null +++ b/lib/python/string.php @@ -0,0 +1,68 @@ +Formatter; + self::$Template = self::$__module->Template; + self::$_ChainMap = self::$__module->_ChainMap; + self::$__spec__ = self::$__module->__spec__; + self::$_re = self::$__module->_re; + self::$_sentinel_dict = self::$__module->_sentinel_dict; + self::$_string = self::$__module->_string; + } + } + + + public static $__cached__ = "/opt/anaconda3/lib/python3.11/__pycache__/string.cpython-311.pyc"; + public static $__file__ = "/opt/anaconda3/lib/python3.11/string.py"; + public static $__name__ = "string"; + public static $__package__ = ""; + public static $ascii_letters = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; + public static $ascii_lowercase = "abcdefghijklmnopqrstuvwxyz"; + public static $ascii_uppercase = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; + public static $digits = "0123456789"; + public static $hexdigits = "0123456789abcdefABCDEF"; + public static $octdigits = "01234567"; + public static $printable = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!\"#$%&'()*+,-./:;<=>?@[\]^_`{|}~ \n "; + public static $punctuation = "!\"#$%&'()*+,-./:;<=>?@[\]^_`{|}~"; + public static $whitespace = " \n "; + + public static $Formatter = null; + public static $Template = null; + public static $_ChainMap = null; + public static $__spec__ = null; + public static $_re = null; + public static $_sentinel_dict = null; + public static $_string = null; + + public static function capwords($s, $sep=null) + { + return self::$__module->capwords($s, $sep); + } +} + +string::__init(); diff --git a/lib/python/subprocess.php b/lib/python/subprocess.php new file mode 100644 index 0000000..f88166a --- /dev/null +++ b/lib/python/subprocess.php @@ -0,0 +1,178 @@ +CalledProcessError; + self::$CompletedProcess = self::$__module->CompletedProcess; + self::$Popen = self::$__module->Popen; + self::$SubprocessError = self::$__module->SubprocessError; + self::$TimeoutExpired = self::$__module->TimeoutExpired; + self::$_PopenSelector = self::$__module->_PopenSelector; + self::$__spec__ = self::$__module->__spec__; + self::$_active = self::$__module->_active; + self::$builtins = self::$__module->builtins; + self::$contextlib = self::$__module->contextlib; + self::$errno = self::$__module->errno; + self::$fcntl = self::$__module->fcntl; + self::$io = self::$__module->io; + self::$locale = self::$__module->locale; + self::$os = self::$__module->os; + self::$select = self::$__module->select; + self::$selectors = self::$__module->selectors; + self::$signal = self::$__module->signal; + self::$sys = self::$__module->sys; + self::$threading = self::$__module->threading; + self::$time = self::$__module->time; + self::$types = self::$__module->types; + self::$warnings = self::$__module->warnings; + } + } + + public const DEVNULL = -3; + public const PIPE = -1; + public const STDOUT = -2; + public const _PIPE_BUF = 4096; + public const _WNOHANG = 1; + + public static $_USE_POSIX_SPAWN = true; + public static $_USE_VFORK = true; + public static $__cached__ = "/opt/anaconda3/lib/python3.11/__pycache__/subprocess.cpython-311.pyc"; + public static $__file__ = "/opt/anaconda3/lib/python3.11/subprocess.py"; + public static $__name__ = "subprocess"; + public static $__package__ = ""; + public static $_can_fork_exec = true; + public static $_mswindows = false; + + public static $CalledProcessError = null; + public static $CompletedProcess = null; + public static $Popen = null; + public static $SubprocessError = null; + public static $TimeoutExpired = null; + public static $_PopenSelector = null; + public static $__spec__ = null; + public static $_active = null; + public static $builtins = null; + public static $contextlib = null; + public static $errno = null; + public static $fcntl = null; + public static $io = null; + public static $locale = null; + public static $os = null; + public static $select = null; + public static $selectors = null; + public static $signal = null; + public static $sys = null; + public static $threading = null; + public static $time = null; + public static $types = null; + public static $warnings = null; + + public static function _WIFSTOPPED($status) + { + return self::$__module->_WIFSTOPPED($status); + } + public static function _WSTOPSIG($status) + { + return self::$__module->_WSTOPSIG($status); + } + public static function _args_from_interpreter_flags() + { + return self::$__module->_args_from_interpreter_flags(); + } + public static function _cleanup() + { + return self::$__module->_cleanup(); + } + public static function _optim_args_from_interpreter_flags() + { + return self::$__module->_optim_args_from_interpreter_flags(); + } + public static function _text_encoding() + { + return self::$__module->_text_encoding(); + } + public static function _use_posix_spawn() + { + return self::$__module->_use_posix_spawn(); + } + public static function _waitpid($pid, $options) + { + return self::$__module->_waitpid($pid, $options); + } + public static function _waitstatus_to_exitcode($status) + { + return self::$__module->_waitstatus_to_exitcode($status); + } + public static function call() + { + return self::$__module->call(); + } + public static function check_call() + { + return self::$__module->check_call(); + } + public static function check_output() + { + return self::$__module->check_output(); + } + public static function getoutput($cmd) + { + return self::$__module->getoutput($cmd); + } + public static function getstatusoutput($cmd) + { + return self::$__module->getstatusoutput($cmd); + } + public static function list2cmdline($seq) + { + return self::$__module->list2cmdline($seq); + } + public static function run() + { + return self::$__module->run(); + } +} + +subprocess::__init(); diff --git a/lib/python/sys.php b/lib/python/sys.php new file mode 100644 index 0000000..cf17bd5 --- /dev/null +++ b/lib/python/sys.php @@ -0,0 +1,319 @@ +__spec__; + self::$__stderr__ = self::$__module->__stderr__; + self::$__stdin__ = self::$__module->__stdin__; + self::$__stdout__ = self::$__module->__stdout__; + self::$_git = self::$__module->_git; + self::$_xoptions = self::$__module->_xoptions; + self::$argv = self::$__module->argv; + self::$builtin_module_names = self::$__module->builtin_module_names; + self::$flags = self::$__module->flags; + self::$float_info = self::$__module->float_info; + self::$hash_info = self::$__module->hash_info; + self::$implementation = self::$__module->implementation; + self::$int_info = self::$__module->int_info; + self::$meta_path = self::$__module->meta_path; + self::$modules = self::$__module->modules; + self::$orig_argv = self::$__module->orig_argv; + self::$path = self::$__module->path; + self::$path_hooks = self::$__module->path_hooks; + self::$path_importer_cache = self::$__module->path_importer_cache; + self::$stderr = self::$__module->stderr; + self::$stdin = self::$__module->stdin; + self::$stdlib_module_names = self::$__module->stdlib_module_names; + self::$stdout = self::$__module->stdout; + self::$thread_info = self::$__module->thread_info; + self::$version_info = self::$__module->version_info; + self::$warnoptions = self::$__module->warnoptions; + } + } + + public const api_version = 1013; + public const hexversion = 51054064; + public const maxsize = 9223372036854775807; + public const maxunicode = 1114111; + + public static $__name__ = "sys"; + public static $__package__ = ""; + public static $_base_executable = "/opt/anaconda3/bin/python3"; + public static $_framework = ""; + public static $_home = null; + public static $_stdlib_dir = "/opt/anaconda3/lib/python3.11"; + public static $abiflags = ""; + public static $base_exec_prefix = "/opt/anaconda3"; + public static $base_prefix = "/opt/anaconda3"; + public static $byteorder = "little"; + public static $copyright = "Copyright (c) 2001-2023 Python Software Foundation.\nAll Rights Reserved.\n\nCopyright (c) 2000 BeOpen.com.\nAll Rights Reserved.\n\nCopyright (c) 1995-2001 Corporation for National Research Initiatives.\nAll Rights Reserved.\n\nCopyright (c) 1991-1995 Stichting Mathematisch Centrum, Amsterdam.\nAll Rights Reserved."; + public static $dont_write_bytecode = false; + public static $exec_prefix = "/opt/anaconda3"; + public static $executable = "/opt/anaconda3/bin/python3"; + public static $float_repr_style = "short"; + public static $platform = "linux"; + public static $platlibdir = "lib"; + public static $prefix = "/opt/anaconda3"; + public static $pycache_prefix = null; + public static $version = "3.11.5 (main, Sep 11 2023, 14:07:11) [GCC 11.2.0]"; + + public static $__spec__ = null; + public static $__stderr__ = null; + public static $__stdin__ = null; + public static $__stdout__ = null; + public static $_git = null; + public static $_xoptions = null; + public static $argv = null; + public static $builtin_module_names = null; + public static $flags = null; + public static $float_info = null; + public static $hash_info = null; + public static $implementation = null; + public static $int_info = null; + public static $meta_path = null; + public static $modules = null; + public static $orig_argv = null; + public static $path = null; + public static $path_hooks = null; + public static $path_importer_cache = null; + public static $stderr = null; + public static $stdin = null; + public static $stdlib_module_names = null; + public static $stdout = null; + public static $thread_info = null; + public static $version_info = null; + public static $warnoptions = null; + + public static function __displayhook__($object) + { + return self::$__module->__displayhook__($object); + } + public static function __excepthook__($exctype, $value, $traceback) + { + return self::$__module->__excepthook__($exctype, $value, $traceback); + } + public static function __interactivehook__() + { + return self::$__module->__interactivehook__(); + } + public static function __unraisablehook__($unraisable) + { + return self::$__module->__unraisablehook__($unraisable); + } + public static function _clear_type_cache() + { + return self::$__module->_clear_type_cache(); + } + public static function _current_exceptions() + { + return self::$__module->_current_exceptions(); + } + public static function _current_frames() + { + return self::$__module->_current_frames(); + } + public static function _debugmallocstats() + { + return self::$__module->_debugmallocstats(); + } + public static function _getframe($depth=0) + { + return self::$__module->_getframe($depth); + } + public static function _getquickenedcount() + { + return self::$__module->_getquickenedcount(); + } + public static function addaudithook($hook) + { + return self::$__module->addaudithook($hook); + } + public static function call_tracing($func, $args) + { + return self::$__module->call_tracing($func, $args); + } + public static function displayhook($object) + { + return self::$__module->displayhook($object); + } + public static function exc_info() + { + return self::$__module->exc_info(); + } + public static function excepthook($exctype, $value, $traceback) + { + return self::$__module->excepthook($exctype, $value, $traceback); + } + public static function exception() + { + return self::$__module->exception(); + } + public static function exit($status=null) + { + return self::$__module->exit($status); + } + public static function get_asyncgen_hooks() + { + return self::$__module->get_asyncgen_hooks(); + } + public static function get_coroutine_origin_tracking_depth() + { + return self::$__module->get_coroutine_origin_tracking_depth(); + } + public static function get_int_max_str_digits() + { + return self::$__module->get_int_max_str_digits(); + } + public static function getallocatedblocks() + { + return self::$__module->getallocatedblocks(); + } + public static function getdefaultencoding() + { + return self::$__module->getdefaultencoding(); + } + public static function getdlopenflags() + { + return self::$__module->getdlopenflags(); + } + public static function getfilesystemencodeerrors() + { + return self::$__module->getfilesystemencodeerrors(); + } + public static function getfilesystemencoding() + { + return self::$__module->getfilesystemencoding(); + } + public static function getprofile() + { + return self::$__module->getprofile(); + } + public static function getrecursionlimit() + { + return self::$__module->getrecursionlimit(); + } + public static function getrefcount($object) + { + return self::$__module->getrefcount($object); + } + public static function getswitchinterval() + { + return self::$__module->getswitchinterval(); + } + public static function gettrace() + { + return self::$__module->gettrace(); + } + public static function intern($string) + { + return self::$__module->intern($string); + } + public static function is_finalizing() + { + return self::$__module->is_finalizing(); + } + public static function set_coroutine_origin_tracking_depth($depth) + { + return self::$__module->set_coroutine_origin_tracking_depth($depth); + } + public static function set_int_max_str_digits($maxdigits) + { + return self::$__module->set_int_max_str_digits($maxdigits); + } + public static function setdlopenflags($flags) + { + return self::$__module->setdlopenflags($flags); + } + public static function setrecursionlimit($limit) + { + return self::$__module->setrecursionlimit($limit); + } + public static function setswitchinterval($interval) + { + return self::$__module->setswitchinterval($interval); + } + public static function unraisablehook($unraisable) + { + return self::$__module->unraisablehook($unraisable); + } +} + +sys::__init(); diff --git a/lib/python/threading.php b/lib/python/threading.php new file mode 100644 index 0000000..8b7ae23 --- /dev/null +++ b/lib/python/threading.php @@ -0,0 +1,170 @@ +Barrier; + self::$BoundedSemaphore = self::$__module->BoundedSemaphore; + self::$BrokenBarrierError = self::$__module->BrokenBarrierError; + self::$Condition = self::$__module->Condition; + self::$Event = self::$__module->Event; + self::$ExceptHookArgs = self::$__module->ExceptHookArgs; + self::$Semaphore = self::$__module->Semaphore; + self::$Thread = self::$__module->Thread; + self::$ThreadError = self::$__module->ThreadError; + self::$Timer = self::$__module->Timer; + self::$WeakSet = self::$__module->WeakSet; + self::$_CRLock = self::$__module->_CRLock; + self::$_DummyThread = self::$__module->_DummyThread; + self::$_MainThread = self::$__module->_MainThread; + self::$_PyRLock = self::$__module->_PyRLock; + self::$_RLock = self::$__module->_RLock; + self::$__spec__ = self::$__module->__spec__; + self::$_active = self::$__module->_active; + self::$_active_limbo_lock = self::$__module->_active_limbo_lock; + self::$_count = self::$__module->_count; + self::$_counter = self::$__module->_counter; + self::$_dangling = self::$__module->_dangling; + self::$_deque = self::$__module->_deque; + self::$_islice = self::$__module->_islice; + self::$_limbo = self::$__module->_limbo; + self::$_main_thread = self::$__module->_main_thread; + self::$_os = self::$__module->_os; + self::$_shutdown_locks = self::$__module->_shutdown_locks; + self::$_shutdown_locks_lock = self::$__module->_shutdown_locks_lock; + self::$_sys = self::$__module->_sys; + self::$_threading_atexits = self::$__module->_threading_atexits; + self::$functools = self::$__module->functools; + self::$local = self::$__module->local; + } + } + + public const TIMEOUT_MAX = 9223372036; + + public static $_HAVE_THREAD_NATIVE_ID = true; + public static $_SHUTTING_DOWN = false; + public static $__cached__ = "/opt/anaconda3/lib/python3.11/__pycache__/threading.cpython-311.pyc"; + public static $__file__ = "/opt/anaconda3/lib/python3.11/threading.py"; + public static $__name__ = "threading"; + public static $__package__ = ""; + public static $_profile_hook = null; + public static $_trace_hook = null; + + public static $Barrier = null; + public static $BoundedSemaphore = null; + public static $BrokenBarrierError = null; + public static $Condition = null; + public static $Event = null; + public static $ExceptHookArgs = null; + public static $Semaphore = null; + public static $Thread = null; + public static $ThreadError = null; + public static $Timer = null; + public static $WeakSet = null; + public static $_CRLock = null; + public static $_DummyThread = null; + public static $_MainThread = null; + public static $_PyRLock = null; + public static $_RLock = null; + public static $__spec__ = null; + public static $_active = null; + public static $_active_limbo_lock = null; + public static $_count = null; + public static $_counter = null; + public static $_dangling = null; + public static $_deque = null; + public static $_islice = null; + public static $_limbo = null; + public static $_main_thread = null; + public static $_os = null; + public static $_shutdown_locks = null; + public static $_shutdown_locks_lock = null; + public static $_sys = null; + public static $_threading_atexits = null; + public static $functools = null; + public static $local = null; + + public static function RLock() + { + return self::$__module->RLock(); + } + public static function _after_fork() + { + return self::$__module->_after_fork(); + } + public static function _enumerate() + { + return self::$__module->_enumerate(); + } + public static function _maintain_shutdown_locks() + { + return self::$__module->_maintain_shutdown_locks(); + } + public static function _make_invoke_excepthook() + { + return self::$__module->_make_invoke_excepthook(); + } + public static function _newname($name_template) + { + return self::$__module->_newname($name_template); + } + public static function _register_atexit($func) + { + return self::$__module->_register_atexit($func); + } + public static function _shutdown() + { + return self::$__module->_shutdown(); + } + public static function activeCount() + { + return self::$__module->activeCount(); + } + public static function active_count() + { + return self::$__module->active_count(); + } + public static function currentThread() + { + return self::$__module->currentThread(); + } + public static function current_thread() + { + return self::$__module->current_thread(); + } + public static function enumerate() + { + return self::$__module->enumerate(); + } + public static function getprofile() + { + return self::$__module->getprofile(); + } + public static function gettrace() + { + return self::$__module->gettrace(); + } + public static function main_thread() + { + return self::$__module->main_thread(); + } + public static function setprofile($func) + { + return self::$__module->setprofile($func); + } + public static function settrace($func) + { + return self::$__module->settrace($func); + } +} + +threading::__init(); diff --git a/lib/python/tkinter.php b/lib/python/tkinter.php new file mode 100644 index 0000000..0b4c2a6 --- /dev/null +++ b/lib/python/tkinter.php @@ -0,0 +1,328 @@ +BaseWidget; + self::$BitmapImage = self::$__module->BitmapImage; + self::$BooleanVar = self::$__module->BooleanVar; + self::$Button = self::$__module->Button; + self::$CallWrapper = self::$__module->CallWrapper; + self::$Canvas = self::$__module->Canvas; + self::$Checkbutton = self::$__module->Checkbutton; + self::$DoubleVar = self::$__module->DoubleVar; + self::$Entry = self::$__module->Entry; + self::$Event = self::$__module->Event; + self::$EventType = self::$__module->EventType; + self::$Frame = self::$__module->Frame; + self::$Grid = self::$__module->Grid; + self::$Image = self::$__module->Image; + self::$IntVar = self::$__module->IntVar; + self::$Label = self::$__module->Label; + self::$LabelFrame = self::$__module->LabelFrame; + self::$Listbox = self::$__module->Listbox; + self::$Menu = self::$__module->Menu; + self::$Menubutton = self::$__module->Menubutton; + self::$Message = self::$__module->Message; + self::$Misc = self::$__module->Misc; + self::$OptionMenu = self::$__module->OptionMenu; + self::$Pack = self::$__module->Pack; + self::$PanedWindow = self::$__module->PanedWindow; + self::$PhotoImage = self::$__module->PhotoImage; + self::$Place = self::$__module->Place; + self::$Radiobutton = self::$__module->Radiobutton; + self::$Scale = self::$__module->Scale; + self::$Scrollbar = self::$__module->Scrollbar; + self::$Spinbox = self::$__module->Spinbox; + self::$StringVar = self::$__module->StringVar; + self::$TclError = self::$__module->TclError; + self::$Text = self::$__module->Text; + self::$Tk = self::$__module->Tk; + self::$Toplevel = self::$__module->Toplevel; + self::$Variable = self::$__module->Variable; + self::$Widget = self::$__module->Widget; + self::$Wm = self::$__module->Wm; + self::$XView = self::$__module->XView; + self::$YView = self::$__module->YView; + self::$_VersionInfoType = self::$__module->_VersionInfoType; + self::$__path__ = self::$__module->__path__; + self::$__spec__ = self::$__module->__spec__; + self::$_magic_re = self::$__module->_magic_re; + self::$_setit = self::$__module->_setit; + self::$_space_re = self::$__module->_space_re; + self::$_tkinter = self::$__module->_tkinter; + self::$collections = self::$__module->collections; + self::$constants = self::$__module->constants; + self::$enum = self::$__module->enum; + self::$getdouble = self::$__module->getdouble; + self::$getint = self::$__module->getint; + self::$re = self::$__module->re; + self::$sys = self::$__module->sys; + self::$types = self::$__module->types; + } + } + + public const EXCEPTION = 8; + public const FALSE = 0; + public const NO = 0; + public const OFF = 0; + public const ON = 1; + public const READABLE = 2; + public const TRUE = 1; + public const TclVersion = 8.6; + public const TkVersion = 8.6; + public const WRITABLE = 4; + public const YES = 1; + public const _checkbutton_count = 0; + public const _varnum = 0; + public const wantobjects = 1; + + public static $ACTIVE = "active"; + public static $ALL = "all"; + public static $ANCHOR = "anchor"; + public static $ARC = "arc"; + public static $BASELINE = "baseline"; + public static $BEVEL = "bevel"; + public static $BOTH = "both"; + public static $BOTTOM = "bottom"; + public static $BROWSE = "browse"; + public static $BUTT = "butt"; + public static $CASCADE = "cascade"; + public static $CENTER = "center"; + public static $CHAR = "char"; + public static $CHECKBUTTON = "checkbutton"; + public static $CHORD = "chord"; + public static $COMMAND = "command"; + public static $CURRENT = "current"; + public static $DISABLED = "disabled"; + public static $DOTBOX = "dotbox"; + public static $E = "e"; + public static $END = "end"; + public static $EW = "ew"; + public static $EXTENDED = "extended"; + public static $FIRST = "first"; + public static $FLAT = "flat"; + public static $GROOVE = "groove"; + public static $HIDDEN = "hidden"; + public static $HORIZONTAL = "horizontal"; + public static $INSERT = "insert"; + public static $INSIDE = "inside"; + public static $LAST = "last"; + public static $LEFT = "left"; + public static $MITER = "miter"; + public static $MOVETO = "moveto"; + public static $MULTIPLE = "multiple"; + public static $N = "n"; + public static $NE = "ne"; + public static $NONE = "none"; + public static $NORMAL = "normal"; + public static $NS = "ns"; + public static $NSEW = "nsew"; + public static $NUMERIC = "numeric"; + public static $NW = "nw"; + public static $OUTSIDE = "outside"; + public static $PAGES = "pages"; + public static $PIESLICE = "pieslice"; + public static $PROJECTING = "projecting"; + public static $RADIOBUTTON = "radiobutton"; + public static $RAISED = "raised"; + public static $RIDGE = "ridge"; + public static $RIGHT = "right"; + public static $ROUND = "round"; + public static $S = "s"; + public static $SCROLL = "scroll"; + public static $SE = "se"; + public static $SEL = "sel"; + public static $SEL_FIRST = "sel.first"; + public static $SEL_LAST = "sel.last"; + public static $SEPARATOR = "separator"; + public static $SINGLE = "single"; + public static $SOLID = "solid"; + public static $SUNKEN = "sunken"; + public static $SW = "sw"; + public static $TOP = "top"; + public static $UNDERLINE = "underline"; + public static $UNITS = "units"; + public static $VERTICAL = "vertical"; + public static $W = "w"; + public static $WORD = "word"; + public static $X = "x"; + public static $Y = "y"; + public static $__cached__ = "/opt/anaconda3/lib/python3.11/tkinter/__pycache__/__init__.cpython-311.pyc"; + public static $__file__ = "/opt/anaconda3/lib/python3.11/tkinter/__init__.py"; + public static $__name__ = "tkinter"; + public static $__package__ = "tkinter"; + public static $_default_root = null; + public static $_support_default_root = true; + + public static $BaseWidget = null; + public static $BitmapImage = null; + public static $BooleanVar = null; + public static $Button = null; + public static $CallWrapper = null; + public static $Canvas = null; + public static $Checkbutton = null; + public static $DoubleVar = null; + public static $Entry = null; + public static $Event = null; + public static $EventType = null; + public static $Frame = null; + public static $Grid = null; + public static $Image = null; + public static $IntVar = null; + public static $Label = null; + public static $LabelFrame = null; + public static $Listbox = null; + public static $Menu = null; + public static $Menubutton = null; + public static $Message = null; + public static $Misc = null; + public static $OptionMenu = null; + public static $Pack = null; + public static $PanedWindow = null; + public static $PhotoImage = null; + public static $Place = null; + public static $Radiobutton = null; + public static $Scale = null; + public static $Scrollbar = null; + public static $Spinbox = null; + public static $StringVar = null; + public static $TclError = null; + public static $Text = null; + public static $Tk = null; + public static $Toplevel = null; + public static $Variable = null; + public static $Widget = null; + public static $Wm = null; + public static $XView = null; + public static $YView = null; + public static $_VersionInfoType = null; + public static $__path__ = null; + public static $__spec__ = null; + public static $_magic_re = null; + public static $_setit = null; + public static $_space_re = null; + public static $_tkinter = null; + public static $collections = null; + public static $constants = null; + public static $enum = null; + public static $getdouble = null; + public static $getint = null; + public static $re = null; + public static $sys = null; + public static $types = null; + + public static function NoDefaultRoot() + { + return self::$__module->NoDefaultRoot(); + } + public static function Tcl($screenName=null, $baseName=null, $className="Tk", $useTk=false) + { + return self::$__module->Tcl($screenName, $baseName, $className, $useTk); + } + public static function _cnfmerge($cnfs) + { + return self::$__module->_cnfmerge($cnfs); + } + public static function _destroy_temp_root($master) + { + return self::$__module->_destroy_temp_root($master); + } + public static function _exit($code=0) + { + return self::$__module->_exit($code); + } + public static function _flatten($item) + { + return self::$__module->_flatten($item); + } + public static function _get_default_root($what=null) + { + return self::$__module->_get_default_root($what); + } + public static function _get_temp_root() + { + return self::$__module->_get_temp_root(); + } + public static function _join($value) + { + return self::$__module->_join($value); + } + public static function _parse_version($version) + { + return self::$__module->_parse_version($version); + } + public static function _splitdict($tk, $v, $cut_minus=true, $conv=null) + { + return self::$__module->_splitdict($tk, $v, $cut_minus, $conv); + } + public static function _stringify($value) + { + return self::$__module->_stringify($value); + } + public static function _test() + { + return self::$__module->_test(); + } + public static function _tkerror($err) + { + return self::$__module->_tkerror($err); + } + public static function getboolean($s) + { + return self::$__module->getboolean($s); + } + public static function image_names() + { + return self::$__module->image_names(); + } + public static function image_types() + { + return self::$__module->image_types(); + } + public static function mainloop($n=0) + { + return self::$__module->mainloop($n); + } +} + +tkinter::__init(); diff --git a/lib/python/torch.php b/lib/python/torch.php new file mode 100644 index 0000000..6897bd7 --- /dev/null +++ b/lib/python/torch.php @@ -0,0 +1,978 @@ += 3.0. +*/ +class torch{ + private static ?PyModule $__module = null; + + public static function __init(): void { + if (self::$__module == null) { + self::$__module = PyCore::import('torch'); + self::$AVG = self::$__module->AVG; + self::$AggregationType = self::$__module->AggregationType; + self::$AliasDb = self::$__module->AliasDb; + self::$Any = self::$__module->Any; + self::$AnyType = self::$__module->AnyType; + self::$Argument = self::$__module->Argument; + self::$ArgumentSpec = self::$__module->ArgumentSpec; + self::$AwaitType = self::$__module->AwaitType; + self::$BFloat16Storage = self::$__module->BFloat16Storage; + self::$BFloat16Tensor = self::$__module->BFloat16Tensor; + self::$BenchmarkConfig = self::$__module->BenchmarkConfig; + self::$BenchmarkExecutionStats = self::$__module->BenchmarkExecutionStats; + self::$Block = self::$__module->Block; + self::$BoolStorage = self::$__module->BoolStorage; + self::$BoolTensor = self::$__module->BoolTensor; + self::$BoolType = self::$__module->BoolType; + self::$BufferDict = self::$__module->BufferDict; + self::$ByteStorage = self::$__module->ByteStorage; + self::$ByteTensor = self::$__module->ByteTensor; + self::$CallStack = self::$__module->CallStack; + self::$Callable = self::$__module->Callable; + self::$Capsule = self::$__module->Capsule; + self::$CharStorage = self::$__module->CharStorage; + self::$CharTensor = self::$__module->CharTensor; + self::$ClassType = self::$__module->ClassType; + self::$Code = self::$__module->Code; + self::$CompilationUnit = self::$__module->CompilationUnit; + self::$CompleteArgumentSpec = self::$__module->CompleteArgumentSpec; + self::$ComplexDoubleStorage = self::$__module->ComplexDoubleStorage; + self::$ComplexFloatStorage = self::$__module->ComplexFloatStorage; + self::$ComplexType = self::$__module->ComplexType; + self::$ConcreteModuleType = self::$__module->ConcreteModuleType; + self::$ConcreteModuleTypeBuilder = self::$__module->ConcreteModuleTypeBuilder; + self::$DeepCopyMemoTable = self::$__module->DeepCopyMemoTable; + self::$DeserializationStorageContext = self::$__module->DeserializationStorageContext; + self::$DeviceObjType = self::$__module->DeviceObjType; + self::$Dict = self::$__module->Dict; + self::$DictType = self::$__module->DictType; + self::$DisableTorchFunction = self::$__module->DisableTorchFunction; + self::$DisableTorchFunctionSubclass = self::$__module->DisableTorchFunctionSubclass; + self::$DispatchKey = self::$__module->DispatchKey; + self::$DispatchKeySet = self::$__module->DispatchKeySet; + self::$DoubleStorage = self::$__module->DoubleStorage; + self::$DoubleTensor = self::$__module->DoubleTensor; + self::$EnumType = self::$__module->EnumType; + self::$ErrorReport = self::$__module->ErrorReport; + self::$ExcludeDispatchKeyGuard = self::$__module->ExcludeDispatchKeyGuard; + self::$ExecutionPlan = self::$__module->ExecutionPlan; + self::$FatalError = self::$__module->FatalError; + self::$FileCheck = self::$__module->FileCheck; + self::$FloatStorage = self::$__module->FloatStorage; + self::$FloatTensor = self::$__module->FloatTensor; + self::$FloatType = self::$__module->FloatType; + self::$FunctionSchema = self::$__module->FunctionSchema; + self::$Future = self::$__module->Future; + self::$FutureType = self::$__module->FutureType; + self::$Generator = self::$__module->Generator; + self::$Gradient = self::$__module->Gradient; + self::$Graph = self::$__module->Graph; + self::$GraphExecutorState = self::$__module->GraphExecutorState; + self::$HalfStorage = self::$__module->HalfStorage; + self::$HalfTensor = self::$__module->HalfTensor; + self::$IODescriptor = self::$__module->IODescriptor; + self::$InferredType = self::$__module->InferredType; + self::$IntStorage = self::$__module->IntStorage; + self::$IntTensor = self::$__module->IntTensor; + self::$IntType = self::$__module->IntType; + self::$InterfaceType = self::$__module->InterfaceType; + self::$JITException = self::$__module->JITException; + self::$List = self::$__module->List; + self::$ListType = self::$__module->ListType; + self::$LiteScriptModule = self::$__module->LiteScriptModule; + self::$LockingLogger = self::$__module->LockingLogger; + self::$LoggerBase = self::$__module->LoggerBase; + self::$LongStorage = self::$__module->LongStorage; + self::$LongTensor = self::$__module->LongTensor; + self::$ModuleDict = self::$__module->ModuleDict; + self::$Node = self::$__module->Node; + self::$NoneType = self::$__module->NoneType; + self::$NoopLogger = self::$__module->NoopLogger; + self::$NumberType = self::$__module->NumberType; + self::$OperatorInfo = self::$__module->OperatorInfo; + self::$Optional = self::$__module->Optional; + self::$OptionalType = self::$__module->OptionalType; + self::$PRIVATE_OPS = self::$__module->PRIVATE_OPS; + self::$ParameterDict = self::$__module->ParameterDict; + self::$PyObjectType = self::$__module->PyObjectType; + self::$PyTorchFileReader = self::$__module->PyTorchFileReader; + self::$PyTorchFileWriter = self::$__module->PyTorchFileWriter; + self::$QInt32Storage = self::$__module->QInt32Storage; + self::$QInt8Storage = self::$__module->QInt8Storage; + self::$QUInt2x4Storage = self::$__module->QUInt2x4Storage; + self::$QUInt4x2Storage = self::$__module->QUInt4x2Storage; + self::$QUInt8Storage = self::$__module->QUInt8Storage; + self::$RRefType = self::$__module->RRefType; + self::$SUM = self::$__module->SUM; + self::$ScriptClass = self::$__module->ScriptClass; + self::$ScriptClassFunction = self::$__module->ScriptClassFunction; + self::$ScriptDict = self::$__module->ScriptDict; + self::$ScriptDictIterator = self::$__module->ScriptDictIterator; + self::$ScriptDictKeyIterator = self::$__module->ScriptDictKeyIterator; + self::$ScriptFunction = self::$__module->ScriptFunction; + self::$ScriptList = self::$__module->ScriptList; + self::$ScriptListIterator = self::$__module->ScriptListIterator; + self::$ScriptMethod = self::$__module->ScriptMethod; + self::$ScriptModule = self::$__module->ScriptModule; + self::$ScriptModuleSerializer = self::$__module->ScriptModuleSerializer; + self::$ScriptObject = self::$__module->ScriptObject; + self::$ScriptObjectProperty = self::$__module->ScriptObjectProperty; + self::$SerializationStorageContext = self::$__module->SerializationStorageContext; + self::$Set = self::$__module->Set; + self::$ShortStorage = self::$__module->ShortStorage; + self::$ShortTensor = self::$__module->ShortTensor; + self::$Size = self::$__module->Size; + self::$StaticModule = self::$__module->StaticModule; + self::$Storage = self::$__module->Storage; + self::$StorageBase = self::$__module->StorageBase; + self::$Stream = self::$__module->Stream; + self::$StreamObjType = self::$__module->StreamObjType; + self::$StringType = self::$__module->StringType; + self::$SymBool = self::$__module->SymBool; + self::$SymBoolType = self::$__module->SymBoolType; + self::$SymFloat = self::$__module->SymFloat; + self::$SymInt = self::$__module->SymInt; + self::$SymIntType = self::$__module->SymIntType; + self::$Tag = self::$__module->Tag; + self::$Tensor = self::$__module->Tensor; + self::$TensorType = self::$__module->TensorType; + self::$ThroughputBenchmark = self::$__module->ThroughputBenchmark; + self::$TracingState = self::$__module->TracingState; + self::$Tuple = self::$__module->Tuple; + self::$TupleType = self::$__module->TupleType; + self::$Type = self::$__module->Type; + self::$TypedStorage = self::$__module->TypedStorage; + self::$Union = self::$__module->Union; + self::$UnionType = self::$__module->UnionType; + self::$UntypedStorage = self::$__module->UntypedStorage; + self::$Use = self::$__module->Use; + self::$Value = self::$__module->Value; + self::$_C = self::$__module->_C; + self::$_TorchCompileInductorWrapper = self::$__module->_TorchCompileInductorWrapper; + self::$_TorchCompileWrapper = self::$__module->_TorchCompileWrapper; + self::$_TritonLibrary = self::$__module->_TritonLibrary; + self::$_VF = self::$__module->_VF; + self::$__annotations__ = self::$__module->__annotations__; + self::$__config__ = self::$__module->__config__; + self::$__future__ = self::$__module->__future__; + self::$__path__ = self::$__module->__path__; + self::$__spec__ = self::$__module->__spec__; + self::$_awaits = self::$__module->_awaits; + self::$_classes = self::$__module->_classes; + self::$_compile = self::$__module->_compile; + self::$_custom_op = self::$__module->_custom_op; + self::$_decomp = self::$__module->_decomp; + self::$_deprecated_attrs = self::$__module->_deprecated_attrs; + self::$_dispatch = self::$__module->_dispatch; + self::$_functorch = self::$__module->_functorch; + self::$_guards = self::$__module->_guards; + self::$_higher_order_ops = self::$__module->_higher_order_ops; + self::$_jit_internal = self::$__module->_jit_internal; + self::$_lazy_modules = self::$__module->_lazy_modules; + self::$_linalg_utils = self::$__module->_linalg_utils; + self::$_lobpcg = self::$__module->_lobpcg; + self::$_logging = self::$__module->_logging; + self::$_lowrank = self::$__module->_lowrank; + self::$_meta_registrations = self::$__module->_meta_registrations; + self::$_mkldnn = self::$__module->_mkldnn; + self::$_namedtensor_internals = self::$__module->_namedtensor_internals; + self::$_ops = self::$__module->_ops; + self::$_prims = self::$__module->_prims; + self::$_prims_common = self::$__module->_prims_common; + self::$_refs = self::$__module->_refs; + self::$_sources = self::$__module->_sources; + self::$_storage_classes = self::$__module->_storage_classes; + self::$_subclasses = self::$__module->_subclasses; + self::$_tensor = self::$__module->_tensor; + self::$_tensor_classes = self::$__module->_tensor_classes; + self::$_tensor_str = self::$__module->_tensor_str; + self::$_utils = self::$__module->_utils; + self::$_utils_internal = self::$__module->_utils_internal; + self::$_vmap_internals = self::$__module->_vmap_internals; + self::$_weights_only_unpickler = self::$__module->_weights_only_unpickler; + self::$amp = self::$__module->amp; + self::$ao = self::$__module->ao; + self::$autocast = self::$__module->autocast; + self::$autograd = self::$__module->autograd; + self::$backends = self::$__module->backends; + self::$bfloat16 = self::$__module->bfloat16; + self::$bits16 = self::$__module->bits16; + self::$bits1x8 = self::$__module->bits1x8; + self::$bits2x4 = self::$__module->bits2x4; + self::$bits4x2 = self::$__module->bits4x2; + self::$bits8 = self::$__module->bits8; + self::$bool = self::$__module->bool; + self::$builtins = self::$__module->builtins; + self::$cdouble = self::$__module->cdouble; + self::$cfloat = self::$__module->cfloat; + self::$chalf = self::$__module->chalf; + self::$channels_last = self::$__module->channels_last; + self::$channels_last_3d = self::$__module->channels_last_3d; + self::$classes = self::$__module->classes; + self::$compiler = self::$__module->compiler; + self::$complex128 = self::$__module->complex128; + self::$complex32 = self::$__module->complex32; + self::$complex64 = self::$__module->complex64; + self::$contiguous_format = self::$__module->contiguous_format; + self::$cpp = self::$__module->cpp; + self::$cpu = self::$__module->cpu; + self::$ctypes = self::$__module->ctypes; + self::$cuda = self::$__module->cuda; + self::$default_generator = self::$__module->default_generator; + self::$device = self::$__module->device; + self::$distributed = self::$__module->distributed; + self::$distributions = self::$__module->distributions; + self::$double = self::$__module->double; + self::$dtype = self::$__module->dtype; + self::$enable_grad = self::$__module->enable_grad; + self::$export = self::$__module->export; + self::$fft = self::$__module->fft; + self::$finfo = self::$__module->finfo; + self::$float = self::$__module->float; + self::$float16 = self::$__module->float16; + self::$float32 = self::$__module->float32; + self::$float64 = self::$__module->float64; + self::$float8_e4m3fn = self::$__module->float8_e4m3fn; + self::$float8_e5m2 = self::$__module->float8_e5m2; + self::$func = self::$__module->func; + self::$functional = self::$__module->functional; + self::$futures = self::$__module->futures; + self::$fx = self::$__module->fx; + self::$half = self::$__module->half; + self::$hub = self::$__module->hub; + self::$iinfo = self::$__module->iinfo; + self::$inference_mode = self::$__module->inference_mode; + self::$inspect = self::$__module->inspect; + self::$int = self::$__module->int; + self::$int16 = self::$__module->int16; + self::$int32 = self::$__module->int32; + self::$int64 = self::$__module->int64; + self::$int8 = self::$__module->int8; + self::$jit = self::$__module->jit; + self::$layout = self::$__module->layout; + self::$legacy_contiguous_format = self::$__module->legacy_contiguous_format; + self::$library = self::$__module->library; + self::$linalg = self::$__module->linalg; + self::$long = self::$__module->long; + self::$masked = self::$__module->masked; + self::$math = self::$__module->math; + self::$memory_format = self::$__module->memory_format; + self::$mps = self::$__module->mps; + self::$multiprocessing = self::$__module->multiprocessing; + self::$nested = self::$__module->nested; + self::$nn = self::$__module->nn; + self::$no_grad = self::$__module->no_grad; + self::$ops = self::$__module->ops; + self::$optim = self::$__module->optim; + self::$os = self::$__module->os; + self::$overrides = self::$__module->overrides; + self::$package = self::$__module->package; + self::$per_channel_affine = self::$__module->per_channel_affine; + self::$per_channel_affine_float_qparams = self::$__module->per_channel_affine_float_qparams; + self::$per_channel_symmetric = self::$__module->per_channel_symmetric; + self::$per_tensor_affine = self::$__module->per_tensor_affine; + self::$per_tensor_symmetric = self::$__module->per_tensor_symmetric; + self::$platform = self::$__module->platform; + self::$preserve_format = self::$__module->preserve_format; + self::$profiler = self::$__module->profiler; + self::$py_float = self::$__module->py_float; + self::$py_int = self::$__module->py_int; + self::$qint32 = self::$__module->qint32; + self::$qint8 = self::$__module->qint8; + self::$qscheme = self::$__module->qscheme; + self::$quantization = self::$__module->quantization; + self::$quantized_gru = self::$__module->quantized_gru; + self::$quantized_lstm = self::$__module->quantized_lstm; + self::$quasirandom = self::$__module->quasirandom; + self::$quint2x4 = self::$__module->quint2x4; + self::$quint4x2 = self::$__module->quint4x2; + self::$quint8 = self::$__module->quint8; + self::$random = self::$__module->random; + self::$return_types = self::$__module->return_types; + self::$serialization = self::$__module->serialization; + self::$set_grad_enabled = self::$__module->set_grad_enabled; + self::$short = self::$__module->short; + self::$signal = self::$__module->signal; + self::$sparse = self::$__module->sparse; + self::$sparse_bsc = self::$__module->sparse_bsc; + self::$sparse_bsr = self::$__module->sparse_bsr; + self::$sparse_coo = self::$__module->sparse_coo; + self::$sparse_csc = self::$__module->sparse_csc; + self::$sparse_csr = self::$__module->sparse_csr; + self::$special = self::$__module->special; + self::$storage = self::$__module->storage; + self::$strided = self::$__module->strided; + self::$sys = self::$__module->sys; + self::$testing = self::$__module->testing; + self::$textwrap = self::$__module->textwrap; + self::$torch = self::$__module->torch; + self::$torch_version = self::$__module->torch_version; + self::$types = self::$__module->types; + self::$uint8 = self::$__module->uint8; + self::$utils = self::$__module->utils; + self::$version = self::$__module->version; + self::$windows = self::$__module->windows; + } + } + + public const e = 2.718281828459; + public const inf = INF; + public const nan = NAN; + public const pi = 3.1415926535898; + + public static $TYPE_CHECKING = false; + public static $USE_GLOBAL_DEPS = true; + public static $USE_RTLD_GLOBAL_WITH_LIBTORCH = false; + public static $_GLOBAL_DEVICE_CONTEXT = null; + public static $__cached__ = "/opt/anaconda3/lib/python3.11/site-packages/torch/__pycache__/__init__.cpython-311.pyc"; + public static $__file__ = "/opt/anaconda3/lib/python3.11/site-packages/torch/__init__.py"; + public static $__name__ = "torch"; + public static $__package__ = "torch"; + public static $__version__ = "2.1.1+cu121"; + public static $attr = "wait"; + public static $has_lapack = true; + public static $has_mkl = true; + public static $has_openmp = true; + public static $has_spectral = true; + public static $name = "zeros_like"; + + public static $AVG = null; + public static $AggregationType = null; + public static $AliasDb = null; + public static $Any = null; + public static $AnyType = null; + public static $Argument = null; + public static $ArgumentSpec = null; + public static $AwaitType = null; + public static $BFloat16Storage = null; + public static $BFloat16Tensor = null; + public static $BenchmarkConfig = null; + public static $BenchmarkExecutionStats = null; + public static $Block = null; + public static $BoolStorage = null; + public static $BoolTensor = null; + public static $BoolType = null; + public static $BufferDict = null; + public static $ByteStorage = null; + public static $ByteTensor = null; + public static $CallStack = null; + public static $Callable = null; + public static $Capsule = null; + public static $CharStorage = null; + public static $CharTensor = null; + public static $ClassType = null; + public static $Code = null; + public static $CompilationUnit = null; + public static $CompleteArgumentSpec = null; + public static $ComplexDoubleStorage = null; + public static $ComplexFloatStorage = null; + public static $ComplexType = null; + public static $ConcreteModuleType = null; + public static $ConcreteModuleTypeBuilder = null; + public static $DeepCopyMemoTable = null; + public static $DeserializationStorageContext = null; + public static $DeviceObjType = null; + public static $Dict = null; + public static $DictType = null; + public static $DisableTorchFunction = null; + public static $DisableTorchFunctionSubclass = null; + public static $DispatchKey = null; + public static $DispatchKeySet = null; + public static $DoubleStorage = null; + public static $DoubleTensor = null; + public static $EnumType = null; + public static $ErrorReport = null; + public static $ExcludeDispatchKeyGuard = null; + public static $ExecutionPlan = null; + public static $FatalError = null; + public static $FileCheck = null; + public static $FloatStorage = null; + public static $FloatTensor = null; + public static $FloatType = null; + public static $FunctionSchema = null; + public static $Future = null; + public static $FutureType = null; + public static $Generator = null; + public static $Gradient = null; + public static $Graph = null; + public static $GraphExecutorState = null; + public static $HalfStorage = null; + public static $HalfTensor = null; + public static $IODescriptor = null; + public static $InferredType = null; + public static $IntStorage = null; + public static $IntTensor = null; + public static $IntType = null; + public static $InterfaceType = null; + public static $JITException = null; + public static $List = null; + public static $ListType = null; + public static $LiteScriptModule = null; + public static $LockingLogger = null; + public static $LoggerBase = null; + public static $LongStorage = null; + public static $LongTensor = null; + public static $ModuleDict = null; + public static $Node = null; + public static $NoneType = null; + public static $NoopLogger = null; + public static $NumberType = null; + public static $OperatorInfo = null; + public static $Optional = null; + public static $OptionalType = null; + public static $PRIVATE_OPS = null; + public static $ParameterDict = null; + public static $PyObjectType = null; + public static $PyTorchFileReader = null; + public static $PyTorchFileWriter = null; + public static $QInt32Storage = null; + public static $QInt8Storage = null; + public static $QUInt2x4Storage = null; + public static $QUInt4x2Storage = null; + public static $QUInt8Storage = null; + public static $RRefType = null; + public static $SUM = null; + public static $ScriptClass = null; + public static $ScriptClassFunction = null; + public static $ScriptDict = null; + public static $ScriptDictIterator = null; + public static $ScriptDictKeyIterator = null; + public static $ScriptFunction = null; + public static $ScriptList = null; + public static $ScriptListIterator = null; + public static $ScriptMethod = null; + public static $ScriptModule = null; + public static $ScriptModuleSerializer = null; + public static $ScriptObject = null; + public static $ScriptObjectProperty = null; + public static $SerializationStorageContext = null; + public static $Set = null; + public static $ShortStorage = null; + public static $ShortTensor = null; + public static $Size = null; + public static $StaticModule = null; + public static $Storage = null; + public static $StorageBase = null; + public static $Stream = null; + public static $StreamObjType = null; + public static $StringType = null; + public static $SymBool = null; + public static $SymBoolType = null; + public static $SymFloat = null; + public static $SymInt = null; + public static $SymIntType = null; + public static $Tag = null; + public static $Tensor = null; + public static $TensorType = null; + public static $ThroughputBenchmark = null; + public static $TracingState = null; + public static $Tuple = null; + public static $TupleType = null; + public static $Type = null; + public static $TypedStorage = null; + public static $Union = null; + public static $UnionType = null; + public static $UntypedStorage = null; + public static $Use = null; + public static $Value = null; + public static $_C = null; + public static $_TorchCompileInductorWrapper = null; + public static $_TorchCompileWrapper = null; + public static $_TritonLibrary = null; + public static $_VF = null; + public static $__annotations__ = null; + public static $__config__ = null; + public static $__future__ = null; + public static $__path__ = null; + public static $__spec__ = null; + public static $_awaits = null; + public static $_classes = null; + public static $_compile = null; + public static $_custom_op = null; + public static $_decomp = null; + public static $_deprecated_attrs = null; + public static $_dispatch = null; + public static $_functorch = null; + public static $_guards = null; + public static $_higher_order_ops = null; + public static $_jit_internal = null; + public static $_lazy_modules = null; + public static $_linalg_utils = null; + public static $_lobpcg = null; + public static $_logging = null; + public static $_lowrank = null; + public static $_meta_registrations = null; + public static $_mkldnn = null; + public static $_namedtensor_internals = null; + public static $_ops = null; + public static $_prims = null; + public static $_prims_common = null; + public static $_refs = null; + public static $_sources = null; + public static $_storage_classes = null; + public static $_subclasses = null; + public static $_tensor = null; + public static $_tensor_classes = null; + public static $_tensor_str = null; + public static $_utils = null; + public static $_utils_internal = null; + public static $_vmap_internals = null; + public static $_weights_only_unpickler = null; + public static $amp = null; + public static $ao = null; + public static $autocast = null; + public static $autograd = null; + public static $backends = null; + public static $bfloat16 = null; + public static $bits16 = null; + public static $bits1x8 = null; + public static $bits2x4 = null; + public static $bits4x2 = null; + public static $bits8 = null; + public static $bool = null; + public static $builtins = null; + public static $cdouble = null; + public static $cfloat = null; + public static $chalf = null; + public static $channels_last = null; + public static $channels_last_3d = null; + public static $classes = null; + public static $compiler = null; + public static $complex128 = null; + public static $complex32 = null; + public static $complex64 = null; + public static $contiguous_format = null; + public static $cpp = null; + public static $cpu = null; + public static $ctypes = null; + public static $cuda = null; + public static $default_generator = null; + public static $device = null; + public static $distributed = null; + public static $distributions = null; + public static $double = null; + public static $dtype = null; + public static $enable_grad = null; + public static $export = null; + public static $fft = null; + public static $finfo = null; + public static $float = null; + public static $float16 = null; + public static $float32 = null; + public static $float64 = null; + public static $float8_e4m3fn = null; + public static $float8_e5m2 = null; + public static $func = null; + public static $functional = null; + public static $futures = null; + public static $fx = null; + public static $half = null; + public static $hub = null; + public static $iinfo = null; + public static $inference_mode = null; + public static $inspect = null; + public static $int = null; + public static $int16 = null; + public static $int32 = null; + public static $int64 = null; + public static $int8 = null; + public static $jit = null; + public static $layout = null; + public static $legacy_contiguous_format = null; + public static $library = null; + public static $linalg = null; + public static $long = null; + public static $masked = null; + public static $math = null; + public static $memory_format = null; + public static $mps = null; + public static $multiprocessing = null; + public static $nested = null; + public static $nn = null; + public static $no_grad = null; + public static $ops = null; + public static $optim = null; + public static $os = null; + public static $overrides = null; + public static $package = null; + public static $per_channel_affine = null; + public static $per_channel_affine_float_qparams = null; + public static $per_channel_symmetric = null; + public static $per_tensor_affine = null; + public static $per_tensor_symmetric = null; + public static $platform = null; + public static $preserve_format = null; + public static $profiler = null; + public static $py_float = null; + public static $py_int = null; + public static $qint32 = null; + public static $qint8 = null; + public static $qscheme = null; + public static $quantization = null; + public static $quantized_gru = null; + public static $quantized_lstm = null; + public static $quasirandom = null; + public static $quint2x4 = null; + public static $quint4x2 = null; + public static $quint8 = null; + public static $random = null; + public static $return_types = null; + public static $serialization = null; + public static $set_grad_enabled = null; + public static $short = null; + public static $signal = null; + public static $sparse = null; + public static $sparse_bsc = null; + public static $sparse_bsr = null; + public static $sparse_coo = null; + public static $sparse_csc = null; + public static $sparse_csr = null; + public static $special = null; + public static $storage = null; + public static $strided = null; + public static $sys = null; + public static $testing = null; + public static $textwrap = null; + public static $torch = null; + public static $torch_version = null; + public static $types = null; + public static $uint8 = null; + public static $utils = null; + public static $version = null; + public static $windows = null; + + public static function __getattr__($name) + { + return self::$__module->__getattr__($name); + } + public static function _assert($condition, $message) + { + return self::$__module->_assert($condition, $message); + } + public static function _check($cond, $message=null) + { + return self::$__module->_check($cond, $message); + } + public static function _check_index($cond, $message=null) + { + return self::$__module->_check_index($cond, $message); + } + public static function _check_not_implemented($cond, $message=null) + { + return self::$__module->_check_not_implemented($cond, $message); + } + public static function _check_tensor_all($cond, $message=null) + { + return self::$__module->_check_tensor_all($cond, $message); + } + public static function _check_tensor_all_with($error_type, $cond, $message=null) + { + return self::$__module->_check_tensor_all_with($error_type, $cond, $message); + } + public static function _check_type($cond, $message=null) + { + return self::$__module->_check_type($cond, $message); + } + public static function _check_value($cond, $message=null) + { + return self::$__module->_check_value($cond, $message); + } + public static function _check_with($error_type, $cond, $message) + { + return self::$__module->_check_with($error_type, $cond, $message); + } + public static function _disable_dynamo($fn=null, $recursive=true) + { + return self::$__module->_disable_dynamo($fn, $recursive); + } + public static function _import_dotted_name($name) + { + return self::$__module->_import_dotted_name($name); + } + public static function _load_global_deps() + { + return self::$__module->_load_global_deps(); + } + public static function _preload_cuda_deps($lib_folder, $lib_name) + { + return self::$__module->_preload_cuda_deps($lib_folder, $lib_name); + } + public static function _register_device_module($device_type, $module) + { + return self::$__module->_register_device_module($device_type, $module); + } + public static function _running_with_deploy() + { + return self::$__module->_running_with_deploy(); + } + public static function _sparse_coo_tensor_unsafe() + { + return self::$__module->_sparse_coo_tensor_unsafe(); + } + public static function _warn_typed_storage_removal($stacklevel=2) + { + return self::$__module->_warn_typed_storage_removal($stacklevel); + } + public static function align_tensors() + { + return self::$__module->align_tensors(); + } + public static function are_deterministic_algorithms_enabled() + { + return self::$__module->are_deterministic_algorithms_enabled(); + } + public static function atleast_1d() + { + return self::$__module->atleast_1d(); + } + public static function atleast_2d() + { + return self::$__module->atleast_2d(); + } + public static function atleast_3d() + { + return self::$__module->atleast_3d(); + } + public static function block_diag() + { + return self::$__module->block_diag(); + } + public static function broadcast_shapes() + { + return self::$__module->broadcast_shapes(); + } + public static function broadcast_tensors() + { + return self::$__module->broadcast_tensors(); + } + public static function cartesian_prod() + { + return self::$__module->cartesian_prod(); + } + public static function cdist($x1, $x2, $p=2, $compute_mode="use_mm_for_euclid_dist_if_necessary") + { + return self::$__module->cdist($x1, $x2, $p, $compute_mode); + } + public static function chain_matmul() + { + return self::$__module->chain_matmul(); + } + public static function classproperty($func) + { + return self::$__module->classproperty($func); + } + public static function compile($model=null) + { + return self::$__module->compile($model); + } + public static function compiled_with_cxx11_abi() + { + return self::$__module->compiled_with_cxx11_abi(); + } + public static function eig($self, $eigenvectors=false) + { + return self::$__module->eig($self, $eigenvectors); + } + public static function einsum() + { + return self::$__module->einsum(); + } + public static function from_dlpack($ext_tensor) + { + return self::$__module->from_dlpack($ext_tensor); + } + public static function get_deterministic_debug_mode() + { + return self::$__module->get_deterministic_debug_mode(); + } + public static function get_file_path() + { + return self::$__module->get_file_path(); + } + public static function get_float32_matmul_precision() + { + return self::$__module->get_float32_matmul_precision(); + } + public static function get_rng_state() + { + return self::$__module->get_rng_state(); + } + public static function initial_seed() + { + return self::$__module->initial_seed(); + } + public static function is_deterministic_algorithms_warn_only_enabled() + { + return self::$__module->is_deterministic_algorithms_warn_only_enabled(); + } + public static function is_storage($obj) + { + return self::$__module->is_storage($obj); + } + public static function is_tensor($obj) + { + return self::$__module->is_tensor($obj); + } + public static function is_warn_always_enabled() + { + return self::$__module->is_warn_always_enabled(); + } + public static function load($f, $map_location=null, $pickle_module=null) + { + return self::$__module->load($f, $map_location, $pickle_module); + } + public static function lobpcg($A, $k=null, $B=null, $X=null, $n=null, $iK=null, $niter=null, $tol=null, $largest=null, $method=null, $tracker=null, $ortho_iparams=null, $ortho_fparams=null, $ortho_bparams=null) + { + return self::$__module->lobpcg($A, $k, $B, $X, $n, $iK, $niter, $tol, $largest, $method, $tracker, $ortho_iparams, $ortho_fparams, $ortho_bparams); + } + public static function lstsq($input, $A) + { + return self::$__module->lstsq($input, $A); + } + public static function lu() + { + return self::$__module->lu(); + } + public static function manual_seed($seed) + { + return self::$__module->manual_seed($seed); + } + public static function matrix_rank($input, $tol=null, $symmetric=false) + { + return self::$__module->matrix_rank($input, $tol, $symmetric); + } + public static function meshgrid() + { + return self::$__module->meshgrid(); + } + public static function norm($input, $p="fro", $dim=null, $keepdim=false, $out=null, $dtype=null) + { + return self::$__module->norm($input, $p, $dim, $keepdim, $out, $dtype); + } + public static function pca_lowrank($A, $q=null, $center=true, $niter=2) + { + return self::$__module->pca_lowrank($A, $q, $center, $niter); + } + public static function prepare_multiprocessing_environment($path) + { + return self::$__module->prepare_multiprocessing_environment($path); + } + public static function save($obj, $f, $pickle_module=null, $pickle_protocol=2, $_use_new_zipfile_serialization=true, $_disable_byteorder_record=false) + { + return self::$__module->save($obj, $f, $pickle_module, $pickle_protocol, $_use_new_zipfile_serialization, $_disable_byteorder_record); + } + public static function seed() + { + return self::$__module->seed(); + } + public static function set_default_device($device) + { + return self::$__module->set_default_device($device); + } + public static function set_default_dtype($d) + { + return self::$__module->set_default_dtype($d); + } + public static function set_default_tensor_type($t) + { + return self::$__module->set_default_tensor_type($t); + } + public static function set_deterministic_debug_mode($debug_mode) + { + return self::$__module->set_deterministic_debug_mode($debug_mode); + } + public static function set_float32_matmul_precision($precision) + { + return self::$__module->set_float32_matmul_precision($precision); + } + public static function set_printoptions($precision=null, $threshold=null, $edgeitems=null, $linewidth=null, $profile=null, $sci_mode=null) + { + return self::$__module->set_printoptions($precision, $threshold, $edgeitems, $linewidth, $profile, $sci_mode); + } + public static function set_rng_state($new_state) + { + return self::$__module->set_rng_state($new_state); + } + public static function set_warn_always($b) + { + return self::$__module->set_warn_always($b); + } + public static function solve($input, $A) + { + return self::$__module->solve($input, $A); + } + public static function split($tensor, $split_size_or_sections, $dim=0) + { + return self::$__module->split($tensor, $split_size_or_sections, $dim); + } + public static function stft($input, $n_fft, $hop_length=null, $win_length=null, $window=null, $center=true, $pad_mode="reflect", $normalized=false, $onesided=null, $return_complex=null) + { + return self::$__module->stft($input, $n_fft, $hop_length, $win_length, $window, $center, $pad_mode, $normalized, $onesided, $return_complex); + } + public static function svd_lowrank($A, $q=6, $niter=2, $M=null) + { + return self::$__module->svd_lowrank($A, $q, $niter, $M); + } + public static function sym_float($a) + { + return self::$__module->sym_float($a); + } + public static function sym_int($a) + { + return self::$__module->sym_int($a); + } + public static function sym_max($a, $b) + { + return self::$__module->sym_max($a, $b); + } + public static function sym_min($a, $b) + { + return self::$__module->sym_min($a, $b); + } + public static function sym_not($a) + { + return self::$__module->sym_not($a); + } + public static function symeig($input, $eigenvectors=false, $upper=true) + { + return self::$__module->symeig($input, $eigenvectors, $upper); + } + public static function tensordot($a, $b, $dims=2, $out=null) + { + return self::$__module->tensordot($a, $b, $dims, $out); + } + public static function typename($o) + { + return self::$__module->typename($o); + } + public static function unique() + { + return self::$__module->unique(); + } + public static function unique_consecutive() + { + return self::$__module->unique_consecutive(); + } + public static function use_deterministic_algorithms($mode) + { + return self::$__module->use_deterministic_algorithms($mode); + } + public static function vmap($func, $in_dims=0, $out_dims=0, $randomness="error") + { + return self::$__module->vmap($func, $in_dims, $out_dims, $randomness); + } +} + +torch::__init(); diff --git a/lib/python/uuid.php b/lib/python/uuid.php new file mode 100644 index 0000000..01ca4cd --- /dev/null +++ b/lib/python/uuid.php @@ -0,0 +1,206 @@ +>> import uuid + + # make a UUID based on the host ID and current time + >>> uuid.uuid1() # doctest: +SKIP + UUID('a8098c1a-f86e-11da-bd1a-00112444be1e') + + # make a UUID using an MD5 hash of a namespace UUID and a name + >>> uuid.uuid3(uuid.NAMESPACE_DNS, 'python.org') + UUID('6fa459ea-ee8a-3ca4-894e-db77e160355e') + + # make a random UUID + >>> uuid.uuid4() # doctest: +SKIP + UUID('16fd2706-8baf-433b-82eb-8c7fada847da') + + # make a UUID using a SHA-1 hash of a namespace UUID and a name + >>> uuid.uuid5(uuid.NAMESPACE_DNS, 'python.org') + UUID('886313e1-3b8a-5372-9b90-0c9aee199e5d') + + # make a UUID from a string of hex digits (braces and hyphens ignored) + >>> x = uuid.UUID('{00010203-0405-0607-0809-0a0b0c0d0e0f}') + + # convert a UUID to a string of hex digits in standard form + >>> str(x) + '00010203-0405-0607-0809-0a0b0c0d0e0f' + + # get the raw 16 bytes of the UUID + >>> x.bytes + b'\x00\x01\x02\x03\x04\x05\x06\x07\x08\t\n\x0b\x0c\r\x0e\x0f' + + # make a UUID from a 16-byte string + >>> uuid.UUID(bytes=x.bytes) + UUID('00010203-0405-0607-0809-0a0b0c0d0e0f') +*/ +class uuid{ + private static ?PyModule $__module = null; + + public static function __init(): void { + if (self::$__module == null) { + self::$__module = PyCore::import('uuid'); + self::$Enum = self::$__module->Enum; + self::$NAMESPACE_DNS = self::$__module->NAMESPACE_DNS; + self::$NAMESPACE_OID = self::$__module->NAMESPACE_OID; + self::$NAMESPACE_URL = self::$__module->NAMESPACE_URL; + self::$NAMESPACE_X500 = self::$__module->NAMESPACE_X500; + self::$SafeUUID = self::$__module->SafeUUID; + self::$UUID = self::$__module->UUID; + self::$_GETTERS = self::$__module->_GETTERS; + self::$_OS_GETTERS = self::$__module->_OS_GETTERS; + self::$__spec__ = self::$__module->__spec__; + self::$_uuid = self::$__module->_uuid; + self::$bytes_ = self::$__module->bytes_; + self::$int_ = self::$__module->int_; + self::$os = self::$__module->os; + self::$platform = self::$__module->platform; + self::$sys = self::$__module->sys; + } + } + + public const _has_uuid_generate_time_safe = 1; + + public static $RESERVED_FUTURE = "reserved for future definition"; + public static $RESERVED_MICROSOFT = "reserved for Microsoft compatibility"; + public static $RESERVED_NCS = "reserved for NCS compatibility"; + public static $RFC_4122 = "specified in RFC 4122"; + public static $_AIX = false; + public static $_LINUX = true; + public static $_MAC_DELIM = ":"; + public static $_MAC_OMITS_LEADING_ZEROES = false; + public static $_UuidCreate = null; + public static $__author__ = "Ka-Ping Yee "; + public static $__cached__ = "/opt/anaconda3/lib/python3.11/__pycache__/uuid.cpython-311.pyc"; + public static $__file__ = "/opt/anaconda3/lib/python3.11/uuid.py"; + public static $__name__ = "uuid"; + public static $__package__ = ""; + public static $_last_timestamp = null; + public static $_node = null; + public static $_platform_system = "Linux"; + + public static $Enum = null; + public static $NAMESPACE_DNS = null; + public static $NAMESPACE_OID = null; + public static $NAMESPACE_URL = null; + public static $NAMESPACE_X500 = null; + public static $SafeUUID = null; + public static $UUID = null; + public static $_GETTERS = null; + public static $_OS_GETTERS = null; + public static $__spec__ = null; + public static $_uuid = null; + public static $bytes_ = null; + public static $int_ = null; + public static $os = null; + public static $platform = null; + public static $sys = null; + + public static function _arp_getnode() + { + return self::$__module->_arp_getnode(); + } + public static function _find_mac_near_keyword($command, $args, $keywords, $get_word_index) + { + return self::$__module->_find_mac_near_keyword($command, $args, $keywords, $get_word_index); + } + public static function _find_mac_under_heading($command, $args, $heading) + { + return self::$__module->_find_mac_under_heading($command, $args, $heading); + } + public static function _get_command_stdout($command) + { + return self::$__module->_get_command_stdout($command); + } + public static function _ifconfig_getnode() + { + return self::$__module->_ifconfig_getnode(); + } + public static function _ip_getnode() + { + return self::$__module->_ip_getnode(); + } + public static function _ipconfig_getnode() + { + return self::$__module->_ipconfig_getnode(); + } + public static function _is_universal($mac) + { + return self::$__module->_is_universal($mac); + } + public static function _lanscan_getnode() + { + return self::$__module->_lanscan_getnode(); + } + public static function _load_system_functions() + { + return self::$__module->_load_system_functions(); + } + public static function _netbios_getnode() + { + return self::$__module->_netbios_getnode(); + } + public static function _netstat_getnode() + { + return self::$__module->_netstat_getnode(); + } + public static function _parse_mac($word) + { + return self::$__module->_parse_mac($word); + } + public static function _random_getnode() + { + return self::$__module->_random_getnode(); + } + public static function _simple_enum($etype=array ( +)) + { + return self::$__module->_simple_enum($etype); + } + public static function _unix_getnode() + { + return self::$__module->_unix_getnode(); + } + public static function _windll_getnode() + { + return self::$__module->_windll_getnode(); + } + public static function getnode() + { + return self::$__module->getnode(); + } + public static function uuid1($node=null, $clock_seq=null) + { + return self::$__module->uuid1($node, $clock_seq); + } + public static function uuid3($namespace, $name) + { + return self::$__module->uuid3($namespace, $name); + } + public static function uuid4() + { + return self::$__module->uuid4(); + } + public static function uuid5($namespace, $name) + { + return self::$__module->uuid5($namespace, $name); + } +} + +uuid::__init(); diff --git a/tools/gen-lib.php b/tools/gen-lib.php new file mode 100644 index 0000000..0ad1751 --- /dev/null +++ b/tools/gen-lib.php @@ -0,0 +1,133 @@ +{$name}; + + if (is_numeric($attr)) { + $constants[$name] = $attr; + } elseif (is_bool($attr) or is_string($attr)) { + $staticProperties[$name] = value_to_repr($attr); + } elseif ($attr === null) { + $staticProperties[$name] = value_to_repr(null); + } elseif ($name === '__doc__') { + $comment = strval($attr); + } elseif (in_array($name, $ignoreAttrs)) { + continue; + } elseif ($attr instanceof PyStr) { + $staticProperties[$name] = value_to_repr(PyCore::scalar($attr)); + } else { + $type = (strval(PyCore::type($attr))); + if ($type === "" or $type === "") { + try { + $info = $inspect->getfullargspec($attr); + } catch (\Throwable $e) { + continue; + } + $args = $info[0]; + $defaultValue = $info[3]; + $functions[$name] = [ + 'args' => gen_args($args, $defaultValue), + 'call' => gen_args($args), + ]; + } else { + $dynamicProperties[$name] = $type; + } + } +} + +$module_name_ext = 'python.' . $module_name; +$namespace = gen_namespace($module_name_ext); +$sub_dir = str_replace('.', '/', $module_name_ext); +$class = basename($sub_dir); + +ob_start(); +include __DIR__ . '/templates/pymodule.tpl'; +$out = '; + +use \PyModule; +use \PyCore; + +/** + +*/ +class +{ + private static ?PyModule $__module = null; + + public static function __init(): void { + if (self::$__module == null) { + self::$__module = PyCore::import(''); + $value): ?> + self::$ = self::$__module->; + + } + } + + $value): ?> + public const = ; + + + $value): ?> + public static $ = ; + + + $value): ?> + public static $ = null; + + + $info): ?> + public static function () + { + return self::$__module->(); + } + +} + +::__init();