def METHOD_NAME(arg):
    """Domain validator for ports
    Args:
        arg : argument to be checked as a Port
    Returns:
        Port object or Exception
    """
    if not isinstance(arg, Port):
        raise ConfigurationError(
            "Invalid argument type. Expected an instance " "of a Pyomo Port object"
        )
    return arg