Did I find the right examples for you? yes no

All Samples(43)  |  Call(0)  |  Derive(0)  |  Import(43)
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/m/o/modern-python-example-HEAD/lib/python2.7/site-packages/logilab/common/fileutils.py   modern-python-example(Download)
from os.path import abspath
from os import sep, mkdir, remove, listdir, stat, chmod, walk
from stat import ST_MODE, S_IWRITE
from cStringIO import StringIO
 
    def __init__(self, filepath, mode):
        self.original_mode = stat(filepath)[ST_MODE]
        self.mode_changed = False
        if mode in ('w', 'a', 'wb', 'ab'):
            if not self.original_mode & S_IWRITE:
                chmod(filepath, self.original_mode | S_IWRITE)

src/m/o/modern-python-example-HEAD/lib/python2.7/site-packages/logilab/common/changelog.py   modern-python-example(Download)
 
import sys
from stat import S_IWRITE
 
BULLET = '*'
    def save(self):
        """write back change log"""
        # filetutils isn't importable in appengine, so import locally
        from logilab.common.fileutils import ensure_fs_mode
        ensure_fs_mode(self.file, S_IWRITE)

src/m/o/modern-python-example-HEAD/lib/python2.7/site-packages/logilab/common/test/unittest_fileutils.py   modern-python-example(Download)
 
import sys, os, tempfile, shutil
from stat import S_IWRITE
from os.path import join
 

src/p/y/pyant-0.0.5/pyant/extensions/file.py   pyant(Download)
        'S_ENFMT' : stat.S_ENFMT,
        'S_IREAD' : stat.S_IREAD,
        'S_IWRITE' : stat.S_IWRITE,
        'S_IEXEC' : stat.S_IEXEC,
        'UF_NODUMP' : stat.UF_NODUMP,

src/w/m/WMCore-HEAD/src/python/WMCore/WMSpec/Steps/Executors/AlcaHarvest.py   WMCore(Download)
                    fout.close()
 
                    os.chmod(filenameDB, stat.S_IREAD | stat.S_IWRITE | stat.S_IRUSR | stat.S_IWUSR | stat.S_IRGRP | stat.S_IWGRP | stat.S_IROTH | stat.S_IWOTH)
                    os.chmod(filenameTXT, stat.S_IREAD | stat.S_IWRITE | stat.S_IRUSR | stat.S_IWUSR | stat.S_IRGRP | stat.S_IWGRP | stat.S_IROTH | stat.S_IWOTH)
 

src/f/i/files-1.1.1/files.py   files(Download)
            s |= stat.S_IREAD
        elif any("w" in i for i in mode) > 0:
            s |= stat.S_IWRITE
 
        if "r" in mode[0]:

src/r/e/relinux-HEAD/src/relinux/fsutil.py   relinux(Download)
    elif c == 1:
        rbit = stat.S_IREAD
        wbit = stat.S_IWRITE
        ebit = stat.S_IEXEC
    elif c == 2:

src/c/o/commons-HEAD/src/python/twitter/common/dirutil/__init__.py   commons(Download)
  path_mode = os.stat(path).st_mode
  path_mode &= int('777', 8)
  path_mode |= stat.S_IWRITE
  os.chmod(path, path_mode)
 

src/u/p/updater4pyi-0.2/updater4pyi/upd_core.py   updater4pyi(Download)
                # make sure the file is executable
                os.chmod(tmpfile.name,
                         stat.S_IREAD|stat.S_IWRITE|stat.S_IEXEC|
                         stat.S_IRUSR|stat.S_IWUSR|stat.S_IXUSR|
                         stat.S_IRGRP|stat.S_IXGRP|

src/d/d/ddocker-HEAD/bin/pex.venv/lib/python2.7/site-packages/twitter/common/python/common.py   ddocker(Download)
  path_mode = os.stat(path).st_mode
  path_mode &= int('777', 8)
  path_mode |= stat.S_IWRITE
  os.chmod(path, path_mode)
 

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