human
Complete this python program:
def _fill_cdata(cls):
assistant
#Here is the Python program you requested.

    """Add struct pack/unpack functions
    """
    funcs = {}
    for (key, name) in [('b', 'char'), ('h', 'short'), ('i', 'int'), ('q', 'longlong')]:
        for (echar, esuffix) in [('<', 'le'), ('>', 'be')]:
            esuffix = ('_' + esuffix)
            for unsigned in [True, False]:
                s = struct.Struct((echar + (key.upper() if unsigned else key)))
                get_wrapper = (lambda f: (lambda *a, **k: f(*a, **k)[0]))
                unpack = get_wrapper(s.unpack)
                unpack_from = get_wrapper(s.unpack_from)
                def get_unpack_from(s):
                    def unpack_from(data, offset=0):
                        return (s.unpack_from(data, offset)[0], (offset + s.size))
                    return unpack_from
                unpack_from = get_unpack_from(s)
                pack = s.pack
                prefix = ('u' if unsigned else '')
                if (s.size == 1):
                    esuffix = ''
                bits = str((s.size * 8))
                if unsigned:
                    max_ = ((2 ** (s.size * 8)) - 1)
                    min_ = 0
                else:
                    max_ = ((2 ** ((s.size * 8) - 1)) - 1)
                    min_ = (- (2 ** ((s.size * 8) - 1)))
                funcs[('%s%s_min' % (prefix, name))] = min_
                funcs[('%s%s_max' % (prefix, name))] = max_
                funcs[('%sint%s_min' % (prefix, bits))] = min_
                funcs[('%sint%s_max' % (prefix, bits))] = max_
                funcs[('%s%s%s' % (prefix, name, esuffix))] = unpack
                funcs[('%sint%s%s' % (prefix, bits, esuffix))] = unpack
                funcs[('%s%s%s_from' % (prefix, name, esuffix))] = unpack_from
                funcs[('%sint%s%s_from' % (prefix, bits, esuffix))] = unpack_from
                funcs[('to_%s%s%s' % (prefix, name, esuffix))] = pack
                funcs[('to_%sint%s%s' % (prefix, bits, esuffix))] = pack
    for (key, func) in iteritems(funcs):
        setattr(cls, key, staticmethod(func))