bugged stringlengths 4 228k | fixed stringlengths 0 96.3M | __index_level_0__ int64 0 481k |
|---|---|---|
def get_top_parent(widget): """Return the ultimate parent of a widget; the assumption that code using this makes is that it will be a gtk.Window, i.e. the widget is fully packed when this is called.""" return widget and widget.get_ancestor(gtk.Window) | def get_top_parent(widget): """Return the ultimate parent of a widget; the assumption that code using this makes is that it will be a gtk.Window, i.e. the widget is fully packed when this is called.""" parent = widget and widget.get_toplevel() if parent and (parent.flags() & gtk.TOPLEVEL): return parent else: return No... | 458,900 |
def human_sort_key(s): if not isinstance(title, unicode): s = s.decode("utf-8") s = unicodedata.normalize('NFD', s.lower()) return split_numeric(s) | def human_sort_key(s): if not isinstance(s, unicode): s = s.decode("utf-8") s = unicodedata.normalize('NFD', s.lower()) return split_numeric(s) | 458,901 |
def __save_files(self, save, revert, model, library): updated = {} deleted = {} added = {} renamed = {} for row in model: if row[EDITED] and not (row[DELETED] or row[RENAMED]): if row[ORIGVALUE] is not None: updated.setdefault(row[TAG], []) updated[row[TAG]].append((util.decode(row[VALUE]), util.decode(row[ORIGVALUE]))... | def __save_files(self, save, revert, model, library): updated = {} deleted = {} added = {} renamed = {} for row in model: if row[EDITED] and not (row[DELETED] or row[RENAMED]): if row[ORIGVALUE] is not None: updated.setdefault(row[TAG], []) updated[row[TAG]].append((util.decode(row[VALUE]), util.decode(row[ORIGVALUE]))... | 458,902 |
def __save_files(self, save, revert, model, library): updated = {} deleted = {} added = {} renamed = {} for row in model: if row[EDITED] and not (row[DELETED] or row[RENAMED]): if row[ORIGVALUE] is not None: updated.setdefault(row[TAG], []) updated[row[TAG]].append((util.decode(row[VALUE]), util.decode(row[ORIGVALUE]))... | def __save_files(self, save, revert, model, library): updated = {} deleted = {} added = {} renamed = {} for row in model: if row[EDITED] and not (row[DELETED] or row[RENAMED]): if row[ORIGVALUE] is not None: updated.setdefault(row[TAG], []) updated[row[TAG]].append((util.decode(row[VALUE]), util.decode(row[ORIGVALUE]))... | 458,903 |
def __save_files(self, save, revert, model, library): updated = {} deleted = {} added = {} renamed = {} for row in model: if row[EDITED] and not (row[DELETED] or row[RENAMED]): if row[ORIGVALUE] is not None: updated.setdefault(row[TAG], []) updated[row[TAG]].append((util.decode(row[VALUE]), util.decode(row[ORIGVALUE]))... | def __save_files(self, save, revert, model, library): updated = {} deleted = {} added = {} renamed = {} for row in model: if row[EDITED] and not (row[DELETED] or row[RENAMED]): if row[ORIGVALUE] is not None: updated.setdefault(row[TAG], []) updated[row[TAG]].append((util.decode(row[VALUE]), util.decode(row[ORIGVALUE]))... | 458,904 |
def __save_files(self, save, revert, model, library): updated = {} deleted = {} added = {} renamed = {} for row in model: if row[EDITED] and not (row[DELETED] or row[RENAMED]): if row[ORIGVALUE] is not None: updated.setdefault(row[TAG], []) updated[row[TAG]].append((util.decode(row[VALUE]), util.decode(row[ORIGVALUE]))... | def __save_files(self, save, revert, model, library): updated = {} deleted = {} added = {} renamed = {} for row in model: if row[EDITED] and not (row[DELETED] or row[RENAMED]): if row[ORIGVALUE] is not None: updated.setdefault(row[TAG], []) updated[row[TAG]].append((util.decode(row[VALUE]), util.decode(row[ORIGVALUE]))... | 458,905 |
def __save(self, *data): """save the cover, spawn the program to edit it if selected""" | def __save(self, *data): """save the cover, spawn the program to edit it if selected""" | 458,906 |
def disabled(self): global gtk_216 if self.__w_sig_map and window.handler_is_connected(self.__w_sig_map): window.disconnect(self.__w_sig_map) if self.__w_sig_del and window.handler_is_connected(self.__w_sig_del): window.disconnect(self.__w_sig_del) if self.__icon: self.__icon.set_visible(False) try: self.__icon.destroy... | def disabled(self): global gtk_216 if self.__w_sig_map and window.handler_is_connected(self.__w_sig_map): window.disconnect(self.__w_sig_map) if self.__w_sig_del and window.handler_is_connected(self.__w_sig_del): window.disconnect(self.__w_sig_del) if self.__icon: self.__icon.set_visible(False) try: self.__icon.destroy... | 458,907 |
def __button_right(self, icon, button, time): global gtk_216 menu = gtk.Menu() | def __button_right(self, icon, button, time): global gtk_216 menu = gtk.Menu() | 458,908 |
def set_rating(value): song = player.song if song is None: return else: song["~#rating"] = value watcher.changed([song]) | def set_rating(value): song = player.song if song is None: return else: song["~#rating"] = value watcher.changed([song]) | 458,909 |
def get_selected_songs(self): model, rows = self.get_selection().get_selected_rows() return [model[row][0] for row in rows] | def get_selected_songs(self): selection = self.get_selection() if selection is None: return [] model, rows = selection.get_selected_rows() return [model[row][0] for row in rows] | 458,910 |
def do_setup(rev): PYVER='2.6' deps = [ (PythonDep('Python', PYVER), MSIInst('Python')), (OnePageDep('setuptools', None, 'http://pypi.python.org/pypi/setuptools', '[^"]*setuptools[^"]*tar.gz[^"#]*'), SetuptoolsInst()), (SFDep('gnuwin32', None, 'unrar-[1234567890.]*-bin.zip'), ZipInst('Python')), (SFDep('innounp', None,... | def do_setup(rev): PYVER='2.6' deps = [ (PythonDep('Python', PYVER), MSIInst('Python')), (OnePageDep('setuptools', None, 'http://pypi.python.org/pypi/setuptools', '[^"]*setuptools[^"]*tar.gz[^"#]*'), SetuptoolsInst()), (SFDep('gnuwin32', None, 'unrar-[1234567890.]*-bin.zip'), ZipInst('Python')), (SFDep('innounp', None,... | 458,911 |
def create_device(self, backend_id, device_id, protocols): """backend_id is the string that gets passed to the backend so it can identify the device. device_id should be a something including the device serial (so it's unique) and maybe the model name.""" klass = get_by_protocols(protocols) if klass: device = klass(bac... | def create_device(self, backend_id, device_id, protocols): """backend_id is the string that gets passed to the backend so it can identify the device. device_id should be a something including the device serial (so it's unique) and maybe the model name.""" klass = get_by_protocols(protocols) if klass: device = klass(bac... | 458,912 |
def __expose(self, widget, event): w, h = self.get_size_request() self.style.paint_flat_box(self.window, gtk.STATE_NORMAL, gtk.SHADOW_OUT, None, self, "tooltip", 0, 0, w, h) self.window.input_shape_combine_region(self.__empty_region, 0, 0) self.__leave_event = widget.connect('leave-notify-event', self.__undisplay) | def __expose(self, widget, event): w, h = self.get_size_request() self.style.paint_flat_box(self.window, gtk.STATE_NORMAL, gtk.SHADOW_OUT, None, self, "tooltip", 0, 0, w, h) self.window.input_shape_combine_region(self.__empty_region, 0, 0) self.__leave_event = widget.connect('leave-notify-event', self.__undisplay) | 458,913 |
def __motion(self, view, event): # trigger over row area, not column headers if event.window is not view.get_bin_window(): return self.__undisplay() suppress = (gtk.gdk.CONTROL_MASK | gtk.gdk.SHIFT_MASK | gtk.gdk.SUPER_MASK | gtk.gdk.HYPER_MASK | gtk.gdk.META_MASK) if event.get_state() & suppress: return self.__undispl... | def __motion(self, view, event): # trigger over row area, not column headers if event.window is not view.get_bin_window(): return self.__undisplay() suppress = (gtk.gdk.CONTROL_MASK | gtk.gdk.SHIFT_MASK | gtk.gdk.SUPER_MASK | gtk.gdk.HYPER_MASK | gtk.gdk.META_MASK) if event.get_state() & suppress: return self.__undispl... | 458,914 |
def __motion(self, view, event): # trigger over row area, not column headers if event.window is not view.get_bin_window(): return self.__undisplay() suppress = (gtk.gdk.CONTROL_MASK | gtk.gdk.SHIFT_MASK | gtk.gdk.SUPER_MASK | gtk.gdk.HYPER_MASK | gtk.gdk.META_MASK) if event.get_state() & suppress: return self.__undispl... | def __motion(self, view, event): # trigger over row area, not column headers if event.window is not view.get_bin_window(): return self.__undisplay() suppress = (gtk.gdk.CONTROL_MASK | gtk.gdk.SHIFT_MASK | gtk.gdk.SUPER_MASK | gtk.gdk.HYPER_MASK | gtk.gdk.META_MASK) if event.get_state() & suppress: return self.__undispl... | 458,915 |
def __init__(self, parent=None): if self.is_not_unique(): return super(Preferences, self).__init__() self.set_transient_for(qltk.get_top_parent(parent)) | def __init__(self, parent=None): if self.is_not_unique(): return super(Preferences, self).__init__() self.set_transient_for(qltk.get_top_parent(parent)) | 458,916 |
def __init__(self, parent=None): if self.is_not_unique(): return super(Preferences, self).__init__() self.set_transient_for(qltk.get_top_parent(parent)) | def __init__(self, parent=None): if self.is_not_unique(): return super(Preferences, self).__init__() self.set_transient_for(qltk.get_top_parent(parent)) | 458,917 |
def __init__(self, parent=None): if self.is_not_unique(): return super(Preferences, self).__init__() self.set_transient_for(qltk.get_top_parent(parent)) | def __init__(self, parent=None): if self.is_not_unique(): return super(Preferences, self).__init__() self.set_transient_for(qltk.get_top_parent(parent)) | 458,918 |
def refresh_panes(self): try: hbox = self.get_children()[1] except IndexError: pass # first call else: hbox.destroy() | def refresh_panes(self): try: hbox = self.get_children()[1] except IndexError: pass # first call else: hbox.destroy() | 458,919 |
def __count_cdf(column, cell, model, iter): try: cell.set_property('text', "(%d)" % (len(model[iter][1]))) except TypeError: cell.set_property('text', '') | def __count_cdf(column, cell, model, iter): try: cell.set_property('text', "(%d)" % (len(model[iter][1]))) except TypeError: cell.set_property('text', '') | 458,920 |
def __text_cdf(column, cell, model, iter): cell.markup = model[iter][0] cell.set_property('markup', cell.markup) | def __text_cdf(column, cell, model, iter): cell.markup = model[iter][0] cell.set_property('markup', cell.markup) | 458,921 |
def __init__(self, mytag, next, library): super(PanedBrowser.Pane, self).__init__() self.set_fixed_height_mode(True) | def __init__(self, mytag, next, library): super(PanedBrowser.Pane, self).__init__() self.set_fixed_height_mode(True) | 458,922 |
def __init__(self, mytag, next, library): super(PanedBrowser.Pane, self).__init__() self.set_fixed_height_mode(True) | def __init__(self, mytag, next, library): super(PanedBrowser.Pane, self).__init__() self.set_fixed_height_mode(True) | 458,923 |
def __init__(self, mytag, next, library): super(PanedBrowser.Pane, self).__init__() self.set_fixed_height_mode(True) | def __init__(self, mytag, next, library): super(PanedBrowser.Pane, self).__init__() self.set_fixed_height_mode(True) | 458,924 |
def __init__(self, mytag, next, library): super(PanedBrowser.Pane, self).__init__() self.set_fixed_height_mode(True) | def __init__(self, mytag, next, library): super(PanedBrowser.Pane, self).__init__() self.set_fixed_height_mode(True) | 458,925 |
def __init__(self, mytag, next, library): super(PanedBrowser.Pane, self).__init__() self.set_fixed_height_mode(True) | def __init__(self, mytag, next, library): super(PanedBrowser.Pane, self).__init__() self.set_fixed_height_mode(True) | 458,926 |
def __init__(self, mytag, next, library): super(PanedBrowser.Pane, self).__init__() self.set_fixed_height_mode(True) | def __init__(self, mytag, next, library): super(PanedBrowser.Pane, self).__init__() self.set_fixed_height_mode(True) | 458,927 |
def __drag_data_get(self, view, ctx, sel, tid, etime): songs = sorted(self.__get_songs(), key=lambda s: s.sort_key) if tid == 1: filenames = [song("~filename") for song in songs] sel.set("text/x-quodlibet-songs", 8, "\x00".join(filenames)) else: sel.set_uris([song("~uri") for song in songs]) | def __drag_data_get(self, view, ctx, sel, tid, etime): songs = self.__get_selected_songs(sort=True) if tid == 1: filenames = [song("~filename") for song in songs] sel.set("text/x-quodlibet-songs", 8, "\x00".join(filenames)) else: sel.set_uris([song("~uri") for song in songs]) | 458,928 |
def __human_sort_key(self, text): try: return self.__sort_cache[text] except KeyError: self.__sort_cache[text] = util.human_sort_key(text) return self.__sort_cache[text] | @staticmethod def __parse_prefs(row_pattern): """ Row pattern format: 'categorize_pattern:display_pattern' * display_pattern is optional (fallback: ~ * patterns, tied and normal tags. * display patterns can have function prefixes for numerical tags. * ':' has to be escaped ('\:') TODO: sort pattern, filter query """ ... | 458,929 |
def __popup_menu(self, view, library): menu = SongsMenu(library, sorted(self.__get_songs(), key=lambda s: s.sort_key), parent=self) menu.show_all() return view.popup_menu(menu, 0, gtk.get_current_event_time()) | def __popup_menu(self, view, library): songs = self.__get_selected_songs(sort=True) menu = SongsMenu(library, songs, parent=self) menu.show_all() return view.popup_menu(menu, 0, gtk.get_current_event_time()) | 458,930 |
def __destroy(self, model): self.set_model(None) model.clear() | def __destroy(self, model): self.set_model(None) model.clear() | 458,931 |
def _remove(self, songs, remove_if_empty=True): self.inhibit() model = self.get_model() to_remove = [] for row in model: data = row[1] if data is None: continue for song in songs: if song in data: data.remove(song) if not model[row.iter][1]: to_remove.append(row.iter) if remove_if_empty: for iter in to_remove: try: del... | def _remove(self, songs, remove_if_empty=True): self.inhibit() model = self.__model songs = set(songs) to_remove = [] for row in model: data = row[1] if data is None: continue for song in songs: if song in data: data.remove(song) if not model[row.iter][1]: to_remove.append(row.iter) if remove_if_empty: for iter in to_r... | 458,932 |
def _remove(self, songs, remove_if_empty=True): self.inhibit() model = self.get_model() to_remove = [] for row in model: data = row[1] if data is None: continue for song in songs: if song in data: data.remove(song) if not model[row.iter][1]: to_remove.append(row.iter) if remove_if_empty: for iter in to_remove: try: del... | def _remove(self, songs, remove_if_empty=True): self.inhibit() model = self.get_model() to_remove = [] for row in model: type, data = row if type == ALL: continue data.songs -= songs data.finalize() model.row_changed(row.path, row.iter) if not data.songs: to_remove.append(row.iter) if remove_if_empty: for iter in to_re... | 458,933 |
def _remove(self, songs, remove_if_empty=True): self.inhibit() model = self.get_model() to_remove = [] for row in model: data = row[1] if data is None: continue for song in songs: if song in data: data.remove(song) if not model[row.iter][1]: to_remove.append(row.iter) if remove_if_empty: for iter in to_remove: try: del... | def _remove(self, songs, remove_if_empty=True): self.inhibit() model = self.get_model() to_remove = [] for row in model: data = row[1] if data is None: continue for song in songs: if song in data: data.remove(song) if not model[row.iter][1]: to_remove.append(row.iter) if remove_if_empty: for iter in to_remove: try: del... | 458,934 |
def _remove(self, songs, remove_if_empty=True): self.inhibit() model = self.get_model() to_remove = [] for row in model: data = row[1] if data is None: continue for song in songs: if song in data: data.remove(song) if not model[row.iter][1]: to_remove.append(row.iter) if remove_if_empty: for iter in to_remove: try: del... | def _remove(self, songs, remove_if_empty=True): self.inhibit() model = self.get_model() to_remove = [] for row in model: data = row[1] if data is None: continue for song in songs: if song in data: data.remove(song) if not model[row.iter][1]: to_remove.append(row.iter) if remove_if_empty: for iter in to_remove: try: del... | 458,935 |
def _matches(self, song): try: model, rows = self.get_selection().get_selected_rows() except (AttributeError, TypeError): return False else: if not rows or model[rows[0]][1] is None: return True else: for row in rows: if model[row][0][:1] == "<": if not bool(self.__format(song)): return True else: value = util.unescape... | def _matches(self, song): model, rows = self.get_selection().get_selected_rows() if not rows or model[rows[0]][0] == ALL: return True keys = self.__get_format_keys(song) if not keys and model[rows[-1]][0] == UNKNOWN: return True for row in rows: if model[row][1].key in keys: return True return False def _add(self, son... | 458,936 |
def _matches(self, song): try: model, rows = self.get_selection().get_selected_rows() except (AttributeError, TypeError): return False else: if not rows or model[rows[0]][1] is None: return True else: for row in rows: if model[row][0][:1] == "<": if not bool(self.__format(song)): return True else: value = util.unescape... | def _matches(self, song): try: model, rows = self.get_selection().get_selected_rows() except (AttributeError, TypeError): return False else: if not rows or model[rows[0]][1] is None: return True else: for row in rows: if model[row][0][:1] == "<": if not bool(self.__format(song)): return True else: value = util.unescape... | 458,937 |
def _add(self, songs): self.inhibit() model = self.get_model() values = {} new = {} for row in model: value = row[0] data = row[1] if value[:1] != "<": value = util.unescape(value).decode('utf-8') values[value] = data elif data is not None: values[""] = data | def _add(self, songs): self.inhibit() model = self.get_model() values = {} new = {} for row in model: value = row[0] data = row[1] if value[:1] != "<": value = util.unescape(value).decode('utf-8') values[value] = data elif data is not None: values[""] = data | 458,938 |
def fill(self, songs): restore = self.__restore_values selected = (restore and restore.pop(0)) or self.get_selected() model = self.get_model() if len(model) == len(selected): selected = None self.inhibit() model.clear() self._add(songs) self.uninhibit() if selected: self.set_selected(selected, jump=True) else: self.set... | def fill(self, songs): restore = self.__restore_values selected = (restore and restore.pop(0)) or self.get_selected() model = self.__model if len(model) == len(selected): selected = None self.inhibit() model.clear() self._add(songs) self.uninhibit() if selected: self.set_selected(selected, jump=True) else: self.set_se... | 458,939 |
def fill(self, songs): restore = self.__restore_values selected = (restore and restore.pop(0)) or self.get_selected() model = self.get_model() if len(model) == len(selected): selected = None self.inhibit() model.clear() self._add(songs) self.uninhibit() if selected: self.set_selected(selected, jump=True) else: self.set... | def fill(self, songs): restore = self.__restore_values selected = (restore and restore.pop(0)) or self.get_selected() model = self.get_model() if len(model) == len(selected): selected = None self.inhibit() model.clear() self._add(songs) self.uninhibit() if selected: self.set_selected(selected, jump=True) else: self.set... | 458,940 |
def scroll(self, song): values = map(util.escape, self.__format(song)) for row in self.get_model(): if row[0] in values: self.scroll_to_cell( row.path[0], use_align=True, row_align=0.5) sel = self.get_selection() sel.unselect_all() sel.select_path(row.path[0]) break | def scroll(self, song): values = self.__get_format_keys(song) for row in self.__model: if row[0] != ALL and row[1].key in values: self.scroll_to_cell( row.path[0], use_align=True, row_align=0.5) sel = self.get_selection() sel.unselect_all() sel.select_path(row.path[0]) break | 458,941 |
def get_selected(self): try: model, rows = self.get_selection().get_selected_rows() except AttributeError: return [] else: return [model[row][0] for row in rows] | def get_selected(self): try: model, paths = self.get_selection().get_selected_rows() except AttributeError: return [] else: return [model[row][0] for row in rows] | 458,942 |
def get_selected(self): try: model, rows = self.get_selection().get_selected_rows() except AttributeError: return [] else: return [model[row][0] for row in rows] | def get_selected(self): try: model, rows = self.get_selection().get_selected_rows() except AttributeError: return [] else: return [model[row][0] for row in rows] | 458,943 |
def set_selected(self, values, jump=False): model = self.get_model() selection = self.get_selection() if values == self.get_selected(): model, rows = selection.get_selected_rows() for row in rows: self.scroll_to_cell(row) break return elif values is None and selection.path_is_selected((0,)): return | def set_selected(self, values, jump=False): model = self.__model if not len(model): return selection = self.get_selection() if values == self.get_selected(): model, rows = selection.get_selected_rows() for row in rows: self.scroll_to_cell(row) break return elif values is None and selection.path_is_selected((0,)): ret... | 458,944 |
def set_selected(self, values, jump=False): model = self.get_model() selection = self.get_selection() if values == self.get_selected(): model, rows = selection.get_selected_rows() for row in rows: self.scroll_to_cell(row) break return elif values is None and selection.path_is_selected((0,)): return | def set_selected(self, values, jump=False): model = self.get_model() selection = self.get_selection() if values is None and selection.path_is_selected((0,)): self.scroll_to_cell((0,)) return elif values == self.get_selected(): model, paths = selection.get_selected_rows() for path in paths: self.scroll_to_cell(path) br... | 458,945 |
def set_selected(self, values, jump=False): model = self.get_model() selection = self.get_selection() if values == self.get_selected(): model, rows = selection.get_selected_rows() for row in rows: self.scroll_to_cell(row) break return elif values is None and selection.path_is_selected((0,)): return | def set_selected(self, values, jump=False): model = self.get_model() selection = self.get_selection() if values == self.get_selected(): model, rows = selection.get_selected_rows() for row in rows: self.scroll_to_cell(row) break return elif values is None and selection.path_is_selected((0,)): return | 458,946 |
def set_selected(self, values, jump=False): model = self.get_model() selection = self.get_selection() if values == self.get_selected(): model, rows = selection.get_selected_rows() for row in rows: self.scroll_to_cell(row) break return elif values is None and selection.path_is_selected((0,)): return | def set_selected(self, values, jump=False): model = self.get_model() selection = self.get_selection() if values == self.get_selected(): model, rows = selection.get_selected_rows() for row in rows: self.scroll_to_cell(row) break return elif values is None and selection.path_is_selected((0,)): return | 458,947 |
def set_selected_by_tag(self, tag, values, jump=False): model = self.get_model() pattern_values = [] values = set(values) for row in model: if row[1]: song = iter(row[1]).next() if set(song.list(tag)) & values: pattern_values.append(row[0]) self.set_selected(pattern_values, jump) | def set_selected_by_tag(self, tag, values, jump=False): """Select the entries which songs all have one of the values.""" if len(self.tags) == 1 and tag in self.tags: self.set_selected(values, jump) return pattern_values = [] values = set(values) for row in model: if row[1]: song = iter(row[1]).next() if set(song.list... | 458,948 |
def set_selected_by_tag(self, tag, values, jump=False): model = self.get_model() pattern_values = [] values = set(values) for row in model: if row[1]: song = iter(row[1]).next() if set(song.list(tag)) & values: pattern_values.append(row[0]) self.set_selected(pattern_values, jump) | def set_selected_by_tag(self, tag, values, jump=False): model = self.get_model() pattern_values = [] for type, data in self.__model: if type == SONGS: for value in values: if data.all_have(tag, value): pattern_values.append(data.key) break if "" in values: pattern_values.append("") self.set_selected(pattern_values, ju... | 458,949 |
def __get_songs(self): model, rows = self.get_selection().get_selected_rows() s = set() if rows and rows[0] == (0,): for row in model: if row[1]: s.update(row[1]) else: for row in rows: s.update(model[row][1]) return s | def __get_selected_songs(self, sort=False): model, rows = self.get_selection().get_selected_rows() s = set() if rows and rows[0] == (0,): for row in model: if row[1]: s.update(row[1]) else: for row in rows: s.update(model[row][1]) return s | 458,950 |
def __get_songs(self): model, rows = self.get_selection().get_selected_rows() s = set() if rows and rows[0] == (0,): for row in model: if row[1]: s.update(row[1]) else: for row in rows: s.update(model[row][1]) return s | def __get_songs(self): model, rows = self.get_selection().get_selected_rows() s = set() if not rows: return s if model[rows[0]][0] == ALL: for row in model: if row[1]: s.update(row[1]) else: for row in rows: s.update(model[row][1]) return s | 458,951 |
def __get_songs(self): model, rows = self.get_selection().get_selected_rows() s = set() if rows and rows[0] == (0,): for row in model: if row[1]: s.update(row[1]) else: for row in rows: s.update(model[row][1]) return s | def __get_songs(self): model, rows = self.get_selection().get_selected_rows() s = set() if rows and rows[0] == (0,): for row in model: if row[0] != ALL: s |= row[1].songs else: for row in rows: s.update(model[row][1]) return s | 458,952 |
def __get_songs(self): model, rows = self.get_selection().get_selected_rows() s = set() if rows and rows[0] == (0,): for row in model: if row[1]: s.update(row[1]) else: for row in rows: s.update(model[row][1]) return s | def __get_songs(self): model, rows = self.get_selection().get_selected_rows() s = set() if rows and rows[0] == (0,): for row in model: if row[1]: s.update(row[1]) else: for row in rows: s |= model[row][1].songs if sort: return sorted(s, key=operator.attrgetter("sort_key")) return s | 458,953 |
def __init__(self, library, player): super(PanedBrowser, self).__init__(library, player, limit=False) | def __init__(self, library, player): super(PanedBrowser, self).__init__(library, player, limit=False) | 458,954 |
def can_filter(self, key): for pane in self.__panes: if (key in pane.tags or (key in PEOPLE and "~people" in pane.tags)): return True else: return False | def __get_filter_pane(self, key): """Get the best pane for filtering etc.""" canditates = [] for pane in self.__panes: if (key in pane.tags or (key in PEOPLE and "~people" in pane.tags)): return True else: return False | 458,955 |
def can_filter(self, key): for pane in self.__panes: if (key in pane.tags or (key in PEOPLE and "~people" in pane.tags)): return True else: return False | def can_filter(self, key): for pane in self.__panes: if (key in pane.tags or (key in PEOPLE and "~people" in pane.tags)): return True else: return False | 458,956 |
def filter(self, key, values): self.__panes[-1].inhibit() for pane in self.__panes: if (key in pane.tags or (key in PEOPLE and "~people" in pane.tags)): pane.set_selected_by_tag(key, values, True) else: pane.set_selected(None, True) self.__panes[-1].uninhibit() self.__panes[-1].get_selection().emit('changed') | def filter(self, key, values): self.__panes[-1].inhibit() for pane in self.__panes: if (key in pane.tags or (key in PEOPLE and "~people" in pane.tags)): pane.set_selected_by_tag(key, values, True) else: pane.set_selected(None, True) self.__panes[-1].uninhibit() self.__panes[-1].get_selection().emit('changed') | 458,957 |
def list(self, key): for pane in self.__panes: if (key in pane.tags or (key in PEOPLE and "~people" in pane.tags)): return [util.unescape(row[0]) for row in pane.get_model() if row[0] and not row[0].startswith("<")] else: return [] | def list(self, key): for pane in self.__panes: if (key in pane.tags or (key in PEOPLE and "~people" in pane.tags)): return [util.unescape(row[0]) for row in pane.get_model() if row[0] and not row[0].startswith("<")] else: return [] | 458,958 |
def save(self): super(PanedBrowser, self).save() selected = [] for pane in self.__panes: selected.append("\t".join(pane.get_selected())) config.set("browsers", "pane_selection", "\n".join(selected)) | def save(self): super(PanedBrowser, self).save() selected = [] for pane in self.__panes: values = pane.get_selected() all = None in values if all: values.remove(None) all = str(int(bool(all))) values.insert(0, all) selected.append("\t".join(values)) config.set("browsers", "pane_selection", "\n".join(selected)) | 458,959 |
def restore(self): super(PanedBrowser, self).restore() selected = config.get("browsers", "pane_selection").split("\n") PanedBrowser.Pane.set_restore([sel.split("\t") for sel in selected]) | def restore(self): super(PanedBrowser, self).restore() selected = config.get("browsers", "pane_selection").split("\n") PanedBrowser.Pane.set_restore([sel.split("\t") for sel in selected]) | 458,960 |
def __build_dev(self, path): """Return the right device instance by determining the supported AccessProtocol""" prop_if = self.__get_dev_prop_interface(path) prop_get = self.__get_dev_property | def __build_dev(self, path): """Return the right device instance by determining the supported AccessProtocol""" prop_if = self.__get_dev_prop_interface(path) prop_get = self.__get_dev_property | 458,961 |
def _set_paused(self, paused): if paused != self._paused: self._paused = paused if self.song: if not self.bin: if self.__init_pipeline(): self.bin.set_property('uri', self.song("~uri")) else: # Backend error; show message and halt playback ErrorMessage(None, _("Output Error"), _("GStreamer output pipeline could not be ... | def _set_paused(self, paused): if paused != self._paused: self._paused = paused if self.song: if not self.bin: if self.__init_pipeline(): self.bin.set_property('uri', self.song("~uri")) else: # Backend error; show message and halt playback ErrorMessage(None, _("Output Error"), _("GStreamer output pipeline could not be ... | 458,962 |
def __init__(self): try: self._times = config.get("plugins", self._pref_name).split()[:7] except: pass else: self._times = (self._times + ["HH:MM"] * 7)[:7] gobject.timeout_add(30000, self._check) | def __init__(self): try: self._times = config.get("plugins", self._pref_name).split(' ')[:7] except: pass else: self._times = (self._times + ["HH:MM"] * 7)[:7] gobject.timeout_add(30000, self._check) | 458,963 |
def get_artist(album): """Returns a single artist likely to be the MB AlbumArtist, or None.""" for tag in ["albumartist", "artist", "performer"]: names = set() for song in album: map(names.add, filter(lambda n: n, song.get(tag, "").split("\n"))) if len(names) == 1: return names.pop() elif len(names) > 1: return None re... | def get_artist(album): """Returns a single artist likely to be the MB AlbumArtist, or None.""" for tag in ["albumartist", "artist", "performer"]: names = set() for song in album: map(names.add, filter(lambda n: n, song.get(tag, "").split("\n"))) if len(names) == 1: return names.pop() elif len(names) > 1: return None re... | 458,964 |
def __init__(self, album, cache): self.album = album | def __init__(self, album, cache): self.album = album | 458,965 |
def coleman_integrals_on_basis(self, P, Q, algorithm=None): """ | def coleman_integrals_on_basis(self, P, Q, algorithm=None): """ | 458,966 |
def coleman_integrals_on_basis(self, P, Q, algorithm=None): """ | def coleman_integrals_on_basis(self, P, Q, algorithm=None): """ | 458,967 |
def coleman_integrals_on_basis(self, P, Q, algorithm=None): """ | def coleman_integrals_on_basis(self, P, Q, algorithm=None): """ | 458,968 |
def coleman_integrals_on_basis(self, P, Q, algorithm=None): """ | def coleman_integrals_on_basis(self, P, Q, algorithm=None): """ | 458,969 |
def coleman_integrals_on_basis(self, P, Q, algorithm=None): """ | def coleman_integrals_on_basis(self, P, Q, algorithm=None): """ | 458,970 |
def coleman_integrals_on_basis(self, P, Q, algorithm=None): """ | defcoleman_integrals_on_basis(self,P,Q,algorithm=None):""" | 458,971 |
def coleman_integrals_on_basis(self, P, Q, algorithm=None): """ | defcoleman_integrals_on_basis(self,P,Q,algorithm=None):""" | 458,972 |
def coleman_integrals_on_basis(self, P, Q, algorithm=None): """ | defcoleman_integrals_on_basis(self,P,Q,algorithm=None):""" | 458,973 |
def coleman_integrals_on_basis(self, P, Q, algorithm=None): """ | def coleman_integrals_on_basis(self, P, Q, algorithm=None): """ | 458,974 |
def coleman_integrals_on_basis(self, P, Q, algorithm=None): """ | defcoleman_integrals_on_basis(self,P,Q,algorithm=None):""" | 458,975 |
def coleman_integrals_on_basis(self, P, Q, algorithm=None): """ | defcoleman_integrals_on_basis(self,P,Q,algorithm=None):""" | 458,976 |
def coleman_integral(self, w, P, Q, algorithm = 'None'): """ INPUT: - w differential (if one of P,Q is Weierstrass, w must be odd) - P point on self - Q point on self - algorithm (optional) = None (uses Frobenius) or teichmuller (uses Teichmuller points) | def coleman_integral(self, w, P, Q, algorithm = 'None'): """ INPUT: - w differential (if one of P,Q is Weierstrass, w must be odd) - P point on self - Q point on self - algorithm (optional) = None (uses Frobenius) or teichmuller (uses Teichmuller points) | 458,977 |
def coleman_integral(self, w, P, Q, algorithm = 'None'): """ INPUT: - w differential (if one of P,Q is Weierstrass, w must be odd) - P point on self - Q point on self - algorithm (optional) = None (uses Frobenius) or teichmuller (uses Teichmuller points) | def coleman_integral(self, w, P, Q, algorithm = 'None'): """ INPUT: - w differential (if one of P,Q is Weierstrass, w must be odd) - P point on self - Q point on self - algorithm (optional) = None (uses Frobenius) or teichmuller (uses Teichmuller points) | 458,978 |
def coleman_integral(self, w, P, Q, algorithm = 'None'): """ INPUT: - w differential (if one of P,Q is Weierstrass, w must be odd) - P point on self - Q point on self - algorithm (optional) = None (uses Frobenius) or teichmuller (uses Teichmuller points) | def coleman_integral(self, w, P, Q, algorithm = 'None'): """ INPUT: - w differential (if one of P,Q is Weierstrass, w must be odd) - P point on self - Q point on self - algorithm (optional) = None (uses Frobenius) or teichmuller (uses Teichmuller points) | 458,979 |
def coleman_integral(self, w, P, Q, algorithm = 'None'): """ INPUT: - w differential (if one of P,Q is Weierstrass, w must be odd) - P point on self - Q point on self - algorithm (optional) = None (uses Frobenius) or teichmuller (uses Teichmuller points) | def coleman_integral(self, w, P, Q, algorithm = 'None'): """ INPUT: - w differential (if one of P,Q is Weierstrass, w must be odd) - P point on self - Q point on self - algorithm (optional) = None (uses Frobenius) or teichmuller (uses Teichmuller points) | 458,980 |
def curve_over_ram_extn(self,deg): """ self over Qp(p^(1/deg)) INPUT: - deg: the degree of the ramified extension OUTPUT: self over Qp(p^(1/deg)) | def curve_over_ram_extn(self,deg): """ self over Qp(p^(1/deg)) INPUT: - deg: the degree of the ramified extension OUTPUT: self over Qp(p^(1/deg)) | 458,981 |
def univariate_polynomial(self, R=None): """ Returns a univariate polynomial associated to this multivariate polynomial. INPUT: - ``R`` - (default: None) PolynomialRing If this polynomial is not in at most one variable, then a ValueError exception is raised. This is checked using the is_univariate() method. The n... | def univariate_polynomial(self, R=None): """ Returns a univariate polynomial associated to this multivariate polynomial. INPUT: - ``R`` - (default: None) PolynomialRing If this polynomial is not in at most one variable, then a ValueError exception is raised. This is checked using the is_univariate() method. The n... | 458,982 |
def eval(self, command, **kwds): """ Evaluates commands. | def eval(self, command, *args, **kwds): """ Evaluates commands. | 458,983 |
def version(self): """ Returns the version of the Scilab software used. | def version(self): """ Returns the version of the Scilab software used. | 458,984 |
def regulator_of_points(self, points=[], precision=None): """ Returns the regulator of the given points on this curve. INPUT: - ``points`` -(default: empty list) a list of points on this curve - ``precision`` - int or None (default: None): the precision in bits of the result (default real precision if None) EXAMPL... | def regulator_of_points(self, points=[], precision=None): """ Returns the regulator of the given points on this curve. INPUT: - ``points`` -(default: empty list) a list of points on this curve - ``precision`` - int or None (default: None): the precision in bits of the result (default real precision if None) EXAMPL... | 458,985 |
def log(x, base=None): """ Return the logarithm of x to the given base. Calls the ``log`` method of the object x when computing the logarithm, thus allowing use of logarithm on any object containing a ``log`` method. In other words, log works on more than just real numbers. EXAMPLES:: sage: log(e^2) 2 sage: log(1024... | def log(x, base=None): """ Return the logarithm of x to the given base. Calls the ``log`` method of the object x when computing the logarithm, thus allowing use of logarithm on any object containing a ``log`` method. In other words, log works on more than just real numbers. EXAMPLES:: sage: log(e^2) 2 sage: log(1024... | 458,986 |
def log(x, base=None): """ Return the logarithm of x to the given base. Calls the ``log`` method of the object x when computing the logarithm, thus allowing use of logarithm on any object containing a ``log`` method. In other words, log works on more than just real numbers. EXAMPLES:: sage: log(e^2) 2 sage: log(1024... | def log(x, base=None): """ Return the logarithm of x to the given base. Calls the ``log`` method of the object x when computing the logarithm, thus allowing use of logarithm on any object containing a ``log`` method. In other words, log works on more than just real numbers. EXAMPLES:: sage: log(e^2) 2 sage: log(1024... | 458,987 |
def crt(a,b,m=None,n=None): r""" Returns a solution to a Chinese Remainder Theorem problem. INPUT: - ``a``, ``b`` - two residues (elements of some ring for which extended gcd is available), or two lists, one of residues and one of moduli. - ``m``, ``n`` - two moduli, or None. OUTPUT: If ``m``, ``n`` are not None, ... | def crt(a,b,m=None,n=None): r""" Returns a solution to a Chinese Remainder Theorem problem. INPUT: - ``a``, ``b`` - two residues (elements of some ring for which extended gcd is available), or two lists, one of residues and one of moduli. - ``m``, ``n`` - (default: ``None``) two moduli, or ``None``. OUTPUT: If ``m... | 458,988 |
def crt(a,b,m=None,n=None): r""" Returns a solution to a Chinese Remainder Theorem problem. INPUT: - ``a``, ``b`` - two residues (elements of some ring for which extended gcd is available), or two lists, one of residues and one of moduli. - ``m``, ``n`` - two moduli, or None. OUTPUT: If ``m``, ``n`` are not None, ... | def crt(a,b,m=None,n=None): r""" Returns a solution to a Chinese Remainder Theorem problem. INPUT: - ``a``, ``b`` - two residues (elements of some ring for which extended gcd is available), or two lists, one of residues and one of moduli. - ``m``, ``n`` - two moduli, or None. OUTPUT: If ``m``, ``n`` are not ``None... | 458,989 |
def crt(a,b,m=None,n=None): r""" Returns a solution to a Chinese Remainder Theorem problem. INPUT: - ``a``, ``b`` - two residues (elements of some ring for which extended gcd is available), or two lists, one of residues and one of moduli. - ``m``, ``n`` - two moduli, or None. OUTPUT: If ``m``, ``n`` are not None, ... | def crt(a,b,m=None,n=None): r""" Returns a solution to a Chinese Remainder Theorem problem. INPUT: - ``a``, ``b`` - two residues (elements of some ring for which extended gcd is available), or two lists, one of residues and one of moduli. - ``m``, ``n`` - two moduli, or None. OUTPUT: If ``m``, ``n`` are not None, ... | 458,990 |
def crt(a,b,m=None,n=None): r""" Returns a solution to a Chinese Remainder Theorem problem. INPUT: - ``a``, ``b`` - two residues (elements of some ring for which extended gcd is available), or two lists, one of residues and one of moduli. - ``m``, ``n`` - two moduli, or None. OUTPUT: If ``m``, ``n`` are not None, ... | def crt(a,b,m=None,n=None): r""" Returns a solution to a Chinese Remainder Theorem problem. INPUT: - ``a``, ``b`` - two residues (elements of some ring for which extended gcd is available), or two lists, one of residues and one of moduli. - ``m``, ``n`` - two moduli, or None. OUTPUT: If ``m``, ``n`` are not None, ... | 458,991 |
def crt(a,b,m=None,n=None): r""" Returns a solution to a Chinese Remainder Theorem problem. INPUT: - ``a``, ``b`` - two residues (elements of some ring for which extended gcd is available), or two lists, one of residues and one of moduli. - ``m``, ``n`` - two moduli, or None. OUTPUT: If ``m``, ``n`` are not None, ... | def crt(a,b,m=None,n=None): r""" Returns a solution to a Chinese Remainder Theorem problem. INPUT: - ``a``, ``b`` - two residues (elements of some ring for which extended gcd is available), or two lists, one of residues and one of moduli. - ``m``, ``n`` - two moduli, or None. OUTPUT: If ``m``, ``n`` are not None, ... | 458,992 |
def crt(a,b,m=None,n=None): r""" Returns a solution to a Chinese Remainder Theorem problem. INPUT: - ``a``, ``b`` - two residues (elements of some ring for which extended gcd is available), or two lists, one of residues and one of moduli. - ``m``, ``n`` - two moduli, or None. OUTPUT: If ``m``, ``n`` are not None, ... | def crt(a,b,m=None,n=None): r""" Returns a solution to a Chinese Remainder Theorem problem. INPUT: - ``a``, ``b`` - two residues (elements of some ring for which extended gcd is available), or two lists, one of residues and one of moduli. - ``m``, ``n`` - two moduli, or None. OUTPUT: If ``m``, ``n`` are not None, ... | 458,993 |
def valuation(m, p): """ The exact power of p that divides m. m should be an integer or rational (but maybe other types work too.) This actually just calls the m.valuation() method. If m is 0, this function returns rings.infinity. EXAMPLES:: sage: valuation(512,2) 9 sage: valuation(1,2) 0 sage: valuation(5/9, 3) -... | def valuation(m,*args1, **args2): """ This actually just calls the m.valuation() method. See the documentation of m.valuation() for a more precise description. Use of this function by developers is discouraged. Use m.valuation() instead. .. NOTE:: This is not always a valuation in the mathematical sense. For more inf... | 458,994 |
def valuation(m, p): """ The exact power of p that divides m. m should be an integer or rational (but maybe other types work too.) This actually just calls the m.valuation() method. If m is 0, this function returns rings.infinity. EXAMPLES:: sage: valuation(512,2) 9 sage: valuation(1,2) 0 sage: valuation(5/9, 3) -... | def valuation(m, p): """ The exact power of p that divides m. m should be an integer or rational (but maybe other types work too.) This actually just calls the m.valuation() method. If m is 0, this function returns rings.infinity. EXAMPLES:: sage: valuation(512,2) 9 sage: valuation(1,2) 0 sage: valuation(5/9, 3) -... | 458,995 |
def univariate_polynomial(self, R=None): """ Returns a univariate polynomial associated to this multivariate polynomial. INPUT: - ``R`` - (default: None) PolynomialRing If this polynomial is not in at most one variable, then a ValueError exception is raised. This is checked using the is_univariate() method. The n... | def univariate_polynomial(self, R=None): """ Returns a univariate polynomial associated to this multivariate polynomial. INPUT: - ``R`` - (default: None) PolynomialRing If this polynomial is not in at most one variable, then a ValueError exception is raised. This is checked using the is_univariate() method. The n... | 458,996 |
def __cmp__(self, right): r""" Compare ``self`` and ``right``. | def __cmp__(self, right): r""" Compare ``self`` and ``right``. | 458,997 |
def factorial(n, algorithm='gmp'): r""" Compute the factorial of `n`, which is the product `1\cdot 2\cdot 3 \cdots (n-1)\cdot n`. INPUT: - ``n`` - an integer - ``algorithm`` - string (default: 'gmp') - ``'gmp'`` - use the GMP C-library factorial function - ``'pari'`` - use PARI's factorial function OUTPUT: an... | def factorial(n, algorithm='gmp'): r""" Compute the factorial of `n`, which is the product `1\cdot 2\cdot 3 \cdots (n-1)\cdot n`. INPUT: - ``n`` - an integer - ``algorithm`` - string (default: 'gmp'): - ``'gmp'`` - use the GMP C-library factorial function - ``'pari'`` - use PARI's factorial function OUTPUT: a... | 458,998 |
def factorial(n, algorithm='gmp'): r""" Compute the factorial of `n`, which is the product `1\cdot 2\cdot 3 \cdots (n-1)\cdot n`. INPUT: - ``n`` - an integer - ``algorithm`` - string (default: 'gmp') - ``'gmp'`` - use the GMP C-library factorial function - ``'pari'`` - use PARI's factorial function OUTPUT: an... | def factorial(n, algorithm='gmp'): r""" Compute the factorial of `n`, which is the product `1\cdot 2\cdot 3 \cdots (n-1)\cdot n`. INPUT: - ``n`` - an integer - ``algorithm`` - string (default: 'gmp') - ``'gmp'`` - use the GMP C-library factorial function - ``'pari'`` - use PARI's factorial function OUTPUT: an... | 458,999 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.