def _splpy_convert_tuple(attributes):
def _to_tuples(tuple_):<EOL><INDENT>if isinstance(tuple_, tuple):<EOL><INDENT>return tuple_<EOL><DEDENT>if isinstance(tuple_, dict):<EOL><INDENT>return tuple(tuple_.get(name, None) for name in attributes)<EOL><DEDENT>if isinstance(tuple_, list):<EOL><INDENT>lt = list()<EOL>for ev in tuple_:<EOL><INDENT>if isinstance(ev, dict):<EOL><INDENT>ev = tuple(ev.get(name, None) for name in attributes)<EOL><DEDENT>lt.append(ev)<EOL><DEDENT>return lt<EOL><DEDENT>return tuple_<EOL><DEDENT>return _to_tuples<EOL>
Create a function that converts tuples to
    be submitted as dict objects into Python tuples
    with the value by position.
    Return function handles tuple,dict,list[tuple|dict|None],None