<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def remove_profile(name, s3=False):
 """ Removes a profile from your config """

    user = os.path.expanduser("~")
    if s3:
        f = os.path.join(user, S3_PROFILE_ID + name)
    else:
        f = os.path.join(user, DBPY_PROFILE_ID + name)
    try:
        try:
            open(f)
        except:
            raise Exception("Profile '{0}' does not exist. Could not find file {1}".format(name, f))
        os.remove(f)
    except Exception as e:
        raise Exception("Could not remove profile {0}! Excpetion: {1}".format(name, e))