(since)
Take a 'since' value and normalise it to be a redis message ID
Take a 'since' value and normalise it to be a redis message ID
Take a since value and normalise it to be a redis message ID
def normalise_since_value(since):
    """Take a 'since' value and normalise it to be a redis message ID"""
    if not since:
        return "$"
    elif hasattr(since, "timestamp"):  # datetime
        # Create message ID: "<milliseconds-timestamp>-<sequence-number>"
        return f"{round(since.timestamp() * 1000):013d}-0"
    else:
        return since
def normalise_since_value ( since ) : if not since : return "$" elif hasattr ( since , "timestamp" ) : # datetime # Create message ID: "<milliseconds-timestamp>-<sequence-number>" return f"{round(since.timestamp() * 1000):013d}-0" else : return since