def _filter_options(options, *names):
    """
        Return a subset of C{options} including only those listed in C{names}.  This is a
        utility method.  Its main purpose is to build a subset of options dictionary for
        C{L{_generate_derived_type_dictionary}} method, which is safe to use as locals or
        globals for evaluating method definitions.

        @param options: full dictionary of options.
        @type  options: C{dict}

        @param names:   permitted options.

        @rtype:         C{dict}
        """
    filtered_options = {}
    for name in names:
        if name in options:
            filtered_options[name] = options[name]
    return filtered_options
