from typing import Optional


def human_readable_size(value: float) -> Optional[str]:
    """Convert bytes to human readable size.

    Args:
        value: Value in bytes.

    Returns:
        Humand readable size.

    Reference:
        https://github.com/aws/aws-cli

    Examples:
        >>> human_readable_size(10)
        '10 B'
        >>> human_readable_size(1024)
        '1.0 K'
        >>> human_readable_size(1048576)
        '1.0 M'
        >>> human_readable_size(11445484)
        '10.9 M'
    """
    HUMANIZE_SUFFIXES = ("K", "M", "G", "T", "P", "E")
    base = 1024
    bytes_int = float(value)

    if bytes_int < base:
        return "%d B" % bytes_int

    for i, suffix in enumerate(HUMANIZE_SUFFIXES):
        unit = base ** (i + 2)
        if round((bytes_int / unit) * base) < base:
            return "%.1f %s" % ((base * bytes_int / unit), suffix)