All Samples(481) | Call(174) | Derive(0) | Import(307)
instancemethod(function, instance, class) Create an instance method object.
src/p/y/py-lessly-HEAD/src/lessly/actor/announcer.py py-lessly(Download)
__all__ = ('Announcer', 'AnnouncingMethod', 'AnnouncingClassMethod')
from collections import defaultdict
from types import MethodType, FunctionType
from functools import wraps
from lessly.actor.publisher import Multicaster, Publisher
from lessly.fn import curry
from lessly.fn.method import methodize, find_in_mro
def announce_method(method):
instance = method.__self__
def wrapper(self, *args, **kw):
result = method(*args, **kw)
self.fire( *('call:'+method.__name__,self,result)+args, **kw )
return result
return MethodType(wraps(method)(wrapper), instance, type(instance))
src/z/a/zamboni-lib-HEAD/lib/python/logilab/common/decorators.py zamboni-lib(Download)
""" __docformat__ = "restructuredtext en" from types import MethodType from time import clock, time import sys, re
def __get__(self, instance, objtype):
if instance is None:
return MethodType(self.func, objtype, objtype.__class__)
return MethodType(self.func, instance, objtype)
def __set__(self, instance, value):
raise AttributeError("can't set attribute")
src/i/r/ironruby-HEAD/External.LCA_RESTRICTED/Languages/IronPython/27/Lib/socket.py ironruby(Download)
import _socket
from _socket import *
from functools import partial
from types import MethodType
try:
import _ssl
p = partial(meth,_m)
p.__name__ = _m
p.__doc__ = getattr(_realsocket,_m).__doc__
m = MethodType(p,None,_socketobject)
setattr(_socketobject,_m,m)
socket = SocketType = _socketobject
src/i/r/ironruby-HEAD/External.LCA_RESTRICTED/Languages/CPython/27/Lib/socket.py ironruby(Download)
import _socket
from _socket import *
from functools import partial
from types import MethodType
try:
import _ssl
p = partial(meth,_m)
p.__name__ = _m
p.__doc__ = getattr(_realsocket,_m).__doc__
m = MethodType(p,None,_socketobject)
setattr(_socketobject,_m,m)
socket = SocketType = _socketobject
src/p/y/pypy3-HEAD/pypy/lib/tputil.py pypy3(Download)
""" application level support module for transparent proxies. """ from __pypy__ import tproxy from types import MethodType
if self.opname == "__getattribute__":
if (isinstance(res, MethodType) and
res.im_self is self.instance):
res = MethodType(res.im_func, self.proxyobj, res.im_class)
if res is self.obj:
res = self.proxyobj
return res
src/a/s/asibsync-HEAD/src/asibsync/asibsync/util.py asibsync(Download)
def noop(self, *objs):
pass
instance.log = types.MethodType(log, instance, instance.__class__)
instance.debug_log = types.MethodType((log if debug else noop), instance, instance.__class__)
instance.debug_log('Debug mode enabled')
def profile(*methods):
for method in methods:
instance = method.im_self
profiled_func = profiled(method.__func__, header_str = method.im_class.__name__ + '.')
profiled_method = types.MethodType(profiled_func, instance, instance.__class__)
src/p/y/pypy-HEAD/pypy/objspace/std/objspace.py pypy(Download)
exprargs, expr,
miniglobals, mm)
boundmethod = types.MethodType(func, self, self.__class__)
setattr(self, name, boundmethod) # store into 'space' instance
elif self.config.objspace.std.builtinshortcut:
if name.startswith('inplace_'):
src/p/y/pypy-HEAD/lib_pypy/tputil.py pypy(Download)
""" application level support module for transparent proxies. """ from __pypy__ import tproxy from types import MethodType
if self.opname == "__getattribute__":
if (isinstance(res, MethodType) and
res.im_self is self.instance):
res = MethodType(res.im_func, self.proxyobj, res.im_class)
if res is self.obj:
res = self.proxyobj
return res
src/p/y/pyvm-HEAD/projects/python_in_a_can/trunk/win32/python-2.7/Lib/socket.py pyvm(Download)
import _socket
from _socket import *
from functools import partial
from types import MethodType
try:
import _ssl
p = partial(meth,_m)
p.__name__ = _m
p.__doc__ = getattr(_realsocket,_m).__doc__
m = MethodType(p,None,_socketobject)
setattr(_socketobject,_m,m)
socket = SocketType = _socketobject
src/a/s/Astropysics-0.1.dev-r699/astropysics/models/core.py Astropysics(Download)
import pymc
from operator import isSequenceType
from inspect import getargspec
from types import MethodType
if set(priors.keys()) != set(self.params):
raise ValueError("input priors don't match function params")
result. You have been warned...
"""
from types import MethodType
import inspect
from functools import partial
if calltype is None:
if xtrans and ytrans:
self._filterfunc = MethodType(lambda self,x,*pars:ytrans(self.f(xtrans(x),*pars)),self,self.__class__)
elif xtrans:
self._filterfunc = MethodType(lambda self,x,*pars:self.f(xtrans(x),*pars),self,self.__class__)
elif ytrans:
self._filterfunc = MethodType(lambda self,x,*pars:ytrans(self.f(x,*pars)),self,self.__class__)
kwargs[xkw] = x
return newf(**kwargs)
self._filterfunc = MethodType(callfunc,self,self.__class__)
self._filterfunctype = (calltype,xts,yts)
1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 Next