All Samples(195712) | Call(195207) | Derive(505) | 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/v/t/VT-USRP-daughterboard-drivers_python-HEAD/gnuradio-examples/python/apps/hf_explorer/hfx2.py VT-USRP-daughterboard-drivers_python(Download)
self.f_slider_scale = 10000/options.decim
self.spin_ctrl_1.SetRange(self.f_lo,self.f_hi)
self.text_ctrl_1.SetValue(str(int(self.usrp_center)))
self.slider_5.SetValue(0)
self.AM_mode = False
self.slider_3.SetValue((self.frequency-self.f_slider_offset)/self.f_slider_scale)
self.spin_ctrl_1.SetValue(int(self.frequency))
else:
self.xlate.set_center_freq( self.usrp_center - (self.frequency - self.tune_offset - 7.5e3))
self.slider_3.SetValue(int((self.frequency-self.f_slider_offset)/self.f_slider_scale))
if self.button_12.GetValue():
self.auto_antenna_tune()
else:
self.frequency = self.frequency + (fRel*1e3) - 7.5e3
self.spin_ctrl_1.SetValue(int(self.frequency))
self.slider_3.SetValue(int((self.frequency-self.f_slider_offset)/self.f_slider_scale))
if self.AM_mode == False:
src/p/y/python-cookbook-HEAD/cb2_examples/cb2_18_12_exm_1.py python-cookbook(Download)
if __name__ == '__main__': as_str = 'qwertyuioplkjhgfdsazxcvbnm0987654321' as_num = 79495849566202193863718934176854772085778985434624775545L num = int( as_str, 36 ) assert num == as_num
src/m/r/mrjob-0.3.5/mrjob/examples/mr_text_classifier.py mrjob(Download)
doc['in_test_set'] = False
else:
doc['in_test_set'] = bool(int(doc_hash[-1], 16) % 2)
# map from (n, ngram) to number of times it appears
src/w/x/wxmap2-HEAD/trunk/app/src/python/pexpect-2.3/examples/rippy.py wxmap2(Download)
attempt to get closer to the video_target_size.
"""
return int(math.floor(video_bitrate * (float(video_target_size) / float(video_actual_size))))
def get_aspect_ratio (video_source_filename):
audio_size = (audio_bitrate * video_length * 1000) / 8.0
video_target_size = video_target_size - audio_size - extra_space
return (int)(calc_video_kbitrate (video_target_size, video_length))
def calc_video_kbitrate (target_size, length_secs):
bitrate = target_size/(125*length_secs)
"""
return int(target_size / (125.0 * length_secs))
def crop_detect (video_source_filename, video_length, dry_run_flag=0):
"""This attempts to figure out the best crop for the given video file.
Basically it runs crop detect for 10 seconds on five different places in the video.
It picks the crop area that was most often detected.
"""
skip = int(video_length/9) # offset to skip (-ss option in mencoder)
def compression_estimate (video_length, video_source_filename, video_final_filename, video_target_size, audio_id=128, video_bitrate=1000, video_codec='mpeg4', audio_codec='mp3', video_fourcc_override='FMP4', video_gray_flag=0, video_crop_area=None, video_aspect_ratio='16/9', video_scale=None, video_encode_passes=2, video_deinterlace_flag=0, audio_volume_boost=None, audio_sample_rate=None, audio_bitrate=None):
"""This attempts to figure out the best compression ratio for a given set of compression options.
"""
# TODO Need to account for AVI overhead.
skip = int(video_length/9) # offset to skip (-ss option in mencoder)
src/f/u/funcparserlib-0.3.5/examples/json/json.py funcparserlib(Download)
def make_number(n):
try:
return int(n)
except ValueError:
return float(n)
def sub(m):
if m.group('standard') is not None:
return std[m.group('standard')]
else:
return unichr(int(m.group('unicode'), 16))
src/n/i/nitime-0.4/doc/examples/ar_model_fit.py nitime(Download)
n_process = am.shape[-1] z = np.empty((N, n_process, L)) nz = np.empty((N, n_process, L)) np.random.seed(1981) for i in xrange(N):
src/s/h/shedskin-HEAD/examples/fysphun_main.py shedskin(Download)
screen.fill((0,0,0)) for l in links: if l.drawme:pygame.draw.lines(screen, (255,0,0),0, [(int(l.p1.x),int(l.p1.y)),(int(l.p2.x),int(l.p2.y))],1) for p in points: pygame.draw.circle(screen, (0,255,0), (int(p.x),int(p.y)), int(p.rad))
src/q/u/quickflash-HEAD/trunk/examples/particle_extract/particle_worker.py quickflash(Download)
MPI_Tag_tag = int(0) MPI_Tag_times = int(1) MPI_Tag_part_data = int(2) MPI_Signal_end = int(-1)
self.__output_prefix = None
self.__start_file_index = int(0)
self.__num_files = int(0)
src/q/u/quickflash-HEAD/rtflame/examples/particle_extract/particle_worker.py quickflash(Download)
MPI_Tag_tag = int(0) MPI_Tag_times = int(1) MPI_Tag_part_data = int(2) MPI_Signal_end = int(-1)
self.__output_prefix = None
self.__start_file_index = int(0)
self.__num_files = int(0)
src/q/u/quickflash-HEAD/netcdf/examples/particle_extract/particle_worker.py quickflash(Download)
MPI_Tag_tag = int(0) MPI_Tag_times = int(1) MPI_Tag_part_data = int(2) MPI_Signal_end = int(-1)
self.__output_prefix = None
self.__start_file_index = int(0)
self.__num_files = int(0)
Previous 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 Next