Registers all API-releated descriptors in a given symbol DB.
175681
def RegisterProtoDescriptors(db, *additional_descriptors):
  """"""
  db.RegisterFileDescriptor(artifact_pb2.DESCRIPTOR)
  db.RegisterFileDescriptor(client_pb2.DESCRIPTOR)
  db.RegisterFileDescriptor(config_pb2.DESCRIPTOR)
  db.RegisterFileDescriptor(cron_pb2.DESCRIPTOR)
  db.RegisterFileDescriptor(flow_pb2.DESCRIPTOR)
  db.RegisterFileDescriptor(hunt_pb2.DESCRIPTOR)
  db.RegisterFileDescriptor(output_plugin_pb2.DESCRIPTOR)
  db.RegisterFileDescriptor(reflection_pb2.DESCRIPTOR)
  db.RegisterFileDescriptor(stats_pb2.DESCRIPTOR)
  db.RegisterFileDescriptor(user_pb2.DESCRIPTOR)
  db.RegisterFileDescriptor(vfs_pb2.DESCRIPTOR)

  db.RegisterFileDescriptor(checks_pb2.DESCRIPTOR)
  db.RegisterFileDescriptor(deprecated_pb2.DESCRIPTOR)
  db.RegisterFileDescriptor(flows_pb2.DESCRIPTOR)
  db.RegisterFileDescriptor(jobs_pb2.DESCRIPTOR)
  db.RegisterFileDescriptor(osquery_pb2.DESCRIPTOR)
  db.RegisterFileDescriptor(wrappers_pb2.DESCRIPTOR)

  for d in additional_descriptors:
    db.RegisterFileDescriptor(d)
492459
def register_models(**kwargs):
    
    [setattr(models, k, v) for k, v in kwargs.items()]
497712
protected void registerSuperClassMultipleJoinedTables(ClassDescriptor cld)
    {
        /*
        arminw: Sadly, we can't map to sub class-descriptor, because it's not guaranteed
        that they exist when this method is called. Thus we map the class instance instead
        of the class-descriptor.
        */
        if(cld.getBaseClass() != null)
        {
            try
            {
                Class superClass = ClassHelper.getClass(cld.getBaseClass());
                Class currentClass = cld.getClassOfObject();
                synchronized(descriptorTable)
                {
                    List subClasses = (List) superClassMultipleJoinedTablesMap.get(superClass);
                    if(subClasses == null)
                    {
                        subClasses = new ArrayList();
                        superClassMultipleJoinedTablesMap.put(superClass,  subClasses);
                    }
                    if(!subClasses.contains(currentClass))
                    {
                        if(log.isDebugEnabled())
                        {
                            log.debug("(MultipleJoinedTables): Register sub-class '" + currentClass
                                    + "' for class '" + superClass);
                        }
                        subClasses.add(currentClass);
                    }
                }
            }
            catch(Exception e)
            {
                throw new MetadataException("Can't register super class '" + cld.getBaseClass()
                        + "' for class-descriptor: " + cld, e);
            }
        }
    }
378872
private static void registerAllTypeFactories(GsonBuilder gsonBuilder) {
        ServiceLoader<TypeAdapterFactory> loader = ServiceLoader.load(TypeAdapterFactory.class);
        for (TypeAdapterFactory typeFactory : loader) {
            if (logger.isLoggable(Level.FINE)) {
                logger.fine("Add gson type factory: " + typeFactory.getClass().getName());
            }
            gsonBuilder.registerTypeAdapterFactory(typeFactory);
        }
    }
1270037
def register(self, name, obj):
        """"""
        if name in self.all:
            log.debug('register: %s already existed: %s', name, obj.name)
            # code.interact(local=locals())
            raise DuplicateDefinitionException(
                'register: %s already existed: %s' % (name, obj.name))
        log.debug('register: %s ', name)
        self.all[name] = obj
        return obj
1325354
def resolve_symbols(self, tree, database, link_resolver):
        
        self.typed_symbols = self.__get_empty_typed_symbols()
        all_syms = OrderedSet()
        for sym_name in self.symbol_names:
            sym = database.get_symbol(sym_name)
            self.__query_extra_symbols(
                sym, all_syms, tree, link_resolver, database)

        if tree.project.is_toplevel:
            page_path = self.link.ref
        else:
            page_path = self.project_name + '/' + self.link.ref

        if self.meta.get("auto-sort", True):
            all_syms = sorted(all_syms, key=lambda x: x.unique_name)
        for sym in all_syms:
            sym.update_children_comments()
            self.__resolve_symbol(sym, link_resolver, page_path)
            self.symbol_names.add(sym.unique_name)

        # Always put symbols with no parent at the end
        no_parent_syms = self.by_parent_symbols.pop(None, None)
        if no_parent_syms:
            self.by_parent_symbols[None] = no_parent_syms

        for sym_type in [ClassSymbol, AliasSymbol, InterfaceSymbol,
                         StructSymbol]:
            syms = self.typed_symbols[sym_type].symbols

            if not syms:
                continue

            if self.title is None:
                self.title = syms[0].display_name
            if self.comment is None:
                self.comment = Comment(name=self.name)
                self.comment.short_description = syms[
                    0].comment.short_description
                self.comment.title = syms[0].comment.title
            break
26278
private function registerCLICommands()
    {
        $console = $this->app->make('console');
        $console->add(new TransifexTranslationsCommand());
        $console->add(new TransifexGlossaryCommand());
        $console->add(new ProcessGitRepositoriesCommand());
        $console->add(new AcceptPendingJoinRequestsCommand());
        $console->add(new SendNotificationsCommand());
        $console->add(new RemoveLoggedIPAddressesCommand());
        $console->add(new NotifyPackageVersionsCommand());
        $console->add(new ProcessRemotePackagesCommand());
    }
475518
static void register() {
        // Unicode: "U+10FFFF" hex, min=4, max=6
        Transliterator.registerFactory("Hex-Any/Unicode", new Transliterator.Factory() {
            @Override
            public Transliterator getInstance(String ID) {
                return new UnescapeTransliterator("Hex-Any/Unicode", new char[] {
                    2, 0, 16, 4, 6, 'U', '+',
                    END
                });
            }
        });

        // Java: "\\uFFFF" hex, min=4, max=4
        Transliterator.registerFactory("Hex-Any/Java", new Transliterator.Factory() {
            @Override
            public Transliterator getInstance(String ID) {
                return new UnescapeTransliterator("Hex-Any/Java", new char[] {
                    2, 0, 16, 4, 4, '\\', 'u',
                    END
                });
            }
        });

        // C: "\\uFFFF" hex, min=4, max=4; \\U0010FFFF hex, min=8, max=8
        Transliterator.registerFactory("Hex-Any/C", new Transliterator.Factory() {
            @Override
            public Transliterator getInstance(String ID) {
                return new UnescapeTransliterator("Hex-Any/C", new char[] {
                    2, 0, 16, 4, 4, '\\', 'u',
                    2, 0, 16, 8, 8, '\\', 'U',
                    END
                });
            }
        });

        // XML: "&#x10FFFF;" hex, min=1, max=6
        Transliterator.registerFactory("Hex-Any/XML", new Transliterator.Factory() {
            @Override
            public Transliterator getInstance(String ID) {
                return new UnescapeTransliterator("Hex-Any/XML", new char[] {
                    3, 1, 16, 1, 6, '&', '#', 'x', ';',
                    END
                });
            }
        });

        // XML10: "&1114111;" dec, min=1, max=7 (not really "Hex-Any")
        Transliterator.registerFactory("Hex-Any/XML10", new Transliterator.Factory() {
            @Override
            public Transliterator getInstance(String ID) {
                return new UnescapeTransliterator("Hex-Any/XML10", new char[] {
                    2, 1, 10, 1, 7, '&', '#', ';',
                    END
                });
            }
        });

        // Perl: "\\x{263A}" hex, min=1, max=6
        Transliterator.registerFactory("Hex-Any/Perl", new Transliterator.Factory() {
            @Override
            public Transliterator getInstance(String ID) {
                return new UnescapeTransliterator("Hex-Any/Perl", new char[] {
                    3, 1, 16, 1, 6, '\\', 'x', '{', '}',
                    END
                });
            }
        });

        // All: Java, C, Perl, XML, XML10, Unicode
        Transliterator.registerFactory("Hex-Any", new Transliterator.Factory() {
            @Override
            public Transliterator getInstance(String ID) {
                return new UnescapeTransliterator("Hex-Any", new char[] {
                    2, 0, 16, 4, 6, 'U', '+',            // Unicode
                    2, 0, 16, 4, 4, '\\', 'u',           // Java
                    2, 0, 16, 8, 8, '\\', 'U',           // C (surrogates)
                    3, 1, 16, 1, 6, '&', '#', 'x', ';',  // XML
                    2, 1, 10, 1, 7, '&', '#', ';',       // XML10
                    3, 1, 16, 1, 6, '\\', 'x', '{', '}', // Perl
                    END
                });
            }
        });
    }
177283
private static void addDescriptorsToList(final List<FeatureDescriptor> descriptorList,
                                             final Map<String, Object> scopeMap)
    {
        for (Object name : scopeMap.keySet())
        {
            String strName = (String)name;
            Class<?> runtimeType = scopeMap.get(strName).getClass();
            descriptorList.add(makeDescriptor(strName, runtimeType));
        }
    }
261644
def resolve_symbols(self, database, link_resolver, page=None):
        

        page = page or self.root

        if page.ast is None and not page.generated:
            with io.open(page.source_file, 'r', encoding='utf-8') as _:
                page.ast = cmark.hotdoc_to_ast(_.read(), self)

        page.resolve_symbols(self, database, link_resolver)
        self.__update_dep_map(page, page.symbols)

        for pagename in page.subpages:
            cpage = self.__all_pages[pagename]
            self.resolve_symbols(database, link_resolver, page=cpage)
458758
private void registerModulesForCustomFieldDef(ObjectMapper objectMapper) {
		SimpleModule simpleModule = new SimpleModule("CustomFieldDefinition", new Version(1, 0, 0, null));
		simpleModule.addDeserializer(CustomFieldDefinition.class, new CustomFieldDefinitionDeserializer());
		objectMapper.registerModule(simpleModule);
	}
785653
private void registerExternalLoaders() throws MojoExecutionException {
        if (archiveLoaders != null) {
            for (String entry : archiveLoaders) {
                try {
                    SourceLoader loader = (SourceLoader) Class.forName(entry).newInstance();
                    registerLoader(loader);
                } catch (Exception e) {
                    throw new MojoExecutionException("Error registering archive loader for class: " + entry, e);
                }
            }
        }
    }
1122313
protected synchronized void registerOpenDatabase(DatabaseImpl newDB)
    {
        DatabaseImpl old_db = getCurrentDatabase();
        if (old_db != null)
        {
            try
            {
                if (old_db.isOpen())
                {
                    log.warn("## There is still an opened database, close old one ##");
                    old_db.close();
                }
            }
            catch (Throwable t)
            {
                //ignore
            }
        }
        if (log.isDebugEnabled()) log.debug("Set current database " + newDB + " PBKey was " + newDB.getPBKey());
        setCurrentDatabase(newDB);
//        usedDatabases.add(newDB.getPBKey());
    }
467142
def _expose_models(cls):
        
        if db._IS_OK_:
            register_models(**{m.__name__: m
                               for m in db.Model.__subclasses__()
                               if not hasattr(models, m.__name__)})
956259
def init_db(drop_all=False, bind=engine):
    """"""
    try:
        if drop_all:
            Base.metadata.drop_all(bind=bind)
        Base.metadata.create_all(bind=bind)
    except OperationalError as err:
        msg = 'password authentication failed for user "dallinger"'
        if msg in err.message:
            sys.stderr.write(db_user_warning)
        raise

    return session
120110
def _ExtractSymbols(self, descriptors):
    

    for desc in descriptors:
      yield (_PrefixWithDot(desc.full_name), desc)
      for symbol in self._ExtractSymbols(desc.nested_types):
        yield symbol
      for enum in desc.enum_types:
        yield (_PrefixWithDot(enum.full_name), enum)
1313350
function registerDatabaseType($typeIdentifier, \Plasma\Types\TypeExtensionInterface $type): void {
        if(isset($this->dbTypes[$typeIdentifier])) {
            throw new \Plasma\Exception('Database Type identifier is already in use');
        }
        
        $this->dbTypes[$typeIdentifier] = $type;
    }