bugged
stringlengths
4
228k
fixed
stringlengths
0
96.3M
__index_level_0__
int64
0
481k
s += "typedef %s {\n" % ty.kind
s += "typedef %s {\n" % ty.kind
449,600
s += "typedef %s {\n" % ty.kind
s += "typedef %s {\n" % ty.kind
449,601
s += "typedef %s {\n" % ty.kind
s += "typedef %s {\n" % ty.kind
449,602
f.write("""#ifndef __LIBXL_TYPES_H
f.write("""#ifndef __LIBXL_TYPES_H
449,603
f.write("""#ifndef __LIBXL_TYPES_H
f.write("""#ifndef __LIBXL_TYPES_H
449,604
f.write("""#ifndef __LIBXL_TYPES_H
f.write("""#ifndef __LIBXL_TYPES_H
449,605
def configure(self, vmConfig): """Config actions common to all unix-like domains.""" if '_temp_using_bootloader' in vmConfig: self.bootloader = True self.kernel = vmConfig['_temp_kernel'] self.cmdline = vmConfig['_temp_args'] self.ramdisk = vmConfig['_temp_ramdisk'] else: self.kernel = vmConfig['PV_kernel'] self.cmdlin...
def configure(self, vmConfig): """Config actions common to all unix-like domains.""" if '_temp_using_bootloader' in vmConfig: self.bootloader = True self.kernel = vmConfig['_temp_kernel'] self.cmdline = vmConfig['_temp_args'] self.ramdisk = vmConfig['_temp_ramdisk'] else: self.kernel = vmConfig['PV_kernel'] self.cmdlin...
449,606
def pci_convert_sxp_to_dict(dev_sxp): """Convert pci device sxp to dict @param dev_sxp: device configuration @type dev_sxp: SXP object (parsed config) @return: dev_config @rtype: dictionary """ # Parsing the device SXP's. In most cases, the SXP looks # like this: # # [device, [vif, [mac, xx:xx:xx:xx:xx:xx], [ip 1.3.4....
def pci_convert_sxp_to_dict(dev_sxp): """Convert pci device sxp to dict @param dev_sxp: device configuration @type dev_sxp: SXP object (parsed config) @return: dev_config @rtype: dictionary """ # Parsing the device SXP's. In most cases, the SXP looks # like this: # # [device, [vif, [mac, xx:xx:xx:xx:xx:xx], [ip 1.3.4....
449,607
def pci_convert_sxp_to_dict(dev_sxp): """Convert pci device sxp to dict @param dev_sxp: device configuration @type dev_sxp: SXP object (parsed config) @return: dev_config @rtype: dictionary """ # Parsing the device SXP's. In most cases, the SXP looks # like this: # # [device, [vif, [mac, xx:xx:xx:xx:xx:xx], [ip 1.3.4....
def pci_convert_sxp_to_dict(dev_sxp): """Convert pci device sxp to dict @param dev_sxp: device configuration @type dev_sxp: SXP object (parsed config) @return: dev_config @rtype: dictionary """ # Parsing the device SXP's. In most cases, the SXP looks # like this: # # [device, [vif, [mac, xx:xx:xx:xx:xx:xx], [ip 1.3.4....
449,608
def parse(self, buf = None): if buf is None: if self.filename is None: raise ValueError, "No config file defined to parse!"
def parse(self, buf = None): if buf is None: if self.filename is None: raise ValueError, "No config file defined to parse!"
449,609
def _configureBootloader(self): """Run the bootloader if we're configured to do so."""
def _configureBootloader(self): """Run the bootloader if we're configured to do so."""
449,610
def _configureBootloader(self): """Run the bootloader if we're configured to do so."""
def _configureBootloader(self): """Run the bootloader if we're configured to do so."""
449,611
def list(self, state = DOM_STATE_RUNNING): """Get list of domain objects.
def list(self, state = DOM_STATE_RUNNING): """Get list of domain objects.
449,612
def list(self, state = DOM_STATE_RUNNING): """Get list of domain objects.
def list(self, state = DOM_STATE_RUNNING): """Get list of domain objects.
449,613
def find_relaxed_node(node_list): import sys nr_nodes = info['max_node_id']+1 if node_list is None: node_list = range(0, nr_nodes) nodeload = [0] nodeload = nodeload * nr_nodes from xen.xend import XendDomain doms = XendDomain.instance().list('all') for dom in filter (lambda d: d.domid != self.domid, doms): cpuinfo = d...
def find_relaxed_node(node_list): import sys nr_nodes = info['max_node_index'] + 1 if node_list is None: node_list = range(0, nr_nodes) nodeload = [0] nodeload = nodeload * nr_nodes from xen.xend import XendDomain doms = XendDomain.instance().list('all') for dom in filter (lambda d: d.domid != self.domid, doms): cpuinf...
449,614
def find_relaxed_node(node_list): import sys nr_nodes = info['max_node_id']+1 if node_list is None: node_list = range(0, nr_nodes) nodeload = [0] nodeload = nodeload * nr_nodes from xen.xend import XendDomain doms = XendDomain.instance().list('all') for dom in filter (lambda d: d.domid != self.domid, doms): cpuinfo = d...
def find_relaxed_node(node_list): import sys nr_nodes = info['max_node_id']+1 if node_list is None: node_list = range(0, nr_nodes) nodeload = [0] nodeload = nodeload * nr_nodes from xen.xend import XendDomain doms = XendDomain.instance().list('all') for dom in filter (lambda d: d.domid != self.domid, doms): cpuinfo = d...
449,615
def find_relaxed_node(node_list): import sys nr_nodes = info['max_node_id']+1 if node_list is None: node_list = range(0, nr_nodes) nodeload = [0] nodeload = nodeload * nr_nodes from xen.xend import XendDomain doms = XendDomain.instance().list('all') for dom in filter (lambda d: d.domid != self.domid, doms): cpuinfo = d...
def find_relaxed_node(node_list): import sys nr_nodes = info['max_node_id']+1 if node_list is None: node_list = range(0, nr_nodes) nodeload = [0] nodeload = nodeload * nr_nodes from xen.xend import XendDomain doms = XendDomain.instance().list('all') for dom in filter (lambda d: d.domid != self.domid, doms): cpuinfo = d...
449,616
def find_relaxed_node(node_list): import sys nr_nodes = info['max_node_id']+1 if node_list is None: node_list = range(0, nr_nodes) nodeload = [0] nodeload = nodeload * nr_nodes from xen.xend import XendDomain doms = XendDomain.instance().list('all') for dom in filter (lambda d: d.domid != self.domid, doms): cpuinfo = d...
def find_relaxed_node(node_list): import sys nr_nodes = info['max_node_id']+1 if node_list is None: node_list = range(0, nr_nodes) nodeload = [0] nodeload = nodeload * nr_nodes from xen.xend import XendDomain doms = XendDomain.instance().list('all') for dom in filter (lambda d: d.domid != self.domid, doms): cpuinfo = d...
449,617
def find_relaxed_node(node_list): import sys nr_nodes = info['max_node_id']+1 if node_list is None: node_list = range(0, nr_nodes) nodeload = [0] nodeload = nodeload * nr_nodes from xen.xend import XendDomain doms = XendDomain.instance().list('all') for dom in filter (lambda d: d.domid != self.domid, doms): cpuinfo = d...
def find_relaxed_node(node_list): import sys nr_nodes = info['max_node_id']+1 if node_list is None: node_list = range(0, nr_nodes) nodeload = [0] nodeload = nodeload * nr_nodes from xen.xend import XendDomain doms = XendDomain.instance().list('all') for dom in filter (lambda d: d.domid != self.domid, doms): cpuinfo = d...
449,618
def find_relaxed_node(node_list): import sys nr_nodes = info['max_node_id']+1 if node_list is None: node_list = range(0, nr_nodes) nodeload = [0] nodeload = nodeload * nr_nodes from xen.xend import XendDomain doms = XendDomain.instance().list('all') for dom in filter (lambda d: d.domid != self.domid, doms): cpuinfo = d...
def find_relaxed_node(node_list): import sys nr_nodes = info['max_node_id']+1 if node_list is None: node_list = range(0, nr_nodes) nodeload = [0] nodeload = nodeload * nr_nodes from xen.xend import XendDomain doms = XendDomain.instance().list('all') for dom in filter (lambda d: d.domid != self.domid, doms): cpuinfo = d...
449,619
def find_relaxed_node(node_list): import sys nr_nodes = info['max_node_id']+1 if node_list is None: node_list = range(0, nr_nodes) nodeload = [0] nodeload = nodeload * nr_nodes from xen.xend import XendDomain doms = XendDomain.instance().list('all') for dom in filter (lambda d: d.domid != self.domid, doms): cpuinfo = d...
def find_relaxed_node(node_list): import sys nr_nodes = info['max_node_id']+1 if node_list is None: node_list = range(0, nr_nodes) nodeload = [0] nodeload = nodeload * nr_nodes from xen.xend import XendDomain doms = XendDomain.instance().list('all') for dom in filter (lambda d: d.domid != self.domid, doms): cpuinfo = d...
449,620
def find_relaxed_node(node_list): import sys nr_nodes = info['max_node_id']+1 if node_list is None: node_list = range(0, nr_nodes) nodeload = [0] nodeload = nodeload * nr_nodes from xen.xend import XendDomain doms = XendDomain.instance().list('all') for dom in filter (lambda d: d.domid != self.domid, doms): cpuinfo = d...
def find_relaxed_node(node_list): import sys nr_nodes = info['max_node_id']+1 if node_list is None: node_list = range(0, nr_nodes) nodeload = [0] nodeload = nodeload * nr_nodes from xen.xend import XendDomain doms = XendDomain.instance().list('all') for dom in filter (lambda d: d.domid != self.domid, doms): cpuinfo = d...
449,621
def arg_check_for_resource_list(args, name): use_long = 0 try: (options, params) = getopt.gnu_getopt(args, 'l', ['long']) except getopt.GetoptError, opterr: err(opterr) sys.exit(1) for (k, v) in options: if k in ['-l', '--long']: use_long = 1 if len(params) == 0: print 'No domain parameter given' usage(name) if len(p...
def arg_check_for_resource_list(args, name): use_long = 0 try: (options, params) = getopt.gnu_getopt(args, 'l', ['long']) except getopt.GetoptError, opterr: err(opterr) usage(name) for (k, v) in options: if k in ['-l', '--long']: use_long = 1 if len(params) == 0: print 'No domain parameter given' usage(name) if len(p...
449,622
def __devIsUnconstrained( self ): if os.path.exists(PERMISSIVE_CONFIG_FILE): try: fin = file(PERMISSIVE_CONFIG_FILE, 'rb') try: pci_perm_dev_config = parse(fin) finally: fin.close() if pci_perm_dev_config is None: pci_perm_dev_config = [''] else: pci_perm_dev_config.insert(0, '') self.pci_perm_dev_config = pci_perm_dev...
def __devIsUnconstrained( self ): if os.path.exists(PERMISSIVE_CONFIG_FILE): try: fin = file(PERMISSIVE_CONFIG_FILE, 'rb') try: pci_perm_dev_config = parse(fin) finally: fin.close() if pci_perm_dev_config is None: pci_perm_dev_config = [''] else: pci_perm_dev_config.insert(0, '') except Exception, ex: raise XendError("...
449,623
def __devIsUnconstrained( self ): if os.path.exists(PERMISSIVE_CONFIG_FILE): try: fin = file(PERMISSIVE_CONFIG_FILE, 'rb') try: pci_perm_dev_config = parse(fin) finally: fin.close() if pci_perm_dev_config is None: pci_perm_dev_config = [''] else: pci_perm_dev_config.insert(0, '') self.pci_perm_dev_config = pci_perm_dev...
def __devIsUnconstrained( self ): if os.path.exists(PERMISSIVE_CONFIG_FILE): try: fin = file(PERMISSIVE_CONFIG_FILE, 'rb') try: pci_perm_dev_config = parse(fin) finally: fin.close() if pci_perm_dev_config is None: pci_perm_dev_config = [''] else: pci_perm_dev_config.insert(0, '') self.pci_perm_dev_config = pci_perm_dev...
449,624
def _parse_sxp(self, sxp_cfg): """ Populate this XendConfig using the parsed SXP.
def _parse_sxp(self, sxp_cfg): """ Populate this XendConfig using the parsed SXP.
449,625
def to_sxp(self, domain = None, ignore_devices = False, ignore = [], legacy_only = True): """ Get SXP representation of this config object.
def to_sxp(self, domain = None, ignore_devices = False, ignore = [], legacy_only = True): """ Get SXP representation of this config object.
449,626
def test_login_token_failed_hax0r(self): fake_token = 'asdf;lhasdfdso' response = self.client.get(reverse('urlcrypt_redirect', args=(fake_token,))) self.assertRedirects(response, URLCRYPT_LOGIN_URL) fake_token = encode_token(str(self.test_user.id), str('asdf;ljasdf'), reverse('urlcrypt_test_view')) response = self.cli...
def test_login_token_failed_hax0r(self): fake_token = 'asdf;lhasdfdso' response = self.client.get(reverse('urlcrypt_redirect', args=(fake_token,))) self.assertRedirects(response, URLCRYPT_LOGIN_URL) fake_token = encode_token([str(self.test_user.id), reverse('urlcrypt_test_view'), str(int(time.time()))], secret_key_f) ...
449,627
def process_events(filename, table, start=None, stop=None): """Do the actual data processing. This function starts a subprocess to unzip the data file, reads the data line by line and stores it in a pytables table, row by row. Only data starting from July 1st, 14:29 UTC is processed, since that is when our detector w...
def process_events(filename, table, start=None, stop=None): """Do the actual data processing. This function starts a subprocess to unzip the data file, reads the data line by line and stores it in a pytables table, row by row. :param filename: the KASCADE data filename :param table: the destination table """ f = gzi...
449,628
def process_events(filename, table, start=None, stop=None): """Do the actual data processing. This function starts a subprocess to unzip the data file, reads the data line by line and stores it in a pytables table, row by row. Only data starting from July 1st, 14:29 UTC is processed, since that is when our detector w...
def process_events(filename, table, start=None, stop=None): """Do the actual data processing. This function starts a subprocess to unzip the data file, reads the data line by line and stores it in a pytables table, row by row. Only data starting from July 1st, 14:29 UTC is processed, since that is when our detector w...
449,629
def do_timeshifts(hevents, kevents, shifts, dtlimit=None, limit=None, h=None, k=None): """Search for coincidences using multiple time shifts This function enables you to search for coincidences multiple times, using a list of time shifts. Given a data file, the events are read into arrays and passed on to the search_c...
def do_timeshifts(hevents, kevents, shifts, dtlimit=None, limit=None, h=None, k=None): """Search for coincidences using multiple time shifts This function enables you to search for coincidences multiple times, using a list of time shifts. Given a data file, the events are read into arrays and passed on to the search_c...
449,630
def finish_graph(): """Finish the histogram This function places a legend, axes titles and the like on the current figure. """ pylab.legend() pylab.xlabel("Time difference (s)") pylab.ylabel("Counts") pylab.title("Nearest neighbour events for HiSPARC / KASCADE") pylab.gca().axis('auto') pylab.gcf().show()
def finish_graph(): """Finish the histogram This function places a legend, axes titles and the like on the current figure. """ try: pylab.legend() pylab.xlabel("Time difference (s)") pylab.ylabel("Counts") pylab.title("Nearest neighbour events for HiSPARC / KASCADE") pylab.gca().axis('auto') pylab.gcf().show() except...
449,631
def store_data(dst_file, dst_group, src_filename, t0, t1): """Copy data from a temporary file to the destination file This function takes a file containing downloaded data and copies it to the destination file, based on start and end timestamps. This can be further optimized at the expense of spaghetti code. """ # O...
def store_data(dst_file, dst_group, src_filename, t0, t1): """Copy data from a temporary file to the destination file This function takes a file containing downloaded data and copies it to the destination file, based on start and end timestamps. This can be further optimized at the expense of spaghetti code. """ # O...
449,632
def deg_to_rad(*args): """Take an optional amount of degree values and replace with radians. INPUT *args: Any number of arguments of ints, floats, and arrays OUTPUT new_values: Original inputs converted to radians """ results = [] ## Iterate through each variable for arg in args: try: iterable = iter(arg) except Type...
def deg_rad(conversion, *args): """Take an optional amount of values and convert between degrees/radians. INPUT conversion: (str) desired output, either 'degrees' or 'radians' *args: Will accept ints, floats, and ndarrrays (from NumPy) OUTPUT results: Original inputs converted to radians or degrees """ if conversion...
449,633
def deg_to_rad(*args): """Take an optional amount of degree values and replace with radians. INPUT *args: Any number of arguments of ints, floats, and arrays OUTPUT new_values: Original inputs converted to radians """ results = [] ## Iterate through each variable for arg in args: try: iterable = iter(arg) except Type...
def deg_to_rad(*args): """Take an optional amount of degree values and replace with radians. INPUT *args: Any number of arguments of ints, floats, and arrays OUTPUT new_values: Original inputs converted to radians """ results = [] ## Iterate through each variable for arg in args: try: iterable = iter(arg) except Type...
449,634
def deg_to_rad(*args): """Take an optional amount of degree values and replace with radians. INPUT *args: Any number of arguments of ints, floats, and arrays OUTPUT new_values: Original inputs converted to radians """ results = [] ## Iterate through each variable for arg in args: try: iterable = iter(arg) except Type...
def deg_to_rad(*args): """Take an optional amount of degree values and replace with radians. INPUT *args: Any number of arguments of ints, floats, and arrays OUTPUT new_values: Original inputs converted to radians """ results = [] ## Iterate through each variable for arg in args: try: iterable = iter(arg) except Type...
449,635
def rotor_analysis(rct_matrix, tip_speed_ratio, number_blades, pitch_0, blade_radius, hub_radius, lift_curve, drag_curve, method): """Returns performance statistics of a rotor. INPUT tip_speed_ratio: (float) The tip speed ratio number_blades: (int) the number of blades pitch_0 : (float) initial pitch angle re...
defpitch_0, rct_matrix[:,2] = deg_rad("degrees", pitch_0, rct_matrix[:,2]) rotor_analysis(rct_matrix,pitch_0, rct_matrix[:,2] = deg_rad("degrees", pitch_0, rct_matrix[:,2]) tip_speed_ratio,pitch_0, rct_matrix[:,2] = deg_rad("degrees", pitch_0, rct_matrix[:,2]) number_blades,pitch_0, rct_matrix[:,2] = deg_rad("degrees",...
449,636
def __init__(self,width,height): resolution=width,height
def __init__(self,width,height): resolution=width,height
449,637
def __init__(self,width,height): resolution=width,height
defself.keymap=(3,7,1,5,6,8,0,2) __init__(self,width,height):self.keymap=(3,7,1,5,6,8,0,2) resolution=width,height
449,638
def __init__(self,width,height): resolution=width,height
def __init__(self,width,height): resolution=width,height
449,639
def move_player(self,p):
def move_player(self,p):
449,640
def __init__(self,width,height): resolution=width,height
def __init__(self,width,height): resolution=width,height
449,641
def get_interface(self): """Gets the interface """ return self.get("interface", None)
def get_interface(self): """Gets the interface """ return self.get("interface", None)
449,642
def is_stopped(self, vid, actor): """ Return True if evaluation must be stop at this vertex """ if vid in self._evaluated: return True
def is_stopped(self, vid, actor): """ Return True if evaluation must be stop at this vertex """ if vid in self._evaluated: return True
449,643
def is_stopped(self, vid, actor): """ Return True if evaluation must be stop at this vertex """ return actor.block or vid in self._evaluated
def is_stopped(self, vid, actor): """ Return True if evaluation must be stop at this vertex """ return actor.block or vid in self._evaluated
449,644
def to_factory(self, sgfactory, listid = None, auto_io=False): """ Update CompositeNodeFactory to fit with the graph
def to_factory(self, sgfactory, listid = None, auto_io=False): """ Update CompositeNodeFactory to fit with the graph
449,645
def initialise_standard_metadata(): """Declares the standard keys used by the Node structures. Called at the end of this file""" #we declare what are the node model ad hoc data we require: AbstractNode.extend_ad_hoc_slots("position", list, [0,0], "posx", "posy") Node.extend_ad_hoc_slots("userColor", list, None, "user_c...
def initialise_standard_metadata(): """Declares the standard keys used by the Node structures. Called at the end of this file""" #we declare what are the node model ad hoc data we require: AbstractNode.extend_ad_hoc_slots("position", list, [0,0], "posx", "posy") Node.extend_ad_hoc_slots("userColor", list, None, "user_c...
449,646
def call_notify(self, sender, event=None): """ Basic implementation call directly notify function Sub class can override this method to implement different call strategy (like signal slot) """ if sender == self and event == "PROCESS_QUEUE": if self.__deaf : self.__eventQueue = None elif len(self.__eventQueue) > 0 : e =...
def call_notify(self, sender, event=None): """ Basic implementation call directly notify function Sub class can override this method to implement different call strategy (like signal slot) """ if sender == self and event == "PROCESS_QUEUE": if self.__deaf : self.__eventQueue = None elif len(self.__eventQueue) > 0 : e =...
449,647
def call_notify(self, sender, event=None): """ Basic implementation call directly notify function Sub class can override this method to implement different call strategy (like signal slot) """ if sender == self and event == "PROCESS_QUEUE": if self.__deaf : self.__eventQueue = None elif len(self.__eventQueue) > 0 : e =...
def call_notify(self, sender, event=None): """ Basic implementation call directly notify function Sub class can override this method to implement different call strategy (like signal slot) """ if sender == self and event == "PROCESS_QUEUE": if self.__deaf : self.__eventQueue = None elif len(self.__eventQueue) > 0 : e =...
449,648
def test_package(): """Test package""" metainfo = {'version': '0.0.1', 'license': 'CECILL-C', 'authors': 'OpenAlea Consortium', 'institutes': 'INRIA/CIRAD', 'description': 'Base library.', 'url': 'http://openalea.gforge.inria.fr', 'icon': ''} package = Package("Test", metainfo) assert package != None
def test_package(): metainfo = {'version': '0.0.1', 'license': 'CECILL-C', 'authors': 'OpenAlea Consortium', 'institutes': 'INRIA/CIRAD', 'description': 'Base library.', 'url': 'http://openalea.gforge.inria.fr', 'icon': ''} package = Package("Test", metainfo) assert package != None
449,649
def initialise_standard_metadata(): """Declares the standard keys used by the Node structures. Called at the end of this file""" #we declare what are the node model ad hoc data we require: AbstractNode.extend_ad_hoc_slots("position", list, [0,0], "posx", "posy") Node.extend_ad_hoc_slots("userColor", list, None, "user_c...
def initialise_standard_metadata(): """Declares the standard keys used by the Node structures. Called at the end of this file""" #we declare what are the node model ad hoc data we require: AbstractNode.extend_ad_hoc_slots("position", list, [0,0], "posx", "posy") Node.extend_ad_hoc_slots("userColor", list, None, "user_c...
449,650
def __init__(self, slots=None): observer.Observed.__init__(self) self._metas = {}
def __init__(self, slots=None): observer.Observed.__init__(self) self._metas = {}
449,651
def __init__(self, slots=None): observer.Observed.__init__(self) self._metas = {}
def __init__(self, slots=None): observer.Observed.__init__(self) self._metas = {}
449,652
def __init__(self, slots=None): observer.Observed.__init__(self) self._metas = {}
def __init__(self, slots=None): observer.Observed.__init__(self) self._metas = {}
449,653
def __repr__(self): if(not len(self._metas)): return "{}" stri = "{" for key, val in self._metas.iteritems(): stri = stri+ "\"" + key + "\" : [" + val[0].__name__ + ", " + repr(val[1]) + "]," stri = stri[:-1] + "}" return stri
def __repr__(self): if(not len(self._metas)): return "{}" stri = "{" for key, val in self._metas.iteritems(): stri = stri+ "\"" + key + "\" : [" + val[0].__name__ + ", " + repr(val[1]) + "]," stri = stri[:-1] + "}" return stri
449,654
def __len__(self): return len(self._metas)
def __len__(self): return len(self._metas)
449,655
def add_metadata(self, key, valType, notify=True): """Creates a new entry in the meta data registry. The data to set will be of the given 'type' type.""" assert type(valType) == types.TypeType
def add_metadata(self, key, valType, notify=True): """Creates a new entry in the meta data registry. The data to set will be of the given 'type' type.""" assert type(valType) == types.TypeType
449,656
def add_metadata(self, key, valType, notify=True): """Creates a new entry in the meta data registry. The data to set will be of the given 'type' type.""" assert type(valType) == types.TypeType
def add_metadata(self, key, valType, notify=True): """Creates a new entry in the meta data registry. The data to set will be of the given 'type' type.""" assert type(valType) == types.TypeType
449,657
def add_metadata(self, key, valType, notify=True): """Creates a new entry in the meta data registry. The data to set will be of the given 'type' type.""" assert type(valType) == types.TypeType
def add_metadata(self, key, valType, notify=True): """Creates a new entry in the meta data registry. The data to set will be of the given 'type' type.""" assert type(valType) == types.TypeType
449,658
def set_metadata(self, key, value, notify=True): """Sets the value of a meta data.""" if( value == None ): return if key not in self._metas : raise Exception("This key does not exist : " + key)
def set_metadata(self, key, value, notify=True): """Sets the value of a meta data.""" if value is None : return if key not in self._metaTypes : raise Exception("This key does not exist : " + key)
449,659
def set_metadata(self, key, value, notify=True): """Sets the value of a meta data.""" if( value == None ): return if key not in self._metas : raise Exception("This key does not exist : " + key)
def set_metadata(self, key, value, notify=True): """Sets the value of a meta data.""" if( value == None ): return if key not in self._metas : raise Exception("This key does not exist : " + key)
449,660
def set_metadata(self, key, value, notify=True): """Sets the value of a meta data.""" if( value == None ): return if key not in self._metas : raise Exception("This key does not exist : " + key)
def set_metadata(self, key, value, notify=True): """Sets the value of a meta data.""" if( value == None ): return if key not in self._metas : raise Exception("This key does not exist : " + key)
449,661
def get_metadata(self, key): """Gets the value of a meta data.""" if key not in self._metas : raise Exception("This key does not exist : " + key) return self._metas[key][1]
def get_metadata(self, key): """Gets the value of a meta data.""" if key not in self._metaTypes : raise Exception("This key does not exist : " + key) return self._metas[key][1]
449,662
def get_metadata(self, key): """Gets the value of a meta data.""" if key not in self._metas : raise Exception("This key does not exist : " + key) return self._metas[key][1]
def get_metadata(self, key): """Gets the value of a meta data.""" if key not in self._metas : raise Exception("This key does not exist : " + key) return self._metas[key][1]
449,663
def simulate_full_data_change(self): for k in self._metas.keys(): valType = self._metas[k][0] value = self._metas[k][1] self.notify_listeners(("metadata_changed", k, value, valType))
def simulate_full_data_change(self): for k in self._metaValues.keys(): valType = self._metaTypes[k] value = self._metaValues[k] self.notify_listeners(("metadata_changed", k, value, valType))
449,664
def initialise_standard_metadata(): """Declares the standard keys used by the Node structures. Called at the end of this file""" #we declare what are the node model ad hoc data we require: AbstractNode.extend_ad_hoc_slots("position", list, [0,0], "posx", "posy") Node.extend_ad_hoc_slots("userColor", list, None, "user_c...
defAnnotation.extend_ad_hoc_slots("visualStyle", int, None) initialise_standard_metadata():Annotation.extend_ad_hoc_slots("visualStyle", int, None) """DeclaresAnnotation.extend_ad_hoc_slots("visualStyle", int, None) theAnnotation.extend_ad_hoc_slots("visualStyle", int, None) standardAnnotation.extend_ad_hoc_slots("visu...
449,665
def __repr__(self): default_min = -2**24 default_max = 2**24 default_step = 1 if (self.min == default_min and self.max == default_max and self.step == default_step): return self.__class__.__name__ else: return 'IFloat(min=%d, max=%d, step=%d)' % \ (self.min, self.max, self.step)
def __repr__(self): default_min = -2**24 default_max = 2**24 default_step = 1 if (self.min == default_min and self.max == default_max and self.step == default_step): return self.__class__.__name__ else: return 'IInt(min=%d, max=%d, step=%d)' % \ (self.min, self.max, self.step)
449,666
def initialise_standard_metadata(): """Declares the standard keys used by the Node structures. Called at the end of this file""" #we declare what are the node model ad hoc data we require: AbstractNode.extend_ad_hoc_slots("position", list, [0,0], "posx", "posy") Node.extend_ad_hoc_slots("userColor", list, None, "user_c...
definitialise_standard_metadata():"""DeclaresthestandardkeysusedbytheNodestructures.Calledattheendofthisfile"""#wedeclarewhatarethenodemodeladhocdatawerequire:AbstractNode.extend_ad_hoc_slots("position",list,[0,0],"posx","posy")Node.extend_ad_hoc_slots("userColor",list,None,"user_color")Node.extend_ad_hoc_slots("useUse...
449,667
def set_input(self, key, val=None, notify=True): """ Define the input value for the specified index/key """
defset_input(self,key,val=None,notify=True):"""Definetheinputvalueforthespecifiedindex/key"""
449,668
def eval(self): """ Evaluate the node by calling __call__ Return True if the node need a reevaluation and a timed delay if the node need a reevaluation at a later time. """ # lazy evaluation if self.block and self.get_nb_output() != 0 and self.output(0) is not None: return False if (self.delay==0 and self.lazy) and not...
def eval(self): """ Evaluate the node by calling __call__ Return True if the node need a reevaluation and a timed delay if the node need a reevaluation at a later time. """ # lazy evaluation if self.block and self.get_nb_output() != 0 and self.output(0) is not None: return False if (self.delay==0 and self.lazy) and not...
449,669
def reset(self): """ Reset ports """ for i in range(self.get_nb_output()): self.outputs[i] = None
def reset(self): """ Reset ports """ for i in range(self.get_nb_output()): self.outputs[i] = None
449,670
def cmp_posx(x, y): """todo""" (xpid, xvid, xactor) = x (ypid, yvid, yactor) = y px = xactor.internal_data.get('posx', 0) py = yactor.internal_data.get('posx', 0) ret = cmp(px, py) if (not ret): ret = cmp(xpid, ypid) # reverse order return ret
def cmp_posx(x, y): """todo""" (xpid, xvid, xactor) = x (ypid, yvid, yactor) = y px = xactor.get_ad_hoc_dict().get_metadata('position')[0] py = yactor.get_ad_hoc_dict().get_metadata('position')[0] ret = cmp(px, py) if (not ret): ret = cmp(xpid, ypid) # reverse order return ret
449,671
def test_search(): pkgman = PackageManager() pkgman.load_directory("./") assert 'Test' in pkgman res = pkgman.search_node("command") print res assert "command" in res[0].name # comment these 3 lines because system.command is not part # of any nodes anymore. #res = pkgman.search_node("system.command") #print res #a...
def test_search(): pkgman = PackageManager() pkgman.load_directory("./") assert 'Test' in pkgman res = pkgman.search_node("sum") print res assert "command" in res[0].name # comment these 3 lines because system.command is not part # of any nodes anymore. #res = pkgman.search_node("system.command") #print res #asser...
449,672
def test_search(): pkgman = PackageManager() pkgman.load_directory("./") assert 'Test' in pkgman res = pkgman.search_node("command") print res assert "command" in res[0].name # comment these 3 lines because system.command is not part # of any nodes anymore. #res = pkgman.search_node("system.command") #print res #a...
def test_search(): pkgman = PackageManager() pkgman.load_directory("./") assert 'Test' in pkgman res = pkgman.search_node("command") print res assert "sum" in res[0].name # comment these 3 lines because system.command is not part # of any nodes anymore. #res = pkgman.search_node("system.command") #print res #asser...
449,673
def CheckArguments(self): self.op.node_name = _ExpandNodeName(self.cfg, self.op.node_name) all_mods = [self.op.offline, self.op.master_candidate, self.op.drained, self.op.master_capable, self.op.vm_capable, self.op.secondary_ip] if all_mods.count(None) == len(all_mods): raise errors.OpPrereqError("Please pass at least ...
def CheckArguments(self): self.op.node_name = _ExpandNodeName(self.cfg, self.op.node_name) all_mods = [self.op.offline, self.op.master_candidate, self.op.drained, self.op.master_capable, self.op.vm_capable, self.op.secondary_ip, self.op.ndparams] if all_mods.count(None) == len(all_mods): raise errors.OpPrereqError("Ple...
449,674
def _NodeAdd(node, readd=False): master = qa_config.GetMasterNode() if not readd and node.get('_added', False): raise qa_error.Error("Node %s already in cluster" % node['primary']) elif readd and not node.get('_added', False): raise qa_error.Error("Node %s not yet in cluster" % node['primary']) cmd = ['gnt-node', 'ad...
def _NodeAdd(node, readd=False): master = qa_config.GetMasterNode() if not readd and node.get('_added', False): raise qa_error.Error("Node %s already in cluster" % node['primary']) elif readd and not node.get('_added', False): raise qa_error.Error("Node %s not yet in cluster" % node['primary']) cmd = ['gnt-node', 'ad...
449,675
def connect(self): """Connect to the server specified when the object was created.
def connect(self): """Connect to the server specified when the object was created.
449,676
def CheckPrereq(self): """Check prerequisites.
def CheckPrereq(self): """Check prerequisites.
449,677
def Exec(self, feedback_fn): """Returns the tag list.
def Exec(self, feedback_fn): """Returns the tag list.
449,678
def Exec(self, feedback_fn): """Sets the tag.
def Exec(self, feedback_fn): """Sets the tag.
449,679
def __init__(self, timefunc): sched.scheduler.__init__(self, timefunc, AsyncoreDelayFunction)
def __init__(self, timefunc): sched.scheduler.__init__(self, timefunc, AsyncoreDelayFunction)
449,680
def __init__(self): """Constructor for AsyncUDPSocket
def __init__(self): """Constructor for AsyncUDPSocket
449,681
def handle_write(self): if not self._out_queue: logging.error("handle_write called with empty output queue") return (ip, port, payload) = self._out_queue[0] utils.IgnoreSignals(self.sendto, payload, 0, (ip, port)) self._out_queue.pop(0)
def handle_write(self): if not self._out_queue: logging.error("handle_write called with empty output queue") return (ip, port, payload) = self._out_queue[0] utils.IgnoreSignals(self.sendto, payload, 0, (ip, port)) self._out_queue.pop(0)
449,682
def BuildHooksEnv(self): """Build hooks env.
def BuildHooksEnv(self): """Build hooks env.
449,683
def CheckArguments(self): self.op.node_name = _ExpandNodeName(self.cfg, self.op.node_name) all_mods = [self.op.offline, self.op.master_candidate, self.op.drained] if all_mods.count(None) == 3: raise errors.OpPrereqError("Please pass at least one modification", errors.ECODE_INVAL) if all_mods.count(True) > 1: raise erro...
def CheckArguments(self): self.op.node_name = _ExpandNodeName(self.cfg, self.op.node_name) all_mods = [self.op.offline, self.op.master_candidate, self.op.drained] if all_mods.count(None) == len(all_mods): raise errors.OpPrereqError("Please pass at least one modification", errors.ECODE_INVAL) if all_mods.count(True) > 1...
449,684
def CheckArguments(self): self.op.node_name = _ExpandNodeName(self.cfg, self.op.node_name) all_mods = [self.op.offline, self.op.master_candidate, self.op.drained] if all_mods.count(None) == 3: raise errors.OpPrereqError("Please pass at least one modification", errors.ECODE_INVAL) if all_mods.count(True) > 1: raise erro...
def CheckArguments(self): self.op.node_name = _ExpandNodeName(self.cfg, self.op.node_name) all_mods = [self.op.offline, self.op.master_candidate, self.op.drained] if all_mods.count(None) == 3: raise errors.OpPrereqError("Please pass at least one modification", errors.ECODE_INVAL) if all_mods.count(True) > 1: raise erro...
449,685
def CheckArguments(self): self.op.node_name = _ExpandNodeName(self.cfg, self.op.node_name) all_mods = [self.op.offline, self.op.master_candidate, self.op.drained] if all_mods.count(None) == 3: raise errors.OpPrereqError("Please pass at least one modification", errors.ECODE_INVAL) if all_mods.count(True) > 1: raise erro...
def CheckArguments(self): self.op.node_name = _ExpandNodeName(self.cfg, self.op.node_name) all_mods = [self.op.offline, self.op.master_candidate, self.op.drained] if all_mods.count(None) == 3: raise errors.OpPrereqError("Please pass at least one modification", errors.ECODE_INVAL) if all_mods.count(True) > 1: raise erro...
449,686
def CheckArguments(self): self.op.node_name = _ExpandNodeName(self.cfg, self.op.node_name) all_mods = [self.op.offline, self.op.master_candidate, self.op.drained] if all_mods.count(None) == 3: raise errors.OpPrereqError("Please pass at least one modification", errors.ECODE_INVAL) if all_mods.count(True) > 1: raise erro...
defCheckArguments(self):self.op.node_name=_ExpandNodeName(self.cfg,self.op.node_name)all_mods=[self.op.offline,self.op.master_candidate,self.op.drained]ifall_mods.count(None)==3:raiseerrors.OpPrereqError("Pleasepassatleastonemodification",errors.ECODE_INVAL)ifall_mods.count(True)>1:raiseerrors.OpPrereqError("Can'tsetth...
449,687
def CheckPrereq(self): """Check prerequisites.
def CheckPrereq(self): """Check prerequisites.
449,688
def CheckPrereq(self): """Check prerequisites.
def CheckPrereq(self): """Check prerequisites.
449,689
def Exec(self, feedback_fn): """Modifies a node.
def Exec(self, feedback_fn): """Modifies a node.
449,690
def LogWarning(self, msg): pass
def LogWarning(self, msg, *args, **kwargs): pass
449,691
def LogInfo(self, msg): pass
def LogInfo(self, msg, *args, **kwargs): pass
449,692
def _ValidateResult(self): """Process the allocator results.
def _ValidateResult(self): """Process the allocator results.
449,693
def _UnlockedVerifyConfig(self): """Verify function.
def _UnlockedVerifyConfig(self): """Verify function.
449,694
def ExpandNames(self): self._ExpandAndLockInstance()
def ExpandNames(self): self._ExpandAndLockInstance()
449,695
def ExpandNames(self): self.op.node_name = self.cfg.ExpandNodeName(self.op.node_name) if self.op.node_name is None: raise errors.OpPrereqError("Node '%s' not known" % self.op.node_name, errors.ECODE_NOENT)
def ExpandNames(self): self.op.node_name = self.cfg.ExpandNodeName(self.op.node_name) if self.op.node_name is None: raise errors.OpPrereqError("Node '%s' not known" % self.op.node_name, errors.ECODE_NOENT)
449,696
def __init__(self, lu, instance_name, mode, iallocator_name, remote_node, disks): """Initializes this class.
def __init__(self, lu, instance_name, mode, iallocator_name, remote_node, disks, delay_iallocator): """Initializes this class.
449,697
def _CheckDiskConsistency(lu, dev, node, on_primary, ldisk=False): """Check that mirrors are not degraded. The ldisk parameter, if True, will change the test from the is_degraded attribute (which represents overall non-ok status for the device(s)) to the ldisk (representing the local storage status). """ lu.cfg.SetDi...
def _CheckDiskConsistency(lu, dev, node, on_primary, ldisk=False): """Check that mirrors are not degraded. The ldisk parameter, if True, will change the test from the is_degraded attribute (which represents overall non-ok status for the device(s)) to the ldisk (representing the local storage status). """ lu.cfg.SetDi...
449,698
def CheckPrereq(self): """Check prerequisites.
def CheckPrereq(self): """Check prerequisites.
449,699