<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def any_to_datetime(self, time_input, tz=None):
 """Return datetime object from multiple formats. Formats: #. Human Input (e.g 30 days ago, last friday) #. ISO 8601 (e.g. 2017-11-08T16:52:42Z) #. Loose Date format (e.g. 2017 12 25) #. Unix Time/Posix Time/Epoch Time (e.g. 1510686617 or 1510686617.298753) Args: time_input (string):
 The time input string (see formats above). tz (string):
 The time zone for the returned data. Returns: (datetime.datetime):
 Python datetime.datetime object. """

        # handle timestamp (e.g. 1510686617 or 1510686617.298753)
        dt_value = self.unix_time_to_datetime(time_input, tz)

        # handle ISO or other formatted date (e.g. 2017-11-08T16:52:42Z,
        # 2017-11-08T16:52:42.400306+00:00)
        if dt_value is None:
            dt_value = self.date_to_datetime(time_input, tz)

        # handle human readable relative time (e.g. 30 days ago, last friday)
        if dt_value is None:
            dt_value = self.human_date_to_datetime(time_input, tz)

        # if all attempt to convert fail raise an error
        if dt_value is None:
            raise RuntimeError('Could not format input ({}) to datetime string.'.format(time_input))

        return dt_value