def to_bytes(s, encoding=None, errors=None):
    if not isinstance(s, bytes):
        return ('%s' % s).encode(encoding or 'utf-8', errors or 'strict')
    elif not encoding or encoding == 'utf-8':
        return s
    else:
        d = s.decode('utf-8')
        return d.encode(encoding, errors or 'strict')
Returns True if the given array is a Latin hypercube.
dataset/ETHPy150Open quantmind/pulsar/pulsar/utils/string.py/to_bytes--crossover with--dataset/ETHPy150Open OpenMDAO/OpenMDAO-Framework/openmdao.lib/src/openmdao/lib/doegenerators/optlh.py/is_latin_hypercube