Creates a nested interface for the given type (using a module with the same name as the type).
773841
public static TSInterfaceType getNestedInterface(TSType type, String name, boolean create) {
		TSModule module = getNestedTypeContainer(type, create);
		if (module == null && !create) {
			return null;
		} else if (module == null) {
			throw new IllegalStateException("cannot setup interface as no parent container is available");
		}

		for (TSElement element : module.getElements()) {
			if (element instanceof TSInterfaceType && ((TSInterfaceType) element).getName().equals(name)) {
				return (TSInterfaceType) element;
			}
		}
		if (create) {
			TSInterfaceType interfaceType = new TSInterfaceType();
			interfaceType.setExported(true);
			interfaceType.setName(name);
			interfaceType.setParent(module);
			module.getElements().add(interfaceType);
			return interfaceType;
		} else {
			return null;
		}
	}
1283734
def create_inst(inst_type, **init_args):
    ''''''
    args, kwargs = get_init_args(inst_type, init_args)
    return inst_type(*args, **kwargs)
576452
private Mapper createMapper(ParameterizedType type) {
    Type rawType = type.getRawType();
    if (!(rawType instanceof Class)) {
      // Don't see how this could ever happen, but just in case...
      throw new IllegalArgumentException(
          String.format("Raw type of ParameterizedType is not a class: %s", type));
    }
    Class<?> rawClass = (Class<?>) rawType;
    Mapper mapper;
    if (Map.class.isAssignableFrom(rawClass)) {
      mapper = new MapMapper(type);
    } else {
      throw new NoSuitableMapperException(String.format("Unsupported type: %s", type));
    }
    return mapper;
  }
1146437
public GinjectorBindings createChildGinjectorBindings(Class<?> module) {
    assertNotFinalized();
    GinjectorBindings child = ginjectorBindingsProvider.get();
    child.setParent(this);
    child.setModule(module);
    children.add(child);
    return child;
  }
513231
@SuppressWarnings("unchecked")
    public <T> PathBuilder<T> create(Class<T> type) {
        PathBuilder<T> rv = (PathBuilder<T>) paths.get(type);
        if (rv == null) {
            rv = new PathBuilder<T>(type, variableName(type));
            paths.put(type, rv);
        }
        return rv;
    }
262187
function(type, factory) {
            var key_parameters = {},
                __type = parse_type(type, key_parameters) .toLowerCase();

            // normalize prop name, remove lead '/'
            for(var prop in key_parameters)
            if (prop[0] === '/') {
                key_parameters[prop.slice(1)] = key_parameters[prop];
                delete key_parameters[prop];
            }

            if (__type.length < type.length || Object.keys(key_parameters).length) {
                // type is subtype with parameters, register to processor.subtypes
                key_parameters.__ctr = factory;
                var subtypes_array = this.subtypes[__type] || (this.subtypes[__type] = []);
                subtypes_array.push(key_parameters);
            } else {
                // register as standalone type
                // check name conflict
                if (this[__type])
                    throw new TypeError('Type ' + type + ' already registered!');

                this[__type] = factory;
            }
        }
704425
def virtual_interface_create(name, net_name, **kwargs):
    '''
    
    '''
    conn = get_conn()
    return conn.virtual_interface_create(name, net_name)
1368372
private static String createTypeId(Type type) {
        if (type instanceof Class<?>) {
            return Reflections.<Class<?>> cast(type).getName();
        }
        if (type instanceof ParameterizedType) {
            ParameterizedType parameterizedType = (ParameterizedType) type;
            StringBuilder builder = new StringBuilder();
            builder.append(createTypeId(parameterizedType.getRawType()));
            builder.append("<");
            for (int i = 0; i < parameterizedType.getActualTypeArguments().length; i++) {
                builder.append(createTypeId(parameterizedType.getActualTypeArguments()[i]));
                if (i != parameterizedType.getActualTypeArguments().length - 1) {
                    builder.append(",");
                }
            }
            builder.append(">");
            return builder.toString();
        }
        if (type instanceof TypeVariable<?>) {
            return Reflections.<TypeVariable<?>> cast(type).getName();
        }
        if (type instanceof GenericArrayType) {
            return createTypeId(Reflections.<GenericArrayType> cast(type).getGenericComponentType());
        }
        throw new java.lang.IllegalArgumentException("Unknown type " + type);
    }
525628
function createPrototype (type, options) {
    return new DuckType({
      name: options && options.name || null,
      test: function test (object) {
        return (object instanceof type);
      }
    });
  }
113787
def create(self, type_, **kwargs):
        
        obj = self.factory.create("ns0:%s" % type_)
        for key, value in kwargs.items():
            setattr(obj, key, value)
        return obj
148550
public void createTypeAssociations() {
		// Connect the child to the parent rtype and interface rtypes
		ClassLoader classLoader = getClazz().getClassLoader();
		if (classLoader == null) {
			return;
		}
		ReloadableType srtype = getSuperRtype();
		if (srtype != null) {
			srtype.recordSubtype(this);
		}
		ReloadableType[] irtypes = getInterfacesRtypes();
		if (irtypes != null) {
			for (ReloadableType irtype : irtypes) {
				irtype.recordSubtype(this);
			}
		}
	}
276030
def create_module(self, spec):
        """"""
        mod = sys.modules.setdefault(spec.name, types.ModuleType(spec.name))
        # we are using setdefault to satisfy https://docs.python.org/3/reference/import.html#loaders
        return mod
1174231
private <T> Set<? extends T> create(Iterable<Class<? extends T>> types)
	{
		Set<T> result = new HashSet<>();

		for(Class<? extends T> t : types)
		{
			if(! Modifier.isAbstract(t.getModifiers()) && ! t.isInterface())
			{
				T instance = factory.create(t);
				result.add(instance);
			}
		}

		return Collections.unmodifiableSet(result);
	}
63759
def add(self, type):
        # type: (InternalType) -> None
        
        try:
            if isinstance(type, SetType):
                if EMPTY_SET_TYPE in self.types_hashable:
                    self.types_hashable.remove(EMPTY_SET_TYPE)
            elif isinstance(type, ListType):
                if EMPTY_LIST_TYPE in self.types_hashable:
                    self.types_hashable.remove(EMPTY_LIST_TYPE)
            elif isinstance(type, IteratorType):
                if EMPTY_ITERATOR_TYPE in self.types_hashable:
                    self.types_hashable.remove(EMPTY_ITERATOR_TYPE)
            elif isinstance(type, DictType):
                if EMPTY_DICT_TYPE in self.types_hashable:
                    self.types_hashable.remove(EMPTY_DICT_TYPE)
                for item in self.types_hashable:
                    if isinstance(item, DictType):
                        if item.key_type == type.key_type:
                            item.val_type.merge(type.val_type)
                            return
            self.types_hashable.add(type)

        except (TypeError, AttributeError):
            try:
                if type not in self.types:
                    self.types.append(type)
            except AttributeError:
                if TypeWasIncomparable not in self.types:
                    self.types.append(TypeWasIncomparable)
1243937
public FunctionType createInterfaceType(
      String name, Node source, ImmutableList<TemplateType> templateKeys, boolean struct) {
    FunctionType fn =
        FunctionType.builder(this)
            .forInterface()
            .withName(name)
            .withSourceNode(source)
            .withEmptyParams()
            .withTemplateKeys(templateKeys)
            .build();
    if (struct) {
      fn.setStruct();
    }
    return fn;
  }
89300
def create(self, interface):
        

        data = {'interfaces': interface}
        return super(ApiInterfaceRequest, self).post('api/v3/interface/', data)
604665
public <T> T createInstance(Class<T> type) {
        try {
            return type.newInstance();
        } catch (InstantiationException | IllegalAccessException e) {
            throw new IllegalArgumentException("Cannot create instance of class " + type.getName(), e);
        }
    }