<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def timecds2datetime(tcds):
 """Method for converting time_cds-variables to datetime-objectsself. Works both with a dictionary and a numpy record_array. """


    days = int(tcds['Days'])
    milliseconds = int(tcds['Milliseconds'])
    try:
        microseconds = int(tcds['Microseconds'])
    except (KeyError, ValueError):
        microseconds = 0
    try:
        microseconds += int(tcds['Nanoseconds']) / 1000.
    except (KeyError, ValueError):
        pass

    reference = datetime(1958, 1, 1)
    delta = timedelta(days=days, milliseconds=milliseconds,
                      microseconds=microseconds)

    return reference + delta