bugged
stringlengths
4
228k
fixed
stringlengths
0
96.3M
__index_level_0__
int64
0
481k
def clone(self,fs=None,path=None,destination=None): evt = super(MOVED_SRC,self).clone() if destination is None: destination = self.destination evt.destination = destination return evt
def clone(self,fs=None,path=None,destination=None): evt = super(MOVED_SRC,self).clone(fs,path) if destination is None: destination = self.destination evt.destination = destination return evt
449,000
def __unicode__(self): return self.name
def __unicode__(self): return self.name
449,001
def delay(self, *args, **kwargs): try: override = kwargs.pop('priority') or 2 except KeyError: override = priority
def delay(self, *args, **kwargs): try: override_priority = kwargs.pop('priority') or 2 except KeyError: override = priority
449,002
def delay(self, *args, **kwargs): try: override = kwargs.pop('priority') or 2 except KeyError: override = priority
def delay(self, *args, **kwargs): try: override = kwargs.pop('priority') or 2 except KeyError: override = priority
449,003
def delay(self, *args, **kwargs): try: override = kwargs.pop('priority') or 2 except KeyError: override = priority
def delay(self, *args, **kwargs): try: override = kwargs.pop('priority') or 2 except KeyError: override = priority
449,004
def get_tasks(bucket=None, schedule=None, status=None): rs = AsyncTask.objects.get_query_set() if bucket: rs = rs.filter(bucket=bucket) if schedule: rs = rs.filter(task_type=schedule) if status: rs = rs.filter(status=status) return [ t for t in rs.all() ]
def get_tasks(self, bucket=None, schedule=None, status=None): rs = AsyncTask.objects.get_query_set() if bucket: rs = rs.filter(bucket=bucket) if schedule: rs = rs.filter(task_type=schedule) if status: rs = rs.filter(status=status) return [ t for t in rs.all() ]
449,005
def test_crash_invalid_item(self, mysetup): node = mysetup.makenode() node.send(123) # invalid item kwargs = mysetup.geteventargs("pytest_testnodedown") assert kwargs['node'] is node assert "Not properly terminated" in str(kwargs['error'])
def test_crash_invalid_item(self, mysetup): node = mysetup.makenode() node.send(123) # invalid item kwargs = mysetup.geteventargs("pytest_testnodedown") assert kwargs['node'] is node assert "Not properly terminated" in str(kwargs['error'])
449,006
def pytest_testnodedown(node, error): assert node.slaveoutput['s2'] == 42 print "s2call-finished"
def pytest_testnodedown(node, error): assert node.slaveoutput['s2'] == 42 print "s2call-finished"
449,007
def test_crash(): os.kill(os.getpid(), 15)
def test_crash(): os.kill(os.getpid(), 15)
449,008
def popevent(self, name=None): while 1: if self.use_callback: data = self.events.get(timeout=2) else: data = self.slp.channel.receive(timeout=2) ev = EventCall(data) if name is None or ev.name == name: return ev print("skipping %s" % (ev,))
def popevent(self, name=None): while 1: if self.use_callback: data = self.events.get(timeout=WAIT_TIMEOUT) else: data = self.slp.channel.receive(timeout=2) ev = EventCall(data) if name is None or ev.name == name: return ev print("skipping %s" % (ev,))
449,009
def popevent(self, name=None): while 1: if self.use_callback: data = self.events.get(timeout=2) else: data = self.slp.channel.receive(timeout=2) ev = EventCall(data) if name is None or ev.name == name: return ev print("skipping %s" % (ev,))
def popevent(self, name=None): while 1: if self.use_callback: data = self.events.get(timeout=2) else: data = self.slp.channel.receive(timeout=WAIT_TIMEOUT) ev = EventCall(data) if name is None or ev.name == name: return ev print("skipping %s" % (ev,))
449,010
def test_remote_collect_skip(self, slave): p = slave.testdir.makepyfile(""" import py py.test.skip("hello") """) slave.setup() ev = slave.popevent("collectionstart") assert not ev.kwargs ev = slave.popevent() assert ev.name == "collectreport" rep = unserialize_report(ev.name, ev.kwargs['data']) assert rep.skipped ev = ...
def test_remote_collect_skip(self, slave): p = slave.testdir.makepyfile(""" import py py.test.skip("hello") """) slave.setup() ev = slave.popevent("collectionstart") assert not ev.kwargs ev = slave.popevent() assert ev.name == "collectreport" rep = unserialize_report(ev.name, ev.kwargs['data']) assert rep.skipped ev = ...
449,011
def testdatabase(request, configuration_id): """Checks connection status of database connection, given configuration_id only for staff member! #todo: this function is still partly hard-coded for Jdbc2Ei """ if not(request.user.is_staff): raise Http404 is_standalone = request.GET.get('is_standalone', None) errormess...
def testdatabase(request, configuration_id): """Checks connection status of database connection, given configuration_id only for staff member! #todo: this function is still partly hard-coded for Jdbc2Ei """ if not(request.user.is_staff): raise Http404 is_standalone = request.GET.get('is_standalone', None) errormess...
449,012
def testdatabase(request, configuration_id): """Checks connection status of database connection, given configuration_id only for staff member! #todo: this function is still partly hard-coded for Jdbc2Ei """ if not(request.user.is_staff): raise Http404 is_standalone = request.GET.get('is_standalone', None) errormess...
def testdatabase(request, configuration_id): """Checks connection status of database connection, given configuration_id only for staff member! #todo: this function is still partly hard-coded for Jdbc2Ei """ if not(request.user.is_staff): raise Http404 is_standalone = request.GET.get('is_standalone', None) errormess...
449,013
def service_get_locations(request, configuration_id, filter_id): """get locations given configuration_id and filter_id return id, name (from filters) x, y, parentid (from locations) """ configuration = get_object_or_404(Configuration, pk=configuration_id) connector = configuration.getConnector() if configuration.dat...
def service_get_locations(request, configuration_id, filter_id): """get locations given configuration_id and filter_id return id, name (from filters) x, y, parentid (from locations) """ configuration = get_object_or_404(Configuration, pk=configuration_id) connector = configuration.getConnector() if configuration.dat...
449,014
def nextURL(self): return self.context.context.absolute_url()
def nextURL(self): return self.context.context.absolute_url()
449,015
def write_input_file(self, verbose=False): """Generate input file for Fall3d-6 """
def write_input_file(self, verbose=False): """Generate input file for Fall3d-6 """
449,016
def set_database(self, verbose=True): """Create meteorological database Requires - input file - topography - windprofile """ executable = os.path.join(self.utilities_dir, 'SetDbs', 'SetDbs.PUB.exe') logfile = self.basepath + '.SetDbs.log' if verbose: header('Building meteorological database (SetDbs)')
def set_database(self, verbose=True): """Create meteorological database Requires - input file - topography - windprofile """ executable = os.path.join(self.utilities_dir, 'SetDbs', 'SetDbs.PUB.exe') logfile = self.basepath + '.SetDbs.log' if verbose: header('Building meteorological database (SetDbs)')
449,017
def set_source(self, verbose=True): """Create eruptive source file Requires - input file - grain file - database file """ executable = os.path.join(self.utilities_dir, 'SetSrc', 'SetSrc.PUB.exe') logfile = self.basepath + '.SetSrc.log'
def set_source(self, verbose=True): """Create eruptive source file Requires - input file - grain file - database file """ executable = os.path.join(self.utilities_dir, 'SetSrc', 'SetSrc.PUB.exe') logfile = self.basepath + '.SetSrc.log'
449,018
def set_source(self, verbose=True): """Create eruptive source file Requires - input file - grain file - database file """ executable = os.path.join(self.utilities_dir, 'SetSrc', 'SetSrc.PUB.exe') logfile = self.basepath + '.SetSrc.log'
def set_source(self, verbose=True): """Create eruptive source file Requires - input file - grain file - database file """ executable = os.path.join(self.utilities_dir, 'SetSrc', 'SetSrc.PUB.exe') logfile = self.basepath + '.SetSrc.log'
449,019
def __init__(self, params, timestamp_output=True, store_locally=False, dircomment=None, output_dir=None, echo=True, verbose=True): """Create AIM instance, common file names Optional arguments: timestamp_output: If True, create unique output directory with timestamp If False, overwrite output at every run store_locall...
def __init__(self, params, timestamp_output=True, store_locally=False, dircomment=None, output_dir=None, echo=True, verbose=True): """Create AIM instance, common file names Optional arguments: timestamp_output: If True, create unique output directory with timestamp If False, overwrite output at every run store_locall...
449,020
def __init__(self, params, timestamp_output=True, store_locally=False, dircomment=None, output_dir=None, echo=True, verbose=True): """Create AIM instance, common file names Optional arguments: timestamp_output: If True, create unique output directory with timestamp If False, overwrite output at every run store_locall...
def__init__(self,params,timestamp_output=True,store_locally=False,dircomment=None,output_dir=None,echo=True,verbose=True):"""CreateAIMinstance,commonfilenamesOptionalarguments:timestamp_output:IfTrue,createuniqueoutputdirectorywithtimestampIfFalse,overwriteoutputateveryrunstore_locally:IfTrue,storeinsamedirectorywheres...
449,021
def __init__(self, params, timestamp_output=True, store_locally=False, dircomment=None, verbose=True): """Create AIM instance and common file names Optional arguments: timestamp_output: If True, create unique output directory with timestamp If False, overwrite output at every run store_locally: If True, store in same...
def __init__(self, params, timestamp_output=True, store_locally=False, dircomment=None, verbose=True): """Create AIM instance and common file names Optional arguments: timestamp_output: If True, create unique output directory with timestamp If False, overwrite output at every run store_locally: If True, store in same...
449,022
def nc2grd(self, verbose=True): """Run nc2grd Requires - input file - source file - grain file - database file """ executable = os.path.join(self.utilities_dir, 'nc2grd', 'nc2grd.exe') logfile = self.basepath + '.nc2grd.log' if verbose: header('Running nc2grd')
def nc2grd(self, verbose=True): """Run nc2grd Requires - input file - source file - grain file - database file """ executable = os.path.join(self.utilities_dir, 'nc2grd', 'nc2grd.exe') logfile = self.basepath + '.nc2grd.log' if verbose: header('Running nc2grd')
449,023
def run_scenario(scenario, dircomment=None, store_locally=False, timestamp_output=True, verbose=True): """Run volcanic ash impact scenario The argument scenario can be either * A Python script or * A Dictionary In any case scenario must specify all required volcanological parameters as stated in the file required_par...
def run_scenario(scenario, dircomment=None, store_locally=False, timestamp_output=True, verbose=True): """Run volcanic ash impact scenario The argument scenario can be either * A Python script or * A Dictionary In any case scenario must specify all required volcanological parameters as stated in the file required_par...
449,024
def download_wind_data(url, verbose=True): """Download data files """ # Get available files fid = urllib2.urlopen(url) print dir(fid) # Select files to download files = [] for line in fid.readlines(): fields = line.split() filename = fields[-1] fields = filename.split('.') if fields[0] == 'IDY25100': msg = 'File %s...
def download_wind_data(url, verbose=True): """Download data files """ # Get available files fid = urllib2.urlopen(url) print dir(fid) # Select files to download files = [] for line in fid.readlines(): fields = line.split() filename = fields[-1] fields = filename.split('.') if fields[0] == 'IDY25100': msg = 'File %s...
449,025
def set_compiler(filename): replace_string_in_file(filename, 'FC= ifort', '#FC= ifort') replace_string_in_file(filename, 'LINKER= ifort', '#LINKER= ifort') replace_string_in_file(filename, 'FFLAGS= -132', '#FFLAGS= -132') replace_string_in_file(filename, 'LINKFLAGS= -132', '#LINKFLAGS= -132') replace_string_in_fil...
def set_compiler(filename): replace_string_in_file(filename, 'FC= ifort', os.chdir(os.path.join(FALL3DHOME, fall3d, 'Scripts')) for program in ['SetDbs', 'SetGrn', 'SetSrc', 'manager', 'Fall3d_Pub']: replace_string_in_file('Script-' + program, 'set HOME=/Users/arnaufolch/Documents/Software/Fall3d-6.0/PUB/Fall3d-6....
449,026
def generate_windprofile(self, verbose=False): """Read wind profile data in the format Hour 1 10 10 14 10 10 4 10 10 1 10 10 -2 10 10 -12 10 10 -30 Hour 2 10 10 14 10 10 4 ... Each row under each Hour heading correspond to an element in zlayers. Alternatively, this format can be specified as Constant 10 10 14 10...
def generate_windprofile(self, verbose=False): """Read wind profile data in the format Hour 1 10 10 14 10 10 4 10 10 1 10 10 -2 10 10 -12 10 10 -30 Hour 2 10 10 14 10 10 4 ... Each row under each Hour heading correspond to an element in zlayers. Alternatively, this format can be specified as Constant 10 10 14 10...
449,027
def download_wind_data(url, verbose=True): """Download data files """ # Get available files fid = urllib2.urlopen(url) print dir(fid) # Select files to download files = [] for line in fid.readlines(): fields = line.split() filename = fields[-1] fields = filename.split('.') if fields[0] == 'IDY25100': msg = 'File %s...
def download_wind_data(url, verbose=True): """Download data files """ # Get available files fid = urllib2.urlopen(url) print dir(fid) # Select files to download files = [] for line in fid.readlines(): fields = line.split() filename = fields[-1] fields = filename.split('.') if fields[0] == 'IDY25100': msg = 'File %s...
449,028
def download_wind_data(url, verbose=True): """Download data files """ # Get available files fid = urllib2.urlopen(url) print dir(fid) # Select files to download files = [] for line in fid.readlines(): fields = line.split() filename = fields[-1] fields = filename.split('.') if fields[0] == 'IDY25100': msg = 'File %s...
def download_wind_data(url, verbose=True): """Download data files """ # Get available files fid = urllib2.urlopen(url) print dir(fid) # Select files to download files = [] for line in fid.readlines(): fields = line.split() filename = fields[-1] fields = filename.split('.') if fields[0] == 'IDY25100': msg = 'File %s...
449,029
def store_inputdata(self, verbose=False): """Create exact copy of input data into output area The intention is to ensure that all output has an audit trail. """ audit_dir = os.path.join(self.output_dir, 'input_data') makedir(audit_dir) # Store input files s = 'cp %s %s' % (self.wind_profile, audit_dir) run(s, verbos...
def store_inputdata(self, verbose=False): """Create exact copy of input data into output area The intention is to ensure that all output has an audit trail. """ audit_dir = os.path.join(self.output_dir, 'input_data') makedir(audit_dir) # Store input files s = 'cp %s %s' % (self.wind_profile, audit_dir) run(s, verbos...
449,030
def __init__(self, params, timestamp_output=True, store_locally=False, dircomment=None, verbose=True): """Create AIM instance, common file names and start logging Optional arguments: timestamp_output: If True, create unique output directory with timestamp If False, overwrite output at every run store_locally: If True...
def __init__(self, params, timestamp_output=True, store_locally=False, dircomment=None, verbose=True): """Create AIM instance, common file names and start logging Optional arguments: timestamp_output: If True, create unique output directory with timestamp If False, overwrite output at every run store_locally: If True...
449,031
def nc2asc(ncfilename, subdataset, projection=None, verbose=False): """Extract given subdataset from ncfile name and create one ASCII file for each band. This function is reading the NetCDF file using the Python Library Scientific.IO.NetCDF Time is assumed to be in whole hours. """ basename, _ = os.path.splitext(nc...
def nc2asc(ncfilename, subdataset, projection=None, verbose=False): """Extract given subdataset from ncfile name and create one ASCII file for each band. This function is reading the NetCDF file using the Python Library Scientific.IO.NetCDF Time is assumed to be in whole hours. """ basename, _ = os.path.splitext(nc...
449,032
def __init__(self, params, timestamp_output=True, store_locally=False, dircomment=None, echo=True, verbose=True): """Create AIM instance, common file names Optional arguments: timestamp_output: If True, create unique output directory with timestamp If False, overwrite output at every run store_locally: If True, store...
def __init__(self, params, timestamp_output=True, store_locally=False, dircomment=None, echo=True, verbose=True): """Create AIM instance, common file names Optional arguments: timestamp_output: If True, create unique output directory with timestamp If False, overwrite output at every run store_locally: If True, store...
449,033
def generate_contours(self, verbose=True): """Contour ASCII grids into shp and kml files The function uses model parameters Load_contours, Thickness_contours and Thickness_units. """ if verbose: header('Contouring ASCII grids to SHP and KML files') for filename in os.listdir(self.output_dir): if filename.endswith('...
def generate_contours(self, verbose=True): """Contour ASCII grids into shp and kml files The function uses model parameters Load_contours, Thickness_contours and Thickness_units. """ if verbose: header('Contouring ASCII grids to SHP and KML files') for filename in os.listdir(self.output_dir): if filename.endswith('...
449,034
def generate_contours(self, verbose=True): """Contour ASCII grids into shp and kml files The function uses model parameters Load_contours, Thickness_contours and Thickness_units. """ if verbose: header('Contouring ASCII grids to SHP and KML files') for filename in os.listdir(self.output_dir): if filename.endswith('...
def generate_contours(self, verbose=True): """Contour ASCII grids into shp and kml files The function uses model parameters Load_contours, Thickness_contours and Thickness_units. """ if verbose: header('Contouring ASCII grids to SHP and KML files') for filename in os.listdir(self.output_dir): if filename.endswith('...
449,035
def get_profile_from_web(url, vent_coordinates, verbose=True): """Download data files and create FALL3D wind profile Input url: web address where ACCESS wind profiles are stored vent_coordinates: UTM location of vent (x_coordinate_of_vent, y_coordinate_of_vent, zone, hemisphere) Output: profile_name: Name of generate...
def get_profile_from_web(url, vent_coordinates, verbose=True): """Download data files and create FALL3D wind profile Input url: web address where ACCESS wind profiles are stored vent_coordinates: UTM location of vent (x_coordinate_of_vent, y_coordinate_of_vent, zone, hemisphere) Output: profile_name: Name of generate...
449,036
def post(self): """ Called when a new ride needs to be added to the database. Probably with all of this data it should be done as a form post. Arguments: - `self`: Web Arguments: - max_passengers - num_passengers - driver - start_point_title - start_point_lat - start_point_long - destination_title - destination_lat - ...
def get(self): """ Called when a new ride needs to be added to the database. Probably with all of this data it should be done as a form post. Arguments: - `self`: Web Arguments: - max_passengers - num_passengers - driver - start_point_title - start_point_lat - start_point_long - destination_title - destination_lat - d...
449,037
def post(self): """ Called when a new ride needs to be added to the database. Probably with all of this data it should be done as a form post. Arguments: - `self`: Web Arguments: - max_passengers - num_passengers - driver - start_point_title - start_point_lat - start_point_long - destination_title - destination_lat - ...
def post(self): """ Called when a new ride needs to be added to the database. Probably with all of this data it should be done as a form post. Arguments: - `self`: Web Arguments: - max_passengers - num_passengers - driver - start_point_title - start_point_lat - start_point_long - destination_title - destination_lat - ...
449,038
def post(self): """ Called when a new ride needs to be added to the database. Probably with all of this data it should be done as a form post. Arguments: - `self`: Web Arguments: - max_passengers - num_passengers - driver - start_point_title - start_point_lat - start_point_long - destination_title - destination_lat - ...
def post(self): """ Called when a new ride needs to be added to the database. Probably with all of this data it should be done as a form post. Arguments: - `self`: Web Arguments: - max_passengers - num_passengers - driver - start_point_title - start_point_lat - start_point_long - destination_title - destination_lat - ...
449,039
def post(self): """ Called when a new ride needs to be added to the database. Probably with all of this data it should be done as a form post. Arguments: - `self`: Web Arguments: - max_passengers - num_passengers - driver - start_point_title - start_point_lat - start_point_long - destination_title - destination_lat - ...
def post(self): """ Called when a new ride needs to be added to the database. Probably with all of this data it should be done as a form post. Arguments: - `self`: Web Arguments: - max_passengers - num_passengers - driver - start_point_title - start_point_lat - start_point_long - destination_title - destination_lat - ...
449,040
def post(self): """ Called when a new ride needs to be added to the database. Probably with all of this data it should be done as a form post. Arguments: - `self`: Web Arguments: - max_passengers - num_passengers - driver - start_point_title - start_point_lat - start_point_long - destination_title - destination_lat - ...
def post(self): """ Called when a new ride needs to be added to the database. Probably with all of this data it should be done as a form post. Arguments: - `self`: Web Arguments: - max_passengers - num_passengers - driver - start_point_title - start_point_lat - start_point_long - destination_title - destination_lat - ...
449,041
def main(): global MAP_APIKEY, FROM_EMAIL_ADDR, NOTIFY_EMAIL_ADDR logging.getLogger().setLevel(logging.DEBUG) # prepopulate the database query = db.Query(Ride) if query.count() < 2: newRide = Ride() newRide.max_passengers = 3 newRide.num_passengers = 0 newRide.driver = users.User("bmiller@luther.edu") newRide.start_...
def main(): global MAP_APIKEY, FROM_EMAIL_ADDR, NOTIFY_EMAIL_ADDR logging.getLogger().setLevel(logging.DEBUG) # prepopulate the database query = db.Query(Ride) if query.count() < 2: newRide = Ride() newRide.max_passengers = 3 newRide.num_passengers = 0 newRide.driver = users.User("bmiller@luther.edu") newRide.start_...
449,042
def to_dict(self): res = {} for k in Ride._properties: ## special case ToD if k != 'ToD' and k != 'driver': res[k] = getattr(self,k) #eval('self.'+k) res['ToD'] = str(self.ToD) res['driver'] = self.driver.email() return res
def to_dict(self): res = {} for k in Ride._properties: ## special case ToD logging.debug("key = %s" % k) if k != 'ToD' and k != 'driver' and k != 'passengers': res[k] = getattr(self,k) #eval('self.'+k) res['ToD'] = str(self.ToD) res['driver'] = self.driver.email() return res
449,043
def get(self): query = db.Query(Ride) query.filter("ToD > ", datetime.datetime.now()) ride_list = query.fetch(limit=100) user = users.get_current_user() greeting = '' logout = '' if user: greeting = ("Welcome, %s! (<a href=\"%s\">sign out</a>) Go to your <a href='/home'>Home Page</a>" % (user.nickname(), users.create_l...
def get(self): query = db.Query(Ride) query.filter("ToD > ", datetime.datetime.now()) ride_list = query.fetch(limit=100) user = users.get_current_user() greeting = '' logout = '' if user: greeting = ("Welcome, %s! (<a href=\"%s\">sign out</a>) Go to your <a href='/home'>Home Page</a>" % (user.nickname(), users.create_l...
449,044
def post(self): """ Called when a new ride needs to be added to the database. Probably with all of this data it should be done as a form post. Arguments: - `self`: Web Arguments: - max_passengers - num_passengers - driver - start_point_title - start_point_lat - start_point_long - destination_title - destination_lat - ...
def post(self): """ Called when a new ride needs to be added to the database. Probably with all of this data it should be done as a form post. Arguments: - `self`: Web Arguments: - max_passengers - num_passengers - driver - start_point_title - start_point_lat - start_point_long - destination_title - destination_lat - ...
449,045
def post(self): """ Called when adding a passenger to a ride Arguments: - 'self' Web Arguments: - user_name - ride_key """ # The current user can add himself to the ride. No need for this in the form. user_name = users.get_current_user() ride_key = self.request.get('ride_key') contact = self.request.get('contact') ...
def post(self): """ Called when adding a passenger to a ride Arguments: - 'self' Web Arguments: - user_name - ride_key """ # The current user can add himself to the ride. No need for this in the form. user_name = users.get_current_user() ride_key = self.request.get('ride_key') contact = self.request.get('contact') ...
449,046
def get(self): key = self.request.get('key') ride = db.get(key) if ride == None: doRender(self, 'error.html', { 'error_message': "No such ride exists."}) else: db.delete(ride) query = db.Query(Ride) query.filter("ToD > ", datetime.datetime.now()) ride_list = query.fetch(limit=100) user = users.get_current_user() greeti...
def get(self): key = self.request.get('key') ride = db.get(key) if ride == None: doRender(self, 'error.html', { 'error_message': "No such ride exists."}) else: db.delete(ride) query = db.Query(Ride) query.filter("ToD > ", datetime.datetime.now()) ride_list = query.fetch(limit=100) user = users.get_current_user() greeti...
449,047
def get(self): rkey = self.request.get('rkey') ride = db.get(rkey) pkey = self.request.get('pkey') passenger = db.get(pkey) #self.response.out.write('Would remove %s from %s ride' % (passenger.name, ride.driver)) if ride == None: doRender(self, 'error.html', { 'error_message': "No such ride exists."}) elif passenger ==...
def get(self): rkey = self.request.get('rkey') ride = db.get(rkey) pkey = self.request.get('pkey') passenger = db.get(pkey) #self.response.out.write('Would remove %s from %s ride' % (passenger.name, ride.driver)) if ride == None: doRender(self, 'error.html', { 'error_message': "No such ride exists."}) elif passenger ==...
449,048
def VideoMainMenu(): dir = MediaContainer(viewGroup="List") mainpage = XML.ElementFromURL(VIDEOS_PAGE % 'en',isHTML=True) for category in mainpage.xpath('//ul[@id="nav"]/li[not(@class="selected") and not(@class="lastItem")]/a'): dir.Append(Function(DirectoryItem(CategoryParsing,category.text,thumb=R(ICON),art=R(ART)),p...
def VideoMainMenu(): dir = MediaContainer(viewGroup="List") mainpage = HTML.ElementFromURL(VIDEOS_PAGE % 'en') for category in mainpage.xpath('//ul[@id="nav"]/li[not(@class="selected") and not(@class="lastItem")]/a'): dir.Append(Function(DirectoryItem(CategoryParsing,category.text,thumb=R(ICON),art=R(ART)),path = categ...
449,049
def CategoryParsing(sender,path): dir = MediaContainer(viewGroup="List") pagetoscrape = XML.ElementFromURL(BASE_ADDRESS + path,isHTML=True) for category in pagetoscrape.xpath("//div[@id='listChannel']/ul//a"): dir.Append(Function(DirectoryItem(SubCategoryParsing,category.text,thumb=R(ICON),art=R(ART)),path = category.g...
def CategoryParsing(sender,path): dir = MediaContainer(viewGroup="List") pagetoscrape = HTML.ElementFromURL(BASE_ADDRESS + path) for category in pagetoscrape.xpath("//div[@id='listChannel']/ul//a"): dir.Append(Function(DirectoryItem(SubCategoryParsing,category.text,thumb=R(ICON),art=R(ART)),path = category.get('href'))...
449,050
def VideoMainMenu(): dir = MediaContainer(viewGroup="List") mainpage = XML.ElementFromURL(VIDEOS_PAGE % 'en',isHTML=True) for category in mainpage.xpath('//ul[@id="nav"]/li[not(@class="selected") and not(@class="lastItem")]/a'): dir.Append(Function(DirectoryItem(CategoryParsing,category.text,thumb=R(ICON),art=R(ART)),p...
def VideoMainMenu(): dir = MediaContainer(viewGroup="List") mainpage = HTML.ElementFromURL(VIDEOS_PAGE % 'en') for category in mainpage.xpath('//ul[@id="nav"]/li[not(@class="selected") and not(@class="lastItem")]/a'): dir.Append(Function(DirectoryItem(CategoryParsing,category.text,thumb=R(ICON),art=R(ART)),path = categ...
449,051
def CategoryParsing(sender,path): dir = MediaContainer(viewGroup="List") pagetoscrape = XML.ElementFromURL(BASE_ADDRESS + path,isHTML=True) for category in pagetoscrape.xpath("//div[@id='listChannel']/ul//a"): dir.Append(Function(DirectoryItem(SubCategoryParsing,category.text,thumb=R(ICON),art=R(ART)),path = category.g...
def CategoryParsing(sender,path): dir = MediaContainer(viewGroup="List") pagetoscrape = HTML.ElementFromURL(BASE_ADDRESS + path) for category in pagetoscrape.xpath("//div[@id='listChannel']/ul//a"): dir.Append(Function(DirectoryItem(SubCategoryParsing,category.text,thumb=R(ICON),art=R(ART)),path = category.get('href'))...
449,052
def write_file(self, filename, compression='none', strip_size = 2**13): """ Write image data to TIFF file.
def write_file(self, filename, compression='none', strip_size = 2**13): """ Write image data to TIFF file.
449,053
def write_file(self, filename, compression='none', strip_size = 2**13): """ Write image data to TIFF file.
def write_file(self, filename, compression='none', strip_size = 2**13): """ Write image data to TIFF file.
449,054
def get_samples(self, subfile_type=0, verbose=False): """ Return samples and sample names.
def get_samples(self, subfile_type=0, verbose=False): """ Return samples and sample names.
449,055
def get_samples(self, subfile_type=0, verbose=False): """ Return samples and sample names.
def get_samples(self, subfile_type=0, verbose=False): """ Return samples and sample names.
449,056
def write_image(self, arr, compression=None): """ Write array as TIFF image.
def write_image(self, arr, compression=None, write_rgb=False): """ Write array as TIFF image.
449,057
def write_image(self, arr, compression=None): """ Write array as TIFF image.
def write_image(self, arr, compression=None): """ Write array as TIFF image.
449,058
def write_image(self, arr, compression=None): """ Write array as TIFF image.
def write_image(self, arr, compression=None): """ Write array as TIFF image.
449,059
def write_image(self, arr, compression=None): """ Write array as TIFF image.
def write_image(self, arr, compression=None): """ Write array as TIFF image.
449,060
def __init__(self, filename, mode='r', first_byte = 0): if mode!='r': raise NotImplementedError(`mode`) self.filename = filename self.first_byte = first_byte self.data = numpy.memmap(filename, dtype=numpy.ubyte, mode=mode)
def __init__(self, filename, mode='r', first_byte = 0): if mode!='r': raise NotImplementedError(`mode`) self.filename = filename self.first_byte = first_byte self.data = numpy.memmap(filename, dtype=numpy.ubyte, mode=mode)
449,061
def get_uint16(self, offset): return self.data[offset:offset+2].view(dtype=numpy.uint16)[0]
def get_uint16(self, offset): return self.data[offset:offset+2].view(dtype=numpy.uint16)[0]
449,062
def get_uint32(self, offset): return self.data[offset:offset+4].view(dtype=numpy.uint32)[0]
def get_uint32(self, offset): return self.data[offset:offset+4].view(dtype=numpy.uint32)[0]
449,063
def get_int16(self, offset): return self.data[offset:offset+2].view(dtype=numpy.int16)[0]
def get_int16(self, offset): return self.data[offset:offset+2].view(dtype=numpy.int16)[0]
449,064
def get_int32(self, offset): return self.data[offset:offset+4].view(dtype=numpy.int32)[0]
def get_int32(self, offset): return self.data[offset:offset+4].view(dtype=numpy.int32)[0]
449,065
def get_float32(self, offset): return self.data[offset:offset+4].view(dtype=numpy.float32)[0]
def get_float32(self, offset): return self.data[offset:offset+4].view(dtype=numpy.float32)[0]
449,066
def get_float64(self, offset): return self.data[offset:offset+8].view(dtype=numpy.float64)[0]
def get_float64(self, offset): return self.data[offset:offset+8].view(dtype=numpy.float64)[0]
449,067
def get_values(self, offset, typ, count): if isinstance(typ, numpy.dtype): dtype = typ bytes = typ.itemsize elif isinstance(typ, type) and issubclass(typ, numpy.generic): dtype = typ bytes = typ().itemsize else: if isinstance(typ, str): typ = name2type.get(typ) dtype = type2dtype.get(typ) bytes = type2bytes.get(typ) i...
def get_values(self, offset, typ, count): if isinstance(typ, numpy.dtype): dtype = typ bytes = typ.itemsize elif isinstance(typ, type) and issubclass(typ, numpy.generic): dtype = typ bytes = typ().itemsize else: if isinstance(typ, str): typ = name2type.get(typ) dtype = self.dtypes.type2dt.get(typ) bytes = type2bytes.g...
449,068
def get_contiguous(self): """ Return memmap of a stack of images. """ if not self.is_contiguous (): raise ValueError('Image stack data not contiguous') ifd0 = self.IFD[0] ifd1 = self.IFD[-1] width = ifd0.get ('ImageWidth').value length = ifd0.get ('ImageLength').value assert width == ifd1.get ('ImageWidth').value asser...
def get_contiguous(self): """ Return memmap of a stack of images. """ if not self.is_contiguous (): raise ValueError('Image stack data not contiguous') ifd0 = self.IFD[0] ifd1 = self.IFD[-1] width = ifd0.get ('ImageWidth').value length = ifd0.get ('ImageLength').value assert width == ifd1.get ('ImageWidth').value asser...
449,069
def get_samples(self, subfile_type=0, verbose=False): """ Return samples and sample names.
def get_samples(self, subfile_type=0, verbose=False): """ Return samples and sample names.
449,070
def get_samples(self, subfile_type=0, verbose=False): """ Return samples and sample names.
def get_samples(self, subfile_type=0, verbose=False): """ Return samples and sample names.
449,071
def get_samples(self, subfile_type=0, verbose=False): """ Return samples and sample names.
def get_samples(self, subfile_type=0, verbose=False): """ Return samples and sample names.
449,072
def get_contiguous(self, channel_name=None): """ Return memmap of an image.
def get_contiguous(self, channel_name=None): """ Return memmap of an image.
449,073
def get_contiguous(self, channel_name=None): """ Return memmap of an image.
def get_contiguous(self, channel_name=None): """ Return memmap of an image.
449,074
def get_samples(self, subfile_type=0, verbose=False): """ Return samples and sample names.
def get_samples(self, subfile_type=0, verbose=False): """ Return samples and sample names.
449,075
def initGui( self ): if int( self.QgisVersion ) < 1: QMessageBox.warning( self.iface.mainWindow(), "MergeShapes", QCoreApplication.translate( "MergeShapes", "Quantum GIS version detected: " ) + unicode( self.QgisVersion ) + ".xx\n" + QCoreApplication.translate( "MergeShapes", "This version of RasterCalc requires at lea...
def initGui( self ): if int( self.QgisVersion ) < 1: QMessageBox.warning( self.iface.mainWindow(), "MergeShapes", QCoreApplication.translate( "MergeShapes", "Quantum GIS version detected: " ) + unicode( self.QgisVersion ) + ".xx\n" + QCoreApplication.translate( "MergeShapes", "This version of MergeShapes requires at le...
449,076
def saveDialog( parent ): settings = QSettings() dirName = settings.value( "/UI/lastShapefileDir" ).toString() filtering = QString( "Shapefiles (*.shp)" ) encode = settings.value( "/UI/encoding" ).toString() fileDialog = QgsEncodingFileDialog( parent, "Save output shapefile", dirName, filtering, encode ) fileDialog.set...
def saveDialog( parent ): settings = QSettings() dirName = settings.value( "/UI/lastShapefileDir" ).toString() filtering = QString( "Shapefiles (*.shp)" ) encode = settings.value( "/UI/encoding" ).toString() title = QCoreApplication.translate( "MergeShapesDialog", "Save output shapefile" ) fileDialog = QgsEncodingFileD...
449,077
def openDialog( parent ): settings = QSettings() dirName = settings.value( "/UI/lastShapefileDir" ).toString() filtering = QString( "Shapefiles (*.shp)" ) encode = settings.value( "/UI/encoding" ).toString() fileDialog = QgsEncodingFileDialog( parent, "Open input shapefile(s)", dirName, QString(filtering), encode ) fil...
def openDialog( parent ): settings = QSettings() dirName = settings.value( "/UI/lastShapefileDir" ).toString() filtering = QString( "Shapefiles (*.shp)" ) encode = settings.value( "/UI/encoding" ).toString() title = QCoreApplication.translate( "MergeShapesDialog", "Open input shapefile(s)" ) fileDialog = QgsEncodingFil...
449,078
def file_getinfo(self): #################### # Description # =========== """ This function finds the information about the current selected file. Displays number of frames, audio codec and video codec.""" # Arguments # ========= # # Further Details # =============== # #################### self.audio_codec = ['N/A','N/A...
def file_getinfo(self): #################### # Description # =========== """ This function finds the information about the current selected file. Displays number of frames, audio codec and video codec.""" # Arguments # ========= # # Further Details # =============== # #################### self.audio_codec = ['N/A','N/A...
449,079
def file_getinfo(self): #################### # Description # =========== """ This function finds the information about the current selected file. Displays number of frames, audio codec and video codec.""" # Arguments # ========= # # Further Details # =============== # #################### self.audio_codec = ['N/A','N/A...
def file_getinfo(self): #################### # Description # =========== """ This function finds the information about the current selected file. Displays number of frames, audio codec and video codec.""" # Arguments # ========= # # Further Details # =============== # #################### self.audio_codec = ['N/A','N/A...
449,080
def file_getinfo(self): #################### # Description # =========== """ This function finds the information about the current selected file. Displays number of frames, audio codec and video codec.""" # Arguments # ========= # # Further Details # =============== # #################### self.audio_codec = ['N/A','N/A...
def file_getinfo(self): #################### # Description # =========== """ This function finds the information about the current selected file. Displays number of frames, audio codec and video codec.""" # Arguments # ========= # # Further Details # =============== # #################### self.audio_codec = ['N/A','N/A...
449,081
def file_getinfo(self): #################### # Description # =========== """ This function finds the information about the current selected file. Displays number of frames, audio codec and video codec.""" # Arguments # ========= # # Further Details # =============== # #################### self.audio_codec = ['N/A','N/A...
def file_getinfo(self): #################### # Description # =========== """ This function finds the information about the current selected file. Displays number of frames, audio codec and video codec.""" # Arguments # ========= # # Further Details # =============== # #################### self.audio_codec = ['N/A','N/A...
449,082
def RemoveInputFile(self,widget): #################### # Description # =========== """ Dialog that allows the user to remove a file from the list of input tiles. Once the user presses the 'ok' button, the file is removed from the list.""" # Arguments # ========= # # Further Details # =============== # #################...
def RemoveInputFile(self,widget): #################### # Description # =========== """ Dialog that allows the user to remove a file from the list of input tiles. Once the user presses the 'ok' button, the file is removed from the list.""" # Arguments # ========= # # Further Details # =============== # #################...
449,083
def RemoveInputFile(self,widget): #################### # Description # =========== """ Dialog that allows the user to remove a file from the list of input tiles. Once the user presses the 'ok' button, the file is removed from the list.""" # Arguments # ========= # # Further Details # =============== # #################...
def dialog.destroy() RemoveInputFile(self,widget): dialog.destroy() #################### dialog.destroy() # dialog.destroy() Description dialog.destroy() # dialog.destroy() =========== dialog.destroy() """ dialog.destroy() Dialog dialog.destroy() that dialog.destroy() allows dialog.destroy() the dialog.dest...
449,084
def download_youtube_dl(self,widget,url): #################### # Description # =========== """Downloads video files from sites like youtube.com, metacafe.com and video.google.com.""" # Arguments # ========= # url http url of the remote file to download eg. http://www.example.org/movie.mpg # # Further Details # ======...
def download_youtube_dl(self,widget,url): #################### # Description # =========== """Downloads video files from sites like youtube.com, metacafe.com and video.google.com.""" # Arguments # ========= # url http url of the remote file to download eg. http://www.example.org/movie.mpg # # Further Details # ======...
449,085
def download_youtube_dl(self,widget,url): #################### # Description # =========== """Downloads video files from sites like youtube.com, metacafe.com and video.google.com.""" # Arguments # ========= # url http url of the remote file to download eg. http://www.example.org/movie.mpg # # Further Details # ======...
def download_youtube_dl(self,widget,url): #################### # Description # =========== """Downloads video files from sites like youtube.com, metacafe.com and video.google.com.""" # Arguments # ========= # url http url of the remote file to download eg. http://www.example.org/movie.mpg # # Further Details # ======...
449,086
def download_youtube_dl(self,widget,url): #################### # Description # =========== """Downloads video files from sites like youtube.com, metacafe.com and video.google.com.""" # Arguments # ========= # url http url of the remote file to download eg. http://www.example.org/movie.mpg # # Further Details # ======...
def download_youtube_dl(self,widget,url): #################### # Description # =========== """Downloads video files from sites like youtube.com, metacafe.com and video.google.com.""" # Arguments # ========= # url http url of the remote file to download eg. http://www.example.org/movie.mpg # # Further Details # ======...
449,087
def download_youtube_dl(self,widget,url): #################### # Description # =========== """Downloads video files from sites like youtube.com, metacafe.com and video.google.com.""" # Arguments # ========= # url http url of the remote file to download eg. http://www.example.org/movie.mpg # # Further Details # ======...
defdownload_youtube_dl(self,widget,url):#####################Description#==========="""Downloadsvideofilesfromsiteslikeyoutube.com,metacafe.comandvideo.google.com."""#Arguments#=========#urlhttpurloftheremotefiletodownloadeg.http://www.example.org/movie.mpg##FurtherDetails#===============#Thisfunctionusesyoutube-dltoge...
449,088
def download_youtube_dl(self,widget,url): #################### # Description # =========== """Downloads video files from sites like youtube.com, metacafe.com and video.google.com.""" # Arguments # ========= # url http url of the remote file to download eg. http://www.example.org/movie.mpg # # Further Details # ======...
def download_youtube_dl(self,widget,url): #################### # Description # =========== """Downloads video files from sites like youtube.com, metacafe.com and video.google.com.""" # Arguments # ========= # url http url of the remote file to download eg. http://www.example.org/movie.mpg # # Further Details # ======...
449,089
def ffmpeg_getcodecs(self): #################### # Description # =========== """ This function determines which codecs the user has installed by looking at the output from "ffmpeg -formats" """ # Arguments # ========= # # Further Details # =============== # #################### command = ["ffmpeg","-formats"] output = ...
def ffmpeg_getcodecs(self): #################### # Description # =========== """ This function determines which codecs the user has installed by looking at the output from both "ffmpeg -formats" and "ffmpeg -codecs" """ # Arguments # ========= # # Further Details # =============== # #################### command = ["ffm...
449,090
def ffmpeg_getcodecs(self): #################### # Description # =========== """ This function determines which codecs the user has installed by looking at the output from "ffmpeg -formats" """ # Arguments # ========= # # Further Details # =============== # #################### command = ["ffmpeg","-formats"] output = ...
def ffmpeg_getcodecs(self): #################### # Description # =========== """ This function determines which codecs the user has installed by looking at the output from "ffmpeg -formats" """ # Arguments # ========= # # Further Details # =============== # #################### command = ["ffmpeg","-formats"] output = ...
449,091
def create(cls, attributes): """Create and save a resource with the given attributes.
def create(cls, attributes): """Create and save a resource with the given attributes.
449,092
def _find_class_for_collection(cls, name): """Look in the parent modules for classes matching the element name.
def _find_class_for_collection(cls, collection_name): """Look in the parent modules for classes matching the element name.
449,093
def _find_class_for_collection(cls, name): """Look in the parent modules for classes matching the element name.
def _find_class_for_collection(cls, name): """Look in the parent modules for classes matching the element name.
449,094
def _find_class_for_collection(cls, name): """Look in the parent modules for classes matching the element name.
def _find_class_for_collection(cls, name): """Look in the parent modules for classes matching the element name.
449,095
def UpdateContents(self): if "Week-end" in creche.feries: self.count = 5 else: self.count = 7 first_monday = getFirstMonday() lines = [] for week_day in range(self.count): date = first_monday + datetime.timedelta(self.semaine * 7 + week_day) if date in creche.jours_fermeture: continue day_lines = {} if len(creche.si...
def UpdateContents(self): if "Week-end" in creche.feries: self.count = 5 else: self.count = 7 first_monday = getFirstMonday() lines = [] for week_day in range(self.count): date = first_monday + datetime.timedelta(self.semaine * 7 + week_day) if date in creche.jours_fermeture: continue day_lines = {} if len(creche.si...
449,096
def UpdateContents(self): if "Week-end" in creche.feries: self.count = 5 else: self.count = 7 first_monday = getFirstMonday() lines = [] for week_day in range(self.count): date = first_monday + datetime.timedelta(self.semaine * 7 + week_day) if date in creche.jours_fermeture: continue day_lines = {} if len(creche.si...
defUpdateContents(self):if"Week-end"increche.feries:self.count=5else:self.count=7first_monday=getFirstMonday()lines=[]forweek_dayinrange(self.count):date=first_monday+datetime.timedelta(self.semaine*7+week_day)ifdateincreche.jours_fermeture:continueday_lines={}iflen(creche.sites)>1:lines.append(days[week_day])forsitein...
449,097
def UpdateContents(self): if "Week-end" in creche.feries: self.count = 5 else: self.count = 7 first_monday = getFirstMonday() lines = [] for week_day in range(self.count): date = first_monday + datetime.timedelta(self.semaine * 7 + week_day) if date in creche.jours_fermeture: continue day_lines = {} if len(creche.si...
def UpdateContents(self): if "Week-end" in creche.feries: self.count = 5 else: self.count = 7 first_monday = getFirstMonday() lines = [] for week_day in range(self.count): date = first_monday + datetime.timedelta(self.semaine * 7 + week_day) if date in creche.jours_fermeture: continue day_lines = {} if len(creche.si...
449,098
def EvtPeriodeChoice(self, evt): annee = self.anneechoice.GetClientData(self.anneechoice.GetSelection()) periode = self.periodechoice.GetClientData(self.periodechoice.GetSelection()) heures_contractualisees = 0.0 heures_realisees = 0.0 heures_facturees = 0.0 for mois in periode: debut = datetime.date(annee, mois+1, 1) ...
def EvtPeriodeChoice(self, evt): annee = self.anneechoice.GetClientData(self.anneechoice.GetSelection()) periode = self.periodechoice.GetClientData(self.periodechoice.GetSelection()) heures_contractualisees = 0.0 heures_realisees = 0.0 heures_facturees = 0.0 for mois in periode: debut = datetime.date(annee, mois+1, 1) ...
449,099