<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def write_raw_file(secret, dest):
 """Writes an actual secret out to a file"""

    secret_file = None
    secret_filename = abspath(dest)
    if sys.version_info >= (3, 0):
        if not isinstance(secret, str):
            secret_file = open(secret_filename, 'wb')

    if not secret_file:
        secret_file = open(secret_filename, 'w')

    secret_file.write(secret)
    secret_file.close()
    os.chmod(secret_filename, 0o600)