Register a channel viewer with the reference viewer.
        `vclass` is the class of the viewer.
507412
def register_viewer(self, vclass):
        
        self.viewer_db[vclass.vname] = Bunch.Bunch(vname=vclass.vname,
                                                   vclass=vclass,
                                                   vtypes=vclass.vtypes)
1132071
public void visitClass(ClassNode classNode) {
        referencedClasses.clear();
        WriterControllerFactory factory = classNode.getNodeMetaData(WriterControllerFactory.class);
        WriterController normalController = new WriterController();
        if (factory!=null) {
            this.controller = factory.makeController(normalController);
        } else {
            this.controller = normalController;
        }
        this.controller.init(this, context, cv, classNode);
        this.cv = this.controller.getClassVisitor();

        if (controller.shouldOptimizeForInt() || factory!=null) {
            OptimizingStatementWriter.setNodeMeta(controller.getTypeChooser(),classNode);
        }

        try {
            int bytecodeVersion = controller.getBytecodeVersion();
            Object min = classNode.getNodeMetaData(MINIMUM_BYTECODE_VERSION);
            if (min instanceof Integer) {
                int minVersion = (int) min;
                if ((bytecodeVersion ^ Opcodes.V_PREVIEW) < minVersion) {
                    bytecodeVersion = minVersion;
                }
            }
            cv.visit(
                    bytecodeVersion,
                    adjustedClassModifiersForClassWriting(classNode),
                    controller.getInternalClassName(),
                    BytecodeHelper.getGenericsSignature(classNode),
                    controller.getInternalBaseClassName(),
                    BytecodeHelper.getClassInternalNames(classNode.getInterfaces())
            );
            cv.visitSource(sourceFile, null);
            if (classNode instanceof InnerClassNode) {
                InnerClassNode innerClass = (InnerClassNode) classNode;
                MethodNode enclosingMethod = innerClass.getEnclosingMethod();
                if (enclosingMethod != null) {
                    String outerClassName = BytecodeHelper.getClassInternalName(innerClass.getOuterClass().getName());
                    cv.visitOuterClass(outerClassName, enclosingMethod.getName(), BytecodeHelper.getMethodDescriptor(enclosingMethod));
                }
            }
            if (classNode.getName().endsWith("package-info")) {
                PackageNode packageNode = classNode.getPackage();
                if (packageNode != null) {
                    // pull them out of package node but treat them like they were on class node
                    visitAnnotations(classNode, packageNode, cv);
                }
                cv.visitEnd();
                return;
            } else {
                visitAnnotations(classNode, cv);
            }

            if (classNode.isInterface()) {
                ClassNode owner = classNode;
                if (owner instanceof InnerClassNode) {
                    owner = owner.getOuterClass();
                }
                String outerClassName = classNode.getName();
                String name = outerClassName + "$" + context.getNextInnerClassIdx();
                controller.setInterfaceClassLoadingClass(
                        new InterfaceHelperClassNode (
                                owner, name, ACC_SUPER | ACC_SYNTHETIC | ACC_STATIC, ClassHelper.OBJECT_TYPE,
                                controller.getCallSiteWriter().getCallSites()));
                super.visitClass(classNode);
                createInterfaceSyntheticStaticFields();
            } else {
                super.visitClass(classNode);
                MopWriter.Factory mopWriterFactory = classNode.getNodeMetaData(MopWriter.Factory.class);
                if (mopWriterFactory==null) {
                    mopWriterFactory = MopWriter.FACTORY;
                }
                MopWriter mopWriter = mopWriterFactory.create(controller);
                mopWriter.createMopMethods();
                controller.getCallSiteWriter().generateCallSiteArray();
                createSyntheticStaticFields();
            }

            // GROOVY-6750 and GROOVY-6808
            for (Iterator<InnerClassNode> iter = classNode.getInnerClasses(); iter.hasNext();) {
                InnerClassNode innerClass = iter.next();
                makeInnerClassEntry(innerClass);
            }
            makeInnerClassEntry(classNode);

            cv.visitEnd();
        } catch (GroovyRuntimeException e) {
            e.setModule(classNode.getModule());
            throw e;
        } catch (NegativeArraySizeException nase) {
            throw new GroovyRuntimeException("NegativeArraySizeException while processing "+sourceFile, nase);
        } catch (NullPointerException npe) {
            throw new GroovyRuntimeException("NPE while processing "+sourceFile, npe);
        }
    }
719856
def register(name):
    """"""
    def decorator(class_):
        if name in known_resolvers:
            raise ValueError('duplicate resolver name "%s"' % name)
        known_resolvers[name] = class_
    return decorator
391666
def class_register(cls):
    """"""
    cls.handler_registry = {}
    cls.sender_registry = {}
    for method_name in dir(cls):
        method = getattr(cls, method_name)
        if hasattr(method, '_handle'):
            cls.handler_registry.update({method._handle: method_name})
        if hasattr(method, '_sends'):
            cls.sender_registry.update({method._sends: method_name})
    return cls
379048
public void register(ModelViewConverter<? extends ModelView> c) {
        java2json.put(c.getSupportedView(), c);
        json2java.put(c.getJSONId(), c);

    }
126639
public void registerView(final Class ownerClass, final Pair<View, View> view) {
        registerView(ownerClass.getSimpleName(), view);
    }
979465
def register_view(self, view):
        
        v_name = get_view_name(self.options.namespace, view)

        if v_name not in self.registered_views:
            desc = {'name': v_name,
                    'documentation': view.description,
                    'labels': list(map(sanitize, view.columns))}
            self.registered_views[v_name] = desc
            self.registry.register(self)
623371
def register_instance(self, class_type, instance, register_as=None):
        
        registration = _InstanceRegistration(instance)
        self._register(class_type, registration, register_as)
226276
public function registerViewFinder()
    {
        $this->app->bindShared('view.finder', function($app)
        {
            $paths = $app['config']->get('view.paths', array());

            return new FileViewFinder($app['files'], $paths);
        });
    }
573363
def register_service(cls, primary_key_type):
    
    view_func = cls.as_view(cls.__name__.lower())  # pylint: disable=no-member
    methods = set(cls.__model__.__methods__)  # pylint: disable=no-member

    if 'GET' in methods:  # pylint: disable=no-member
        current_app.add_url_rule(
            cls.__model__.__url__ + '/', defaults={'resource_id': None},
            view_func=view_func,
            methods=['GET'])
        current_app.add_url_rule(
            '{resource}/meta'.format(resource=cls.__model__.__url__),
            view_func=view_func,
            methods=['GET'])
    if 'POST' in methods:  # pylint: disable=no-member
        current_app.add_url_rule(
            cls.__model__.__url__ + '/', view_func=view_func, methods=['POST', ])
    current_app.add_url_rule(
        '{resource}/<{pk_type}:{pk}>'.format(
            resource=cls.__model__.__url__,
            pk='resource_id', pk_type=primary_key_type),
        view_func=view_func,
        methods=methods - {'POST'})
    current_app.classes.append(cls)
14510
public function registerViewFinder()
    {
        $self = $this;
        $this->container->singleton('view.finder', function($app) use ($self) {
            $paths = $self->viewPaths;

            return new FileViewFinder($app['files'], $paths);
        });
    }
933879
def add_channel_cb(self, viewer, channel):
        """"""
        chname = channel.name

        # add old highlight set to channel external data
        channel.extdata.setdefault('contents_old_highlight', set([]))

        # Add the channel to the treeview
        file_dict = {}
        self.name_dict.setdefault(chname, file_dict)

        if not self.gui_up:
            return False

        tree_dict = {chname: {}}
        if self.gui_up:
            self.treeview.add_tree(tree_dict)

        self._rebuild_channels()
915849
def register_for(vcs)
      vcs = Metior.find_vcs vcs
      vcs.register_adapter id, self
      class_variable_set :@@vcs, vcs
    end
691149
def register(cls):
    
    if not issubclass(cls, Entity):
        raise ValueError("Class must be a subclass of abilian.core.entities.Entity")

    Commentable.register(cls)
    return cls
749501
def register_view(self, view):
        """"""
        super(AbstractTreeViewController, self).register_view(view)
        self.signal_handlers.append((self._tree_selection,
                                     self._tree_selection.connect('changed', self.selection_changed)))
        # self.handler_ids.append((self.tree_view,
        #                          self.tree_view.connect('key-press-event', self.tree_view_keypress_callback)))
        self.tree_view.connect('key-release-event', self.on_key_release_event)
        self.tree_view.connect('button-release-event', self.tree_view_keypress_callback)
        # key press is needed for tab motion but needs to be registered already here TODO why?
        self.tree_view.connect('key-press-event', self.tree_view_keypress_callback)
        self._tree_selection.set_mode(Gtk.SelectionMode.MULTIPLE)
        self.update_selection_sm_prior()
505849
def register_view_for(cls, app, action, classview, attr):
        
        if 'view_for_endpoints' not in cls.__dict__:
            cls.view_for_endpoints = {}
        cls.view_for_endpoints.setdefault(app, {})[action] = (classview, attr)
1338116
@Override
  public void register(Monitor<?> monitor) {
    SpectatorContext.register(monitor);
    registry.register(monitor);
  }