<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _index_idiom(el_name, index, alt=None):
 """ Generate string where `el_name` is indexed by `index` if there are enough items or `alt` is returned. Args: el_name (str):
 Name of the `container` which is indexed. index (int):
 Index of the item you want to obtain from container. alt (whatever, default None):
 Alternative value. Returns: str: Python code. Live example:: # pick element from list xex = xex[0] if xex else None # pick element from list xex = xex[1] if len(xex) - 1 >= 1 else 'something' """

    el_index = "%s[%d]" % (el_name, index)

    if index == 0:
        cond = "%s" % el_name
    else:
        cond = "len(%s) - 1 >= %d" % (el_name, index)

    output = IND + "# pick element from list\n"

    return output + IND + "%s = %s if %s else %s\n\n" % (
        el_name,
        el_index,
        cond,
        repr(alt)
    )