Factory method for registering a participant with a barrier. If the barrier
does not exist, then a new barrier is created.

@param name              Name of the barrier
@param participant       JavaScript object
@returns {Barrier}
963801
function registerParticipant (name, participant) {
  let barrier = barriers[name];

  if (!barrier) {
    debug (`creating barrier ${name}`);
    barrier = barriers[name] = new Barrier ({name});
  }

  debug (`registering participant with barrier ${name}`);
  return barrier.registerParticipant (participant);
}
556414
def create(tournament, name, **params):
    """"""
    params.update({"name": name})

    return api.fetch_and_parse(
        "POST",
        "tournaments/%s/participants" % tournament,
        "participant",
        **params)
344348
function(element, name) {
		var event = this.document.createEvent("UIEvents");
		event.initEvent(name, true, true);
		return element.dispatchEvent(event);
	}
1241111
private void registerEntry(String source,
                               String target,
                               String variant,
                               Object entry,
                               boolean visible) {
        String s = source;
        if (s.length() == 0) {
            s = ANY;
        }
        String ID = TransliteratorIDParser.STVtoID(source, target, variant);
        registerEntry(ID, s, target, variant, entry, visible);
    }
429315
function(filter, name) {
        var node = this.createElementNSPlus("ogc:"+name);
        this.writeNode("PropertyName", filter, node);
        if(filter.value instanceof OpenLayers.Filter.Function) {
            this.writeNode("Function", filter.value, node);
        } else {
        var child;
        if(filter.value instanceof OpenLayers.Geometry) {
            child = this.writeNode("feature:_geometry", filter.value).firstChild;
        } else {
            child = this.writeNode("gml:Box", filter.value);
        }
        if(filter.projection) {
            child.setAttribute("srsName", filter.projection);
        }
        node.appendChild(child);
        }
        return node;
    }
339419
function getOrRegister(name, definition) {
    if(name && !definition) {
      return registry.get(name);
    }
    if(name && definition) {
      return registry.register(name, definition);
    }

    return null;
  }
1057323
protected void registerEditorsWithSubClasses(PropertyEditor editor, Class<? extends BioPAXElement> domain) {

        for (Class<? extends BioPAXElement> c : classToEditorMap.keySet())
        {
            if (domain.isAssignableFrom(c)) {
                //workaround for participants - can be replaced w/ a general
                // annotation based system. For the time being, I am just handling it
                //as a special case
                if ((editor.getProperty().equals("PARTICIPANTS") &&
                        (conversion.class.isAssignableFrom(c) || control.class.isAssignableFrom(c))) ||
                        (editor.getProperty().equals("participant") &&
                                (Conversion.class.isAssignableFrom(c) || Control.class.isAssignableFrom(c)))) {
                    if (log.isDebugEnabled()) {
                        log.debug("skipping restricted participant property");
                    }
                } else {
                    classToEditorMap.get(c).put(editor.getProperty(), editor);
                }
            }

        }

        if (editor instanceof ObjectPropertyEditor) {
            registerInverseEditors((ObjectPropertyEditor) editor);
        }
    }
941298
public Object invokeMethod(String name, Object args) {
        final Object[] argsArr = args instanceof Object[] ? (Object[]) args : new Object[]{args};
        MetaMethod metaMethod = myMetaClass.getMetaMethod(name, argsArr);
        if (metaMethod != null) {
            // we have to use doMethodInvoke here instead of simply invoke,
            // because getMetaMethod may provide a method that can not be called
            // without further argument transformation, which is done only in 
            // doMethodInvoke
            return metaMethod.doMethodInvoke(this, argsArr);
        }

        if (argsArr.length == 2 && argsArr[0] instanceof Class && argsArr[1] instanceof Closure) {
            if (argsArr[0] == theClass)
                registerInstanceMethod(name, (Closure) argsArr[1]);
            else {
                registerSubclassInstanceMethod(name, (Class) argsArr[0], (Closure) argsArr[1]);
            }
            return null;
        }

        if (argsArr.length == 1 && argsArr[0] instanceof Closure) {
            registerInstanceMethod(name, (Closure) argsArr[0]);
            return null;
        }

        throw new MissingMethodException(name, getClass(), argsArr);
    }
150487
function invokeGuardedCallback(name, func, a) {
  try {
    func(a);
  } catch (x) {
    if (caughtError === null) {
      caughtError = x;
    }
  }
}
201098
private void onParticipantIsTyping(ParticipantTypingEvent event) {
        handler.post(() -> listener.onParticipantIsTyping(event));
        log("Event published " + event.toString());
    }
763684
function (name,hidden)
		{
			var eventName = 'event-'+name;
			if (_events[eventName] != undefined) 
				return _events[eventName];
			else
			{
				if (!_eventsConfig[eventName] || !this.c)
					return false;
				var config = _eventsConfig[eventName] || {},
					_class = config.class;
				config.id = eventName;
				config.autoInit = false;
				var evt = this.createClass(_class,config);
				if (evt)
				{
					evt.setParent(this);
					evt.init();
					if (hidden != false)
					{
						_events[eventName] = evt;
						this.e[name]=evt.emit;
					} else
					{
						Object.defineProperty(_events[eventName],{ value: evt, enumerable: false });
					}
					return evt;
				}
				return false;
			}
		}
974281
function(name, interfaze) {
            if (-1 !== this.__interfaces.indexOf(name)) {
                throw new Error('Interface "' + name + '" is already implemented!');
            }
            this.__interfaces.push(name);
            _.extend(this, interfaze);
            return this;
        }
102124
@PluginFactory
  public static SpectatorAppender createAppender(
      @PluginAttribute("name") String name,
      @PluginAttribute("ignoreExceptions") boolean ignoreExceptions,
      @PluginElement("Layout") Layout<? extends Serializable> layout,
      @PluginElement("Filters") Filter filter) {

    if (name == null) {
      LOGGER.error("no name provided for SpectatorAppender");
      return null;
    }

    return new SpectatorAppender(Spectator.globalRegistry(), name, filter, layout, ignoreExceptions);
  }
126361
def lookup(participant_name, workitem, opts={})

      pinfo = participant_name.is_a?(String) ?
        lookup_info(participant_name, workitem) : participant_name

      instantiate(pinfo, opts)
    end
355982
public void registerDestructionCallback(String name, Runnable callback) {
		Bean bean = beans.get(name);
		if (null == bean) {
			bean = new Bean();
			beans.put(name, bean);
		}
		bean.destructionCallback = callback;
	}
1309119
function(name) {
        if (!this.isValidRegister(name)) {
          return this.unamedRegister;
        }
        name = name.toLowerCase();
        if (!this.registers[name]) {
          this.registers[name] = new Register();
        }
        return this.registers[name];
      }
495961
public static BoxRetentionPolicy.Info createIndefinitePolicy(BoxAPIConnection api, String name) {
        return createRetentionPolicy(api, name, TYPE_INDEFINITE, 0, ACTION_REMOVE_RETENTION);
    }