bugged stringlengths 4 228k | fixed stringlengths 0 96.3M | __index_level_0__ int64 0 481k |
|---|---|---|
def write_env(bld, cwd, cname): # write out env.csh for people who haven't yet learned bash env_name = os.path.join(cwd, 'env.csh') f = open(env_name, 'w') for cmd in config('ALL', 'before'): f.write('%s\n' % cmd) print >> f, "setenv LD_LIBRARY_PATH " + bld.libdir + ":$LD_LIBRARY_PATH" try: if os.environ['PYTHONPATH']... | def write_env(bld, cwd, cname): # write out env.csh for people who haven't yet learned bash env_name = os.path.join(cwd, 'env.csh') f = open(env_name, 'w') for cmd in config('ALL', 'before'): f.write('%s\n' % cmd) print >> f, "setenv LD_LIBRARY_PATH " + bld.libdir + ":$LD_LIBRARY_PATH" try: if os.environ['PYTHONPATH']... | 477,000 |
def acceptMPM( self, istep): if ( istep%self.couplingStep == 0 ): #gettin nlocalfaces from MPM ( len(nlocalfaces) = remote_comm_world.size() ) | def acceptMPM( self, istep): if ( istep%self.couplingStep == 0 ): #gettin nlocalfaces from MPM ( len(nlocalfaces) = remote_comm_world.size() ) | 477,001 |
def acceptMPM( self, istep): if ( istep%self.couplingStep == 0 ): #gettin nlocalfaces from MPM ( len(nlocalfaces) = remote_comm_world.size() ) | def acceptMPM( self, istep): if ( istep%self.couplingStep == 0 ): #gettin nlocalfaces from MPM ( len(nlocalfaces) = remote_comm_world.size() ) | 477,002 |
def setBaseVars(env,cla): for o in optionsList: env[o[0]] = o[1] for k,v in cla.iteritems(): if v in ['True','true']: v = True elif v in ['False', 'false']: v = False env[k] = v env['DEBUG'] = env['VERSION'] == 'debug' env['ARCH'] = Arch.getArch() sconstructDir = os.path.abspath(str(env.fs.SConstruct_dir)) #print... | def setBaseVars(env,cla): for o in optionsList: env[o[0]] = o[1] for k,v in cla.iteritems(): if v in ['True','true']: v = True elif v in ['False', 'false']: v = False env[k] = v env['DEBUG'] = env['VERSION'] == 'debug' env['ARCH'] = Arch.getArch() sconstructDir = os.path.abspath(str(env.fs.SConstruct_dir)) #print... | 477,003 |
def setBaseVars(env,cla): for o in optionsList: env[o[0]] = o[1] for k,v in cla.iteritems(): if v in ['True','true']: v = True elif v in ['False', 'false']: v = False env[k] = v env['DEBUG'] = env['VERSION'] == 'debug' env['ARCH'] = Arch.getArch() sconstructDir = os.path.abspath(str(env.fs.SConstruct_dir)) #print... | def setBaseVars(env,cla): for o in optionsList: env[o[0]] = o[1] for k,v in cla.iteritems(): if v in ['True','true']: v = True elif v in ['False', 'false']: v = False env[k] = v env['DEBUG'] = env['VERSION'] == 'debug' env['ARCH'] = Arch.getArch() sconstructDir = os.path.abspath(str(env.fs.SConstruct_dir)) #print... | 477,004 |
def setBaseVars(env,cla): for o in optionsList: env[o[0]] = o[1] for k,v in cla.iteritems(): if v in ['True','true']: v = True elif v in ['False', 'false']: v = False env[k] = v env['DEBUG'] = env['VERSION'] == 'debug' env['ARCH'] = Arch.getArch() sconstructDir = os.path.abspath(str(env.fs.SConstruct_dir)) #print... | def setBaseVars(env,cla): for o in optionsList: env[o[0]] = o[1] for k,v in cla.iteritems(): if v in ['True','true']: v = True elif v in ['False', 'false']: v = False env[k] = v env['DEBUG'] = env['VERSION'] == 'debug' env['ARCH'] = Arch.getArch() sconstructDir = os.path.abspath(str(env.fs.SConstruct_dir)) #print... | 477,005 |
def setVersionPaths(env): env['BUILDVERSION'] = '$COMPILER/$VERSION' env['BUILDVERSIONDIR'] = '$BUILDDIR/$ARCH/$BUILDVERSION' env['AUTOGENDIR'] = '$BUILDVERSIONDIR/autogen' buildvdir = os.path.join(env['TOPDIR'], env.GetBuildPath('$BUILDVERSIONDIR')) if not os.access(buildvdir,os.F_OK): os.makedirs(buildvdir) | def setVersionPaths(env): env['BUILDVERSION'] = '$COMPILER/$VERSION' env['BUILDVERSIONDIR'] = '$BUILDDIR/$ARCH/$BUILDVERSION' env['AUTOGENDIR'] = '$BUILDVERSIONDIR/autogen' buildvdir = os.path.join(env['TOPDIR'], env.GetBuildPath('$BUILDVERSIONDIR')) if not os.access(buildvdir,os.F_OK): os.makedirs(buildvdir) | 477,006 |
def __init__(self, platform=None, **kwargs): SConsEnvironment.__init__(self, platform=platform, tools=[]) | def __init__(self, platform=None, **kwargs): SConsEnvironment.__init__(self, platform=platform, tools=[]) | 477,007 |
def __init__(self, platform=None, **kwargs): SConsEnvironment.__init__(self, platform=platform, tools=[]) | def __init__(self, platform=None, **kwargs): SConsEnvironment.__init__(self, platform=platform, tools=[]) | 477,008 |
def __init__(self, platform=None, **kwargs): SConsEnvironment.__init__(self, platform=platform, tools=[]) | def __init__(self, platform=None, **kwargs): SConsEnvironment.__init__(self, platform=platform, tools=[]) | 477,009 |
def __init__(self, platform=None, **kwargs): SConsEnvironment.__init__(self, platform=platform, tools=[]) | def __init__(self, platform=None, **kwargs): SConsEnvironment.__init__(self, platform=platform, tools=[]) | 477,010 |
def constructComponents(self): for component, dir in self._compDirMap.iteritems(): env = self.myClone(newTargets=True) | def constructComponents(self): for component, dir in self._compDirMap.iteritems(): env = self.myClone(newTargets=True) | 477,011 |
def createATypedSharedLibrary(self, target, sources=[], deplibs=[], skip=[],**kwargs): env = self.myClone() | def createATypedSharedLibrary(self, target, sources=[], deplibs=[], skip=[],**kwargs): env = self.myClone() | 477,012 |
def createSwigModule(self, target, sources=[], deplibs=[], atype=None,**kwargs): | def createSwigModule(self, target, sources=[], deplibs=[], atype=None,**kwargs): | 477,013 |
def createSwigModule(self, target, sources=[], deplibs=[], atype=None,**kwargs): | def createSwigModule(self, target, sources=[], deplibs=[], atype=None,**kwargs): | 477,014 |
def createATypedSwigModule(self, target, sources=[], deplibs=[], skip=[],**kwargs): env = self.myClone() env.loadTools(['swig']) | def createATypedSwigModule(self, target, sources=[], deplibs=[], skip=[],**kwargs): env = self.myClone() env.loadTools(['swig']) | 477,015 |
def createATypedSwigModule(self, target, sources=[], deplibs=[], skip=[],**kwargs): env = self.myClone() env.loadTools(['swig']) | def createATypedSwigModule(self, target, sources=[], deplibs=[], skip=[],**kwargs): env = self.myClone() env.loadTools(['swig']) | 477,016 |
def _addTarget(self, nodes): self._targets.extend(nodes) | def _addTarget(self, nodes): self._targets.extend(nodes) | 477,017 |
def do_file(self, subcmd, opts, action, path): """${cmd_name}: operations on files: ls/rm/add | def do_file(self, subcmd, opts, action, path): """${cmd_name}: operations on files: ls/rm/add | 477,018 |
def __str__(self): return self.basename | def __str__(self): return self.basename | 477,019 |
def dir_show_mirrors(conn, path, missing=False): """Show mirrors on which a certain directory path was found. The path could actually also be a file, it doesn't matter, but directory is what we are looking for in the context that this function was written for. """ if missing: query = """select distinct(mirrors) from f... | def dir_show_mirrors(conn, path, missing=False): """Show mirrors on which a certain directory path was found. The path could actually also be a file, it doesn't matter, but directory is what we are looking for in the context that this function was written for. """ query = """select distinct(mirrors) from filearr where... | 477,020 |
def dir_show_mirrors(conn, path, missing=False): """Show mirrors on which a certain directory path was found. The path could actually also be a file, it doesn't matter, but directory is what we are looking for in the context that this function was written for. """ if missing: query = """select distinct(mirrors) from f... | def dir_show_mirrors(conn, path, missing=False): """Show mirrors on which a certain directory path was found. The path could actually also be a file, it doesn't matter, but directory is what we are looking for in the context that this function was written for. """ if missing: query = """select distinct(mirrors) from f... | 477,021 |
def do_edit(self, subcmd, opts, identifier): """${cmd_name}: edit a new mirror entry in $EDITOR | def do_edit(self, subcmd, opts, identifier): """${cmd_name}: edit a new mirror entry in $EDITOR | 477,022 |
def do_edit(self, subcmd, opts, identifier): """${cmd_name}: edit a new mirror entry in $EDITOR | def do_edit(self, subcmd, opts, identifier): """${cmd_name}: edit a new mirror entry in $EDITOR | 477,023 |
def probe_http(mirror): """Try to reach host at baseurl. Set status_baseurl_new.""" logging.debug("%s probing %s" % (threading.currentThread().getName(), mirror.identifier)) #req = urllib2.Request('http://old-cherry.suse.de') # never works #req = urllib2.Request('http://doozer.poeml.de/') # always works req = urlli... | def probe_http(mirror): """Try to reach host at baseurl. Set status_baseurl_new.""" logging.debug("%s probing %s" % (threading.currentThread().getName(), mirror.identifier)) #req = urllib2.Request('http://old-cherry.suse.de') # never works #req = urllib2.Request('http://doozer.poeml.de/') # always works req = urlli... | 477,024 |
def probe_http(mirror): """Try to reach host at baseurl. Set status_baseurl_new.""" logging.debug("%s probing %s" % (threading.currentThread().getName(), mirror.identifier)) #req = urllib2.Request('http://old-cherry.suse.de') # never works #req = urllib2.Request('http://doozer.poeml.de/') # always works req = urlli... | def probe_http(mirror): """Try to reach host at baseurl. Set status_baseurl_new.""" logging.debug("%s probing %s" % (threading.currentThread().getName(), mirror.identifier)) #req = urllib2.Request('http://old-cherry.suse.de') # never works #req = urllib2.Request('http://doozer.poeml.de/') # always works req = urlli... | 477,025 |
def probe_http(mirror): """Try to reach host at baseurl. Set status_baseurl_new.""" logging.debug("%s probing %s" % (threading.currentThread().getName(), mirror.identifier)) #req = urllib2.Request('http://old-cherry.suse.de') # never works #req = urllib2.Request('http://doozer.poeml.de/') # always works req = urlli... | def probe_http(mirror): """Try to reach host at baseurl. Set status_baseurl_new.""" logging.debug("%s probing %s" % (threading.currentThread().getName(), mirror.identifier)) #req = urllib2.Request('http://old-cherry.suse.de') # never works #req = urllib2.Request('http://doozer.poeml.de/') # always works req = urlli... | 477,026 |
def probe_http(mirror): """Try to reach host at baseurl. Set status_baseurl_new.""" logging.debug("%s probing %s" % (threading.currentThread().getName(), mirror.identifier)) #req = urllib2.Request('http://old-cherry.suse.de') # never works #req = urllib2.Request('http://doozer.poeml.de/') # always works req = urlli... | def probe_http(mirror): """Try to reach host at baseurl. Set status_baseurl_new.""" logging.debug("%s probing %s" % (threading.currentThread().getName(), mirror.identifier)) #req = urllib2.Request('http://old-cherry.suse.de') # never works #req = urllib2.Request('http://doozer.poeml.de/') # always works req = urlli... | 477,027 |
def probe_http(mirror): """Try to reach host at baseurl. Set status_baseurl_new.""" logging.debug("%s probing %s" % (threading.currentThread().getName(), mirror.identifier)) #req = urllib2.Request('http://old-cherry.suse.de') # never works #req = urllib2.Request('http://doozer.poeml.de/') # always works req = urlli... | def probe_http(mirror): """Try to reach host at baseurl. Set status_baseurl_new.""" logging.debug("%s probing %s" % (threading.currentThread().getName(), mirror.identifier)) #req = urllib2.Request('http://old-cherry.suse.de') # never works #req = urllib2.Request('http://doozer.poeml.de/') # always works req = urlli... | 477,028 |
def do_test(self, subcmd, opts, identifier): """${cmd_name}: test if a mirror is working | def do_test(self, subcmd, opts, identifier): """${cmd_name}: test if a mirror is working | 477,029 |
def check_db(self, conn, verbose=False, dry_run=False, force=False): """check if the hashes that are stored in the database are up to date for performance, this function talks very low level to the database""" # get a database cursor, but make it persistent which is faster try: conn.mycursor except AttributeError: con... | def check_db(self, conn, verbose=False, dry_run=False, force=False): """check if the hashes that are stored in the database are up to date for performance, this function talks very low level to the database""" # get a database cursor, but make it persistent which is faster try: conn.mycursor except AttributeError: con... | 477,030 |
def check_db(self, conn, verbose=False, dry_run=False, force=False): """check if the hashes that are stored in the database are up to date for performance, this function talks very low level to the database""" # get a database cursor, but make it persistent which is faster try: conn.mycursor except AttributeError: con... | def check_db(self, conn, verbose=False, dry_run=False, force=False): """check if the hashes that are stored in the database are up to date for performance, this function talks very low level to the database""" # get a database cursor, but make it persistent which is faster try: conn.mycursor except AttributeError: con... | 477,031 |
def check_db(self, conn, verbose=False, dry_run=False, force=False): """check if the hashes that are stored in the database are up to date for performance, this function talks very low level to the database""" # get a database cursor, but make it persistent which is faster try: conn.mycursor except AttributeError: con... | def check_db(self, conn, verbose=False, dry_run=False, force=False): """check if the hashes that are stored in the database are up to date for performance, this function talks very low level to the database""" # get a database cursor, but make it persistent which is faster try: conn.mycursor except AttributeError: con... | 477,032 |
def fill(self, verbose=False): verbose = True # XXX if verbose: sys.stdout.write('Hashing %r... ' % self.src) sys.stdout.flush() | def fill(self, verbose=False): verbose = True # XXX if verbose: sys.stdout.write('Hashing %r... ' % self.src) sys.stdout.flush() | 477,033 |
def iplookup(conn, s): from mb.util import IpAddress import mb.mberr if s[0].isdigit(): a = IpAddress(s) else: import sys, socket # note the difference between socket.gethostbyname # and socket.gethostbyname_ex try: host, aliases, ips = socket.gethostbyname_ex(s) except socket.error, e: if e[0] == socket.EAI_NONAME... | def iplookup(conn, s): from mb.util import IpAddress import mb.mberr if s[0].isdigit(): a = IpAddress(s) else: import sys, socket # note the difference between socket.gethostbyname # and socket.gethostbyname_ex try: host, aliases, ips = socket.gethostbyname_ex(s) except socket.error, e: if e[0] == socket.EAI_NONAME... | 477,034 |
def do_export(self, subcmd, opts, *args): """${cmd_name}: export the mirror list as text file | def do_export(self, subcmd, opts, *args): """${cmd_name}: export the mirror list as text file | 477,035 |
def do_size(self, subcmd, opts, host): """${cmd_name}: find out the size of an rsync module | def do_size(self, subcmd, opts, host): """${cmd_name}: find out the size of an rsync module | 477,036 |
def render(self, name, value, attrs=None): html = super(RestructuredTextareaWidget, self).render(name, value, attrs) | def render(self, name, value, attrs=None): html = super(RestructuredTextareaWidget, self).render(name, value, attrs) | 477,037 |
def render(self, name, value, attrs=None, choices=()): import logging logging.debug("Adding media %s" % RichCheckboxSelectMultiple.Media.js) if value is None: value = [] has_id = attrs and 'id' in attrs checkbox_class = 'richtable-checkbox' if attrs and 'class' in attrs: attrs['class'] = attrs['class'] + ' ' + checkbox... | def render(self, name, value, attrs=None, choices=()): import logging logging.debug("Adding media %s" % RichCheckboxSelectMultiple.Media.js) if value is None: value = [] has_id = attrs and 'id' in attrs checkbox_class = 'richtable-checkbox' if attrs and 'class' in attrs: attrs['class'] = attrs['class'] + ' ' + checkbox... | 477,038 |
def render(self, name, value, attrs=None, choices=()): import logging logging.debug("Adding media %s" % RichCheckboxSelectMultiple.Media.js) if value is None: value = [] has_id = attrs and 'id' in attrs checkbox_class = 'richtable-checkbox' if attrs and 'class' in attrs: attrs['class'] = attrs['class'] + ' ' + checkbox... | def render(self, name, value, attrs=None, choices=()): import logging logging.debug("Adding media %s" % RichCheckboxSelectMultiple.Media.js) if value is None: value = [] has_id = attrs and 'id' in attrs checkbox_class = 'richtable-checkbox' if attrs and 'class' in attrs: attrs['class'] = attrs['class'] + ' ' + checkbox... | 477,039 |
def render(self, name, value, attrs=None, choices=()): import logging logging.debug("Adding media %s" % RichCheckboxSelectMultiple.Media.js) if value is None: value = [] has_id = attrs and 'id' in attrs checkbox_class = 'richtable-checkbox' if attrs and 'class' in attrs: attrs['class'] = attrs['class'] + ' ' + checkbox... | def render(self, name, value, attrs=None, choices=()): import logging logging.debug("Adding media %s" % RichCheckboxSelectMultiple.Media.js) if value is None: value = [] has_id = attrs and 'id' in attrs checkbox_class = 'richtable-checkbox' if attrs and 'class' in attrs: attrs['class'] = attrs['class'] + ' ' + checkbox... | 477,040 |
def render(self, name, value, attrs=None, choices=()): import logging logging.debug("Adding media %s" % RichCheckboxSelectMultiple.Media.js) if value is None: value = [] has_id = attrs and 'id' in attrs checkbox_class = 'richtable-checkbox' if attrs and 'class' in attrs: attrs['class'] = attrs['class'] + ' ' + checkbox... | def render(self, name, value, attrs=None, choices=()): import logging logging.debug("Adding media %s" % RichCheckboxSelectMultiple.Media.js) if value is None: value = [] has_id = attrs and 'id' in attrs checkbox_class = 'richtable-checkbox' if attrs and 'class' in attrs: attrs['class'] = attrs['class'] + ' ' + checkbox... | 477,041 |
def render(self, name, value, attrs=None, choices=()): import logging logging.debug("Adding media %s" % RichCheckboxSelectMultiple.Media.js) if value is None: value = [] has_id = attrs and 'id' in attrs checkbox_class = 'richtable-checkbox' if attrs and 'class' in attrs: attrs['class'] = attrs['class'] + ' ' + checkbox... | def render(self, name, value, attrs=None, choices=()): import logging logging.debug("Adding media %s" % RichCheckboxSelectMultiple.Media.js) if value is None: value = [] has_id = attrs and 'id' in attrs checkbox_class = 'richtable-checkbox' if attrs and 'class' in attrs: attrs['class'] = attrs['class'] + ' ' + checkbox... | 477,042 |
def handle_label(self, app=None, **options): if app is None: raise CommandError("Specify at least one app") if app not in settings.INSTALLED_APPS: raise CommandError("%s not found at INSTALLED_APPS" % app) MEDIA_ROOT = os.path.abspath(options['media_root']) | def handle_label(self, app=None, **options): if app is None: raise CommandError("Specify at least one app") if app not in settings.INSTALLED_APPS: raise CommandError("%s not found at INSTALLED_APPS" % app) MEDIA_ROOT = os.path.abspath(options['media_root']) | 477,043 |
def register_rst_directives(directives_items): """ Registers restructuredText directives given as dictionary with keys being names and paths to directive function. """ for name, directive_path in directives_items: try: splitted = directive_path.split('.') mod_path, method_name = '.'.join(splitted[:-1]), splitted[-1] mo... | def register_rst_directives(directives_items): """ Registers restructuredText directives given as dictionary with keys being names and paths to directive function. """ for name, directive_path in directives_items: try: splitted = directive_path.split('.') mod_path, method_name = '.'.join(splitted[:-1]), splitted[-1] mo... | 477,044 |
def register_rst_directives(directives_items): """ Registers restructuredText directives given as dictionary with keys being names and paths to directive function. """ for name, directive_path in directives_items: try: splitted = directive_path.split('.') mod_path, method_name = '.'.join(splitted[:-1]), splitted[-1] mo... | def register_rst_directives(directives_items): """ Registers restructuredText directives given as dictionary with keys being names and paths to directive function. """ for name, directive_path in directives_items: try: splitted = directive_path.split('.') mod_path, method_name = '.'.join(splitted[:-1]), splitted[-1] mo... | 477,045 |
def rho(r): R = 0.354 Delta = 0.153 R1 = R - Delta / 2 R2 = R + Delta / 2 return rho0 * (theta(R2-r) - theta(r-R1)) | def rho(r): R = 0.354 * nm Delta = 0.153 * nm R1 = R - Delta / 2 R2 = R + Delta / 2 return rho0 * (theta(R2-r) - theta(r-R1)) | 477,046 |
def rho(r): R = 0.354 Delta = 0.153 R1 = R - Delta / 2 R2 = R + Delta / 2 return rho0 * (theta(R2-r) - theta(r-R1)) | def rho(r): R = 0.354 Delta = 0.153 R1 = R - Delta / 2 R2 = R + Delta / 2 return rho0 * (theta(R2-r) - theta(r-R1)) | 477,047 |
def close(self): # free parsed data if not self.is_opened(): return self.__open_status = False | def close(self): # free parsed data if not self.is_opened(): return self.__open_status = False | 477,048 |
def close(self): # free parsed data if not self.is_opened(): return self.__open_status = False | def close(self): # free parsed data if not self.is_opened(): return self.__open_status = False | 477,049 |
def run(self): hid_object = self.hid_object while hid_object.is_opened() and not self.__abort: raw_report = hid_object._input_report_queue.get() if not raw_report: continue hid_object._process_raw_report(raw_report) # reuse the report (avoid allocating new memory) hid_object._input_report_queue.reuse(raw_report) | def run(self): hid_object = self.hid_object while hid_object.is_opened() and not self.__abort: raw_report = hid_object._input_report_queue.get() if not raw_report or self.__abort: break hid_object._process_raw_report(raw_report) # reuse the report (avoid allocating new memory) hid_object._input_report_queue.reuse(raw_r... | 477,050 |
def run(self): hid_object = self.hid_object while hid_object.is_opened() and not self.__abort: raw_report = hid_object._input_report_queue.get() if not raw_report: continue hid_object._process_raw_report(raw_report) # reuse the report (avoid allocating new memory) hid_object._input_report_queue.reuse(raw_report) | def run(self): hid_object = self.hid_object while hid_object.is_opened() and not self.__abort: raw_report = hid_object._input_report_queue.get() if not raw_report: continue hid_object._process_raw_report(raw_report) # reuse the report (avoid allocating new memory) if hid_object._input_report_queue: hid_object._input_re... | 477,051 |
def abort(self): if not self.__abort: self.__abort = True if self.is_alive() and self.__overlapped_read_obj: # force overlapped events completition SetEvent(self.__overlapped_read_obj.h_event) | def abort(self): if not self.__active: return self.__abort = True if self.is_alive() and self.__overlapped_read_obj: # force overlapped events completition SetEvent(self.__overlapped_read_obj.h_event) | 477,052 |
def run(self): if not self.raw_report_size: # don't raise any error as the hid object can still be used # for writing reports raise HIDError("Attempting to read input reports on non "\ "capable HID device") over_read = OVERLAPPED() over_read.h_event = CreateEvent(None, 0, 0, None) if over_read.h_event: self.__overlapp... | def self.__active = False self.__abort = True run(self): self.__active = False self.__abort = True if self.__active = False self.__abort = True not self.__active = False self.__abort = True self.raw_report_size: self.__active = False self.__abort = True # self.__active = False self.__abort = True don't self.__active = ... | 477,053 |
def send_output_report(self, data): """Send input/output/feature report ID = report_id, data should be a c_ubyte object with included the required report data """ assert( self.is_opened() ) | defsend_output_report(self,data):"""Sendinput/output/featurereportID=report_id,datashouldbeac_ubyteobjectwithincludedtherequiredreportdata"""assert(self.is_opened()) | 477,054 |
def __setitem__(self, index, value): "Allow to access value array by index" if not self.__is_value_array: raise ValueError("Report item is not value usage array") if index < self.__report_count: byte_index = (index * self.__bit_size) / 8 byte_index = (index * self.__bit_size) % 8 bit_value = (value & ((1 << self.__bit_... | def __setitem__(self, index, value): "Allow to access value array by index" if not self.__is_value_array: raise ValueError("Report item is not value usage array") if index < self.__report_count: byte_index = (index * self.__bit_size) / 8 bit_index = (index * self.__bit_size) % 8 bit_mask = ((1 << self.__bit_size) - 1)... | 477,055 |
def __getitem__(self, index): "Allow to access value array by index" if not self.__is_value_array: raise ValueError("Report item is not value usage array") if index < self.__report_count: byte_index = (index * self.__bit_size) / 8 byte_index = (index * self.__bit_size) % 8 return ((self.__value[byte_index] >> byte_inde... | def __getitem__(self, index): "Allow to access value array by index" if not self.__is_value_array: raise ValueError("Report item is not value usage array") if index < self.__report_count: byte_index = (index * self.__bit_size) / 8 bit_index = (index * self.__bit_size) % 8 return ((self.__value[byte_index] >> bit_index)... | 477,056 |
def get(self): if self.__locked_down: return None #wait for data self.posted_event.wait() self.fresh_lock.acquire() if self.__locked_down: self.fresh_lock.release() return None | def get(self): if self.__locked_down: return None #wait for data self.posted_event.wait() self.fresh_lock.acquire() if self.__locked_down: self.fresh_lock.release() return None | 477,057 |
def post(self, raw_report): if self.__locked_down: self.posted_event.set() return self.fresh_lock.acquire() self.fresh_queue.append( raw_report ) self.fresh_lock.release() self.posted_event.set() | def post(self, raw_report): if self.__locked_down: return self.fresh_lock.acquire() self.fresh_queue.append( raw_report ) self.fresh_lock.release() self.posted_event.set() | 477,058 |
def run(self): time.sleep(0.050) # this fixes an strange python threading bug if not self.raw_report_size: # don't raise any error as the hid object can still be used # for writing reports raise HIDError("Attempting to read input reports on non "\ "capable HID device") | def run(self): time.sleep(0.050) # this fixes an strange python threading bug if not self.raw_report_size: # don't raise any error as the hid object can still be used # for writing reports raise HIDError("Attempting to read input reports on non "\ "capable HID device") | 477,059 |
def __repr__(self): res = [] if self.string_index: res.append( self.get_usage_string() ) res.append( "page_id=%s"%hex(self.page_id) ) res.append( "usage_id=%s"%hex(self.usage_id) ) if self.__value != None: res.append( "value=%s)"%hex(self.__value) ) else: res.append( "value=[None])" ) usage_type = "" if self.is_button(... | def __repr__(self): res = [] if self.string_index: res.append( self.get_usage_string() ) res.append( "page_id=%s"%hex(self.page_id) ) res.append( "usage_id=%s"%hex(self.usage_id) ) if self.__value != None: res.append( "value=%s" % str(self.get_value())) else: res.append( "value=[None])" ) usage_type = "" if self.is_but... | 477,060 |
def set_raw_data(self, raw_data): """Set usage values based on given raw data, item[0] is report_id, lenght should match 'raw_data_length' value, best performance if raw_data is c_ubyte ctypes array object type """ #pre-parsed data should exist if not self.__hid_object.ptr_preparsed_data: raise HIDError("HID object clo... | def set_raw_data(self, raw_data): """Set usage values based on given raw data, item[0] is report_id, lenght should match 'raw_data_length' value, best performance if raw_data is c_ubyte ctypes array object type """ #pre-parsed data should exist if not self.__hid_object.ptr_preparsed_data: raise HIDError("HID object clo... | 477,061 |
def __getitem__(self, key): if '.' not in key: return self.parent[key] else: all_keys = key.split('.') curr_var = self.parent[all_keys[0]] for item in all_keys[1:]: new_var = getattr(curr_var, item) curr_var = new_var return new_var | def __getitem__(self, key): if '.' not in key: return self.parent[key] else: all_keys = key.split('.') curr_var = self.parent[all_keys[0]] for item in all_keys[1:]: new_var = getattr(curr_var, item) curr_var = new_var return new_var | 477,062 |
def LoadSingle(filename=None): if filename==None: filename=wx.FileSelector() im=Image.open(filename) # TODO: Need to add more smarts to this based on the mode 'I;16' vs. RGB, etc... #'1','P','RGB','RGBA','L','F','CMYK','YCbCr','I', # Can I simplify this by simply fixing the PIL -> numpy conversion #if im.format in _t... | def LoadSingle(filename=None): if filename==None: filename=wx.FileSelector() im=Image.open(filename) # TODO: Need to add more smarts to this based on the mode 'I;16' vs. RGB, etc... #'1','P','RGB','RGBA','L','F','CMYK','YCbCr','I', # Can I simplify this by simply fixing the PIL -> numpy conversion #if im.format in _t... | 477,063 |
def SaveFileSequence(arr,basename=None,format='gif',tiffBits=16): if basename==None: basename=wx.SaveFileSelector('Array as Sequence of Gifs -- numbers automatically added to','.'+format) if format in _gif_names: pass elif format in _tif_names: if tiffBits not in [8,16,32]: print 'Unsupported tiff format! Choose 8 or... | def SaveFileSequence(arr,basename=None,format='gif',tiffBits=16): if basename==None: basename=wx.SaveFileSelector('Array as Sequence of Gifs -- numbers automatically added to','.'+format) if format in _gif_names: pass elif format in _tif_names: if tiffBits not in [8,16,32]: print 'Unsupported tiff format! Choose 8 or... | 477,064 |
def LoadMonolithic(filename=None): #f='C:/Documents and Settings/Owner/Desktop/Stack_Zproject_GBR_DC.gif' if filename==None: filename=wx.FileSelector() im=Image.open(filename) if im.format in _tif_names: datatype=np.uint16 elif im.format in _gif_names: datatype=np.uint8 l=[] numFrames=0 while 1: l.append(np.asarray(... | def LoadMonolithic(filename=None): #f='C:/Documents and Settings/Owner/Desktop/Stack_Zproject_GBR_DC.gif' if filename==None: filename=wx.FileSelector() im=Image.open(filename) if im.format in _tif_names: datatype=np.uint16 elif im.format in _gif_names: datatype=np.uint8 l=[] numFrames=0 while 1: l.append(np.asarray(... | 477,065 |
def LoadFrameFromMonolithic(filename=None,frameNum=0): #f='C:/Documents and Settings/Owner/Desktop/Stack_Zproject_GBR_DC.gif' if filename==None: filename=wx.FileSelector() im=Image.open(filename) if im.format in _tif_names: datatype=np.uint16 elif im.format in _gif_names: datatype=np.uint8 t=None i=0 while 1: if i==... | def LoadFrameFromMonolithic(filename=None,frameNum=0): #f='C:/Documents and Settings/Owner/Desktop/Stack_Zproject_GBR_DC.gif' if filename==None: filename=wx.FileSelector() im=Image.open(filename) if im.format in _tif_names: datatype=np.uint16 elif im.format in _gif_names: datatype=np.uint8 t=None i=0 while 1: if i==... | 477,066 |
def LoadSingle(filename=None): if filename==None: filename=wx.FileSelector() im=Image.open(filename) # TODO: Need to add more smarts to this based on the mode 'I;16' vs. RGB, etc... #'1','P','RGB','RGBA','L','F','CMYK','YCbCr','I', # Can I simplify this by simply fixing the PIL -> numpy conversion #if im.format in _t... | def LoadSingle(filename=None): if filename==None: filename=wx.FileSelector() im=Image.open(filename) # TODO: Need to add more smarts to this based on the mode 'I;16' vs. RGB, etc... #'1','P','RGB','RGBA','L','F','CMYK','YCbCr','I', # Can I simplify this by simply fixing the PIL -> numpy conversion #if im.format in _t... | 477,067 |
def LoadSingle(filename=None): if filename==None: filename=wx.FileSelector() im=Image.open(filename) # TODO: Need to add more smarts to this based on the mode 'I;16' vs. RGB, etc... #'1','P','RGB','RGBA','L','F','CMYK','YCbCr','I', # Can I simplify this by simply fixing the PIL -> numpy conversion #if im.format in _t... | def LoadSingle(filename=None): if filename==None: filename=wx.FileSelector() im=Image.open(filename) # TODO: Need to add more smarts to this based on the mode 'I;16' vs. RGB, etc... #'1','P','RGB','RGBA','L','F','CMYK','YCbCr','I', # Can I simplify this by simply fixing the PIL -> numpy conversion #if im.format in _t... | 477,068 |
def LoadMonolithic(filename=None): #f='C:/Documents and Settings/Owner/Desktop/Stack_Zproject_GBR_DC.gif' if filename==None: filename=wx.FileSelector() im=Image.open(filename) if im.format in _tif_names: datatype=np.uint16 elif im.format in _gif_names: datatype=np.uint8 l=[] numFrames=0 while 1: l.append(np.asarray(... | def LoadMonolithic(filename=None): #f='C:/Documents and Settings/Owner/Desktop/Stack_Zproject_GBR_DC.gif' if filename==None: filename=wx.FileSelector() im=Image.open(filename) datatype = GetDatatype(im) l=[] numFrames=0 while 1: l.append(np.asarray(im.getdata(),dtype=datatype)) numFrames+=1 try: im.seek(im.tell()+1) ... | 477,069 |
def LoadMonolithic(filename=None): #f='C:/Documents and Settings/Owner/Desktop/Stack_Zproject_GBR_DC.gif' if filename==None: filename=wx.FileSelector() im=Image.open(filename) if im.format in _tif_names: datatype=np.uint16 elif im.format in _gif_names: datatype=np.uint8 l=[] numFrames=0 while 1: l.append(np.asarray(... | def LoadMonolithic(filename=None): #f='C:/Documents and Settings/Owner/Desktop/Stack_Zproject_GBR_DC.gif' if filename==None: filename=wx.FileSelector() im=Image.open(filename) if im.format in _tif_names: datatype=np.uint16 elif im.format in _gif_names: datatype=np.uint8 l=[] numFrames=0 while 1: l.append(np.asarray(... | 477,070 |
def LoadMonolithic(filename=None): #f='C:/Documents and Settings/Owner/Desktop/Stack_Zproject_GBR_DC.gif' if filename==None: filename=wx.FileSelector() im=Image.open(filename) if im.format in _tif_names: datatype=np.uint16 elif im.format in _gif_names: datatype=np.uint8 l=[] numFrames=0 while 1: l.append(np.asarray(... | def LoadMonolithic(filename=None): #f='C:/Documents and Settings/Owner/Desktop/Stack_Zproject_GBR_DC.gif' if filename==None: filename=wx.FileSelector() im=Image.open(filename) if im.format in _tif_names: datatype=np.uint16 elif im.format in _gif_names: datatype=np.uint8 l=[] numFrames=0 while 1: l.append(np.asarray(... | 477,071 |
def LoadFrameFromMonolithic(filename=None,frameNum=0): #f='C:/Documents and Settings/Owner/Desktop/Stack_Zproject_GBR_DC.gif' if filename==None: filename=wx.FileSelector() im=Image.open(filename) if im.format in _tif_names: datatype=np.uint16 elif im.format in _gif_names: datatype=np.uint8 t=None i=0 while 1: if i==... | def LoadFrameFromMonolithic(filename=None,frameNum=0): #f='C:/Documents and Settings/Owner/Desktop/Stack_Zproject_GBR_DC.gif' if filename==None: filename=wx.FileSelector() im=Image.open(filename) datatype = GetDatatype(im) t=None i=0 while 1: if i==frameNum: t = np.asarray(im.getdata(),dtype=datatype) t.resize(numFra... | 477,072 |
def LoadFrameFromMonolithic(filename=None,frameNum=0): #f='C:/Documents and Settings/Owner/Desktop/Stack_Zproject_GBR_DC.gif' if filename==None: filename=wx.FileSelector() im=Image.open(filename) if im.format in _tif_names: datatype=np.uint16 elif im.format in _gif_names: datatype=np.uint8 t=None i=0 while 1: if i==... | def LoadFrameFromMonolithic(filename=None,frameNum=0): #f='C:/Documents and Settings/Owner/Desktop/Stack_Zproject_GBR_DC.gif' if filename==None: filename=wx.FileSelector() im=Image.open(filename) if im.format in _tif_names: datatype=np.uint16 elif im.format in _gif_names: datatype=np.uint8 t=None i=0 while 1: if i==... | 477,073 |
def LoadMonolithicOrSequenceSpecial(filename=None): if filename==None: filename=wx.FileSelector() numFrames,w,h,isSequence = GetShapeMonolithicOrSequence(filename) if isSequence: files = getSortedListOfNumericalEquivalentFiles( filename,os.path.split(filename)[0] ) if len(files)==0: print 'Empty Directory!' return t0... | def LoadMonolithicOrSequenceSpecial(filename=None): if filename==None: filename=wx.FileSelector() numFrames,w,h,isSequence = GetShapeMonolithicOrSequence(filename) if isSequence: files = getSortedListOfNumericalEquivalentFiles( filename,os.path.split(filename)[0]) if len(files)==0: print 'Empty Directory!' return t0=... | 477,074 |
def find_bricks(host=None, name=None): """Used by find_one_brick to look for bricks ***ADVANCED USERS ONLY***""" try: import usbsock usb_available = True socks = usbsock.find_bricks(host, name) for s in socks: yield s except ImportError: usb_available = False import sys print >>sys.stderr, "USB module unavailable, not... | def find_bricks(host=None, name=None): """Used by find_one_brick to look for bricks ***ADVANCED USERS ONLY***""" try: import usbsock usb_available = True socks = usbsock.find_bricks(host, name) for s in socks: yield s except ImportError: usb_available = False import sys print >>sys.stderr, "USB module unavailable, not... | 477,075 |
def find_bricks(host=None, name=None): """Used by find_one_brick to look for bricks ***ADVANCED USERS ONLY***""" try: import usbsock usb_available = True socks = usbsock.find_bricks(host, name) for s in socks: yield s except ImportError: usb_available = False import sys print >>sys.stderr, "USB module unavailable, not... | def find_bricks(host=None, name=None): """Used by find_one_brick to look for bricks ***ADVANCED USERS ONLY***""" try: import usbsock usb_available = True socks = usbsock.find_bricks(host, name) for s in socks: yield s except ImportError: usb_available = False import sys print >>sys.stderr, "USB module unavailable, not... | 477,076 |
def find_bricks(host=None, name=None): """Used by find_one_brick to look for bricks ***ADVANCED USERS ONLY***""" try: import usbsock usb_available = True socks = usbsock.find_bricks(host, name) for s in socks: yield s except ImportError: usb_available = False import sys print >>sys.stderr, "USB module unavailable, not... | def find_bricks(host=None, name=None): """Used by find_one_brick to look for bricks ***ADVANCED USERS ONLY***""" try: import usbsock usb_available = True socks = usbsock.find_bricks(host, name) for s in socks: yield s except ImportError: usb_available = False import sys print >>sys.stderr, "USB module unavailable, not... | 477,077 |
def _ls_read(self): for n in range(3): try: return self.brick.ls_read(self.port) except I2CError: pass raise I2CError, 'ls_read timeout' | def _ls_get_status(self, n_bytes): for n in range(3): try: return self.brick.ls_read(self.port) except I2CError: pass raise I2CError, 'ls_read timeout' | 477,078 |
def _ls_read(self): for n in range(3): try: return self.brick.ls_read(self.port) except I2CError: pass raise I2CError, 'ls_read timeout' | def _ls_read(self): for n in range(3): try: return self.brick.ls_read(self.port) except I2CError: pass raise I2CError, 'ls_read timeout' | 477,079 |
def _i2c_query(self, address, format): """Reads an i2c value from given address, and returns a value unpacked according to the given format. Format is the same as in the struct module. """ n_bytes = struct.calcsize(format) msg = chr(self.I2C_DEV) + chr(address) if not self.lastpoll: self.lastpoll = time() if self.lastp... | def _i2c_query(self, address, format): """Reads an i2c value from given address, and returns a value unpacked according to the given format. Format is the same as in the struct module. """ n_bytes = struct.calcsize(format) msg = chr(self.I2C_DEV) + chr(address) if not self.lastpoll: self.lastpoll = time() if self.lastp... | 477,080 |
def __init__(self, red, green, blue, white): self.red, self.green, self.blue, self.white = red, green, blue, white | def __init__(self, red, green, blue, white): self.red, self.green, self.blue, self.white = red, green, blue, white | 477,081 |
def __init__(self, red, green, blue, white): self.red, self.green, self.blue, self.white = red, green, blue, white | def __init__(self, red, green, blue, white): self.red, self.green, self.blue, self.white = red, green, blue, white | 477,082 |
def get_passive_color(self): """"Returns color values when in passive or raw mode. """ red = self.read_value('rawred') green = self.read_value('rawgreen') blue = self.read_value('rawblue') white = self.read_value('rawwhite') return PassiveColor(red, green, blue, white) | def get_passive_color(self): """"Returns color values when in passive or raw mode. """ red, green, blue, white = self.read_value('all_raw_data') return PassiveColor(red, green, blue, white) | 477,083 |
def paintEvent(self, event) : if len(self.highlight_positions_list) > 0 : painter = Qt.QPainter(self) | def paintEvent(self, event) : if len(self.highlight_positions_list) > 0 : painter = Qt.QPainter(self) | 477,084 |
def data(index = -1) : if index < 0 : index = self.index() return self.actions_list[index].data() | def data(self, index = -1) : if index < 0 : index = self.index() return self.actions_list[index].data() | 477,085 |
def compress(base, directory): filelist = os.listdir(directory) filelist.sort() for file in filelist: if file in ('checksum.files', 'checksum.global', 'var', 'files.html'): continue if base: filename = base + '/' + file else: filename = file absfilename = os.path.join(directory, file) if os.path.isfile(absfilename): pr... | def compress(base, directory): filelist = os.listdir(directory) filelist.sort() for file in filelist: if file in ('checksum.files', 'checksum.global', 'var', 'files.html'): continue if base: filename = base + '/' + file else: filename = file absfilename = os.path.join(directory, file) if os.path.isfile(absfilename): pr... | 477,086 |
def compress(base, directory): filelist = os.listdir(directory) filelist.sort() for file in filelist: if file in ('checksum.files', 'checksum.global', 'var', 'files.html'): continue if base: filename = base + '/' + file else: filename = file absfilename = os.path.join(directory, file) if os.path.isfile(absfilename): pr... | def compress(base, directory): filelist = os.listdir(directory) filelist.sort() for file in filelist: if file in ('checksum.files', 'checksum.global', 'var', 'files.html'): continue if base: filename = base + '/' + file else: filename = file absfilename = os.path.join(directory, file) if os.path.isfile(absfilename): pr... | 477,087 |
def compress(base, directory): filelist = os.listdir(directory) filelist.sort() for file in filelist: if file in ('checksum.files', 'checksum.global', 'var', 'files.html'): continue if base: filename = base + '/' + file else: filename = file absfilename = os.path.join(directory, file) if os.path.isfile(absfilename): pr... | def compress(base, directory): filelist = os.listdir(directory) filelist.sort() for file in filelist: if file in ('checksum.files', 'checksum.global', 'var', 'files.html'): continue if base: filename = base + '/' + file else: filename = file absfilename = os.path.join(directory, file) if os.path.isfile(absfilename): pr... | 477,088 |
def compress(base, directory): filelist = os.listdir(directory) filelist.sort() for file in filelist: if file in ('checksum.files', 'checksum.global', 'var', 'files.html'): continue if base: filename = base + '/' + file else: filename = file absfilename = os.path.join(directory, file) if os.path.isfile(absfilename): pr... | def compress(base, directory): filelist = os.listdir(directory) filelist.sort() for file in filelist: if file in ('checksum.files', 'checksum.global', 'var', 'files.html'): continue if base: filename = base + '/' + file else: filename = file absfilename = os.path.join(directory, file) if os.path.isfile(absfilename): pr... | 477,089 |
def index_product(product): """Indexes passed product. """ if product.is_variant(): try: product = product.parent.get_default_variant() except AttributeError: return _index_products([product]) | def index_product(product): """Indexes passed product. """ if product.is_variant(): try: product = product.parent.get_default_variant() except AttributeError: return if product.active: _index_products([product]) | 477,090 |
def delete_product(product): """Deletes passed product from index. """ conn = Solr(SOLR_ADDRESS) conn.delete(id=product.id) | def delete_product(product): """Deletes passed product from index. """ conn = Solr(SOLR_ADDRESS) conn.delete(id=product.id) | 477,091 |
def _changesetFromRevision(self, branch, revision_id): """ Generate changeset for the given Bzr revision """ from datetime import datetime from vcpx.tzinfo import FixedOffset, UTC | def _changesetFromRevision(self, branch, revision_id): """ Generate changeset for the given Bzr revision """ from datetime import datetime from vcpx.tzinfo import FixedOffset, UTC | 477,092 |
def setLog(self, log): """Strip away the "Ignore-this:" noise from the changelog.""" | def setLog(self, log): """Strip away the "Ignore-this:" noise from the changelog.""" | 477,093 |
def debug (*what): print >> sys.stderr, '[DEBUG]: ', ' '.join (map (unicode, what)) | def debug (*what): print >> sys.stderr, '[DEBUG]: ', ' '.join (map (unicode, what)) | 477,094 |
def debug (*what): print >> sys.stderr, '[DEBUG]: ', ' '.join (map (unicode, what)) | def debug (*what): print >> sys.stderr, '[DEBUG]: ', ' '.join (map (unicode, what)) | 477,095 |
def process_phrase (okey, phrase, freq): global phrase_counter, phrases, freq_total, i_map phrase_counter += 1 k = (okey, phrase) if k in phrases: phrases[k] += freq else: phrases[k] = freq freq_total += freq ikeys = g ([[]], okey.split (), 0) if not ikeys and options.verbose: print >> sys.stderr, 'failed index generat... | def process_phrase (okey, phrase, freq): global phrase_counter, phrases, freq_total, i_map phrase_counter += 1 k = (okey, phrase) if k in phrases: phrases[k] += freq else: phrases[k] = freq ikeys = g ([[]], okey.split (), 0) if not ikeys and options.verbose: print >> sys.stderr, 'failed index generation for phrase [%s]... | 477,096 |
def __register_dict(self, dict_prefix, max_key_length, schema_info): if dict_prefix not in self.__dict: s = self.__dict[dict_prefix] = [max_key_length, [], None, dict(), -1] else: s = self.__dict[dict_prefix][1] s.append(schema_info) | def __register_dict(self, dict_prefix, max_key_length, schema_info): if dict_prefix not in self.__dict: s = self.__dict[dict_prefix] = [max_key_length, [], None, dict(), -1] else: s = self.__dict[dict_prefix][1] s.append(schema_info) | 477,097 |
def process_phrase(okey, phrase, freq): global phrase_counter, phrases, freq_total, ip_map phrase_counter += 1 freq_total += freq k = (okey, phrase) if k in phrases: phrases[k] += freq else: phrases[k] = freq ikeys = g([[]], okey.split(), 0) if not ikeys and options.verbose: print >> sys.stderr, 'failed index generatio... | def process_phrase(okey, phrase, freq): global phrase_counter, phrases, freq_total, ip_map phrase_counter += 1 freq_total += freq k = (okey, phrase) if k in phrases: phrases[k] += freq else: phrases[k] = freq ikeys = g([[]], okey.split(), 0) if not ikeys and options.verbose: print >> sys.stderr, 'failed index generatio... | 477,098 |
def process_phrase(okey, phrase, freq): global phrase_counter, phrases, freq_total, ip_map phrase_counter += 1 freq_total += freq k = (okey, phrase) if k in phrases: phrases[k] += freq else: phrases[k] = freq ikeys = g([[]], okey.split(), 0) if not ikeys and options.verbose: print >> sys.stderr, 'failed index generatio... | def process_phrase(okey, phrase, freq): global phrase_counter, phrases, freq_total, ip_map phrase_counter += 1 freq_total += freq k = (okey, phrase) if k in phrases: phrases[k] += freq else: phrases[k] = freq ikeys = g([[]], okey.split(), 0) if not ikeys and options.verbose: print >> sys.stderr, 'failed index generatio... | 477,099 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.