Base message emitter class. See below for the two available variants.
343068
function ClientChannel(client, opts) {
  opts = opts || {};
  events.EventEmitter.call(this);

  this.client = client;
  this.timeout = utils.getOption(opts, 'timeout', client._timeout$);
  this._endWritable = !!utils.getOption(opts, 'endWritable', true);
  this._prefix = normalizedPrefix(opts.scope);

  var cache = client._cache$;
  var clientSvc = client._svc$;
  var hash = opts.serverHash;
  if (!hash) {
    hash = clientSvc.hash;
  }
  var adapter = cache[hash];
  if (!adapter) {
    // This might happen even if the server hash option was set if the cache
    // doesn't contain the corresponding adapter. In this case we fall back to
    // the client's protocol (as mandated by the spec).
    hash = clientSvc.hash;
    adapter = cache[hash] = new Adapter(clientSvc, clientSvc, hash);
  }
  this._adapter = adapter;

  this._registry = new Registry(this, PREFIX_LENGTH);
  this.pending = 0;
  this.destroyed = false;
  this.draining = false;
  this.once('_eot', function (pending, err) {
    // Since this listener is only run once, we will only forward an error if
    // it is present during the initial `destroy` call, which is OK.
    debug('client channel EOT');
    this.destroyed = true;
    this.emit('eot', pending, err);
  });
}
20021
def message_channel(self, message):
        
        self.log(None, message)
        super(BaseBot, self).message_channel(message)
918863
function createEventEmitterCallback(event, emitter) {
    return function (ex) {
        if (ex) {
            emitter.emit('error', ex);
        } else {
            var args = Array.prototype.slice.call(arguments);
            args[0] = event;
            emitter.emit.apply(emitter, args);
            if (event == 'end') {
                emitter.removeAllListeners();
            }
        }
    };
}
91178
@Override
    public <T extends Throwable> T emit(T throwable, String message, long sequence, Logger logger) {
        message = message == null ? Throwables.getFullMessage(throwable) : message + ": " + Throwables.getFullMessage(throwable);
        emit(Level.WARNING, message, sequence, logger);
        return throwable;
    }
1273203
function init(noEmitter) {
	if (!noEmitter) {
		if (emitter) apperror.removeErrorListener(emitter)
		emitter = new events.EventEmitter
		emitter.id = 'Api Manager'
		apperror.addErrorListener(emitter)
	}
	return emitter
}
187711
def sender_class(sender)
      if sender.kind_of? Symbol
        reflections[sender.to_s].klass
      elsif sender.kind_of? ActiveRecord::Base
        sender.class
      else
        raise 'SimpleNotifications::SenderTypeError'
      end
    end
1226900
private static MessageBuffer newInstance(Constructor<?> constructor, Object... args)
    {
        try {
            // We need to use reflection to create MessageBuffer instances in order to prevent TypeProfile generation for getInt method. TypeProfile will be
            // generated to resolve one of the method references when two or more classes overrides the method.
            return (MessageBuffer) constructor.newInstance(args);
        }
        catch (InstantiationException e) {
            // should never happen
            throw new IllegalStateException(e);
        }
        catch (IllegalAccessException e) {
            // should never happen unless security manager restricts this reflection
            throw new IllegalStateException(e);
        }
        catch (InvocationTargetException e) {
            if (e.getCause() instanceof RuntimeException) {
                // underlying constructor may throw RuntimeException
                throw (RuntimeException) e.getCause();
            }
            else if (e.getCause() instanceof Error) {
                throw (Error) e.getCause();
            }
            // should never happen
            throw new IllegalStateException(e.getCause());
        }
    }
121015
private ClassSymbol getReceiver(ExpressionTree tree, Symbol sym) {
    if (sym.isStatic() || sym instanceof ClassSymbol) {
      return sym.enclClass();
    }
    switch (tree.getKind()) {
      case MEMBER_SELECT:
      case METHOD_INVOCATION:
        Type receiver = ASTHelpers.getType(ASTHelpers.getReceiver(tree));
        if (receiver == null) {
          return null;
        }
        return receiver.tsym.enclClass();
      case IDENTIFIER:
        // Simple names are implicitly qualified by an enclosing instance, so if we get here
        // we're inside the compilation unit that declares the receiver, and the diff doesn't
        // contain accurate information.
        return null;
      default:
        return null;
    }
  }
1213185
public MessagelistenerType<MessageadapterType<T>> getOrCreateMessagelistener()
   {
      List<Node> nodeList = childNode.get("messagelistener");
      if (nodeList != null &&  nodeList.size() > 0)
      {
         return new MessagelistenerTypeImpl<MessageadapterType<T>>(this, "messagelistener", childNode, nodeList.get(0));
      }
      return createMessagelistener();
   }
677153
def midl_emitter(target, source, env):
    """"""
    base, _ = SCons.Util.splitext(str(target[0]))
    tlb = target[0]
    incl = base + '.h'
    interface = base + '_i.c'
    targets = [tlb, incl, interface]

    midlcom = env['MIDLCOM']

    if midlcom.find('/proxy') != -1:
        proxy = base + '_p.c'
        targets.append(proxy)
    if midlcom.find('/dlldata') != -1:
        dlldata = base + '_data.c'
        targets.append(dlldata)

    return (targets, source)
348347
@Override
    public <T extends Throwable> T emit(T throwable, String message, long sequence) {
        if (_broadcaster != null) _broadcaster.sendNotification(new Notification(
            Level.WARNING.toString(),
            _name != null ? _name : this,
            sequence,
            message == null ? Throwables.getFullMessage(throwable) : message + ": " + Throwables.getFullMessage(throwable)
        ));
        return throwable;
    }
461629
@Override
    public void emit(Sink sink, DataType dataType, String header) {
    	logger.fine("Generating data type " + dataType.name + ".");
        sink.write(header);
        sink.write(ASTPrinter.print(dataType));
        sink.write("\n*/\n");

        sink.write(ASTPrinter.printComments("", commentProcessor.leftAlign(dataType.comments)));
        for (Annotation annotation : dataType.annotations) {
            sink.write(ASTPrinter.print(annotation));
            sink.write("\n");
        }
        if (dataType.constructors.size() == 1) {
            emitSingleConstructor(sink, dataType, header);
            
        } else {
            emitMultipleConstructor(sink, dataType, header);
        }
    }
142135
def types():
        
        if Message._types is None:
            Message._types = {}
            classes_to_process = [Message]
            while classes_to_process:
                atom = classes_to_process.pop()
                classes_to_process += atom.__subclasses__()
                Message._types[atom.__name__] = atom
        return Message._types
1126757
function toEmitter( selection, target ){
    
    // Apply the entire Emitter API
    if( selection === API ){
        asEmitter.call( target );
    
    // Apply only the selected API methods
    } else {
        let index, key, mapping, names, value;
        
        if( typeof selection === 'string' ){
            names = selection.split( ' ' );
            mapping = API;
        } else {
            names = Object.keys( selection );
            mapping = selection;
        }
        
        index = names.length;
        
        while( index-- ){
            key = names[ index ];
            value = mapping[ key ];
            
            target[ key ] = typeof value === 'function' ?
                value :
                API[ value ];
        }
    }
}
99644
def object_emitter(target, source, env, parent_emitter):
    """"""

    validate_vars(env)

    parent_emitter(target, source, env)

    # Add a dependency, but only if the target (e.g. 'Source1.obj')
    # doesn't correspond to the pre-compiled header ('Source1.pch').
    # If the basenames match, then this was most likely caused by
    # someone adding the source file to both the env.PCH() and the
    # env.Program() calls, and adding the explicit dependency would
    # cause a cycle on the .pch file itself.
    #
    # See issue #2505 for a discussion of what to do if it turns
    # out this assumption causes trouble in the wild:
    # http://scons.tigris.org/issues/show_bug.cgi?id=2505
    if 'PCH' in env:
        pch = env['PCH']
        if str(target[0]) != SCons.Util.splitext(str(pch))[0] + '.obj':
            env.Depends(target, pch)

    return (target, source)
974498
function EventReactor(options, proto) {
    // allow initialization without a new prefix
    if (!(this instanceof EventReactor)) return new EventReactor(options, proto);

    options = options || {};
    this.restore = {};

    // don't attach the extra event reactor methods, we are going to apply them
    // manually to the prototypes
    if (options.manual) return this;

    var methods = EventReactor.generation
      , method;

    for (method in methods) {
      if (methods.hasOwnProperty(method)) {
        this[method](proto);
      }
    }

    // such as aliases and emit overrides
    this.aliases(proto);
    this.emit(proto);
  }
242298
def _generate_struct_class_custom_annotations(self, ns, data_type):
        
        self.emit('def _process_custom_annotations(self, annotation_type, field_path, processor):')

        with self.indent(), emit_pass_if_nothing_emitted(self):
            self.emit(
                (
                    'super({}, self)._process_custom_annotations(annotation_type, field_path, '
                    'processor)'
                ).format(class_name_for_data_type(data_type))
            )
            self.emit()

            for field in data_type.fields:
                field_name = fmt_var(field.name, check_reserved=True)
                for annotation_type, processor in self._generate_custom_annotation_processors(
                        ns, field.data_type, field.custom_annotations):
                    annotation_class = class_name_for_annotation_type(annotation_type, ns)
                    self.emit('if annotation_type is {}:'.format(annotation_class))
                    with self.indent():
                        self.emit('self.{} = {}'.format(
                            field_name,
                            generate_func_call(
                                processor,
                                args=[
                                    "'{{}}.{}'.format(field_path)".format(field_name),
                                    'self.{}'.format(field_name),
                                ])
                        ))
                    self.emit()