# Path: anchorhub/exceptions/validationexception.py
# class ValidationException(Exception):
#     def __init__(self, *args, **kwargs):
#         Exception.__init__(self, *args, **kwargs)
# 
# Path: anchorhub/util/hasattrs.py
# def hasattrs(object, *names):
#     """
#     Takes in an object and a variable length amount of named attributes,
#     and checks to see if the object has each property. If any of the
#     attributes are missing, this returns false.
# 
#     :param object: an object that may or may not contain the listed attributes
#     :param names: a variable amount of attribute names to check for
#     :return: True if the object contains each named attribute, false otherwise
#     """
#     for name in names:
#         if not hasattr(object, name):
#             return False
#     return True


import os.path as path
from anchorhub.exceptions.validationexception import ValidationException
from anchorhub.util.hasattrs import hasattrs
"""
Functions for validating the overwrite argument in combination with other
arguments
"""



def validate(opts):
    """
     Client facing overwrite validation. Checks to see if the opts arguments
     contains the attributes 'overwrite', 'input', and 'output'.

    :param opts: a namespace containing the attributes 'overwrite', 'input',
        and 'output'
    :raises ValueError: if the value passed in is not a namespace with the
        attributes 'overwrite', 'input', and 'output'
    :raises ValidationException: if opts fails any of the validations
    :return: True if opts passes the validations
    """

# Path: anchorhub/exceptions/validationexception.py
# class ValidationException(Exception):
#     def __init__(self, *args, **kwargs):
#         Exception.__init__(self, *args, **kwargs)
# 
# Path: anchorhub/util/hasattrs.py
# def hasattrs(object, *names):
#     """
#     Takes in an object and a variable length amount of named attributes,
#     and checks to see if the object has each property. If any of the
#     attributes are missing, this returns false.
# 
#     :param object: an object that may or may not contain the listed attributes
#     :param names: a variable amount of attribute names to check for
#     :return: True if the object contains each named attribute, false otherwise
#     """
#     for name in names:
#         if not hasattr(object, name):
#             return False
#     return True


# Path: anchorhub/validation/validate_overwrite.py
import os.path as path
from anchorhub.exceptions.validationexception import ValidationException
from anchorhub.util.hasattrs import hasattrs

"""
Functions for validating the overwrite argument in combination with other
arguments
"""



def validate(opts):
    """
     Client facing overwrite validation. Checks to see if the opts arguments
     contains the attributes 'overwrite', 'input', and 'output'.

    :param opts: a namespace containing the attributes 'overwrite', 'input',
        and 'output'
    :raises ValueError: if the value passed in is not a namespace with the
        attributes 'overwrite', 'input', and 'output'
    :raises ValidationException: if opts fails any of the validations
    :return: True if opts passes the validations
    """

    if hasattrs(opts, 'overwrite', 'input', 'output'):