rem stringlengths 1 322k | add stringlengths 0 2.05M | context stringlengths 4 228k | meta stringlengths 156 215 |
|---|---|---|---|
twopercent_resourcetemplate = onepercentmanyevents_resource_fd.read() | twopercent_resourcetemplate = twopercent_resource_fd.read() | def main(): """ <Purpose> The main function that calls the process_nodes_and_change_state() function in the node_transition_lib passing in the process and error functions. <Arguments> None <Exceptions> None <Side Effects> None """ # Open and read the resource file that is necessary for twopercent vessels. # This wi... | 2fd89eaf9e7ab7a5c79cc115ccb013a1b97ab34d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7995/2fd89eaf9e7ab7a5c79cc115ccb013a1b97ab34d/transition_canonical_to_twopercent.py |
for possibleport in configuration['ports']: try: servicelogger.log("[INFO]: Trying to wait") shimstack.waitforconn(unique_id, possibleport, nmconnectionmanager.connection_handler) except Exception, e: servicelogger.log("[ERROR]: when calling waitforconn for the connection_handler: " + str(e)) servicelogger.log_last_ex... | if not private_key_string: raise TypeError("private_key_string must be provided if api_key is not") if not isinstance(private_key_string, basestring): raise TypeError("private_key_string must be a string") if not isinstance(xmlrpc_url, basestring): raise TypeError("xmlrpc_url must be a string") if not isinstance(allow... | def start_accepter(): shimstack = ShimStackInterface('(RSAShim)(NatDeciderShim)') unique_id = rsa_publickey_to_string(configuration['publickey']) unique_id = sha_hexhash(unique_id) + str(configuration['service_vessel']) # do this until we get the accepter started... while True: if is_accepter_started(): # we're don... | 99fb6e1ca74de6038aa668a9cd8075a52e5e9538 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7995/99fb6e1ca74de6038aa668a9cd8075a52e5e9538/addme.py |
servicelogger.log("[ERROR]: cannot find a port for waitforconn.") time.sleep(configuration['pollfrequency']) def is_worker_thread_started(): for thread in threading.enumerate(): if 'WorkerThread' in str(thread): return True else: return False def start_worker_thread(sleeptime): if not is_worker_thread_sta... | raise InternalError(fault.faultString) def _do_pwauth_call(self, function, password, *args): """For use by calls that require a password rather than an api key.""" pwauth = {'username':self.auth['username'], 'password':password} | def start_accepter(): shimstack = ShimStackInterface('(RSAShim)(NatDeciderShim)') unique_id = rsa_publickey_to_string(configuration['publickey']) unique_id = sha_hexhash(unique_id) + str(configuration['service_vessel']) # do this until we get the accepter started... while True: if is_accepter_started(): # we're don... | 99fb6e1ca74de6038aa668a9cd8075a52e5e9538 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7995/99fb6e1ca74de6038aa668a9cd8075a52e5e9538/addme.py |
myip = emulcomm.getmyip() except Exception, e: if len(e.args) >= 1 and e.args[0] == "Cannot detect a connection to the Internet.": pass | return function(pwauth, *args) except socket.error, err: raise CommunicationError("XMLRPC failed: " + str(err)) except xmlrpclib.Fault, fault: if fault.faultCode == FAULTCODE_AUTHERROR: raise AuthenticationError elif fault.faultCode == FAULTCODE_INVALIDREQUEST: raise InvalidRequestError(fault.faultString) elif fault.fa... | def main(): global configuration if not FOREGROUND: # Background ourselves. daemon.daemonize() # ensure that only one instance is running at a time... gotlock = runonce.getprocesslock("seattlenodemanager") if gotlock == True: # I got the lock. All is well... pass else: if gotlock: servicelogger.log("[ERROR]:Anothe... | 99fb6e1ca74de6038aa668a9cd8075a52e5e9538 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7995/99fb6e1ca74de6038aa668a9cd8075a52e5e9538/addme.py |
raise else: break time.sleep(0.1) vesseldict = nmrequesthandler.initialize(myip, configuration['publickey'], version) myname = start_accepter() servicelogger.log('myname = '+str(myname)) start_worker_thread(configuration['pollfrequency']) start_advert_thread(vesseldict, myname, configuration['publickey']) ... | raise InternalError(fault.faultString) def acquire_lan_resources(self, count): """ <Purpose> Acquire LAN vessels. <Arguments> count The number of vessels to acquire. <Exceptions> The common exceptions described in the module comments, as well as: SeattleGENINotEnoughCredits If the account does not have enough availa... | def main(): global configuration if not FOREGROUND: # Background ourselves. daemon.daemonize() # ensure that only one instance is running at a time... gotlock = runonce.getprocesslock("seattlenodemanager") if gotlock == True: # I got the lock. All is well... pass else: if gotlock: servicelogger.log("[ERROR]:Anothe... | 99fb6e1ca74de6038aa668a9cd8075a52e5e9538 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7995/99fb6e1ca74de6038aa668a9cd8075a52e5e9538/addme.py |
main() except Exception,e: servicelogger.log_last_exception() harshexit.harshexit(15) | import M2Crypto except ImportError, err: raise ImportError("In order to use the SeattleGENI XMLRPC client with " + "allow_ssl_insecure=False, you need M2Crypto " + "installed. " + str(err)) class M2CryptoSSLTransport(M2Crypto.m2xmlrpclib.SSL_Transport): def request(self, host, handler, request_body, verbose=0): if h... | def main(): global configuration if not FOREGROUND: # Background ourselves. daemon.daemonize() # ensure that only one instance is running at a time... gotlock = runonce.getprocesslock("seattlenodemanager") if gotlock == True: # I got the lock. All is well... pass else: if gotlock: servicelogger.log("[ERROR]:Anothe... | 99fb6e1ca74de6038aa668a9cd8075a52e5e9538 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7995/99fb6e1ca74de6038aa668a9cd8075a52e5e9538/addme.py |
times = windows_api.process_times(pid) | times = process_times(pid) | def get_process_cpu_time(pid): """ <Purpose> See process_times <Arguments> See process_times <Exceptions> See process_times <Returns> The amount of CPU time used by the kernel and user in seconds. """ # Get the times times = windows_api.process_times(pid) # Add kernel and user time together... It's in units of 10... | 98ecf300d8b4d13608163ca21c082bd5f56e5106 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7995/98ecf300d8b4d13608163ca21c082bd5f56e5106/windows_api.py |
copy_to_target("production_nat_new/src/nmpatch/nmmain.py", target_dir) copy_to_target("production_nat_new/src/nmpatch/nmclient.repy", target_dir) copy_to_target("production_nat_new/src/nmpatch/sockettimeout.repy", target_dir) copy_to_target("production_nat_new/src/nmpatch/ShimStackInterface.repy", target_dir) | def main(): repytest = False RANDOMPORTS = False target_dir = None for arg in sys.argv[1:]: # -t means we will copy repy tests if arg == '-t': repytest = True # The user wants us to fill in the port numbers randomly. elif arg == '-randomports': RANDOMPORTS = True # Not a flag? Assume it's the target directory else: ... | 3aba7caf204d6bc10d1bd5220f4752824294b94e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7995/3aba7caf204d6bc10d1bd5220f4752824294b94e/preparetest.py | |
try: advertise_announce(unique_id, myip, DNS_CACHE_TTL) servicelogger.log("[INFO]: Advertised " + str(unique_id) + " which maps to " + myip) except Exception, error: if 'announce error' in str(error): pass else: raise Exception(error) | advertise_success = False while not advertise_success: try: advertise_announce(unique_id, myip, DNS_CACHE_TTL) servicelogger.log("[INFO]: Advertised " + str(unique_id) + " which maps to " + myip) advertise_success = True except Exception, error: if 'announce error' in str(error): advertise_success = True else: a... | def advertise_to_DNS(unique_id): """ Advertise unique_id to the zenodotus DNS server. We strip away whatever that follows the NAME_SERVER part of the unique_id. For instance, if our unique_id is abc.NAME_SERVER:1234@xyz, then we only advertise abc.NAME_SERVER. """ # IP that maps to the unique_id myip = emulcomm.getmyi... | 717ad4f65641a2bd4f9fb31cf3f7452634fae3ba /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7995/717ad4f65641a2bd4f9fb31cf3f7452634fae3ba/nmmain.py |
copy_to_target("production_nat_new/src/nmpatch/nmmain.py") copy_to_target("production_nat_new/src/nmpatch/nmclient.repy") copy_to_target("production_nat_new/src/nmpatch/sockettimeout.repy") copy_to_target("production_nat_new/src/nmpatch/ShimStackInterface.repy") | copy_to_target("production_nat_new/src/nmpatch/nmmain.py", target_dir) copy_to_target("production_nat_new/src/nmpatch/nmclient.repy", target_dir) copy_to_target("production_nat_new/src/nmpatch/sockettimeout.repy", target_dir) copy_to_target("production_nat_new/src/ShimStackInterface.repy", target_dir) | def main(): repytest = False RANDOMPORTS = False target_dir = None for arg in sys.argv[1:]: # -t means we will copy repy tests if arg == '-t': repytest = True # The user wants us to fill in the port numbers randomly. elif arg == '-randomports': RANDOMPORTS = True # Not a flag? Assume it's the target directory else: ... | 5eb8f5e933ecbefef0bb8d0973860c7ae1bf7791 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7995/5eb8f5e933ecbefef0bb8d0973860c7ae1bf7791/preparetest.py |
def drvterm(t,p,q,l,m): dv=t.betx**(p/2.)*t.bety**(q/2.) dv*=exp(+2j*pi*((p-2*l)*t.mux+(q-2*m)*t.muy)) | def drvterm(t,p=0,q=0,l=0,m=0): dv=t.betx**(abs(p)/2.)*t.bety**(abs(q)/2.) dv*=_n.exp(+2j*pi*((p-2*l)*t.mux+(q-2*m)*t.muy)) | def drvterm(t,p,q,l,m): dv=t.betx**(p/2.)*t.bety**(q/2.) dv*=exp(+2j*pi*((p-2*l)*t.mux+(q-2*m)*t.muy)) return dv | 3d13b9271bfc1293d64594ec1e5c0d576c680f55 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5983/3d13b9271bfc1293d64594ec1e5c0d576c680f55/optics.py |
s=self.xaxis | s=self.ont.s | def _lattice(self,names,color,lbl): | a4f2abb475d4e687c401a7ca9d020f002dc0ec02 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5983/a4f2abb475d4e687c401a7ca9d020f002dc0ec02/optics.py |
prenoms=[unicode(x.strip(),"utf-8") for x in open("prenoms.txt")] | prenoms=[unicode(x.strip(),"utf-8").capitalize() for x in open("prenoms.txt")] | def __init__(self, parent=None): QtGui.QWidget.__init__(self, parent) self.ui = Ui_MainWindow() self.ui.setupUi(self) | 19c8bdeb0c3f63a86180290e24195c2e59889930 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/13828/19c8bdeb0c3f63a86180290e24195c2e59889930/vote.py |
p1,p2=self.combis.pop() while frozenset((p1,p2)) in self.ballots.ballots.keys(): try: p1,p2=self.combis.pop() except IndexError: | p1,p2=None,None while p1 is None or frozenset((p1,p2)) in self.ballots.ballots.keys(): if not self.combis: | def update(self): p1,p2=self.combis.pop() while frozenset((p1,p2)) in self.ballots.ballots.keys(): try: p1,p2=self.combis.pop() except IndexError: print "Thanks, you are done!" QtGui.QApplication.instance().quit() sys.exit(0) self.ui.prenom1.setText(p1) self.ui.prenom2.setText(p2) | 19c8bdeb0c3f63a86180290e24195c2e59889930 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/13828/19c8bdeb0c3f63a86180290e24195c2e59889930/vote.py |
QtGui.QApplication.instance().quit() | def update(self): p1,p2=self.combis.pop() while frozenset((p1,p2)) in self.ballots.ballots.keys(): try: p1,p2=self.combis.pop() except IndexError: print "Thanks, you are done!" QtGui.QApplication.instance().quit() sys.exit(0) self.ui.prenom1.setText(p1) self.ui.prenom2.setText(p2) | 19c8bdeb0c3f63a86180290e24195c2e59889930 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/13828/19c8bdeb0c3f63a86180290e24195c2e59889930/vote.py | |
old_sep,old_count=self.ballots[self.get_couple(ballot)] | d1,d2,old_sep,old_count=self.ballots[self.get_couple(ballot)] | def add(self,ballot): winner,sep,other,count=ballot winner=winner.capitalize() other=other.capitalize() if not self.is_in(ballot): self.ballots[self.get_couple(ballot)]=(winner,sep,other,count) else: old_sep,old_count=self.ballots[self.get_couple(ballot)] assert(old_sep==sep) self.ballots[self.get_couple(ballot)]=(winn... | 794ff6b34413bf5aed81fecb6828ed21281f9550 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/13828/794ff6b34413bf5aed81fecb6828ed21281f9550/vote.py |
return repr(count)+":"+winner+sep+other | return unicode(repr(count))+u":"+winner+sep+other | def ballot_repr(self,ballot): winner,sep,other,count=ballot return repr(count)+":"+winner+sep+other | 794ff6b34413bf5aed81fecb6828ed21281f9550 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/13828/794ff6b34413bf5aed81fecb6828ed21281f9550/vote.py |
f.write((self.ballot_repr(ballot)+"\n").encode("utf-8")) | f.write((self.ballot_repr(ballot)+u"\n").encode("utf-8")) | def save(self): with open(self.filename,"w") as f: for ballot in self.ballots.values(): f.write((self.ballot_repr(ballot)+"\n").encode("utf-8")) | 794ff6b34413bf5aed81fecb6828ed21281f9550 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/13828/794ff6b34413bf5aed81fecb6828ed21281f9550/vote.py |
b=(unicode(self.ui.prenom1.text()),"=",unicode(self.ui.prenom2.text()),1) | b=(unicode(self.ui.prenom1.text()),u"=",unicode(self.ui.prenom2.text()),1) | def count_ballot_and_update(self,win): if win == 0: b=(unicode(self.ui.prenom1.text()),"=",unicode(self.ui.prenom2.text()),1) elif win==1: b=(unicode(self.ui.prenom1.text()),">",unicode(self.ui.prenom2.text()),1) elif win==2: b=(unicode(self.ui.prenom2.text()),">",unicode(self.ui.prenom1.text()),1) self.ballots.add(b) ... | 794ff6b34413bf5aed81fecb6828ed21281f9550 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/13828/794ff6b34413bf5aed81fecb6828ed21281f9550/vote.py |
b=(unicode(self.ui.prenom1.text()),">",unicode(self.ui.prenom2.text()),1) | b=(unicode(self.ui.prenom1.text()),u">",unicode(self.ui.prenom2.text()),1) | def count_ballot_and_update(self,win): if win == 0: b=(unicode(self.ui.prenom1.text()),"=",unicode(self.ui.prenom2.text()),1) elif win==1: b=(unicode(self.ui.prenom1.text()),">",unicode(self.ui.prenom2.text()),1) elif win==2: b=(unicode(self.ui.prenom2.text()),">",unicode(self.ui.prenom1.text()),1) self.ballots.add(b) ... | 794ff6b34413bf5aed81fecb6828ed21281f9550 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/13828/794ff6b34413bf5aed81fecb6828ed21281f9550/vote.py |
b=(unicode(self.ui.prenom2.text()),">",unicode(self.ui.prenom1.text()),1) | b=(unicode(self.ui.prenom2.text()),u">",unicode(self.ui.prenom1.text()),1) | def count_ballot_and_update(self,win): if win == 0: b=(unicode(self.ui.prenom1.text()),"=",unicode(self.ui.prenom2.text()),1) elif win==1: b=(unicode(self.ui.prenom1.text()),">",unicode(self.ui.prenom2.text()),1) elif win==2: b=(unicode(self.ui.prenom2.text()),">",unicode(self.ui.prenom1.text()),1) self.ballots.add(b) ... | 794ff6b34413bf5aed81fecb6828ed21281f9550 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/13828/794ff6b34413bf5aed81fecb6828ed21281f9550/vote.py |
base.__name__, | base.__plain_name__, | def __new__(meta_class, class_name, bases, class_dict, **kw_arguments): """ Create a new type object, for example through a 'class' statement. Behaves like a class method and is called before __init__(). """ if kw_arguments: # Assigning values to the parameters means specializing the # template. Therefore, derive a su... | ba5c445a8609ca5bf441edcaf37518cacef2ed40 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10264/ba5c445a8609ca5bf441edcaf37518cacef2ed40/types.py |
@param[in] stats The @c pstats.Stats compatible object whose data is to be represented as the new CallGraph. | @param stats The @c pstats.Stats compatible object whose data is to be represented as the new CallGraph. | def __init__(self, stats): """ Constructs a CallGraph from the given @p stats object. @param[in] stats The @c pstats.Stats compatible object whose data is to be represented as the new CallGraph. """ # Function -> ( Outgoing Calls, Incoming Calls ) self.__functions = {} # Call -> ( Calling Function, Called Functi... | 472ab6914163cde4ce9c20ac96cd86b1a7236c0a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10264/472ab6914163cde4ce9c20ac96cd86b1a7236c0a/callgraph.py |
def __bool__(self): """ Test whether the element is non-zero: return @c True if, and only if, it is non-zero. Otherwise return @c False. Implicit conversions to boolean (truth) values use this method, for example when @c x is an element of a Field: @code if x: do_something() @endcode @exception NotImplementedError if... | def __bool__(self): """ Test whether the element is non-zero: return @c True if, and only if, it is non-zero. Otherwise return @c False. Implicit conversions to boolean (truth) values use this method, for example when @c x is an element of a Field: @code if x: do_something() @endcode @exception NotImplementedError if... | 5cdde871f8683be9e30f8752b360f472c96a7f79 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10264/5cdde871f8683be9e30f8752b360f472c96a7f79/__init__.py | |
method, for example: | method; for example: | def __neq__(self, other): """ Test whether another element @p other is different from @p self; return @c True if that is the case. The infix operator @c != calls this method, for example: @code if self != other: do_something() @endcode """ return not self.__eq__( other ) | 5cdde871f8683be9e30f8752b360f472c96a7f79 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10264/5cdde871f8683be9e30f8752b360f472c96a7f79/__init__.py |
calls this method if @p self is the minuend (left element), for example: | calls this method if @p self is the minuend (left element); for example: | def __sub__(self, other): """ Return the difference of @p self and @p other. The infix operator @c - calls this method if @p self is the minuend (left element), for example: @code result = self - other @endcode """ return self.__add__( -other ) | 5cdde871f8683be9e30f8752b360f472c96a7f79 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10264/5cdde871f8683be9e30f8752b360f472c96a7f79/__init__.py |
calls this method if @p self is the dividend, for example: | calls this method if @p self is the dividend; for example: | def __truediv__(self, other): """ Return the quotient of @p self and @p other. The infix operator @c / calls this method if @p self is the dividend, for example: @code result = self / other @endcode @exception ZeroDivisionError if @p other is zero. @exception TypeError if @p other lacks the multiplicative... | 5cdde871f8683be9e30f8752b360f472c96a7f79 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10264/5cdde871f8683be9e30f8752b360f472c96a7f79/__init__.py |
print( "platform: {0}".format( platform.platform() ), file = timing_file ) print( "python: {0}".format( platform.python_version() ), file = timing_file ) print( "wall time (s): {0}".format( wall_time ), file = timing_file ) print( "user time (s): {0}".format( user_time ), file = timing_file ) print( "sys time (s): {0}"... | info = [ "node: {0}".format( platform.node() ), "platform: {0}".format( platform.platform() ), "python: {0}".format( platform.python_version() ), "date (Y/M/D h:m:s): {0}".format( datetime.now().strftime("%Y/%m/%d %H:%M:%S") ), "wall time (s): {0}".format( wall_time ), "user time (s): {0}".format( user_time ), "sys tim... | def dump_data(self, extra_information = {}): if self.is_running(): self.stop() # Yes, this is a race condition. self.__profile_file.close() self.__profile.dump_stats( self.__profile_file.name ) | 8c3213d1cd42162a32b568732093724083e1b2e4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10264/8c3213d1cd42162a32b568732093724083e1b2e4/running.py |
print( "{0}: {1}".format( key, value ), file = timing_file ) | info.append( "{0}: {1}".format( key, value ) ) print( "\n".join( info ), file=timing_file ) | def dump_data(self, extra_information = {}): if self.is_running(): self.stop() # Yes, this is a race condition. self.__profile_file.close() self.__profile.dump_stats( self.__profile_file.name ) | 8c3213d1cd42162a32b568732093724083e1b2e4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10264/8c3213d1cd42162a32b568732093724083e1b2e4/running.py |
while line and not line.strip() and line.strip().startswith( " | while line and (not line.strip() or line.strip().startswith( " | def __iter__(self): # Register: increase the number of parsers with self.__lock() as data: parsers, current_offset, current_line = data self.__update( parsers + 1, current_offset, current_line ) # Iterate until the file ends line = self.__file.readline() while line: with self.__lock() as data: parsers, current_offset,... | 8c3213d1cd42162a32b568732093724083e1b2e4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10264/8c3213d1cd42162a32b568732093724083e1b2e4/running.py |
yield current_line, tuple( line.split( self.__separator ) ) | yield current_line, tuple( line.strip().split( self.__separator ) ) | def __iter__(self): # Register: increase the number of parsers with self.__lock() as data: parsers, current_offset, current_line = data self.__update( parsers + 1, current_offset, current_line ) # Iterate until the file ends line = self.__file.readline() while line: with self.__lock() as data: parsers, current_offset,... | 8c3213d1cd42162a32b568732093724083e1b2e4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10264/8c3213d1cd42162a32b568732093724083e1b2e4/running.py |
self.__input = [ ( "<stdin>", [ (0, tuple( arguments ) ) ] ) ] | self.__input = [] if arguments: self.__input.append( ( "<stdin>", [ (0, tuple( arguments ) ) ] ) ) | def __init__(self, algorithm, arguments=sys.argv[1:], algorithm_version="<unknown>" ): self.__algorithm = algorithm self.__algorithm_version = algorithm_version options, arguments = self._parse_arguments( arguments, algorithm_version ) # __input is a list of pairs (<name>, <iterable>); # <iterable> is expected to retu... | 8c3213d1cd42162a32b568732093724083e1b2e4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10264/8c3213d1cd42162a32b568732093724083e1b2e4/running.py |
modulo_primes = greedy_prime_factors( | torsion_primes = greedy_prime_factors( | def frobenius_trace(curve): """ Compute the trace of the Frobenius endomorphism for the given EllpiticCurve @p curve. This is an implementation of Schoof's original algorithm for counting the points of an elliptic curve over a finite field. @return The trace @f$ t @f$ of the Frobenius endomorphism. The number of p... | 7cc864441f472f2e8b01251a88abb79d737c24ac /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10264/7cc864441f472f2e8b01251a88abb79d737c24ac/reduced_computation_schoof.py |
if 2 in modulo_primes: | if 2 in torsion_primes: | def frobenius_trace(curve): """ Compute the trace of the Frobenius endomorphism for the given EllpiticCurve @p curve. This is an implementation of Schoof's original algorithm for counting the points of an elliptic curve over a finite field. @return The trace @f$ t @f$ of the Frobenius endomorphism. The number of p... | 7cc864441f472f2e8b01251a88abb79d737c24ac /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10264/7cc864441f472f2e8b01251a88abb79d737c24ac/reduced_computation_schoof.py |
modulo_primes.remove( 2 ) | torsion_primes.remove( 2 ) | def frobenius_trace(curve): """ Compute the trace of the Frobenius endomorphism for the given EllpiticCurve @p curve. This is an implementation of Schoof's original algorithm for counting the points of an elliptic curve over a finite field. @return The trace @f$ t @f$ of the Frobenius endomorphism. The number of p... | 7cc864441f472f2e8b01251a88abb79d737c24ac /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10264/7cc864441f472f2e8b01251a88abb79d737c24ac/reduced_computation_schoof.py |
for prime in modulo_primes: | for prime in torsion_primes: | def frobenius_trace(curve): """ Compute the trace of the Frobenius endomorphism for the given EllpiticCurve @p curve. This is an implementation of Schoof's original algorithm for counting the points of an elliptic curve over a finite field. @return The trace @f$ t @f$ of the Frobenius endomorphism. The number of p... | 7cc864441f472f2e8b01251a88abb79d737c24ac /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10264/7cc864441f472f2e8b01251a88abb79d737c24ac/reduced_computation_schoof.py |
def frobenius_trace_mod_l(torsion_group): """ Compute the trace of the Frobenius endomorphism modulo @f$ l @f$, where @f$ l @f$ is the torsion of @p torsion_group. The function guesses candidates and verifies whether the function that results from applying the characteristic polynomial @f$ \chi_\phi @f$ to @f$ \phi @f... | 7cc864441f472f2e8b01251a88abb79d737c24ac /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10264/7cc864441f472f2e8b01251a88abb79d737c24ac/reduced_computation_schoof.py | ||
def greedy_prime_factors(n, shunned=0): """ Return a list of the first primes whose product is greater than, or equal to @p n, but do not use @p shunned. For example, if @p n is 14, then the returned list will consist of 3 and 5, but not 2, because 3 times 5 is greater than 14. The function behaves like inverse_primor... | 7cc864441f472f2e8b01251a88abb79d737c24ac /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10264/7cc864441f472f2e8b01251a88abb79d737c24ac/reduced_computation_schoof.py | ||
if not os.path.islink(line): logging.info("creating symlink from %s to %s", reposfilepath + line, line) | if not os.path.islink(line) and accesscontrollist.hasacl(line) and not options.ignoreacl: err = "filetoversion has a 'deny' in ACL permissions (ls -lde %s: %s) \n \ This program is currently not clever enough to check if you have permission to move/delete this file. \n \ To avoid this problem remove deny permissions fr... | def makesymlinks(repospath): reposfilepath = os.path.abspath(repospath) with open(os.path.join(repospath, SYNCHER_DB_FILENAME)) as db: try: for line in db: line = line.strip() if not os.path.islink(line): logging.info("creating symlink from %s to %s", reposfilepath + line, line) if not options.dry: if os.path.exists(li... | 89b492e4f795b5a957e6231e2a08d7669894154f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10713/89b492e4f795b5a957e6231e2a08d7669894154f/symlinkrepos.py |
acl = None | def makesymlinks(repospath): reposfilepath = os.path.abspath(repospath) with open(os.path.join(repospath, SYNCHER_DB_FILENAME)) as db: try: for line in db: line = line.strip() if not os.path.islink(line): logging.info("creating symlink from %s to %s", reposfilepath + line, line) if not options.dry: if os.path.exists(li... | 89b492e4f795b5a957e6231e2a08d7669894154f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10713/89b492e4f795b5a957e6231e2a08d7669894154f/symlinkrepos.py | |
acl = removeacl(line) util.move(line, line+".beforesyncher") if acl is not None: accesscontrollist.setacl(line, acl) | acl = accesscontrollist.removeacl(line) util.move(line, line+"-beforesyncher") | def makesymlinks(repospath): reposfilepath = os.path.abspath(repospath) with open(os.path.join(repospath, SYNCHER_DB_FILENAME)) as db: try: for line in db: line = line.strip() if not os.path.islink(line): logging.info("creating symlink from %s to %s", reposfilepath + line, line) if not options.dry: if os.path.exists(li... | 89b492e4f795b5a957e6231e2a08d7669894154f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10713/89b492e4f795b5a957e6231e2a08d7669894154f/symlinkrepos.py |
exc = sys.exc_info()[1] raise exc | exc = sys.exc_info()[1] raise exc | def parseString( self, instring, parseAll=False ): """Execute the parse expression with the given string. This is the main interface to the client code, once the complete expression has been built. | a340e95bb0e330881e7c570990ddda53290b256b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12364/a340e95bb0e330881e7c570990ddda53290b256b/pyparsing_py3.py |
if self.val.type.code == gdb.TYPE_CODE_RANGE: | if self.val['code'] == gdb.TYPE_CODE_RANGE: | def to_string(self): """Return a pretty-printed image of our main_type. """ fields = [] fields.append("name = %s" % self.val['name']) fields.append("tag_name = %s" % self.val['tag_name']) fields.append("code = %s" % self.val['code']) fields.append("flags = [%s]" % self.flags_to_string()) fields.append("owner = %s" % se... | 5a7d297248beb0d4e8ca816a0d3e21ed7c7d709f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9879/5a7d297248beb0d4e8ca816a0d3e21ed7c7d709f/gdb-gdb.py |
if self.val.type.code == gdb.TYPE_CODE_RANGE: | if self.val['code'] == gdb.TYPE_CODE_RANGE: | def to_string(self): """Return a pretty-printed image of our main_type. """ fields = [] fields.append("name = %s" % self.val['name']) fields.append("tag_name = %s" % self.val['tag_name']) fields.append("code = %s" % self.val['code']) fields.append("flags = [%s]" % self.flags_to_string()) fields.append("owner = %s" % se... | 9bf91e0a3545162e68b84780a6cfd2325fa5fe03 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9879/9bf91e0a3545162e68b84780a6cfd2325fa5fe03/gdb-gdb.py |
except: pass | except: pass | def scrapeNfo(self, metadata, media, lang): Log("all your datas are belong to us") Log('UPDATE: ' + media.items[0].parts[0].file) path = os.path.dirname(media.items[0].parts[0].file) id=media.title nfoFile='' Log(path) if os.path.exists(path): for f in os.listdir(path): if f.split(".")[-1].lower() == "nfo": nfoName=f.s... | e2428c28f2ce50df527813f9898759870d32678e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14874/e2428c28f2ce50df527813f9898759870d32678e/__init__.py |
m = re.search('(tt[0-9]+)', metadata.guid) if m: id = m.groups(1)[0] | m = re.search('(tt[0-9]+)', metadata.guid) if m: id = m.groups(1)[0] | def scrapeNfo(self, metadata, media, lang): Log("all your datas are belong to us") Log('UPDATE: ' + media.items[0].parts[0].file) path = os.path.dirname(media.items[0].parts[0].file) id=media.title nfoFile='' Log(path) if os.path.exists(path): for f in os.listdir(path): if f.split(".")[-1].lower() == "nfo": nfoName=f.s... | e2428c28f2ce50df527813f9898759870d32678e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14874/e2428c28f2ce50df527813f9898759870d32678e/__init__.py |
def scrapeNfo(self, metadata, media, lang): Log("all your datas are belong to us") Log('UPDATE: ' + media.items[0].parts[0].file) path = os.path.dirname(media.items[0].parts[0].file) id=media.title nfoFile='' Log(path) if os.path.exists(path): for f in os.listdir(path): if f.split(".")[-1].lower() == "nfo": nfoName=f.s... | 7766e44ff918621f057e618978f8bd8f87dc2542 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14874/7766e44ff918621f057e618978f8bd8f87dc2542/__init__.py | ||
<<<<<<< HEAD | def search(self, results, media, lang): Log("Searching") fname=Media id=media.name pageUrl="http://localhost:32400/library/metadata/" + media.id page=HTTP.Request(pageUrl) Log(media.primary_metadata) nfoXML = XML.ElementFromURL(pageUrl).xpath('//MediaContainer/Video/Media/Part')[0] path1=nfoXML.get('file') path = os.p... | 4e20cce3a10111505cec7c4e88b992777970c7bb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14874/4e20cce3a10111505cec7c4e88b992777970c7bb/__init__.py | |
======= >>>>>>> e5a5e37cb95fd2b91a757284cc694e01ea9da987 | def search(self, results, media, lang): Log("Searching") fname=Media id=media.name pageUrl="http://localhost:32400/library/metadata/" + media.id page=HTTP.Request(pageUrl) Log(media.primary_metadata) nfoXML = XML.ElementFromURL(pageUrl).xpath('//MediaContainer/Video/Media/Part')[0] path1=nfoXML.get('file') path = os.p... | 4e20cce3a10111505cec7c4e88b992777970c7bb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14874/4e20cce3a10111505cec7c4e88b992777970c7bb/__init__.py | |
<<<<<<< HEAD | def search(self, results, media, lang): Log("Searching") fname=Media id=media.name pageUrl="http://localhost:32400/library/metadata/" + media.id page=HTTP.Request(pageUrl) Log(media.primary_metadata) nfoXML = XML.ElementFromURL(pageUrl).xpath('//MediaContainer/Video/Media/Part')[0] path1=nfoXML.get('file') path = os.p... | 4e20cce3a10111505cec7c4e88b992777970c7bb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14874/4e20cce3a10111505cec7c4e88b992777970c7bb/__init__.py | |
======= name="Nfo_" + media.name results.Append(MetadataSearchResult(id=media.id,name=name,year=3000,lang=lang,score=100)) >>>>>>> e5a5e37cb95fd2b91a757284cc694e01ea9da987 | def search(self, results, media, lang): Log("Searching") fname=Media id=media.name pageUrl="http://localhost:32400/library/metadata/" + media.id page=HTTP.Request(pageUrl) Log(media.primary_metadata) nfoXML = XML.ElementFromURL(pageUrl).xpath('//MediaContainer/Video/Media/Part')[0] path1=nfoXML.get('file') path = os.p... | 4e20cce3a10111505cec7c4e88b992777970c7bb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14874/4e20cce3a10111505cec7c4e88b992777970c7bb/__init__.py | |
<<<<<<< HEAD | def scrapeNfo(self, metadata, media, lang): Log("all your datas are belong to us") Log('UPDATE: ' + media.items[0].parts[0].file) path = os.path.dirname(media.items[0].parts[0].file) id=media.title nfoFile='' Log(path) if os.path.exists(path): for f in os.listdir(path): if f.split(".")[-1].lower() == "nfo": nfoName=f.s... | 4e20cce3a10111505cec7c4e88b992777970c7bb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14874/4e20cce3a10111505cec7c4e88b992777970c7bb/__init__.py | |
======= metadata.directors.clear() try: metadata.directors.add(nfoXML.xpath("director")[0].text) except: pass >>>>>>> e5a5e37cb95fd2b91a757284cc694e01ea9da987 | def scrapeNfo(self, metadata, media, lang): Log("all your datas are belong to us") Log('UPDATE: ' + media.items[0].parts[0].file) path = os.path.dirname(media.items[0].parts[0].file) id=media.title nfoFile='' Log(path) if os.path.exists(path): for f in os.listdir(path): if f.split(".")[-1].lower() == "nfo": nfoName=f.s... | 4e20cce3a10111505cec7c4e88b992777970c7bb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14874/4e20cce3a10111505cec7c4e88b992777970c7bb/__init__.py | |
<<<<<<< HEAD | def scrapeNfo(self, metadata, media, lang): Log("all your datas are belong to us") Log('UPDATE: ' + media.items[0].parts[0].file) path = os.path.dirname(media.items[0].parts[0].file) id=media.title nfoFile='' Log(path) if os.path.exists(path): for f in os.listdir(path): if f.split(".")[-1].lower() == "nfo": nfoName=f.s... | 4e20cce3a10111505cec7c4e88b992777970c7bb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14874/4e20cce3a10111505cec7c4e88b992777970c7bb/__init__.py | |
======= metadata.genres.clear() Log("cleared genres") for r in genres: Log(r) metadata.genres.add(r) Log(metadata.genres) metadata.roles.clear() for actor in nfoXML.findall('./actor'): role = metadata.roles.new() try: role.role = actor.xpath("role")[0].text except: pass try: role.actor = actor.xpath("name")[0].text ex... | def grabPoster(pUrl=thumb.text, i=i): posterUrl = pUrl Log("Adding: " + pUrl) thumbpic = HTTP.Request(pUrl) metadata.posters[posterUrl] = Proxy.Preview(thumbpic, sort_order = i) | 4e20cce3a10111505cec7c4e88b992777970c7bb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14874/4e20cce3a10111505cec7c4e88b992777970c7bb/__init__.py | |
def system_load(): loads = open('/proc/loadavg').read().split(" ") allusers = users allusers.Select(allusers.FILTER_STANDARD) nbusers = len(allusers.filtered_users) cxusers = len(Popen('who', shell = True, stdin = PIPE, stdout = PIPE, close_fds = True).stdout.read().split('\n')) if cxusers > 1: s_users = 's' else: s... | 16349ceb256a4fadc58fa051cf7cc6d978d7b11e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/16349ceb256a4fadc58fa051cf7cc6d978d7b11e/base.py | ||
uptime_string += _('%d sec%s') % (uptime_sec, s_sec) | uptime_string += _('%d sec%s') % (uptime_sec, s_sec) | def system_load(): loads = open('/proc/loadavg').read().split(" ") allusers = users allusers.Select(allusers.FILTER_STANDARD) nbusers = len(allusers.filtered_users) cxusers = len(Popen('who', shell = True, stdin = PIPE, stdout = PIPE, close_fds = True).stdout.read().split('\n')) if cxusers > 1: s_users = 's' else: s... | 16349ceb256a4fadc58fa051cf7cc6d978d7b11e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/16349ceb256a4fadc58fa051cf7cc6d978d7b11e/base.py |
1, 5, and 15 last minutes load average: <strong>%s</strong>, %s, %s''') % (uptime_string, nbusers, cxusers, loads[0], loads[1], loads[2]) | 1, 5, and 15 last minutes load average: <strong>%s</strong>, %s, %s''') % (uptime_string, nbusers, cxusers, loads[0], loads[1], loads[2]) | def system_load(): loads = open('/proc/loadavg').read().split(" ") allusers = users allusers.Select(allusers.FILTER_STANDARD) nbusers = len(allusers.filtered_users) cxusers = len(Popen('who', shell = True, stdin = PIPE, stdout = PIPE, close_fds = True).stdout.read().split('\n')) if cxusers > 1: s_users = 's' else: s... | 16349ceb256a4fadc58fa051cf7cc6d978d7b11e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/16349ceb256a4fadc58fa051cf7cc6d978d7b11e/base.py |
return _(''' | if mem['SwapTotal'] == 0: swap_message = _("no virtual memory installed.") else: swap_message = \ _("Virtual memory: %.2f Gb total, <strong>%.0f%% free<strong>.") % \ (mem['SwapTotal'], (mem['SwapFree'] * 100.0 / mem['SwapTotal'])) return (_(''' | def compute_mem(line, x): #logging.debug(line[0:-1] + " -> " + re.split('\W+', line)[1]) | 16349ceb256a4fadc58fa051cf7cc6d978d7b11e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/16349ceb256a4fadc58fa051cf7cc6d978d7b11e/base.py |
Virtual memory: %.2f Gb total, <strong>%.0f%% free<strong>. ''') % (s, cpus, model, mem['MemTotal'], (mem['Inactive'] + mem['Active']), mem['Cached'], mem['Buffers'], mem['SwapTotal'], (mem['SwapFree'] * 100.0 / mem['SwapTotal']) ) | %s''') % (s, cpus, model, mem['MemTotal'], (mem['Inactive'] + mem['Active']), mem['Cached'], mem['Buffers'], swap_message)) | def compute_mem(line, x): #logging.debug(line[0:-1] + " -> " + re.split('\W+', line)[1]) | 16349ceb256a4fadc58fa051cf7cc6d978d7b11e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/16349ceb256a4fadc58fa051cf7cc6d978d7b11e/base.py |
def index(uri, http_user): start = time.time() title = _("Server status") data = '<div id="banner">\n%s\n%s\n%s\n</div><!-- banner -->\n<div id="main">\n%s\n<div id="content">' % (w.backto(), w.metanav(http_user), w.menu(uri), ctxtnav()) data += '''<table> <tr> <td><h1>%s</h1><br />%s</td> <td><h1>%s</h1>%s</td> </... | 16349ceb256a4fadc58fa051cf7cc6d978d7b11e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/16349ceb256a4fadc58fa051cf7cc6d978d7b11e/base.py | ||
data = '<div id="banner">\n%s\n%s\n%s\n</div><!-- banner -->\n<div id="main">\n%s\n<div id="content">' % (w.backto(), w.metanav(http_user), w.menu(uri), ctxtnav()) | data = '<div id="banner">\n%s\n%s\n%s\n</div><!-- banner -->\n<div id="main">\n%s\n<div id="content">' % (w.backto(), w.metanav(http_user), w.menu(uri), ctxtnav()) | def index(uri, http_user): start = time.time() title = _("Server status") data = '<div id="banner">\n%s\n%s\n%s\n</div><!-- banner -->\n<div id="main">\n%s\n<div id="content">' % (w.backto(), w.metanav(http_user), w.menu(uri), ctxtnav()) data += '''<table> <tr> <td><h1>%s</h1><br />%s</td> <td><h1>%s</h1>%s</td> </... | 16349ceb256a4fadc58fa051cf7cc6d978d7b11e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/16349ceb256a4fadc58fa051cf7cc6d978d7b11e/base.py |
LicornMessage(data=text_message), | LicornMessage(data=text_message, channel=1), | def output(self, text_message): return current_thread().listener.process( LicornMessage(data=text_message), options.msgproc.getProxy()) | d5980ccaf85371bb2f2dd030582cd63c6e7979c5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/d5980ccaf85371bb2f2dd030582cd63c6e7979c5/rwi.py |
self.reload() | self.reload(full=False) | def __init__(self, configuration): """ Create the user accounts list from the underlying system. """ | 8298bb4c166c10335fde7321145b88da300e88e1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/8298bb4c166c10335fde7321145b88da300e88e1/users.py |
def reload(self): | def reload(self, full=True): | def reload(self): """ Load (or reload) the data structures from the system data. """ | 8298bb4c166c10335fde7321145b88da300e88e1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/8298bb4c166c10335fde7321145b88da300e88e1/users.py |
users.reload() | def main(uri, http_user, sort = "login", order = "asc"): """ display all users in a nice HTML page. """ start = time.time() groups.reload() users.reload() # profiles.reload() u = users.users g = groups.groups p = profiles.profiles groups.Select(filters.PRIVILEGED) pri_grps = [ g[gid]['name'] for gid in groups.filter... | 0ebcb08d8fdf6b58581b325dbdf0cbb7cb7b3771 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/0ebcb08d8fdf6b58581b325dbdf0cbb7cb7b3771/users.py | |
self.current_target_object, self.args, self.kwargs | self.current_target, self.args, self.kwargs | def dump_status(self, long_output=False, precision=None): """ get detailled thread status. """ | a3db7d295a7a1a61d223bfc2474db829f8a19f66 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/a3db7d295a7a1a61d223bfc2474db829f8a19f66/threads.py |
self.current_target_object) \ | self.current_target) \ | def dump_status(self, long_output=False, precision=None): """ get detailled thread status. """ | a3db7d295a7a1a61d223bfc2474db829f8a19f66 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/a3db7d295a7a1a61d223bfc2474db829f8a19f66/threads.py |
command.extend([ "--skel", skel ]) | command.extend(["--skel", skel]) | def record(uri, http_user, name, skel=None, permissive=False, description=None, members_source = [], members_dest = [], resps_source = [], resps_dest = [], guests_source = [], guests_dest = [], record = None): """Record group changes.""" # web submit -> forget it del record title = _("Modifying group... | d9449425cb5de89ee21ea727bbf57a04644d6cfc /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/d9449425cb5de89ee21ea727bbf57a04644d6cfc/groups.py |
execute([ 'sudo', 'rm', '-rf', '%s/*' % configuration.home_backup_dir, '%s/*' % configuration.home_archive_dir ]) execute(ADD + ['group', '--system', 'acl,admins,remotessh,licorn-wmi']) | for directory in ( configuration.home_backup_dir, configuration.home_archive_dir ): clean_dir_contents(directory) execute(ADD + ['group', '--system', 'acl,admins,remotessh,licorn-wmi']) | def clean_system(): """ Remove all stuff to make the system clean, testsuite-wise.""" test_message('''cleaning system from previous runs.''') # delete them first in case of a previous failed testsuite run. # don't check exit codes or such, this will be done later. for argument in ( ['user', '''toto,tutu,tata,titi,te... | f349e3342b6e7a4d6ed5a9284273477b19d7fb9e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/f349e3342b6e7a4d6ed5a9284273477b19d7fb9e/core.py |
ScenarioTest([ [ 'sudo', 'rm', '-vrf', '%s/*' % configuration.home_archive_dir ], | clean_dir_contents(configuration.home_archive_dir) ScenarioTest([ | def chk_acls_cmds(group, subdir=None): return [ 'sudo', 'getfacl', '-R', '%s/%s/%s%s' % ( configuration.defaults.home_base_path, configuration.groups.names['plural'], group, '/%s' % subdir if subdir else '') ] | f349e3342b6e7a4d6ed5a9284273477b19d7fb9e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/f349e3342b6e7a4d6ed5a9284273477b19d7fb9e/core.py |
[ 'sudo', 'getfacl', '-R', configuration.home_archive_dir ], [ 'sudo', 'rm', '-vrf', '%s/*' % configuration.home_archive_dir ] | [ 'sudo', 'getfacl', '-R', configuration.home_archive_dir ] | def chk_acls_cmds(group, subdir=None): return [ 'sudo', 'getfacl', '-R', '%s/%s/%s%s' % ( configuration.defaults.home_base_path, configuration.groups.names['plural'], group, '/%s' % subdir if subdir else '') ] | f349e3342b6e7a4d6ed5a9284273477b19d7fb9e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/f349e3342b6e7a4d6ed5a9284273477b19d7fb9e/core.py |
logging.warning( 'Adding a default profile on the system (this is mandatory).') | logging.warning('''Adding a default %s profile on the system ''' '''(this is mandatory).''' % styles.stylize(styles.ST_NAME, 'Users')) | def checkDefaultProfile(self): """If no profile exists on the system, create a default one with system group "users".""" | 3482744910e32cde6e9d054b800a2d84b6cd8199 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/3482744910e32cde6e9d054b800a2d84b6cd8199/profiles.py |
description='', profileShell=None, profileSkel=None, force_existing=False): | description='', profileShell=None, profileSkel=None, force_existing=False): | def AddProfile(self, name, group, profileQuota=1024, groups=[], description='', profileShell=None, profileSkel=None, force_existing=False): """ Add a user profile (self.groups is an instance of GroupsController and is needed to create the profile group). """ | 3482744910e32cde6e9d054b800a2d84b6cd8199 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/3482744910e32cde6e9d054b800a2d84b6cd8199/profiles.py |
lenghts[0], lenghts[1], lenghts[2], lenghts[3], lenghts[4], lenghts[5], lenghts[6], lenghts[7] | lengths[0], lengths[1], lengths[2], lengths[3], lengths[4], lengths[5], lengths[6], lengths[7] | def run(self): logging.progress("%s: thread running." % (self.name)) Thread.run(self) | 97fed721fd6cf0a03ac4998f18a51e7f5e89dfc2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/97fed721fd6cf0a03ac4998f18a51e7f5e89dfc2/inotifier.py |
if(lenghts[7] > 0): | if(lengths[7] > 0): | def run(self): logging.progress("%s: thread running." % (self.name)) Thread.run(self) | 97fed721fd6cf0a03ac4998f18a51e7f5e89dfc2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/97fed721fd6cf0a03ac4998f18a51e7f5e89dfc2/inotifier.py |
dest = list(user['groups'].copy()) | dest = list(user['groups'][:]) | def edit(uri, http_user, login): """Edit an user account, based on login.""" users.reload() groups.reload() # profiles.reload() title = _('Edit account %s') % login if protected_user(login): return w.forgery_error(title) data = w.page_body_start(uri, http_user, ctxtnav, title, False) try: user = users.users[users... | 7fe4b9d7097d5e3724f4e48b9ff9a25383843212 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/7fe4b9d7097d5e3724f4e48b9ff9a25383843212/users.py |
count += 1 | def fork_wmi(opts, start_wmi = True): """ Start the Web Management Interface (fork it). """ # FIXME: implement start_wmi in argparser module. try: if os.fork() == 0: # FIXME: drop_privileges() → become setuid('licorn:licorn') process.write_pid_file(wpid_path) if opts.daemon: process.use_log_file(wlog_path) pname =... | a40ab54b4c27c2712b82d1ed670b65e2e643ac88 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/a40ab54b4c27c2712b82d1ed670b65e2e643ac88/wmi.py | |
logging.warning("%s/wmi: socket already in use. waiting (total: %dsec)." % (dname, count)) | logging.warning("%s/wmi: socket already in use. waiting (total: %ds)." % (dname, count)) count += 1 | def fork_wmi(opts, start_wmi = True): """ Start the Web Management Interface (fork it). """ # FIXME: implement start_wmi in argparser module. try: if os.fork() == 0: # FIXME: drop_privileges() → become setuid('licorn:licorn') process.write_pid_file(wpid_path) if opts.daemon: process.use_log_file(wlog_path) pname =... | a40ab54b4c27c2712b82d1ed670b65e2e643ac88 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/a40ab54b4c27c2712b82d1ed670b65e2e643ac88/wmi.py |
def minifind(path, type=None, perms=None, mindepth=0, maxdepth=99, exclude=[], followlinks=False, followmounts=True): """ Mimic the GNU find behaviour in python. returns an iterator. """ if mindepth > maxdepth: raise exceptions.BadArgumentError("mindepth must be <= maxdepth.") if maxdepth > 99: raise exceptions.Bad... | 35fc5c64dfc0567f1862ec7ffb81a147ef2b8f43 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/35fc5c64dfc0567f1862ec7ffb81a147ef2b8f43/fsapi.py | ||
def check_dirs_and_contents_perms_and_acls_new(dirs_infos, batch=None, | def check_dirs_and_contents_perms_and_acls_new(dirs_infos, batch=False, | def check_dirs_and_contents_perms_and_acls_new(dirs_infos, batch=None, auto_answer=None): """ general function to check file/dir """ def check_one_dir_and_acl(dir_info, batch=batch, auto_answer=auto_answer): all_went_ok = True # save desired user and group owner of the file/dir try: if dir_info.user: uid = dir_info['us... | 35fc5c64dfc0567f1862ec7ffb81a147ef2b8f43 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/35fc5c64dfc0567f1862ec7ffb81a147ef2b8f43/fsapi.py |
if daemon.cmdlistener.role == licornd_roles.SERVER: | if LMC.configuration.licornd.role == licornd_roles.SERVER: | def acceptHost(self, daemon, connection): """ Very basic check for the connection. """ client_addr, client_socket = connection.addr | 0f31f110017538e52dfb02852ad84eb582ec192d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/0f31f110017538e52dfb02852ad84eb582ec192d/cmdlistener.py |
logging.warning('''%s: socket already in use. ''' '''waiting (total: %ds).''' % (self.name, count)) | logging.warning('''%s: %s. ''' '''waiting (total: %ds).''' % (self.name, e, count)) | def run(self): assert ltrace('thread', '%s running' % self.name) | 3efdcf45fa2a5f65ea5a4855fd293bcc4c48f257 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/3efdcf45fa2a5f65ea5a4855fd293bcc4c48f257/cmdlistener.py |
self.pyro_daemon.shutdown(True) | def run(self): assert ltrace('thread', '%s running' % self.name) | 3efdcf45fa2a5f65ea5a4855fd293bcc4c48f257 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/3efdcf45fa2a5f65ea5a4855fd293bcc4c48f257/cmdlistener.py | |
def log_and_exec (command, inverse_test=False, result_code=0, comment="", | def log_and_exec(command, inverse_test=False, result_code=0, comment="", | def log_and_exec (command, inverse_test=False, result_code=0, comment="", verb=verbose): """Display a command, execute it, and exit if soemthing went wrong.""" sys.stderr.write("%s>>> running %s%s%s\n" % (colors[ST_LOG], colors[ST_PATH], command, colors[ST_NO])) output, retcode = execute(command) must_exit = False #... | 38a496a61795ec7fb8b2f6589579ac75d0b90d9d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/38a496a61795ec7fb8b2f6589579ac75d0b90d9d/core.py |
return (strip_moving_data(output), retcode) | def RunCommand(self, cmdnum, batch=False): | 38a496a61795ec7fb8b2f6589579ac75d0b90d9d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/38a496a61795ec7fb8b2f6589579ac75d0b90d9d/core.py | |
ScenarioTest(commands, descr="integrated help").Run() | ScenarioTest(commands, descr='''test integrated help of all CLI commands''' ).Run() | def test_integrated_help(): """Test extensively argmarser contents and intergated help.""" commands = [] for program in (GET, ADD, MOD, DEL, CHK): commands.extend([ program + ['-h'], program + ['--help']]) if program == ADD: modes = [ 'user', 'users', 'group', 'profile' ] elif program == MOD: modes = [ 'configurati... | 38a496a61795ec7fb8b2f6589579ac75d0b90d9d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/38a496a61795ec7fb8b2f6589579ac75d0b90d9d/core.py |
ScenarioTest(commands, context=context, descr="get tests").Run() | ScenarioTest(commands, context=context, descr='''CLI get tests''').Run() | def test_get(context): """Test GET a lot.""" commands = [] for category in [ 'config_dir', 'main_config_file', 'extendedgroup_data_file' ]: for mode in [ '', '-s', '-b', '--bourne-shell', '-c', '--c-shell', '-p', '--php-code' ]: commands.append(GET + [ 'configuration', category, mode ]) for category in [ 'skels', 's... | 38a496a61795ec7fb8b2f6589579ac75d0b90d9d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/38a496a61795ec7fb8b2f6589579ac75d0b90d9d/core.py |
def test_regexes(): """ Try funky strings to make regexes fail (they should not).""" # TODO: test regexes directly from defs in licorn.core.... test_message('''starting regexes tests.''') regexes_commands = [] # groups related regexes_commands.extend([ ADD + [ 'group', "--name='_- -_'" ], CHK + [ 'group', "--name='... | 38a496a61795ec7fb8b2f6589579ac75d0b90d9d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/38a496a61795ec7fb8b2f6589579ac75d0b90d9d/core.py | ||
def clean_system(): """ Remove all stuff to make the system clean, testsuite-wise.""" test_message('''cleaning system from previous runs.''') for argument in ( ['user', '''toto,tutu,tata,titi,test,utilisager.normal,''' \ '''test.responsibilly,utilicateur.accentue,user_test,''' \ '''grp-acl-user,utest_267,user_test... | def clean_system(): """ Remove all stuff to make the system clean, testsuite-wise.""" test_message('''cleaning system from previous runs.''') # delete them first in case of a previous failed testsuite run. # don't check exit codes or such, this will be done later. for argument in ( ['user', '''toto,tutu,tata,titi,te... | 38a496a61795ec7fb8b2f6589579ac75d0b90d9d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/38a496a61795ec7fb8b2f6589579ac75d0b90d9d/core.py | |
descr='ADD group with specified skel and descr', | descr='''ADD group with specified skel and descr''', | def chk_acls_cmds(group, subdir=None): return [ 'getfacl', '-R', '%s/%s/%s%s' % ( configuration.defaults.home_base_path, configuration.groups.names.plural, group, '/%s' % subdir if subdir else '') ] | 38a496a61795ec7fb8b2f6589579ac75d0b90d9d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/38a496a61795ec7fb8b2f6589579ac75d0b90d9d/core.py |
descr='''Check if privilege list is up to date after group deletion''' ''' (fix | descr='''Check if privilege list is up to date after group deletion ''' '''(fix | def chk_acls_cmds(group, subdir=None): return [ 'getfacl', '-R', '%s/%s/%s%s' % ( configuration.defaults.home_base_path, configuration.groups.names.plural, group, '/%s' % subdir if subdir else '') ] | 38a496a61795ec7fb8b2f6589579ac75d0b90d9d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/38a496a61795ec7fb8b2f6589579ac75d0b90d9d/core.py |
descr='tests of groups commands with --gid option (fix | descr='''tests of groups commands with --gid option (fix | def chk_acls_cmds(group, subdir=None): return [ 'getfacl', '-R', '%s/%s/%s%s' % ( configuration.defaults.home_base_path, configuration.groups.names.plural, group, '/%s' % subdir if subdir else '') ] | 38a496a61795ec7fb8b2f6589579ac75d0b90d9d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/38a496a61795ec7fb8b2f6589579ac75d0b90d9d/core.py |
def chk_acls_cmds(group, subdir=None): return [ 'getfacl', '-R', '%s/%s/%s%s' % ( configuration.defaults.home_base_path, configuration.groups.names.plural, group, '/%s' % subdir if subdir else '') ] | 38a496a61795ec7fb8b2f6589579ac75d0b90d9d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/38a496a61795ec7fb8b2f6589579ac75d0b90d9d/core.py | ||
def chk_acls_cmds(group, subdir=None): return [ 'getfacl', '-R', '%s/%s/%s%s' % ( configuration.defaults.home_base_path, configuration.groups.names.plural, group, '/%s' % subdir if subdir else '') ] | 38a496a61795ec7fb8b2f6589579ac75d0b90d9d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/38a496a61795ec7fb8b2f6589579ac75d0b90d9d/core.py | ||
descr='''check if a user can be modified with an incorrect shell and with a correct shell''' | descr='''check if a user can be modified with an incorrect shell and ''' '''with a correct shell''' | def chk_acls_cmds(dir): return [ 'getfacl', '-R', dir ] | 38a496a61795ec7fb8b2f6589579ac75d0b90d9d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/38a496a61795ec7fb8b2f6589579ac75d0b90d9d/core.py |
descr='test add user with --firstname and --lastname options (fix | descr='''test add user with --firstname and --lastname options ''' '''(fix | def chk_acls_cmds(dir): return [ 'getfacl', '-R', dir ] | 38a496a61795ec7fb8b2f6589579ac75d0b90d9d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/38a496a61795ec7fb8b2f6589579ac75d0b90d9d/core.py |
descr='modify one or more parameters of a user (avoid | descr='''modify one or more parameters of a user (avoid | def chk_acls_cmds(dir): return [ 'getfacl', '-R', dir ] | 38a496a61795ec7fb8b2f6589579ac75d0b90d9d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/38a496a61795ec7fb8b2f6589579ac75d0b90d9d/core.py |
descr='check option --home of user command (fix | descr='''check option --home of user command (fix | def chk_acls_cmds(dir): return [ 'getfacl', '-R', dir ] | 38a496a61795ec7fb8b2f6589579ac75d0b90d9d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/38a496a61795ec7fb8b2f6589579ac75d0b90d9d/core.py |
descr='''check messages of --lock and --unlock on mod user command and answer of get user --long (avoid | descr='''check messages of --lock and --unlock on mod user command ''' '''and answer of get user --long (avoid | def chk_acls_cmds(dir): return [ 'getfacl', '-R', dir ] | 38a496a61795ec7fb8b2f6589579ac75d0b90d9d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/38a496a61795ec7fb8b2f6589579ac75d0b90d9d/core.py |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.