def _check_attributes(self, node):

        attrs = node.attrs
        ltype = getattr(attrs, 'NODE_TYPE', None)
        ltypever = getattr(attrs, 'NODE_TYPE_VERSION', None)

        if ltype != NodeType:
            raise ValueError("invalid type of node object: %s" % (ltype,))
        if ltypever not in NodeTypeVersions:
            raise ValueError(
                "unsupported type version of node object: %s" % (ltypever,))
Helper method to get the region code for a given phone number, from a list of possible region
dataset/ETHPy150Open PyTables/PyTables/tables/nodes/filenode.py/RawPyTablesIO._check_attributes--crossover with--dataset/ETHPy150Open daviddrysdale/python-phonenumbers/python/phonenumbers/shortnumberinfo.py/_region_code_for_short_number_from_region_list