def generate_take_template(template, exclude=None):
    # name, dest, ctypein, ctypeout, preval, postval, cancopy, nogil
    function_list = [
        ('bool', 'bool', 'uint8_t', 'uint8_t', '', '', True, True),
        ('bool', 'object', 'uint8_t', 'object',
         'True if ', ' > 0 else False', False, False),
        ('int8', 'int8', 'int8_t', 'int8_t', '', '', True, False),
        ('int8', 'int32', 'int8_t', 'int32_t', '', '', False, True),
        ('int8', 'int64', 'int8_t', 'int64_t', '', '', False, True),
        ('int8', 'float64', 'int8_t', 'float64_t', '', '', False, True),
        ('int16', 'int16', 'int16_t', 'int16_t', '', '', True, True),
        ('int16', 'int32', 'int16_t', 'int32_t', '', '', False, True),
        ('int16', 'int64', 'int16_t', 'int64_t', '', '', False, True),
        ('int16', 'float64', 'int16_t', 'float64_t', '', '', False, True),
        ('int32', 'int32', 'int32_t', 'int32_t', '', '', True, True),
        ('int32', 'int64', 'int32_t', 'int64_t', '', '', False, True),
        ('int32', 'float64', 'int32_t', 'float64_t', '', '', False, True),
        ('int64', 'int64', 'int64_t', 'int64_t', '', '', True, True),
        ('int64', 'float64', 'int64_t', 'float64_t', '', '', False, True),
        ('float32', 'float32', 'float32_t', 'float32_t', '', '', True, True),
        ('float32', 'float64', 'float32_t', 'float64_t', '', '', False, True),
        ('float64', 'float64', 'float64_t', 'float64_t', '', '', True, True),
        ('object', 'object', 'object', 'object', '', '', False, False),
    ]

    output = StringIO()
    for (name, dest, c_type_in, c_type_out,
         preval, postval, can_copy, nogil) in function_list:

        if exclude is not None and exclude in name:
            continue

        if nogil:
            nogil = "with nogil:"
            tab = '    '
        else:
            nogil = ''
            tab = ''

        func = template % {'name': name, 'dest': dest,
                           'c_type_in': c_type_in, 'c_type_out': c_type_out,
                           'preval': preval, 'postval': postval,
                           'can_copy': 'True' if can_copy else 'False',
                           'nogil' : nogil,
                           'tab' : tab }
        output.write(func)
        output.write("\n")
    return output.getvalue()
dataset/ETHPy150Open pydata/pandas/pandas/src/generate_code.py/generate_take_template/swapped operands of `in`