Search for a specified observer within current event's observers
@param {KISSY.Event.Observer} observer
@return {Number} observer's index in observers
770460
function (observer) {
            var observers = this.observers, i;
            for (i = observers.length - 1; i >= 0; --i) {
                /*
             If multiple identical EventListeners are registered on the same EventTarget
             with the same parameters the duplicate instances are discarded.
             They do not cause the EventListener to be called twice
             and since they are discarded
             they do not need to be removed with the removeEventListener method.
             */
                if (observer.equals(observers[i])) {
                    return i;
                }
            }
            return -1;
        }
1033688
function ( obj, args ) {
		args = args || {};

		utility.iterate( args, function ( v, k ) {
			if ( regex.element_update.test( k ) ) {
				obj[k] = v;
			}
			else if ( k === "class" ) {
				!string.isEmpty( v ) ? element.klass( obj, v ) : element.klass( obj, "*", false );
			}
			else if ( k.indexOf( "data-" ) === 0 ) {
				element.data( obj, k.replace( "data-", "" ), v );
			}
			else if ( k === "id" ) {
				var o = observer.listeners;

				if ( o[obj.id] !== undefined ) {
					o[k] = o[obj.id];
					delete o[obj.id];
				}
			}
			else {
				element.attr ( obj, k, v );
			}
		});

		return obj;
	}
253325
def observers(self):
        """"""
        ret = []
        for player in self.players:
            try:
                if player.observer: ret.append(player)
            except: pass # ignore PlayerRecords which don't have an observer attribute
        return ret
10212
def observer(self, component_type=ComponentType):
        
        def inner(func):
            self.add_observer(func, component_type)
            return func
        return inner
129286
public static void addObserver(TaskObserver<?> observer) {
		if(observer != null && tls.get().observers == null) {
			tls.get().observers = new ArrayList<TaskObserver<?>>();
		}
		tls.get().observers.add(observer);
	}
132931
public static function get_observer_list() {
        $events = \core\event\manager::get_all_observers();
        foreach ($events as $key => $observers) {
            foreach ($observers as $observerskey => $observer) {
                $events[$key][$observerskey]->parentplugin =
                        \core_plugin_manager::instance()->get_parent_of_subplugin($observer->plugintype);
            }
        }
        return $events;
    }
552674
@Override
    public void removeObserver(final Observer<S, T> observer) {
        synchronized (OBSERVER_LOCK) {
            observers.remove(observer);
        }
    }
439316
def _get_observer_fun(self, prop_name):
        """"""
        def _observer_fun(self, model, old, new):
            if self._itsme:
                return
            self._on_prop_changed()

        # doesn't affect stack traces
        _observer_fun.__name__ = "property_%s_value_change" % prop_name
        return _observer_fun
731161
function (value) {
        checkDisposed(this);
        if (!this.isStopped) {
          for (var i = 0, os = cloneArray(this.observers), len = os.length; i < len; i++) {
            os[i].onNext(value);
          }
        }
      }
76352
def getObservers(self):
        
        result = []
        for observer in self._observers:
            result.append(
                          {
                              "observing": observer["observing"],
                              "call": observer["call"]
                          })
        return result
767935
function(index) {
			var i = typeof index !== 'undefined' ? index : current;
			if (typeof i != 'number' || i < 0 || i >= slides.length) return null;
			return slides[i];
		}
96058
function makeAccessedObserver() {
      return Observer(object, function(changes) {
        changes.forEach(({type, name}) => {
          var {names} = accessEntry;
          if (!names || type === 'update' && names.indexOf(name) !== -1)
            rerun();
        });
      });
    }
663407
function notifyAccess({object, name}) {

    // Create an observer for changes in properties accessed during execution of this function.
    function makeAccessedObserver() {
      return Observer(object, function(changes) {
        changes.forEach(({type, name}) => {
          var {names} = accessEntry;
          if (!names || type === 'update' && names.indexOf(name) !== -1)
            rerun();
        });
      });
    }

    // Make a new entry in the access table, containing initial property name if any
    // and observer for properties accessed on the object.
    function makeAccessEntry() {
      accesses.set(object, {
        names:    name ? [name] : null,
        observer: makeAccessedObserver()
      });
    }

    // If properties on this object are already being watched, there is already an entry
    // in the access table for it. Add a new property name to the existing entry.
    function setAccessEntry() {
      if (name && accessEntry.names) accessEntry.names.push(name);
      else accessEntry.names = null;
    }

    var accessEntry = accesses.get(object);
    if (accessEntry) setAccessEntry();
    else makeAccessEntry();
  }
1072251
function(connect) {
		var obs = this._observer;
		if (obs) {
			if (connect) {
				obs.observe(document, {
					childList: true,
					subtree: true
				});
			} else {
				obs.disconnect();
			}
		}
	}
140282
def add_observer(self, observer, callble, priority=0):
        
        self.observers.add(priority, observer, callble)
639291
def index_at_event(self, event):
        
        # find index at mouse position
        globalpos = event.globalPos()
        viewport = self.viewport()
        pos = viewport.mapFromGlobal(globalpos)
        return self.indexAt(pos)
931585
public static function observers($specific = null, $default = null)
	{
		$class = get_called_class();

		if ( ! array_key_exists($class, static::$_observers_cached))
		{
			$observers = array();
			if (property_exists($class, '_observers'))
			{
				foreach (static::$_observers as $obs_k => $obs_v)
				{
					if (is_int($obs_k))
					{
						$observers[$obs_v] = array();
					}
					else
					{
						if (is_string($obs_v) or (is_array($obs_v) and is_int(key($obs_v))))
						{
							// @TODO deprecated until v1.4
							logger(\Fuel::L_WARNING, 'Passing observer events as array is deprecated, they must be
								inside another array under a key "events". Check the docs for more info.', __METHOD__);
							$observers[$obs_k] = array('events' => (array) $obs_v);
						}
						else
						{
							$observers[$obs_k] = $obs_v;
						}
					}
				}
			}
			static::$_observers_cached[$class] = $observers;
		}

		if ($specific)
		{
			return \Arr::get(static::$_observers_cached[$class], $specific, $default);
		}

		return static::$_observers_cached[$class];
	}