<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_permissions_mode(permission_octal, name):
 """Retrieve a user name group permissions bitwise code."""

    read = PERMISSIONS[name]['read']
    write = PERMISSIONS[name]['write']
    execute = PERMISSIONS[name]['execute']

    # Read
    if permission_octal == 4:
        return read & ~write & ~execute

    # Write
    elif permission_octal == 2:
        return ~read & write & ~execute

    # Execute
    elif permission_octal == 1:
        return ~read & ~write & execute

    # Read & Write
    elif permission_octal == 6:
        return read & write & ~execute

    # Read & Execute
    elif permission_octal == 5:
        return read & ~write & execute

    # Write & Execute
    elif permission_octal == 3:
        return ~read & write & execute

    # Read, Write & Execute
    elif permission_octal == 7:
        return read & write & execute

    # No read, write or execute by default
    else:
        return ~read & ~write & ~execute