# Path: argos/utils/cls.py
# def is_a_string(var, allow_none=False):
#     """ Returns True if var is a string (ascii or unicode)
# 
#         Result             py-2  py-3
#         -----------------  ----- -----
#         b'bytes literal'   True  False
#          'string literal'  True  True
#         u'unicode literal' True  True
# 
#         Also returns True if the var is a numpy string (numpy.string_, numpy.unicode_).
#     """
#     return isinstance(var, six.string_types) or (var is None and allow_none)
# 
# def is_text(var, allow_none=False):
#     """ Returns True if var is a unicode text
# 
#         Result             py-2  py-3
#         -----------------  ----- -----
#         b'bytes literal'   False False
#          'string literal'  False True
#         u'unicode literal' True  True
# 
#         Also works with the corresponding numpy types.
#     """
#     return isinstance(var, six.text_type) or (var is None and allow_none)
# 
# def is_binary(var, allow_none=False):
#     """ Returns True if var is a binary (bytes) objects
# 
#         Result             py-2  py-3
#         -----------------  ----- -----
#         b'bytes literal'   True  True
#          'string literal'  True  False
#         u'unicode literal' False False
# 
#         Also works with the corresponding numpy types.
#     """
#     return isinstance(var, six.binary_type) or (var is None and allow_none)
# 
# Path: argos/utils/misc.py
# def python2():
#     """ Returns True if we are running python 2
#     """
#     major_version = sys.version_info[0]
#     assert major_version == 2 or major_version == 3, "major_version = {!r}".format(major_version)
#     return major_version == 2


import unittest
import numpy as np
from argos.utils.cls import is_a_string, is_text, is_binary
from argos.utils.misc import python2
             'string literal'  True  True
            u'unicode literal' True  True
        """

        if python2():
            self.assertTrue(is_a_string(self.b_lit))
            self.assertTrue(is_a_string(self.np_b_lit))
        else:
            self.assertFalse(is_a_string(self.b_lit))
            self.assertFalse(is_a_string(self.np_b_lit))

        self.assertTrue(is_a_string(self.s_lit))
        self.assertTrue(is_a_string(self.np_s_lit))

        self.assertTrue(is_a_string(self.u_lit))
        self.assertTrue(is_a_string(self.np_u_lit))


    def test_is_text(self):
        """
            Result             py-2  py-3
            -----------------  ----- -----
            b'bytes literal'   False False
             'string literal'  False True
            u'unicode literal' True  True
        """

        self.assertFalse(is_text(self.b_lit))
        self.assertFalse(is_text(self.np_b_lit))


# Path: argos/utils/cls.py
# def is_a_string(var, allow_none=False):
#     """ Returns True if var is a string (ascii or unicode)
# 
#         Result             py-2  py-3
#         -----------------  ----- -----
#         b'bytes literal'   True  False
#          'string literal'  True  True
#         u'unicode literal' True  True
# 
#         Also returns True if the var is a numpy string (numpy.string_, numpy.unicode_).
#     """
#     return isinstance(var, six.string_types) or (var is None and allow_none)
# 
# def is_text(var, allow_none=False):
#     """ Returns True if var is a unicode text
# 
#         Result             py-2  py-3
#         -----------------  ----- -----
#         b'bytes literal'   False False
#          'string literal'  False True
#         u'unicode literal' True  True
# 
#         Also works with the corresponding numpy types.
#     """
#     return isinstance(var, six.text_type) or (var is None and allow_none)
# 
# def is_binary(var, allow_none=False):
#     """ Returns True if var is a binary (bytes) objects
# 
#         Result             py-2  py-3
#         -----------------  ----- -----
#         b'bytes literal'   True  True
#          'string literal'  True  False
#         u'unicode literal' False False
# 
#         Also works with the corresponding numpy types.
#     """
#     return isinstance(var, six.binary_type) or (var is None and allow_none)
# 
# Path: argos/utils/misc.py
# def python2():
#     """ Returns True if we are running python 2
#     """
#     major_version = sys.version_info[0]
#     assert major_version == 2 or major_version == 3, "major_version = {!r}".format(major_version)
#     return major_version == 2


# Path: tests/test_utils.py
import unittest
import numpy as np
from argos.utils.cls import is_a_string, is_text, is_binary
from argos.utils.misc import python2

             'string literal'  True  True
            u'unicode literal' True  True
        """

        if python2():
            self.assertTrue(is_a_string(self.b_lit))
            self.assertTrue(is_a_string(self.np_b_lit))
        else:
            self.assertFalse(is_a_string(self.b_lit))
            self.assertFalse(is_a_string(self.np_b_lit))

        self.assertTrue(is_a_string(self.s_lit))
        self.assertTrue(is_a_string(self.np_s_lit))

        self.assertTrue(is_a_string(self.u_lit))
        self.assertTrue(is_a_string(self.np_u_lit))


    def test_is_text(self):
        """
            Result             py-2  py-3
            -----------------  ----- -----
            b'bytes literal'   False False
             'string literal'  False True
            u'unicode literal' True  True
        """

        self.assertFalse(is_text(self.b_lit))
        self.assertFalse(is_text(self.np_b_lit))


        if python2():