<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def find_closest_in_list(number, array, direction="both", strictly=False):
 """ Find the closest number in the array from x. Parameters number : float The number. array : list The list to look in. direction : str "both" for smaller or greater, "greater" for only greater numbers and "smaller" for the closest smaller. strictly : bool False for stricly superior or inferior or True for including equal. Returns closest : int The closest number in the array. Example Notes *Authors* - `Dominique Makowski <https://dominiquemakowski.github.io/>`_ """

    if direction == "both":
        closest = min(array, key=lambda x:abs(x-number))
    if direction == "smaller":
        if strictly is True:
            closest = max(x for x in array if x < number)
        else:
            closest = max(x for x in array if x <= number)
    if direction == "greater":
        if strictly is True:
            closest = min(filter(lambda x: x > number, array))
        else:
            closest = min(filter(lambda x: x >= number, array))

    return(closest)