function
stringlengths
11
56k
repo_name
stringlengths
5
60
features
list
def estimStereoSIMMParams(self): self.computeStereoX() SXR = np.abs(self.XR) ** 2 SXL = np.abs(self.XL) ** 2 alphaR, alphaL, HGAMMA, HPHI, HF0, \ betaR, betaL, HM, WM, recoError2 = SIMM.Stereo_SIMM( # the data to be fitted to: SXR, SXL, # t...
wslihgt/pyfasst
[ 87, 21, 87, 6, 1375254776 ]
def estimStereoSUIMMParams(self):
wslihgt/pyfasst
[ 87, 21, 87, 6, 1375254776 ]
def writeSeparatedSignals(self, suffix='.wav'): """Writes the separated signals to the files in self.files. If suffix contains 'VUIMM', then this method will take the WF0 and HF0 that contain the estimated unvoiced elements. """ if 'VUIMM' in suffix: WF0 = self.SIM...
wslihgt/pyfasst
[ 87, 21, 87, 6, 1375254776 ]
def writeSeparatedSignalsWithUnvoice(self): """A wrapper to give a decent name to the function: simply calling self.writeSeparatedSignals with the '_VUIMM.wav' suffix. """ self.writeSeparatedSignals(suffix='_VUIMM.wav')
wslihgt/pyfasst
[ 87, 21, 87, 6, 1375254776 ]
def checkChunkSize(self, maxFrames): """Computes the number of chunks of size maxFrames, and changes maxFrames in case it does not provide long enough chunks (especially the last chunk). """ totFrames = np.int32(self.computeNFrames()) nChunks = totFrames / maxFrames + 1 ...
wslihgt/pyfasst
[ 87, 21, 87, 6, 1375254776 ]
def __init__(self, name, identifier, anchor_token, token_to_move, between_tokens): structure.Rule.__init__(self, name, identifier) self.subphase = 2 self.anchor_token = anchor_token self.token_to_move = token_to_move self.between_tokens = between_tokens
jeremiah-c-leary/vhdl-style-guide
[ 129, 31, 129, 57, 1499106283 ]
def _analyze(self, lToi): for oToi in lToi: lTokens = oToi.get_tokens() for iToken, oToken in enumerate(lTokens): if isinstance(oToken, self.anchor_token): iStartIndex = iToken if isinstance(oToken, self.token_to_move): ...
jeremiah-c-leary/vhdl-style-guide
[ 129, 31, 129, 57, 1499106283 ]
def __init__(self): self.word_to_cluster_dict = {} self.cluster_dict = {}
texta-tk/texta
[ 31, 7, 31, 2, 1459876722 ]
def cluster(self, embedding, n_clusters=None): vocab = list(embedding.wv.vocab.keys()) vocab_vectors = np.array([embedding[word] for word in vocab])
texta-tk/texta
[ 31, 7, 31, 2, 1459876722 ]
def query(self, word): try: return self.cluster_dict[self.word_to_cluster_dict[word]] except: return []
texta-tk/texta
[ 31, 7, 31, 2, 1459876722 ]
def text_to_clusters(self, text): text = [str(self.word_to_cluster_dict[word]) for word in text if word in self.word_to_cluster_dict] return ' '.join(text)
texta-tk/texta
[ 31, 7, 31, 2, 1459876722 ]
def test_intspansproduct_errors(): """Check instanciation errors of IntspansProduct.""" with pytest.raises(TypeError) as excinfo: IntspansProduct('4-9,10', 'a') assert str(excinfo.value) == 'elt_nb must be an int, found '\ '<class \'str\'> instead.' with pytest.raises(TypeError) as excin...
nicolashainaux/mathmaker
[ 4, 1, 4, 34, 1468416792 ]
def test_intspansproduct_group_by_packs(): r = IntspansProduct('1,2×1,2×3,4×5,6') assert r._group_by_packs(r.spans, '2_2') == \ [[[intspan('1-2'), intspan('1-2')], [intspan('3-4'), intspan('5-6')]], [[intspan('1-2'), intspan('3-4')], [intspan('1-2'), intspan('5-6')]], [[intspan('1-2'),...
nicolashainaux/mathmaker
[ 4, 1, 4, 34, 1468416792 ]
def test_intspansproduct_rebuild_spans_from_packs(): filtered_packs = [[intspan('1'), intspan('3')]] assert IntspansProduct._rebuild_spans_from_packs(filtered_packs, '3_2') \ == [[intspan('1'), intspan('1'), intspan('1'), intspan('3'), intspan('3')]] assert IntspansProduct._rebuild_span...
nicolashainaux/mathmaker
[ 4, 1, 4, 34, 1468416792 ]
def test_intspansproduct_random_draw_constructible(): r = IntspansProduct('3×4×6,7') d = r.random_draw(constructible=True) assert d == (3, 4, 6) d = r.random_draw(constructible=False) assert d == (3, 4, 7) r = IntspansProduct('3×4×7-10') with pytest.raises(RuntimeError) as excinfo: r...
nicolashainaux/mathmaker
[ 4, 1, 4, 34, 1468416792 ]
def test_parse_sql_creation_query(): """Check if parse_sql_creation_query parses correctly.""" assert parse_sql_creation_query('''CREATE TABLE w3l (id INTEGER PRIMARY KEY, language TEXT, word TEXT, drawDate INTEGER)''') == \ ('w3l', ['id', 'language', 'word', 'drawDate']) as...
nicolashainaux/mathmaker
[ 4, 1, 4, 34, 1468416792 ]
def _get_room_mapping(): return {(r.location.name, r.name): r for r in Room.query.options(lazyload(Room.owner), joinedload(Room.location))}
belokop/indico_bare
[ 1, 1, 1, 5, 1465204236 ]
def __init__(self, importer, old_event, event): self.importer = importer self.old_event = old_event self.event = event self.event_person_map = {} self.legacy_session_map = {} self.legacy_session_ids_used = set() self.legacy_contribution_map = {} self.legac...
belokop/indico_bare
[ 1, 1, 1, 5, 1465204236 ]
def run(self): self.importer.print_success('Importing {}'.format(self.old_event), event_id=self.event.id) self.event.references = list(self._process_references(EventReference, self.old_event)) self._migrate_event_persons() self._migrate_event_persons_links() self._migrate_contrib...
belokop/indico_bare
[ 1, 1, 1, 5, 1465204236 ]
def _process_principal(self, principal_cls, principals, legacy_principal, name, read_access=None, full_access=None, roles=None, allow_emails=True): if legacy_principal is None: return elif isinstance(legacy_principal, basestring): user = self.importer.a...
belokop/indico_bare
[ 1, 1, 1, 5, 1465204236 ]
def _process_ac(self, principal_cls, principals, ac, allow_emails=True): # read access for principal in ac.allowed: self._process_principal(principal_cls, principals, principal, 'Access', read_access=True, allow_emails=allow_emails) # email-based r...
belokop/indico_bare
[ 1, 1, 1, 5, 1465204236 ]
def _process_keywords(self, keywords): return map(convert_to_unicode, keywords.splitlines())
belokop/indico_bare
[ 1, 1, 1, 5, 1465204236 ]
def _get_person(self, old_person): email = getattr(old_person, '_email', None) or getattr(old_person, 'email', None) email = sanitize_email(convert_to_unicode(email).lower()) if email else email if not is_valid_mail(email, False): email = None return self.event_person_map.get...
belokop/indico_bare
[ 1, 1, 1, 5, 1465204236 ]
def _update_link_data(self, link, data_list): for attr in PERSON_INFO_MAP.itervalues(): value = most_common(data_list, key=itemgetter(attr)) if value and value != getattr(link, attr): setattr(link, attr, value)
belokop/indico_bare
[ 1, 1, 1, 5, 1465204236 ]
def _migrate_event_persons_links(self): person_link_map = {} for chair in getattr(self.old_event, '_chairs', []): person = self._get_person(chair) if not person: continue link = person_link_map.get(person) if link: self.impo...
belokop/indico_bare
[ 1, 1, 1, 5, 1465204236 ]
def _migrate_sessions(self): sessions = [] friendly_id_map = {} friendly_ids_used = set() skipped = [] for id_, session in sorted(self.old_event.sessions.items(), key=lambda x: (x[0].isdigit(), int(x[0]) if x[0].isdigit() else x[0])): ...
belokop/indico_bare
[ 1, 1, 1, 5, 1465204236 ]
def _migrate_contribution_fields(self): try: afm = self.old_event.abstractMgr._abstractFieldsMgr except AttributeError: return pos = 0 content_field = None for field in afm._fields: # it may happen that there is a second 'content' field (old v...
belokop/indico_bare
[ 1, 1, 1, 5, 1465204236 ]
def _migrate_contributions(self): contribs = [] friendly_id_map = {} friendly_ids_used = set() skipped = [] for id_, contrib in sorted(self.old_event.contributions.items(), key=lambda x: (not x[0].isdigit(), int(x[0]) if x[0].isdigit() else x[0]...
belokop/indico_bare
[ 1, 1, 1, 5, 1465204236 ]
def _migrate_contribution(self, old_contrib, friendly_id): ac = old_contrib._Contribution__ac description = old_contrib._fields.get('content', '') description = convert_to_unicode(getattr(description, 'value', description)) # str or AbstractFieldContent status = getattr(old_contrib, '_s...
belokop/indico_bare
[ 1, 1, 1, 5, 1465204236 ]
def _migrate_abstract_judgments(self, old_abstract): if not hasattr(old_abstract, '_trackJudgementsHistorical'): self.importer.print_warning( cformat('%{blue!}Abstract {} {yellow}had no judgment history!%{reset}').format(old_abstract._id), event_id=self.event.id) ...
belokop/indico_bare
[ 1, 1, 1, 5, 1465204236 ]
def _migrate_abstract_field_values(self, old_abstract): fields = dict(getattr(old_abstract, '_fields', {})) fields.pop('content', None) for field_id, field_content in fields.iteritems(): value = convert_to_unicode(getattr(field_content, 'value', field_content)) if not val...
belokop/indico_bare
[ 1, 1, 1, 5, 1465204236 ]
def _migrate_subcontribution(self, old_contrib, old_subcontrib, position): subcontrib = SubContribution(position=position, friendly_id=position, duration=old_subcontrib.duration, title=convert_to_unicode(old_subcontrib.title), description...
belokop/indico_bare
[ 1, 1, 1, 5, 1465204236 ]
def _migrate_subcontribution_person_links(self, old_entry): person_link_map = {} person_link_data_map = defaultdict(list) for speaker in getattr(old_entry, 'speakers', []): person = self._get_person(speaker) if not person: continue person_link_...
belokop/indico_bare
[ 1, 1, 1, 5, 1465204236 ]
def _migrate_timetable(self): if not self.importer.quiet: self.importer.print_info(cformat('%{green}Timetable...')) self._migrate_timetable_entries(self.old_event._Conference__schedule._entries)
belokop/indico_bare
[ 1, 1, 1, 5, 1465204236 ]
def _migrate_contribution_timetable_entry(self, old_entry, session_block=None): old_contrib = old_entry._LinkedTimeSchEntry__owner contrib = self.legacy_contribution_map[old_contrib] contrib.timetable_entry = TimetableEntry(event_new=self.event, start_dt=old_contrib.startDate) self._migr...
belokop/indico_bare
[ 1, 1, 1, 5, 1465204236 ]
def _migrate_block_timetable_entry(self, old_entry): old_block = old_entry._LinkedTimeSchEntry__owner try: session = self.legacy_session_map[old_block.session] except KeyError: self.importer.print_warning(cformat('%{yellow!}Found zombie session {}').format(old_block.sessi...
belokop/indico_bare
[ 1, 1, 1, 5, 1465204236 ]
def _get_parent_location(self, obj, attr): type_ = obj.__class__.__name__ if type_ == 'SessionSlot': conf = obj.session.conference return getattr(conf, attr)[0] if getattr(conf, attr, None) else None elif type_ in ('BreakTimeSchEntry', 'Contribution', 'AcceptedContributio...
belokop/indico_bare
[ 1, 1, 1, 5, 1465204236 ]
def __init__(self, **kwargs): self.default_group_provider = kwargs.pop('default_group_provider') self.parallel = kwargs.pop('parallel') self.reference_types = kwargs.pop('reference_types') super(EventTimetableImporter, self).__init__(**kwargs) self.reference_type_map = {}
belokop/indico_bare
[ 1, 1, 1, 5, 1465204236 ]
def decorate_command(command): def _process_parallel(ctx, param, value): if value is None: return None n, i = map(int, value.split(':', 1)) if n <= 1: raise click.BadParameter('N must be >1') if i not in range(n): ra...
belokop/indico_bare
[ 1, 1, 1, 5, 1465204236 ]
def _load_data(self): self.print_step("Loading some data") self.room_mapping = _get_room_mapping() self.venue_mapping = {location.name: location for location in Location.query} self.all_users_by_email = {} for user in User.query.options(joinedload('_all_emails')): if ...
belokop/indico_bare
[ 1, 1, 1, 5, 1465204236 ]
def migrate_reference_types(self): if self.parallel and self.parallel[1]: self.print_step("Loading reference types") self.reference_type_map = {r.name: r for r in ReferenceType.query} return self.print_step("Migrating reference types") for name in self.referen...
belokop/indico_bare
[ 1, 1, 1, 5, 1465204236 ]
def _iter_events(self): it = self.zodb_root['conferences'].itervalues() total = len(self.zodb_root['conferences']) all_events_query = Event.find(is_deleted=False).options(undefer('_last_friendly_contribution_id'), undefer('_last_fri...
belokop/indico_bare
[ 1, 1, 1, 5, 1465204236 ]
def save_teletries_to_files(telems: List[Dict]): for telem in tqdm(telems, desc="Telemetries saved to files", position=3): SampleFileParser.save_telemetry_to_file(telem)
guardicore/monkey
[ 6098, 725, 6098, 196, 1440919371 ]
def save_telemetry_to_file(telem: Dict): telem_filename = telem["name"] + telem["method"] for i in range(MAX_SAME_TYPE_TELEM_FILES): if not path.exists(path.join(TELEM_DIR_PATH, (str(i) + telem_filename))): telem_filename = str(i) + telem_filename break ...
guardicore/monkey
[ 6098, 725, 6098, 196, 1440919371 ]
def read_telem_files() -> List[str]: telems = [] try: file_paths = [ path.join(TELEM_DIR_PATH, f) for f in listdir(TELEM_DIR_PATH) if path.isfile(path.join(TELEM_DIR_PATH, f)) ] except FileNotFoundError: raise Fi...
guardicore/monkey
[ 6098, 725, 6098, 196, 1440919371 ]
def n_squares(n): return [i**2 for i in range(2, n)]
kylebegovich/ProjectEuler
[ 1, 1, 1, 4, 1490033748 ]
def multiSlice(s,cutpoints): k = len(cutpoints) if k == 0: return [s] else: multislices = [s[:cutpoints[0]]] multislices.extend(s[cutpoints[i]:cutpoints[i+1]] for i in range(k-1)) multislices.append(s[cutpoints[k-1]:]) return multislices
kylebegovich/ProjectEuler
[ 1, 1, 1, 4, 1490033748 ]
def list_sum(num_list): outer_sum = 0 for sub_list in num_list: inner_sum = 0 power = 1 for digit in sub_list[::-1]: inner_sum += power * digit power *= 10 outer_sum += inner_sum return outer_sum
kylebegovich/ProjectEuler
[ 1, 1, 1, 4, 1490033748 ]
def is_s_num(num): sqrt = num**0.5 for part in allPartitions([int(i) for i in str(num)]): if sqrt == list_sum(part): return True return False
kylebegovich/ProjectEuler
[ 1, 1, 1, 4, 1490033748 ]
def T(N): squares = n_squares(N) sum = 0 for n in squares: if is_s_num(n): print(n, "is true") sum += n return sum
kylebegovich/ProjectEuler
[ 1, 1, 1, 4, 1490033748 ]
def __init__(self, mainWindows): QWidget.__init__(self) uic.loadUi(directory + "/../ui/stats_tipster.ui", self) gettext.textdomain("betcon") gettext.bindtextdomain("betcon", "../lang/mo" + mainWindows.lang) gettext.bindtextdomain("betcon", "/usr/share/locale" + mainWindows.lang) ...
soker90/betcon
[ 7, 2, 7, 2, 1499643026 ]
def initData(self): self.years, self.months = LibStats.getYears() self.cmbYear.addItems(self.years.keys()) firstKey = next(iter(self.years)) self.cmbMonth.addItems(self.getMonths(firstKey)) data = LibStats.getTipster() items = [] for i in data: item...
soker90/betcon
[ 7, 2, 7, 2, 1499643026 ]
def updateTree(self): year = self.cmbYear.currentText() sMonth = self.cmbMonth.currentText() month = key_from_value(self.months, sMonth) data = LibStats.getTipster(year, month) self.treeMonth.clear() items = [] for i in data: item = QTreeWidgetItem(i...
soker90/betcon
[ 7, 2, 7, 2, 1499643026 ]
def __init__(self, name=None, **kwargs): self.name = name
ValyrianTech/BitcoinSpellbook-v0.3
[ 16, 2, 16, 2, 1503599758 ]
def genome_template(self): pass
ValyrianTech/BitcoinSpellbook-v0.3
[ 16, 2, 16, 2, 1503599758 ]
def model_to_genome(self, model): pass
ValyrianTech/BitcoinSpellbook-v0.3
[ 16, 2, 16, 2, 1503599758 ]
def convert_text(node, context): context["top"].append(node.astext())
uliss/quneiform
[ 10, 2, 10, 6, 1306885353 ]
def convert_title(node, context): level = context["heading-level"] if level == 0: # The document did not start with a section level = 1 heading = odf_create_heading(level, node.astext(), style='Heading_20_%s' % level) context["body"].append(heading)
uliss/quneiform
[ 10, 2, 10, 6, 1306885353 ]
def convert_list(node, context, list_type): # Reuse template styles if list_type == "enumerated": style_name = "Numbering_20_1" else: style_name = "List_20_1" odf_list = odf_create_list(style=style_name) context["top"].append(odf_list) # Save the current top old_top = conte...
uliss/quneiform
[ 10, 2, 10, 6, 1306885353 ]
def convert_list_bullet(node, context): return convert_list(node, context, "bullet")
uliss/quneiform
[ 10, 2, 10, 6, 1306885353 ]
def convert_footnote(node, context): # XXX ids is a list ?? refid = node.get("ids")[0] # Find the footnote footnotes = context["footnotes"] if refid not in footnotes: printwarn('unknown footnote "%s"' % refid) return footnote_body = footnotes[refid].get_element("text:note-body")...
uliss/quneiform
[ 10, 2, 10, 6, 1306885353 ]
def _convert_style_like(node, context, style_name): # Create the span span = odf_create_span(style=style_name) context["top"].append(span) # Save the current top old_top = context["top"] # Convert context["top"] = span for child in node: convert_node(child, context) # And ...
uliss/quneiform
[ 10, 2, 10, 6, 1306885353 ]
def convert_emphasis(node, context): emphasis_style = _get_emphasis_style(context).get_style_name() # Convert _convert_style_like(node, context, emphasis_style)
uliss/quneiform
[ 10, 2, 10, 6, 1306885353 ]
def convert_strong(node, context): strong_style = _get_strong_style(context).get_style_name() # Convert _convert_style_like(node, context, strong_style)
uliss/quneiform
[ 10, 2, 10, 6, 1306885353 ]
def convert_literal_block(node, context): paragraph = odf_create_paragraph(style="Preformatted_20_Text") context["top"].append(paragraph) # Convert for child in node: # Only text if child.tagname != "#text": printwarn('node "%s" not supported in literal block' % ( ...
uliss/quneiform
[ 10, 2, 10, 6, 1306885353 ]
def _get_term_style(context): styles = context['styles'] term_style = styles.get('term') if term_style is not None: return term_style # Reuse template style if any doc = context['doc'] term_style = doc.get_style('paragraph', u"Definition_20_List_20_Term") if term_style is...
uliss/quneiform
[ 10, 2, 10, 6, 1306885353 ]
def convert_definition_list(node, context): """Convert a list of term/definition pairs to styled paragraphs. The "Definition List Term" style is looked for term paragraphs, and the "Definition List Definition" style is looked for definition paragraphs. """ styles = context['styles'] term_style ...
uliss/quneiform
[ 10, 2, 10, 6, 1306885353 ]
def _get_caption_style(context): styles = context['styles'] caption_style = styles.get('caption') if caption_style is not None: return caption_style caption_style = odf_create_style('graphic', parent=u"Frame", **{'style:wrap': u"none", 'style:vertical-pos': u"top", 's...
uliss/quneiform
[ 10, 2, 10, 6, 1306885353 ]
def _add_image(image, caption, context, width=None, height=None): # Load the image to find its size encoding = stdout.encoding if stdout.encoding is not None else "utf-8" try: image_file = open(image.encode(encoding), 'rb') image_object = Image.open(image_file) except (UnicodeEncodeError...
uliss/quneiform
[ 10, 2, 10, 6, 1306885353 ]
def convert_figure(node, context): image = None caption = None width = None height = None for child in node: tagname = child.tagname if tagname == "image": if image is not None: printwarn("unexpected duplicate image in a figure") continue ...
uliss/quneiform
[ 10, 2, 10, 6, 1306885353 ]
def _get_cell_style(context): styles = context['styles'] cell_style = styles.get('cell') if cell_style is not None: return cell_style # Give borders to cells cell_style = odf_create_style('table-cell', u"odf_table.A1", padding=u"0.049cm", border=u"0.002cm solid #000000") cont...
uliss/quneiform
[ 10, 2, 10, 6, 1306885353 ]
def convert_node(node, context): tagname = node.tagname convert_method = convert_methods.get(tagname) if convert_method is not None: convert_method(node, context) else: printwarn("node not supported: %s" % tagname)
uliss/quneiform
[ 10, 2, 10, 6, 1306885353 ]
def daterange(start_date, end_date): for n in range(int ((end_date - start_date).days)): yield start_date + timedelta(n)
centrofermi/e3monitor
[ 2, 1, 2, 8, 1417606679 ]
def flirt(message): if len(message) <= 1: return '' for sep in '.!?': s, sepfound, after = message.partition(sep) numspace = len(s) - len(s.lstrip()) s = ' ' * numspace + \ random.choice(PHRASES).format(s=s.lstrip().lower(), sep=sepfound) return s + flirt(afte...
sentriz/steely
[ 21, 14, 21, 6, 1498783471 ]
def __init__(self, bases, pv=None, *, force=False): self.bases = list(bases) if self.size > self._size_max and not force: raise ValueError( 'Density matrix of the system is going to have {} items. It ' 'is probably too much. If you know what you are doing, ' ...
brianzi/quantumsim
[ 28, 16, 28, 13, 1465822644 ]
def from_pv(cls, pv, bases, *, force=False): return cls(bases, pv, force=force)
brianzi/quantumsim
[ 28, 16, 28, 13, 1465822644 ]
def to_pv(self): """Get data in a form of Numpy array""" pass
brianzi/quantumsim
[ 28, 16, 28, 13, 1465822644 ]
def from_dm(cls, dm, bases, *, force=False): if not hasattr(bases, '__iter__'): n_qubits = len(dm) // bases.dim_hilbert bases = [bases] * n_qubits return cls(bases, dm_to_pv(dm, bases), force=force)
brianzi/quantumsim
[ 28, 16, 28, 13, 1465822644 ]
def n_qubits(self): return len(self.bases)
brianzi/quantumsim
[ 28, 16, 28, 13, 1465822644 ]
def dim_hilbert(self): return tuple((b.dim_hilbert for b in self.bases))
brianzi/quantumsim
[ 28, 16, 28, 13, 1465822644 ]
def size(self): return pytools.product(self.dim_hilbert) ** 2
brianzi/quantumsim
[ 28, 16, 28, 13, 1465822644 ]
def dim_pauli(self): return tuple([pb.dim_pauli for pb in self.bases])
brianzi/quantumsim
[ 28, 16, 28, 13, 1465822644 ]
def apply_ptm(self, operation, *qubits): pass
brianzi/quantumsim
[ 28, 16, 28, 13, 1465822644 ]
def diagonal(self, *, get_data=True): pass
brianzi/quantumsim
[ 28, 16, 28, 13, 1465822644 ]
def trace(self): pass
brianzi/quantumsim
[ 28, 16, 28, 13, 1465822644 ]
def partial_trace(self, *qubits): pass
brianzi/quantumsim
[ 28, 16, 28, 13, 1465822644 ]
def meas_prob(self, qubit): pass
brianzi/quantumsim
[ 28, 16, 28, 13, 1465822644 ]
def renormalize(self): pass
brianzi/quantumsim
[ 28, 16, 28, 13, 1465822644 ]
def copy(self): pass
brianzi/quantumsim
[ 28, 16, 28, 13, 1465822644 ]
def __init__(self, store, aID, name, currency=0, balance=0.0, mintId=None, currNick=False): ORMObject.__init__(self) self.IsFrozen = True self.Store = store self.ID = aID self._Name = name self._Transactions = None self._RecurringTransactions = [] self._pr...
mrooney/wxbanker
[ 17, 9, 17, 7, 1337971002 ]
def GetSiblings(self): return [account for account in self.Parent if account is not self]
mrooney/wxbanker
[ 17, 9, 17, 7, 1337971002 ]
def GetCurrency(self): return self._Currency
mrooney/wxbanker
[ 17, 9, 17, 7, 1337971002 ]
def GetBalance(self, currency=None): return self.balanceAtCurrency(self.Balance, currency)
mrooney/wxbanker
[ 17, 9, 17, 7, 1337971002 ]
def GetRecurringTransactions(self): return self._RecurringTransactions
mrooney/wxbanker
[ 17, 9, 17, 7, 1337971002 ]
def SetRecurringTransactions(self, recurrings): self._RecurringTransactions = recurrings
mrooney/wxbanker
[ 17, 9, 17, 7, 1337971002 ]
def GetName(self): return self._Name
mrooney/wxbanker
[ 17, 9, 17, 7, 1337971002 ]
def Remove(self): self.Parent.Remove(self.Name)
mrooney/wxbanker
[ 17, 9, 17, 7, 1337971002 ]
def AddRecurringTransaction(self, amount, description, date, repeatType, repeatEvery=1, repeatOn=None, endDate=None, source=None): # Create the recurring transaction object. recurring = RecurringTransaction(None, self, amount, description, date, repeatType, repeatEvery, repeatOn, endDate, source) ...
mrooney/wxbanker
[ 17, 9, 17, 7, 1337971002 ]
def RemoveRecurringTransaction(self, recurring): # Orphan any recurring children so that they are normal transactions. for child in recurring.GetChildren(): child.RecurringParent = None if child.LinkedTransaction: child.LinkedTransaction.RecurringParent = None
mrooney/wxbanker
[ 17, 9, 17, 7, 1337971002 ]
def AddTransaction(self, amount=None, description="", date=None, source=None, transaction=None): """ Enter a transaction in this account, optionally making the opposite transaction in the source account first. """ Publisher.sendMessage("batch.start")
mrooney/wxbanker
[ 17, 9, 17, 7, 1337971002 ]