import math
import logging


def __closest_power_of_two(number):
    """Closest n^2.

    Example:
        >>> __closest_power_of_two(67)
        64
        >>> __closest_power_of_two(64)
        64

    Returns:
        Integer: Closest power of two.
    """
    try:
        return int(math.pow(2, int(math.log(number, 2) + 0.5)))
    except IOError as err:
        logging.error(err)
    except ValueError as err:
        logging.error(err)
    except TypeError as err:
        logging.error(err)