Create a new ``_ClassModel`` from a single Swagger definition.

        :param pclass_for_definition: A callable like
            ``Swagger.pclass_for_definition`` which can be used to resolve
            type references encountered in the definition.

        :param unicode name: The name of the definition.

        :param definition: The Swagger definition to model.  This will be a
            value like the one found at ``spec["definitions"][name]``.

        :return: A new model for the given definition.

def from_swagger(cls, pclass_for_definition, name, definition):
        """
        Create a new ``_ClassModel`` from a single Swagger definition.

        :param pclass_for_definition: A callable like
            ``Swagger.pclass_for_definition`` which can be used to resolve
            type references encountered in the definition.

        :param unicode name: The name of the definition.

        :param definition: The Swagger definition to model.  This will be a
            value like the one found at ``spec["definitions"][name]``.

        :return: A new model for the given definition.
        """
        return cls(
            name=name,
            doc=definition.get(u"description", name),
            attributes=cls._attributes_for_definition(
                pclass_for_definition,
                definition,
            ),
        )