#!/usr/bin/env python3
"""Contains all the user-defined Exceptions created for PgmPy"""


class MissingParentsError(Exception):
    def __init__(self, *missing):
        self.missing = missing

    def __str__(self):
        return repr("Parents are missing: " + str(self.missing))


class ExtraParentsError(Exception):
    def __init__(self, *extra):
        self.extra = extra

    def __str__(self):
        return repr("Following are not parents: " + str(self.extra))


class MissingStatesError(Exception):
    def __init__(self, *missing):
        self.missing = missing

    def __str__(self):
        return repr("States are missing: " + str(self.missing))


class ExtraStatesError(Exception):
    def __init__(self, *extra):
        self.extra = extra

    def __str__(self):
        return repr("Following are not states: " + str(self.extra))

#!/usr/bin/env python3
"""Contains all the user-defined Exceptions created for PgmPy"""


class MissingParentsError(Exception):
    def __init__(self, *missing):
        self.missing = missing

    def __str__(self):
        return repr("Parents are missing: " + str(self.missing))


class ExtraParentsError(Exception):
    def __init__(self, *extra):
        self.extra = extra

    def __str__(self):
        return repr("Following are not parents: " + str(self.extra))


class MissingStatesError(Exception):
    def __init__(self, *missing):
        self.missing = missing

    def __str__(self):
        return repr("States are missing: " + str(self.missing))


class ExtraStatesError(Exception):
    def __init__(self, *extra):
        self.extra = extra

    def __str__(self):
        return repr("Following are not states: " + str(self.extra))


class SelfLoopError(Exception):
    def __init__(self, *extra):
        self.extra = extra

    def __str__(self):
        return repr(str(self.extra))

Add SelfLoopsError Exception