human
I wrote the below code

    if (recursion_depth > MAX_RECURSION_DEPTH):
        raise Exception('Maximum    recursion    depth    exceeded    in    jsonable2thrift.')
    if (jsonable is None):
        return default
    def check_bits(jsonable, bits):
        '\n                Helper    function    to    check    bounds.\n\n                The    Thrift    IDL    specifies    how    many    bytes    numbers    can    be,    and    always    uses\n                signed    integers.        This    makes    sure    that    the    Thrift    struct    that    comes    out\n                conforms    to    that    schema.\n                '
        check_type(jsonable, (int, long))
        min_val = ((-1) << (bits - 1))
        max_val = ((1 << (bits - 1)) - 1)
        assert (min_val <= jsonable), ('Value    %d    <=    %d    minimum    value' % (jsonable, min_val))
        assert (max_val >= jsonable), ('Value    %d    >=    %d    maxium    value' % (jsonable, max_val))
    def check_type(jsonable, expected):
        assert isinstance(jsonable, expected), ('Value    %s    has    wrong    type.        Expected    %s.' % (repr(jsonable), repr(expected)))
    if (type_enum == TType.BOOL):
        check_type(jsonable, bool)
        return jsonable
    elif (type_enum == TType.BYTE):
        check_bits(jsonable, 8)
        return jsonable
    elif (type_enum == TType.I16):
        check_bits(jsonable, 16)
        return jsonable
    elif (type_enum == TType.I32):
        check_bits(jsonable, 32)
        return jsonable
    elif (type_enum == TType.I64):
        check_bits(jsonable, 64)
        return jsonable
    elif (type_enum == TType.DOUBLE):
        check_type(jsonable, float)
        return jsonable
    elif (type_enum == TType.STRING):
        assert isinstance(jsonable, basestring)
        return jsonable
    elif (type_enum == TType.STRUCT):
        check_type(jsonable, dict)
        (thrift_type, thrift_spec) = spec_args
        out = thrift_type()
        for spec in thrift_spec:
            if (spec is None):
               ...

What's a good function header?

=====
Here's a good function header?
assistant
#Here's a good function header.

def _jsonable2thrift_helper(jsonable, type_enum, spec_args, default, recursion_depth=0):