rem
stringlengths
1
322k
add
stringlengths
0
2.05M
context
stringlengths
4
228k
meta
stringlengths
156
215
*h = self->box.h - self->element->il - self->element->ib
*h = self->box.h - self->element->it - self->element->ib def land_widget_inner_extents(LandWidget *self, float *l, *t, *r, *b): *l = self->box.x + self->element->il *t = self->box.y + self->element->it *r = self->box.x + self->box.w - self->element->ir *b = self->box.y + self->box.h - self->element->ib
def land_widget_inner(LandWidget *self, float *x, *y, *w, *h): *x = self->box.x + self->element->il *y = self->box.y + self->element->it *w = self->box.w - self->element->il - self->element->ir *h = self->box.h - self->element->il - self->element->ib
96f55a9068187f97b66bf445094f7a9067e90ec6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/930/96f55a9068187f97b66bf445094f7a9067e90ec6/base.py
LandArray *def land_array_new(): LandArray *self land_alloc(self) return self
fc77eb3d82cdafdd39712f08c6f7a4ef9ed86b06 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/930/fc77eb3d82cdafdd39712f08c6f7a4ef9ed86b06/array.py
land_free(self->data)
if self->data: land_free(self->data)
def land_array_destroy(LandArray *self): land_free(self->data) land_free(self)
fc77eb3d82cdafdd39712f08c6f7a4ef9ed86b06 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/930/fc77eb3d82cdafdd39712f08c6f7a4ef9ed86b06/array.py
def land_log_overwrite(char const *name): FILE *f if logname: land_free(logname) logname = land_strdup(name) f = fopen(logname, "w") if f: fclose(f)
c8247dbcb08c4be4130b297e7cf4447cec886fec /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/930/c8247dbcb08c4be4130b297e7cf4447cec886fec/log.py
atexit(land_log_del)
if not once: atexit(land_log_del) once++
def land_log_new(char const *base, int unique): FILE *f int i = 0 if logname: land_free(logname) logname = land_malloc(strlen(base) + 10) atexit(land_log_del) if unique: do: sprintf(logname, "%s%04d.log", base, i) f = fopen(logname, "r") if f: fclose(f) i++ while (f) else: sprintf(logname, "%s.log", base) f = fopen...
c8247dbcb08c4be4130b297e7cf4447cec886fec /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/930/c8247dbcb08c4be4130b297e7cf4447cec886fec/log.py
land_widget_base_size(super)
def land_widget_container_size(LandWidget *super): LandWidgetContainer *self = LAND_WIDGET_CONTAINER(super) if !self->children: return LandListItem *item = self->children->first while item: LandWidget *child = item->data land_call_method(child, size, (child)) item = item->next land_widget_base_size(super)
e2ab6aba165502ddd00fb1959907301c95c9fa10 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/930/e2ab6aba165502ddd00fb1959907301c95c9fa10/container.py
if pixel_y > -h:
def land_grid_draw_isometric(LandGrid *self, LandView *view): float w = self->cell_w / 2 float h = self->cell_h / 2 int cell_x, cell_y float pixel_x, pixel_y float view_x = view->scroll_x float view_y = view->scroll_y if !find_offset(self, view_x, view_y, &cell_x, &cell_y, &pixel_x, &pixel_y): return # One row up mi...
f31f6a70aba09b884448a0f3a197437be8f1a9e6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/930/f31f6a70aba09b884448a0f3a197437be8f1a9e6/isometric.py
cell_y-- pixel_x += w pixel_y -= h
def land_grid_draw_isometric(LandGrid *self, LandView *view): float w = self->cell_w / 2 float h = self->cell_h / 2 int cell_x, cell_y float pixel_x, pixel_y float view_x = view->scroll_x float view_y = view->scroll_y if !find_offset(self, view_x, view_y, &cell_x, &cell_y, &pixel_x, &pixel_y): return # One row up mi...
f31f6a70aba09b884448a0f3a197437be8f1a9e6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/930/f31f6a70aba09b884448a0f3a197437be8f1a9e6/isometric.py
def land_grid_draw_isometric(LandGrid *self, LandView *view): float w = self->cell_w / 2 float h = self->cell_h / 2 int cell_x, cell_y float pixel_x, pixel_y float view_x = view->scroll_x float view_y = view->scroll_y if !find_offset(self, view_x, view_y, &cell_x, &cell_y, &pixel_x, &pixel_y): return # One row up mi...
f31f6a70aba09b884448a0f3a197437be8f1a9e6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/930/f31f6a70aba09b884448a0f3a197437be8f1a9e6/isometric.py
land_widget_layout_inhibit(self)
def land_widget_base_size(LandWidget *self): land_widget_layout_inhibit(self) land_widget_layout(self) land_widget_layout_enable(self)
b42a3e895dfa51e4183a4d4a9f84cff7ecf79cd9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/930/b42a3e895dfa51e4183a4d4a9f84cff7ecf79cd9/base.py
land_widget_layout_enable(self)
def land_widget_base_size(LandWidget *self): land_widget_layout_inhibit(self) land_widget_layout(self) land_widget_layout_enable(self)
b42a3e895dfa51e4183a4d4a9f84cff7ecf79cd9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/930/b42a3e895dfa51e4183a4d4a9f84cff7ecf79cd9/base.py
static import global winsock
static import global winsock2, ws2tcpip static macro SHUT_RDWR SD_BOTH static import global sys/time, sys/socket, sys/ioctl, errno, arpa/inet static import netdb, signal
#ifdef WINDOWS
50371b137a9e7e682a9ef96b376ff2509614caad /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/930/50371b137a9e7e682a9ef96b376ff2509614caad/net.py
static import global sys/time, sys/socket, sys/ioctl, errno, arpa/inet, netdb,\ signal
#ifdef WINDOWS
50371b137a9e7e682a9ef96b376ff2509614caad /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/930/50371b137a9e7e682a9ef96b376ff2509614caad/net.py
static int once = 1
#ifdef WINDOWS
50371b137a9e7e682a9ef96b376ff2509614caad /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/930/50371b137a9e7e682a9ef96b376ff2509614caad/net.py
char a = 1;
def land_net_listen(LandNet *self, char const *address): int r struct sockaddr_in sock_address char *host int port if self->state != LAND_NET_INVALID: return self->local_address = strdup (address) split_address(address, &host, &port) # Resolve hostname. struct hostent *hostinfo if not (hostinfo = gethostbyname (hos...
50371b137a9e7e682a9ef96b376ff2509614caad /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/930/50371b137a9e7e682a9ef96b376ff2509614caad/net.py
if WSAGetLastError () != WSAEINTR &&
if WSAGetLastError () != WSAEINTR and\
static def land_net_poll_recv(LandNet *self): int r if self->size == 0 or self->full == self->size: return r = recv (self->sock, self->buffer + self->full, self->size - self->full, 0) if r < 0: #if defined WINDOWS if WSAGetLastError () != WSAEINTR && WSAGetLastError () != WSAEWOULDBLOCK: #else if errno != EINTR && e...
50371b137a9e7e682a9ef96b376ff2509614caad /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/930/50371b137a9e7e682a9ef96b376ff2509614caad/net.py
if value is None: value = self._value if tagSet is None: tagSet = self._tagSet if subtypeSpec is None: subtypeSpec = self._subtypeSpec if namedValues is None: namedValues = self.__namedValues
if value is None and tagSet is None and subtypeSpec is None \ and namedValues is None: return self if value is None: value = self._value if tagSet is None: tagSet = self._tagSet if subtypeSpec is None: subtypeSpec = self._subtypeSpec if namedValues is None: namedValues = self.__namedValues
def clone(self, value=None, tagSet=None, subtypeSpec=None, namedValues=None): if value is None: value = self._value if tagSet is None: tagSet = self._tagSet if subtypeSpec is None: subtypeSpec = self._subtypeSpec if namedValues is None: namedValues = self.__namedValues return self.__class__(value, tagSet, subtypeSpec, ...
ce70d9d4c8bca2c0291f525b176e176883a397f0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8754/ce70d9d4c8bca2c0291f525b176e176883a397f0/univ.py
def __init__(self, codecMap): self.__codecMap = codecMap
def __init__(self, __codecMap): self.__codecMap = __codecMap
def __init__(self, codecMap): self.__codecMap = codecMap
1ff275006a767b307a43c5f221e680e63c0558cc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8754/1ff275006a767b307a43c5f221e680e63c0558cc/encoder.py
def __cmp__(self, other): return cmp(self.__hashedValues, other)
# def __cmp__(self, other):
3bbc41fce4b992757c7329ab4c0609d71fd496e1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8754/3bbc41fce4b992757c7329ab4c0609d71fd496e1/constraint.py
def _encodeValue(self, encodeFun, client, defMode, maxChunkSize): if hasattr(client, 'setDefaultComponents'): client.setDefaultComponents() client.verifySizeSpec() # Guess client type basing on number of component types. # This is certainly a hack but how do I distinguish one from # another if they have the same tags&c...
cca194b97453527b7791a317f7d35cf91c7b33c4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8754/cca194b97453527b7791a317f7d35cf91c7b33c4/encoder.py
if len(client) > 1:
if hasattr(client, 'getDefaultComponentByPosition'):
def _encodeValue(self, encodeFun, client, defMode, maxChunkSize): if hasattr(client, 'setDefaultComponents'): client.setDefaultComponents() client.verifySizeSpec() # Guess client type basing on number of component types. # This is certainly a hack but how do I distinguish one from # another if they have the same tags&c...
cca194b97453527b7791a317f7d35cf91c7b33c4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8754/cca194b97453527b7791a317f7d35cf91c7b33c4/encoder.py
r.append("<p>TEST_DATA is %s</p>" % (defaults.TEST_DATA,))
def default_page(): """Show the visitor the options to start a survey """ r=[cgiUtils.section('First: an outline of your survey')] r.append(cgiUtils.form_begin(action=THIS_SCRIPT,enctype='multipart/form-data',charset=defaults.HTML_CODEC)) #r.append("<form action='%s' enctype='multipart/form-data' method='POST' accept-c...
c570cdd244f8141afcf7b6077be87a5cfe838160 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2454/c570cdd244f8141afcf7b6077be87a5cfe838160/admin.py
id = self.optimizer_menu.FindItem("Features")
id = self.optimizer_menu.FindItem("Features...")
def enable_controls(self, enable=True): id = self.optimizer_menu.FindItem("Start") self.optimizer_menu.Enable(id, enable) id = self.optimizer_menu.FindItem("Features") self.optimizer_menu.Enable(id, enable) id = self.optimizer_menu.FindItem("Open") self.optimizer_menu.Enable(id, enable) self.status.enable_controls(enab...
a6549624b8906671dbb486bb2754637fc35da899 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9927/a6549624b8906671dbb486bb2754637fc35da899/gaoptimizer_display.py
if self.settings_filename != None:
if self.settings_filename is not None:
def save_cb(self, evt): if self.classifier == None: gui_util.message("There is no loaded classifier to save.") else: if self.settings_filename != None: wxBeginBusyCursor() self.classifier.save_settings(self.settings_filename) wxEndBusyCursor() else: self.save_as_cb(evt)
a6549624b8906671dbb486bb2754637fc35da899 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9927/a6549624b8906671dbb486bb2754637fc35da899/gaoptimizer_display.py
wxBeginBusyCursor() self.classifier.save_settings(self.settings_filename) wxEndBusyCursor()
if self.settings_filename is not None: wxBeginBusyCursor() self.classifier.save_settings(self.settings_filename) wxEndBusyCursor()
def save_as_cb(self, evt): if self.classifier == None: gui_util.message("There is no loaded classifier to save.") else: self.settings_filename = gui_util.save_file_dialog(self) wxBeginBusyCursor() self.classifier.save_settings(self.settings_filename) wxEndBusyCursor()
a6549624b8906671dbb486bb2754637fc35da899 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9927/a6549624b8906671dbb486bb2754637fc35da899/gaoptimizer_display.py
if self.default is None:
if default is None:
def __init__(self, name=None, default=None, length=-1): Class.__init__(self, name, self.klass) if type(length) != int: raise TypeError("'length' must be an int") self.length = length if self.default is None: self.default = [] self.has_default = False else: self.default = default self.has_default = True
51c7ee1c131e5be1b0846f9caff11d2a9f55cd6e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9927/51c7ee1c131e5be1b0846f9caff11d2a9f55cd6e/args.py
subimage = SubImage(self.image, y, x, h, w) image = apply(wxEmptyImage, (w, h))
subimage = SubImage(self.image, y, x, h + 1, w + 1) image = apply(wxEmptyImage, (w + 1, h + 1))
def PaintArea(self, x, y, w, h, check=1): dc = wxPaintDC(self) dc.SetLogicalFunction(wxCOPY) origin = self.GetViewStart() size = self.GetSizeTuple() ox = x - (origin[0] / self.scaling) oy = y - (origin[1] / self.scaling) if check: if ((x + w < (origin[0] / self.scaling) and y + h < (origin[1] / self.scaling)) or (x > (...
9957d07d678c24bc03cb8e190ce3c372761becf0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9927/9957d07d678c24bc03cb8e190ce3c372761becf0/gamera_display.py
break return selection, active_id, inactive_id
return selection, active_id, inactive_id return [], self.multi_iw.id, self.class_iw.id
def get_all_selected(self): for display in (self.multi_iw.id, self.class_iw.id): if display.IsSelection(): selection = display.GetSelectedItems(display.GetGridCursorRow(), display.GetGridCursorCol()) active_id = display inactive_id = self.get_other_multi(display) break return selection, active_id, inactive_id
8ef4cdf90c3b4cc82ad23f32e8c344c272dc3b00 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9927/8ef4cdf90c3b4cc82ad23f32e8c344c272dc3b00/classifier_display.py
filename = gui_util.open_file_dialog(self.text, self.extension)
parent = self.text.GetParent() filename = gui_util.open_file_dialog(parent, self.extension)
def OnBrowse(self, event): filename = gui_util.open_file_dialog(self.text, self.extension) if filename: self.text.SetValue(filename) self.text.GetParent().Raise()
7f12af70d31f52193d49f39c8ba22b6647875073 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9927/7f12af70d31f52193d49f39c8ba22b6647875073/args_gui.py
self.text.GetParent().Raise() def get(self):
parent.Raise() if wxIsBusy(): wxEndBusyCursor() def get(self):
def OnBrowse(self, event): filename = gui_util.open_file_dialog(self.text, self.extension) if filename: self.text.SetValue(filename) self.text.GetParent().Raise()
7f12af70d31f52193d49f39c8ba22b6647875073 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9927/7f12af70d31f52193d49f39c8ba22b6647875073/args_gui.py
def get_string(self): while 1: text = self.text.GetValue() if not os.path.exists(os.path.abspath(text)): gui_util.message("File '%s' does not exist." % text) self.OnBrowse(None) else: break return _Filename.get_string(self)
7f12af70d31f52193d49f39c8ba22b6647875073 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9927/7f12af70d31f52193d49f39c8ba22b6647875073/args_gui.py
filename = gui_util.save_file_dialog(self.text, self.extension)
parent = self.text.GetParent() filename = gui_util.save_file_dialog(parent, self.extension)
def OnBrowse(self, event): filename = gui_util.save_file_dialog(self.text, self.extension) if filename: self.text.SetValue(filename) self.text.GetParent().Raise()
7f12af70d31f52193d49f39c8ba22b6647875073 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9927/7f12af70d31f52193d49f39c8ba22b6647875073/args_gui.py
self.text.GetParent().Raise()
parent.Raise() if wxIsBusy(): wxEndBusyCursor()
def OnBrowse(self, event): filename = gui_util.save_file_dialog(self.text, self.extension) if filename: self.text.SetValue(filename) self.text.GetParent().Raise()
7f12af70d31f52193d49f39c8ba22b6647875073 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9927/7f12af70d31f52193d49f39c8ba22b6647875073/args_gui.py
parent = self.text.GetParent()
def OnBrowse(self, event): filename = gui_util.directory_dialog(self.text) if filename: self.text.SetValue(filename) self.text.GetParent().Raise()
7f12af70d31f52193d49f39c8ba22b6647875073 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9927/7f12af70d31f52193d49f39c8ba22b6647875073/args_gui.py
self.text.GetParent().Raise() def get(self):
parent.Raise() if wxIsBusy(): wxEndBusyCursor() def get(self):
def OnBrowse(self, event): filename = gui_util.directory_dialog(self.text) if filename: self.text.SetValue(filename) self.text.GetParent().Raise()
7f12af70d31f52193d49f39c8ba22b6647875073 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9927/7f12af70d31f52193d49f39c8ba22b6647875073/args_gui.py
def get_string(self): while 1: text = self.text.GetValue() if not os.path.exists(os.path.abspath(text)): gui_util.message("File '%s' does not exist." % text) self.OnBrowse(None) else: break return _Filename.get_string(self)
7f12af70d31f52193d49f39c8ba22b6647875073 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9927/7f12af70d31f52193d49f39c8ba22b6647875073/args_gui.py
def determine_choices(self, locals): from gamera import core self.klass = core.Point return Class.determine_choices(self, locals)
7f12af70d31f52193d49f39c8ba22b6647875073 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9927/7f12af70d31f52193d49f39c8ba22b6647875073/args_gui.py
self.status.enable_controls(True)
self.status.enable_controls(enable)
def enable_controls(self, enable=True): id = self.file_menu.FindItem("Start") self.file_menu.Enable(id, enable) id = self.file_menu.FindItem("Features") self.file_menu.Enable(id, enable) id = self.file_menu.FindItem("Open") self.file_menu.Enable(id, enable) self.status.enable_controls(True) self.update_status()
0d90e882114aa5e83a44ac272acaf9978b1669dc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9927/0d90e882114aa5e83a44ac272acaf9978b1669dc/gaoptimizer_display.py
id = image
id = image.id_name
def do_auto_move(self, state): # if auto-moving is turned off, just return if state == []: return
3f526c820243f92a2971383a388c18e249e97243 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9927/3f526c820243f92a2971383a388c18e249e97243/classifier_display.py
image = dlg.show(self, image_menu.shell.locals, name="Choose image")
image = dlg.show(self, image_menu.shell.locals)
def _OnChooseImage(self, event): dlg = Args([Class("Image for context display", ImageBase)]) image = dlg.show(self, image_menu.shell.locals, name="Choose image") if image != None: self.id.set_image(image)
3f526c820243f92a2971383a388c18e249e97243 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9927/3f526c820243f92a2971383a388c18e249e97243/classifier_display.py
self.id.set_image(image)
self.id.set_image(image[0])
def _OnChooseImage(self, event): dlg = Args([Class("Image for context display", ImageBase)]) image = dlg.show(self, image_menu.shell.locals, name="Choose image") if image != None: self.id.set_image(image)
3f526c820243f92a2971383a388c18e249e97243 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9927/3f526c820243f92a2971383a388c18e249e97243/classifier_display.py
self._SaveEditorCollection(event)
self._SaveEditorCollection(self.editor_collection_filename)
def _OnSaveEditorCollectionAs(self, event): if gui_util.are_you_sure_dialog("There are %d glyphs in the editor.\nAre you sure you want to save?" % len(glyphs)): filename = gui_util.save_file_dialog(self._frame, gamera_xml.extensions) if filename: self.editor_collection_filename = filename self._SaveEditorCollection(eve...
8c3ffddd7ea79bf3921815c9a34fb8e4e1e05f5b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9927/8c3ffddd7ea79bf3921815c9a34fb8e4e1e05f5b/classifier_display.py
def __getattr__(self, attr): init_gamera() if hasattr(self, attr): return getattr(self, attr) else: raise AttributeError("'Image' object has no attribute '%s'." % attr)
def __getstate__(self): """Extremely basic pickling support for use in testing. Note that there is no unpickling support.""" dict = {} for key in self._members_for_menu: dict[key] = getattr(self, key) dict['encoded_data'] = util.encode_binary( self.to_string()) return dict
e39ed63f3bf5e7a8cc351ca020e12d263ddfa0df /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9927/e39ed63f3bf5e7a8cc351ca020e12d263ddfa0df/core.py
_gamera_initialised = True
def _init_gamera(): global _gamera_initialised if _gamera_initialised: return import plugin, gamera_xml, sys # Create the default functions for the menupl for method in ( plugin.PluginFactory( "load_image", "File", plugin.ImageType(ALL, "image"), plugin.ImageType(ALL), plugin.Args([plugin.FileOpen("filename")])), plugi...
e39ed63f3bf5e7a8cc351ca020e12d263ddfa0df /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9927/e39ed63f3bf5e7a8cc351ca020e12d263ddfa0df/core.py
raise RuntimeError("%s in not a TIFF or PNG file." % filename)
raise RuntimeError("%s is not a TIFF or PNG file." % filename)
def load_image(filename, compression = DENSE): """**load_image** (FileOpen *filename*, Choice *storage_format* = ``DENSE``)
d7bfc075bbb6e4b60b0a02b0f9a5326f682aa5d1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9927/d7bfc075bbb6e4b60b0a02b0f9a5326f682aa5d1/core.py
t = time.clock()
def parse_stream(self, stream): t = time.clock() self._setup_handlers() self._parser = expat.ParserCreate() self._parser.StartElementHandler = self._start_element_handler self._parser.EndElementHandler = self._end_element_handler self._stream = stream self._progress = util.ProgressFactory("Loading XML...", self._stream...
017d126e2d2fcd0421ced5f36356bc7bd3af4a40 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9927/017d126e2d2fcd0421ced5f36356bc7bd3af4a40/gamera_xml.py
print "Time:", time.clock() - t
def parse_stream(self, stream): t = time.clock() self._setup_handlers() self._parser = expat.ParserCreate() self._parser.StartElementHandler = self._start_element_handler self._parser.EndElementHandler = self._end_element_handler self._stream = stream self._progress = util.ProgressFactory("Loading XML...", self._stream...
017d126e2d2fcd0421ced5f36356bc7bd3af4a40 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9927/017d126e2d2fcd0421ced5f36356bc7bd3af4a40/gamera_xml.py
Py_DECREF(list);
[[def switch(layer, args)]] switch(get_image_combination([[images[layer].pyname]])) { [[for type in images[layer].pixel_types]] [[exec current = '*((' + type + '*)' + images[layer].name + ')']] case [[type.upper()]]: [[if layer == len(images) - 1]] [[if not function.return_type is None]] return_value = [[end]] [[functi...
34666b1f16286a48d3e8d14bb497c56c7b4ec149 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9927/34666b1f16286a48d3e8d14bb497c56c7b4ec149/generate.py
k.load_settings("c:/Documents and Settings/Karl MacMillan/Desktop/default.xml") generate_features_list(glyphs, k.feature_functions) forest = distance.unique_distances(glyphs)
forest = k.unique_distances(glyphs)
def create_graph(glyphs, ratio): import gamera.knn k = gamera.knn.kNN() k.load_settings("c:/Documents and Settings/Karl MacMillan/Desktop/default.xml") generate_features_list(glyphs, k.feature_functions) forest = distance.unique_distances(glyphs) #forest = create_forest(glyphs) num_nodes = len(glyphs) next = 1 g = Grap...
5e7290c8402e0ce41318d8d1e316898d929cf7a4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9927/5e7290c8402e0ce41318d8d1e316898d929cf7a4/cluster.py
import traceback traceback.print_stack()
def _init_gamera(): import traceback traceback.print_stack() global _gamera_initialised if _gamera_initialised: return _gamera_initialised = True import plugin, gamera_xml, sys # Create the default functions for the menupl for method in ( plugin.PluginFactory( "load_image", "File", plugin.ImageType(ALL, "image"), plugi...
a28cdb16b06caf45fbfa98b4263285cdc28f428b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9927/a28cdb16b06caf45fbfa98b4263285cdc28f428b/core.py
unions = []
def _pregroup(self, glyphs, function): from gamera import graph G = graph.Undirected() G.add_nodes(glyphs) progress = util.ProgressFactory("Pre-grouping glyphs...", len(glyphs)) try: equivalencies = {} group_no = 0 for i in range(len(glyphs)): gi = glyphs[i] for j in range(i + 1, len(glyphs)): gj = glyphs[j] if functio...
d5a9979e582851137a037cb0eed0f8b59d7a7652 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9927/d5a9979e582851137a037cb0eed0f8b59d7a7652/classify.py
self.unions.append(union) union.properties.root_number = self.root_number
def _evaluate_subgroup(self, subgroup): import image_utilities if len(subgroup) > 1: union = image_utilities.union_images(subgroup) self.unions.append(union) ### union.properties.root_number = self.root_number ### classification = self.guess_glyph_automatic(union) classification_name = classification[0][1] if (classifi...
d5a9979e582851137a037cb0eed0f8b59d7a7652 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9927/d5a9979e582851137a037cb0eed0f8b59d7a7652/classify.py
return 0
return 0.0
def _evaluate_subgroup(self, subgroup): import image_utilities if len(subgroup) > 1: union = image_utilities.union_images(subgroup) self.unions.append(union) ### union.properties.root_number = self.root_number ### classification = self.guess_glyph_automatic(union) classification_name = classification[0][1] if (classifi...
d5a9979e582851137a037cb0eed0f8b59d7a7652 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9927/d5a9979e582851137a037cb0eed0f8b59d7a7652/classify.py
return 0
return 0.0
def _evaluate_subgroup(self, subgroup): import image_utilities if len(subgroup) > 1: union = image_utilities.union_images(subgroup) self.unions.append(union) ### union.properties.root_number = self.root_number ### classification = self.guess_glyph_automatic(union) classification_name = classification[0][1] if (classifi...
d5a9979e582851137a037cb0eed0f8b59d7a7652 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9927/d5a9979e582851137a037cb0eed0f8b59d7a7652/classify.py
self.root_number = 0
def _find_group_unions(self, G, evaluate_function, max_parts_per_group=5): self.root_number = 0 ### import image_utilities progress = util.ProgressFactory("Grouping glyphs...", G.nsubgraphs) try: found_unions = [] for root in G.get_subgraph_roots(): self.root_number += 1 ### best_grouping = G.optimize_partitions( root,...
d5a9979e582851137a037cb0eed0f8b59d7a7652 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9927/d5a9979e582851137a037cb0eed0f8b59d7a7652/classify.py
self.root_number += 1
def _find_group_unions(self, G, evaluate_function, max_parts_per_group=5): self.root_number = 0 ### import image_utilities progress = util.ProgressFactory("Grouping glyphs...", G.nsubgraphs) try: found_unions = [] for root in G.get_subgraph_roots(): self.root_number += 1 ### best_grouping = G.optimize_partitions( root,...
d5a9979e582851137a037cb0eed0f8b59d7a7652 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9927/d5a9979e582851137a037cb0eed0f8b59d7a7652/classify.py
classification_state = image.classification_state
def Draw(self, grid, attr, dc, rect, row, col, isSelected): dc.BeginDrawing() dc.SetOptimization(True) view_start = grid.GetViewStart() view_units = grid.GetScrollPixelsPerUnit() view_size = grid.GetClientSize() if not rect.Intersects(wxRect( view_start[0] * view_units[0], view_start[1] * view_units[1], view_size[0], v...
58008e4541119f02ef2f289f80e7300b380144f3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9927/58008e4541119f02ef2f289f80e7300b380144f3/gamera_display.py
version = [int(x) for x in docutils.__version__.split(".")]
version = tuple([int(x) for x in docutils.__version__.split(".")])
def do_docstring(obj, name): doc_string = inspect.getdoc(obj) if doc_string is None: text = "[Not documented]\n\n" else: text = doc_string + "\n\n" content = docutils.statemachine.string2lines(text, convert_whitespace=1) if not options.has_key('no_title'): title_text = "``%s``" % name textnodes, messages = state.inline...
62747cbb82de9cd0bec123e6ff8a44c3e7ae84a9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9927/62747cbb82de9cd0bec123e6ff8a44c3e7ae84a9/gendoc.py
return unicodedata.lookup(id_name)
return unicodedata.lookup(name)
def name_lookup_unicode(id_name): name = id_name.replace(".", " ") name = name.upper() try: return unicodedata.lookup(id_name) except KeyError: print "ERROR: Name not found:", id_name return ""
dff927e2c35b37cf2e6f4147dc98b3f19a3f4af8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9927/dff927e2c35b37cf2e6f4147dc98b3f19a3f4af8/roman_text.py
print "ERROR: Name not found:", id_name
print "ERROR: Name not found:", name
def name_lookup_unicode(id_name): name = id_name.replace(".", " ") name = name.upper() try: return unicodedata.lookup(id_name) except KeyError: print "ERROR: Name not found:", id_name return ""
dff927e2c35b37cf2e6f4147dc98b3f19a3f4af8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9927/dff927e2c35b37cf2e6f4147dc98b3f19a3f4af8/roman_text.py
if (%(pysymbol)s_seq)
if (%(pysymbol)s_seq == NULL)
def from_python(self): return """ const char* type_error_%(name)s = "Argument '%(name)s' must be an iterable of images."; PyObject* %(pysymbol)s_seq = PySequence_Fast(%(pysymbol)s, type_error_%(name)s); if (%(pysymbol)s_seq) return 0; int %(symbol)s_size = PySequence_Fast_GET_SIZE(%(pysymbol)s_seq); %(symbol)s.resize(%...
d16d13f8e8f48256cb5712ece55bd53b07d3b0d5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9927/d16d13f8e8f48256cb5712ece55bd53b07d3b0d5/args_wrappers.py
self._classifier.get_feature_functions()[0]]
ImageBase.get_feature_functions()[0]]
def _OnChangeSetOfFeatures(self, event): all_features = [x[0] for x in ImageBase.methods_flat_category("Features", ONEBIT)] all_features.sort() existing_features = [x[0] for x in self._classifier.get_feature_functions()[0]] feature_controls = [] for x in all_features: feature_controls.append( Check('', x, default=(x in...
ea003ccf8555df2263428d8007ca7313c6d59f5d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9927/ea003ccf8555df2263428d8007ca7313c6d59f5d/classifier_display.py
return Rect(int(o.ul_y - amount), int(o.ul_x - amount), int(o.nrows + amount * 2), int(o.ncols + amount * 2))
return Rect(Point(int(o.ul_x-amount), int(o.ul_y - amount)), Dim(int(o.ncols + amount * 2), int(o.nrows + amount * 2)))
def Fudge(o, amount = FUDGE_AMOUNT): # For rectangles, just return a new rectangle that is slightly larger if isinstance(o, Rect): return Rect(int(o.ul_y - amount), int(o.ul_x - amount), int(o.nrows + amount * 2), int(o.ncols + amount * 2)) # For integers, return one of our "fudge number proxies" elif isinstance(o, in...
3d2c417fc441961671589f52138b1c26f4112aad /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9927/3d2c417fc441961671589f52138b1c26f4112aad/fudge.py
font.SetPointSize(14)
pass
def __init__(self, toplevel, parent = None, id = -1, size = wxDefaultSize): self.toplevel = toplevel MultiImageWindow.__init__(self, parent, id, size)
2bfa6072e0eee6ee9776fba1bb552eff467b0ecb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9927/2bfa6072e0eee6ee9776fba1bb552eff467b0ecb/classifier_display.py
self.titlebar_button = wxButton(self, -1, "+", size=(16, 16))
self.titlebar_button = wxButton(self, -1, "+")
def __init__(self, toplevel, parent = None, id = -1, size = wxDefaultSize): self.toplevel = toplevel MultiImageWindow.__init__(self, parent, id, size)
2bfa6072e0eee6ee9776fba1bb552eff467b0ecb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9927/2bfa6072e0eee6ee9776fba1bb552eff467b0ecb/classifier_display.py
lc.right.SameAs(self, wxRight, 0)
lc.right.SameAs(self.titlebar_button, wxLeft, 0)
def __init__(self, toplevel, parent = None, id = -1, size = wxDefaultSize): self.toplevel = toplevel MultiImageWindow.__init__(self, parent, id, size)
2bfa6072e0eee6ee9776fba1bb552eff467b0ecb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9927/2bfa6072e0eee6ee9776fba1bb552eff467b0ecb/classifier_display.py
lc.height.AsIs() lc.width.AsIs()
lc.height.SameAs(self.titlebar, wxHeight, 0) lc.width.SameAs(self.titlebar, wxHeight, 0)
def __init__(self, toplevel, parent = None, id = -1, size = wxDefaultSize): self.toplevel = toplevel MultiImageWindow.__init__(self, parent, id, size)
2bfa6072e0eee6ee9776fba1bb552eff467b0ecb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9927/2bfa6072e0eee6ee9776fba1bb552eff467b0ecb/classifier_display.py
if gui_util.are_you_sure_dialog(self._frame,
if gui_util.are_you_sure_dialog(
def _OnClearClassifierCollection(self, event): if self._classifier.is_dirty: if gui_util.are_you_sure_dialog(self._frame, "Are you sure you want to clear all glyphs in the classifier?"): self._classifier.clear_glyphs() else: self._classifier.clear_glyphs() self._classifier.is_dirty = False
2bfa6072e0eee6ee9776fba1bb552eff467b0ecb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9927/2bfa6072e0eee6ee9776fba1bb552eff467b0ecb/classifier_display.py
"Are you sure you want to quit without saving?", self._frame):
"Are you sure you want to quit without saving?"):
def _OnCloseWindow(self, event): if self.is_dirty: if not gui_util.are_you_sure_dialog( "Are you sure you want to quit without saving?", self._frame): event.Veto() return self._classifier.set_display(None) self.multi_iw.Destroy() self.single_iw.Destroy() self.splitterhr1.Destroy() self.splitterhr0.Destroy() self.splitt...
2bfa6072e0eee6ee9776fba1bb552eff467b0ecb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9927/2bfa6072e0eee6ee9776fba1bb552eff467b0ecb/classifier_display.py
self.text = wxTextCtrl(self, txID, style=wxTE_PROCESS_ENTER)
self.text = wxTextCtrl(self, txID, style=wxTE_PROCESS_ENTER | wxTE_PROCESS_TAB)
def __init__(self, symbol_table, toplevel, parent = None, id = -1): wxPanel.__init__( self, parent, id, style=wxWANTS_CHARS|wxCLIP_CHILDREN|wxNO_FULL_REPAINT_ON_RESIZE) self.toplevel = toplevel self._symbol_table = symbol_table self.SetAutoLayout(true) self.box = wxBoxSizer(wxVERTICAL) txID = NewId() self.text = wxText...
40d2d07da7b00db524d562303d2b244ccd83f1d9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9927/40d2d07da7b00db524d562303d2b244ccd83f1d9/classifier_display.py
EVT_TEXT_TAB(self, txID, self._OnTab)
def __init__(self, symbol_table, toplevel, parent = None, id = -1): wxPanel.__init__( self, parent, id, style=wxWANTS_CHARS|wxCLIP_CHILDREN|wxNO_FULL_REPAINT_ON_RESIZE) self.toplevel = toplevel self._symbol_table = symbol_table self.SetAutoLayout(true) self.box = wxBoxSizer(wxVERTICAL) txID = NewId() self.text = wxText...
40d2d07da7b00db524d562303d2b244ccd83f1d9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9927/40d2d07da7b00db524d562303d2b244ccd83f1d9/classifier_display.py
def _OnTab(self, evt):
def _OnKey(self, evt): find = self.text.GetValue() if evt.KeyCode() == WXK_TAB:
def _OnTab(self, evt): find = self._symbol_table.autocomplete(find) self.text.SetValue(find) self.text.SetInsertionPointEnd()
40d2d07da7b00db524d562303d2b244ccd83f1d9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9927/40d2d07da7b00db524d562303d2b244ccd83f1d9/classifier_display.py
def _OnKey(self, evt): find = self.text.GetValue() if evt.KeyCode() == WXK_TAB: self._OnTab(evt)
def _OnTab(self, evt): find = self._symbol_table.autocomplete(find) self.text.SetValue(find) self.text.SetInsertionPointEnd()
40d2d07da7b00db524d562303d2b244ccd83f1d9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9927/40d2d07da7b00db524d562303d2b244ccd83f1d9/classifier_display.py
def run (self): name = self.distribution.metadata.name version = self.distribution.metadata.version description = self.distribution.metadata.description self.run_command('build') install = self.reinitialize_command('install', reinit_subcommands=1) install.root = self.bdist_dir install.warn_dir = 0 log.info("installi...
e24c7be3948de844c8f43e643c213af03f056b13 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9927/e24c7be3948de844c8f43e643c213af03f056b13/gamera_mac_setup.py
pkg = os.path.join(self.dist_dir, name + ".pkg") if os.path.exists(pkg): remove_tree(pkg)
def run (self): name = self.distribution.metadata.name version = self.distribution.metadata.version description = self.distribution.metadata.description self.run_command('build') install = self.reinitialize_command('install', reinit_subcommands=1) install.root = self.bdist_dir install.warn_dir = 0 log.info("installi...
e24c7be3948de844c8f43e643c213af03f056b13 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9927/e24c7be3948de844c8f43e643c213af03f056b13/gamera_mac_setup.py
log.info("Building %s.pkg..." % name) pm = buildpkg.PackageMaker(name, version, description)
log.info("Building %s.pkg..." % fullname) pm = buildpkg.PackageMaker(fullname, version, description)
def run (self): name = self.distribution.metadata.name version = self.distribution.metadata.version description = self.distribution.metadata.description self.run_command('build') install = self.reinitialize_command('install', reinit_subcommands=1) install.root = self.bdist_dir install.warn_dir = 0 log.info("installi...
e24c7be3948de844c8f43e643c213af03f056b13 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9927/e24c7be3948de844c8f43e643c213af03f056b13/gamera_mac_setup.py
readmes = ['README', 'readme.txt', 'LICENSE', 'ACKNOWLEDGEMENTS'] for readme in readmes: if os.path.exists(readme): copy_file(readme, pkg_dir)
def run (self): name = self.distribution.metadata.name version = self.distribution.metadata.version description = self.distribution.metadata.description self.run_command('build') install = self.reinitialize_command('install', reinit_subcommands=1) install.root = self.bdist_dir install.warn_dir = 0 log.info("installi...
e24c7be3948de844c8f43e643c213af03f056b13 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9927/e24c7be3948de844c8f43e643c213af03f056b13/gamera_mac_setup.py
removals = [os.path.join(self.dist_dir, name + ".dmg"), os.path.join(self.dist_dir, "_%s.dmg" % name)]
removals = [os.path.join(self.dist_dir, fullname + ".dmg"), os.path.join(self.dist_dir, "_%s.dmg" % fullname)]
def run (self): name = self.distribution.metadata.name version = self.distribution.metadata.version description = self.distribution.metadata.description self.run_command('build') install = self.reinitialize_command('install', reinit_subcommands=1) install.root = self.bdist_dir install.warn_dir = 0 log.info("installi...
e24c7be3948de844c8f43e643c213af03f056b13 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9927/e24c7be3948de844c8f43e643c213af03f056b13/gamera_mac_setup.py
log.info("Making %s.dmg..." % name) makedmg.make_dmg(pkg_dir, self.dist_dir, name)
log.info("Making %s.dmg..." % fullname) makedmg.make_dmg(pkg_dir, self.dist_dir, fullname)
def run (self): name = self.distribution.metadata.name version = self.distribution.metadata.version description = self.distribution.metadata.description self.run_command('build') install = self.reinitialize_command('install', reinit_subcommands=1) install.root = self.bdist_dir install.warn_dir = 0 log.info("installi...
e24c7be3948de844c8f43e643c213af03f056b13 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9927/e24c7be3948de844c8f43e643c213af03f056b13/gamera_mac_setup.py
if wxIsBusy():
while wxIsBusy():
def OnBrowse(self, event): parent = self.text.GetParent() filename = gui_util.open_file_dialog(parent, self.extension) if filename: self.text.SetValue(filename) parent.Raise() if wxIsBusy(): wxEndBusyCursor()
501dcb2b38f1267311f3d8a2e145fa2b11e957a8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9927/501dcb2b38f1267311f3d8a2e145fa2b11e957a8/args_gui.py
if wxIsBusy():
while wxIsBusy():
def OnBrowse(self, event): parent = self.text.GetParent() filename = gui_util.save_file_dialog(parent, self.extension) if filename: self.text.SetValue(filename) parent.Raise() if wxIsBusy(): wxEndBusyCursor()
501dcb2b38f1267311f3d8a2e145fa2b11e957a8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9927/501dcb2b38f1267311f3d8a2e145fa2b11e957a8/args_gui.py
if wxIsBusy():
while wxIsBusy():
def OnBrowse(self, event): parent = self.text.GetParent() filename = gui_util.directory_dialog(self.text) if filename: self.text.SetValue(filename) parent.Raise() if wxIsBusy(): wxEndBusyCursor()
501dcb2b38f1267311f3d8a2e145fa2b11e957a8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9927/501dcb2b38f1267311f3d8a2e145fa2b11e957a8/args_gui.py
for x in self._members_for_menu
for x in _members_for_menu
def members_for_menu(self): return ["%s: %s" % (x, getattr(self, x)) for x in self._members_for_menu if hasattr(self, x)]
4781a3ebdbd17ab6c44c8352baf7e1955aa24ed4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9927/4781a3ebdbd17ab6c44c8352baf7e1955aa24ed4/image_menu.py
evaluate_function = _Classifier._evaluate_subgroup
evaluate_function = self._evaluate_subgroup
def group_list_automatic(self, glyphs, grouping_function=None, evaluate_function=None): if len(glyphs) == 0: return glyphs = [x for x in glyphs if x.classification_state != 3] splits, removed = self.classify_list_automatic(glyphs) glyphs = [x for x in glyphs if not x.get_main_id().startswith('split')] if grouping_funct...
2578bac57e73f124ab90fbf6ec1353a4d57f64fe /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9927/2578bac57e73f124ab90fbf6ec1353a4d57f64fe/classify.py
def _evaluate_subgroup(subgroup):
def _evaluate_subgroup(self, subgroup):
def _evaluate_subgroup(subgroup): import image_utilities if len(subgroup) > 1: union = image_utilities.union_images(subgroup) classification = self.guess_glyph_automatic(union) if (classification[0][1].startswith("split") or classification[0][1].startswith("skip")): return 0 else: return classification[0][0] return sub...
2578bac57e73f124ab90fbf6ec1353a4d57f64fe /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9927/2578bac57e73f124ab90fbf6ec1353a4d57f64fe/classify.py
_evaulate_subgroup = staticmethod(_evaluate_subgroup)
def _evaluate_subgroup(subgroup): import image_utilities if len(subgroup) > 1: union = image_utilities.union_images(subgroup) classification = self.guess_glyph_automatic(union) if (classification[0][1].startswith("split") or classification[0][1].startswith("skip")): return 0 else: return classification[0][0] return sub...
2578bac57e73f124ab90fbf6ec1353a4d57f64fe /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9927/2578bac57e73f124ab90fbf6ec1353a4d57f64fe/classify.py
self.GetGridWindow().GetParent().Layout()
def resize_grid(self, do_auto_size=1): if not self.created: return wxBeginBusyCursor() self.BeginBatch() try: orig_rows = self.rows rows = int(max(ceil(float(len(self.list) - 1) / float(GRID_NCOLS)), 1)) cols = GRID_NCOLS self.DeleteRows(0, self.rows) self.AppendRows(rows) self.rows = rows self.cols = cols row_size = 1...
5b50f32ef68fe5d7631b915a125d7b7201a5f19b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9927/5b50f32ef68fe5d7631b915a125d7b7201a5f19b/gamera_display.py
def scale(self, scaling): if self.scaling != scaling: self.scaling = scaling #x = self.GetSize() self.AutoSize() #self.SetSize(x) self.MakeCellVisible(self.GetGridCursorRow(), self.GetGridCursorCol())
5b50f32ef68fe5d7631b915a125d7b7201a5f19b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9927/5b50f32ef68fe5d7631b915a125d7b7201a5f19b/gamera_display.py
self.MakeCellVisible(self.GetGridCursorRow(), self.GetGridCursorCol())
self.MakeCellVisible( self.GetGridCursorRow(), self.GetGridCursorCol())
def scale(self, scaling): if self.scaling != scaling: self.scaling = scaling #x = self.GetSize() self.AutoSize() #self.SetSize(x) self.MakeCellVisible(self.GetGridCursorRow(), self.GetGridCursorCol())
5b50f32ef68fe5d7631b915a125d7b7201a5f19b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9927/5b50f32ef68fe5d7631b915a125d7b7201a5f19b/gamera_display.py
to_rle, from_rle]
to_rle, from_rle, iterate_black_horizontal_runs, iterate_black_vertical_runs, iterate_white_horizontal_runs, iterate_white_vertical_runs]
def __call__(self, length): warnings.warn("Use filter_wide_black_runs instead of filter_wide_runs.", DeprecationWarning) return _runlength.filter_wide_black_runs(self, length)
4c22cc8d3ccd4e0e5bc207527efd0894d751714e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9927/4c22cc8d3ccd4e0e5bc207527efd0894d751714e/runlength.py
def add_highlight_cc(self, cc): self._iw.id.add_highlight_cc(cc)
def add_highlight_cc(self, cc, color): self._iw.id.add_highlight_cc(cc, color)
def add_highlight_cc(self, cc): self._iw.id.add_highlight_cc(cc)
7b74a60c70068773d1f7eed3faaf78d2d160409a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9927/7b74a60c70068773d1f7eed3faaf78d2d160409a/gamera_display.py
font.SetPointSize(14)
if wxPlatform == '__WXMSW__': font.SetPointSize(10) else: font.SetPointSize(14)
def __init__(self, toplevel, parent = None, id = -1, size = wxDefaultSize): self.toplevel = toplevel MultiImageWindow.__init__(self, parent, id, size)
c74295924c0ca7f63ddb02860a8e1271ba4accfd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9927/c74295924c0ca7f63ddb02860a8e1271ba4accfd/classifier_display.py
def _SaveClassifierCollection(self, filename): try: self._classifier.to_xml_filename(filename) except gamera_xml.XMLError, e: gui_util.message("Saving classifier glyphs: " + str(e)) def _OnClearClassifierCollection(self, event): if self._classifier.is_dirty: if gui_util.are_you_sure_dialog(self._frame, "Are you sure ...
def _OnGenerateClassifierStats(self, event): from gamera import classifier_stats all_stats = [(x.title, x) for x in classifier_stats.all_stat_pages] all_stats.sort() stats_controls = [Check('', x[0], default=True) for x in all_stats] stats_controls.append(Directory('Stats directory')) dialog = Args( stats_controls, nam...
c74295924c0ca7f63ddb02860a8e1271ba4accfd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9927/c74295924c0ca7f63ddb02860a8e1271ba4accfd/classifier_display.py
else len(args) == 2:
elif len(args) == 2:
def __call__(self, *args): if len(args) == 5: return _draw.draw_hollow_rect(self, *args) elif len(args) == 3: try: a = args[0] b = args[1] value = args[2] return _draw.draw_hollow_rect(self, a.y, a.x, b.y, b.x, value) except KeyError, AttributeError: pass else len(args) == 2: try: a = args[0] value = args[1] return _dr...
2a60a42f9f34d5bf480f35ed055770c4d6c34c54 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9927/2a60a42f9f34d5bf480f35ed055770c4d6c34c54/draw.py
**draw_filled_rect** (Point(*x1*, *y1*), Point(*x2*, *y2))
**draw_filled_rect** (Point(*x1*, *y1*), Point(*x2*, *y2*))
def __doc_example1__(images): from random import randint from gamera.core import Image image = Image(0, 0, 100, 100, RGB, DENSE) for i in range(10): image.draw_hollow_rect(randint(0, 100), randint(0, 100), randint(0, 100), randint(0, 100), RGBPixel(randint(0, 255), randint(0,255), randint(0, 255))) return image
2a60a42f9f34d5bf480f35ed055770c4d6c34c54 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9927/2a60a42f9f34d5bf480f35ed055770c4d6c34c54/draw.py
else len(args) == 2:
elif len(args) == 2:
def __call__(self, *args): if len(args) == 5: return _draw.draw_filled_rect(self, *args) elif len(args) == 3: try: a = args[0] b = args[1] value = args[2] return _draw.draw_filled_rect(self, a.y, a.x, b.y, b.x, value) except KeyError, AttributeError: pass else len(args) == 2: try: a = args[0] value = args[1] return _dr...
2a60a42f9f34d5bf480f35ed055770c4d6c34c54 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9927/2a60a42f9f34d5bf480f35ed055770c4d6c34c54/draw.py
*accuracy*:
*accuracy* = ``0.1``:
def __doc_example1__(images): from random import randint from gamera.core import Image image = Image(0, 0, 100, 100, RGB, DENSE) for i in range(10): image.draw_filled_rect(randint(0, 100), randint(0, 100), randint(0, 100), randint(0, 100), RGBPixel(randint(0, 255), randint(0,255), randint(0, 255))) return image
2a60a42f9f34d5bf480f35ed055770c4d6c34c54 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9927/2a60a42f9f34d5bf480f35ed055770c4d6c34c54/draw.py
print self.database
def change_feature_set(self, features): self.is_dirty = True if len(self.database): print self.database self.feature_functions = iter(self.database).next().get_feature_functions(features) self.generate_features(self.database) self.instantiate_from_images(self.database)
e138f8d96b39da8ffee66274b7af1fa3b2cb24bd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9927/e138f8d96b39da8ffee66274b7af1fa3b2cb24bd/classify.py
print name
def magic_import(name, globals_={}, locals_={}, fromlist=[]): if fromlist != None and "core" in fromlist: fromlist = list(fromlist) fromlist.remove("core") if (name[0] == '_' and name[1] != "_" and name != "_winreg") or name == "core" or name == "gamera.core": print name return None else: return std_import(name, glob...
d0955d089e22590fe4cf90052f62d885bd031828 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9927/d0955d089e22590fe4cf90052f62d885bd031828/generate.py
[[ exec function.self_type.pixel_types = orig_self_types]]
[[exec function.self_type.pixel_types = orig_self_types]]
[[def switch(layer, args)]] switch(get_image_combination([[images[layer].name]], cc_type)) { [[for type in images[layer].pixel_types]] [[exec current = '*((' + type + '*)((RectObject*)' + images[layer].name + ')->m_x)']] case [[type.upper()]]: [[if layer == len(images) - 1]] [[if function.return_type != None]] return_v...
d0955d089e22590fe4cf90052f62d885bd031828 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9927/d0955d089e22590fe4cf90052f62d885bd031828/generate.py