<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def first(thing, n=0):
 """ get the first element of a list 1 [1, 2, 3] [1, 2, 3, 4, 5] {'key': 'value'} 'a' '' [''] '' False '' """

    n = to_int(n)
    if is_list(thing) or is_tuple(thing):
        if len(thing) == 0:
            return None
        if n > 0:
            return thing[0:n]
        return thing[0]
    return thing