text stringlengths 0 828 |
|---|
return all(allchecks)" |
1862,"def describe(self): |
"""""" describes a Symbol, returns a string """""" |
lines = [] |
lines.append(""Symbol = {}"".format(self.name)) |
if len(self.tags): |
tgs = "", "".join(x.tag for x in self.tags) |
lines.append("" tagged = {}"".format(tgs)) |
if len(self.aliases): |
als = "", "".join(x.alias for x in self.aliases) |
lines.append("" aliased = {}"".format(als)) |
if len(self.feeds): |
lines.append("" feeds:"") |
for fed in self.feeds: |
lines.append("" {}. {}"".format(fed.fnum, |
fed.ftype)) |
return ""\n"".join(lines)" |
1863,"def del_tags(self, tags): |
"""""" remove a tag or tags from a symbol |
Parameters |
---------- |
tags : str or [str,] |
Tags to be removed |
"""""" |
# SQLA Adding a SymbolTag object, feels awkward/uneccessary. |
# Should I be implementing this functionality a different way? |
if isinstance(tags, (str, unicode)): |
tags = [tags] |
objs = object_session(self) |
docommit = False |
for symboltag in self.tags: |
if symboltag.tag in tags: |
objs.delete(symboltag) |
docommit = True |
if docommit: |
objs.commit()" |
1864,"def add_tags(self, tags): |
"""""" add a tag or tags to a symbol |
Parameters |
---------- |
tags : str or [str,] |
Tags to be added |
"""""" |
# SQLA Adding a SymbolTag object, feels awkward/uneccessary. |
# Should I be implementing this functionality a different way? |
if isinstance(tags, (str, unicode)): |
tags = [tags] |
objs = object_session(self) |
tmps = [SymbolTag(tag=t, sym=self) for t in tags] |
objs.add_all(tmps) |
objs.commit()" |
1865,"def _log_an_event(self, event, evresult='No Result', note='No Note'): |
"""""" log an event |
Parameters |
---------- |
event : string |
evresult : string |
note : string |
"""""" |
objs = object_session(self) |
evnt = SymbolLogEvent(event, evresult, note, sym=self.name) |
objs.add(evnt) |
objs.commit()" |
1866,"def add_feed(self, feedlike, **kwargs): |
"""""" Add a feed to the Symbol |
Parameters |
---------- |
feedlike : Feed or bFeed-like |
The feed template, or Feed object to be added. |
kwargs |
Munging instructions |
"""""" |
if 'fnum' in kwargs: |
fnum = kwargs['fnum'] |
del kwargs['fnum'] |
else: |
fnum = None |
if isinstance(feedlike, bFeed): |
munging = feedlike.munging |
if 'munging' in kwargs: |
explicit_munging = kwargs['munging'].as_odict |
for key in explicit_munging: |
munging[key] = explicit_munging[key] |
fed = Feed(self, feedlike.ftype, |
feedlike.sourcing, |
munging, |
feedlike.meta, |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.