Register this descriptor with the Proto Struct.
358519
def AddDescriptor(cls, field_desc):
    """"""
    if not isinstance(field_desc, ProtoType):
      raise type_info.TypeValueError(
          "%s field '%s' should be of type ProtoType" %
          (cls.__name__, field_desc.name))

    # Ensure the field descriptor knows the class that owns it.
    field_desc.SetOwner(cls)

    # If the field is late bound we do not really add it to the descriptor set
    # yet. We must wait for the LateBindingPlaceHolder() to add it later.
    if field_desc.late_bound:
      # Keep track of unbound fields.
      cls.late_bound_type_infos[field_desc.name] = field_desc
      return

    # Ensure this field number is unique:
    if field_desc.field_number in cls.type_infos_by_field_number:
      raise type_info.TypeValueError(
          "Field number %s for field %s is not unique in %s" %
          (field_desc.field_number, field_desc.name, cls.__name__))

    # We store an index of the type info by tag values to speed up parsing.
    cls.type_infos_by_field_number[field_desc.field_number] = field_desc
    cls.type_infos_by_encoded_tag[field_desc.encoded_tag] = field_desc

    cls.type_infos.Append(field_desc)
    cls.late_bound_type_infos.pop(field_desc.name, None)

    # Add direct accessors only if the class does not already have them.
    if not hasattr(cls, field_desc.name):
      # This lambda is a class method so pylint: disable=protected-access
      # This is much faster than __setattr__/__getattr__
      setattr(
          cls, field_desc.name,
          property(lambda self: self.Get(field_desc.name), lambda self, x: self.
                   _Set(x, field_desc), None, field_desc.description))
258612
def register(self, collector):
        
        if not isinstance(collector, Collector):
            raise TypeError(
                "Can't register instance, not a valid type of collector")

        if collector.name in self.collectors:
            raise ValueError("Collector already exists or name colision")

        with mutex:
            self.collectors[collector.name] = collector
724638
public function setup() {

		foreach ( $this->struct as $struct_key => $sub_struct ) {
			if ( is_array( $sub_struct ) && uix()->get_register_callback( $struct_key ) ) {
				$this->process_child( $struct_key );
			}
		}
	}
60598
def init_self(self, cls, name):
        
        # the class the descriptor is defined on
        self.this_class = cls
        # the attribute name of this descriptor
        self.this_name = name
556283
def RegisterDecompressor(cls, decompressor):
    
    compression_method = decompressor.COMPRESSION_METHOD.lower()
    if compression_method in cls._decompressors:
      raise KeyError(
          'Decompressor for compression method: {0:s} already set.'.format(
              decompressor.COMPRESSION_METHOD))

    cls._decompressors[compression_method] = decompressor
608507
def register(self, key, initializer: callable, param=None):
        ''''''
        if not callable(initializer):
            raise DependencyError('Initializer {0} is not callable'.format(initializer))
        if key not in self._initializers:
            self._initializers[key] = {}
        self._initializers[key][param] = initializer
1318482
def register(self, *args, **kwargs):
    """"""
    if self._frozen:
      raise FrozenRegistration(self.scope, args[0])

    # Prevent further registration in enclosing scopes.
    ancestor = self._parent_parser
    while ancestor:
      ancestor._freeze()
      ancestor = ancestor._parent_parser

    if kwargs.get('type') == bool:
      default = kwargs.get('default')
      if default is None:
        # Unless a tri-state bool is explicitly opted into with the `UnsetBool` default value,
        # boolean options always have an implicit boolean-typed default. We make that default
        # explicit here.
        kwargs['default'] = not self._ensure_bool(kwargs.get('implicit_value', True))
      elif default is UnsetBool:
        kwargs['default'] = None

    # Record the args. We'll do the underlying parsing on-demand.
    self._option_registrations.append((args, kwargs))
    if self._parent_parser:
      for arg in args:
        existing_scope = self._parent_parser._existing_scope(arg)
        if existing_scope is not None:
          raise Shadowing(self.scope, arg, outer_scope=self._scope_str(existing_scope))
    for arg in args:
      if arg in self._known_args:
        raise OptionAlreadyRegistered(self.scope, arg)
    self._known_args.update(args)
291845
private void registerThis()
    {
        DefaultComponentDescriptor<ComponentManager> cd = new DefaultComponentDescriptor<>();
        cd.setRoleType(ComponentManager.class);

        registerComponent(cd, this);
    }
760024
public void registerInitialProcesses()
    {
        MessageProcessInfo recMessageProcessInfo = new MessageProcessInfo(this);
        try   {
             // Always register this generic processing queue.
            this.registerProcessForMessage(new BaseMessageFilter(MessageConstants.TRX_SEND_QUEUE, MessageConstants.INTERNET_QUEUE, null, null), null, null);
            recMessageProcessInfo.close();
            while (recMessageProcessInfo.hasNext())
            {
                recMessageProcessInfo.next();
                String strQueueName = recMessageProcessInfo.getQueueName(true);
                String strQueueType = recMessageProcessInfo.getQueueType(true);
                String strProcessClass = recMessageProcessInfo.getField(MessageProcessInfo.PROCESSOR_CLASS).toString();
                Map<String,Object> properties = ((PropertiesField)recMessageProcessInfo.getField(MessageProcessInfo.PROPERTIES)).getProperties();
                Record recMessageType = ((ReferenceField)recMessageProcessInfo.getField(MessageProcessInfo.MESSAGE_TYPE_ID)).getReference();
                if (recMessageType != null)
                {   // Start all processes that handle INcoming REQUESTs.
                    String strMessageType = recMessageType.getField(MessageType.CODE).toString();
                    Record recMessageInfo = ((ReferenceField)recMessageProcessInfo.getField(MessageProcessInfo.MESSAGE_INFO_ID)).getReference();
                    if (recMessageInfo != null)
                    {
                        Record recMessageInfoType = ((ReferenceField)recMessageInfo.getField(MessageInfo.MESSAGE_INFO_TYPE_ID)).getReference();
                        if (recMessageInfoType != null)
                        {
                            String strMessageInfoType = recMessageInfoType.getField(MessageInfoType.CODE).toString();
                            if (MessageInfoType.REQUEST.equals(strMessageInfoType))
                                if (MessageType.MESSAGE_IN.equals(strMessageType))
                                    if ((strQueueName != null) && (strQueueName.length() > 0))
                                        this.registerProcessForMessage(new BaseMessageFilter(strQueueName, strQueueType, null, null), strProcessClass, properties);
                        }
                    }
                }
            }
            recMessageProcessInfo.close();
        } catch (DBException ex)    {
            ex.printStackTrace();
        } finally {
            recMessageProcessInfo.free();
        }
    }
394210
def register_serializer(name, serializer):
    '''
'''
    if not isclass(serializer):
        serializer = serializer.__class__
    _serializers[name] = serializer
182943
def attach_protocol(self, proto):
        
        if self._protocol is not None:
            raise RuntimeError("Already have a protocol.")
        # make sure we have nothing in self.unsaved
        self.save()
        self.__dict__['_protocol'] = proto

        # FIXME some of this is duplicated from ctor
        del self.__dict__['_accept_all_']
        self.__dict__['post_bootstrap'] = defer.Deferred()
        if proto.post_bootstrap:
            proto.post_bootstrap.addCallback(self.bootstrap)
        return self.__dict__['post_bootstrap']
1291748
def register(coordinator):
    """"""
    timer_queue = Queue.Queue()
    coordinator.register(TimerItem, timer_queue)
    coordinator.worker_threads.append(
        TimerThread(timer_queue, coordinator.input_queue))
593774
def register(host=DFLT_ADDRESS[0], port=DFLT_ADDRESS[1],
             signum=signal.SIGUSR1):
    
    _pdbhandler._register(host, port, signum)
1004386
def register_type_name(t, name):
    
    assert isinstance(t, type)
    assert isinstance(name, unicode)
    __type_names[t] = name
1250879
def register(self, params, target):
        """"""
        self._space.register(params, target)
        self.dispatch(Events.OPTMIZATION_STEP)
840061
public SerDeserializers register(Class<?> type, SerDeserializer deserializer) {
        deserializers.put(type, deserializer);
        return this;
    }
106215
def CopyToProto(self, proto):
    
    if (self.file is not None and
        self._serialized_start is not None and
        self._serialized_end is not None):
      proto.ParseFromString(self.file.serialized_pb[
          self._serialized_start:self._serialized_end])
    else:
      raise Error('Descriptor does not contain serialization.')