def _isinstance()

in ec2stack/core.py [0:0]


    def _isinstance(self, model, raise_error=True):
        """
        Checks if the given model is an instance of the service.

        @param model: Model to be checked.
        @param raise_error: ValueError if model isn't the correct type.
        @return: Bool @raise ValueError: stating not of correct type.
        """
        valid_type = isinstance(model, self.__model__)
        if not valid_type and raise_error:
            raise ValueError('%s is not of type %s' % (model, self.__model__))
        return valid_type