method that should be inherited by all vis classes
327456
def build(self, output_path=""):
        """"""

        self.output_path = self.checkOutputPath(output_path)
        self._buildStaticFiles()
        self.final_url = self._buildTemplates()
        printDebug("Done.", "comment")
        printDebug("=> %s" % (self.final_url), "comment")
        return self.final_url
1285212
@Override
    public void sawOpcode(int seen) {
        if (seen != Const.INVOKESPECIAL) {
            return;
        }

        String calledClassName = getClassConstantOperand();
        String calledMethodName = getNameConstantOperand();
        String calledMethodSig = getSigConstantOperand();
        if (calledClassName.equals(getSuperclassName()) && calledMethodName.equals(getMethodName())
                && calledMethodSig.equals(getMethodSig())) {
            sawCallToSuper = true;
        }

    }
135789
def weave_class(klass, aspect, methods=NORMAL_METHODS, subclasses=True, lazy=False,
                owner=None, name=None, aliases=True, bases=True, bag=BrokenBag):
    
    assert isclass(klass), "Can't weave %r. Must be a class." % klass

    if bag.has(klass):
        return Nothing

    entanglement = Rollback()
    method_matches = make_method_matcher(methods)
    logdebug("weave_class (klass=%r, methods=%s, subclasses=%s, lazy=%s, owner=%s, name=%s, aliases=%s, bases=%s)",
             klass, methods, subclasses, lazy, owner, name, aliases, bases)

    if subclasses and hasattr(klass, '__subclasses__'):
        sub_targets = klass.__subclasses__()
        if sub_targets:
            logdebug("~ weaving subclasses: %s", sub_targets)
        for sub_class in sub_targets:
            if not issubclass(sub_class, Fabric):
                entanglement.merge(weave_class(sub_class, aspect,
                                               methods=methods, subclasses=subclasses, lazy=lazy, bag=bag))
    if lazy:
        def __init__(self, *args, **kwargs):
            super(SubClass, self).__init__(*args, **kwargs)
            for attr in dir(self):
                func = getattr(self, attr, None)
                if method_matches(attr) and attr not in wrappers and isroutine(func):
                    setattr(self, attr, _checked_apply(aspect, force_bind(func)).__get__(self, SubClass))

        wrappers = {
            '__init__': _checked_apply(aspect, __init__) if method_matches('__init__') else __init__
        }
        for attr, func in klass.__dict__.items():
            if method_matches(attr):
                if ismethoddescriptor(func):
                    wrappers[attr] = _rewrap_method(func, klass, aspect)

        logdebug(" * creating subclass with attributes %r", wrappers)
        name = name or klass.__name__
        SubClass = type(name, (klass, Fabric), wrappers)
        SubClass.__module__ = klass.__module__
        module = owner or _import_module(klass.__module__)
        entanglement.merge(patch_module(module, name, SubClass, original=klass, aliases=aliases))
    else:
        original = {}
        for attr, func in klass.__dict__.items():
            if method_matches(attr):
                if isroutine(func):
                    logdebug("@ patching attribute %r (original: %r).", attr, func)
                    setattr(klass, attr, _rewrap_method(func, klass, aspect))
                else:
                    continue
                original[attr] = func
        entanglement.merge(lambda: deque((
            setattr(klass, attr, func) for attr, func in original.items()
        ), maxlen=0))
        if bases:
            super_original = set()
            for sklass in _find_super_classes(klass):
                if sklass is not object:
                    for attr, func in sklass.__dict__.items():
                        if method_matches(attr) and attr not in original and attr not in super_original:
                            if isroutine(func):
                                logdebug("@ patching attribute %r (from superclass: %s, original: %r).",
                                         attr, sklass.__name__, func)
                                setattr(klass, attr, _rewrap_method(func, sklass, aspect))
                            else:
                                continue
                            super_original.add(attr)
            entanglement.merge(lambda: deque((
                delattr(klass, attr) for attr in super_original
            ), maxlen=0))

    return entanglement
749084
function _inherit(Ctor, Parent) {
	function Dummy () {}
	Dummy.prototype = Parent.prototype
	Ctor.prototype = new Dummy()
	Ctor.prototype.supper = function () {
		Parent.apply(this, arguments)
	}
	Ctor.prototype.constructor = Ctor
	return Ctor
}
962967
def html_visit_inheritance_diagram(
    self: NodeVisitor, node: inheritance_diagram
) -> None:
    
    inheritance_graph = node["graph"]
    urls = build_urls(self, node)
    graphviz_graph = inheritance_graph.build_graph(urls)
    dot_code = format(graphviz_graph, "graphviz")
    # TODO: We can perform unflattening here
    aspect_ratio = inheritance_graph.aspect_ratio
    if aspect_ratio:
        aspect_ratio = math.ceil(math.sqrt(aspect_ratio[1] / aspect_ratio[0]))
    if aspect_ratio > 1:
        process = subprocess.Popen(
            ["unflatten", "-l", str(aspect_ratio), "-c", str(aspect_ratio), "-f"],
            stdout=subprocess.PIPE,
            stdin=subprocess.PIPE,
            stderr=subprocess.PIPE,
        )
        stdout, stderr = process.communicate(dot_code.encode())
        dot_code = stdout.decode()
    render_dot_html(self, node, dot_code, {}, "inheritance", "inheritance")
    raise SkipNode
859309
def inherit(self):
        
        # Preserve original data and merge parent
        # (original data needed for custom inheritance extensions)
        self.original_data = self.data
        self.merge()
        log.debug("Data for '{0}' inherited.".format(self))
        log.data(pretty(self.data))
        #  to all children
        for child in self.children.values():
            child.inherit()
723254
def inheritdoc(method):
    
    method.__doc__ = getattr(list, method.__name__).__doc__
    return method
353311
function(cls,superClass) {
    superClass = lib.resolve.resolve(superClass);
    factory.inherits(cls,superClass);
  }
719326
@Override
  public MethodVisitor visitMethod(int access, String name, String desc,
                                   String signature, String[] exceptions) {
    MethodVisitor mv = cv.visitMethod(access | Opcodes.ACC_SYNTHETIC,
                                      name, desc, signature, exceptions);
    return new AccessMethodAdapter(mv);
  }
799099
def p_inheritance(self, p):
        """"""
        if p[1]:
            if p[2].nullable:
                msg = 'Reference cannot be nullable.'
                self.errors.append((msg, p.lineno(1), self.path))
            else:
                p[0] = p[2]
1286952
private Method getDelegateMethod(String title, Context ctxt)
	{
		Method m = delegateMethods.get(title);

		if (m == null)
		{
			List<PPattern> plist = null;
			String mname = title.substring(0, title.indexOf('('));

			// FIXME: this is to handle inheritance in the same way as VDMJ did. See CSV and IO, where the subclass
			// declared methods is in the tail of the list
			List<PDefinition> defs = new Vector<PDefinition>(definitions);
			Collections.reverse(defs);

			for (PDefinition d : defs)
			{
				if (d.getName().getName().equals(mname))
				{
					plist = null;

					if (ctxt.assistantFactory.createPDefinitionAssistant().isOperation(d))
					{
						if (d instanceof AExplicitOperationDefinition)
						{
							AExplicitOperationDefinition e = (AExplicitOperationDefinition) d;
							plist = e.getParameterPatterns();
						}
						else if (d instanceof AImplicitOperationDefinition)
						{
							AImplicitOperationDefinition e = (AImplicitOperationDefinition) d;
							plist = ctxt.assistantFactory.createAImplicitOperationDefinitionAssistant().getParamPatternList(e);
						}
					}
					else if (ctxt.assistantFactory.createPDefinitionAssistant().isFunction(d))
					{
						if (d instanceof AExplicitFunctionDefinition)
						{
							AExplicitFunctionDefinition e = (AExplicitFunctionDefinition) d;
							plist = e.getParamPatternList().get(0);
						}
						else if (d instanceof AImplicitFunctionDefinition)
						{
							AImplicitFunctionDefinition e = (AImplicitFunctionDefinition) d;
							plist = ctxt.assistantFactory.createAImplicitFunctionDefinitionAssistant().getParamPatternList(e).get(0);
						}
					}

					if (toTitle(mname, plist).equals(title))
					{
						break;
					}
				}
			}

			LexNameList anames = new LexNameList();
			List<Class<?>> ptypes = new Vector<Class<?>>();

			if (plist != null)
			{
				for (PPattern p : plist)
				{
					if (p instanceof AIdentifierPattern)
					{
						AIdentifierPattern ip = (AIdentifierPattern) p;
						anames.add(ip.getName());
						ptypes.add(Value.class);
					} else
					{
						throw new InternalException(56, "Native method cannot use pattern arguments: "
								+ title);
					}
				}

				delegateArgs.put(title, anames);
			} else
			{
				throw new InternalException(57, "Native member not found: "
						+ title);
			}

			// search with no context and default package + org.overture.lib
			InternalException searchException = null;
			Method basicMathod = null;
			try {
				basicMathod = getDelegateMethod(mname, ptypes);
			}catch(InternalException e)
			{
				searchException = e;
			}

			// search with context and default package + org.overture.lib this is preferred over no context
            try {
                ptypes.add(0,Context.class);
                m = getJavaDelegateMethod(mname, ptypes);
            }catch(InternalException e)
            {
                // Fine
            }

			if(m==null)
			{
				m = basicMathod;
			}



			if(m==null && searchException!=null)
			{
				throw searchException;
			}

			delegateMethods.put(title, m);
		}

		return m;
	}
357444
def as_view(cls, view_type, *init_args, **init_kwargs):
        
        global _method

        new_cls = type(
            cls.__name__ + '_' + _BridgeMixin.__name__ + '_restless',
            (_BridgeMixin, cls._request_handler_base_,),
            dict(
                __resource_cls__=cls,
                __resource_args__=init_args,
                __resource_kwargs__=init_kwargs,
                __resource_view_type__=view_type)
        )

        """
        Add required http-methods to the newly created class
        We need to scan through MRO to find what functions users declared,
        and then add corresponding http-methods used by Tornado.
        """
        bases = inspect.getmro(cls)
        bases = bases[0:bases.index(Resource)-1]
        for k, v in cls.http_methods[view_type].items():
            if any(v in base_cls.__dict__ for base_cls in bases):
                setattr(new_cls, k.lower(), _method)

        return new_cls
640216
public void invokevirtual(ExecutableElement method) throws IOException
    {
        if (method.getEnclosingElement().getKind() == ElementKind.INTERFACE)
        {
            int index = subClass.resolveInterfaceMethodIndex(method);
            invokeinterface(index, argumentCount(method.getParameters()));
        }
        else
        {
            int index = subClass.resolveMethodIndex(method);
            invokevirtual(index);
        }
    }
105865
function inherit(x, props) {
  var r = Object.create(x);
  return extend(r, props);
}
1276348
def inherited(subclass)
      subclass._arguments = []
      subclass._description = ''
      subclass._abstract = false
      subclass._skip_options = false
      subclass._exe_name = @_exe_name
      subclass._default_priority = @_default_priority.to_f / 2
      subclass._priority = 0
      super
    end
965943
function inheritParent(constructor, parent) {
        var x,
            binds = parent[$class].binds,
            key,
            value,
            classId = constructor[$class].id;

        // Inherit binds
        for (x = binds.length - 1; x >= 0; x -= 1) {
            if (binds[x].substr(0, 2) !== '__') {
                constructor[$class].binds.push(binds[x]);
            }
        }

        // Inherit methods and properties
        for (key in parent[$class].methods) {
            value = parent[$class].methods[key];
            constructor[$class].methods[key] = value;

            if (value.isProtected) {
                value.allowed.push(classId);
            }
        }

        for (key in parent[$class].properties) {
            value = parent[$class].properties[key];
            constructor[$class].properties[key] = value;

            if (value.isProtected) {
                value.allowed.push(classId);
            }
        }

        // Inherit static methods and properties
        for (key in parent[$class].staticMethods) {
            value = parent[$class].staticMethods[key];

            if (!value.isPrivate) {
                constructor[$class].staticMethods[key] = value;
                constructor[key] = value.implementation;

                if (value.isProtected) {
                    value.allowed.push(classId);
                }
            }
        }

        for (key in parent[$class].staticProperties) {
            value = parent[$class].staticProperties[key];

            if (!value.isPrivate) {
                constructor[$class].staticProperties[key] = value;
                constructor[key] = value.value;
                if (value.isProtected) {
                    value.allowed.push(classId);
                }

            }
        }

        // Make inheritance also for the simple constructor (for the inspect)
        if (hasDefineProperty) {
            inheritPrototype(constructor[$class].simpleConstructor, parent[$class].simpleConstructor);
        }

        // Inherit locked and forceUnlocked
        if (hasOwn(parent[$class], 'locked')) {
            constructor[$class].locked = parent[$class].locked;
        }
        if (hasOwn(parent[$class], 'forceUnlocked')) {
            constructor[$class].forceUnlocked = parent[$class].forceUnlocked;
        }

        obfuscateProperty(constructor, '$parent', parent);

        // Inherit implemented interfaces
        constructor[$class].interfaces = [].concat(parent[$class].interfaces);
    }
234388
public static <VH extends PeasyViewHolder> VH GetViewHolder(PeasyViewHolder vh, Class<VH> cls) {
        return cls.cast(vh);
    }