Return the registered methods as DisplayList
427943
def _getMethodsVoc(self):
        
        methods = api.search({
            "portal_type": "Method",
            "is_active": True
        }, "bika_setup_catalog")

        items = map(lambda m: (api.get_uid(m), api.get_title(m)), methods)
        items.sort(lambda x, y: cmp(x[1], y[1]))
        items.insert(0, ("", _("Not specified")))

        return DisplayList(list(items))
1136579
def _display_objects(obj_type, object_repo, namespace, cmt_begin, cmt_end,
                         dest=None, summary=None, output_format=None):
        

        # TODO:ks FUTURE Consider sorting to perserve order of compile/add.
        if namespace in object_repo:
            if obj_type == 'Methods':
                _uprint(dest,
                        _format(u"{0}Namespace {1!A}: contains {2} {3}:{4}\n",
                                cmt_begin, namespace,
                                len(object_repo[namespace]),
                                obj_type, cmt_end))
            else:
                _uprint(dest,
                        _format(u"{0}Namespace {1!A}: contains {2} {3} {4}\n",
                                cmt_begin, namespace,
                                len(object_repo[namespace]),
                                obj_type, cmt_end))
            if summary:
                return

            # instances are special because the inner struct is a list
            if obj_type == 'Instances':
                try:
                    insts = object_repo[namespace]
                except KeyError:
                    return

                # TODO:ks Future: Possibly sort insts by path order.
                for inst in insts:
                    if output_format == 'xml':
                        _uprint(dest,
                                _format(u"{0} Path={1} {2}\n{3}",
                                        cmt_begin, inst.path.to_wbem_uri(),
                                        cmt_end,
                                        _pretty_xml(inst.tocimxmlstr())))
                    elif output_format == 'repr':
                        _uprint(dest,
                                _format(u"Path:\n{0!A}\nInst:\n{1!A}\n",
                                        inst.path, inst))
                    else:
                        _uprint(dest,
                                _format(u"{0} Path={1} {2}\n{3}",
                                        cmt_begin, inst.path.to_wbem_uri(),
                                        cmt_end, inst.tomof()))

            elif obj_type == 'Methods':
                try:
                    methods = object_repo[namespace]
                except KeyError:
                    return

                for cln in methods:
                    for method in methods[cln]:
                        _uprint(dest,
                                _format(u"{0}Class: {1}, method: {2}, "
                                        u"callback: {3} {4}",
                                        cmt_begin, cln, method,
                                        methods[cln][method].__name__,
                                        cmt_end))

            else:
                assert obj_type in ['Classes', 'Qualifier Declarations']
                try:
                    objs = object_repo[namespace]
                except KeyError:
                    return
                for key in sorted(objs):
                    obj = objs[key]
                    if output_format == 'xml':
                        _uprint(dest, _pretty_xml(obj.tocimxmlstr()))
                    elif output_format == 'repr':
                        _uprint(dest, _format(u"{0!A}", obj))
                    else:
                        _uprint(dest, obj.tomof())
787168
def nice_display(item):
    """"""
    if hasattr(item, 'all'):  # RelatedManager: display a list
        return ', '.join(map(text_type, item.all()))
    return item
989572
public JMethod []getDeclaredMethods()
  {
    SoftReference<JMethod[]> jMethodsRef = _declaredMethodsRef;
    JMethod []jMethods = null;

    if (jMethodsRef != null) {
      jMethods = jMethodsRef.get();
      if (jMethods != null)
        return jMethods;
    }

    Method []methods = _class.getDeclaredMethods();
    
    jMethods = new JMethod[methods.length];

    for (int i = 0; i < methods.length; i++) {
      jMethods[i] = new JMethodWrapper(methods[i], getClassLoader());
    }

    _declaredMethodsRef = new SoftReference<JMethod[]>(jMethods);

    return jMethods;
  }
1141003
private static List<Method> getMethodsList(final Class cls, final boolean declared) {
		$.checkNotNull(cls);

		final List<Method> allMethods = new ArrayList<Method>();
		Class currentClass = cls;
		while (currentClass != null) {
			final Method[] methods = declared ? currentClass.getDeclaredMethods() : currentClass.getMethods();
			for (Method method : methods) {
				allMethods.add(method);
			}
			currentClass = currentClass.getSuperclass();
		}
		return allMethods;
	}
1076221
function getMethodList(obj) {
    var arr = obj && typeof obj === 'string' ? [obj] : obj, list;
    if (arr) {
      list = {};
      arr.forEach(function(item) {
        list[item.toLowerCase()] = true;
      });
    }
    return list;
  }
365693
function getJavaScriptParameterListSimple(parameters, returnType) {
    var result = []

    parameters.forEach(function(parameter){
        if (parameter.out) return
        result.push("<span class='type'>/*" + getIdlType(parameter.type) + "*/ </span><span class='parameterName'>" + parameter.name + "</span>")
    })

    result.push("<span class='parameterName'>callback</span>")
    return result.join(", ")
}
1211301
def _view(self, filepath, format):
        """"""
        methodnames = [
            '_view_%s_%s' % (format, backend.PLATFORM),
            '_view_%s' % backend.PLATFORM,
        ]
        for name in methodnames:
            view_method = getattr(self, name, None)
            if view_method is not None:
                break
        else:
            raise RuntimeError('%r has no built-in viewer support for %r '
                'on %r platform' % (self.__class__, format, backend.PLATFORM))
        view_method(filepath)
1185197
def get_view(cls, method_name):
        
        method = getattr(cls, method_name)

        @wraps(method)
        def view(request, **kwargs):
            handler = cls(request, kwargs)
            handler.call_processors('view')
            response = None
            try:
                response = method(handler)
                return response
            finally:
                handler.call_processors('post_view', response=response)

        return view
616402
def view_list(self):
        ''''''
        done = set()
        ret = []
        while len(done) != self.count():
            p = self.view_indexes(done)
            if len(p) > 0:
                ret.append(p)
        return ret
755127
def implemented_methods(cls):
        ''''''
        if cls.__implemented_methods:
            return cls.__implemented_methods
        cls.__implemented_methods = {}
        for method in cls.callbacks:
            for op in getattr(method, 'swagger_ops'):
                cls.__implemented_methods[op] = method
        return cls.__implemented_methods
745943
protected String getDisplayNameOf(Method e, T i) {
        Class<?> c = e.getDeclaringClass();
        String key = displayNameOf(i);
        if (key.length()==0)  return c.getSimpleName()+"."+e.getName();
        try {
            ResourceBundleHolder rb = ResourceBundleHolder.get(
                    c.getClassLoader().loadClass(c.getPackage().getName() + ".Messages"));
            return rb.format(key);
        } catch (ClassNotFoundException x) {
            LOGGER.log(WARNING, "Failed to load "+x.getMessage()+" for "+e.toString(),x);
            return key;
        } catch (MissingResourceException x) {
            LOGGER.log(WARNING, "Could not find key '" + key + "' in " + c.getPackage().getName() + ".Messages", x);
            return key;
        }
    }
925795
def to_display_list(pairs, sort_by="key", allow_empty=True):
    
    dl = DisplayList()

    if isinstance(pairs, basestring):
        pairs = [pairs, pairs]
    for pair in pairs:
        # pairs is a list of lists -> add each pair
        if isinstance(pair, (tuple, list)):
            dl.add(*pair)
        # pairs is just a single pair -> add it and stop
        if isinstance(pair, basestring):
            dl.add(*pairs)
            break

    # add the empty option
    if allow_empty:
        dl.add("", "")

    # sort by key/value
    if sort_by == "key":
        dl = dl.sortedByKey()
    elif sort_by == "value":
        dl = dl.sortedByValue()

    return dl
708798
def list_public_methods(obj: Any):
    
    return [member for member in dir(obj)
            if not member.startswith('_') and
            callable(getattr(obj, member))]
85800
public static String formatDisplayList(String[] displayList, int termHeight, int termWidth) {
        return formatDisplayList(Arrays.asList(displayList), termHeight, termWidth);
    }
969995
function showInterfaceJavaMethod(intf, method, html) {
    var line = ""

    line += "\n    /**"
    line += "\n     * "
    line += "\n     */"
    line += "\n    <span class='methodName'>public void " + method.name + "</span>(" + getJavaParameterListSimple(method.parameters, method.returns) + ") throws IOException {"
    line += "\n        Main.warn(getClass().getName() + \"." + method.name + "() not implemented\");"
    line += "\n"
    line += "\n        channel.sendCallback(\"" + intf.name + "\", callbackId" + getJavaCallbackParameterListSimple(method.callbackParameters) + ");"
    line += "\n    }"
    line += "\n"
    html.push(line)
}
1034868
public Set<Method> getMethodsReturn(Class returnType) {
        return getMethodsFromDescriptors(store.get(index(MethodParameterScanner.class), names(returnType)), loaders());
    }