Inherit from BaseMenu for common methods
161175
function RowMenu( options = {} ) {
	if ( ! options.outputWidth && ! options.width ) {
		options.outputWidth = Math.min( options.parent.inputWidth , options.parent.outputWidth ) ;
	}

	BaseMenu.call( this , options , defaultOptions ) ;

	this.justify = !! options.justify ;
	this.buttonSpacing = options.buttonSpacing || 1 ;

	this.initChildren() ;

	// Only draw if we are not a superclass of the object
	if ( this.elementType === 'RowMenu' && ! options.noDraw ) { this.draw() ; }
}
524569
function(child, parent, protoProps, staticProps) {
    // Inherit prototype properties from parent
    // Set the prototype chain to inherit without calling parent's constructor function.
    SharedConstructor.prototype = parent.prototype;
    child.prototype = new SharedConstructor();
    child.prototype.constructor = child;

    // Extend with prototype and static properties
    extendObj(child.prototype, protoProps);
    extendObj(child, staticProps);

    // Set a convenience property in case the parent's prototype is needed later.
    child.__super__ = parent.prototype;

    // Copy references to static methods we want to extend
    child.extendWithConstructor = Constructr.extendWithConstructor;
    child.extend = Constructr.extend;
    child.mixes = Constructr.mixes;
    child.def = Constructr.def;

    return child;
}
1204651
private void prepareMenu(Container menu, Component component, int x, int y)
    {
        int n = menu.getComponentCount();
        for (int i=0; i<n; i++)
        {
            Component menuComponent = popupMenu.getComponent(i);
            if (menuComponent instanceof JMenu)
            {
                JMenu subMenu = (JMenu)menuComponent;
                prepareMenu(subMenu, component, x, y);
            }
            if (menuComponent instanceof AbstractButton)
            {
                AbstractButton abstractButton = (AbstractButton)menuComponent;
                Action action = abstractButton.getAction();
                if (action != null && action instanceof LocationBasedAction)
                {
                    LocationBasedAction locationBasedAction = 
                        (LocationBasedAction)action;
                    locationBasedAction.prepareShow(component, x, y);
                }
            }
        }
    }
1064233
function(protoProps, classProps) {
			var child = inherits(this, protoProps, classProps);
			child.extend = this.extend;
			// a hack required to WSH inherit `toString` method
			if (protoProps.hasOwnProperty('toString'))
				child.prototype.toString = protoProps.toString;
			return child;
		}
693046
def _inherit_parent_kwargs(self, kwargs):
        

        if not self.parent or not self._is_dynamic:
            return kwargs

        if 'request_fields' not in kwargs:
            # If 'request_fields' isn't explicitly set, pull it from the
            # parent serializer.
            request_fields = self._get_request_fields_from_parent()
            if request_fields is None:
                # Default to 'id_only' for nested serializers.
                request_fields = True
            kwargs['request_fields'] = request_fields

        if self.embed and kwargs.get('request_fields') is True:
            # If 'embed' then make sure we fetch the full object.
            kwargs['request_fields'] = {}

        if hasattr(self.parent, 'sideloading'):
            kwargs['sideloading'] = self.parent.sideloading

        if hasattr(self.parent, 'debug'):
            kwargs['debug'] = self.parent.debug

        return kwargs
756466
function(parent, name, nested, populateFunction, icon, tooltip, selectionClass, positioningNode, defaultInvocation, pretendDefaultActionId, extraClasses) {
			parent = lib.node(parent);
			// We create dropdowns asynchronously so it's possible that the parent has been removed from the document 
			// by the time we are called.  If so, don't bother building a submenu for an orphaned menu.
			if (!parent || !lib.contains(document.body, parent)) {
				return null;
			}
			var menuButton, newMenu, dropdownArrow;
			var destroyButton, menuParent = parent;
			if (nested) {
				var range = document.createRange();
				range.selectNode(parent);
				var buttonFragment = range.createContextualFragment(SubMenuButtonFragment);
				// bind name to fragment variable
				lib.processTextNodes(buttonFragment, {ButtonText: name});
				parent.appendChild(buttonFragment);
				destroyButton = parent.lastChild;
				newMenu = destroyButton.lastChild;
				menuButton = newMenu.previousSibling;
				menuButton.dropdown = new mDropdown.Dropdown({dropdown: newMenu, name: name, populate: populateFunction, parentDropdown: parent.dropdown});
				newMenu.dropdown = menuButton.dropdown;
			} else {
				if (parent.nodeName.toLowerCase() === "ul") { //$NON-NLS-0$
					menuParent = document.createElement("li"); //$NON-NLS-0$
					menuParent.setAttribute("role", "none");
					parent.appendChild(menuParent);
					destroyButton = menuParent;
				}
				var buttonCss = null;
				if (icon) {
					buttonCss = "dropdownButtonWithIcon"; //$NON-NLS-0$ // This class distinguishes dropdown buttons with an icon from those without
					tooltip = tooltip || name; // No text and no tooltip => fallback to name
				}
				tooltip = icon ? (tooltip || name) : tooltip;
				var created = Commands.createDropdownMenu(menuParent, name, populateFunction, buttonCss, icon, false, selectionClass, positioningNode, defaultInvocation || pretendDefaultActionId, extraClasses);
				dropdownArrow = created.dropdownArrow;
				menuButton = created.menuButton;
				if (dropdownArrow) {
					if (defaultInvocation) {
						defaultInvocation.domNode = created.menuButton;
					}
					var self = this;
					menuButton.onclick = function(evt){
						var bounds = lib.bounds(dropdownArrow);
						if ((evt.clientX >= bounds.left || pretendDefaultActionId === true) && created.dropdown) {
							created.dropdown.toggle(evt);
						} else {
							self._invoke(defaultInvocation);
						}
					};
					if (created.dropdown) {
						menuButton.onkeydown = function(evt) {
							if (lib.KEY.DOWN === evt.keyCode) {
								created.dropdown.toggle(evt);
								lib.stop(evt);
							}
						};
					}
				}
				newMenu = created.menu;
				var tooltipText, hasDefault = defaultInvocation && defaultInvocation.command && (defaultInvocation.command.tooltip || defaultInvocation.command.name);
				if (hasDefault) {
					tooltipText = defaultInvocation.command.tooltip || defaultInvocation.command.name;
				} else {
					tooltipText = tooltip;
				}
				if (tooltipText) {
					menuButton.commandTooltip = new mTooltip.Tooltip({
						node: menuButton,
						text: tooltipText,
						position: ["above", "below", "right", "left"] //$NON-NLS-3$ //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$
					});					
				}
			}
			
			return {menuButton: menuButton, menu: newMenu, dropdown: menuButton.dropdown, destroyButton: destroyButton, dropdownArrow: dropdownArrow};
		}
1352250
def inherit_kwargs(inherit_func):
    
    import utool as ut
    keys, is_arbitrary = ut.get_kwargs(inherit_func)
    if is_arbitrary:
        keys += ['**kwargs']
    kwargs_append = '\n'.join(keys)
    #from six.moves import builtins
    #builtins.print(kwargs_block)
    def _wrp(func):
        if func.__doc__ is None:
            func.__doc__ = ''
        # TODO append to kwargs block if it exists
        kwargs_block = 'Kwargs:\n' + ut.indent(kwargs_append)
        func.__doc__ += kwargs_block
        return func
    return _wrp
659025
function inherit(options, destination, source, key) {
		var define, override, path;

		if (key in destination) {
			if (isObject(destination[key]) && isObject(source[key])) {
				//  live up to the name and merge the sub objects
				Object.keys(source[key]).forEach(function(k) {
					inherit(options, destination[key], source[key], k);
				});
			}

			return;
		}

		options.path.push(key);
		define = {enumerable: true};

		if (isObject(source[key])) {
			override = combine(options, [source[key]]);
		}
		else if (source[key] instanceof Array) {
			override = monitorArray(source[key], function() {
				options.emitter.emit('change', path, source[key], source[key]);
			});
		}

		if (isTrue(options, 'live')) {
			path = options.path.join('.');

			define.get = function() {
				return override || source[key];
			};

			define.set = function(value) {
				if (isTrue(options, 'locked') || value === destination[key]) {
					return;
				}

				if (isObject(value)) {
					options.path = path.split('.');
					value = combine(options, [value, source[key]]);
				}

				override = null;
				options.emitter.emit('change', path, value, source[key]);
				source[key] = value;
			};
		}
		else {
			define.value = override || source[key];
			define.writable = !isTrue(options, 'locked');
		}

		Object.defineProperty(destination, key, define);

		options.path.pop();
	}
254101
function inheritedCustomObject(name, Meta) {
    var key = memberProperty(name);
    var capitalized = capitalize(name);
    Meta.prototype['writable' + capitalized] = function (create) {
      var ret = this[key];
      if (!ret) {
        if (this.parent) {
          ret = this[key] = this.parent['writable' + capitalized](create).copy(this.source);
        } else {
          ret = this[key] = create(this.source);
        }
      }
      return ret;
    };
    Meta.prototype['readable' + capitalized] = function () {
      return this._getInherited(key);
    };
  }
703762
public function inheritMethods(&$element, &$rootDoc, &$package)
    {
        $methods =& $element->methods();
        if ($methods) {
            ksort($methods);
            $num = count($methods); $foo = 0;
            echo '<table class="inherit">', "\n";
            echo '<tr><th colspan="2">Methods inherited from ', $element->qualifiedName(), "</th></tr>\n";
            echo '<tr><td>';
            foreach ($methods as $method) {
                echo '<a href="', str_repeat('../', $this->_depth), $method->asPath(), '">', $method->name(), '</a>';
                if (++$foo < $num) {
                    echo ', ';
                }
            }
            echo '</td></tr>';
            echo "</table>\n\n";
            if ($element->superclass()) {
                $superclass =& $rootDoc->classNamed($element->superclass());
                if ($superclass) {
                    $this->inheritMethods($superclass, $rootDoc, $package);
                }
            }
        }
    }
1223581
public static void sortMenu(BaseComponent parent, int startIndex, int endIndex) {
        List<BaseComponent> items = parent.getChildren();
        int bottom = startIndex + 1;

        for (int i = startIndex; i < endIndex;) {
            BaseComponent item1 = items.get(i++);
            BaseComponent item2 = items.get(i);

            if (item1 instanceof BaseMenuComponent && item2 instanceof BaseMenuComponent && ((BaseMenuComponent) item1)
                    .getLabel().compareToIgnoreCase(((BaseMenuComponent) item2).getLabel()) > 0) {
                parent.swapChildren(i - 1, i);

                if (i > bottom) {
                    i -= 2;
                }
            }
        }
    }
776985
def _inherit_from(context, uri, calling_uri):
    """"""

    if uri is None:
        return None
    template = _lookup_template(context, uri, calling_uri)
    self_ns = context['self']
    ih = self_ns
    while ih.inherits is not None:
        ih = ih.inherits
    lclcontext = context._locals({'next': ih})
    ih.inherits = TemplateNamespace("self:%s" % template.uri,
                                lclcontext,
                                template=template,
                                populate_self=False)
    context._data['parent'] = lclcontext._data['local'] = ih.inherits
    callable_ = getattr(template.module, '_mako_inherit', None)
    if callable_ is not None:
        ret = callable_(template, lclcontext)
        if ret:
            return ret

    gen_ns = getattr(template.module, '_mako_generate_namespaces', None)
    if gen_ns is not None:
        gen_ns(context)
    return (template.callable_, lclcontext)
1204465
def create_context_menu(self, extended):
        """"""
        menu = Gtk.Menu()
        self._menu(menu, extended)
        return menu
1209252
function (name, clazz, func) {
        /*  determine inheritance of current class  */
        var extend = _cs.annotation(clazz, "extend");
        if (extend === null)
            return null;

        /*  find function in current class' prototype and mixin chain  */
        var found = false;
        if (   _cs.istypeof(clazz.prototype[name]) === "function"
            && _cs.isown(clazz.prototype, name)                  ) {
            var currentFuncOfChain = clazz.prototype[name];
            while (_cs.istypeof(currentFuncOfChain) === "function") {
                if (currentFuncOfChain === func) {
                    found = true;
                    break;
                }
                currentFuncOfChain = resolve_annotation(currentFuncOfChain, "base");
            }
        }

        /*  if not found, search recusively in the parent hierarchy,
            starting from the parent class  */
        if (!found)
            return resolve_extend(name, extend, func);

        /*  return the parent class  */
        return extend;
    }
383632
function inherits(ctor, sctor) {
		ctor.prototype = Object.create(sctor.prototype);
		ctor._super = sctor;
	}
844866
function inheritParent(constructor, parent) {
        var x,
            binds = parent[$class].binds,
            key,
            value;

        // Inherit binds
        for (x = binds.length - 1; x >= 0; x -= 1) {
            if (binds[x].substr(0, 2) !== '__') {
                constructor[$class].binds.push(binds[x]);
            }
        }

        // Grab properties
        append(constructor[$class].properties, parent[$class].properties);

        // Inherit static methods and properties
        append(constructor[$class].staticMethods, parent[$class].staticMethods);

        for (x =  parent[$class].staticMethods.length - 1; x >= 0; x -= 1) {
            if (parent[$class].staticMethods[x].substr(0, 2) !== '__') {
                constructor[parent[$class].staticMethods[x]] = parent[parent[$class].staticMethods[x]];
            }
        }

        for (key in parent[$class].staticProperties) {
            value = parent[$class].staticProperties[key];

            if (key.substr(0, 2) !== '__') {
                constructor[$class].staticProperties[key] = value;
                constructor[key] = value;
            }
        }

        obfuscateProperty(constructor, '$parent', parent);

        // Inherit implemented interfaces
        constructor[$class].interfaces = [].concat(parent[$class].interfaces);
    }
27902
def get_inheritors(cls):
    """"""
    subclasses = set()
    work = [cls]
    while work:
        parent = work.pop()
        for child in parent.__subclasses__():
            if child not in subclasses:
                subclasses.add(child)
                work.append(child)
    return subclasses