def get_oct_digits(mode):
    """
    Separate a given integer into its three components
    """
    if not 0 <= mode <= 511:
        raise ValueError('expected a value between 000 and 777')
    return {'u': (mode & 448) >> 6, 'g': (mode & 56) >> 3, 'o': mode & 7}
