def verify_components(components):
        """
        Verify values returned from :meth:`make_components`.

        Used internally during the :meth:`build` process.

        :param components: value returned from :meth:`make_components`
        :type components: :class:`dict`
        :raises ValueError: if verification fails
        """
        # verify returned type from user-defined function
        if not isinstance(components, dict):
            raise ValueError(
                "invalid type returned by make_components(): %r (must be a dict)" % components
            )

        # check types for (name, component) pairs in dict
        for (name, component) in components.items():
            # name is a string
            if not isinstance(name, str):
                raise ValueError((
                    "invalid name from make_components(): (%r, %r) "
                    "(must be a (str, Component))"
                ) % (name, component))

            # component is a Component instance
            if not isinstance(component, Component):
                raise ValueError((
                    "invalid component type from make_components(): (%r, %r) "
                    "(must be a (str, Component))"
                ) % (name, component))

            # check component name validity
            invalid_chars = set(name) - VALID_NAME_CHARS
            if invalid_chars:
                raise ValueError(
                    "component name {!r} invalid; cannot include {!r}".format(
                        name, invalid_chars
                    )
                )
def verify_components ( components ) : if not isinstance ( components , dict ) : raise ValueError ( "invalid type returned by make_components(): %r (must be a dict)" % components ) for ( name , component ) in components . items ( ) : if not isinstance ( name , str ) : raise ValueError ( ( "invalid name from make_components(): (%r, %r) " "(must be a (str, Component))" ) % ( name , component ) ) if not isinstance ( component , Component ) : raise ValueError ( ( "invalid component type from make_components(): (%r, %r) " "(must be a (str, Component))" ) % ( name , component ) ) invalid_chars = set ( name ) - VALID_NAME_CHARS if invalid_chars : raise ValueError ( "component name {!r} invalid; cannot include {!r}" . format ( name , invalid_chars ) )
Verify values returned from :meth:`make_components`.

        Used internally during the :meth:`build` process.

        :param components: value returned from :meth:`make_components`
        :type components: :class:`dict`
        :raises ValueError: if verification fails