_id stringlengths 2 7 | title stringlengths 1 88 | partition stringclasses 3
values | text stringlengths 31 13.1k | language stringclasses 1
value | meta_information dict |
|---|---|---|---|---|---|
q249500 | Character.avatars | train | def avatars(self):
"""Iterate over all my avatars, regardless of what character they are
in.
"""
charname = self.character.name
branch, turn, tick = self.engine._btt()
charmap = self.engine.character
avit = self.engine._avatarness_cache.iter_entities
make... | python | {
"resource": ""
} |
q249501 | QueryEngine.sql | train | def sql(self, stringname, *args, **kwargs):
"""Wrapper for the various prewritten or compiled SQL calls.
First argument is the name of the query, either a key in
``sqlite.json`` or a method name in
``allegedb.alchemy.Alchemist``. The rest of the arguments are
parameters to the q... | python | {
"resource": ""
} |
q249502 | QueryEngine.sqlmany | train | def sqlmany(self, stringname, *args):
"""Wrapper for executing many SQL calls on my connection.
First arg is the name of a query, either a key in the
precompiled JSON or a method name in
``allegedb.alchemy.Alchemist``. Remaining arguments should be
tuples of argument sequences t... | python | {
"resource": ""
} |
q249503 | QueryEngine.have_graph | train | def have_graph(self, graph):
"""Return whether I have a graph by this name."""
graph = self.pack(graph)
| python | {
"resource": ""
} |
q249504 | QueryEngine.new_graph | train | def new_graph(self, graph, typ):
"""Declare a new graph by this name of this type."""
| python | {
"resource": ""
} |
q249505 | QueryEngine.del_graph | train | def del_graph(self, graph):
"""Delete all records to do with the graph"""
g = self.pack(graph)
self.sql('del_edge_val_graph', g)
self.sql('del_node_val_graph', g)
| python | {
"resource": ""
} |
q249506 | QueryEngine.graph_type | train | def graph_type(self, graph):
"""What type of graph is this?"""
graph = self.pack(graph)
| python | {
"resource": ""
} |
q249507 | QueryEngine.global_get | train | def global_get(self, key):
"""Return the value for the given key in the ``globals`` table."""
key = self.pack(key)
r = self.sql('global_get', key).fetchone()
| python | {
"resource": ""
} |
q249508 | QueryEngine.global_del | train | def global_del(self, key):
"""Delete the global record for the key."""
| python | {
"resource": ""
} |
q249509 | QueryEngine.new_branch | train | def new_branch(self, branch, parent, parent_turn, parent_tick):
"""Declare that the ``branch`` is descended from ``parent`` at | python | {
"resource": ""
} |
q249510 | QueryEngine.graph_val_dump | train | def graph_val_dump(self):
"""Yield the entire contents of the graph_val table."""
self._flush_graph_val()
for (graph, key, branch, turn, tick, value) in self.sql('graph_val_dump'):
yield (
self.unpack(graph),
| python | {
"resource": ""
} |
q249511 | QueryEngine._flush_graph_val | train | def _flush_graph_val(self):
"""Send all new and changed graph values to the database."""
if not self._graphvals2set:
return
delafter = {}
for graph, key, branch, turn, tick, value in self._graphvals2set:
if (graph, key, branch) in delafter:
delafte... | python | {
"resource": ""
} |
q249512 | QueryEngine.exist_node | train | def exist_node(self, graph, node, branch, turn, tick, extant):
"""Declare that the node exists or doesn't.
Inserts a new record or updates an old one, as needed.
"""
if (branch, turn, tick) in self._btts:
| python | {
"resource": ""
} |
q249513 | QueryEngine.nodes_dump | train | def nodes_dump(self):
"""Dump the entire contents of the nodes table."""
self._flush_nodes()
for (graph, node, branch, turn,tick, extant) in self.sql('nodes_dump'):
yield (
self.unpack(graph),
| python | {
"resource": ""
} |
q249514 | QueryEngine.node_val_dump | train | def node_val_dump(self):
"""Yield the entire contents of the node_val table."""
self._flush_node_val()
for (
graph, node, key, branch, turn, tick, value
| python | {
"resource": ""
} |
q249515 | QueryEngine.node_val_set | train | def node_val_set(self, graph, node, key, branch, turn, tick, value):
"""Set a key-value pair on a node at a specific branch and revision"""
if (branch, turn, tick) in self._btts:
raise TimeError
self._btts.add((branch, turn, tick))
| python | {
"resource": ""
} |
q249516 | QueryEngine.edges_dump | train | def edges_dump(self):
"""Dump the entire contents of the edges table."""
self._flush_edges()
for (
graph, orig, dest, idx, branch, turn, tick, extant
| python | {
"resource": ""
} |
q249517 | QueryEngine.exist_edge | train | def exist_edge(self, graph, orig, dest, idx, branch, turn, tick, extant):
"""Declare whether or not this edge exists."""
if (branch, turn, tick) in self._btts:
raise TimeError
self._btts.add((branch, turn, tick))
graph, | python | {
"resource": ""
} |
q249518 | QueryEngine.edge_val_dump | train | def edge_val_dump(self):
"""Yield the entire contents of the edge_val table."""
self._flush_edge_val()
for (
graph, orig, dest, idx, key, branch, turn, tick, value
) in self.sql('edge_val_dump'):
yield (
self.unpack(graph),
self... | python | {
"resource": ""
} |
q249519 | QueryEngine.edge_val_set | train | def edge_val_set(self, graph, orig, dest, idx, key, branch, turn, tick, value):
"""Set this key of this edge to this value."""
if (branch, turn, tick) in self._btts:
raise TimeError
self._btts.add((branch, turn, tick))
graph, orig, dest, key, | python | {
"resource": ""
} |
q249520 | QueryEngine.initdb | train | def initdb(self):
"""Create tables and indices as needed."""
if hasattr(self, 'alchemist'):
self.alchemist.meta.create_all(self.engine)
if 'branch' not in self.globl:
self.globl['branch'] = 'trunk'
if 'rev' not in self.globl:
self.globl... | python | {
"resource": ""
} |
q249521 | QueryEngine.flush | train | def flush(self):
"""Put all pending changes into the SQL transaction."""
self._flush_nodes()
| python | {
"resource": ""
} |
q249522 | QueryEngine.commit | train | def commit(self):
"""Commit the transaction"""
self.flush()
if hasattr(self, 'transaction') and self.transaction.is_active:
| python | {
"resource": ""
} |
q249523 | Node.path_exists | train | def path_exists(self, dest, weight=None):
"""Return whether there is a path leading from me to ``dest``.
With ``weight``, only consider edges that have a stat by the
given name.
Raise ``ValueError`` if ``dest`` is not a node in my character
| python | {
"resource": ""
} |
q249524 | Node.delete | train | def delete(self):
"""Get rid of this, starting now.
Apart from deleting the node, this also informs all its users
that it doesn't exist and therefore can't be their avatar
anymore.
"""
if self.name in self.character.portal:
del self.character.portal[self.nam... | python | {
"resource": ""
} |
q249525 | Node.one_way_portal | train | def one_way_portal(self, other, **stats):
"""Connect a portal from here to another node, and return it."""
| python | {
"resource": ""
} |
q249526 | Node.two_way_portal | train | def two_way_portal(self, other, **stats):
"""Connect these nodes with a two-way portal and return it."""
| python | {
"resource": ""
} |
q249527 | Node.new_thing | train | def new_thing(self, name, **stats):
"""Create a new thing, located here, and return it."""
| python | {
"resource": ""
} |
q249528 | Card.on_background_image | train | def on_background_image(self, *args):
"""When I get a new ``background_image``, store its texture in
``background_texture``.
| python | {
"resource": ""
} |
q249529 | Card.on_foreground_image | train | def on_foreground_image(self, *args):
"""When I get a new ``foreground_image``, store its texture in my
``foreground_texture``.
| python | {
"resource": ""
} |
q249530 | Card.on_art_image | train | def on_art_image(self, *args):
"""When I get a new ``art_image``, store its texture in
``art_texture``.
| python | {
"resource": ""
} |
q249531 | Card.on_touch_down | train | def on_touch_down(self, touch):
"""If I'm the first card to collide this touch, grab it, store my
metadata in its userdict, and store the relative coords upon
me where the collision happened.
"""
if not self.collide_point(*touch.pos):
return
if 'card' in touc... | python | {
"resource": ""
} |
q249532 | Card.on_touch_move | train | def on_touch_move(self, touch):
"""If I'm being dragged, move so as to be always positioned the same
relative to the touch.
"""
if not self.dragging:
touch.ungrab(self)
| python | {
"resource": ""
} |
q249533 | Card.on_touch_up | train | def on_touch_up(self, touch):
"""Stop dragging if needed."""
if not self.dragging:
| python | {
"resource": ""
} |
q249534 | Foundation.upd_pos | train | def upd_pos(self, *args):
"""Ask the foundation where I should be, based on what deck I'm
for.
| python | {
"resource": ""
} |
q249535 | DeckBuilderLayout.scroll_deck_x | train | def scroll_deck_x(self, decknum, scroll_x):
"""Move a deck left or right."""
if decknum >= len(self.decks):
raise IndexError("I have no deck at {}".format(decknum))
if decknum >= len(self.deck_x_hint_offsets):
self.deck_x_hint_offsets = list(self.deck_x_hint_offsets) + [0... | python | {
"resource": ""
} |
q249536 | DeckBuilderLayout.scroll_deck_y | train | def scroll_deck_y(self, decknum, scroll_y):
"""Move a deck up or down."""
if decknum >= len(self.decks):
raise IndexError("I have no deck at {}".format(decknum))
if decknum >= len(self.deck_y_hint_offsets):
self.deck_y_hint_offsets = list(self.deck_y_hint_offsets) + [0] *... | python | {
"resource": ""
} |
q249537 | DeckBuilderLayout.scroll_deck | train | def scroll_deck(self, decknum, scroll_x, scroll_y):
"""Move a deck."""
| python | {
"resource": ""
} |
q249538 | DeckBuilderLayout._get_foundation_pos | train | def _get_foundation_pos(self, i):
"""Private. Get the absolute coordinates to use for a deck's
foundation, based on the ``starting_pos_hint``, the
``deck_hint_step``, ``deck_x_hint_offsets``, and
``deck_y_hint_offsets``.
"""
(phx, phy) = get_pos_hint(
self.st... | python | {
"resource": ""
} |
q249539 | DeckBuilderLayout.on_decks | train | def on_decks(self, *args):
"""Inform the cards of their deck and their index within the deck;
extend the ``_hint_offsets`` properties as needed; and trigger
a layout.
"""
if None in (
self.canvas,
self.decks,
self.deck_x_hint_offse... | python | {
"resource": ""
} |
q249540 | DeckBuilderLayout.on_touch_move | train | def on_touch_move(self, touch):
"""If a card is being dragged, move other cards out of the way to show
where the dragged card will go if you drop it.
"""
if (
'card' not in touch.ud or
'layout' not in touch.ud or
touch.ud['layout'] != self... | python | {
"resource": ""
} |
q249541 | DeckBuilderLayout.on_touch_up | train | def on_touch_up(self, touch):
"""If a card is being dragged, put it in the place it was just dropped
and trigger a layout.
"""
if (
'card' not in touch.ud or
'layout' not in touch.ud or
touch.ud['layout'] != self
):
ret... | python | {
"resource": ""
} |
q249542 | DeckBuilderLayout.do_layout | train | def do_layout(self, *args):
"""Layout each of my decks"""
if self.size == [1, 1]:
return
| python | {
"resource": ""
} |
q249543 | DeckBuilderLayout.layout_deck | train | def layout_deck(self, i):
"""Stack the cards, starting at my deck's foundation, and proceeding
by ``card_pos_hint``
"""
def get_dragidx(cards):
j = 0
for card in cards:
if card.dragging:
return j
j += 1
... | python | {
"resource": ""
} |
q249544 | ScrollBarBar.on_touch_down | train | def on_touch_down(self, touch):
"""Tell my parent if I've been touched"""
if self.parent is None:
return
| python | {
"resource": ""
} |
q249545 | DeckBuilderScrollBar.do_layout | train | def do_layout(self, *args):
"""Put the bar where it's supposed to be, and size it in proportion to
the size of the scrollable area.
"""
if 'bar' not in self.ids:
Clock.schedule_once(self.do_layout)
return
if self.orientation == 'horizontal':
| python | {
"resource": ""
} |
q249546 | DeckBuilderScrollBar.upd_scroll | train | def upd_scroll(self, *args):
"""Update my own ``scroll`` property to where my deck is actually
scrolled.
| python | {
"resource": ""
} |
q249547 | DeckBuilderScrollBar.on_deckbuilder | train | def on_deckbuilder(self, *args):
"""Bind my deckbuilder to update my ``scroll``, and my ``scroll`` to
update my deckbuilder.
"""
if self.deckbuilder is None:
return
att = 'deck_{}_hint_offsets'.format(
'x' if self.orientation == 'horizontal' else 'y'
... | python | {
"resource": ""
} |
q249548 | DeckBuilderScrollBar.handle_scroll | train | def handle_scroll(self, *args):
"""When my ``scroll`` changes, tell my deckbuilder how it's scrolled
now.
"""
if 'bar' not in self.ids:
Clock.schedule_once(self.handle_scroll, 0)
return
att = 'deck_{}_hint_offsets'.format(
'x' if self.orientat... | python | {
"resource": ""
} |
q249549 | DeckBuilderScrollBar.bar_touched | train | def bar_touched(self, bar, touch):
"""Start scrolling, and record where I started scrolling."""
self.scrolling = True
self._start_bar_pos_hint = get_pos_hint(bar.pos_hint, *bar.size_hint)
self._start_touch_pos_hint = ( | python | {
"resource": ""
} |
q249550 | DeckBuilderScrollBar.on_touch_move | train | def on_touch_move(self, touch):
"""Move the scrollbar to the touch, and update my ``scroll``
accordingly.
"""
if not self.scrolling or 'bar' not in self.ids:
touch.ungrab(self)
return
touch.push()
touch.apply_transform_2d(self.parent.to_local)
... | python | {
"resource": ""
} |
q249551 | ListWrapper.unwrap | train | def unwrap(self):
"""Return a deep copy of myself as a list, and unwrap any wrapper objects in me."""
| python | {
"resource": ""
} |
q249552 | ArrowWidget.on_portal | train | def on_portal(self, *args):
"""Set my ``name`` and instantiate my ``mirrormap`` as soon as I have
the properties I need to do so.
"""
if not (
self.board and
self.origin and
self.destination and
self.origin.name | python | {
"resource": ""
} |
q249553 | ArrowWidget.collide_point | train | def collide_point(self, x, y):
"""Delegate to my ``collider``, or return ``False`` if I | python | {
"resource": ""
} |
q249554 | ArrowWidget.on_origin | train | def on_origin(self, *args):
"""Make sure to redraw whenever the origin moves."""
if self.origin is None:
| python | {
"resource": ""
} |
q249555 | ArrowWidget.on_destination | train | def on_destination(self, *args):
"""Make sure to redraw whenever the destination moves."""
if self.destination is None:
| python | {
"resource": ""
} |
q249556 | ArrowWidget.on_board | train | def on_board(self, *args):
"""Draw myself for the first time as soon as I have the properties I
need to do so.
"""
if None in (
self.board,
| python | {
"resource": ""
} |
q249557 | ArrowWidget._get_slope | train | def _get_slope(self):
"""Return a float of the increase in y divided by the increase in x,
both from left to right."""
orig = self.origin
dest = self.destination
ox = orig.x
oy = orig.y
dx = dest.x
dy = dest.y
if oy == dy:
return 0
| python | {
"resource": ""
} |
q249558 | ArrowWidget._get_b | train | def _get_b(self):
"""Return my Y-intercept.
I probably don't really hit the left edge of the window, but
this is where I would, if I were long enough.
"""
orig = self.origin
dest = self.destination
(ox, oy) = orig.pos
| python | {
"resource": ""
} |
q249559 | ArrowWidget._repoint | train | def _repoint(self, *args):
"""Recalculate points, y-intercept, and slope"""
if None in (self.origin, self.destination):
Clock.schedule_once(self._repoint, 0)
return
try:
(self.trunk_points, self.head_points) = self._get_points()
except ValueError:
... | python | {
"resource": ""
} |
q249560 | munge_source | train | def munge_source(v):
"""Take Python source code, return a pair of its parameters and the rest of it dedented"""
lines = v.split('\n')
if not lines:
return tuple(), ''
firstline = lines[0].lstrip()
while firstline == '' or firstline[0] == '@':
del lines[0]
| python | {
"resource": ""
} |
q249561 | StoreList.redata | train | def redata(self, *args, **kwargs):
"""Update my ``data`` to match what's in my ``store``"""
select_name = kwargs.get('select_name')
if not self.store:
Clock.schedule_once(self.redata)
return
| python | {
"resource": ""
} |
q249562 | StoreList.select_name | train | def select_name(self, name, *args):
"""Select an item by its name, highlighting"""
| python | {
"resource": ""
} |
q249563 | Editor.save | train | def save(self, *args):
"""Put text in my store, return True if it changed"""
if self.name_wid is None or self.store is None:
Logger.debug("{}: Not saving, missing name_wid or store".format(type(self).__name__))
return
if not (self.name_wid.text or self.name_wid.hint_text)... | python | {
"resource": ""
} |
q249564 | Editor.delete | train | def delete(self, *args):
"""Remove the currently selected item from my store"""
key = self.name_wid.text or self.name_wid.hint_text
if not hasattr(self.store, key):
# TODO feedback about missing key
return
| python | {
"resource": ""
} |
q249565 | DialogLayout.advance_dialog | train | def advance_dialog(self, *args):
"""Try to display the next dialog described in my ``todo``."""
self.clear_widgets()
try: | python | {
"resource": ""
} |
q249566 | DialogLayout.ok | train | def ok(self, *args, cb=None):
"""Clear dialog widgets, call ``cb`` if provided, and advance the dialog queue"""
self.clear_widgets()
| python | {
"resource": ""
} |
q249567 | Node.add_child | train | def add_child(self, child):
'''Add child to ``Node`` object
Args:
``child`` (``Node``): The child ``Node`` to be added
'''
if not isinstance(child, Node):
| python | {
"resource": ""
} |
q249568 | Node.contract | train | def contract(self):
'''Contract this ``Node`` by directly connecting its children to its parent'''
if self.is_root():
return
for c in self.children:
if self.edge_length is not None and c.edge_length is not None:
| python | {
"resource": ""
} |
q249569 | Node.newick | train | def newick(self):
'''Newick string conversion starting at this ``Node`` object
Returns:
``str``: Newick string conversion starting at this ``Node`` object
'''
node_to_str = dict()
for node in self.traverse_postorder():
if node.is_leaf():
i... | python | {
"resource": ""
} |
q249570 | Node.remove_child | train | def remove_child(self, child):
'''Remove child from ``Node`` object
Args:
``child`` (``Node``): The child to remove
'''
if not isinstance(child, Node):
raise TypeError("child must be a Node")
try:
| python | {
"resource": ""
} |
q249571 | Node.resolve_polytomies | train | def resolve_polytomies(self):
'''Arbitrarily resolve polytomies below this ``Node`` with 0-lengthed edges.'''
q = deque(); q.append(self)
while len(q) != 0:
node = q.popleft()
while len(node.children) > 2:
| python | {
"resource": ""
} |
q249572 | Node.set_parent | train | def set_parent(self, parent):
'''Set the parent of this ``Node`` object. Use this carefully, otherwise you may damage the structure of this ``Tree`` object.
Args:
``Node``: The new parent of this ``Node``
| python | {
"resource": ""
} |
q249573 | Node.traverse_ancestors | train | def traverse_ancestors(self, include_self=True):
'''Traverse over the ancestors of this ``Node``
Args:
``include_self`` (``bool``): ``True`` to include self in the traversal, otherwise ``False``
'''
if not isinstance(include_self, bool):
raise | python | {
"resource": ""
} |
q249574 | Node.traverse_inorder | train | def traverse_inorder(self, leaves=True, internal=True):
'''Perform an inorder traversal starting at this ``Node`` object
Args:
``leaves`` (``bool``): ``True`` to include leaves, otherwise ``False``
``internal`` (``bool``): ``True`` to include internal nodes, otherwise ``False``... | python | {
"resource": ""
} |
q249575 | Node.traverse_levelorder | train | def traverse_levelorder(self, leaves=True, internal=True):
'''Perform a levelorder traversal starting at this ``Node`` object
Args:
``leaves`` (``bool``): ``True`` to include leaves, otherwise ``False``
``internal`` (``bool``): ``True`` to include internal nodes, otherwise ``Fa... | python | {
"resource": ""
} |
q249576 | Node.traverse_postorder | train | def traverse_postorder(self, leaves=True, internal=True):
'''Perform a postorder traversal starting at this ``Node`` object
Args:
``leaves`` (``bool``): ``True`` to include leaves, otherwise ``False``
``internal`` (``bool``): ``True`` to include internal nodes, otherwise ``Fals... | python | {
"resource": ""
} |
q249577 | Node.traverse_preorder | train | def traverse_preorder(self, leaves=True, internal=True):
'''Perform a preorder traversal starting at this ``Node`` object
Args:
``leaves`` (``bool``): ``True`` to include leaves, otherwise ``False``
``internal`` (``bool``): ``True`` to include internal nodes, otherwise ``False`... | python | {
"resource": ""
} |
q249578 | ValuesAggregation.merge_with | train | def merge_with(self, other):
"""Merge this ``ValuesAggregation`` with another one"""
result = ValuesAggregation()
result.total = self.total + other.total
result.count = self.count | python | {
"resource": ""
} |
q249579 | parse_url_rules | train | def parse_url_rules(urls_fp):
"""URL rules from given fp"""
url_rules = []
for line in urls_fp:
| python | {
"resource": ""
} |
q249580 | force_bytes | train | def force_bytes(s, encoding='utf-8', errors='strict'):
"""A function turns "s" into bytes object, similar to django.utils.encoding.force_bytes
"""
# Handle the common case first for performance reasons.
if isinstance(s, bytes):
if encoding == 'utf-8':
| python | {
"resource": ""
} |
q249581 | force_text | train | def force_text(s, encoding='utf-8', errors='strict'):
"""A function turns "s" into text type, similar to django.utils.encoding.force_text
"""
if issubclass(type(s), str):
return s
try:
if isinstance(s, bytes):
| python | {
"resource": ""
} |
q249582 | DataAbstract.set_XRef | train | def set_XRef(self, X=None, indtX=None, indtXlamb=None):
""" Reset the reference X
Useful if to replace channel indices by a time-vraying quantity
e.g.: distance to the magnetic axis
"""
out = self._checkformat_inputs_XRef(X=X, indtX=indtX,
| python | {
"resource": ""
} |
q249583 | DataAbstract.set_dtreat_indt | train | def set_dtreat_indt(self, t=None, indt=None):
""" Store the desired index array for the time vector
If an array of indices (refering to self.ddataRef['t'] is not provided,
uses self.select_t(t=t) to produce it
"""
lC = [indt is not None, t is not None]
if all(lC):
... | python | {
"resource": ""
} |
q249584 | DataAbstract.set_dtreat_indch | train | def set_dtreat_indch(self, indch=None):
""" Store the desired index array for the channels
If None => all channels
Must be a 1d array
"""
if indch is not None:
indch = np.asarray(indch)
| python | {
"resource": ""
} |
q249585 | DataAbstract.set_dtreat_indlamb | train | def set_dtreat_indlamb(self, indlamb=None):
""" Store the desired index array for the wavelength
If None => all wavelengths
Must be a 1d array
"""
if not self._isSpectral():
msg = "The wavelength can only be set with DataSpectral object !"
raise Exceptio... | python | {
"resource": ""
} |
q249586 | DataAbstract.set_dtreat_interp_indt | train | def set_dtreat_interp_indt(self, indt=None):
""" Set the indices of the times for which to interpolate data
The index can be provided as:
- A 1d np.ndarray of boolean or int indices
=> interpolate data at these times for all channels
- A dict with:
... | python | {
"resource": ""
} |
q249587 | DataAbstract.set_dtreat_interp_indch | train | def set_dtreat_interp_indch(self, indch=None):
""" Set the indices of the channels for which to interpolate data
The index can be provided as:
- A 1d np.ndarray of boolean or int indices of channels
=> interpolate data at these channels for all times
- A dict wit... | python | {
"resource": ""
} |
q249588 | DataAbstract.set_dtreat_dfit | train | def set_dtreat_dfit(self, dfit=None):
""" Set the fitting dictionnary
A dict contaning all parameters for fitting the data
Valid dict content includes:
- 'type': str
'fft': A fourier filtering
| python | {
"resource": ""
} |
q249589 | DataAbstract.set_dtreat_interpt | train | def set_dtreat_interpt(self, t=None):
""" Set the time vector on which to interpolate the data """
if t is not None:
| python | {
"resource": ""
} |
q249590 | DataAbstract.set_dtreat_order | train | def set_dtreat_order(self, order=None):
""" Set the order in which the data treatment should be performed
Provide an ordered list of keywords indicating the order in which
you wish the data treatment steps to be performed.
Each keyword corresponds to a step.
Available steps are... | python | {
"resource": ""
} |
q249591 | DataAbstract.clear_ddata | train | def clear_ddata(self):
""" Clear the working copy of data
Harmless, as it preserves the reference copy and the treatment dict
Use only to free some memory
"""
| python | {
"resource": ""
} |
q249592 | DataAbstract.dchans | train | def dchans(self, key=None):
""" Return the dchans updated with indch
Return a dict with all keys if key=None
"""
if self._dtreat['indch'] is None or np.all(self._dtreat['indch']):
dch = dict(self._dchans) if key is None else self._dchans[key]
else:
dch =... | python | {
"resource": ""
} |
q249593 | DataAbstract.select_t | train | def select_t(self, t=None, out=bool):
""" Return a time index array
Return a boolean or integer index array, hereafter called 'ind'
The array refers to the reference time vector self.ddataRef['t']
Parameters
----------
t : None / float / np.ndarray / list / tuple
... | python | {
"resource": ""
} |
q249594 | DataAbstract.select_lamb | train | def select_lamb(self, lamb=None, out=bool):
""" Return a wavelength index array
Return a boolean or integer index array, hereafter called 'ind'
The array refers to the reference time vector self.ddataRef['lamb']
Parameters
----------
lamb : None / float / np.ndarray... | python | {
"resource": ""
} |
q249595 | DataAbstract.plot | train | def plot(self, key=None,
cmap=None, ms=4, vmin=None, vmax=None,
vmin_map=None, vmax_map=None, cmap_map=None, normt_map=False,
ntMax=None, nchMax=None, nlbdMax=3,
lls=None, lct=None, lcch=None, lclbd=None, cbck=None,
inct=[1,10], incX=[1,5], inclbd=[1,10],... | python | {
"resource": ""
} |
q249596 | DataAbstract.plot_compare | train | def plot_compare(self, lD, key=None,
cmap=None, ms=4, vmin=None, vmax=None,
vmin_map=None, vmax_map=None, cmap_map=None, normt_map=False,
ntMax=None, nchMax=None, nlbdMax=3,
lls=None, lct=None, lcch=None, lclbd=None, cbck=None,
... | python | {
"resource": ""
} |
q249597 | DataAbstract.calc_spectrogram | train | def calc_spectrogram(self, fmin=None,
method='scipy-fourier', deg=False,
window='hann', detrend='linear',
nperseg=None, noverlap=None,
boundary='constant', padded=True,
wave='morlet', warn=True):... | python | {
"resource": ""
} |
q249598 | DataAbstract.plot_spectrogram | train | def plot_spectrogram(self, fmin=None, fmax=None,
method='scipy-fourier', deg=False,
window='hann', detrend='linear',
nperseg=None, noverlap=None,
boundary='constant', padded=True, wave='morlet',
... | python | {
"resource": ""
} |
q249599 | DataAbstract.calc_svd | train | def calc_svd(self, lapack_driver='gesdd'):
""" Return the SVD decomposition of data
The input data np.ndarray shall be of dimension 2,
with time as the first dimension, and the channels in the second
Hence data should be of shape (nt, nch)
Uses scipy.linalg.svd(), with:... | python | {
"resource": ""
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.