Did I find the right examples for you? yes no

All Samples(35)  |  Call(0)  |  Derive(0)  |  Import(35)
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/f/u/fusepy-HEAD/examples/memoryll.py   fusepy(Download)
#!/usr/bin/env python
 
from collections import defaultdict
from errno import ENOENT, EROFS
from stat import S_IFMT, S_IMODE, S_IFDIR, S_IFREG

src/f/u/fusepy-HEAD/examples/context.py   fusepy(Download)
#!/usr/bin/env python
 
from errno import ENOENT
from stat import S_IFDIR, S_IFREG
from sys import argv, exit
        elif path == '/uid':
            size = len('%s\n' % uid)
            st = dict(st_mode=(S_IFREG | 0444), st_size=size)
        elif path == '/gid':
            size = len('%s\n' % gid)
            st = dict(st_mode=(S_IFREG | 0444), st_size=size)
        elif path == '/pid':
            size = len('%s\n' % pid)
            st = dict(st_mode=(S_IFREG | 0444), st_size=size)

src/f/u/fusepy-HEAD/examples/memory.py   fusepy(Download)
from collections import defaultdict
from errno import ENOENT
from stat import S_IFDIR, S_IFLNK, S_IFREG
from sys import argv, exit
from time import time
    def create(self, path, mode):
        self.files[path] = dict(st_mode=(S_IFREG | mode), st_nlink=1,
                                st_size=0, st_ctime=time(), st_mtime=time(),
                                st_atime=time())
 

src/c/b/cbdfs-HEAD/fuse-python-cvs/example/hello.py   cbdfs(Download)
            st.st_nlink = 2
        elif path == hello_path:
            st.st_mode = stat.S_IFREG | 0444
            st.st_nlink = 1
            st.st_size = len(hello_str)

src/f/u/fuse-python-0.2/example/hello.py   fuse-python(Download)
            st.st_nlink = 2
        elif path == hello_path:
            st.st_mode = stat.S_IFREG | 0444
            st.st_nlink = 1
            st.st_size = len(hello_str)

src/p/y/pygtrie-0.9.1/example.py   pygtrie(Download)
        except OSError:
            continue
        if stat.S_IFMT(filestat.st_mode) == stat.S_IFREG:
            t[filename] = filestat.st_size
 

src/p/y/pytrie-HEAD/example.py   pytrie(Download)
        except OSError:
            continue
        if stat.S_IFMT(filestat.st_mode) == stat.S_IFREG:
            t[filename] = filestat.st_size
 

src/l/i/lib-pyFreenet-staging-HEAD/fcp/freenetfs.py   lib-pyFreenet-staging(Download)
            mode |= stat.S_IFBLK
        if kw.get('isreg', False):
            mode |= stat.S_IFREG
        if kw.get('isfifo', False):
            mode |= stat.S_IFIFO
            mode |= stat.S_IFBLK
        if kw.pop('isreg', False):
            mode |= stat.S_IFREG
        if kw.pop('isfifo', False):
            mode |= stat.S_IFIFO
        elif attr in ['isreg', 'isfile']:
            if val:
                self[stat.ST_MODE] |= stat.S_IFREG
            else:
                self[stat.ST_MODE] &= ~stat.S_IFREG

src/m/e/mercurial-2.9.1/mercurial/pure/osutil.py   Mercurial(Download)
def _mode_to_kind(mode):
    if statmod.S_ISREG(mode):
        return statmod.S_IFREG
    if statmod.S_ISDIR(mode):
        return statmod.S_IFDIR

src/h/g/hg-HEAD/mercurial/pure/osutil.py   hg(Download)
def _mode_to_kind(mode):
    if statmod.S_ISREG(mode):
        return statmod.S_IFREG
    if statmod.S_ISDIR(mode):
        return statmod.S_IFDIR

  1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9  Next