This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from tweedledum import Model, ModelAdapter, Thingy | |
if __name__ == '__main__': | |
model = Model() | |
model.thingy = Thingy(dee_count = 42, dum_count = 24) | |
import enaml | |
import enaml.qt.qt_application | |
app = enaml.qt.qt_application.QtApplication() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numba | |
def foo(x): | |
return 1 < x < 7 | |
def bar(x): | |
_x_0 = x | |
_x_1 = 1 < _x_0 | |
if not _x_1: | |
_x_2 = False |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numba | |
import numba.types | |
src = ''' | |
from __future__ import division | |
import numba.types | |
def f(x): | |
j = numba.types.int32(0) | |
return j+x |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from enaml.layout.api import ( | |
hbox, vbox, align, spacer, | |
) | |
from enaml.widgets.api import ( | |
MainWindow, PushButton, ImageView, Container | |
) | |
import enaml | |
import os | |
def openResource(path, mode='r'): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from PySide import QtCore | |
from enaml.qt.qt_application import QtApplication | |
class UI(QtCore.QObject): | |
def __init__(self, **kwargs): | |
super(UI, self).__init__() | |
print "got here" | |
self.app = QtApplication() | |
print "didn't get here" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import yaml | |
import jsonschema | |
raw_schema = r''' | |
"$schema": "http://json-schema.org/draft-04/schema#" | |
type: object | |
properties: | |
debug: {$ref: "#/definitions/debug"} | |
required: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import tables as pt | |
import subprocess | |
import random | |
import re | |
import os | |
import zlib | |
class H5fileContext(object): | |
def __init__(self, filename, groupname): |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
os.environ['QT_API'] = 'pyside' | |
from PySide.QtCore import QTimer, QObject | |
from atom.api import Atom, Event, Bool | |
from enaml.core.api import Include | |
from enaml.widgets.api import ( | |
Window, Container, PopupView, Form, Label, PushButton | |
) | |
class Model(Atom): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from enaml.widgets.api import Window, Container, PushButton, Timer | |
class StateMachine(object): | |
# normally handles some complicated view controller process | |
# but here we just want to listen for the timer timeout | |
def __init__(self, view): | |
self.view = view | |
self.timer = Timer() | |
self.timer.interval = 350 | |
self.timer.single_shot = True |