<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def take_at_most_n_seconds(time_s, func, *args, **kwargs):
 """A function that returns whether a function call took less than time_s. NOTE: The function call is not killed and will run indefinitely if hung. Args: time_s: Maximum amount of time to take. func: Function to call. *args: Arguments to call the function with. **kwargs: Keyword arguments to call the function with. Returns: True if the function finished in less than time_s seconds. """

  thread = threading.Thread(target=func, args=args, kwargs=kwargs)
  thread.start()
  thread.join(time_s)
  if thread.is_alive():
    return False
  return True