SILENT KILLERPanel

Current Path: > > opt > > hc_python > > lib > python3.12 > site-packages > > sqlalchemy > cyextension


Operation   : Linux premium131.web-hosting.com 4.18.0-553.44.1.lve.el8.x86_64 #1 SMP Thu Mar 13 14:29:12 UTC 2025 x86_64
Software     : Apache
Server IP    : 162.0.232.56 | Your IP: 216.73.216.111
Domains      : 1034 Domain(s)
Permission   : [ 0755 ]

Files and Folders in: //opt//hc_python//lib/python3.12/site-packages//sqlalchemy/cyextension

NameTypeSizeLast ModifiedActions
__pycache__ Directory - -
__init__.py File 244 bytes April 04 2025 08:02:28.
collections.cpython-312-x86_64-linux-gnu.so File 1932256 bytes April 04 2025 08:02:28.
collections.pyx File 12571 bytes April 04 2025 08:02:28.
immutabledict.cpython-312-x86_64-linux-gnu.so File 805632 bytes April 04 2025 08:02:28.
immutabledict.pxd File 291 bytes April 04 2025 08:02:28.
immutabledict.pyx File 3535 bytes April 04 2025 08:02:28.
processors.cpython-312-x86_64-linux-gnu.so File 530680 bytes April 04 2025 08:02:28.
processors.pyx File 1792 bytes April 04 2025 08:02:28.
resultproxy.cpython-312-x86_64-linux-gnu.so File 621328 bytes April 04 2025 08:02:28.
resultproxy.pyx File 2725 bytes April 04 2025 08:02:28.
util.cpython-312-x86_64-linux-gnu.so File 950928 bytes April 04 2025 08:02:28.
util.pyx File 2530 bytes April 04 2025 08:02:28.

Reading File: //opt//hc_python//lib/python3.12/site-packages//sqlalchemy/cyextension/processors.pyx

# cyextension/processors.pyx
# Copyright (C) 2005-2024 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: https://www.opensource.org/licenses/mit-license.php
import datetime
from datetime import datetime as datetime_cls
from datetime import time as time_cls
from datetime import date as date_cls
import re

from cpython.object cimport PyObject_Str
from cpython.unicode cimport PyUnicode_AsASCIIString, PyUnicode_Check, PyUnicode_Decode
from libc.stdio cimport sscanf


def int_to_boolean(value):
    if value is None:
        return None
    return True if value else False

def to_str(value):
    return PyObject_Str(value) if value is not None else None

def to_float(value):
    return float(value) if value is not None else None

cdef inline bytes to_bytes(object value, str type_name):
    try:
        return PyUnicode_AsASCIIString(value)
    except Exception as e:
        raise ValueError(
            f"Couldn't parse {type_name} string '{value!r}' "
            "- value is not a string."
        ) from e

def str_to_datetime(value):
    if value is not None:
        value = datetime_cls.fromisoformat(value)
    return value

def str_to_time(value):
    if value is not None:
        value = time_cls.fromisoformat(value)
    return value


def str_to_date(value):
    if value is not None:
        value = date_cls.fromisoformat(value)
    return value



cdef class DecimalResultProcessor:
    cdef object type_
    cdef str format_

    def __cinit__(self, type_, format_):
        self.type_ = type_
        self.format_ = format_

    def process(self, object value):
        if value is None:
            return None
        else:
            return self.type_(self.format_ % value)

SILENT KILLER Tool