Override method of class Knget
4655
def run(self, tags, begin, end=False):
        
        if not end:
            end = begin

        # Type `H` doesn't cast anything, so we
        # manually cast the strings end to integer.
        super(KngetShell, self).run(tags, begin, int(end))
944434
async def _roundtrip(cls):
        """"""
        getters = {
            name[4:]: getattr(cls, name) for name in dir(cls)
            if name.startswith("get_") and name != "get_config"
        }
        setters = {
            name[4:]: getattr(cls, name) for name in dir(cls)
            if name.startswith("set_") and name != "set_config"
        }

        for name, getter in getters.items():
            print(">>>", name)
            value = await getter()
            print(" ->", repr(value))
            print("   ", type(value))
            setter = setters[name]
            try:
                await setter(value)
            except CallError as error:
                print(error)
                print(error.content.decode("utf-8", "replace"))
            else:
                value2 = await getter()
                if value2 != value:
                    print(
                        "!!! Round-trip failed:", repr(value),
                        "-->", repr(value2))
980822
def _make_class(cls, **kwargs):
    """"""
    kwargs = {k: (v if v is not None else getattr(cls, k, None))
              for k, v in kwargs.items()}
    # The class name contains a hash of the custom parameters.
    name = cls.__name__ + '_' + _hash(kwargs)
    if name not in _CLASSES:
        logger.log(5, "Create class %s %s.", name, kwargs)
        cls = type(name, (cls,), kwargs)
        _CLASSES[name] = cls
    return _CLASSES[name]
1001827
def hmget(self, name, keys, *args):
        ""
        args = list_or_args(keys, args)
        return self.execute_command('HMGET', name, *args)
127016
def dispatch_hook(cls, _pkt=None, *args, **kargs):
        

        cls = conf.raw_layer
        if _pkt is not None:
            ptype = orb(_pkt[0])
            return globals().get(_param_set_cls.get(ptype), conf.raw_layer)

        return cls
1223064
private static <T> Method getGetter(Class<T> clazz, Field f){
		String getterName = "get" + StringUtils.capitalize(f.getName());
		Method getter = null;
		try {
			getter = clazz.getMethod(getterName);
		} catch (Exception e) {
			logger.debug(getterName + " doesn't exist!",e);
		}
		return getter;
	}
116502
def _loadable_get_(name, self):
        ""

        func = getattr(self._attr_func_, name)
        ret = func()
        setattr(self._attr_data_, name, ret)
        setattr(
            type(self),
            name,
            property(
                functools.partial(self._simple_get_, name)
            )
        )
        delattr(self._attr_func_, name)
        return ret
678280
function layerMethod(k, fun) {
    var pos = k.match(position)[0],
        key = k.replace(position, ''),
        prop = this[key];

    if (pos === 'after') {
        this[key] = function () {
            var ret = prop.apply(this, arguments);
            var args = [].slice.call(arguments);
            args.splice(0, 0, ret);
            fun.apply(this, args);
            return ret;
        };
    } else if (pos === 'before') {
        this[key] = function () {
            fun.apply(this, arguments);
            var ret = prop.apply(this, arguments);
            return ret;
        };
    }
}
52872
function getCustomRepository(RepositoryClass, knex, entityModel) {
  validate.inheritsFrom(
    RepositoryClass,
    EntityRepository,
    'Custom repository class must inherit from EntityRepository'
  );
  return memoizedGetCustomRepository(...arguments);
}
752806
def inheritance_patch(attrs):
    """"""
    for key, obj in attrs.items():
        if isinstance(obj, attribute):
            if getattr(obj, 'attr_write', None) == AttrWriteType.READ_WRITE:
                if not getattr(obj, 'fset', None):
                    method_name = obj.write_method_name or "write_" + key
                    obj.fset = attrs.get(method_name)
1319676
private static RunIf findRunIfAnnotation(Class<?> klass) {
		while (klass != null && klass != Object.class) {
			RunIf annotation = klass.getAnnotation(RunIf.class);
			if (annotation != null) {
				return annotation;
			}

			klass = klass.getSuperclass();
		}

		return null;
	}
687933
def _unpickle_method(func_name, obj, cls):
  """"""

  if obj is None:
    return cls.__dict__[func_name].__get__(obj, cls)
  for cls in cls.__mro__:
    try:
      func = cls.__dict__[func_name]
    except KeyError:
      pass
    else:
      break
  return func.__get__(obj, cls)
1035088
private Method findSetter(Method []methods, String getterName, Class< ? > arg) {
        String setterName = "set" + getterName.substring(INT_VALUE);
	    
        for (int i = 0; i < methods.length; i++) {
            Method method = methods[i];

            if (!method.getName().equals(setterName)) {
                continue;
            }
            
            if (!method.getReturnType().equals(void.class)) {
                continue;
            }

            Class< ? > []params = method.getParameterTypes();

            if (params.length == 1 && params[0].equals(arg)) {
                return method;
            }
        }
        return null;
    }
170759
def hget(self, key, field, *, encoding=_NOTSET):
        """"""
        return self.execute(b'HGET', key, field, encoding=encoding)
26111
def pass_config(func=None, **config_kw):
    """"""

    def decorate(func):
        def new_func(*args, **kw):
            config = load_config(**config_kw)
            func(config, *args, **kw)

        return functools.update_wrapper(new_func, func)

    if func is None:
        return decorate
    else:
        return decorate(func)
1137144
def mutating_method(func):
    """"""
    def wrapper(self, *__args, **__kwargs):
        old_mutable = self._mutable
        self._mutable = True
        try:
            # Call the wrapped function
            return func(self, *__args, **__kwargs)
        finally:
            self._mutable = old_mutable
    return wrapper
845227
public static function InvokeOverrideMethod ($instance, $method_name, $vector = self::INVOKE_VECTOR_UP) {
		$target_classes = [];

		$target_class = new \ReflectionObject($instance);
		do {
			if (!$target_class->hasMethod($method_name)) {
				continue;
			}
			if ($target_class->getMethod($method_name)->getDeclaringClass()->getName() !== $target_class->getName()) {
				continue;
			}
			$target_classes[] = $target_class;
		} while ($target_class = $target_class->getParentClass());

		$ret_pool = [];
		$fetch_function = self::INVOKE_VECTOR_DOWN === $vector ? 'array_shift' : 'array_pop';
		while (($target_class = $fetch_function($target_classes)) !== null) {
			$ret_pool[] = $target_class->getMethod($method_name)->invoke($instance);
		}

		return $ret_pool;
	}