temporary wrapper for deprecated constructor
547446
private static ExecutorService wrapExecutor(final Executor executor)
    {
        return new AbstractExecutorService()
        {
            private volatile boolean isShutdown = false;
            private volatile boolean isTerminated = false;

            @Override
            public void shutdown()
            {
                isShutdown = true;
            }

            @Override
            public List<Runnable> shutdownNow()
            {
                return Lists.newArrayList();
            }

            @Override
            public boolean isShutdown()
            {
                return isShutdown;
            }

            @Override
            public boolean isTerminated()
            {
                return isTerminated;
            }

            @Override
            public boolean awaitTermination(long timeout, TimeUnit unit) throws InterruptedException
            {
                throw new UnsupportedOperationException();
            }

            @Override
            public void execute(Runnable command)
            {
                try
                {
                    executor.execute(command);
                }
                finally
                {
                    isShutdown = true;
                    isTerminated = true;
                }
            }
        };
    }
633326
def decorate_callable(self, callable_):
        """"""
        @wraps(callable_)
        def decorated(*args, **kwargs):
            # Extract timeout from request itself or use default for ioloop wrapper
            timeout = kwargs.get('timeout')
            return self.call_in_ioloop(callable_, args, kwargs, timeout)

        decorated.__doc__ = '\n\n'.join((
"""Wrapped async call. Will call in ioloop.

This call will block until the original callable has finished running on the ioloop, and
will pass on the return value. If the original callable returns a future, this call will
wait for the future to resolve and return the value or raise the exception that the future
resolves with.

Original Callable Docstring
---------------------------
""",
            textwrap.dedent(decorated.__doc__ or '')))

        return decorated
1118415
function wrapFunctions(name, obj, protoLevel, hooks, state, rules){
  if (!(obj && (util.isObject(obj) || util.isFunction(obj)))){
    return;
  }

  if (obj.__concurix_blacklisted || (obj.constructor && obj.constructor.__concurix_blacklisted)) {
    return;
  }

  if (obj.__concurix_wrapped_obj__ || !Object.isExtensible(obj)){
    return;
  }

  tagObject(obj, '__concurix_wrapped_obj__');


  protoLevel = protoLevel ? protoLevel : 0;
  util.iterateOwnProperties(obj, function(key){
    var desc = Object.getOwnPropertyDescriptor(obj, key);

    // We got a property that wasn't a property.
    if (desc == null) {
      return;
    }

    // ignore properties that cannot be set
    if (!desc.configurable || !desc.writable || desc.set){
      return;
    }

    // ignore blacklisted properties
    if (desc.value && desc.value.__concurix_blacklisted) {
      return;
    }

    // if we are supposed to skip a function, blacklist it so we don't wrap it.
    if( !rules.wrapKey(key) ){
      blacklist(obj[key]);
      return;
    }

    if ( util.isFunction(desc.value) && !wrap.isWrapper(obj[key]) && rules.wrapKey(key) ) {
      //console.log('wrapping ', key, ' for ', name, state.modInfo.top);
      obj[key] = wrap(obj[key])
                  .before(hooks.beforeHook)
                  .after(hooks.afterHook)
                  .module(name)
                  .state(state)
                  .nameIfNeeded(key)
                  .getProxy();
    } else if (util.isObject(desc.value) && !wrap.isWrapper(obj[key]) && rules.wrapKey(key)) {
      // to save cycles do not go up through the prototype chain for object-type properties
      wrapFunctions(name, desc.value, 0, hooks, state, rules);
    }
  });
  // protoLevel is how deep you want to traverse the prototype chain.
  // protoLevel = -1 - this will go all the way up excluding Object.prototype
  if (protoLevel != 0){
    protoLevel--;
    var proto = Object.getPrototypeOf(obj);
    wrapFunctions(name, proto, protoLevel, hooks, state, rules);
  }
}
82231
def deprecated_name(name):
    
    def decorator(func):
        """Decorator function."""
        def func_wrapper(self):
            """Wrapper for original function."""
            if hasattr(self, name):
                # Return the old property
                return getattr(self, name)
            else:
                return func(self)
        return func_wrapper
    return decorator
83792
private byte[] wrapClass(String className, boolean wrapConstructors, String... methodNames) throws NotFoundException, IOException, CannotCompileException {
        ClassPool cp = ClassPool.getDefault();
        CtClass ctClazz = cp.get(className);
        // constructors
        if (wrapConstructors) {
            CtConstructor[] constructors = ctClazz.getConstructors();
            for (CtConstructor constructor : constructors) {
                try {
                    constructor.insertBefore("{ com.netflix.hystrix.contrib.networkauditor.HystrixNetworkAuditorAgent.notifyOfNetworkEvent(); }");
                } catch (Exception e) {
                    throw new RuntimeException("Failed trying to wrap constructor of class: " + className, e);
                }

            }
        }
        // methods
        CtMethod[] methods = ctClazz.getDeclaredMethods();
        for (CtMethod method : methods) {
            try {
                for (String methodName : methodNames) {
                    if (method.getName().equals(methodName)) {
                        method.insertBefore("{ com.netflix.hystrix.contrib.networkauditor.HystrixNetworkAuditorAgent.handleNetworkEvent(); }");
                    }
                }
            } catch (Exception e) {
                throw new RuntimeException("Failed trying to wrap method [" + method.getName() + "] of class: " + className, e);
            }
        }
        return ctClazz.toBytecode();
    }
338180
function Deprecate(methodDescriptor) {
    let {descriptor, key} = methodDescriptor;

    let fn = descriptor.value;

    descriptor.value = function(...args) {
        console.warn(`DEPRECATE: [${key}] This function will be removed in future versions.`);
        return fn.apply(this, args);
    };

    return {
        ...methodDescriptor,
        descriptor,
    };
}
775574
def wrap(self, starter_cls):
        
        if isinstance(starter_cls, type) and issubclass(starter_cls, ProcessStarter):
            return starter_cls
        depr_msg = 'Pass a ProcessStarter for preparefunc'
        warnings.warn(depr_msg, DeprecationWarning, stacklevel=3)
        return functools.partial(CompatStarter, starter_cls)
1210353
def safe_wraps(wrapper, *args, **kwargs):
    """"""
    while isinstance(wrapper, functools.partial):
        wrapper = wrapper.func
    return functools.wraps(wrapper, *args, **kwargs)
30550
function overrideDebugFormat () {
  debug.formatArgs = function (args) {
    const prefix = new Date().toISOString() + ' ' + this.namespace + ' '
    args[0] = prefix + args[0].split('\n').join('\n' + prefix)
  }
}
449087
def decorate(decorator_cls, *args, **kwargs):
    """"""
    global _wrappers

    wrapper_cls = _wrappers.get(decorator_cls, None)
    if wrapper_cls is None:

        class PythonWrapper(decorator_cls):
            pass

        wrapper_cls = PythonWrapper
        wrapper_cls.__name__ = decorator_cls.__name__ + "PythonWrapper"
        _wrappers[decorator_cls] = wrapper_cls

    def decorator(fn):
        wrapped = wrapper_cls(fn, *args, **kwargs)
        _update_wrapper(wrapped, fn)
        return wrapped

    return decorator
1273648
def temporary_assignment(obj, attr, value):
  """"""
  original = getattr(obj, attr, None)
  setattr(obj, attr, value)
  yield
  setattr(obj, attr, original)
358893
def object_build_function(node, member, localname):
    """"""
    # pylint: disable=deprecated-method; completely removed in 2.0
    args, varargs, varkw, defaults = inspect.getargspec(member)
    if varargs is not None:
        args.append(varargs)
    if varkw is not None:
        args.append(varkw)
    func = build_function(
        getattr(member, "__name__", None) or localname, args, defaults, member.__doc__
    )
    node.add_local_node(func, localname)
1161290
def allow_bare_decorator(cls):
    

    @wraps(cls)
    def wrapper(*args, **kwargs):
        """"Wrapper for real decorator"""

        # If we weren't only passed a bare class, return class instance
        if kwargs or len(args) != 1 or not isclass(args[0]):  # pylint: disable=no-else-return
            return cls(*args, **kwargs)
        # Otherwise, pass call to instance with default values
        else:
            return cls()(args[0])

    return wrapper
1102034
def deprecated(func, *args, **kwargs):
    '''  '''
    warnings.warn(
        '{} is deprecated and should no longer be used.'.format(func),
        DeprecationWarning,
        stacklevel=3
    )
    return func(*args, **kwargs)
872823
function applyClassDecorators(classPath) {
  if (!hasClassDecorators(classPath.node)) return;

  const decorators = classPath.node.decorators || [];
  classPath.node.decorators = null;

  const name = classPath.scope.generateDeclaredUidIdentifier("class");

  return decorators
    .map(dec => dec.expression)
    .reverse()
    .reduce(function(acc, decorator) {
      return buildClassDecorator({
        CLASS_REF: t.cloneNode(name),
        DECORATOR: t.cloneNode(decorator),
        INNER: acc,
      }).expression;
    }, classPath.node);
}
369323
@Deprecated
    public static void initializeClass(Class theClass) {
        // ***HACK*** We ask the VM to create an instance
        // by voluntarily providing illegal arguments to force
        // the VM to run the class' static initializer, while
        // at the same time not running a valid constructor.

        final Constructor[] cons = theClass.getDeclaredConstructors();
        //At least one constructor is guaranteed to be there, but check anyway.
        if (cons != null) {
            if (cons.length > 0 && cons[0] != null) {
                final String[] strs = new String[NUMBER_OF_STRINGS];
                try {
                    cons[0].newInstance((Object[]) strs);
                    // Expecting an exception to be thrown by this call:
                    // IllegalArgumentException: wrong number of Arguments
                } catch (Exception e) {
                    // Ignore - we are interested only in the side
                    // effect - that of getting the static initializers
                    // invoked.  As we do not want to call a valid
                    // constructor to get this side effect, an
                    // attempt is made to call a hopefully
                    // invalid constructor - come on, nobody
                    // would have a constructor that takes in
                    // 256 String arguments ;-)
                    // (In fact, they can't - according to JVM spec
                    // section 4.10, the number of method parameters is limited
                    // to 255 by the definition of a method descriptor.
                    // Constructors count as methods here.)
                }
            }
        }
    }
956301
@Deprecated
    public static <T> DslTemplate<T> dslTemplate(Class<? extends T> cl, String template, ImmutableList<?> args) {
        return dslTemplate(cl, createTemplate(template), args);
    }