Autoload all registered types
491740
public function autoloadTypes()
    {
        //loaded and static
        if (self::$loaded) {
            return;
        }

        if (!$this->kernel->isDebug() && $this->loadFromCacheCache()) {
            self::$loaded = true;

            return;
        }

        self::$loaded = true;

        foreach ($this->kernel->getBundles() as $bundle) {
            $path = $bundle->getPath().'/Type';
            if (file_exists($path)) {
                $this->registerBundleTypes($path, $bundle->getNamespace());
            }
        }

        if (Kernel::VERSION_ID >= 40000) {
            $path = $this->kernel->getRootDir().'/Type';
            if (file_exists($path)) {
                $this->registerBundleTypes($path, 'App');
            }
        }

        $this->saveCache();
    }
466986
function addType(typeName, type) {
	if (types[typeName]) {
		throw new Error("Type already registered '" + typeName + "'");
	}
	types[typeName] = type;
}
501755
public function registerClassLoader() : void
    {
        if ($this->root === null) {
            return;
        }

        $path = sprintf('%s/%s/autoload.php', $this->root, $this->getVendorDirectory());

        if (!is_file($path)) {
            return;
        }

        require $path;
    }
737322
public function initTypes()
    {
        $names = $this->generateTypesNames();
        foreach ($names as $name) {
            $object = $this->getNewType($name);
            $this->addType($object);
        }
    }
362656
def register(cls, name, type_):
        

        if not issubclass(type_, Entry):
            raise exceptions.InvalidEntryType("%s is not a subclass of Entry" % str(type_))
        cls._registry[name.lower()] = type_
361081
def _auto_fill_defaults(cls):
        """"""
        if not cls.spec.appname:
            cls.spec.appname = get_basename(get_program_path())
        if not cls.spec.dev:
            cls.spec.dev = get_dev_folder()
701367
def register(filetypes):
    
    def decorator(clazz):
        for ext in filetypes:
            checkers.setdefault(ext, []).append(clazz)
        return clazz
    return decorator
28202
def register_type(*args)
      if types_list.respond_to?(:add)
        types_list.add self, *args
      else
        types_list << self
      end
      if types_tracker_base.respond_to?(:scope) &&
          !types_tracker_base.respond_to?(model_name.element)
        type_name = name
        types_tracker_base.scope model_name.element, -> { where(type: type_name) }
      end
    end
1344780
def bind_type(type_to_bind: hexdi.core.restype, accessor: hexdi.core.clstype, lifetime_manager: hexdi.core.ltype):
    
    hexdi.core.get_root_container().bind_type(type_to_bind, accessor, lifetime_manager)
638168
def RegisterBuiltin(cls, arg):
        '''
        '''
        if arg in cls.types_dict:
            raise RuntimeError, '%s already registered' %arg
        class _Wrapper(arg):
            'Wrapper for builtin %s\n%s' %(arg, cls.__doc__)
        _Wrapper.__name__ = '_%sWrapper' %arg.__name__
        cls.types_dict[arg] = _Wrapper
440147
protected function loadTypes()
    {
        $this->log('Loading types');

        $types = $this->wsdl->getTypes();

        foreach ($types as $typeNode) {
            $type = null;

            if ($typeNode->isComplex()) {
                if ($typeNode->isArray()) {
                    $type = new ArrayType($this->config, $typeNode->getName());
                } else {
                    $type = new ComplexType($this->config, $typeNode->getName());
                }

                $this->log('Loading type ' . $type->getPhpIdentifier());

                $type->setAbstract($typeNode->isAbstract());

                foreach ($typeNode->getParts() as $name => $typeName) {
                    // There are 2 ways a wsdl can indicate that a field accepts the null value -
                    // by setting the "nillable" attribute to "true" or by setting the "minOccurs" attribute to "0".
                    // See http://www.ibm.com/developerworks/webservices/library/ws-tip-null/index.html
                    $nullable = $typeNode->isElementNillable($name) || $typeNode->getElementMinOccurs($name) === 0;
                    $type->addMember($typeName, $name, $nullable);
                }
            } elseif ($enumValues = $typeNode->getEnumerations()) {
                $type = new Enum($this->config, $typeNode->getName(), $typeNode->getRestriction());
                array_walk($enumValues, function ($value) use ($type) {
                      $type->addValue($value);
                });
            } elseif ($pattern = $typeNode->getPattern()) {
                $type = new Pattern($this->config, $typeNode->getName(), $typeNode->getRestriction());
                $type->setValue($pattern);
            }

            if ($type != null) {
                $already_registered = false;
                if ($this->config->get('sharedTypes')) {
                    foreach ($this->types as $registered_types) {
                        if ($registered_types->getIdentifier() == $type->getIdentifier()) {
                            $already_registered = true;
                            break;
                        }
                    }
                }
                if (!$already_registered) {
                    $this->types[$typeNode->getName()] = $type;
                }
            }
        }

        // Loop through all types again to setup class inheritance.
        // We can only do this once all types have been loaded. Otherwise we risk referencing types which have not been
        // loaded yet.
        foreach ($types as $type) {
            if (($baseType = $type->getBase()) && isset($this->types[$baseType]) && $this->types[$baseType] instanceof ComplexType) {
                $this->types[$type->getName()]->setBaseType($this->types[$baseType]);
            }
        }

        $this->log('Done loading types');
    }
1121884
def register(self, ptype):
        """"""
        # Too many of them leads to memory burst
        if len(self.typedefs) < cfg.getint('typing', 'max_combiner'):
            self.typedefs.append(ptype)
            return True
        return False
318803
function (types) {

    that.logger.logEnter('callback in loadEventTypes, types:\n' + JSON.stringify(types));

    // The "raw" event type data has a deeply-nested structure and it
    // contains a bunch of stuff we're not interested in.  We'll just
    // store the names of each type's properties.
    Object.keys(types).forEach(function (typeName) {
      if (types[typeName].properties) {
        eventTypes[typeName] = Object.keys(types[typeName].properties);
      }
    });

    that.logger.log('eventTypes:\n' + JSON.stringify(eventTypes));

    if (process.env.TESTONLY_EMIT_INTERNAL_EVENTS) {
      that.emit(that.CONSTANT.internal_event_load_types_done);
    }

    // Now the event buffer can begin processing events.
    eventBuffer.ready();

    that.logger.logExit('callback in loadEventTypes');
  }
235865
final public static function autoloadRegister()
    {
        // spl_autoload_register disables oldschool autoload
        // even if it was added using spl_autoload_register!
        // this is intended to preserve old autoloader

        $uses_autoload = function_exists('__autoload')
            && (!($tmp = spl_autoload_functions()) || ($tmp[0] === '__autoload'));

        // Prepending PHPTAL's autoloader helps if there are other autoloaders
        // that throw/die when file is not found. Only >5.3 though.
        if (version_compare(PHP_VERSION, '5.3', '>=')) {
            spl_autoload_register(array(__CLASS__,'autoload'), false, true);
        } else {
            spl_autoload_register(array(__CLASS__,'autoload'));
        }

        if ($uses_autoload) {
            spl_autoload_register('__autoload');
        }
    }
148955
def auto_compilation(on=True):
    """"""
    if on:
        if coconut_importer not in sys.meta_path:
            sys.meta_path.insert(0, coconut_importer)
    else:
        try:
            sys.meta_path.remove(coconut_importer)
        except ValueError:
            pass
944419
public static function autoload(): void
    {
        //  CI base helpers
        require_once BASEPATH . 'core/Common.php';

        $aComponents = [];
        foreach (Components::available() as $oModule) {
            $aComponents[] = (object) [
                'slug'     => $oModule->slug,
                'autoload' => $oModule->autoload,
            ];
        }

        //  Module items
        foreach ($aComponents as $oModule) {
            //  Helpers
            if (!empty($oModule->autoload->helpers)) {
                foreach ($oModule->autoload->helpers as $sHelper) {
                    if (is_array($sHelper)) {
                        list($sName, $sProvider) = $sHelper;
                        self::helper($sName, $sProvider);
                    } else {
                        self::helper($sHelper, $oModule->slug);
                    }
                }
            }
            //  Services
            if (!empty($oModule->autoload->services)) {
                foreach ($oModule->autoload->services as $sService) {
                    if (is_array($sHelper)) {
                        list($sName, $sProvider) = $sService;
                        self::service($sName, $sProvider);
                    } else {
                        self::service($sService, $oModule->slug);
                    }
                }
            }
        }
    }
956167
def force_auto(service, _type):
    
    storable = service.byPythonType(_type, istype=True)
    version = max(handler.version[0] for handler in storable.handlers) + 1
    _storable = default_storable(_type, version=(version, ))
    storable.handlers.append(_storable.handlers[0])