Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(1)  |  Call(0)  |  Derive(0)  |  Import(1)
int(x=0) -> int or long
int(x, base=10) -> int or long

Convert a number or string to an integer, or return 0 if no arguments
are given.  If x is floating point, the conversion truncates towards zero.
If x is outside the integer range, the function returns a long instead.

If x is not a number or if base is given, then x must be a string or
Unicode object representing an integer literal in the given base.  The
literal can be preceded by '+' or '-' and be surrounded by whitespace.(more...)

src/k/a/karesansui-HEAD/bin/create_storage_volume.py   karesansui(Download)
    from karesansui.lib.virt.virt import KaresansuiVirtConnection
    from karesansui.lib.utils import load_locale, get_pwd_info, get_grp_info
    from karesansui.lib.const import STORAGE_POOL_TYPE, STORAGE_VOLUME_FORMAT, \
                pool_info = pool_obj.get_info()
                if not pool_info['allocation'] or pool_info['allocation'] == 0:
                    storage_volume_allocation_max_size = STORAGE_VOLUME_SIZE_MAX_LENGTH
                    storage_volume_allocation_max_size = long(pool_info['allocation']) / STORAGE_VOLUME_UNIT.get(opts.unit, 1)
                    if pool_info['type'] == 'dir' or pool_info['type'] == 'fs':
                        storage_volume_allocation_max_size = long(pool_info["available"]) / STORAGE_VOLUME_UNIT.get(opts.unit, 1)
                if not pool_info['capacity'] or pool_info['capacity'] == 0:
                    storage_volume_capacity_max_size = STORAGE_VOLUME_SIZE_MAX_LENGTH