<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _get_timestamp(dirname_full, remove):
 """ Get the timestamp from the timestamp file. Optionally mark it for removal if we're going to write another one. """

    record_filename = os.path.join(dirname_full, RECORD_FILENAME)

    if not os.path.exists(record_filename):
        return None

    mtime = os.stat(record_filename).st_mtime
    mtime_str = datetime.fromtimestamp(mtime)
    print('Found timestamp {}:{}'.format(dirname_full, mtime_str))
    if Settings.record_timestamp and remove:
        OLD_TIMESTAMPS.add(record_filename)
    return mtime