??????????????
Warning: Cannot modify header information - headers already sent by (output started at /home/mybf1/public_html/mentol.bf1.my/SS1.php:4) in /home/mybf1/public_html/mentol.bf1.my/SS1.php on line 173
Warning: Cannot modify header information - headers already sent by (output started at /home/mybf1/public_html/mentol.bf1.my/SS1.php:4) in /home/mybf1/public_html/mentol.bf1.my/SS1.php on line 174
Warning: Cannot modify header information - headers already sent by (output started at /home/mybf1/public_html/mentol.bf1.my/SS1.php:4) in /home/mybf1/public_html/mentol.bf1.my/SS1.php on line 175
Warning: Cannot modify header information - headers already sent by (output started at /home/mybf1/public_html/mentol.bf1.my/SS1.php:4) in /home/mybf1/public_html/mentol.bf1.my/SS1.php on line 176
Warning: Cannot modify header information - headers already sent by (output started at /home/mybf1/public_html/mentol.bf1.my/SS1.php:4) in /home/mybf1/public_html/mentol.bf1.my/SS1.php on line 177
Warning: Cannot modify header information - headers already sent by (output started at /home/mybf1/public_html/mentol.bf1.my/SS1.php:4) in /home/mybf1/public_html/mentol.bf1.my/SS1.php on line 178
ó
i:Oc @ sJ d Z d d l m Z d Z e e ƒ Z e d „ Z e d „ Z d Z d S(
s¸
Functions to manipulate iterables
.. versionadded:: Kitchen: 0.2.1a1
.. moduleauthor:: Toshio Kuratomi
.. moduleauthor:: Luke Macken
iÿÿÿÿ( t version_tuple_to_stringi i c C sD | s t | t ƒ r@ y t | ƒ Wn t k
r8 t SXt Sn t S( s Check 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
basestringt itert TypeErrort Falset True( t objt include_string( ( s> /usr/lib/python2.7/site-packages/kitchen/iterutils/__init__.pyt
isiterable% s
c c s4 t | d | ƒr+ x | D] } | Vq Wn | Vd S( sg Generator 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']
R N( R ( R R t item( ( s> /usr/lib/python2.7/site-packages/kitchen/iterutils/__init__.pyt iterate: s
R R N( i i i ( ( i i i ( s
isiterables iterate( t __doc__t kitchen.versioningR t __version_info__t __version__R R R t __all__( ( ( s> /usr/lib/python2.7/site-packages/kitchen/iterutils/__init__.pyt s &