bugged
stringlengths
4
228k
fixed
stringlengths
0
96.3M
__index_level_0__
int64
0
481k
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
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->it - self->element->ib def land_widget_inner_extents(LandWidget *self, float *l, *t, *r, *b...
28,000
LandArray *def land_array_new(): LandArray *self land_alloc(self) return self
LandArray*defland_array_new():LandArray*selfland_alloc(self)returnself
28,001
def land_array_destroy(LandArray *self): land_free(self->data) land_free(self)
def land_array_destroy(LandArray *self): if self->data: land_free(self->data) land_free(self)
28,002
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)
defland_log_overwrite(charconst*name):FILE*fiflogname:land_free(logname)logname=land_strdup(name)f=fopen(logname,"w")iff:fclose(f)
28,003
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...
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) if not once: atexit(land_log_del) once++ 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.lo...
28,004
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)
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
28,005
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...
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...
28,006
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...
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...
28,007
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...
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_yfloat view_x = view->scroll_x float view_y = view->scroll_yif !find_offset(self, view_x, view_y, &cell_x, &cell_y, &pixel_x, &pixel_y): return# One row up might al...
28,008
def land_widget_base_size(LandWidget *self): land_widget_layout_inhibit(self) land_widget_layout(self) land_widget_layout_enable(self)
def land_widget_base_size(LandWidget *self): land_widget_layout(self) land_widget_layout_enable(self)
28,009
def land_widget_base_size(LandWidget *self): land_widget_layout_inhibit(self) land_widget_layout(self) land_widget_layout_enable(self)
def land_widget_base_size(LandWidget *self): land_widget_layout_inhibit(self) land_widget_layout(self)
28,010
#ifdef WINDOWS
#ifdef WINDOWS
28,011
#ifdef WINDOWS
#ifdef WINDOWS
28,012
#ifdef WINDOWS
#ifdef WINDOWS
28,013
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...
def char a = 1; land_net_listen(LandNet char a = 1; *self, char a = 1; char char a = 1; const char a = 1; *address): char a = 1; int char a = 1; r char a = 1; struct char a = 1; sockaddr_in char a = 1; sock_address char a = 1; char char a = 1; *host char a = 1; int char a = 1; port char a =...
28,014
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...
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 and\ WSAGetLastError () != WSAEWOULDBLOCK: #else if errno != EINTR &&...
28,015
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, ...
def clone(self, value=None, tagSet=None, subtypeSpec=None, namedValues=None): 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 named...
28,016
def __init__(self, codecMap): self.__codecMap = codecMap
def __init__(self, codecMap): self.__codecMap = codecMap
28,017
# def __cmp__(self, other):
# def __cmp__(self, other): return cmp(self.__hashedValues, other) def __cmp__(self, other): return cmp(self.__hashedValues, other) def __cmp__(self, other):
28,018
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...
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...
28,019
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...
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...
28,020
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...
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...
28,021
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...
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(e...
28,022
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)
def save_cb(self, evt): if self.classifier == None: gui_util.message("There is no loaded classifier to save.") else: if self.settings_filename is not None: wxBeginBusyCursor() self.classifier.save_settings(self.settings_filename) wxEndBusyCursor() else: self.save_as_cb(evt)
28,023
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()
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()
28,024
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
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 default is None: self.default = [] self.has_default = False else: self.default = default self.has_default = True
28,025
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 > (...
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 > (...
28,026
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
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
28,027
def OnBrowse(self, event): filename = gui_util.open_file_dialog(self.text, self.extension) if filename: self.text.SetValue(filename) self.text.GetParent().Raise()
def OnBrowse(self, event): parent = self.text.GetParent() filename = gui_util.open_file_dialog(parent, self.extension) if filename: self.text.SetValue(filename) self.text.GetParent().Raise()
28,028
def OnBrowse(self, event): filename = gui_util.open_file_dialog(self.text, self.extension) if filename: self.text.SetValue(filename) self.text.GetParent().Raise()
def OnBrowse(self, event): filename = gui_util.open_file_dialog(self.text, self.extension) if filename: self.text.SetValue(filename) self.text.GetParent().Raise()
28,029
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)
defget_string(self):while1:text=self.text.GetValue()ifnotos.path.exists(os.path.abspath(text)):gui_util.message("File'%s'doesnotexist."%text)self.OnBrowse(None)else:breakreturn_Filename.get_string(self)
28,030
def OnBrowse(self, event): filename = gui_util.save_file_dialog(self.text, self.extension) if filename: self.text.SetValue(filename) self.text.GetParent().Raise()
def OnBrowse(self, event): parent = self.text.GetParent() filename = gui_util.save_file_dialog(parent, self.extension) if filename: self.text.SetValue(filename) self.text.GetParent().Raise()
28,031
def OnBrowse(self, event): filename = gui_util.save_file_dialog(self.text, self.extension) if filename: self.text.SetValue(filename) self.text.GetParent().Raise()
def OnBrowse(self, event): filename = gui_util.save_file_dialog(self.text, self.extension) if filename: self.text.SetValue(filename) self.text.GetParent().Raise()
28,032
def OnBrowse(self, event): filename = gui_util.directory_dialog(self.text) if filename: self.text.SetValue(filename) self.text.GetParent().Raise()
defparent = self.text.GetParent() OnBrowse(self,parent = self.text.GetParent() event):parent = self.text.GetParent() parent = self.text.GetParent() filenameparent = self.text.GetParent() =parent = self.text.GetParent() gui_util.directory_dialog(self.text)parent = self.text.GetParent() ifparent = self.text.GetParent() f...
28,033
def OnBrowse(self, event): filename = gui_util.directory_dialog(self.text) if filename: self.text.SetValue(filename) self.text.GetParent().Raise()
def OnBrowse(self, event): filename = gui_util.directory_dialog(self.text) if filename: self.text.SetValue(filename) self.text.GetParent().Raise()
28,034
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)
defget_string(self):while1:text=self.text.GetValue()ifnotos.path.exists(os.path.abspath(text)):gui_util.message("File'%s'doesnotexist."%text)self.OnBrowse(None)else:breakreturn_Filename.get_string(self)
28,035
def determine_choices(self, locals): from gamera import core self.klass = core.Point return Class.determine_choices(self, locals)
defdetermine_choices(self,locals):fromgameraimportcoreself.klass=core.PointreturnClass.determine_choices(self,locals)
28,036
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()
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(enable) self.update_status()
28,037
def do_auto_move(self, state): # if auto-moving is turned off, just return if state == []: return
def do_auto_move(self, state): # if auto-moving is turned off, just return if state == []: return
28,038
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)
def _OnChooseImage(self, event): dlg = Args([Class("Image for context display", ImageBase)]) image = dlg.show(self, image_menu.shell.locals) if image != None: self.id.set_image(image)
28,039
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)
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)
28,040
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...
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...
28,041
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
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
28,042
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...
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...
28,043
def load_image(filename, compression = DENSE): """**load_image** (FileOpen *filename*, Choice *storage_format* = ``DENSE``)
def load_image(filename, compression = DENSE): """**load_image** (FileOpen *filename*, Choice *storage_format* = ``DENSE``)
28,044
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...
def parse_stream(self, stream): 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_length) try: try...
28,045
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...
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...
28,046
[[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...
[[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...
28,047
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...
def create_graph(glyphs, ratio): import gamera.knn k = gamera.knn.kNN() forest = k.unique_distances(glyphs) #forest = create_forest(glyphs) num_nodes = len(glyphs) next = 1 g = Graph() for i in range(len(glyphs)): glyphs[i].visited = 0 g.add_node(glyphs[i]) glyphs[i].cluster_name = str(i) g.add_edge(forest[0][1], fores...
28,048
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...
def _init_gamera(): 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"), plugin.ImageType(ALL), plugin.Args([plugin.Fil...
28,049
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...
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...
28,050
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...
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...
28,051
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...
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...
28,052
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...
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...
28,053
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,...
def _find_group_unions(self, G, evaluate_function, max_parts_per_group=5): ### 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, evaluate_function, m...
28,054
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,...
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(): ### best_grouping = G.optimize_partitions( root, evaluate_function, ma...
28,055
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...
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...
28,056
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...
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...
28,057
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 ""
def name_lookup_unicode(id_name): name = id_name.replace(".", " ") name = name.upper() try: return unicodedata.lookup(name) except KeyError: print "ERROR: Name not found:", id_name return ""
28,058
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 ""
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:", name return ""
28,059
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(%...
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 == NULL) return 0; int %(symbol)s_size = PySequence_Fast_GET_SIZE(%(pysymbol)s_seq); %(symbol)s....
28,060
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...
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 ImageBase.get_feature_functions()[0]] feature_controls = [] for x in all_features: feature_controls.append( Check('', x, default=(x in existi...
28,061
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...
def Fudge(o, amount = FUDGE_AMOUNT): # For rectangles, just return a new rectangle that is slightly larger if isinstance(o, Rect): return Rect(Point(int(o.ul_x-amount), int(o.ul_y - amount)), Dim(int(o.ncols + amount * 2), int(o.nrows + amount * 2))) # For integers, return one of our "fudge number proxies" elif isinst...
28,062
def __init__(self, toplevel, parent = None, id = -1, size = wxDefaultSize): self.toplevel = toplevel MultiImageWindow.__init__(self, parent, id, size)
def __init__(self, toplevel, parent = None, id = -1, size = wxDefaultSize): self.toplevel = toplevel MultiImageWindow.__init__(self, parent, id, size)
28,063
def __init__(self, toplevel, parent = None, id = -1, size = wxDefaultSize): self.toplevel = toplevel MultiImageWindow.__init__(self, parent, id, size)
def __init__(self, toplevel, parent = None, id = -1, size = wxDefaultSize): self.toplevel = toplevel MultiImageWindow.__init__(self, parent, id, size)
28,064
def __init__(self, toplevel, parent = None, id = -1, size = wxDefaultSize): self.toplevel = toplevel MultiImageWindow.__init__(self, parent, id, size)
def __init__(self, toplevel, parent = None, id = -1, size = wxDefaultSize): self.toplevel = toplevel MultiImageWindow.__init__(self, parent, id, size)
28,065
def __init__(self, toplevel, parent = None, id = -1, size = wxDefaultSize): self.toplevel = toplevel MultiImageWindow.__init__(self, parent, id, size)
def __init__(self, toplevel, parent = None, id = -1, size = wxDefaultSize): self.toplevel = toplevel MultiImageWindow.__init__(self, parent, id, size)
28,066
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
def _OnClearClassifierCollection(self, event): if self._classifier.is_dirty: if gui_util.are_you_sure_dialog( "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
28,067
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...
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?"): event.Veto() return self._classifier.set_display(None) self.multi_iw.Destroy() self.single_iw.Destroy() self.splitterhr1.Destroy() self.splitterhr0.Destroy() self.splitterhl.Destroy(...
28,068
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...
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...
28,069
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...
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...
28,070
def _OnTab(self, evt): find = self._symbol_table.autocomplete(find) self.text.SetValue(find) self.text.SetInsertionPointEnd()
def _OnKey(self, evt): find = self.text.GetValue() if evt.KeyCode() == WXK_TAB: find = self._symbol_table.autocomplete(find) self.text.SetValue(find) self.text.SetInsertionPointEnd()
28,071
def _OnTab(self, evt): find = self._symbol_table.autocomplete(find) self.text.SetValue(find) self.text.SetInsertionPointEnd()
def _OnTab(self, evt): find = self._symbol_table.autocomplete(find) self.text.SetValue(find) self.text.SetInsertionPointEnd()
28,072
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...
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...
28,073
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...
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...
28,074
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...
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...
28,075
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...
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...
28,076
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...
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...
28,077
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...
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...
28,078
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()
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() while wxIsBusy(): wxEndBusyCursor()
28,079
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()
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() while wxIsBusy(): wxEndBusyCursor()
28,080
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()
def OnBrowse(self, event): parent = self.text.GetParent() filename = gui_util.directory_dialog(self.text) if filename: self.text.SetValue(filename) parent.Raise() while wxIsBusy(): wxEndBusyCursor()
28,081
def members_for_menu(self): return ["%s: %s" % (x, getattr(self, x)) for x in self._members_for_menu if hasattr(self, x)]
def members_for_menu(self): return ["%s: %s" % (x, getattr(self, x)) for x in _members_for_menu if hasattr(self, x)]
28,082
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...
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...
28,083
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...
def _evaluate_subgroup(self, 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] retu...
28,084
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...
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...
28,085
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...
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...
28,086
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())
defscale(self,scaling):ifself.scaling!=scaling:self.scaling=scaling#x=self.GetSize()self.AutoSize()#self.SetSize(x)self.MakeCellVisible(self.GetGridCursorRow(),self.GetGridCursorCol())
28,087
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())
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())
28,088
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)
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)
28,089
def add_highlight_cc(self, cc): self._iw.id.add_highlight_cc(cc)
def add_highlight_cc(self, cc): self._iw.id.add_highlight_cc(cc)
28,090
def __init__(self, toplevel, parent = None, id = -1, size = wxDefaultSize): self.toplevel = toplevel MultiImageWindow.__init__(self, parent, id, size)
def __init__(self, toplevel, parent = None, id = -1, size = wxDefaultSize): self.toplevel = toplevel MultiImageWindow.__init__(self, parent, id, size)
28,091
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...
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...
28,092
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...
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 elif len(args) == 2: try: a = args[0] value = args[1] return _dr...
28,093
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
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
28,094
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...
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 elif len(args) == 2: try: a = args[0] value = args[1] return _dr...
28,095
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
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
28,096
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)
def change_feature_set(self, features): self.is_dirty = True if len(self.database): self.feature_functions = iter(self.database).next().get_feature_functions(features) self.generate_features(self.database) self.instantiate_from_images(self.database)
28,097
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...
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": return None else: return std_import(name, globals_, local...
28,098
[[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...
[[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...
28,099