Returns the event module by event name and event version.
@param {String} name    The event name.
@param {Number} version The event version. [optional; default 0]
@returns {Event}
198680
function (name, version) {
    if (!name || !_.isString(name)) {
      var err = new Error('Please pass a valid string as name!');
      debug(err);
      throw err;
    }

    version = version || 0;

    if (!_.isNumber(version)) {
      var err = new Error('Please pass a valid number as version!');
      debug(err);
      throw err;
    }

    return _.find(this.events, function (evt) {
      return evt.name === name && evt.version === version;
    });
  }
1247399
function getAvailableNpmVersions(module_name) {
    var npm = require('npm');
    return Q.nfcall(npm.load).then(function () {
        return Q.ninvoke(npm.commands, 'view', [module_name, 'versions'], /* silent = */ true).then(function (result) {
            // result is an object in the form:
            //     {'<version>': {versions: ['1.2.3', '1.2.4', ...]}}
            // (where <version> is the latest version)
            return result[Object.keys(result)[0]].versions;
        });
    });
}
232209
def _load_resource(version, name)
      _version_module(version).const_get(name.camelcase.singularize).new
    rescue NameError
      nil
    end
952613
function getHandlers (name, callback, context) {
    var events = [];
    if (!callback && !context) {
        if (name) {
            return (this._events && this._events[name]) || [];
        } else {
            return this._events;
        }
    }
    _.each(this._events, function (value, key) {
        if (!name || key === name) {
            value.forEach(function (event) {
                if ((!callback || event.callback === callback) && (!context || event.context === context)) {
                    events.push(event);
                }
            });
        }
    });
    return events;
}
913548
public static TraceEvent getVersion(List<TraceEvent> events)
   {
      for (TraceEvent te : events)
      {
         if (te.getType() == TraceEvent.VERSION)
            return te;
      }

      return null;
   }
277824
public function get($name, $default = null)
    {
        if (array_key_exists($name, $this->eventData)) {
            return $this->eventData[$name];
        }

        return $default;
    }
580422
function(name, callback, context) {
      if (!eventsApi(this, 'on', name, [callback, context]) || !callback) return this;
      this._events || (this._events = {});
      var events = this._events[name] || (this._events[name] = []);
      events.push({callback: callback, context: context, ctx: context || this});
      return this;
    }
1078013
public static function getModuleInstanceByName($name)
    {
        $instance = self::getInstance();
        foreach ($instance->getModules() as $module) {
            if ($module->title === $name) {
                return $module;
            }
        }
        return null;
    }
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;
			}
		}
558304
def get_event(self, name, default=_sentinel):
        
        if name not in self.events:
            if self.create_events_on_access:
                self.add_event(name)
            elif default is not _sentinel:
                return default
        return self.events[name]
211286
function (name, version) {
    if (!name || !_.isString(name)) {
      var err = new Error('Please pass a valid string as name!');
      debug(err);
      throw err;
    }

    version = version || 0;

    if (!_.isNumber(version)) {
      var err = new Error('Please pass a valid number as version!');
      debug(err);
      throw err;
    }

    var handler =  _.find(this.commandHandlers, function (cmdHnd) {
      return cmdHnd.name === name && cmdHnd.version === version;
    });

    if (handler) {
      return handler;
    }

    if (!this.getCommand(name, version)) {
      return null;
    }

    return this.defaultCommandHandler;
  }
746701
function (name) {
			return function (args, onDone) {
				
				if (typeof args === 'function') {
					onDone = args;
					args = {};
				}
				
				console.log('calling API [' + name + ']...');
				
				// NOTE: by default callbacks are always kept
				SR.sendEvent(name, args, function (result) {
					if (result.err) {
						console.error(result.err);
						return SR.safeCall(onDone, result.err);
					}
					
					SR.safeCall(onDone, null, result.result);
				}, undefined, true);
			}
		}
754462
function(version) {
        version = version || this.defaultVersion;
        var profile = this.profile ? "_" + this.profile : "";
        if(!this.parser || this.parser.VERSION != version) {
            var format = OpenLayers.Format[this.name][
                "v" + version.replace(/\./g, "_") + profile
            ];
            if(!format) {
                if (profile !== "" && this.allowFallback) {
                    // fallback to the non-profiled version of the parser
                    profile = "";
                    format = OpenLayers.Format[this.name][
                        "v" + version.replace(/\./g, "_")
                    ];
                }
                if (!format) {
                    throw "Can't find a " + this.name + " parser for version " +
                          version + profile;
                }
            }
            this.parser = new format(this.options);
        }
        return this.parser;
    }
653187
public function getModuleByName($name)
    {
        foreach ($this->modules as $module) {
            /* @var $module Module */
            if ($name == $module->getValue()->getName()) {
                return $module;
            }
        }

        return false;
    }
1122431
public com.google.javascript.jscomp.FunctionInformationMap.Module getModule(int index) {
    return module_.get(index);
  }
333294
public function js($name,$version = false) {
		$cdn = false;
		if ($name[0] === '>') {
			$name[0] = '';
			$name = trim($name);
			$cdn = true;		
		}
		if(strpos($name, '::')=== false){
			$name .='::';
		} 
		list($name,$ver) = explode('::',$name); 
		
		
		
		$name = call_user_func(RitaTools::libRepo($name),$cdn, $name[1]);
	
		pr($name);	
	
		//	return LibRepo::$name(RitaTools::inLocalhost(),$version);	
	}
899686
protected String getVersion(String version) {
        return this.version == null || this.version.length() == 0
                ? version
                : this.version;
    }