def blank_to_none(value, default=None):
    """Converts an empty string or byte object to None

    If value is an empty string or an empty byte array None is returned
    else value is returned

    Args:
        value(str/bytes): object to be converted

    """
    if isinstance(value, str) and value == '':
        return default

    return value