text
stringlengths 0
828
|
---|
ax.set_axis_off() |
fig.savefig(""{}_{}.png"".format(channel, fnextend), bbox_inches='tight', dpi=300) |
plt.close(fig)" |
105,"def overall(): |
"""""" The overall grammer for pulling apart the main input files. """""" |
return ZeroOrMore(Grammar.comment) + Dict(ZeroOrMore(Group( |
Grammar._section + ZeroOrMore(Group(Grammar.line))) |
))" |
106,"def file(): |
"""""" Grammar for files found in the overall input files. """""" |
return ( |
Optional(Word(alphanums).setResultsName('alias') + |
Suppress(Literal('.'))) + Suppress(White()) + |
Word(approved_printables).setResultsName('filename') |
)" |
107,"def command_lines(): |
"""""" Grammar for commands found in the overall input files. """""" |
return ZeroOrMore(Group( |
Group(ZeroOrMore(Group(Grammar.comment))) + Grammar._non_comment_line |
))" |
108,"def command(): |
"""""" Grammar for commands found in the overall input files. """""" |
return ( |
OneOrMore( |
Word(approved_printables+' ').setResultsName('command', |
listAllMatches=True) ^ |
Grammar.__command_input_output.setResultsName('_in', |
listAllMatches=True) |
) |
)" |
109,"def listen_to_event_updates(): |
""""""Subscribe to events."""""" |
def callback(event): |
print('Event:', event) |
client.create_event_subscription(instance='simulator', on_data=callback) |
sleep(5)" |
110,"def get_current_scene_node(): |
""""""Return the name of the jb_sceneNode, that describes the current scene or None if there is no scene node. |
:returns: the full name of the node or none, if there is no scene node |
:rtype: str | None |
:raises: None |
"""""" |
c = cmds.namespaceInfo(':', listOnlyDependencyNodes=True, absoluteName=True, dagPath=True) |
l = cmds.ls(c, type='jb_sceneNode', absoluteName=True) |
if not l: |
return |
else: |
for n in sorted(l): |
if not cmds.listConnections(""%s.reftrack"" % n, d=False): |
return n" |
111,"def updateSpec(self, *args, **kwargs): |
""""""Updates the spectrogram. First argument can be a filename, |
or a data array. If no arguments are given, clears the spectrograms. |
For other arguments, see: :meth:`SpecWidget.updateData<sparkle.gui.plotting.pyqtgraph_widgets.SpecWidget.updateData>` |
"""""" |
if args[0] is None: |
self.specPlot.clearImg() |
elif isinstance(args[0], basestring): |
self.specPlot.fromFile(*args, **kwargs) |
else: |
self.specPlot.updateData(*args,**kwargs)" |
112,"def showSpec(self, fname): |
""""""Draws the spectrogram if it is currently None"""""" |
if not self.specPlot.hasImg() and fname is not None: |
self.specPlot.fromFile(fname)" |
113,"def updateSpiketrace(self, xdata, ydata, plotname=None): |
""""""Updates the spike trace |
:param xdata: index values |
:type xdata: numpy.ndarray |
:param ydata: values to plot |
:type ydata: numpy.ndarray |
"""""" |
if plotname is None: |
plotname = self.responsePlots.keys()[0] |
if len(ydata.shape) == 1: |
self.responsePlots[plotname].updateData(axeskey='response', x=xdata, y=ydata) |
else: |
self.responsePlots[plotname].addTraces(xdata, ydata)" |
114,"def addRasterPoints(self, xdata, repnum, plotname=None): |
""""""Add a list (or numpy array) of points to raster plot, |
in any order. |
:param xdata: bin centers |
:param ydata: rep number |
"""""" |
if plotname is None: |
plotname = self.responsePlots.keys()[0] |
ydata = np.ones_like(xdata)*repnum |
self.responsePlots[plotname].appendData('raster', xdata, ydata)" |
115,"def updateSignal(self, xdata, ydata, plotname=None): |
""""""Updates the trace of the outgoing signal |
:param xdata: time points of recording |
:param ydata: brain potential at time points |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.