• Facebook
  • Twitter
  • Reddit
  • StumbleUpon
  • Digg
  • email

All Samples(133178)  |  Call(4766)  |  Derive(128309)  |  Import(103)
The most base type

src/s/y/sympy-HEAD/examples/advanced/relativity.py   sympy(Download)
class MT(object):
    def __init__(self,m):
        self.gdd=m
        self.guu=m.inv()
 
    def __str__(self):
        return "g_dd =\n" + str(self.gdd)
class G(object):
    def __init__(self,g,x):
        self.g = g
        self.x = x
 
    def udd(self,i,k,l):
        g=self.g
class Riemann(object):
    def __init__(self,G,x):
        self.G = G
        self.x = x
 
    def uddd(self,rho,sigma,mu,nu):
        G=self.G
class Ricci(object):
    def __init__(self,R,x):
        self.R = R
        self.x = x
        self.g = R.G.g
 
    def dd(self,mu,nu):

src/s/e/secret-squirrel-lib-HEAD/packages/jinja2/examples/rwbench/rwbench.py   secret-squirrel-lib(Download)
class Article(object):
 
    def __init__(self, id):
        self.id = id
        self.href = '/article/%d' % self.id
        self.title = generate_lorem_ipsum(1, False, 5, 10)
        self.user = choice(users)
        self.body = generate_lorem_ipsum()
        self.pub_date = datetime.utcfromtimestamp(randrange(10 ** 9, 2 * 10 ** 9))
        self.published = True
 
 
class User(object):

src/p/y/python-inject-HEAD/Examples/django_example/views.py   python-inject(Download)
class Hello(object):
 
    '''Hello string with a request counter.'''
 
    counter = 0
 
    def __init__(self):
class Text1(object):
 
    @inject.param('app_started_at', 'app_started_at')
    def __init__(self, app_started_at):
        self.app_started_at = app_started_at
 
    def __str__(self):
        return 'The application started serving requests at <b>%s</b>.<br />' \
               'This value is application scoped. In other words,<br />' \
               'it has been created only once for the whole<br />' \
               'application.' % self.app_started_at
 
 
class Text2(object):
class Text3(object):
 
    @inject.param('req_started_at', 'req_started_at')
    @inject.param('req_ended_at', datetime, bindto=datetime.now)
    def __str__(self, req_started_at, req_ended_at):
        return 'The request ended at <b>%s</b>,<br />' \
               'but started at <b>%s</b>.<br />' \

src/b/a/badger-lib-HEAD/packages/pyparsing/examples/adventureEngine.py   badger-lib(Download)
class Room(object):
    def __init__(self, desc):
        self.desc = desc
        self.inv = []
        self.gameOver = False
        self.doors = [None,None,None,None]
 
class Item(object):
    items = {}
    def __init__(self, desc):
        self.desc = desc
        self.isDeadly = False
        self.isFragile = False
        self.isBroken = False
class Command(object):
    "Base class for commands"
    def __init__(self, verb, verbProg):
        self.verb = verb
        self.verbProg = verbProg
 
    @staticmethod
class Parser(object):
    def __init__(self):
        self.bnf = self.makeBNF()
 
    def makeCommandParseAction( self, cls ):
        def cmdParseAction(s,l,tokens):
            return cls(tokens)
class Player(object):
    def __init__(self, name):
        self.name = name
        self.gameOver = False
        self.inv = []
 
    def moveTo(self, rm):

src/s/q/sqlalchemy-HEAD/examples/poly_assoc/poly_assoc.py   sqlalchemy(Download)
class Address(object):
    def __init__(self, type):
        self.addressable_type = type
    member = property(lambda self: getattr(self, '_backref_%s' % self.addressable_type))
 
def addressable(cls, name, uselist=True):
    """addressable 'interface'.
class User(object):
    pass
 
mapper(User, users)
addressable(User, 'addresses', uselist=True)
 
######
# sample # 2, orders
 
orders = Table("orders", metadata,
    Column('id', Integer, primary_key=True),
    Column('description', String(50), nullable=False))
 
class Order(object):

src/s/q/sqlalchemy-HEAD/examples/derived_attributes/attributes.py   sqlalchemy(Download)
class MethodDescriptor(object):
    def __init__(self, func):
        self.func = func
    def __get__(self, instance, owner):
        if instance is None:
            return new.instancemethod(self.func, owner, owner.__class__)
        else:
            return new.instancemethod(self.func, instance, owner)
 
class PropertyDescriptor(object):
class BaseInterval(object):
    @hybrid
    def contains(self,point):
        return (self.start <= point) & (point < self.end)
 
    @hybrid
    def intersects(self, other):

src/i/r/ironruby-HEAD/Languages/IronPython/Samples/Direct3D/checkpoints/checkpoint2.py   ironruby(Download)
class SceneManager(object):
    def __init__(self):
        self.Device = None
        self.Paused = False
        self.Background = System.Drawing.Color.Black
 
    def InitGraphics(self, handle):

src/i/r/ironruby-HEAD/Languages/IronPython/Samples/Direct3D/checkpoints/checkpoint1.py   ironruby(Download)
class SceneManager(object):
    def __init__(self):
        pass
 
    def InitGraphics(self, handle):
        return True
 

src/r/e/reporter-lib-HEAD/packages/sqlalchemy/examples/postgis/postgis.py   reporter-lib(Download)
class GisElement(object):
    """Represents a geometry value."""
 
    @property
    def wkt(self):
        return func.AsText(literal(self, Geometry))
 
class GISDDL(object):
    """A DDL extension which integrates SQLAlchemy table create/drop 
    methods with PostGis' AddGeometryColumn/DropGeometryColumn functions.
 
    Usage::
 
        sometable = Table('sometable', metadata, ...)

src/c/h/changingsong-HEAD/trunk/samples/plugin_sys/pyutilib/pyutilib/component/core/core.py   changingsong(Download)
class PluginGlobals(object):
 
    def __init__(self):                         #pragma:nocover
        """Disable construction."""
        raise PluginError, "The PluginGlobals class should not be created."
 
    """The registry of interfaces, by name"""
class Interface(object):
    """
    Marker base class for extension point interfaces.  This class
    is not intended to be instantiated.  Instead, the declaration
    of subclasses of Interface are recorded, and these 
    classes are used to define extension points.
    """
 
    __metaclass__ = InterfaceMeta
 
 
class ExtensionPoint(object):
class PluginEnvironment(object):
 
    def __init__(self, name=None, bootstrap=False):
        if name is None:
            self.name = "env"+str(PluginGlobals.next_id())
        else:
            self.name = name
class Plugin(object):
    """Base class for plugins.  A `service' is an instance of a Plugin.
 
    Every Plugin class can declare what extension points it provides, as well as
    what extension points of other Plugin's it extends.
    """
 

Previous  5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13  Next