# Path: hq/hquery/evaluation_error.py
# class HqueryEvaluationError(RuntimeError):
# 
#     @classmethod
#     def must_be_node_set(cls, obj):
#         if not is_node_set(obj):
#             raise HqueryEvaluationError('Expected a node set, but found a(n) {0}'.format(obj.__class__.__name__))
# 
#     @classmethod
#     def must_be_node_set_or_sequence(cls, obj):
#         if not (is_node_set(obj) or is_sequence(obj)):
#             raise HqueryEvaluationError('Expected a node set or sequence, but found a(n) {0}'.format(
#                 obj.__class__.__name__
#             ))
# 
# Path: hq/hquery/expression_context.py
# def get_context_node():
#     return peek_context().node
# 
# def peek_context():
#     try:
#         return context_stack[-1]
#     except IndexError:
#         raise ExpressionStackEmptyError('tried to peek while expression stack was empty')
# 
# Path: hq/hquery/functions/core_boolean.py
# class boolean:
# 
#     def __init__(self, obj):
#         if is_node_set(obj):
#             self.value = len(obj) > 0
#         elif is_number(obj):
#             f = float(obj)
#             self.value = bool(f) and not isnan(f)
#         else:
#             self.value = bool(obj)
# 
#     def __bool__(self):
#         return self.value
# 
#     def __nonzero__(self):
#         return self.__bool__()
# 
#     def __str__(self):
#         return str(self.value).lower()
# 
#     def __eq__(self, other):
#         return is_boolean(other) and self.value == other.value
# 
#     def __repr__(self):
#         return 'boolean({0})'.format(self.value)


from hq.hquery.evaluation_error import HqueryEvaluationError
from hq.hquery.expression_context import get_context_node, peek_context
from hq.hquery.functions.core_boolean import boolean

exports = ('class_', 'even', 'odd')


def class_(*args):
    if len(args) == 1:
        tag = get_context_node()
        name = args[0]
    elif len(args) == 2:

# Path: hq/hquery/evaluation_error.py
# class HqueryEvaluationError(RuntimeError):
# 
#     @classmethod
#     def must_be_node_set(cls, obj):
#         if not is_node_set(obj):
#             raise HqueryEvaluationError('Expected a node set, but found a(n) {0}'.format(obj.__class__.__name__))
# 
#     @classmethod
#     def must_be_node_set_or_sequence(cls, obj):
#         if not (is_node_set(obj) or is_sequence(obj)):
#             raise HqueryEvaluationError('Expected a node set or sequence, but found a(n) {0}'.format(
#                 obj.__class__.__name__
#             ))
# 
# Path: hq/hquery/expression_context.py
# def get_context_node():
#     return peek_context().node
# 
# def peek_context():
#     try:
#         return context_stack[-1]
#     except IndexError:
#         raise ExpressionStackEmptyError('tried to peek while expression stack was empty')
# 
# Path: hq/hquery/functions/core_boolean.py
# class boolean:
# 
#     def __init__(self, obj):
#         if is_node_set(obj):
#             self.value = len(obj) > 0
#         elif is_number(obj):
#             f = float(obj)
#             self.value = bool(f) and not isnan(f)
#         else:
#             self.value = bool(obj)
# 
#     def __bool__(self):
#         return self.value
# 
#     def __nonzero__(self):
#         return self.__bool__()
# 
#     def __str__(self):
#         return str(self.value).lower()
# 
#     def __eq__(self, other):
#         return is_boolean(other) and self.value == other.value
# 
#     def __repr__(self):
#         return 'boolean({0})'.format(self.value)


# Path: hq/hquery/functions/extend_node_set.py
from hq.hquery.evaluation_error import HqueryEvaluationError
from hq.hquery.expression_context import get_context_node, peek_context
from hq.hquery.functions.core_boolean import boolean


exports = ('class_', 'even', 'odd')


def class_(*args):
    if len(args) == 1:
        tag = get_context_node()
        name = args[0]
    elif len(args) == 2:

        HqueryEvaluationError.must_be_node_set(args[0])