Assign the super dfs in terms of the deriving class's type parameters
324401
private void assignSuperDfs( IDynamicFunctionSymbol dfsDelegate, IGosuClass owner )
  {
    IDynamicFunctionSymbol rawSuperDfs = dfsDelegate.getSuperDfs();
    if( rawSuperDfs instanceof DynamicFunctionSymbol )
    {
      while( rawSuperDfs.getBackingDfs() instanceof DynamicFunctionSymbol && rawSuperDfs.getBackingDfs() != rawSuperDfs )
      {
        rawSuperDfs = rawSuperDfs.getBackingDfs();
      }
      IType ownersType = rawSuperDfs.getDeclaringTypeInfo().getOwnersType();
      if( !IGosuClass.ProxyUtil.isProxy( ownersType ) )
      {
        IType superOwner = TypeLord.findParameterizedType( owner, ownersType );
        if( superOwner == null )
        {
          superOwner = ownersType;
        }
        setSuperDfs( ((DynamicFunctionSymbol)rawSuperDfs).getParameterizedVersion( (IGosuClass)superOwner ) );
      }
    }
  }
314017
def deftypes(self):
    """"""
    for f in self.body:
        if (hasattr(f, '_ctype')
                and (f._ctype._storage == Storages.TYPEDEF
                    or (f._name == '' and isinstance(f._ctype, ComposedType)))):
            yield f
244067
function _gpfProcessDefineParamsCheck (params) {
    _gpfAsserts({
        "name is required (String)": "string" === typeof params[_GPF_DEFINE_PARAM_NAME],
        "Super is required and must resolve to a Constructor": params[_GPF_DEFINE_PARAM_SUPER] instanceof Function,
        "definition is required (Object)": "object" === typeof params[_GPF_DEFINE_PARAM_DEFINITION]
    });
}
1304969
private <T extends ProgramElementDoc> void mapTypeParameters(Map<String,List<T>> map, Object doc,
            T holder) {
        TypeVariable[] typeVariables;
        if (doc instanceof ClassDoc) {
            typeVariables = ((ClassDoc) doc).typeParameters();
        } else if (doc instanceof WildcardType) {
            for (Type extendsBound : ((WildcardType) doc).extendsBounds()) {
                addTypeParameterToMap(map, extendsBound, holder);
            }
            for (Type superBound : ((WildcardType) doc).superBounds()) {
                addTypeParameterToMap(map, superBound, holder);
            }
            return;
        } else if (doc instanceof ParameterizedType) {
            for (Type typeArgument : ((ParameterizedType) doc).typeArguments()) {
                addTypeParameterToMap(map, typeArgument, holder);
            }
            return;
        } else if (doc instanceof ExecutableMemberDoc) {
            typeVariables = ((ExecutableMemberDoc) doc).typeParameters();
        } else if (doc instanceof FieldDoc) {
            Type fieldType = ((FieldDoc) doc).type();
            mapTypeParameters(map, fieldType, holder);
            return;
        } else {
            return;
        }
        for (TypeVariable typeVariable : typeVariables) {
            for (Type bound : typeVariable.bounds()) {
                addTypeParameterToMap(map, bound, holder);
            }
        }
    }
1321395
def withSize(cls, minimum, maximum):
        

        class X(cls):
            subtypeSpec = cls.subtypeSpec + constraint.ValueSizeConstraint(
                minimum, maximum)

        X.__name__ = cls.__name__
        return X
253381
private void compileJavaInteropBridgeConstructor( DynamicFunctionSymbol dfs )
  {
    DynamicFunctionSymbol copy = new DynamicFunctionSymbol( dfs );
    copy.setValue( null );
    copy.setInitializer( null );
    ConstructorStatement fs = new ConstructorStatement( true );
    fs.setDynamicFunctionSymbol( copy );
    fs.setSynthetic( true );
    MethodCallExpression expr = new MethodCallExpression();
    expr.setType( JavaTypes.pVOID() );
    List<ISymbol> args = dfs.getArgs();
    Expression[] exprArgs = new Expression[args.size()];
    for( int i = 0; i < args.size(); i++ )
    {
      ISymbol arg = args.get( i );

      Identifier id = new Identifier();
      id.setSymbol( arg, dfs.getSymbolTable() );
      id.setType( arg.getType() );
      exprArgs[i] = id;
    }
    expr.setArgs( exprArgs );
    expr.setFunctionSymbol( new ThisConstructorFunctionSymbol( dfs, true ) );
    MethodCallStatement stmt = new MethodCallStatement();
    stmt.setMethodCall( expr );
    stmt.setSynthetic( true );
    copy.setValue( stmt );
    copy.setDeclFunctionStmt( fs );

    int iModifiers = getModifiers( copy );

    List<IRSymbol> parameters = new ArrayList<>();
    maybeGetEnumSuperConstructorSymbols( parameters );
    for( ISymbol param : copy.getArgs() )
    {
      parameters.add( makeParamSymbol( copy, param ) );
    }

    setUpFunctionContext( copy, true, parameters );
    FunctionStatementTransformer funcStmtCompiler = new FunctionStatementTransformer( copy, _context );
    IRStatement methodBody = funcStmtCompiler.compile();
    IExpression annotationDefault = copy.getAnnotationDefault();
    Object[] annotationDefaultValue = null;
    if( annotationDefault != null )
    {
      annotationDefaultValue = new Object[] {CompileTimeExpressionParser.convertValueToInfoFriendlyValue( annotationDefault.evaluate(), getGosuClass().getTypeInfo() )};
    }

    IRMethodStatement methodStatement = new IRMethodStatement(
      methodBody,
      "<init>",
      iModifiers,
      copy.isInternal(),
      IRTypeConstants.pVOID(),
      copy.getReturnType(),
      parameters,
      copy.getArgTypes(),
      copy.getType(), annotationDefaultValue);

    methodStatement.setAnnotations( getIRAnnotations( makeAnnotationInfos( copy.getModifierInfo().getAnnotations(), getGosuClass().getTypeInfo() ) ) );
    _irClass.addMethod( methodStatement );
  }
938319
def _generate_struct_class_init(self, data_type):
        

        args = ['self']
        for field in data_type.all_fields:
            field_name_reserved_check = fmt_var(field.name, True)
            args.append('%s=None' % field_name_reserved_check)

        self.generate_multiline_list(args, before='def __init__', after=':')

        with self.indent():
            lineno = self.lineno

            # Call the parent constructor if a super type exists
            if data_type.parent_type:
                class_name = class_name_for_data_type(data_type)
                all_parent_fields = [fmt_func(f.name, check_reserved=True)
                              for f in data_type.parent_type.all_fields]
                self.generate_multiline_list(
                    all_parent_fields,
                    before='super({}, self).__init__'.format(class_name))

            # initialize each field
            for field in data_type.fields:
                field_var_name = fmt_var(field.name)
                self.emit('self._{}_value = None'.format(field_var_name))
                self.emit('self._{}_present = False'.format(field_var_name))

            # handle arguments that were set
            for field in data_type.fields:
                field_var_name = fmt_var(field.name, True)
                self.emit('if {} is not None:'.format(field_var_name))
                with self.indent():
                    self.emit('self.{0} = {0}'.format(field_var_name))

            if lineno == self.lineno:
                self.emit('pass')
            self.emit()
329185
def _set_up_schema_elements_of_kind(self, class_name_to_definition, kind, class_names):
        """"""
        allowed_duplicated_edge_property_names = frozenset({
            EDGE_DESTINATION_PROPERTY_NAME, EDGE_SOURCE_PROPERTY_NAME
        })
        orientdb_base_classes = frozenset({
            ORIENTDB_BASE_VERTEX_CLASS_NAME,
            ORIENTDB_BASE_EDGE_CLASS_NAME,
        })

        for class_name in class_names:
            class_definition = class_name_to_definition[class_name]

            class_fields = class_definition.get('customFields')
            if class_fields is None:
                # OrientDB likes to make empty collections be None instead.
                # We convert this field back to an empty dict, for our general sanity.
                class_fields = dict()

            abstract = class_definition['abstract']
            if class_name in orientdb_base_classes:
                # Special-case the V and E base classes:
                # OrientDB won't let us make them abstract, but we don't want to create
                # any vertices or edges with those types either.
                # Pretend they are marked abstract in OrientDB's schema.
                abstract = True

            property_name_to_descriptor = {}
            all_property_lists = (
                class_name_to_definition[inherited_class_name]['properties']
                for inherited_class_name in self._inheritance_sets[class_name]
            )
            links = {EDGE_DESTINATION_PROPERTY_NAME: [], EDGE_SOURCE_PROPERTY_NAME: []}
            for property_definition in chain.from_iterable(all_property_lists):
                property_name = property_definition['name']

                # The only properties we allow to be redefined are the in/out properties
                # of edge classes. All other properties may only be defined once
                # in the entire inheritance hierarchy of any schema class, of any kind.
                duplication_allowed = all((
                    property_name in allowed_duplicated_edge_property_names,
                    kind == SchemaElement.ELEMENT_KIND_EDGE
                ))

                if not duplication_allowed and property_name in property_name_to_descriptor:
                    raise AssertionError(u'The property "{}" on class "{}" is defined '
                                         u'more than once, this is not allowed!'
                                         .format(property_name, class_name))

                property_descriptor = self._create_descriptor_from_property_definition(
                    class_name, property_definition, class_name_to_definition)

                if property_name in allowed_duplicated_edge_property_names:
                    links[property_name].append(property_descriptor)
                else:
                    property_name_to_descriptor[property_name] = property_descriptor

            for property_name in allowed_duplicated_edge_property_names:
                elements = {
                    property_descriptor.qualifier
                    for property_descriptor in links[property_name]
                }
                # If there are multiple in/out properties, we choose to include the one that
                # is a subclass of all the elements present in the in/out properties.
                for property_descriptor in links[property_name]:
                    subclass_set = self._subclass_sets[property_descriptor.qualifier]
                    if len(elements.intersection(subclass_set)) == 1:
                        current_descriptor = property_name_to_descriptor.get(property_name, None)
                        if current_descriptor and current_descriptor != property_descriptor:
                            raise AssertionError(u'There already exists property "{}" in addition '
                                                 u'to property "{}" which is a subclass of all '
                                                 u'in/out properties for class "{}".'
                                                 .format(current_descriptor,
                                                         property_descriptor, class_name))
                        property_name_to_descriptor[property_name] = property_descriptor

                if (property_name not in property_name_to_descriptor and not abstract and
                        kind == SchemaElement.ELEMENT_KIND_EDGE):
                    raise AssertionError(u'For property "{}" of non-abstract edge class "{}", '
                                         u'no such subclass-of-all-elements exists.'
                                         .format(property_name, class_name))

            self._elements[class_name] = SchemaElement(class_name, kind, abstract,
                                                       property_name_to_descriptor, class_fields)
924234
private void generateUMLClass(PackageDoc[] pkgs) throws IOException {
        for (int i=0; i < pkgs.length; i++) {
            // generate statistics
            generateUMLClass(pkgs[i].ordinaryClasses(), pkgs[i].name());
        }
    }
979628
function (classDef) {
            var attributes,
                Super;
            while (classDef) { // !undefined && !null
                attributes = classDef._attributes;
                if (attributes) {
                    attributes._copy(this);
                }
                Super = classDef._Super;
                if (Super === Object) { // Can't go upper
                    break;
                } else {
                    classDef = _gpfGetClassDefinition(Super);
                }
            }
            return this;
        }
713236
def dfs(graph, func, head, reverse=None):
    
    todo = deque()
    todo.append(head)
    path = deque()
    done = set()
    while todo:
        node = todo.popleft()
        if node in done:
            path.pop()
            continue

        done.add(node)
        path.append(node)
        result = func(node, path, graph)
        if result:
            if reverse:
                children = graph.get_parents(node)
            else:
                children = graph.get_children(node)
            todo.extend(children)
808454
function setSuperType(s) {
  const ss = _.isArray(s) ? s : [s]
  this.superClasses = _.uniq(this.superClasses.concat(ss))
}
160280
private void addSuperClasses(Integer directSuperClass,
			ClassRecord subClassRecord) {
		if (subClassRecord.superClasses.contains(directSuperClass)) {
			return;
		}
		subClassRecord.superClasses.add(directSuperClass);
		ClassRecord superClassRecord = getClassRecord(directSuperClass);
		if (superClassRecord == null) {
			return;
		}

		for (Integer superClass : superClassRecord.directSuperClasses) {
			addSuperClasses(superClass, subClassRecord);
		}
	}
1092715
def parameterized_class(name, params, bases=Parameterized):
    
    if not (isinstance(bases, list) or isinstance(bases, tuple)):
          bases=[bases]
    return type(name, tuple(bases), params)
864667
function _gpfGenSuperMember (superMethod, method) {
    return function GpfSuperableMethod () {
        var previousSuper = this._super,
            result;
        // Add a new ._super() method pointing to the base class member
        this._super = superMethod;
        try {
            // Execute the method
            result = method.apply(this, arguments);
        } finally {
            // Remove it after execution
            if (undefined === previousSuper) {
                delete this._super;
            } else {
                this._super = previousSuper;
            }
        }
        return result;
    };
}
253757
function _gpfClassSuperCreate (superMember) {
    var superMethod;
    if (typeof superMember === "function") {
        superMethod = superMember;
    } else {
        superMethod = _gpfClassNoSuper;
    }
    return _gpfClassSuperCreateWithSameSignature(superMethod);
}
807282
function _GpfClassDefinition (qName, superClassDef) {
    _gpfAssert(!superClassDef || superClassDef instanceof _GpfClassDefinition, "Expected a _GpfClassDefinition");
    /*jshint validthis:true*/ // constructor
    /*eslint-disable no-invalid-this*/
    this._qName = qName;
    this._members = Object.create(_gpfLinkToSuperClassDef(this, superClassDef));
    /*eslint-enable no-invalid-this*/
}