All Samples(204091) | Call(203571) | Derive(520) | Import(0)
int(x[, base]) -> integer Convert a string or number to an integer, if possible. A floating point argument will be truncated towards zero (this does not include a string representation of a floating point number!) When converting a string, use the optional base. It is an error to supply a base when converting a non-string. If base is zero, the proper base is guessed based on the string content. If the argument is outside the integer range a long object will be returned instead.
src/l/o/logilab-constraint-0.5.0/examples/rooks.py logilab-constraint(Download)
first = 0
if args:
size = int(args[0])
else:
size = 8
src/q/u/quickflash-HEAD/netcdf/examples/mass_bins/read_bins.py quickflash(Download)
if (num_elems > 1) :
lo_index = int(0)
hi_index = int(num_elems - 1)
self.__bin_max_radii_list.append(list())
self.__num_entries = int(0)
raise RuntimeError("NumBins requries a value")
num_bins = int(words[1])
elif (keyword == "LogScale") :
elif (word[:9] == "Mass_Bin_") :
bin_index = int(word[9:])
bin_masses_index_list[bin_index] = col_index
src/b/a/badger-lib-HEAD/packages/pyparsing/docs/examples/stackish.py badger-lib(Download)
NUMBER = Word(nums)
NUMBER.setParseAction(lambda t:int(t[0]))
FLOAT = Combine(oneOf("+ -") + Word(nums) + "." + Optional(Word(nums)))
FLOAT.setParseAction(lambda t:float(t[0]))
def setBodyLength(tokens):
strBody << Word(srange(r'[\0x00-\0xffff]'), exact=int(tokens[0]))
return ""
BLOB = Combine(QUOTE + Word(nums).setParseAction(setBodyLength) +
COLON + strBody + QUOTE)
src/d/j/django_addexampledata-1.0/addexampledata/management/commands/addexampledata.py django_addexampledata(Download)
def handle(self, *args, **options):
appnames = args
verbosity = int(options.get('verbosity', '2'))
for appname in appnames:
src/g/d/gdata-2.0.17/samples/apps/marketplace_sample/gdata/oauth/__init__.py gdata(Download)
def generate_timestamp():
return int(time.time())
# util function: nonce
# pseudorandom number
def _check_timestamp(self, timestamp):
# verify that timestamp is recentish
timestamp = int(timestamp)
now = int(time.time())
lapsed = now - timestamp
src/g/d/gdata-2.0.17/samples/apps/marketplace_sample/gdata/tlslite/mathtls.py gdata(Download)
def PRF(secret, label, seed, length):
#Split the secret into left and right halves
S1 = secret[ : int(math.ceil(len(secret)/2.0))]
S2 = secret[ int(math.floor(len(secret)/2.0)) : ]
src/p/y/pyzza-HEAD/examples/charts/axes.py pyzza(Download)
g.lineTo(width, 0)
for i in range(10):
g.moveTo(int(i*width/10), 0)
g.lineTo(int(i*width/10), 4)
g.lineTo(width, height)
for i in range(10):
g.moveTo(width-4, int(i*height/10))
g.lineTo(width, int(i*height/10))
src/c/h/Chiplotle-0.4/chiplotle/examples/abstract_masterpiece_virtual.py Chiplotle(Download)
print "width: %d height: %d" % (plotter.margins.soft.width, plotter.margins.soft.height)
pens = raw_input("\nhow many pens do you want to use? ")
numPens = int(pens)
#start in a random spot
for i in range(numPoints):
plotter.nudge(random.randint(int(-xRange), int(xRange)), random.randint(int(-yRange), int(yRange)))
plotter.goto(firstX, firstY)
plotter.pen_up()
src/g/s/gstimbox-HEAD/gstimbox/example.py gstimbox(Download)
exit(-1)
else:
comport = int(argv[1])
b = gSTIMbox(comport)
print "Connected to gSTIMbox (serial port %d)" % comport
src/p/y/pycsp-0.9.0/examples/Mandelbrot/mandelbrot_ctypes.py pycsp(Download)
sys.exit(0)
workers = int(args[1])
jobcount = int(args[2])
width = int(args[3])
height = int(args[4])
Previous 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 Next